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
@@ -1,275 +0,0 @@
1
- <template>
2
- <div>
3
- <!--<div class="container-fluid toppanel auto">-->
4
- <!--<div class="container">-->
5
- <!--<div class="row margin15">-->
6
- <!--<div class="col-md-6"><img :src="logo()" class="img-responsive" alt=""/></div>-->
7
- <!--<div class="col-md-6 text-right titlebtn">-->
8
- <!--<a href="#" class="back" @click="back('tosell')">返回</a>-->
9
- <!--<a href="#" @click="back('tomain')" class="tomain">退出</a>-->
10
- <!--</div>-->
11
- <!--</div>-->
12
- <!--</div>-->
13
- <!--</div>-->
14
- <div class="mhead" v-if="!hideHead">
15
- <ul>
16
- <li>
17
- <text>购气写卡</text>
18
- </li>
19
- </ul>
20
- </div>
21
- <div class="body">
22
- <div class="container contentpanel auto">
23
- <div class="row buypanel">
24
- <div class="buyform">
25
- <h3 style="color: red;">订单信息</h3>
26
- <div>
27
- <h4>用户编号:{{userInfo.f_userinfo_code}}</h4>
28
- </div>
29
- <div>
30
- <h4>用户名称:{{userInfo.f_user_name}}</h4>
31
- </div>
32
- <div>
33
- <h4>购 气 量:{{stairPrice.f_pregas}} &nbsp;&nbsp;方</h4>
34
- </div>
35
- <div>
36
- <h4>支付金额:{{stairPrice.f_collection}} &nbsp;&nbsp;元</h4>
37
- </div>
38
- </div>
39
- <div class="horizontal" height="auto">
40
- <h3 style="color: red;">请选择支付方式</h3>
41
- <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
42
- <tbody>
43
- <tr>
44
- <td align="center" v-if='payBtn1.show' class="col-xs-4 weixin">
45
- <div @click='pay("1")'>
46
- <img :src="btn1Path" alt=""/>
47
- </div>
48
- </td>
49
-
50
- <td align="center" v-if='payBtn2.show' class="col-xs-4 alipay">
51
- <div @click='pay("2")'>
52
- <img :src="btn2Path " alt=""/>
53
- </div>
54
- </td>
55
-
56
- <td align="center" v-if='payBtn3.show' class="col-xs-4 unionpay">
57
- <div @click='pay("3")'>
58
- <img :src="btn3Path" alt=""/>
59
- </div>
60
- </td>
61
-
62
- </tr>
63
- </tbody>
64
- </table>
65
- </div>
66
- </div>
67
- </div>
68
- </div>
69
- <div class="foot" @click="back('tomain')">
70
- <text>返回</text>
71
- </div>
72
- </div>
73
- </template>
74
- <script>
75
- import co from 'co'
76
- import Vue from 'vue'
77
- let testUnionPaySave = function* (self, data) {
78
- return self.$post(Vue.ProxyUrl + '/rs/logic/saveCharge', {data: data}, {resolveMsg: null, rejectMsg: null})
79
- }
80
- let generateScanGen = function * generateScan(self,attach) {
81
- let money = Vue.PosUtil.yuan2fen(self.stairPrice.f_collection)
82
- //测试环境支付金额统一改为1分
83
- if( self.$PosUtil.posParam.isTest){
84
- money= 1
85
- }
86
- let str = self.$PosUtil.posParam.orderScrib
87
- console.log('generateScanGen中attach',attach)
88
- console.log('self.$PosUtil.posParam',self.$PosUtil.posParam)
89
- //post去后台给微信下单并生成二维码和流水号
90
- self.$resetpost(Vue.ProxyUrl + '/rs/logic/'+self.$PosUtil.posParam.module+'GetCode', {config:self.$PosUtil.posParam.config, f_revenue:self.$PosUtil.posParam.revenue,
91
- pay_way: self.stairPrice.pay_way, money: money + '', attach: attach, body: str ,filiale_wx: self.$PosUtil.posParam.filiale_wx}, {resolveMsg: null, rejectMsg: null}).then((ret) => {
92
- console.log('下单ret===',ret)
93
- console.log(ret.data.code === 200)
94
- if (ret.data.code === 200) {
95
- console.log("ret.data===",ret.data)
96
- self.stairPrice.url = ret.data.url
97
- self.stairPrice.f_serial_id = ret.data.f_out_trade_no //微信订单流水号
98
- console.log('stair',self.stairPrice)
99
- // console.log('this.next',self.next())
100
- console.log('self.back',self.back)
101
- self.$goto('scan-qrcode', {userInfo: self.userInfo, cardInfo: self.cardInfo, stair: self.stairPrice}, 'self', self.back)
102
- // console.log(this)
103
- // 设置下一个服务状态为扫码支付 需要去轮询数据库
104
- // self.next.isQR = true
105
- // this.resolve(true)
106
- } else {
107
- self.$back('getbillerro')
108
- // this.resolve(false)
109
- }
110
- }
111
- ).catch((ret) => {
112
- // this.resolve(false)
113
- console.log(ret)
114
- self.$back('getbillerro')
115
- })
116
- }
117
-
118
- export default {
119
- title: '选择支付方式',
120
- data() {
121
- return {
122
- hadclick: false,
123
- hideHead:false,
124
- // userInfo: {},
125
- // stairPrice: {},
126
- // cardInfo: {},
127
- btn1Path:'',
128
- btn2Path:'',
129
- btn3Path:'',
130
- payBtn1:{
131
- show: false,
132
- path: "",
133
- method:"",
134
- pay_way:"",
135
- payment:""
136
- },
137
- payBtn2: {
138
- show: false,
139
- path: "",
140
- method:"",
141
- pay_way:"",
142
- payment:""
143
- },
144
- payBtn3: {
145
- show: false,
146
- path: "",
147
- method:"",
148
- pay_way:"",
149
- payment:""
150
- },
151
- isMachine: false, //本次流程是否是机表
152
- resolve: undefined,
153
- reject: undefined,
154
- obj: undefined
155
- }
156
- },
157
- props: ['userInfo', 'cardInfo','stairPrice'],
158
- methods: {
159
- logo() {
160
- return Vue.ProxyUrl + '/res/'+this.$PosUtil.posParam.imgpath+'/sublogo.png'
161
- },
162
- back(para) {
163
- // 返回或者退出,回滚该次事务
164
- // this.resolve(false)
165
- this.$back(para)
166
- },
167
- // getQR() {
168
- // this.obj.getQR()
169
- // },
170
- getAttach(){
171
- let attach = {}
172
- console.log("userInfo",this.userInfo,this.cardInfo,this.stairPrice)
173
- attach.f_user_id = this.userInfo.f_user_id //用户ID
174
- // attach.f_card_id = self.cardInfo.CardID
175
- attach.f_pregas = this.stairPrice.f_pregas //购气量
176
- // attach.f_times = self.cardInfo.Times + 1
177
- attach.f_preamount = this.stairPrice.f_preamount
178
- attach.f_payment= this.stairPrice.f_payment
179
- attach.f_terminal_num = this.$PosUtil.Sn //设备值 f_operator
180
- attach.f_collection = this.stairPrice.f_collection
181
- attach.isGasValue = this.userInfo.f_collection_type === '按金额' ? 1 : 0
182
- attach.f_totalcost = this.stairPrice.f_totalcost - 0
183
- attach.isHand = this.userInfo.f_meter_type ==='机表'? 1 :this.userInfo.f_meter_type ==='物联网表'? -1 :0
184
- attach.f_delaypay = this.stairPrice.f_delaypay
185
- attach.hand_ids = this.stairPrice.hand_ids
186
- if(this.cardInfo.Meterid !== undefined && this.cardInfo.Meterid !== ''){
187
- attach.f_meterid = this.cardInfo.Meterid
188
- }
189
- if (this.userInfo.f_meter_type !=='机表'&& this.userInfo.f_meter_type !=='物联网表' ){
190
- attach.f_card_id = this.cardInfo.CardID
191
- attach.f_times =this.cardInfo.Times + 1
192
- }
193
- // 生产环境金额单位由元 转为分
194
- console.log("getAttach()==",attach)
195
- return attach
196
- },
197
- getQR() {
198
- console.log("生成二维码")
199
- if (!this.hadclick) {
200
- this.hadclick = true
201
- let attach = this.getAttach()
202
- console.log("getQR()中attach==",attach)
203
- let gen = generateScanGen(this,attach)
204
- return co(gen)
205
- }
206
- },
207
- payMethod(paymethod) {
208
- console.log('支付方式'+paymethod)
209
- if(paymethod === 'qrcode'){
210
- console.log('扫码支付')
211
- this.getQR()
212
- } else if(paymethod === 'card'){
213
- console.log('银联软件支付')
214
- this.cardPay()
215
- }else{
216
- this.$showMessage(`未知支付方式:${paymethod},请联系管理员`)
217
- }
218
- },
219
- cardPay() {
220
- let data = this.getAttach()
221
- try {
222
- HostApp.__this__ = this
223
- HostApp.pay({
224
- data: data,
225
- callback: 'javascript:HostApp.__this__.toWriteCard();'
226
- })
227
- } catch (e) {
228
- data.f_serial_id = this.$PosUtil.getBillNum()
229
- var gen = testUnionPaySave(this, data)
230
- co(gen)
231
- this.toWriteCard()
232
- }
233
-
234
- },
235
- toWriteCard() {
236
- this.stairPrice.steps = 1
237
- let id = this.$AndroidPlugin.getSellId()
238
- this.stairPrice.id = Number(id)
239
- this.$goto('order-info', {userInfo: this.userInfo, cardInfo: this.cardInfo, stairPrice: this.stairPrice, status:2,obj: this.obj.next}, 'self', this.back)
240
- },
241
- pay(str) {
242
- console.log('点击支付,按钮'+str)
243
- if(str==='1'){
244
- this.stairPrice.pay_way = this.payBtn1.pay_way
245
- this.stairPrice.f_payment = this.payBtn1.payment
246
- this.payMethod(this.payBtn1.method)
247
- }else if (str === '2') {
248
- this.stairPrice.pay_way = this.payBtn2.pay_way
249
- this.stairPrice.f_payment = this.payBtn2.payment
250
- this.payMethod(this.payBtn2.method)
251
- } else {
252
- this.stairPrice.pay_way = this.payBtn2.pay_way
253
- this.stairPrice.f_payment = this.payBtn2.payment
254
- this.payMethod(this.payBtn3.method)
255
- }
256
- }
257
- },
258
- ready() {
259
- this.cardInfo = this.cardInfo
260
- // 服务对象的引用
261
- this.obj = this.obj
262
- this.userInfo = this.userInfo
263
- this.stairPrice = this.stairPrice
264
- this.payBtn1 = this.$PosUtil.posParam.PayBtn1 //支付按钮1
265
- this.payBtn2 = this.$PosUtil.posParam.PayBtn2 //支付按钮2
266
- this.payBtn3 = this.$PosUtil.posParam.PayBtn3 //支付按钮3
267
- this.btn1Path =require(`../../image/${this.payBtn1.path}`)
268
- this.btn2Path =require(`../../image/${this.payBtn2.path}`)
269
- this.btn3Path =require(`../../image/${this.payBtn3.path}`)
270
- // 设置服务对象里的组件对象
271
- // this.obj.setComponents(this)
272
- }
273
- }
274
-
275
- </script>
@@ -1,38 +0,0 @@
1
- <template>
2
- <div >
3
- <table class="tabprice" >
4
- <tr>
5
- <td colspan="6" class="lab"><span><img src="../../image/titleicon03.png" width="26" height="26" alt=""/></span> 收费明细</td>
6
- </tr>
7
- <tr>
8
- <td class="lab" align="right">气价类型:</td>
9
- <td colspan="2" ><input type="text" value="固定气价" readonly/></td>
10
-
11
- </tr>
12
- <tr>
13
- <td class="lab" align="right">单位气价:</td>
14
- <td ><input type="number" v-model="stair.chargeprice[0].f_price" readonly/></td>
15
- <td class="lab" align="right">气量:</td>
16
- <td ><input type="number" v-model="stair.chargeprice[0].f_gas" readonly/></td>
17
- <td class="lab" align="right">金额:</td>
18
- <td ><input type="number" v-model="stair.chargeprice[0].f_money" readonly/></td>
19
- </tr>
20
- <tr>
21
- <td colspan="4" ></td>
22
- <td class="lab" align="right">总计金额:</td>
23
- <td style="font-size: 14px;color: red;"><input type="number" v-model="stair.chargenum" readonly/></td>
24
- </tr>
25
- </table>
26
- </div>
27
- </template>
28
- <script>
29
- export default {
30
- title: '固定气价',
31
- data () {
32
- return {
33
- index: 0
34
- }
35
- },
36
- props: ['stair']
37
- }
38
- </script>
@@ -1,54 +0,0 @@
1
- <template>
2
- <div>
3
- <table class="tabprice" >
4
- <tr>
5
- <td colspan="6" class="lab"><span><img src="../../image/titleicon03.png" width="26" height="26" alt=""/></span> 收费明细</td>
6
- </tr>
7
- <tr>
8
- <td class="lab" align="right">气价类型:</td>
9
- <td colspan="2" ><input type="text" value="阶梯气价" readonly/></td>
10
-
11
- </tr>
12
- <tr>
13
- <td class="lab" align="right">一阶气价:</td>
14
- <td ><input type="number" v-model="stair.f_stair1price" readonly/></td>
15
- <td class="lab" align="right">气量:</td>
16
- <td ><input type="number" v-model="stair.f_stair1amount" readonly/></td>
17
- <td class="lab" align="right">金额:</td>
18
- <td ><input type="number" v-model="stair.f_stair1fee" readonly/></td>
19
- </tr>
20
- <tr>
21
- <td class="lab" align="right">二阶气价:</td>
22
- <td ><input type="number" v-model="stair.f_stair2price" readonly/></td>
23
- <td class="lab" align="right">气量:</td>
24
- <td ><input type="number" v-model="stair.f_stair2amount" readonly/></td>
25
- <td class="lab" align="right">金额:</td>
26
- <td ><input type="number" v-model="stair.f_stair2fee" readonly/></td>
27
- </tr>
28
- <tr>
29
- <td class="lab" align="right">三阶气价:</td>
30
- <td ><input type="number" v-model="stair.f_stair3price" readonly/></td>
31
- <td class="lab" align="right">气量:</td>
32
- <td ><input type="number" v-model="stair.f_stair3amount" readonly/></td>
33
- <td class="lab" align="right">金额:</td>
34
- <td ><input type="number" v-model="stair.f_stair3fee" readonly/></td>
35
- </tr>
36
- <tr>
37
- <td colspan="4" ></td>
38
- <td class="lab" align="right">总计金额:</td>
39
- <td style="font-size: 14px;color: red;"><input type="number" v-model="stair.chargenum" readonly/></td>
40
- </tr>
41
- </table>
42
- </div>
43
- </template>
44
- <script>
45
- export default {
46
- title: '阶梯气价',
47
- data () {
48
- return {
49
- index: 0
50
- }
51
- },
52
- props: ['stair']
53
- }
54
- </script>
@@ -1,171 +0,0 @@
1
- <template>
2
- <div>
3
- <div class="scanppanel">
4
- <!--<div class="mhead">-->
5
- <!--<ul>-->
6
- <!--<li>-->
7
- <!--<a href="#" class="back" @click="isback()"> </a>-->
8
- <!--<a href="#" class="tomain" @click="istomain()"></a>-->
9
- <!--</li>-->
10
- <!--</ul>-->
11
- <!--</div>-->
12
- <div class="mhead" v-if="!hideHead">
13
- <ul>
14
- <li>
15
- <text>购气写卡</text>
16
- </li>
17
- </ul>
18
- </div>
19
- <div class="body">
20
- <div class="timeout">
21
- <ul>
22
- <li>
23
- <a class="noti">请使用<span>{{payinfo.payway}}</span>扫码支付</a>
24
- <a class="timecount" v-if="!isout">支付倒计时:<span>{{second}}秒</span></a>
25
- <a class="timecount" v-if="isout">订单关闭,刷新数据...<span>{{countDown}}秒</span></a>
26
- </li>
27
- </ul>
28
- </div>
29
- <div class="qrcode">
30
-
31
- <div class="qrpanel">
32
- <img class="qrpic" :src="qrsrc" >
33
- </div>
34
- </div>
35
- <div class="notice">
36
- <span>注意:请在规定时间内完成支付,支付完成请等待程序自动执行,如支付超时、失败或需要更换支付方式,请返回重新下单支付</span>
37
- </div>
38
- </div>
39
- <div class="foot" style="margin-top: -5%;" v-if="needback" @click="back('tomain')">
40
- <text>返回</text>
41
- </div>
42
- </div>
43
- <!--<write-card v-if="index===1" :userInfo="userInfo" :cardInfo="cardInfo" :stair="stair" :payinfo="payinfo"> </write-card>-->
44
- </div>
45
- </template>
46
- <script>
47
- import co from 'co'
48
- import Vue from 'vue'
49
- let InterValObj
50
- let checkValObj
51
- let checkBillSateGen = function * (self) {
52
- // ceshi
53
- // window.clearInterval(checkValObj)
54
- // window.clearInterval(InterValObj) // 停止计时器
55
- // self.index = 1
56
- try {
57
- let condition = 'f_serial_id = \'' + self.stair.f_serial_id + '\' and f_user_id = ' + self.userInfo.f_user_id + ' and f_charge_state = \'有效\''
58
- // let condition = 'f_serial_id = \'d25c6969ec1640bfb8d8417383c48694\' and f_user_id = ' + self.userInfo.f_user_id + ' and f_charge_state = \'有效\''
59
- console.log("condition==", condition)
60
- let ret = yield self.$resetpost(Vue.ProxyUrl + '/rs/sql/pos_singleTable_OrderBy', {data: {items: '*', tablename: 't_sellinggas', condition: condition, orderitem: 'f_delivery_date desc'}}, {resolveMsg: null, rejectMsg: null})
61
- console.log("ret== ", ret)
62
- if (ret.data.length === 1) {
63
- window.clearInterval(checkValObj)
64
- window.clearInterval(InterValObj) // 停止计时器
65
- console.log("停止定时器去写卡==", self.stair)
66
- self.stair.id = ret.data[0].id
67
- self.stair.f_operator = ret.data[0].f_operator
68
- self.stair.f_outlets = ret.data[0].f_outlets
69
- console.log("停止定时器去写卡self.stair", self.stair)
70
- // self.index = 1
71
- self.$goto('write-card',{userInfo:self.userInfo,cardInfo:self.cardInfo,stairPrice:self.stair},'self', self.back)
72
- // console.log('success')
73
- // self.$goto('order-info', {userInfo: self.userInfo, cardInfo: self.cardInfo, deviceInfo: self.deviceInfo, stairPrice: self.stairPrice, payInfo: self.payInfo}, 'self', self.callBack)
74
- }
75
- } catch (ret) {
76
- // window.clearInterval(checkValObj)
77
- // window.clearInterval(InterValObj) // 停止计时器
78
- // console.log('error')
79
- self.haserro(ret)
80
- }
81
- }
82
- // import * as Util from '../../util'
83
- export default{
84
- title: '扫描二维码',
85
- data () {
86
- return {
87
- needback:false,
88
- hideHead:false,
89
- isout: false,
90
- // index: 0,
91
- qrsrc: '',
92
- iserro: false,
93
- second: 105,
94
- countDown: 121
95
- }
96
- },
97
- props: ['userInfo', 'cardInfo', 'stair'],
98
- methods: {
99
- isback () {
100
- this.$showMessage('交易进行中是否确认返回?(已支付请选择\'取消\')', ['confirm', 'cancel'])
101
- .then((res) => {
102
- if (res === 'confirm') {
103
- window.clearInterval(checkValObj) // 停止计时器
104
- window.clearInterval(InterValObj)
105
- this.$back('tochoose')
106
- }
107
- })
108
- },
109
- haserro (erro) {
110
- this.iserro = true
111
- this.$showAlert('网络错误', 'info', 5000)
112
- },
113
- back (msg) {
114
- if (msg === 'tomain') {
115
- this.$back(msg)
116
- }
117
- },
118
- istomain () {
119
- this.$showMessage('交易进行中是否确认退出?(已支付请选择\'取消\')', ['confirm', 'cancel'])
120
- .then((res) => {
121
- if (res === 'confirm') {
122
- window.clearInterval(checkValObj) // 停止计时器
123
- window.clearInterval(InterValObj)
124
- this.$back('tomain')
125
- }
126
- })
127
- },
128
- checkbillstate () {
129
- let gen = checkBillSateGen(this)
130
- return co(gen)
131
- },
132
- outOfPage () {
133
- if (this.countDown > 26) {
134
- if(this.second != 0) {
135
- --this.second
136
- }
137
- --this.countDown
138
- this.isout = false
139
- } else if (this.countDown > 0) {
140
- --this.countDown
141
- this.isout = true
142
- this.qrsrc = require('../../image/qrcode_no.png')
143
- this.needback = true
144
- window.clearInterval(checkValObj) // 停止计时器
145
- window.clearInterval(InterValObj)
146
- this.$back('tomain')
147
- } else {
148
- window.clearInterval(checkValObj) // 停止计时器
149
- window.clearInterval(InterValObj)
150
- if (this.iserro) {
151
- this.$dispatch('checkbillerro')// 错误,重新读卡
152
- } else {
153
- this.$dispatch('timeout') // 超时重新购气
154
- }
155
-
156
- // this.$back('支付超时,请重新购气!(如已支付我们将会在1到2个工作日内退款,造成不便敬请谅解)')
157
- }
158
- }
159
- },
160
- ready () {
161
- console.log("userInfo, cardInfo,stair", this.userInfo, this.cardInfo, this.stair)
162
- let url = this.stair.url.replace(/&/g,'|')
163
- console.log('url===',url)
164
- this.qrsrc = Vue.ProxyUrl + '/rs/pay/paintCode?url=' + url
165
- // this.qrsrc = Vue.ProxyUrl + 'rs/payOnline/paintCode?QRCODE=' + this.payinfo.QRCODE
166
- InterValObj = window.setInterval(this.outOfPage, 1000)
167
- // 定时器回调
168
- checkValObj = window.setInterval(this.checkbillstate, 5000)
169
- }
170
- }
171
- </script>