会员列表,详情,充值,订单列表
This commit is contained in:
223
pages/product/choosetable.vue
Normal file
223
pages/product/choosetable.vue
Normal file
@@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<image class="top_bg" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/order/orderAMeal.png"
|
||||
mode="aspectFill"></image>
|
||||
<view class="content_box">
|
||||
<view class="content">
|
||||
<view class="title">
|
||||
<view class="title_text">请选择就餐人数</view>
|
||||
<view class="title_tabNum">桌号{{tableCode}}</view>
|
||||
</view>
|
||||
<view class="num" :class="{'active':numIndex==-1}">
|
||||
<view class="item" @click="tabCut(index)" v-for="(item,index) in 9" :key="index">
|
||||
<view class="num_item" :class="{'active':numIndex==index }">{{index+1}}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<up--input class="num_item" v-model="otherNum" :class="{'active':numIndex==-1 }"
|
||||
@input="isOtherNum" @focus="tabCut(-1)" @blur="blur()" border="none" type="nubmer"
|
||||
maxlength="3"></up--input>
|
||||
</view>
|
||||
<!-- <view class="num_item" v-else :class="{'active':numIndex==-1 }">其</view> -->
|
||||
</view>
|
||||
<view class="startBtn" @click="start">
|
||||
开始点餐
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
|
||||
const otherNum = ref('其他')
|
||||
|
||||
const numIndex = ref(0)
|
||||
|
||||
const dinersNum = ref(1)
|
||||
|
||||
const isOtherNum = (e) => {
|
||||
otherNum.value = otherNum.value.replace(/\D/g, '')
|
||||
}
|
||||
|
||||
const tableCode = uni.cache.get('tableCode')
|
||||
|
||||
// 切换桌型
|
||||
const tabCut = (index) => {
|
||||
numIndex.value = index;
|
||||
if (index != -1) {
|
||||
dinersNum.value = index + 1;
|
||||
} else {
|
||||
otherNum.value = otherNum.value == "其他" ? "" : otherNum.value
|
||||
}
|
||||
}
|
||||
|
||||
const blur = (index) => {
|
||||
otherNum.value = otherNum.value == "" ? "其他" : otherNum.value
|
||||
}
|
||||
|
||||
const shopTable = uni.cache.get('shopTable')
|
||||
|
||||
const start = async () => {
|
||||
if (numIndex.value == -1 && (otherNum.value == "其他" || otherNum.value <= 0)) {
|
||||
uni.showToast({
|
||||
title: '请选择就餐人数',
|
||||
icon: 'none',
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (numIndex.value == -1 && otherNum.value != "其他") {
|
||||
dinersNum.value = otherNum.value
|
||||
}
|
||||
if (shopTable.useNum < dinersNum.value) {
|
||||
uni.showToast({
|
||||
title: `最多${shopTable.useNum}人`,
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
uni.pro.redirectTo('product/index', dinersNum.value)
|
||||
|
||||
}
|
||||
|
||||
uni.cache.get('tableCode')
|
||||
uni.cache.get('shopId')
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
// background: #f6f6f6;
|
||||
}
|
||||
|
||||
.top_bg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.content_box {
|
||||
width: 100%;
|
||||
padding: 0 28rpx;
|
||||
position: absolute;
|
||||
bottom: 148rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 48rpx 0 32rpx 32rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 44rpx 44rpx 44rpx 44rpx;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 48rpx;
|
||||
padding-right: 32rpx;
|
||||
|
||||
.title_text {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.title_tabNum {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.num {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.item {
|
||||
width: 20%;
|
||||
padding-right: 32rpx;
|
||||
}
|
||||
|
||||
.num_item {
|
||||
width: 100%;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
margin-right: 28rpx;
|
||||
margin-bottom: 32rpx;
|
||||
background-color: #FEF4EB;
|
||||
border-radius: 12rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.num_item:nth-child(5n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
::v-deep .u-input {
|
||||
width: 100%;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
margin-bottom: 32rpx;
|
||||
background-color: #FEF4EB;
|
||||
border-radius: 12rpx;
|
||||
|
||||
}
|
||||
|
||||
::v-deep input {
|
||||
font-weight: 400;
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx !important;
|
||||
color: #333333 !important;
|
||||
text-align: center !important;
|
||||
background-color: #FEF4EB !important;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #fff;
|
||||
background-color: #E8AD7B;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
::v-deep .num.active .u-input {
|
||||
width: 100%;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
margin-bottom: 32rpx;
|
||||
background-color: #E8AD7B !important;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
::v-deep .num.active input {
|
||||
color: #fff !important;
|
||||
border-radius: 12rpx;
|
||||
background-color: #E8AD7B !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.startBtn {
|
||||
width: 100%;
|
||||
height: 96rpx;
|
||||
line-height: 96rpx;
|
||||
text-align: center;
|
||||
background-color: #E8AD7B;
|
||||
border-radius: 48rpx;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
232
pages/product/components/orderAMeal.vue
Normal file
232
pages/product/components/orderAMeal.vue
Normal file
@@ -0,0 +1,232 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<image class="top_bg" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/order/orderAMeal.png" mode="aspectFill"></image>
|
||||
<view class="content_box">
|
||||
<view class="content">
|
||||
<view class="title">
|
||||
<view class="title_text">请选择就餐人数</view>
|
||||
<view class="title_tabNum">桌号A2</view>
|
||||
</view>
|
||||
<view class="num" :class="{'active':numIndex==-1}">
|
||||
<view class="item" @click="tabCut(index)" v-for="(item,index) in 9" :key="index">
|
||||
<view class="num_item" :class="{'active':numIndex==index }">{{index+1}}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<u--input class="num_item" v-model="otherNum" :class="{'active':numIndex==-1 }" @input="isOtherNum" @focus="tabCut(-1)" @blur="blur()" border="none" type="nubmer" maxlength="3"></u--input>
|
||||
</view>
|
||||
<!-- <view class="num_item" v-else :class="{'active':numIndex==-1 }">其</view> -->
|
||||
</view>
|
||||
<view class="startBtn" @click="start">
|
||||
开始点餐
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableCode: null,
|
||||
shopId: null,
|
||||
numIndex: 0,
|
||||
otherNum: '其他',
|
||||
dinersNum: 1,
|
||||
type: ""
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.tableCode = options.tableCode;
|
||||
this.shopId = options.shopId;
|
||||
if ( options.type ) { this.type = options.type}
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
|
||||
isOtherNum (e) {
|
||||
this.$nextTick(() => {
|
||||
this.otherNum = this.otherNum.replace(/\D/g, '')
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 切换桌型
|
||||
*/
|
||||
tabCut(index) {
|
||||
this.numIndex = index;
|
||||
if ( index != -1) {
|
||||
this.dinersNum = index+1;
|
||||
} else {
|
||||
this.otherNum = this.otherNum == "其他" ? "" : this.otherNum;
|
||||
}
|
||||
},
|
||||
|
||||
blur ( index ) {
|
||||
this.otherNum = this.otherNum == "" ? "其他" : this.otherNum;
|
||||
},
|
||||
|
||||
/**
|
||||
* 开始点餐
|
||||
*/
|
||||
async start () {
|
||||
if ( this.numIndex == -1 && (this.otherNum == "其他"||this.otherNum <= 0)) {
|
||||
uni.showToast({
|
||||
title: '请选择就餐人数',
|
||||
icon: 'none',
|
||||
})
|
||||
return;
|
||||
}
|
||||
if ( this.numIndex == -1 && this.otherNum != "其他") {
|
||||
this.dinersNum = this.otherNum
|
||||
}
|
||||
|
||||
let res = await this.api.productChoseCount({
|
||||
tableId: this.tableCode,
|
||||
num: this.dinersNum,
|
||||
shopId: this.shopId,
|
||||
}) //判断是否支付成功
|
||||
if ( res.code == 0) {
|
||||
if( this.type == 'confirm') {
|
||||
uni.pro,navigateBack()
|
||||
} else {
|
||||
uni.pro.redirectTo('order_food/order_food', {
|
||||
// uni.pro.navigateTo('order_food/order_food', {
|
||||
tableCode: this.tableCode,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
// background: #f6f6f6;
|
||||
}
|
||||
.top_bg{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
}
|
||||
.content_box{
|
||||
width: 100%;
|
||||
padding: 0 28rpx;
|
||||
position: absolute;
|
||||
bottom: 148rpx;
|
||||
}
|
||||
.content{
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 48rpx 0 32rpx 32rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 44rpx 44rpx 44rpx 44rpx;
|
||||
.title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 48rpx;
|
||||
padding-right: 32rpx;
|
||||
.title_text{
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.title_tabNum{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
.num{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.item{
|
||||
width: 20%;
|
||||
padding-right: 32rpx;
|
||||
}
|
||||
.num_item{
|
||||
width: 100%;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
margin-right: 28rpx;
|
||||
margin-bottom: 32rpx;
|
||||
background-color: #FEF4EB;
|
||||
border-radius: 12rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.num_item:nth-child(5n){
|
||||
margin-right: 0;
|
||||
}
|
||||
::v-deep .u-input{
|
||||
width: 100%;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
margin-bottom: 32rpx;
|
||||
background-color: #FEF4EB;
|
||||
border-radius: 12rpx;
|
||||
|
||||
}
|
||||
::v-deep input{
|
||||
font-weight: 400;
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx!important;
|
||||
color: #333333!important;
|
||||
text-align: center!important;
|
||||
background-color: #FEF4EB!important;
|
||||
}
|
||||
.active{
|
||||
color: #fff;
|
||||
background-color: #E8AD7B;
|
||||
}
|
||||
|
||||
}
|
||||
::v-deep .num.active .u-input{
|
||||
width: 100%;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
margin-bottom: 32rpx;
|
||||
background-color: #E8AD7B!important;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
::v-deep .num.active input{
|
||||
color: #fff!important;
|
||||
border-radius: 12rpx;
|
||||
background-color: #E8AD7B!important;
|
||||
}
|
||||
|
||||
}
|
||||
.startBtn{
|
||||
width: 100%;
|
||||
height: 96rpx;
|
||||
line-height: 96rpx;
|
||||
text-align: center;
|
||||
background-color: #E8AD7B;
|
||||
border-radius: 48rpx;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
@@ -29,7 +29,7 @@
|
||||
<text class="i">¥</text>
|
||||
<!-- 会员价与价格 -->
|
||||
<text
|
||||
class="price">{{shopInfo.isVip ==1?item.memberPrice:item.salePrice}}</text>
|
||||
class="price">{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?item.memberPrice:item.salePrice}}</text>
|
||||
<!-- <text class="originalprice"
|
||||
v-if="item.originPrice">¥{{item.originPrice}}</text>
|
||||
<text class="unit" v-if="item.unitName">/{{item.unitName}}</text> -->
|
||||
@@ -44,7 +44,7 @@
|
||||
<text class="num">{{ ifcartNumber(item) }}</text>
|
||||
<view class="btn">
|
||||
<!-- <up-icon name="plus-circle-fill"
|
||||
:color="shopInfo.isVip == 1 ? '#CECECE' : '#E9AB7A'"
|
||||
:color="{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1? '#CECECE' : '#E9AB7A'"
|
||||
size="25"></up-icon> -->
|
||||
<up-icon name="plus-circle-fill" color="#E9AB7A" size="25"></up-icon>
|
||||
<view class="btnClick" @click="cartListadd(item,'+')"></view>
|
||||
|
||||
@@ -51,10 +51,11 @@
|
||||
style="margin-top: 32rpx;margin-bottom: 48rpx;">
|
||||
<view class="panelfiveitemsex flex-between">
|
||||
<view class="panelfiveitemsex_oen">
|
||||
<text class="tips" :class="shopInfo.isVip ==0?'lineThrough':''">¥</text>
|
||||
<text class="tips"
|
||||
:class="shopInfo.isVip ==0 || shopInfo.isMemberPrice==0?'lineThrough':''">¥</text>
|
||||
<!-- 会员价与价格 -->
|
||||
<text
|
||||
class="price">{{shopInfo.isVip ==1?item.memberPrice:item.salePrice}}</text>
|
||||
class="price">{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?item.memberPrice:item.salePrice}}</text>
|
||||
<!-- 原价 -->
|
||||
<text class="originalprice" v-if="item.originPrice">¥{{item.originPrice}}</text>
|
||||
<!-- 单位 -->
|
||||
@@ -72,10 +73,11 @@
|
||||
<view v-else class="flex-between" style="margin-top: 32rpx;margin-bottom: 48rpx;">
|
||||
<view class="panelfiveitemsex flex-between">
|
||||
<view class="panelfiveitemsex_oen">
|
||||
<text class="tips" :class="shopInfo.isVip ==0?'lineThrough':''">¥</text>
|
||||
<text class="tips"
|
||||
:class="shopInfo.isVip ==0 || shopInfo.isMemberPrice==0?'lineThrough':''">¥</text>
|
||||
<!-- 会员价与价格 -->
|
||||
<text
|
||||
class="price">{{shopInfo.isVip ==1?item.memberPrice:item.salePrice}}</text>
|
||||
class="price">{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?item.memberPrice:item.salePrice}}</text>
|
||||
<!-- 原价 -->
|
||||
<text class="originalprice" v-if="item.originPrice">¥{{item.originPrice}}</text>
|
||||
<!-- 单位 -->
|
||||
@@ -159,12 +161,15 @@
|
||||
<view v-if="item1.isSoldStock == 1 || item1.isSaleTime == 0" class="flex-between">
|
||||
<view class="money">
|
||||
<view>¥</view>
|
||||
<text class="money_num" v-if="shopInfo.isVip == 1"
|
||||
<text class="money_num"
|
||||
v-if="shopInfo.isVip ==1 && shopInfo.isMemberPrice==1"
|
||||
style="margin-right: 10rpx;">{{ item1.memberPrice }}</text>
|
||||
<view v-if="shopInfo.isVip ==1" :class="{lineThrough: shopInfo.isVip ==1}">¥
|
||||
<view v-if="shopInfo.isVip ==1 && shopInfo.isMemberPrice==1"
|
||||
:class="{lineThrough: shopInfo.isVip ==1 && shopInfo.isMemberPrice==1}">
|
||||
¥
|
||||
</view>
|
||||
<text class="money_num"
|
||||
:class="{lineThrough: shopInfo.isVip ==1}">{{ item1.salePrice }}</text>
|
||||
:class="{lineThrough: shopInfo.isVip ==1 && shopInfo.isMemberPrice==1}">{{ item1.salePrice }}</text>
|
||||
<text v-if="item1.unitName">/{{item1.unitName}}</text>
|
||||
</view>
|
||||
<view class="flex-end">
|
||||
@@ -177,12 +182,15 @@
|
||||
<view v-else class="flex-between">
|
||||
<view class="money">
|
||||
<view>¥</view>
|
||||
<text class="money_num" v-if="shopInfo.isVip ==1"
|
||||
<text class="money_num"
|
||||
v-if="shopInfo.isVip ==1 && shopInfo.isMemberPrice==1"
|
||||
style="margin-right: 10rpx;">{{ item1.memberPrice }}</text>
|
||||
<view v-if="shopInfo.isVip ==1" :class="{lineThrough: shopInfo.isVip ==1}">¥
|
||||
<view v-if="shopInfo.isVip ==1 && shopInfo.isMemberPrice==1"
|
||||
:class="{lineThrough: shopInfo.isVip ==1 && shopInfo.isMemberPrice==1}">
|
||||
¥
|
||||
</view>
|
||||
<text class="money_num"
|
||||
:class="{lineThrough: shopInfo.isVip ==1}">{{ item1.salePrice }}</text>
|
||||
:class="{lineThrough: shopInfo.isVip ==1 && shopInfo.isMemberPrice==1}">{{ item1.salePrice }}</text>
|
||||
<text v-if="item1.unitName">/{{item1.unitName}}</text>
|
||||
</view>
|
||||
|
||||
@@ -308,7 +316,7 @@
|
||||
<view class="price">
|
||||
<text class="i">¥</text>
|
||||
<text
|
||||
class="num">{{shopInfo.isVip ==1?specifications.item.memberPrice:specifications.item.salePrice}}</text>
|
||||
class="num">{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?specifications.item.memberPrice:specifications.item.salePrice}}</text>
|
||||
<text class="i">/{{specifications.item.unitName}}</text>
|
||||
</view>
|
||||
<view class="operation-wrap">
|
||||
@@ -423,17 +431,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const shopExtend = reactive({
|
||||
autokey: "index_bg",
|
||||
createTime: "2024-08-27T06:59:35.000+00:00",
|
||||
id: 17,
|
||||
name: "首页",
|
||||
shopId: 29,
|
||||
type: "img",
|
||||
updateTime: null,
|
||||
value: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240827/4e58171d813a45269997085b145b8bfe.png"
|
||||
})
|
||||
const shopExtend = uni.cache.get('shopTable').shopExtendMap.index_bg
|
||||
|
||||
// 计算高度
|
||||
const navScroll = ref(null)
|
||||
@@ -875,6 +873,10 @@
|
||||
showCart.value = false
|
||||
}
|
||||
|
||||
if (Message.type == 'bc') {
|
||||
console.log(Message)
|
||||
}
|
||||
|
||||
// 初始化购物车数据
|
||||
if (Message.operate_type == "shopping_init") {
|
||||
cartList.value = Message.data
|
||||
@@ -886,7 +888,7 @@
|
||||
}
|
||||
|
||||
// 添加或者减少购物后返回
|
||||
if (Message.operate_type == 'shopping_add' || Message.operate_type == 'sopping_edit') {
|
||||
if (Message.operate_type == 'shopping_add' || Message.operate_type == 'sopping_edit' || Message.type == 'bc') {
|
||||
[Message.data].forEach((objA) => {
|
||||
const index = cartList.value.findIndex((objB) => objB.id == objA.id);
|
||||
if (index !== -1) {
|
||||
|
||||
Reference in New Issue
Block a user