-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathapp.js
63 lines (58 loc) · 1.22 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
51
52
53
54
55
56
57
58
59
60
61
62
63
//app.js
App({
onLaunch: function (options) {
},
getUserInfo:function(cb){
var that = this
if(this.globalData.userInfo){
typeof cb == "function" && cb(this.globalData.userInfo)
}else{
//调用登录接口
wx.login({
success: function () {
wx.getUserInfo({
success: function (res) {
that.globalData.userInfo = res.userInfo
typeof cb == "function" && cb(that.globalData.userInfo)
}
})
}
})
}
},
globalData:{
userInfo:{
avatar: null,
nickname: '',
phone: '',
hasData: false
},
//geo page address
geoAddress: {
province: null,
city: null,
district: null,
province_name: null,
city_name: null,
district_name: null,
addressline: null,
address_lng: null,
address_lat: null,
hasLocationStore: null
},
//购物车数据
cartData:{
list:[],
totalCount:1,
totalPrice:0,
// 起送价
floorPrice:0,
// 总价达到此价免配送费
freeShipPrice:0,
// 运费
deliveryFee:0,
storeId:0,
storeName:''
}
}
})