Commit 6e40dbb7 by 朱建香

0930

parent 72c6d16d
...@@ -50,6 +50,7 @@ function init() { ...@@ -50,6 +50,7 @@ function init() {
mounted(){ mounted(){
let self = this; let self = this;
iot.navigator.closeAllBesidesItself(); iot.navigator.closeAllBesidesItself();
//获取设备信息
iot.business.sds.getDevicesByUser({ iot.business.sds.getDevicesByUser({
success: (response) => { success: (response) => {
let data = uPublic.checkResponseData(response.data); let data = uPublic.checkResponseData(response.data);
...@@ -118,6 +119,7 @@ function init() { ...@@ -118,6 +119,7 @@ function init() {
let time = new Date(); let time = new Date();
this.ringingTime = moment(time).format("HH:mm"); this.ringingTime = moment(time).format("HH:mm");
// getNewOpenDoorRecord(this); // getNewOpenDoorRecord(this);
}, },
methods:{ methods:{
...@@ -189,7 +191,7 @@ function init() { ...@@ -189,7 +191,7 @@ function init() {
}, },
//tap 个人信息 //tap 个人信息
onMyInfoTap(){ onMyInfoTap(){
myInfoTap(); myInfoTap(this);
}, },
//tap 门锁管理 //tap 门锁管理
onDoorlockManageTap(){ onDoorlockManageTap(){
...@@ -347,10 +349,13 @@ function getNewOpenDoorRecord(self){ ...@@ -347,10 +349,13 @@ function getNewOpenDoorRecord(self){
} }
//tap 个人信息 //tap 个人信息
function myInfoTap(){ function myInfoTap(self){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../myInfo/', url: '../myInfo/',
id: 'myInfo' id: 'myInfo',
extras: {
nickname: self.nickname
}
}); });
} }
......
...@@ -16,18 +16,27 @@ function init() { ...@@ -16,18 +16,27 @@ function init() {
const app = new Vue({ const app = new Vue({
data:{ data:{
//配置组件 //配置组件
textNickName: null, textNickName: iot.navigator.getExtras().nickname,
textErrorTip: '请输入昵称', textErrorTip: null,
componentsConfig: initComponentsConfig() componentsConfig: initComponentsConfig()
}, },
mounted(){ mounted(){
}, },
methods:{ methods:{
getTextNickName(){
return this.textNickName;
},
setTextNickName(text){
this.textNickName = this;
},
onSaveTap(){ onSaveTap(){
saveTap(); saveTap(this);
}, },
onBackTap(){ onBackTap(){
backTap(); backTap();
},
onNicknameChange(text){
nicknameChange(this, text);
} }
} }
}).$mount('#app'); }).$mount('#app');
...@@ -62,12 +71,43 @@ function initComponentsConfig() { ...@@ -62,12 +71,43 @@ function initComponentsConfig() {
} }
} }
//保存昵称 //保存昵称
function saveTap(){ function saveTap(self){
if(self.textNickName == null || self.textNickName.trim() == ''){
self.textErrorTip = Vue.t('editNickname.nickNameInputTip');
}else{
uComponents.showLoading(self);
iot.business.user.setInfo({
data: {
nickname: self.textNickName,
head: '',
info: {}
},
success: (response) => {
if(response.data = 'success'){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{
// name: 'zhu'
});
iot.navigator.back();
}
},
error: (error) => {
console.log(error);
},
complete: () => {
uComponents.hideLoading(self);
}
});
}
} }
//返回上一页 //返回上一页
function backTap(){ function backTap(){
iot.navigator.back(); iot.navigator.back();
} }
function nicknameChange(self, text){
self.textNickName = text;
self.textErrorTip = '';
}
...@@ -16,15 +16,21 @@ function init() { ...@@ -16,15 +16,21 @@ function init() {
const app = new Vue({ const app = new Vue({
data:{ data:{
//配置组件 //配置组件
nickName: 'bank', nickname: 'bank',
componentsConfig: initComponentsConfig() componentsConfig: initComponentsConfig()
}, },
mounted(){ mounted(){
let self = this;
getInfo(this);
window.addEventListener('returnPage',function(event){
console.log("in");
getInfo(self);
});
}, },
methods:{ methods:{
//tap 修改昵称 //tap 修改昵称
onEditNicknameTap(){ onEditNicknameTap(){
editNicknameTap(); editNicknameTap(this);
}, },
//tap 修改密码 //tap 修改密码
onEditPasswordTap(){ onEditPasswordTap(){
...@@ -49,10 +55,13 @@ function initComponentsConfig() { ...@@ -49,10 +55,13 @@ function initComponentsConfig() {
} }
//tap 修改昵称 //tap 修改昵称
function editNicknameTap(){ function editNicknameTap(self){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../myInfo/editNickname.html', url: '../myInfo/editNickname.html',
id: 'editNickname' id: 'editNickname',
extras: {
nickname: self.nickname
}
}); });
} }
...@@ -67,3 +76,19 @@ function editPasswordTap(){ ...@@ -67,3 +76,19 @@ function editPasswordTap(){
function backTap(){ function backTap(){
iot.navigator.back(); iot.navigator.back();
} }
function getInfo(self){
iot.business.user.getInfo({
success: (response) => {
let data = uPublic.checkResponseData(response.data);
if(data){
console.log(data);
self.nickname = data.nickname;
}else{
}
},
error: (error) => {},
complete: () => {}
});
}
...@@ -46,30 +46,31 @@ ...@@ -46,30 +46,31 @@
} }
span{ span{
//去掉span //去掉span
// &:first-child{
// font-size: 16px;
// line-height: 1;
// .flex();
// }
&:first-child{ &:first-child{
font-size: 16px; float: right;
line-height: 1; font-family: iconfont;
.flex(); font-size: @TEXT-COMPONENT-ICON-FONTSIZE;
} -webkit-font-smoothing: antialiased;
&:nth-child(2){ .transform(rotate(180deg));
font-size: 12px;
line-height: 1;
float: right;
} }
&:last-child{ &:last-child{
display: block; font-size: 12px;
// float: right;
.iconfont(@TEXT-COMPONENT-ICON-FONTSIZE);
.transform(rotate(180deg));
} }
} }
} }
.editPassword{ .editPassword{
span{ span{
&:nth-child(2){ &:nth-child(2){
display: block; font-family: iconfont;
// font-size: @TEXT-COMPONENT-ICON-FONTSIZE;
.iconfont(@TEXT-COMPONENT-ICON-FONTSIZE); -webkit-font-smoothing: antialiased;
} }
} }
} }
......
...@@ -25,14 +25,14 @@ ...@@ -25,14 +25,14 @@
</div> </div>
<ul class="editMyInfo"> <ul class="editMyInfo">
<v-touch tag="li" class="editNickname" v-on:tap="onEditNicknameTap"> <v-touch tag="li" class="editNickname" v-on:tap="onEditNicknameTap">
<span >{{ $t('myInfo.editNickname') }}</span> {{ $t('myInfo.editNickname') }}
<span>{{ nickName }}</span>
<span>&#xe611;</span> <span>&#xe611;</span><span>{{ nickname }}</span>
</v-touch> </v-touch>
<v-touch tag="li" class="editPassword" v-on:tap="onEditPasswordTap"> <v-touch tag="li" class="editPassword" v-on:tap="onEditPasswordTap">
<span>{{ $t('myInfo.editPassword') }}</span> {{ $t('myInfo.editPassword') }}
<span>&#xe655;</span>
<span>&#xe611;</span> <span>&#xe611;</span><span>&#xe655;</span>
</v-touch> </v-touch>
</ul> </ul>
<u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading> <u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
......
...@@ -573,13 +573,7 @@ p { ...@@ -573,13 +573,7 @@ p {
width: 100%; width: 100%;
height: 1.467rem; height: 1.467rem;
position: relative; position: relative;
line-height: 1; line-height: 1.467rem;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
padding: 0 1.147rem; padding: 0 1.147rem;
} }
...@@ -596,35 +590,23 @@ p { ...@@ -596,35 +590,23 @@ p {
} }
.editMyInfo li span:first-child { .editMyInfo li span:first-child {
font-size: 0.427rem;
line-height: 1;
flex: 1;
}
.editMyInfo li span:nth-child(2) {
font-size: 0.32rem;
line-height: 1;
float: right; float: right;
}
.editMyInfo li span:last-child {
display: block;
font-family: iconfont; font-family: iconfont;
font-size: 0.533rem; font-size: 0.533rem;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
line-height: 1;
-webkit-transform: rotate(180deg); -webkit-transform: rotate(180deg);
transform: rotate(180deg); transform: rotate(180deg);
} }
.editMyInfo li span:last-child {
font-size: 0.32rem;
float: right;
}
.editMyInfo .editPassword span:nth-child(2) { .editMyInfo .editPassword span:nth-child(2) {
display: block;
font-family: iconfont; font-family: iconfont;
font-size: 0.533rem; font-size: 0.533rem;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
line-height: 1;
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
} }
.errorTip { .errorTip {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment