jufubao-food 1.0.12-beta9 → 1.0.13-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/JfbFoodConfirmV2/Api.js +15 -1
- package/src/components/JfbFoodConfirmV2/JfbFoodConfirmV2.vue +74 -12
- package/src/components/JfbFoodConfirmV2/cusAttr/advanced.js +13 -0
- package/src/components/JfbFoodProductInfo/JfbFoodProductInfo.vue +11 -3
- package/src/components/JfbFoodProductInfo/XdSku.vue +2 -1
- package/src/components/JfbFoodProductInfo/XdSpu.vue +9 -1
- package/src/components/JfbFoodProductList/JfbFoodProductList.vue +58 -17
package/package.json
CHANGED
|
@@ -15,11 +15,25 @@ module.exports = [
|
|
|
15
15
|
cart_order_id: ['cart_order_id', 'String', true],
|
|
16
16
|
delivery_method: ['投递方式', 'String', false],
|
|
17
17
|
blessings: ['祝福语', 'String', false],
|
|
18
|
-
subscribeTimeInfo: ['配送时间', 'String', false]
|
|
18
|
+
subscribeTimeInfo: ['配送时间', 'String', false],
|
|
19
|
+
switch_resource_shop_id: ['切换门店的资源id', 'String', false]
|
|
19
20
|
},
|
|
20
21
|
isConsole: true,
|
|
21
22
|
disabled: true
|
|
22
23
|
},
|
|
24
|
+
{
|
|
25
|
+
title: "购物车 - 清空购物车",
|
|
26
|
+
path: "/hourdash/v1/:xnamespace/:shop_id/cart/clear",
|
|
27
|
+
mapFnName: "clearFoodCart",
|
|
28
|
+
data: {
|
|
29
|
+
xnamespace: ["命名空间", "String", "必选"],
|
|
30
|
+
shop_id: ["门店id", "String", "必选"],
|
|
31
|
+
consume_mode: ["消费模式", "String", "必选"],
|
|
32
|
+
cart_order_id: ["购物车订单id", "String", "必选"]
|
|
33
|
+
},
|
|
34
|
+
isConsole: true,
|
|
35
|
+
disabled: true,
|
|
36
|
+
},
|
|
23
37
|
{
|
|
24
38
|
mapFnName: 'getFoodCardList',
|
|
25
39
|
title: '展示可选卡列表',
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<view class="jfb-food-confirm-v-2__body" :style="[bodyStyleComp]">
|
|
19
19
|
<view class="section">
|
|
20
20
|
<view class="delivery_wrap">
|
|
21
|
-
<view class="shop_wrap" @click="
|
|
21
|
+
<view class="shop_wrap" @click="toSwitchShop">
|
|
22
22
|
<view class="shop_info">
|
|
23
23
|
<view class="_name"><xd-font-icon icon="iconshouye" :color="mainColor" size="36" style="margin-right: 8rpx;"></xd-font-icon>{{ shopInfo.shop_name }}</view>
|
|
24
24
|
<view class="_dist">{{ shopInfo.distance_conversion}}
|
|
@@ -94,6 +94,12 @@
|
|
|
94
94
|
<xd-unit :price="orderInfo.product_total_amount" :isOld="false" :fontSize="24" :iconSize="0.3"></xd-unit>
|
|
95
95
|
</xd-list-item>
|
|
96
96
|
</view>
|
|
97
|
+
<view v-if="isShowPlusSaveMoney" class="section">
|
|
98
|
+
<xd-list-item label="" paddingLR="60rpx" size="small">
|
|
99
|
+
<view slot="label" style="color: #86541E;">PLUS专享立减</view>
|
|
100
|
+
<xd-unit :price="-plus_saving_money" :largeZero="false" :isOld="false" :fontSize="24" :iconSize="0.3"></xd-unit>
|
|
101
|
+
</xd-list-item>
|
|
102
|
+
</view>
|
|
97
103
|
|
|
98
104
|
<view class="section">
|
|
99
105
|
<template v-for="item in otherPayMethod">
|
|
@@ -215,8 +221,8 @@
|
|
|
215
221
|
</view>
|
|
216
222
|
</view>
|
|
217
223
|
<view slot="btn" style="display: flex;margin-top: 40rpx;">
|
|
218
|
-
<xd-button type="info" size="small" @click="handleChangeStop">更换门店</xd-button>
|
|
219
|
-
<xd-button type="primary" size="small"
|
|
224
|
+
<xd-button v-if="shopInfo.is_switch_shop==='Y'" style="margin-right: 40rpx;"type="info" size="small" @click="handleChangeStop">更换门店</xd-button>
|
|
225
|
+
<xd-button type="primary" size="small" @click="handleCreatePayConfirm">就是这家</xd-button>
|
|
220
226
|
</view>
|
|
221
227
|
</XdDailog>
|
|
222
228
|
|
|
@@ -229,7 +235,7 @@
|
|
|
229
235
|
</view>
|
|
230
236
|
</view>
|
|
231
237
|
<view slot="btn" style="display: flex;margin-top: 40rpx;">
|
|
232
|
-
<xd-button type="info" size="small" @click="
|
|
238
|
+
<xd-button type="info" size="small" @click="giveUpChange">放弃更换</xd-button>
|
|
233
239
|
<xd-button type="primary" size="small" style="margin-left: 40rpx;" @click="handleSwitchShop">继续更换</xd-button>
|
|
234
240
|
</view>
|
|
235
241
|
</XdDailog>
|
|
@@ -247,6 +253,7 @@
|
|
|
247
253
|
import XdWalletChose from "@/components/XdWalletChose/XdWalletChose"
|
|
248
254
|
import CusCouponChose from '@/components/CusCouponChose/CusCouponChose'
|
|
249
255
|
import XdDailog from "@/components/XdDailog/XdDailog"
|
|
256
|
+
import CusVipList from "@/components/CusVipList/CusVipList"
|
|
250
257
|
import { jfbRootExec } from "@/utils/xd.event";
|
|
251
258
|
import JfbFoodConfirmV2Mixin from "./JfbFoodConfirmV2Mixin";
|
|
252
259
|
import { getContainerPropsValue, gCPVal } from "@/utils/xd.base";
|
|
@@ -265,13 +272,17 @@
|
|
|
265
272
|
XdCardPayChose,
|
|
266
273
|
XdWalletChose,
|
|
267
274
|
CusCouponChose,
|
|
268
|
-
XdDailog
|
|
275
|
+
XdDailog,
|
|
276
|
+
CusVipList
|
|
269
277
|
},
|
|
270
278
|
mixins: [
|
|
271
279
|
componentsMixins, extsMixins, JfbFoodConfirmV2Mixin, OrderMixin
|
|
272
280
|
],
|
|
273
281
|
data() {
|
|
274
282
|
return {
|
|
283
|
+
isVip: false,
|
|
284
|
+
options: {},
|
|
285
|
+
consume_mode: "",
|
|
275
286
|
order_id: "", //订单ID
|
|
276
287
|
comment: "", //订单备注
|
|
277
288
|
buyer_phone_number: "", //订购人手机号
|
|
@@ -287,6 +298,7 @@
|
|
|
287
298
|
vip_card_id: "",
|
|
288
299
|
plus_saving_money: 0,
|
|
289
300
|
main_order_id: "",
|
|
301
|
+
resource_shop_id: "",
|
|
290
302
|
|
|
291
303
|
showDialogConfirmShop: false,
|
|
292
304
|
showDialogChangeShop: false,
|
|
@@ -331,6 +343,7 @@
|
|
|
331
343
|
payPath: "",
|
|
332
344
|
paySuccessPath: "",
|
|
333
345
|
switchStorePath: "",
|
|
346
|
+
productListPath: "",
|
|
334
347
|
}
|
|
335
348
|
},
|
|
336
349
|
computed: {
|
|
@@ -395,6 +408,11 @@
|
|
|
395
408
|
let result = this.$xdUniHelper.cutFloatNumber(total_amount, total);
|
|
396
409
|
return result;
|
|
397
410
|
},
|
|
411
|
+
//是否展示vip减免
|
|
412
|
+
isShowPlusSaveMoney(){
|
|
413
|
+
if(this.is_show_vip_card_list === 'Y') return this.vip_card_id;
|
|
414
|
+
else return this.isVip && this.plus_saving_money;
|
|
415
|
+
},
|
|
398
416
|
},
|
|
399
417
|
watch: {
|
|
400
418
|
container(value, oldValue) {
|
|
@@ -405,13 +423,17 @@
|
|
|
405
423
|
created() {
|
|
406
424
|
this.is_plus_site = this.projectAttr.headers['X-Site-Group']==="vip";
|
|
407
425
|
this.init(this.container);
|
|
408
|
-
|
|
426
|
+
this.isVip = this.getTokenForKey('user_level') === 'VIP';
|
|
409
427
|
//todo
|
|
410
428
|
},
|
|
411
429
|
methods: {
|
|
412
430
|
async onJfbLoad(options) {
|
|
431
|
+
this.options = options || {};
|
|
413
432
|
this.setNameSpace(options);
|
|
433
|
+
this.consume_mode = options.consume_mode || 'HDSELF';
|
|
414
434
|
this.order_id = options.order_id || '';
|
|
435
|
+
this.resource_shop_id = options.resource_shop_id || '';
|
|
436
|
+
this.main_order_id = options.main_order_id || '';
|
|
415
437
|
await this.p_getCartConfirm();
|
|
416
438
|
this.validImageAPIUrl = this.brandInfo['api_host'] + '/common/v1/valid_code/image/show'
|
|
417
439
|
// #ifdef H5
|
|
@@ -439,6 +461,7 @@
|
|
|
439
461
|
this.payPath = getContainerPropsValue(container, 'content.payPath', { value: "/system/system/pay" }).value;
|
|
440
462
|
this.paySuccessPath = getContainerPropsValue(container, 'content.paySuccessPath', {value: "/system/order/success"}).value;
|
|
441
463
|
this.switchStorePath = getContainerPropsValue(container, 'content.switchStorePath',{value: ""}).value;
|
|
464
|
+
this.productListPath = getContainerPropsValue(container, 'content.productListPath', {value: ""}).value;
|
|
442
465
|
|
|
443
466
|
this.bindCard = getContainerPropsValue(container,"content.bindCard","1");
|
|
444
467
|
this.skipTip = getContainerPropsValue(container, "content.skipTip", "N");
|
|
@@ -487,7 +510,8 @@
|
|
|
487
510
|
longitude: this.stateLocation.longitude,
|
|
488
511
|
card_id: this.vip_card_id,
|
|
489
512
|
meal_method: this.meal_method,
|
|
490
|
-
main_order_id: this.main_order_id
|
|
513
|
+
main_order_id: this.main_order_id,
|
|
514
|
+
switch_resource_shop_id: this.resource_shop_id
|
|
491
515
|
}
|
|
492
516
|
}).then(res => {
|
|
493
517
|
this.$xdHideLoading();
|
|
@@ -499,6 +523,10 @@
|
|
|
499
523
|
},150)
|
|
500
524
|
},
|
|
501
525
|
handlerConfirmRes(res){
|
|
526
|
+
//更换门店后,价格有变动
|
|
527
|
+
if(res.is_price_change === 'Y'){
|
|
528
|
+
this.showDialogChangeShop = true;
|
|
529
|
+
}
|
|
502
530
|
// this.is_first_use_card = res.is_first_use_card || "Y";
|
|
503
531
|
// this.is_use_jfb_pay = res.is_use_jfb_pay || "Y";
|
|
504
532
|
this.is_show_vip_card_list = res.is_show_vip_card_list;
|
|
@@ -513,7 +541,7 @@
|
|
|
513
541
|
if(!this.meal_method && mealMethods.length){
|
|
514
542
|
this.meal_method = mealMethods[0].value;
|
|
515
543
|
}
|
|
516
|
-
this.plus_saving_money = res.plus_saving_money || 0;
|
|
544
|
+
this.plus_saving_money = res.order_info.plus_saving_money || 0;
|
|
517
545
|
this.main_order_id = res.order_info.main_order_id
|
|
518
546
|
|
|
519
547
|
//支付方式跟用户相关,与订单无关。
|
|
@@ -606,15 +634,49 @@
|
|
|
606
634
|
duration: 0
|
|
607
635
|
})
|
|
608
636
|
},
|
|
637
|
+
toSwitchShop(){
|
|
638
|
+
if(this.shopInfo.is_switch_shop !== 'Y') return;
|
|
639
|
+
|
|
640
|
+
//切换门店
|
|
641
|
+
let curPage = this.$xdUniHelper.getCurrentPages();
|
|
642
|
+
let query = {...curPage.query};
|
|
643
|
+
if(this.main_order_id) query.main_order_id = this.main_order_id;
|
|
644
|
+
let callback= Base64.encode(curPage.path + '?' + this.$xdUniHelper.jsonToParams(query));
|
|
645
|
+
this.$xdUniHelper.redirectTo({
|
|
646
|
+
url: this.switchStorePath + '?brand_id=' + this.shopInfo.brand_id + '&callback=' + callback
|
|
647
|
+
})
|
|
648
|
+
},
|
|
649
|
+
//放弃更换
|
|
650
|
+
giveUpChange(){
|
|
651
|
+
this.showDialogChangeShop = false;
|
|
652
|
+
let curPage = this.$xdUniHelper.getCurrentPages();
|
|
653
|
+
let {resource_shop_id, ...otherParams} = curPage.query;
|
|
654
|
+
this.$xdUniHelper.redirectTo({
|
|
655
|
+
url: curPage.path + '?' + this.$xdUniHelper.jsonToParams(otherParams)
|
|
656
|
+
})
|
|
657
|
+
},
|
|
609
658
|
handleSwitchShop(){
|
|
610
659
|
this.showDialogChangeShop = false;
|
|
611
|
-
|
|
612
|
-
|
|
660
|
+
//清空购物车
|
|
661
|
+
this.$xdShowLoading({})
|
|
662
|
+
jfbRootExec("clearFoodCart", {
|
|
663
|
+
vm: this,
|
|
664
|
+
data: {
|
|
665
|
+
namespace: this.xnamespace,
|
|
666
|
+
shop_id: this.shopInfo.shop_id,
|
|
667
|
+
consume_mode: this.consume_mode,
|
|
668
|
+
cart_order_id: this.order_id
|
|
669
|
+
}
|
|
670
|
+
}).then(res => {
|
|
671
|
+
this.$xdHideLoading();
|
|
672
|
+
this.$xdUniHelper.redirectTo({
|
|
673
|
+
url: this.productListPath + '?resource_shop_id=' + this.resource_shop_id,
|
|
674
|
+
})
|
|
613
675
|
})
|
|
614
676
|
},
|
|
615
677
|
handleChangeStop(){
|
|
616
|
-
this.showDialogChangeShop = true;
|
|
617
678
|
this.showDialogConfirmShop = false;
|
|
679
|
+
this.toSwitchShop();
|
|
618
680
|
},
|
|
619
681
|
async handleCardPay(){
|
|
620
682
|
if(!this.getCreateOrderParams()) return false;
|
|
@@ -718,7 +780,7 @@
|
|
|
718
780
|
return false;
|
|
719
781
|
}
|
|
720
782
|
return {
|
|
721
|
-
|
|
783
|
+
buyer_phone_number: this.buyer_phone_number,
|
|
722
784
|
comment: this.comment,
|
|
723
785
|
meal_method: this.meal_method,
|
|
724
786
|
};
|
|
@@ -41,6 +41,19 @@ export default (data)=>{
|
|
|
41
41
|
groupKey:'advanced',
|
|
42
42
|
className: 'input100',
|
|
43
43
|
},
|
|
44
|
+
{
|
|
45
|
+
label: '商品列表',
|
|
46
|
+
ele: 'xd-select-pages-path',
|
|
47
|
+
valueKey: 'productListPath',
|
|
48
|
+
placeholder: '请选择商品列表页跳转地址',
|
|
49
|
+
value: data.productListPath || null,
|
|
50
|
+
setting: {
|
|
51
|
+
router: XdBus.getParentApi('getPagesTree'),
|
|
52
|
+
},
|
|
53
|
+
labelInline: true,
|
|
54
|
+
groupKey:'advanced',
|
|
55
|
+
className: 'input100',
|
|
56
|
+
},
|
|
44
57
|
|
|
45
58
|
{
|
|
46
59
|
label: '版本号:',
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<view class="prod_title_number">
|
|
36
36
|
<view class="prod_title">{{ baseInfo.product_name }}</view>
|
|
37
37
|
<view class="prod_number">
|
|
38
|
-
<xd-number v-model="number" :min="1" :max="99"></xd-number>
|
|
38
|
+
<xd-number v-model="number" :min="1" :max="99" circle></xd-number>
|
|
39
39
|
</view>
|
|
40
40
|
</view>
|
|
41
41
|
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<view class="fixed_bottom" :style="prod_bottom">
|
|
54
54
|
<view class="prod_bottom_body">
|
|
55
55
|
<view class="">
|
|
56
|
-
<CusPrice :isPlus="is_plus_site" type="order" :showPrice="productShowPrice"></CusPrice>
|
|
56
|
+
<CusPrice :isPlus="is_plus_site" type="order" salePriceFontSize="32" :showPrice="productShowPrice"></CusPrice>
|
|
57
57
|
</view>
|
|
58
58
|
<view class="btns" :style="[bottomBtnWrapStyle]">
|
|
59
59
|
<xd-button
|
|
@@ -125,6 +125,9 @@
|
|
|
125
125
|
|
|
126
126
|
is_plus_site: false,
|
|
127
127
|
//面板
|
|
128
|
+
isShowDiscount: "Y", //是否展示划线价
|
|
129
|
+
differ: 1, //原价与现价的差值
|
|
130
|
+
|
|
128
131
|
shopBtnBgColor: "",
|
|
129
132
|
bottomBtnRadius: "100",
|
|
130
133
|
bottomBtnHeight: "",
|
|
@@ -174,6 +177,7 @@
|
|
|
174
177
|
return style;
|
|
175
178
|
},
|
|
176
179
|
productShowPrice(){
|
|
180
|
+
if(this.curSku && this.curSku.show_prices) return this.curSku.show_prices;
|
|
177
181
|
let originPrice = JSON.parse(JSON.stringify(this.baseInfo.show_prices));
|
|
178
182
|
return originPrice.map(item => {
|
|
179
183
|
let p = item.p + this.specsPrice;
|
|
@@ -236,7 +240,8 @@
|
|
|
236
240
|
product_id: this.product_id,
|
|
237
241
|
category_id: this.category_id,
|
|
238
242
|
consume_mode: this.consume_mode,
|
|
239
|
-
shop_id: this.shop_id
|
|
243
|
+
shop_id: this.shop_id,
|
|
244
|
+
is_show_uprice: this.isShowDiscount !== 'Y' ? 0 : this.multiply(this.differ),
|
|
240
245
|
}
|
|
241
246
|
}).then(res => {
|
|
242
247
|
this.$xdHideLoading()
|
|
@@ -249,6 +254,9 @@
|
|
|
249
254
|
this.$xdHideLoading()
|
|
250
255
|
})
|
|
251
256
|
},
|
|
257
|
+
multiply(num){
|
|
258
|
+
return this.$xdUniHelper.multiplyFloatNumber(num, 100);
|
|
259
|
+
},
|
|
252
260
|
addCart(){
|
|
253
261
|
let specs = [];
|
|
254
262
|
if(this.$refs['mySpu']){
|
|
@@ -146,7 +146,7 @@ export default {
|
|
|
146
146
|
let isExt = true;
|
|
147
147
|
let standards = item.standards;
|
|
148
148
|
checkedList.forEach((o1,ii) => {
|
|
149
|
-
let standItem = standards
|
|
149
|
+
let standItem = standards.find(stand => stand.name === o1.name);
|
|
150
150
|
if(o1.value != standItem.value){
|
|
151
151
|
isExt = false;
|
|
152
152
|
}
|
|
@@ -157,6 +157,7 @@ export default {
|
|
|
157
157
|
this.currSku = rtList[0];
|
|
158
158
|
}
|
|
159
159
|
},
|
|
160
|
+
|
|
160
161
|
checkHasProduct(i, ii){
|
|
161
162
|
let curSku = this.skuList[i];
|
|
162
163
|
let curStands = curSku.values[ii];
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
<image class="spec_img" :src="opt.image" mode=""></image>
|
|
11
11
|
<view class="spec_main">
|
|
12
12
|
<view class="spec_name">{{ opt.name }}</view>
|
|
13
|
-
<view class="spec_price">
|
|
13
|
+
<view v-if="item.showPrice" class="spec_price">
|
|
14
14
|
<template v-if="opt.price">+{{ opt.price/100 }}元</template>
|
|
15
15
|
</view>
|
|
16
|
+
<view v-else style="height: 16rpx;"></view>
|
|
16
17
|
<view v-if="item.multiple" class="spec_num" @click.stop>
|
|
17
18
|
<!-- <xd-number v-if="!checkIsDisabled(i, ii)" width="160" v-model="opt.num" :min="0" :max="99" @change="val => handleSpeNum(val, i, ii)"></xd-number> -->
|
|
18
19
|
<view v-if="!checkIsDisabled(i, ii)" class="num_box">
|
|
@@ -76,10 +77,13 @@ export default {
|
|
|
76
77
|
list: {
|
|
77
78
|
handler(val){
|
|
78
79
|
this.uiList = val.map(item => {
|
|
80
|
+
let showPrice = false;
|
|
79
81
|
item.values = item.values.map(opt => {
|
|
80
82
|
if(!opt.checked) opt.num = 0;
|
|
83
|
+
if(opt.price > 0) showPrice = true;
|
|
81
84
|
return opt;
|
|
82
85
|
})
|
|
86
|
+
item.showPrice = showPrice;
|
|
83
87
|
return item;
|
|
84
88
|
});
|
|
85
89
|
},
|
|
@@ -213,6 +217,7 @@ export default {
|
|
|
213
217
|
}
|
|
214
218
|
|
|
215
219
|
.specs_img_item{
|
|
220
|
+
width: 212rpx;
|
|
216
221
|
border: 1px solid #F8F8F8;
|
|
217
222
|
border-radius: 8rpx;
|
|
218
223
|
display: flex;
|
|
@@ -260,6 +265,9 @@ export default {
|
|
|
260
265
|
}
|
|
261
266
|
.spec_name{
|
|
262
267
|
margin-top: 16rpx;
|
|
268
|
+
width: 100%;
|
|
269
|
+
text-align: center;
|
|
270
|
+
padding: 0 8rpx;
|
|
263
271
|
}
|
|
264
272
|
.spec_price{
|
|
265
273
|
height: 28rpx;
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
<view class="prod_specs" v-if="item.sub_name">{{item.sub_name}}</view>
|
|
69
69
|
<view class="prod_price">
|
|
70
70
|
<view style="display:flex;align-items:center">
|
|
71
|
-
<CusPrice :isPlus="is_plus_site" :isShowIcon="false" :showPrice="item.show_prices"></CusPrice>
|
|
71
|
+
<CusPrice :isPlus="is_plus_site" :isShowIcon="false" salePriceFontSize="32" :showPrice="item.show_prices"></CusPrice>
|
|
72
72
|
</view>
|
|
73
73
|
<view style="font-size: 28rpx;color:#999">
|
|
74
74
|
<view v-if="item.has_choose" class="chose_spu" @click="toProductDetail(item)">
|
|
@@ -76,8 +76,9 @@
|
|
|
76
76
|
<view v-if="item.num" class="cart_edg">{{ item.num }}</view>
|
|
77
77
|
</view>
|
|
78
78
|
<view v-else>
|
|
79
|
-
<xd-number v-if="item.num" v-model="item.num" @change="val => handleCartNumChange(val, item)"></xd-number>
|
|
80
|
-
<xd-font-icon v-else icon="iconaddcart" :color="mainColor" size="46"></xd-font-icon>
|
|
79
|
+
<xd-number v-if="item.num" v-model="item.num" circle @change="val => handleCartNumChange(val, item)"></xd-number>
|
|
80
|
+
<!-- <xd-font-icon v-else icon="iconaddcart" :color="mainColor" size="46"></xd-font-icon> -->
|
|
81
|
+
<view class="icon_add_cart" v-else @click="toProductDetail(item)">+</view>
|
|
81
82
|
</view>
|
|
82
83
|
</view>
|
|
83
84
|
</view>
|
|
@@ -106,7 +107,8 @@
|
|
|
106
107
|
<xd-unit :price="cartPrice" :isOld="false"></xd-unit>
|
|
107
108
|
</view>
|
|
108
109
|
<view>
|
|
109
|
-
<xd-button width="170rpx" size="small" type="primary"
|
|
110
|
+
<xd-button v-if="cartProductList.length" width="170rpx" size="small" type="primary" @click="handleSubmitCart">选好了</xd-button>
|
|
111
|
+
<xd-button v-else width="170rpx" size="small" type="primary" :disabled="true">选好了</xd-button>
|
|
110
112
|
</view>
|
|
111
113
|
</view>
|
|
112
114
|
<view class="cart_product_modal" v-if="cartProductShow">
|
|
@@ -136,7 +138,7 @@
|
|
|
136
138
|
<CusPrice :isPlus="is_plus_site" type="order" :showPrice="prod.show_prices"></CusPrice>
|
|
137
139
|
</view>
|
|
138
140
|
<view style="font-size: 28rpx;color:#999">
|
|
139
|
-
<xd-number v-model="prod.num" @change="val => handleCartNumChange(val, prod)"></xd-number>
|
|
141
|
+
<xd-number circle v-model="prod.num" @change="val => handleCartNumChange(val, prod)"></xd-number>
|
|
140
142
|
</view>
|
|
141
143
|
</view>
|
|
142
144
|
</view>
|
|
@@ -210,6 +212,7 @@
|
|
|
210
212
|
cartPrice: 0,
|
|
211
213
|
cartCount: 0,
|
|
212
214
|
cartProductShow: false,
|
|
215
|
+
scrollTopTimer: null,
|
|
213
216
|
|
|
214
217
|
//商品列表
|
|
215
218
|
column_num: 1,
|
|
@@ -227,6 +230,8 @@
|
|
|
227
230
|
is_plus_site: false,
|
|
228
231
|
|
|
229
232
|
//面板
|
|
233
|
+
isShowDiscount: "Y", //是否展示划线价
|
|
234
|
+
differ: 1, //原价与现价的差值
|
|
230
235
|
foodDetailPath: "",
|
|
231
236
|
confirmPath: "",
|
|
232
237
|
switchStorePath: "",
|
|
@@ -304,13 +309,18 @@
|
|
|
304
309
|
},
|
|
305
310
|
handleCartNumChange(val, prod){
|
|
306
311
|
console.log("handleCartNumChange", val, prod)
|
|
312
|
+
let product = {
|
|
313
|
+
product_id: prod.product_id,
|
|
314
|
+
num: val,
|
|
315
|
+
category_id: prod.category_id
|
|
316
|
+
}
|
|
307
317
|
jfbRootExec("setFoodCartNum", {
|
|
308
318
|
vm: this,
|
|
309
319
|
data: {
|
|
310
320
|
xnamespace: this.xnamespace,
|
|
311
321
|
shop_id: this.shopInfo.shop_id,
|
|
312
322
|
consume_mode: this.consume_mode,
|
|
313
|
-
product:
|
|
323
|
+
product: product
|
|
314
324
|
}
|
|
315
325
|
}).then(res => {
|
|
316
326
|
this.p_getFoodCartCount();
|
|
@@ -375,6 +385,7 @@
|
|
|
375
385
|
},
|
|
376
386
|
//获取门店分类信息
|
|
377
387
|
p_getFoodShopCategory(){
|
|
388
|
+
this.$xdShowLoading({})
|
|
378
389
|
jfbRootExec("getFoodShopCategory", {
|
|
379
390
|
vm: this,
|
|
380
391
|
data: {
|
|
@@ -383,6 +394,7 @@
|
|
|
383
394
|
consume_mode: this.consume_mode
|
|
384
395
|
}
|
|
385
396
|
}).then(res => {
|
|
397
|
+
this.$xdHideLoading();
|
|
386
398
|
this.categoryList = res.categories.map(item => {
|
|
387
399
|
item.productList = [];
|
|
388
400
|
return item;
|
|
@@ -393,6 +405,10 @@
|
|
|
393
405
|
}
|
|
394
406
|
})
|
|
395
407
|
},
|
|
408
|
+
// this.$xdUniHelper.multiplyFloatNumber(res.total_price, 1);
|
|
409
|
+
multiply(num){
|
|
410
|
+
return this.$xdUniHelper.multiplyFloatNumber(num, 100);
|
|
411
|
+
},
|
|
396
412
|
getList(options = {}){
|
|
397
413
|
return new Promise((resolve, reject) => {
|
|
398
414
|
jfbRootExec("getFoodProductList", {
|
|
@@ -404,6 +420,7 @@
|
|
|
404
420
|
page_token: options.page_token || 1,
|
|
405
421
|
page_size: this.page_size,
|
|
406
422
|
category_id: options.category_id,
|
|
423
|
+
is_show_uprice: this.isShowDiscount !== 'Y' ? 0 : this.multiply(this.differ),
|
|
407
424
|
...options,
|
|
408
425
|
}
|
|
409
426
|
}).then(res => {
|
|
@@ -450,7 +467,7 @@
|
|
|
450
467
|
return new Promise((resolve,reject) => {
|
|
451
468
|
this.getList(options).then(async res => {
|
|
452
469
|
this.$xdHideLoading();
|
|
453
|
-
if(res.total_size
|
|
470
|
+
if(res.total_size <= 5){
|
|
454
471
|
await this.loadNextCateProduct(this.loadCateIndex)
|
|
455
472
|
}
|
|
456
473
|
this.$nextTick(() => {
|
|
@@ -466,18 +483,17 @@
|
|
|
466
483
|
})
|
|
467
484
|
})
|
|
468
485
|
},
|
|
469
|
-
setCategoryRect(){
|
|
470
|
-
console.log("setCategoryRect")
|
|
486
|
+
async setCategoryRect(){
|
|
471
487
|
const query = uni.createSelectorQuery().in(this);
|
|
472
|
-
|
|
488
|
+
|
|
489
|
+
for(let i = 0; i < this.categoryList.length; i++){
|
|
490
|
+
let cate = this.categoryList[i];
|
|
473
491
|
let id = this.getID(cate);
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
})
|
|
492
|
+
let cateHeight = await this.syncGetEleHeight('#' + id);
|
|
493
|
+
this.$set(this.categoryList[i], 'height', cateHeight);
|
|
494
|
+
}
|
|
495
|
+
|
|
479
496
|
query.select(".product_scroll").boundingClientRect(data => {
|
|
480
|
-
console.log(data, "product_scroll categoryList");
|
|
481
497
|
this.scrollBoxHeight = data.height;
|
|
482
498
|
}).exec();
|
|
483
499
|
|
|
@@ -488,6 +504,14 @@
|
|
|
488
504
|
return item;
|
|
489
505
|
})
|
|
490
506
|
},
|
|
507
|
+
syncGetEleHeight(ele){
|
|
508
|
+
return new Promise((resolve, reject) => {
|
|
509
|
+
this.$xdUniHelper.getWindowHeight([ele], this).then(res => {
|
|
510
|
+
console.log(res);
|
|
511
|
+
resolve(res[ele].height);
|
|
512
|
+
})
|
|
513
|
+
})
|
|
514
|
+
},
|
|
491
515
|
getID(cate) {
|
|
492
516
|
return `category_${cate.category_id}`;
|
|
493
517
|
},
|
|
@@ -511,7 +535,10 @@
|
|
|
511
535
|
handleScroll(e){
|
|
512
536
|
// console.log(e, 'handleScroll')
|
|
513
537
|
let scrollTop = e.detail.scrollTop;
|
|
514
|
-
this.
|
|
538
|
+
if(this.scrollTopTimer) clearTimeout(this.scrollTopTimer);
|
|
539
|
+
this.scrollTopTimer = setTimeout(()=>{
|
|
540
|
+
this.prodScrollTop = scrollTop;
|
|
541
|
+
},50)
|
|
515
542
|
//手动点击tab定位不触发
|
|
516
543
|
if(!this.pointerScroll) return false;
|
|
517
544
|
if(this.lastScrollTop > scrollTop){
|
|
@@ -920,6 +947,20 @@
|
|
|
920
947
|
display: flex;
|
|
921
948
|
align-items: flex-end;
|
|
922
949
|
justify-content: space-between;
|
|
950
|
+
|
|
951
|
+
.icon_add_cart{
|
|
952
|
+
background-color: var(--main-color);
|
|
953
|
+
border: 1px solid var(--main-color);
|
|
954
|
+
border-radius: 50%;
|
|
955
|
+
color: #FFFFFF;
|
|
956
|
+
font-size: 28rpx;
|
|
957
|
+
width: 48rpx;
|
|
958
|
+
height: 48rpx;
|
|
959
|
+
display: flex;
|
|
960
|
+
align-items: center;
|
|
961
|
+
justify-content: center;
|
|
962
|
+
box-sizing: border-box;
|
|
963
|
+
}
|
|
923
964
|
}
|
|
924
965
|
}
|
|
925
966
|
}
|