总计 跳转
This commit is contained in:
@@ -174,11 +174,16 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<view class="total-wrap">
|
<view class="total-wrap" v-if="listinfo.status == 'unpaid'">
|
||||||
<view>总计¥</view>
|
<view>总计¥</view>
|
||||||
<view class="price"> {{listinfo.totalCost}} </view>
|
<view class="price"> {{listinfo.totalCost}} </view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="total-wrap" v-else>
|
||||||
|
<view>实付¥</view>
|
||||||
|
<view class="price"> {{listinfo.payAmount}} </view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -212,7 +212,6 @@
|
|||||||
// 监听价格算法
|
// 监听价格算法
|
||||||
watchEffect(async () => {
|
watchEffect(async () => {
|
||||||
if (listinfo.combinedArray.length > 0) {
|
if (listinfo.combinedArray.length > 0) {
|
||||||
console.log(11)
|
|
||||||
// 打包费packFeess 计算购物车商品费用totalPrices 餐位费Seatcharge
|
// 打包费packFeess 计算购物车商品费用totalPrices 餐位费Seatcharge
|
||||||
// try {
|
// try {
|
||||||
let sum = (is_type.value != 0 ? listinfo.packFeess : 0) + listinfo.totalPrices + (is_type
|
let sum = (is_type.value != 0 ? listinfo.packFeess : 0) + listinfo.totalPrices + (is_type
|
||||||
|
|||||||
@@ -55,11 +55,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<view class="footer_item">
|
<view class="footer_item">
|
||||||
<view class="footer_item_top"><text>{{dataform.queueInfo.waitingCount}}</text><text>桌</text></view>
|
<view class="footer_item_top"><text>{{dataform.queueInfo.waitingCount}}</text><text>桌</text>
|
||||||
|
</view>
|
||||||
<view class="footer_item_bom">前方等待桌数</view>
|
<view class="footer_item_bom">前方等待桌数</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="footer_item">
|
<view class="footer_item">
|
||||||
<view class="footer_item_top"><text>≥{{dataform.queueInfo.waitTime||''}}</text><text>分钟</text></view>
|
<view class="footer_item_top"><text>≥{{dataform.queueInfo.waitTime||''}}</text><text>分钟</text>
|
||||||
|
</view>
|
||||||
<view class="footer_item_bom">预计等待时长</view>
|
<view class="footer_item_bom">预计等待时长</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -99,7 +101,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="title">手机号码</view>
|
<view class="title">手机号码</view>
|
||||||
<u--input type="number" placeholder="填写号码" border="surround" v-model="dataform.phone"></u--input>
|
<u--input type="number" placeholder="填写号码" border="surround"
|
||||||
|
v-model="dataform.phone"></u--input>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
@@ -114,7 +117,10 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
reactive,
|
reactive,
|
||||||
ref
|
ref,
|
||||||
|
onMounted,
|
||||||
|
getCurrentInstance,
|
||||||
|
nextTick
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
|
||||||
const queueUpList = ref([])
|
const queueUpList = ref([])
|
||||||
@@ -130,189 +136,168 @@
|
|||||||
shopId: "",
|
shopId: "",
|
||||||
queueId: "",
|
queueId: "",
|
||||||
})
|
})
|
||||||
export default {
|
|
||||||
onLoad(options) {
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
if (options.q) {
|
|
||||||
this.shopId = this.getQueryString(decodeURIComponent(options.q), 'shopId')
|
|
||||||
this.queueId = this.getQueryString(decodeURIComponent(options.q), 'queueId')
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP-ALIPAY
|
|
||||||
if (getApp().globalData.shopId) {
|
|
||||||
this.shopId = getApp().globalData.shopId
|
|
||||||
}
|
|
||||||
if (getApp().globalData.queueId) {
|
|
||||||
this.queueId = getApp().globalData.queueId
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
this.getQueueUpState();
|
|
||||||
this.getQueueUpTablList();
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* 解码
|
|
||||||
* @param {Object} url
|
|
||||||
* @param {Object} name
|
|
||||||
*/
|
|
||||||
getQueryString(url, name) {
|
|
||||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
|
||||||
var r = url.substr(1).match(reg)
|
|
||||||
if (r != null) {
|
|
||||||
return r[2]
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取排号状态
|
|
||||||
*/
|
|
||||||
async getQueueUpState() {
|
|
||||||
let params = {
|
|
||||||
openId: uni.cache.get('miniAppOpenId'),
|
|
||||||
shopId: this.shopId,
|
|
||||||
}
|
|
||||||
if (this.queueId) {
|
|
||||||
params.queueId = this.queueId;
|
|
||||||
}
|
|
||||||
let res = await this.api.getQueueUpState(params)
|
|
||||||
|
|
||||||
if (res.code == 0) {
|
|
||||||
dataform.shopInfo = res.data.shopInfo;
|
|
||||||
dataform.queueInfo = res.data.queueInfo;
|
|
||||||
dataform.queueId = dataform.queueInfo.id;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取排号数据
|
|
||||||
*/
|
|
||||||
async getQueueUpList() {
|
|
||||||
let res = await this.api.getQueueUpList({
|
|
||||||
openId: uni.cache.get('miniAppOpenId'),
|
|
||||||
shopId: this.shopId,
|
|
||||||
})
|
|
||||||
if (res.code == 0 && res.data.length > 0) {
|
|
||||||
queueUpList.value = res.data;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取桌型数据
|
|
||||||
*/
|
|
||||||
async getQueueUpTablList() {
|
|
||||||
let res = await this.api.getQueueUpTablList({
|
|
||||||
shopId: this.shopId,
|
|
||||||
})
|
|
||||||
if (res.code == 0 && res.data.length > 0) {
|
|
||||||
tableList.value = res.data;
|
|
||||||
dataform.callTableId = res.data[0].id;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订阅通知
|
|
||||||
*/
|
|
||||||
async subscribe() {
|
|
||||||
|
|
||||||
let res = await this.api.setSubMsg({
|
|
||||||
openId: uni.cache.get('miniAppOpenId'),
|
|
||||||
shopId: this.shopId,
|
|
||||||
queueId: this.queueId,
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '订阅成功',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
uni.requestSubscribeMessage({
|
|
||||||
tmplIds: ["qUhvEfvCtIcBA3DOn3QMqsGOolrEpyr0YBh99i-AUqw",
|
|
||||||
"yxOjWK-KjMEZ_BaHWqDJJpHiUPXN6JWqr7u9y65RIWM",
|
|
||||||
"3BgFazRpVlvreh5z9u4cNP_VeclXKSQfh-r3x2_bYx4"
|
|
||||||
],
|
|
||||||
complete() {
|
|
||||||
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取号
|
|
||||||
*/
|
|
||||||
async getTakeNumber() {
|
|
||||||
if (dataform.phone == "" || dataform.phone == null) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请填写手机号',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let res = await this.api.getTakeNumber({
|
|
||||||
openId: uni.cache.get('miniAppOpenId'),
|
|
||||||
shopId: dataform.shopId,
|
|
||||||
phone: dataform.phone,
|
|
||||||
callTableId: dataform.callTableId,
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
dataform.phone = "";
|
|
||||||
dataform.queueId = res.data.id;
|
|
||||||
this.getQueueUpState();
|
|
||||||
dataform.show = false;
|
|
||||||
uni.requestSubscribeMessage({
|
|
||||||
tmplIds: ["qUhvEfvCtIcBA3DOn3QMqsGOolrEpyr0YBh99i-AUqw",
|
|
||||||
"yxOjWK-KjMEZ_BaHWqDJJpHiUPXN6JWqr7u9y65RIWM",
|
|
||||||
"3BgFazRpVlvreh5z9u4cNP_VeclXKSQfh-r3x2_bYx4"
|
|
||||||
],
|
|
||||||
complete() {
|
|
||||||
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消排队
|
|
||||||
*/
|
|
||||||
async cancelTakeNumber() {
|
|
||||||
let res = await this.api.cancelTakeNumber({
|
|
||||||
queueId: dataform.queueInfo.id,
|
|
||||||
shopId: this.shopId,
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.getQueueUpTablList();
|
|
||||||
this.getQueueUpState();
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 切换桌型
|
|
||||||
*/
|
|
||||||
tableCut(item) {
|
|
||||||
dataform.callTableId = item.id;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹窗关闭监听
|
|
||||||
*/
|
|
||||||
close() {
|
|
||||||
this.phone = "";
|
|
||||||
if (tableList.value.length > 0) {
|
|
||||||
dataform.callTableId = tableList.value[0].id;
|
|
||||||
}
|
|
||||||
dataform.show = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
|
// 解码
|
||||||
|
const getQueryString = (url, name) => {
|
||||||
|
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
||||||
|
var r = url.substr(1).match(reg)
|
||||||
|
if (r != null) {
|
||||||
|
return r[2]
|
||||||
}
|
}
|
||||||
};
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取排号状态
|
||||||
|
const getQueueUpState = async () => {
|
||||||
|
let params = {
|
||||||
|
openId: uni.cache.get('miniAppOpenId'),
|
||||||
|
shopId: this.shopId,
|
||||||
|
}
|
||||||
|
if (this.queueId) {
|
||||||
|
params.queueId = this.queueId;
|
||||||
|
}
|
||||||
|
let res = await this.api.getQueueUpState(params)
|
||||||
|
|
||||||
|
if (res.code == 0) {
|
||||||
|
dataform.shopInfo = res.data.shopInfo;
|
||||||
|
dataform.queueInfo = res.data.queueInfo;
|
||||||
|
dataform.queueId = dataform.queueInfo.id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取排号数据
|
||||||
|
const getQueueUpList = async () => {
|
||||||
|
let res = await this.api.getQueueUpList({
|
||||||
|
openId: uni.cache.get('miniAppOpenId'),
|
||||||
|
shopId: this.shopId,
|
||||||
|
})
|
||||||
|
if (res.code == 0 && res.data.length > 0) {
|
||||||
|
queueUpList.value = res.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取桌型数据
|
||||||
|
const getQueueUpTablList = async () => {
|
||||||
|
let res = await this.api.getQueueUpTablList({
|
||||||
|
shopId: this.shopId,
|
||||||
|
})
|
||||||
|
if (res.code == 0 && res.data.length > 0) {
|
||||||
|
tableList.value = res.data;
|
||||||
|
dataform.callTableId = res.data[0].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 订阅通知
|
||||||
|
const subscribe = async () => {
|
||||||
|
let res = await this.api.setSubMsg({
|
||||||
|
openId: uni.cache.get('miniAppOpenId'),
|
||||||
|
shopId: this.shopId,
|
||||||
|
queueId: this.queueId,
|
||||||
|
})
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '订阅成功',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
uni.requestSubscribeMessage({
|
||||||
|
tmplIds: ["qUhvEfvCtIcBA3DOn3QMqsGOolrEpyr0YBh99i-AUqw",
|
||||||
|
"yxOjWK-KjMEZ_BaHWqDJJpHiUPXN6JWqr7u9y65RIWM",
|
||||||
|
"3BgFazRpVlvreh5z9u4cNP_VeclXKSQfh-r3x2_bYx4"
|
||||||
|
],
|
||||||
|
complete() {
|
||||||
|
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取号
|
||||||
|
const getTakeNumber = async () => {
|
||||||
|
if (dataform.phone == "" || dataform.phone == null) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请填写手机号',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let res = await this.api.getTakeNumber({
|
||||||
|
openId: uni.cache.get('miniAppOpenId'),
|
||||||
|
shopId: dataform.shopId,
|
||||||
|
phone: dataform.phone,
|
||||||
|
callTableId: dataform.callTableId,
|
||||||
|
})
|
||||||
|
if (res.code == 0) {
|
||||||
|
dataform.phone = "";
|
||||||
|
dataform.queueId = res.data.id;
|
||||||
|
this.getQueueUpState();
|
||||||
|
dataform.show = false;
|
||||||
|
uni.requestSubscribeMessage({
|
||||||
|
tmplIds: ["qUhvEfvCtIcBA3DOn3QMqsGOolrEpyr0YBh99i-AUqw",
|
||||||
|
"yxOjWK-KjMEZ_BaHWqDJJpHiUPXN6JWqr7u9y65RIWM",
|
||||||
|
"3BgFazRpVlvreh5z9u4cNP_VeclXKSQfh-r3x2_bYx4"
|
||||||
|
],
|
||||||
|
complete() {
|
||||||
|
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消排队
|
||||||
|
const cancelTakeNumber = async () => {
|
||||||
|
let res = await this.api.cancelTakeNumber({
|
||||||
|
queueId: dataform.queueInfo.id,
|
||||||
|
shopId: this.shopId,
|
||||||
|
})
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.getQueueUpTablList();
|
||||||
|
this.getQueueUpState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消排队
|
||||||
|
const close = async () => {
|
||||||
|
this.phone = "";
|
||||||
|
if (tableList.value.length > 0) {
|
||||||
|
dataform.callTableId = tableList.value[0].id;
|
||||||
|
}
|
||||||
|
dataform.show = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消排队
|
||||||
|
const tableCut = async (item) => {
|
||||||
|
dataform.callTableId = item.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await proxy.$onLaunched;
|
||||||
|
// 获取当前页面栈
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
// 获取当前页面实例
|
||||||
|
const currentPage = pages[pages.length - 1];
|
||||||
|
// 获取页面参数
|
||||||
|
const options = currentPage.options;
|
||||||
|
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
if (options.q) {
|
||||||
|
this.shopId = getQueryString(decodeURIComponent(options.q), 'shopId')
|
||||||
|
this.queueId = getQueryString(decodeURIComponent(options.q), 'queueId')
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
if (getApp().globalData.shopId) {
|
||||||
|
this.shopId = getApp().globalData.shopId
|
||||||
|
}
|
||||||
|
if (getApp().globalData.queueId) {
|
||||||
|
this.queueId = getApp().globalData.queueId
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
await nextTick()
|
||||||
|
this.getQueueUpState();
|
||||||
|
this.getQueueUpTablList();
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@@ -119,7 +119,9 @@ export const productStore = defineStore('product', {
|
|||||||
}
|
}
|
||||||
// 是否免除桌位费 0否1是
|
// 是否免除桌位费 0否1是
|
||||||
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
||||||
uni.pro.navigateTo('product/choosetable')
|
uni.reLaunch({
|
||||||
|
url: '/pages/product/choosetable'
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/product/index'
|
url: '/pages/product/index'
|
||||||
@@ -147,7 +149,9 @@ export const productStore = defineStore('product', {
|
|||||||
}
|
}
|
||||||
// 是否免除桌位费 0否1是
|
// 是否免除桌位费 0否1是
|
||||||
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
||||||
uni.pro.navigateTo('product/choosetable')
|
uni.navigateTo({
|
||||||
|
url: '/pages/product/choosetable'
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/product/index'
|
url: '/pages/product/index'
|
||||||
@@ -184,7 +188,9 @@ export const productStore = defineStore('product', {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
||||||
uni.pro.navigateTo('product/choosetable')
|
uni.navigateTo({
|
||||||
|
url: '/pages/product/choosetable'
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/product/index'
|
url: '/pages/product/index'
|
||||||
|
|||||||
Reference in New Issue
Block a user