| @@ -14,20 +14,38 @@ Page({ | |||||
| { name: 1, value: '男', checked: false }, | { name: 1, value: '男', checked: false }, | ||||
| { name: 2, value: '女', checked: false }, | { name: 2, value: '女', checked: false }, | ||||
| ], | ], | ||||
| username: "" | |||||
| username: "", | |||||
| array: ['上班族', '学生', '企业高管', '个体户', '自由职业', '其他'], | |||||
| array1: ['附近住户', '距离2km', '距离3km', '更远'], | |||||
| index: 0, | |||||
| index1: 0, | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 获得生日 | * 获得生日 | ||||
| */ | */ | ||||
| bindDateChange: function (e) { | bindDateChange: function (e) { | ||||
| console.log('picker发送选择改变,携带值为', e.detail.value); | |||||
| console.log(typeof (e.detail.value)) | |||||
| this.setData({ | this.setData({ | ||||
| date: e.detail.value, | date: e.detail.value, | ||||
| flag: 2 | flag: 2 | ||||
| }) | }) | ||||
| }, | }, | ||||
| /** | |||||
| * 职业 | |||||
| */ | |||||
| bindPickerChange: function (e) { | |||||
| console.log(e) | |||||
| this.setData({ | |||||
| index: e.detail.value | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 生活半径 | |||||
| */ | |||||
| bindPickerChange1: function (e) { | |||||
| this.setData({ | |||||
| index1: e.detail.value | |||||
| }) | |||||
| }, | |||||
| address: function () { | address: function () { | ||||
| let that = this; | let that = this; | ||||
| wx.chooseLocation({ | wx.chooseLocation({ | ||||
| @@ -1,8 +1,8 @@ | |||||
| <form bindsubmit="formSubmit"> | <form bindsubmit="formSubmit"> | ||||
| <view class='section'> | <view class='section'> | ||||
| <text>姓名</text> | <text>姓名</text> | ||||
| <input wx:if="{{username}}" name="username" type="text" placeholder='{{username}}'/> | |||||
| <input wx:if="{{!username}}" name="username" type="text" placeholder='请填写名字'/> | |||||
| <input wx:if="{{username}}" name="username" type="text" placeholder='{{username}}' /> | |||||
| <input wx:if="{{!username}}" name="username" type="text" placeholder='请填写名字' /> | |||||
| </view> | </view> | ||||
| <view class="section sec"> | <view class="section sec"> | ||||
| <text>生日</text> | <text>生日</text> | ||||
| @@ -19,6 +19,22 @@ | |||||
| </radio> | </radio> | ||||
| </radio-group> | </radio-group> | ||||
| </view> | </view> | ||||
| <view class="section"> | |||||
| <text>职业</text> | |||||
| <picker bindchange="bindPickerChange" data-occupation='{{array[index]}}' value="{{index}}" range="{{array}}"> | |||||
| <view class="picker"> | |||||
| {{array[index]}} | |||||
| </view> | |||||
| </picker> | |||||
| </view> | |||||
| <view class="section"> | |||||
| <text>生活半径</text> | |||||
| <picker bindchange="bindPickerChange1" data-life='{{array1[index1]}}' value="{{index1}}" range="{{array1}}"> | |||||
| <view class="picker"> | |||||
| {{array1[index1]}} | |||||
| </view> | |||||
| </picker> | |||||
| </view> | |||||
| <view class='section' bindtap='address'> | <view class='section' bindtap='address'> | ||||
| <text>地址</text> | <text>地址</text> | ||||
| <input wx:if="{{name}}" type="text" placeholder='{{name}}' disabled/> | <input wx:if="{{name}}" type="text" placeholder='{{name}}' disabled/> | ||||