From ec511e31e01a195bfea5145f9e7e929a68cd9f7e Mon Sep 17 00:00:00 2001 From: liuwh <hugeinfo123> Date: Wed, 25 Mar 2020 01:05:55 +0800 Subject: [PATCH] 提交 --- SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js | 54 ++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 38 insertions(+), 16 deletions(-) diff --git a/SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js b/SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js index 4704e66..934abec 100644 --- a/SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js +++ b/SunshineLnsMinApp/pages/fzpxInfo/fzpxInfo.js @@ -9,18 +9,20 @@ * 页面的初始数据 */ data: { + user: app.globalData.imgUrl + '/image/user.svg', loading: false, peopleInfo: {}, signStatus: '', id: "", - topattList:[], - bottomattList:[] + topattList: [], + bottomattList: [], + statequeId: '' }, /** * 生命周期函数--监听页面加载 */ - onLoad: function (options) { + onLoad: function(options) { var that = this; that.setData({ id: options.id, @@ -33,7 +35,7 @@ }) wx.request({ url: app.globalData.url + '/api/activity/find?id=' + options.id, - success: function (res) { + success: function(res) { console.log(res); that.setData({ loading: false @@ -41,10 +43,21 @@ wx.hideLoading(); if (res.data.code == 0) { res.data.data.startTime = app.formatDate(res.data.data.startTime) + if (res.data.data.activityStatus == 3) { + if (res.data.data.queId) { + that.setData({ + statequeId: res.data.data.queId + }) + } + } else { + that.setData({ + statequeId: '' + }) + } that.setData({ activity: res.data.data, - bottomattList:res.data.data.attList.filter((item)=>(item.associateType==1020)), - topattList:res.data.data.attList.filter((item)=>(item.associateType==1000)) + bottomattList: res.data.data.attList.filter((item) => (item.associateType == 1020)), + topattList: res.data.data.attList.filter((item) => (item.associateType == 1000)) }) console.log('传过来', options.flag) console.log('传过来', options.signStatus) @@ -53,7 +66,8 @@ that.setData({ signStatus: options.signStatus }) - } else {sign + } else { + sign if (options.flag == 'true') { //可报名 console.log('可报名') @@ -98,7 +112,7 @@ }, // 跳转 - linkFunction: function () { + linkFunction: function() { wx.showToast({ title: '抱歉,报名人数已满', icon: 'none', @@ -107,14 +121,22 @@ }, // 呼叫组织方 - makePhoneCall: function (e) { + makePhoneCall: function(e) { var phone = e.currentTarget.dataset['phone']; wx.makePhoneCall({ phoneNumber: phone }) }, - inputChange: function (e) { + //跳转问卷调查 + businessSchedule: function(e) { + var id = e.currentTarget.dataset['id']; + wx.navigateTo({ + url: '/pages/createSub/createSub?id=' + id, + }) + }, + + inputChange: function(e) { var name = e.currentTarget.dataset.name; this.setData({ peopleInfo: { @@ -125,7 +147,7 @@ }, // 签到 - sign: function () { + sign: function() { var id = this.data.id; var userinfo = wx.getStorageSync("user"); var userId = userinfo.id; @@ -138,12 +160,12 @@ title: '识别中', }) wx.request({ - url: app.globalData.url + '/api/activity/sign?id='+id+'&code='+res.result+'&userId='+userId, + url: app.globalData.url + '/api/activity/sign?id=' + id + '&code=' + res.result + '&userId=' + userId, method: 'GET', header: { "Content-Type": "application/json" }, - success: function (res) { + success: function(res) { wx.hideLoading(); if (res.data.code == 0) { wx.showToast({ @@ -164,14 +186,14 @@ }, // 返回 - goBack: function () { + goBack: function() { wx.navigateBack({ delta: 1 }); }, // 提交报名 - submit: function () { + submit: function() { var peopleInfo = this.data.peopleInfo; var userinfo = wx.getStorageSync("user"); var personId = userinfo.id; @@ -209,7 +231,7 @@ header: { "Content-Type": "application/json" }, - success: function (res) { + success: function(res) { wx.hideLoading(); if (res.data.code == 0) { wx.reLaunch({ -- Gitblit v1.8.0