-
Notifications
You must be signed in to change notification settings - Fork 7
/
app.js
46 lines (44 loc) · 985 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//app.js
App({
onLaunch: function () {
},
getRequest: function(url,callback){
wx.showToast({
title: '加载中',
icon: 'loading',
duration: 10000
})
wx.request({
url: url, //仅为示例,并非真实的接口地址
success: function(res) {
if(callback && typeof callback == 'function'){
callback(res)
wx.hideToast()
}
}
})
},
getScanning: function(){
wx.scanCode({
success: (res) => {
var result = res.result
result = result.replace('http://','')
wx.navigateTo({
url: '../'+result
})
}
})
},
setStorageUser: function(params,callback){
wx.setStorage({
key: params.key,
data: params.data,
success: function(res) {
if(callback && typeof callback == 'function'){
callback(res)
}
}
});
// console.log(params)
}
})