Browse Source

[编辑资料的修改][修改]:编辑资料增加职业和生活半径

tags/2.2.5
meo 6 years ago
parent
commit
fd69198312
2 changed files with 40 additions and 6 deletions
  1. +22
    -4
      pages/edit/edit.js
  2. +18
    -2
      pages/edit/edit.wxml

+ 22
- 4
pages/edit/edit.js View File

@@ -14,20 +14,38 @@ Page({
{ name: 1, value: '男', checked: false },
{ name: 2, value: '女', checked: false },
],
username: ""
username: "",
array: ['上班族', '学生', '企业高管', '个体户', '自由职业', '其他'],
array1: ['附近住户', '距离2km', '距离3km', '更远'],
index: 0,
index1: 0,
},
/**
* 获得生日
*/
bindDateChange: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value);

console.log(typeof (e.detail.value))
this.setData({
date: e.detail.value,
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 () {
let that = this;
wx.chooseLocation({


+ 18
- 2
pages/edit/edit.wxml View File

@@ -1,8 +1,8 @@
<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='请填写名字'/>
<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>
@@ -19,6 +19,22 @@
</radio>
</radio-group>
</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'>
<text>地址</text>
<input wx:if="{{name}}" type="text" placeholder='{{name}}' disabled/>


Loading…
Cancel
Save