新增预点单功能
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
<!-- <view class="contentboxitemright_item flex-between"
|
||||
@click="memberindex('user/member/index')"
|
||||
> -->
|
||||
|
||||
<view class="contentboxitemright_item flex-between" @click="toCharge">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xchong.png" mode="aspectFill"></image>
|
||||
<view class="contentboxitemright_itembox flex-colum">
|
||||
@@ -38,6 +37,24 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-popup :show="popupShow" :safe-area-inset-bottom="false" mode="center" @close="popupShow = false">
|
||||
<view class="popup-content">
|
||||
<view class="header-wrap">
|
||||
<text class="t">请选择</text>
|
||||
<view class="close" @click="popupShow = false">
|
||||
<u-icon name="close" size="16" color="#666"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-content">
|
||||
<view class="btn">
|
||||
<u-button color="#E8AD7B" plain="" shape="circle" @click="beforehandOrderHandle">预点单</u-button>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<u-button color="#E8AD7B" shape="circle" @click="scanOrderHandle">扫码点单</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -55,10 +72,27 @@ const props = defineProps({
|
||||
|
||||
import { productStore } from '@/stores/user.js';
|
||||
|
||||
const scanCodehandle = async (i) => {
|
||||
// 显示弹窗
|
||||
const popupShow = ref(false);
|
||||
const scanCodehandle = (i) => {
|
||||
popupShow.value = true;
|
||||
};
|
||||
|
||||
// 预点单
|
||||
function beforehandOrderHandle() {
|
||||
let shopUserInfo = uni.cache.get('shopUserInfo');
|
||||
uni.cache.set('dinersNum', 1);
|
||||
uni.cache.set('tableCode', shopUserInfo.id);
|
||||
uni.navigateTo({
|
||||
url: '/pages/product/index?type=beforehand'
|
||||
});
|
||||
}
|
||||
|
||||
// 扫码点餐
|
||||
async function scanOrderHandle() {
|
||||
const store = productStore();
|
||||
await store.scanCodeactions();
|
||||
};
|
||||
}
|
||||
|
||||
const memberindex = (url) => {
|
||||
uni.pro.navigateTo(url, {
|
||||
@@ -221,4 +255,39 @@ page {
|
||||
}
|
||||
}
|
||||
}
|
||||
.popup-content {
|
||||
width: 90vw;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
.header-wrap {
|
||||
height: 64px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #ececec;
|
||||
padding: 0 28upx;
|
||||
.t {
|
||||
font-size: 32upx;
|
||||
color: #333;
|
||||
}
|
||||
.close {
|
||||
$size: 60upx;
|
||||
width: $size;
|
||||
height: $size;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
.btn-content {
|
||||
height: 86px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 60upx;
|
||||
.btn {
|
||||
width: 248upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user