vshare.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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>{{datainfo.reason}}</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" v-if="checkflag">
  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. </view>
  41. <!-- <view class="adrbox mb16">
  42. <view class="tit mb10">分享人</view>
  43. <view class="txt">{{datainfo.houseAddress||"分享人"}}</view>
  44. </view> -->
  45. <view class="adrbox mb16">
  46. <view class="tit mb10">房屋地址</view>
  47. <view class="txt">{{datainfo.detailAddress}}{{datainfo.houseAddress}}</view>
  48. </view>
  49. </view>
  50. </view>
  51. <loading></loading>
  52. </view>
  53. </template>
  54. <script>
  55. import config from '@/config'
  56. const baseUrl = config.baseUrl
  57. import {geocodeAddress} from '@/utils/common.js'
  58. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  59. import {reservDet} from "@/api/work/people.js"
  60. var key='';
  61. // #ifdef H5
  62. key='8de52b560193f01932ad997dba3e76c0'
  63. // #endif
  64. // #ifdef APP-PLUS
  65. key='8de52b560193f01932ad997dba3e76c0'
  66. // #endif
  67. // #ifdef MP-WEIXIN
  68. key='8de52b560193f01932ad997dba3e76c0'
  69. // #endif
  70. export default{
  71. components:{},
  72. data(){
  73. return{
  74. check: require('@/mine/static/check.png'),
  75. ncheck: require('@/mine/static/ncheck.png'),
  76. mapimg: require("@/work/static/visitor/adr.png"),
  77. nvaHeight:44,
  78. checkflag:false,
  79. backgroundColor: "transparent",
  80. baseUrl:config.baseUrl,
  81. mapContext:'',
  82. center:{
  83. lng:'',
  84. lat:'',
  85. },
  86. covers:[],
  87. // covers: [{
  88. // id:0,
  89. // latitude: '31.839676',
  90. // longitude: '117.211954',
  91. // width:18, //宽
  92. // height:19, //高
  93. // iconPath: require("@/work/static/visitor/adr.png"),
  94. // anchor:{x: 0.5, y: 0.5}
  95. // }],
  96. id:'',
  97. datainfo:{},
  98. }
  99. },
  100. onLoad: function(e) {
  101. uni.getSystemInfo({
  102. success: (e) => {
  103. this.nvaHeight = Number(e.statusBarHeight)+44;
  104. }
  105. })
  106. if(e.id){
  107. this.id=e.id;
  108. this.getDetail()
  109. }
  110. this.checkflag=e.cflag;
  111. if(this.checkflag){
  112. this.getcreateMap()
  113. }
  114. console.log(this.checkflag)
  115. },
  116. onReady() {
  117. },
  118. onPageScroll(e) {
  119. var scrollTop = Number(e.scrollTop);
  120. if (scrollTop > 0) {
  121. this.backgroundColor = '#0256FD'
  122. } else {
  123. this.backgroundColor = 'transparent'
  124. }
  125. },
  126. methods:{
  127. checkPermi, checkRole,
  128. getcreateMap(){
  129. //mapId 就是你在 map 标签中定义的 id
  130. this.mapContext = uni.createMapContext('container', this);
  131. },
  132. onClcikImgMap(){
  133. },
  134. getOpenFn(){
  135. },
  136. getBackFn(){
  137. uni.navigateBack({
  138. delta:1
  139. })
  140. },
  141. getPhoneFn(){
  142. uni.makePhoneCall({
  143. phoneNumber: '114' //仅为示例
  144. });
  145. },
  146. async getLocation(address) {
  147. console.log(address,111)
  148. var that=this;
  149. if (!address) {
  150. uni.showToast({ title: '请输入地址', icon: 'none' });
  151. return;
  152. }
  153. try {
  154. const { latitude, longitude } = await geocodeAddress(address, key);
  155. this.center.lat = latitude;
  156. this.center.lng = longitude;
  157. console.log(latitude,longitude)
  158. that.covers = [];
  159. that.covers = [{
  160. id:3,
  161. width:18, //宽
  162. height:19, //高
  163. latitude: latitude,
  164. longitude: longitude,
  165. iconPath: that.mapimg,
  166. anchor:{x: 0.5, y: 0.5}
  167. }]
  168. } catch (error) {
  169. // uni.showToast({ title: '获取经纬度失败', icon: 'none' });
  170. }
  171. },
  172. getDetail(){
  173. reservDet(this.id).then(res=>{
  174. if(res.code==200){
  175. this.datainfo=res.data;
  176. this.chooseValue=res.data.portalId;
  177. console.log(res.data.detailAddress&&this.checkflag)
  178. if(res.data.detailAddress&&this.checkflag){
  179. console.log(11)
  180. // this.getLocation(res.data.detailAddress)
  181. }
  182. }
  183. })
  184. },
  185. }
  186. }
  187. </script>
  188. <style>
  189. page{background: #F3F3F0;}
  190. </style>
  191. <style lang="scss" scoped>
  192. .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;}
  193. .rfbga{background: #2ACA8E !important;}
  194. .navbg{width: 100%;height: 722rpx;z-index: 0;}
  195. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  196. .vdmain{z-index: 2;position: relative;background: #FFFFFF;border-radius: 20rpx;flex: 1;padding: 60rpx 26rpx 98rpx;
  197. .line{width: 168rpx;height: 2rpx;
  198. &.lia{background: linear-gradient(270deg, #0256FD 0%, rgba(2,86,253,0) 100%);}
  199. &.lib{background: linear-gradient(90deg, #0256FD 0%, rgba(2,86,253,0) 100%);}
  200. }
  201. .vdtop{font-weight: bold;font-size: 26rpx;color: #272727;margin: 0 32rpx;}
  202. .vdlist{
  203. .list{font-weight: 500;font-size: 26rpx;color: #272727;margin-bottom: 24rpx;}
  204. }
  205. .adrbox{
  206. .tit{font-weight: bold;font-size: 26rpx;color: #272727;}
  207. .txt{font-weight: 500;font-size: 26rpx;color: #666666;line-height: 36rpx;}
  208. .txts{font-weight: 500;font-size: 22rpx;color: #AAAAAA;}
  209. .checkimg{width: 80rpx;height: 40rpx;margin-left: 8rpx;}
  210. }
  211. }
  212. </style>