BUG 25784

This commit is contained in:
aixianling
2021-12-23 16:42:14 +08:00
parent 13b6a85497
commit de5bcb1e22
6 changed files with 295 additions and 214 deletions

View File

@@ -1,269 +0,0 @@
<template>
<div class="add">
<div class="title">
<span class="tips"></span>房屋信息
</div>
<div class="pad-l32">
<div class="item">
<span class="label">房屋面积</span>
<div class="value">
<u-input type="digit" placeholder="请输入" v-model="houseInfo.houseArea" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="7" />
</div>
</div>
<div class="item">
<span class="label">居住现状</span>
<div class="value" @click="selectClick('houselivingStatus', 'livingStatus')">
<span :class="houseInfo.livingStatus === '' ? 'color-999' : ''">{{ $dict.getLabel('houselivingStatus', houseInfo.livingStatus) || '请选择'}}</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
<div class="item">
<span class="label">房屋用途</span>
<div class="value" @click="selectClick('houseUseStatus', 'houseUse')">
<span :class="houseInfo.houseUse === '' ? 'color-999' : ''">{{$dict.getLabel('houseUseStatus', houseInfo.houseUse) || '请选择'}}</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
<div class="item" v-if="houseInfo.livingStatus == 1">
<span class="label">承租情况</span>
<div class="value" @click="selectClick('houseLeaseSituation', 'leaseSituation')">
<span :class="houseInfo.leaseSituation === '' ? 'color-999' : ''">{{ $dict.getLabel('houseLeaseSituation', houseInfo.leaseSituation) || '请选择'}}</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
<div class="item" v-if="houseInfo.livingStatus == 1">
<span class="label">起租日期</span>
<div class="value" @click="dateShow=true">
<span :class="houseInfo.startDate === '' ? 'color-999' : ''">{{ houseInfo.startDate || '请选择'}}</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
<div class="item" v-if="houseInfo.livingStatus == 1">
<span class="label">租房备案证明</span>
<div class="value" @click="selectClick('isFilingCertificateStatus', 'isFilingCertificate')">
<span :class="houseInfo.isFilingCertificate === '' ? 'color-999' : ''">{{ $dict.getLabel('isFilingCertificateStatus', houseInfo.isFilingCertificate) || '请选择'}}</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
</div>
<div class="line-bg"></div>
<div class="title">
<span class="tips"></span>房主信息
<span class="select" @click="handleSelectUser('owner')">选择人员</span>
</div>
<div class="pad-l32">
<div class="item" v-for="(item, index) in houseInfo.owner" :key="index">
<span class="label">{{item.name}}</span>
<div class="value" @click="tableRelationSelect('owner', index)">
<span :class=" item.relation === '' ? 'color-999' : ''">{{$dict.getLabel('householdRelation', item.relation) || '与户主关系'}}</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
</div>
<div class="line-bg"></div>
<div class="title">
<span class="tips"></span>承租人信息
<span class="select" @click="handleSelectUser('renter')">选择人员</span>
</div>
<div class="pad-l32">
<div class="item" v-for="(item, index) in houseInfo.renter" :key="index">
<span class="label">{{item.name}}</span>
<div class="value" @click="tableRelationSelect('renter', index)">
<span :class=" item.relation === '' ? 'color-999' : ''">{{$dict.getLabel('householdRelation', item.relation) || '与户主关系'}}</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
</div>
<div class="line-bg"></div>
<div class="title">
<span class="tips"></span>实际居住人员
<span class="select" @click="handleSelectUser('live')">选择人员</span>
</div>
<div class="pad-l32">
<div class="item" v-for="(item, index) in houseInfo.live" :key="index">
<span class="label">{{item.name}}</span>
<div class="value" @click="tableRelationSelect('live', index)">
<span :class=" item.relation === '' ? 'color-999' : ''">{{$dict.getLabel('householdRelation', item.relation) || '与户主关系'}}</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
</div>
<div class="footer" @click="submit">
<div class="btn">保存</div>
</div>
<u-picker mode="time" v-model="dateShow" :params="deteParams" start-year="2010" @confirm="dateConfirm" >请选择</u-picker>
<u-select v-model="showSelect" :list="selectList" label-name="dictName" value-name="dictValue" @confirm="confirmSelect"></u-select>
<u-select v-model="showRelation" :list="$dict.getDict('householdRelation')" label-name="dictName" value-name="dictValue" @confirm="confirmRelation"></u-select>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex'
export default {
data() {
return {
id: '',
houseInfo: {},
showSelect: false,
selectList: [],
formName: '',
dateShow: false,
deteParams: { year: true, month: true, day: true, hour: false, minute: false, second: false},
showRelation: false,
tableName: '',
tableIndex: '',
communityId: ''
}
},
computed: { ...mapState(['user']) },
mounted() {
this.id = this.params.id
this.communityId = this.params.communityId
this.$dict.load('householdRelation', 'houselivingStatus', 'houseLeaseSituation', 'houseUseStatus',
'isFilingCertificateStatus', 'communityBuildingType', 'yesOrNo', 'BulidResidentType').then(() => {
this.getDetail()
})
},
methods: {
...mapActions(['selectEnterpriseContact']),
handleSelectUser(fieldDbName) {
this.selectEnterpriseContact({
fromDepartmentId: 0,
type: ["user"],
selectedUserIds: this.houseInfo[fieldDbName]?.map(e => e.id)
}).then(res => {
this.houseInfo[fieldDbName] = res?.userList || []
})
},
tableRelationSelect(name, index) {
this.tableName = name
this.tableIndex = index
this.showRelation = true
},
confirmRelation(e) {
console.log(this.houseInfo[this.tableName][this.tableIndex])
this.houseInfo[this.tableName][this.tableIndex].relation = e[0].value
},
getDetail() {
this.$http.post(`app/appcommunityhouseinfo/queryDetailById?id=${this.id}`).then(res => {
if (res.code == 0) {
if(res.data.startDate) {
res.data.startDate = res.data.startDate.substring(0, 10)
}
this.houseInfo = res.data
}
})
},
submit() {
this.$http.post(`app/appcommunityhouseinfo/update`, this.houseInfo).then(res => {
if (res.code == 0) {
this.$u.toast('提交成功')
setTimeout(() => {
this.$emit('change', {
type: 'Detail',
params: {
id: this.communityId
}
})
}, 600)
}
})
},
selectClick(dictName, formName) {
console.log(123)
this.selectList = this.$dict.getDict(dictName)
this.formName = formName
this.showSelect = true
},
confirmSelect(e) {
this.houseInfo[this.formName] = e[0].value
},
dateConfirm(e) {
this.houseInfo.startDate = `${e.year}-${e.month}-${e.day}`
}
}
}
</script>
<style lang="scss" scoped>
.add {
padding-bottom: 112px;
.title{
width: 100%;
height: 96px;
line-height: 96px;
background: #FFF;
font-size: 32px;
font-weight: 500;
color: #262B36;
padding-right: 32px;
box-sizing: border-box;
overflow: hidden;
.tips{
display: inline-block;
width: 8px;
height: 32px;
background: #4E75FE;
box-shadow: 0px 8px 24px 2px #C9D8FA;
border-radius: 4px;
vertical-align: middle;
margin-right: 22px;
}
.select{
float: right;
font-size: 30px;
color: #1365DD;
}
}
.item{
width: 100%;
padding: 34px 32px 34px 0;
background: #FFFFFF;
border-bottom: 1px solid #D8DDE6;
display: flex;
justify-content: space-between;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 44px;
box-sizing: border-box;
.color-999{
color: #999;
}
.value{
.u-icon{
margin-left: 16px;
}
}
}
.footer{
width: 100%;
position: fixed;
bottom: 0;
left: 0;
}
.btn{
width: 100%;
height: 112px;
line-height: 112px;
text-align: center;
background: #1365DD;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFF;
}
.line-bg{
width: 100%;
height: 16px;
background: #F5F5F5;
}
.pad-l32{
padding-left: 32px;
background-color: #fff;
}
}
</style>

View File

@@ -1,475 +0,0 @@
<template>
<div class="detail">
<AiTopFixed>
<div class="select-flex" v-if="selectList.length" @click="showSelect=true">
<span class="name">{{selectList[selectCellIndex].cellName}}</span>
<span class="btn">切换</span>
</div>
<div class="line-bg"></div>
<div class="num-content">
<div class="num-item">
<div class="content">
<h2>{{numInfo['实有户数'] || 0}}</h2>
<p>实有户数</p>
</div>
</div>
<div class="num-item">
<div class="content">
<h2>{{numInfo['实有人口'] || 0}}</h2>
<p>实有人口</p>
</div>
</div>
<div class="num-item">
<div class="content">
<h2>{{numInfo['流动人口'] || 0}}</h2>
<p>流动人口</p>
</div>
</div>
</div>
<div class="line-bg"></div>
</AiTopFixed>
<div class="list-content">
<div class="left">
<div class="item-content" v-for="(item, index) in list" :key="index" @click="getHouseDetail(item.id)">
<div class="item">
<h2>{{item.houseCode}}</h2>
<p>无人</p>
</div>
</div>
<AiEmpty v-if="!list.length" style="padding-bottom:80px;" />
</div>
</div>
<u-select v-model="showSelect" :list="selectList" label-name="cellName" value-name="id" @confirm="confirmSelect"></u-select>
<u-popup v-model="show" mode="bottom" border-radius="14">
<div class="popup">
<div class="bg"></div>
<div class="title">{{houseInfo.createAddress}}</div>
<div class="row-info">
<div class="row-item left">
<h3>{{houseInfo.houseArea}} </h3>
<p>房屋面积</p>
</div>
<div class="row-item center">
<span class="right-line"></span>
<span class="left-line"></span>
<h3>{{$dict.getLabel('houseUseStatus', houseInfo.houseUse)}} </h3>
<p>房屋用途</p>
</div>
<div class="row-item right">
<h3>{{ $dict.getLabel('houselivingStatus', houseInfo.livingStatus) }}</h3>
<p>居住现状</p>
</div>
</div>
<div class="row-info">
<div class="row-item left">
<h3>{{ $dict.getLabel('houseLeaseSituation', houseInfo.leaseSituation) }}</h3>
<p>承租情况</p>
</div>
<div class="row-item center">
<span class="right-line"></span>
<span class="left-line"></span>
<h3>{{houseInfo.startDate}}</h3>
<p>起租日期</p>
</div>
<div class="row-item right">
<h3>{{ houseInfo.isFilingCertificate == 1 ? '有' : '无'}}</h3>
<p>租房备案证明</p>
</div>
</div>
</div>
<div v-if="houseInfo.owner.length || houseInfo.renter.length">
<div class="line-bg"></div>
<div class="popup" v-if="houseInfo.owner.length">
<div class="title pad-t32">房主信息</div>
<div class="info-flex" v-for="(item, index) in houseInfo.owner" :key="index">
<div class="item">
<span class="label">房主</span>
<span class="value">{{item.name}}</span>
</div>
<div class="item">
<span class="label">联系方式</span>{{item.phone}}
</div>
</div>
</div>
<div class="popup" v-if="houseInfo.renter.length">
<div class="title pad-t32">承租人信息</div>
<div class="info-flex" v-for="(item, index) in houseInfo.renter" :key="index">
<div class="item">
<span class="label">房主</span>
<span class="value">{{item.name}}</span>
</div>
<div class="item">
<span class="label">联系方式</span>{{item.phone}}
</div>
</div>
</div>
</div>
<div v-if="houseInfo.live.length">
<div class="line-bg"></div>
<div class="popup">
<div class="title pad-t32">实际居住人员</div>
<div v-for="(item, index) in houseInfo.live" :key="index">
<div class="info-flex">
<div class="item">
<span class="label">居住人</span>
<span class="value">{{item.name}}</span>
</div>
<div class="item">
<span class="label">联系方式</span>{{item.phone}}
</div>
</div>
<div class="info-flex mar-t48">
<div class="item">
<span class="label">与户主关系</span>{{$dict.getLabel('householdRelation', item.relation)}}
</div>
</div>
</div>
</div>
</div>
<div class="pop-btn" @click="toAdd">编辑修改</div>
</u-popup>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
props: ['params'],
data() {
return {
show: false,
communityId: '',
list: [],
houseInfo: {
owner: [],
renter: [],
live: []
},
numInfo: {},
showSelect: false,
selectList: [],
selectCellIndex: 0,
houseId: ''
}
},
computed: { ...mapState(['user']) },
mounted() {
this.communityId = this.params.id
this.$dict.load('householdRelation', 'houselivingStatus', 'houseLeaseSituation', 'houseUseStatus',
'isFilingCertificateStatus', 'communityBuildingType', 'yesOrNo', 'BulidResidentType').then(() => {
this.getSelectList()
})
},
methods: {
getSelectList() {
this.$http.post(`app/appcommunitybuildinginfo/list?communityId=${this.communityId}&size=999`).then(res => {
if (res.code == 0 && res.data.records) {
res.data.records.map((item) => {
item.cellName = item.communityName + item.buildingNumber + '栋' + item.unitNumber + '单元'
})
this.selectList = res.data.records
this.getStatistics()
this.getList()
}
})
},
getStatistics() {
this.$http.post(`app/appcommunitybuildinginfo/statistics`, null , {
params: {
id: this.selectList[this.selectCellIndex].communityId,
unitNum: this.selectList[this.selectCellIndex].unitNumber
}
}).then(res => {
if (res.code == 0) {
this.numInfo = res.data.unit
}
})
},
getList() {
this.$http.post(`app/appcommunityhouseinfo/list`, null, {
params: {
current: 1,
size: 1000,
buildingId: this.selectList[this.selectCellIndex].id,
unitNumber: this.selectList[this.selectCellIndex].unitNumber
}
}).then(res => {
if (res.code == 0) {
this.list = res.data.records
}
})
},
getHouseDetail(id) {
this.houseId = id
this.$http.post(`app/appcommunityhouseinfo/queryDetailById?id=${id}`).then(res => {
if (res.code == 0) {
if(res.data.startDate) {
res.data.startDate = res.data.startDate.substring(0, 10)
}
this.houseInfo = res.data
this.show = true
}
})
},
confirmSelect(e) {
this.selectList.map((item, index) => {
if(item.id == e[0].value) {
this.selectCellIndex = index
}
})
this.getStatistics()
this.getList()
},
toAdd() {
this.$emit('change', {
type: 'Add',
params: {
id: this.houseId,
communityId: this.communityId
}
})
}
}
}
</script>
<style lang="scss" scoped>
.detail {
.select-flex{
padding: 20px 40px 40px;
box-sizing: border-box;
line-height: 50px;
display: flex;
justify-content: space-between;
background-color: #fff;
.name{
width: 560px;
word-break: break-all;
font-size: 36px;
font-weight: 800;
color: #333;
}
.btn{
width: 70px;
color: #1365DD;
font-size: 30px;
}
}
.num-content{
width: 100%;
padding: 0 0 18px 40px;
background-color: #fff;
box-sizing: border-box;
display: flex;
.num-item{
flex: 1;
.content{
width: 120px;
text-align: center;
}
h2{
font-size: 36px;
font-weight: bold;
color: #333;
line-height: 42px;
padding-top: 46px;
}
p{
font-size: 26px;
color: #666;
line-height: 36px;
}
}
}
.line-bg{
width: 100%;
height: 8px;
background: #F1F6F9;
}
.list-content{
background-color: #fff;
display: flex;
justify-content: space-between;
width: 100%;
padding: 48px 2px 0 32px;
box-sizing: border-box;
.left{
// width: calc(100% - 120px);
width: 100%;
overflow: hidden;
.item-content{
width: 33%;
padding-right: 32px;
box-sizing: border-box;
float: left;
}
.item{
width: 100%;
height: 158px;
background: #FAFBFF;
border-radius: 1px;
border: 1px solid #E7E7E7;
box-sizing: border-box;
text-align: center;
font-weight: bold;
margin: 0 32px 32px 0;
h2{
font-size: 38px;
color: #5088FF;
line-height: 44px;
margin: 14px 0 26px 0;
}
p{
font-size: 32px;
color: #333;
line-height: 44px;
}
}
.item:nth-of-type(2n) {
margin-right: 0;
}
}
.right{
.item{
width: 120px;
height: 60px;
line-height: 60px;
padding: 0 8px;
background: #FAFBFF;
border-radius: 4px;
border: 1px solid #E7E7E7;
box-sizing: border-box;
font-size: 30px;
font-family: DINAlternate-Bold, DINAlternate;
color: #787878;
letter-spacing: -1px;
margin-bottom: 24px;
}
.active{
background: #5088FF;
border-radius: 2px;
border: 1px solid #E7E7E7;
color: #fff;
}
}
}
.popup{
padding-left: 32px;
.bg{
width: 64px;
height: 10px;
background: #CCC;
border-radius: 6px;
margin: 32px 0 32px 344px;
}
.title{
font-size: 36px;
font-family: PingFang-SC-Heavy, PingFang-SC;
font-weight: 800;
color: #333;
line-height: 50px;
margin-bottom: 40px;
}
.row-info{
padding-bottom: 48px;
.row-item{
display: inline-block;
width: 33%;
h3{
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #4E75FE;
line-height: 64px;
}
p{
font-size: 28px;
color: #666;
line-height: 42px;
}
}
.left{
width: calc(28% - 70px);
text-align: center;
margin-right: 70px;
box-sizing: border-box;
}
.center{
width: 36%;
text-align: center;
box-sizing: border-box;
position: relative;
.left-line{
position: absolute;
top: 20px;
left: 0;
height: 64px;
border-left: 1px solid #E5E5E5;
}
.right-line{
position: absolute;
top: 20px;
right: 0;
height: 64px;
border-left: 1px solid #E5E5E5;
}
}
.right{
width: calc(33% - 40px);
text-align: center;
margin-left: 40px;
box-sizing: border-box;
}
}
.info-flex{
display: flex;
margin-bottom: 24px;
padding-right: 70px;
box-sizing: border-box;
.item{
flex: 1;
font-size: 28px;
color: #333;
line-height: 30px;
.label{
color: #999;
vertical-align: top;
}
.value{
display: inline-block;
width: calc(100% - 120px);
word-break: break-all;
}
}
}
}
.line-bg{
width: 100%;
height: 30px;
background: #F5F6FA;
}
.pad-t32{
padding-top: 32px;
}
.mar-t48{
margin-top: 48px;
}
.pop-btn{
width: 100%;
height: 112px;
line-height: 112px;
text-align: center;
font-size: 32px;
font-weight: 500;
color: #FFF;
background: #1365DD;
}
}
::v-deep .content{
padding: 0!important;
}
</style>

View File

@@ -1,162 +0,0 @@
<template>
<div class="list">
<AiTopFixed>
<u-search placeholder="楼栋名称" :show-action="false" v-model="title" @search="current=1,getList()"/>
</AiTopFixed>
<div class="list-content">
<div class="item" v-for="(item, index) in list" :key="index">
<div class="item-content" @click="toDetail(item.communityId)">
<p class="title line-two">{{item.communityName}}</p>
<p class="address">{{item.createAddress}}</p>
<span class="status" :class="'color'+item.locationStatus">{{$dict.getLabel('BuildLocationStatus', item.locationStatus)}}</span>
</div>
<div class="item-btn" v-if="item.locationStatus != 1" @click="toMap(item.id, item.areaId)">
<span>去定位</span>
</div>
</div>
<AiEmpty v-if="!list.length"/>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
title: '',
current: 1,
list: []
}
},
computed: { ...mapState(['user']) },
mounted() {
this.$dict.load('BuildLocationStatus').then(() => {
this.getList()
})
},
methods: {
getList() {
this.$http.post(`/app/appcommunitybuildinginfo/list`, null, {
params: {
current: 1,
size: 10,
areaId: this.user.areaId,
communityName: this.title
}
}).then(res => {
if (res.code == 0) {
if (this.current > 1 && this.current > res.data.pages) {
return
}
this.list = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
this.pages = res.data.pages
}
})
},
toDetail(id) {
this.$emit('change', {
type: 'Detail',
params: {id}
})
},
toMap(id, areaId) {
this.$emit('change', {
type: 'Map',
params: {id, areaId}
})
}
},
onReachBottom() {
this.current++;
this.getList()
},
}
</script>
<style lang="scss" scoped>
.list {
.list-content{
padding: 32px 32px 0;
background-color: #F5F5F5;
.item{
width: 100%;
background: #FFF;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.02);
border-radius: 8px;
box-sizing: border-box;
position: relative;
overflow: hidden;
margin-bottom: 32px;
.item-content{
padding: 32px 32px 42px 32px;
}
.title{
width: calc(100% - 60px);
word-break: break-all;
font-size: 32px;
color: #333;
line-height: 44px;
}
.address{
width: 100%;
word-break: break-all;
font-size: 28px;
color: #999;
line-height: 40px;
}
.status{
width: 160rpx;
height: 40rpx;
line-height: 36rpx;
font-size: 26rpx;
font-weight: 500;
position: absolute;
right: -38rpx;
top: 24rpx;
-webkit-transform: rotate(90deg);
transform: rotate(45deg);
text-align: center;
}
.color0{
background: #FFECEF;
color: #f46;
}
.color1{
background: #EEF5FF;
color: #5A98F2;
}
.item-btn{
width: 100%;
padding: 20px 32px 20px 0;
border-top: 1px solid #eee;
text-align: right;
box-sizing: border-box;
span{
display: inline-block;
width: 160px;
height: 56px;
line-height: 56px;
text-align: center;
border-radius: 28px;
border: 1px solid #1365DD;
font-size: 28px;
color: #1365DD;
}
}
}
.line-two{
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
}
}
</style>

View File

@@ -1,204 +0,0 @@
<template>
<div class="map">
<div class="build-btn">
<img src="./img/model-icon.png" alt="" @click="toDetail"> 楼栋<br/>模型
</div>
<div class="map-content">
<AiTMap v-if="user.areaId" :areaId="user.areaId" :map.sync="map" :lib.sync="lib" :ops="ops" :libraries="['service', 'tools']"></AiTMap>
</div>
<div class="footer">
<div class="click" @click="isFlag=true">点击定位</div>
<div class="btn" @click="confirm">确认定位</div>
</div>
<!-- <u-popup v-model="show" mode="bottom" border-radius="14">
<div class="popup">
<div class="bg"></div>
<div class="title">恒大城西社区居委会</div>
<p class="address">山东省济南市历城区王舍人街道恒大商业广场蓝天新城</p>
<div class="info-flex">
<span class="label">所属社区</span>
<span class="value">后西一街袁集村</span>
</div>
<div class="info-flex">
<span class="label">所属小区</span>
<span class="value">蓝天新城世纪花园</span>
</div>
<div class="info-flex">
<span class="label">房屋类型</span>
<span class="value">单元(公寓)</span>
</div>
<div class="info-flex">
<span class="label">所属网格</span>
<span class="value">蓝天新城基础网格一</span>
</div>
<div class="info-flex">
<span class="label">网格管理员</span>
<span class="value">林珊珊</span>
</div>
<div class="info-flex">
<span class="label">楼栋长</span>
<span class="value">林珊珊&nbsp;&nbsp;13782951281
<img :src="$cdn + 'common/phone.png'" alt="" @click="call(item)" class="phone-icon">
</span>
</div>
</div>
<div class="popup-btn">查看楼栋模型</div>
</u-popup> -->
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
props: ['params'],
data() {
return {
ops: {},
lib: null,
map: null,
markerLayer: '',
isFlag: false,
latLng: {lat: '', lng: ''},
retryTimes: 0
}
},
computed: {...mapState(['user'])},
mounted() {
this.initMap()
},
methods: {
initMap() { //初始化地图
this.$nextTick(() => {
let {lib: TMap, map, retryTimes} = this
if (map) {
map.setZoom(15)
map.on("click", (evt) => {
if (this.markerLayer) {
this.markerLayer.setMap(null);
}
this.markerLayer = new TMap.MultiMarker({
id: 'marker-layer',
map: map
});
if (this.isFlag) {
this.markerLayer.add({
position: evt.latLng
});
this.latLng = {
lat: evt.latLng.lat,
lng: evt.latLng.lng
}
}
});
} else {
if (retryTimes < 5)
setTimeout(() => {
this.retryTimes++
this.initMap()
}, 1000)
}
})
},
confirm() {
if (!this.latLng.lat) {
return this.$u.toast(`未获取到定位信息,无法定位`)
}
this.$http.post(`/app/appcommunitybuildinginfo/updateLocation`, null, {
params: {
id: this.params.id,
lat: this.latLng.lat,
lng: this.latLng.lng,
}
}).then(res => {
if (res.code == 0) {
this.$u.toast('提交成功')
setTimeout(() => {
this.$emit('change', {
type: 'List',
})
}, 600)
}
})
},
toDetail() {
this.$emit('change', {
type: 'Detail',
params: this.params
})
}
}
}
</script>
<style lang="scss" scoped>
uni-page-body {
height: 100%;
}
.map {
height: 100%;
.build-btn {
width: 80px;
height: 160px;
background: #FFF;
box-shadow: 0 4px 8px 0 rgba(138, 138, 138, 0.5);
border-radius: 8px;
position: fixed;
bottom: 136px;
right: 24px;
z-index: 99999;
padding: 16px 16px 0;
box-sizing: border-box;
font-size: 24px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #666;
line-height: 30px;
img {
width: 48px;
height: 48px;
margin-bottom: 8px;
}
}
.map-content {
width: 100%;
height: 100%;
}
.footer {
width: 100%;
position: fixed;
bottom: 0;
left: 0;
z-index: 99999;
display: flex;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
height: 112px;
line-height: 112px;
text-align: center;
.click {
flex: 1;
color: #333;
background-color: #fff;
}
.btn {
flex: 2;
background: #1365DD;
color: #FFF;
}
}
}
</style>

View File

@@ -95,7 +95,7 @@
<div class="info-flex">
<span class="label">楼栋长</span>
<span
class="value">{{ building.managerName || '' }}&nbsp;&nbsp;{{building.managerPhone || '' }}
class="value">{{ building.managerName || '' }}&nbsp;&nbsp;{{ building.managerPhone || '' }}
<img :src="$cdn + 'common/phone.png'" alt="" @click="callPhone(detailInfo.build.managerPhone)"
class="phone-icon" v-if="detailInfo.build.managerPhone">
</span>
@@ -341,18 +341,13 @@ export default {
})
},
toList() {
this.$emit('change', {
type: 'List',
})
uni.navigateTo({url: './list'})
},
callPhone(phone) {
uni.makePhoneCall({phoneNumber: phone})
},
toDetail(id) {
this.$emit('change', {
type: 'Detail',
params: {id}
})
uni.navigateTo({url: `./detail?id=${id}`})
},
}
}