vdetail.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <template>
  2. <view class="warrbox flexdc" :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <uni-nav-bar title="访客信息" left-icon="left" @clickLeft="getBackFn" color="#FFFFFF" :background-color="backgroundColor" :border="false" statusBar='true' fixed="true">
  5. </uni-nav-bar>
  6. </view>
  7. <!-- <image :src="mbg" class="navbg"></image> -->
  8. <view class="vdmain flexdc">
  9. <view class="flex1">
  10. <view class="flexcc mb26">
  11. <view class="line lia"></view>
  12. <view class="vdtop">邀请详情</view>
  13. <view class="line lib"></view>
  14. </view>
  15. <view class="vdlist mb26">
  16. <view class="list"><text>访客姓名:</text>{{datainfo.name}}</view>
  17. <view class="list"><text>来访时间:</text>{{datainfo.visitorTime}}</view>
  18. <view class="flexc">
  19. <view class="list mw50"><text>来访人数:</text>{{datainfo.num}}人</view>
  20. <view class="list mw50"><text>来访事由:</text>{{kaType(datainfo.reason,sylist)}}</view>
  21. </view>
  22. <view class="flexc">
  23. <view class="list mw50"><text>车牌号码:</text>{{datainfo.plateNumber||''}}</view>
  24. <view class="list mw50"><text>手机号码:</text>{{datainfo.mobileNumber}}</view>
  25. </view>
  26. </view>
  27. <!-- 地图 -->
  28. <view class="mb22">
  29. <map
  30. id="container"
  31. class="map"
  32. :latitude="center.lat"
  33. :longitude="center.lng"
  34. @poitap="onClcikImgMap"
  35. @tap="onClcikImgMap"
  36. :markers="covers"
  37. scale="18"
  38. style="width: 638rpx;height:280rpx;"
  39. ></map>
  40. <!-- <map
  41. id="container"
  42. class="map"
  43. :latitude="center.lat"
  44. :longitude="center.lng"
  45. @poitap="onClcikImgMap"
  46. @tap="onClcikImgMap"
  47. :markers="covers"
  48. scale="15"
  49. :style="'width: 750rpx;height:' + mapheight + 'px;'"
  50. ></map> -->
  51. </view>
  52. <view class="adrbox mb16">
  53. <view class="tit mb10">房屋地址</view>
  54. <view class="txt">{{datainfo.detailAddress}}{{datainfo.houseAddress}}</view>
  55. </view>
  56. <view class="adrbox">
  57. <view class="flexc mb6">
  58. <view class="tit flex1">共享位置</view>
  59. <view class="flexc" @click="checkflag=!checkflag">
  60. <view class="flex1"></view>
  61. <image :src="check" v-if="checkflag" class="checkimg"></image>
  62. <image :src="ncheck" v-else class="checkimg"></image>
  63. </view>
  64. </view>
  65. <view class="txts">打开即确认将位置共享于被分享者</view>
  66. </view>
  67. </view>
  68. <!-- #ifdef APP-PLUS -->
  69. <view class="rhbtn mt30" @click="getShareFn">分享</view>
  70. <!-- #endif -->
  71. <!-- #ifdef MP-WEIXIN -->
  72. <!-- <button open-type="share" class="rhbtn mt30">分享</button> -->
  73. <!-- #endif -->
  74. <!-- <button class="rhbtn mt30" @click="getShareFn">分享</button> -->
  75. <!-- <view class="rhbtn mt30" @click="getShareFn">分享</view> -->
  76. <!-- <view class="rhbtn mt30" @click="getPutFn">修改</view> -->
  77. </view>
  78. <loading></loading>
  79. </view>
  80. </template>
  81. <script>
  82. import config from '@/config'
  83. const baseUrl = config.baseUrl
  84. // import {geocodeAddress} from '@/utils/common.js'
  85. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  86. import {reservDet} from "@/api/work/people.js"
  87. import {getDictionaryFn} from "@/api/system/user.js"
  88. import {selectDictValue} from "@/utils/common.js"
  89. // var key='';
  90. // // #ifdef H5
  91. // key='8de52b560193f01932ad997dba3e76c0'
  92. // // #endif
  93. // // #ifdef APP-PLUS
  94. // key='8de52b560193f01932ad997dba3e76c0'
  95. // // #endif
  96. // // #ifdef MP-WEIXIN
  97. // key='8de52b560193f01932ad997dba3e76c0'
  98. // // #endif
  99. export default{
  100. components:{},
  101. data(){
  102. return{
  103. check: require('@/mine/static/check.png'),
  104. ncheck: require('@/mine/static/ncheck.png'),
  105. mapimg: require("@/work/static/visitor/adr.png"),
  106. nvaHeight:44,
  107. checkflag:false,
  108. backgroundColor: "transparent",
  109. baseUrl:config.baseUrl,
  110. shareurl:config.shareurl,
  111. mapContext:'',
  112. center:{
  113. lng:'',
  114. lat:'',
  115. },
  116. covers:[],
  117. sylist:[],
  118. // covers: [{
  119. // id:0,
  120. // latitude: '31.839676',
  121. // longitude: '117.211954',
  122. // width:18, //宽
  123. // height:19, //高
  124. // iconPath: require("@/work/static/visitor/adr.png"),
  125. // anchor:{x: 0.5, y: 0.5}
  126. // }],
  127. id:'',
  128. datainfo:{}
  129. }
  130. },
  131. onLoad: function(e) {
  132. uni.getSystemInfo({
  133. success: (e) => {
  134. this.nvaHeight = Number(e.statusBarHeight)+44;
  135. }
  136. })
  137. this.init()
  138. if(e.id){
  139. this.id=e.id;
  140. this.getDetail()
  141. }
  142. },
  143. onReady() {
  144. this.getcreateMap()
  145. },
  146. onPageScroll(e) {
  147. var scrollTop = Number(e.scrollTop);
  148. if (scrollTop > 0) {
  149. this.backgroundColor = '#0256FD'
  150. } else {
  151. this.backgroundColor = 'transparent'
  152. }
  153. },
  154. onShareAppMessage(res) {
  155. // this.comflag=false;
  156. // if (res.from === 'button') {// 来自页面内分享按钮
  157. // var data=res.target.dataset;
  158. // var newobj={
  159. // title: "邀请你来我家",
  160. // path: 'http://192.168.101.147:9091'
  161. // }
  162. // // if(data.img){
  163. // // newobj.imageUrl=this.baseUrl+data.img
  164. // // }
  165. // return newobj
  166. // }else{
  167. // return {
  168. // title: '智能校管家',
  169. // path: '/pages/trends/index'
  170. // }
  171. // }
  172. },
  173. methods:{
  174. checkPermi, checkRole,
  175. kaType(data, list) {
  176. return selectDictValue(list, data);
  177. },
  178. init(){
  179. // 获取事由
  180. getDictionaryFn('visit_reason').then(res=>{
  181. if(res.code==200){
  182. this.sylist = res.data.map(v => {
  183. return {
  184. dictLabel: v.dictLabel,
  185. dictValue: v.dictValue
  186. }
  187. })
  188. }
  189. })
  190. },
  191. getcreateMap(){
  192. //mapId 就是你在 map 标签中定义的 id
  193. this.mapContext = uni.createMapContext('container', this);
  194. },
  195. onClcikImgMap(){
  196. },
  197. getShareFn(){
  198. // /profile/upload/2025/06/11/applogo_20250611033931A020.png
  199. //用户端/profile/upload/2025/06/11/applogo_20250611034002A021.png
  200. var cflag=0;
  201. if(this.checkflag){
  202. cflag=1
  203. }
  204. uni.share({
  205. provider: "weixin",
  206. scene: "WXSceneSession",
  207. type: 0,
  208. href: this.shareurl+'/work/pages/visitor/vshare?id='+this.id+'&cflag='+cflag,
  209. title: "邀请你来我家",
  210. summary: "邀请信息",
  211. imageUrl: "https://zxyzhsq.qs163.cn/prod-api/profile/upload/2025/06/11/applogo_20250611034002A021.png",
  212. success: function (res) {
  213. console.log("success:" + JSON.stringify(res));
  214. },
  215. fail: function (err) {
  216. console.log("fail:" + JSON.stringify(err));
  217. }
  218. });
  219. },
  220. getPutFn(){
  221. this.$tab.navigateTo("/work/pages/visitor/vadd?id="+this.id)
  222. },
  223. getOpenFn(){
  224. },
  225. getBackFn(){
  226. uni.navigateBack({
  227. delta:1
  228. })
  229. },
  230. getPhoneFn(){
  231. uni.makePhoneCall({
  232. phoneNumber: '114' //仅为示例
  233. });
  234. },
  235. async getLocation(address) {
  236. console.log(address,111)
  237. var that=this;
  238. if (!address) {
  239. uni.showToast({ title: '请输入地址', icon: 'none' });
  240. return;
  241. }
  242. try {
  243. const { latitude, longitude } = await geocodeAddress(address, key);
  244. this.center.lat = latitude;
  245. this.center.lng = longitude;
  246. console.log(latitude,longitude)
  247. that.covers = [];
  248. that.covers = [{
  249. id:3,
  250. width:18, //宽
  251. height:19, //高
  252. latitude: latitude,
  253. longitude: longitude,
  254. iconPath: that.mapimg,
  255. anchor:{x: 0.5, y: 0.5}
  256. }]
  257. } catch (error) {
  258. // uni.showToast({ title: '获取经纬度失败', icon: 'none' });
  259. }
  260. },
  261. getDetail(){
  262. var that=this;
  263. reservDet(this.id).then(res=>{
  264. if(res.code==200){
  265. this.datainfo=res.data;
  266. this.chooseValue=res.data.houseId;
  267. if(res.data.detailAddress){
  268. // this.getLocation(res.data.detailAddress)
  269. var latitude=res.data.lat
  270. var longitude=res.data.lgt
  271. this.center.lat = latitude;
  272. this.center.lng = longitude;
  273. that.covers = [];
  274. that.covers = [{
  275. id:3,
  276. width:18, //宽
  277. height:19, //高
  278. latitude: latitude,
  279. longitude: longitude,
  280. iconPath: that.mapimg,
  281. anchor:{x: 0.5, y: 0.5}
  282. }]
  283. }
  284. }
  285. })
  286. },
  287. }
  288. }
  289. </script>
  290. <style>
  291. page{background: #F3F3F0;}
  292. </style>
  293. <style lang="scss" scoped>
  294. .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;}
  295. .rfbga{background: #2ACA8E !important;}
  296. .navbg{width: 100%;height: 722rpx;z-index: 0;}
  297. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  298. .vdmain{z-index: 2;position: relative;background: #FFFFFF;border-radius: 20rpx;flex: 1;padding: 60rpx 26rpx 98rpx;
  299. .line{width: 168rpx;height: 2rpx;
  300. &.lia{background: linear-gradient(270deg, #0256FD 0%, rgba(2,86,253,0) 100%);}
  301. &.lib{background: linear-gradient(90deg, #0256FD 0%, rgba(2,86,253,0) 100%);}
  302. }
  303. .vdtop{font-weight: bold;font-size: 26rpx;color: #272727;margin: 0 32rpx;}
  304. .vdlist{
  305. .list{font-weight: 500;font-size: 26rpx;color: #272727;margin-bottom: 24rpx;}
  306. }
  307. .adrbox{
  308. .tit{font-weight: bold;font-size: 26rpx;color: #272727;}
  309. .txt{font-weight: 500;font-size: 26rpx;color: #666666;line-height: 36rpx;}
  310. .txts{font-weight: 500;font-size: 22rpx;color: #AAAAAA;}
  311. .checkimg{width: 80rpx;height: 40rpx;margin-left: 8rpx;}
  312. }
  313. }
  314. </style>