jufubao-base 1.0.210 → 1.0.212-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 +1 -1
- package/src/components/JfbBaseCardInfo/JfbBaseCardInfo.vue +5 -5
- package/src/components/JfbBaseNotice/Attr.js +0 -1
- package/src/components/JfbBaseRecharge/Api.js +21 -0
- package/src/components/JfbBaseRecharge/Attr.js +0 -1
- package/src/components/JfbBaseRecharge/JfbBaseRecharge.vue +169 -67
- package/src/components/JfbBaseRechargeNew/Api.js +35 -0
- package/src/components/JfbBaseRechargeNew/Attr.js +35 -0
- package/src/components/JfbBaseRechargeNew/JfbBaseRechargeNew.vue +283 -0
- package/src/components/JfbBaseRechargeNew/JfbBaseRechargeNewLess.less +79 -0
- package/src/components/JfbBaseRechargeNew/JfbBaseRechargeNewMixin.js +30 -0
- package/src/components/JfbBaseRechargeNew/Mock.js +14 -0
- package/src/components/JfbBaseRechargeOrder/JfbBaseRechargeOrder.vue +2 -2
- package/src/components/JfbBaseRechargeSuccess/JfbBaseRechargeSuccess.vue +1 -1
package/package.json
CHANGED
|
@@ -198,11 +198,11 @@ export default {
|
|
|
198
198
|
},
|
|
199
199
|
methods: {
|
|
200
200
|
handleLabel(el){
|
|
201
|
-
this.card_password_focus = false;
|
|
202
|
-
this.card_number_focus = false;
|
|
203
|
-
setTimeout(()=>{
|
|
204
|
-
|
|
205
|
-
},50)
|
|
201
|
+
// this.card_password_focus = false;
|
|
202
|
+
// this.card_number_focus = false;
|
|
203
|
+
// setTimeout(()=>{
|
|
204
|
+
// this[`${el}_focus`] = true;
|
|
205
|
+
// },50)
|
|
206
206
|
},
|
|
207
207
|
handleIcon(){
|
|
208
208
|
this.isPassword = !this.isPassword
|
|
@@ -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
|
];
|
|
@@ -14,43 +14,47 @@
|
|
|
14
14
|
</view>
|
|
15
15
|
<!-- #endif -->
|
|
16
16
|
<view class="jfb-base-recharge__body">
|
|
17
|
-
<view class="
|
|
18
|
-
<view>
|
|
19
|
-
<view class="
|
|
20
|
-
<
|
|
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
|
-
|
|
122
|
-
|
|
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.navigateTo({
|
|
154
|
+
url: `${this.payPath}?order_id=${pay_order_id}&main_order_id=${order_id}&type=recharge`,
|
|
155
|
+
});
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
206
|
+
card_point: this.$xdUniHelper.multiplyFloatNumber(Number(this.card_point),100), //组件ID
|
|
190
207
|
},
|
|
191
208
|
})
|
|
192
209
|
.then((res) => {
|
|
193
|
-
this.$
|
|
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.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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:
|
|
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)
|
|
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(
|
|
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>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description API模型
|
|
5
|
+
* 建议:Ffff=>模块 Xxxx=>自定义名字
|
|
6
|
+
* 获取单记录(getByIdFfffXxxx)
|
|
7
|
+
* 获取列表记录(getByListFfffXxxx)
|
|
8
|
+
* 添加列表记录(addFfffXxxxx)
|
|
9
|
+
* 删除列表记录(removeFfffXxxxx|deleteFfffXxxx)
|
|
10
|
+
* 更新列表记录(updateFfffXxxxx)
|
|
11
|
+
* @type {*[]}
|
|
12
|
+
*/
|
|
13
|
+
module.exports = [
|
|
14
|
+
{
|
|
15
|
+
mapFnName: "cardRechargeNew",
|
|
16
|
+
title: "获取卡券套餐列表",
|
|
17
|
+
path: "/card/v1/new-card-recharge/create-order",
|
|
18
|
+
isRule: false,
|
|
19
|
+
data: {
|
|
20
|
+
package_id: ['套餐ID', "String", "必填"]
|
|
21
|
+
},
|
|
22
|
+
isConsole: true,
|
|
23
|
+
disabled: true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
mapFnName: "cardRechargeList",
|
|
27
|
+
title: "卡券充值下单",
|
|
28
|
+
path: "/card/v1/new-card-recharge/list",
|
|
29
|
+
isRule: false,
|
|
30
|
+
params: {},
|
|
31
|
+
isConsole: true,
|
|
32
|
+
disabled: true
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description 当表单组件中有联动操作时候,使用方法进行返回
|
|
5
|
+
*/
|
|
6
|
+
export default {
|
|
7
|
+
style: [],
|
|
8
|
+
content: (data) => {
|
|
9
|
+
return [
|
|
10
|
+
0&&{
|
|
11
|
+
label: '立即购买自定义文案:',
|
|
12
|
+
ele: 'el-input',
|
|
13
|
+
type: 'text',
|
|
14
|
+
valueKey: 'buyBtnName',
|
|
15
|
+
groupKey:'content',
|
|
16
|
+
value: data.buyBtnName || '',
|
|
17
|
+
placeholder: '请输入立即购买自定义文案',
|
|
18
|
+
className: 'input80'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: '票券支付路径:',
|
|
22
|
+
ele: 'xd-select-pages-path',
|
|
23
|
+
valueKey: 'payPath',
|
|
24
|
+
groupKey:'advanced',
|
|
25
|
+
placeholder: '请选择票券支付路径',
|
|
26
|
+
value: data['payPath'] || {},
|
|
27
|
+
setting: {
|
|
28
|
+
router: XdBus.getParentApi('getPagesTree'),
|
|
29
|
+
},
|
|
30
|
+
inline: false,
|
|
31
|
+
},
|
|
32
|
+
].filter(i=>i)
|
|
33
|
+
},
|
|
34
|
+
advanced: [ ],
|
|
35
|
+
};
|
|
@@ -0,0 +1,283 @@
|
|
|
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">
|
|
18
|
+
<view class="recharge-list">
|
|
19
|
+
<view class="recharge-item">
|
|
20
|
+
<view
|
|
21
|
+
class="recharge-pack"
|
|
22
|
+
v-for="item in newCardList"
|
|
23
|
+
:key="item.package_id"
|
|
24
|
+
:style="{
|
|
25
|
+
backgroundImage: 'url('+ item['package_image'] +')',
|
|
26
|
+
color: item['package_color'] ? item['package_color']:'#fff'
|
|
27
|
+
}"
|
|
28
|
+
>
|
|
29
|
+
<view class="name">{{item.package_name}}</view>
|
|
30
|
+
<view class="price">面值:{{item.card_point}}</view>
|
|
31
|
+
<view class="time">有效期:{{item['valid_date']}}</view>
|
|
32
|
+
<view class="line"></view>
|
|
33
|
+
<view class="buy">
|
|
34
|
+
<view>
|
|
35
|
+
<xd-unit
|
|
36
|
+
:is-old="false"
|
|
37
|
+
:price="item.card_amount"
|
|
38
|
+
:color-new="item['package_color'] ? item['package_color']:'#fff'"
|
|
39
|
+
:font-size="40"
|
|
40
|
+
:icon-size=".3"
|
|
41
|
+
></xd-unit>
|
|
42
|
+
</view>
|
|
43
|
+
<view @click="handleNewBuy(item)">{{buyBtnName}}</view>
|
|
44
|
+
</view>
|
|
45
|
+
</view>
|
|
46
|
+
</view>
|
|
47
|
+
</view>
|
|
48
|
+
</view>
|
|
49
|
+
</view>
|
|
50
|
+
</view>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script>
|
|
54
|
+
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
55
|
+
import XdButton from "@/components/XdButton/XdButton";
|
|
56
|
+
import XdUnit from "@/components/XdUnit/XdUnit.vue";
|
|
57
|
+
import { jfbRootExec } from "@/utils/xd.event";
|
|
58
|
+
import JfbBaseRechargeNewMixin from "./JfbBaseRechargeNewMixin";
|
|
59
|
+
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
60
|
+
import componentsMixins from "@/mixins/componentsMixins";
|
|
61
|
+
import extsMixins from "@/mixins/extsMixins";
|
|
62
|
+
import Color from "color";
|
|
63
|
+
import getServiceUrl from "@/common/getServiceUrl";
|
|
64
|
+
export default {
|
|
65
|
+
name: "JfbBaseRechargeNew",
|
|
66
|
+
components: {
|
|
67
|
+
XdFontIcon,
|
|
68
|
+
XdButton,
|
|
69
|
+
XdUnit
|
|
70
|
+
},
|
|
71
|
+
mixins: [componentsMixins, extsMixins, JfbBaseRechargeNewMixin],
|
|
72
|
+
data() {
|
|
73
|
+
return {
|
|
74
|
+
closeMask: true,
|
|
75
|
+
isPreview: false,
|
|
76
|
+
buyBtnName: '立即购买' ,
|
|
77
|
+
newCardList:[],
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
watch: {
|
|
81
|
+
container(value,oldValue) {
|
|
82
|
+
if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
|
|
83
|
+
if (this.$configProject['isPreview']) this.init(value)
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
created() {
|
|
87
|
+
this.isPreview = this.$configProject.isPreview;
|
|
88
|
+
this.init(this.container);
|
|
89
|
+
},
|
|
90
|
+
methods: {
|
|
91
|
+
onJfbLoad(options) {
|
|
92
|
+
this.getNewCardList();
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* @description 监听事件变化
|
|
96
|
+
* @param container {object} 业务组件对象自己
|
|
97
|
+
*/
|
|
98
|
+
init(container) {
|
|
99
|
+
this.payPath = getContainerPropsValue(container, "content.payPath", {value: "",}).value;
|
|
100
|
+
this.buyBtnName = getContainerPropsValue(container, 'content.buyBtnName', '立即购买')
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
//==套餐购买=============
|
|
104
|
+
/**
|
|
105
|
+
* @description 获取套餐列表
|
|
106
|
+
*/
|
|
107
|
+
getNewCardList(reload = false){
|
|
108
|
+
if(reload) this.$xdShowLoading({});
|
|
109
|
+
jfbRootExec("cardRechargeList", {
|
|
110
|
+
vm: this,
|
|
111
|
+
data: {},
|
|
112
|
+
})
|
|
113
|
+
.then((res) => {
|
|
114
|
+
this.newCardList = (res.list || []).map(item=>{
|
|
115
|
+
item['package_image'] = getServiceUrl(item['package_image']);
|
|
116
|
+
item['card_point'] = `${this.$xdUniHelper.divisionFloatNumber(item['card_point'],100)}`
|
|
117
|
+
if(item['card_unit']){
|
|
118
|
+
item['card_point'] = `${item['card_point']} ${item['card_unit']}`
|
|
119
|
+
}
|
|
120
|
+
return item;
|
|
121
|
+
});
|
|
122
|
+
if(reload) this.$xdHideLoading();
|
|
123
|
+
})
|
|
124
|
+
.catch((error) => {
|
|
125
|
+
if(reload) this.$xdHideLoading();
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
handleNewBuy(item){
|
|
130
|
+
this.$xdShowLoading({});
|
|
131
|
+
jfbRootExec("cardRechargeNew", {
|
|
132
|
+
vm: this,
|
|
133
|
+
data: {
|
|
134
|
+
package_id: item.package_id,
|
|
135
|
+
},
|
|
136
|
+
})
|
|
137
|
+
.then((res) => {
|
|
138
|
+
this.$xdHideLoading();
|
|
139
|
+
|
|
140
|
+
//数据不存在做刷新列表
|
|
141
|
+
if(res.code === 'NotFound') {
|
|
142
|
+
this.$xdConfirm({
|
|
143
|
+
title:'温馨提示',
|
|
144
|
+
content: res.message || '记录不存在',
|
|
145
|
+
cancel: false,
|
|
146
|
+
confirmText: '我知道了',
|
|
147
|
+
success:(res)=>{
|
|
148
|
+
this.getNewCardList(true);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
this.toLink(res.pay_order_id, res.order_id)
|
|
155
|
+
})
|
|
156
|
+
.catch((err) => {
|
|
157
|
+
this.$xdHideLoading();
|
|
158
|
+
console.log(err, "err");
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
},
|
|
162
|
+
//==套餐购买=============
|
|
163
|
+
|
|
164
|
+
toLink(pay_order_id, order_id){
|
|
165
|
+
if(!this.payPath) {
|
|
166
|
+
this.$xdAlert({
|
|
167
|
+
time: 3000,
|
|
168
|
+
content: '支付路径未设置,清检查配置',
|
|
169
|
+
type: 'error',
|
|
170
|
+
isClose: false
|
|
171
|
+
})
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
this.$xdUniHelper.navigateTo({
|
|
175
|
+
url: `${this.payPath}?order_id=${pay_order_id}&main_order_id=${order_id}&type=recharge`,
|
|
176
|
+
});
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
onJfbShow(options) {
|
|
180
|
+
this.onJfbLoad(options);
|
|
181
|
+
},
|
|
182
|
+
onJfbCustomEvent(options) {
|
|
183
|
+
console.log("event.onJfbReachBottom", options);
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
</script>
|
|
188
|
+
|
|
189
|
+
<style scoped lang="less">
|
|
190
|
+
@import "./JfbBaseRechargeNewLess.less";
|
|
191
|
+
|
|
192
|
+
.jfb-base-recharge-new {
|
|
193
|
+
&__body {
|
|
194
|
+
.recharge {
|
|
195
|
+
padding: 30rpx;
|
|
196
|
+
|
|
197
|
+
&-tab {
|
|
198
|
+
height: 100rpx;
|
|
199
|
+
margin-bottom: 15rpx;
|
|
200
|
+
display:flex;
|
|
201
|
+
justify-content: flex-start;
|
|
202
|
+
align-items: center;
|
|
203
|
+
& > view {
|
|
204
|
+
margin: 0 50rpx 0 0;
|
|
205
|
+
font-size: 32rpx;
|
|
206
|
+
position: relative;
|
|
207
|
+
height: 100%;
|
|
208
|
+
line-height: 100rpx;
|
|
209
|
+
cursor: pointer;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&-index {
|
|
213
|
+
height: 6rpx;
|
|
214
|
+
overflow: hidden;
|
|
215
|
+
border-radius: 4rpx;
|
|
216
|
+
position: absolute;
|
|
217
|
+
left: 0;
|
|
218
|
+
right: 0;
|
|
219
|
+
bottom: 16rpx;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.recharge-pack {
|
|
224
|
+
height: 330rpx;
|
|
225
|
+
background-position: top left;
|
|
226
|
+
background-size: 100% 100%;
|
|
227
|
+
background-repeat: no-repeat;
|
|
228
|
+
color: #fff;
|
|
229
|
+
padding: 30rpx;
|
|
230
|
+
box-sizing: border-box;
|
|
231
|
+
border-radius: 16rpx;
|
|
232
|
+
margin-bottom: 30rpx;
|
|
233
|
+
&:last-child {
|
|
234
|
+
margin-bottom: 0;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
& .name {
|
|
238
|
+
font-size: 32rpx;
|
|
239
|
+
font-weight: 500;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
& .price {
|
|
243
|
+
font-size: 28rpx;
|
|
244
|
+
font-weight: 400;
|
|
245
|
+
padding: 20rpx 0 10rpx;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
& .time {
|
|
249
|
+
font-size: 28rpx;
|
|
250
|
+
font-weight: 400;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
& .line {
|
|
254
|
+
margin: 20rpx 0;
|
|
255
|
+
height: 2rpx;
|
|
256
|
+
background: rgba(255,255,255,.2);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
& .buy {
|
|
260
|
+
display: flex;
|
|
261
|
+
justify-content: space-between;
|
|
262
|
+
align-items: center;
|
|
263
|
+
|
|
264
|
+
& > view:nth-child(2) {
|
|
265
|
+
height: 60rpx;
|
|
266
|
+
min-width: 120rpx;
|
|
267
|
+
text-align: center;
|
|
268
|
+
border-radius: 40rpx;
|
|
269
|
+
line-height: 60rpx;
|
|
270
|
+
border: 4rpx solid #fff;
|
|
271
|
+
padding: 0 25rpx;
|
|
272
|
+
font-size: 28rpx;
|
|
273
|
+
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
</style>
|
|
@@ -0,0 +1,79 @@
|
|
|
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**/
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
cardRecharge: {"amount":10000,"request_id":"1d4ab6e96e7fd54d"},
|
|
5
|
+
cardRechargeList: {
|
|
6
|
+
"list":[
|
|
7
|
+
{"package_id":65,"package_name":"聚福宝福利卡","package_image":"\/\/sandbox-img.jufubao.cn\/uploads\/20241202\/4802cc982695196c86b7aed865cd97cb.jpg","delay_days":1,"valid_date":"2024-12-04","card_point":14000,"card_amount":1,"card_unit":"点"},
|
|
8
|
+
{"package_id":57,"package_name":"聚福宝福利礼包卡","package_image":"\/\/sandbox-img.jufubao.cn\/uploads\/20241127\/e017b49c59e929290787883947ee08f4.jpg","delay_days":2,"valid_date":"2024-12-05","card_point":200,"card_amount":200,"card_unit":"点"},
|
|
9
|
+
{"package_id":56,"package_name":"聚福宝福利礼电影卡","package_image":"\/\/sandbox-img.jufubao.cn\/uploads\/20241127\/825db706a1706fd011df3ba5bb66319a.png","delay_days":1,"valid_date":"2024-12-04","card_point":200,"card_amount":200,"card_unit":"点"},
|
|
10
|
+
{"package_id":55,"package_name":"聚福宝福利礼中秋礼品卡","package_image":"\/\/sandbox-img.jufubao.cn\/uploads\/20241127\/4946a15dab8ec885415eb9e69d09e90f.jpg","delay_days":1,"valid_date":"2024-12-04","card_point":100,"card_amount":100,"card_unit":"点"},
|
|
11
|
+
],
|
|
12
|
+
"request_id":"059b2a0cda4142f0"}
|
|
13
|
+
|
|
14
|
+
}
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
size="mini"
|
|
103
103
|
type="primary"
|
|
104
104
|
:bgColor="mainColor"
|
|
105
|
-
@click="handleToPay(item)"
|
|
105
|
+
@click.stop="handleToPay(item)"
|
|
106
106
|
>
|
|
107
107
|
{{ item.pay_status === "3007" ? "去支付" : "重新支付" }}
|
|
108
108
|
</xd-button>
|
|
@@ -293,7 +293,7 @@ export default {
|
|
|
293
293
|
},
|
|
294
294
|
handleToPay(item) {
|
|
295
295
|
this.$xdUniHelper.navigateTo({
|
|
296
|
-
url: `${this.payPath}?order_id=${item.pay_order_id}&main_order_id=${item.order_id}`,
|
|
296
|
+
url: `${this.payPath}?order_id=${item.pay_order_id}&main_order_id=${item.order_id}&type=${this.type}`,
|
|
297
297
|
});
|
|
298
298
|
},
|
|
299
299
|
handleToDetail(item) {
|
|
@@ -115,7 +115,7 @@ export default {
|
|
|
115
115
|
},
|
|
116
116
|
handleToPay() {
|
|
117
117
|
this.$xdUniHelper.navigateTo({
|
|
118
|
-
url: `${this.payPath}?order_id=${this.info.pay_order_id}&main_order_id=${this.order_id}`,
|
|
118
|
+
url: `${this.payPath}?order_id=${this.info.pay_order_id}&main_order_id=${this.order_id}&type=${this.type}`,
|
|
119
119
|
});
|
|
120
120
|
},
|
|
121
121
|
handleToBtn(item) {
|