jufubao-base 1.0.208-beta1 → 1.0.209-beta1

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.208-beta1",
3
+ "version": "1.0.209-beta1",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -291,7 +291,6 @@ export default {
291
291
  groupKey:'content',
292
292
  value: data['btnConfirmBgColor'] || '',
293
293
  placeholder: '请选择按钮背景颜色',
294
- groupKey: "content",
295
294
  },
296
295
  {
297
296
  label: "按钮文字颜色:",
@@ -258,17 +258,6 @@ export default {
258
258
  },trigger: ['blur', 'change']
259
259
  }],
260
260
  },
261
- params['isCarousel']=== 2 && (params.poster && params.poster['type'] && params.poster['type'] === '1') && {
262
- label: '是否启用配套背景:',
263
- ele: 'xd-radio',
264
- valueKey: 'isSupport',
265
- value: params['isSupport'] || 'Y',
266
- groupKey:'style',
267
- list: [
268
- {"label": "启用", "value": 'Y'},
269
- {"label": "禁用", "value": 'N'},
270
- ]
271
- },
272
261
  {
273
262
  ele: 'title',
274
263
  label: '广告位参数配置',
@@ -335,6 +324,19 @@ export default {
335
324
  {"label": "轮播图显示", "value": 2},
336
325
  ]
337
326
  },
327
+ params['isCarousel']=== 2 && (params.poster && params.poster['type'] && params.poster['type'] === '1') && {
328
+ label: '是否启用配套背景:',
329
+ ele: 'xd-radio',
330
+ valueKey: 'isSupport',
331
+ value: params['isSupport'] || 'Y',
332
+ groupKey:'content',
333
+ list: [
334
+ {"label": "启用", "value": 'Y'},
335
+ {"label": "禁用", "value": 'N'},
336
+ ],
337
+ inline: false,
338
+ notice: '广告位使用轮播图模式,每个页面中<span style="color:red">仅允许一个广告位启用配套背景功能</span>,否则无法达到效果。',
339
+ },
338
340
  params['isCarousel'] === 2 && {
339
341
  label: '广告位轮播周期:',
340
342
  ele: 'el-input',
@@ -577,7 +577,9 @@
577
577
  this.padding = 20;
578
578
  }
579
579
  this.rows = getContainerPropsValue(container, 'content.rows', 1);
580
- if(this.posterType === '1' && this.isCarousel === 2) this.isSupport = getContainerPropsValue(container, 'content.isSupport', 'Y');
580
+ if(this.posterType === '1' && this.isCarousel === 2) {
581
+ this.isSupport = getContainerPropsValue(container, 'content.isSupport', 'Y');
582
+ }
581
583
  this.mS = getContainerPropsValue(container, 'content.margin', {});
582
584
  this.background = getContainerPropsValue(container, "content.background", '');
583
585
  this.bgImagePadding = getContainerPropsValue(container, 'content.bgImagePadding', {});
@@ -50,4 +50,25 @@ module.exports = [
50
50
  isConsole: true,
51
51
  disabled: true,
52
52
  },
53
+ {
54
+ mapFnName: "cardRechargeNew",
55
+ title: "获取卡券套餐列表",
56
+ path: "/card/v1/new-card-recharge/create-order",
57
+ isRule: false,
58
+ data: {
59
+ package_id: ['套餐ID', "String", "必填"]
60
+ },
61
+ isConsole: true,
62
+ disabled: true
63
+ },
64
+ {
65
+ mapFnName: "cardRechargeList",
66
+ title: "卡券充值下单",
67
+ path: "/card/v1/new-card-recharge/list",
68
+ isRule: false,
69
+ params: {},
70
+ isConsole: true,
71
+ disabled: true
72
+ },
73
+
53
74
  ];
@@ -27,7 +27,6 @@ export default {
27
27
  placeholder: '请输入票券充值点数自定义文案',
28
28
  className: 'input80'
29
29
  },
30
-
31
30
  {
32
31
  label: '注意事项:',
33
32
  ele: 'xd-site-news',
@@ -14,43 +14,47 @@
14
14
  </view>
15
15
  <!-- #endif -->
16
16
  <view class="jfb-base-recharge__body">
17
- <view class="jfb-base-recharge__body-card">
18
- <view>
19
- <view class="jfb-base-recharge__body-form">
20
- <input v-model="cardNumber" :placeholder="card_num_placeholder" />
17
+ <view class="recharge">
18
+ <view class="recharge-list">
19
+ <view class="recharge-item">
20
+ <view class="jfb-base-recharge__body-card">
21
+ <view>
22
+ <view class="jfb-base-recharge__body-form">
23
+ <input v-model="cardNumber" :placeholder="card_num_placeholder" />
24
+ </view>
25
+ <view class="jfb-base-recharge__body-form">
26
+ <input v-model="card_point" :placeholder="point_placeholder" />
27
+ </view>
28
+ <view
29
+ v-if="amount && card_point"
30
+ :style="{
31
+ color: mainColor,
32
+ fontSize: '24rpx',
33
+ paddingBottom: '32rpx',
34
+ }"
35
+ >支付金额:{{ amount }} 元</view>
36
+ <xd-button
37
+ size="medium"
38
+ type="primary"
39
+ :bgColor="mainColor"
40
+ @click="handleToRecharge"
41
+ :disabled="!amount || !card_point || !cardNumber"
42
+ >提交</xd-button>
43
+ </view>
44
+ </view>
21
45
  </view>
22
- <view class="jfb-base-recharge__body-form">
23
- <input v-model="card_point" :placeholder="point_placeholder" />
24
- </view>
25
- <view
26
- v-if="amount&&card_point"
27
- :style="{
28
- color: mainColor,
29
- fontSize: '24rpx',
30
- paddingBottom: '32rpx',
31
- }"
32
- >
33
- 支付金额:{{ amount }} 元
34
- </view>
35
- <xd-button
36
- size="medium"
37
- type="primary"
38
- :bgColor="mainColor"
39
- @click="handleToRecharge"
40
- :disabled="!amount || !card_point || !cardNumber"
41
- >提交</xd-button>
42
46
  </view>
47
+ <view class="xd-notice-content" v-if="content">
48
+ <view>注意事项:</view>
49
+ <view v-html="content" class="prod_info"></view>
50
+ </view>
51
+ <view
52
+ v-if="isPreview && statusContent === true && content === '' "
53
+ class="xd-notice"
54
+ :style="{ color: dangerColor,fontSize: 24 + 'rpx',backgroundColor:noticeBgc }"
55
+ >注意事项未配置数据,因此改模块在正式环境将不显示</view>
56
+ <view class="bottom_btn-mask"></view>
43
57
  </view>
44
- <view class="xd-notice-content" v-if="content">
45
- <view>注意事项:</view>
46
- <view v-html="content" class="prod_info"></view>
47
- </view>
48
- <view
49
- v-if="isPreview && statusContent === true && content === '' "
50
- class="xd-notice"
51
- :style="{ color: dangerColor,fontSize: 24 + 'rpx',backgroundColor:noticeBgc }"
52
- >注意事项未配置数据,因此改模块在正式环境将不显示</view>
53
- <view class="bottom_btn-mask"></view>
54
58
  </view>
55
59
  </view>
56
60
  </template>
@@ -58,24 +62,27 @@
58
62
  <script>
59
63
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
60
64
  import XdButton from "@/components/XdButton/XdButton";
65
+ import XdUnit from "@/components/XdUnit/XdUnit.vue";
61
66
  import { jfbRootExec } from "@/utils/xd.event";
62
67
  import JfbBaseRechargeMixin from "./JfbBaseRechargeMixin";
63
68
  import { getContainerPropsValue } from "@/utils/xd.base";
64
69
  import componentsMixins from "@/mixins/componentsMixins";
65
70
  import extsMixins from "@/mixins/extsMixins";
66
71
  import Color from "color";
72
+ import getServiceUrl from "@/common/getServiceUrl";
67
73
  export default {
68
74
  name: "JfbBaseRecharge",
69
75
  components: {
70
76
  XdFontIcon,
71
77
  XdButton,
78
+ XdUnit
72
79
  },
73
80
  mixins: [componentsMixins, extsMixins, JfbBaseRechargeMixin],
74
81
  data() {
75
82
  return {
83
+ closeMask: true,
76
84
  card_num_placeholder: "",
77
85
  point_placeholder: "",
78
-
79
86
  cardNumber: "",
80
87
  card_point: "",
81
88
  payPath: "",
@@ -117,20 +124,12 @@ export default {
117
124
  * @param container {object} 业务组件对象自己
118
125
  */
119
126
  init(container) {
120
- this.card_num_placeholder = getContainerPropsValue(
121
- this.container,
122
- "content.card_num_placeholder",
123
- "输入券号"
124
- );
125
- this.point_placeholder = getContainerPropsValue(
126
- this.container,
127
- "content.point_placeholder",
128
- "充值点数"
129
- );
130
- this.payPath = getContainerPropsValue(container, "content.payPath", {
131
- value: "",
132
- }).value;
127
+ this.card_num_placeholder = getContainerPropsValue(this.container, "content.card_num_placeholder", "输入券号");
128
+ this.point_placeholder = getContainerPropsValue(this.container, "content.point_placeholder", "充值点数");
129
+ this.payPath = getContainerPropsValue(container, "content.payPath", {value: "",}).value;
133
130
  },
131
+
132
+
134
133
  getContent() {
135
134
  jfbRootExec("getListRechargeNewsContent", {
136
135
  vm: this,
@@ -149,6 +148,13 @@ export default {
149
148
  console.error(error);
150
149
  });
151
150
  },
151
+
152
+ toLink(pay_order_id, order_id){
153
+ this.$xdUniHelper.redirectTo({
154
+ url: `${this.payPath}?order_id=${pay_order_id}&main_order_id=${order_id}&type=recharge`,
155
+ }, false, true);
156
+ },
157
+
152
158
  handleToRecharge() {
153
159
  if (!this.cardNumber) {
154
160
  this.$xdAlert({ content: "请输入卡券号" });
@@ -158,7 +164,12 @@ export default {
158
164
  this.$xdAlert({ content: "请输入充值点数" });
159
165
  return;
160
166
  }
161
- // this.$xdShowLoading({})
167
+
168
+ if( this.$configProject.isPreview) {
169
+ return;
170
+ }
171
+
172
+ this.$xdShowLoading({});
162
173
  jfbRootExec("cardRecharge", {
163
174
  vm: this,
164
175
  data: {
@@ -168,41 +179,47 @@ export default {
168
179
  })
169
180
  .then((res) => {
170
181
  this.$xdHideLoading();
171
- this.$xdUniHelper.navigateTo({
172
- url: `${this.payPath}?order_id=${res.pay_order_id}&main_order_id=${res.order_id}&type=recharge`,
173
- });
182
+ this.toLink(res.pay_order_id, res.order_id)
174
183
  })
175
184
  .catch((err) => {
176
185
  this.$xdHideLoading();
177
186
  console.log(err, "err");
178
187
  });
179
188
  },
189
+
180
190
  handleGetPrice(e) {
191
+ //未填写值
181
192
  if (!this.cardNumber || !this.card_point) {
182
193
  return;
183
194
  }
184
- this.$xdShowLoading({});
195
+
196
+ //预览模式
197
+ if( this.$configProject.isPreview) {
198
+ this.amount = this.card_point;
199
+ return;
200
+ }
201
+
185
202
  jfbRootExec("getRechargeAmount", {
186
203
  vm: this,
187
204
  data: {
188
205
  card_number: this.cardNumber, //页面ID
189
- card_point: this.card_point * 100, //组件ID
206
+ card_point: this.$xdUniHelper.multiplyFloatNumber(Number(this.card_point),100), //组件ID
190
207
  },
191
208
  })
192
209
  .then((res) => {
193
- this.$xdHideLoading();
194
- this.amount = res.amount / 100;
210
+ this.amount = this.$xdUniHelper.divisionFloatNumber(res.amount ,100);
195
211
  })
196
212
  .catch((err) => {
197
- this.$xdHideLoading();
198
213
  });
199
214
  },
215
+
200
216
  onJfbUpdate(data) {
201
- this.getContent();
202
- },
203
- onJfbScroll(options) {
204
- console.log("event.onJfbScroll", options);
217
+ if( this.$configProject.isPreview) {
218
+ this.getContent();
219
+ }
220
+
205
221
  },
222
+
206
223
  onJfbShow(options) {
207
224
  this.onJfbLoad(options);
208
225
  },
@@ -219,17 +236,16 @@ export default {
219
236
  .jfb-base-recharge {
220
237
  &__body {
221
238
  &-card {
222
- box-shadow: 0px unit(16, rpx) unit(60, rpx) 0px rgba(227, 227, 227, 0.37);
223
- background: #ffffff;
224
- padding: unit(48, rpx);
225
- margin: unit(40, rpx);
239
+ box-shadow: 0 unit(16, rpx) unit(60, rpx) 0 rgba(227, 227, 227, 0.37);
226
240
  border-radius: unit(20, rpx);
241
+ background: #fff;
242
+ padding: 30rpx;
227
243
  }
228
244
  &-form {
229
245
  input {
230
246
  background: #eeeeee;
231
247
  border-radius: unit(16, rpx);
232
- padding: unit(30, rpx) unit(40, rpx);
248
+ padding: unit(30, rpx);
233
249
  margin-bottom: unit(30, rpx);
234
250
  }
235
251
  }
@@ -258,10 +274,96 @@ export default {
258
274
  }
259
275
  }
260
276
  .xd-notice {
261
- margin-top: unit(20, rpx);
277
+ margin-top: unit(40, rpx);
262
278
  padding: unit(40, rpx);
263
279
  border-radius: unit(15, rpx)
264
280
  }
265
281
  }
266
282
  }
283
+
284
+ .recharge {
285
+ padding: 30rpx;
286
+
287
+ &-tab {
288
+ height: 100rpx;
289
+ margin-bottom: 15rpx;
290
+ display:flex;
291
+ justify-content: flex-start;
292
+ align-items: center;
293
+ & > view {
294
+ margin: 0 50rpx 0 0;
295
+ font-size: 32rpx;
296
+ position: relative;
297
+ height: 100%;
298
+ line-height: 100rpx;
299
+ cursor: pointer;
300
+ }
301
+
302
+ &-index {
303
+ height: 6rpx;
304
+ overflow: hidden;
305
+ border-radius: 4rpx;
306
+ position: absolute;
307
+ left: 0;
308
+ right: 0;
309
+ bottom: 16rpx;
310
+ }
311
+ }
312
+
313
+ .recharge-pack {
314
+ height: 330rpx;
315
+ background-position: top left;
316
+ background-size: 100% 100%;
317
+ background-repeat: no-repeat;
318
+ color: #fff;
319
+ padding: 30rpx;
320
+ box-sizing: border-box;
321
+ border-radius: 16rpx;
322
+ margin-bottom: 30rpx;
323
+ &:last-child {
324
+ margin-bottom: 0;
325
+ }
326
+
327
+ & .name {
328
+ font-size: 32rpx;
329
+ font-weight: 500;
330
+ }
331
+
332
+ & .price {
333
+ font-size: 28rpx;
334
+ font-weight: 400;
335
+ padding: 20rpx 0 10rpx;
336
+ }
337
+
338
+ & .time {
339
+ font-size: 28rpx;
340
+ font-weight: 400;
341
+ }
342
+
343
+ & .line {
344
+ margin: 20rpx 0;
345
+ height: 2rpx;
346
+ background: rgba(255,255,255,.2);
347
+ }
348
+
349
+ & .buy {
350
+ display: flex;
351
+ justify-content: space-between;
352
+ align-items: center;
353
+
354
+ & > view:nth-child(2) {
355
+ height: 60rpx;
356
+ min-width: 120rpx;
357
+ text-align: center;
358
+ border-radius: 40rpx;
359
+ line-height: 60rpx;
360
+ border: 4rpx solid #fff;
361
+ padding: 0 25rpx;
362
+ font-size: 28rpx;
363
+
364
+ }
365
+ }
366
+
367
+ }
368
+ }
267
369
  </style>
@@ -1,58 +1,74 @@
1
1
  'use strict';
2
+
2
3
  /**
3
- * @description 接口配置,
4
- * 在设置方法名字当时候,别忘记加上【模块名字】:Recharge
4
+ * @description API模型
5
+ * 建议:Ffff=>模块 Xxxx=>自定义名字
6
+ * 获取单记录(getByIdFfffXxxx)
7
+ * 获取列表记录(getByListFfffXxxx)
8
+ * 添加列表记录(addFfffXxxxx)
9
+ * 删除列表记录(removeFfffXxxxx|deleteFfffXxxx)
10
+ * 更新列表记录(updateFfffXxxxx)
5
11
  * @type {*[]}
6
12
  */
7
13
  module.exports = [
8
14
  {
9
- //设置方法名字当别忘记加上【模块名字】:Recharge
10
- mapFnName: 'getRechargeByIdFilmSquate',
11
- title: '获取电影广场列表',
12
- path: '/api/account/film/list-film-square',
15
+ mapFnName: "cardRecharge",
16
+ title: "卡券充值下单",
17
+ path: "/card/v1/card-recharge/create-order",
13
18
  isRule: false,
14
- params: {
15
- last_key: ['当前页', 'Number', '必选'],
16
- page_size: ['每页数量', 'Number', '必选'],
19
+ data: {
20
+ card_number: ['卡券号', "String", "必填"],
21
+ card_point: ['充值点数 单位是分', "String", '必选']
17
22
  },
18
23
  isConsole: true,
19
- disabled: true,
24
+ disabled: true
20
25
  },
21
26
  {
22
- //设置方法名字当别忘记加上【模块名字】:Recharge
23
- mapFnName: 'updateRechargeFilmPaiqiDate',
24
- title: '更新排期',
25
- path: '/api/account/film/paiqi-date',
27
+ mapFnName: "getRechargeAmount",
28
+ title: "获得充值点数需要支付的钱",
29
+ path: "/card/v1/card-recharge/get-amount",
26
30
  isRule: false,
27
31
  params: {
28
- film_id: ['电影id', 'Number', '必选'],
29
- cinema_id: ['影院id', 'Number', '必选'],
32
+ card_number: ['卡券号', "String", "必填"],
33
+ card_point: ['充值点数 单位是分', "String", '必选']
30
34
  },
31
35
  isConsole: true,
32
- disabled: true,
36
+ disabled: true
33
37
  },
34
38
  {
35
- //设置方法名字当别忘记加上【模块名字】:Recharge
36
- mapFnName: 'removeRechargeFilmAddress',
37
- title: '删除我的配送地址',
38
- path: '/api/account/film/paiqi-date',
39
+ mapFnName: 'getListRechargeNewsContent', //自定义方法名字(必选)
40
+ title: '获取内容',
41
+ path: '/cms/v1/news-content',
39
42
  isRule: false,
40
43
  params: {
41
- film_id: ['电影id', 'Number', '必选'],
44
+ scene: ['使用场景', 'String', '选填'],
45
+ container_id: ['插件ID', 'String', '必填'],
46
+ page_id: ['页面ID', 'String', '必填'],
47
+ page_size: ['记录条数', 'Number', '必填', 1],
48
+ code: ['业务线id', 'String', '选填'],
42
49
  },
43
50
  isConsole: true,
44
51
  disabled: true,
45
52
  },
46
53
  {
47
- //设置方法名字当别忘记加上【模块名字】:Recharge
48
- mapFnName: 'addRechargeFilmcart',
49
- title: '添加购物车',
50
- path: '/api/account/film/paiqi-date',
54
+ mapFnName: "cardRechargeNew",
55
+ title: "获取卡券套餐列表",
56
+ path: "/card/v1/new-card-recharge/create-order",
51
57
  isRule: false,
52
- params: {
53
- film_id: ['电影id', 'Number', '必选'],
58
+ data: {
59
+ package_id: ['套餐ID', "String", "必填"]
54
60
  },
55
61
  isConsole: true,
56
- disabled: true,
62
+ disabled: true
63
+ },
64
+ {
65
+ mapFnName: "cardRechargeList",
66
+ title: "卡券充值下单",
67
+ path: "/card/v1/new-card-recharge/list",
68
+ isRule: false,
69
+ params: {},
70
+ isConsole: true,
71
+ disabled: true
57
72
  },
73
+
58
74
  ];