新增预点单功能

This commit is contained in:
gyq
2025-12-03 15:26:41 +08:00
parent 0d3fb4f634
commit 00c5987ccc
11 changed files with 4814 additions and 5207 deletions

View File

@@ -0,0 +1,108 @@
<template>
<view class="loading-page">
<view class="loader"></view>
<text class="text">加载中...</text>
</view>
</template>
<script setup></script>
<style scoped lang="scss">
.loading-page {
width: 100%;
height: 100vh;
background-color: rgba(255, 255, 255, 0.8);
backdrop-filter: blur(10px);
position: fixed;
top: 0;
left: 0;
z-index: 999;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 10vh;
--color: #111;
.text {
font-size: 24upx;
color: var(--color);
}
.loader {
width: 40px;
height: 20px;
--c: no-repeat radial-gradient(farthest-side, var(--color) 93%, var(--color));
background: var(--c) 0 0, var(--c) 50% 0;
background-size: 8px 8px;
position: relative;
clip-path: inset(-200% -100% 0 0);
animation: l6-0 1.5s linear infinite;
}
.loader:before {
content: '';
position: absolute;
width: 8px;
height: 12px;
background: var(--color);
left: -16px;
top: 0;
animation: l6-1 1.5s linear infinite, l6-2 0.5s cubic-bezier(0, 200, 0.8, 200) infinite;
}
.loader:after {
content: '';
position: absolute;
inset: 0 0 auto auto;
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--color);
animation: l6-3 1.5s linear infinite;
}
@keyframes l6-0 {
0%,
30% {
background-position: 0 0, 50% 0;
}
33% {
background-position: 0 100%, 50% 0;
}
41%,
63% {
background-position: 0 0, 50% 0;
}
66% {
background-position: 0 0, 50% 100%;
}
74%,
100% {
background-position: 0 0, 50% 0;
}
}
@keyframes l6-1 {
90% {
transform: translateY(0);
}
95% {
transform: translateY(15px);
}
100% {
transform: translateY(15px);
left: calc(100% - 8px);
}
}
@keyframes l6-2 {
100% {
top: -0.1px;
}
}
@keyframes l6-3 {
0%,
80%,
100% {
transform: translate(0);
}
90% {
transform: translate(26px);
}
}
}
</style>

View File

@@ -127,6 +127,8 @@
</view>
<indexs ref="indexsRef" v-if="showindex == 'shopIndex'" :shopExtend="orderVIP.shopExtendList"></indexs>
<!-- <CouponModal></CouponModal> -->
<!-- 页面加载动画 -->
<pageLoading v-if="showPageLoading" />
</view>
</template>
@@ -136,6 +138,7 @@ import { ref, computed, onMounted, reactive, onBeforeUnmount, watch, getCurrentI
import { onLoad, onReady, onShow, onReachBottom, onPageScroll } from '@dcloudio/uni-app';
// 获取全局属性
const { proxy } = getCurrentInstance();
import pageLoading from './components/pageLoading.vue';
import swipers from './components/swiper.vue'; //引入轮播
import advertisement from './components/advertisement.vue'; //广告
import diamond from './components/diamond.vue'; //金刚区
@@ -194,7 +197,7 @@ const hometop = async () => {
const query = uni.createSelectorQuery().select('#fourcontent');
query
.boundingClientRect((rect) => {
if(rect){
if (rect) {
elementTop.value = rect.top - store.height;
}
})
@@ -326,16 +329,13 @@ const indexsRef = ref(null);
onShow(async () => {
try {
await storeuser.getLocation()
await storeuser.getLocation();
proxy.$isResolve();
const shopId=uni.cache.get('shopId')
if(shopId){
const shopId = uni.cache.get('shopId');
if (shopId) {
indexsRef.value.getVipConfig();
}
} catch (error) {
}
} catch (error) {}
await proxy.$onLaunched;
if (uni.cache.get('shopId')) {
showindex.value = 'shopIndex';
@@ -349,7 +349,14 @@ onShow(async () => {
// 获取初始定位高度
}
});
onMounted(async () => {});
const showPageLoading = ref(true);
onMounted(async () => {
setTimeout(() => {
showPageLoading.value = false;
}, 800);
});
onReachBottom(() => {
onLoadhome();

View File

@@ -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>

View File

@@ -914,7 +914,7 @@
console.log('init', listinfo);
if (options.shopId) {
// 每次进来全局更新shopId
uni.cache.set('shopId', options.shopId, 30)
uni.cache.set('shopId', options.shopId)
uni.$on('returnData', handleReturnData);
}
// * 获取会员信息

File diff suppressed because it is too large Load Diff

View File

@@ -575,7 +575,7 @@
orderId.value = options.orderId
if (options.shopId) {
// 每次进来全局更新shopId
uni.cache.set('shopId', options.shopId, 30)
uni.cache.set('shopId', options.shopId)
uni.$on('returnData', handleReturnData);
}
// * 获取会员信息

File diff suppressed because it is too large Load Diff

View File

@@ -291,7 +291,7 @@
dataform.queueId = getApp().globalData.queueId
}
// #endif
uni.cache.set('shopId', dataform.shopId, 30)
uni.cache.set('shopId', dataform.shopId)
await nextTick()
getQueueUpTablList();
})

View File

@@ -343,7 +343,7 @@
// #endif
if (options.shopId) {
uni.cache.set('shopId', options.shopId, 30)
uni.cache.set('shopId', options.shopId)
infoForn.shopId = options.shopId ? options.shopId : uni.cache.get('shopId')
}
asyncshopUserInfo()

File diff suppressed because it is too large Load Diff