123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322 |
- <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>{{kaType(datainfo.reason,sylist)}}</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">
- <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>
- <!-- <map
- id="container"
- class="map"
- :latitude="center.lat"
- :longitude="center.lng"
- @poitap="onClcikImgMap"
- @tap="onClcikImgMap"
- :markers="covers"
- scale="15"
- :style="'width: 750rpx;height:' + mapheight + 'px;'"
- ></map> -->
- </view>
- <view class="adrbox mb16">
- <view class="tit mb10">房屋地址</view>
- <view class="txt">{{datainfo.detailAddress}}{{datainfo.houseAddress}}</view>
- </view>
- <view class="adrbox">
- <view class="flexc mb6">
- <view class="tit flex1">共享位置</view>
- <view class="flexc" @click="checkflag=!checkflag">
- <view class="flex1"></view>
- <image :src="check" v-if="checkflag" class="checkimg"></image>
- <image :src="ncheck" v-else class="checkimg"></image>
- </view>
- </view>
-
- <view class="txts">打开即确认将位置共享于被分享者</view>
- </view>
- </view>
- <!-- #ifdef APP-PLUS -->
- <view class="rhbtn mt30" @click="getShareFn">分享</view>
- <!-- #endif -->
- <!-- #ifdef MP-WEIXIN -->
- <!-- <button open-type="share" class="rhbtn mt30">分享</button> -->
- <!-- #endif -->
- <!-- <button class="rhbtn mt30" @click="getShareFn">分享</button> -->
- <!-- <view class="rhbtn mt30" @click="getShareFn">分享</view> -->
- <!-- <view class="rhbtn mt30" @click="getPutFn">修改</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"
- import {getDictionaryFn} from "@/api/system/user.js"
- import {selectDictValue} from "@/utils/common.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,
- shareurl:config.shareurl,
- mapContext:'',
- center:{
- lng:'',
- lat:'',
- },
- covers:[],
- sylist:[],
- // 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;
- }
- })
- this.init()
- if(e.id){
- this.id=e.id;
- this.getDetail()
- }
- },
- onReady() {
- this.getcreateMap()
- },
- onPageScroll(e) {
- var scrollTop = Number(e.scrollTop);
- if (scrollTop > 0) {
- this.backgroundColor = '#0256FD'
- } else {
- this.backgroundColor = 'transparent'
- }
- },
- onShareAppMessage(res) {
- // this.comflag=false;
- // if (res.from === 'button') {// 来自页面内分享按钮
- // var data=res.target.dataset;
- // var newobj={
- // title: "邀请你来我家",
- // path: 'http://192.168.101.147:9091'
- // }
- // // if(data.img){
- // // newobj.imageUrl=this.baseUrl+data.img
- // // }
- // return newobj
- // }else{
- // return {
- // title: '智能校管家',
- // path: '/pages/trends/index'
- // }
- // }
- },
- methods:{
- checkPermi, checkRole,
- kaType(data, list) {
- return selectDictValue(list, data);
- },
- init(){
- // 获取事由
- getDictionaryFn('visit_reason').then(res=>{
- if(res.code==200){
- this.sylist = res.data.map(v => {
- return {
- dictLabel: v.dictLabel,
- dictValue: v.dictValue
- }
- })
- }
- })
- },
- getcreateMap(){
- //mapId 就是你在 map 标签中定义的 id
- this.mapContext = uni.createMapContext('container', this);
- },
- onClcikImgMap(){
-
- },
- getShareFn(){
- // /profile/upload/2025/06/11/applogo_20250611033931A020.png
- //用户端/profile/upload/2025/06/11/applogo_20250611034002A021.png
- var cflag=0;
- if(this.checkflag){
- cflag=1
- }
- uni.share({
- provider: "weixin",
- scene: "WXSceneSession",
- type: 0,
- href: this.shareurl+'/work/pages/visitor/vshare?id='+this.id+'&cflag='+cflag,
- title: "邀请你来我家",
- summary: "邀请信息",
- imageUrl: "https://zxyzhsq.qs163.cn/prod-api/profile/upload/2025/06/11/applogo_20250611034002A021.png",
- success: function (res) {
- console.log("success:" + JSON.stringify(res));
- },
- fail: function (err) {
- console.log("fail:" + JSON.stringify(err));
- }
- });
- },
- getPutFn(){
- this.$tab.navigateTo("/work/pages/visitor/vadd?id="+this.id)
- },
- 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(){
- var that=this;
- reservDet(this.id).then(res=>{
- if(res.code==200){
- this.datainfo=res.data;
- this.chooseValue=res.data.houseId;
- if(res.data.detailAddress){
- // this.getLocation(res.data.detailAddress)
- var latitude=res.data.lat
- var longitude=res.data.lgt
- this.center.lat = latitude;
- this.center.lng = 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}
- }]
- }
- }
- })
- },
- }
- }
- </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>
|