jufubao-mall 2.0.32-beta1 → 2.0.32-beta2
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
|
@@ -124,9 +124,9 @@
|
|
|
124
124
|
<view v-if="item.product_id === productId"></view>
|
|
125
125
|
</view>
|
|
126
126
|
</view>
|
|
127
|
-
<view class="media-detail">
|
|
127
|
+
<view class="media-detail" v-if="prodcutInfo">
|
|
128
128
|
<view>商品详情</view>
|
|
129
|
-
<view
|
|
129
|
+
<view>
|
|
130
130
|
<xd-content-xss :key="prodcutContKey" v-if="prodcutInfo" :html="prodcutInfo"></xd-content-xss>
|
|
131
131
|
</view>
|
|
132
132
|
</view>
|
|
@@ -474,6 +474,7 @@
|
|
|
474
474
|
this.twoViewId = '';
|
|
475
475
|
this.threeViewId = ''
|
|
476
476
|
this.productList = null;
|
|
477
|
+
this.prodcutInfo = '';
|
|
477
478
|
this.productId = -1
|
|
478
479
|
this.shopId = -1;
|
|
479
480
|
|
|
@@ -626,6 +627,7 @@
|
|
|
626
627
|
|
|
627
628
|
},
|
|
628
629
|
getProductInfo(item = null){
|
|
630
|
+
this.prodcutInfo = '';
|
|
629
631
|
if(item === null) this.hasProducts = 'N';
|
|
630
632
|
else {
|
|
631
633
|
this.hasProducts = 'Y';
|
|
@@ -635,67 +637,84 @@
|
|
|
635
637
|
//====分类数据=========
|
|
636
638
|
|
|
637
639
|
//==商品相关操作=======
|
|
638
|
-
handleProductOperate(){
|
|
639
|
-
this.getProductContent(this.productId);
|
|
640
|
-
this.getProductBtns(this.productId);
|
|
641
|
-
this.getProductForm(this.productId);
|
|
640
|
+
async handleProductOperate(){
|
|
641
|
+
await this.getProductContent(this.productId);
|
|
642
|
+
await this.getProductBtns(this.productId);
|
|
643
|
+
await this.getProductForm(this.productId);
|
|
644
|
+
this.$xdHideLoading();
|
|
642
645
|
},
|
|
643
646
|
|
|
644
647
|
handleSelectProduct(i){
|
|
645
648
|
if(i === this.productId) return
|
|
646
649
|
this.productId = i;
|
|
650
|
+
this.$xdShowLoading({});
|
|
647
651
|
this.handleProductOperate()
|
|
648
652
|
},
|
|
649
653
|
|
|
650
654
|
getProductBtns(product_id){
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
655
|
+
return new Promise((resolve)=>{
|
|
656
|
+
jfbRootExec("getMallMediaProductBuyButton", {
|
|
657
|
+
vm: this,
|
|
658
|
+
data: {
|
|
659
|
+
product_id,
|
|
660
|
+
xnamespace: this.xnamespace,
|
|
661
|
+
}
|
|
662
|
+
}).then(res=>{
|
|
663
|
+
let isCanBuyItem = res['buttons'].filter(item=>{
|
|
664
|
+
return item.code === 'buy-now' && item.enabled === true;
|
|
665
|
+
});
|
|
666
|
+
this.isCanBuy = isCanBuyItem.length > 0;
|
|
667
|
+
resolve();
|
|
668
|
+
}).catch(err=>{
|
|
669
|
+
this.isCanBuy = false
|
|
670
|
+
resolve();
|
|
671
|
+
})
|
|
664
672
|
})
|
|
673
|
+
|
|
665
674
|
},
|
|
666
675
|
|
|
667
676
|
getProductForm(product_id){
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
677
|
+
return new Promise((resolve)=>{
|
|
678
|
+
jfbRootExec("getMallMediaProductForm", {
|
|
679
|
+
vm: this,
|
|
680
|
+
data: {
|
|
681
|
+
product_id,
|
|
682
|
+
xnamespace: this.xnamespace,
|
|
683
|
+
}
|
|
684
|
+
}).then(res=>{
|
|
685
|
+
this.blessingData = res['form_data']||[];
|
|
686
|
+
resolve()
|
|
687
|
+
}).catch(err=>{
|
|
688
|
+
this.blessingData = [];
|
|
689
|
+
console.error(err);
|
|
690
|
+
resolve()
|
|
691
|
+
})
|
|
679
692
|
})
|
|
693
|
+
|
|
680
694
|
},
|
|
681
695
|
|
|
682
696
|
getProductContent(product_id){
|
|
683
|
-
|
|
684
|
-
this.prodcutContKey = Date.now();
|
|
685
|
-
|
|
686
|
-
jfbRootExec("getMallMediaProductContent", {
|
|
687
|
-
vm: this,
|
|
688
|
-
data: {
|
|
689
|
-
product_id,
|
|
690
|
-
xnamespace: this.xnamespace,
|
|
691
|
-
}
|
|
692
|
-
}).then(res=>{
|
|
693
|
-
this.prodcutInfo = res.content;
|
|
694
|
-
this.prodcutContKey = Date.now()
|
|
695
|
-
}).catch(err=>{
|
|
697
|
+
return new Promise((resolve)=>{
|
|
696
698
|
this.prodcutInfo = '';
|
|
697
|
-
this.prodcutContKey = Date.now()
|
|
699
|
+
this.prodcutContKey = Date.now();
|
|
700
|
+
|
|
701
|
+
jfbRootExec("getMallMediaProductContent", {
|
|
702
|
+
vm: this,
|
|
703
|
+
data: {
|
|
704
|
+
product_id,
|
|
705
|
+
xnamespace: this.xnamespace,
|
|
706
|
+
}
|
|
707
|
+
}).then(res=>{
|
|
708
|
+
this.prodcutInfo = res.content;
|
|
709
|
+
this.prodcutContKey = Date.now();
|
|
710
|
+
resolve()
|
|
711
|
+
}).catch(err=>{
|
|
712
|
+
this.prodcutInfo = '';
|
|
713
|
+
this.prodcutContKey = Date.now();
|
|
714
|
+
resolve()
|
|
715
|
+
})
|
|
698
716
|
})
|
|
717
|
+
|
|
699
718
|
},
|
|
700
719
|
|
|
701
720
|
filterProdcutData(list = []){
|
|
@@ -717,13 +736,13 @@
|
|
|
717
736
|
page_token: this.page_token,
|
|
718
737
|
page_size: this.page_size,
|
|
719
738
|
custom_category_id: cate.category_id,
|
|
720
|
-
|
|
739
|
+
//is_remove_same_prefix_name: 'Y'
|
|
721
740
|
}
|
|
722
741
|
|
|
723
742
|
//设置是否展示划线价格
|
|
724
743
|
if(this.isShowDiscount==='Y') data.is_show_uprice = this.$xdUniHelper.multiplyFloatNumber(this.differ,100)
|
|
725
744
|
else data.is_show_uprice = -1
|
|
726
|
-
|
|
745
|
+
this.$xdShowLoading({});
|
|
727
746
|
jfbRootExec("getMallMediaProductList", {
|
|
728
747
|
vm: this,
|
|
729
748
|
data: data
|
|
@@ -737,8 +756,12 @@
|
|
|
737
756
|
this.productId = item.product_id;
|
|
738
757
|
this.handleProductOperate()
|
|
739
758
|
}
|
|
759
|
+
else {
|
|
760
|
+
this.$xdHideLoading();
|
|
761
|
+
}
|
|
740
762
|
|
|
741
763
|
}).catch(err=>{
|
|
764
|
+
this.$xdHideLoading();
|
|
742
765
|
this.productList = [ ]
|
|
743
766
|
})
|
|
744
767
|
},
|