|
@@ -16,26 +16,7 @@ Page({
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
- onLoad: async function (options) {
|
|
|
- let userMobile = await activity.getMobileCache();
|
|
|
- console.log(userMobile)
|
|
|
- if (userMobile.length !== 0) {
|
|
|
- this.setData({
|
|
|
- isLogin: true,
|
|
|
- mobileTop: userMobile,
|
|
|
- })
|
|
|
- }
|
|
|
- // this.setData({
|
|
|
- // isLogin: getMobileCache() != '',
|
|
|
- // mobileTop: getMobileCache(),
|
|
|
- // })
|
|
|
-
|
|
|
- if(this.data.isLogin){
|
|
|
- let nums = await this.getCountNum();
|
|
|
- this.setData({
|
|
|
- countNum: nums,
|
|
|
- })
|
|
|
- }
|
|
|
+ onLoad: function (options) {
|
|
|
|
|
|
},
|
|
|
|
|
@@ -193,7 +174,22 @@ Page({
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
- onShow: function () {
|
|
|
+ onShow: async function () {
|
|
|
+ let userMobile = await activity.getMobileCache();
|
|
|
+ console.log(userMobile)
|
|
|
+ if (userMobile.length !== 0) {
|
|
|
+ this.setData({
|
|
|
+ isLogin: true,
|
|
|
+ mobileTop: userMobile,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.data.isLogin){
|
|
|
+ let nums = await this.getCountNum();
|
|
|
+ this.setData({
|
|
|
+ countNum: nums,
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
|