jufubao-base 1.0.302-beta1 → 1.0.302-beta2

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,110 +2,452 @@
2
2
  <view
3
3
  class="jfb-base-invoice-detail"
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-invoice-detail__edit"
10
- :class="{ editx : isEditx && active }"
10
+ :class="{ editx: isEditx && active }"
11
11
  v-if="isEditx && active"
12
12
  >
13
- <view class="jfb-base-invoice-detail__edit-icon" @click="delEdit">删除</view>
13
+ <view class="jfb-base-invoice-detail__edit-icon" @click="delEdit"
14
+ >删除</view
15
+ >
14
16
  </view>
15
17
  <!-- #endif -->
16
- <view class="jfb-base-invoice-detail__body">
17
- <view>测试插件( {{containerId}} )</view>
18
+ <view
19
+ v-if="info && info !== null"
20
+ class="jfb-base-invoice-detail__body"
21
+ :style="{ minHeight: layoutInfo.bodyMinHeightRpx + 'rpx' }"
22
+ >
23
+ <view :style="[statusStyle]" class="jfb-base-invoice-detail__body-status">
24
+ <view class="jfb-base-invoice-detail__body-status-name"
25
+ ><XdFontIcon
26
+ :icon="info.status === 'P' ? 'icondengdai' : 'icondui_fill'"
27
+ ></XdFontIcon>
28
+ <view>{{ info.status_name }}</view></view
29
+ >
30
+ <view
31
+ v-if="info.status === 'P'"
32
+ class="jfb-base-invoice-detail__body-status-text"
33
+ >{{ info.status_desc }}</view
34
+ >
35
+ <view
36
+ v-else-if="info.status === 'Y'"
37
+ class="jfb-base-invoice-detail__body-status-text"
38
+ >已开发票金额:<xd-unit
39
+ :isOld="false"
40
+ :price="info.invoice_amount"
41
+ ></xd-unit
42
+ ></view>
43
+ </view>
44
+ <view class="jfb-base-invoice-detail__body-content">
45
+ <view class="jfb-base-invoice-detail__body-content-item">
46
+ <view class="jfb-base-invoice-detail__body-content-item-info">
47
+ <view>开票金额</view>
48
+ <XdUnit :isOld="false" :price="info.invoice_amount"></XdUnit>
49
+ </view>
50
+ <view class="jfb-base-invoice-detail__body-content-item-info">
51
+ <view>发票类型</view>
52
+ <view>(普通发票)数电发票</view>
53
+ </view>
54
+ </view>
55
+ <view
56
+ style="margin-top: 24rpx"
57
+ class="jfb-base-invoice-detail__body-content-item"
58
+ >
59
+ <view
60
+ v-if="info.status === 'Y'"
61
+ class="jfb-base-invoice-detail__body-content-item-info"
62
+ >
63
+ <view>发票内容</view>
64
+ <view>{{ info.content_type_name }}</view>
65
+ </view>
66
+ <view class="jfb-base-invoice-detail__body-content-item-info">
67
+ <view>抬头类型</view>
68
+ <view>{{ info.invoice_header_type_name }}</view>
69
+ </view>
70
+ <view class="jfb-base-invoice-detail__body-content-item-info">
71
+ <view>发票抬头</view>
72
+ <view>{{ info.invoice_header }}</view>
73
+ </view>
74
+ <view class="jfb-base-invoice-detail__body-content-item-info">
75
+ <view>联系电话</view>
76
+ <view>{{ info.phone_number }}</view>
77
+ </view>
78
+ <view
79
+ v-if="info.invoice_number"
80
+ class="jfb-base-invoice-detail__body-content-item-info"
81
+ >
82
+ <view>税号</view>
83
+ <view>{{ info.invoice_number }}</view>
84
+ </view>
85
+ <view class="jfb-base-invoice-detail__body-content-item-info">
86
+ <view>接收邮箱</view>
87
+ <view>{{ info.email }}</view>
88
+ </view>
89
+ <view class="jfb-base-invoice-detail__body-content-item-info">
90
+ <view>申请时间</view>
91
+ <view>{{ info.apply_time }}</view>
92
+ </view>
93
+ <view
94
+ v-if="info.status === 'Y'"
95
+ class="jfb-base-invoice-detail__body-content-item-info"
96
+ >
97
+ <view>开票时间</view>
98
+ <view>{{ info.open_time }}</view>
99
+ </view>
100
+ </view>
101
+ </view>
102
+ <view
103
+ v-if="info.status === 'Y'"
104
+ class="jfb-base-invoice-detail__body-images"
105
+ >
106
+ <view
107
+ class="jfb-base-invoice-detail__body-images-item"
108
+ v-for="(item, index) in images"
109
+ :key="index"
110
+ >
111
+ <image @click="handlePreview(index, item)" :src="item"></image>
112
+ </view>
113
+ </view>
114
+ <view v-if="info.status === 'Y'" class="fixe_bottom" :style="prod_bottom">
115
+ <view :style="[bottomBtnWrapStyle]">
116
+ <XdButton
117
+ :wrapStyle="[wrapStyle]"
118
+ width="240rpx"
119
+ @click="handleSend"
120
+ size="small"
121
+ type="primary"
122
+ >发送邮箱</XdButton
123
+ >
124
+ </view>
125
+ </view>
126
+ <xd-dailog
127
+ title="请确认邮箱地址"
128
+ :cancel="false"
129
+ :confirm="false"
130
+ :showTitle="false"
131
+ :showClose="false"
132
+ :show.sync="showDialog"
133
+ >
134
+ <view class="dialog">
135
+ <view class="dialog-title">请确认邮箱地址</view>
136
+ <view class="dialog-content">
137
+ <input type="text" v-model="email" placeholder="请输入邮箱地址" />
138
+ </view>
139
+ <view class="dialog-footer">
140
+ <xd-button @click="handleCancel" width="220rpx" type="info"
141
+ >取消</xd-button
142
+ >
143
+ <xd-button @click="handleConfirm" width="220rpx" type="primary"
144
+ >确定</xd-button
145
+ >
146
+ </view>
147
+ </view>
148
+ </xd-dailog>
18
149
  </view>
19
150
  </view>
20
151
  </template>
21
152
 
22
153
  <script>
23
- import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
24
- import { jfbRootExec } from "@/utils/xd.event";
25
- import JfbBaseInvoiceDetailMixin from "./JfbBaseInvoiceDetailMixin";
26
- import { getContainerPropsValue } from "@/utils/xd.base";
27
- import componentsMixins from "@/mixins/componentsMixins";
28
- import extsMixins from "@/mixins/extsMixins";
29
- export default {
30
- name: "JfbBaseInvoiceDetail",
31
- components: {
32
- XdFontIcon
33
- },
34
- mixins: [
35
- componentsMixins, extsMixins, JfbBaseInvoiceDetailMixin
36
- ],
37
- data() {
154
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
155
+ import XdDailog from "@/components/XdDailog/XdDailog";
156
+ import { jfbRootExec } from "@/utils/xd.event";
157
+ import JfbBaseInvoiceDetailMixin from "./JfbBaseInvoiceDetailMixin";
158
+ import { getContainerPropsValue, gCPVal } from "@/utils/xd.base";
159
+ import componentsMixins from "@/mixins/componentsMixins";
160
+ import getServiceUrl from "@/common/getServiceUrl";
161
+ import extsMixins from "@/mixins/extsMixins";
162
+ export default {
163
+ name: "JfbBaseInvoiceDetail",
164
+ components: {
165
+ XdFontIcon,
166
+ XdDailog,
167
+ },
168
+ mixins: [componentsMixins, extsMixins, JfbBaseInvoiceDetailMixin],
169
+ data() {
170
+ return {
171
+ statusBg: "",
172
+ status: "ing",
173
+ images: [],
174
+ showDialog: false,
175
+ email: "",
176
+ main_order_id: "",
177
+ pay_order_id: "",
178
+ info: null,
179
+ };
180
+ },
181
+ computed: {
182
+ statusStyle() {
38
183
  return {
39
-
40
- //todo
41
- }
184
+ backgroundImage: `url(${this.statusBg})`,
185
+ backgroundRepeat: "no-repeat",
186
+ backgroundSize: "100% 100%",
187
+ };
42
188
  },
43
- watch: {
44
- container(value, oldValue) {
45
- if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
46
- if (this.$configProject['isPreview']) this.init(value)
47
- },
189
+ prod_bottom() {
190
+ let style = this.fixedStyle({ bottom: 0 });
191
+ return style;
48
192
  },
49
- created() {
50
- this.init(this.container);
51
-
52
- //todo
193
+ bottomBtnWrapStyle() {
194
+ let style = {
195
+ display: "flex",
196
+ "justify-content": "flex-end",
197
+ };
198
+ return style;
53
199
  },
54
- methods: {
55
- onJfbLoad(options) {
56
-
57
- // jfbRootExec('baiduUserLogin', {
58
-
59
- // vm: this,// data: {
60
-
61
- // account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
62
-
63
- // }
200
+ wrapStyle() {
201
+ let style = {
202
+ margin: 0,
203
+ };
204
+ return style;
205
+ },
206
+ },
207
+ watch: {
208
+ container(value, oldValue) {
209
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
210
+ if (this.$configProject["isPreview"]) this.init(value);
211
+ },
212
+ },
213
+ created() {
214
+ setTimeout(() => {
215
+ this.status = "success";
216
+ }, 1000);
217
+ this.init(this.container);
64
218
 
65
- // }).then().catch()
66
- },
67
- /**
68
- * @description 监听事件变化
69
- * @param container {object} 业务组件对象自己
70
- */
71
- init(container) {
219
+ //todo
220
+ },
221
+ methods: {
222
+ onJfbLoad(options) {
223
+ this.main_order_id = options.main_order_id;
224
+ this.pay_order_id = options.pay_order_id;
225
+ this.getDetail();
226
+ },
227
+ getDetail() {
228
+ jfbRootExec("userInvoiceDetail", {
229
+ vm: this,
230
+ data: {
231
+ main_order_id: this.main_order_id,
232
+ pay_order_id: this.pay_order_id,
233
+ },
234
+ })
235
+ .then((res) => {
236
+ if (res.invoice_result.apply_time) {
237
+ res.invoice_result.apply_time = this.$xdUniHelper.getDate(
238
+ res.invoice_result.apply_time * 1000
239
+ ).fullTime;
240
+ }
241
+ if (res.invoice_result.open_time) {
242
+ res.invoice_result.open_time = this.$xdUniHelper.getDate(
243
+ res.invoice_result.open_time * 1000
244
+ ).fullTime;
245
+ }
246
+ if (res.invoice_result.file_info) {
247
+ res.invoice_result.file_info = JSON.parse(res.invoice_result.file_info)
248
+ this.images= res.invoice_result.file_info.map(item=>{
249
+ return getServiceUrl(item.url,'size3')
250
+ })
251
+ }
252
+ this.info = res.invoice_result;
253
+ })
254
+ .catch();
255
+ },
256
+ /**
257
+ * @description 监听事件变化
258
+ * @param container {object} 业务组件对象自己
259
+ */
260
+ init(container) {
261
+ this.statusBg = getServiceUrl(
262
+ gCPVal(container, "statusBg", { url: "" }, {}).url
263
+ );
264
+ },
265
+ handlePreview(i, item) {
266
+ //#ifdef H5
267
+ // 调用 uni.previewImage() 方法预览图片
268
+ let images = this.images.map((item) => item);
269
+ uni.previewImage({
270
+ // 预览时,默认显示图片的索引
271
+ current: i,
272
+ indicator: "number",
273
+ // 所有图片 url 路径的数组 //这里直接把图片列表的数组放入即可
274
+ urls: images,
275
+ });
276
+ //#endif
277
+ //#ifdef MP-WEIXIN
278
+ uni.previewImage({
279
+ // 预览时,默认显示图片的索引
280
+ current: i,
281
+ indicator: "number",
282
+ // 所有图片 url 路径的数组 //这里直接把图片列表的数组放入即可
283
+ urls: this.images.map((item) => item),
284
+ });
285
+ //#endif
286
+ },
287
+ handleCancel() {
288
+ this.showDialog = false;
289
+ this.email = "";
290
+ },
291
+ handleConfirm() {
292
+ jfbRootExec("userInvoiceSend", {
293
+ vm: this,
294
+ data: {
295
+ main_order_id: this.main_order_id,
296
+ pay_order_id: this.pay_order_id,
297
+ email: this.email,
298
+ },
299
+ }).then((res) => {
300
+ this.showDialog = false;
301
+ this.email = "";
302
+ });
303
+ },
304
+ handleSend() {
305
+ this.showDialog = true;
306
+ },
307
+ onJfbScroll(options) {
308
+ console.log("event.onJfbScroll", options);
309
+ },
310
+ onJfbReachBottom(options) {
311
+ console.log("event.onJfbReachBottom", options);
312
+ },
313
+ onJfbShow(options) {
314
+ console.log("event.onJfbShow", options);
315
+ },
316
+ onJfbHide(options) {
317
+ console.log("event.onJfbHide", options);
318
+ },
319
+ onJfbBack(options) {
320
+ console.log("event.onJfbBack", options);
321
+ },
322
+ onJfbUpdate(...data) {
323
+ console.log("event.onJfbUpdate", data);
324
+ },
325
+ onJfbCustomEvent(options) {
326
+ console.log("event.onJfbReachBottom", options);
327
+ },
328
+ },
329
+ };
330
+ </script>
72
331
 
73
- //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
332
+ <style scoped lang="less">
333
+ @import "./JfbBaseInvoiceDetailLess.less";
74
334
 
75
- //this.height = getContainerPropsValue(container, 'content.height', 10);
76
- },
77
- onJfbScroll(options) {
78
- console.log('event.onJfbScroll', options)
79
- },
80
- onJfbReachBottom(options) {
81
- console.log('event.onJfbReachBottom', options)
82
- },
83
- onJfbShow(options) {
84
- console.log('event.onJfbShow', options)
85
- },
86
- onJfbHide(options) {
87
- console.log('event.onJfbHide', options)
88
- },
89
- onJfbBack(options) {
90
- console.log('event.onJfbBack', options)
91
- },
92
- onJfbUpdate(...data) {
93
- console.log('event.onJfbUpdate', data)
94
- },
95
- onJfbCustomEvent(options) {
96
- console.log('event.onJfbReachBottom', options)
97
- },
335
+ .jfb-base-invoice-detail {
336
+ &__body {
337
+ &-status {
338
+ height: 180rpx;
339
+ color: #fff;
340
+ display: flex;
341
+ flex-direction: column;
342
+ align-items: center;
343
+ justify-content: center;
344
+ &-name {
345
+ display: flex;
346
+ align-items: center;
347
+ justify-content: center;
348
+ font-size: 36rpx;
349
+ & > view {
350
+ margin-left: 16rpx;
351
+ }
352
+ }
353
+ &-text {
354
+ margin-left: 0rpx !important;
355
+ margin-top: 16rpx;
356
+ font-size: 26rpx;
357
+ display: flex;
358
+ align-items: center;
359
+ }
98
360
  }
99
- }
100
-
101
- </script>
361
+ &-content {
362
+ padding: 24rpx;
363
+ position: relative;
364
+ top: -18rpx;
365
+ border-radius: 16rpx;
366
+ background: #f8f8f8;
367
+ &-item {
368
+ background: #fff;
369
+ border-radius: 8rpx;
370
+ &-info {
371
+ padding: 20rpx 48rpx;
372
+ display: flex;
373
+ justify-content: space-between;
374
+ align-items: center;
375
+ color: #333333;
376
+ font-size: 28rpx;
377
+ border-bottom: 2rpx solid #f7f7f7;
378
+ position: relative;
379
+ }
380
+ }
381
+ }
382
+ &-images {
383
+ display: flex;
384
+ flex-wrap: wrap;
385
+ padding: 16rpx;
386
+ border-radius: 16rpx;
387
+ background: #fff;
388
+ margin: -18rpx 24rpx 24rpx 24rpx;
102
389
 
103
- <style scoped lang="less">
104
- @import "./JfbBaseInvoiceDetailLess.less";
390
+ &-item {
391
+ background: #f2f1f6;
392
+ display: flex;
393
+ align-items: center;
394
+ justify-content: center;
395
+ padding: 8rpx;
396
+ margin-right: 16rpx;
105
397
 
106
- .jfb-base-invoice-detail {
107
- &__body{
398
+ & > image {
399
+ width: 192rpx;
400
+ height: 128rpx;
401
+ }
402
+ }
403
+ &-item:nth-child(3n) {
404
+ margin-right: 0;
405
+ }
406
+ }
407
+ .fixe_bottom {
408
+ display: flex;
409
+ align-items: center;
410
+ justify-content: flex-end !important;
411
+ height: unit(100, rpx);
412
+ padding: 0 unit(40, rpx);
413
+ flex-flow: nowrap;
414
+ background: #fff;
415
+ box-shadow: 0 0 unit(16, rpx) rgba(0, 0, 0, 0.05);
416
+ .flex_l {
417
+ display: flex;
418
+ align-items: center;
419
+ font-size: unit(32, rpx);
420
+ }
108
421
 
422
+ & > view {
423
+ flex: 1;
424
+ padding: 0 unit(15, rpx);
425
+ }
426
+ }
427
+ .dialog {
428
+ .dialog-title {
429
+ font-size: 32rpx;
430
+ text-align: center;
431
+ padding-top: 40rpx;
432
+ }
433
+ .dialog-content {
434
+ font-size: 28rpx;
435
+ margin: 28rpx 0;
436
+ text-align: center;
437
+ & > input {
438
+ font-size: 28rpx;
439
+ background: #f8f8f8;
440
+ padding: 16rpx;
441
+ }
442
+ }
443
+ .dialog-footer {
444
+ display: flex;
445
+ justify-content: space-around;
446
+ align-items: center;
447
+ border-top: 2rpx dashed #e5e5e5;
448
+ padding-top: 28rpx;
449
+ }
109
450
  }
110
451
  }
452
+ }
111
453
  </style>
@@ -0,0 +1,6 @@
1
+ import {
2
+ dataVal,
3
+ } from "@/utils/AttrTools";
4
+ export default (data, gValue, gColor, oldData = {}) => {
5
+ return [].filter(i => i);
6
+ }
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+ import {
3
+ dataVal,
4
+ statusDataVal,
5
+ statusShow,
6
+ customVal,
7
+ getRemoteOptions
8
+ } from "@/utils/AttrTools";
9
+
10
+ export default (data, gValue, gColor, oldData = {}) => {
11
+ return [].filter(i => i);
12
+ }
@@ -0,0 +1,41 @@
1
+ import {
2
+ dataVal,
3
+ statusDataVal,
4
+ statusShow,
5
+ cRaBorShadow,
6
+ cusDisabled,
7
+ getCustomAttr,
8
+ TestCssInfo
9
+ } from "@/utils/AttrTools";
10
+ export default (data, gValue, gColor, oldData = {}) => {
11
+ return [
12
+ {
13
+ label: '背景图',
14
+ ele: 'xd-upload',
15
+ labelInline: true,
16
+ valueKey: 'statusBg',
17
+ value: dataVal({
18
+ data,
19
+ key: 'statusBg',
20
+ dValue: null,
21
+ gValue,
22
+ }),
23
+ defaultValue: dataVal({
24
+ data,
25
+ key: 'statusBg',
26
+ dValue: null,
27
+ gValue,
28
+ }),
29
+ slot: true,
30
+ tipsformet: '上传文件格式:@imageType@,不超过@size@MB.,建议宽度为:<span style="color:red">750</span>像素',
31
+ type: ['jpg', 'png', 'jpeg'],
32
+ styleType: 'one',
33
+ uploadType: 'aliyun',
34
+ oneHeight: 90,
35
+ oneWidth: 375,
36
+ size: 5,
37
+ action: 'aliyun',
38
+ groupKey: 'style',
39
+ },
40
+ ].filter(i => i);
41
+ }
@@ -61,5 +61,17 @@ module.exports = [
61
61
  },
62
62
  isConsole: true,
63
63
  disabled: true,
64
- }
64
+ },
65
+ {
66
+ mapFnName: 'getCheckInvoice',
67
+ title: '用户开票 - 检查订单是否支持开票',
68
+ path: '/pay/v1/user-invoice/check-allow-open',
69
+ isRule: false,
70
+ params: {
71
+ main_order_id: ['订单编号', 'Number', '必选'],
72
+ pay_order_id: ['支付订单号', 'Number', '必选'],
73
+ },
74
+ isConsole: true,
75
+ disabled: true,
76
+ },
65
77
  ];
@@ -300,6 +300,20 @@ export default {
300
300
  { label: '不允许', value: 'N' },
301
301
  ]
302
302
  },
303
+ {
304
+ label: "发票申请:",
305
+ ele: 'xd-radio',
306
+ valueKey: "is_show_invoice",
307
+ value: data['is_show_invoice'] || 'N',
308
+ groupKey: 'content',
309
+ placeholder: '请选择是否发票申请',
310
+ multiple: false,
311
+ className: 'input80',
312
+ list: [
313
+ { label: '展示', value: 'Y' },
314
+ { label: '隐藏', value: 'N' },
315
+ ]
316
+ },
303
317
  {
304
318
  label: '外填充:',
305
319
  ele: 'xd-margin-padding',
@@ -530,6 +544,30 @@ export default {
530
544
  },
531
545
  inline: false,
532
546
  },
547
+ {
548
+ label: '发票申请页面路径:',
549
+ ele: 'xd-select-pages-path',
550
+ valueKey: 'invoicePath',
551
+ groupKey: 'advanced',
552
+ placeholder: '发票申请页面路径',
553
+ value: data['invoicePath'] || null,
554
+ setting: {
555
+ router: XdBus.getParentApi('getPagesTree'),
556
+ },
557
+ inline: false,
558
+ },
559
+ {
560
+ label: '查看发票页面路径:',
561
+ ele: 'xd-select-pages-path',
562
+ valueKey: 'viewInvoicePath',
563
+ groupKey: 'advanced',
564
+ placeholder: '发票申请页面路径',
565
+ value: data['viewInvoicePath'] || null,
566
+ setting: {
567
+ router: XdBus.getParentApi('getPagesTree'),
568
+ },
569
+ inline: false,
570
+ },
533
571
 
534
572
 
535
573
  // 废弃 - 隐藏