|
|
@ -193,7 +193,7 @@ |
|
|
|
let skulist = await this.searchGoodBySku("10000012") |
|
|
|
this.shopList = this.shopList.concat(skulist) |
|
|
|
}, |
|
|
|
clickToPay() { |
|
|
|
async clickToPay() { |
|
|
|
// 将shopList进行精简为 { |
|
|
|
// "id": 57, |
|
|
|
// "name": "光明纯牛奶", |
|
|
@ -224,7 +224,57 @@ |
|
|
|
if(this.shopListTotalPrice<=0){ |
|
|
|
return util.showNone("请先添加商品") |
|
|
|
} |
|
|
|
util.routeTo(`/pages/pay/index?query=${JSON.stringify(_query)}`, 'rL'); |
|
|
|
|
|
|
|
util.showLoad() |
|
|
|
await this.makeOrder(_query).then((order_res)=>{ |
|
|
|
util.hideLoad() |
|
|
|
if(order_res.order_no){ |
|
|
|
_query["order_no"]=order_res.order_no |
|
|
|
util.routeTo(`/pages/pay/index?query=${JSON.stringify(_query)}`, 'rL'); |
|
|
|
}else{ |
|
|
|
util.showNone(order_res.message||order_res.msg||"error:生成订单失败") |
|
|
|
} |
|
|
|
console.log(order_res) |
|
|
|
}).catch((err)=>{ |
|
|
|
util.hideLoad() |
|
|
|
console.log(err) |
|
|
|
util.showNone(err) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
async makeOrder(res){ |
|
|
|
let {brand_id,token} = getApp().globalData.accountInfo |
|
|
|
let store_id = uni.getStorageSync("stadiumInfo").id||"" |
|
|
|
|
|
|
|
let _dataQuery = { |
|
|
|
goods_data:res.shopList, |
|
|
|
amount:res.shopListTotalPrice, |
|
|
|
} |
|
|
|
let {goods_data,amount} = _dataQuery |
|
|
|
brand_id = parseInt(brand_id) |
|
|
|
amount = parseFloat(amount) |
|
|
|
|
|
|
|
let urlParams = { |
|
|
|
store_id,brand_id,token,amount, |
|
|
|
"goods_data": goods_data, |
|
|
|
"pay_type": 7, |
|
|
|
"other_pay_type":"付款码支付", |
|
|
|
"card_no": "", |
|
|
|
"mark": "" |
|
|
|
} |
|
|
|
console.log("makeOrder urlParams:", urlParams) |
|
|
|
|
|
|
|
return ox.post({ |
|
|
|
url: API.makeOrder, |
|
|
|
data: urlParams, |
|
|
|
isDefaultGet: true, |
|
|
|
failMsg: '操作失败!' |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
util.hideLoad(); |
|
|
|
console.log("makeOrder suc: ", res) |
|
|
|
return res |
|
|
|
}) |
|
|
|
}, |
|
|
|
clickToUse() { |
|
|
|
util.routeTo(`/pages/login/success`, 'nT'); |
|
|
|