weapp测试结束
This commit is contained in:
parent
636304af73
commit
870fc47323
@ -8,16 +8,9 @@ module.exports = {
|
||||
|
||||
h5: {
|
||||
esnextModules: ['taro-ui'],
|
||||
// devServer: {
|
||||
// proxy: {
|
||||
// '/api': 'http://192.168.1.230/Shop-ajaxStore',
|
||||
// changeOrigin: true,
|
||||
// headers: {
|
||||
// // 后端要校验请求源,那改下 host 或者 origin 不就美滋滋了?
|
||||
// Host: '192.168.1.230',
|
||||
// Origin: '192.168.1.230'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
devServer:{
|
||||
host: "192.168.1.120",
|
||||
port:80
|
||||
}
|
||||
}
|
||||
}
|
@ -113,7 +113,7 @@ class GoodsPublish extends Component {
|
||||
if (this.state.isPublish) {
|
||||
// 导航到编辑页面
|
||||
Taro.redirectTo({
|
||||
url: '/pages/myGoodsList/myGoodsList'
|
||||
url: '/pages/myGoodList/myGoodList'
|
||||
})
|
||||
} else if (this.state.isPublishAndAdd) {
|
||||
// 导航到发布页面
|
||||
@ -299,6 +299,7 @@ class GoodsPublish extends Component {
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
// console.log(this.props, nextProps)
|
||||
|
@ -17,6 +17,8 @@ $themeColor: #FF7142;
|
||||
}
|
||||
}
|
||||
.item-title{
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
font-size: 40px;
|
||||
min-height: 21px;
|
||||
clear: both;
|
||||
|
@ -1,45 +1,40 @@
|
||||
import Taro, { Component } from '@tarojs/taro'
|
||||
import { View , Swiper, SwiperItem} from '@tarojs/components'
|
||||
import { AtGrid } from 'taro-ui'
|
||||
import URL from '../../../serviceAPI.config'
|
||||
import { View, ScrollView } from '@tarojs/components'
|
||||
import './subCateSlider.scss'
|
||||
|
||||
|
||||
class SubCateSlider extends Component {
|
||||
passDataToParent(e) {
|
||||
|
||||
this.props.onClickChildCate(e)
|
||||
}
|
||||
|
||||
passDataToParent(e) {
|
||||
render() {
|
||||
const { subCateList } = this.props
|
||||
const subCateElementsArray = subCateList.map((item, index) => {
|
||||
return <View key={index} onClick={this.passDataToParent.bind(this, item)} className='view-item'>
|
||||
<View className='text'>{item.class_name}</View>
|
||||
</View>
|
||||
})
|
||||
|
||||
this.props.onClickChildCate(e)
|
||||
}
|
||||
return (
|
||||
|
||||
render() {
|
||||
const { subCateList } = this.props
|
||||
const subCateElementsArray = subCateList.map((item, index) => {
|
||||
return <View key={index} onClick={this.passDataToParent.bind(this, item)} className='view-item'>
|
||||
<View className='text'>{item.class_name}</View>
|
||||
</View>
|
||||
})
|
||||
<ScrollView
|
||||
className='scroll-view'
|
||||
scrollX
|
||||
scrollWithAnimation
|
||||
scrollTop='0'
|
||||
lowerThreshold='20'
|
||||
upperThreshold='20'
|
||||
style='white-space: nowrap;'
|
||||
>
|
||||
|
||||
return (
|
||||
{subCateElementsArray}
|
||||
|
||||
<ScrollView
|
||||
</ScrollView>
|
||||
|
||||
className='scroll-view'
|
||||
scrollX
|
||||
scrollWithAnimation
|
||||
scrollTop='0'
|
||||
lowerThreshold='20'
|
||||
upperThreshold='20'
|
||||
style='white-space: nowrap;'
|
||||
>
|
||||
|
||||
{subCateElementsArray}
|
||||
|
||||
</ScrollView>
|
||||
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default SubCateSlider
|
||||
|
@ -2,10 +2,12 @@
|
||||
height:100%;
|
||||
padding:0px 0px;
|
||||
.view-item{
|
||||
font-size: 25px;
|
||||
width:150px;
|
||||
display:inline-block;
|
||||
text-align:center;
|
||||
padding-bottom: 10px;
|
||||
border-bottom:2px solid #F2F2F2;
|
||||
|
||||
}
|
||||
}
|
@ -110,7 +110,7 @@ class MyNeedsEdit extends Component {
|
||||
needsStateSelected: needsState,
|
||||
initialImageURL: imageFile,
|
||||
initialImagesInfo: res.data.sdInfo.file_path,
|
||||
ImageURL: imageFile,
|
||||
pickerImageUrl: imageFile,
|
||||
ImagesInfo: res.data.sdInfo.file_path,
|
||||
})
|
||||
|
||||
@ -301,6 +301,51 @@ class MyNeedsEdit extends Component {
|
||||
})
|
||||
}
|
||||
}
|
||||
// 上传图片
|
||||
onChangeImg(files, operationType, index) {
|
||||
const that = this
|
||||
if (operationType === 'add') {
|
||||
Taro.uploadFile({
|
||||
url: URL.UploadDSPorductImage,
|
||||
filePath: files[files.length - 1].url,
|
||||
name: 'file',
|
||||
header: {
|
||||
'content-type': 'multipart/form-data',
|
||||
'Cookie': 'PFWSSS=' + getGlobalStorage('session_id'),
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
},
|
||||
success(response) {
|
||||
const data = JSON.parse(response.data)
|
||||
const imagePath = URL.Base + data.file_path
|
||||
const newPickerImageUrl = that.state.pickerImageUrl.concat({ url: imagePath })
|
||||
const newImageInfo = that.state.ImagesInfo.concat(data)
|
||||
that.setState({
|
||||
pickerImageUrl: newPickerImageUrl,
|
||||
ImagesInfo: newImageInfo
|
||||
})
|
||||
Taro.showToast({
|
||||
title: '上传成功',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
if (operationType === 'remove') {
|
||||
this.state.ImagesInfo.splice(index, 1) // 删除显示的图片
|
||||
this.state.pickerImageUrl.splice(index, 1)// 删除图片param
|
||||
that.setState({
|
||||
pockerImageUrl: this.state.pickerImageUrl,
|
||||
ImagesInfo: this.state.ImagesInfo,
|
||||
})
|
||||
Taro.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 从图片子组件获取信息
|
||||
getImageDetails(value) {
|
||||
this.setState({
|
||||
|
@ -147,6 +147,7 @@ class MySupplyDemand extends Component {
|
||||
Taro.showToast({
|
||||
title: '删除成功'
|
||||
}).then(() => {
|
||||
Taro.showLoading()
|
||||
this.getMySupplyDemand({})
|
||||
})
|
||||
|
||||
@ -478,8 +479,10 @@ class MySupplyDemand extends Component {
|
||||
<CopyrightComponent></CopyrightComponent>
|
||||
|
||||
</View>
|
||||
|
||||
|
||||
<MovableView className='movable-point' x={this.state.screenWidth} y={this.state.screenHeight} style='opacity:0.3' direction='all' >
|
||||
<View onClick={this.goToCenterPage.bind(this)}> 个人中心</View>
|
||||
<View className='movable-point' onClick={this.goToCenterPage.bind(this)}> 个人中心</View>
|
||||
|
||||
</MovableView>
|
||||
</MovableArea>
|
||||
|
@ -86,7 +86,6 @@ class SupplyDemand extends Component {
|
||||
icon: res.data.err_msg == 'success' ? 'success' : 'none',
|
||||
duration: 1000
|
||||
}).then(() => {
|
||||
console.log('this.state.isPublishAndNew', this.state.isPublishAndNew)
|
||||
setTimeout(() => {
|
||||
if (this.state.isPublishAndNew) {
|
||||
Taro.navigateTo({
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
//const LOCALURL = "http://192.168.1.230/"
|
||||
const LOCALURL = "https://www.ihome6.com/"
|
||||
const LOCALURL = "http://192.168.1.230/"
|
||||
//const LOCALURL = "https://www.ihome6.com/"
|
||||
|
||||
const URL = {
|
||||
Base: LOCALURL,
|
||||
|
Loading…
Reference in New Issue
Block a user