Browse Source

Merge branch 'dev'

master
赵明涛 7 months ago
parent
commit
0b4d1290dd
  1. 54
      uniapp_project_code/src/pages/index/index.vue
  2. 10
      uniapp_project_code/src/pages/pay/index.vue

54
uniapp_project_code/src/pages/index/index.vue

@ -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');

10
uniapp_project_code/src/pages/pay/index.vue

@ -82,7 +82,7 @@
async onReady() {
await this.setPageHeight()
// this.testAcceptScanCode()
this.preMakeOrder()
// this.preMakeOrder() //0627 , order_id,
},
onUnload(){
this.clearMakeOrder()
@ -111,10 +111,11 @@
let _data = {
goods_data:res.shopList,
amount:res.shopListTotalPrice,
order_no :res.order_no
}
console.log("setPayData2:",_data)
this.dataQuery = _data
// this.makeInfo.order_no = res.order_no
},
// 101112131415WECHAT_MICROPAY,28ALI_BARCODEPAY
getPayType(code){
@ -157,9 +158,8 @@
// pay_code,pay_type
// })
// })
let order_no = this.makeInfo?.order_no||""
if(!order_no)return util.showNone("支付失败,请重新下单!")
let order_no = this.dataQuery?.order_no||""
if(!order_no)return util.showNone("支付失败,请重新下单!01")
await this.payOrder({
"order_no":order_no,
pay_code,pay_type

Loading…
Cancel
Save