diff --git a/pages/user/assistance/friend_assistance.js b/pages/user/assistance/friend_assistance.js index 5d6217f..bdc5d76 100644 --- a/pages/user/assistance/friend_assistance.js +++ b/pages/user/assistance/friend_assistance.js @@ -32,54 +32,53 @@ Page({ if (options.userId) this.data.userId = options.userId; //任务是不是为空 if (this.data.tasking == 0 || this.data.tasking == undefined) { - //this.data.task_id = decodeURIComponent(options.scene); - this.data.tasking =1; - 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: { - id: 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; - //获取活动的时间 - 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.data.code == 0) { - th.setData({ - s_num: res.data.data.countAll - }); - } - }) - - } + this.data.tasking = decodeURIComponent(options.scene); } - }, + 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: { + id: 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; + //获取活动的时间 + 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.data.code == 0) { + th.setData({ + s_num: res.data.data.countAll + }); + } + }) + + } + }, // 跳转到助力成功页 participate_activity: function() {