From 10ab37282ba4984277708ba4982c831fc77a4924 Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Fri, 14 Jun 2019 16:46:54 +0800 Subject: [PATCH] =?UTF-8?q?ID1001733=E3=80=91C=E7=AB=AF=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E6=8A=A5=E5=90=8D=E5=90=8E=E5=A6=82=E6=9E=9C=E6=98=AF=E5=B1=9E?= =?UTF-8?q?=E4=BA=8E=E7=A7=AF=E5=88=86=E5=85=91=E6=8D=A2=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=87=BA=E6=9D=A5=E5=85=91=E6=8D=A2=E7=9A=84?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E6=89=A3=E9=99=A4=EF=BC=8C=E6=8A=A5=E5=90=8D?= =?UTF-8?q?=E6=97=B6=E4=B9=9F=E9=9C=80=E8=A6=81=E6=98=BE=E7=A4=BA=E6=89=80?= =?UTF-8?q?=E6=B6=88=E8=80=97=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/radetail/index.js | 115 ++++++++++++++------------ pages/radetail/index.wxml | 1 + pages/radetail/joinActivity/edit.js | 1 - pages/radetail/joinActivity/edit.wxss | 2 +- pages/radetail/success/index.js | 18 ++++ pages/radetail/success/index.wxml | 1 + pages/radetail/success/index.wxss | 11 ++- 7 files changed, 91 insertions(+), 58 deletions(-) diff --git a/pages/radetail/index.js b/pages/radetail/index.js index 8b7f4bc..bc99ba5 100644 --- a/pages/radetail/index.js +++ b/pages/radetail/index.js @@ -9,91 +9,96 @@ let configUrls = extConfig.attr.configUrl; Page({ data: { data: {}, - status:1, + status: 1, couponId: null, orderId: "", - question:[], + question: [], day: "", hour: "", - activityId:"", + activityId: "", wmhome: imgurl.wmhome.url, minute: "", nodes: '' }, onLoad(options) { let that = this; - if (options.id){ + if(options&&options.id){ that.setData({ activityId: options.id }) - Http.get({ - url: config.api.acfindById, - data: { - id: options.id - } - }).then(res => { - if (res && res.data && res.data.activity){ - that.setData({ - data: res.data.activity - }) - - that.setData({ - activityStartTime:util.formatTime(res.data.activity.activityStartTime, "yyyy-MM-dd hh:mm:ss"), - activityEndTime:util.formatTime(res.data.activity.activityEndTime, "yyyy-MM-dd hh:mm:ss"), - startTime: util.formatTime(res.data.activity.startTime, "yyyy-MM-dd hh:mm:ss"), - endTime: util.formatTime(res.data.activity.endTime, "yyyy-MM-dd hh:mm:ss") + that.findById(options.id); + } + }, + findById(id) { + let that = this; + Http.get({ + url: config.api.acfindById, + data: { + id: id + } + }).then(res => { + if (res && res.data && res.data.activity) { + that.setData({ + data: res.data.activity + }) + + that.setData({ + activityStartTime: util.formatTime(res.data.activity.activityStartTime, "yyyy-MM-dd hh:mm:ss"), + activityEndTime: util.formatTime(res.data.activity.activityEndTime, "yyyy-MM-dd hh:mm:ss"), + startTime: util.formatTime(res.data.activity.startTime, "yyyy-MM-dd hh:mm:ss"), + endTime: util.formatTime(res.data.activity.endTime, "yyyy-MM-dd hh:mm:ss") + }) + if (res.data.activity.type == 2) { + wx.request({ + url: configUrls + config.api.acPrintHtmlById, + data: { + id: options.id, + date: new Date(), + token: app.globalData.token, + }, + header: { + 'content-type': 'application/html' + }, + success: function(res) { + var temp = WxParse.wxParse('article', 'html', res.data, that, 5); + } }) - if (res.data.activity.type == 2) { - wx.request({ - url: configUrls + config.api.acPrintHtmlById, - data: { - id: options.id, - date: new Date(), - token: app.globalData.token, - }, - header: { - 'content-type': 'application/html' - }, - success: function (res) { - var temp = WxParse.wxParse('article', 'html', res.data, that, 5); - } - }) - } - } - if (res && res.data && res.data.status) { - that.setData({ - status: res.data.status - }); } - - }).catch(err => { - wx.showToast({ - title: err.errMsg, - icon: 'none', - duration: 2000, - mask: false - }) + } + if (res && res.data && res.data.status) { + that.setData({ + status: res.data.status + }); + } + + }).catch(err => { + wx.showToast({ + title: err.errMsg, + icon: 'none', + duration: 2000, + mask: false }) - } + }) + }, //跳转到报名详情页 - goSignUp(e){ + goSignUp(e) { let activityId = e.currentTarget.dataset.activityid; wx.navigateTo({ url: `/pages/radetail/joinActivity/edit?activityId=${activityId}`, }) }, - goback: function () { + goback: function() { wx.switchTab({ url: '/pages/main/index', }) }, - gotoactdetail:function(){ + gotoactdetail: function() { let that = this; console.log(that.data.data.detail) - + wx.navigateTo({ url: `/pages/actdetail/actdetail?detail=${that.data.data.detail}`, }) } -}); +}); \ No newline at end of file diff --git a/pages/radetail/index.wxml b/pages/radetail/index.wxml index 376936e..2d80793 100644 --- a/pages/radetail/index.wxml +++ b/pages/radetail/index.wxml @@ -16,6 +16,7 @@ {{data.detail}} 活动人数:{{data.personLimit}}人 + 消耗积分:{{data.credit}}积分 活动开始时间:{{activityStartTime}} 活动结束时间:{{activityEndTime}} 报名开始时间:{{startTime}} diff --git a/pages/radetail/joinActivity/edit.js b/pages/radetail/joinActivity/edit.js index 9d41940..ea07ab1 100644 --- a/pages/radetail/joinActivity/edit.js +++ b/pages/radetail/joinActivity/edit.js @@ -73,7 +73,6 @@ Page({ }, formSubmit: function(e) { let that = this; - console.log(e) /** * sex * 0 保密 diff --git a/pages/radetail/joinActivity/edit.wxss b/pages/radetail/joinActivity/edit.wxss index 267e537..4ec1e11 100644 --- a/pages/radetail/joinActivity/edit.wxss +++ b/pages/radetail/joinActivity/edit.wxss @@ -99,7 +99,7 @@ radio { font-size: 40rpx; border-top:6rpx solid orange; border-bottom:6rpx solid orange; - margin: 40rpx auto 0; + margin: 40rpx auto 30rpx; text-align: center!important; } .ques text{ diff --git a/pages/radetail/success/index.js b/pages/radetail/success/index.js index 7c26ad7..7125bd9 100644 --- a/pages/radetail/success/index.js +++ b/pages/radetail/success/index.js @@ -153,6 +153,24 @@ Page({ that.setData({ activityId: options.activityId }) + that.findById(options.activityId); } + }, + findById(id) { + let that = this; + Http.get({ + url: config.api.acfindById, + data: { + id: id + } + }).then(res => { + if (res && res.data && res.data.activity) { + if (res.data.activity.useCridit){ + that.setData({ + credit: res.data.activity.credit + }) + } + } + }) } }) \ No newline at end of file diff --git a/pages/radetail/success/index.wxml b/pages/radetail/success/index.wxml index 9da840c..da33a37 100644 --- a/pages/radetail/success/index.wxml +++ b/pages/radetail/success/index.wxml @@ -1,3 +1,4 @@ +您已扣除{{credit}}积分 报名成功 请您在我的活动中查看您的报名状态 diff --git a/pages/radetail/success/index.wxss b/pages/radetail/success/index.wxss index b9473ed..2b824ef 100644 --- a/pages/radetail/success/index.wxss +++ b/pages/radetail/success/index.wxss @@ -16,7 +16,16 @@ .fr{ float: right; } - +.title{ + font-size:30rpx; + border:1px solid #999; + width:400rpx; + margin:30rpx auto; + border-radius:10rpx; + text-align:center; + color:#999; + padding: 8rpx 0; +} .btns { padding-bottom: 37rpx;