1
|
1
|
// pages/main/finalpay/refundInfo/refundInfo.js
|
|
2
|
+var app = getApp();
|
|
3
|
+var baseUrl = app.globalData.baseUrl;
|
2
|
4
|
Page({
|
3
|
5
|
|
4
|
6
|
/**
|
...
|
...
|
@@ -11,56 +13,148 @@ Page({ |
11
|
13
|
/**
|
12
|
14
|
* Lifecycle function--Called when page load
|
13
|
15
|
*/
|
14
|
|
- onLoad: function (options) {
|
15
|
|
-
|
|
16
|
+ onLoad: function(options) {
|
|
17
|
+ this.initOSS()
|
16
|
18
|
},
|
17
|
19
|
|
18
|
20
|
/**
|
19
|
21
|
* Lifecycle function--Called when page is initially rendered
|
20
|
22
|
*/
|
21
|
|
- onReady: function () {
|
|
23
|
+ onReady: function() {
|
|
24
|
+
|
|
25
|
+ },
|
22
|
26
|
|
|
27
|
+ initOSS: function() {
|
|
28
|
+ var that = this
|
|
29
|
+ var Authorization = getApp().globalData.Authorization;
|
|
30
|
+ //OSS 上传前init
|
|
31
|
+ wx.showLoading()
|
|
32
|
+ wx.request({
|
|
33
|
+ url: baseUrl + "filemeta/v1/inits",
|
|
34
|
+ header: {
|
|
35
|
+ 'Authorization': Authorization
|
|
36
|
+ },
|
|
37
|
+ method: 'POST',
|
|
38
|
+ data: {
|
|
39
|
+ "access_type": "web_upload",
|
|
40
|
+ "action ": "put_object",
|
|
41
|
+ "instance_id": "",
|
|
42
|
+ "object_type": "wx_image"
|
|
43
|
+ },
|
|
44
|
+ success: function(result) {
|
|
45
|
+
|
|
46
|
+ OSSInit = result.data
|
|
47
|
+ console.log(' OSS init 成功', OSSInit)
|
|
48
|
+ },
|
|
49
|
+ fail: function(res) {
|
|
50
|
+ console.log('OSS init 失败', res)
|
|
51
|
+ },
|
|
52
|
+ complete: function() {
|
|
53
|
+ wx.hideLoading()
|
|
54
|
+ }
|
|
55
|
+ })
|
23
|
56
|
},
|
24
|
57
|
|
25
|
58
|
/**
|
26
|
59
|
* Lifecycle function--Called when page show
|
27
|
60
|
*/
|
28
|
|
- onShow: function () {
|
|
61
|
+ onShow: function() {
|
|
62
|
+
|
|
63
|
+ },
|
|
64
|
+
|
|
65
|
+ bindbank: function() {
|
|
66
|
+ var that = this
|
|
67
|
+ wx.chooseImage({
|
|
68
|
+ sourceType: ['camera', 'album'],
|
|
69
|
+ // sizeType: ['original'],
|
|
70
|
+ count: 1,
|
|
71
|
+ success: function(res) {
|
|
72
|
+ console.log('success', res)
|
|
73
|
+ that.ocrBankImage(res.tempFilePaths[0])
|
|
74
|
+ }
|
|
75
|
+ })
|
|
76
|
+ },
|
|
77
|
+
|
|
78
|
+ // 识别银行卡照片
|
|
79
|
+ ocrBankImage: function(path) {
|
|
80
|
+ var that = this
|
|
81
|
+ this.Authorization = getApp().globalData.Authorization;
|
|
82
|
+ wx.request({
|
|
83
|
+ url: baseUrl + "common/v1/ocr/bankcards",
|
|
84
|
+ method: "POST",
|
|
85
|
+ header: {
|
|
86
|
+ 'Authorization': this.Authorization
|
|
87
|
+ },
|
|
88
|
+ data: {
|
|
89
|
+ "image": path
|
|
90
|
+ },
|
|
91
|
+ success: function(result) {
|
|
92
|
+ console.log("payinfo", result)
|
|
93
|
+ if (result.statusCode == 200) {
|
|
94
|
+
|
|
95
|
+ }
|
|
96
|
+ },
|
|
97
|
+ })
|
|
98
|
+ },
|
29
|
99
|
|
|
100
|
+ formSubmit: function() {
|
|
101
|
+ // 是否放弃退税,(是:"5",否:"")
|
|
102
|
+ var that = this
|
|
103
|
+ this.Authorization = getApp().globalData.Authorization;
|
|
104
|
+ wx.request({
|
|
105
|
+ url: baseUrl + "payroll/v1/settlement-tax/record",
|
|
106
|
+ header: {
|
|
107
|
+ 'Authorization': this.Authorization
|
|
108
|
+ },
|
|
109
|
+ data: {
|
|
110
|
+ 'name': '',
|
|
111
|
+ "bank": '',
|
|
112
|
+ "bank_card_no": '',
|
|
113
|
+ "bank_card_province": ''
|
|
114
|
+ },
|
|
115
|
+ success: function(result) {
|
|
116
|
+ console.log("submit", result)
|
|
117
|
+ if (result.statusCode == 200) {
|
|
118
|
+ that.setData({
|
|
119
|
+
|
|
120
|
+ })
|
|
121
|
+ }
|
|
122
|
+ },
|
|
123
|
+ })
|
30
|
124
|
},
|
31
|
125
|
|
32
|
126
|
/**
|
33
|
127
|
* Lifecycle function--Called when page hide
|
34
|
128
|
*/
|
35
|
|
- onHide: function () {
|
|
129
|
+ onHide: function() {
|
36
|
130
|
|
37
|
131
|
},
|
38
|
132
|
|
39
|
133
|
/**
|
40
|
134
|
* Lifecycle function--Called when page unload
|
41
|
135
|
*/
|
42
|
|
- onUnload: function () {
|
|
136
|
+ onUnload: function() {
|
43
|
137
|
|
44
|
138
|
},
|
45
|
139
|
|
46
|
140
|
/**
|
47
|
141
|
* Page event handler function--Called when user drop down
|
48
|
142
|
*/
|
49
|
|
- onPullDownRefresh: function () {
|
|
143
|
+ onPullDownRefresh: function() {
|
50
|
144
|
|
51
|
145
|
},
|
52
|
146
|
|
53
|
147
|
/**
|
54
|
148
|
* Called when page reach bottom
|
55
|
149
|
*/
|
56
|
|
- onReachBottom: function () {
|
|
150
|
+ onReachBottom: function() {
|
57
|
151
|
|
58
|
152
|
},
|
59
|
153
|
|
60
|
154
|
/**
|
61
|
155
|
* Called when user click on the top right corner to share
|
62
|
156
|
*/
|
63
|
|
- onShareAppMessage: function () {
|
|
157
|
+ onShareAppMessage: function() {
|
64
|
158
|
|
65
|
159
|
}
|
66
|
160
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|