Commit 9cf820d1 authored by 石盼盼's avatar 石盼盼

申请页面

parent 19cadcaf
...@@ -106,6 +106,22 @@ Page({ ...@@ -106,6 +106,22 @@ Page({
} }
}, },
apply() { apply() {
if(this.data.name == '' || this.data.name == undefined){
base.toast('真实姓名不能为空')
return
}
if(this.data.selectedIndex == '' || this.data.selectedIndex == undefined){
base.toast('性别不能为空')
return
}
if(this.data.age == '' || this.data.age == undefined){
base.toast('年龄不能为空')
return
}
if( this.data.subject == '' || this.data.subject == undefined){
base.toast('擅长科目不能为空')
return
}
let params = { let params = {
url: 'apply', url: 'apply',
type: 'POST', type: 'POST',
......
...@@ -25,6 +25,7 @@ Page({ ...@@ -25,6 +25,7 @@ Page({
iconActive: 'https://wdty.xueyoubangedu.com/wandou/sexSelected.png' iconActive: 'https://wdty.xueyoubangedu.com/wandou/sexSelected.png'
}, },
], ],
userTel : ''
}, },
/** /**
...@@ -32,7 +33,8 @@ Page({ ...@@ -32,7 +33,8 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({ this.setData({
status: options.status ? options.status : '0' status: options.status ? options.status : '0',
userTel : wx.getStorageSync('userTel')
}) })
}, },
showPopup() { showPopup() {
...@@ -52,47 +54,47 @@ Page({ ...@@ -52,47 +54,47 @@ Page({
selectedIndex: index, selectedIndex: index,
}) })
console.log(this.data.selectedIndex) console.log(this.data.selectedIndex)
}, },
showPopup() { showPopup() {
this.setData({ this.setData({
showCoach: true showCoach: true
}) })
}, },
Close() { Close() {
this.setData({ this.setData({
showCoach: false showCoach: false
}) })
}, },
name(e) { name(e) {
console.log(e.detail); console.log(e.detail);
this.setData({ this.setData({
name: e.detail name: e.detail
}) })
}, },
age(e) { age(e) {
console.log(e.detail); console.log(e.detail);
this.setData({ this.setData({
age: e.detail age: e.detail
}) })
}, },
subject(e) { subject(e) {
console.log(e.detail); console.log(e.detail);
this.setData({ this.setData({
subject: e.detail subject: e.detail
}) })
}, },
major(e) { major(e) {
console.log(e.detail); console.log(e.detail);
this.setData({ this.setData({
major: e.detail major: e.detail
}) })
}, },
certificate(e) { certificate(e) {
console.log(e.detail); console.log(e.detail);
this.setData({ this.setData({
certificate: e.detail certificate: e.detail
}) })
}, },
copy: function (e) { copy: function (e) {
wx.setClipboardData({ wx.setClipboardData({
data: 'bu15333212792', data: 'bu15333212792',
...@@ -111,12 +113,34 @@ certificate(e) { ...@@ -111,12 +113,34 @@ certificate(e) {
}) })
}, },
save() { save() {
if(this.data.name == '' || this.data.name == undefined){
base.toast('真实姓名不能为空')
return
}
if(this.data.selectedIndex == '' || this.data.selectedIndex == undefined){
base.toast('性别不能为空')
return
}
if(this.data.age == '' || this.data.age == undefined){
base.toast('年龄不能为空')
return
}
if( this.data.subject == '' || this.data.subject == undefined){
base.toast('擅长科目不能为空')
return
}
let params = { let params = {
url: 'apply', url: 'apply',
type: 'POST', type: 'POST',
data: { data: {
role_type: this.data.role_type, role_type: this.data.role_type,
mobile: wx.getStorageSync('userTel') mobile: wx.getStorageSync('userTel'),
true_name: this.data.name,
sex: this.data.selectedIndex,
age: this.data.age,
subject: this.data.subject,
major: this.data.major,
certificate: this.data.certificate
}, },
callback: (data) => { callback: (data) => {
wx.redirectTo({ wx.redirectTo({
......
<!-- <view class="box">
<view class="icon">
<image src="/images/pic_01.png"></image>
</view>
<view class="text">申请成功</view>
<view class="cont">
<view class="title">添加审核人员,更快管理场馆!</view>
<view class="code" catchtap="prevImage">
<image src="{{curImage}}"></image>
</view>
<view class="save" catchtap="prevImage">长按保存相册</view>
<view class="wx">微信号: bu15333212792<text class="copy" bindtap="copy">复制</text></view>
</view>
</view> -->
<view> <view>
<view class="one" wx:if="{{ status == 0 }}"> <view class="one" wx:if="{{ status == 0 }}">
<image src="/images/loading.png"></image> <image src="/images/loading.png"></image>
...@@ -43,8 +30,8 @@ ...@@ -43,8 +30,8 @@
<image wx:else class="genderImg" src="{{item.icon}}"></image> <image wx:else class="genderImg" src="{{item.icon}}"></image>
</view> </view>
</view> </view>
<!-- <view class="phone">{{telPhone}}</view> --> <view class="phone">{{userTel}}</view>
<van-field value="{{ value }}" placeholder="请输入手机号" border="{{ true }}" bind:change="tel" /> <!-- <van-field value="{{ value }}" placeholder="请输入手机号" border="{{ true }}" bind:change="tel" /> -->
<van-field value="{{ value }}" placeholder="请输入年龄" border="{{ true }}" bind:change="age" /> <van-field value="{{ value }}" placeholder="请输入年龄" border="{{ true }}" bind:change="age" />
<van-field value="{{ value }}" placeholder="请输入擅长科目" border="{{ true }}" bind:change="subject" /> <van-field value="{{ value }}" placeholder="请输入擅长科目" border="{{ true }}" bind:change="subject" />
<van-field value="{{ value }}" placeholder="请输入所选专业 (选填)" border="{{ true }}" bind:change="major" /> <van-field value="{{ value }}" placeholder="请输入所选专业 (选填)" border="{{ true }}" bind:change="major" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment