From d9e2d8ddbe000da92e181a9979a9097c02f6be44 Mon Sep 17 00:00:00 2001 From: Devil Date: Tue, 8 Dec 2020 16:17:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.txt | 1 + sourcecode/weixin/default/app.js | 2 +- .../invoice/invoice-detail/invoice-detail.js | 2 +- .../invoice-saveinfo/invoice-saveinfo.js | 32 +++++++-- .../invoice-saveinfo/invoice-saveinfo.wxml | 9 +++ .../pages/plugins/invoice/order/order.js | 28 ++++++++ .../pages/plugins/invoice/order/order.wxml | 69 +++++++++++-------- .../pages/plugins/invoice/order/order.wxss | 18 +++++ 8 files changed, 124 insertions(+), 37 deletions(-) diff --git a/changelog.txt b/changelog.txt index 025cbe244..9d6df50cf 100755 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ 2. 首页左侧二级商品分类支持自定义配置 3. 快捷导航新增开关控制 4. 用户地址[地图/身份证]新增开关控制 + 5. 新增开票插件 web端 1. 后台管理小程序列表新增主题管理 diff --git a/sourcecode/weixin/default/app.js b/sourcecode/weixin/default/app.js index 1ed872248..966efaeb9 100755 --- a/sourcecode/weixin/default/app.js +++ b/sourcecode/weixin/default/app.js @@ -74,7 +74,7 @@ App({ // 请求地址 request_url: "{{request_url}}", request_url: 'http://shopxo.com/', - // request_url: 'https://dev.shopxo.net/', + request_url: 'https://dev.shopxo.net/', // 基础信息 application_title: "{{application_title}}", diff --git a/sourcecode/weixin/default/pages/plugins/invoice/invoice-detail/invoice-detail.js b/sourcecode/weixin/default/pages/plugins/invoice/invoice-detail/invoice-detail.js index 2bd463e25..cf9ec64a4 100644 --- a/sourcecode/weixin/default/pages/plugins/invoice/invoice-detail/invoice-detail.js +++ b/sourcecode/weixin/default/pages/plugins/invoice/invoice-detail/invoice-detail.js @@ -45,7 +45,7 @@ Page({ { name: "发票类型", value: data.data.invoice_type_name || '' }, { name: "发票金额", value: data.data.total_price || '' }, { name: "状态", value: data.data.status_name || '' }, - { name: "发票内容", value: data.data.invoice_account || '' }, + { name: "发票内容", value: data.data.invoice_content || '' }, { name: "发票抬头", value: data.data.invoice_title || '' }, { name: "纳税识别号", value: data.data.invoice_code || '' }, { name: "企业开户行名称", value: data.data.invoice_bank || '' }, diff --git a/sourcecode/weixin/default/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo.js b/sourcecode/weixin/default/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo.js index d165ec8fa..1c69c6e02 100644 --- a/sourcecode/weixin/default/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo.js +++ b/sourcecode/weixin/default/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo.js @@ -7,14 +7,15 @@ Page({ data_list_loding_msg: '', data_bottom_line_status: false, data_base: null, - apply_type_list: null, - can_invoice_type_list: null, - invoice_content_list: null, + apply_type_list: [], + can_invoice_type_list: [], + invoice_content_list: [], save_base_data: null, data: null, form_invoice_type_index: 0, form_apply_type_index: 0, + form_invoice_content_index: 0, form_apply_type_disabled: false, company_container: false, company_special_container: false, @@ -48,15 +49,18 @@ Page({ var data = res.data.data; self.setData({ data_base: data.base || null, - apply_type_list: data.apply_type_list || null, - can_invoice_type_list: data.can_invoice_type_list || null, - invoice_content_list: data.invoice_content_list || null, + apply_type_list: data.apply_type_list || [], + can_invoice_type_list: data.can_invoice_type_list || [], + invoice_content_list: data.invoice_content_list || [], save_base_data: data.save_base_data, data: ((data.data || null) == null || data.data.length == 0) ? null : data.data, data_list_loding_status: 0, data_bottom_line_status: true, data_list_loding_msg: (data.save_base_data.total_price <= 0) ? '发票金额必须大于0' : '', }); + + // 数据容器处理 + this.invoice_container_handle(); } else { self.setData({ data_list_loding_status: 2, @@ -103,6 +107,13 @@ Page({ this.invoice_container_handle(); }, + // 发票内容事件 + form_invoice_content_event(e) { + this.setData({ + form_invoice_content_index: e.detail.value + }); + }, + // 容器显隐处理 invoice_container_handle() { // 发票类型 @@ -210,6 +221,15 @@ Page({ } if(app.fields_check(data, validation)) { + // 发票类型 + data['invoice_type'] = this.data.can_invoice_type_list[this.data.form_invoice_type_index]['id']; + + // 发票内容 + if(this.data.invoice_content_list.length > 0 && this.data.invoice_content_list[this.data.form_invoice_content_index] != undefined) + { + data['invoice_content'] = this.data.invoice_content_list[this.data.form_invoice_content_index]; + } + wx.showLoading({title: '提交中...'}); this.setData({form_submit_loading: true}); diff --git a/sourcecode/weixin/default/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo.wxml b/sourcecode/weixin/default/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo.wxml index 342675c84..a343cbf66 100644 --- a/sourcecode/weixin/default/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo.wxml +++ b/sourcecode/weixin/default/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo.wxml @@ -22,6 +22,15 @@ + + 发票内容必选 + + + {{invoice_content_list[form_invoice_content_index] == undefined ? '请选择发票内容' : invoice_content_list[form_invoice_content_index]}} + + + + 发票抬头必填 diff --git a/sourcecode/weixin/default/pages/plugins/invoice/order/order.js b/sourcecode/weixin/default/pages/plugins/invoice/order/order.js index accbe5d2f..929c9e62e 100644 --- a/sourcecode/weixin/default/pages/plugins/invoice/order/order.js +++ b/sourcecode/weixin/default/pages/plugins/invoice/order/order.js @@ -8,6 +8,7 @@ Page({ data_list_loding_status: 1, data_bottom_line_status: false, params: null, + select_ids: [], }, onLoad(params) { @@ -136,4 +137,31 @@ Page({ scroll_lower(e) { this.get_data_list(); }, + + // 选择 + selected_event(e) { + var value = e.currentTarget.dataset.value; + var temp_select_ids = this.data.select_ids; + var index = temp_select_ids.indexOf(value); + if(index == -1) + { + temp_select_ids.push(value); + } else { + temp_select_ids.splice(index, 1); + } + this.setData({select_ids: temp_select_ids}); + console.log(value, index, temp_select_ids); + }, + + // 合并开票 + invoice_merge_event(e) { + if(this.data.select_ids.length <= 0) + { + app.showToast('请先选择数据'); + return false; + } + wx.navigateTo({ + url: '/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo?ids='+this.data.select_ids.join(',')+'&type=order&is_redirect=1', + }); + }, }); \ No newline at end of file diff --git a/sourcecode/weixin/default/pages/plugins/invoice/order/order.wxml b/sourcecode/weixin/default/pages/plugins/invoice/order/order.wxml index 197ac6b50..9004ab01b 100644 --- a/sourcecode/weixin/default/pages/plugins/invoice/order/order.wxml +++ b/sourcecode/weixin/default/pages/plugins/invoice/order/order.wxml @@ -1,38 +1,49 @@ + - - - {{item.add_time}} - - - - - 订单编号 - {{item.order_no}} - - - 订单总价 - {{item.total_price}} - - - - 支付金额 - {{item.pay_price}} - - - - 订单单价 - {{item.price}} - + + + + + + {{item.add_time}} - - - - + + + + 订单编号 + {{item.order_no}} + + + 订单总价 + {{item.total_price}} + + + + 支付金额 + {{item.pay_price}} + + + + 订单单价 + {{item.price}} + + + + + + + + - + + + + + + diff --git a/sourcecode/weixin/default/pages/plugins/invoice/order/order.wxss b/sourcecode/weixin/default/pages/plugins/invoice/order/order.wxss index d33b7f743..20027e637 100644 --- a/sourcecode/weixin/default/pages/plugins/invoice/order/order.wxss +++ b/sourcecode/weixin/default/pages/plugins/invoice/order/order.wxss @@ -22,4 +22,22 @@ } .data-list .item .operation button:not(:first-child) { margin-left: 30rpx; +} + +/* + * 选择 + */ + .selected .icon { + width: 40rpx; + height: 40rpx !important; + margin-left: 10rpx; + margin-right: 20rpx; + vertical-align: middle; +} + .invoice-merge-submit { + width: 220rpx; + height: 70rpx !important; + line-height: 74rpx !important; + left: calc(50% - 110rpx); + bottom: 50rpx; } \ No newline at end of file -- GitLab