支付宝 修改商品传值编码

This commit is contained in:
郑茂强 2019-03-15 16:48:59 +08:00
parent 5d0790e767
commit f0f8f82035
20 changed files with 110 additions and 107 deletions

View File

@ -21,12 +21,12 @@ class App extends Component {
pages: [
//'pages/index/index', // index页面
'pages/goodsPublish/goodsPublish',// 商品发布页面 ---------------------
'pages/home/home',//首页 ---------------------
'pages/login/login',//登入页面 ---------------------
'pages/shop/shop',//店铺页面 ---------------------
'pages/goods/goods',// 商品页面 ---------------------
'pages/goodsPublish/goodsPublish',// 商品发布页面 ---------------------
'pages/supplyDemandPublish/supplyDemandPublish',// 供求发布页面 ---------------------
'pages/mySupplyDemand/mySupplyDemand',// 我的供求列表页面 ---------------------
'pages/myGoodsEdit/myGoodsEdit',// 我的商品编辑页面 ---------------------

View File

@ -1,7 +1,6 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import { View, Text,Picker} from '@tarojs/components'
import { Picker } from 'taro-ui'
import './goodsTypeInteractionComp.scss'
import loginExpired from '../../util/loginExpired'

View File

@ -1,8 +1,6 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import { Picker } from 'taro-ui'
import { View, Text,Picker } from '@tarojs/components'
import './interactionComponent.scss'
import loginExpired from '../../util/loginExpired';

View File

@ -20,7 +20,7 @@ class ShopItem extends Component {
shopOnClickHanlder(){
let goodId=this.props.item.goods_id
Taro.navigateTo({
url: '/pages/goods/goods?id='+goodId
url: '/pages/goods/goods?id='+encodeURIComponent(goodId)
})
}
componentDidMount(){

View File

@ -1,7 +1,6 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import { View, Text,Picker } from '@tarojs/components'
import { Picker } from 'taro-ui'
import './shopTypeInteractionComp.scss'
import loginExpired from '../../util/loginExpired';
@ -52,9 +51,10 @@ class ShopTypeInteractionComp extends Component {
}
this.setState({
interactionMultiArray: this.interactionData(res.data.data),
initailMultiArray: this.initializedData(res.data.data),
initailMultiArray: this.initializedData(res.data.data)[0],
}, () => {
console.log('state',this.state.initailMultiArray,this.state.interactionMultiArray)
// this.passDataToParent(this.state.initailMultiArray)
//返回初始选项在 在商品编辑页面

View File

@ -1,6 +1,6 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image, Button } from '@tarojs/components'
import { AtInput, Picker, AtIcon, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import { View, Text, Image, Button,Picker } from '@tarojs/components'
import { AtInput, AtIcon, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'
import ScrollToTopComponent from '../../component/scrollToTopComponent/scrollToTopComponent'

View File

@ -1,7 +1,7 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image, Swiper, SwiperItem } from '@tarojs/components'
import { View, Text, Image, Swiper, SwiperItem,Picker } from '@tarojs/components'
import { AtTabs, AtTabsPane, AtSegmentedControl, AtIcon, Picker } from 'taro-ui'
import { AtIcon } from 'taro-ui'
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'
import LoginService from '../../util/LoginService'
@ -41,15 +41,19 @@ class Goods extends Component {
// 商品详情api
getGoodDescription() {
console.log('goods',this.$router.params.id)
let goodId=decodeURIComponent(this.$router.params.id)
Taro.request({
url: URL.GetShopItemDetail,
method: 'POST',
dataType: 'json',
data: {
goodsID: escape(this.$router.params.id).replace('+', '%2B'),
goodsID: goodId,
},
header: {
'content-type': 'application/x-www-form-urlencoded',
'content-type': 'application/x-www-form-urlencoded',
'Cookie': 'PFWSSS=' + getGlobalStorage('session_id'),
}
})

View File

@ -251,57 +251,57 @@ class GrabOrderPage extends Component {
<AtModalAction> <Button onClick={this.handleWindowModCancel.bind(this)}>取消</Button> <Button className='orange' onClick={this.handleWindowConfirm.bind(this)}></Button> </AtModalAction>
</AtModal>
let ButtonElement
if (localStoageUserId === this.state.userId && this.state.stateId === '1') {
ButtonElement = <View className='button-box'>
<View className='button' onClick={this.goMyNeedsPublishPage.bind(this)}>
<Button size='mini' className='button-green'>
<AtIcon value='add' size='12' color='white'></AtIcon>
新增</Button>
</View>
<View className='button' onClick={this.goToMyNeedsPage.bind(this)}>
<Button size='mini' className='button-orange'>
<AtIcon value='' size='12' color='white'></AtIcon>
我的需求</Button>
</View>
{/* <View className='button' onClick={this.goMyNeedEditPage.bind(this)}>
<Button size='mini' className='button-blue'>
<AtIcon value='settings' size='12' color='white'></AtIcon>
修改</Button>
</View>
// if (localStoageUserId === this.state.userId && this.state.stateId === '1') {
// ButtonElement = <View className='button-box'>
// <View className='button' onClick={this.goMyNeedsPublishPage.bind(this)}>
// <Button size='mini' className='button-green'>
// <AtIcon value='add' size='12' color='white'></AtIcon>
// 新增</Button>
// </View>
// <View className='button' onClick={this.goToMyNeedsPage.bind(this)}>
// <Button size='mini' className='button-orange'>
// <AtIcon value='' size='12' color='white'></AtIcon>
// 我的需求</Button>
// </View>
// {/* <View className='button' onClick={this.goMyNeedEditPage.bind(this)}>
// <Button size='mini' className='button-blue'>
// <AtIcon value='settings' size='12' color='white'></AtIcon>
// 修改</Button>
// </View>
<View className='button' onClick={this.deleteButton.bind(this)}>
<Button size='mini' className='button-dark-red'>
<AtIcon value='trash' size='12' color='white'></AtIcon>
删除</Button>
</View> */}
</View>
} else if (localStoageUserId === this.state.userId && this.state.stateId != '1') {
ButtonElement = <View className='button-box'>
<View className='button' onClick={this.goMyNeedsPublishPage.bind(this)}>
<Button size='mini' className='button-green'>
<AtIcon value='add' size='12' color='white'></AtIcon>
新增</Button>
</View>
<View className='button' onClick={this.goToMyNeedsPage.bind(this)}>
<Button size='mini' className='button-orange'>
<AtIcon value='' size='12' color='white'></AtIcon>
我的需求</Button>
</View>
</View>
} else if (this.state.stateId === '1') {
ButtonElement = <View className='button-box'><View className='button' onClick={this.grabButtonHandler.bind(this)}>
<Button size='mini' className='button-orange'>抢单</Button>
</View></View>
// <View className='button' onClick={this.deleteButton.bind(this)}>
// <Button size='mini' className='button-dark-red'>
// <AtIcon value='trash' size='12' color='white'></AtIcon>
// 删除</Button>
// </View> */}
// </View>
// } else if (localStoageUserId === this.state.userId && this.state.stateId != '1') {
// ButtonElement = <View className='button-box'>
// <View className='button' onClick={this.goMyNeedsPublishPage.bind(this)}>
// <Button size='mini' className='button-green'>
// <AtIcon value='add' size='12' color='white'></AtIcon>
// 新增</Button>
// </View>
// <View className='button' onClick={this.goToMyNeedsPage.bind(this)}>
// <Button size='mini' className='button-orange'>
// <AtIcon value='' size='12' color='white'></AtIcon>
// 我的需求</Button>
// </View>
// </View>
// } else if (this.state.stateId === '1') {
// ButtonElement = <View className='button-box'><View className='button' onClick={this.grabButtonHandler.bind(this)}>
// <Button size='mini' className='button-orange'>抢单</Button>
// </View></View>
} else if (this.state.stateId === '2') {
ButtonElement = <View className='button-box'><View className='button'>
<Button size='mini' className='button-orange blur'>{this.state.stateName}</Button>
</View></View>
} else if (this.state.stateId === '3') {
ButtonElement = <View className='button-box'><View className='button'>
<Button size='mini' className='button-orange blur'>{this.state.stateName}</Button>
</View></View>
}
// } else if (this.state.stateId === '2') {
// ButtonElement = <View className='button-box'><View className='button'>
// <Button size='mini' className='button-orange blur'>{this.state.stateName}</Button>
// </View></View>
// } else if (this.state.stateId === '3') {
// ButtonElement = <View className='button-box'><View className='button'>
// <Button size='mini' className='button-orange blur'>{this.state.stateName}</Button>
// </View></View>
// }

View File

@ -331,9 +331,7 @@ class Home extends Component {
}
componentWillMount() {
Taro.navigateTo({
url: '/pages/goods/goods?id=4a0eQpU8YI68yN2ZTc5rchTiEzCAaaiK0UEeWzvDPE0bVw'
})
}
componentWillUnmount() { }

View File

@ -1,6 +1,6 @@
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { AtGrid, Swiper, SwiperItem } from 'taro-ui'
import { View , Swiper, SwiperItem } from '@tarojs/components'
import { AtGrid} from 'taro-ui'
import URL from '../../../serviceAPI.config'
import './mainCateSlider.scss'

View File

@ -1,6 +1,6 @@
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { AtGrid, Swiper, SwiperItem } from 'taro-ui'
import { View , Swiper, SwiperItem} from '@tarojs/components'
import { AtGrid } from 'taro-ui'
import URL from '../../../serviceAPI.config'
import './subCateSlider.scss'

View File

@ -1,7 +1,7 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Text, Button, Input } from '@tarojs/components'
import { AtInput, AtImagePicker, AtTextarea, Picker, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import { View, Text, Button, Input,Picker } from '@tarojs/components'
import { AtInput, AtImagePicker, AtTextarea, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import PictureUploadComponent from '../../component/pictureUploadComponent/pictureUploadComponent'
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'
import URL from '../../serviceAPI.config'

View File

@ -1,6 +1,6 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Button, MovableArea, MovableView, CheckboxGroup, Checkbox } from '@tarojs/components'
import { AtInput, Text, AtIcon, Picker, Image, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import { View, Button, MovableArea, MovableView, CheckboxGroup, Checkbox ,Picker, Image , Text} from '@tarojs/components'
import { AtInput, AtIcon, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'
import ScrollToTopComponent from '../../component/scrollToTopComponent/scrollToTopComponent'
@ -143,13 +143,15 @@ class MyGoodList extends Component {
'X-Requested-With': 'XMLHttpRequest'
}
}).then(res => {
const data = JSON.parse(res.data)
Taro.hideLoading()
const data = res.data
if (data.err_code === 88888) {
loginExpired(data)
} else if (data.err_code != 10) {
console.log('我的商品列表', JSON.parse(res.data))
console.log(res.data)
Taro.hideLoading()
if (data.goodsCount != '0' && data.goods.length) {
data.goods.forEach(item => {
item.checked = false
@ -555,6 +557,7 @@ class MyGoodList extends Component {
}
goToGoodspage(e) {
const goodId = onClickValueService(e)
Taro.navigateTo({
url: '/pages/goods/goods?id=' + goodId
})

View File

@ -1,6 +1,6 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import { AtInput, AtImagePicker, AtTextarea, Button, } from 'taro-ui'
import { View, Text , Button} from '@tarojs/components'
import { AtInput, AtImagePicker, AtTextarea, } from 'taro-ui'
import ShopTypeInteractionComp from '../../component/shopTypeInteractionComp/shopTypeInteractionComp'
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'

View File

@ -1,7 +1,7 @@
//myNeeds
import Taro, { Component } from '@tarojs/taro'
import { View, Text, Button } from '@tarojs/components'
import { AtInput, Picker, AtIcon, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import { View, Text, Button, Picker, Input } from '@tarojs/components'
import { AtInput, AtIcon, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import URL from '../../serviceAPI.config'
import ScrollToTopComponent from '../../component/scrollToTopComponent/scrollToTopComponent'
import InteractionComponent from '../../component/interactionComponent/interactionComponent'
@ -187,7 +187,7 @@ class MyNeeds extends Component {
// 搜索按钮
onSearchButtonHandler() {
showLoading({ title: '加载中' }).then(() => {
showLoading({ title: '加载中' }).then(() => {
this.setState({ currentPage: 1, loadMorePageIndex: 1 }, () => {
this.getMyNeedsList({
curr_page: this.state.currentPage,
@ -285,15 +285,15 @@ class MyNeeds extends Component {
componentDidMount() {
isUserLogin().then(res=>{
isUserLogin().then(res => {
return res
}).then(res=>{
showLoading({
title: '加载中'
}).then(res => {
showLoading({
title: '加载中'
})
this.getMyNeedsList({})
})
this.getMyNeedsList({})
})
}
componentWillReceiveProps(nextProps) {
@ -318,7 +318,7 @@ class MyNeeds extends Component {
}
// 底部加载
onReachBottom() {
showLoading({
showLoading({
title: '加载中'
})
this.setState({ isAddToList: true, loadMorePageIndex: this.state.loadMorePageIndex + 1 }, () => {
@ -386,6 +386,7 @@ class MyNeeds extends Component {
title='需求标题:'
placeholder='需求标题·'
type='text'
border={false}
value={this.state.title}
onChange={this.titleChange.bind(this)}
/>

View File

@ -1,7 +1,7 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Text, Button, Input } from '@tarojs/components'
import { AtInput, AtTextarea, Picker, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import { View, Text, Button, Input,Picker } from '@tarojs/components'
import { AtInput, AtTextarea, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import InteractionComponent from '../../component/interactionComponent/interactionComponent'
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'

View File

@ -1,7 +1,7 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Text, Button, Input, } from '@tarojs/components'
import { AtInput, AtTextarea, Picker } from 'taro-ui'
import { View, Text, Button, Input, Picker } from '@tarojs/components'
import { AtInput, AtTextarea} from 'taro-ui'
import PictureUploadComponent from '../../component/pictureUploadComponent/pictureUploadComponent'

View File

@ -1,6 +1,6 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Text, Button, MovableArea, MovableView } from '@tarojs/components'
import { AtInput, Picker, AtIcon, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import { View, Text, Button, MovableArea, MovableView ,Picker } from '@tarojs/components'
import { AtInput, AtIcon, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import URL from '../../serviceAPI.config'
import ScrollToTopComponent from '../../component/scrollToTopComponent/scrollToTopComponent'

View File

@ -1,7 +1,7 @@
import Taro, { Component } from '@tarojs/taro'
import { View, Text, Button, Input } from '@tarojs/components'
import { AtInput, AtImagePicker, AtTextarea, Picker } from 'taro-ui'
import { View, Text, Button, Input , Picker} from '@tarojs/components'
import { AtInput, AtImagePicker, AtTextarea } from 'taro-ui'
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'

View File

@ -1,13 +1,13 @@
export default function onClickValueService(e) {
let value
export default function onClickValueService(value) {
if (process.env.TARO_ENV === 'alipay') {
value = e.currentTarget.dataset.eOnTapAA
return value
} else if (process.env.TARO_ENV === 'weapp') {
value = e.currentTarget.dataset.eTapAA
return value
}
value=typeof(value)==='string'?encodeURIComponent(value):value
return value
}