mydetails.vue
2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<template>
<ul>
<li>
<label @click="selicon">头像
<span class="details-icon">
<span class="head-portrait user-avatar" :style='icoStyle'></span>
<span class="icon icon-right"></span>
</span>
</label>
</li>
<li>
<label>昵称<input class="details-nickname" v-model='nickname'></label>
</li>
<li>
<label @click="selgender">性别<span class="details-gender">{{ gender }}</span></label>
</li>
<li>
<label>生日<input id="birthday" class="details-birthday" type="text" v-model='birthday' readonly></input>
</li>
</ul>
</template>
<script>
const $ = require('yoho-jquery');
const dtpicker = require('common/anypicker');
const Select = require('common/select');
const iconSel = Select(['拍照','从相册选择']);
const genderSel = Select(['MEN', 'WOMEN']);
module.exports = {
props: ['head_ico', 'nickname', 'gender', 'birthday'],
data() {
return {
icoStyle: this.head_ico ? 'background-image:url(' + this.head_ico + ');' : ''
};
},
methods: {
selicon: function(){
iconSel.show(function(item) {
if (item === '拍照') {
console.log('拍照');
}
if (item === '从相册选择') {
console.log('从相册选择');
}
});
},
selgender: function(){
let _this = this;
genderSel.show(function(item) {
_this.gender = item.toLowerCase();
})
}
},
ready: function(){
$("#birthday").AnyPicker({
mode: "datetime",
dateTimeFormat: "yyyy. MM. dd",
theme: "iOS"
});
}
};
</script>
<style>
@import "../../scss/home/_details.css";
</style>