123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- <template>
- <view class="warrbox flexdc" :style="'padding-top:'+nvaHeight+'px;'">
- <view class="navbox">
- <uni-nav-bar title="访客信息" left-icon="left" @clickLeft="getBackFn" color="#FFFFFF" :background-color="backgroundColor" :border="false" statusBar='true' fixed="true">
- </uni-nav-bar>
- </view>
- <!-- <image :src="mbg" class="navbg"></image> -->
- <view class="vdmain flexdc">
- <view class="flex1">
- <view class="flexcc mb26">
- <view class="line lia"></view>
- <view class="vdtop">邀请详情</view>
- <view class="line lib"></view>
- </view>
- <view class="vdlist mb26">
- <view class="list"><text>访客姓名:</text>{{datainfo.name}}</view>
- <view class="list"><text>来访时间:</text>{{datainfo.visitorTime}}</view>
- <view class="flexc">
- <view class="list mw50"><text>来访人数:</text>{{datainfo.num}}人</view>
- <view class="list mw50"><text>来访事由:</text>{{datainfo.reason}}</view>
- </view>
- <view class="flexc">
- <view class="list mw50"><text>车牌号码:</text>{{datainfo.plateNumber||''}}</view>
- <view class="list mw50"><text>手机号码:</text>{{datainfo.mobileNumber}}</view>
- </view>
- </view>
- <!-- 地图 -->
- <view class="mb22" v-if="checkflag">
- <map
- id="container"
- class="map"
- :latitude="center.lat"
- :longitude="center.lng"
- @poitap="onClcikImgMap"
- @tap="onClcikImgMap"
- :markers="covers"
- scale="18"
- style="width: 638rpx;height:280rpx;"
- ></map>
- </view>
- <!-- <view class="adrbox mb16">
- <view class="tit mb10">分享人</view>
- <view class="txt">{{datainfo.houseAddress||"分享人"}}</view>
- </view> -->
- <view class="adrbox mb16" v-if="checkflag">
- <view class="tit mb10">房屋地址</view>
- <view class="txt">{{datainfo.detailAddress}}{{datainfo.houseAddress}}</view>
- </view>
- </view>
- </view>
- <loading></loading>
- </view>
- </template>
- <script>
- import config from '@/config'
- const baseUrl = config.baseUrl
- import {geocodeAddress} from '@/utils/common.js'
- import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
- import {reservDet} from "@/api/work/people.js"
- var key='';
- // #ifdef H5
- key='8de52b560193f01932ad997dba3e76c0'
- // #endif
- // #ifdef APP-PLUS
- key='8de52b560193f01932ad997dba3e76c0'
- // #endif
- // #ifdef MP-WEIXIN
- key='8de52b560193f01932ad997dba3e76c0'
- // #endif
- export default{
- components:{},
- data(){
- return{
- check: require('@/mine/static/check.png'),
- ncheck: require('@/mine/static/ncheck.png'),
- mapimg: require("@/work/static/visitor/adr.png"),
- nvaHeight:44,
- checkflag:false,
- backgroundColor: "transparent",
- baseUrl:config.baseUrl,
- mapContext:'',
- center:{
- lng:'',
- lat:'',
- },
- covers:[],
- // covers: [{
- // id:0,
- // latitude: '31.839676',
- // longitude: '117.211954',
- // width:18, //宽
- // height:19, //高
- // iconPath: require("@/work/static/visitor/adr.png"),
- // anchor:{x: 0.5, y: 0.5}
- // }],
- id:'',
- datainfo:{},
- }
- },
- onLoad: function(e) {
- uni.getSystemInfo({
- success: (e) => {
- this.nvaHeight = Number(e.statusBarHeight)+44;
- }
- })
- if(e.id){
- this.id=e.id;
- this.getDetail()
- }
- if(e.cflag=='1'){
- this.checkflag=true;
- }else{
- this.checkflag=false;
- }
- if(this.checkflag){
- this.getcreateMap()
- }
- },
- onReady() {
-
- },
- onPageScroll(e) {
- var scrollTop = Number(e.scrollTop);
- if (scrollTop > 0) {
- this.backgroundColor = '#0256FD'
- } else {
- this.backgroundColor = 'transparent'
- }
- },
- methods:{
- checkPermi, checkRole,
- getcreateMap(){
- //mapId 就是你在 map 标签中定义的 id
- this.mapContext = uni.createMapContext('container', this);
- },
- onClcikImgMap(){
-
- },
- getOpenFn(){
-
- },
- getBackFn(){
- uni.navigateBack({
- delta:1
- })
- },
- getPhoneFn(){
- uni.makePhoneCall({
- phoneNumber: '114' //仅为示例
- });
- },
- async getLocation(address) {
- console.log(address,111)
- var that=this;
- if (!address) {
- uni.showToast({ title: '请输入地址', icon: 'none' });
- return;
- }
-
- try {
- const { latitude, longitude } = await geocodeAddress(address, key);
- this.center.lat = latitude;
- this.center.lng = longitude;
- console.log(latitude,longitude)
- that.covers = [];
- that.covers = [{
- id:3,
- width:18, //宽
- height:19, //高
- latitude: latitude,
- longitude: longitude,
- iconPath: that.mapimg,
- anchor:{x: 0.5, y: 0.5}
- }]
- } catch (error) {
- // uni.showToast({ title: '获取经纬度失败', icon: 'none' });
- }
- },
- getDetail(){
- reservDet(this.id).then(res=>{
- if(res.code==200){
- this.datainfo=res.data;
- this.chooseValue=res.data.houseId;
- if(res.data.detailAddress&&this.checkflag){
- this.getLocation(res.data.detailAddress)
- }
- }
- })
- },
- }
- }
- </script>
- <style>
- page{background: #F3F3F0;}
- </style>
- <style lang="scss" scoped>
- .warrbox{min-height: 100vh;background: linear-gradient(180deg, #0256FD 0%,#528AF9 60%, rgba(255,255,255,0) 100%) no-repeat;background-size: 100% 722rpx;padding:0 30rpx 26rpx;}
- .rfbga{background: #2ACA8E !important;}
- .navbg{width: 100%;height: 722rpx;z-index: 0;}
- .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
- .vdmain{z-index: 2;position: relative;background: #FFFFFF;border-radius: 20rpx;flex: 1;padding: 60rpx 26rpx 98rpx;
- .line{width: 168rpx;height: 2rpx;
- &.lia{background: linear-gradient(270deg, #0256FD 0%, rgba(2,86,253,0) 100%);}
- &.lib{background: linear-gradient(90deg, #0256FD 0%, rgba(2,86,253,0) 100%);}
- }
- .vdtop{font-weight: bold;font-size: 26rpx;color: #272727;margin: 0 32rpx;}
- .vdlist{
- .list{font-weight: 500;font-size: 26rpx;color: #272727;margin-bottom: 24rpx;}
- }
- .adrbox{
- .tit{font-weight: bold;font-size: 26rpx;color: #272727;}
- .txt{font-weight: 500;font-size: 26rpx;color: #666666;line-height: 36rpx;}
- .txts{font-weight: 500;font-size: 22rpx;color: #AAAAAA;}
- .checkimg{width: 80rpx;height: 40rpx;margin-left: 8rpx;}
- }
- }
- </style>
|