jufubao-mall 2.0.32-beta1 → 2.0.32-beta3

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-mall",
3
- "version": "2.0.32-beta1",
3
+ "version": "2.0.32-beta3",
4
4
  "private": false,
5
5
  "description": "聚福宝商城业务组件插件包",
6
6
  "main": "index.js",
@@ -124,9 +124,16 @@
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-product-nodata" v-if="productList && productList.length === 0">
128
+ <xd-no-data
129
+ icon-type="product"
130
+ :scale-size="2"
131
+ height="100%"
132
+ >当前暂无商品</xd-no-data>
133
+ </view>
134
+ <view class="media-detail" v-if="prodcutInfo">
128
135
  <view>商品详情</view>
129
- <view v-if="prodcutInfo">
136
+ <view>
130
137
  <xd-content-xss :key="prodcutContKey" v-if="prodcutInfo" :html="prodcutInfo"></xd-content-xss>
131
138
  </view>
132
139
  </view>
@@ -209,7 +216,8 @@
209
216
  if(this.cateTwoList.length > 0) other += 190 //二级分类高度
210
217
  other += 80 //底部缝隙高度
211
218
  other += 120 //底部高度
212
- other += 32
219
+ other += 32;
220
+ if(this.cateThreeList.length === 0) other -= 80
213
221
  return {
214
222
  height: `calc(${this.layoutInfo.bodyMinHeightPx}px - ${other* this.$rpxNum}px)`
215
223
  }
@@ -474,6 +482,7 @@
474
482
  this.twoViewId = '';
475
483
  this.threeViewId = ''
476
484
  this.productList = null;
485
+ this.prodcutInfo = '';
477
486
  this.productId = -1
478
487
  this.shopId = -1;
479
488
 
@@ -626,6 +635,7 @@
626
635
 
627
636
  },
628
637
  getProductInfo(item = null){
638
+ this.prodcutInfo = '';
629
639
  if(item === null) this.hasProducts = 'N';
630
640
  else {
631
641
  this.hasProducts = 'Y';
@@ -635,67 +645,84 @@
635
645
  //====分类数据=========
636
646
 
637
647
  //==商品相关操作=======
638
- handleProductOperate(){
639
- this.getProductContent(this.productId);
640
- this.getProductBtns(this.productId);
641
- this.getProductForm(this.productId);
648
+ async handleProductOperate(){
649
+ await this.getProductContent(this.productId);
650
+ await this.getProductBtns(this.productId);
651
+ await this.getProductForm(this.productId);
652
+ this.$xdHideLoading();
642
653
  },
643
654
 
644
655
  handleSelectProduct(i){
645
656
  if(i === this.productId) return
646
657
  this.productId = i;
658
+ this.$xdShowLoading({});
647
659
  this.handleProductOperate()
648
660
  },
649
661
 
650
662
  getProductBtns(product_id){
651
- jfbRootExec("getMallMediaProductBuyButton", {
652
- vm: this,
653
- data: {
654
- product_id,
655
- xnamespace: this.xnamespace,
656
- }
657
- }).then(res=>{
658
- let isCanBuyItem = res['buttons'].filter(item=>{
659
- return item.code === 'buy-now' && item.enabled === true;
660
- });
661
- this.isCanBuy = isCanBuyItem.length > 0;
662
- }).catch(err=>{
663
- this.isCanBuy = false
663
+ return new Promise((resolve)=>{
664
+ jfbRootExec("getMallMediaProductBuyButton", {
665
+ vm: this,
666
+ data: {
667
+ product_id,
668
+ xnamespace: this.xnamespace,
669
+ }
670
+ }).then(res=>{
671
+ let isCanBuyItem = res['buttons'].filter(item=>{
672
+ return item.code === 'buy-now' && item.enabled === true;
673
+ });
674
+ this.isCanBuy = isCanBuyItem.length > 0;
675
+ resolve();
676
+ }).catch(err=>{
677
+ this.isCanBuy = false
678
+ resolve();
679
+ })
664
680
  })
681
+
665
682
  },
666
683
 
667
684
  getProductForm(product_id){
668
- jfbRootExec("getMallMediaProductForm", {
669
- vm: this,
670
- data: {
671
- product_id,
672
- xnamespace: this.xnamespace,
673
- }
674
- }).then(res=>{
675
- this.blessingData = res['form_data']||[];
676
- }).catch(err=>{
677
- this.blessingData = [];
678
- console.error(err);
685
+ return new Promise((resolve)=>{
686
+ jfbRootExec("getMallMediaProductForm", {
687
+ vm: this,
688
+ data: {
689
+ product_id,
690
+ xnamespace: this.xnamespace,
691
+ }
692
+ }).then(res=>{
693
+ this.blessingData = res['form_data']||[];
694
+ resolve()
695
+ }).catch(err=>{
696
+ this.blessingData = [];
697
+ console.error(err);
698
+ resolve()
699
+ })
679
700
  })
701
+
680
702
  },
681
703
 
682
704
  getProductContent(product_id){
683
- this.prodcutInfo = '';
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=>{
705
+ return new Promise((resolve)=>{
696
706
  this.prodcutInfo = '';
697
- this.prodcutContKey = Date.now()
707
+ this.prodcutContKey = Date.now();
708
+
709
+ jfbRootExec("getMallMediaProductContent", {
710
+ vm: this,
711
+ data: {
712
+ product_id,
713
+ xnamespace: this.xnamespace,
714
+ }
715
+ }).then(res=>{
716
+ this.prodcutInfo = res.content;
717
+ this.prodcutContKey = Date.now();
718
+ resolve()
719
+ }).catch(err=>{
720
+ this.prodcutInfo = '';
721
+ this.prodcutContKey = Date.now();
722
+ resolve()
723
+ })
698
724
  })
725
+
699
726
  },
700
727
 
701
728
  filterProdcutData(list = []){
@@ -717,13 +744,13 @@
717
744
  page_token: this.page_token,
718
745
  page_size: this.page_size,
719
746
  custom_category_id: cate.category_id,
720
- is_remove_same_prefix_nam: 'Y'
747
+ is_remove_same_prefix_name: 'Y'
721
748
  }
722
749
 
723
750
  //设置是否展示划线价格
724
751
  if(this.isShowDiscount==='Y') data.is_show_uprice = this.$xdUniHelper.multiplyFloatNumber(this.differ,100)
725
752
  else data.is_show_uprice = -1
726
-
753
+ this.$xdShowLoading({});
727
754
  jfbRootExec("getMallMediaProductList", {
728
755
  vm: this,
729
756
  data: data
@@ -737,8 +764,12 @@
737
764
  this.productId = item.product_id;
738
765
  this.handleProductOperate()
739
766
  }
767
+ else {
768
+ this.$xdHideLoading();
769
+ }
740
770
 
741
771
  }).catch(err=>{
772
+ this.$xdHideLoading();
742
773
  this.productList = [ ]
743
774
  })
744
775
  },
@@ -838,7 +869,7 @@
838
869
  display: flex;
839
870
  justify-content: flex-start;
840
871
  white-space: nowrap;
841
- padding: 16rpx 32rpx 30rpx;
872
+ padding: 16rpx 0 30rpx 32rpx;
842
873
  }
843
874
  &-item {
844
875
  margin-right: 16rpx;
@@ -920,7 +951,6 @@
920
951
  margin: 0 16rpx 16rpx;
921
952
  background-color: #fff;
922
953
  border-radius: 16rpx;
923
- min-height: var(--g-comp-min-height);
924
954
  }
925
955
 
926
956
  .media-input {
@@ -999,7 +1029,14 @@
999
1029
 
1000
1030
  }
1001
1031
  }
1002
-
1032
+ .media-product-nodata {
1033
+ padding: 24rpx;
1034
+ border-radius: var(--g-comp-radius);
1035
+ overflow: hidden;
1036
+ background: rgba(255, 255, 255, 1);
1037
+ margin-bottom: 24rpx;
1038
+ height: 700rpx;
1039
+ }
1003
1040
  .media-product {
1004
1041
  padding: 24rpx;
1005
1042
  border-radius: var(--g-comp-radius);
@@ -1012,6 +1049,8 @@
1012
1049
  align-items: center;
1013
1050
  flex-flow: wrap;
1014
1051
 
1052
+
1053
+
1015
1054
  &-item {
1016
1055
  width: calc((100% - 48rpx)/3);
1017
1056
  flex-shrink: 0;
@@ -8,6 +8,7 @@ export default {
8
8
  style: [],
9
9
  advanced: [],
10
10
  content: (data, gValue, gColor, oldData={})=>{
11
+ debugger
11
12
  console.log(data['row_num'],"data['row_num']");
12
13
 
13
14
  let defContShadow = oldTonNewBorAndSha(