jufubao-base 1.0.119-beta12 → 1.0.119-beta14

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.
@@ -2,109 +2,490 @@
2
2
  <view
3
3
  class="jfb-base-wallet-item"
4
4
  @click="handleEditxSelect"
5
- :class="{ editx : isEditx && active }"
5
+ :class="{ editx: isEditx && active }"
6
6
  >
7
7
  <!--#ifdef H5-->
8
8
  <view
9
9
  class="jfb-base-wallet-item__edit"
10
- :class="{ editx : isEditx && active }"
10
+ :class="{ editx: isEditx && active }"
11
11
  v-if="isEditx && active"
12
12
  >
13
13
  <view class="jfb-base-wallet-item__edit-icon" @click="delEdit">删除</view>
14
14
  </view>
15
15
  <!-- #endif -->
16
- <view class="jfb-base-wallet-item__body">
17
- <view>测试插件( {{containerId}} )</view>
16
+ <view v-if="status" class="jfb-base-wallet-item__body">
17
+ <view class="jfb-base-wallet-item__body-id">
18
+ <text>账户ID:{{ walletInfo.wallet_virtual_number }}</text>
19
+ <XdFontIcon
20
+ @click="copyText(walletInfo.wallet_virtual_number)"
21
+ size="30"
22
+ icon="iconfuzhi"
23
+ ></XdFontIcon>
24
+ </view>
25
+ <view
26
+ style="padding: 32rpx 40rpx"
27
+ class="jfb-base-wallet-item__body-wrap"
28
+ >
29
+ <view class="jfb-base-wallet-item__body-header">
30
+ <view class="jfb-base-wallet-item__body-header-total">
31
+ <view>
32
+ <XdFontIcon
33
+ :icon="type === 'wallet' ? 'iconyuanbao' : 'iconjifenjilu'"
34
+ ></XdFontIcon>
35
+ <text>{{ walletInfo.wallet_name }}</text>
36
+ </view>
37
+ <view>{{ dividePrice(walletInfo.amount) }}</view>
38
+ </view>
39
+ <view style="align-items: flex-start" @click="showRule = true">
40
+ <view style="display: flex; font-size: 24rpx">
41
+ <text style="margin-right: 16rpx">使用规则</text>
42
+ <XdFontIcon
43
+ size="24"
44
+ color="#666"
45
+ icon="iconxiangyou_xian"
46
+ ></XdFontIcon>
47
+ </view>
48
+ </view>
49
+ </view>
50
+ <view class="jfb-base-wallet-item__body-bussiness">
51
+ <view>使用范围</view>
52
+ <view>{{ walletInfo.business_codes_name }}</view>
53
+ <view @click="handleToEffective">
54
+ <view :style="{ color: mainColor }">有效期列表</view>
55
+ <XdFontIcon
56
+ :style="{ color: mainColor }"
57
+ size="20"
58
+ icon="iconxiangyou_xian"
59
+ ></XdFontIcon>
60
+ </view>
61
+ </view>
62
+ </view>
63
+ <view class="jfb-base-wallet-item__body-title">收支明细</view>
64
+ <view class="jfb-base-wallet-item__body-wrap">
65
+ <view class="jfb-base-wallet-item__body-filter">
66
+ <picker
67
+ fields="month"
68
+ mode="date"
69
+ :value="date"
70
+ @change="bindDateChange"
71
+ >
72
+ <view class="jfb-base-wallet-item__body-filter-condition">
73
+ <text>全部月份</text>
74
+ <XdFontIcon size="24" icon="iconxia_down"></XdFontIcon>
75
+ </view>
76
+ </picker>
77
+ <picker
78
+ mode="selector"
79
+ range-key="label"
80
+ :value="operate_type"
81
+ :range="buySale"
82
+ @change="bindOperateChange"
83
+ >
84
+ <view class="jfb-base-wallet-item__body-filter-condition">
85
+ <text>全部收支</text>
86
+ <XdFontIcon size="24" icon="iconxia_down"></XdFontIcon>
87
+ </view>
88
+ </picker>
89
+ </view>
90
+ <view class="jfb-base-wallet-item__body-list">
91
+ <view v-if="detailList.length">
92
+ <view
93
+ v-for="(item, index) in detailList"
94
+ :key="index"
95
+ class="jfb-base-wallet-item__body-list-item"
96
+ @click="handleToBillDetail(item)"
97
+ >
98
+ <view>
99
+ <XdFontIcon
100
+ :icon="
101
+ item.operate_type === 'A' ? 'iconshouru' : 'iconzhichu'
102
+ "
103
+ ></XdFontIcon>
104
+ <text style="margin-left: 10rpx"
105
+ >消费{{ item.operate_type_name }}</text
106
+ >
107
+ </view>
108
+ <view>
109
+ <view
110
+ >{{ item.operate_type === "A" ? "+" : "-" }}
111
+ {{ dividePrice(item.amount) }}</view
112
+ >
113
+ <view>{{ item.created_time }}</view>
114
+ </view>
115
+ </view></view
116
+ >
117
+
118
+ <view class="jfb-base-wallet-item__body-list-empty" v-else
119
+ >暂无数据</view
120
+ >
121
+ </view>
122
+ </view>
123
+ <XdDailog
124
+ @onBtn="handleConfirm"
125
+ confirmText="知道了"
126
+ :showClose="false"
127
+ :cancel="false"
128
+ :show.sync="showRule"
129
+ title="元宝使用原则"
130
+ >
131
+ <XdContentXss :html="walletInfo.wallet_rule"></XdContentXss>
132
+ </XdDailog>
18
133
  </view>
19
134
  </view>
20
135
  </template>
21
136
 
22
137
  <script>
23
- import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
24
- import { jfbRootExec } from "@/utils/xd.event";
25
- import JfbBaseWalletItemMixin from "./JfbBaseWalletItemMixin";
26
- import { getContainerPropsValue } from "@/utils/xd.base";
27
- import componentsMixins from "@/mixins/componentsMixins";
28
- import extsMixins from "@/mixins/extsMixins";
29
- export default {
30
- name: "JfbBaseWalletItem",
31
- components: {
32
- XdFontIcon
33
- },
34
- mixins: [
35
- componentsMixins, extsMixins, JfbBaseWalletItemMixin
36
- ],
37
- data() {
38
- return {
138
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
139
+ import XdDailog from "@/components/XdDailog/XdDailog";
140
+ import XdContentXss from "@/components/XdContentXss/XdContentXss";
141
+ import { jfbRootExec } from "@/utils/xd.event";
142
+ import JfbBaseWalletItemMixin from "./JfbBaseWalletItemMixin";
143
+ import { getContainerPropsValue } from "@/utils/xd.base";
144
+ import componentsMixins from "@/mixins/componentsMixins";
145
+ import extsMixins from "@/mixins/extsMixins";
146
+ export default {
147
+ name: "JfbBaseWalletItem",
148
+ components: {
149
+ XdFontIcon,
150
+ XdDailog,
151
+ XdContentXss,
152
+ },
153
+ mixins: [componentsMixins, extsMixins, JfbBaseWalletItemMixin],
154
+ data() {
155
+ return {
156
+ billDetailPath: "",
157
+ effectivePath: "",
158
+ detailList: [],
159
+ hasNext: true,
160
+ next_page_token: "",
161
+ page_size: 10,
162
+ page_token: 1,
163
+ showRule: false,
164
+ rules: "",
165
+ type: "",
166
+ buySale: [
167
+ {
168
+ label: "全部",
169
+ value: "",
170
+ },
171
+ {
172
+ label: "支出",
173
+ value: "R",
174
+ },
175
+ {
176
+ label: "收入",
177
+ value: "A",
178
+ },
179
+ ],
180
+ date: "",
181
+ operate_type: "",
182
+ wallet_type: "",
183
+ walletInfo: {},
184
+ status: false,
185
+ };
186
+ },
187
+ watch: {
188
+ container(value) {
189
+ this.init(value);
190
+ },
191
+ },
192
+ created() {
193
+ this.init(this.container);
39
194
 
40
- //todo
41
- }
195
+ //todo
196
+ },
197
+ methods: {
198
+ async onJfbLoad(options) {
199
+ this.type = options.type;
200
+ this.wallet_type = options.wallet_type;
201
+ await jfbRootExec("getWalletDetail", {
202
+ vm: this,
203
+ data: {
204
+ wallet_type: this.wallet_type,
205
+ },
206
+ })
207
+ .then((res) => {
208
+ this.walletInfo = res.wallet;
209
+ if (this.walletInfo.business_codes_name) {
210
+ const codes = this.walletInfo.business_codes_name.split(",");
211
+ const newCodes = codes.map((code) => code.trim()).join("、");
212
+ this.walletInfo.business_codes_name = newCodes;
213
+ }
214
+ })
215
+ .catch(this.$xdLog.catch);
216
+ await this.getList();
217
+ this.status = true;
42
218
  },
43
- watch: {
44
- container(value) {
45
- this.init(value)
46
- }
219
+ getList() {
220
+ jfbRootExec("getWalletRecordList", {
221
+ vm: this,
222
+ data: {
223
+ support_method: this.type,
224
+ month: this.date,
225
+ page_size: this.page_size,
226
+ page_token: this.page_token,
227
+ operate_type: this.operate_type,
228
+ },
229
+ })
230
+ .then((res) => {
231
+ try {
232
+ let list = res.list.map((item) => {
233
+ const timestamp = item.created_time * 1000;
234
+ const date = new Date(timestamp);
235
+ const year = date.getFullYear();
236
+ const month = ("0" + (date.getMonth() + 1)).slice(-2);
237
+ const day = ("0" + date.getDate()).slice(-2);
238
+ const hours = ("0" + date.getHours()).slice(-2);
239
+ const minutes = ("0" + date.getMinutes()).slice(-2);
240
+ const seconds = ("0" + date.getSeconds()).slice(-2);
241
+ const formattedDate =
242
+ year +
243
+ "-" +
244
+ month +
245
+ "-" +
246
+ day +
247
+ " " +
248
+ hours +
249
+ ":" +
250
+ minutes +
251
+ ":" +
252
+ seconds;
253
+ item.created_time = formattedDate;
254
+ return item;
255
+ });
256
+ if (this.page_token === 1) {
257
+ this.detailList = list;
258
+ } else {
259
+ this.detailList = this.detailList.concat(list);
260
+ }
261
+ this.hasNext = res.next_page_token !== "";
262
+ this.next_page_token = res.next_page_token;
263
+ } catch (error) {
264
+ console.log(error, "alaakakakak");
265
+ }
266
+ })
267
+ .catch(this.$xdLog.catch);
47
268
  },
48
- created() {
49
- this.init(this.container);
50
-
51
- //todo
269
+ dividePrice(num) {
270
+ return this.$xdUniHelper.divisionFloatNumber(num, 100);
52
271
  },
53
- methods: {
54
- onJfbLoad(options) {
55
-
56
- // jfbRootExec('baiduUserLogin', {
57
-
58
- // vm: this,// data: {
59
-
60
- // account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
61
-
62
- // }
63
-
64
- // }).then().catch()
65
- },
66
- /**
67
- * @description 监听事件变化
68
- * @param container {object} 业务组件对象自己
69
- */
70
- init(container) {
71
-
72
- //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
73
-
74
- //this.height = getContainerPropsValue(container, 'content.height', 10);
75
- },
76
- onJfbScroll(options) {
77
- console.log('event.onJfbScroll', options)
78
- },
79
- onJfbReachBottom(options) {
80
- console.log('event.onJfbReachBottom', options)
81
- },
82
- onJfbShow(options) {
83
- console.log('event.onJfbShow', options)
84
- },
85
- onJfbHide(options) {
86
- console.log('event.onJfbHide', options)
87
- },
88
- onJfbBack(options) {
89
- console.log('event.onJfbBack', options)
90
- },
91
- onJfbUpdate(...data) {
92
- console.log('event.onJfbUpdate', data)
93
- },
94
- onJfbCustomEvent(options) {
95
- console.log('event.onJfbReachBottom', options)
96
- },
97
- }
98
- }
272
+ bindDateChange(e) {
273
+ console.log(e, "mmmmmm");
99
274
 
275
+ //调用搜索
276
+ this.detailList = [];
277
+ this.page_token = 1;
278
+ this.hasNext = true;
279
+ this.date = e.detail.value;
280
+ this.getList();
281
+ },
282
+ bindOperateChange(e) {
283
+ //调用搜索
284
+ this.detailList = [];
285
+ this.page_token = 1;
286
+ this.hasNext = true;
287
+ this.operate_type = this.buySale[e.detail.value].value;
288
+ this.getList();
289
+ },
290
+ // 复制文案函数
291
+ copyText(text) {
292
+ // 设置剪贴板数据
293
+ uni.setClipboardData({
294
+ data: text,
295
+ success: function () {
296
+ // 复制成功,提示用户
297
+ uni.showToast({
298
+ title: "复制成功",
299
+ icon: "success",
300
+ });
301
+ },
302
+ fail: function () {
303
+ // 复制失败,提示用户
304
+ uni.showToast({
305
+ title: "复制失败",
306
+ icon: "none",
307
+ });
308
+ },
309
+ });
310
+ },
311
+ handleToBillDetail(item) {
312
+ this.$xdUniHelper.navigateTo({
313
+ url: `${this.billDetailPath}?trade_id=${item.trade_id}`,
314
+ });
315
+ },
316
+ handleConfirm(status) {
317
+ this.showRule = false;
318
+ },
319
+ handleToEffective(item) {
320
+ this.$xdUniHelper.navigateTo({
321
+ url: `${this.effectivePath}?wallet_type=${this.wallet_type}&type=${this.type}`,
322
+ });
323
+ },
324
+ /**
325
+ * @description 监听事件变化
326
+ * @param container {object} 业务组件对象自己
327
+ */
328
+ init(container) {
329
+ this.billDetailPath = getContainerPropsValue(
330
+ container,
331
+ "content.billDetailPath",
332
+ {
333
+ value: "",
334
+ }
335
+ ).value;
336
+ this.effectivePath = getContainerPropsValue(
337
+ container,
338
+ "content.effectivePath",
339
+ {
340
+ value: "",
341
+ }
342
+ ).value;
343
+ },
344
+ onJfbScroll(options) {
345
+ console.log("event.onJfbScroll", options);
346
+ },
347
+ onJfbReachBottom(options) {
348
+ console.log("1111");
349
+ if (this.hasNext) {
350
+ this.page_token = this.next_page_token;
351
+ this.getList();
352
+ }
353
+ },
354
+ onJfbShow(options) {
355
+ console.log("event.onJfbShow", options);
356
+ },
357
+ onJfbHide(options) {
358
+ console.log("event.onJfbHide", options);
359
+ },
360
+ onJfbBack(options) {
361
+ console.log("event.onJfbBack", options);
362
+ },
363
+ onJfbUpdate(...data) {
364
+ console.log("event.onJfbUpdate", data);
365
+ },
366
+ onJfbCustomEvent(options) {
367
+ console.log("event.onJfbReachBottom", options);
368
+ },
369
+ },
370
+ };
100
371
  </script>
101
372
 
102
373
  <style scoped lang="less">
103
- @import "./JfbBaseWalletItemLess.less";
104
-
105
- .jfb-base-wallet-item {
106
- &__body{
374
+ @import "./JfbBaseWalletItemLess.less";
107
375
 
376
+ .jfb-base-wallet-item {
377
+ &__body {
378
+ &-wrap {
379
+ border-radius: 20rpx;
380
+ background: #ffffff;
381
+ border: 1rpx solid #eeeeee;
382
+ margin: 20rpx 20rpx 0 20rpx;
383
+ }
384
+ &-header {
385
+ display: flex;
386
+ justify-content: space-between;
387
+ font-size: 28rpx;
388
+ color: #333333;
389
+ border-bottom: 1px solid #eee;
390
+ padding-bottom: 28rpx;
391
+ &-total {
392
+ & > view:first-child {
393
+ display: flex;
394
+ align-items: center;
395
+ font-size: 24rpx;
396
+ & > text {
397
+ margin-left: 10rpx;
398
+ }
399
+ }
400
+ & > view:last-child {
401
+ font-size: 64rpx;
402
+ color: #333;
403
+ }
404
+ }
405
+ }
406
+ &-bussiness {
407
+ padding: 24rpx 0 0 0;
408
+ font-size: 24rpx;
409
+ & > view:first-child {
410
+ color: #666;
411
+ }
412
+ & > view:nth-child(2) {
413
+ color: #999;
414
+ font-size: 22rpx;
415
+ padding: 24rpx 0;
416
+ }
417
+ & > view:nth-child(3) {
418
+ display: flex;
419
+ justify-content: space-between;
420
+ align-items: center;
421
+ }
422
+ }
423
+ &-id {
424
+ display: flex;
425
+ align-items: center;
426
+ padding: 40rpx 60rpx;
427
+ font-size: 28rpx;
428
+ color: #333;
429
+ & > text {
430
+ margin-right: 30rpx;
431
+ }
432
+ }
433
+ &-title {
434
+ font-size: 28rpx;
435
+ padding: 40rpx 60rpx 20rpx 60rpx;
436
+ }
437
+ &-filter {
438
+ display: flex;
439
+ justify-content: space-around;
440
+ padding: 40rpx 0;
441
+ border-bottom: 2rpx solid #eee;
442
+ color: #666666;
443
+ font-size: 24rpx;
444
+ &-condition {
445
+ display: flex;
446
+ align-items: center;
447
+ font-size: 28rpx;
448
+ & > text {
449
+ margin-right: 10rpx;
450
+ }
451
+ }
452
+ }
453
+ &-list {
454
+ padding: 40rpx 40rpx 0 40rpx;
455
+ color: #333;
456
+ &-empty {
457
+ display: flex;
458
+ justify-content: center;
459
+ align-items: center;
460
+ padding-bottom: 40rpx;
461
+ color: #999;
462
+ font-size: 28rpx;
463
+ }
464
+ &-item {
465
+ display: flex;
466
+ justify-content: space-between;
467
+ padding-bottom: 40rpx;
468
+ & > view:first-child {
469
+ display: flex;
470
+ align-items: center;
471
+ text-align: left;
472
+ font-size: 28rpx;
473
+ }
474
+ & > view:nth-child(2) {
475
+ & > view:first-child {
476
+ color: #666;
477
+ font-size: 32rpx;
478
+ font-weight: 700;
479
+ text-align: right;
480
+ }
481
+ & > view:nth-child(2) {
482
+ color: #999;
483
+ font-size: 22rpx;
484
+ margin-top: 24rpx;
485
+ }
486
+ }
487
+ }
108
488
  }
109
489
  }
490
+ }
110
491
  </style>
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  module.exports = {
4
- aaaa: {}
4
+ getWalletDetail: {"wallet":{"wallet_type":"UB","wallet_name":"福利宝","wallet_virtual_number":"1000000000000244","amount":100000,"business_codes":"cake","business_codes_name":"蛋糕(勿改)","wallet_rule":"UB使用规则说明"},"request_id":"fa4e778c1443dcda"},
5
+ getWalletRecordList: {"next_page_token":"","total_size":0,"list":[{"trade_id":"8ICccHHNMFVyGvnetIkJU","partner_id":0,"site_id":"","amount":100000,"wallet_type":"UC","operate_type":"A","operate_type_name":"收入","trade_type":"recharge","trade_type_name":"充值","comment":"","created_time":1711421305},{"trade_id":"oxbU0hZYtaWZDnwn-ddtr","partner_id":0,"site_id":"","amount":100000,"wallet_type":"UB","operate_type":"A","operate_type_name":"收入","trade_type":"recharge","trade_type_name":"充值","comment":"","created_time":1711421282}],"request_id":"d332d6696fcc001e"}
5
6
  }