支付宝兼容,排队预约修改,订单逻辑修改

This commit is contained in:
GaoHao
2024-09-24 15:22:34 +08:00
parent 861e97b775
commit 5f03e44701
31 changed files with 823 additions and 737 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -226,6 +226,8 @@
</view>
</view>
</view>
<view class="placedOrderTip"><u-avatar :src="src" shape="circle"></u-avatar><view style="margin-left: 8rpx;">已下单菜品</view></view>
<!-- 购物车 -->
<u-popup :show="showCart" :round="20" :safeAreaInsetBottom="false" :zIndex="98" :overlayStyle="{ zIndex: 98 }"
@@ -241,31 +243,41 @@
<scroll-view scroll-y class="scroll-view">
<view class="list-wrap">
<view class="shop-item" v-for="(item,index) in cartLists.data" :key="item.id">
<view class="cover">
<u-image :src="item.coverImg" width="120" height="120"></u-image>
</view>
<view class="info">
<view class="name"> {{ item.name }} </view>
<view class="select-sku-wrap"> {{ item.skuName }} </view>
<view class="price-wrap" style="padding-top: 0;">
<view class="price">
<text class="i"></text>
<text class="num">{{ item.salePrice }}</text>
</view>
<view class="operation-wrap">
<view class="btn" v-if="item.number" >
<u-icon name="minus-circle-fill" size="50"></u-icon>
<view class="btnClick" @click="cartListadd(item,index,'-')"></view>
<view class="shop-item-content">
<view class="cover">
<u-image :src="item.coverImg" width="120" height="120"></u-image>
</view>
<view class="info">
<view class="name"> {{ item.name }} </view>
<view class="select-sku-wrap"> {{ item.skuName }} </view>
<view class="price-wrap" style="padding-top: 0;">
<view class="price">
<text class="i"></text>
<text class="num">{{ item.salePrice }}</text>
</view>
<text class="num" v-if="item.number">{{ item.number }}</text>
<view class="btn">
<u-icon name="plus-circle-fill" :color="item.isVip == 1 ? '#CECECE' : '#E9AB7A'" size="50"></u-icon>
<view class="btnClick" @click="cartListadd(item,index,'+')"></view>
<view class="operation-wrap">
<view class="btn" v-if="item.number" >
<u-icon name="minus-circle-fill" size="50"></u-icon>
<view class="btnClick" @click="cartListadd(item,index,'-')"></view>
</view>
<text class="num" v-if="item.number">{{ item.number }}</text>
<view class="btn">
<u-icon name="plus-circle-fill" :color="item.isVip == 1 ? '#CECECE' : '#E9AB7A'" size="50"></u-icon>
<view class="btnClick" @click="cartListadd(item,index,'+')"></view>
</view>
</view>
</view>
</view>
</view>
<view class="shop-item-remark">
<view class="label">备注</view>
<u--input
placeholder="商品备注(选填)"
border="none"
v-model="item.remark"
></u--input>
</view>
</view>
</view>
</scroll-view>
@@ -378,6 +390,7 @@
</view>
</u-popup>
<popupad :forceUpdate="forceUpdate" :showPosition="'make_order'"></popupad>
</view>
</template>
@@ -427,6 +440,7 @@
forceUpdate: false,
shopExtend: null,
shopId: null,
tableCode: null,
}
},
onPageScroll(e) {
@@ -456,10 +470,14 @@
}
},
onLoad(e) {
console.log(e)
if (e.q) {
this.tableCode = this.getQueryString(decodeURIComponent(e.q), 'code')
uni.cache.set('tableCode', this.tableCode)
}
if ( e.tableCode ) {
this.tableCode = e.tableCode
}
},
onUnload() {
if (this.socketTicket) {
@@ -581,6 +599,7 @@
this.shopId = res.data.storeInfo.id;
this.shopInfo = res.data;
this.productqueryProduct() //list 数据
this.getShopUserInfo() //list 数据
this.handlemessage() //监听websocket返回
this.getShopExtend();
} else {
@@ -590,7 +609,21 @@
}
},
/**
* 获取门店会员信息
*/
async getShopUserInfo() {
let res = await this.api.shopUserInfo({
"shopId": this.shopId,
"userId": uni.cache.get('userInfo').id,
})
if (res.code == 0) {
this.shopUserInfo = res.data;
uni.cache.set('shopUserInfo', res.data)
}
},
/**
* 图片加载
*/
@@ -1022,8 +1055,9 @@
})
return false
}
console.log(JSON.stringify(this.shopInfo.storeInfo))
uni.navigateTo({
url: `/pages/order_food/confirm_order?storeInfo=${JSON.stringify(this.shopInfo.storeInfo)}&cartList=${JSON.stringify(this.cartLists)}`
url: `/pagesOrder/confirm_order/index?storeInfo=${encodeURIComponent(JSON.stringify(this.shopInfo.storeInfo))}&cartLists=${JSON.stringify(this.cartLists)}&tableCode=${this.tableCode}`
});
},
@@ -1822,8 +1856,23 @@
.shop-item {
display: flex;
flex-direction: column;
padding-bottom: $paddingSize;
.shop-item-content{
display: flex;
}
.shop-item-remark{
display: flex;
align-items: center;
padding-right: 180rpx;
margin-top: 10rpx;
.label{
font-size: 28rpx;
color: #666;
margin-right: 20rpx;
}
}
.langcover {
position: relative;
}
@@ -1951,7 +2000,25 @@
}
}
.placedOrderTip{
width: 200rpx;
height: 60rpx;
display: flex;
align-items: center;
position: fixed;
justify-content: center;
right: 0;
top: 0;
bottom: 0;
margin: auto;
z-index: 99;
background-color: #fff;
font-weight: 400;
font-size: 24rpx;
color: #333333;
border-radius: 40rpx 0rpx 0rpx 40rpx;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0,0,0,0.16);
}
}
@@ -2250,5 +2317,6 @@
}
}
}
</style>

View File

@@ -125,31 +125,41 @@
<scroll-view scroll-y class="scroll-view">
<view class="list-wrap">
<view class="shop-item" v-for="(item,index) in cartLists.data" :key="item.id">
<view class="cover">
<u-image :src="item.coverImg" width="120" height="120"></u-image>
</view>
<view class="info">
<view class="name"> {{ item.name }} </view>
<view class="select-sku-wrap"> {{ item.skuName }} </view>
<view class="price-wrap" style="padding-top: 0;">
<view class="price">
<text class="i"></text>
<text class="num">{{ item.salePrice }}</text>
</view>
<view class="operation-wrap">
<view class="btn" v-if="item.number" >
<u-icon name="minus-circle-fill" color="#E9AB7A" size="50"></u-icon>
<view class="btnClick" @click="cartListadd(item,'-')"></view>
<view class="shop-item-content">
<view class="cover">
<u-image :src="item.coverImg" width="120" height="120"></u-image>
</view>
<view class="info">
<view class="name"> {{ item.name }} </view>
<view class="select-sku-wrap"> {{ item.skuName }} </view>
<view class="price-wrap" style="padding-top: 0;">
<view class="price">
<text class="i"></text>
<text class="num">{{ item.salePrice }}</text>
</view>
<text class="num" v-if="item.number">{{ item.number }}</text>
<view class="btn">
<u-icon name="plus-circle-fill" :color="item.isVip == 1 ? '#CECECE' : '#E9AB7A'" size="50"></u-icon>
<view class="btnClick" @click="cartListadd(item,'+')"></view>
<view class="operation-wrap">
<view class="btn" v-if="item.number" >
<u-icon name="minus-circle-fill" color="#E9AB7A" size="50"></u-icon>
<view class="btnClick" @click="cartListadd(item,'-')"></view>
</view>
<text class="num" v-if="item.number">{{ item.number }}</text>
<view class="btn">
<u-icon name="plus-circle-fill" :color="item.isVip == 1 ? '#CECECE' : '#E9AB7A'" size="50"></u-icon>
<view class="btnClick" @click="cartListadd(item,'+')"></view>
</view>
</view>
</view>
</view>
</view>
<view class="shop-item-remark">
<view class="label">备注</view>
<u--input
placeholder="商品备注(选填)"
border="none"
v-model="item.remark"
></u--input>
</view>
</view>
</view>
</scroll-view>
@@ -792,7 +802,7 @@
return false
}
uni.redirectTo({
url: `/pages/order_food/confirm_order?storeInfo=${JSON.stringify(this.shopInfo.storeInfo)}&cartList=${JSON.stringify(this.cartLists)}`
url: `/pagesOrder/confirm_order/index?storeInfo=${JSON.stringify(this.shopInfo.storeInfo)}&cartList=${JSON.stringify(this.cartLists)}`
});
},
@@ -1399,8 +1409,23 @@
.shop-item {
display: flex;
flex-direction: column;
padding-bottom: $paddingSize;
.shop-item-content{
display: flex;
}
.shop-item-remark{
display: flex;
align-items: center;
padding-right: 180rpx;
margin-top: 10rpx;
.label{
font-size: 28rpx;
color: #666;
margin-right: 20rpx;
}
}
.langcover {
position: relative;
}