jufubao-mall 2.0.6 → 2.0.7

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.6",
3
+ "version": "2.0.7",
4
4
  "private": false,
5
5
  "description": "聚福宝商城业务组件插件包",
6
6
  "main": "index.js",
@@ -139,6 +139,7 @@
139
139
  </view>
140
140
  </uni-swipe-action>
141
141
  </view>
142
+ <view :style="[positionBottom]"></view>
142
143
  </view>
143
144
  <xd-no-data v-else height="600rpx" :hasImg="hasImg" iconType="cart" scaleSize="2">
144
145
  <slot>
@@ -149,8 +150,8 @@
149
150
  </slot>
150
151
  </xd-no-data>
151
152
  </template>
152
- <view v-if="cartList.length" class="bottom_fixed" :style="cart_bottom">
153
- <view class="bottom_fixed_body" :style="[bottomFixedBoxStyle]">
153
+ <view v-if="cartList.length" class="bottom_fixed" id="bottom_fixed" :style="cart_bottom">
154
+ <view class="bottom_fixed_body" id="bottom_fixed_body" :style="[bottomFixedBoxStyle]">
154
155
  <view class="flex-sub">
155
156
  <view class="flex">
156
157
  <xd-radio size="mini" :width="40" :height="60" :is-old="false" :value="allCheck" @change="handleAllCheck"></xd-radio>
@@ -293,6 +294,7 @@ export default {
293
294
  hasImg:['cart'],
294
295
  cartStyle:null,
295
296
  cardHeaderHeight:0,
297
+ bottomFixedHeight:0,
296
298
  };
297
299
  },
298
300
  watch: {
@@ -303,7 +305,26 @@ export default {
303
305
  cartList(n, o) {
304
306
  if (n && JSON.stringify(n) !== JSON.stringify(o)) {
305
307
  jfbRootFnExec(this, "onCustomEvent")("mallCart@cartList", n);
306
- }
308
+ if(n.length){
309
+ setTimeout(() => {
310
+ this.$nextTick(() => {
311
+ const query = uni.createSelectorQuery().in(this);
312
+ query
313
+ .select("#bottom_fixed_body")
314
+ .boundingClientRect((data) => {
315
+ if (data) {
316
+ this.bottomFixedHeight = data.height;
317
+ console.log("目标元素信息:", data);
318
+ } else {
319
+ console.error("未找到目标元素");
320
+ }
321
+ })
322
+ .exec();
323
+ })
324
+ },50)
325
+
326
+ }
327
+ }
307
328
  },
308
329
  checkedProdList: {
309
330
  handler(n, o) {
@@ -384,7 +405,8 @@ export default {
384
405
  },
385
406
  listMarTop(){
386
407
  return {
387
- top:this.cardHeaderHeight+'px'
408
+ top:this.cardHeaderHeight+'px',
409
+ marginBottom: this.cardHeaderHeight+'px'
388
410
  }
389
411
  },
390
412
  fixedHeaderStyle(){
@@ -396,6 +418,11 @@ export default {
396
418
  top: this.layoutInfo['top']+'rpx'
397
419
  }
398
420
  },
421
+ positionBottom(){
422
+ return{
423
+ height: this.bottomFixedHeight+'px'
424
+ }
425
+ }
399
426
  },
400
427
  created() {
401
428
  this.init(this.container);
@@ -839,7 +866,6 @@ export default {
839
866
  height: 100%;
840
867
  .cart_wrap {
841
868
  position: relative;
842
- padding-bottom: 120rpx;
843
869
  .cart_header {
844
870
  position: relative;
845
871
  display: flex;
@@ -897,7 +923,6 @@ export default {
897
923
  }
898
924
  }
899
925
  .cart_item {
900
- margin-bottom: 40rpx;
901
926
  .shop_name {
902
927
  display: flex;
903
928
  align-items: center;
@@ -28,11 +28,18 @@
28
28
  height="750rpx"
29
29
  :indicatorDots="false"
30
30
  @animationfinish="animationfinish"
31
- >
31
+ >
32
+ <!--#ifdef H5-->
32
33
  <template slot-scope="{ item,index }">
33
- <image v-if="item.status===true" @error="item.status=false" @click="handlePreview(index,item)" :src="item.src"></image>
34
- <image v-if="item.status===false" :src="errorProductUrl" @click="handlePreview(index,item)"></image>
34
+ <image v-show="item.status===true" @error="item.status=false" @click="handlePreview(index,item)" :src="item.src"></image>
35
+ <image v-show="item.status===false" :src="errorProductUrl" @click="handlePreview(index,item)"></image>
35
36
  </template>
37
+ <!-- #endif -->
38
+ <!--#ifdef MP-WEIXIN-->
39
+ <template slot-scope="{ item,index }">
40
+ <image @click="handlePreview(index)" :src="item.src"></image>
41
+ </template>
42
+ <!-- #endif -->
36
43
  </xd-swiper>
37
44
  <view class="xd-store-product__swiper-tips">{{swiperCurrent + 1}}/{{images.length}}</view>
38
45
  </view>
@@ -229,6 +236,7 @@
229
236
  :cusStyle="[bottomBtnStyle, {
230
237
  color: shopBtnTextColor
231
238
  }]"
239
+ :isAuto="!btnAddBuy||!btnBuyNow"
232
240
  :wrapStyle="[wrapStyle]"
233
241
  :bg-color="shopBtnBgColor"
234
242
  :radius="bottomBtnRadius+'rpx'"
@@ -238,6 +246,7 @@
238
246
  >加入购物车</xd-button>
239
247
  <xd-button
240
248
  v-if="btnBuyNow"
249
+ :isAuto="!btnAddBuy||!btnBuyNow"
241
250
  :disabled="!btnBuyNow.enabled"
242
251
  :cusStyle="[bottomBtnStyle, {
243
252
  color: buyBtnTextColor
@@ -645,7 +654,7 @@
645
654
  return style;
646
655
  },
647
656
  wrapStyle() {
648
- let style = {color:'red'};
657
+ let style = {};
649
658
  if(this.bottomBtnFill === 'fill'){
650
659
  style['flex'] = 1;
651
660
  style['display'] = 'flex';
@@ -1021,8 +1030,9 @@
1021
1030
  },
1022
1031
 
1023
1032
  // 实现轮播图的预览效果
1024
- handlePreview(i,item) {
1025
- // 调用 uni.previewImage() 方法预览图片
1033
+ handlePreview(i, item) {
1034
+ //#ifdef H5
1035
+ // 调用 uni.previewImage() 方法预览图片
1026
1036
  let images = this.images.map(item => item.src)
1027
1037
  if (!item.status) {
1028
1038
  images = [this.errorProductUrl]
@@ -1034,6 +1044,16 @@
1034
1044
  // 所有图片 url 路径的数组 //这里直接把图片列表的数组放入即可
1035
1045
  urls: images
1036
1046
  })
1047
+ //#endif
1048
+ //#ifdef MP-WEIXIN
1049
+ uni.previewImage({
1050
+ // 预览时,默认显示图片的索引
1051
+ current: i,
1052
+ indicator: "number",
1053
+ // 所有图片 url 路径的数组 //这里直接把图片列表的数组放入即可
1054
+ urls: this.images.map(item => item.src)
1055
+ })
1056
+ //#endif
1037
1057
  },
1038
1058
  handleToMapArea(){
1039
1059
  let city_code = "";