This commit is contained in:
zhangmanman
2021-08-13 13:30:35 +08:00
parent 540d76bdb8
commit 8f7cc986c2
46 changed files with 1582 additions and 1056 deletions

View File

@@ -35,7 +35,8 @@ Page({
payWay :[
{value: 0, name: "微信支付"},
{value: 1, name: "沃钱包支付"}
]
],
orderType : '' //订单类型
},
/**
@@ -47,17 +48,19 @@ Page({
typeWeb : options.type,
getType : options.getType,
openid : options.openid || '',
parentId : options.parentid || ''
orderType : options.orderType
})
// 获取详情
this.rightsInfo();
console.log(getApp().globalData.shareObj)
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
onShow() {
// 获取详情
this.rightsInfo();
},
/**
* 详情
@@ -259,13 +262,24 @@ Page({
isdeliver: this.data.detail.def_get
})
}
let right_id = this.data.detail.right_id,
address_id = this.data.address.id,
is_deliver = this.data.isdeliver,
qty = this.data.num,
parent_id = this.data.parentId
newParent = '',
shareObj = getApp().globalData.shareObj
if(shareObj.type == 'shareStored' && shareObj.type == this.data.orderType){
newParent = shareObj.userId
}
if(shareObj.type == 'shareGoods' && shareObj.goodsId == right_id){
console.log(22222)
newParent = shareObj.userId
}
wx.$api.index.rightStore(right_id, address_id, is_deliver, qty, parent_id).then(res=>{
wx.$api.index.rightStore(right_id, address_id, is_deliver, qty, newParent).then(res=>{
if(res.data.canPay == false) {
wx.showToast({
title : '支付成功',
@@ -287,6 +301,24 @@ Page({
rightsTap: true
})
}else {
// 储值
if(shareObj.type == 'shareStored'){
getApp().globalData.shareObj = {
type : '',
goodsId : '',
userId : ''
}
}
// 商品
if(shareObj.type == 'shareGoods' && shareObj.goodsId == right_id){
getApp().globalData.shareObj = {
type : '',
goodsId : '',
userId : ''
}
}
// 跳转收银台
wx.navigateTo({
url: "/pages/cashier/cashier?trade_no=" + res.data.trade_no + "&amount=" + this.data.amount + "&is_deliver=" + is_deliver + "&pay_type=rightsPay"