-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
50 lines (48 loc) · 1.61 KB
/
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
47
48
49
50
//app.js
App({
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
// 获取用户信息
wx.getSetting({
success(res) {
if (res.authSetting['scope.userInfo']) {
wx.authorize({
scope: 'scope.userInfo',
success() {
// 用户已经同意小程序使用功能,后续调用 接口不会弹窗询问
}
})
}
}
})
},
globalData: {
userInfo: null,
// urlheader: "https://www.lazyfei.top/api/",
urls:{
loginUrl: "https://www.lazyfei.top/api/" + "login/to-login",
placeOrder: "https://www.lazyfei.top/api/" + "order/place-an-order",
getOrder: "https://www.lazyfei.top/api/" + "order/order-list",
myOrder: "https://www.lazyfei.top/api/" + "order/order-list",
getVerifyingCode: "https://www.lazyfei.top/api/"+"login/get-phone-vcode",
getAddress:"https://www.lazyfei.top/api/"+"address/show",
addAddress:"https://www.lazyfei.top/api/"+ "address/add",
delAddress:'https://www.lazyfei.top/api/'+"address/del",
getOneAdd:"https://www.lazyfei.top/api/"+"address/get-add-by-id",
editAddress: "https://www.lazyfei.top/api/" + "address/edit-addr",
receiveOrder: "https://www.lazyfei.top/api/" +"order/receive-order",
delAddress:'https://www.lazyfei.top/api/'+"address/del"
}
},
onShow:function(){
}
})