jufubao-base 1.0.104 → 1.0.105-beta2
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 +1 -1
- package/src/components/JfbBaseConDialog/Attr.js +12 -0
- package/src/components/JfbBaseConDialog/JfbBaseConDialog.vue +14 -1
- package/src/components/JfbBaseConList/Attr.js +11 -0
- package/src/components/JfbBaseConList/JfbBaseConList.vue +44 -19
- package/src/components/JfbBaseConList/Mock.js +18 -5
- package/src/components/JfbBaseSuccess/JfbBaseSuccess.vue +4 -1
package/package.json
CHANGED
|
@@ -31,6 +31,18 @@ export default {
|
|
|
31
31
|
{ label: '切换', value: 2 },
|
|
32
32
|
]
|
|
33
33
|
},
|
|
34
|
+
{
|
|
35
|
+
label: "触发事件:",
|
|
36
|
+
ele: "xd-select-list",
|
|
37
|
+
valueKey: "distribution_method",
|
|
38
|
+
value: data.distribution_method || "",
|
|
39
|
+
placeholder: "请选择触发事件",
|
|
40
|
+
list: [
|
|
41
|
+
// { label: "首页发放", value: "homed" },
|
|
42
|
+
{ label: "支付成功", value: "paid" },
|
|
43
|
+
{ label: "绑卡成功", value: "card_binded" },
|
|
44
|
+
]
|
|
45
|
+
},
|
|
34
46
|
{
|
|
35
47
|
label: '弹窗间隔:',
|
|
36
48
|
ele: 'el-input',
|
|
@@ -93,6 +93,9 @@ export default {
|
|
|
93
93
|
isPreview: false, //是否预览
|
|
94
94
|
activity_id: "",
|
|
95
95
|
backgroundColor: "",
|
|
96
|
+
distribution_method: "homed", //触发事件
|
|
97
|
+
dispatchData: "", //触发事件参数
|
|
98
|
+
|
|
96
99
|
};
|
|
97
100
|
},
|
|
98
101
|
computed: {
|
|
@@ -114,6 +117,7 @@ export default {
|
|
|
114
117
|
this.list_url = getContainerPropsValue(value, "content.list_url", {
|
|
115
118
|
value: "",
|
|
116
119
|
}).value;
|
|
120
|
+
this.distribution_method = getContainerPropsValue(value, "content.distribution_method", "");
|
|
117
121
|
this.type = getContainerPropsValue(value, "content.type", 1);
|
|
118
122
|
this.isHide = getContainerPropsValue(value, "content.isHide", false);
|
|
119
123
|
this.time = Number(getContainerPropsValue(value, "content.time", 3));
|
|
@@ -122,10 +126,12 @@ export default {
|
|
|
122
126
|
}
|
|
123
127
|
},
|
|
124
128
|
getDialogList() {
|
|
129
|
+
|
|
125
130
|
jfbRootExec("getCouponDialogList", {
|
|
126
131
|
vm: this,
|
|
127
132
|
data: {
|
|
128
133
|
namespace: this.pageBusinessCode,
|
|
134
|
+
distribution_method: this.distribution_method,
|
|
129
135
|
},
|
|
130
136
|
})
|
|
131
137
|
.then((res) => {
|
|
@@ -167,7 +173,7 @@ export default {
|
|
|
167
173
|
},
|
|
168
174
|
handleToList() {
|
|
169
175
|
this.$xdUniHelper.navigateTo({
|
|
170
|
-
url: `${this.list_url}?activity_id=${this.activity_id}&distribution_method
|
|
176
|
+
url: `${this.list_url}?activity_id=${this.activity_id}&distribution_method=${this.distribution_method}`,
|
|
171
177
|
});
|
|
172
178
|
},
|
|
173
179
|
handleClose() {
|
|
@@ -201,6 +207,13 @@ export default {
|
|
|
201
207
|
);
|
|
202
208
|
this.activity_id = this.list[this.currentIndex].activity_id;
|
|
203
209
|
},
|
|
210
|
+
onJfbCustomEvent({action, data}){
|
|
211
|
+
if(action === '@showBaseConDialog'){
|
|
212
|
+
this.dispatchData = data;
|
|
213
|
+
this.getDialogList();
|
|
214
|
+
}
|
|
215
|
+
console.log('onJfbCustomEvent',action, data);
|
|
216
|
+
}
|
|
204
217
|
},
|
|
205
218
|
};
|
|
206
219
|
</script>
|
|
@@ -6,6 +6,17 @@
|
|
|
6
6
|
export default {
|
|
7
7
|
style: [],
|
|
8
8
|
content: [
|
|
9
|
+
{
|
|
10
|
+
label: '查看已领票券路径:', //label
|
|
11
|
+
ele: 'xd-select-pages-path', //package 名称
|
|
12
|
+
valueKey: 'collectedPath', //form[valueKey]
|
|
13
|
+
placeholder: '请选择查看已领票券路径',
|
|
14
|
+
value: null,
|
|
15
|
+
setting: {
|
|
16
|
+
router: XdBus.getParentApi('getPagesTree'),
|
|
17
|
+
},
|
|
18
|
+
inline: false,
|
|
19
|
+
},
|
|
9
20
|
// {
|
|
10
21
|
// label: '领券规则:',
|
|
11
22
|
// ele: 'xd-site-news',
|
|
@@ -16,15 +16,14 @@
|
|
|
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" v-if="done"
|
|
19
|
+
<view class="jfb-base-con-list__body" v-if="done" :style="{
|
|
20
|
+
backgroundImage: `url(${background})`,
|
|
21
|
+
backgroundSize: '100%',
|
|
22
|
+
backgroundRepeat: 'no-repeat',
|
|
23
|
+
minHeight: `${layoutInfo.bodyMinHeightRpx}rpx`,
|
|
24
|
+
}">
|
|
20
25
|
<view
|
|
21
26
|
v-if="couponList&&couponList.length > 0"
|
|
22
|
-
:style="{
|
|
23
|
-
backgroundImage: `url(${background})`,
|
|
24
|
-
backgroundSize: '100%',
|
|
25
|
-
backgroundRepeat: 'no-repeat',
|
|
26
|
-
height: `${layoutInfo.bodyMinHeightRpx}rpx`,
|
|
27
|
-
}"
|
|
28
27
|
>
|
|
29
28
|
<view class="jfb-base-con-list__body-content">
|
|
30
29
|
<view class="jfb-base-con-list__body-content-header">
|
|
@@ -41,7 +40,7 @@
|
|
|
41
40
|
<xd-font-icon size="20" icon="iconxiangyou_xian"></xd-font-icon>
|
|
42
41
|
</view>
|
|
43
42
|
</view>
|
|
44
|
-
<view class="jfb-base-con-list__body-content-list">
|
|
43
|
+
<view v-if="can_take === 'Y' && has_times === 'Y'" class="jfb-base-con-list__body-content-list">
|
|
45
44
|
<view v-for="(item, index) in couponList" :key="index">
|
|
46
45
|
<view
|
|
47
46
|
class="jfb-base-con-list__body-content-list-item"
|
|
@@ -106,24 +105,27 @@
|
|
|
106
105
|
<view></view>
|
|
107
106
|
|
|
108
107
|
<xd-button
|
|
109
|
-
v-if="item.can_take_num !== 'Y'"
|
|
110
108
|
size="small"
|
|
111
|
-
:disabled="item.remain_card_count == 0"
|
|
109
|
+
:disabled="item.can_take_num !=='Y' && item.remain_card_count == 0"
|
|
112
110
|
@click="getCoupont(item)"
|
|
113
111
|
type="primary"
|
|
112
|
+
style="width: 170rpx;height: 60rpx;"
|
|
114
113
|
:style="item.btn"
|
|
115
114
|
:color="item.infoColor"
|
|
116
|
-
|
|
117
|
-
>
|
|
115
|
+
>{{ item.btn_txt }}</xd-button>
|
|
118
116
|
</view>
|
|
119
117
|
</view>
|
|
120
118
|
</view>
|
|
121
119
|
</view>
|
|
122
120
|
</view>
|
|
123
|
-
<view class="jfb-base-con-list__body-content-
|
|
124
|
-
|
|
125
|
-
>
|
|
121
|
+
<view v-else class="jfb-base-con-list__body-content-list" style="padding-bottom: 60rpx;">
|
|
122
|
+
<image mode="widthFix" src="//sandbox-img.jufubao.cn/uploads/20240123/0b022b56928000ae54f5e7c9669cf214.png?ver=tjJC9jW3mbfiz2p19I6l"></image>
|
|
123
|
+
</view>
|
|
126
124
|
</view>
|
|
125
|
+
<view class="jfb-base-con-list__body-content-foot"
|
|
126
|
+
@click="toCoupon"
|
|
127
|
+
>查看已领票券</view
|
|
128
|
+
>
|
|
127
129
|
</view>
|
|
128
130
|
<view
|
|
129
131
|
v-else
|
|
@@ -180,6 +182,9 @@ export default {
|
|
|
180
182
|
activity_id: "",
|
|
181
183
|
background: "",
|
|
182
184
|
app_coupon_url: "",
|
|
185
|
+
used_up_url: "",
|
|
186
|
+
can_take: "",
|
|
187
|
+
has_times: "",
|
|
183
188
|
method: "entry",
|
|
184
189
|
maxTime: 5, //最长轮询2的N次方(秒)
|
|
185
190
|
date: 2, //时间底数
|
|
@@ -188,6 +193,8 @@ export default {
|
|
|
188
193
|
order_num: null,
|
|
189
194
|
done: false,
|
|
190
195
|
message: "",
|
|
196
|
+
|
|
197
|
+
collectedPath: "",
|
|
191
198
|
};
|
|
192
199
|
},
|
|
193
200
|
computed: {
|
|
@@ -213,6 +220,7 @@ export default {
|
|
|
213
220
|
init(value) {
|
|
214
221
|
this.contentBackground = '#FFF8F8';
|
|
215
222
|
this.iconColor = '#FF4D4A';
|
|
223
|
+
this.collectedPath = getContainerPropsValue(value, "content.collectedPath", {value: ''}).value;
|
|
216
224
|
},
|
|
217
225
|
getList() {
|
|
218
226
|
jfbRootExec("getCouponList", {
|
|
@@ -225,16 +233,22 @@ export default {
|
|
|
225
233
|
})
|
|
226
234
|
.then((res) => {
|
|
227
235
|
this.background = getServiceUrl(res.background);
|
|
236
|
+
this.used_up_url = getServiceUrl(res.used_up_url);
|
|
237
|
+
this.can_take = res.can_take;
|
|
238
|
+
this.has_times = res.has_times;
|
|
239
|
+
|
|
228
240
|
this.couponList =
|
|
229
241
|
res.list &&
|
|
230
242
|
res.list.length > 0 &&
|
|
231
243
|
res.list.map((item) => {
|
|
244
|
+
let mapArr = {"Y": "去查看", "P": "领取", "N": "已发完"}
|
|
245
|
+
item.btn_txt = mapArr[item.can_take_num];
|
|
232
246
|
if (item.can_take_num === "Y" || item.can_take_num === "P") {
|
|
233
247
|
//按钮样式
|
|
234
248
|
item.btn = res.app_coupon_button_bg_url
|
|
235
249
|
? {
|
|
236
250
|
backgroundImage: `url(${getServiceUrl(
|
|
237
|
-
res.app_coupon_button_bg_url
|
|
251
|
+
item.can_take_num === "Y" ? res.app_coupon_button_see_url : res.app_coupon_button_bg_url
|
|
238
252
|
)})`,
|
|
239
253
|
backgroundSize: "100%",
|
|
240
254
|
backgroundRepeat: "no-repeat",
|
|
@@ -288,7 +302,16 @@ export default {
|
|
|
288
302
|
console.log(err, "err");
|
|
289
303
|
});
|
|
290
304
|
},
|
|
305
|
+
toCoupon(){
|
|
306
|
+
this.$xdUniHelper.navigateTo({
|
|
307
|
+
url: this.collectedPath,
|
|
308
|
+
});
|
|
309
|
+
},
|
|
291
310
|
getCoupont(item) {
|
|
311
|
+
if(item.can_take_num === "Y") {
|
|
312
|
+
this.toCoupon();
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
292
315
|
this.$xdShowLoading({});
|
|
293
316
|
jfbRootExec("getAllCoupon", {
|
|
294
317
|
vm: this,
|
|
@@ -329,6 +352,7 @@ export default {
|
|
|
329
352
|
})
|
|
330
353
|
.then((res) => {
|
|
331
354
|
if (res.status_type === "success") {
|
|
355
|
+
this.order_num = null;
|
|
332
356
|
this.$xdHideLoading();
|
|
333
357
|
this.$xdAlert({
|
|
334
358
|
content: "领取成功",
|
|
@@ -438,6 +462,9 @@ export default {
|
|
|
438
462
|
&__body {
|
|
439
463
|
position: relative;
|
|
440
464
|
overflow-y: auto;
|
|
465
|
+
padding-top: 82px;
|
|
466
|
+
box-sizing: border-box;
|
|
467
|
+
background-color: #FAFAFA;
|
|
441
468
|
.empty_data {
|
|
442
469
|
text-align: center;
|
|
443
470
|
color: #999999;
|
|
@@ -455,8 +482,6 @@ export default {
|
|
|
455
482
|
border-radius: unit(20, rpx);
|
|
456
483
|
background: #fff;
|
|
457
484
|
padding: unit(34, rpx);
|
|
458
|
-
position: relative;
|
|
459
|
-
top: unit(164, rpx);
|
|
460
485
|
margin-right: auto;
|
|
461
486
|
margin-left: auto;
|
|
462
487
|
width: unit(650, rpx);
|
|
@@ -534,7 +559,7 @@ export default {
|
|
|
534
559
|
color: #a6a6a6;
|
|
535
560
|
font-size: unit(24, rpx);
|
|
536
561
|
text-align: center;
|
|
537
|
-
margin
|
|
562
|
+
margin: unit(40, rpx) 0;
|
|
538
563
|
}
|
|
539
564
|
}
|
|
540
565
|
}
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
getCouponList: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
getCouponList: {
|
|
5
|
+
"list":[
|
|
6
|
+
{"prize_id":153,"prize_name":"满50减50","prize_type":"满减券","prize_num":1,"can_take":"Y","is_over":"N","can_take_num":"P","today_times":1,"today_num":0,"total_times":1,"total_num":0,"remain_card_count":55},
|
|
7
|
+
{"prize_id":153,"prize_name":"满50减50","prize_type":"满减券","prize_num":1,"can_take":"Y","is_over":"N","can_take_num":"P","today_times":1,"today_num":0,"total_times":1,"total_num":0,"remain_card_count":55},
|
|
8
|
+
{"prize_id":153,"prize_name":"满50减50","prize_type":"满减券","prize_num":1,"can_take":"Y","is_over":"N","can_take_num":"P","today_times":1,"today_num":0,"total_times":1,"total_num":0,"remain_card_count":55}
|
|
9
|
+
],
|
|
10
|
+
"background":"//sandbox-img.jufubao.cn/uploads/20231204/96b801e0dc27422c183dc90d905dd2ed.jpg",
|
|
11
|
+
"has_times": "Y",
|
|
12
|
+
"can_take":"Y",
|
|
13
|
+
"message":"",
|
|
14
|
+
"app_coupon_url":"//sandbox-img.jufubao.cn/uploads/20231205/fee9b644b83495c9ba8a4db277600b54.jpg",
|
|
15
|
+
"app_activity_button":"//sandbox-img.jufubao.cn/uploads/20231207/35f3065b2b2bc3fc2dda73d7b5b9eae8.jpg",
|
|
16
|
+
"app_coupon_button_bg_url":"//sandbox-img.jufubao.cn/uploads/20231212/026a3ea901f87f51b531d06c24604676.png",
|
|
17
|
+
"app_coupon_button_see_url": "//sandbox-img.jufubao.cn/uploads/20231212/026a3ea901f87f51b531d06c24604676.png",
|
|
18
|
+
"app_coupon_invalid_url":"//sandbox-img.jufubao.cn/uploads/20231208/8b153ce4870686a37295c16fbc992235.jpg",
|
|
19
|
+
"rule":"<p>打发·</p>",
|
|
20
|
+
"request_id":"a2603f2a480485f4"
|
|
21
|
+
},
|
|
9
22
|
getAllCoupon: {
|
|
10
23
|
"request_id": "5987aa28c709d4ef"
|
|
11
24
|
}
|
|
@@ -321,7 +321,7 @@ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
|
321
321
|
import XdDailog from "@/components/XdDailog/XdDailog";
|
|
322
322
|
import XdButton from "@/components/XdButton/XdButton";
|
|
323
323
|
import XdUnit from "@/components/XdUnit/XdUnit";
|
|
324
|
-
import { jfbRootExec } from "@/utils/xd.event";
|
|
324
|
+
import { jfbRootExec, jfbRootFnExec } from "@/utils/xd.event";
|
|
325
325
|
import JfbBaseSuccessMixin from "./JfbBaseSuccessMixin";
|
|
326
326
|
import componentsMixins from "@/mixins/componentsMixins";
|
|
327
327
|
import extsMixins from "@/mixins/extsMixins";
|
|
@@ -495,6 +495,9 @@ export default {
|
|
|
495
495
|
},
|
|
496
496
|
})
|
|
497
497
|
.then((res) => {
|
|
498
|
+
if(res.status.status_type === 'success') {
|
|
499
|
+
jfbRootFnExec(this, 'onCustomEvent')("@showBaseConDialog", {order_id: this.order_id});
|
|
500
|
+
}
|
|
498
501
|
this.handleOrderResolve(res);
|
|
499
502
|
})
|
|
500
503
|
.catch((err) => {
|