|
@@ -6,17 +6,17 @@
|
6
|
6
|
<div class="bannerInfo flex-h">
|
7
|
7
|
<div class="flex-item">
|
8
|
8
|
<div>
|
9
|
|
- <span>项目名称:xxxx</span>
|
|
9
|
+ <span>项目名称:{{caseName}}</span>
|
10
|
10
|
</div>
|
11
|
11
|
</div>
|
12
|
|
- <span>xxx您好!</span>
|
|
12
|
+ <span>{{userInfo.customer != undefined ? userInfo.customer.CustomerName : ''}}您好!</span>
|
13
|
13
|
</div>
|
14
|
14
|
</div>
|
15
|
15
|
<div class="tableInfo flex-h">
|
16
|
16
|
<div class="flex-item">
|
17
|
17
|
<div>
|
18
|
|
- <span>桌号:案场11号桌</span>
|
19
|
|
- <span>本月已用:150杯</span>
|
|
18
|
+ <span>桌号:{{tableNo}}</span>
|
|
19
|
+ <!-- <span>本月已用:150杯</span> -->
|
20
|
20
|
</div>
|
21
|
21
|
</div>
|
22
|
22
|
<router-link :to="{name: 'coffeeIndex', query: {}}">返回选择桌号</router-link>
|
|
@@ -66,8 +66,8 @@
|
66
|
66
|
<i class="iconfont" :class="{'icon-jiantou-up': !showCalcMenu,'icon-jiantou-down': showCalcMenu}" @click="showCalcMenu = true"></i>
|
67
|
67
|
</div>
|
68
|
68
|
</div>
|
69
|
|
- <!-- <router-link :to="{name: 'placeOrderDetail', query: {info: JSON.stringify(settlementList)}}">下单</router-link> -->
|
70
|
|
- <a @click="showCalcMenu = true">下单</a>
|
|
69
|
+ <router-link :to="{name: 'placeOrderDetail', query: {info: JSON.stringify(settlementList), caseid: encodeURI(caseId), areaid: encodeURI(areaId), areaname: encodeURI(areaName), areaid: encodeURI(areaId), tableid: encodeURI(tableId), tableno: encodeURI(tableNo)}}">下单</router-link>
|
|
70
|
+ <!-- <a @click="showCalcMenu = true">下单</a> -->
|
71
|
71
|
</div>
|
72
|
72
|
<orderPopup :show="showPopup" :data="currentSpec" @closePopup="closePopup" @returnData="calcMenus"></orderPopup>
|
73
|
73
|
<calcMenu :show="showCalcMenu" :totalNum="totalCupNum" :data="settlementList" @returnData="calcMenus" @emptyMenus="emptyMenus" @closeCalcMenu="closeCalcMenu" @placeOrder="placeOrder"></calcMenu>
|
|
@@ -75,6 +75,8 @@
|
75
|
75
|
</template>
|
76
|
76
|
|
77
|
77
|
<script>
|
|
78
|
+import { mapState, createNamespacedHelpers } from 'vuex'
|
|
79
|
+const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
|
78
|
80
|
import orderItem from '../../../components/orderItem/index'
|
79
|
81
|
import orderPopup from '../../../components/orderPopup/index'
|
80
|
82
|
import calcMenu from '../../../components/calcMenu/index'
|
|
@@ -86,6 +88,12 @@ export default {
|
86
|
88
|
data () {
|
87
|
89
|
const _self = this
|
88
|
90
|
return {
|
|
91
|
+ tableNo: decodeURI(this.$route.query.tableno),
|
|
92
|
+ tableId: decodeURI(this.$route.query.tableid),
|
|
93
|
+ areaId: decodeURI(this.$route.query.areaid),
|
|
94
|
+ areaName: decodeURI(this.$route.query.areaname),
|
|
95
|
+ caseName: decodeURI(this.$route.query.casename),
|
|
96
|
+ caseId: decodeURI(this.$route.query.caseid),
|
89
|
97
|
totalCupNum: 0, // 共计使用杯数
|
90
|
98
|
showCalcMenu: false, // 显隐已点菜单弹窗
|
91
|
99
|
currentSpec: null, // 当前选择规格
|
|
@@ -94,103 +102,105 @@ export default {
|
94
|
102
|
totalPrice: 0, // 总价格
|
95
|
103
|
settlementList: [], // 商品选择清单
|
96
|
104
|
slideMenusActive: 0, // 左侧菜单选中索引值
|
97
|
|
- menuList: [{ // 商品数据
|
98
|
|
- value: '咖啡',
|
99
|
|
- eValue: 'Coffee',
|
100
|
|
- id: '1',
|
101
|
|
- status: 1,
|
102
|
|
- list: [{
|
103
|
|
- img: '',
|
104
|
|
- name: '商品名称',
|
105
|
|
- id: '1-1',
|
106
|
|
- status: 1,
|
107
|
|
- spec: [{
|
108
|
|
- value: '去冰',
|
109
|
|
- id: '1-1-1',
|
110
|
|
- num: 0,
|
111
|
|
- status: 0,
|
112
|
|
- price: '10',
|
113
|
|
- }, {
|
114
|
|
- value: '少冰',
|
115
|
|
- id: '1-1-2',
|
116
|
|
- num: 0,
|
117
|
|
- status: 1,
|
118
|
|
- price: '15',
|
119
|
|
- }, {
|
120
|
|
- value: '正常',
|
121
|
|
- id: '1-1-3',
|
122
|
|
- num: 0,
|
123
|
|
- status: 1,
|
124
|
|
- price: '20',
|
125
|
|
- }, {
|
126
|
|
- value: '多冰',
|
127
|
|
- id: '1-1-4',
|
128
|
|
- num: 0,
|
129
|
|
- status: 1,
|
130
|
|
- price: '25',
|
131
|
|
- }],
|
132
|
|
- price: '100',
|
133
|
|
- }, {
|
134
|
|
- img: '',
|
135
|
|
- name: '商品名称',
|
136
|
|
- id: '1-2',
|
137
|
|
- spec: [],
|
138
|
|
- status: 0,
|
139
|
|
- price: '100',
|
140
|
|
- }, {
|
141
|
|
- img: '',
|
142
|
|
- name: '商品名称',
|
143
|
|
- id: '1-3',
|
144
|
|
- spec: [],
|
145
|
|
- status: 1,
|
146
|
|
- price: '100',
|
147
|
|
- }, {
|
148
|
|
- img: '',
|
149
|
|
- name: '商品名称',
|
150
|
|
- id: '1-4',
|
151
|
|
- spec: [],
|
152
|
|
- status: 1,
|
153
|
|
- price: '100',
|
154
|
|
- }, {
|
155
|
|
- img: '',
|
156
|
|
- name: '商品名称',
|
157
|
|
- id: '1-5',
|
158
|
|
- spec: [],
|
159
|
|
- status: 1,
|
160
|
|
- price: '100',
|
161
|
|
- }, {
|
162
|
|
- img: '',
|
163
|
|
- name: '商品名称',
|
164
|
|
- id: '1-6',
|
165
|
|
- spec: [],
|
166
|
|
- status: 1,
|
167
|
|
- price: '100',
|
168
|
|
- }],
|
169
|
|
- }, {
|
170
|
|
- value: '咖啡一',
|
171
|
|
- eValue: 'Coffee',
|
172
|
|
- id: '2',
|
173
|
|
- status: 1,
|
174
|
|
- list: [],
|
175
|
|
- }, {
|
176
|
|
- value: '咖啡二',
|
177
|
|
- eValue: 'Coffee',
|
178
|
|
- id: '3',
|
179
|
|
- status: 1,
|
180
|
|
- list: [],
|
181
|
|
- }, {
|
182
|
|
- value: '咖啡三',
|
183
|
|
- eValue: 'Coffee',
|
184
|
|
- id: '4',
|
185
|
|
- status: 1,
|
186
|
|
- list: [],
|
187
|
|
- }, {
|
188
|
|
- value: '咖啡四',
|
189
|
|
- eValue: 'Coffee',
|
190
|
|
- id: '5',
|
191
|
|
- status: 1,
|
192
|
|
- list: [],
|
193
|
|
- }],
|
|
105
|
+ menuList: [ // 商品数据
|
|
106
|
+ // {
|
|
107
|
+ // value: '咖啡',
|
|
108
|
+ // eValue: 'Coffee',
|
|
109
|
+ // id: '1',
|
|
110
|
+ // status: 1,
|
|
111
|
+ // list: [{
|
|
112
|
+ // img: '',
|
|
113
|
+ // name: '商品名称',
|
|
114
|
+ // id: '1-1',
|
|
115
|
+ // status: 1,
|
|
116
|
+ // spec: [{
|
|
117
|
+ // value: '去冰',
|
|
118
|
+ // id: '1-1-1',
|
|
119
|
+ // num: 0,
|
|
120
|
+ // status: 0,
|
|
121
|
+ // price: '10',
|
|
122
|
+ // }, {
|
|
123
|
+ // value: '少冰',
|
|
124
|
+ // id: '1-1-2',
|
|
125
|
+ // num: 0,
|
|
126
|
+ // status: 1,
|
|
127
|
+ // price: '15',
|
|
128
|
+ // }, {
|
|
129
|
+ // value: '正常',
|
|
130
|
+ // id: '1-1-3',
|
|
131
|
+ // num: 0,
|
|
132
|
+ // status: 1,
|
|
133
|
+ // price: '20',
|
|
134
|
+ // }, {
|
|
135
|
+ // value: '多冰',
|
|
136
|
+ // id: '1-1-4',
|
|
137
|
+ // num: 0,
|
|
138
|
+ // status: 1,
|
|
139
|
+ // price: '25',
|
|
140
|
+ // }],
|
|
141
|
+ // price: '100',
|
|
142
|
+ // }, {
|
|
143
|
+ // img: '',
|
|
144
|
+ // name: '商品名称',
|
|
145
|
+ // id: '1-2',
|
|
146
|
+ // spec: [],
|
|
147
|
+ // status: 0,
|
|
148
|
+ // price: '100',
|
|
149
|
+ // }, {
|
|
150
|
+ // img: '',
|
|
151
|
+ // name: '商品名称',
|
|
152
|
+ // id: '1-3',
|
|
153
|
+ // spec: [],
|
|
154
|
+ // status: 1,
|
|
155
|
+ // price: '100',
|
|
156
|
+ // }, {
|
|
157
|
+ // img: '',
|
|
158
|
+ // name: '商品名称',
|
|
159
|
+ // id: '1-4',
|
|
160
|
+ // spec: [],
|
|
161
|
+ // status: 1,
|
|
162
|
+ // price: '100',
|
|
163
|
+ // }, {
|
|
164
|
+ // img: '',
|
|
165
|
+ // name: '商品名称',
|
|
166
|
+ // id: '1-5',
|
|
167
|
+ // spec: [],
|
|
168
|
+ // status: 1,
|
|
169
|
+ // price: '100',
|
|
170
|
+ // }, {
|
|
171
|
+ // img: '',
|
|
172
|
+ // name: '商品名称',
|
|
173
|
+ // id: '1-6',
|
|
174
|
+ // spec: [],
|
|
175
|
+ // status: 1,
|
|
176
|
+ // price: '100',
|
|
177
|
+ // }],
|
|
178
|
+ // }, {
|
|
179
|
+ // value: '咖啡一',
|
|
180
|
+ // eValue: 'Coffee',
|
|
181
|
+ // id: '2',
|
|
182
|
+ // status: 1,
|
|
183
|
+ // list: [],
|
|
184
|
+ // }, {
|
|
185
|
+ // value: '咖啡二',
|
|
186
|
+ // eValue: 'Coffee',
|
|
187
|
+ // id: '3',
|
|
188
|
+ // status: 1,
|
|
189
|
+ // list: [],
|
|
190
|
+ // }, {
|
|
191
|
+ // value: '咖啡三',
|
|
192
|
+ // eValue: 'Coffee',
|
|
193
|
+ // id: '4',
|
|
194
|
+ // status: 1,
|
|
195
|
+ // list: [],
|
|
196
|
+ // }, {
|
|
197
|
+ // value: '咖啡四',
|
|
198
|
+ // eValue: 'Coffee',
|
|
199
|
+ // id: '5',
|
|
200
|
+ // status: 1,
|
|
201
|
+ // list: [],
|
|
202
|
+ // }
|
|
203
|
+ ],
|
194
|
204
|
swiperOption: {
|
195
|
205
|
observer: true,
|
196
|
206
|
direction: 'vertical',
|
|
@@ -211,6 +221,11 @@ export default {
|
211
|
221
|
}
|
212
|
222
|
},
|
213
|
223
|
computed: {
|
|
224
|
+ ...mapState({
|
|
225
|
+ userInfo: x => x.userCenter.userInfo,
|
|
226
|
+ goodsTypeList: x => x.placeOrderForCoffee.goodsTypeList,
|
|
227
|
+ goodsList: x => x.placeOrderForCoffee.goodsList
|
|
228
|
+ }),
|
214
|
229
|
MySwiper () {
|
215
|
230
|
return this.$refs.mySwiper.swiper
|
216
|
231
|
},
|
|
@@ -225,10 +240,69 @@ export default {
|
225
|
240
|
orderPopup,
|
226
|
241
|
calcMenu,
|
227
|
242
|
},
|
228
|
|
- created () { },
|
|
243
|
+ created () {
|
|
244
|
+ this.getGoodsTypeList({
|
|
245
|
+ caseid: this.caseId,
|
|
246
|
+ }).then((res) => {
|
|
247
|
+ // console.log(JSON.stringify(res))
|
|
248
|
+ this.getGoodsList({
|
|
249
|
+ caseid: this.caseId,
|
|
250
|
+ }).then((res) => {
|
|
251
|
+ // console.log(JSON.stringify(res))
|
|
252
|
+ this.mapArr()
|
|
253
|
+ })
|
|
254
|
+ })
|
|
255
|
+ },
|
229
|
256
|
methods: {
|
|
257
|
+ ...caseTableActions([
|
|
258
|
+ 'getGoodsTypeList',
|
|
259
|
+ 'getGoodsList',
|
|
260
|
+ ]),
|
|
261
|
+ mapArr () { // 匹配商品规格
|
|
262
|
+ var aArr = this.goodsTypeList, bArr = this.goodsList
|
|
263
|
+ for (var n = 0; n < aArr.length; n++) {
|
|
264
|
+ aArr[n].list = []
|
|
265
|
+ for (var a = 0; a < bArr.length; a++) {
|
|
266
|
+ if (aArr[n].TypeId === bArr[a].TypeId) {
|
|
267
|
+ aArr[n].list.push(bArr[a])
|
|
268
|
+ }
|
|
269
|
+ }
|
|
270
|
+ }
|
|
271
|
+ this.menuList = []
|
|
272
|
+ for (var x = 0; x < aArr.length; x++) {
|
|
273
|
+ this.menuList.push({
|
|
274
|
+ value: aArr[x].TypeName,
|
|
275
|
+ eValue: aArr[x].EnglishName,
|
|
276
|
+ id: aArr[x].TypeId,
|
|
277
|
+ status: aArr[x].Status,
|
|
278
|
+ list: []
|
|
279
|
+ })
|
|
280
|
+ for (var y = 0; y < aArr[x].list.length; y++) {
|
|
281
|
+ this.menuList[x].list.push({
|
|
282
|
+ img: aArr[x].list[y].Images,
|
|
283
|
+ name: aArr[x].list[y].GoodsName,
|
|
284
|
+ id: aArr[x].list[y].GoodsId,
|
|
285
|
+ spec: [],
|
|
286
|
+ status: aArr[x].list[y].Status,
|
|
287
|
+ price: aArr[x].list[y].Price,
|
|
288
|
+ })
|
|
289
|
+ if(aArr[x].list[y].Specs !== null){
|
|
290
|
+ for (var z = 0; z < aArr[x].list[y].Specs.length; z++) {
|
|
291
|
+ this.menuList[x].list[y].spec.push({
|
|
292
|
+ value: aArr[x].list[y].Specs[z].SpecName,
|
|
293
|
+ id: aArr[x].list[y].Specs[z].SpecId,
|
|
294
|
+ num: 0,
|
|
295
|
+ status: aArr[x].list[y].Specs[z].Status,
|
|
296
|
+ price: aArr[x].list[y].Specs[z].GoodsPrice,
|
|
297
|
+ })
|
|
298
|
+ }
|
|
299
|
+ }
|
|
300
|
+ }
|
|
301
|
+ }
|
|
302
|
+ // console.log(JSON.stringify(this.menuList))
|
|
303
|
+ },
|
230
|
304
|
placeOrder () { // 下单
|
231
|
|
- this.$router.push({name: 'orderList', query: {}})
|
|
305
|
+ this.$router.push({ name: 'orderList', query: {} })
|
232
|
306
|
},
|
233
|
307
|
closeCalcMenu () { // 关闭已选菜单
|
234
|
308
|
this.showCalcMenu = false
|
|
@@ -304,5 +378,5 @@ export default {
|
304
|
378
|
|
305
|
379
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
306
|
380
|
<style lang="scss" scoped>
|
307
|
|
-@import "page.scss";
|
|
381
|
+@import 'page.scss';
|
308
|
382
|
</style>
|