107 lines
3.8 KiB
Vue
107 lines
3.8 KiB
Vue
<template>
|
|
<view class="min-height bg-main-light">
|
|
<HeaderItem title="机构"/>
|
|
<view class="p-20 pos-r bg-linear">
|
|
<u-input v-model="keyword" shape="circle" :custom-style="{background: 'white', height: '65rpx'}"
|
|
placeholder="请输入您要查找的机构姓名"/>
|
|
<view class="pos-a" style="right: 30rpx; top: 30rpx">
|
|
<u-button shape="circle" type="primary" :custom-style="{width: '200rpx', zIndex: 9999}" @click="getList">
|
|
搜索
|
|
</u-button>
|
|
</view>
|
|
</view>
|
|
<view class="card m-20 flex justify-center items-center" @click="showType = true">
|
|
<u-icon name="arrow-down" :label="type" label-pos="left" label-size="25rpx"/>
|
|
</view>
|
|
<template v-if="list.length">
|
|
<view class="bg-white rounded m-20 flex flex-col justify-start items-start" v-for="(item, index) in list"
|
|
:key="index" style="padding: 25rpx 0">
|
|
<text class="text-28 text-main m-15 mx-25">{{ item.title }}</text>
|
|
<view class="flex justify-start items-center text-25 text-gray-weight w-100p pb-20"
|
|
style="border-bottom: 1px dotted #6EA5D1">
|
|
<u-icon name="/lawOrgPages/static/building.png" size="100rpx"/>
|
|
<view class="flex flex-col justify-start items-start w-80p ml-15">
|
|
<view class="flex justify-between items-center mt-15 w-100p" @click="call(item.phone)">
|
|
<text>联系方式: {{ item.phone }}</text>
|
|
<u-icon name="phone" :color="MAIN()" size="40rpx"/>
|
|
</view>
|
|
<text class="mt-15">机构地址: {{ item.province }}{{ item.city }}{{ item.region }}</text>
|
|
<text class="mt-15">详细地址: {{ item.address }}</text>
|
|
</view>
|
|
</view>
|
|
<view class="py-15 flex justify-center items-center w-100p" @click="toMap(item)">
|
|
<u-icon name="/lawOrgPages/static/position.png" size="40rpx" label="到这去" :label-color="MAIN()"
|
|
label-pos="right" label-size="28rpx"/>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
<u-empty v-else icon="/lawOrgPages/static/empty.png"/>
|
|
<u-picker :show="showType" :columns="[typeList]" @cancel="showType = false"
|
|
:default-index="defaultIndex"
|
|
@confirm="selectType" key-name="dictDataCode"
|
|
/>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import HeaderItem from "@/components/HeaderItem.vue";
|
|
import {dictDataReq} from "@/api/common";
|
|
import {listLawOrgPeopleReq, listLawOrgReq} from "@/api/lawOrg";
|
|
import {MAIN} from "@/config/color";
|
|
import coordtransform from 'coordtransform'
|
|
|
|
export default {
|
|
name: "peopleList",
|
|
components: {HeaderItem},
|
|
data() {
|
|
return {
|
|
type: '',
|
|
keyword: '',
|
|
list: [],
|
|
typeList: [],
|
|
defaultIndex: [0],
|
|
showType: false
|
|
}
|
|
},
|
|
methods: {
|
|
MAIN() {
|
|
return MAIN
|
|
},
|
|
async getTypeList() {
|
|
const {data} = await dictDataReq({dictId: '161'})
|
|
this.typeList = data
|
|
this.defaultIndex = [data.findIndex(item => item.dictDataCode === this.type)]
|
|
},
|
|
selectType({value}) {
|
|
this.type = value[0].dictDataCode
|
|
this.showType = false
|
|
this.getList()
|
|
},
|
|
async getList() {
|
|
const {data} = await listLawOrgReq({
|
|
keywords: this.keyword
|
|
})
|
|
this.list = data.filter(item => item.type === this.type)
|
|
},
|
|
call(phoneNumber) {
|
|
uni.makePhoneCall({
|
|
phoneNumber: phoneNumber
|
|
})
|
|
},
|
|
toMap(item){
|
|
const [lng, lat] = coordtransform.wgs84togcj02(item.lng, item.lat)
|
|
uni.openLocation({
|
|
latitude: parseFloat(lat),
|
|
longitude: parseFloat(lng),
|
|
name: item.title,
|
|
address: `${item.province}${item.city}${item.region}${item.address}`,
|
|
})
|
|
}
|
|
},
|
|
onLoad({type}) {
|
|
this.type = type
|
|
this.getTypeList()
|
|
this.getList()
|
|
}
|
|
}
|
|
</script> |