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