jufubao-base 1.0.158-beta5 → 1.0.158-beta6

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-beta5",
3
+ "version": "1.0.158-beta6",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -221,7 +221,6 @@ export default {
221
221
  }
222
222
 
223
223
  let path = this.getUrlCallback(this.my_card_url || this.backUrl);
224
-
225
224
  //有优惠券处理
226
225
  if(this.hasCon){
227
226
  this.toShowCouponDialog();
@@ -238,7 +238,6 @@ export default {
238
238
  }
239
239
  },
240
240
  handlerAfterBindCard(res){
241
-
242
241
  if(res.pop_info && res.pop_info.pop_code === '1001'){
243
242
  this.handleBindConfirm();
244
243
  return;
@@ -57,7 +57,6 @@
57
57
  :isRandom="isRandom"
58
58
  :list="couponList"
59
59
  :setting="couponOther"
60
- :btnImage="btnImage"
61
60
  @closeDialog="handleCardBindClose"
62
61
  @getCoupont="handleGetCoupon"
63
62
  @getAllCoupont="getAllCoupont"
@@ -118,10 +117,8 @@ export default {
118
117
  //预览是否显示弹窗
119
118
  is_preview_hide_dailog: false,
120
119
 
121
- isAll: true,
122
- isRandom: true,
123
- btnImage: ''
124
-
120
+ isAll: false,
121
+ isRandom: false
125
122
  };
126
123
  },
127
124
  computed: {
@@ -268,6 +265,7 @@ export default {
268
265
  this.list[this.currentIndex].app_activity_button
269
266
  );
270
267
  this.activity_id = this.list[this.currentIndex].activity_id;
268
+ this.isAll =
271
269
  this.handlePop();
272
270
  })
273
271
  .catch((err) => {
@@ -286,13 +284,27 @@ export default {
286
284
  const { list, ...other } = res;
287
285
  this.couponList = list;
288
286
  this.couponOther = other;
289
- if(res.can_take === "Y" && res.has_times === "Y" && list.length > 0){
287
+ this.isAll = res.receive_method==="batch"
288
+ this.isRandom = res.distribution_type==="random"
289
+ this.activity_id = res.activity_id
290
+ if(res.receive_method !== "batch") {
291
+ if(res.can_take === "Y" && res.has_times === "Y" && list.length > 0){
292
+ if (this.isPreview) {
293
+ console.log(getContainerPropsValue(value, "content.is_show_dailog", 'Y'))
294
+ this.isShow = getContainerPropsValue(value, "content.is_show_dailog", 'Y') === 'N';
295
+ }else this.isShow = true;
296
+ }else{
297
+ this.handleCardBindClose();
298
+ }
299
+ } else {
300
+ if(res.can_take === "Y"){
290
301
  if (this.isPreview) {
291
302
  console.log(getContainerPropsValue(value, "content.is_show_dailog", 'Y'))
292
303
  this.isShow = getContainerPropsValue(value, "content.is_show_dailog", 'Y') === 'N';
293
- }else this.isShow = true;
294
- }else{
295
- this.handleCardBindClose();
304
+ }else this.isShow = true;
305
+ }else{
306
+ this.handleCardBindClose();
307
+ }
296
308
  }
297
309
  })
298
310
  },
@@ -305,7 +317,7 @@ export default {
305
317
  }
306
318
  },
307
319
 
308
- getAllCoupont() {
320
+ getAllCoupont(info) {
309
321
  this.p_getAllDialogList();
310
322
  },
311
323
 
@@ -316,6 +328,7 @@ export default {
316
328
  vm: this,
317
329
  data: {
318
330
  distribution_method: this.distribution_method,
331
+ activity_id: this.activity_id,
319
332
  ...this.dispatchData
320
333
  }
321
334
  }).then(res => {
@@ -3,50 +3,93 @@
3
3
  <view
4
4
  class="ticket_box"
5
5
  :style="{
6
- backgroundImage: dialogBackground
6
+ backgroundImage: dialogBackground,
7
7
  }"
8
8
  >
9
- <view v-if="!isRandom" class="ticket_list">
10
- <view
11
- class="ticket_item"
12
- :class="item.can_take_num"
13
- v-for="(item,i) in uiList"
14
- :key="i"
15
- >
16
- <view class="item_head">
17
- <image class="t_icon" mode="widthFix" :src="item.headIcon"></image>
18
- <view>{{ item.prize_type }}</view>
19
- </view>
20
- <view class="item_sub">{{ item.prize_name }}</view>
9
+ <view v-if="isAll">
10
+ <view v-if="!isRandom" class="ticket_list">
11
+ <view
12
+ class="ticket_item"
13
+ :class="item.can_take_num"
14
+ v-for="(item, i) in uiList"
15
+ :key="i"
16
+ >
17
+ <view class="item_head">
18
+ <image
19
+ class="t_icon"
20
+ mode="widthFix"
21
+ :src="item.headIcon"
22
+ ></image>
23
+ <view>{{ item.prize_type }}</view>
24
+ </view>
25
+ <view class="item_sub">{{ item.prize_name }}</view>
21
26
 
22
- <xd-font-icon class="ticket_icon" :color="item.iconColor" :icon="item.icon"></xd-font-icon>
23
- <view v-if="!isAll" class="btn">
24
- <xd-button
25
- size="small"
26
- type="primary"
27
- :disabled="item.remain_card_count == 0"
28
- :style="{
29
- backgroundImage: item.btnImage,
30
- backgroundSize: '100% 100%',
31
- }"
32
- @click="getCoupont(item)"
33
- >{{item.btn_txt}}</xd-button>
27
+ <xd-font-icon
28
+ class="ticket_icon"
29
+ :color="item.iconColor"
30
+ :icon="item.icon"
31
+ ></xd-font-icon>
34
32
  </view>
35
33
  </view>
34
+ <view v-else>
35
+ <img
36
+ style="width: 100%"
37
+ mode="widthFix"
38
+ :src="bottomBackground"
39
+ alt=""
40
+ />
41
+ </view>
42
+ <xd-button
43
+ size="small"
44
+ type="primary"
45
+ :style="{
46
+ backgroundImage: btnImage,
47
+ backgroundSize: '100% 100%',
48
+ width: '80%'
49
+ }"
50
+ @click="getAllCoupont"
51
+ >{{ isRandom ? "开心获取" : "一键领取" }}</xd-button
52
+ >
36
53
  </view>
37
54
  <view v-else>
38
- 随机领取图片
55
+ <view class="ticket_list">
56
+ <view
57
+ class="ticket_item"
58
+ :class="item.can_take_num"
59
+ v-for="(item, i) in uiList"
60
+ :key="i"
61
+ >
62
+ <view class="item_head">
63
+ <image
64
+ class="t_icon"
65
+ mode="widthFix"
66
+ :src="item.headIcon"
67
+ ></image>
68
+ <view>{{ item.prize_type }}</view>
69
+ </view>
70
+ <view class="item_sub">{{ item.prize_name }}</view>
71
+
72
+ <xd-font-icon
73
+ class="ticket_icon"
74
+ :color="item.iconColor"
75
+ :icon="item.icon"
76
+ ></xd-font-icon>
77
+ <view class="btn">
78
+ <xd-button
79
+ size="small"
80
+ type="primary"
81
+ :disabled="item.remain_card_count == 0"
82
+ :style="{
83
+ backgroundImage: item.btnImage,
84
+ backgroundSize: '100% 100%',
85
+ }"
86
+ @click="getCoupont(item)"
87
+ >{{ item.btn_txt }}</xd-button
88
+ >
89
+ </view>
90
+ </view>
91
+ </view>
39
92
  </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>
50
93
  </view>
51
94
 
52
95
  <xd-font-icon
@@ -62,172 +105,173 @@
62
105
  import XdButton from "@/components/XdButton/XdButton";
63
106
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
64
107
  import getServiceUrl from "@/common/getServiceUrl";
65
- export default{
108
+ export default {
66
109
  name: "XdCouCardBind",
67
110
  components: {
68
111
  XdButton,
69
- XdFontIcon
112
+ XdFontIcon,
70
113
  },
71
114
  props: {
72
115
  list: {
73
116
  type: Array,
74
- default(){
75
- return []
76
- }
117
+ default() {
118
+ return [];
119
+ },
77
120
  },
78
121
  isAll: {
79
122
  type: Boolean,
80
- default: false
123
+ default: false,
81
124
  },
82
125
  isRandom: {
83
126
  type: Boolean,
84
- default: false
127
+ default: false,
85
128
  },
86
129
  btnImage: {
87
130
  type: String,
88
- default: ""
131
+ default: "",
89
132
  },
90
- setting: {}
133
+ setting: {},
91
134
  },
92
135
  computed: {
93
- uiList(){
94
- return this.list.map(item => {
95
- let mapArr = {"Y": "去查看", "P": "领取", "N": "已发完"}
136
+ uiList() {
137
+ return this.list.map((item) => {
138
+ let mapArr = { Y: "去查看", P: "领取", N: "已发完" };
96
139
  item.btn_txt = mapArr[item.can_take_num];
97
- if(item.can_take_num === "Y" || item.can_take_num === "P"){
140
+ if (item.can_take_num === "Y" || item.can_take_num === "P") {
98
141
  item.headIcon = getServiceUrl(this.setting.app_coupon_url);
99
- item.btnImage = `url(${getServiceUrl(this.setting.app_coupon_button_bg_url)})`;
100
- item.icon = item.can_take_num === "Y" ? "iconyilingqu" : "icondailingqu";
101
- item.iconColor = item.can_take_num === "Y"?'#D6D6D6':"#FF4D4A"
102
- }else if(item.can_take_num === "N"){
142
+ item.btnImage = `url(${getServiceUrl(
143
+ this.setting.app_coupon_button_bg_url
144
+ )})`;
145
+ item.icon =
146
+ item.can_take_num === "Y" ? "iconyilingqu" : "icondailingqu";
147
+ item.iconColor = item.can_take_num === "Y" ? "#D6D6D6" : "#FF4D4A";
148
+ } else if (item.can_take_num === "N") {
103
149
  item.headIcon = getServiceUrl(this.setting.app_coupon_invalid_url);
104
150
  item.btnImage = "";
105
151
  item.icon = "iconyifawan";
106
- item.iconColor = '#D6D6D6'
152
+ item.iconColor = "#D6D6D6";
107
153
  }
108
154
  return item;
109
- })
155
+ });
110
156
  },
111
- dialogBackground(){
157
+ dialogBackground() {
112
158
  return `url(${getServiceUrl(this.setting.background)})`;
113
- }
159
+ },
160
+ bottomBackground() {
161
+ return getServiceUrl(this.setting.app_coupon_bottom_url);
162
+ },
114
163
  },
115
- data(){
116
- return {
117
-
118
- }
164
+ data() {
165
+ return {};
119
166
  },
120
167
  methods: {
121
168
  //领取优惠券
122
- getCoupont(item){
123
- if(item.can_take_num === "P"){
169
+ getCoupont(item) {
170
+ if (item.can_take_num === "P") {
124
171
  this.$emit("getCoupont", item);
125
172
  }
126
173
  },
127
174
  getAllCoupont() {
128
- this.$emit("getAllCoupont", item);
175
+ this.$emit("getAllCoupont");
129
176
  },
130
- handleClose(){
177
+ handleClose() {
131
178
  this.$emit("closeDialog");
132
- }
133
- }
134
- }
179
+ },
180
+ },
181
+ };
135
182
  </script>
136
183
 
137
184
  <style lang="less" scoped>
138
185
  @ticketHeight: 180rpx;
139
186
  @bgHeight: @ticketHeight - 40rpx;
140
- .xd-cou-card-bind{
141
- width: 600rpx;
142
- max-height: 900rpx;
143
- padding-bottom: 80rpx;
144
- .ticket_box{
145
- background-color: #fff;
146
- background-size: 100% auto;
147
- background-repeat: no-repeat;
148
- padding-top: 200rpx;
149
- border-radius: 20rpx;
150
- box-sizing: border-box;
151
- padding-bottom: 20rpx;
152
- }
153
-
154
- .ticket_item{
155
- display: flex;
156
- flex-direction: column;
157
- position: relative;
158
- width: 540rpx;
159
- height: @ticketHeight;
160
- margin: 20rpx auto;
161
- border-radius: 20rpx;
162
- padding: 30rpx;
163
- box-sizing: border-box;
164
- background: #FFF8F8;
165
-
166
- &.P,
167
- &.Y{
187
+ .xd-cou-card-bind {
188
+ width: 600rpx;
189
+ max-height: 900rpx;
190
+ padding-bottom: 80rpx;
191
+ .ticket_box {
192
+ background-color: #fff;
193
+ background-size: 100% auto;
194
+ background-repeat: no-repeat;
195
+ padding-top: 200rpx;
196
+ border-radius: 20rpx;
197
+ box-sizing: border-box;
198
+ padding-bottom: 20rpx;
199
+ }
168
200
 
169
- }
170
- &.N{
171
- background: #F3F3F3;
172
- .item_head{
173
- color: #BBBBBB;
174
- }
175
- .item_sub{
176
- color: #BBBBBB;
177
- }
178
- .ticket_icon{
179
- color: #D6D6D6;
201
+ .ticket_item {
202
+ display: flex;
203
+ flex-direction: column;
204
+ position: relative;
205
+ width: 540rpx;
206
+ height: @ticketHeight;
207
+ margin: 20rpx auto;
208
+ border-radius: 20rpx;
209
+ padding: 30rpx;
210
+ box-sizing: border-box;
211
+ background: #fff8f8;
180
212
 
181
- }
182
- .btn{
183
- .xd-button{
184
- background-color: #DDDDDD !important;
185
- color: #999999 !important;
186
- }
187
- }
188
- }
189
- .item_head{
190
- display: flex;
191
- align-items: center;
192
- font-size: 40rpx;
193
- color: #000000;
194
- font-weight: 500;
195
- .t_icon{
196
- width: 44rpx;
197
- margin-right: 20rpx;
198
- }
213
+ &.P,
214
+ &.Y {
215
+ }
216
+ &.N {
217
+ background: #f3f3f3;
218
+ .item_head {
219
+ color: #bbbbbb;
199
220
  }
200
- .item_sub{
201
- margin-top: 20rpx;
202
- color: #FF4D4A;
203
- font-size: 36rpx;
204
- font-weight: 400;
221
+ .item_sub {
222
+ color: #bbbbbb;
205
223
  }
206
- .ticket_icon{
207
- font-size: 80rpx !important;
208
- position: absolute;
209
- top: 0;
210
- right: 0;
224
+ .ticket_icon {
225
+ color: #d6d6d6;
211
226
  }
212
- .btn{
213
- position: absolute;
214
- right: 20rpx;
215
- bottom: 20rpx;
216
- .xd-button{
217
- height: 30rpx;
218
- width: 100rpx;
219
- font-size: 28rpx;
220
- background-size: cover !important;
221
- background-color: #fb5b3f;
227
+ .btn {
228
+ .xd-button {
229
+ background-color: #dddddd !important;
230
+ color: #999999 !important;
222
231
  }
223
232
  }
224
-
225
233
  }
226
- .dialog_close{
234
+ .item_head {
235
+ display: flex;
236
+ align-items: center;
237
+ font-size: 40rpx;
238
+ color: #000000;
239
+ font-weight: 500;
240
+ .t_icon {
241
+ width: 44rpx;
242
+ margin-right: 20rpx;
243
+ }
244
+ }
245
+ .item_sub {
246
+ margin-top: 20rpx;
247
+ color: #ff4d4a;
248
+ font-size: 36rpx;
249
+ font-weight: 400;
250
+ }
251
+ .ticket_icon {
252
+ font-size: 80rpx !important;
227
253
  position: absolute;
228
- bottom: 0rpx;
229
- left: 50%;
230
- transform: translateX(-50%);
254
+ top: 0;
255
+ right: 0;
256
+ }
257
+ .btn {
258
+ position: absolute;
259
+ right: 20rpx;
260
+ bottom: 20rpx;
261
+ .xd-button {
262
+ height: 30rpx;
263
+ width: 100rpx;
264
+ font-size: 28rpx;
265
+ background-size: cover !important;
266
+ background-color: #fb5b3f;
267
+ }
231
268
  }
232
269
  }
270
+ .dialog_close {
271
+ position: absolute;
272
+ bottom: 0rpx;
273
+ left: 50%;
274
+ transform: translateX(-50%);
275
+ }
276
+ }
233
277
  </style>