handpos-client 1.0.0 → 1.0.2

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +9 -9
  2. package/README.md +3 -3
  3. package/build/dev-android.js +80 -82
  4. package/build/dev-server.js +0 -7
  5. package/build/webpack.base.conf.js +6 -6
  6. package/build/webpack.baseandroid.conf.js +87 -83
  7. package/index.html +1 -1
  8. package/oa.iml +9 -0
  9. package/package.json +7 -4
  10. package/src/App.vue +0 -2
  11. package/src/aotePos-android.js +49 -0
  12. package/src/aotePos.js +66 -70
  13. package/src/bootstrap/less/navs.less +1 -1
  14. package/src/components/Init.vue +114 -108
  15. package/src/components/Main.vue +81 -80
  16. package/src/components/css/garbage.less +80 -0
  17. package/src/components/css/style.less +119 -51
  18. package/src/components/garbage/GarbageInfo.vue +212 -0
  19. package/src/components/garbage/GarbagePayWay.vue +199 -0
  20. package/src/components/garbage/GarbageScanNative.vue +87 -0
  21. package/src/components/image/Payway.png +0 -0
  22. package/src/components/image/cardSale.png +0 -0
  23. package/src/components/image/ccbpay.png +0 -0
  24. package/src/components/image/code.jpg +0 -0
  25. package/src/components/image/guangda190603.jpg +0 -0
  26. package/src/components/image/machineSale.png +0 -0
  27. package/src/components/image/select.png +0 -0
  28. package/src/components/image/xxxk.png +0 -0
  29. package/src/components/main/CardMain.vue +47 -0
  30. package/src/components/main/MachineMain.vue +143 -0
  31. package/src/components/pay/PayWay.vue +173 -0
  32. package/src/components/pay/ScanNative.vue +87 -0
  33. package/src/components/pay/WriteCard.vue +141 -0
  34. package/src/components/public/BuyGas.vue +306 -0
  35. package/src/components/public/HistorySellList.vue +65 -0
  36. package/src/components/public/WritecardInfo.vue +114 -0
  37. package/src/components/sellgas/CardSellGas.vue +437 -0
  38. package/src/components/sellgas/IotSellGas.vue +155 -0
  39. package/src/components/sellgas/MachineSellGasGas.vue +145 -0
  40. package/src/components/sellgas/MachineSellGasMoney.vue +174 -0
  41. package/src/components/userinfo/UserInfo.vue +145 -0
  42. package/src/main.js +18 -23
  43. package/src/plugin/AndroidPlugin-/346/274/224/347/244/272/347/263/273/347/273/237.js +102 -0
  44. package/src/plugin/AndroidPlugin.js +107 -0
  45. package/src/plugin/DateUtil.js +32 -0
  46. package/src/plugin/HttpReset.js +124 -0
  47. package/src/plugin/Httputil.js +39 -0
  48. package/src/{Plugin → plugin}/PosUtil.js +21 -19
  49. package/src/service/CheckCard.js +103 -0
  50. package/src/service/GarbagePayWay.js +101 -0
  51. package/src/service/GarbageScanNative.js +116 -0
  52. package/src/service/GetCardInfo.js +88 -0
  53. package/src/service/PayWay.js +121 -0
  54. package/src/service/ScanNative.js +118 -0
  55. package/src/service/WriteCard.js +262 -0
  56. package/src/Plugin/AndroidPlugin.js +0 -141
  57. package/src/components/charge/card/CardInfo.vue +0 -43
  58. package/src/components/charge/card/ReadCardInter.vue +0 -176
  59. package/src/components/charge/card/ReadCardToBuy.vue +0 -174
  60. package/src/components/charge/machine/MachineSearch.Vue +0 -124
  61. package/src/components/charge/payment/OrderInfo.vue +0 -283
  62. package/src/components/charge/payment/ScanNative.vue +0 -162
  63. package/src/components/charge/sellgas/CardSellGas.vue +0 -365
  64. package/src/components/charge/sellgas/ChoosePayWay.vue +0 -275
  65. package/src/components/charge/sellgas/GudingPrice.vue +0 -38
  66. package/src/components/charge/sellgas/JietiPrice.vue +0 -54
  67. package/src/components/charge/sellgas/ScanQrcode.vue +0 -171
  68. package/src/components/charge/sellgas/WriteCard.vue +0 -283
  69. package/src/components/charge/userinfo/ChangeMeterList.vue +0 -43
  70. package/src/components/charge/userinfo/FillGasList.vue +0 -43
  71. package/src/components/charge/userinfo/HistorySellList.vue +0 -93
  72. package/src/components/charge/userinfo/OtherList.vue +0 -43
  73. package/src/components/charge/userinfo/SellList.vue +0 -43
  74. package/src/components/charge/userinfo/TransList.vue +0 -43
  75. package/src/components/charge/userinfo/UserInfo.vue +0 -201
  76. package/src/components/charge/userinfo/WritecardInfo.vue +0 -44
  77. package/src/components/ztprint.js +0 -26
  78. /package/src/components/image/{card.gif → readCard.gif} +0 -0
@@ -0,0 +1,145 @@
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" style="overflow:auto;">
11
+ <div class="userinfo" style="height: 33%">
12
+ <table width="96%" border="0" style="font-size:16px;margin-right:2%;margin-left:2%;" >
13
+ <tr>
14
+ <td colspan="6" class="lab"><span><img src="../image/titleicon01.png" width="26" height="26" alt=""/></span> 档案信息</td>
15
+ </tr>
16
+ <tr>
17
+ <td width="60" align="right">用户编号:</td>
18
+ <td><input type="text" v-model="userInfo.f_userinfo_code" readonly/></td>
19
+ </tr>
20
+ <tr>
21
+ <td width="80" align="right">用户名称:</td>
22
+ <td colspan="2"><input type="text" v-model="userInfo.f_user_name" readonly/>
23
+ </tr>
24
+ <tr>
25
+ <td width="80" align="right">滞 纳 金:</td>
26
+ <td><input type="text" v-model="userInfo.f_gasproperties" readonly/></td>
27
+ </tr>
28
+ <tr>
29
+ <td width="80" align="right">账户结余:</td>
30
+ <td><input type="text" v-model="userInfo.f_balance" readonly/></td>
31
+ </tr>
32
+ <!-- <tr>-->
33
+ <!-- <td width="80" align="right">用户地址:</td>-->
34
+ <!-- <td colspan="5"><input type="text" v-model="userInfo.f_address" readonly/></td>-->
35
+ <!-- </tr>-->
36
+ </table>
37
+ </div>
38
+ <tabset v-ref:tabs :close="false" class="lists">
39
+ <tab header='预写卡信息' class="tabview" v-if="isWriteCard">
40
+ <write-card-info> </write-card-info>
41
+ </tab>
42
+ <tab header='购气' class="tabview" v-if="!isWriteCard">
43
+ <buy-gas :user="userInfo"> </buy-gas>
44
+ <button type="button" class="btn-primary" style="width: 33%;font-size: 16px;padding: 10px;margin-left: 33%;" @click="generScan()" :disabled="!canBuy">确认订单</button>
45
+ </tab>
46
+ <tab header='历史购气记录' class="tabview">
47
+ <history-sell-list :rows="rows" :sell_date="sellDate"> </history-sell-list>
48
+ </tab>
49
+ </tabset>
50
+ </div>
51
+ <div class="foot" @click="back('toMain')">
52
+ <text>返回</text>
53
+ </div>
54
+ </div>
55
+ </template>
56
+ <script>
57
+ import WriteCard from '../../service/WriteCard'
58
+ import ScanNative from '../../service/ScanNative'
59
+ import PayWay from "../../service/PayWay";
60
+ import co from 'co'
61
+ import Vue from 'vue'
62
+
63
+ // 查询收费记录
64
+ let userInfoGen = function * (condition, self) {
65
+ self.$pospost(Vue.ProxyUrl + 'rs/sql/' + Vue.PosUtil.posParam.revenue + 'getSellgas', {data: {condition: condition}}, {resolveMsg: null, rejectMsg: null}).then((ret) => {
66
+ self.rows = ret.data
67
+ })
68
+ }
69
+ export default{
70
+ title: '用户信息',
71
+ data () {
72
+ return {
73
+ cardInfo: {},
74
+ // 预写卡信息
75
+ stairPrices: [],
76
+ userInfo: {},
77
+ tieredPrice: false,
78
+ // 阶梯单价信息
79
+ stair: {},
80
+ // 固定气价单价
81
+ unitPrice: 0,
82
+ isWriteCard: false,
83
+ rows: [],
84
+ sellDate: '',
85
+ canBuy: false,
86
+ chargePrice: {}
87
+ }
88
+ },
89
+ methods: {
90
+ back (param) {
91
+ this.$back(param)
92
+ },
93
+ // 卡表用户存在未写卡收费记录时需要先写卡
94
+ writeCard (msg) {
95
+ this.$showNewMessage('提示', msg + '点击"确认"开始写卡', ['confirm'], 'newMsg').then((res) => {
96
+ if (res === 'confirm') {
97
+ var stairPrice = this.stairPrices[0]
98
+ this.$goto('order-info', {
99
+ userInfo: this.userInfo,
100
+ cardInfo: this.cardInfo,
101
+ stairPrice: stairPrice,
102
+ status: 1,
103
+ obj: new WriteCard()
104
+ }, 'self', this.back)
105
+ }
106
+ })
107
+ },
108
+ generScan() {
109
+ this.chargePrice.f_totalcost = Number(((this.chargePrice.f_preamount - 0) - (this.chargePrice.f_balance - 0)).toFixed(2))
110
+ this.chargePrice.f_curbalance = Number((this.curbalance - 0).toFixed(2))
111
+ // 选择支付方式 轮询数据库 写卡
112
+ console.log('确认订单后', this)
113
+ let services = [new PayWay(this), new ScanNative(), new WriteCard()]
114
+ // 构建服务引用链
115
+ this.$PosUtil.buildLinked(services)
116
+ // 开启事务
117
+ Vue.eventBack(services)
118
+ }
119
+ },
120
+ ready () {
121
+ this.sellDate = this.$PosUtil.posParam.f_delivery_date
122
+
123
+ // 是否有线下写卡
124
+ this.isWriteCard = this.stairPrices.length > 0
125
+
126
+ if (this.userInfo.f_price_type === '固定气价') {
127
+ this.tieredPrice = true
128
+ }
129
+ // 获取用户历史收费记录
130
+ let condition = 'f_user_id=\'' + this.userInfo.f_user_id + '\''
131
+ co(userInfoGen(condition, this))
132
+
133
+ // 线下圈存
134
+ if (this.isWriteCard) {
135
+ this.writeCard('您有' + this.stairPrices.length + '笔未写卡的缴费记录,是否现在写卡?')
136
+ }
137
+ },
138
+ events: {
139
+ 'keyValue': function (stairPrice) {
140
+ this.chargePrice = stairPrice
141
+ this.canBuy = true
142
+ }
143
+ }
144
+ }
145
+ </script>
@@ -0,0 +1,174 @@
1
+ <template>
2
+ <div >
3
+ <div class="mhead">
4
+ <ul>
5
+ <li>
6
+ <text>machine购气写卡</text>
7
+ </li>
8
+ </ul>
9
+ </div>
10
+ <div class="body" style="overflow:auto;">
11
+ <div class="userinfo" style="height: 33%">
12
+ <table width="96%" border="0" style="font-size:16px;margin-right:2%;margin-left:2%;" >
13
+ <tr>
14
+ <td colspan="6" class="lab"><span><img src="../image/titleicon01.png" width="26" height="26" alt=""/></span> 档案信息</td>
15
+ </tr>
16
+ <tr>
17
+ <td width="60" align="right">用户编号:</td>
18
+ <td><input type="text" v-model="userInfo.f_userinfo_code" readonly/></td>
19
+ </tr>
20
+ <tr>
21
+ <td width="80" align="right">用户名称:</td>
22
+ <td colspan="2"><input type="text" v-model="userInfo.f_user_name" readonly/>
23
+ </tr>
24
+ <tr>
25
+ <td width="80" align="right">滞 纳 金:</td>
26
+ <td><input type="text" v-model="this.overDue" readonly/></td>
27
+ </tr>
28
+ <tr>
29
+ <td width="80" align="right">账户结余:</td>
30
+ <td><input type="text" v-model="userInfo.f_balance" readonly/></td>
31
+ </tr>
32
+ <!-- <tr>-->
33
+ <!-- <td width="80" align="right">用户地址:</td>-->
34
+ <!-- <td colspan="5"><input type="text" v-model="userInfo.f_address" readonly/></td>-->
35
+ <!-- </tr>-->
36
+ </table>
37
+ </div>
38
+ <tabset v-ref:tabs :close="false" class="lists">
39
+ <tab header='预写卡信息' class="tabview" v-if="isWriteCard">
40
+ <write-card-info> </write-card-info>
41
+ </tab>
42
+ <tab header='购气' class="tabview" v-if="!isWriteCard">
43
+ <table class="buyTab">
44
+ <tr>
45
+ <td>预购金额(元):<input type="text" v-el:inputfee v-model="stairPrice.f_preamount" :readonly="userInfo.f_collection_type === '按金额'||isReadOnly" @blur="preamount"/></td>
46
+ </tr>
47
+ <tr>
48
+ <td>本次缴费(元):<input type="text" v-model="stairPrice.f_collection" readonly/></td>
49
+ </tr>
50
+ </table>
51
+ <button type="button" class="btn-primary" style="width: 33%;font-size: 16px;padding: 10px;margin-left: 33%;" @click="generScan()" :disabled="!canBuy">确认订单</button>
52
+ </tab>
53
+ <tab header='历史购气记录' class="tabview">
54
+ <history-sell-list :rows="rows" :sell_date="sellDate"> </history-sell-list>
55
+ </tab>
56
+ </tabset>
57
+ </div>
58
+ <div class="foot" @click="back('toMain')">
59
+ <text>返回</text>
60
+ </div>
61
+ </div>
62
+ </template>
63
+ <script>
64
+ import WriteCard from '../../service/WriteCard'
65
+ import ScanNative from '../../service/ScanNative'
66
+ import PayWay from "../../service/PayWay";
67
+ import co from 'co'
68
+ import Vue from 'vue'
69
+
70
+ // 查询收费记录
71
+ let userInfoGen = function * (condition, self) {
72
+ self.$pospost(Vue.ProxyUrl + 'rs/sql/' + Vue.PosUtil.posParam.revenue + 'getSellgas', {data: {condition: condition}}, {resolveMsg: null, rejectMsg: null}).then((ret) => {
73
+ self.rows = ret.data
74
+ })
75
+ }
76
+
77
+ export default{
78
+ title: '用户信息',
79
+ data () {
80
+ return {
81
+ cardInfo: {},
82
+ // 预写卡信息
83
+ stairPrices: [],
84
+ userInfo: {},
85
+ tieredPrice: false,
86
+ // 阶梯单价信息
87
+ stair: {},
88
+ // 固定气价单价
89
+ unitPrice: 0,
90
+ isWriteCard: false,
91
+ rows: [],
92
+ sellDate: '',
93
+ canBuy: false,
94
+ chargePrice: {},
95
+ overDue: 0
96
+ }
97
+ },
98
+ methods: {
99
+ back (param) {
100
+ this.$back(param)
101
+ },
102
+ // 卡表用户存在未写卡收费记录时需要先写卡
103
+ writeCard (msg) {
104
+ this.$showNewMessage('提示', msg + '点击"确认"开始写卡', ['confirm'], 'newMsg').then((res) => {
105
+ if (res === 'confirm') {
106
+ var stairPrice = this.stairPrices[0]
107
+ this.$goto('order-info', {
108
+ userInfo: this.userInfo,
109
+ cardInfo: this.cardInfo,
110
+ stairPrice: stairPrice,
111
+ status: 1,
112
+ obj: new WriteCard()
113
+ }, 'self', this.back)
114
+ }
115
+ })
116
+ },
117
+ generScan() {
118
+ this.chargePrice.f_totalcost = Number(((this.chargePrice.f_preamount - 0) - (this.chargePrice.f_balance - 0)).toFixed(2))
119
+ this.chargePrice.f_curbalance = Number((this.curbalance - 0).toFixed(2))
120
+ // 选择支付方式 轮询数据库 写卡
121
+ console.log('确认订单后', this)
122
+ let services = [new PayWay(this), new ScanNative(), new WriteCard()]
123
+ // 构建服务引用链
124
+ this.$PosUtil.buildLinked(services)
125
+ // 开启事务
126
+ Vue.eventBack(services)
127
+ },
128
+ getOverDue (info) {
129
+ this.$resetpost(Vue.ProxyUrl + 'rs/logic/' + Vue.PosUtil.posParam.revenue + 'getOverDue',{data: info}, {resolveMsg: null, rejectMsg: null}).then((ret) => {
130
+ console.log('滞纳金结果:', ret.data)
131
+ this.overDue = ret.data.resJson.oweinfo.oughtfee
132
+ console.log(this.overDue)
133
+ }).catch(function (error) {
134
+ console.log('ceshi', error)
135
+ })
136
+ }
137
+ },
138
+ ready () {
139
+ console.log('machine用户信息为: ', this.userInfo)
140
+ this.sellDate = this.$PosUtil.posParam.f_delivery_date
141
+
142
+ // 是否有线下写卡
143
+ this.isWriteCard = this.stairPrices.length > 0
144
+
145
+ let info = {
146
+ f_userinfo_code: this.userInfo.f_userinfo_code,
147
+ f_filialeid: this.userInfo.f_filialeid
148
+ }
149
+
150
+ // 获取
151
+ this.getOverDue(info)
152
+
153
+ if (this.userInfo.f_price_type === '固定气价') {
154
+ this.tieredPrice = true
155
+ }
156
+ // 获取用户历史收费记录
157
+ let condition = 'f_user_id=\'' + this.userInfo.f_user_id + '\''
158
+ console.log('machine用户信息为: ', this.userInfo)
159
+ co(userInfoGen(condition, this))
160
+
161
+
162
+ // 线下圈存
163
+ if (this.isWriteCard) {
164
+ this.writeCard('您有' + this.stairPrices.length + '笔未写卡的缴费记录,是否现在写卡?')
165
+ }
166
+ },
167
+ events: {
168
+ 'keyValue': function (stairPrice) {
169
+ this.chargePrice = stairPrice
170
+ this.canBuy = true
171
+ }
172
+ }
173
+ }
174
+ </script>
@@ -0,0 +1,145 @@
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" style="overflow:auto;">
11
+ <div class="userinfo" style="height: 33%">
12
+ <table width="96%" border="0" style="font-size:16px;margin-right:2%;margin-left:2%;" >
13
+ <tr>
14
+ <td colspan="6" class="lab"><span><img src="../image/titleicon01.png" width="26" height="26" alt=""/></span> 档案信息</td>
15
+ </tr>
16
+ <tr>
17
+ <td width="60" align="right">用户编号:</td>
18
+ <td><input type="text" v-model="userInfo.f_userinfo_code" readonly/></td>
19
+ </tr>
20
+ <tr>
21
+ <td width="80" align="right">用户名称:</td>
22
+ <td colspan="2"><input type="text" v-model="userInfo.f_user_name" readonly/>
23
+ </tr>
24
+ <tr>
25
+ <td width="80" align="right">滞 纳 金:</td>
26
+ <td><input type="text" v-model="userInfo.f_gasproperties" readonly/></td>
27
+ </tr>
28
+ <tr>
29
+ <td width="80" align="right">账户结余:</td>
30
+ <td><input type="text" v-model="userInfo.f_balance" readonly/></td>
31
+ </tr>
32
+ <!-- <tr>-->
33
+ <!-- <td width="80" align="right">用户地址:</td>-->
34
+ <!-- <td colspan="5"><input type="text" v-model="userInfo.f_address" readonly/></td>-->
35
+ <!-- </tr>-->
36
+ </table>
37
+ </div>
38
+ <tabset v-ref:tabs :close="false" class="lists">
39
+ <tab header='预写卡信息' class="tabview" v-if="isWriteCard">
40
+ <write-card-info> </write-card-info>
41
+ </tab>
42
+ <tab header='购气' class="tabview" v-if="!isWriteCard">
43
+ <buy-gas :user="userInfo"> </buy-gas>
44
+ <button type="button" class="btn-primary" style="width: 33%;font-size: 16px;padding: 10px;margin-left: 33%;" @click="generScan()" :disabled="!canBuy">确认订单</button>
45
+ </tab>
46
+ <tab header='历史购气记录' class="tabview">
47
+ <history-sell-list :rows="rows" :sell_date="sellDate"> </history-sell-list>
48
+ </tab>
49
+ </tabset>
50
+ </div>
51
+ <div class="foot" @click="back('toMain')">
52
+ <text>返回</text>
53
+ </div>
54
+ </div>
55
+ </template>
56
+ <script>
57
+ import WriteCard from '../../service/WriteCard'
58
+ import ScanNative from '../../service/ScanNative'
59
+ import PayWay from "../../service/PayWay";
60
+ import co from 'co'
61
+ import Vue from 'vue'
62
+
63
+ // 查询收费记录
64
+ let userInfoGen = function * (condition, self) {
65
+ self.$pospost(Vue.ProxyUrl + 'rs/sql/' + Vue.PosUtil.posParam.revenue + 'getSellgas', {data: {condition: condition}}, {resolveMsg: null, rejectMsg: null}).then((ret) => {
66
+ self.rows = ret.data
67
+ })
68
+ }
69
+ export default{
70
+ title: '用户信息',
71
+ data () {
72
+ return {
73
+ cardInfo: {},
74
+ // 预写卡信息
75
+ stairPrices: [],
76
+ userInfo: {},
77
+ tieredPrice: false,
78
+ // 阶梯单价信息
79
+ stair: {},
80
+ // 固定气价单价
81
+ unitPrice: 0,
82
+ isWriteCard: false,
83
+ rows: [],
84
+ sellDate: '',
85
+ canBuy: false,
86
+ chargePrice: {}
87
+ }
88
+ },
89
+ methods: {
90
+ back (param) {
91
+ this.$back(param)
92
+ },
93
+ // 卡表用户存在未写卡收费记录时需要先写卡
94
+ writeCard (msg) {
95
+ this.$showNewMessage('提示', msg + '点击"确认"开始写卡', ['confirm'], 'newMsg').then((res) => {
96
+ if (res === 'confirm') {
97
+ var stairPrice = this.stairPrices[0]
98
+ this.$goto('order-info', {
99
+ userInfo: this.userInfo,
100
+ cardInfo: this.cardInfo,
101
+ stairPrice: stairPrice,
102
+ status: 1,
103
+ obj: new WriteCard()
104
+ }, 'self', this.back)
105
+ }
106
+ })
107
+ },
108
+ generScan() {
109
+ this.chargePrice.f_totalcost = Number(((this.chargePrice.f_preamount - 0) - (this.chargePrice.f_balance - 0)).toFixed(2))
110
+ this.chargePrice.f_curbalance = Number((this.curbalance - 0).toFixed(2))
111
+ // 选择支付方式 轮询数据库 写卡
112
+ console.log('确认订单后', this)
113
+ let services = [new PayWay(this), new ScanNative(), new WriteCard()]
114
+ // 构建服务引用链
115
+ this.$PosUtil.buildLinked(services)
116
+ // 开启事务
117
+ Vue.eventBack(services)
118
+ }
119
+ },
120
+ ready () {
121
+ this.sellDate = this.$PosUtil.posParam.f_delivery_date
122
+
123
+ // 是否有线下写卡
124
+ this.isWriteCard = this.stairPrices.length > 0
125
+
126
+ if (this.userInfo.f_price_type === '固定气价') {
127
+ this.tieredPrice = true
128
+ }
129
+ // 获取用户历史收费记录
130
+ let condition = 'f_user_id=\'' + this.userInfo.f_user_id + '\''
131
+ co(userInfoGen(condition, this))
132
+
133
+ // 线下圈存
134
+ if (this.isWriteCard) {
135
+ this.writeCard('您有' + this.stairPrices.length + '笔未写卡的缴费记录,是否现在写卡?')
136
+ }
137
+ },
138
+ events: {
139
+ 'keyValue': function (stairPrice) {
140
+ this.chargePrice = stairPrice
141
+ this.canBuy = true
142
+ }
143
+ }
144
+ }
145
+ </script>
package/src/main.js CHANGED
@@ -1,23 +1,18 @@
1
-
2
- import Vue from 'vue'
3
- import App from './App'
4
- import 'babel-polyfill'
5
- import { all } from 'vue-client'
6
- import aotePos from './aotePos'
7
- // import { system } from 'system-clients'
8
-
9
- // import './components/js/jquery.min.js'
10
- // import './components/js/bootstrap.min.js'
11
- Vue.config.silent = true
12
- all()
13
- aotePos()
14
- // system()
15
-
16
- require('./bootstrap/less/bootstrap.less')
17
- require('./components/css/style.less')
18
-
19
- /* eslint-disable no-new */
20
- new Vue({
21
- el: 'body',
22
- components: { App }
23
- })
1
+ import Vue from 'vue'
2
+ import App from './App'
3
+ import 'babel-polyfill'
4
+ import { all } from 'vue-client'
5
+ import aotePos from './aotePos'
6
+
7
+ Vue.config.silent = true
8
+ all()
9
+ aotePos()
10
+
11
+ require('./bootstrap/less/bootstrap.less')
12
+ require('./components/css/style.less')
13
+
14
+ /* eslint-disable no-new */
15
+ new Vue({
16
+ el: 'body',
17
+ components: { App }
18
+ })
@@ -0,0 +1,102 @@
1
+ import Vue from 'vue'
2
+
3
+ let AndroidPlugin = {
4
+ install(Vue, options) {
5
+ // 给vue增添对话框显示方法
6
+ Vue.AndroidPlugin = Vue.prototype.$AndroidPlugin = AndroidPlugin
7
+ },
8
+ isAndroid : false,
9
+ // 系统提示
10
+ alert (msg) {
11
+ if (false) {
12
+ HostApp.alert(msg)
13
+ } else {
14
+ console.log(msg)
15
+ }
16
+ },
17
+ // 判卡函数
18
+ hasCard(index){
19
+ if (false) {
20
+ return HostApp.hasCard().data
21
+ } else {
22
+ return index > 2
23
+ }
24
+ },
25
+ // 读卡
26
+ read() {
27
+ if (false) {
28
+ if(Vue.PosUtil.posParam.AREA === undefined){
29
+ return HostApp.read()
30
+ }else {
31
+ if(Vue.PosUtil.posParam.Encry){
32
+ let area = Vue.PosUtil.posParam.AREA
33
+ let encrypt = JSON.stringify(Vue.PosUtil.posParam.Encry)
34
+ return HostApp.read(area,encrypt)
35
+ }else {
36
+ let area = Vue.PosUtil.posParam.AREA
37
+ return HostApp.read(area)
38
+ }
39
+ }
40
+ } else {
41
+ return {
42
+ code: 200,
43
+ msg: {
44
+ CardID: '9988776655',
45
+ Factory: 'QiLiangKaBiao',
46
+ Gas: 0,
47
+ Money: 0,
48
+ RenewTimes: 0,
49
+ Meterid: '',
50
+ Times: 4,
51
+ WscKmm: '000000000000000000000000000000000000000000000000',
52
+ Yhh: ''
53
+ }
54
+ }
55
+ }
56
+ },
57
+ // 写卡
58
+ sell (params) {
59
+ if (false) {
60
+ if(Vue.PosUtil.posParam.Encry){
61
+ let encrypt = JSON.stringify(Vue.PosUtil.posParam.Encry)
62
+ return HostApp.sell(JSON.stringify(params),encrypt)
63
+ }else {
64
+ return HostApp.sell(JSON.stringify(params))
65
+ }
66
+ } else {
67
+ return {code: 200, msg: {Err: '修改卡密码错误', Exception: '修改卡密码错误', kmm: '123213123'}}
68
+ }
69
+ },
70
+ //打印
71
+ print(params) {
72
+ if (false) {
73
+ return HostApp.print(JSON.stringify(params))
74
+ } else {
75
+ return {code: 200, msg: '打印机缺纸'}
76
+ }
77
+ },
78
+ //获取SN码
79
+ getSN() {
80
+ if (false) {
81
+ return HostApp.getSN().data
82
+ } else {
83
+ return 'G02203000143'
84
+ }
85
+ },
86
+ // 安卓环境下返回桌面
87
+ back_home() {
88
+ if (false) {
89
+ HostApp.back_home()
90
+ } else {
91
+ console.log('返回桌面')
92
+ }
93
+ },
94
+ getProxyURL() {
95
+ if (false) {
96
+ return HostApp.getProxyUrl().data
97
+ } else {
98
+ return '/pos'
99
+ }
100
+ }
101
+ }
102
+ export default AndroidPlugin