支付宝兼容,排队预约修改,订单逻辑修改
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<view class="content">
|
||||
<image class="top_img" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/queueUp/queueUp_img.png" mode="aspectFill"></image>
|
||||
<view class="head">
|
||||
<image class="avatar" :src="shopInfo.coverImg" mode="aspectFill"></image>
|
||||
<image class="avatar" :src="shopInfo.logo" mode="aspectFill"></image>
|
||||
<view class="head_text">
|
||||
<text class="shopName">{{shopInfo.shopName}}</text>
|
||||
<text class="tip">{{shopInfo.status == 1 ? '营业中' : '休息中'}}</text>
|
||||
@@ -20,8 +20,8 @@
|
||||
<!-- queueUpList -->
|
||||
<view class="center_list" v-for="(item,index) in queueUpList" :key="index">
|
||||
<view class="w center_list_item">
|
||||
<text>{{item.tableName}}</text>
|
||||
<text>{{item.tableNote}}</text>
|
||||
<text>{{item.tableName||''}}</text>
|
||||
<text>{{item.tableNote||''}}</text>
|
||||
</view>
|
||||
<view class="w center_list_item">
|
||||
<text>{{item.waitingCount}}</text>
|
||||
@@ -49,7 +49,7 @@
|
||||
<view class="tip">当前门店</view>
|
||||
</view>
|
||||
<view class="sort">{{queueInfo.callNum}}</view>
|
||||
<view class="note">{{queueInfo.tableName}}{{queueInfo.tableNote}}</view>
|
||||
<view class="note">{{queueInfo.tableName}}{{queueInfo.tableNote||''}}</view>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<view class="footer_item">
|
||||
@@ -57,14 +57,20 @@
|
||||
<view class="footer_item_bom">前方等待桌数</view>
|
||||
</view>
|
||||
<view class="footer_item">
|
||||
<view class="footer_item_top"><text>≥{{queueInfo.waitTime}}</text><text>分钟</text></view>
|
||||
<view class="footer_item_top"><text>≥{{queueInfo.waitTime||''}}</text><text>分钟</text></view>
|
||||
<view class="footer_item_bom">预计等待时长</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cancelBtn" @click="cancelTakeNumber">
|
||||
取消排队
|
||||
<view class="result_btn">
|
||||
<view class="subscribe" @click="subscribe">
|
||||
订阅通知
|
||||
</view>
|
||||
<view class="cancelBtn" @click="cancelTakeNumber">
|
||||
取消排队
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</block>
|
||||
|
||||
@@ -88,8 +94,8 @@
|
||||
v-for="(item,index) in tableList" :key="index"
|
||||
@click="tableCut(item)"
|
||||
>
|
||||
<view>{{item.name}}</view>
|
||||
<view>{{item.note}}</view>
|
||||
<view>{{item.name||''}}</view>
|
||||
<view>{{item.note||''}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -123,15 +129,17 @@
|
||||
phone: "",
|
||||
queueUpList: [],
|
||||
tableList: [],
|
||||
callTableId: null,
|
||||
callTableId: "",
|
||||
shopInfo: null,
|
||||
queueInfo: null,
|
||||
shopId: null,
|
||||
shopId: "",
|
||||
queueId: "",
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.q) {
|
||||
this.shopId = this.getQueryString(decodeURIComponent(options.q), 'shopId')
|
||||
this.queueId = this.getQueryString(decodeURIComponent(options.q), 'queueId')
|
||||
}
|
||||
|
||||
},
|
||||
@@ -140,9 +148,7 @@
|
||||
this.getQueueUpList();
|
||||
this.getQueueUpTablList();
|
||||
},
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
|
||||
methods: {
|
||||
/**
|
||||
@@ -163,10 +169,15 @@
|
||||
* 获取排号状态
|
||||
*/
|
||||
async getQueueUpState () {
|
||||
let res = await this.api.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) {
|
||||
this.shopInfo = res.data.shopInfo;
|
||||
this.queueInfo = res.data.queueInfo;
|
||||
@@ -199,6 +210,26 @@
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 订阅通知
|
||||
*/
|
||||
async subscribe () {
|
||||
|
||||
let res = await this.api.setSubMsg({
|
||||
openId: uni.cache.get('miniAppOpenId'),
|
||||
shopId: this.shopId,
|
||||
queueId: this.queueId,
|
||||
})
|
||||
if ( res.code == 0) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds:["qUhvEfvCtIcBA3DOn3QMqsGOolrEpyr0YBh99i-AUqw","yxOjWK-KjMEZ_BaHWqDJJpHiUPXN6JWqr7u9y65RIWM","3BgFazRpVlvreh5z9u4cNP_VeclXKSQfh-r3x2_bYx4"],
|
||||
complete() {
|
||||
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 取号
|
||||
@@ -218,6 +249,8 @@
|
||||
callTableId: this.callTableId,
|
||||
})
|
||||
if ( res.code == 0) {
|
||||
this.phone = "";
|
||||
this.queueId = res.data.id;
|
||||
this.getQueueUpState();
|
||||
this.show = false;
|
||||
uni.requestSubscribeMessage({
|
||||
@@ -568,18 +601,32 @@
|
||||
border-right: 1rpx solid #E5E5E5;
|
||||
}
|
||||
}
|
||||
.cancelBtn{
|
||||
width: 336rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
border-radius: 56rpx;
|
||||
border: 2rpx solid #333333;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
margin: 64rpx auto;
|
||||
.result_btn{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
view{
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
border-radius: 56rpx;
|
||||
border: 2rpx solid #333333;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.subscribe{
|
||||
width: 336rpx;
|
||||
margin: 64rpx auto;
|
||||
}
|
||||
.cancelBtn{
|
||||
width: 336rpx;
|
||||
|
||||
|
||||
|
||||
margin: 64rpx auto;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user