Commit d5b2bb8e6583455cd8747c17c0e3bd1e0b1c3b1a

Authored by wangfan
1 parent 39785136

模式切换

Showing 1 changed file with 24 additions and 8 deletions
... ... @@ -10,16 +10,16 @@ Page({
data: {
hasSellerBook:false,
},
enter_params:'',
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
App.Reserve.SellerForOpenid({openid:getApp().openid}).then(res=>{
this.enter_params=res.data;
this.setData({
hasSellerBook:res.data,
})
if(res.data && res.data.seller_id) {
this.setData({
hasSellerBook: res.data,
})
}
})
},
... ... @@ -52,9 +52,25 @@ Page({
},
gotoSellerBook(){
util.cache('islove','book');
wx.reLaunch({
url:util.http_build_query(this.enter_params,'/pages/book/b_index')
util.loading()
App.Reserve.SellerForOpenid({openid:getApp().openid}).then(res=>{
util.loading('clear');
if(res.data && res.data.seller_id){
this.setData({
hasSellerBook:res.data,
})
util.cache('islove','book');
wx.reLaunch({
url:util.http_build_query(res.data,'/pages/book/b_index')
})
}else{
this.setData({
hasSellerBook:false,
})
util.toast('已不是商家','none')
}
})
}
})
\ No newline at end of file
... ...