jufubao-base 1.0.305-beta51 → 1.0.306

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.
@@ -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-invoice'
20
+ }
21
+ },
22
+ created() {
23
+
24
+ //@AttrDataCreated
25
+ this.Attr = this.$xdUniHelper.customClone(Attr);
26
+ //@EndAttrDataCreated
27
+
28
+
29
+ },
30
+ }
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+
5
+ userInvoiceDetail: { "invoice_result": { "id": 0, "open_nnid": "", "partner_id": 0, "supplier_id": 0, "site_id": "", "user_id": 0, "issuer": "", "category": "", "category_name": "", "content_type": "", "content_type_name": "", "invoice_header": "", "invoice_header_type": "", "invoice_header_type_name": "", "invoice_amount": 1, "invoice_number": "", "phone_number": "", "email": "", "status": "N", "pay_order_id": "", "main_order_id": "", "scene": "", "supplier_fulfil_type": "", "file_info": "", "product_data": [], "open_user_id": "", "open_username": "", "comment": "", "apply_time": 0, "open_time": 0, "created_time": 0, "updated_time": 0, "issuer_name": "", "product_num": 0, "status_name": "未开票", "total_amount": 0, "channel_amount": 0, "error_info": "", "status_desc": "" }, "request_id": "80f312c6000ec59a" },
6
+
7
+ userInvoiceOptions: { "status_list": [{ "label": "未开票", "value": "N" }, { "label": "已开票", "value": "Y" }, { "label": "待开票", "value": "P" }], "category_list": [{ "label": "数电发票(普通发票)", "value": "normal" }], "content_type_list": [{ "label": "明细", "value": "detail" }], "invoice_header_type_list": [{ "label": "个人", "value": "person" }, { "label": "单位", "value": "company" }], "issuer_list": [{ "label": "供货商", "value": "supplier" }, { "label": "平台", "value": "platform" }], "request_id": "c989ca4688ac7ecb" },
8
+
9
+ userInvoiceSubmit:{},
10
+
11
+ }
@@ -0,0 +1,33 @@
1
+ import {
2
+ dataVal,
3
+ } from "@/utils/AttrTools";
4
+ export default (data, gValue, gColor, oldData = {}) => {
5
+ return [
6
+ {
7
+ label: '确认开票',
8
+ ele: 'xd-select-pages-path',
9
+ valueKey: 'confirmPath',
10
+ placeholder: '请选择确认开票页面',
11
+ value: data['confirmPath'] || {},
12
+ labelInline: true,
13
+ setting: {
14
+ router: XdBus.getParentApi('getPagesTree'),
15
+ },
16
+ className: 'input100',
17
+ groupKey: 'advanced',
18
+ },
19
+ {
20
+ label: '开票详情',
21
+ ele: 'xd-select-pages-path',
22
+ valueKey: 'detailPath',
23
+ placeholder: '请选择开票详情页面',
24
+ value: data['detailPath'] || {},
25
+ labelInline: true,
26
+ setting: {
27
+ router: XdBus.getParentApi('getPagesTree'),
28
+ },
29
+ className: 'input100',
30
+ groupKey: 'advanced',
31
+ },
32
+ ].filter(i => i);
33
+ }
@@ -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
+ }
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+ /**
3
+ * @description 接口配置,
4
+ * 在设置方法名字当时候,别忘记加上【模块名字】:Invoice
5
+ * @type {*[]}
6
+ */
7
+ module.exports = [
8
+ {
9
+ //设置方法名字当别忘记加上【模块名字】:Invoice
10
+ mapFnName: 'userInvoiceDetail',
11
+ title: '用户开票 - 详情',
12
+ path: '/pay/v1/user-invoice/detail',
13
+ isRule: false,
14
+ params: {
15
+ main_order_id: ['订单编号', 'Number', '必选'],
16
+ pay_order_id: ['支付订单号', 'Number', '必选'],
17
+ },
18
+ isConsole: true,
19
+ disabled: true,
20
+ },
21
+ {
22
+ //设置方法名字当别忘记加上【模块名字】:Invoice
23
+ mapFnName: 'userInvoiceSend',
24
+ title: '用户开票 - 发送邮箱',
25
+ path: '/pay/v1/user-invoice/send',
26
+ isRule: false,
27
+ data: {
28
+ main_order_id: ['订单编号', 'Number', '必选'],
29
+ pay_order_id: ['支付订单号', 'Number', '必选'],
30
+ email: ['邮箱', 'String', '必选'],
31
+ },
32
+ isConsole: true,
33
+ disabled: true,
34
+ },
35
+ ];
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+ import Content from './cusAttr/content'
3
+ import Style from './cusAttr/style'
4
+ import Advanced from './cusAttr/advanced'
5
+ /**
6
+ * @description 当表单组件中有联动操作时候,使用方法进行返回
7
+ */
8
+ export default {
9
+ style: [],
10
+ content: (data, gValue, gColor, oldData = {}) => {
11
+ return [
12
+ ...Content(data, gValue, gColor, oldData),
13
+ ...Style(data, gValue, gColor, oldData),
14
+ ...Advanced(data, gValue, gColor, oldData),
15
+
16
+ ].filter(i => i)
17
+ },
18
+ advanced: [
19
+
20
+ ],
21
+ };
@@ -0,0 +1,465 @@
1
+ <template>
2
+ <view
3
+ class="jfb-base-invoice-detail"
4
+ @click="handleEditxSelect"
5
+ :class="{ editx: isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-base-invoice-detail__edit"
10
+ :class="{ editx: isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-base-invoice-detail__edit-icon" @click="delEdit"
14
+ >删除</view
15
+ >
16
+ </view>
17
+ <!-- #endif -->
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' ? 'iconshijian' : 'iconchenggong1'"
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
+ fontSize="28"
40
+ colorNew="#fff"
41
+ :isOld="false"
42
+ :price="info.invoice_amount"
43
+ ></xd-unit
44
+ ></view>
45
+ </view>
46
+ <view class="jfb-base-invoice-detail__body-content">
47
+ <view class="jfb-base-invoice-detail__body-content-item">
48
+ <view class="jfb-base-invoice-detail__body-content-item-info">
49
+ <view>开票金额</view>
50
+ <XdUnit :isOld="false" :price="info.invoice_amount"></XdUnit>
51
+ </view>
52
+ <view class="jfb-base-invoice-detail__body-content-item-info">
53
+ <view>发票类型</view>
54
+ <view>(普通发票)数电发票</view>
55
+ </view>
56
+ </view>
57
+ <view
58
+ style="margin-top: 24rpx"
59
+ class="jfb-base-invoice-detail__body-content-item"
60
+ >
61
+ <view
62
+ v-if="info.status === 'Y'"
63
+ class="jfb-base-invoice-detail__body-content-item-info"
64
+ >
65
+ <view>发票内容</view>
66
+ <view>{{ info.content_type_name }}</view>
67
+ </view>
68
+ <view class="jfb-base-invoice-detail__body-content-item-info">
69
+ <view>抬头类型</view>
70
+ <view>{{ info.invoice_header_type_name }}</view>
71
+ </view>
72
+ <view class="jfb-base-invoice-detail__body-content-item-info">
73
+ <view>发票抬头</view>
74
+ <view>{{ info.invoice_header }}</view>
75
+ </view>
76
+ <view class="jfb-base-invoice-detail__body-content-item-info">
77
+ <view>联系电话</view>
78
+ <view>{{ info.phone_number }}</view>
79
+ </view>
80
+ <view
81
+ v-if="info.invoice_number"
82
+ class="jfb-base-invoice-detail__body-content-item-info"
83
+ >
84
+ <view>税号</view>
85
+ <view>{{ info.invoice_number }}</view>
86
+ </view>
87
+ <view class="jfb-base-invoice-detail__body-content-item-info">
88
+ <view>接收邮箱</view>
89
+ <view>{{ info.email }}</view>
90
+ </view>
91
+ <view class="jfb-base-invoice-detail__body-content-item-info">
92
+ <view>申请时间</view>
93
+ <view>{{ info.apply_time }}</view>
94
+ </view>
95
+ <view
96
+ v-if="info.status === 'Y'"
97
+ class="jfb-base-invoice-detail__body-content-item-info"
98
+ >
99
+ <view>开票时间</view>
100
+ <view>{{ info.open_time }}</view>
101
+ </view>
102
+ </view>
103
+ </view>
104
+ <view
105
+ v-if="info.status === 'Y'"
106
+ class="jfb-base-invoice-detail__body-images"
107
+ >
108
+ <view
109
+ class="jfb-base-invoice-detail__body-images-item"
110
+ v-for="(item, index) in images"
111
+ :key="index"
112
+ >
113
+ <image @click="handlePreview(index, item)" :src="item"></image>
114
+ </view>
115
+ </view>
116
+ <view :style="{ height: '100rpx' }"></view>
117
+ <view v-if="info.status === 'Y'" class="fixe_bottom" :style="prod_bottom">
118
+ <view :style="[bottomBtnWrapStyle]">
119
+ <XdButton
120
+ :wrapStyle="[wrapStyle]"
121
+ width="240rpx"
122
+ @click="handleSend"
123
+ size="small"
124
+ type="primary"
125
+ >发送邮箱</XdButton
126
+ >
127
+ </view>
128
+ </view>
129
+ <xd-dailog
130
+ title="请确认邮箱地址"
131
+ :cancel="false"
132
+ :confirm="false"
133
+ :showTitle="false"
134
+ :showClose="false"
135
+ :show.sync="showDialog"
136
+ >
137
+ <view class="dialog">
138
+ <view class="dialog-title">请确认邮箱地址</view>
139
+ <view class="dialog-content">
140
+ <input type="text" v-model="email" placeholder="请输入邮箱地址" />
141
+ </view>
142
+ <view class="dialog-footer">
143
+ <xd-button @click="handleCancel" width="220rpx" type="info"
144
+ >取消</xd-button
145
+ >
146
+ <xd-button @click="handleConfirm" width="220rpx" type="primary"
147
+ >确定</xd-button
148
+ >
149
+ </view>
150
+ </view>
151
+ </xd-dailog>
152
+ </view>
153
+ </view>
154
+ </template>
155
+
156
+ <script>
157
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
158
+ import XdDailog from "@/components/XdDailog/XdDailog";
159
+ import XdUnit from "@/components/XdUnit/XdUnit";
160
+ import { jfbRootExec } from "@/utils/xd.event";
161
+ import JfbBaseInvoiceDetailMixin from "./JfbBaseInvoiceDetailMixin";
162
+ import { getContainerPropsValue, gCPVal } from "@/utils/xd.base";
163
+ import componentsMixins from "@/mixins/componentsMixins";
164
+ import getServiceUrl from "@/common/getServiceUrl";
165
+ import extsMixins from "@/mixins/extsMixins";
166
+ export default {
167
+ name: "JfbBaseInvoiceDetail",
168
+ components: {
169
+ XdFontIcon,
170
+ XdDailog,
171
+ XdUnit,
172
+ },
173
+ mixins: [componentsMixins, extsMixins, JfbBaseInvoiceDetailMixin],
174
+ data() {
175
+ return {
176
+ statusBg: "",
177
+ status: "ing",
178
+ images: [],
179
+ showDialog: false,
180
+ email: "",
181
+ main_order_id: "",
182
+ pay_order_id: "",
183
+ info: null,
184
+ };
185
+ },
186
+ computed: {
187
+ statusStyle() {
188
+ return {
189
+ backgroundImage: `url(${this.statusBg})`,
190
+ backgroundRepeat: "no-repeat",
191
+ backgroundSize: "100% 100%",
192
+ };
193
+ },
194
+ prod_bottom() {
195
+ let style = this.fixedStyle({ bottom: 0 });
196
+ return style;
197
+ },
198
+ bottomBtnWrapStyle() {
199
+ let style = {
200
+ display: "flex",
201
+ "justify-content": "flex-end",
202
+ };
203
+ return style;
204
+ },
205
+ wrapStyle() {
206
+ let style = {
207
+ margin: 0,
208
+ };
209
+ return style;
210
+ },
211
+ },
212
+ watch: {
213
+ container(value, oldValue) {
214
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
215
+ if (this.$configProject["isPreview"]) this.init(value);
216
+ },
217
+ },
218
+ created() {
219
+ setTimeout(() => {
220
+ this.status = "success";
221
+ }, 1000);
222
+ this.init(this.container);
223
+
224
+ //todo
225
+ },
226
+ methods: {
227
+ onJfbLoad(options) {
228
+ this.main_order_id = options.main_order_id;
229
+ this.pay_order_id = options.pay_order_id;
230
+ this.getDetail();
231
+ },
232
+ getDetail() {
233
+ jfbRootExec("userInvoiceDetail", {
234
+ vm: this,
235
+ data: {
236
+ main_order_id: this.main_order_id,
237
+ pay_order_id: this.pay_order_id,
238
+ },
239
+ })
240
+ .then((res) => {
241
+ if (res.invoice_result.apply_time) {
242
+ res.invoice_result.apply_time = this.$xdUniHelper.getDate(
243
+ res.invoice_result.apply_time * 1000
244
+ ).fullTime;
245
+ }
246
+ if (res.invoice_result.open_time) {
247
+ res.invoice_result.open_time = this.$xdUniHelper.getDate(
248
+ res.invoice_result.open_time * 1000
249
+ ).fullTime;
250
+ }
251
+ if (res.invoice_result.file_info) {
252
+ res.invoice_result.file_info = JSON.parse(
253
+ res.invoice_result.file_info
254
+ );
255
+ this.images = res.invoice_result.file_info.map((item) => {
256
+ return item.preview_url
257
+ });
258
+ }
259
+ this.info = res.invoice_result;
260
+ if (this.info.status_name === "待开票") {
261
+ this.info.status_name = "开票中";
262
+ }
263
+ })
264
+ .catch();
265
+ },
266
+ /**
267
+ * @description 监听事件变化
268
+ * @param container {object} 业务组件对象自己
269
+ */
270
+ init(container) {
271
+ this.statusBg = getServiceUrl(
272
+ gCPVal(container, "statusBg", { url: "" }, {}).url
273
+ );
274
+ },
275
+ handlePreview(i, item) {
276
+ //#ifdef H5
277
+ // 调用 uni.previewImage() 方法预览图片
278
+ let images = this.images.map((item) => item);
279
+ uni.previewImage({
280
+ // 预览时,默认显示图片的索引
281
+ current: i,
282
+ indicator: "number",
283
+ // 所有图片 url 路径的数组 //这里直接把图片列表的数组放入即可
284
+ urls: images,
285
+ });
286
+ //#endif
287
+ //#ifdef MP-WEIXIN
288
+ uni.previewImage({
289
+ // 预览时,默认显示图片的索引
290
+ current: i,
291
+ indicator: "number",
292
+ // 所有图片 url 路径的数组 //这里直接把图片列表的数组放入即可
293
+ urls: this.images.map((item) => item),
294
+ });
295
+ //#endif
296
+ },
297
+ handleCancel() {
298
+ this.showDialog = false;
299
+ this.email = "";
300
+ },
301
+ handleConfirm() {
302
+ jfbRootExec("userInvoiceSend", {
303
+ vm: this,
304
+ data: {
305
+ main_order_id: this.main_order_id,
306
+ pay_order_id: this.pay_order_id,
307
+ email: this.email,
308
+ },
309
+ }).then((res) => {
310
+ this.showDialog = false;
311
+ this.email = "";
312
+ this.$xdAlert({ content: "发送成功" });
313
+ });
314
+ },
315
+ handleSend() {
316
+ this.showDialog = true;
317
+ },
318
+ onJfbScroll(options) {
319
+ console.log("event.onJfbScroll", options);
320
+ },
321
+ onJfbReachBottom(options) {
322
+ console.log("event.onJfbReachBottom", options);
323
+ },
324
+ onJfbShow(options) {
325
+ console.log("event.onJfbShow", options);
326
+ },
327
+ onJfbHide(options) {
328
+ console.log("event.onJfbHide", options);
329
+ },
330
+ onJfbBack(options) {
331
+ console.log("event.onJfbBack", options);
332
+ },
333
+ onJfbUpdate(...data) {
334
+ console.log("event.onJfbUpdate", data);
335
+ },
336
+ onJfbCustomEvent(options) {
337
+ console.log("event.onJfbReachBottom", options);
338
+ },
339
+ },
340
+ };
341
+ </script>
342
+
343
+ <style scoped lang="less">
344
+ @import "./JfbBaseInvoiceDetailLess.less";
345
+
346
+ .jfb-base-invoice-detail {
347
+ &__body {
348
+ &-status {
349
+ height: 180rpx;
350
+ color: #fff;
351
+ display: flex;
352
+ flex-direction: column;
353
+ align-items: center;
354
+ justify-content: center;
355
+ &-name {
356
+ display: flex;
357
+ align-items: center;
358
+ justify-content: center;
359
+ font-size: 36rpx;
360
+ & > view {
361
+ margin-left: 16rpx;
362
+ }
363
+ }
364
+ &-text {
365
+ margin-left: 0rpx !important;
366
+ margin-top: 16rpx;
367
+ font-size: 26rpx;
368
+ display: flex;
369
+ align-items: center;
370
+ }
371
+ }
372
+ &-content {
373
+ padding: 24rpx;
374
+ position: relative;
375
+ top: -18rpx;
376
+ border-radius: 16rpx;
377
+ background: #f8f8f8;
378
+ &-item {
379
+ background: #fff;
380
+ border-radius: 8rpx;
381
+ &-info {
382
+ padding: 20rpx 48rpx;
383
+ display: flex;
384
+ justify-content: space-between;
385
+ align-items: center;
386
+ color: #333333;
387
+ font-size: 28rpx;
388
+ border-bottom: 2rpx solid #f7f7f7;
389
+ position: relative;
390
+ }
391
+ }
392
+ }
393
+ &-images {
394
+ display: flex;
395
+ flex-wrap: wrap;
396
+ padding: 16rpx;
397
+ border-radius: 16rpx;
398
+ background: #fff;
399
+ margin: -18rpx 24rpx 24rpx 24rpx;
400
+
401
+ &-item {
402
+ background: #f2f1f6;
403
+ display: flex;
404
+ align-items: center;
405
+ justify-content: center;
406
+ padding: 8rpx;
407
+ margin-right: 16rpx;
408
+ margin-bottom: 16rpx;
409
+
410
+ & > image {
411
+ width: 192rpx;
412
+ height: 128rpx;
413
+ }
414
+ }
415
+ &-item:nth-child(3n) {
416
+ margin-right: 0;
417
+ }
418
+ }
419
+ .fixe_bottom {
420
+ display: flex;
421
+ align-items: center;
422
+ justify-content: flex-end !important;
423
+ height: unit(100, rpx);
424
+ padding: 0 unit(40, rpx);
425
+ flex-flow: nowrap;
426
+ background: #fff;
427
+ box-shadow: 0 0 unit(16, rpx) rgba(0, 0, 0, 0.05);
428
+ .flex_l {
429
+ display: flex;
430
+ align-items: center;
431
+ font-size: unit(32, rpx);
432
+ }
433
+
434
+ & > view {
435
+ flex: 1;
436
+ padding: 0 unit(15, rpx);
437
+ }
438
+ }
439
+ .dialog {
440
+ .dialog-title {
441
+ font-size: 32rpx;
442
+ text-align: center;
443
+ padding-top: 40rpx;
444
+ }
445
+ .dialog-content {
446
+ font-size: 28rpx;
447
+ margin: 28rpx 0;
448
+ text-align: center;
449
+ & > input {
450
+ font-size: 28rpx;
451
+ background: #f8f8f8;
452
+ padding: 16rpx;
453
+ }
454
+ }
455
+ .dialog-footer {
456
+ display: flex;
457
+ justify-content: space-around;
458
+ align-items: center;
459
+ border-top: 2rpx dashed #e5e5e5;
460
+ padding-top: 28rpx;
461
+ }
462
+ }
463
+ }
464
+ }
465
+ </style>