Authored by 沈志敏

上传头像

... ... @@ -29,7 +29,7 @@ const component = {
page: 'index',
noLocalCSS: true,
head_ico: proData && proData.head_ico ? helpers.image(proData.head_ico, 200, 200) : '',
profile_name: proData ? proData.profile_name : '登录/注册',
nickname: proData ? proData.nickname : '登录/注册',
userinfourl: proData ? '/home/mydetails' : '',
serviceUrl: 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409&'
};
... ... @@ -37,19 +37,35 @@ const component = {
res.render('index', _.merge(result, data[1]));
}).catch(next);
},
mydetails: (req, res) => {
mydetails: (req, res, next) => {
const uid = req.user.uid || 14459668;
homeModel.getUserProfileData(uid).then(data => {
res.render('mydetails', {
module: 'home',
page: 'mydetails',
head_ico: data && data.head_ico ? helpers.image(data.head_ico, 92, 92) : '',
nickname: '',
head_ico: data.head_ico ? helpers.image(data.head_ico, 92, 92) : '',
nickname: data.nickname,
gender: data.gender === '1' ? 'men' : 'women',
birthday: data.birthday
});
}).catch(next);
},
updUserInfo: (req, res, next) => {
const uid = req.user.uid || 14459668;
const nickName = req.query.nickName;
const gender = req.query.gender;
const birthday = req.query.birthday;
homeModel.getHelpInfo().then(helpList => {
res.render('help', {
module: 'home',
page: 'help',
noLocalJS: true,
noLocalCSS: true,
helpList: helpList
});
}).catch(next);
},
help: (req, res, next) => {
homeModel.getHelpInfo().then(helpList => {
... ...
... ... @@ -3,7 +3,7 @@
<span class="setting icon icon-setting" id="setting"></span>
<a class="user-info" id="user-info" {{#if userinfourl}} href='{{userinfourl}}' {{/if}}>
<span class="user-avatar" {{#if head_ico}} style="background-image: url('{{head_ico}}');" {{/if}}></span>
<br><span class="username">{{profile_name}}</span>
<br><span class="username">{{nickname}}</span>
</a>
</div>
<div class="my-order">
... ...
... ... @@ -12,7 +12,7 @@
const tip = require('common/tip');
/* 空方法 */
const nullFun = () =>{};
const nullFun = () => {};
/* 提示信息 */
const tipInfo = '暂不支持,请在BLK应用中打开';
... ...
... ... @@ -20,7 +20,9 @@
height: 90px;
border-bottom: 1px solid #e0e0e0;
.details-icon {
.details-icon,
.details-gender,
.details-birthday {
float: right;
height: 100%;
margin-right: 15px;
... ... @@ -59,14 +61,25 @@
overflow: hidden;
display: inline-block;
.details-nickname,
.details-gender,
.details-birthday {
.nickname {
text-align: right;
float: right;
margin-right: 40px;
color: #b0b0b0;
}
.gender {
text-align: right;
color: #b0b0b0;
}
.birthday {
text-align: right;
color: #b0b0b0;
background: transparent;
border: 1px solid #ffffff;
height: 100%;
}
}
}
}
... ...
... ... @@ -32,7 +32,7 @@
.user-avatar {
display: inline-block;
position: relative;
top: 90px;
top: 100px;
width: 200px;
height: 200px;
border-radius: 50%;
... ...
<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>
... ...