jufubao-food 1.0.15-beta4 → 1.0.15-beta6
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
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<!-- #endif -->
|
|
18
18
|
<view class="jfb-food-product-list__body" :style="[bodyStyleComp]">
|
|
19
19
|
<view v-if="shopInfo">
|
|
20
|
-
<view class="shop_info" :style="{top: layoutInfo.top+'rpx'}" @click="
|
|
20
|
+
<view class="shop_info" :style="{top: layoutInfo.top+'rpx'}" @click="handleSwitchShop">
|
|
21
21
|
<view class="flex-center">
|
|
22
22
|
<xd-font-icon icon="icona-Buy2" size="36" style="margin-right: 8rpx;"></xd-font-icon>
|
|
23
23
|
<view class="shop_name">{{ shopInfo.shop_name }}</view><text style="margin:0 20rpx;">|</text> <text class="_distance">{{ shopInfo.distance }}</text>
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
scrollTopTimer: null,
|
|
270
270
|
brand_id: "",
|
|
271
271
|
shopList: [],
|
|
272
|
-
curShopIndex:
|
|
272
|
+
curShopIndex: -1,
|
|
273
273
|
|
|
274
274
|
//商品列表
|
|
275
275
|
column_num: 1,
|
|
@@ -437,7 +437,11 @@
|
|
|
437
437
|
this.resource_shop_id = options.resource_shop_id;
|
|
438
438
|
this.consume_mode = options.consume_mode || 'HDSELF';
|
|
439
439
|
this.brand_id = options.brand_id;
|
|
440
|
-
this.
|
|
440
|
+
if(this.resource_shop_id){
|
|
441
|
+
this.p_getFoodShopDetail(this.resource_shop_id);
|
|
442
|
+
}else if(this.brand_id){
|
|
443
|
+
this.p_getFoodShopList();
|
|
444
|
+
}
|
|
441
445
|
},
|
|
442
446
|
/**
|
|
443
447
|
* @description 监听事件变化
|
|
@@ -538,6 +542,9 @@
|
|
|
538
542
|
})
|
|
539
543
|
},
|
|
540
544
|
toSwitchShopPage(){
|
|
545
|
+
if(this.shopList.length===0){
|
|
546
|
+
this.p_getFoodShopList(false);
|
|
547
|
+
}
|
|
541
548
|
this.showTakeoutShop = true;
|
|
542
549
|
},
|
|
543
550
|
handleSwitchShop(){
|
|
@@ -552,7 +559,7 @@
|
|
|
552
559
|
}
|
|
553
560
|
this.showTakeoutShop = false;
|
|
554
561
|
},
|
|
555
|
-
p_getFoodShopList(){
|
|
562
|
+
p_getFoodShopList(loadFirstShop=true){
|
|
556
563
|
jfbRootExec("getFoodShopList", {
|
|
557
564
|
vm: this,
|
|
558
565
|
data: {
|
|
@@ -566,8 +573,13 @@
|
|
|
566
573
|
}).then(res => {
|
|
567
574
|
if(res.list && res.list.length > 0){
|
|
568
575
|
this.shopList = res.list;
|
|
569
|
-
|
|
570
|
-
|
|
576
|
+
if(loadFirstShop){
|
|
577
|
+
this.curShopIndex = 0;
|
|
578
|
+
this.p_getFoodShopDetail();
|
|
579
|
+
}else{
|
|
580
|
+
let findShopIndex = this.shopList.findIndex(item => item.resource_shop_id == this.resource_shop_id);
|
|
581
|
+
this.curShopIndex = findShopIndex;
|
|
582
|
+
}
|
|
571
583
|
if(!this.$configProject['isPreview']){
|
|
572
584
|
this.showTakeoutShop = true;
|
|
573
585
|
}
|
|
@@ -576,13 +588,13 @@
|
|
|
576
588
|
}
|
|
577
589
|
})
|
|
578
590
|
},
|
|
579
|
-
p_getFoodShopDetail(){
|
|
591
|
+
p_getFoodShopDetail(resource_shop_id){
|
|
580
592
|
let curShop = this.shopList[this.curShopIndex];
|
|
581
593
|
jfbRootExec("getFoodShopDetail", {
|
|
582
594
|
vm: this,
|
|
583
595
|
data: {
|
|
584
596
|
xnamespace: this.xnamespace,
|
|
585
|
-
resource_shop_id: curShop.resource_shop_id,
|
|
597
|
+
resource_shop_id: resource_shop_id || curShop.resource_shop_id,
|
|
586
598
|
consume_mode: this.consume_mode,
|
|
587
599
|
latitude: this.stateLocation.latitude,
|
|
588
600
|
longitude: this.stateLocation.longitude,
|