Kaynağa Gözat

同步qsqd分支代码

master
yangwenhua 2 yıl önce
ebeveyn
işleme
4d997b7b4f
10 değiştirilmiş dosya ile 748 ekleme ve 32 silme
  1. +1
    -1
      src/App.vue
  2. +230
    -3
      src/components/FeedListPopup/FeedListPopup.vue
  3. +21
    -0
      src/components/GoodsList/GoodsList.vue
  4. +10
    -1
      src/pages.json
  5. +64
    -0
      src/pages/confirmOrder/confirmOrder.vue
  6. +321
    -1
      src/pages/food/food.vue
  7. +1
    -1
      src/pages/giveNoodle/giveNoodle.vue
  8. +10
    -25
      src/pages/homeNew/homeNew.vue
  9. +63
    -0
      src/pages/underDevelopment/underDevelopment.vue
  10. +27
    -0
      src/store/index.js

+ 1
- 1
src/App.vue Dosyayı Görüntüle

@@ -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: '',


+ 230
- 3
src/components/FeedListPopup/FeedListPopup.vue Dosyayı Görüntüle

@@ -46,7 +46,7 @@
</view>
<view class="feed-info-center">
<view class="feed-name-box">
<view class="feed-name-text">
<view class="feed-name-text text-overflow-two">
{{addFood.name}}
</view>
<view class="feed-company-text">
@@ -67,10 +67,83 @@
</view>
</view>
</view>
<!-- 套餐列表 -->
<view class="set-meal-list">
<view class="feed-item" v-for="(feed, index) in currentGoods.setMealList" :key="index">
<view class="feed-title">
{{feed.name}}
</view>
<view class="feed-info" v-for="addFood in feed.foods" :key="addFood.id">
<view class="feed-cover">
<image :src="addFood.cover" class="image-common-cover"></image>
</view>
<view class="feed-info-center">
<view class="feed-name-box">
<view class="feed-name-text text-overflow-two">
{{addFood.name}}
</view>
<view class="feed-company-text">
{{addFood.company ? addFood.company : '份'}}
</view>
</view>
<view class="feed-price-box green-color">
¥{{addFood.price}}
</view>
</view>
<view class="feed-buy-count">
<icon class="iconfont icon-jianshaojianqujianhao" :class="{'hidden-blank-data': addFood.count === 0}" @click="onSetMealCountReduce(addFood)"></icon>
<view :class="{'feed-count-now': true, 'hidden-blank-data': addFood.count === 0}" >
{{addFood.count}}
</view>
<icon class="iconfont icon-zengjia" @click="onSetMealCountPlus(addFood)" ></icon>
</view>
</view>
</view>
</view>
<view class="choose-success-btn" @click="onSure">
选好了
</view>
</view>
<!-- 选规格 -->
<u-popup :show="showSpecification" mode="center" @close="closeChooseSpeci" @open="openChooseSpeci" round="30rpx">
<view class="specifi-box">
<view class="specifi-head">
{{currentChoose.name}}
</view>
<view class="specifi-type-list">
<view class="specifi-type-item" v-for="specificationType in currentChoose.specification" :key="specificationType.id">
<view class="specifi-item-title">
{{specificationType.name}}
</view>
<view class="specifi-detail-list">
<view @click="onChooseSpecifi(specificationType, specifiDetailIndex)" :class="{'specifi-detail-item': true, 'specifi-detail-select': specifiDetail.isSelect}" v-for="(specifiDetail, specifiDetailIndex) in specificationType.foods" :key="specifiDetail.id">
{{specifiDetail.name}}
</view>
</view>
</view>
</view>
<view class="specifi-choosed-card">
<view class="specifi-choosed-prev">
已选规格:
</view>
<view class="specifi-choosed-list" v-for="specifiType in currentChoose.specification" :key="specifiType.id">
<view class="specifi-choosed-item" v-for="specifiItem in specifiType.foods" :key="specifiItem.id" v-show="specifiItem.isSelect">
{{specifiItem.name}}
</view>
</view>
</view>
<view class="specifi-total-card">
<view class="specifi-total-left">
总计
<text class="specifi-total-price">¥{{specificationTotalPrice}}</text>
</view>
<view class="specifi-total-right" @click="onJoinCar">
<icon class="iconfont icon-zengjia"></icon>
加入购物车
</view>
</view>
</view>
</u-popup>
</view>
</template>

@@ -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;
}
</style>

+ 21
- 0
src/components/GoodsList/GoodsList.vue Dosyayı Görüntüle

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


+ 10
- 1
src/pages.json Dosyayı Görüntüle

@@ -296,7 +296,16 @@
"path" : "pages/homeNew/homeNew",
"style" :
{
"navigationBarTitleText": "",
"navigationBarTitleText": "首页",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/underDevelopment/underDevelopment",
"style" :
{
"navigationBarTitleText": "功能开发中",
"enablePullDownRefresh": false
}


+ 64
- 0
src/pages/confirmOrder/confirmOrder.vue Dosyayı Görüntüle

@@ -165,6 +165,36 @@
</view>
</view>
</view>
<!-- 超值换购 -->
<view class="value-exchange-card order-common-box-shadow" v-if="true">
<view class="value-exchange-title">
超值换购
</view>
<view class="value-exchange-item" v-for="(exchangeGoods, index) in exchangeList" :key="index">
<view class="value-exchange-cover">
<image :src="imageServer.concat(exchangeGoods.cover)" class="image-common-cover"></image>
</view>
<view class="value-exchange-goods">
<view class="value-exchange-name text-overflow-one">
{{exchangeGoods.name}}
<text class="exchange-goos-compant">{{exchangeGoods.company}}</text>
</view>
<view class="value-exchange-price">
¥{{exchangeGoods.discountPrice}}
<text class="exchange-original-price">
¥{{exchangeGoods.originalPrice}}
</text>
</view>
</view>
<view class="value-exchange-count">
<icon class="iconfont icon-jianshaojianqujianhao" :class="{'hidden-blank-data': exchangeGoods.count < 1}" @click="onExchangeReduce(index)"></icon>
<text class="buy-count" :class="{'hidden-blank-data': exchangeGoods.count < 1}">
{{exchangeGoods.count}}
</text>
<icon class="iconfont icon-zengjia" @click="onExchangePlus(index)"></icon>
</view>
</view>
</view>
<!-- 备注 -->
<view class="remark-card order-common-box-shadow" @click="onOpenRemarkPopup">
<view class="remark-card-prev">
@@ -227,6 +257,17 @@
userLocation: '', //用户坐标
autoActivityList: [], //自动参与活动列表
userAutoActivityJson: {},//参与活动JSON数据
exchangeList: [
{
id: '1001100',
name: '丝滑香草冰淇淋',
cover: '97fba14a-6908-48b2-8f4b-fcf6556030cd.png',
originalPrice: 9, //原价
discountPrice: 1, //折后价
count: 0,
company: '杯' //单位
}
],
}
},
created() {
@@ -723,6 +764,18 @@
flex-grow: 1;
}
.value-exchange-count {
display: flex;
align-items: center;
justify-content: space-between;
flex-shrink: 0;
width: 130rpx;
font-size: 32rpx;
}
.value-exchange-count .iconfont {
font-size: 40rpx;
}
.exchange-goos-compant {
margin-left: 10rpx;
@@ -730,6 +783,17 @@
color: #999;
}
.value-exchange-price {
font-family: fangsong;
color: #F84352;
}
.exchange-original-price {
margin-left: 10rpx;
color: #999;
text-decoration: line-through;
}
.order-discount-title {
color: #999;


+ 321
- 1
src/pages/food/food.vue Dosyayı Görüntüle

@@ -136,8 +136,328 @@
}
typeItem.foods.forEach(food => {
food.shopCartNumber = 0;
});
});
});
//套餐 模拟JSON数据
const foodTypeItem = {
id: 'f697317d-e715-430d-8703-65b805520220428',
name: '爆款!单人套餐',
sort: 0,
coverUrl: 'http://res.hualala.com/basicdoc/f4201455-d8fd-4695-a9eb-0d2664f12f7b.png',
foods: [
{
addtoFoodList: [],
company: '套',
cover: 'http://res.hualala.com/basicdoc/f4201455-d8fd-4695-a9eb-0d2664f12f7b.png',
id: '920b6b5b-b612-4f70-903e-a6627920220428',
name: '立减套餐!咖啡鸡排面,咖啡+奶茶(饮品二选一)',
price: 44,
sort: 0,
state: 1,
vipPrice: 32,
shopCartNumber: 0,
setMealList: [
{
id: 'f697317d-e715-430d-8703-65b805520220428',
name: '立减套餐!咖啡鸡排面,咖啡+奶茶(饮品二选一)',
sort: 0,
coverUrl: 'http://res.hualala.com/basicdoc/f4201455-d8fd-4695-a9eb-0d2664f12f7b.png',
foods: [
{
company: '份',
cover: 'http://res.hualala.com/basicdoc/f4201455-d8fd-4695-a9eb-0d2664f12f7b.png',
id: '920b6b5b-b612-abcd-903e-a6627920220428',
name: '泰式咖啡鸡排面(咖喱与鸡的完美搭配)',
price: 32,
sort: 0,
state: 1,
vipPrice: 24,
mandatory: true, //是否必选
singleChoice: true, //是否单选
}
]
},
{
id: 'f697317d-1111-430d-8703-65b805520220428',
name: '奶茶二选一',
sort: 0,
coverUrl: null,
foods: [
{
company: '杯',
cover: 'http://res.hualala.com/basicdoc/c2bdda52-99d0-4c3e-9b91-7e9cfce7ca9e.png?x-oss-process=image/resize,limit_0,m_fill,h_300,w_300',
id: '920b6b5b-1234-abcd-903e-a6627920220428',
name: '金瓜波波奶茶(香糯南瓜泥+芋圆珍珠、醇香茶汤,杯杯有料超满足)',
price: 20,
sort: 0,
state: 1,
vipPrice: 14,
mandatory: false, //是否必选
singleChoice: true, //是否单选
specification: [ //选规格
{
id: 'f697317d-fn15-430d-8703-65b805520220428',
name: '分量',
sort: 0,
coverUrl: '',
mandatory: true, //是否必选
singleChoice: true, //是否单选
foods: [
{
company: '份',
cover: '',
id: '920b6b5b-gg34-abcd-903e-a6627920220428',
name: '+冰淇淋(限冷饮)',
price: 20,
sort: 0,
state: 1,
vipPrice: 14,
},
{
company: '份',
cover: '',
id: '920b6b5b-gg35-abcd-903e-a6627920220428',
name: '+芋圆',
price: 21,
sort: 0,
state: 1,
vipPrice: 14,
},
{
company: '份',
cover: '',
id: '920b6b5b-gg36-abcd-903e-a6627920220428',
name: '+椰奶冻',
price: 22,
sort: 0,
state: 1,
vipPrice: 14,
}
]
},
{
id: 'f697317d-td15-430d-8703-65b805520220428',
name: '糖度',
sort: 0,
coverUrl: '',
mandatory: true, //是否必选
singleChoice: false, //是否单选
foods: [
{
company: '份',
cover: '',
id: '920b6b5b-td34-abcd-903e-a6627920220428',
name: '三分糖',
price: 0,
sort: 0,
state: 1,
vipPrice: 0,
},
{
company: '份',
cover: '',
id: '920b6b5b-td35-abcd-903e-a6627920220428',
name: '五分糖',
price: 0,
sort: 0,
state: 1,
vipPrice: 0,
},
{
company: '份',
cover: '',
id: '920b6b5b-td36-abcd-903e-a6627920220428',
name: '全糖',
price: 0,
sort: 0,
state: 1,
vipPrice: 0,
}
]
},
{
id: 'f697317d-jd15-430d-8703-65b805520220428',
name: '可选基底',
sort: 0,
coverUrl: '',
mandatory: true, //是否必选
singleChoice: true, //是否单选
foods: [
{
company: '份',
cover: '',
id: '920b6b5b-jd34-abcd-903e-a6627920220428',
name: '阿萨姆红茶',
price: 0,
sort: 0,
state: 1,
vipPrice: 0,
},
{
company: '份',
cover: '',
id: '920b6b5b-jd35-abcd-903e-a6627920220428',
name: '茉莉绿茶',
price: 0,
sort: 0,
state: 1,
vipPrice: 0,
},
{
company: '份',
cover: '',
id: '920b6b5b-jd36-abcd-903e-a6627920220428',
name: '清香乌龙茶',
price: 0,
sort: 0,
state: 1,
vipPrice: 0,
}
]
}
]
},
{
company: '杯',
cover: 'http://res.hualala.com/basicdoc/3b2a9516-3a24-4400-ab3c-9540b42f97ed.png?x-oss-process=image/resize,limit_0,m_fill,h_300,w_300',
id: '920b6b5b-1222-abcd-903e-a6627920220428',
name: '栗栗波波奶茶(香糯板栗配珍珠芋圆,口感醇厚茶汤,杯杯有料超满足)',
price: 20,
sort: 0,
state: 1,
vipPrice: 14,
mandatory: false, //是否必选
singleChoice: true, //是否单选
specification: [ //选规格
{
id: 'f697317d-fb15-430d-8703-65b805520220428',
name: '分量',
sort: 0,
coverUrl: '',
mandatory: true, //是否必选
singleChoice: true, //是否单选
foods: [
{
company: '份',
cover: '',
id: '920b6b5b-gg34-abcd-903e-a6627920220428',
name: '+冰淇淋(限冷饮)',
price: 20,
sort: 0,
state: 1,
vipPrice: 14,
},
{
company: '份',
cover: '',
id: '920b6b5b-gg35-abcd-903e-a6627920220428',
name: '+芋圆',
price: 21,
sort: 0,
state: 1,
vipPrice: 14,
},
{
company: '份',
cover: '',
id: '920b6b5b-gg36-abcd-903e-a6627920220428',
name: '+椰奶冻',
price: 22,
sort: 0,
state: 1,
vipPrice: 14,
}
]
},
{
id: 'f697317d-gg15-430d-8703-65b805520220428',
name: '糖度',
sort: 0,
coverUrl: '',
mandatory: true, //是否必选
singleChoice: true, //是否单选
foods: [
{
company: '份',
cover: '',
id: '920b6b5b-td34-abcd-903e-a6627920220428',
name: '三分糖',
price: 0,
sort: 0,
state: 1,
vipPrice: 0,
},
{
company: '份',
cover: '',
id: '920b6b5b-td35-abcd-903e-a6627920220428',
name: '五分糖',
price: 0,
sort: 0,
state: 1,
vipPrice: 0,
},
{
company: '份',
cover: '',
id: '920b6b5b-td36-abcd-903e-a6627920220428',
name: '全糖',
price: 0,
sort: 0,
state: 1,
vipPrice: 0,
}
]
},
{
id: 'f697317d-jd15-430d-8703-65b805520220428',
name: '可选基底',
sort: 0,
coverUrl: '',
mandatory: true, //是否必选
singleChoice: true, //是否单选
foods: [
{
company: '份',
cover: '',
id: '920b6b5b-jd34-abcd-903e-a6627920220428',
name: '阿萨姆红茶',
price: 0,
sort: 0,
state: 1,
vipPrice: 0,
},
{
company: '份',
cover: '',
id: '920b6b5b-jd35-abcd-903e-a6627920220428',
name: '茉莉绿茶',
price: 0,
sort: 0,
state: 1,
vipPrice: 0,
},
{
company: '份',
cover: '',
id: '920b6b5b-jd36-abcd-903e-a6627920220428',
name: '清香乌龙茶',
price: 0,
sort: 0,
state: 1,
vipPrice: 0,
}
]
}
]
},
]
},
]
}
]
}
foodTypes.unshift(foodTypeItem);
store.commit('initFoodArray', foodTypes);
setTimeout(() => {
this.$refs.goodsListRef.getNodeInfo();


+ 1
- 1
src/pages/giveNoodle/giveNoodle.vue Dosyayı Görüntüle

@@ -5,7 +5,7 @@
</view>
<image :src="imageServer.concat('ad916a1b-1a3f-42d5-8ac1-b92ea59c44eb.png')" class="image-common-cover give-noodle-back"></image>
<view class="round-activity-list">
<view :class="{'round-activity-item': true, 'round-activity-food': item < consumptionQuantity}" v-for="item in 10"></view>
<view :class="{'round-activity-item': true, 'round-activity-food': item < consumptionQuantity}" v-for="item in 10" :key="item"></view>
</view>
<!-- 活动列表弹窗 -->
<u-popup :show="isShowActivity" bgColor="#FFF" round="30rpx" mode="center" @close="onSwitchActivityPopup(false)" @open="onSwitchActivityPopup(true)">


+ 10
- 25
src/pages/homeNew/homeNew.vue Dosyayı Görüntüle

@@ -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'
});
},
//获取循环消费数据


+ 63
- 0
src/pages/underDevelopment/underDevelopment.vue Dosyayı Görüntüle

@@ -0,0 +1,63 @@
<template>
<view class="under-delevelopment-box">
<view class="delevelopment-logo"></view>
<view class="delevelopment-desc">
该功能正在开发中
</view>
<view class="delevelopment-back" @click="onClickBack">
首页
</view>
</view>
</template>

<script>
export default {
data() {
return {
}
},
methods: {
onClickBack() {
uni.navigateBack({
delta: 1
});
}
}
}
</script>

<style scoped>
.under-delevelopment-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
}
.delevelopment-logo {
width: 200rpx;
height: 200rpx;
background-image: url('https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/company/QSQD/d5ed2564-068c-4c27-93a9-183e12d2b0ee.jpg');
background-position: center;
background-repeat: no-repeat;
background-size: contain;
margin-bottom: 100rpx;
}
.delevelopment-desc {
color: #999;
font-size: 30rpx;
}
.delevelopment-back {
margin-top: 100rpx;
background-color: #51A97D;
color: #FFF;
padding: 10rpx 100rpx;
font-size: 32rpx;
letter-spacing: 10rpx;
}
</style>

+ 27
- 0
src/store/index.js Dosyayı Görüntüle

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


Yükleniyor…
İptal
Kaydet