推广小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

55 lines
863 B

export default {
data() {
return {
}
},
computed: {
},
methods: {
// 立即支付
toPayOrder(item){
let api = ''
if([0, 1].includes(item.shopState)){
api = 'createOrderTwo'
}else{
api = 'createSumOrderAgain'
}
this.$api(api, {
orderId : item.id,
addressId : item.addressId
}, res => {
if(res.code == 200){
uni.requestPaymentWxPay(res)
.then(res => {
uni.showToast({
title: '支付成功',
icon: 'none'
})
this.getData()
}).catch(n => {
this.getData()
})
}
})
},
// 确认收货
confirmOrder(item){
uni.showModal({
title: '您收到货了吗?',
success : e => {
if(e.confirm){
this.$api('confirmOrder', {
orderId : item.id,
}, res => {
this.getData()
})
}
}
})
},
}
}