jufubao-base 1.0.209-beta5 → 1.0.210
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 +1 -0
- package/src/components/JfbBasePay/Attr.js +1 -1
- package/src/components/JfbBaseRecharge/Api.js +0 -21
- package/src/components/JfbBaseRecharge/Attr.js +1 -0
- package/src/components/JfbBaseRecharge/JfbBaseRecharge.vue +67 -169
- package/src/components/JfbBaseRechargeOrder/JfbBaseRechargeOrder.vue +2 -2
- package/src/components/JfbBaseRechargeSuccess/JfbBaseRechargeSuccess.vue +1 -1
- package/src/components/JfbBaseRechargeNew/Api.js +0 -35
- package/src/components/JfbBaseRechargeNew/Attr.js +0 -35
- package/src/components/JfbBaseRechargeNew/JfbBaseRechargeNew.vue +0 -285
- package/src/components/JfbBaseRechargeNew/JfbBaseRechargeNewLess.less +0 -79
- package/src/components/JfbBaseRechargeNew/JfbBaseRechargeNewMixin.js +0 -30
- package/src/components/JfbBaseRechargeNew/Mock.js +0 -5
package/package.json
CHANGED
|
@@ -198,11 +198,11 @@ export default {
|
|
|
198
198
|
},
|
|
199
199
|
methods: {
|
|
200
200
|
handleLabel(el){
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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,25 +50,4 @@ 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
|
-
|
|
74
53
|
];
|
|
@@ -14,47 +14,43 @@
|
|
|
14
14
|
</view>
|
|
15
15
|
<!-- #endif -->
|
|
16
16
|
<view class="jfb-base-recharge__body">
|
|
17
|
-
<view class="
|
|
18
|
-
<view
|
|
19
|
-
<view class="
|
|
20
|
-
<
|
|
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>
|
|
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" />
|
|
45
21
|
</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>
|
|
46
42
|
</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>
|
|
57
43
|
</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>
|
|
58
54
|
</view>
|
|
59
55
|
</view>
|
|
60
56
|
</template>
|
|
@@ -62,27 +58,24 @@
|
|
|
62
58
|
<script>
|
|
63
59
|
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
64
60
|
import XdButton from "@/components/XdButton/XdButton";
|
|
65
|
-
import XdUnit from "@/components/XdUnit/XdUnit.vue";
|
|
66
61
|
import { jfbRootExec } from "@/utils/xd.event";
|
|
67
62
|
import JfbBaseRechargeMixin from "./JfbBaseRechargeMixin";
|
|
68
63
|
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
69
64
|
import componentsMixins from "@/mixins/componentsMixins";
|
|
70
65
|
import extsMixins from "@/mixins/extsMixins";
|
|
71
66
|
import Color from "color";
|
|
72
|
-
import getServiceUrl from "@/common/getServiceUrl";
|
|
73
67
|
export default {
|
|
74
68
|
name: "JfbBaseRecharge",
|
|
75
69
|
components: {
|
|
76
70
|
XdFontIcon,
|
|
77
71
|
XdButton,
|
|
78
|
-
XdUnit
|
|
79
72
|
},
|
|
80
73
|
mixins: [componentsMixins, extsMixins, JfbBaseRechargeMixin],
|
|
81
74
|
data() {
|
|
82
75
|
return {
|
|
83
|
-
closeMask: true,
|
|
84
76
|
card_num_placeholder: "",
|
|
85
77
|
point_placeholder: "",
|
|
78
|
+
|
|
86
79
|
cardNumber: "",
|
|
87
80
|
card_point: "",
|
|
88
81
|
payPath: "",
|
|
@@ -124,12 +117,20 @@ export default {
|
|
|
124
117
|
* @param container {object} 业务组件对象自己
|
|
125
118
|
*/
|
|
126
119
|
init(container) {
|
|
127
|
-
this.card_num_placeholder = getContainerPropsValue(
|
|
128
|
-
|
|
129
|
-
|
|
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;
|
|
130
133
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
134
|
getContent() {
|
|
134
135
|
jfbRootExec("getListRechargeNewsContent", {
|
|
135
136
|
vm: this,
|
|
@@ -148,13 +149,6 @@ export default {
|
|
|
148
149
|
console.error(error);
|
|
149
150
|
});
|
|
150
151
|
},
|
|
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
|
-
|
|
158
152
|
handleToRecharge() {
|
|
159
153
|
if (!this.cardNumber) {
|
|
160
154
|
this.$xdAlert({ content: "请输入卡券号" });
|
|
@@ -164,12 +158,7 @@ export default {
|
|
|
164
158
|
this.$xdAlert({ content: "请输入充值点数" });
|
|
165
159
|
return;
|
|
166
160
|
}
|
|
167
|
-
|
|
168
|
-
if( this.$configProject.isPreview) {
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
this.$xdShowLoading({});
|
|
161
|
+
// this.$xdShowLoading({})
|
|
173
162
|
jfbRootExec("cardRecharge", {
|
|
174
163
|
vm: this,
|
|
175
164
|
data: {
|
|
@@ -179,47 +168,41 @@ export default {
|
|
|
179
168
|
})
|
|
180
169
|
.then((res) => {
|
|
181
170
|
this.$xdHideLoading();
|
|
182
|
-
this.
|
|
171
|
+
this.$xdUniHelper.navigateTo({
|
|
172
|
+
url: `${this.payPath}?order_id=${res.pay_order_id}&main_order_id=${res.order_id}&type=recharge`,
|
|
173
|
+
});
|
|
183
174
|
})
|
|
184
175
|
.catch((err) => {
|
|
185
176
|
this.$xdHideLoading();
|
|
186
177
|
console.log(err, "err");
|
|
187
178
|
});
|
|
188
179
|
},
|
|
189
|
-
|
|
190
180
|
handleGetPrice(e) {
|
|
191
|
-
//未填写值
|
|
192
181
|
if (!this.cardNumber || !this.card_point) {
|
|
193
182
|
return;
|
|
194
183
|
}
|
|
195
|
-
|
|
196
|
-
//预览模式
|
|
197
|
-
if( this.$configProject.isPreview) {
|
|
198
|
-
this.amount = this.card_point;
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
|
|
184
|
+
this.$xdShowLoading({});
|
|
202
185
|
jfbRootExec("getRechargeAmount", {
|
|
203
186
|
vm: this,
|
|
204
187
|
data: {
|
|
205
188
|
card_number: this.cardNumber, //页面ID
|
|
206
|
-
card_point: this
|
|
189
|
+
card_point: this.card_point * 100, //组件ID
|
|
207
190
|
},
|
|
208
191
|
})
|
|
209
192
|
.then((res) => {
|
|
210
|
-
this
|
|
193
|
+
this.$xdHideLoading();
|
|
194
|
+
this.amount = res.amount / 100;
|
|
211
195
|
})
|
|
212
196
|
.catch((err) => {
|
|
197
|
+
this.$xdHideLoading();
|
|
213
198
|
});
|
|
214
199
|
},
|
|
215
|
-
|
|
216
200
|
onJfbUpdate(data) {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
201
|
+
this.getContent();
|
|
202
|
+
},
|
|
203
|
+
onJfbScroll(options) {
|
|
204
|
+
console.log("event.onJfbScroll", options);
|
|
221
205
|
},
|
|
222
|
-
|
|
223
206
|
onJfbShow(options) {
|
|
224
207
|
this.onJfbLoad(options);
|
|
225
208
|
},
|
|
@@ -236,16 +219,17 @@ export default {
|
|
|
236
219
|
.jfb-base-recharge {
|
|
237
220
|
&__body {
|
|
238
221
|
&-card {
|
|
239
|
-
box-shadow:
|
|
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);
|
|
240
226
|
border-radius: unit(20, rpx);
|
|
241
|
-
background: #fff;
|
|
242
|
-
padding: 30rpx;
|
|
243
227
|
}
|
|
244
228
|
&-form {
|
|
245
229
|
input {
|
|
246
230
|
background: #eeeeee;
|
|
247
231
|
border-radius: unit(16, rpx);
|
|
248
|
-
padding: unit(30, rpx);
|
|
232
|
+
padding: unit(30, rpx) unit(40, rpx);
|
|
249
233
|
margin-bottom: unit(30, rpx);
|
|
250
234
|
}
|
|
251
235
|
}
|
|
@@ -274,96 +258,10 @@ export default {
|
|
|
274
258
|
}
|
|
275
259
|
}
|
|
276
260
|
.xd-notice {
|
|
277
|
-
margin-top: unit(
|
|
261
|
+
margin-top: unit(20, rpx);
|
|
278
262
|
padding: unit(40, rpx);
|
|
279
263
|
border-radius: unit(15, rpx)
|
|
280
264
|
}
|
|
281
265
|
}
|
|
282
266
|
}
|
|
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
|
-
}
|
|
369
267
|
</style>
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
size="mini"
|
|
103
103
|
type="primary"
|
|
104
104
|
:bgColor="mainColor"
|
|
105
|
-
@click
|
|
105
|
+
@click="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}`,
|
|
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}`,
|
|
119
119
|
});
|
|
120
120
|
},
|
|
121
121
|
handleToBtn(item) {
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
];
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,285 +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">
|
|
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(){
|
|
108
|
-
jfbRootExec("cardRechargeList", {
|
|
109
|
-
vm: this,
|
|
110
|
-
data: {},
|
|
111
|
-
})
|
|
112
|
-
.then((res) => {
|
|
113
|
-
this.newCardList = (res.list || []).map(item=>{
|
|
114
|
-
item['package_image'] = getServiceUrl(item['package_image']);
|
|
115
|
-
item['card_point'] = `${this.$xdUniHelper.divisionFloatNumber(item['card_point'],100)}`
|
|
116
|
-
if(item['card_unit']){
|
|
117
|
-
item['card_point'] = `${item['card_point']} ${item['card_unit']}`
|
|
118
|
-
}
|
|
119
|
-
return item;
|
|
120
|
-
});
|
|
121
|
-
})
|
|
122
|
-
.catch((error) => {
|
|
123
|
-
console.error(error);
|
|
124
|
-
});
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
handleNewBuy(item){
|
|
128
|
-
this.$xdShowLoading({});
|
|
129
|
-
jfbRootExec("cardRechargeNew", {
|
|
130
|
-
vm: this,
|
|
131
|
-
data: {
|
|
132
|
-
package_id: item.package_id,
|
|
133
|
-
},
|
|
134
|
-
})
|
|
135
|
-
.then((res) => {
|
|
136
|
-
this.$xdHideLoading();
|
|
137
|
-
this.toLink(res.pay_order_id, res.order_id)
|
|
138
|
-
})
|
|
139
|
-
.catch((err) => {
|
|
140
|
-
this.$xdHideLoading();
|
|
141
|
-
console.log(err, "err");
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
//==套餐购买=============
|
|
146
|
-
|
|
147
|
-
getContent() {
|
|
148
|
-
jfbRootExec("getListRechargeNewsContent", {
|
|
149
|
-
vm: this,
|
|
150
|
-
data: {
|
|
151
|
-
page_id: this.pageAttr["page_id"], //页面ID
|
|
152
|
-
container_id: this.containerId, //组件ID
|
|
153
|
-
},
|
|
154
|
-
})
|
|
155
|
-
.then((res) => {
|
|
156
|
-
if(res && res.list && res.list.length > 0) {
|
|
157
|
-
this.content = res.list[0].content;
|
|
158
|
-
}
|
|
159
|
-
this.statusContent = true;
|
|
160
|
-
})
|
|
161
|
-
.catch((error) => {
|
|
162
|
-
console.error(error);
|
|
163
|
-
});
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
toLink(pay_order_id, order_id){
|
|
167
|
-
if(!this.payPath) {
|
|
168
|
-
this.$xdAlert({
|
|
169
|
-
time: 3000,
|
|
170
|
-
content: '支付路径未设置,清检查配置',
|
|
171
|
-
type: 'error',
|
|
172
|
-
isClose: false
|
|
173
|
-
})
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
this.$xdUniHelper.navigateTo({
|
|
177
|
-
url: `${this.payPath}?order_id=${pay_order_id}&main_order_id=${order_id}&type=recharge`,
|
|
178
|
-
});
|
|
179
|
-
},
|
|
180
|
-
|
|
181
|
-
onJfbShow(options) {
|
|
182
|
-
this.onJfbLoad(options);
|
|
183
|
-
},
|
|
184
|
-
onJfbCustomEvent(options) {
|
|
185
|
-
console.log("event.onJfbReachBottom", options);
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
};
|
|
189
|
-
</script>
|
|
190
|
-
|
|
191
|
-
<style scoped lang="less">
|
|
192
|
-
@import "./JfbBaseRechargeNewLess.less";
|
|
193
|
-
|
|
194
|
-
.jfb-base-recharge-new {
|
|
195
|
-
&__body {
|
|
196
|
-
.recharge {
|
|
197
|
-
padding: 30rpx;
|
|
198
|
-
|
|
199
|
-
&-tab {
|
|
200
|
-
height: 100rpx;
|
|
201
|
-
margin-bottom: 15rpx;
|
|
202
|
-
display:flex;
|
|
203
|
-
justify-content: flex-start;
|
|
204
|
-
align-items: center;
|
|
205
|
-
& > view {
|
|
206
|
-
margin: 0 50rpx 0 0;
|
|
207
|
-
font-size: 32rpx;
|
|
208
|
-
position: relative;
|
|
209
|
-
height: 100%;
|
|
210
|
-
line-height: 100rpx;
|
|
211
|
-
cursor: pointer;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
&-index {
|
|
215
|
-
height: 6rpx;
|
|
216
|
-
overflow: hidden;
|
|
217
|
-
border-radius: 4rpx;
|
|
218
|
-
position: absolute;
|
|
219
|
-
left: 0;
|
|
220
|
-
right: 0;
|
|
221
|
-
bottom: 16rpx;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.recharge-pack {
|
|
226
|
-
height: 330rpx;
|
|
227
|
-
background-position: top left;
|
|
228
|
-
background-size: 100% 100%;
|
|
229
|
-
background-repeat: no-repeat;
|
|
230
|
-
color: #fff;
|
|
231
|
-
padding: 30rpx;
|
|
232
|
-
box-sizing: border-box;
|
|
233
|
-
border-radius: 16rpx;
|
|
234
|
-
margin-bottom: 30rpx;
|
|
235
|
-
&:last-child {
|
|
236
|
-
margin-bottom: 0;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
& .name {
|
|
240
|
-
font-size: 32rpx;
|
|
241
|
-
font-weight: 500;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
& .price {
|
|
245
|
-
font-size: 28rpx;
|
|
246
|
-
font-weight: 400;
|
|
247
|
-
padding: 20rpx 0 10rpx;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
& .time {
|
|
251
|
-
font-size: 28rpx;
|
|
252
|
-
font-weight: 400;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
& .line {
|
|
256
|
-
margin: 20rpx 0;
|
|
257
|
-
height: 2rpx;
|
|
258
|
-
background: rgba(255,255,255,.2);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
& .buy {
|
|
262
|
-
display: flex;
|
|
263
|
-
justify-content: space-between;
|
|
264
|
-
align-items: center;
|
|
265
|
-
|
|
266
|
-
& > view:nth-child(2) {
|
|
267
|
-
height: 60rpx;
|
|
268
|
-
min-width: 120rpx;
|
|
269
|
-
text-align: center;
|
|
270
|
-
border-radius: 40rpx;
|
|
271
|
-
line-height: 60rpx;
|
|
272
|
-
border: 4rpx solid #fff;
|
|
273
|
-
padding: 0 25rpx;
|
|
274
|
-
font-size: 28rpx;
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
</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
|
-
}
|