...
|
...
|
@@ -49,6 +49,23 @@ Page({ |
|
|
|
|
|
// console.log(this.data.stick)
|
|
|
},
|
|
|
|
|
|
// 获取个人信息
|
|
|
getInfoFun() {
|
|
|
let that= this;
|
|
|
let u = app.interface.readteacher;
|
|
|
app.post(u, {}).then((r) => {
|
|
|
console.log('3489523498',r)
|
|
|
if (r.code == 200) {
|
|
|
|
|
|
app.globalData.login_new=r.msg.login_new;
|
|
|
console.log( app.globalData.login_new)
|
|
|
// t.setData({
|
|
|
// obj: r.msg
|
|
|
// })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
moremiao() {
|
|
|
let token = wx.getStorageSync("token")
|
|
|
if (token == '') {
|
...
|
...
|
@@ -64,8 +81,37 @@ Page({ |
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
}else{
|
|
|
let login_new=app.globalData.login_new;
|
|
|
if(login_new==0){
|
|
|
// wx.showToast({
|
|
|
// title: '您还不是会员',
|
|
|
// icon:"none"
|
|
|
// })
|
|
|
// setTimeout(function(){
|
|
|
// wx.navigateTo({
|
|
|
// url: '/pages/login/login',
|
|
|
// })
|
|
|
// },1500)
|
|
|
// return false
|
|
|
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '您还不是会员',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/login/login',
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
|
}
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/xianshi/xianshi?title2='+this.data.title2,
|
|
|
})
|
...
|
...
|
@@ -79,7 +125,6 @@ Page({ |
|
|
let url = '//wb/wb';
|
|
|
let data = {
|
|
|
|
|
|
|
|
|
}
|
|
|
app.post(url, data, "POST").then((r) => {
|
|
|
console.log('4456789', r)
|
...
|
...
|
@@ -214,6 +259,25 @@ Page({ |
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
let login_new=app.globalData.login_new;
|
|
|
if(login_new==0){
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '您还不是会员',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
|
|
|
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/login/login',
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/zhuanqu/zhuanqu?id=' + id,
|
|
|
})
|
...
|
...
|
@@ -222,6 +286,42 @@ Page({ |
|
|
},
|
|
|
|
|
|
more() {
|
|
|
let token = wx.getStorageSync("token")
|
|
|
if (token == '') {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '请先登录',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/register/register',
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
let login_new=app.globalData.login_new;
|
|
|
if(login_new==0){
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '您还不是会员',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
|
|
|
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/login/login',
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/classify/classify',
|
|
|
})
|
...
|
...
|
@@ -234,12 +334,48 @@ Page({ |
|
|
},
|
|
|
// 查看小分类
|
|
|
look_item(e) {
|
|
|
let token = wx.getStorageSync("token")
|
|
|
if (token == '') {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '请先登录',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/register/register',
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
let login_new=app.globalData.login_new;
|
|
|
if(login_new==0){
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '您还不是会员',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
|
|
|
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/login/login',
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
let title = this.data.nav_arr[this.data.nav_index].name
|
|
|
let index = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0
|
|
|
let pid = this.data.nav_arr[this.data.nav_index].id
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/search/search_result/search_result?title=' + title + "&index=" + index + '&pid=' + pid
|
|
|
})
|
|
|
}
|
|
|
|
|
|
},
|
|
|
//监测轮播图变化
|
|
|
swiperChange(e) {
|
...
|
...
|
@@ -266,6 +402,25 @@ Page({ |
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
let login_new=app.globalData.login_new;
|
|
|
if(login_new==0){
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '您还不是会员',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
|
|
|
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/login/login',
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
if (style == 2) {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src
|
...
|
...
|
@@ -313,7 +468,7 @@ Page({ |
|
|
page_type: false
|
|
|
})
|
|
|
//调用排序接口
|
|
|
this.good_list(this.data.cid, e.currentTarget.dataset.index)
|
|
|
this.good_list(this.data.pid, e.currentTarget.dataset.index)
|
|
|
},
|
|
|
|
|
|
select_nav(e) {
|
...
|
...
|
@@ -441,13 +596,20 @@ Page({ |
|
|
}
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function(options) {
|
|
|
let that = this
|
|
|
let that = this;
|
|
|
let token=wx.getStorageSync('token');
|
|
|
console.log('woshitoe',token)
|
|
|
if(token!=""){
|
|
|
this.getInfoFun()
|
|
|
}
|
|
|
this.get_banner()
|
|
|
this.get_info(0, 1);
|
|
|
|
|
|
// 获取活动专区
|
|
|
this.getzhuanqulist();
|
|
|
this.getxianshi();
|
...
|
...
|
@@ -523,6 +685,22 @@ Page({ |
|
|
|
|
|
}).catch((err) => {})
|
|
|
},
|
|
|
// 获取个人信息
|
|
|
getInfoFun() {
|
|
|
let that= this;
|
|
|
let u = app.interface.readteacher;
|
|
|
app.post(u, {}).then((r) => {
|
|
|
console.log('3489523498',r)
|
|
|
if (r.code == 200) {
|
|
|
|
|
|
app.globalData.login_new=r.msg.login_new;
|
|
|
console.log( app.globalData.login_new)
|
|
|
// t.setData({
|
|
|
// obj: r.msg
|
|
|
// })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
...
|
...
|
@@ -534,9 +712,25 @@ Page({ |
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function() {
|
|
|
this.setData({
|
|
|
shop_arr:[],
|
|
|
page:1
|
|
|
})
|
|
|
let token=wx.getStorageSync('token');
|
|
|
console.log('woshitoe',token)
|
|
|
if(token!=""){
|
|
|
this.getInfoFun()
|
|
|
}
|
|
|
this.get_notice()
|
|
|
this.get_shopnum()
|
|
|
this.getmessagelist()
|
|
|
this.getmessagelist();
|
|
|
console.log('998867',this.data.pid)
|
|
|
if(this.data.pid){
|
|
|
this.get_info(this.data.pid, 2);
|
|
|
}else{
|
|
|
this.get_info(0, 1);
|
|
|
}
|
|
|
|
|
|
//控制显示隐藏
|
|
|
this.ishow()
|
|
|
},
|
...
|
...
|
@@ -594,7 +788,7 @@ Page({ |
|
|
that.setData({
|
|
|
page: that.data.page + 1
|
|
|
})
|
|
|
that.good_list(that.data.cid, that.data.c_index)
|
|
|
that.good_list(that.data.pid, that.data.c_index)
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
|