From 2dea0e607380fd4da6dbeac1ec09e3636a2aba51 Mon Sep 17 00:00:00 2001 From: DESKTOP-C76OEIA\DELL Date: Tue, 11 Feb 2020 17:40:21 +0800 Subject: [PATCH] 好友帮拆的界面 强制授权登陆 --- pages/user/assistance/friend_assistance.js | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------- 1 file changed, 54 insertions(+), 47 deletions(-) diff --git a/pages/user/assistance/friend_assistance.js b/pages/user/assistance/friend_assistance.js index 4658f13..8701da5 100644 --- a/pages/user/assistance/friend_assistance.js +++ b/pages/user/assistance/friend_assistance.js @@ -33,59 +33,14 @@ Page({ var nav_b = th.selectComponent("#nav_b"); //组件的id nav_b.set_name("助力", "/pages/user/assistance/assistance"); - if (options.tasking) this.data.tasking = options.tasking; if (options.userId) this.data.userId = options.userId; //任务是不是为空 if (this.data.tasking == 0 || this.data.tasking == undefined) { - this.data.tasking = decodeURIComponent(options.scene); + this.data.tasking = decodeURIComponent(options.scene); } + getApp().getUserFir(function() {}); - if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking != - 0) { - - getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { - data: { - taskingId: th.data.tasking, - storeId: os.stoid - } - }).then(res => { - if (res.data.code == 0) { - th.data.userId = res.data.data.userId; - th.data.taskId = res.data.data.taskId; - th.data.helpId=res.data.data.helpFormId; - //获取活动的时间 - return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { - data: { - helpId: res.data.data.helpFormId, - storeId: os.stoid - } - }) - } - return ut.null_promise(); - }).then(res => { - if (res.data.code == 0) { - th.setData({ - zl_act: res.data.data - }) - //获取活动的参与的人数 - return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { - data: { - helpId: res.data.data.id, - storeId: os.stoid - } - }) - } - return ut.null_promise(); - }).then(res => { - if (res && res.data && res.data.code == 0) { - th.setData({ - s_num: res.data.data.countAll - }); - } - }) - - } }, // 跳转到助力成功页 @@ -99,11 +54,63 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function() { + if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking != + 0) { + getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { + data: { + taskingId: th.data.tasking, + storeId: os.stoid + } + }).then(res => { + if (res.data.code == 0) { + th.data.userId = res.data.data.userId; + th.data.taskId = res.data.data.taskId; + th.data.helpId=res.data.data.helpFormId; + //获取活动的时间 + return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { + data: { + helpId: res.data.data.helpFormId, + storeId: os.stoid + } + }) + } + return ut.null_promise(); + }).then(res => { + if (res.data.code == 0) { + th.setData({ + zl_act: res.data.data + }) + //获取活动的参与的人数 + return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { + data: { + helpId: res.data.data.id, + storeId: os.stoid + } + }) + } + return ut.null_promise(); + }).then(res => { + if (res && res.data && res.data.code == 0) { + th.setData({ + s_num: res.data.data.countAll + }); + } + }) + + } }, //点击开启礼盒 cklie_button: function() { var th = this; + //--先判断会员状态-- + 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 t_user_id = app_d.user_id; var data = { id: this.data.tasking, -- libgit2 0.21.4