jufubao-base 1.0.209-beta1 → 1.0.209-beta100

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.
@@ -1,468 +0,0 @@
1
- <template>
2
- <view
3
- class="jfb-base-recharge-new"
4
- @click="handleEditxSelect"
5
- :class="{ editx: isEditx && active }"
6
- >
7
- <!--#ifdef H5-->
8
- <view
9
- class="jfb-base-recharge-new__edit"
10
- :class="{ editx: isEditx && active }"
11
- v-if="isEditx && active"
12
- >
13
- <view class="jfb-base-recharge-new__edit-icon" @click="delEdit">删除</view>
14
- </view>
15
- <!-- #endif -->
16
- <view class="jfb-base-recharge-new__body">
17
- <view class="recharge" :class="{active:tabsIndex === 'old'}" >
18
- <view class="recharge-tab" v-if="tabs.length > 1">
19
- <view
20
- v-for="item in tabs"
21
- :key="item.value"
22
- @click.stop="handleTabs(item.value)"
23
- :style="{ color: tabsIndex === item.value?mainColor: '#333'}"
24
- >
25
- <text>{{item.label}}</text>
26
- <text class="recharge-tab-index" v-if="tabsIndex === item.value" :style="{background: tabsIndex === item.value?mainColor: '#fff'}"></text>
27
- </view>
28
- </view>
29
- <view class="recharge-list">
30
- <view class="recharge-item" v-if="tabsIndex === 'new'">
31
- <view
32
- class="recharge-pack"
33
- v-for="item in newCardList"
34
- :key="item.package_id"
35
- :style="{backgroundImage: 'url('+ item['package_image'] +')'}"
36
- >
37
- <view class="name">{{item.package_name}}</view>
38
- <view class="price">面值:{{item.card_point}}</view>
39
- <view class="time">有效期:{{item['valid_date']}}</view>
40
- <view class="line"></view>
41
- <view class="buy">
42
- <view>
43
- <xd-unit :is-old="false" :price="item.card_amount" color-new="#fff" :font-size="40" :icon-size=".3"></xd-unit>
44
- </view>
45
- <view @click="handleNewBuy(item)">{{buyBtnName}}</view>
46
- </view>
47
- </view>
48
- </view>
49
- <view class="recharge-item" v-if="tabsIndex === 'old'">
50
- <view class="jfb-base-recharge-new__body-card">
51
- <view>
52
- <view class="jfb-base-recharge-new__body-form">
53
- <input v-model="cardNumber" :placeholder="card_num_placeholder" />
54
- </view>
55
- <view class="jfb-base-recharge-new__body-form">
56
- <input v-model="card_point" :placeholder="point_placeholder" />
57
- </view>
58
- <view
59
- v-if="amount && card_point"
60
- :style="{
61
- color: mainColor,
62
- fontSize: '24rpx',
63
- paddingBottom: '32rpx',
64
- }"
65
- >支付金额:{{ amount }} 元</view>
66
- <xd-button
67
- size="medium"
68
- type="primary"
69
- :bgColor="mainColor"
70
- @click="handleToRecharge"
71
- :disabled="!amount || !card_point || !cardNumber"
72
- >提交</xd-button>
73
- </view>
74
- </view>
75
- </view>
76
- </view>
77
- <view class="xd-notice-content" v-if="content">
78
- <view>注意事项:</view>
79
- <view v-html="content" class="prod_info"></view>
80
- </view>
81
- <view
82
- v-if="isPreview && statusContent === true && content === '' "
83
- class="xd-notice"
84
- :style="{ color: dangerColor,fontSize: 24 + 'rpx',backgroundColor:noticeBgc }"
85
- >注意事项未配置数据,因此改模块在正式环境将不显示</view>
86
- <view class="bottom_btn-mask"></view>
87
- </view>
88
- </view>
89
- </view>
90
- </template>
91
-
92
- <script>
93
- import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
94
- import XdButton from "@/components/XdButton/XdButton";
95
- import XdUnit from "@/components/XdUnit/XdUnit.vue";
96
- import { jfbRootExec } from "@/utils/xd.event";
97
- import JfbBaseRechargeNewMixin from "./JfbBaseRechargeNewMixin";
98
- import { getContainerPropsValue } from "@/utils/xd.base";
99
- import componentsMixins from "@/mixins/componentsMixins";
100
- import extsMixins from "@/mixins/extsMixins";
101
- import Color from "color";
102
- import getServiceUrl from "@/common/getServiceUrl";
103
- export default {
104
- name: "JfbBaseRechargeNew",
105
- components: {
106
- XdFontIcon,
107
- XdButton,
108
- XdUnit
109
- },
110
- mixins: [componentsMixins, extsMixins, JfbBaseRechargeNewMixin],
111
- data() {
112
- return {
113
- closeMask: true,
114
- card_num_placeholder: "",
115
- point_placeholder: "",
116
- cardNumber: "",
117
- card_point: "",
118
- payPath: "",
119
- amount: "",
120
- timer:null,
121
-
122
- //提示文案
123
- isPreview: false,
124
- content: "",
125
- statusContent: false,
126
- noticeBgc:'',
127
-
128
- tabs: [],
129
- tabsIndex: '',
130
- buyBtnName: '立即购买' ,
131
- newCardList:[],
132
- };
133
- },
134
- watch: {
135
- container(value,oldValue) {
136
- if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
137
- if (this.$configProject['isPreview']) this.init(value)
138
- },
139
- card_point(value) {
140
- if(this.timer) clearTimeout(this.timer);
141
- this.timer = setTimeout(()=>{
142
- if (value && value != 0) {
143
- this.handleGetPrice();
144
- }
145
- }, 1000)
146
- },
147
- },
148
- created() {
149
- this.isPreview = this.$configProject.isPreview;
150
- this.noticeBgc = Color(this.dangerColor).alpha(0.1).toString();
151
- this.init(this.container);
152
- },
153
- methods: {
154
- onJfbLoad(options) {
155
- this.getContent();
156
- },
157
- /**
158
- * @description 监听事件变化
159
- * @param container {object} 业务组件对象自己
160
- */
161
- init(container) {
162
- this.card_num_placeholder = getContainerPropsValue(this.container, "content.card_num_placeholder", "输入券号");
163
- this.point_placeholder = getContainerPropsValue(this.container, "content.point_placeholder", "充值点数");
164
- this.payPath = getContainerPropsValue(container, "content.payPath", {value: "",}).value;
165
- this.buyBtnName = getContainerPropsValue(container, 'content.buyBtnName', '立即购买')
166
-
167
- //标签设置
168
- let tabs = getContainerPropsValue(container, "content.tabs", [{label:'新券购买', value:'new', check: true},{label:'旧券充值', value:'old', check: true}]);
169
- let isNewCard = false;
170
- this.tabs = tabs.filter(item=>{
171
- if(item.check && item.value === 'new') {
172
- isNewCard = true;
173
- }
174
- return item.check
175
- });
176
- if(tabs.length === 2) this.tabsIndex = 'old';
177
- else {
178
- if(tabs.length > 0) this.tabsIndex = tabs[0].value;
179
- }
180
- if(isNewCard) this.getNewCardList();
181
- },
182
-
183
- handleTabs(value){
184
- if(this.tabsIndex === value) return;
185
- this.tabsIndex = value;
186
- },
187
-
188
- //==套餐购买=============
189
- /**
190
- * @description 获取套餐列表
191
- */
192
- getNewCardList(){
193
- jfbRootExec("cardRechargeList", {
194
- vm: this,
195
- data: {},
196
- })
197
- .then((res) => {
198
- this.newCardList = (res.list || []).map(item=>{
199
- item['package_image'] = getServiceUrl(item['package_image']);
200
- item['card_point'] = `${this.$xdUniHelper.divisionFloatNumber(item['card_point'],100)}`
201
- if(item['card_unit']){
202
- item['card_point'] = `${item['card_point']} ${item['card_unit']}`
203
- }
204
- return item;
205
- });
206
- })
207
- .catch((error) => {
208
- console.error(error);
209
- });
210
- },
211
-
212
- handleNewBuy(item){
213
- this.$xdShowLoading({});
214
- jfbRootExec("cardRechargeNew", {
215
- vm: this,
216
- data: {
217
- package_id: item.package_id,
218
- },
219
- })
220
- .then((res) => {
221
- this.$xdHideLoading();
222
- this.toLink(res.pay_order_id, res.order_id)
223
- })
224
- .catch((err) => {
225
- this.$xdHideLoading();
226
- console.log(err, "err");
227
- });
228
-
229
- },
230
- //==套餐购买=============
231
-
232
- getContent() {
233
- jfbRootExec("getListRechargeNewsContent", {
234
- vm: this,
235
- data: {
236
- page_id: this.pageAttr["page_id"], //页面ID
237
- container_id: this.containerId, //组件ID
238
- },
239
- })
240
- .then((res) => {
241
- if(res && res.list && res.list.length > 0) {
242
- this.content = res.list[0].content;
243
- }
244
- this.statusContent = true;
245
- })
246
- .catch((error) => {
247
- console.error(error);
248
- });
249
- },
250
-
251
- toLink(pay_order_id, order_id){
252
- this.$xdUniHelper.redirectTo({
253
- url: `${this.payPath}?order_id=${pay_order_id}&main_order_id=${order_id}&type=recharge`,
254
- }, false, true);
255
- },
256
-
257
- handleToRecharge() {
258
- if (!this.cardNumber) {
259
- this.$xdAlert({ content: "请输入卡券号" });
260
- return;
261
- }
262
- if (!this.card_point) {
263
- this.$xdAlert({ content: "请输入充值点数" });
264
- return;
265
- }
266
-
267
- if( this.$configProject.isPreview) {
268
- return;
269
- }
270
-
271
- this.$xdShowLoading({});
272
- jfbRootExec("cardRecharge", {
273
- vm: this,
274
- data: {
275
- card_number: this.cardNumber, //页面ID
276
- card_point: this.card_point * 100, //组件ID
277
- },
278
- })
279
- .then((res) => {
280
- this.$xdHideLoading();
281
- this.toLink(res.pay_order_id, res.order_id)
282
- })
283
- .catch((err) => {
284
- this.$xdHideLoading();
285
- console.log(err, "err");
286
- });
287
- },
288
-
289
- handleGetPrice(e) {
290
- //未填写值
291
- if (!this.cardNumber || !this.card_point) {
292
- return;
293
- }
294
-
295
- //预览模式
296
- if( this.$configProject.isPreview) {
297
- this.amount = this.card_point;
298
- return;
299
- }
300
-
301
- jfbRootExec("getRechargeAmount", {
302
- vm: this,
303
- data: {
304
- card_number: this.cardNumber, //页面ID
305
- card_point: this.$xdUniHelper.multiplyFloatNumber(Number(this.card_point),100), //组件ID
306
- },
307
- })
308
- .then((res) => {
309
- this.amount = this.$xdUniHelper.divisionFloatNumber(res.amount ,100);
310
- })
311
- .catch((err) => {
312
- });
313
- },
314
-
315
- onJfbUpdate(data) {
316
- if( this.$configProject.isPreview) {
317
- this.getContent();
318
- }
319
-
320
- },
321
-
322
- onJfbShow(options) {
323
- this.onJfbLoad(options);
324
- },
325
- onJfbCustomEvent(options) {
326
- console.log("event.onJfbReachBottom", options);
327
- },
328
- },
329
- };
330
- </script>
331
-
332
- <style scoped lang="less">
333
- @import "./JfbBaseRechargeNewLess.less";
334
-
335
- .jfb-base-recharge-new {
336
- &__body {
337
- &-card {
338
- box-shadow: 0 unit(16, rpx) unit(60, rpx) 0 rgba(227, 227, 227, 0.37);
339
- border-radius: unit(20, rpx);
340
- background: #fff;
341
- padding: 30rpx;
342
- }
343
- &-form {
344
- input {
345
- background: #eeeeee;
346
- border-radius: unit(16, rpx);
347
- padding: unit(30, rpx);
348
- margin-bottom: unit(30, rpx);
349
- }
350
- }
351
-
352
- .xd-notice-content {
353
- padding: 0 40rpx 40rpx 40rpx;
354
- & > view:first-child {
355
- font-size: 32rpx;
356
- font-weight: 500;
357
- color: #333;
358
- margin-bottom: 20rpx;
359
- }
360
- & > view:last-child {
361
- line-height: 44rpx;
362
- font-size: 26rpx;
363
- color: #666;
364
- /deep/ img, /deep/ image{
365
- max-width: 100% !important;
366
- height: auto !important;
367
- margin: 22rpx 0;
368
- }
369
-
370
- /deep/ *{
371
- max-width: 100% !important;
372
- }
373
- }
374
- }
375
- .xd-notice {
376
- margin-top: unit(40, rpx);
377
- padding: unit(40, rpx);
378
- border-radius: unit(15, rpx)
379
- }
380
- }
381
- }
382
-
383
- .recharge {
384
- padding: 30rpx;
385
-
386
- &-tab {
387
- height: 100rpx;
388
- margin-bottom: 15rpx;
389
- display:flex;
390
- justify-content: flex-start;
391
- align-items: center;
392
- & > view {
393
- margin: 0 50rpx 0 0;
394
- font-size: 32rpx;
395
- position: relative;
396
- height: 100%;
397
- line-height: 100rpx;
398
- cursor: pointer;
399
- }
400
-
401
- &-index {
402
- height: 6rpx;
403
- overflow: hidden;
404
- border-radius: 4rpx;
405
- position: absolute;
406
- left: 0;
407
- right: 0;
408
- bottom: 16rpx;
409
- }
410
- }
411
-
412
- .recharge-pack {
413
- height: 330rpx;
414
- background-position: top left;
415
- background-size: 100% 100%;
416
- background-repeat: no-repeat;
417
- color: #fff;
418
- padding: 30rpx;
419
- box-sizing: border-box;
420
- border-radius: 16rpx;
421
- margin-bottom: 30rpx;
422
- &:last-child {
423
- margin-bottom: 0;
424
- }
425
-
426
- & .name {
427
- font-size: 32rpx;
428
- font-weight: 500;
429
- }
430
-
431
- & .price {
432
- font-size: 28rpx;
433
- font-weight: 400;
434
- padding: 20rpx 0 10rpx;
435
- }
436
-
437
- & .time {
438
- font-size: 28rpx;
439
- font-weight: 400;
440
- }
441
-
442
- & .line {
443
- margin: 20rpx 0;
444
- height: 2rpx;
445
- background: rgba(255,255,255,.2);
446
- }
447
-
448
- & .buy {
449
- display: flex;
450
- justify-content: space-between;
451
- align-items: center;
452
-
453
- & > view:nth-child(2) {
454
- height: 60rpx;
455
- min-width: 120rpx;
456
- text-align: center;
457
- border-radius: 40rpx;
458
- line-height: 60rpx;
459
- border: 4rpx solid #fff;
460
- padding: 0 25rpx;
461
- font-size: 28rpx;
462
-
463
- }
464
- }
465
-
466
- }
467
- }
468
- </style>
@@ -1,79 +0,0 @@
1
- /**
2
- * @desc 获取绝对路径完整地址
3
- * @param @path
4
- **/
5
- //例如:https://image.jufubao.cn/20220501010108/image/bg/default_gonghui_bg.png
6
- @basePath: 'business/';
7
- @doMain: '//sandbox-img.jufubao.cn/';
8
-
9
- .getBusinessImageUrl(@path, @size: 'size8') {
10
- @url: "@{doMain}@{basePath}@{path}?x-oss-process=style/@{size}";
11
- background-image: url(@url);
12
- }
13
-
14
- //start
15
- .jfb-base-recharge-new {
16
- box-sizing: border-box;
17
-
18
- &__body{
19
- position: relative;
20
- overflow: hidden;
21
- z-index: 2
22
- }
23
-
24
- &.editx,&.editx:hover {
25
- position: relative;
26
- min-height: unit(100, rpx);
27
- z-index: 3;
28
- &::after {
29
- border: 2rpx dashed blue;
30
- content: " ";
31
- position: absolute;
32
- top:0;
33
- left:0;
34
- bottom:0;
35
- right:0;
36
- z-index: 4;
37
- cursor: pointer;
38
- }
39
-
40
- }
41
-
42
-
43
- &__edit {
44
- cursor: pointer;
45
- position: absolute;
46
- right: unit(0, rpx);
47
- top: unit(-52, rpx);
48
- height: unit(50, rpx);
49
- line-height: unit(50, rpx);
50
- display: flex;
51
- justify-content: center;
52
- align-items: center;
53
- background: rgba(0, 0, 0, .6);
54
- border-radius: unit(10, rpx);
55
- box-shadow: 0 0 10px rbga(0, 0, 0, 0.3);
56
- color: #fff;
57
- font-size: unit(22, rpx);
58
-
59
- &-icon{
60
- padding: 0 unit(20, rpx);
61
- }
62
-
63
- &.editx {
64
- box-sizing: border-box;
65
-
66
- }
67
- }
68
- }
69
- //end
70
-
71
-
72
- /**notPreview**/
73
- .jfb-base-recharge-new {
74
- //&:before {
75
- //content: " ";
76
- //display: table;
77
- //}
78
- }
79
- /**endNotPreview**/
@@ -1,30 +0,0 @@
1
- 'use strict';
2
-
3
-
4
- //@AttrImport
5
- import Attr from "./Attr";
6
- //@EndAttrImport
7
-
8
-
9
- export default {
10
- data() {
11
- return {
12
- //#ifdef H5
13
-
14
- //@AttrData
15
- Attr:{}, //对外开发编辑属性
16
- //@EndAttrData
17
-
18
- // #endif
19
- cssRoot: 'jfb-base-recharge-new'
20
- }
21
- },
22
- created() {
23
-
24
- //@AttrDataCreated
25
- this.Attr = this.$xdUniHelper.customClone(Attr);
26
- //@EndAttrDataCreated
27
-
28
-
29
- },
30
- }
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- cardRecharge: {"amount":10000,"request_id":"1d4ab6e96e7fd54d"}
5
- }