...
|
...
|
@@ -62,9 +62,6 @@ Page({ |
|
|
]
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scroll(e) {
|
|
|
// console.log(e.detail.scrollTop)
|
|
|
// if (e.detail.scrollTop >300){
|
...
|
...
|
@@ -77,13 +74,13 @@ Page({ |
|
|
// stick:0
|
|
|
// })
|
|
|
// }
|
|
|
|
|
|
// console.log(this.data.stick)
|
|
|
},
|
|
|
|
|
|
|
|
|
onLoad: function (options) {
|
|
|
console.log(app.globalData.index)
|
|
|
if (options.token) {
|
|
|
wx.setStorageSync('token', options.token)
|
|
|
}
|
|
|
if (wx.getStorageSync('entrance_type') == '2') {
|
|
|
wx.setNavigationBarTitle({
|
|
|
title: '工会商城'
|
...
|
...
|
@@ -97,57 +94,44 @@ Page({ |
|
|
title: '办公采办'
|
|
|
})
|
|
|
}
|
|
|
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.getzhuanqulist();
|
|
|
this.getxianshi();
|
|
|
setTimeout(function () {
|
|
|
that.setData({
|
|
|
showtime: true
|
|
|
})
|
|
|
}, 990)
|
|
|
}
|
|
|
// if (app.globalData.index == undefined) {
|
|
|
// let that = this;
|
|
|
// let token = wx.getStorageSync('token');
|
|
|
// if (token != "") {
|
|
|
// this.getInfoFun()
|
|
|
// }
|
|
|
// this.get_notice()
|
|
|
// this.get_shopnum()
|
|
|
// this.getmessagelist();
|
|
|
// if (this.data.pid) {
|
|
|
// this.get_info(this.data.pid, 2);
|
|
|
// } else {
|
|
|
// this.get_info(0, 1);
|
|
|
// }
|
|
|
// // 获取活动专区
|
|
|
// this.getzhuanqulist();
|
|
|
// this.getxianshi();
|
|
|
// setTimeout(function () {
|
|
|
// that.setData({
|
|
|
// showtime: true
|
|
|
// })
|
|
|
// }, 990)
|
|
|
// }
|
|
|
//控制显示隐藏
|
|
|
this.ishow()
|
|
|
|
|
|
// this.ishow()
|
|
|
},
|
|
|
|
|
|
// 获取个人信息
|
|
|
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;
|
|
|
app.globalData.status = r.msg.status;
|
|
|
console.log(app.globalData.status)
|
|
|
// t.setData({
|
|
|
// obj: r.msg
|
|
|
// })
|
|
|
}
|
|
|
})
|
|
|
}).catch({})
|
|
|
},
|
|
|
|
|
|
moremiao() {
|
|
|
let token = wx.getStorageSync("token")
|
|
|
if (token == '') {
|
...
|
...
|
@@ -163,8 +147,9 @@ Page({ |
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
let login_new = wx.getStorageSync("login");
|
|
|
if (login_new == 0) {
|
|
|
// 2023-10-19 需求是无需登录
|
|
|
// let login_new = wx.getStorageSync("login");
|
|
|
// if (login_new == 0) {
|
|
|
// wx.showToast({
|
|
|
// title: '您还不是会员',
|
|
|
// icon:"none"
|
...
|
...
|
@@ -175,23 +160,19 @@ Page({ |
|
|
// })
|
|
|
// },1500)
|
|
|
// return false
|
|
|
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '您还不是会员',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
wx.navigateTo({
|
|
|
url: '/packageA/pages/login/login',
|
|
|
})
|
|
|
} else if (res.cancel) { }
|
|
|
}
|
|
|
})
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
|
}
|
|
|
// wx.showModal({
|
|
|
// title: '提示',
|
|
|
// content: '您还不是会员',
|
|
|
// success(res) {
|
|
|
// if (res.confirm) {
|
|
|
// wx.navigateTo({
|
|
|
// url: '/packageA/pages/login/login',
|
|
|
// })
|
|
|
// } else if (res.cancel) { }
|
|
|
// }
|
|
|
// })
|
|
|
// return false
|
|
|
// }
|
|
|
wx.navigateTo({
|
|
|
url: '/packageA/pages/xianshi/xianshi?title2=' + this.data.title2,
|
|
|
})
|
...
|
...
|
@@ -203,19 +184,13 @@ Page({ |
|
|
ishow() {
|
|
|
let that = this
|
|
|
let url = '//wb/wb';
|
|
|
let data = {
|
|
|
|
|
|
}
|
|
|
let data = {}
|
|
|
app.post(url, data, "POST").then((r) => {
|
|
|
console.log('4456789', r)
|
|
|
that.setData({
|
|
|
status1: r.msg.status1,
|
|
|
status2: r.msg.status2,
|
|
|
title2: r.msg.title2
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((err) => { })
|
|
|
},
|
|
|
|
...
|
...
|
@@ -226,28 +201,19 @@ Page({ |
|
|
let data = {
|
|
|
page: 1,
|
|
|
pageNum: 6
|
|
|
|
|
|
}
|
|
|
app.post(url, data, "POST").then((r) => {
|
|
|
console.log(r)
|
|
|
console.log(r.msg.residue_time)
|
|
|
that.setData({
|
|
|
xianshilist: r.msg.list,
|
|
|
endTime: r.msg.residue_time,
|
|
|
activitystatus: r.msg.status
|
|
|
})
|
|
|
var time = that.date_format(r.msg.residue_time);
|
|
|
console.log('9988776', that.data.activitystatus)
|
|
|
|
|
|
that.countDown()
|
|
|
|
|
|
console.log(that.data.xianshilist)
|
|
|
// that.setData({
|
|
|
// messagelist: that.data.messagelist.concat(r.msg)
|
|
|
// })
|
|
|
|
|
|
// console.log(that.data.messagelist)
|
|
|
|
|
|
}).catch((err) => { })
|
|
|
},
|
|
|
|
...
|
...
|
@@ -307,14 +273,10 @@ Page({ |
|
|
that.setData({
|
|
|
activity: r.msg
|
|
|
})
|
|
|
|
|
|
console.log(that.data.activity)
|
|
|
// that.setData({
|
|
|
// messagelist: that.data.messagelist.concat(r.msg)
|
|
|
// })
|
|
|
|
|
|
// console.log(that.data.messagelist)
|
|
|
|
|
|
}).catch((err) => { })
|
|
|
},
|
|
|
|
...
|
...
|
@@ -335,27 +297,26 @@ Page({ |
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
let login_new = wx.getStorageSync('login');
|
|
|
if (login_new == 0) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '您还不是会员',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
wx.navigateTo({
|
|
|
url: '/packageA/pages/login/login',
|
|
|
})
|
|
|
} else if (res.cancel) { }
|
|
|
}
|
|
|
})
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
// 2023-10-19 需求是无需登录
|
|
|
// let login_new = wx.getStorageSync('login');
|
|
|
// if (login_new == 0) {
|
|
|
// wx.showModal({
|
|
|
// title: '提示',
|
|
|
// content: '您还不是会员',
|
|
|
// success(res) {
|
|
|
// if (res.confirm) {
|
|
|
// wx.navigateTo({
|
|
|
// url: '/packageA/pages/login/login',
|
|
|
// })
|
|
|
// } else if (res.cancel) { }
|
|
|
// }
|
|
|
// })
|
|
|
// return false
|
|
|
// }
|
|
|
wx.navigateTo({
|
|
|
url: '/packageA/pages/zhuanqu/zhuanqu?id=' + id,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
more() {
|
...
|
...
|
@@ -372,27 +333,24 @@ Page({ |
|
|
} else if (res.cancel) { }
|
|
|
}
|
|
|
})
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
let login_new = wx.getStorageSync('login');
|
|
|
if (login_new == 0) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '您还不是会员',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
|
|
|
|
|
|
wx.navigateTo({
|
|
|
url: '/packageA/pages/login/login',
|
|
|
})
|
|
|
} else if (res.cancel) { }
|
|
|
}
|
|
|
})
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
// 2023-10-19 需求是无需登录
|
|
|
// let login_new = wx.getStorageSync('login');
|
|
|
// if (login_new == 0) {
|
|
|
// wx.showModal({
|
|
|
// title: '提示',
|
|
|
// content: '您还不是会员',
|
|
|
// success(res) {
|
|
|
// if (res.confirm) {
|
|
|
// wx.navigateTo({
|
|
|
// url: '/packageA/pages/login/login',
|
|
|
// })
|
|
|
// } else if (res.cancel) { }
|
|
|
// }
|
|
|
// })
|
|
|
// return false
|
|
|
// }
|
|
|
wx.navigateTo({
|
|
|
url: '/packageA/pages/classify/classify',
|
|
|
})
|
...
|
...
|
@@ -419,65 +377,66 @@ Page({ |
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
let login_new = wx.getStorageSync('login');
|
|
|
let gh_login = wx.getStorageSync('gh_login');
|
|
|
let cb_login = wx.getStorageSync('cb_login');
|
|
|
let loginType = wx.getStorageSync('entrance_type');
|
|
|
if (loginType == 1) {
|
|
|
if (login_new == 0) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '请绑定账户后操作',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
wx.navigateTo({
|
|
|
url: '/packageA/pages/login/login',
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
// 2023-10-19 需求是无需登录
|
|
|
// let login_new = wx.getStorageSync('login');
|
|
|
// let gh_login = wx.getStorageSync('gh_login');
|
|
|
// let cb_login = wx.getStorageSync('cb_login');
|
|
|
// let loginType = wx.getStorageSync('entrance_type');
|
|
|
// if (loginType == 1) {
|
|
|
// if (login_new == 0) {
|
|
|
// wx.showModal({
|
|
|
// title: '提示',
|
|
|
// content: '请绑定账户后操作',
|
|
|
// success(res) {
|
|
|
// if (res.confirm) {
|
|
|
// wx.navigateTo({
|
|
|
// url: '/packageA/pages/login/login',
|
|
|
// })
|
|
|
// } else if (res.cancel) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
// }
|
|
|
// }
|
|
|
// })
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
} else if(loginType == 2){
|
|
|
if (gh_login == 0) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '请绑定账户后操作',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
wx.navigateTo({
|
|
|
url: '/packageA/pages/login/login',
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
// return false
|
|
|
// }
|
|
|
// } else if (loginType == 2) {
|
|
|
// if (gh_login == 0) {
|
|
|
// wx.showModal({
|
|
|
// title: '提示',
|
|
|
// content: '请绑定账户后操作',
|
|
|
// success(res) {
|
|
|
// if (res.confirm) {
|
|
|
// wx.navigateTo({
|
|
|
// url: '/packageA/pages/login/login',
|
|
|
// })
|
|
|
// } else if (res.cancel) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
// }
|
|
|
// }
|
|
|
// })
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
}else if(loginType == 3){
|
|
|
if (cb_login == 0) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '请绑定账户后操作',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
wx.navigateTo({
|
|
|
url: '/packageA/pages/login/login',
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
// return false
|
|
|
// }
|
|
|
// } else if (loginType == 3) {
|
|
|
// if (cb_login == 0) {
|
|
|
// wx.showModal({
|
|
|
// title: '提示',
|
|
|
// content: '请绑定账户后操作',
|
|
|
// success(res) {
|
|
|
// if (res.confirm) {
|
|
|
// wx.navigateTo({
|
|
|
// url: '/packageA/pages/login/login',
|
|
|
// })
|
|
|
// } else if (res.cancel) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
// }
|
|
|
// }
|
|
|
// })
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
// return false
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
let title = this.data.nav_arr[this.data.nav_index].name
|
|
|
let index = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0
|
...
|
...
|
@@ -512,21 +471,22 @@ Page({ |
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
let login_new = wx.getStorageSync('login');
|
|
|
if (login_new == 0) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '您还不是会员',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
wx.navigateTo({
|
|
|
url: '/packageA/pages/login/login',
|
|
|
})
|
|
|
} else if (res.cancel) { }
|
|
|
}
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
// 2023-10-19 需求是无需登录
|
|
|
// let login_new = wx.getStorageSync('login');
|
|
|
// if (login_new == 0) {
|
|
|
// wx.showModal({
|
|
|
// title: '提示',
|
|
|
// content: '您还不是会员',
|
|
|
// success(res) {
|
|
|
// if (res.confirm) {
|
|
|
// wx.navigateTo({
|
|
|
// url: '/packageA/pages/login/login',
|
|
|
// })
|
|
|
// } else if (res.cancel) { }
|
|
|
// }
|
|
|
// })
|
|
|
// return false
|
|
|
// }
|
|
|
if (style == 2) {
|
|
|
wx.navigateTo({
|
|
|
url: '/packageA/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src
|
...
|
...
|
@@ -539,10 +499,6 @@ Page({ |
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 排序
|
|
|
reorder(e) {
|
|
|
let that = this
|
...
|
...
|
@@ -735,7 +691,7 @@ Page({ |
|
|
index: 2,
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
}).catch(err => {})
|
|
|
},
|
|
|
|
|
|
getmessagelist() {
|
...
|
...
|
@@ -744,28 +700,22 @@ Page({ |
|
|
let data = {
|
|
|
page: 1,
|
|
|
pageNum: 10,
|
|
|
|
|
|
}
|
|
|
app.post(url, data, "POST").then((r) => {
|
|
|
// console.log(r)
|
|
|
// that.setData({
|
|
|
// messagelist: that.data.messagelist.concat(r.msg)
|
|
|
// })
|
|
|
|
|
|
let newlist = [];
|
|
|
r.msg.forEach(function (value, index, array) {
|
|
|
console.log(newlist)
|
|
|
if (value.status == 1) {
|
|
|
newlist.push(value)
|
|
|
}
|
|
|
})
|
|
|
|
|
|
console.log('77889944556', newlist)
|
|
|
if (newlist.length != 0) {
|
|
|
wx.showTabBarRedDot({
|
|
|
index: 1,
|
|
|
success: function (red) {
|
|
|
|
|
|
wx.setTabBarBadge({
|
|
|
index: 1,
|
|
|
text: newlist.length.toString(),
|
...
|
...
|
@@ -773,8 +723,6 @@ Page({ |
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
}).catch((err) => { })
|
|
|
},
|
|
|
// 获取个人信息
|
...
|
...
|
@@ -790,37 +738,28 @@ Page({ |
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function () {
|
|
|
|
|
|
this.setData({
|
|
|
logok: app.globalData.baseUrlimg + "assets/img/cb2ad36a391388f19f5f912fa021f8f.png"
|
|
|
})
|
|
|
console.log(this.data.logok)
|
|
|
// this.logok=app.globalData.baseUrlimg+"assets/img/cb2ad36a391388f19f5f912fa021f8f.png''
|
|
|
this.get_banner()
|
|
|
console.log(app.globalData.index)
|
|
|
if (app.globalData.index == 0) {
|
|
|
app.globalData.index = undefined
|
|
|
// if (app.globalData.index == 0) {
|
|
|
// app.globalData.index = undefined
|
|
|
let token = wx.getStorageSync('token');
|
|
|
console.log('woshitoe', token)
|
|
|
if (token != "") {
|
|
|
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.ishow()
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
|