jufubao-base 1.0.105-beta1 → 1.0.105-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.105-beta1",
3
+ "version": "1.0.105-beta5",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -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=homed`,
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>
@@ -106,7 +106,7 @@
106
106
 
107
107
  <xd-button
108
108
  size="small"
109
- :disabled="item.remain_card_count == 0"
109
+ :disabled="item.can_take_num !=='Y' && item.remain_card_count == 0"
110
110
  @click="getCoupont(item)"
111
111
  type="primary"
112
112
  style="width: 170rpx;height: 60rpx;"
@@ -233,7 +233,7 @@ export default {
233
233
  })
234
234
  .then((res) => {
235
235
  this.background = getServiceUrl(res.background);
236
- this.used_up_url = getServiceUrl(res.used_up_url);
236
+ this.used_up_url = res.used_up_url && getServiceUrl(res.used_up_url);
237
237
  this.can_take = res.can_take;
238
238
  this.has_times = res.has_times;
239
239
 
@@ -308,6 +308,10 @@ export default {
308
308
  });
309
309
  },
310
310
  getCoupont(item) {
311
+ if(item.can_take_num === "Y") {
312
+ this.toCoupon();
313
+ return;
314
+ }
311
315
  this.$xdShowLoading({});
312
316
  jfbRootExec("getAllCoupon", {
313
317
  vm: this,
@@ -348,6 +352,7 @@ export default {
348
352
  })
349
353
  .then((res) => {
350
354
  if (res.status_type === "success") {
355
+ this.order_num = null;
351
356
  this.$xdHideLoading();
352
357
  this.$xdAlert({
353
358
  content: "领取成功",
@@ -1,11 +1,25 @@
1
1
  'use strict';
2
2
 
3
3
  module.exports = {
4
- getCouponList: {"list":[
5
- {"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},
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
- ],"background":"//sandbox-img.jufubao.cn/uploads/20231204/96b801e0dc27422c183dc90d905dd2ed.jpg","can_take":"Y","message":"","app_coupon_url":"//sandbox-img.jufubao.cn/uploads/20231205/fee9b644b83495c9ba8a4db277600b54.jpg","app_activity_button":"//sandbox-img.jufubao.cn/uploads/20231207/35f3065b2b2bc3fc2dda73d7b5b9eae8.jpg","app_coupon_button_bg_url":"//sandbox-img.jufubao.cn/uploads/20231212/026a3ea901f87f51b531d06c24604676.png","app_coupon_invalid_url":"//sandbox-img.jufubao.cn/uploads/20231208/8b153ce4870686a37295c16fbc992235.jpg","request_id":"a2603f2a480485f4"},
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
+ "used_up_url": "",
12
+ "has_times": "Y",
13
+ "can_take":"Y",
14
+ "message":"",
15
+ "app_coupon_url":"//sandbox-img.jufubao.cn/uploads/20231205/fee9b644b83495c9ba8a4db277600b54.jpg",
16
+ "app_activity_button":"//sandbox-img.jufubao.cn/uploads/20231207/35f3065b2b2bc3fc2dda73d7b5b9eae8.jpg",
17
+ "app_coupon_button_bg_url":"//sandbox-img.jufubao.cn/uploads/20231212/026a3ea901f87f51b531d06c24604676.png",
18
+ "app_coupon_button_see_url": "//sandbox-img.jufubao.cn/uploads/20231212/026a3ea901f87f51b531d06c24604676.png",
19
+ "app_coupon_invalid_url":"//sandbox-img.jufubao.cn/uploads/20231208/8b153ce4870686a37295c16fbc992235.jpg",
20
+ "rule":"<p>打发&middot;</p>",
21
+ "request_id":"a2603f2a480485f4"
22
+ },
9
23
  getAllCoupon: {
10
24
  "request_id": "5987aa28c709d4ef"
11
25
  }
@@ -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) => {