handpos-client 1.0.1 → 1.0.3

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.1",
3
+ "version": "1.0.3",
4
4
  "description": "手持POS",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -0,0 +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,208 +1,212 @@
1
- <template>
2
- <div >
3
- <div class="mhead">
4
- <ul>
5
- <li>
6
- <text>自助缴费机</text>
7
- </li>
8
- </ul>
9
- </div>
10
- <div class="loadview">
11
- <div class="auto">
12
- <div class="loading-text-style">
13
- <span class="text-style span-height-center">{{loading_text}}{{dots}}</span>
14
- </div>
15
- <div class="ErrorBtnLocation">
16
- <button class="InitErrorBtn btn btn-danger" v-if="errorShow" @click="start">重试</button>
17
- </div>
18
- </div>
19
- </div>
20
- <div class="foot">
21
- <text >返回</text>
22
- </div>
23
- </div>
24
- </template>
25
-
26
- <script>
27
- import Vue from 'vue'
28
- let getConfig = self => {
29
- console.group('getConfigParam')
30
- let param = {
31
- device_num: self.$PosUtil.Sn
32
- }
33
- console.log('getConfigParam参数: ', param)
34
- self.$resetpost(Vue.ProxyUrl +'rs/logic/getConfigParam', param, {resolveMsg: null, rejectMsg: null}).then(res => {
35
- self.loading_text = "初始化成功"
36
- self.clearThisInterval()
37
- // 设置从后台拿过来的参数值
38
- Object.assign(self.$PosUtil.posParam, res.data)
39
-
40
- console.log(self.$PosUtil.posParam)
41
-
42
- // 验证通过
43
- self.$goto('main', {}, 'self')
44
- }).catch(res => {
45
- console.log('res.status:', res.status)
46
- if (res.status === 501) {
47
- self.loading_text = "该设备未注册,请注册后点击重试"
48
- } else if (res.status === 404) {
49
- self.loading_text = "设备网络故障或连接服务器异常"
50
- } else if (res.status === 500) {
51
- self.loading_text = "服务器内部错误"
52
- } else {
53
- self.loading_text = "未知错误"
54
- }
55
- self.errorShow = true
56
- self.clearThisInterval()
57
- })
58
- console.groupEnd()
59
- }
60
- export default {
61
- title: '初始化',
62
- name: "Init",
63
- data() {
64
- return {
65
- loading_text: '正在对机器进行初始化操作,请稍等',
66
- dots: '',
67
- timeOut: undefined,
68
- timeIndex: 0,
69
- errorShow: false
70
- }
71
- },
72
- ready() {
73
- this.start()
74
- },
75
- methods: {
76
- //判断当前运行环境
77
- isAndroidDevice() {
78
- try {
79
- console.log('android环境')
80
- HostApp
81
- this.$AndroidPlugin.isAndroid = true
82
- Vue.ProxyUrl = this.$AndroidPlugin.getProxyURL() + '/'
83
- } catch (e) {
84
- console.log('PC测试环境')
85
- Vue.AndroidPlugin.isAndroid = false
86
- //如果是非安卓环境,config中配置的链接地址肯定是不能用的,所以改成空的即可
87
- Vue.ProxyUrl = ''
88
- }
89
- },
90
- back(){
91
- this.$back()
92
- },
93
- getSn() {
94
- this.Sn = this.$AndroidPlugin.getSN()
95
- Vue.PosUtil.Sn = this.Sn
96
- },
97
- home() {
98
- this.$AndroidPlugin.back_home()
99
- },
100
- /**
101
- * 给等待条添加一个点
102
- * */
103
- addDots() {
104
- this.timeIndex++
105
- this.dots += '.'
106
- },
107
- /**
108
- * 结束本组件内的计时器
109
- * */
110
- clearThisInterval() {
111
- window.clearInterval(this.timeOut)
112
- this.initDots()
113
- },
114
- /**
115
- * 清空等待条中的点
116
- * */
117
- initDots() {
118
- this.timeIndex = 0
119
- this.dots = ''
120
- },
121
- /**
122
- * 启动计时器
123
- * */
124
- async start() {
125
- await this.isAndroidDevice()
126
- await this.getSn()
127
- this.errorShow = false
128
- this.loading_text = '正在进行初始化操作,请稍等...'
129
- this.timeOut = window.setInterval(this.setTimeOutMethod, 1000)
130
- getConfig(this)
131
- },
132
- // 判断增加一个点还是清空点
133
- setTimeOutMethod() {
134
- this.timeIndex >= 3 ? this.initDots() : this.addDots()
135
- }
136
- }
137
- }
138
- </script>
139
- <style>
140
- .span-height-center {
141
- position: relative;
142
- top: 35%;
143
- }
144
-
145
- .text-style {
146
- font-size: 30px;
147
- color: black;
148
- font-weight: bolder;
149
- }
150
-
151
- .div-height10 {
152
- height: 10%
153
- }
154
-
155
- .div-height20 {
156
- height: 20%
157
- }
158
-
159
- .div-height30 {
160
- height: 30%
161
- }
162
-
163
- .div-height40 {
164
- height: 40%
165
- }
166
-
167
- .div-height50 {
168
- height: 50%
169
- }
170
-
171
- .div-height60 {
172
- height: 60%
173
- }
174
-
175
- .div-height70 {
176
- height: 70%
177
- }
178
-
179
- .div-height80 {
180
- height: 80%
181
- }
182
-
183
- .div-height90 {
184
- height: 90%
185
- }
186
-
187
- .div-height100 {
188
- height: 100%
189
- }
190
-
191
- .loading-text-style {
192
- margin: 0 10% 0 10%;
193
- height: 30%;
194
- border-radius: 10px;
195
- text-align: center
196
- }
197
-
198
- .InitErrorBtn {
199
- width: 150px;
200
- height: 60px;
201
- font-size: 20px;
202
- }
203
-
204
- .ErrorBtnLocation {
205
- position: relative;
206
- height: 0;
207
- }
208
- </style>
1
+ <template>
2
+ <div >
3
+ <div class="mhead">
4
+ <ul>
5
+ <li>
6
+ <text>自助缴费机</text>
7
+ </li>
8
+ </ul>
9
+ </div>
10
+ <div class="loadview">
11
+ <div class="auto">
12
+ <div class="loading-text-style">
13
+ <span class="text-style span-height-center">{{loading_text}}{{dots}}</span>
14
+ </div>
15
+ <div class="ErrorBtnLocation">
16
+ <button class="InitErrorBtn btn btn-danger" v-if="errorShow" @click="start">重试</button>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ <div class="foot">
21
+ <text >返回</text>
22
+ </div>
23
+ </div>
24
+ </template>
25
+
26
+ <script>
27
+ import Vue from 'vue'
28
+ let getConfig = self => {
29
+ console.group('getConfigParam')
30
+ let param = {
31
+ device_num: self.$PosUtil.Sn
32
+ }
33
+ console.log('getConfigParam参数: ', param)
34
+ self.$resetpost(Vue.ProxyUrl +'rs/logic/getConfigParam', param, {resolveMsg: null, rejectMsg: null}).then(res => {
35
+ self.loading_text = "初始化成功"
36
+ self.clearThisInterval()
37
+ // 设置从后台拿过来的参数值
38
+ Object.assign(self.$PosUtil.posParam, res.data)
39
+
40
+ console.log(self.$PosUtil.posParam)
41
+
42
+ // 验证通过
43
+ self.$goto('main', {}, 'self')
44
+ }).catch(res => {
45
+ console.log('res.status:', res.status)
46
+ if (res.status === 501) {
47
+ self.loading_text = "该设备未注册,请注册后点击重试"
48
+ } else if (res.status === 404) {
49
+ self.loading_text = "设备网络故障或连接服务器异常"
50
+ } else if (res.status === 500) {
51
+ self.loading_text = "服务器内部错误"
52
+ } else {
53
+ self.loading_text = "未知错误"
54
+ }
55
+ self.errorShow = true
56
+ self.clearThisInterval()
57
+ })
58
+ console.groupEnd()
59
+ }
60
+ export default {
61
+ title: '初始化',
62
+ name: "Init",
63
+ data() {
64
+ return {
65
+ loading_text: '正在对机器进行初始化操作,请稍等',
66
+ dots: '',
67
+ timeOut: undefined,
68
+ timeIndex: 0,
69
+ errorShow: false
70
+ }
71
+ },
72
+ ready() {
73
+ this.start()
74
+ },
75
+ methods: {
76
+ //判断当前运行环境
77
+ isAndroidDevice() {
78
+ try {
79
+ console.log('android环境')
80
+ HostApp
81
+ this.$AndroidPlugin.isAndroid = true
82
+ let url = this.$AndroidPlugin.getProxyURL() + '/'
83
+ if (Vue.phoneBuild){
84
+ url = this.$AndroidPlugin.getProxyURL() + '/pos/'
85
+ }
86
+ Vue.ProxyUrl = url
87
+ } catch (e) {
88
+ console.log('PC测试环境')
89
+ Vue.AndroidPlugin.isAndroid = false
90
+ //如果是非安卓环境,config中配置的链接地址肯定是不能用的,所以改成空的即可
91
+ Vue.ProxyUrl = ''
92
+ }
93
+ },
94
+ back(){
95
+ this.$back()
96
+ },
97
+ getSn() {
98
+ this.Sn = this.$AndroidPlugin.getSN()
99
+ Vue.PosUtil.Sn = this.Sn
100
+ },
101
+ home() {
102
+ this.$AndroidPlugin.back_home()
103
+ },
104
+ /**
105
+ * 给等待条添加一个点
106
+ * */
107
+ addDots() {
108
+ this.timeIndex++
109
+ this.dots += '.'
110
+ },
111
+ /**
112
+ * 结束本组件内的计时器
113
+ * */
114
+ clearThisInterval() {
115
+ window.clearInterval(this.timeOut)
116
+ this.initDots()
117
+ },
118
+ /**
119
+ * 清空等待条中的点
120
+ * */
121
+ initDots() {
122
+ this.timeIndex = 0
123
+ this.dots = ''
124
+ },
125
+ /**
126
+ * 启动计时器
127
+ * */
128
+ async start() {
129
+ await this.isAndroidDevice()
130
+ await this.getSn()
131
+ this.errorShow = false
132
+ this.loading_text = '正在进行初始化操作,请稍等...'
133
+ this.timeOut = window.setInterval(this.setTimeOutMethod, 1000)
134
+ getConfig(this)
135
+ },
136
+ // 判断增加一个点还是清空点
137
+ setTimeOutMethod() {
138
+ this.timeIndex >= 3 ? this.initDots() : this.addDots()
139
+ }
140
+ }
141
+ }
142
+ </script>
143
+ <style>
144
+ .span-height-center {
145
+ position: relative;
146
+ top: 35%;
147
+ }
148
+
149
+ .text-style {
150
+ font-size: 30px;
151
+ color: black;
152
+ font-weight: bolder;
153
+ }
154
+
155
+ .div-height10 {
156
+ height: 10%
157
+ }
158
+
159
+ .div-height20 {
160
+ height: 20%
161
+ }
162
+
163
+ .div-height30 {
164
+ height: 30%
165
+ }
166
+
167
+ .div-height40 {
168
+ height: 40%
169
+ }
170
+
171
+ .div-height50 {
172
+ height: 50%
173
+ }
174
+
175
+ .div-height60 {
176
+ height: 60%
177
+ }
178
+
179
+ .div-height70 {
180
+ height: 70%
181
+ }
182
+
183
+ .div-height80 {
184
+ height: 80%
185
+ }
186
+
187
+ .div-height90 {
188
+ height: 90%
189
+ }
190
+
191
+ .div-height100 {
192
+ height: 100%
193
+ }
194
+
195
+ .loading-text-style {
196
+ margin: 0 10% 0 10%;
197
+ height: 30%;
198
+ border-radius: 10px;
199
+ text-align: center
200
+ }
201
+
202
+ .InitErrorBtn {
203
+ width: 150px;
204
+ height: 60px;
205
+ font-size: 20px;
206
+ }
207
+
208
+ .ErrorBtnLocation {
209
+ position: relative;
210
+ height: 0;
211
+ }
212
+ </style>