jufubao-base 1.0.158-beta4 → 1.0.158-beta5

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.158-beta4",
3
+ "version": "1.0.158-beta5",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -63,7 +63,7 @@
63
63
  class="jfb-base-after-order-detail__body-movie-content-info-bottom"
64
64
  >
65
65
  <view >
66
- <xd-unit v-if="info.business_icon !== 'gift' && info.is_not_show_price !== 'Y'" :price="item.sale_price"></xd-unit>
66
+ <xd-unit v-if="info.business_icon !== 'gift'" :price="item.sale_price"></xd-unit>
67
67
  </view>
68
68
  <view style=" font-size: 28rpx; display: flex; align-items: center; color: #666;">x {{ item.buy_count }}</view>
69
69
  </view>
@@ -80,7 +80,7 @@
80
80
  :style="{ color: mainColor }"
81
81
  >补发快递:{{ info['express_name'] }}</view> -->
82
82
  <view v-else :style="{ color: mainColor }">
83
- <view v-if="info.business_code !== 'gift' && info.is_not_show_price !== 'Y'">
83
+ <view v-if="info.business_code !== 'gift'">
84
84
  已退款:¥{{ info.total_refund_sale_amount }}
85
85
  </view>
86
86
  </view>
@@ -29,7 +29,7 @@ module.exports = [
29
29
  disabled: true,
30
30
  },
31
31
  {
32
- mapFnName: 'getAllCoupon', //自定义方法名字(必选)
32
+ mapFnName: 'getOnceCoupon', //自定义方法名字(必选)
33
33
  title: '领取优惠券',
34
34
  path: '/sms-coupon/v1/activity-prizes-user/set',
35
35
  isRule: false,
@@ -40,6 +40,18 @@ module.exports = [
40
40
  isConsole: true,
41
41
  disabled: true,
42
42
  },
43
+ {
44
+ mapFnName: 'getAllCoupon', //自定义方法名字(必选)
45
+ title: '领取优惠券',
46
+ path: '/sms-coupon/v1/activity-prizes-user/set-all',
47
+ isRule: false,
48
+ params: {
49
+ distribution_method: ['发放方式 entry=主动发放, homed=首页发放,paid=消费后发放,card_binded=绑定卡后发放', 'String', '选填'],
50
+ namespace: ['业务线', 'String', '必填'],
51
+ },
52
+ isConsole: true,
53
+ disabled: true,
54
+ },
43
55
  {
44
56
  mapFnName: 'getCouponResult', //自定义方法名字(必选)
45
57
  title: '轮询查询活动结果',
@@ -53,10 +53,14 @@
53
53
  </view>
54
54
  <view v-else class="jfb-base-con-dialog__body-dialog-content">
55
55
  <xd-cou-card-bind
56
+ :isAll="isAll"
57
+ :isRandom="isRandom"
56
58
  :list="couponList"
57
59
  :setting="couponOther"
60
+ :btnImage="btnImage"
58
61
  @closeDialog="handleCardBindClose"
59
62
  @getCoupont="handleGetCoupon"
63
+ @getAllCoupont="getAllCoupont"
60
64
  ></xd-cou-card-bind>
61
65
  </view>
62
66
  </view>
@@ -114,6 +118,10 @@ export default {
114
118
  //预览是否显示弹窗
115
119
  is_preview_hide_dailog: false,
116
120
 
121
+ isAll: true,
122
+ isRandom: true,
123
+ btnImage: ''
124
+
117
125
  };
118
126
  },
119
127
  computed: {
@@ -153,7 +161,7 @@ export default {
153
161
  //领取优惠券
154
162
  handleGetCoupon(item){
155
163
  this.$xdShowLoading({});
156
- jfbRootExec("getAllCoupon", {
164
+ jfbRootExec("getOnceCoupon", {
157
165
  vm: this,
158
166
  data: {
159
167
  prize_id: item.prize_id,
@@ -182,7 +190,6 @@ export default {
182
190
  },
183
191
 
184
192
  getResult() {
185
- debugger
186
193
  jfbRootExec("getCouponResult", {
187
194
  vm: this,
188
195
  data: {
@@ -281,7 +288,6 @@ export default {
281
288
  this.couponOther = other;
282
289
  if(res.can_take === "Y" && res.has_times === "Y" && list.length > 0){
283
290
  if (this.isPreview) {
284
- debugger
285
291
  console.log(getContainerPropsValue(value, "content.is_show_dailog", 'Y'))
286
292
  this.isShow = getContainerPropsValue(value, "content.is_show_dailog", 'Y') === 'N';
287
293
  }else this.isShow = true;
@@ -299,6 +305,40 @@ export default {
299
305
  }
300
306
  },
301
307
 
308
+ getAllCoupont() {
309
+ this.p_getAllDialogList();
310
+ },
311
+
312
+ p_getAllDialogList() {
313
+ //getAllCoupon
314
+ this.$xdShowLoading({});
315
+ jfbRootExec("getAllCoupon", {
316
+ vm: this,
317
+ data: {
318
+ distribution_method: this.distribution_method,
319
+ ...this.dispatchData
320
+ }
321
+ }).then(res => {
322
+ if (res.code === 400) {
323
+ this.$xdHideLoading();
324
+ this.$xdAlert({
325
+ content: res.message,
326
+ zIndex: 3200,
327
+ time: 2000,
328
+ isClose: false,
329
+ });
330
+ this.getDialogList();
331
+ return;
332
+ }
333
+ this.order_num = res.tmp_order_number;
334
+ setTimeout(()=>{
335
+ this.getResult();
336
+ },1000)
337
+ }).catch((err) => {
338
+ console.log(err, "err");
339
+ });
340
+ },
341
+
302
342
  handlePop() {
303
343
  console.warn(`this.time${this.time * 60 + "分钟"}`);
304
344
  storage.set(this.containerId, 1, this.time);
@@ -320,7 +360,6 @@ export default {
320
360
  ){
321
361
  this.getDialogList();
322
362
  }
323
-
324
363
  //支付跟绑卡是主动触发
325
364
  if(this.distribution_method === 'card_binded'){
326
365
  jfbRootFnExec(this, 'onCustomEvent')("baseConDialog@hasCon", this.containerId);
@@ -6,7 +6,7 @@
6
6
  backgroundImage: dialogBackground
7
7
  }"
8
8
  >
9
- <view class="ticket_list">
9
+ <view v-if="!isRandom" class="ticket_list">
10
10
  <view
11
11
  class="ticket_item"
12
12
  :class="item.can_take_num"
@@ -20,7 +20,7 @@
20
20
  <view class="item_sub">{{ item.prize_name }}</view>
21
21
 
22
22
  <xd-font-icon class="ticket_icon" :color="item.iconColor" :icon="item.icon"></xd-font-icon>
23
- <view class="btn">
23
+ <view v-if="!isAll" class="btn">
24
24
  <xd-button
25
25
  size="small"
26
26
  type="primary"
@@ -34,6 +34,19 @@
34
34
  </view>
35
35
  </view>
36
36
  </view>
37
+ <view v-else>
38
+ 随机领取图片
39
+ </view>
40
+ <xd-button
41
+ v-if="isAll"
42
+ size="small"
43
+ type="primary"
44
+ :style="{
45
+ backgroundImage: btnImage,
46
+ backgroundSize: '100% 100%',
47
+ }"
48
+ @click="getAllCoupont"
49
+ >{{isRandom?'开心获取':'一键领取'}}</xd-button>
37
50
  </view>
38
51
 
39
52
  <xd-font-icon
@@ -62,6 +75,18 @@ export default{
62
75
  return []
63
76
  }
64
77
  },
78
+ isAll: {
79
+ type: Boolean,
80
+ default: false
81
+ },
82
+ isRandom: {
83
+ type: Boolean,
84
+ default: false
85
+ },
86
+ btnImage: {
87
+ type: String,
88
+ default: ""
89
+ },
65
90
  setting: {}
66
91
  },
67
92
  computed: {
@@ -99,6 +124,9 @@ export default{
99
124
  this.$emit("getCoupont", item);
100
125
  }
101
126
  },
127
+ getAllCoupont() {
128
+ this.$emit("getAllCoupont", item);
129
+ },
102
130
  handleClose(){
103
131
  this.$emit("closeDialog");
104
132
  }
@@ -33,7 +33,7 @@ module.exports = [
33
33
  disabled: true,
34
34
  },
35
35
  {
36
- mapFnName: 'getAllCoupon', //自定义方法名字(必选)
36
+ mapFnName: 'getOnceCoupon', //自定义方法名字(必选)
37
37
  title: '领取优惠券',
38
38
  path: '/sms-coupon/v1/activity-prizes-user/set',
39
39
  isRule: false,
@@ -44,6 +44,18 @@ module.exports = [
44
44
  isConsole: true,
45
45
  disabled: true,
46
46
  },
47
+ {
48
+ mapFnName: 'getAllCoupon', //自定义方法名字(必选)
49
+ title: '领取优惠券',
50
+ path: '/sms-coupon/v1/activity-prizes-user/set-all',
51
+ isRule: false,
52
+ params: {
53
+ distribution_method: ['发放方式 entry=主动发放, homed=首页发放,paid=消费后发放,card_binded=绑定卡后发放', 'String', '选填'],
54
+ namespace: ['业务线', 'String', '必填'],
55
+ },
56
+ isConsole: true,
57
+ disabled: true,
58
+ },
47
59
  {
48
60
  mapFnName: 'getCouponResult', //自定义方法名字(必选)
49
61
  title: '轮询查询活动结果',
@@ -24,9 +24,9 @@
24
24
  backgroundSize: '100%',
25
25
  backgroundRepeat: 'no-repeat',
26
26
  minHeight: `${layoutInfo.bodyMinHeightRpx}rpx`,
27
- }"
27
+ }"
28
28
  >
29
- <view v-if="couponList&&couponList.length > 0" >
29
+ <view v-if="!message">
30
30
  <view class="jfb-base-con-list__body-content">
31
31
  <view class="jfb-base-con-list__body-content-header">
32
32
  <view class="jfb-base-con-list__body-content-header-left">
@@ -34,7 +34,10 @@
34
34
  <view>赠送优惠券</view>
35
35
  </view>
36
36
  <view
37
- :style="{ color: '#FA2125', backgroundColor: contentBackground }"
37
+ :style="{
38
+ color: '#FA2125',
39
+ backgroundColor: contentBackground,
40
+ }"
38
41
  class="jfb-base-con-list__body-content-header-right"
39
42
  @click="showRule = true"
40
43
  >
@@ -42,64 +45,162 @@
42
45
  <xd-font-icon size="20" icon="iconxiangyou_xian"></xd-font-icon>
43
46
  </view>
44
47
  </view>
45
- <view v-if="can_take === 'Y' && has_times === 'Y'" class="jfb-base-con-list__body-content-list">
46
- <view v-for="(item, index) in couponList" :key="index">
48
+
49
+ <view v-if="isAll">
50
+ <view v-if="isRandom">
51
+ <view class="jfb-base-con-list__body-content-list">
52
+ <view>
53
+ <img
54
+ style="width: 100%"
55
+ mode="widthFix"
56
+ :src="app_coupon_bottom_url"
57
+ alt=""
58
+ />
59
+ </view>
60
+ <xd-button
61
+ size="small"
62
+ type="primary"
63
+ :style="btn_style"
64
+ @click="can_take!=='Y'?toCoupon():getAllCoupont()"
65
+ >{{ btn_txt }}</xd-button
66
+ >
67
+ </view>
68
+ </view>
69
+ <view v-else>
47
70
  <view
48
- class="jfb-base-con-list__body-content-list-item"
49
- :class="'status_' + item.can_take_num"
50
- :style="{
51
- backgroundColor: item.can_take_num==='Y'||item.can_take_num==='P'? contentBackground:'#F3F3F3',
52
- }"
71
+ v-if="can_take === 'Y'"
72
+ class="jfb-base-con-list__body-content-list"
53
73
  >
54
- <view class="item_head">
55
- <image class="t_icon" mode="widthFix" :src="item.headIcon" ></image>
56
- <view>{{ item.prize_type }}</view>
74
+ <view>
75
+ <view v-for="(item, index) in couponList" :key="index">
76
+ <view
77
+ class="jfb-base-con-list__body-content-list-item"
78
+ :class="'status_' + item.can_take_num"
79
+ :style="{
80
+ backgroundColor:
81
+ item.can_take_num === 'Y' ||
82
+ item.can_take_num === 'P'
83
+ ? contentBackground
84
+ : '#F3F3F3',
85
+ }"
86
+ >
87
+ <view class="item_head">
88
+ <image
89
+ class="t_icon"
90
+ mode="widthFix"
91
+ :src="item.headIcon"
92
+ ></image>
93
+ <view>{{ item.prize_type }}</view>
94
+ </view>
95
+ <view class="item_sub">{{ item.prize_name }}</view>
96
+ <xd-font-icon
97
+ size="100"
98
+ :style="{
99
+ color: item.iconColor,
100
+ position: 'absolute',
101
+ right: '0rpx',
102
+ top: '0rpx',
103
+ }"
104
+ :icon="item.icon"
105
+ ></xd-font-icon>
106
+ </view>
107
+ </view>
57
108
  </view>
58
- <view class="item_sub">{{ item.prize_name }}</view>
59
- <xd-font-icon
60
- size="100"
109
+ <xd-button
110
+ size="small"
111
+ type="primary"
112
+ :style="btn_style"
113
+ @click="can_take!=='Y'?toCoupon():getAllCoupont()"
114
+ >{{ btn_txt }}</xd-button
115
+ >
116
+ </view>
117
+ <view
118
+ v-else
119
+ class="jfb-base-con-list__body-content-list"
120
+ style="padding-bottom: 60rpx"
121
+ >
122
+ <image mode="widthFix" :src="used_up_url"></image>
123
+ </view>
124
+ </view>
125
+ </view>
126
+
127
+ <view v-else>
128
+ <view
129
+ v-if="can_take === 'Y' && has_times === 'Y'"
130
+ class="jfb-base-con-list__body-content-list"
131
+ >
132
+ <view v-for="(item, index) in couponList" :key="index">
133
+ <view
134
+ class="jfb-base-con-list__body-content-list-item"
135
+ :class="'status_' + item.can_take_num"
61
136
  :style="{
62
- color: item.iconColor,
63
- position: 'absolute',
64
- right: '0rpx',
65
- top: '0rpx',
137
+ backgroundColor:
138
+ item.can_take_num === 'Y' || item.can_take_num === 'P'
139
+ ? contentBackground
140
+ : '#F3F3F3',
66
141
  }"
67
- :icon="item.icon"
68
- ></xd-font-icon>
69
- <view class="btn_wrap">
70
- <xd-button
71
- size="small"
72
- :disabled="item.can_take_num !=='Y' && item.remain_card_count == 0"
73
- @click="getCoupont(item)"
74
- type="primary"
75
- style="width: 170rpx;height: 60rpx;"
76
- :style="item.btn"
77
- :color="item.infoColor"
78
- >{{ item.btn_txt }}</xd-button>
142
+ >
143
+ <view class="item_head">
144
+ <image
145
+ class="t_icon"
146
+ mode="widthFix"
147
+ :src="item.headIcon"
148
+ ></image>
149
+ <view>{{ item.prize_type }}</view>
150
+ </view>
151
+ <view class="item_sub">{{ item.prize_name }}</view>
152
+ <xd-font-icon
153
+ size="100"
154
+ :style="{
155
+ color: item.iconColor,
156
+ position: 'absolute',
157
+ right: '0rpx',
158
+ top: '0rpx',
159
+ }"
160
+ :icon="item.icon"
161
+ ></xd-font-icon>
162
+ <view class="btn_wrap">
163
+ <xd-button
164
+ size="small"
165
+ :disabled="
166
+ item.can_take_num !== 'Y' &&
167
+ item.remain_card_count == 0
168
+ "
169
+ @click="getCoupont(item)"
170
+ type="primary"
171
+ style="width: 170rpx; height: 60rpx"
172
+ :style="item.btn"
173
+ :color="item.infoColor"
174
+ >{{ item.btn_txt }}</xd-button
175
+ >
176
+ </view>
79
177
  </view>
80
178
  </view>
81
179
  </view>
82
- </view>
83
- <view v-else class="jfb-base-con-list__body-content-list" style="padding-bottom: 60rpx;">
84
- <image mode="widthFix" :src="used_up_url"></image>
180
+ <view
181
+ v-else
182
+ class="jfb-base-con-list__body-content-list"
183
+ style="padding-bottom: 60rpx"
184
+ >
185
+ <image mode="widthFix" :src="used_up_url"></image>
186
+ </view>
85
187
  </view>
86
188
  </view>
87
- <view class="jfb-base-con-list__body-content-foot" @click="toCoupon" >
189
+ <view class="jfb-base-con-list__body-content-foot" @click="toCoupon">
88
190
  <view
89
191
  :style="{
90
- padding:outPadding,
91
- border:border,
92
- borderRadius:radius + 'rpx',
93
- color: btnTextColor,
94
- backgroundColor: btnBgColor,
95
- boxShadow:shadow
96
- }">查看已领票券</view>
192
+ padding: outPadding,
193
+ border: border,
194
+ borderRadius: radius + 'rpx',
195
+ color: btnTextColor,
196
+ backgroundColor: btnBgColor,
197
+ boxShadow: shadow,
198
+ }"
199
+ >查看已领票券</view
200
+ >
97
201
  </view>
98
202
  </view>
99
- <view
100
- v-else
101
- class="empty_data"
102
- >
203
+ <view v-else class="empty_data">
103
204
  <image :src="emptyBg"></image>
104
205
  {{ message }}
105
206
  </view>
@@ -109,7 +210,10 @@
109
210
  title="活动规则说明"
110
211
  :show.sync="showRule"
111
212
  >
112
- <xd-content-xss style="text-align:left" :html="notice"></xd-content-xss>
213
+ <xd-content-xss
214
+ style="text-align: left"
215
+ :html="notice"
216
+ ></xd-content-xss>
113
217
  </xd-dailog>
114
218
  </view>
115
219
  </view>
@@ -167,18 +271,23 @@ export default {
167
271
  collectedPath: "",
168
272
 
169
273
  //按钮设置
170
- btnBgColor:'',
171
- btnTextColor:'',
172
- padding:{},
274
+ btnBgColor: "",
275
+ btnTextColor: "",
276
+ padding: {},
173
277
  radius: 0,
174
278
  //边框
175
- is_border:'N',
176
- is_border_c:'',
177
- is_border_w:'',
279
+ is_border: "N",
280
+ is_border_c: "",
281
+ is_border_w: "",
178
282
  //投影
179
- is_shadow: 'Y',
283
+ is_shadow: "Y",
180
284
  is_shadow_bg: 0,
181
285
  is_shadow_w: 0,
286
+
287
+ isAll: false,
288
+ isRandom: false,
289
+ btn_txt: "",
290
+ btn_style: {},
182
291
  };
183
292
  },
184
293
  computed: {
@@ -191,15 +300,17 @@ export default {
191
300
  str = `${str} ${this.checkValue(this.padding.right, 0)}rpx`;
192
301
  str = `${str} ${this.checkValue(this.padding.bottom, 0)}rpx`;
193
302
  str = `${str} ${this.checkValue(this.padding.left, 0)}rpx`;
194
- return str
303
+ return str;
195
304
  },
196
305
  border() {
197
- if (this.is_border === 'Y') return `${this.is_border_w}rpx solid ${this.is_border_c}`;
198
- else return '0';
306
+ if (this.is_border === "Y")
307
+ return `${this.is_border_w}rpx solid ${this.is_border_c}`;
308
+ else return "0";
199
309
  },
200
- shadow(){
201
- if(this.is_shadow === 'Y') return `0 0 ${this.is_shadow_w}rpx ${this.is_shadow_bg}`;
202
- else return '0 0 0 rgba(0,0,0,0)';
310
+ shadow() {
311
+ if (this.is_shadow === "Y")
312
+ return `0 0 ${this.is_shadow_w}rpx ${this.is_shadow_bg}`;
313
+ else return "0 0 0 rgba(0,0,0,0)";
203
314
  },
204
315
  },
205
316
  watch: {
@@ -217,22 +328,50 @@ export default {
217
328
  },
218
329
  methods: {
219
330
  init(value) {
220
- this.contentBackground = '#FFF8F8';
221
- this.iconColor = '#FF4D4A';
222
- this.collectedPath = getContainerPropsValue(value, "content.collectedPath", {value: ''}).value;
331
+ this.contentBackground = "#FFF8F8";
332
+ this.iconColor = "#FF4D4A";
333
+ this.collectedPath = getContainerPropsValue(
334
+ value,
335
+ "content.collectedPath",
336
+ { value: "" }
337
+ ).value;
223
338
 
224
339
  this.padding = getContainerPropsValue(value, "content.padding", {});
225
- this.btnBgColor = getContainerPropsValue(value, "content.btnBgColor", 'rgba(0,0,0,0)');
226
- this.btnTextColor = getContainerPropsValue(value, "content.btnTextColor", '#666');
227
- this.radius = getContainerPropsValue(value, "content.radius", '0');
340
+ this.btnBgColor = getContainerPropsValue(
341
+ value,
342
+ "content.btnBgColor",
343
+ "rgba(0,0,0,0)"
344
+ );
345
+ this.btnTextColor = getContainerPropsValue(
346
+ value,
347
+ "content.btnTextColor",
348
+ "#666"
349
+ );
350
+ this.radius = getContainerPropsValue(value, "content.radius", "0");
228
351
 
229
- this.is_border = getContainerPropsValue(value, "content.is_border", 'N');
230
- this.is_border_c = getContainerPropsValue(value, "content.is_border_c", '#e5e5e5');
231
- this.is_border_w = getContainerPropsValue(value, "content.is_border_w", 1);
352
+ this.is_border = getContainerPropsValue(value, "content.is_border", "N");
353
+ this.is_border_c = getContainerPropsValue(
354
+ value,
355
+ "content.is_border_c",
356
+ "#e5e5e5"
357
+ );
358
+ this.is_border_w = getContainerPropsValue(
359
+ value,
360
+ "content.is_border_w",
361
+ 1
362
+ );
232
363
 
233
- this.is_shadow = getContainerPropsValue(value, 'content.is_shadow', 'N');
234
- this.is_shadow_bg = getContainerPropsValue(value, 'content.is_shadow_bg', '#fff');
235
- this.is_shadow_w = getContainerPropsValue(value, 'content.is_shadow_w', '10');
364
+ this.is_shadow = getContainerPropsValue(value, "content.is_shadow", "N");
365
+ this.is_shadow_bg = getContainerPropsValue(
366
+ value,
367
+ "content.is_shadow_bg",
368
+ "#fff"
369
+ );
370
+ this.is_shadow_w = getContainerPropsValue(
371
+ value,
372
+ "content.is_shadow_w",
373
+ "10"
374
+ );
236
375
  },
237
376
 
238
377
  getList() {
@@ -248,30 +387,77 @@ export default {
248
387
  .then((res) => {
249
388
  this.background = getServiceUrl(res.background);
250
389
  this.used_up_url = res.used_up_url && getServiceUrl(res.used_up_url);
390
+ this.app_activity_button =
391
+ res.app_activity_button && getServiceUrl(res.app_activity_button);
392
+ this.app_activity_url =
393
+ res.app_activity_url && getServiceUrl(res.app_activity_url);
394
+ this.app_coupon_bottom_url =
395
+ res.app_coupon_bottom_url &&
396
+ getServiceUrl(res.app_coupon_bottom_url);
251
397
  this.can_take = res.can_take;
252
398
  this.has_times = res.has_times;
253
399
  this.next_url = res.next_url;
400
+ this.isAll = res.receive_method === "batch";
401
+ this.isRandom = res.distribution_type === "random";
402
+ // 判断是否是一键领取
403
+ if (this.isAll) {
404
+ // 定义按钮文字
405
+ let btn_txt = "";
406
+ // 设置按钮样式
407
+ this.btn_style = res.app_coupon_button_bg_url
408
+ ? {
409
+ // 设置背景图片
410
+ backgroundImage: `url(${getServiceUrl(
411
+ res.can_take !== "Y"
412
+ ? res.app_coupon_button_see_url
413
+ : res.app_coupon_button_bg_url
414
+ )})`,
415
+ // 设置背景大小
416
+ backgroundSize: "100% 100%",
417
+ // 设置背景重复
418
+ backgroundRepeat: "no-repeat",
419
+ // 设置背景颜色
420
+ backgroundColor: "",
421
+ // 设置外边距
422
+ margin: "0",
423
+ }
424
+ : {
425
+ // 设置背景颜色
426
+ backgroundColor: "#FB5B3F",
427
+ // 设置外边距
428
+ margin: "0",
429
+ };
430
+ // 设置按钮文字
431
+ btn_txt = res.can_take === "Y" ? "一键领取" : "去查看";
432
+ // 判断是否是随机领取
433
+ if (this.isRandom) {
434
+ // 设置按钮文字
435
+ btn_txt = res.can_take === "Y" ? "开心领取" : "去查看";
436
+ }
437
+ // 设置按钮文字
438
+ this.btn_txt = btn_txt;
439
+ }
254
440
 
255
- this.couponList =
256
- res.list &&
257
- res.list.length > 0 &&
258
- res.list.map((item) => {
259
- let mapArr = {"Y": "去查看", "P": "领取", "N": "已发完"}
441
+ if (res.list && res.list.length) {
442
+ this.couponList = res.list.map((item) => {
443
+ let mapArr = { Y: "去查看", P: "领取", N: "已发完" };
260
444
  item.btn_txt = mapArr[item.can_take_num];
261
445
  if (item.can_take_num === "Y" || item.can_take_num === "P") {
262
446
  //按钮样式
263
447
  item.btn = res.app_coupon_button_bg_url
264
448
  ? {
265
449
  backgroundImage: `url(${getServiceUrl(
266
- item.can_take_num === "Y" ? res.app_coupon_button_see_url : res.app_coupon_button_bg_url
450
+ item.can_take_num === "Y"
451
+ ? res.app_coupon_button_see_url
452
+ : res.app_coupon_button_bg_url
267
453
  )})`,
268
454
  backgroundSize: "100% 100%",
269
455
  backgroundRepeat: "no-repeat",
270
- backgroundColor: '',
456
+ backgroundColor: "",
271
457
  margin: "0",
272
458
  }
273
459
  : {
274
- backgroundColor: '#FB5B3F',
460
+ backgroundColor: "#FB5B3F",
275
461
  margin: "0",
276
462
  };
277
463
  //整块背景
@@ -282,34 +468,39 @@ export default {
282
468
  backgroundRepeat: "no-repeat",
283
469
  };
284
470
  //icon
285
- item.icon=item.can_take_num === "Y"?'iconyilingqu':'icondailingqu'
471
+ item.icon =
472
+ item.can_take_num === "Y" ? "iconyilingqu" : "icondailingqu";
286
473
  //icon颜色
287
- item.iconColor = item.can_take_num === "Y"?'#D6D6D6':this.iconColor
474
+ item.iconColor =
475
+ item.can_take_num === "Y" ? "#D6D6D6" : this.iconColor;
288
476
  //券名称颜色
289
- item.nameColor = '#FB5B3F'
477
+ item.nameColor = "#FB5B3F";
290
478
  //其他文字颜色
291
- item.infoColor = '#fff'
479
+ item.infoColor = "#fff";
292
480
  } else {
293
481
  //按钮样式
294
482
  item.btn = { background: "#D6D6D6", margin: "0" };
295
483
  //整块背景
296
- item.headIcon = getServiceUrl(res.app_coupon_invalid_url)
484
+ item.headIcon = getServiceUrl(res.app_coupon_invalid_url);
297
485
  item.couponBackground = {
298
- backgroundImage: `url(${getServiceUrl(res.app_coupon_invalid_url)})`,
486
+ backgroundImage: `url(${getServiceUrl(
487
+ res.app_coupon_invalid_url
488
+ )})`,
299
489
  backgroundSize: "100%",
300
490
  backgroundRepeat: "no-repeat",
301
491
  };
302
492
  //icon
303
- item.icon='iconyifawan'
493
+ item.icon = "iconyifawan";
304
494
  //icon颜色
305
- item.iconColor = '#D6D6D6'
495
+ item.iconColor = "#D6D6D6";
306
496
  //券名称颜色
307
- item.nameColor = '#BBBBBB'
497
+ item.nameColor = "#BBBBBB";
308
498
  //其他文字颜色
309
- item.infoColor = '#BBBBBB'
499
+ item.infoColor = "#BBBBBB";
310
500
  }
311
501
  return item;
312
502
  });
503
+ }
313
504
  console.log("couponList", this.couponList);
314
505
  this.message = res.message;
315
506
  this.notice = res.about;
@@ -320,19 +511,19 @@ export default {
320
511
  });
321
512
  },
322
513
 
323
- toCoupon(){
514
+ toCoupon() {
324
515
  this.$xdUniHelper.navigateTo({
325
516
  url: this.next_url || this.collectedPath,
326
517
  });
327
518
  },
328
519
 
329
520
  getCoupont(item) {
330
- if(item.can_take_num === "Y") {
521
+ if (item.can_take_num === "Y") {
331
522
  this.toCoupon();
332
523
  return;
333
524
  }
334
525
  this.$xdShowLoading({});
335
- jfbRootExec("getAllCoupon", {
526
+ jfbRootExec("getOnceCoupon", {
336
527
  vm: this,
337
528
  data: {
338
529
  ...this.options,
@@ -355,9 +546,42 @@ export default {
355
546
  return;
356
547
  }
357
548
  this.order_num = res.tmp_order_number;
358
- setTimeout(()=>{
549
+ setTimeout(() => {
550
+ this.getResult();
551
+ }, 1000);
552
+ })
553
+ .catch((err) => {
554
+ console.log(err, "err");
555
+ });
556
+ },
557
+
558
+ getAllCoupont() {
559
+ this.$xdShowLoading({});
560
+ jfbRootExec("getAllCoupon", {
561
+ vm: this,
562
+ data: {
563
+ ...this.options,
564
+ distribution_method: this.method,
565
+ namespace: this.pageBusinessCode,
566
+ activity_id: this.activity_id,
567
+ },
568
+ })
569
+ .then((res) => {
570
+ if (res.code == 400) {
571
+ this.$xdHideLoading();
572
+ this.$xdAlert({
573
+ content: res.message,
574
+ zIndex: 3200,
575
+ time: 2000,
576
+ isClose: false,
577
+ });
578
+ this.getList();
579
+ return;
580
+ }
581
+ this.order_num = res.tmp_order_number;
582
+ setTimeout(() => {
359
583
  this.getResult();
360
- },1000)
584
+ }, 1000);
361
585
  })
362
586
  .catch((err) => {
363
587
  console.log(err, "err");
@@ -383,6 +607,7 @@ export default {
383
607
  isClose: false,
384
608
  });
385
609
  this.getList();
610
+ this.btn_txt = "去查看";
386
611
  if (this.timeer) {
387
612
  this.time = 0;
388
613
  clearTimeout(this.timeer);
@@ -415,6 +640,7 @@ export default {
415
640
  `pay_${res.status_type}`
416
641
  );
417
642
  }
643
+ this.btn_txt = `领取中 ${res.success_num}/${res.total_num}`;
418
644
  this.time++;
419
645
  }, Math.pow(this.date, this.time > this.maxTime ? this.maxTime : this.time) * 1000);
420
646
  })
@@ -470,7 +696,7 @@ export default {
470
696
  overflow-y: auto;
471
697
  padding-top: 220rpx;
472
698
  box-sizing: border-box;
473
- background-color: #FAFAFA;
699
+ background-color: #fafafa;
474
700
  }
475
701
 
476
702
  .empty_data {
@@ -531,40 +757,39 @@ export default {
531
757
  margin: unit(20, rpx) auto 0 auto;
532
758
  position: relative;
533
759
 
534
- &.status_N{
535
- .item_head{
536
- color: #BBBBBB;
760
+ &.status_N {
761
+ .item_head {
762
+ color: #bbbbbb;
537
763
  }
538
- .item_sub{
539
- color: #BBBBBB;
764
+ .item_sub {
765
+ color: #bbbbbb;
540
766
  }
541
767
  }
542
- .btn_wrap{
768
+ .btn_wrap {
543
769
  position: absolute;
544
770
  right: 30rpx;
545
771
  bottom: 40rpx;
546
772
  }
547
773
 
548
- .item_head{
774
+ .item_head {
549
775
  display: flex;
550
776
  align-items: center;
551
777
  font-size: 40rpx;
552
778
  color: #000000;
553
779
  font-weight: 500;
554
780
 
555
- .t_icon{
781
+ .t_icon {
556
782
  width: 44rpx;
557
783
  margin-right: 20rpx;
558
784
  max-height: 80rpx;
559
785
  }
560
786
  }
561
- .item_sub{
787
+ .item_sub {
562
788
  margin-top: 26rpx;
563
- color: #FF4D4A;
789
+ color: #ff4d4a;
564
790
  font-size: 36rpx;
565
791
  font-weight: 400;
566
792
  }
567
-
568
793
  }
569
794
  }
570
795
  &-foot {
@@ -20,7 +20,7 @@ module.exports = {
20
20
  "rule":"<p>打发&middot;</p>",
21
21
  "request_id":"a2603f2a480485f4"
22
22
  },
23
- getAllCoupon: {
23
+ getOnceCoupon: {
24
24
  "request_id": "5987aa28c709d4ef"
25
25
  }
26
26
  }
@@ -579,7 +579,7 @@
579
579
  </view>
580
580
  </view>
581
581
  <view
582
- v-if="info.pay_info && (biz_code !== 'gift' || info.is_show_gift_price) && is_not_show_price !== 'Y'"
582
+ v-if="info.pay_info && (biz_code !== 'gift' || info.is_show_gift_price)"
583
583
  class="jfb-base-order-detail__body-card"
584
584
  :style="{
585
585
  background: backgroundColor,
@@ -824,7 +824,6 @@ export default {
824
824
  viewStatus: "", //业务类型预览
825
825
  isPreview: false, //是否预览
826
826
  biz_code: "",
827
- is_not_show_price: "",
828
827
 
829
828
  showPassword: false,
830
829
  dialogPassword: "",
@@ -940,7 +939,6 @@ export default {
940
939
  })
941
940
  .then((res) => {
942
941
  this.biz_code = res.biz_code;
943
- this.is_not_show_price = res.is_not_show_price;
944
942
  if (this.isPreview) {
945
943
  switch (this.viewStatus) {
946
944
  case "mall":
@@ -149,7 +149,7 @@
149
149
  </view>
150
150
  <view class="jfb-base-order-list__body-order-item-bottom">
151
151
  <view>下单时间:{{ item.created_time_text }}</view>
152
- <view v-if="item.biz_code !== 'gift' && item.is_not_show_price !== 'Y'">
152
+ <view v-if="item.biz_code !== 'gift'">
153
153
  <text>合计:</text>
154
154
  <xd-unit
155
155
  :isOld="false"