diff --git a/app.json b/app.json
index ff51ba3..a3688e2 100644
--- a/app.json
+++ b/app.json
@@ -22,6 +22,8 @@
"pages/edit/edit",
"pages/actdetail/actdetail",
"pages/radetail/index",
+ "pages/radetail/success/index",
+ "pages/radetail/joinActivity/edit",
"pages/bannerdetail/index",
"pages/getuserinfo/index",
"pages/phoneinput/phoneinput",
diff --git a/config/config.js b/config/config.js
index c537836..819faa1 100755
--- a/config/config.js
+++ b/config/config.js
@@ -299,7 +299,9 @@ var config = {
*/
printHtmlById:"/wxCampaign/printHtmlById",
acfindById:"/wxActivity/findById",
- acPrintHtmlById:"/wxActivity/printHtmlById"
+ acPrintHtmlById:"/wxActivity/printHtmlById",
+ //参与活动
+ activityJoin:"/wxActivityJoin/join"
},
weapp: {
AppId: weappId
diff --git a/pages/radetail/index.js b/pages/radetail/index.js
index 7114015..0ea383b 100644
--- a/pages/radetail/index.js
+++ b/pages/radetail/index.js
@@ -7,43 +7,55 @@ const imgurl = require("../../utils/imgurl");
Page({
data: {
data: {},
+ status:1,
couponId: null,
orderId: "",
day: "",
hour: "",
+ activityId:"",
wmhome: imgurl.wmhome.url,
minute: "",
nodes: ''
},
onLoad(options) {
let that = this;
- console.log(options)
if (options.id){
+ that.setData({
+ activityId: options.id
+ })
Http.get({
url: config.api.acfindById,
data: {
id: options.id
}
}).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 => {
wx.showToast({
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 () {
wx.switchTab({
url: '/pages/main/index',
diff --git a/pages/radetail/index.wxml b/pages/radetail/index.wxml
index 5d91b2a..5a6feef 100644
--- a/pages/radetail/index.wxml
+++ b/pages/radetail/index.wxml
@@ -15,6 +15,11 @@
活动说明
{{data.detail}}
+ 活动人数:30人
+ 活动开始时间:2019.06.11 08:11:30
+ 活动结束时间:2019.06.11 08:11:30
+ 报名开始时间:2019.06.11 08:11:30
+ 报名结束时间:2019.06.11 08:11:30
@@ -23,4 +28,8 @@
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/radetail/index.wxss b/pages/radetail/index.wxss
index e3b887a..2e96763 100644
--- a/pages/radetail/index.wxss
+++ b/pages/radetail/index.wxss
@@ -1,4 +1,5 @@
@import "../../app.wxss";
+@import "../../wxParse/wxParse.wxss";
.coupons {
width: 100%;
position: relative;
@@ -607,6 +608,10 @@ button::after{ border: none; }
text-align: left;
line-height: 48rpx;
padding-top: 3.2%;
+ font-weight: bold;
+}
+.member{
+ font-size: 32rpx;
}
.txt002 {
@@ -1112,4 +1117,27 @@ button::after{ border: none; }
top: 0;
bottom: 0;
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;
}
\ No newline at end of file
diff --git a/pages/radetail/joinActivity/edit.js b/pages/radetail/joinActivity/edit.js
new file mode 100644
index 0000000..aebecf1
--- /dev/null
+++ b/pages/radetail/joinActivity/edit.js
@@ -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
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/pages/radetail/joinActivity/edit.json b/pages/radetail/joinActivity/edit.json
new file mode 100644
index 0000000..717f5de
--- /dev/null
+++ b/pages/radetail/joinActivity/edit.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "活动调查"
+}
\ No newline at end of file
diff --git a/pages/radetail/joinActivity/edit.wxml b/pages/radetail/joinActivity/edit.wxml
new file mode 100644
index 0000000..461e55d
--- /dev/null
+++ b/pages/radetail/joinActivity/edit.wxml
@@ -0,0 +1,28 @@
+
\ No newline at end of file
diff --git a/pages/radetail/joinActivity/edit.wxss b/pages/radetail/joinActivity/edit.wxss
new file mode 100644
index 0000000..d18b170
--- /dev/null
+++ b/pages/radetail/joinActivity/edit.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/pages/radetail/sc/edit.js b/pages/radetail/sc/edit.js
new file mode 100644
index 0000000..3012f17
--- /dev/null
+++ b/pages/radetail/sc/edit.js
@@ -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 () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/radetail/sc/edit.json b/pages/radetail/sc/edit.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/radetail/sc/edit.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/radetail/sc/edit.wxml b/pages/radetail/sc/edit.wxml
new file mode 100644
index 0000000..1ab0eaa
--- /dev/null
+++ b/pages/radetail/sc/edit.wxml
@@ -0,0 +1,2 @@
+
+pages/radetail/sc/edit.wxml
diff --git a/pages/radetail/sc/edit.wxss b/pages/radetail/sc/edit.wxss
new file mode 100644
index 0000000..eeeb7ca
--- /dev/null
+++ b/pages/radetail/sc/edit.wxss
@@ -0,0 +1 @@
+/* pages/radetail/sc/edit.wxss */
\ No newline at end of file
diff --git a/pages/radetail/success/index.js b/pages/radetail/success/index.js
new file mode 100644
index 0000000..9800a86
--- /dev/null
+++ b/pages/radetail/success/index.js
@@ -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
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/pages/radetail/success/index.json b/pages/radetail/success/index.json
new file mode 100644
index 0000000..ecbc12f
--- /dev/null
+++ b/pages/radetail/success/index.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "报名成功"
+}
\ No newline at end of file
diff --git a/pages/radetail/success/index.wxml b/pages/radetail/success/index.wxml
new file mode 100644
index 0000000..fb14756
--- /dev/null
+++ b/pages/radetail/success/index.wxml
@@ -0,0 +1,13 @@
+
+ 报名成功
+ 请您在我的活动中查看您的报名状态
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/radetail/success/index.wxss b/pages/radetail/success/index.wxss
new file mode 100644
index 0000000..b9473ed
--- /dev/null
+++ b/pages/radetail/success/index.wxss
@@ -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);
+}
\ No newline at end of file