Commit 2dea0e607380fd4da6dbeac1ec09e3636a2aba51
1 parent
5b7c583c
好友帮拆的界面 强制授权登陆
Showing
1 changed file
with
54 additions
and
47 deletions
pages/user/assistance/friend_assistance.js
| ... | ... | @@ -33,59 +33,14 @@ Page({ |
| 33 | 33 | var nav_b = th.selectComponent("#nav_b"); //组件的id |
| 34 | 34 | nav_b.set_name("助力", "/pages/user/assistance/assistance"); |
| 35 | 35 | |
| 36 | - | |
| 37 | 36 | if (options.tasking) this.data.tasking = options.tasking; |
| 38 | 37 | if (options.userId) this.data.userId = options.userId; |
| 39 | 38 | //任务是不是为空 |
| 40 | 39 | if (this.data.tasking == 0 || this.data.tasking == undefined) { |
| 41 | - this.data.tasking = decodeURIComponent(options.scene); | |
| 40 | + this.data.tasking = decodeURIComponent(options.scene); | |
| 42 | 41 | } |
| 42 | + getApp().getUserFir(function() {}); | |
| 43 | 43 | |
| 44 | - if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking != | |
| 45 | - 0) { | |
| 46 | - | |
| 47 | - getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { | |
| 48 | - data: { | |
| 49 | - taskingId: th.data.tasking, | |
| 50 | - storeId: os.stoid | |
| 51 | - } | |
| 52 | - }).then(res => { | |
| 53 | - if (res.data.code == 0) { | |
| 54 | - th.data.userId = res.data.data.userId; | |
| 55 | - th.data.taskId = res.data.data.taskId; | |
| 56 | - th.data.helpId=res.data.data.helpFormId; | |
| 57 | - //获取活动的时间 | |
| 58 | - return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { | |
| 59 | - data: { | |
| 60 | - helpId: res.data.data.helpFormId, | |
| 61 | - storeId: os.stoid | |
| 62 | - } | |
| 63 | - }) | |
| 64 | - } | |
| 65 | - return ut.null_promise(); | |
| 66 | - }).then(res => { | |
| 67 | - if (res.data.code == 0) { | |
| 68 | - th.setData({ | |
| 69 | - zl_act: res.data.data | |
| 70 | - }) | |
| 71 | - //获取活动的参与的人数 | |
| 72 | - return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { | |
| 73 | - data: { | |
| 74 | - helpId: res.data.data.id, | |
| 75 | - storeId: os.stoid | |
| 76 | - } | |
| 77 | - }) | |
| 78 | - } | |
| 79 | - return ut.null_promise(); | |
| 80 | - }).then(res => { | |
| 81 | - if (res && res.data && res.data.code == 0) { | |
| 82 | - th.setData({ | |
| 83 | - s_num: res.data.data.countAll | |
| 84 | - }); | |
| 85 | - } | |
| 86 | - }) | |
| 87 | - | |
| 88 | - } | |
| 89 | 44 | }, |
| 90 | 45 | |
| 91 | 46 | // 跳转到助力成功页 |
| ... | ... | @@ -99,11 +54,63 @@ Page({ |
| 99 | 54 | * 生命周期函数--监听页面显示 |
| 100 | 55 | */ |
| 101 | 56 | onShow: function() { |
| 57 | + if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking != | |
| 58 | + 0) { | |
| 102 | 59 | |
| 60 | + getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { | |
| 61 | + data: { | |
| 62 | + taskingId: th.data.tasking, | |
| 63 | + storeId: os.stoid | |
| 64 | + } | |
| 65 | + }).then(res => { | |
| 66 | + if (res.data.code == 0) { | |
| 67 | + th.data.userId = res.data.data.userId; | |
| 68 | + th.data.taskId = res.data.data.taskId; | |
| 69 | + th.data.helpId=res.data.data.helpFormId; | |
| 70 | + //获取活动的时间 | |
| 71 | + return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { | |
| 72 | + data: { | |
| 73 | + helpId: res.data.data.helpFormId, | |
| 74 | + storeId: os.stoid | |
| 75 | + } | |
| 76 | + }) | |
| 77 | + } | |
| 78 | + return ut.null_promise(); | |
| 79 | + }).then(res => { | |
| 80 | + if (res.data.code == 0) { | |
| 81 | + th.setData({ | |
| 82 | + zl_act: res.data.data | |
| 83 | + }) | |
| 84 | + //获取活动的参与的人数 | |
| 85 | + return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { | |
| 86 | + data: { | |
| 87 | + helpId: res.data.data.id, | |
| 88 | + storeId: os.stoid | |
| 89 | + } | |
| 90 | + }) | |
| 91 | + } | |
| 92 | + return ut.null_promise(); | |
| 93 | + }).then(res => { | |
| 94 | + if (res && res.data && res.data.code == 0) { | |
| 95 | + th.setData({ | |
| 96 | + s_num: res.data.data.countAll | |
| 97 | + }); | |
| 98 | + } | |
| 99 | + }) | |
| 100 | + | |
| 101 | + } | |
| 103 | 102 | }, |
| 104 | 103 | //点击开启礼盒 |
| 105 | 104 | cklie_button: function() { |
| 106 | 105 | var th = this; |
| 106 | + //--先判断会员状态-- | |
| 107 | + var user_info = getApp().globalData.userInfo; | |
| 108 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
| 109 | + wx.navigateTo({ | |
| 110 | + url: '/pages/getphone/getphone', | |
| 111 | + }) | |
| 112 | + return false; | |
| 113 | + } | |
| 107 | 114 | var t_user_id = app_d.user_id; |
| 108 | 115 | var data = { |
| 109 | 116 | id: this.data.tasking, | ... | ... |