jufubao-base 1.0.67-beta202 → 1.0.67-beta204

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-base",
3
- "version": "1.0.67-beta202",
3
+ "version": "1.0.67-beta204",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -20,7 +20,7 @@
20
20
  <view class="jfb-base-con-dialog__body-dialog" v-if="isShow">
21
21
  <view class="jfb-base-con-dialog__body-dialog-mask"></view>
22
22
  <view class="jfb-base-con-dialog__body-dialog-content">
23
- <view class="jfb-base-con-dialog__body-dialog-content-num">
23
+ <view v-if="list.length>1" class="jfb-base-con-dialog__body-dialog-content-num">
24
24
  <text>{{ currentIndex + 1 }}/{{ list.length }}</text>
25
25
  </view>
26
26
  <view style="display: flex; align-items: center">
@@ -16,69 +16,120 @@
16
16
  <view class="jfb-base-con-list__edit-icon" @click="delEdit">删除</view>
17
17
  </view>
18
18
  <!-- #endif -->
19
- <view class="jfb-base-con-list__body">
20
- <view class="jfb-base-con-list__body-header">
21
- <image :src="background"></image>
22
- </view>
23
- <view class="jfb-base-con-list__body-content">
24
- <view class="jfb-base-con-list__body-content-header">
25
- <view class="jfb-base-con-list__body-content-header-left">
26
- <view :style="{ backgroundColor: mainColor }"></view>
27
- <view>赠送优惠券</view>
28
- </view>
29
- <view
30
- :style="{ color: mainColor, background: contentBackground }"
31
- class="jfb-base-con-list__body-content-header-right"
32
- @click="showRule = true"
33
- >
34
- <text>领券规则</text>
35
- <xd-font-icon size="20" icon="iconxiangyou_xian"></xd-font-icon>
19
+ <view class="jfb-base-con-list__body" v-if="done">
20
+ <view
21
+ v-if="couponList.length > 0"
22
+ :style="{
23
+ backgroundImage: `url(${background})`,
24
+ backgroundSize: '100% 100%',
25
+ backgroundRepeat: 'no-repeat',
26
+ height: `${layoutInfo.bodyMinHeightRpx}rpx`,
27
+ }"
28
+ >
29
+ <view class="jfb-base-con-list__body-content">
30
+ <view class="jfb-base-con-list__body-content-header">
31
+ <view class="jfb-base-con-list__body-content-header-left">
32
+ <view :style="{ backgroundColor: mainColor }"></view>
33
+ <view>赠送优惠券</view>
34
+ </view>
35
+ <view
36
+ :style="{ color: mainColor, background: contentBackground }"
37
+ class="jfb-base-con-list__body-content-header-right"
38
+ @click="showRule = true"
39
+ >
40
+ <text>领券规则</text>
41
+ <xd-font-icon size="20" icon="iconxiangyou_xian"></xd-font-icon>
42
+ </view>
36
43
  </view>
37
- </view>
38
- <view class="jfb-base-con-list__body-content-list">
39
- <view
40
- v-for="(item, index) in couponList"
41
- :key="index"
42
- class="jfb-base-con-list__body-content-list-item"
43
- :style="{ background: contentBackground }"
44
- >
45
- <view class="jfb-base-con-list__body-content-list-item-left">
46
- <view
47
- :style="couponBackground"
48
- class="jfb-base-con-list__body-content-list-item-left-info"
49
- >
50
- <view :style="{ color: mainColor }">满减券</view>
51
- <view>{{ item.prize_name }}</view>
44
+ <view class="jfb-base-con-list__body-content-list">
45
+ <view
46
+ v-for="(item, index) in couponList"
47
+ :key="index"
48
+ class="jfb-base-con-list__body-content-list-item"
49
+ :style="{ background: contentBackground }"
50
+ >
51
+ <view class="jfb-base-con-list__body-content-list-item-left">
52
+ <view
53
+ :style="item.couponBackground"
54
+ class="jfb-base-con-list__body-content-list-item-left-info"
55
+ >
56
+ <view :style="{ color: mainColor }">满减券</view>
57
+ <view>{{ item.prize_name }}</view>
58
+ </view>
52
59
  </view>
53
- <view class="jfb-base-con-list__body-content-list-item-left-num">
54
- <view>{{ item.prize_name }}</view>
55
- <view :style="{ color: mainColor,display:'flex',alignItems:'center' }">
56
- <xd-font-icon style="margin-right:10rpx" size="24" icon="icondanchuangguanbi_xian"></xd-font-icon>
57
- {{ item.prize_num }}
60
+ <view class="jfb-base-con-list__body-content-list-item-right">
61
+ <view
62
+ class="jfb-base-con-list__body-content-list-item-right-name"
63
+ >
64
+ <view>{{ item.prize_name }}</view>
65
+ <xd-font-icon
66
+ v-if="item.remain_card_count > 0"
67
+ size="100"
68
+ :style="{
69
+ color: item.can_take === 'N' ? '#D6D6D6' : mainColor,
70
+ position: 'absolute',
71
+ right: '-30rpx',
72
+ top: '-40rpx',
73
+ }"
74
+ :icon="
75
+ item.can_take === 'N' ? 'iconyilingqu' : 'icondailingqu'
76
+ "
77
+ ></xd-font-icon>
78
+ <xd-font-icon
79
+ v-else
80
+ size="100"
81
+ :style="{
82
+ color: '#D6D6D6',
83
+ position: 'absolute',
84
+ right: '-30rpx',
85
+ top: '-40rpx',
86
+ }"
87
+ icon="iconyifawan"
88
+ ></xd-font-icon>
89
+ </view>
90
+ <view
91
+ class="jfb-base-con-list__body-content-list-item-right-num"
92
+ >
93
+ <view
94
+ :style="{
95
+ color: mainColor,
96
+ display: 'flex',
97
+ alignItems: 'center',
98
+ fontSize: '28rpx',
99
+ }"
100
+ >
101
+ <xd-font-icon
102
+ style="margin-right: 10rpx"
103
+ size="22"
104
+ icon="icondanchuangguanbi_xian"
105
+ ></xd-font-icon>
106
+ {{ item.prize_num }}
58
107
  </view>
108
+
109
+ <xd-button
110
+ size="small"
111
+ :disabled="item.can_take === 'N'"
112
+ @click="getCoupont(item)"
113
+ type="primary"
114
+ :style="item.btn"
115
+ >{{ item.can_take === "N" ? "已领取" : "领取" }}</xd-button
116
+ >
117
+ </view>
59
118
  </view>
60
119
  </view>
61
- <view class="jfb-base-con-list__body-content-list-item-right">
62
- <xd-font-icon
63
- size="100"
64
- :style="{ color: disabled ? '#D6D6D6' : mainColor }"
65
- :icon="disabled ? 'iconyilingqu' : 'icondailingqu'"
66
- ></xd-font-icon>
67
- </view>
68
120
  </view>
69
121
  </view>
70
- </view>
71
- <view style="height: 120rpx"></view>
72
- <view class="bottom_btn" :style="prod_bottom">
73
- <xd-button
74
- :disabled="disabled"
75
- @click="getCoupont"
76
- type="primary"
77
- :style="btn"
78
- width="60%"
79
- >{{ disabled ? "已领取" : "一键领取" }}</xd-button
122
+ <view class="jfb-base-con-list__body-foot"
123
+ >可在个人中心-我的票券进行查看</view
80
124
  >
81
125
  </view>
126
+ <view
127
+ v-else
128
+ class="empty_data"
129
+ :style="{ minHeight: layoutInfo.bodyMinHeightPx + 'px' }"
130
+ >
131
+ <image src="https://img.jufubao.cn/component/sp_nodata.png"></image>
132
+ </view>
82
133
  <xd-dailog
83
134
  :cancel="false"
84
135
  :confirm="false"
@@ -119,7 +170,6 @@ export default {
119
170
  return {
120
171
  contentBackground: "",
121
172
  couponList: [],
122
- disabled: false,
123
173
  notice: "",
124
174
  showRule: false,
125
175
  btn: "",
@@ -132,19 +182,10 @@ export default {
132
182
  time: 1, //时间幂指数
133
183
  timeer: null,
134
184
  order_num: null,
185
+ done: false,
135
186
  };
136
187
  },
137
188
  computed: {
138
- prod_bottom() {
139
- return this.fixedStyle({ height: 0, zIndex: 111 });
140
- },
141
- couponBackground() {
142
- return {
143
- background: `url(${this.app_coupon_url})`,
144
- backgroundSize: "100% 100%",
145
- backgroundRepeat: "no-repeat",
146
- };
147
- },
148
189
  ...mapState(["pageBusinessCode"]),
149
190
  },
150
191
  watch: {
@@ -175,21 +216,45 @@ export default {
175
216
  })
176
217
  .then((res) => {
177
218
  this.background = getServiceUrl(res.background);
178
- this.app_coupon_url = getServiceUrl(res.app_coupon_url);
179
- this.btn = res.app_activity_button
180
- ? {
181
- background: `url(${getServiceUrl(res.app_activity_button)})`,
182
- backgroundSize: "100% 100%",
183
- backgroundRepeat: "no-repeat",
219
+ this.couponList =
220
+ res.list &&
221
+ res.list.length > 0 &&
222
+ res.list.map((item) => {
223
+ if (item.can_take === "Y") {
224
+ item.btn = res.app_coupon_button_bg_url
225
+ ? {
226
+ background: `url(${getServiceUrl(
227
+ res.app_coupon_button_bg_url
228
+ )})`,
229
+ backgroundSize: "100% 100%",
230
+ backgroundRepeat: "no-repeat",
231
+ margin: "0",
232
+ }
233
+ : { background: this.mainColor, margin: "0" };
234
+ item.couponBackground = {
235
+ background: `url(${getServiceUrl(res.app_coupon_url)})`,
236
+ backgroundSize: "100% 100%",
237
+ backgroundRepeat: "no-repeat",
238
+ };
239
+ } else {
240
+ item.btn = { background: "#D6D6D6", margin: "0" };
241
+ item.couponBackground = {
242
+ background: `url(${getServiceUrl(
243
+ res.app_coupon_invalid_url
244
+ )})`,
245
+ backgroundSize: "100% 100%",
246
+ backgroundRepeat: "no-repeat",
247
+ };
184
248
  }
185
- : { background: this.mainColor };
186
- this.couponList = res.list;
249
+ return item;
250
+ });
251
+ this.done = true;
187
252
  })
188
253
  .catch((err) => {
189
254
  console.log(err, "err");
190
255
  });
191
256
  },
192
- getCoupont() {
257
+ getCoupont(item) {
193
258
  this.$xdShowLoading({});
194
259
  jfbRootExec("getAllCoupon", {
195
260
  vm: this,
@@ -197,6 +262,7 @@ export default {
197
262
  distribution_method: this.method,
198
263
  namespace: this.pageBusinessCode,
199
264
  activity_id: this.activity_id,
265
+ prize_id: item.prize_id,
200
266
  },
201
267
  })
202
268
  .then((res) => {
@@ -223,7 +289,7 @@ export default {
223
289
  time: 2000,
224
290
  isClose: false,
225
291
  });
226
- this.disabled = true;
292
+ this.getList();
227
293
  if (this.timeer) {
228
294
  clearTimeout(this.timeer);
229
295
  }
@@ -232,12 +298,11 @@ export default {
232
298
  if (res.status_type === "error") {
233
299
  this.$xdHideLoading();
234
300
  this.$xdAlert({
235
- content: "领取失败",
301
+ content: res.message,
236
302
  zIndex: 3200,
237
303
  time: 2000,
238
304
  isClose: false,
239
305
  });
240
- this.disabled = false;
241
306
  if (this.timeer) {
242
307
  clearTimeout(this.timeer);
243
308
  }
@@ -318,22 +383,28 @@ export default {
318
383
  .jfb-base-con-list {
319
384
  &__body {
320
385
  position: relative;
321
- &-header {
322
- height: unit(600, rpx);
386
+ overflow-y: auto;
387
+ .empty_data {
388
+ text-align: center;
389
+ color: #999999;
390
+ font-size: 28rpx;
391
+ display: flex;
392
+ flex-direction: column;
393
+ align-items: center;
394
+ justify-content: center;
323
395
  & > image {
324
- width: 100%;
325
- height: 100%;
396
+ width: unit(400, rpx);
397
+ height: unit(400, rpx);
326
398
  }
327
399
  }
328
400
  &-content {
329
401
  border-radius: unit(20, rpx);
330
402
  background: #fff;
331
- padding: unit(40, rpx);
332
- position: absolute;
333
- top: unit(164, rpx);
334
- left: 50%;
335
- transform: translateX(-50%);
336
- width: unit(600, rpx);
403
+ padding: unit(34, rpx);
404
+ margin-top: unit(164, rpx);
405
+ margin-right: auto;
406
+ margin-left: auto;
407
+ width: unit(650, rpx);
337
408
 
338
409
  &-header {
339
410
  display: flex;
@@ -364,15 +435,14 @@ export default {
364
435
  margin-top: unit(20, rpx);
365
436
 
366
437
  &-item {
367
- margin-top: unit(20, rpx);
368
438
  display: flex;
369
439
  justify-content: space-between;
370
440
  align-items: center;
371
441
  padding: unit(20, rpx) unit(30, rpx);
372
442
  border-radius: unit(12, rpx);
443
+ margin: unit(20, rpx) auto 0 auto;
373
444
  &-left {
374
445
  display: flex;
375
-
376
446
  &-info {
377
447
  padding: unit(20, rpx) unit(36, rpx);
378
448
  & > view:first-child {
@@ -385,30 +455,31 @@ export default {
385
455
  color: #fff;
386
456
  }
387
457
  }
388
-
458
+ }
459
+ &-right {
460
+ margin-left: unit(24, rpx);
461
+ flex: 1;
462
+ &-name {
463
+ position: relative;
464
+ font-size: unit(40, rpx);
465
+ color: #000;
466
+ display: flex;
467
+ align-items: center;
468
+ justify-content: space-between;
469
+ }
389
470
  &-num {
390
- margin-left: unit(24, rpx);
391
- margin-top: unit(10, rpx);
392
- & > view:first-child {
393
- font-size: unit(40, rpx);
394
- margin-bottom: unit(16, rpx);
395
- }
396
- & > view:nth-child(2) {
397
- font-size: unit(28, rpx);
398
- }
471
+ margin-top: unit(40, rpx);
472
+ display: flex;
473
+ justify-content: space-between;
399
474
  }
400
475
  }
401
476
  }
402
477
  }
403
478
  }
404
- .bottom_btn {
405
- position: fixed;
406
- width: 100%;
407
- display: flex;
408
- justify-content: center;
409
- align-items: center;
410
- height: unit(120, rpx);
411
- background: #ffffff;
479
+ &-foot {
480
+ color: #a6a6a6;
481
+ font-size: unit(24, rpx);
482
+ text-align: center;
412
483
  }
413
484
  }
414
485
  }