媳妇支付订单余额支付问题
This commit is contained in:
@@ -183,12 +183,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toPay() {
|
function toPay() {
|
||||||
|
const userId=orderDetail.info.userId||''
|
||||||
go.to('PAGES_ORDER_PAY', {
|
go.to('PAGES_ORDER_PAY', {
|
||||||
tableId: options.tableId|| orderDetail.info.tableId,
|
tableId: options.tableId|| orderDetail.info.tableId,
|
||||||
tableName: options.name,
|
tableName: options.name,
|
||||||
masterId: options.masterId,
|
masterId: options.masterId,
|
||||||
orderId: orderDetail.info.id,
|
orderId: orderDetail.info.id,
|
||||||
discount: 1
|
discount: 1,
|
||||||
|
userId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
order.setVal('hasAjax',true)
|
order.setVal('hasAjax',true)
|
||||||
}
|
}
|
||||||
onPullDownRefresh(()=>{
|
onPullDownRefresh(()=>{
|
||||||
pageData.order.query.page=0
|
order.setQuery('page',0)
|
||||||
init()
|
init()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<my-tabs :list="pays.list" v-model="pays.selIndex"></my-tabs>
|
<my-tabs :list="pays.list" v-model="pays.selIndex"></my-tabs>
|
||||||
<template v-if="pays.selIndex==0">
|
<template v-if="pays.selIndex==0">
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="item" @click="changePayType(index)" v-for="(item,index) in pays.payTypes.list"
|
<view class="item" @click="changePayType(index,item)" v-for="(item,index) in pays.payTypes.list"
|
||||||
:key="index">
|
:key="index">
|
||||||
<view class="u-flex u-row-between u-p-t-30 u-p-b-30 border-bottom">
|
<view class="u-flex u-row-between u-p-t-30 u-p-b-30 border-bottom">
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
@@ -45,11 +45,11 @@
|
|||||||
<text class="u-m-l-10">{{item.payName}}</text>
|
<text class="u-m-l-10">{{item.payName}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex color-999 u-font-24">
|
<view class="u-flex color-999 u-font-24">
|
||||||
<!-- <view class="u-m-r-20">
|
<view class="u-m-r-20" v-if="item.payType=='vipPay'">
|
||||||
<text>余额:</text>
|
<text>余额:</text>
|
||||||
<text>¥0.00</text>
|
<text>¥{{user.amount||'0'}}</text>
|
||||||
</view> -->
|
</view>
|
||||||
<my-radio @click="changePayType(index)"
|
<my-radio @click="changePayType(index,item)"
|
||||||
:modelValue="index==pays.payTypes.selIndex">
|
:modelValue="index==pays.payTypes.selIndex">
|
||||||
</my-radio>
|
</my-radio>
|
||||||
</view>
|
</view>
|
||||||
@@ -117,6 +117,7 @@
|
|||||||
onLoad
|
onLoad
|
||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
import * as Api from '@/http/yskApi/Instead.js'
|
import * as Api from '@/http/yskApi/Instead.js'
|
||||||
|
import {queryAllShopUser} from '@/http/yskApi/shop-user.js'
|
||||||
import * as orderApi from '@/http/yskApi/order.js'
|
import * as orderApi from '@/http/yskApi/order.js'
|
||||||
import infoBox from '@/commons/utils/infoBox.js'
|
import infoBox from '@/commons/utils/infoBox.js'
|
||||||
import editDiscount from '@/components/my-components/edit-discount.vue'
|
import editDiscount from '@/components/my-components/edit-discount.vue'
|
||||||
@@ -124,6 +125,8 @@
|
|||||||
let payStatus = ref(null) //loading success
|
let payStatus = ref(null) //loading success
|
||||||
|
|
||||||
let timer = null
|
let timer = null
|
||||||
|
|
||||||
|
let user=ref({amount:0});
|
||||||
|
|
||||||
function clear() {
|
function clear() {
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
@@ -182,7 +185,10 @@
|
|||||||
pays.payTypes.list = payTypeList
|
pays.payTypes.list = payTypeList
|
||||||
}
|
}
|
||||||
|
|
||||||
function changePayType(i) {
|
function changePayType(i,item) {
|
||||||
|
if(item.payType=='vipPay'&&user.value.amount*1<order.amount*1){
|
||||||
|
return infoBox.showToast('余额不足')
|
||||||
|
}
|
||||||
pays.payTypes.selIndex = i
|
pays.payTypes.selIndex = i
|
||||||
}
|
}
|
||||||
//支付成功回调
|
//支付成功回调
|
||||||
@@ -262,11 +268,10 @@
|
|||||||
})
|
})
|
||||||
let payCodeUrl = ref('')
|
let payCodeUrl = ref('')
|
||||||
async function init() {
|
async function init() {
|
||||||
|
|
||||||
const res = await orderApi.tbOrderInfoDetail(order.orderId)
|
const res = await orderApi.tbOrderInfoDetail(order.orderId)
|
||||||
Object.assign(order, res)
|
Object.assign(order, res)
|
||||||
}
|
}
|
||||||
onLoad((opt) => {
|
onLoad(async(opt) => {
|
||||||
orderApi.$getOrderPayUrl({
|
orderApi.$getOrderPayUrl({
|
||||||
orderId: opt.orderId
|
orderId: opt.orderId
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
@@ -274,6 +279,13 @@
|
|||||||
})
|
})
|
||||||
console.log(opt);
|
console.log(opt);
|
||||||
Object.assign(order, opt)
|
Object.assign(order, opt)
|
||||||
|
const payTypeList = await Api.$getPayType()
|
||||||
|
pays.payTypes.list = payTypeList
|
||||||
|
if(order.userId){
|
||||||
|
queryAllShopUser({id:opt.userId}).then(res=>{
|
||||||
|
user.value=res.content[0]||opt
|
||||||
|
})
|
||||||
|
}
|
||||||
init()
|
init()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user