fstarter 2.10.56 → 2.11.1
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/.babelrc +6 -6
- package/.editorconfig +9 -9
- package/index.html +22 -22
- package/index.js +222 -222
- package/package.json +104 -104
- package/src/App.vue +38 -38
- package/src/i18n/en-US.js +35 -35
- package/src/i18n/zh-CN.js +35 -35
- package/src/main.js +95 -95
- package/src/plugins/assets/ak.js +948 -948
- package/src/plugins/assets/callNative.js +490 -490
- package/src/plugins/assets/compressImg.js +75 -75
- package/src/plugins/assets/config.js +106 -106
- package/src/plugins/assets/fileServer.js +469 -469
- package/src/plugins/assets/http.js +344 -344
- package/src/plugins/assets/ua.js +27 -27
- package/src/plugins/components/BSButton.vue +61 -61
- package/src/plugins/components/BSCascader.vue +465 -465
- package/src/plugins/components/BSCell.vue +48 -48
- package/src/plugins/components/BSDatePicker.vue +167 -167
- package/src/plugins/components/BSImage.vue +42 -42
- package/src/plugins/components/BSInput.vue +140 -140
- package/src/plugins/components/BSList.vue +81 -81
- package/src/plugins/components/BSPicCode.vue +96 -96
- package/src/plugins/components/BSPopup.vue +43 -43
- package/src/plugins/components/BSRadio.vue +97 -97
- package/src/plugins/components/BSSearch.vue +109 -109
- package/src/plugins/components/BSSelect.vue +144 -144
- package/src/plugins/components/BSSign.vue +454 -454
- package/src/plugins/components/BSStepper.vue +115 -115
- package/src/plugins/components/BSUpload.vue +92 -92
- package/src/plugins/components/BSUpload2.vue +397 -397
- package/src/plugins/components/BSVerCode.vue +128 -128
- package/src/plugins/components/BSViewer.vue +92 -92
- package/src/plugins/components/base.js +496 -496
- package/src/plugins/components/base2.js +489 -489
- package/src/plugins/lib/weixin.js +20 -20
- package/src/plugins/platform/index.js +7 -7
- package/src/plugins/platform/isp_phone.js +310 -310
- package/src/plugins/plugins/README.md +560 -0
- package/src/plugins/plugins/browserUtils.js +925 -0
- package/src/plugins/plugins/components/imageCropper.vue +299 -0
- package/src/plugins/plugins/components/images/bz.png +0 -0
- package/src/plugins/plugins/components/images/correct.png +0 -0
- package/src/plugins/plugins/components/images/error.png +0 -0
- package/src/plugins/plugins/components/images/mohu.png +0 -0
- package/src/plugins/plugins/components/images/qs.png +0 -0
- package/src/plugins/plugins/components/images/zd.png +0 -0
- package/src/plugins/plugins/components/pdfPreview.vue +688 -0
- package/src/plugins/plugins/demo.vue +832 -0
- package/src/plugins/plugins/native-js-sdk.js +360 -0
- package/src/plugins/plugins/nativeUtils.js +1444 -0
- package/src/plugins/route/index.js +140 -140
- package/src/plugins/selector/index.js +342 -342
- package/src/plugins/service/index.js +81 -81
- package/src/plugins/services/callCamera.js +53 -53
- package/src/plugins/services/exit.js +37 -36
- package/src/plugins/services/face.js +69 -69
- package/src/plugins/services/faceH5.js +54 -54
- package/src/plugins/services/faceInApp.js +31 -31
- package/src/plugins/services/faceTx.js +61 -61
- package/src/plugins/services/getFaceResult.js +104 -104
- package/src/plugins/services/getH5FaceResult.js +62 -62
- package/src/plugins/services/getMenus.js +40 -40
- package/src/plugins/services/getSystemData.js +144 -128
- package/src/plugins/services/getToken.js +93 -79
- package/src/plugins/services/getTxFaceResult.js +83 -83
- package/src/plugins/services/getUserInfo.js +47 -47
- package/src/plugins/services/goSetPage.js +40 -40
- package/src/plugins/services/hideFhoneTitle.js +36 -36
- package/src/plugins/services/index.js +45 -45
- package/src/plugins/services/init.js +35 -35
- package/src/plugins/services/jumpView.js +42 -40
- package/src/plugins/services/logout.js +44 -43
- package/src/plugins/services/share.js +113 -113
- package/src/plugins/services/statusBarHeight.js +39 -39
- package/src/plugins/session/index.js +32 -32
- package/src/services/getAuthInfo.js +22 -22
- package/src/services/index.js +9 -9
- package/src/services/sendVerCode.js +23 -23
- package/src/views/auth.vue +367 -367
- package/src/views/auth2.vue +90 -90
- package/src/views/auth3.vue +157 -157
- package/src/views/auth4.vue +8979 -8979
- package/src/views/auth5.vue +50 -50
- package/src/views/authh5.vue +369 -369
- package/src/views/components/BankSelect.vue +55 -55
- package/src/views/foot.vue +140 -140
- package/src/views/page.vue +222 -222
- package/src/views/shellFunc.vue +41 -41
- package/themes/basic.css +1 -1
- package/webpack.config.js +144 -144
- package/fstarter.iml +0 -9
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* app-js-sdk.js
|
|
3
|
+
* 基于 WebViewJavascriptBridge.js 封装的 JS SDK
|
|
4
|
+
* 基础调用部分使用 Promise 格式回调
|
|
5
|
+
*/
|
|
6
|
+
window.appCallBack = function () {}
|
|
7
|
+
const isReady = callback => {
|
|
8
|
+
// iOS使用
|
|
9
|
+
if (navigator.userAgent.indexOf('iPhone') != -1) {
|
|
10
|
+
// WebViewJavascriptBridge v6
|
|
11
|
+
if (window.WebViewJavascriptBridge) {
|
|
12
|
+
console.log('iPhone WebViewJavascriptBridge is ready-----')
|
|
13
|
+
callback(window.WebViewJavascriptBridge)
|
|
14
|
+
return
|
|
15
|
+
}
|
|
16
|
+
if (window.WVJBCallbacks) {
|
|
17
|
+
window.WVJBCallbacks.push(callback)
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
window.WVJBCallbacks = [callback]
|
|
21
|
+
var WVJBIframe = document.createElement('iframe')
|
|
22
|
+
WVJBIframe.style.display = 'none'
|
|
23
|
+
WVJBIframe.src = 'https://__bridge_loaded__'
|
|
24
|
+
document.documentElement.appendChild(WVJBIframe)
|
|
25
|
+
setTimeout(function () {
|
|
26
|
+
document.documentElement.removeChild(WVJBIframe)
|
|
27
|
+
}, 0)
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (window.WebViewJavascriptBridge && window.WebViewJavascriptBridge.callHandler) {
|
|
32
|
+
callback(window.WebViewJavascriptBridge)
|
|
33
|
+
return
|
|
34
|
+
} else {
|
|
35
|
+
document.addEventListener(
|
|
36
|
+
'WebViewJavascriptBridgeReady',
|
|
37
|
+
function () {
|
|
38
|
+
callback(window.WebViewJavascriptBridge)
|
|
39
|
+
},
|
|
40
|
+
false
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function callNative(method, params = {}) {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
isReady(bridge => {
|
|
48
|
+
try {
|
|
49
|
+
console.log(`Calling native method: ${method}`, params)
|
|
50
|
+
bridge.callHandler(method, params, response => {
|
|
51
|
+
console.log(`Calling native callback: ${method}`, response)
|
|
52
|
+
console.log('Calling native response:', typeof response)
|
|
53
|
+
try {
|
|
54
|
+
// 判断响应是string还是object,string则尝试解析为object
|
|
55
|
+
let res
|
|
56
|
+
if (typeof response === 'string') {
|
|
57
|
+
res = JSON.parse(response)
|
|
58
|
+
} else {
|
|
59
|
+
res = response
|
|
60
|
+
console.log(2)
|
|
61
|
+
}
|
|
62
|
+
// 标准化响应处理
|
|
63
|
+
switch (res.status) {
|
|
64
|
+
case 'success':
|
|
65
|
+
resolve(res.data)
|
|
66
|
+
break
|
|
67
|
+
case 'fail':
|
|
68
|
+
case 'cancel':
|
|
69
|
+
reject({
|
|
70
|
+
code: res.code || 9001,
|
|
71
|
+
message: res.message || 'Unknown error',
|
|
72
|
+
data: res.data || null
|
|
73
|
+
})
|
|
74
|
+
break
|
|
75
|
+
default:
|
|
76
|
+
reject({
|
|
77
|
+
code: 9001,
|
|
78
|
+
message: 'Invalid response format',
|
|
79
|
+
data: null
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
} catch (e) {
|
|
83
|
+
reject({
|
|
84
|
+
status: 'fail',
|
|
85
|
+
code: 9001,
|
|
86
|
+
message: 'JSON parse error',
|
|
87
|
+
data: null
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
} catch (e) {
|
|
92
|
+
console.error(`Native call error: ${method}`, e)
|
|
93
|
+
reject({
|
|
94
|
+
status: 'fail',
|
|
95
|
+
code: 9001,
|
|
96
|
+
message: e.message,
|
|
97
|
+
data: null
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const sdk = {
|
|
105
|
+
init() {
|
|
106
|
+
console.log('WebViewJavascriptBridge init')
|
|
107
|
+
isReady(bridge => {
|
|
108
|
+
console.log('WebViewJavascriptBridge is initialized', bridge)
|
|
109
|
+
// 如果是Android
|
|
110
|
+
if (navigator.userAgent.indexOf('Android') != -1) {
|
|
111
|
+
bridge.init()
|
|
112
|
+
}
|
|
113
|
+
//桥接默认
|
|
114
|
+
bridge.registerHandler('appCallWebInJs', function (event, responseCallback) {
|
|
115
|
+
try {
|
|
116
|
+
// event: '{"eventType":"ON_BACK_PRESSED","data":{}}'
|
|
117
|
+
event = JSON.parse(event)
|
|
118
|
+
window.appCallback(event, true)
|
|
119
|
+
responseCallback('{"code": "0","message": "success"}')
|
|
120
|
+
} catch (e) {
|
|
121
|
+
window.appCallback({}, false)
|
|
122
|
+
responseCallback('{"code": "1","message": "App调用JS异常:"' + e + '"}')
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
})
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
device: {
|
|
129
|
+
callPhone(params) {
|
|
130
|
+
return callNative('callPhone', params)
|
|
131
|
+
},
|
|
132
|
+
sendSMS(params) {
|
|
133
|
+
return callNative('sendSMS', params)
|
|
134
|
+
},
|
|
135
|
+
readContacts(params) {
|
|
136
|
+
return callNative('readContacts', params)
|
|
137
|
+
},
|
|
138
|
+
addCalendarEvent(params) {
|
|
139
|
+
return callNative('addCalendarEvent', params)
|
|
140
|
+
},
|
|
141
|
+
getDeviceInfo(params) {
|
|
142
|
+
return callNative('getDeviceInfo', params)
|
|
143
|
+
},
|
|
144
|
+
setScreenOrientation(params) {
|
|
145
|
+
return callNative('setScreenOrientation', params)
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
utils: {
|
|
149
|
+
switchEnvironment(params) {
|
|
150
|
+
return callNative('switchEnvironment', params)
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
getCacheSize(params) {
|
|
154
|
+
return callNative('getCacheSize', params)
|
|
155
|
+
},
|
|
156
|
+
clearCache(params) {
|
|
157
|
+
return callNative('clearCache', params)
|
|
158
|
+
},
|
|
159
|
+
launchApp(params) {
|
|
160
|
+
return callNative('launchApp', params)
|
|
161
|
+
},
|
|
162
|
+
scanQRCode(params) {
|
|
163
|
+
return callNative('scanQRCode', params)
|
|
164
|
+
},
|
|
165
|
+
openSystemBrowser(params) {
|
|
166
|
+
return callNative('openSystemBrowser', params)
|
|
167
|
+
},
|
|
168
|
+
checkAppUpdate(params) {
|
|
169
|
+
return callNative('checkAppUpdate', params)
|
|
170
|
+
},
|
|
171
|
+
screenshot(params) {
|
|
172
|
+
return callNative('screenshot', params)
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
navigator: {
|
|
176
|
+
openPage(params) {
|
|
177
|
+
return callNative('openPage', params)
|
|
178
|
+
},
|
|
179
|
+
redirectTo(params) {
|
|
180
|
+
return callNative('redirectTo', params)
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
closePage(params) {
|
|
184
|
+
return callNative('closePage', params)
|
|
185
|
+
},
|
|
186
|
+
toHome(params) {
|
|
187
|
+
return callNative('toHome', params)
|
|
188
|
+
},
|
|
189
|
+
setBackInterceptor(params) {
|
|
190
|
+
return callNative('setBackInterceptor', params)
|
|
191
|
+
},
|
|
192
|
+
setNavigationBar(params) {
|
|
193
|
+
return callNative('setNavigationBar', params)
|
|
194
|
+
},
|
|
195
|
+
setNavigationBarVisible(params) {
|
|
196
|
+
return callNative('setNavigationBarVisible', params)
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
auth: {
|
|
200
|
+
setToken(params) {
|
|
201
|
+
return callNative('setToken', params)
|
|
202
|
+
},
|
|
203
|
+
getToken() {
|
|
204
|
+
return new Promise((resolve, reject) => {
|
|
205
|
+
callNative('getToken')
|
|
206
|
+
.then(response => {
|
|
207
|
+
try {
|
|
208
|
+
const token = JSON.parse(response)
|
|
209
|
+
resolve(token)
|
|
210
|
+
} catch (e) {
|
|
211
|
+
resolve()
|
|
212
|
+
}
|
|
213
|
+
})
|
|
214
|
+
.catch(error => {
|
|
215
|
+
reject(error)
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
},
|
|
219
|
+
clearToken() {
|
|
220
|
+
return callNative('clearToken')
|
|
221
|
+
},
|
|
222
|
+
setUserInfo(params) {
|
|
223
|
+
return callNative('setUserInfo', params)
|
|
224
|
+
},
|
|
225
|
+
getUserInfo() {
|
|
226
|
+
return new Promise((resolve, reject) => {
|
|
227
|
+
callNative('getUserInfo')
|
|
228
|
+
.then(response => {
|
|
229
|
+
try {
|
|
230
|
+
const userInfo = JSON.parse(response)
|
|
231
|
+
resolve(userInfo)
|
|
232
|
+
} catch (e) {
|
|
233
|
+
resolve()
|
|
234
|
+
}
|
|
235
|
+
})
|
|
236
|
+
.catch(error => {
|
|
237
|
+
reject(error)
|
|
238
|
+
})
|
|
239
|
+
})
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
clearUserInfo() {
|
|
243
|
+
return callNative('clearUserInfo')
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
storage: {
|
|
247
|
+
setItem(key, value) {
|
|
248
|
+
return callNative('setItem', {
|
|
249
|
+
key,
|
|
250
|
+
value
|
|
251
|
+
})
|
|
252
|
+
},
|
|
253
|
+
getItem(key) {
|
|
254
|
+
return callNative('getItem', {
|
|
255
|
+
key
|
|
256
|
+
})
|
|
257
|
+
},
|
|
258
|
+
removeItem(key) {
|
|
259
|
+
return callNative('removeItem', {
|
|
260
|
+
key
|
|
261
|
+
})
|
|
262
|
+
},
|
|
263
|
+
clearAllData() {
|
|
264
|
+
return callNative('clearAllData')
|
|
265
|
+
},
|
|
266
|
+
setTempItem(key, value) {
|
|
267
|
+
return callNative('setTempItem', {
|
|
268
|
+
key,
|
|
269
|
+
value
|
|
270
|
+
})
|
|
271
|
+
},
|
|
272
|
+
getTempItem(key) {
|
|
273
|
+
return callNative('getTempItem', {
|
|
274
|
+
key
|
|
275
|
+
})
|
|
276
|
+
},
|
|
277
|
+
removeTempItem(key) {
|
|
278
|
+
return callNative('removeTempItem', {
|
|
279
|
+
key
|
|
280
|
+
})
|
|
281
|
+
},
|
|
282
|
+
clearAllTempData() {
|
|
283
|
+
return callNative('clearAllTempData')
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
media: {
|
|
287
|
+
takePhoto(params) {
|
|
288
|
+
return callNative('takePhoto', params)
|
|
289
|
+
},
|
|
290
|
+
chooseImage(params) {
|
|
291
|
+
return callNative('chooseImage', params)
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
doc: {
|
|
295
|
+
openPDF(params) {
|
|
296
|
+
return callNative('openPDF', params)
|
|
297
|
+
},
|
|
298
|
+
preview(params) {
|
|
299
|
+
return callNative('preview', params)
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
safe: {
|
|
303
|
+
preventScreenCapture(params) {
|
|
304
|
+
return callNative('preventScreenCapture', params)
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
thirdParty: {
|
|
308
|
+
wechat: {
|
|
309
|
+
isInstalled() {
|
|
310
|
+
return callNative('wechatIsInstalled')
|
|
311
|
+
},
|
|
312
|
+
openCustomerService(params) {
|
|
313
|
+
return callNative('wechatOpenCustomerService', params)
|
|
314
|
+
},
|
|
315
|
+
login(params) {
|
|
316
|
+
return callNative('wechatLogin', params)
|
|
317
|
+
},
|
|
318
|
+
share(params) {
|
|
319
|
+
return callNative('wechatShare', params)
|
|
320
|
+
},
|
|
321
|
+
launchMiniProgram(params) {
|
|
322
|
+
return callNative('wechatLaunchMiniProgram', params)
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
oneClickLogin(params) {
|
|
326
|
+
return callNative('oneClickLogin', params)
|
|
327
|
+
},
|
|
328
|
+
bio: {
|
|
329
|
+
faceAuth(params) {
|
|
330
|
+
return callNative('faceAuth', params)
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
ocr: {
|
|
334
|
+
recognizeIDCard(params) {
|
|
335
|
+
return callNative('recognizeIDCard', params)
|
|
336
|
+
},
|
|
337
|
+
recognizeBankCard(params) {
|
|
338
|
+
return callNative('recognizeBankCard', params)
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
geo: {
|
|
342
|
+
getLocation(params) {
|
|
343
|
+
return callNative('getLocation', params)
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
biz: {
|
|
348
|
+
setFloatingActionButton(params) {
|
|
349
|
+
return callNative('setFloatingActionButton', params)
|
|
350
|
+
},
|
|
351
|
+
login(params) {
|
|
352
|
+
return callNative('login', params)
|
|
353
|
+
},
|
|
354
|
+
loginSuccess(params) {
|
|
355
|
+
return callNative('loginSuccess', params)
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export default sdk
|