瀏覽代碼

[活动报名][修改]:[优化活动报名]

tags/福建版C.9.1.01
meo 5 年之前
父節點
當前提交
d83e452e4c
共有 2 個檔案被更改,包括 32 行新增29 行删除
  1. +27
    -24
      pages/radetail/joinActivity/edit.js
  2. +5
    -5
      pages/radetail/joinActivity/edit.wxml

+ 27
- 24
pages/radetail/joinActivity/edit.js 查看文件

@@ -10,6 +10,7 @@ Page({
data: {
navigationBarHeight,
date: '1988-03-12',
selectques: { "sex": 0, "name": 0, "birth": 0, "phone": 0, "address": 0 },
flag: 1,
answerflag: "",
flagsex: 0,
@@ -60,21 +61,21 @@ Page({
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) {}
// })
// },
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) {}
})
},
change(value){
console.log(value)
},
@@ -91,11 +92,11 @@ Page({
} else {
var sex = that.data.sex;
}
// if (that.data.addressStr) {
// var address = that.data.addressStr;
// } else {
// var address = null;
// }
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) {
@@ -136,12 +137,13 @@ Page({
});
}

if (username == null || sex == 0 || birthday == null) {
if ((username == null && this.data.selectques.name == 1) || (sex == 0 && this.data.selectques.sex == 1) || (birthday == null && this.data.selectques.birthday == 1)) {
wx.showToast({
title: '请输入完整的用户信息',
icon: "none"
})
} else {
}
else {
if (this.data.answerflag == 'noanswer'){
}else{
that.setData({
@@ -150,7 +152,7 @@ Page({
let data ={};
data = {
sex: sex,
// address: address,
address: address,
name: username,
birthday: birthday,
answer: JSON.stringify(that.data.answer),
@@ -266,7 +268,8 @@ Page({
if (res && res.data && res.data.activity) {
this.setData({
useImg: res.data.activity.useImg,
imgDetail: res.data.activity.imgDetail
imgDetail: res.data.activity.imgDetail,
selectques: JSON.parse(res.data.activity.selectques)
})
if (res.data && res.data.activity && res.data.activity.question) {
that.setData({


+ 5
- 5
pages/radetail/joinActivity/edit.wxml 查看文件

@@ -2,19 +2,19 @@
<view style="padding-top:{{navigationBarHeight}}">
<form bindsubmit="formSubmit">
<view style='padding-bottom:100rpx;'>
<view class='section'>
<view class='section' wx:if="{{selectques.name==1}}">
<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">
<view class="section sec" wx:if="{{selectques.birth==1}}">
<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">
<view class="section section_gap" wx:if="{{selectques.sex==1}}">
<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}}">
@@ -22,11 +22,11 @@
</radio>
</radio-group>
</view>
<!-- <view class='address' bindtap='address'>
<view class='address' bindtap='address' wx:if="{{selectques.address==1}}">
<text>住址</text>
<view class='names' wx:if="{{address}}">{{address}}</view>
<view class='names' wx:if="{{!address}}">请选择地址</view>
</view> -->
</view>
<view class='ques' wx:if="{{question&&question.length>0}}">
<text class='questionTitle'>调查问卷</text>
<view class='answer' wx:for="{{question}}" wx:key="index">


Loading…
取消
儲存