diff --git a/api/owner/ownerApi.js b/api/owner/ownerApi.js
index c5d2852..2973217 100755
--- a/api/owner/ownerApi.js
+++ b/api/owner/ownerApi.js
@@ -71,6 +71,11 @@ export function getCurOwner() {
export function refreshOwner() {
return new Promise(
(resolve, reject) => {
+ let _userInfo = wx.getStorageSync(mapping.USER_INFO);
+ if (!_userInfo) {
+ reject();
+ return;
+ }
request({
url: url.queryAppUserBindingOwner,
data: {
@@ -78,8 +83,8 @@ export function refreshOwner() {
},
success: function(res) {
let _json = res.data;
- if (_json.code == 0) {
- _ownerInfo = _json.data[0];
+ if (_json.code == 0 && _json.data && _json.data.length >0) {
+ let _ownerInfo = _json.data[0];
if (_ownerInfo == null || _ownerInfo == undefined) {
//没有业主信息
reject();
diff --git a/components/my/my-person.vue b/components/my/my-person.vue
index 71df1ed..48221d6 100644
--- a/components/my/my-person.vue
+++ b/components/my/my-person.vue
@@ -50,13 +50,14 @@
import context from '@/lib/java110/Java110Context.js';
const factory = context.factory; //获取app实例
const constant = context.constant;
+ import conf from '@/conf/config.js'
export default {
name: "my-person",
data() {
return {
userInfo: {},
- headerImg: this.imgUrl+'/h5/images/serve/head.png',
- topImg: this.imgUrl+'/h5/images/serve/bg.png',
+ headerImg: conf.imgUrl+'/h5/images/serve/head.png',
+ topImg: conf.imgUrl+'/h5/images/serve/bg.png',
userName: '',
userPhone: '',
communityName: '',
@@ -111,7 +112,7 @@
if(_owner.headImgUrl){
_that.headerImg = _owner.headImgUrl;
}else{
- _that.headerImg = '/static/images/serve/head.png';
+ _that.headerImg =conf.imgUrl+'/h5/images/serve/head.png';
}
_that.userName = _owner.appUserName;
_that.userPhone = _owner.link;
diff --git a/lib/java110/Java110Context.js b/lib/java110/Java110Context.js
index 7df21b4..d845ad9 100644
--- a/lib/java110/Java110Context.js
+++ b/lib/java110/Java110Context.js
@@ -146,6 +146,13 @@ const getCurrentCommunity = function() {
const getRooms = function() {
return new Promise((resolve, reject) => {
+
+ if(!_owner.ownerId || _owner.ownerId == '-1'){
+ resolve({
+ data:{rooms:[]}
+ });
+ }
+
getOwner(function(_owner) {
request({
url: constant.url.queryRoomsByOwner,
diff --git a/pages/my/my.vue b/pages/my/my.vue
index 988981b..50c8fcf 100755
--- a/pages/my/my.vue
+++ b/pages/my/my.vue
@@ -3,7 +3,7 @@
-
+
@@ -46,7 +46,7 @@
import mySystem from '@/components/my/my-system.vue'
export default {
data() {
- return {
+ return {
property: {},
// 用户信息
};
@@ -64,8 +64,13 @@
},
onShow: function() {
let _that = this; //查询用户信息
- this.$refs.myPersonRef.refreshPageLoginInfo();
- this.$refs.mySystem._judgeHasLogin();
+ if (this.$refs.myPersonRef) {
+ this.$refs.myPersonRef.refreshPageLoginInfo();
+ }
+ if (this.$refs.mySystem) {
+ this.$refs.mySystem._judgeHasLogin();
+ }
+
},
methods: {
// 原onShow方法
diff --git a/pages/settings/settings.vue b/pages/settings/settings.vue
index 8354f1e..0a19e2f 100755
--- a/pages/settings/settings.vue
+++ b/pages/settings/settings.vue
@@ -88,10 +88,11 @@
import context from '../../lib/java110/Java110Context.js'
import * as TanslateImage from '../../lib/java110/utils/translate-image.js';
- import {refreshOwner} from '@/api/owner/ownerApi.js'
-
+ import {refreshOwner} from '@/api/owner/ownerApi.js';
+ import conf from '@/conf/config.js';
const constant = context.constant;
const factory = context.factory;
+
export default {
data() {
return {
@@ -112,7 +113,7 @@
return;
}
this.loadOwnerHeaderImg();
-
+
},
methods: {
settingHeadImg: function() {
@@ -134,14 +135,12 @@
//#ifdef H5
TanslateImage.translate(tempFilePaths, (_baseInfo) => {
_that.headerImg = _baseInfo;
- _that._uploadOwnerHeaderImg();
wx.hideLoading()
})
//#endif
//#ifdef MP-WEIXIN
factory.base64.urlTobase64(tempFilePaths[0]).then(function(_baseInfo) {
_that.headerImg = _baseInfo;
- _that._uploadOwnerHeaderImg();
wx.hideLoading()
});
//#endif
@@ -152,9 +151,14 @@
* 查询业主头像
*/
loadOwnerHeaderImg: function() {
+ console.log('loadOwnerHeaderImg')
let _that = this;
refreshOwner().then(_owner=>{
- _that.headerImg = _owner.headerImgUrl;
+ if(_owner.headImgUrl ){
+ _that.headerImg = _owner.headImgUrl;
+ }else{
+ _that.headerImg = conf.imgUrl+'/h5/images/serve/head.png';
+ }
},err=>{
});
@@ -184,6 +188,8 @@
});
return;
}
+
+ _that.loadOwnerHeaderImg();
},
fail: function(e) {
wx.showToast({