|
|
<template>
|
|
|
<ul>
|
|
|
<li>
|
|
|
<label @click="selicon">头像
|
|
|
<label @click="setAvatar">头像
|
|
|
<span class="details-icon">
|
|
|
<span class="head-portrait user-avatar" :style='icoStyle'></span>
|
|
|
<span class="icon icon-right"></span>
|
...
|
...
|
@@ -9,23 +9,31 @@ |
|
|
</label>
|
|
|
</li>
|
|
|
<li>
|
|
|
<label>昵称<input class="details-nickname" v-model='nickname'></label>
|
|
|
<label>昵称<input class="nickname" v-model='nickname' @blur="setNickname"></label>
|
|
|
</li>
|
|
|
<li>
|
|
|
<label @click="selgender">性别<span class="details-gender">{{ gender }}</span></label>
|
|
|
<label @click="setAender">性别
|
|
|
<span class="details-gender">
|
|
|
<span class="gender">{{ gender }}</span>
|
|
|
<span class="icon icon-right"></span>
|
|
|
</span>
|
|
|
</label>
|
|
|
</li>
|
|
|
<li>
|
|
|
<label>生日<input id="birthday" class="details-birthday" type="text" v-model='birthday' readonly></input>
|
|
|
<label>生日
|
|
|
<span class="details-birthday">
|
|
|
<input class="birthday" type="date" v-model='birthday' @change="setBirthday"></input>
|
|
|
<span class="icon icon-right"></span>
|
|
|
</span>
|
|
|
</label>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
const yoho = require('yoho');
|
|
|
const $ = require('yoho-jquery');
|
|
|
const dtpicker = require('common/anypicker');
|
|
|
const Select = require('common/select');
|
|
|
const iconSel = Select(['拍照','从相册选择']);
|
|
|
const genderSel = Select(['MEN', 'WOMEN']);
|
|
|
const genderSel = require('common/select')(['MEN', 'WOMEN']);
|
|
|
|
|
|
module.exports = {
|
|
|
props: ['head_ico', 'nickname', 'gender', 'birthday'],
|
...
|
...
|
@@ -35,33 +43,28 @@ |
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
selicon: function(){
|
|
|
iconSel.show(function(item) {
|
|
|
if (item === '拍照') {
|
|
|
console.log('拍照');
|
|
|
}
|
|
|
|
|
|
if (item === '从相册选择') {
|
|
|
console.log('从相册选择');
|
|
|
}
|
|
|
});
|
|
|
setAvatar: function() {
|
|
|
yoho.goSetAvatar();
|
|
|
},
|
|
|
setNickname: function() {
|
|
|
this.saveDetails();
|
|
|
},
|
|
|
selgender: function(){
|
|
|
setAender: function() {
|
|
|
let _this = this;
|
|
|
|
|
|
genderSel.show(function(item) {
|
|
|
_this.gender = item.toLowerCase();
|
|
|
|
|
|
_this.saveDetails();
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
ready: function(){
|
|
|
$("#birthday").AnyPicker({
|
|
|
mode: "datetime",
|
|
|
dateTimeFormat: "yyyy. MM. dd",
|
|
|
theme: "iOS"
|
|
|
});
|
|
|
setBirthday: function() {
|
|
|
this.saveDetails();
|
|
|
},
|
|
|
saveDetails: function(params) {
|
|
|
console.log("saveDetails")
|
|
|
}
|
|
|
}
|
|
|
|
|
|
};
|
|
|
</script>
|
|
|
|
...
|
...
|
|