handpos-client 1.0.5 → 1.0.7-lekai

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "handpos-client",
3
- "version": "1.0.5",
3
+ "version": "1.0.7-lekai",
4
4
  "description": "手持POS",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -1,49 +1,49 @@
1
- import Vue from 'vue'
2
-
3
- export default function (filiale) {
4
- // 参数加载页面
5
- Vue.component('init', (resolve) => { require(['./components/Init'], resolve) })
6
- // 主页面
7
- Vue.component('main', (resolve) => { require(['./components/Main'], resolve) })
8
-
9
- // 卡表收费
10
- Vue.component('card-main', (resolve) => { require(['./components/main/CardMain'], resolve) })
11
- // 无卡收费
12
- Vue.component('machine-main', (resolve) => { require(['./components/main/MachineMain'], resolve) })
13
-
14
- // 垃圾费相关
15
- // 垃圾费信息
16
- Vue.component('garbage-info', (resolve) => { require(['./components/garbage/GarbageInfo'], resolve) })
17
- // 垃圾费支付方式选择
18
- Vue.component('garbage-pay-way', (resolve) => { require(['./components/garbage/GarbagePayWay'], resolve) })
19
- // 垃圾费二维码扫描
20
- Vue.component('garbage-scan-native', (resolve) => { require(['./components/garbage/GarbageScanNative'], resolve) })
21
-
22
- // 卡表用户信息
23
- Vue.component('card-user-info', (resolve) => { require(['./components/sellgas/CardSellGas'], resolve) })
24
- // 物联网表信息
25
- Vue.component('iot-user-info', (resolve) => { require(['./components/sellgas/IotSellGas'], resolve) })
26
- // 机表用户信息-gas
27
- Vue.component('machine-user-info-gas', (resolve) => { require(['./components/sellgas/MachineSellGasGas'], resolve) })
28
- // 机表用户信息-money(常用)
29
- Vue.component('machine-user-info', (resolve) => { require(['./components/sellgas/MachineSellGasMoney'], resolve) })
30
-
31
- // 支付
32
- // 选择支付方式
33
- Vue.component('pay-way', (resolve) => { require(['./components/pay/PayWay'], resolve) })
34
- // 二维码展示界面
35
- Vue.component('scannative', (resolve) => { require(['./components/pay/ScanNative'], resolve) })
36
- // 写卡界面
37
- Vue.component('order-info', (resolve) => { require(['./components/pay/WriteCard'], resolve) })
38
-
39
-
40
-
41
- // 公共组件
42
- // 历史收费记录
43
- Vue.component('history-sell-list', (resolve) => { require(['./components/public/HistorySellList'], resolve) })
44
- // 预写卡信息
45
- Vue.component('write-card-info', (resolve) => { require(['./components/public/WritecardInfo'], resolve) })
46
- // 购气
47
- Vue.component('buy-gas', (resolve) => { require(['./components/public/BuyGas'], resolve) })
48
-
49
- }
1
+ import Vue from 'vue'
2
+
3
+ export default function (filiale) {
4
+ // 参数加载页面
5
+ Vue.component('init', (resolve) => { require(['./components/Init'], resolve) })
6
+ // 主页面
7
+ Vue.component('main', (resolve) => { require(['./components/Main'], resolve) })
8
+
9
+ // 卡表收费
10
+ Vue.component('card-main', (resolve) => { require(['./components/main/CardMain'], resolve) })
11
+ // 无卡收费
12
+ Vue.component('machine-main', (resolve) => { require(['./components/main/MachineMain'], resolve) })
13
+
14
+ // 垃圾费相关
15
+ // 垃圾费信息
16
+ Vue.component('garbage-info', (resolve) => { require(['./components/garbage/GarbageInfo'], resolve) })
17
+ // 垃圾费支付方式选择
18
+ Vue.component('garbage-pay-way', (resolve) => { require(['./components/garbage/GarbagePayWay'], resolve) })
19
+ // 垃圾费二维码扫描
20
+ Vue.component('garbage-scan-native', (resolve) => { require(['./components/garbage/GarbageScanNative'], resolve) })
21
+
22
+ // 卡表用户信息
23
+ Vue.component('card-user-info', (resolve) => { require(['./components/sellgas/CardSellGas'], resolve) })
24
+ // 物联网表信息
25
+ Vue.component('iot-user-info', (resolve) => { require(['./components/sellgas/IotSellGas'], resolve) })
26
+ // 机表用户信息-gas
27
+ Vue.component('machine-user-info-gas', (resolve) => { require(['./components/sellgas/MachineSellGasGas'], resolve) })
28
+ // 机表用户信息-money(常用)
29
+ Vue.component('machine-user-info', (resolve) => { require(['./components/sellgas/MachineSellGasMoney'], resolve) })
30
+
31
+ // 支付
32
+ // 选择支付方式
33
+ Vue.component('pay-way', (resolve) => { require(['./components/pay/PayWay'], resolve) })
34
+ // 二维码展示界面
35
+ Vue.component('scannative', (resolve) => { require(['./components/pay/ScanNative'], resolve) })
36
+ // 写卡界面
37
+ Vue.component('order-info', (resolve) => { require(['./components/pay/WriteCard'], resolve) })
38
+
39
+
40
+
41
+ // 公共组件
42
+ // 历史收费记录
43
+ Vue.component('history-sell-list', (resolve) => { require(['./components/public/HistorySellList'], resolve) })
44
+ // 预写卡信息
45
+ Vue.component('write-card-info', (resolve) => { require(['./components/public/WritecardInfo'], resolve) })
46
+ // 购气
47
+ Vue.component('buy-gas', (resolve) => { require(['./components/public/BuyGas'], resolve) })
48
+
49
+ }
@@ -79,9 +79,9 @@ export default {
79
79
  console.log('android环境')
80
80
  HostApp
81
81
  this.$AndroidPlugin.isAndroid = true
82
- let url = this.$AndroidPlugin.getProxyURL() + '/'
82
+ let url = Vue.AndroidPlugin.getProxyURL() + '/'
83
83
  if (Vue.phoneBuild){
84
- url = this.$AndroidPlugin.getProxyURL() + '/pos/'
84
+ url = Vue.AndroidPlugin.getProxyURL() + '/pos/'
85
85
  }
86
86
  Vue.ProxyUrl = url
87
87
  } catch (e) {
@@ -1,233 +1,233 @@
1
- <template>
2
- <div>
3
- <div class="mhead">
4
- <ul>
5
- <li>
6
- <text>垃圾费缴费</text>
7
- </li>
8
- </ul>
9
- </div>
10
- <div class="body">
11
- <div class="container contentpanel auto">
12
- <div class="row buypanel">
13
- <div class="buyform">
14
- <h3 style="color: red;">订单信息</h3>
15
- <div>
16
- <h4>缴费类型:垃圾费</h4>
17
- </div>
18
- <div>
19
- <h4>账期:{{garbageInfo.accountperiod}}</h4>
20
- </div>
21
- <div>
22
- <h4>支付金额:{{garbageInfo.money}} &nbsp;&nbsp;元</h4>
23
- </div>
24
- </div>
25
- <div class="horizontal" height="auto">
26
- <h3 style="color: red;">请选择支付方式</h3>
27
- <table width="60%" border="0" cellspacing="0" cellpadding="0" align="center">
28
- <tbody>
29
- <tr>
30
- <td align="center" v-if='payBtn1.show' class="col-xs-4 weixin">
31
- <div @click='pay("1")'>
32
- <img :src="btn1Path" alt=""/>
33
- </div>
34
- </td>
35
- <td align="center" v-if='payBtn2.show' class="col-xs-4 alipay" >
36
- <div @click='pay("2")'>
37
- <img :src="btn2Path " alt=""/>
38
- </div>
39
- </td>
40
- <td align="center" v-if='payBtn3.show' class="col-xs-4 unionpay">
41
- <div @click='pay("3")'>
42
- <img :src="btn3Path" alt=""/>
43
- </div>
44
- </td>
45
- </tr>
46
- </tbody>
47
- </table>
48
- </div>
49
- </div>
50
- </div>
51
- </div>
52
- <div class="foot" @click="back('toMain')">
53
- <text>返回</text>
54
- </div>
55
- </div>
56
- </template>
57
- <script>
58
- import Vue from 'vue'
59
- import * as util from '../../service/util.js'
60
- export default {
61
- title: '选择支付方式',
62
- data() {
63
- return {
64
- btn1Path: '',
65
- btn2Path: '',
66
- btn3Path: '',
67
- payBtn1: {
68
- show: false,
69
- path: "",
70
- method: "",
71
- pay_way: "",
72
- payment: ""
73
- },
74
- payBtn2: {
75
- show: false,
76
- path: "",
77
- method: "",
78
- pay_way: "",
79
- payment: ""
80
- },
81
- payBtn3: {
82
- show: false,
83
- path: "",
84
- method: "",
85
- pay_way: "",
86
- payment: ""
87
- },
88
- garbageInfo: {
89
- accountperiod: '',
90
- money: 0,
91
- list: []
92
- },
93
- payInfo: {
94
- pay_way: '',
95
- f_payment: '',
96
- url: '',
97
- f_serial_id: ''
98
- },
99
- resolve: undefined,
100
- reject: undefined,
101
- obj: undefined
102
- }
103
- },
104
- methods: {
105
- // 格式化日期显示
106
- formatDate(dateStr) {
107
- if (!dateStr) return ''
108
- const parts = dateStr.split('-')
109
- if (parts.length === 2) {
110
- return `${parts[0]}年${parts[1]}月`
111
- }
112
- return dateStr
113
- },
114
-
115
- back(para) {
116
- this.obj.resolve(false)
117
- this.$back(para)
118
- },
119
-
120
- getQR() {
121
- this.obj.getQR()
122
- },
123
-
124
- async pay (str) {
125
- if (!this.handClick) {
126
- this.handClick = true
127
-
128
- // 垃圾费不需要读卡验证,直接进行支付
129
- if (str === '1') {
130
- this.payInfo.pay_way = this.payBtn1.pay_way
131
- this.payInfo.f_payment = this.payBtn1.payment
132
- this.payMethod(this.payBtn1.unionPayAlias, this.payBtn1.method)
133
- } else if (str === '2') {
134
- this.payInfo.pay_way = this.payBtn2.pay_way
135
- this.payInfo.f_payment = this.payBtn2.payment
136
- this.payMethod(this.payBtn2.unionPayAlias, this.payBtn2.method)
137
- } else {
138
- this.payInfo.pay_way = this.payBtn3.pay_way
139
- this.payInfo.f_payment = this.payBtn3.payment
140
- this.payMethod(this.payBtn3.unionPayAlias, this.payBtn3.method)
141
- }
142
- }
143
- },
144
-
145
- payMethod(unionPayAlias, payMethod) {
146
- if (payMethod === 'qrcode') {
147
- this.getQR()
148
- } else if (payMethod === 'card') {
149
- this.cardPay(unionPayAlias)
150
- } else {
151
- this.$showNewMessage('提示', `未知支付方式:${payMethod},请联系管理员`, ['confirm'], 'newmgs')
152
- }
153
- },
154
-
155
- cardPay(unionPayAlias) {
156
- let attach = this.obj.getAttach()
157
- let money = Vue.PosUtil.yuan2fen(this.garbageInfo.money)
158
- //测试环境支付金额统一改为1分
159
- if (Vue.PosUtil.posParam.isTest) {
160
- money = 1
161
- }
162
- attach.f_revenue = Vue.PosUtil.posParam.revenue
163
- attach.money = money
164
- try {
165
- HostApp.__this__ = this
166
- HostApp.pay({
167
- data: attach,
168
- callback: 'javascript:HostApp.__this__.toSuccess();'
169
- }, unionPayAlias)
170
- } catch (e) {
171
- console.log('e', e)
172
- }
173
- },
174
- print(){
175
- try {
176
- let num = 0.00
177
- this.garbage.list.forEach(item=>{
178
- num += item.f_money
179
- })
180
- let bigNum = util.numberToChinese(num)
181
- let date = util.getDate()
182
- let printContent = []
183
- let textHead = {type: 3, text: '山西华新科莱天然气有限公司垃圾费收费单', fontsize: 3, isbold: true, align: 'center'}
184
- printContent.push(textHead)
185
- printContent.push({type: 4, value: 2, unit: 'line'})
186
- printContent.push({type: 3, text: '收费日期:' + date, fontsize: 2, isbold: false, align: 'left'})
187
- printContent.push({type: 3, text: '用户编号:' + this.userInfo.f_userinfo_code, fontsize: 2, isbold: false, align: 'left'})
188
- printContent.push({type: 3, text: '用户姓名:' + this.userInfo.f_user_name, fontsize: 2, isbold: false, align: 'left'})
189
- printContent.push({type: 3, text: '用气地址:' + this.userInfo.f_address, fontsize: 2, isbold: false, align: 'left'})
190
- printContent.push({type: 3, text: '收费项目:' + '垃圾费', fontsize: 2, isbold: false, align: 'left'})
191
- printContent.push({type: 3, text: '垃圾处理费:' + num, fontsize: 2, isbold: false, align: 'left'})
192
- printContent.push({type: 3, text: '实收金额(大写):' + bigNum, fontsize: 2, isbold: false, align: 'left'})
193
- printContent.push({type: 3, text: '打票时间:' + date, fontsize: 2, isbold: false, align: 'left'})
194
- printContent.push({type: 3, text: '收费员:' + Vue.user.name || Vue.PosUtil.Sn, fontsize: 2, isbold: false, align: 'left'})
195
- printContent.push({type: 4, value: 4, unit: 'line'})
196
- this.$AndroidPlugin.print(printContent)
197
- }catch (e) {
198
- this.$showNewMessage('错误', '收费打印单失败。')
199
- }
200
- this.$back('toMain')
201
- },
202
-
203
- // 垃圾费支付成功处理
204
- toSuccess() {
205
- this.$showNewMessage('错误', '垃圾费缴费成功!是否打印收费单?', ['confirm', 'cancel'], 'newmgs')
206
- .then((res) => {
207
- if (res === 'confirm') {
208
- this.print()
209
- } else {
210
- this.$back('toMain')
211
- }
212
- })
213
- }
214
- },
215
-
216
- ready() {
217
- // 从路由参数获取垃圾费信息
218
- this.garbageInfo = this.garbage
219
-
220
- // 设置服务对象里的组件对象
221
- if (this.obj) {
222
- this.obj.setComponents(this)
223
- }
224
-
225
- this.payBtn1 = this.$PosUtil.posParam.PayBtn1
226
- this.payBtn2 = this.$PosUtil.posParam.PayBtn2
227
- this.payBtn3 = this.$PosUtil.posParam.PayBtn3
228
- this.btn1Path = require(`../image/${this.payBtn1.path}`)
229
- this.btn2Path = require(`../image/${this.payBtn2.path}`)
230
- this.btn3Path = require(`../image/${this.payBtn3.path}`)
231
- }
232
- }
233
- </script>
1
+ <template>
2
+ <div>
3
+ <div class="mhead">
4
+ <ul>
5
+ <li>
6
+ <text>垃圾费缴费</text>
7
+ </li>
8
+ </ul>
9
+ </div>
10
+ <div class="body">
11
+ <div class="container contentpanel auto">
12
+ <div class="row buypanel">
13
+ <div class="buyform">
14
+ <h3 style="color: red;">订单信息</h3>
15
+ <div>
16
+ <h4>缴费类型:垃圾费</h4>
17
+ </div>
18
+ <div>
19
+ <h4>账期:{{garbageInfo.accountperiod}}</h4>
20
+ </div>
21
+ <div>
22
+ <h4>支付金额:{{garbageInfo.money}} &nbsp;&nbsp;元</h4>
23
+ </div>
24
+ </div>
25
+ <div class="horizontal" height="auto">
26
+ <h3 style="color: red;">请选择支付方式</h3>
27
+ <table width="60%" border="0" cellspacing="0" cellpadding="0" align="center">
28
+ <tbody>
29
+ <tr>
30
+ <td align="center" v-if='payBtn1.show' class="col-xs-4 weixin">
31
+ <div @click='pay("1")'>
32
+ <img :src="btn1Path" alt=""/>
33
+ </div>
34
+ </td>
35
+ <td align="center" v-if='payBtn2.show' class="col-xs-4 alipay" >
36
+ <div @click='pay("2")'>
37
+ <img :src="btn2Path " alt=""/>
38
+ </div>
39
+ </td>
40
+ <td align="center" v-if='payBtn3.show' class="col-xs-4 unionpay">
41
+ <div @click='pay("3")'>
42
+ <img :src="btn3Path" alt=""/>
43
+ </div>
44
+ </td>
45
+ </tr>
46
+ </tbody>
47
+ </table>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ <div class="foot" @click="back('toMain')">
53
+ <text>返回</text>
54
+ </div>
55
+ </div>
56
+ </template>
57
+ <script>
58
+ import Vue from 'vue'
59
+ import * as util from '../../service/util.js'
60
+ export default {
61
+ title: '选择支付方式',
62
+ data() {
63
+ return {
64
+ btn1Path: '',
65
+ btn2Path: '',
66
+ btn3Path: '',
67
+ payBtn1: {
68
+ show: false,
69
+ path: "",
70
+ method: "",
71
+ pay_way: "",
72
+ payment: ""
73
+ },
74
+ payBtn2: {
75
+ show: false,
76
+ path: "",
77
+ method: "",
78
+ pay_way: "",
79
+ payment: ""
80
+ },
81
+ payBtn3: {
82
+ show: false,
83
+ path: "",
84
+ method: "",
85
+ pay_way: "",
86
+ payment: ""
87
+ },
88
+ garbageInfo: {
89
+ accountperiod: '',
90
+ money: 0,
91
+ list: []
92
+ },
93
+ payInfo: {
94
+ pay_way: '',
95
+ f_payment: '',
96
+ url: '',
97
+ f_serial_id: ''
98
+ },
99
+ resolve: undefined,
100
+ reject: undefined,
101
+ obj: undefined
102
+ }
103
+ },
104
+ methods: {
105
+ // 格式化日期显示
106
+ formatDate(dateStr) {
107
+ if (!dateStr) return ''
108
+ const parts = dateStr.split('-')
109
+ if (parts.length === 2) {
110
+ return `${parts[0]}年${parts[1]}月`
111
+ }
112
+ return dateStr
113
+ },
114
+
115
+ back(para) {
116
+ this.obj.resolve(false)
117
+ this.$back(para)
118
+ },
119
+
120
+ getQR() {
121
+ this.obj.getQR()
122
+ },
123
+
124
+ async pay (str) {
125
+ if (!this.handClick) {
126
+ this.handClick = true
127
+
128
+ // 垃圾费不需要读卡验证,直接进行支付
129
+ if (str === '1') {
130
+ this.payInfo.pay_way = this.payBtn1.pay_way
131
+ this.payInfo.f_payment = this.payBtn1.payment
132
+ this.payMethod(this.payBtn1.unionPayAlias, this.payBtn1.method)
133
+ } else if (str === '2') {
134
+ this.payInfo.pay_way = this.payBtn2.pay_way
135
+ this.payInfo.f_payment = this.payBtn2.payment
136
+ this.payMethod(this.payBtn2.unionPayAlias, this.payBtn2.method)
137
+ } else {
138
+ this.payInfo.pay_way = this.payBtn3.pay_way
139
+ this.payInfo.f_payment = this.payBtn3.payment
140
+ this.payMethod(this.payBtn3.unionPayAlias, this.payBtn3.method)
141
+ }
142
+ }
143
+ },
144
+
145
+ payMethod(unionPayAlias, payMethod) {
146
+ if (payMethod === 'qrcode') {
147
+ this.getQR()
148
+ } else if (payMethod === 'card') {
149
+ this.cardPay(unionPayAlias)
150
+ } else {
151
+ this.$showNewMessage('提示', `未知支付方式:${payMethod},请联系管理员`, ['confirm'], 'newmgs')
152
+ }
153
+ },
154
+
155
+ cardPay(unionPayAlias) {
156
+ let attach = this.obj.getAttach()
157
+ let money = Vue.PosUtil.yuan2fen(this.garbageInfo.money)
158
+ //测试环境支付金额统一改为1分
159
+ if (Vue.PosUtil.posParam.isTest) {
160
+ money = 1
161
+ }
162
+ attach.f_revenue = Vue.PosUtil.posParam.revenue
163
+ attach.money = money
164
+ try {
165
+ HostApp.__this__ = this
166
+ HostApp.pay({
167
+ data: attach,
168
+ callback: 'javascript:HostApp.__this__.toSuccess();'
169
+ }, unionPayAlias)
170
+ } catch (e) {
171
+ console.log('e', e)
172
+ }
173
+ },
174
+ print(){
175
+ try {
176
+ let num = 0.00
177
+ this.garbage.list.forEach(item=>{
178
+ num += item.f_money
179
+ })
180
+ let bigNum = util.numberToChinese(num)
181
+ let date = util.getDate()
182
+ let printContent = []
183
+ let textHead = {type: 3, text: '山西华新科莱天然气有限公司垃圾费收费单', fontsize: 3, isbold: true, align: 'center'}
184
+ printContent.push(textHead)
185
+ printContent.push({type: 4, value: 2, unit: 'line'})
186
+ printContent.push({type: 3, text: '收费日期:' + date, fontsize: 2, isbold: false, align: 'left'})
187
+ printContent.push({type: 3, text: '用户编号:' + this.userInfo.f_userinfo_code, fontsize: 2, isbold: false, align: 'left'})
188
+ printContent.push({type: 3, text: '用户姓名:' + this.userInfo.f_user_name, fontsize: 2, isbold: false, align: 'left'})
189
+ printContent.push({type: 3, text: '用气地址:' + this.userInfo.f_address, fontsize: 2, isbold: false, align: 'left'})
190
+ printContent.push({type: 3, text: '收费项目:' + '垃圾费', fontsize: 2, isbold: false, align: 'left'})
191
+ printContent.push({type: 3, text: '垃圾处理费:' + num, fontsize: 2, isbold: false, align: 'left'})
192
+ printContent.push({type: 3, text: '实收金额(大写):' + bigNum, fontsize: 2, isbold: false, align: 'left'})
193
+ printContent.push({type: 3, text: '打票时间:' + date, fontsize: 2, isbold: false, align: 'left'})
194
+ printContent.push({type: 3, text: '收费员:' + Vue.user.name || Vue.PosUtil.Sn, fontsize: 2, isbold: false, align: 'left'})
195
+ printContent.push({type: 4, value: 4, unit: 'line'})
196
+ this.$AndroidPlugin.print(printContent)
197
+ }catch (e) {
198
+ this.$showNewMessage('错误', '收费打印单失败。')
199
+ }
200
+ this.$back('toMain')
201
+ },
202
+
203
+ // 垃圾费支付成功处理
204
+ toSuccess() {
205
+ this.$showNewMessage('错误', '垃圾费缴费成功!是否打印收费单?', ['confirm', 'cancel'], 'newmgs')
206
+ .then((res) => {
207
+ if (res === 'confirm') {
208
+ this.print()
209
+ } else {
210
+ this.$back('toMain')
211
+ }
212
+ })
213
+ }
214
+ },
215
+
216
+ ready() {
217
+ // 从路由参数获取垃圾费信息
218
+ this.garbageInfo = this.garbage
219
+
220
+ // 设置服务对象里的组件对象
221
+ if (this.obj) {
222
+ this.obj.setComponents(this)
223
+ }
224
+
225
+ this.payBtn1 = this.$PosUtil.posParam.PayBtn1
226
+ this.payBtn2 = this.$PosUtil.posParam.PayBtn2
227
+ this.payBtn3 = this.$PosUtil.posParam.PayBtn3
228
+ this.btn1Path = require(`../image/${this.payBtn1.path}`)
229
+ this.btn2Path = require(`../image/${this.payBtn2.path}`)
230
+ this.btn3Path = require(`../image/${this.payBtn3.path}`)
231
+ }
232
+ }
233
+ </script>