diff --git a/pages/getphone/getphone.js b/pages/getphone/getphone.js index d000bf6..e772f65 100644 --- a/pages/getphone/getphone.js +++ b/pages/getphone/getphone.js @@ -26,8 +26,7 @@ Page({ if (openid == "" || openid == null || r==null ){ getApp().globalData.user_id=null; getApp().globalData.userInfo=null; - console.log("openid"); - wx.navigateTo({ url: '/pages/togoin/togoin', }) + getApp().goto('/pages/togoin/togoin') return false; } var user_info=getApp().globalData.userInfo; diff --git a/pages/giftpack/birthdaygift/birthdaygift.js b/pages/giftpack/birthdaygift/birthdaygift.js index bae9be5..7070465 100644 --- a/pages/giftpack/birthdaygift/birthdaygift.js +++ b/pages/giftpack/birthdaygift/birthdaygift.js @@ -115,31 +115,22 @@ Page({ }, onLoad: function onLoad(options) { - //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) - return false; - } var th = this; th.setData({ getActId: options.actId, giftID: options.giftBagId }) - th.GetList(); + }, onShow: function onShow() { //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) + getApp().goto('/pages/getphone/getphone'); return false; } + this.GetList(); }, GetReceive: function() { diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js index 7d0a458..9c60f1e 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.js +++ b/pages/giftpack/buygiftpack/giftpackbuy.js @@ -28,15 +28,6 @@ Page({ }, onLoad: function(options) { - //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) - return false; - } - var th = this; var my_confirm = th.selectComponent("#my_confirm"); //组件的id my_confirm.open_cancel(0); @@ -44,17 +35,16 @@ Page({ getStorageID: a.stoid, getUserID: d.user_id }) - th.getList(); + }, onShow: function() { //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) + getApp().goto('/pages/getphone/getphone'); return false; } + this.getList(); }, diff --git a/pages/giftpack/evaluategift/evaluategift.js b/pages/giftpack/evaluategift/evaluategift.js index 7f8e0ce..68b985d 100644 --- a/pages/giftpack/evaluategift/evaluategift.js +++ b/pages/giftpack/evaluategift/evaluategift.js @@ -121,15 +121,6 @@ Page({ }, onLoad: function(options) { - //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) - return false; - } - var th = this; th.setData({ getActId: options.actId, @@ -143,17 +134,17 @@ Page({ th.setData({ orderType: orderType}) } - th.GetList(); + }, onShow: function() { //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) + getApp().goto('/pages/getphone/getphone'); return false; } + + this.GetList(); }, GetReceive: function() { diff --git a/pages/giftpack/festival/festival.js b/pages/giftpack/festival/festival.js index 6618eda..6666a6a 100644 --- a/pages/giftpack/festival/festival.js +++ b/pages/giftpack/festival/festival.js @@ -118,22 +118,13 @@ Page({ }, onLoad: function(options) { - //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) - return false; - } var th = this; th.setData({ getActId: options.actId, giftID: options.giftBagId }) - th.is_festival(); - th.GetList(); + wx.setNavigationBarTitle({ title: "节日有礼", }); @@ -142,11 +133,11 @@ Page({ //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) + getApp().goto('/pages/getphone/getphone'); return false; } + this.is_festival(); + this.GetList(); }, GetReceive: function() { diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index 96ef55f..1eb560b 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -30,14 +30,7 @@ Page({ is_lb: 0, //是否有礼包 }, onLoad: function(options) { - //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) - return false; - } + var th = this; th.setData({ @@ -45,23 +38,23 @@ Page({ getGiftID: options.lbId, orderSn: options.orderSn }) - if (options.isBuy == 0) { - th.GetMyGiftList(); - } else { - th.GetBuyGiftList(); - } + th.close(); }, onShow: function() { //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) + getApp().goto('/pages/getphone/getphone'); return false; } + if (this.data.isBuy == 0) { + this.GetMyGiftList(); + } else { + this.GetBuyGiftList(); + } + }, GetBuyPrice: function(e) { var that = this.data; diff --git a/pages/giftpack/mygiftpack/mygiftpack.js b/pages/giftpack/mygiftpack/mygiftpack.js index fffbdcc..8ab5ca6 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.js +++ b/pages/giftpack/mygiftpack/mygiftpack.js @@ -28,14 +28,6 @@ Page({ }, onLoad: function(options) { - //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) - return false; - } var th = this; th.setData({ @@ -44,17 +36,16 @@ Page({ loadingType: 0, getDate: i.formatTime(new Date().getTime()) }) - th.getList(); + }, onShow: function() { //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) + getApp().goto('/pages/getphone/getphone'); return false; } + this.getList(); }, getList: function() { diff --git a/pages/giftpack/newvipgift/newvipgift.js b/pages/giftpack/newvipgift/newvipgift.js index 5b728c6..a4c9453 100644 --- a/pages/giftpack/newvipgift/newvipgift.js +++ b/pages/giftpack/newvipgift/newvipgift.js @@ -114,30 +114,22 @@ Page({ }, onLoad: function(options) { - //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) - return false; - } + var th = this; th.setData({ getActId: options.actId, giftID: options.giftBagId }) - th.GetList(); + }, onShow: function() { //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) + getApp().goto('/pages/getphone/getphone'); return false; } + this.GetList(); }, GetReceive: function() { diff --git a/pages/user/assistance/assistance.js b/pages/user/assistance/assistance.js index 6cd175c..7257d3d 100644 --- a/pages/user/assistance/assistance.js +++ b/pages/user/assistance/assistance.js @@ -35,15 +35,6 @@ Page({ */ onLoad: function(options) { - //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) - return false; - } - var th = this; var nav_b = th.selectComponent("#nav_b"); //组件的id nav_b.set_name("助力", "/pages/user/assistance/assistance"); @@ -58,15 +49,13 @@ Page({ //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) + getApp().goto('/pages/getphone/getphone'); return false; } var th = this; // 助力活动 - th.assistance(); + this.assistance(); }, // 助力活动 assistance() { diff --git a/pages/user/assistance/friend_assistance.js b/pages/user/assistance/friend_assistance.js index 43e9494..a85edeb 100644 --- a/pages/user/assistance/friend_assistance.js +++ b/pages/user/assistance/friend_assistance.js @@ -29,15 +29,6 @@ Page({ */ onLoad: function(options) { - //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) - return false; - } - var th = this; var nav_b = th.selectComponent("#nav_b"); //组件的id @@ -49,7 +40,6 @@ Page({ if (this.data.tasking == 0 || this.data.tasking == undefined) { this.data.tasking = decodeURIComponent(options.scene); } - getApp().getUserFir(function() {}); }, @@ -67,9 +57,7 @@ Page({ //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) + getApp().goto('/pages/getphone/getphone'); return false; } diff --git a/pages/user/assistance/giftpacklist.js b/pages/user/assistance/giftpacklist.js index 5f81704..a7c90ff 100644 --- a/pages/user/assistance/giftpacklist.js +++ b/pages/user/assistance/giftpacklist.js @@ -39,15 +39,6 @@ Page({ }, onLoad: function(options) { - //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) - return false; - } - var th = this; if (options.is_libao == 0) { th.setData({ @@ -80,9 +71,7 @@ Page({ //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) + getApp().goto('/pages/getphone/getphone'); return false; } diff --git a/pages/user/assistance/task_assistance.js b/pages/user/assistance/task_assistance.js index c1cd519..002ee60 100644 --- a/pages/user/assistance/task_assistance.js +++ b/pages/user/assistance/task_assistance.js @@ -69,14 +69,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) - return false; - } + var th = this; var help_id = options.help_id; var nav_b = th.selectComponent("#nav_b"); //组件的id @@ -147,9 +140,7 @@ Page({ //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/getphone/getphone', - }) + getApp().goto('/pages/getphone/getphone'); return false; }