Commit 6e40dbb7 by 朱建香

0930

parent 72c6d16d
......@@ -50,6 +50,7 @@ function init() {
mounted(){
let self = this;
iot.navigator.closeAllBesidesItself();
//获取设备信息
iot.business.sds.getDevicesByUser({
success: (response) => {
let data = uPublic.checkResponseData(response.data);
......@@ -118,6 +119,7 @@ function init() {
let time = new Date();
this.ringingTime = moment(time).format("HH:mm");
// getNewOpenDoorRecord(this);
},
methods:{
......@@ -189,7 +191,7 @@ function init() {
},
//tap 个人信息
onMyInfoTap(){
myInfoTap();
myInfoTap(this);
},
//tap 门锁管理
onDoorlockManageTap(){
......@@ -347,10 +349,13 @@ function getNewOpenDoorRecord(self){
}
//tap 个人信息
function myInfoTap(){
function myInfoTap(self){
iot.navigator.openWindow({
url: '../myInfo/',
id: 'myInfo'
id: 'myInfo',
extras: {
nickname: self.nickname
}
});
}
......
......@@ -16,18 +16,27 @@ function init() {
const app = new Vue({
data:{
//配置组件
textNickName: null,
textErrorTip: '请输入昵称',
textNickName: iot.navigator.getExtras().nickname,
textErrorTip: null,
componentsConfig: initComponentsConfig()
},
mounted(){
},
methods:{
getTextNickName(){
return this.textNickName;
},
setTextNickName(text){
this.textNickName = this;
},
onSaveTap(){
saveTap();
saveTap(this);
},
onBackTap(){
backTap();
},
onNicknameChange(text){
nicknameChange(this, text);
}
}
}).$mount('#app');
......@@ -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(){
iot.navigator.back();
}
function nicknameChange(self, text){
self.textNickName = text;
self.textErrorTip = '';
}
......@@ -16,15 +16,21 @@ function init() {
const app = new Vue({
data:{
//配置组件
nickName: 'bank',
nickname: 'bank',
componentsConfig: initComponentsConfig()
},
mounted(){
let self = this;
getInfo(this);
window.addEventListener('returnPage',function(event){
console.log("in");
getInfo(self);
});
},
methods:{
//tap 修改昵称
onEditNicknameTap(){
editNicknameTap();
editNicknameTap(this);
},
//tap 修改密码
onEditPasswordTap(){
......@@ -49,10 +55,13 @@ function initComponentsConfig() {
}
//tap 修改昵称
function editNicknameTap(){
function editNicknameTap(self){
iot.navigator.openWindow({
url: '../myInfo/editNickname.html',
id: 'editNickname'
id: 'editNickname',
extras: {
nickname: self.nickname
}
});
}
......@@ -67,3 +76,19 @@ function editPasswordTap(){
function backTap(){
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 @@
}
span{
//去掉span
// &:first-child{
// font-size: 16px;
// line-height: 1;
// .flex();
// }
&:first-child{
font-size: 16px;
line-height: 1;
.flex();
}
&:nth-child(2){
font-size: 12px;
line-height: 1;
float: right;
font-family: iconfont;
font-size: @TEXT-COMPONENT-ICON-FONTSIZE;
-webkit-font-smoothing: antialiased;
.transform(rotate(180deg));
}
&:last-child{
display: block;
//
.iconfont(@TEXT-COMPONENT-ICON-FONTSIZE);
.transform(rotate(180deg));
font-size: 12px;
float: right;
}
}
}
.editPassword{
span{
&:nth-child(2){
display: block;
//
.iconfont(@TEXT-COMPONENT-ICON-FONTSIZE);
font-family: iconfont;
font-size: @TEXT-COMPONENT-ICON-FONTSIZE;
-webkit-font-smoothing: antialiased;
}
}
}
......
......@@ -25,14 +25,14 @@
</div>
<ul class="editMyInfo">
<v-touch tag="li" class="editNickname" v-on:tap="onEditNicknameTap">
<span >{{ $t('myInfo.editNickname') }}</span>
<span>{{ nickName }}</span>
<span>&#xe611;</span>
{{ $t('myInfo.editNickname') }}
<span>&#xe611;</span><span>{{ nickname }}</span>
</v-touch>
<v-touch tag="li" class="editPassword" v-on:tap="onEditPasswordTap">
<span>{{ $t('myInfo.editPassword') }}</span>
<span>&#xe655;</span>
<span>&#xe611;</span>
{{ $t('myInfo.editPassword') }}
<span>&#xe611;</span><span>&#xe655;</span>
</v-touch>
</ul>
<u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
......
......@@ -573,13 +573,7 @@ p {
width: 100%;
height: 1.467rem;
position: relative;
line-height: 1;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
line-height: 1.467rem;
padding: 0 1.147rem;
}
......@@ -596,35 +590,23 @@ p {
}
.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;
}
.editMyInfo li span:last-child {
display: block;
font-family: iconfont;
font-size: 0.533rem;
-webkit-font-smoothing: antialiased;
line-height: 1;
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
}
.editMyInfo li span:last-child {
font-size: 0.32rem;
float: right;
}
.editMyInfo .editPassword span:nth-child(2) {
display: block;
font-family: iconfont;
font-size: 0.533rem;
-webkit-font-smoothing: antialiased;
line-height: 1;
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
}
.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