mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-02-23 21:36:38 +08:00
优化代码
This commit is contained in:
parent
3be4cabb9d
commit
783d6b0aa3
@ -103,4 +103,29 @@ export function recoveryCommunityInfo(_obj){
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询业主小区
|
||||
* @param {Object} dataObj 对象
|
||||
*/
|
||||
export function getOwnerCommunitys(dataObj) {
|
||||
return new Promise(
|
||||
(resolve, reject) => {
|
||||
request({
|
||||
url: url.listCommunitys,
|
||||
method: "GET",
|
||||
data: dataObj,
|
||||
//动态数据
|
||||
success: function(res) {
|
||||
if (res.statusCode == 200) {
|
||||
let _communtiys = res.data.communitys;
|
||||
resolve(_communitys);
|
||||
}
|
||||
},
|
||||
fail: function(e) {
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
@ -611,6 +611,15 @@
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}
|
||||
,{
|
||||
"path" : "pages/changeOwnerCommunity/changeOwnerCommunity",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "切换小区",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#272636",
|
||||
|
||||
60
pages/changeOwnerCommunity/changeOwnerCommunity.vue
Normal file
60
pages/changeOwnerCommunity/changeOwnerCommunity.vue
Normal file
@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<view>
|
||||
<view class="padding">小区信息</view>
|
||||
<view class="cu-list menu ">
|
||||
<view class="cu-item" v-for="(item,sub) in communitys" :key="sub" @tap="_doChangeCommunity(item)">
|
||||
<view class="content padding-tb-sm">
|
||||
<view>
|
||||
<text class="lg cuIcon-homefill text-blue margin-right-xs"></text> {{item.name}}
|
||||
</view>
|
||||
<view class="text-gray text-sm">
|
||||
<text class="lg text-gray cuIcon-location margin-right-xs"></text> {{item.address}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {getOwnerCommunitys} from '../../api/community/communityApi.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
communityName: '',
|
||||
communitys: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this._loadCommunitys();
|
||||
},
|
||||
methods: {
|
||||
_loadCommunitys: function() {
|
||||
let _that = this;
|
||||
let _condition = {
|
||||
name: this.communityName
|
||||
}
|
||||
getOwnerCommunitys()
|
||||
.then(_communitys => {
|
||||
_that.communitys = _communitys;
|
||||
});
|
||||
},
|
||||
_doChangeCommunity: function(_community) {
|
||||
uni.setStorageSync(mapping.CURRENT_COMMUNITY_INFO, JSON.stringify(_community));
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@ -24,10 +24,13 @@
|
||||
</view>
|
||||
|
||||
<view class="cu-list menu margin-top">
|
||||
<view class="cu-item arrow" @click="myAssets()">
|
||||
<view class="cu-item arrow" @tap="_changeCommunity()">
|
||||
<view class="content">
|
||||
<text class="cuIcon-profile text-pink"></text>
|
||||
<text class="text-grey">我的小区</text>
|
||||
<text class="cuIcon-circlefill text-yellow"></text>
|
||||
<text class="text-grey">切换小区</text>
|
||||
</view>
|
||||
<view class="action">
|
||||
<text class="text-grey text-sm">{{currentCommunityName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-item arrow" @click="myAssets()">
|
||||
@ -237,6 +240,12 @@
|
||||
url: '/pages/myAccount/myAccount',
|
||||
});
|
||||
},
|
||||
//切换小区
|
||||
_changeCommunity:function(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/changeOwnerCommunity/changeOwnerCommunity"
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user