作者 lihongjuan

1

... ... @@ -94,8 +94,9 @@ App({
console.log('3489523498',r)
if (r.code == 200) {
that.globalData.login_new=r.msg.login_new;
console.log( that.globalData.login_new)
wx.setStorageSync('login', r.msg.login_new)
// that.globalData.login_new=r.msg.login_new;
// console.log( that.globalData.login_new)
// t.setData({
// obj: r.msg
// })
... ...
{
"pages": [
"pages/index/index",
"pages/startindex/startindex",
"pages/register/register",
"pages/login/login",
"pages/startindex/startindex",
"pages/zuji/zuji",
"pages/messagedetail/messagedetail",
"pages/message/message",
... ...
... ... @@ -49,6 +49,45 @@ Page({
// console.log(this.data.stick)
},
onLoad: function(options) {
console.log( app.globalData.index)
if( app.globalData.index==undefined){
let that = this;
let token=wx.getStorageSync('token');
console.log('woshitoe',token);
if(token!=""){
console.log(9999)
this.getInfoFun()
}
this.get_notice()
this.get_shopnum()
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.get_banner()
// 获取活动专区
this.getzhuanqulist();
this.getxianshi();
setTimeout(function() {
that.setData({
showtime: true
})
}, 990)
}
//控制显示隐藏
this.ishow()
},
// 获取个人信息
getInfoFun() {
... ... @@ -83,7 +122,7 @@ Page({
}
})
}else{
let login_new=app.globalData.login_new;
let login_new=wx.getStorageSync("login");
if(login_new==0){
// wx.showToast({
// title: '您还不是会员',
... ... @@ -260,7 +299,7 @@ Page({
}
})
}else{
let login_new=app.globalData.login_new;
let login_new=wx.getStorageSync('login');
if(login_new==0){
wx.showModal({
title: '提示',
... ... @@ -304,7 +343,7 @@ Page({
return false
}
let login_new=app.globalData.login_new;
let login_new=wx.getStorageSync('login');
if(login_new==0){
wx.showModal({
title: '提示',
... ... @@ -350,7 +389,7 @@ Page({
}
})
}else{
let login_new=app.globalData.login_new;
let login_new=wx.getStorageSync('login');
if(login_new==0){
wx.showModal({
title: '提示',
... ... @@ -403,15 +442,13 @@ Page({
}
})
} else {
let login_new=app.globalData.login_new;
let login_new=wx.getStorageSync('login');
if(login_new==0){
wx.showModal({
title: '提示',
content: '您还不是会员',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/login/login',
})
... ... @@ -602,29 +639,7 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that = this;
let token=wx.getStorageSync('token');
console.log('woshitoe',token)
// if(token!=""){
// this.getInfoFun()
// }
this.get_banner()
// 获取活动专区
this.getzhuanqulist();
this.getxianshi();
setTimeout(function() {
that.setData({
showtime: true
})
}, 990)
},
//获取购物车数量
get_shopnum() {
let that = this
... ... @@ -700,10 +715,9 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.setData({
shop_arr:[],
page:1
})
console.log(app.globalData.index)
if(app.globalData.index==0){
app.globalData.index=undefined
let token=wx.getStorageSync('token');
console.log('woshitoe',token)
if(token!=""){
... ... @@ -718,9 +732,13 @@ Page({
}else{
this.get_info(0, 1);
}
//控制显示隐藏
this.ishow()
}
//控制显示隐藏
this.ishow()
},
/**
... ...
... ... @@ -90,7 +90,13 @@ Page({
// loginFun(){
// setTimeout(() => {
// wx.switchTab({
// url: '/pages/index/index'
// })
// }, 1000)
// },
// 登录
loginFun() {
... ... @@ -127,6 +133,7 @@ Page({
}
a.post(u, d).then((r) => {
if (r.code == 200) {
a.globalData.index=0
wx.setStorageSync('login', 1);
wx.showToast({
title: '登录成功',
... ... @@ -139,7 +146,6 @@ Page({
}, 1000)
}
})
}
}).catch((er) => {})
},
... ...
... ... @@ -138,7 +138,7 @@ Page({
}
let login_new=a.globalData.login_new;
let login_new=wx.getStorageSync('login');
if(login_new==0){
wx.showModal({
title: '提示',
... ...
... ... @@ -82,6 +82,9 @@ page {
margin-left: 24rpx;
margin-right: 24rpx;
}
.info_box view:last-child{
border-right:none
}
.content {
width: 686rpx;
... ...
... ... @@ -80,6 +80,7 @@ Page({
wx.hideLoading()
if (r.code == 200) {
wx.setStorageSync('token', r.token);
// wx.setStorageSync('token', 'C9c4f9e702e05dae61d854c0c2dd6e21a');
wx.setStorageSync('login', r.new_login);
wx.setStorageSync('tel', r.tel);
// wx.reLaunch({
... ...
... ... @@ -121,7 +121,6 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
... ... @@ -156,13 +155,12 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let newpage=this.data.page;
newpage++;
this.setData({
page:newpage
})
this.getmorelist()
// let newpage=this.data.page;
// newpage++;
// this.setData({
// page:newpage
// })
// this.getmorelist()
},
/**
... ...