From a3e1d951e6be06d6841f74b45d3c261b71769ae0 Mon Sep 17 00:00:00 2001
From: GaoHao <1210693421@qq.com>
Date: Fri, 27 Sep 2024 15:28:37 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/popupad.vue | 1 -
framework/5-pro-ext.js | 1 -
pages/order_food/components/shoppingCart.vue | 353 +++
.../components/shoppingCartBilling.vue | 189 ++
pages/order_food/order_food - 副本.vue | 2363 +++++++++++++++++
pages/order_food/order_food.vue | 459 +---
pages/order_food/order_food_search - 副本.vue | 1567 +++++++++++
pages/order_food/order_food_search.vue | 414 +--
pagesOrder/confirm_order/index.vue | 24 +-
pagesOrder/orderAMeal/index.vue | 2 -
10 files changed, 4528 insertions(+), 845 deletions(-)
create mode 100644 pages/order_food/components/shoppingCart.vue
create mode 100644 pages/order_food/components/shoppingCartBilling.vue
create mode 100644 pages/order_food/order_food - 副本.vue
create mode 100644 pages/order_food/order_food_search - 副本.vue
diff --git a/components/popupad.vue b/components/popupad.vue
index 8216d61..742e3be 100644
--- a/components/popupad.vue
+++ b/components/popupad.vue
@@ -54,7 +54,6 @@
watch: {
forceUpdate(val,oldval) {
// 在 forceUpdate 改变时执行更新操作
- console.log(val,oldval)
let time = uni.cache.get('popUpTime') ? new Date().getTime() - uni.cache.get('popUpTime') : 1000;
if ( time >= 1000 ) {
uni.cache.set('popUpTime', new Date().getTime())
diff --git a/framework/5-pro-ext.js b/framework/5-pro-ext.js
index 2425d99..4520b87 100644
--- a/framework/5-pro-ext.js
+++ b/framework/5-pro-ext.js
@@ -13,7 +13,6 @@ uni.pro.uploadFile = (obj) => {
uni.pro.navigateTo = (pageName, extras = {}) => {
let url = uni.url.getUrl(pageName, extras)
- console.log(url)
return uni.navigateTo({
url
})
diff --git a/pages/order_food/components/shoppingCart.vue b/pages/order_food/components/shoppingCart.vue
new file mode 100644
index 0000000..2f7f263
--- /dev/null
+++ b/pages/order_food/components/shoppingCart.vue
@@ -0,0 +1,353 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+ {{ item.skuName }}
+
+
+
+ ¥
+ {{ item.salePrice }}
+
+
+
+
+
+
+ {{ item.number }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/order_food/components/shoppingCartBilling.vue b/pages/order_food/components/shoppingCartBilling.vue
new file mode 100644
index 0000000..300ed43
--- /dev/null
+++ b/pages/order_food/components/shoppingCartBilling.vue
@@ -0,0 +1,189 @@
+
+
+
+
+
+
+
+ {{cartLists_count<99?cartLists_count:'99+'}}
+
+
+ ¥
+ {{cartLists.amount||'0.00'}}
+
+
+ 去结算
+
+
+
+
+
+
+
+
+
diff --git a/pages/order_food/order_food - 副本.vue b/pages/order_food/order_food - 副本.vue
new file mode 100644
index 0000000..16cbad7
--- /dev/null
+++ b/pages/order_food/order_food - 副本.vue
@@ -0,0 +1,2363 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ shopInfo.storeInfo.shopName }}
+
+
+ 距离您{{ shopInfo.distance }}
+
+
+
+ 营业时间:{{ (shopInfo.storeInfo.businessStartDay || '——') +'至'+ (shopInfo.storeInfo.businessEndDay || '——') +' '+ (shopInfo.storeInfo.businessTime || '')}}
+
+
+ 查看
+
+
+
+
+ 本店招牌菜
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+ 本店回头客第{{index+1}}名
+
+
+ 招牌
+
+
+
+ 月售{{item.stockNumber}}
+
+
+
+
+
+
+
+ ¥{{item.lowPrice}}/{{item.unitSnap}}
+
+
+
+
+ 非可售时间
+ 已售罄
+
+
+
+
+
+ ¥{{item.lowPrice}}/{{item.unitSnap}}
+
+
+
+
+ {{item.suit}}{{item.unitSnap}}起点
+ {{item.cartNumber<99?item.cartNumber:'99+'}}
+
+
+
+
+
+
+
+ 选规格
+ {{item.cartNumber<99?item.cartNumber:'99+'}}
+
+
+
+
+
+
+ {{ item.cartNumber }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+ TOP{{index1+1}}
+
+
+ {{ item1.name }}
+ 本店回头客第{{index1+1}}名
+ {{item1.shortTitle?item1.shortTitle:''}}
+ 月售{{item1.stockNumber}}
+
+
+
+ ¥{{ item1.lowPrice }}/{{item1.unitSnap}}
+
+
+ 非可售时间
+ 已售罄
+
+
+
+
+ ¥{{ item1.lowPrice }}/{{item1.unitSnap}}
+
+
+
+ {{item1.suit}}{{item1.unitSnap}}起点
+ {{item1.cartNumber<99?item1.cartNumber:'99+'}}
+
+
+
+
+
+
+ 选规格
+ {{item1.cartNumber<99?item1.cartNumber:'99+'}}
+
+
+
+
+
+
+
+ {{ item1.cartNumber }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{cartLists_count<99?cartLists_count:'99+'}}
+
+
+ ¥
+ {{cartLists.amount||'0.00'}}
+
+
+ 去结算
+
+
+
+
+ 已下单菜品
+
+
+
+
+
+
+
+
+
+
+
+ {{ shopInfo.storeInfo.shopName }}
+
+
+
+
+ 商家信息
+
+
+ 营业时间:
+ {{ (shopInfo.storeInfo.businessStartDay || '——') +'至'+ (shopInfo.storeInfo.businessEndDay || '——') +' '+ (shopInfo.storeInfo.businessTime || '')}}
+
+
+ 商家地址:
+ {{ shopInfo.storeInfo.address }}
+
+
+ 商家电话:
+ {{ shopInfo.storeInfo.phone }}
+
+
+ 商家公告
+
+
+ 公告:
+ {{ shopInfo.storeInfo.detail }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{specifications.name}}
+
+ 本店回头客第{{specifications.indexb+1}}名
+ {{specifications.shortTitle?specifications.shortTitle:''}}
+
+
+
+ {{item.name}}
+
+
+
+
+ {{item1.name}}
+
+ 下架
+
+
+ 售罄
+
+
+
+
+
+
+
+
+
+ ¥
+ {{salePrice}}
+ /{{specifications.unitSnap}}
+
+
+
+
+
+
+
+ {{amountcartNumber}}
+
+
+
+
+
+
+
+ {{skuidname.toString()}}
+
+
+ {{skuBtnText}}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/order_food/order_food.vue b/pages/order_food/order_food.vue
index eb90d62..171e454 100644
--- a/pages/order_food/order_food.vue
+++ b/pages/order_food/order_food.vue
@@ -206,85 +206,14 @@
-
-
-
-
-
-
-
- {{cartLists_count<99?cartLists_count:'99+'}}
-
-
- ¥
- {{cartLists.amount||'0.00'}}
-
-
- 去结算
-
-
-
- 已下单菜品
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.name }}
- {{ item.skuName }}
-
-
-
- ¥
- {{ item.salePrice }}
-
-
-
-
-
-
- {{ item.number }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ 已下单菜品
@@ -399,10 +328,14 @@
import navseat from '@/components/navseat.vue'
import webSocketUtils from '@/common/js/websocket.js';
import popupad from '@/components/popupad.vue'
+ import shoppingCart from './components/shoppingCart.vue'
+ import shoppingCartBilling from './components/shoppingCartBilling.vue'
export default {
components: {
navseat,
- popupad
+ popupad,
+ shoppingCart,
+ shoppingCartBilling
},
data() {
return {
@@ -437,7 +370,6 @@
showCart: false,
lastbottom: '', //元素最低端的距离
scrollxleft: true,
- orderdetailFlag: true,
forceUpdate: false,
shopExtend: null,
shopId: null,
@@ -472,7 +404,6 @@
}
},
onLoad(e) {
- console.log(e)
if (e.q) {
this.tableCode = this.getQueryString(decodeURIComponent(e.q), 'code')
uni.cache.set('tableCode', this.tableCode)
@@ -503,7 +434,6 @@
},
async onShow() {
let _this = this;
- this.orderdetailFlag = true;
uni.pageScrollTo({
scrollTop: 0,
@@ -727,7 +657,7 @@
}
}
},
-
+
/**
* 添加购物车
*/
@@ -759,55 +689,24 @@
"userId": uni.cache.get('userInfo').id,
"tableId": this.tableCode,
}
- this.addCart(params)
- },
-
- /**
- * 购物车加减
- * @param {Object} item
- * @param {Object} index
- * @param {Object} a
- */
- async cartListadd(item, index, c) {
- try {
- if ( c == "+" && item.isVip == 1){
- return;
- }
- let params = {
- "skuId": item.skuId,
- "num": c == '+' ? item.number + 1 : item.number - 1, //数量
- "type": c == '+' ? 1 : 0,
- "isVip": item.isVip,
- "productId": item.productId, //商品id
- "note": item.note,
- "shopId": this.shopId,
- "userId": uni.cache.get('userInfo').id,
- "tableId": this.tableCode,
- }
- this.addCart(params);
- } catch (e) {
- //TODO handle the exception
- }
+ this.addCart(params);
},
/**
- * 菜品备注修改
+ * 关闭购物车
*/
- productBlur ( item ) {
- let params = {
- "skuId": item.skuId,
- "num": item.number, //数量
- "type": item.type,
- "isVip": item.isVip,
- "productId": item.productId, //商品id
- "note": item.note,
- "shopId": this.shopId,
- "userId": uni.cache.get('userInfo').id,
- "tableId": this.tableCode,
- }
- this.addCart(params);
+ close (e) {
+ this.showCart = e;
},
+ /**
+ * 显示购物车
+ */
+ isOpen (e) {
+ this.showCart = e;
+ },
+
+
/**
* 添加到购物车
*/
@@ -816,21 +715,9 @@
if (res.code == 0) {
this.showShopsku = false;
this.pagemetashow = false;
- // this.$set(this, 'amountcartNumber', 0)
}
},
- /**
- * 清空购物车
- */
- async cartclear() {
- let res = await this.api.cleanCart({
- "shopId": this.shopId,
- "tableId": this.tableCode,
- })
- },
-
-
/**
* 商品数量\购物车数量处理
*/
@@ -1053,6 +940,7 @@
})
this.salePrice = res.data.salePrice // 价格
let data = null;
+ console.log(a)
if (a == 1) { //1添加购物车 2是websocket返回这个商品的价格(应为不同的多规格商品返回不同的价格)
let params = {
"skuId": res.data.id,
@@ -1065,6 +953,7 @@
"userId": uni.cache.get('userInfo').id,
"tableId": this.tableCode,
}
+ //添加到购物车
this.addCart(params);
} else {
this.skuId = res.data.id;
@@ -1085,26 +974,6 @@
} catch (e) {}
},
- /**
- * 结算直接生成订单
- */
- orderdetail() {
- if (!this.orderdetailFlag) {
- return;
- }
- this.orderdetailFlag = false;
- if (this.cartLists.data.length == 0) {
- uni.showToast({
- title: '请先添加商品',
- icon: 'none'
- })
- return false
- }
- uni.navigateTo({
- url: `/pagesOrder/confirm_order/index?storeInfo=${encodeURIComponent(JSON.stringify(this.shopInfo.storeInfo))}&cartLists=${JSON.stringify(this.cartLists)}&tableCode=${this.tableCode||''}&dinersNum=${this.dinersNum||''}`
- });
-
- },
/**
* 商家信息显示
@@ -1118,7 +987,6 @@
* @param {Object} msg
*/
getMessage(msg) { //wss 回显数据
- console.log(msg)
if (msg == 1) { // 网络在连接
this.fixedtrue = true
return false
@@ -1770,280 +1638,9 @@
}
}
- .cart-wrap {
- width: 100%;
- padding: 0 20rpx;
- box-sizing: border-box;
- position: fixed;
- bottom: 40rpx;
- left: 0;
- z-index: 99;
+
- .cart-content {
- display: flex;
- align-items: center;
- height: 128rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 0rpx 20rpx 2rpx rgba(0, 0, 0, 0.15);
- border-radius: 58rpx;
- padding: 0 36rpx;
- box-sizing: border-box;
-
- .left {
- flex: 1;
- display: flex;
- align-items: center;
- position: relative;
-
- .iconBox {
- position: relative;
- }
-
- .icon {
- width: 76rpx;
- height: 88rpx;
- margin-left: 22rpx;
- }
-
- .u-badge {
- position: absolute;
- top: -30rpx;
- right: -30rpx;
- background-color: #FF4B33;
- color: #fff;
- border-radius: 58rpx;
- padding: 5rpx 14rpx;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 20rpx;
- }
-
- .i,
- .num {
- color: #333;
- }
-
- .i {
- font-size: 20upx;
- position: relative;
- top: 4upx;
- margin-left: 64rpx;
- }
-
- .num {
- font-size: 42upx;
- font-weight: bold;
- }
- }
-
- .btn {
- height: 100%;
- width: 40%;
- display: flex;
- align-items: center;
- justify-content: flex-end;
-
- .t {
- width: 160rpx;
- height: 64rpx;
- line-height: 64rpx;
- text-align: center;
- background: #E7AE7B;
- border-radius: 36rpx 36rpx 36rpx 36rpx;
- border: 2rpx solid #E8AD7B;
- font-weight: bold;
- font-size: 28rpx;
- color: #FFFFFF;
- }
- }
- }
- }
-
- .cart-list-wrap {
- .cart-header {
- display: flex;
- height: 72rpx;
- background-color: #F2F2F2;
- align-items: center;
- justify-content: space-between;
- padding: 20upx $paddingSize;
- border-radius: 20upx 20upx 0 0;
-
- .num {
- font-weight: 400;
- font-size: 28rpx;
- color: #333333;
- }
-
- .clear {
- display: flex;
- align-items: center;
-
- .t {
- font-size: 24upx;
- color: #999;
- margin-left: 4upx;
- }
- }
- }
-
- .scroll-view {
- max-height: 50vh;
- margin-bottom: 190rpx;
- }
-
- .list-wrap {
- padding: $paddingSize 0 0 $paddingSize;
- }
-
- .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;
- }
-
- .langcover::after {
- content: '加载中..';
- position: absolute;
- top: 0;
- left: 0;
- height: 100%;
- width: 100%;
- background-color: #e8e8e8;
- color: #6b6b6b;
- border-radius: 10rpx;
- text-align: center;
- line-height: 180rpx;
- z-index: 1;
- }
-
- .info {
- flex: 1;
- padding-left: 20upx;
- padding-right: $paddingSize;
-
- .name {
- font-size: 28upx;
- font-weight: bold;
- color: #333;
- margin-bottom: 5rpx;
- }
-
- .select-sku-wrap {
- font-weight: 400;
- font-size: 24rpx;
- color: #999999;
- }
-
- .price-wrap {
- margin-top: 16rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
-
- .price {
- display: flex;
- align-items: flex-end;
-
- .i,
- .num {
- font-weight: bold;
- font-size: 32rpx;
- color: #333333;
- }
-
- .i {
- position: relative;
- bottom: 4upx;
- }
-
- .num {}
- }
-
- .sku-wrap {
- padding: 6upx 16upx;
- background-color: $color-priamry;
- border-radius: 12upx;
- display: flex;
- align-items: center;
- justify-content: center;
- position: relative;
-
- .t {
- font-size: 24upx;
- font-weight: bold;
- }
-
- .dot {
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 20upx;
- position: absolute;
- padding: 2upx 12upx;
- border-radius: 8upx;
- background-color: $numColor;
- color: #fff;
- position: absolute;
- top: -14upx;
- right: -8upx;
- }
-
- }
-
- .operation-wrap {
- display: flex;
- align-items: center;
-
- .num {
- font-size: 32upx;
- padding: 0 16upx;
- }
-
- .btn {
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- position: relative;
- .btnClick{
- width: 100rpx;
- height: 100rpx;
- position: absolute;
- // bottom: 0;
- }
- .btnClick.l{
- right: 0;
- }
- .btnClick.r{
- left: 0;
- }
- }
- }
- }
- }
- }
-
- }
+
.placedOrderTip{
width: 200rpx;
height: 60rpx;
diff --git a/pages/order_food/order_food_search - 副本.vue b/pages/order_food/order_food_search - 副本.vue
new file mode 100644
index 0000000..0c5f4a7
--- /dev/null
+++ b/pages/order_food/order_food_search - 副本.vue
@@ -0,0 +1,1567 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TOP{{index1+1}}
+
+
+
+ {{ item1.name }}
+ 本店回头客第{{index1+1}}名
+ {{item1.shortTitle?item1.shortTitle:''}}
+ 月售{{item1.stockNumber}}
+
+
+
+ ¥{{ item1.lowPrice }}/{{item1.unitSnap}}
+
+
+ 非可售时间
+ 已售罄
+
+
+
+
+ ¥{{ item1.lowPrice }}/{{item1.unitSnap}}
+
+
+
+ {{item1.suit}}{{item1.unitSnap}}起点
+ {{item1.cartNumber<99?item1.cartNumber:'99+'}}
+
+
+
+
+
+
+ 选规格
+ {{item1.cartNumber<99?item1.cartNumber:'99+'}}
+
+
+
+
+
+
+
+ {{ item1.cartNumber }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{cartLists_count<99?cartLists_count:'99+'}}
+
+
+ ¥
+ {{cartLists.amount||'0.00'}}
+
+
+ 去结算
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+ {{ item.skuName }}
+
+
+
+ ¥
+ {{ item.salePrice }}
+
+
+
+
+
+
+ {{ item.number }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{specifications.name}}
+
+ 本店回头客第{{specifications.indexb+1}}名
+ {{specifications.shortTitle?specifications.shortTitle:''}}
+
+
+
+ {{item.name}}
+
+
+
+ {{item1.name}}
+
+ 下架
+
+
+ 售罄
+
+
+
+
+
+
+
+
+
+ ¥
+ {{salePrice}}
+ /{{specifications.unitSnap}}
+
+
+
+
+
+
+
+ {{amountcartNumber}}
+
+
+
+
+
+
+
+ {{skuidname.toString()}}
+
+
+ {{skuBtnText}}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/order_food/order_food_search.vue b/pages/order_food/order_food_search.vue
index 0c5f4a7..e92de25 100644
--- a/pages/order_food/order_food_search.vue
+++ b/pages/order_food/order_food_search.vue
@@ -90,83 +90,11 @@
-
-
-
-
-
-
-
- {{cartLists_count<99?cartLists_count:'99+'}}
-
-
- ¥
- {{cartLists.amount||'0.00'}}
-
-
- 去结算
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.name }}
- {{ item.skuName }}
-
-
-
- ¥
- {{ item.salePrice }}
-
-
-
-
-
-
- {{ item.number }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -241,9 +169,13 @@