index.js
923 Bytes
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
import App from '../../../utils/api.js'
import util from '../../../utils/util.js'
Page({
onLoad(){
this.setData({
headerHeight:util.cache('headerHeight')
})
this.getsellerlist();
},
getsellerlist(){
App.Seller.GetSystemByOpenid({openid:util.cache('openid')}).then((json)=>{
console.log(json)
if(json.ret==200){
if(json.data.auth==0){
}else{
this.setData({
sellerlist:json.data
})
}
}
})
},
switchseller(){
if(util.cache('sellerid')){
wx.reLaunch({
url:'../../me/s_index?sellerid='+util.cache('sellerid')
})
}else{
if(this.data.sellerlist){
if(this.data.sellerlist.length==1){
wx.reLaunch({
url:'../../me/s_index?sellerid='+this.data.sellerlist[0].seller.id
})
}else{
wx.reLaunch({
url:'../../currency/c_store'
})
}
}else{
wx.reLaunch({
url:'../../me/s_index'
})
}
}
}
})