From 4d997b7b4f843dba804a89ae168854482823561c Mon Sep 17 00:00:00 2001
From: yangwenhua <1289978696@qq.com>
Date: Thu, 5 May 2022 10:01:24 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5qsqd=E5=88=86=E6=94=AF?=
=?UTF-8?q?=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/App.vue | 2 +-
.../FeedListPopup/FeedListPopup.vue | 233 ++++++++++++-
src/components/GoodsList/GoodsList.vue | 21 ++
src/pages.json | 11 +-
src/pages/confirmOrder/confirmOrder.vue | 64 ++++
src/pages/food/food.vue | 322 +++++++++++++++++-
src/pages/giveNoodle/giveNoodle.vue | 2 +-
src/pages/homeNew/homeNew.vue | 35 +-
.../underDevelopment/underDevelopment.vue | 63 ++++
src/store/index.js | 27 ++
10 files changed, 748 insertions(+), 32 deletions(-)
create mode 100644 src/pages/underDevelopment/underDevelopment.vue
diff --git a/src/App.vue b/src/App.vue
index 098e59f..6a3a97f 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -4,7 +4,7 @@
import store from "@/store/index.js";
export default {
globalData: {
- imageServer: 'https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/company/QSQD/', //图片服务器地址
+ imageServer: 'https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/company/QSQD/', //图片服务器地址且时且多
user: {
gender: 0,
openId: '',
diff --git a/src/components/FeedListPopup/FeedListPopup.vue b/src/components/FeedListPopup/FeedListPopup.vue
index b4a3a16..08889f6 100644
--- a/src/components/FeedListPopup/FeedListPopup.vue
+++ b/src/components/FeedListPopup/FeedListPopup.vue
@@ -46,7 +46,7 @@
-
+
{{addFood.name}}
@@ -67,10 +67,83 @@
+
+
+
+
+ {{feed.name}}
+
+
+
+
+
+
+
+
+ {{addFood.name}}
+
+
+ {{addFood.company ? addFood.company : '份'}}
+
+
+
+ ¥{{addFood.price}}
+
+
+
+
+
+ {{addFood.count}}
+
+
+
+
+
+
选好了
+
+
+
+
+ {{currentChoose.name}}
+
+
+
+
+ {{specificationType.name}}
+
+
+
+ {{specifiDetail.name}}
+
+
+
+
+
+
+ 已选规格:
+
+
+
+ {{specifiItem.name}}
+
+
+
+
+
+ 总计
+ ¥{{specificationTotalPrice}}
+
+
+
+ 加入购物车
+
+
+
+
@@ -81,6 +154,8 @@
data() {
return {
imageServer: getApp().globalData.imageServer,
+ currentChoose: {}, //当前已选商品
+ showSpecification: false
};
},
computed: {
@@ -114,6 +189,19 @@
},
currentGoods() {
return store.state.currentGoods;
+ },
+ specificationTotalPrice() {
+ let price = 0;
+ if (this.currentChoose.specification) {
+ this.currentChoose.specification.forEach(specifiType => {
+ specifiType.foods.forEach(specifiItem => {
+ if (specifiItem.isSelect) {
+ price += specifiItem.price
+ }
+ });
+ });
+ }
+ return price;
}
},
methods: {
@@ -133,6 +221,43 @@
onSure() {
store.commit('onStapleFoodPlusFromList');
this.$emit('onFeedPopuoClose');
+ },
+ //套餐减1
+ onSetMealCountReduce(setMeal) {
+ if (setMeal.count === 0) return;
+ store.commit('onSetMealCountReduce', setMeal);
+ },
+ //套餐加1
+ onSetMealCountPlus(setMeal) {
+ if (setMeal.specification && setMeal.specification.length > 0) {
+ this.currentChoose = setMeal;
+ this.openChooseSpeci();
+ } else {
+ store.commit('onSetMealCountPlus', setMeal);
+ }
+ },
+ closeChooseSpeci() {
+ this.showSpecification = false;
+ },
+ openChooseSpeci() {
+ this.showSpecification = true;
+ },
+ onChooseSpecifi(type, chooseIndex) {
+ if (type.singleChoice) {
+ type.foods.forEach((item, index) => {
+ if (chooseIndex === index) {
+ item.isSelect = true;
+ } else {
+ item.isSelect = false;
+ }
+ });
+ } else {
+ type.foods[chooseIndex].isSelect = !type.foods[chooseIndex].isSelect;
+ }
+ },
+ onJoinCar() {
+ store.commit('onSetMealCountPlus', this.currentChoose);
+ this.closeChooseSpeci();
}
}
}
@@ -218,7 +343,7 @@
height: 30rpx;
}
- .feed-list {
+ .feed-list, .set-meal-list {
max-height: 450rpx;
overflow: scroll;
margin: 40rpx 0;
@@ -229,14 +354,20 @@
}
.feed-cover {
+ flex-shrink: 0;
width: 100rpx;
height: 100rpx;
margin-right: 30rpx;
}
+ .feed-info-center {
+ flex-grow: 1;
+ }
+
.feed-info {
display: flex;
align-items: center;
+ margin-bottom: 10rpx;
}
.feed-name-box {
@@ -251,7 +382,8 @@
}
.feed-buy-count {
- width: 200rpx;
+ flex-shrink: 0;
+ width: 180rpx;
display: flex;
justify-content: space-around;
align-items: center;
@@ -303,4 +435,99 @@
top: 180rpx;
padding: 0 !important;
}
+
+ /* 套餐 */
+ .set-meal-list .feed-title {
+ font-size: 30rpx;
+ font-weight: 700;
+ }
+
+ /* 选规格 */
+ .specifi-box {
+ width: 680rpx;
+ padding: 30rpx;
+ box-sizing: border-box;
+ }
+
+ .specifi-head {
+ font-size: 34rpx;
+ font-weight: 900;
+ }
+
+ .specifi-type-list, .specifi-type-item {
+ margin: 20rpx 0;
+ }
+
+ .specifi-item-title {
+ margin-bottom: 10rpx;
+ font-size: 28rpx;
+ color: #999;
+ }
+
+ .specifi-detail-list {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ }
+
+ .specifi-detail-item {
+ margin-right: 10rpx;
+ margin-bottom: 10rpx;
+ border: 2rpx solid #dedede;
+ padding: 10rpx 40rpx;
+ border-radius: 10rpx;
+ font-size: 28rpx;
+ }
+
+ .specifi-detail-select {
+ border-color: #51A97D;
+ color: #51A97D;
+ }
+
+ .specifi-choosed-card {
+ background-color: rgb(250, 250, 250);
+ font-size: 26rpx;
+ padding: 10rpx 10rpx;
+ }
+
+ .specifi-choosed-card, .specifi-choosed-list {
+ display: flex;
+ flex-wrap: wrap;
+ }
+
+ .specifi-choosed-item::after {
+ content: '、';
+ }
+
+ .specifi-total-card {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 100rpx;
+ font-size: 30rpx;
+ }
+
+ .specifi-total-right {
+ display: flex;
+ align-items: center;
+ }
+
+ .specifi-total-price {
+ font-size: 36rpx;
+ color: #F94352;
+ }
+
+ .specifi-total-right {
+ display: flex;
+ align-items: center;
+ background-color: #51A97D;
+ color: #FFF;
+ padding: 10rpx 40rpx;
+ border-radius: 10rpx;
+ }
+
+ .specifi-total-right .iconfont {
+ color: #FFF;
+ margin-right: 20rpx;
+ }
diff --git a/src/components/GoodsList/GoodsList.vue b/src/components/GoodsList/GoodsList.vue
index f95eb85..d9a8861 100644
--- a/src/components/GoodsList/GoodsList.vue
+++ b/src/components/GoodsList/GoodsList.vue
@@ -167,6 +167,27 @@
currentGoods = JSON.parse(JSON.stringify(food));
store.commit('initCurrentGoods', currentGoods);
this.isShowFeedPopup = true;
+ } else if (food.setMealList && food.setMealList.length > 0) {
+ food.setMealList.forEach(item => {
+ item.foods.forEach(additional => {
+ additional.count = 0;
+ additional.sourceCount = 0;
+ if (additional.specification && additional.specification.length > 0) {
+ additional.specification.forEach(specifiType => {
+ specifiType.foods.forEach((specifiItem, specifiIndex) =>{
+ if (specifiIndex === 0) {
+ specifiItem.isSelect = true;
+ } else {
+ specifiItem.isSelect = false;
+ }
+ });
+ });
+ }
+ });
+ });
+ currentGoods = JSON.parse(JSON.stringify(food));
+ store.commit('initCurrentGoods', currentGoods);
+ this.isShowFeedPopup = true;
} else {
currentGoods = JSON.parse(JSON.stringify(food));
store.commit('initCurrentGoods', currentGoods);
diff --git a/src/pages.json b/src/pages.json
index 935a7d7..ddd8e2a 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -296,7 +296,16 @@
"path" : "pages/homeNew/homeNew",
"style" :
{
- "navigationBarTitleText": "",
+ "navigationBarTitleText": "首页",
+ "enablePullDownRefresh": false
+ }
+
+ }
+ ,{
+ "path" : "pages/underDevelopment/underDevelopment",
+ "style" :
+ {
+ "navigationBarTitleText": "功能开发中",
"enablePullDownRefresh": false
}
diff --git a/src/pages/confirmOrder/confirmOrder.vue b/src/pages/confirmOrder/confirmOrder.vue
index 936e8fe..b26b563 100644
--- a/src/pages/confirmOrder/confirmOrder.vue
+++ b/src/pages/confirmOrder/confirmOrder.vue
@@ -165,6 +165,36 @@
+
+
+
+ 超值换购
+
+
+
+
+
+
+
+ {{exchangeGoods.name}}
+ {{exchangeGoods.company}}
+
+
+ ¥{{exchangeGoods.discountPrice}}
+
+ ¥{{exchangeGoods.originalPrice}}
+
+
+
+
+
+
+ {{exchangeGoods.count}}
+
+
+
+
+
-
+
diff --git a/src/pages/homeNew/homeNew.vue b/src/pages/homeNew/homeNew.vue
index e7490c0..a689ca7 100644
--- a/src/pages/homeNew/homeNew.vue
+++ b/src/pages/homeNew/homeNew.vue
@@ -105,11 +105,8 @@
});
},
onJumpTakeOut() {
- uni.showToast({
- title: '开发中',
- duration: 1000,
- icon: 'none',
- mask: true
+ uni.navigateTo({
+ url: '/pages/underDevelopment/underDevelopment'
});
},
//跳转注册会员
@@ -130,27 +127,18 @@
});
}, 2000, true),
onJumpSign() {
- uni.showToast({
- title: '开发中',
- duration: 1000,
- icon: 'none',
- mask: true
+ uni.navigateTo({
+ url: '/pages/underDevelopment/underDevelopment'
});
},
onJumpNewProduct() {
- uni.showToast({
- title: '开发中',
- duration: 1000,
- icon: 'none',
- mask: true
+ uni.navigateTo({
+ url: '/pages/underDevelopment/underDevelopment'
});
},
onJumpFriendShare() {
- uni.showToast({
- title: '开发中',
- duration: 1000,
- icon: 'none',
- mask: true
+ uni.navigateTo({
+ url: '/pages/underDevelopment/underDevelopment'
});
},
//跳转积碗换面
@@ -162,11 +150,8 @@
})
}, 2000, true),
onJumpDrink() {
- uni.showToast({
- title: '开发中',
- duration: 1000,
- icon: 'none',
- mask: true
+ uni.navigateTo({
+ url: '/pages/underDevelopment/underDevelopment'
});
},
//获取循环消费数据
diff --git a/src/pages/underDevelopment/underDevelopment.vue b/src/pages/underDevelopment/underDevelopment.vue
new file mode 100644
index 0000000..cdfb42b
--- /dev/null
+++ b/src/pages/underDevelopment/underDevelopment.vue
@@ -0,0 +1,63 @@
+
+
+
+
+ 该功能正在开发中
+
+
+ 首页
+
+
+
+
+
+
+
diff --git a/src/store/index.js b/src/store/index.js
index f036012..0b97687 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -105,6 +105,33 @@ const store = new Vuex.Store({
});
});
},
+ //套餐-1
+ onSetMealCountReduce(state, payload) {
+ const setMeal = payload;
+ if (setMeal.count === 0) return;
+ state.currentGoods.setMealList.forEach(item =>{
+ item.foods.forEach(addFood => {
+ if (addFood.id === setMeal.id) {
+ addFood.count -= 1;
+ addFood.sourceCount = addFood.count;
+ state.currentGoods.sencondId = state.currentGoods.sencondId.concat(addFood.id);
+ }
+ })
+ });
+ },
+ //套餐+1
+ onSetMealCountPlus(state, payload) {
+ const setMeal = payload;
+ state.currentGoods.setMealList.forEach(item =>{
+ item.foods.forEach(addFood => {
+ if (addFood.id === setMeal.id) {
+ addFood.count += 1;
+ addFood.sourceCount = addFood.count;
+ state.currentGoods.sencondId = state.currentGoods.sencondId.replace(addFood.id, '');
+ }
+ })
+ });
+ },
//从购物车添加主食
onStapleFoodPlusFromCart(state, payload) {
let stapleFood = payload;