Bladeren bron

[活动报名][增加]:[活动报名增加报名成功和活动调查的页面]

tags/C.7.1.0
meo 6 jaren geleden
bovenliggende
commit
20b2a07f41
17 gewijzigde bestanden met toevoegingen van 653 en 20 verwijderingen
  1. +2
    -0
      app.json
  2. +3
    -1
      config/config.js
  3. +37
    -18
      pages/radetail/index.js
  4. +10
    -1
      pages/radetail/index.wxml
  5. +28
    -0
      pages/radetail/index.wxss
  6. +151
    -0
      pages/radetail/joinActivity/edit.js
  7. +3
    -0
      pages/radetail/joinActivity/edit.json
  8. +28
    -0
      pages/radetail/joinActivity/edit.wxml
  9. +87
    -0
      pages/radetail/joinActivity/edit.wxss
  10. +66
    -0
      pages/radetail/sc/edit.js
  11. +3
    -0
      pages/radetail/sc/edit.json
  12. +2
    -0
      pages/radetail/sc/edit.wxml
  13. +1
    -0
      pages/radetail/sc/edit.wxss
  14. +153
    -0
      pages/radetail/success/index.js
  15. +3
    -0
      pages/radetail/success/index.json
  16. +13
    -0
      pages/radetail/success/index.wxml
  17. +63
    -0
      pages/radetail/success/index.wxss

+ 2
- 0
app.json Bestand weergeven

@@ -22,6 +22,8 @@
"pages/edit/edit", "pages/edit/edit",
"pages/actdetail/actdetail", "pages/actdetail/actdetail",
"pages/radetail/index", "pages/radetail/index",
"pages/radetail/success/index",
"pages/radetail/joinActivity/edit",
"pages/bannerdetail/index", "pages/bannerdetail/index",
"pages/getuserinfo/index", "pages/getuserinfo/index",
"pages/phoneinput/phoneinput", "pages/phoneinput/phoneinput",


+ 3
- 1
config/config.js Bestand weergeven

@@ -299,7 +299,9 @@ var config = {
*/ */
printHtmlById:"/wxCampaign/printHtmlById", printHtmlById:"/wxCampaign/printHtmlById",
acfindById:"/wxActivity/findById", acfindById:"/wxActivity/findById",
acPrintHtmlById:"/wxActivity/printHtmlById"
acPrintHtmlById:"/wxActivity/printHtmlById",
//参与活动
activityJoin:"/wxActivityJoin/join"
}, },
weapp: { weapp: {
AppId: weappId AppId: weappId


+ 37
- 18
pages/radetail/index.js Bestand weergeven

@@ -7,43 +7,55 @@ const imgurl = require("../../utils/imgurl");
Page({ Page({
data: { data: {
data: {}, data: {},
status:1,
couponId: null, couponId: null,
orderId: "", orderId: "",
day: "", day: "",
hour: "", hour: "",
activityId:"",
wmhome: imgurl.wmhome.url, wmhome: imgurl.wmhome.url,
minute: "", minute: "",
nodes: '' nodes: ''
}, },
onLoad(options) { onLoad(options) {
let that = this; let that = this;
console.log(options)
if (options.id){ if (options.id){
that.setData({
activityId: options.id
})
Http.get({ Http.get({
url: config.api.acfindById, url: config.api.acfindById,
data: { data: {
id: options.id id: options.id
} }
}).then(res => { }).then(res => {
that.setData({
data: res.data.activity
});
if (res.data.activity.type == 2 ){
wx.request({
url: 'https://ciformall.youlane.cn/C/api' + 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.activity){
that.setData({
data: res.data.activity
}) })
if (res.data.activity.type == 2) {
wx.request({
url: 'https://ciformall.youlane.cn/C/api' + 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 => { }).catch(err => {
wx.showToast({ wx.showToast({
title: err.errMsg, title: err.errMsg,
@@ -54,6 +66,13 @@ Page({
}) })
} }
}, },
//跳转到报名详情页
goSignUp(e){
let activityId = e.currentTarget.dataset.activityid;
wx.navigateTo({
url: `/pages/radetail/joinActivity/edit?activityId=${activityId}`,
})
},
goback: function () { goback: function () {
wx.switchTab({ wx.switchTab({
url: '/pages/main/index', url: '/pages/main/index',


+ 10
- 1
pages/radetail/index.wxml Bestand weergeven

@@ -15,6 +15,11 @@
<text>活动说明</text> <text>活动说明</text>
<text>{{data.detail}}</text> <text>{{data.detail}}</text>
</view> </view>
<view class='member'>活动人数:30人</view>
<view class='time'>活动开始时间:2019.06.11 08:11:30</view>
<view class='time'>活动结束时间:2019.06.11 08:11:30</view>
<view class='time'>报名开始时间:2019.06.11 08:11:30</view>
<view class='time'>报名结束时间:2019.06.11 08:11:30</view>
</view> </view>
</view> </view>
</view> </view>
@@ -23,4 +28,8 @@
<view class="content"> <view class="content">
<template is="wxParse" data="{{wxParseData:article.nodes}}" /> <template is="wxParse" data="{{wxParseData:article.nodes}}" />
</view> </view>
</view>
</view>

<button wx:if="{{status == 0}}" disabled class='signUp' hover-class='opacity'>报名未开始</button>
<button wx:if="{{status == 1}}" class='signUp'data-activityId="{{activityId}}" bindtap='goSignUp' hover-class='opacity'>我要报名</button>
<button wx:if="{{status == 2}}" disabled class='signUp' hover-class='opacity'>活动已结束</button>

+ 28
- 0
pages/radetail/index.wxss Bestand weergeven

@@ -1,4 +1,5 @@
@import "../../app.wxss"; @import "../../app.wxss";
@import "../../wxParse/wxParse.wxss";
.coupons { .coupons {
width: 100%; width: 100%;
position: relative; position: relative;
@@ -607,6 +608,10 @@ button::after{ border: none; }
text-align: left; text-align: left;
line-height: 48rpx; line-height: 48rpx;
padding-top: 3.2%; padding-top: 3.2%;
font-weight: bold;
}
.member{
font-size: 32rpx;
} }


.txt002 { .txt002 {
@@ -1112,4 +1117,27 @@ button::after{ border: none; }
top: 0; top: 0;
bottom: 0; bottom: 0;
margin: auto; margin: auto;
}
.signUp{
position: fixed;
bottom: 30rpx;
left: 0;
right: 0;
margin: auto;
width: 430rpx;
height: 90rpx;
line-height: 90rpx;
border-radius: 60rpx;
background: orange;
color: #fff;
font-size: 30rpx;
text-align: center;
box-shadow: 0 0 10px 0 rgba(211,211,211,0.50);
}
.opacity{
opacity: .8;
}
.time{
font-size: 30rpx;
line-height: 50rpx;
} }

+ 151
- 0
pages/radetail/joinActivity/edit.js Bestand weergeven

@@ -0,0 +1,151 @@
const util = require("../../../utils/util.js");
const Http = require("../../../utils/HttpBasics");
const config = require("../../../config/config");
Page({
/**
* 页面的初始数据
*/
data: {
date: '1988-03-12',
flag: 1,
flagsex: 0,
items: [
{ name: 1, value: '男', checked: false },
{ name: 2, value: '女', checked: false },
],
username: "",
array: ['上班族', '学生', '企业高管', '个体户', '自由职业', '其他'],
array1: ['附近住户', '距离2km', '距离3km', '更远'],
index: 0,
index1: 0,
showPage:false
},
/**
* 获得生日
*/
bindDateChange: function (e) {
this.setData({
date: e.detail.value,
flag: 2
})
},
/**
* 职业
*/
bindPickerChange: function (e) {
this.setData({
index: e.detail.value
})
},
/**
* 生活半径
*/
bindPickerChange1: function (e) {
this.setData({
index1: e.detail.value
})
},
address: function () {
let that = this;
wx.chooseLocation({
success: function (res) {
that.setData({
address: res.name + '(' + res.address + ')',
addressStr: JSON.stringify(res)
})
},
fail: function (error) {
console.log(error)
},
complete: function (data) {
}
})
},
formSubmit: function (e) {
let that = this;
/**
* sex
* 0 保密
* 1 男
* 2 女
*/
if (that.data.flagsex == 0) {
var sex = 0;
} else {
var sex = that.data.sex;
}
if (that.data.addressStr) {
var address = that.data.addressStr;
}
else {
var address = null;
}
if (e.detail.value.username) {
var username = e.detail.value.username;
}
else if (that.data.username) {
var username = that.data.username;
}
else {
var username = null;
}
if (that.data.flag == 2 && that.data.date) {
var birthdate = new Date(that.data.date).getTime();
} else {
var birthdate = null;
}
if (username == null || address == null || sex == 0 || birthdate == null) {
wx.showToast({
title: '请输入完整的用户信息',
icon:"none"
})
} else {
Http.post({
url: config.api.activityJoin,
data: {
sex: sex,
address: address,
name: username,
birthdate: birthdate,
activityId: that.data.activityId
}
})
.then(res => {
wx.showToast({
title: "提交成功",
icon: 'none',
duration: 2000,
mask: false
})
wx.navigateTo({
url: '/pages/radetail/success/index',
})
})
.catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
})
})
}
},
radioChange: function (e) {
this.setData({
sex: e.detail.value,
flagsex: 1
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that = this;
if (options && options.activityId){
that.setData({
activityId: options.activityId
})
}
}
})

+ 3
- 0
pages/radetail/joinActivity/edit.json Bestand weergeven

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "活动调查"
}

+ 28
- 0
pages/radetail/joinActivity/edit.wxml Bestand weergeven

@@ -0,0 +1,28 @@
<form bindsubmit="formSubmit">
<view class='section'>
<text>姓名</text>
<input wx:if="{{username}}" name="username" type="text" placeholder='{{username}}' />
<input wx:if="{{!username}}" name="username" type="text" placeholder='请填写名字' />
</view>
<view class="section sec">
<text>生日</text>
<picker mode="date" value="{{date}}" start="1930-09-01" end="2017-09-01" bindchange="bindDateChange">
<input wx:if="{{flag==1}}" class='input' placeholder='请输入生日' disabled/>
<view wx:if="{{flag==2}}" class="picker"> {{date}}</view>
</picker>
</view>
<view class="section section_gap">
<text>性别</text>
<radio-group class="radio-group" bindchange="radioChange">
<radio class="radio" wx:for-items="{{items}}" wx:key="name" value="{{item.name}}" checked="{{item.checked}}">
<text>{{item.value}}</text>
</radio>
</radio-group>
</view>
<view class='address' bindtap='address'>
<text>住址</text>
<view class='names' wx:if="{{address}}">{{address}}</view>
<view class='names' wx:if="{{!address}}">请选择地址</view>
</view>
<button class='btn' formType="submit" hover-class='active'>提交</button>
</form>

+ 87
- 0
pages/radetail/joinActivity/edit.wxss Bestand weergeven

@@ -0,0 +1,87 @@
input {
width:600rpx;
display: inline-block;
font-size: 32rpx;
vertical-align: middle;
margin-top: -3rpx;
}

.radio-group {
display: inline-block;
}

.section {
height: 100rpx;
line-height: 100rpx;
width: 710rpx;
margin: 0 auto;
border-bottom: 1px solid #eee;
}
.address{
width: 710rpx;
margin: 0 auto;
border-bottom: 1px solid #eee;
padding-bottom: 10rpx;
}
.radio{
margin-right: 30rpx;
}

.section__title, .picker, picker {
display: inline-block;
font-size: 32rpx;
color: #999;
}

radio {
transform:scale(0.8);
}
.section__title {
color: #999;
}

.section > text:nth-of-type(1) {
font-size: 32rpx;
display: inline-block;
margin-right: 20rpx;
}
.address > text:nth-of-type(1) {
font-size: 32rpx;
display: inline-block;
margin-right: 20rpx;
}
.btn{
position: fixed;
bottom: 30rpx;
left: 0;
right: 0;
margin: auto;
width: 600rpx;
color: #fff;
height: 86rpx;
line-height: 86rpx;
text-align: center;
border-radius:60rpx;
background: orange;
font-size: 32rpx;
}
.active{
opacity: .6;
}
.sec{
position: relative;
}
.input{
position: absolute;
left: 84rpx;
z-index: 1000;
top: 0;
bottom: 0;
margin: auto;
background: #fff;
}
.names{
font-size: 26rpx;
line-height: 46rpx;
color: #999;
}

+ 66
- 0
pages/radetail/sc/edit.js Bestand weergeven

@@ -0,0 +1,66 @@
// pages/radetail/sc/edit.js
Page({

/**
* 页面的初始数据
*/
data: {

},

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {

},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

}
})

+ 3
- 0
pages/radetail/sc/edit.json Bestand weergeven

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

+ 2
- 0
pages/radetail/sc/edit.wxml Bestand weergeven

@@ -0,0 +1,2 @@
<!--pages/radetail/sc/edit.wxml-->
<text>pages/radetail/sc/edit.wxml</text>

+ 1
- 0
pages/radetail/sc/edit.wxss Bestand weergeven

@@ -0,0 +1 @@
/* pages/radetail/sc/edit.wxss */

+ 153
- 0
pages/radetail/success/index.js Bestand weergeven

@@ -0,0 +1,153 @@
const util = require("../../../utils/util.js");
const Http = require("../../../utils/HttpBasics");
const config = require("../../../config/config");
Page({
/**
* 页面的初始数据
*/
data: {
date: '1988-03-12',
flag: 1,
flagsex: 0,
items: [
{ name: 1, value: '男', checked: false },
{ name: 2, value: '女', checked: false },
],
username: "",
array: ['上班族', '学生', '企业高管', '个体户', '自由职业', '其他'],
array1: ['附近住户', '距离2km', '距离3km', '更远'],
index: 0,
index1: 0,
showPage:false
},
/**
* 获得生日
*/
bindDateChange: function (e) {
this.setData({
date: e.detail.value,
flag: 2
})
},
goback: function () {
wx.switchTab({
url: '/pages/main/index',
})
},
/**
* 职业
*/
bindPickerChange: function (e) {
this.setData({
index: e.detail.value
})
},
/**
* 生活半径
*/
bindPickerChange1: function (e) {
this.setData({
index1: e.detail.value
})
},
address: function () {
let that = this;
wx.chooseLocation({
success: function (res) {
that.setData({
address: res.name + '(' + res.address + ')',
addressStr: JSON.stringify(res)
})
},
fail: function (error) {
console.log(error)
},
complete: function (data) {
}
})
},
formSubmit: function (e) {
let that = this;
/**
* sex
* 0 保密
* 1 男
* 2 女
*/
if (that.data.flagsex == 0) {
var sex = 0;
} else {
var sex = that.data.sex;
}
if (that.data.addressStr) {
var address = that.data.addressStr;
}
else {
var address = null;
}
if (e.detail.value.username) {
var username = e.detail.value.username;
}
else if (that.data.username) {
var username = that.data.username;
}
else {
var username = null;
}
if (that.data.flag == 2 && that.data.date) {
var birthdate = new Date(that.data.date).getTime();
} else {
var birthdate = null;
}
if (username == null || address == null || sex == 0 || birthdate == null) {
wx.showToast({
title: '请输入完整的用户信息',
icon:"none"
})
} else {
Http.post({
url: config.api.activityJoin,
data: {
sex: sex,
address: address,
name: username,
birthdate: birthdate,
activityId: that.data.activityId
}
})
.then(res => {
wx.showToast({
title: "修改成功",
icon: 'none',
duration: 2000,
mask: false
})
})
.catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
})
})
}
},
radioChange: function (e) {
this.setData({
sex: e.detail.value,
flagsex: 1
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that = this;
if (options && options.activityId){
that.setData({
activityId: options.activityId
})
}
}
})

+ 3
- 0
pages/radetail/success/index.json Bestand weergeven

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "报名成功"
}

+ 13
- 0
pages/radetail/success/index.wxml Bestand weergeven

@@ -0,0 +1,13 @@
<view class='success'>
<text class='tit'>报名成功</text>
<text class='mess'>请您在我的活动中查看您的报名状态</text>
</view>

<view class="btns clearfix" hover-class="none" hover-stop-propagation="false">
<button class="fl" bindtap='goback'>
返回首页
</button>
<button class="fr">
我的活动
</button>
</view>

+ 63
- 0
pages/radetail/success/index.wxss Bestand weergeven

@@ -0,0 +1,63 @@
.success text{
display: block;
text-align: center;
}
.tit{
font-size: 40rpx;
font-weight:bold;
}
.mess{
margin-top: 40rpx;
font-size: 30rpx;
}
.fl{
float: left;
}
.fr{
float: right;
}


.btns {
padding-bottom: 37rpx;
padding-top: 37rpx;
z-index: 100;
background: #fff;
width: 625rpx;
margin:100rpx auto 0;
}
.success{
margin-top: 200rpx;
}
.btns > button {
width: 277rpx;
height: 95rpx;
border-radius: 10rpx;
text-align: center;
}

.btns .fl {
margin-left: 20rpx;
color: #fff;
background: rgba(255, 169, 2, 1);
box-shadow: 0px 8px 8px 1px rgba(255, 169, 2, 0.32);
}

.btns .fl text {
display: block;
font-size: 30rpx;
line-height: 34rpx;
}

.btns .fl text:nth-of-type(1) {
margin-top: 12rpx;
}

.btns .fr {
font-size: 30rpx;
color: #fff;
margin-right: 20rpx;
line-height: 95rpx;
background: rgba(236, 59, 45, 1);
box-shadow: 0px 8px 8px 1px rgba(246, 93, 51, 0.32);
}

Laden…
Annuleren
Opslaan