修改调整页面样式

This commit is contained in:
2024-10-18 16:27:51 +08:00
parent 91c716103e
commit f44cf801e8
22 changed files with 543 additions and 278 deletions

View File

@@ -113,8 +113,9 @@
} from 'vue';
import {
onLoad,
onBackPress
onBackPress,onShow
} from '@dcloudio/uni-app'
import go from '@/commons/utils/go.js'
import * as Api from '@/http/yskApi/Instead.js'
import {
queryAllShopUser
@@ -132,6 +133,7 @@
let option = {isNowPay:false}
let payFinish=ref(false)
onBackPress(() => {
uni.$emit('orderDetail:update')
console.log('onBackPress');
// uni.$emit('update:createOrderIndex')
// if (option.isNowPay&&!payFinish.value) {
@@ -172,11 +174,11 @@
go.to('PAGES_CHOOSE_USER')
}
//更新选择用户
function setUser(par) {
function setUser(par) {
console.log(option);
const submitPar = {
masterId: option.masterId,
tableId: table.value.tableId,
tableId: option.tableId,
vipUserId: user.value.id ? user.value.id : '',
type: user.value.id ? 0 : 1 //0 设置 1 取消
}
@@ -187,11 +189,17 @@
uni.$off('choose-user')
uni.$on('choose-user', (data) => {
console.log(data);
user.value = data
setUser()
setUser({
vipUserId: data.id ? data.id : '',
type: data.id ? 0 : 1 //0 设置 1 取消
}).then(res=>{
user.value = data
})
})
}
onShow(()=>{
watchChooseuser()
})
watch(() => pays.selIndex, (newval) => {
clearInterval(timer)
@@ -238,10 +246,10 @@
}
function changePayType(i, item) {
if (item.payType == 'vipPay' && user.value.amount * 1 < order.amount * 1) {
return infoBox.showToast('余额不足')
}
pays.payTypes.selIndex = i
if (item.payType == 'vipPay' ) {
chooseUser()
}
}
//支付成功回调
function paySuccess() {
@@ -250,6 +258,7 @@
// uni.$emit('orderDetail:update')
payFinish.value=true
uni.$emit('get:table')
uni.$emit('update:orderDetail')
uni.navigateBack({
delta: 1
})
@@ -266,6 +275,10 @@
}
async function payOrder() {
const payType = pays.payTypes.list[pays.payTypes.selIndex].payType
if (payType == 'vipPay' && user.value.amount * 1 < order.amount * 1) {
infoBox.showToast('余额不足')
return
}
await Api.$payOrder({
tableId: order.tableId,
masterId: order.masterId,
@@ -328,7 +341,9 @@
queryAllShopUser({
id: order.userId
}).then(res => {
user.value = res.content[0] || opt
if(res.content[0]){
user.value =res.content[0]
}
})
}
getPayUrl()
@@ -348,7 +363,6 @@
Object.assign(order, opt)
const payTypeList = await Api.$getPayType()
pays.payTypes.list = payTypeList
init()
})