页面调整

This commit is contained in:
唐明明
2021-11-10 19:24:56 +08:00
parent f543bed848
commit d3ca6422a0
5 changed files with 46 additions and 24 deletions

View File

@@ -96,18 +96,22 @@
};
},
onShow() {
marketsInfo(this.$Route.query.marketId).then(res =>{
this.info = res
this.price = res.price
this.loding = false
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
this.getInfo()
},
methods:{
// 获取数据信息
getInfo(){
marketsInfo(this.$Route.query.marketId).then(res =>{
this.info = res
this.price = res.price
this.loding = false
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 查看锚定产品
onGoods(){
this.$Router.push({name: 'marketGoods', params: { id: this.info.goods.goods_id }})
@@ -151,19 +155,34 @@
switch (this.payValue){
case 'wechat':
let payConfigObj = JSON.parse(res)
cashierPay.pay('wxpay', payConfigObj, 'market')
cashierPay.pay('wxpay', payConfigObj, 'market').then(() => {
this.paySuccess()
})
break
case 'alipay':
cashierPay.pay('alipay', res, 'market')
cashierPay.pay('alipay', res, 'market').then(() => {
this.paySuccess()
})
break
}
}).catch(err => {
console.log(err)
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 支付结果
paySuccess(){
this.$refs.payLay.close()
uni.showModal({
title : '支付成功',
content : '购买成功,可在节点中心我的权证中查看',
showCancel : false,
success : () => {
this.$Router.back()
}
})
}
}
}