zouling 3 ヶ月 前
コミット
2acef98dfe

+ 1 - 1
user_ui/1.txt

@@ -7,6 +7,6 @@
 MD5: 43:45:A4:46:EE:C4:B9:9A:BF:D0:B2:B2:9E:EE:79:02
 SHA1: BC:CC:2F:16:32:84:D8:EE:F7:2A:8C:26:F2:11:8E:FA:EE:16:9B:16
 
-高德key:
+高德key:f55857365884963baed205a0974d6e96
 
 极光appkey:

+ 1 - 1
user_ui/App.vue

@@ -12,7 +12,7 @@ import {updateUserProfile,findVersion} from "@/api/system/user.js"
 	},
     onLaunch: function() {
 		// #ifdef APP
-		this.onlineWgt(); //版本更新
+		// this.onlineWgt(); //版本更新
 		// #endif
 		this.initApp()
     },

+ 20 - 5
user_ui/manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "若依移动端",
+    "name" : "智慧社区用户端",
     "appid" : "__UNI__E57E235",
     "description" : "",
     "versionName" : "1.1.0",
@@ -14,7 +14,9 @@
             "autoclose" : true,
             "delay" : 0
         },
-        "modules" : {},
+        "modules" : {
+            "Maps" : {}
+        },
         "distribute" : {
             "android" : {
                 "permissions" : [
@@ -39,7 +41,20 @@
                 "dSYMs" : false
             },
             "sdkConfigs" : {
-                "ad" : {}
+                "ad" : {},
+                "share" : {},
+                "maps" : {
+                    "amap" : {
+                        "appkey_ios" : "f55857365884963baed205a0974d6e96",
+                        "appkey_android" : "f55857365884963baed205a0974d6e96"
+                    }
+                }
+            },
+            "icons" : {
+                "android" : {
+                    "hdpi" : "static/applogo.png",
+                    "xhdpi" : "static/applogo.png"
+                }
             }
         }
     },
@@ -72,8 +87,8 @@
         "sdkConfigs" : {
             "maps" : {
                 "amap" : {
-                    "key" : "8de52b560193f01932ad997dba3e76c0",
-                    "securityJsCode" : "8de52b560193f01932ad997dba3e76c0",
+                    "key" : "fba818d626f91cf5a13cd61943a7667e",
+                    "securityJsCode" : "fba818d626f91cf5a13cd61943a7667e",
                     "serviceHost" : ""
                 }
             }

+ 6 - 6
user_ui/mine/components/box/list.vue

@@ -176,12 +176,12 @@
 						<view class="flexc mb6">
 							<view class="name flex1 over">{{ite.nickName}}</view>
 							<view class="tit flex0 ml10">
-								<block v-if="ite.targetType==1">评论</block>
-								<block v-if="ite.targetType==2">点赞</block>
-								<block v-if="ite.targetType==3">收藏</block>
-								<block v-if="ite.targetType==4">回复</block>
-								<block v-if="ite.targetType==5 ">点赞</block>
-								了你的文章</view>
+								<block v-if="ite.targetType==1">评论了你的文章</block>
+								<block v-if="ite.targetType==2">点赞了你的文章</block>
+								<block v-if="ite.targetType==3">收藏了你的文章</block>
+								<block v-if="ite.targetType==4">回复了你的评论</block>
+								<block v-if="ite.targetType==5">点赞了你的评论</block>
+								</view>
 							<view class="time flex0 ml10">{{ite.createTime}}</view>
 						</view>
 						<view class="flexc overh mb4">

+ 0 - 31
user_ui/mine/pages/house/addhouse.vue

@@ -192,16 +192,6 @@
 	import {uploadIdentify,selectValueKey,geocodeAddress} from '@/utils/common.js'
 	import {getDictionaryFn} from "@/api/system/user.js"
 	import {houseInfoAdd,houseInfoPut,houseInfoDet} from "@/api/work/work.js"
-	var key='';
-	// #ifdef H5
-	key='8de52b560193f01932ad997dba3e76c0'
-	// #endif
-	// #ifdef APP-PLUS
-	key='ccbe52b1ec5f66295fa4609c90a819b7'
-	// #endif
-	// #ifdef MP-WEIXIN
-	key='ccbe52b1ec5f66295fa4609c90a819b7'
-	// #endif
 	export default{
 		components:{},
 		data(){
@@ -346,20 +336,6 @@
 					}
 				})
 			},
-			async getLocation(address) {
-			      if (!address) {
-			        uni.showToast({ title: '请输入地址', icon: 'none' });
-			        return;
-			      }
-			
-			      try {
-			        const { latitude, longitude } = await geocodeAddress(address, key);
-			        this.latitude = latitude;
-			        this.longitude = longitude;
-			      } catch (error) {
-			        uni.showToast({ title: '获取经纬度失败', icon: 'none' });
-			      }
-			},
 			getSubmit(){
 				this.$refs.form.validate().then(res => {
 					var params=JSON.parse(JSON.stringify(this.datainfo))
@@ -374,13 +350,6 @@
 					// if(!params.visitorTime){
 					// 	this.$toast("请选择来访时间")
 					// 	return
-					// }
-					// if(params.location){
-					// 	var pobj=this.getLocation(params.location)
-					// 	console.log(pobj)
-					// 	params.lgt=longitude;
-					// 	params.lat=latitude;
-
 					// }
 					if(this.ptype=='add'){
 						houseInfoAdd(params).then(res=>{

+ 27 - 1
user_ui/mine/pages/house/index.vue

@@ -128,6 +128,13 @@
 			})
 			this.getDataFn()
 		},
+		// 上拉触底加载更多触发事件
+		onReachBottom() {
+			if (this.reachflag) {
+				this.pageNum++
+				this.getDataFn()
+			}
+		},
 		onPageScroll(e) {
 			var scrollTop = Number(e.scrollTop);
 			if (scrollTop > 0) {
@@ -179,14 +186,33 @@
 			getDataFn(){
 				var params={
 					userId:this.userId,
+					pageSize:this.pageSize,
+					pageNum: this.pageNum,
 				}
 				houseInfoList(params).then(res=>{
 					if(res.code==200){
+						if (res.rows.length < this.pageSize) {
+							this.reachflag = false
+							this.wtdt = '到底了~';
+						} else {
+							var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum -	1)
+							if (num < res.total) {
+								this.reachflag = true
+								this.wtdt = ''
+							} else {
+								this.reachflag = false
+								this.wtdt = '到底了~';
+							}
+						}
 						var newArr=JSON.parse(JSON.stringify(res.rows))
 						newArr.forEach(ite=>{
 							ite.right=0;
 						})
-						this.list = JSON.parse(JSON.stringify(newArr));
+						if (this.pageNum == 1) {
+							this.list = newArr;
+						} else {
+							this.list = this.list.concat(newArr)
+						}
 					}else{
 						this.$toast(res.msg)
 					}

+ 0 - 8
user_ui/mine/pages/house/list.vue

@@ -1,8 +0,0 @@
-<template>
-</template>
-
-<script>
-</script>
-
-<style>
-</style>

+ 14 - 0
user_ui/pages/index/index.vue

@@ -158,6 +158,7 @@ import boxList from "@/components/box/list.vue"
 import popUp from "@/components/box/popup.vue"
 import {houseInfoList} from "@/api/work/work.js"
 import {gesettingsList} from "@/api/work/index.js"
+import self from '@/utils/location.js';
   export default {
 	components:{footers,notice,boxList,popUp},
 	data(){
@@ -220,6 +221,7 @@ import {gesettingsList} from "@/api/work/index.js"
 		}
 	},
     onLoad: function() {
+		var that=this;
 		uni.getSystemInfo({
 			success: (e) => {
 				this.nvaHeight = Number(e.statusBarHeight)+44;
@@ -228,6 +230,15 @@ import {gesettingsList} from "@/api/work/index.js"
 		// 获取房子
 		this.getDataFn()
 		this.gesettingsList()
+		// #ifndef H5
+		self.getLocation(function(res){
+			if(res==-1){
+				
+			}else{
+				that.city=res.city;
+			}			
+		})
+		// #endif
     },
 	methods:{
 		getDataFn(){
@@ -242,6 +253,9 @@ import {gesettingsList} from "@/api/work/index.js"
 				}
 			})
 			
+		},
+		getBusListFn(){
+			
 		},
 		gesettingsList(){
 			gesettingsList().then(res=>{

+ 1 - 1
user_ui/pages/mine/about/index.vue

@@ -3,7 +3,7 @@
     <view class="header-section text-center">
       <image style="width: 150rpx;height: 150rpx;" src="/static/logo200.png" mode="widthFix">
       </image>
-      <uni-title type="h2" title="若依移动端"></uni-title>
+      <uni-title type="h2" title="智慧社区用户端"></uni-title>
     </view>
 
     <view class="content-section">

+ 2 - 2
user_ui/pages/mine/index.vue

@@ -8,7 +8,7 @@
 		<image :src="bgimg" class="navbg"></image>
 		<view class="mbox">
 			<view class="infobox flexc" @click="handleToInfo">
-				<image  @click.stop="handleToAvatar" :src="avatar?avatar:avatarimg" class="limg" mode="aspectFill"></image>
+				<image  @click.stop="handleToAvatar" :src="avatar?baseUrl+avatar:avatarimg" class="limg" mode="aspectFill"></image>
 				<view class="cbox">
 					<view class="tit flexc">{{name?name:'登录账号'}}
 					
@@ -217,7 +217,7 @@
 		},
 		computed: {
 			avatar() {
-				return this.baseUrl+this.$store.state.user.avatar
+				return this.$store.state.user.avatar
 			},
 			windowHeight() {
 				return uni.getSystemInfoSync().windowHeight - 50

+ 31 - 0
user_ui/plugins/amap-wx.130.js

@@ -0,0 +1,31 @@
+function AMapWX(a){this.key=a.key;this.requestConfig={key:a.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};this.MeRequestConfig={key:a.key,serviceName:"https://restapi.amap.com/rest/me"}}
+AMapWX.prototype.getWxLocation=function(a,b){wx.getLocation({type:"gcj02",success:function(c){c=c.longitude+","+c.latitude;wx.setStorage({key:"userLocation",data:c});b(c)},fail:function(c){wx.getStorage({key:"userLocation",success:function(d){d.data&&b(d.data)}});a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
+AMapWX.prototype.getMEKeywordsSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.city&&(d.city=b.city);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&(d.pageSize=b.pageSize);b.sig&&(d.sig=
+b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/local",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
+AMapWX.prototype.getMEIdSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.id&&(d.id=b.id);b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/id",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&
+0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
+AMapWX.prototype.getMEPolygonSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.polygon&&(d.polygon=b.polygon);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&(d.pageSize=b.pageSize);
+b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/polygon",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
+AMapWX.prototype.getMEaroundSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.center&&(d.center=b.center);b.radius&&(d.radius=b.radius);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&
+(d.pageSize=b.pageSize);b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/around",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
+AMapWX.prototype.getGeo=function(a){var b=this.requestConfig,c=a.options;b={key:this.key,extensions:"all",s:b.s,platform:b.platform,appname:this.key,sdkversion:b.sdkversion,logversion:b.logversion};c.address&&(b.address=c.address);c.city&&(b.city=c.city);c.batch&&(b.batch=c.batch);c.sig&&(b.sig=c.sig);wx.request({url:"https://restapi.amap.com/v3/geocode/geo",data:b,method:"GET",header:{"content-type":"application/json"},success:function(d){(d=d.data)&&d.status&&"1"===d.status?a.success(d):a.fail({errCode:"0",
+errMsg:d})},fail:function(d){a.fail({errCode:"0",errMsg:d.errMsg||""})}})};
+AMapWX.prototype.getRegeo=function(a){function b(d){var e=c.requestConfig;wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:c.key,location:d,extensions:"all",s:e.s,platform:e.platform,appname:c.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(g){if(g.data.status&&"1"==g.data.status){g=g.data.regeocode;var h=g.addressComponent,f=[],k=g.roads[0].name+"\u9644\u8fd1",m=d.split(",")[0],n=d.split(",")[1];if(g.pois&&
+g.pois[0]){k=g.pois[0].name+"\u9644\u8fd1";var l=g.pois[0].location;l&&(m=parseFloat(l.split(",")[0]),n=parseFloat(l.split(",")[1]))}h.provice&&f.push(h.provice);h.city&&f.push(h.city);h.district&&f.push(h.district);h.streetNumber&&h.streetNumber.street&&h.streetNumber.number?(f.push(h.streetNumber.street),f.push(h.streetNumber.number)):f.push(g.roads[0].name);f=f.join("");a.success([{iconPath:a.iconPath,width:a.iconWidth,height:a.iconHeight,name:f,desc:k,longitude:m,latitude:n,id:0,regeocodeData:g}])}else a.fail({errCode:g.data.infocode,
+errMsg:g.data.info})},fail:function(g){a.fail({errCode:"0",errMsg:g.errMsg||""})}})}var c=this;a.location?b(a.location):c.getWxLocation(a,function(d){b(d)})};
+AMapWX.prototype.getWeather=function(a){function b(g){var h="base";a.type&&"forecast"==a.type&&(h="all");wx.request({url:"https://restapi.amap.com/v3/weather/weatherInfo",data:{key:d.key,city:g,extensions:h,s:e.s,platform:e.platform,appname:d.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(f){if(f.data.status&&"1"==f.data.status)if(f.data.lives){if((f=f.data.lives)&&0<f.length){f=f[0];var k={city:{text:"\u57ce\u5e02",data:f.city},
+weather:{text:"\u5929\u6c14",data:f.weather},temperature:{text:"\u6e29\u5ea6",data:f.temperature},winddirection:{text:"\u98ce\u5411",data:f.winddirection+"\u98ce"},windpower:{text:"\u98ce\u529b",data:f.windpower+"\u7ea7"},humidity:{text:"\u6e7f\u5ea6",data:f.humidity+"%"}};k.liveData=f;a.success(k)}}else f.data.forecasts&&f.data.forecasts[0]&&a.success({forecast:f.data.forecasts[0]});else a.fail({errCode:f.data.infocode,errMsg:f.data.info})},fail:function(f){a.fail({errCode:"0",errMsg:f.errMsg||""})}})}
+function c(g){wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:d.key,location:g,extensions:"all",s:e.s,platform:e.platform,appname:d.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(h){if(h.data.status&&"1"==h.data.status){h=h.data.regeocode;if(h.addressComponent)var f=h.addressComponent.adcode;else h.aois&&0<h.aois.length&&(f=h.aois[0].adcode);b(f)}else a.fail({errCode:h.data.infocode,errMsg:h.data.info})},
+fail:function(h){a.fail({errCode:"0",errMsg:h.errMsg||""})}})}var d=this,e=d.requestConfig;a.city?b(a.city):d.getWxLocation(a,function(g){c(g)})};
+AMapWX.prototype.getPoiAround=function(a){function b(e){e={key:c.key,location:e,s:d.s,platform:d.platform,appname:c.key,sdkversion:d.sdkversion,logversion:d.logversion};a.querytypes&&(e.types=a.querytypes);a.querykeywords&&(e.keywords=a.querykeywords);wx.request({url:"https://restapi.amap.com/v3/place/around",data:e,method:"GET",header:{"content-type":"application/json"},success:function(g){if(g.data.status&&"1"==g.data.status){if((g=g.data)&&g.pois){for(var h=[],f=0;f<g.pois.length;f++){var k=0==
+f?a.iconPathSelected:a.iconPath;h.push({latitude:parseFloat(g.pois[f].location.split(",")[1]),longitude:parseFloat(g.pois[f].location.split(",")[0]),iconPath:k,width:22,height:32,id:f,name:g.pois[f].name,address:g.pois[f].address})}a.success({markers:h,poisData:g.pois})}}else a.fail({errCode:g.data.infocode,errMsg:g.data.info})},fail:function(g){a.fail({errCode:"0",errMsg:g.errMsg||""})}})}var c=this,d=c.requestConfig;a.location?b(a.location):c.getWxLocation(a,function(e){b(e)})};
+AMapWX.prototype.getStaticmap=function(a){function b(e){c.push("location="+e);a.zoom&&c.push("zoom="+a.zoom);a.size&&c.push("size="+a.size);a.scale&&c.push("scale="+a.scale);a.markers&&c.push("markers="+a.markers);a.labels&&c.push("labels="+a.labels);a.paths&&c.push("paths="+a.paths);a.traffic&&c.push("traffic="+a.traffic);e="https://restapi.amap.com/v3/staticmap?"+c.join("&");a.success({url:e})}var c=[];c.push("key="+this.key);var d=this.requestConfig;c.push("s="+d.s);c.push("platform="+d.platform);
+c.push("appname="+d.appname);c.push("sdkversion="+d.sdkversion);c.push("logversion="+d.logversion);a.location?b(a.location):this.getWxLocation(a,function(e){b(e)})};
+AMapWX.prototype.getInputtips=function(a){var b=Object.assign({},this.requestConfig);a.location&&(b.location=a.location);a.keywords&&(b.keywords=a.keywords);a.type&&(b.type=a.type);a.city&&(b.city=a.city);a.citylimit&&(b.citylimit=a.citylimit);wx.request({url:"https://restapi.amap.com/v3/assistant/inputtips",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.tips&&a.success({tips:c.data.tips})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||
+""})}})};
+AMapWX.prototype.getDrivingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);a.strategy&&(b.strategy=a.strategy);a.waypoints&&(b.waypoints=a.waypoints);a.avoidpolygons&&(b.avoidpolygons=a.avoidpolygons);a.avoidroad&&(b.avoidroad=a.avoidroad);wx.request({url:"https://restapi.amap.com/v3/direction/driving",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths,
+taxi_cost:c.data.route.taxi_cost||""})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
+AMapWX.prototype.getWalkingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);wx.request({url:"https://restapi.amap.com/v3/direction/walking",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
+AMapWX.prototype.getTransitRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);a.strategy&&(b.strategy=a.strategy);a.city&&(b.city=a.city);a.cityd&&(b.cityd=a.cityd);wx.request({url:"https://restapi.amap.com/v3/direction/transit/integrated",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&(c=c.data.route,a.success({distance:c.distance||"",taxi_cost:c.taxi_cost||
+"",transits:c.transits}))},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
+AMapWX.prototype.getRidingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);wx.request({url:"https://restapi.amap.com/v3/direction/riding",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};module.exports.AMapWX=AMapWX;

+ 4 - 4
user_ui/static/index.html

@@ -11,11 +11,11 @@
 			document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
 		</script>
 		<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
-		<script src="https://webapi.amap.com/maps?v=1.4.15&key=8de52b560193f01932ad997dba3e76c0&plugin=AMap.Autocomplete,AMap.Geocoder,AMap.getGeo"></script>
+		<script src="https://webapi.amap.com/maps?v=1.4.15&key=fba818d626f91cf5a13cd61943a7667e&plugin=AMap.Autocomplete,AMap.Geocoder"></script>
 		<script type="text/javascript">
-		        // window._AMapSecurityConfig = {
-		        //     securityJsCode:'b06df55c66884ce2c9a3f3281c2c5ca9',
-		        // }
+		        window._AMapSecurityConfig = {
+		            securityJsCode:'b06df55c66884ce2c9a3f3281c2c5ca9',
+		        }
 		</script>
 	</head>
 	<body>

+ 2 - 0
user_ui/utils/common.js

@@ -100,9 +100,11 @@ export function geocodeAddress(address, key) {
       uni.request({
         url,
         success: (res) => {
+			console.log(res)
           if (res.data.status === '1' && res.data.geocodes.length > 0) {
             const location = res.data.geocodes[0].location; // 返回格式:经度,纬度
             const [longitude, latitude] = location.split(',');
+			console.log(223)
             resolve({ latitude: parseFloat(latitude), longitude: parseFloat(longitude) });
           } else {
             reject(new Error('未找到地址对应的经纬度'));

+ 16 - 0
user_ui/utils/initmap.js

@@ -0,0 +1,16 @@
+import amap from '@/plugins/amap-wx.130.js';
+// 调用高德SDK
+var key='';
+// #ifdef H5
+key='fba818d626f91cf5a13cd61943a7667e'
+// #endif
+// #ifdef APP-PLUS
+key='ccbe52b1ec5f66295fa4609c90a819b7'
+// #endif
+// #ifdef MP-WEIXIN
+key='ccbe52b1ec5f66295fa4609c90a819b7'
+// #endif
+const myAmapFun =new amap.AMapWX({
+	key:key
+})
+export default myAmapFun

+ 295 - 0
user_ui/utils/location.js

@@ -0,0 +1,295 @@
+import myAmapFun from "@/utils/initmap.js"
+import {showConfirm} from '@/utils/common'
+
+var __CFG = null;
+//系统参数
+__CFG = __CFG || {
+	'lat': '',
+	'lng': '',
+	'address': '',
+	'city':'',
+	"UxLocation": {
+		"lng": "",
+		"lat": "",
+		"address": "",
+		'city':'',
+	},
+};
+function setUxLocation(UxLocation){
+    UxLocation = UxLocation || {};
+	__CFG.lng = UxLocation.lng || '';
+	__CFG.lat = UxLocation.lat || '';
+	__CFG.address = UxLocation.address || UxLocation.addr || '';
+	__CFG.city = UxLocation.city || UxLocation.city || '';
+	__CFG.UxLocation = UxLocation;
+}
+//设置浏览器cookie
+function set_cookie(key, value, expire, path){
+	var keys = __CFG.C_PREFIX + key;
+	path = path || '/';
+	var a = keys + "=" + value;
+	if(typeof(expire) != 'undefined'){
+		var date = new Date();
+		expire = parseInt(expire,10);
+		date.setTime(date.getTime() + expire*1000);
+		a += "; expires="+date.toGMTString();
+	}
+	a += ";path="+path;
+	if(__CFG.C_DOMAIN){
+		a += ";domain="+__CFG.C_DOMAIN;
+	}
+	document.cookie = a;
+};
+
+//删除浏览器cookie
+function remove_cookie(key){
+	if (!key) {
+		return false;
+	} else {
+		var keys = __CFG.C_PREFIX + key;
+		document.cookie = keys+"=;expires="+(new Date(0)).toGMTString();
+	}
+};
+
+//获取浏览器cookie
+function get_cookie(key) {
+	if (!key) {
+		return false;
+	} else {
+		var keys = __CFG.C_PREFIX + key;
+		var reg = new RegExp("(^| )" + keys + "=([^;]*)(;|\x24)");
+		var result = reg.exec(document.cookie);
+		if (result) {
+			return result[2] || '';
+		}
+		return '';
+	}
+};
+
+function getLocation(callback) {
+	
+	callback = typeof(callback) == 'function' ? callback : function(res) {};
+		var num=1;
+		// #ifdef MP-WEIXIN
+		uni.getSetting({
+			success(res) {
+				if(res.authSetting['scope.userLocation'] != undefined){
+					if (res.authSetting['scope.userLocation']) {
+						getLocationaddr(callback)
+						// 已经授权,可以直接调用 getLocation 获取地理位置
+					} else {
+						showConfirm('您还未开启定位,是否去开启定位?').then(cres => {
+						  if (cres.confirm) {
+						    uni.openSetting({
+						    	success(res2) {
+						    		if (res2.authSetting['scope.userLocation']) {
+						    			
+						    		}
+						    	}
+						    });
+							callback(-1)
+						  }
+						})
+					};
+				}else{
+					var uxlocation = {"lng": "", "lat": "", "address": ""};
+					// var citynum=1;
+					uni.getLocation({
+						type: 'gcj02',
+						geocode: 'true',
+						success: function(ares) {
+							uxlocation.lat = ares.latitude;
+							uxlocation.lng = res.longitude;
+							myAmapFun.getRegeo({
+								success: function(data) {
+									// citynum=0;
+									uxlocation.address = data[0].name+data[0].desc||data[0].regeocodeData.formatted_address;
+									uxlocation.city = data[0].regeocodeData.addressComponent.city;
+									setUxLocation(uxlocation);
+									// uni.hideLoading();
+									// console.log(uxlocation,23)
+									callback(uxlocation);
+									//成功回调
+								},
+								fail: function(info) {
+									//失败回调
+								}
+							})
+							// if(citynum==1){
+							// 	setUxLocation(uxlocation);
+							// 	callback(uxlocation);
+							// }
+						},
+						
+						fail: function(error) {
+							uni.showToast({
+								icon: 'none',
+								title: '定位失败'
+							})
+					
+							// #ifdef APP-PLUS
+							// #endif
+					
+						},
+						complete: function(rs) {
+							// console.log('complete:'+JSON.stringify(rs))
+						}
+					})
+				}
+			},
+			fail(err) {
+				console.log(err)
+			},
+		})
+		// #endif
+		// #ifdef APP-PLUS
+		let system = uni.getSystemInfoSync();
+			if(system.platform === "android"){
+				var context = plus.android.importClass("android.content.Context");
+				var locationManger = plus.android.importClass("android.location.LocationManager");
+				var main = plus.android.runtimeMainActivity();
+				var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
+				if(!mainSvr.isProviderEnabled(locationManger.GPS_PROVIDER)){
+					uni.showModal({
+						title:"提示",
+						content:"请授权位置获取地址",
+						showCancel:false,
+							success() {
+								if(!mainSvr.isProviderEnabled(locationManger.GPS_PROVIDER)){
+									var Intent = plus.android.importClass("android.content.Intent");
+									var Settings = plus.android.importClass("android.provider.Settings");
+									var intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
+									main.startActivity(intent);
+								}else{
+									console.log("定位已开启")
+									_self.setSite()
+								}
+							}
+						})
+				}else{
+					plus.android.requestPermissions(
+						['android.permission.ACCESS_FINE_LOCATION'], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
+						function(resultObj) {
+							var result = 0;
+							for (var i = 0; i < resultObj.granted.length; i++) {
+								var grantedPermission = resultObj.granted[i];
+								console.log('已获取的权限:' + grantedPermission);
+								result = 1
+							}
+							for (var i = 0; i < resultObj.deniedPresent.length; i++) {
+								var deniedPresentPermission = resultObj.deniedPresent[i];
+								console.log('拒绝本次申请的权限:' + deniedPresentPermission);
+								result = 0
+							}
+							for (var i = 0; i < resultObj.deniedAlways.length; i++) {
+								var deniedAlwaysPermission = resultObj.deniedAlways[i];
+								console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
+								result = -1
+							}
+							// resolve(result);
+							// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
+							if (result != 1) {
+								showConfirm('您还未开启定位,是否去开启定位?').then(res => {
+								  if (res.confirm) {
+								    gotoAppPermissionSetting()
+									callback(result)
+								  }
+								})
+							}else{
+								getLocationaddr(callback)
+							}
+						},
+						function(error) {
+							console.log('申请权限错误:' + error.code + " = " + error.message);
+							// resolve({
+							// 	code: error.code,
+							// 	message: error.message
+							// });
+						}
+					);
+				}
+			}
+			
+		// #endif
+};
+// 跳转到**应用**的权限页面
+function gotoAppPermissionSetting() {
+	var isIos
+	// #ifdef APP-PLUS
+	isIos = (plus.os.name == "iOS")
+	// #endif
+	if (isIos) {
+		var UIApplication = plus.ios.import("UIApplication");
+		var application2 = UIApplication.sharedApplication();
+		var NSURL2 = plus.ios.import("NSURL");
+		// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");		
+		var setting2 = NSURL2.URLWithString("app-settings:");
+		application2.openURL(setting2);
+
+		plus.ios.deleteObject(setting2);
+		plus.ios.deleteObject(NSURL2);
+		plus.ios.deleteObject(application2);
+	} else {
+		var Intent = plus.android.importClass("android.content.Intent");
+		var Settings = plus.android.importClass("android.provider.Settings");
+		var Uri = plus.android.importClass("android.net.Uri");
+		var mainActivity = plus.android.runtimeMainActivity();
+		var intent = new Intent();
+		intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
+		var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
+		intent.setData(uri);
+		mainActivity.startActivity(intent);
+	}
+}
+function getLocationaddr(callback){
+	callback = typeof(callback) == 'function' ? callback : function(res) {};
+	var uxlocation = {"lng": "", "lat": "", "address": ""};
+	uni.getLocation({
+		type: 'gcj02',
+		geocode: 'true',
+		success: function(res) {
+			uxlocation.lat = res.latitude;
+			uxlocation.lng = res.longitude;
+			myAmapFun.getRegeo({
+				success: function(data) {
+					uxlocation.address = data[0].name+data[0].desc||data[0].regeocodeData.formatted_address;
+					uxlocation.city = data[0].regeocodeData.addressComponent.city;
+					setUxLocation(uxlocation);
+					// uni.hideLoading();
+					// console.log(uxlocation,23)
+					callback(uxlocation);
+					//成功回调
+				},
+				fail: function(info) {
+					//失败回调
+					console.log(info,223)
+				}
+			})
+			// if(citynum==1){
+			// 	setUxLocation(uxlocation);
+			// 	callback(uxlocation);
+			// }
+		},
+		
+		fail: function(error) {
+			uni.showToast({
+				icon: 'none',
+				title: '定位失败'
+			})
+	
+			// #ifdef APP-PLUS
+			// #endif
+	
+		},
+		complete: function(rs) {
+			// console.log('complete:'+JSON.stringify(rs))
+		}
+	})
+}
+
+const self = {
+	getLocation,
+	setUxLocation,
+	__CFG
+}
+export default self

+ 87 - 16
user_ui/work/pages/visitor/vdetail.vue

@@ -34,9 +34,20 @@
 						@poitap="onClcikImgMap"
 						@tap="onClcikImgMap"
 						:markers="covers"
-						scale="17"
-						:style="'width: 638rpx;height:280rpx;'"
+						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>
@@ -55,6 +66,9 @@
 					<view class="txts">打开即确认将位置共享于被分享者</view>
 				</view>
 			</view>
+			<!-- #ifdef APP-PLUS -->
+			<view class="rhbtn mt30" @click="getShareFn">分享</view>
+			<!-- #endif -->
 			<view class="rhbtn mt30" @click="getShareFn">分享</view>
 <!-- 			<view class="rhbtn mt30" @click="getPutFn">修改</view> -->
 		</view>	
@@ -65,31 +79,45 @@
 <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 {reservDet} from "@/api/work/people.js"
+	var key='';
+	// #ifdef H5
+	key='8de52b560193f01932ad997dba3e76c0'
+	// #endif
+	// #ifdef APP-PLUS
+	key='8de52b560193f01932ad997dba3e76c0'
+	// #endif
+	// #ifdef MP-WEIXIN
+	key='ccbe52b1ec5f66295fa4609c90a819b7'
+	// #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:'117.211954',
-					lat:'31.839676',
+					lng:'',
+					lat:'',
 				},
-				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}
-				}],
+				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:{}
 			}
@@ -121,9 +149,24 @@
 			getcreateMap(){
 				//mapId 就是你在 map 标签中定义的 id
 				this.mapContext = uni.createMapContext('container', this);
+			},
+			onClcikImgMap(){
+				
 			},
 			getShareFn(){
-				this.$tab.navigateTo("/work/pages/visitor/vshare")
+				// uni.share({
+				// 	provider: "weixin",
+				// 	scene: "WXSceneSession",
+				// 	type: 1,
+				// 	summary: "我正在使用HBuilderX开发uni-app,赶紧跟我一起来体验!",
+				// 	success: function (res) {
+				// 		console.log("success:" + JSON.stringify(res));
+				// 	},
+				// 	fail: function (err) {
+				// 		console.log("fail:" + JSON.stringify(err));
+				// 	}
+				// });
+				// this.$tab.navigateTo("/work/pages/visitor/vshare")
 			},
 			getPutFn(){
 				this.$tab.navigateTo("/work/pages/visitor/vadd?id="+this.id)
@@ -141,11 +184,39 @@
 					phoneNumber: '114' //仅为示例
 				});
 			},
+			async getLocation(address) {
+				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;
+					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.portalId
+						this.chooseValue=res.data.portalId;
+						if(res.data.detailAddress){
+							this.getLocation(res.data.detailAddress)
+						}
 					}
 				})
 			},

+ 2 - 2
user_ui/work/pages/visitor/vlist.vue

@@ -183,8 +183,8 @@ font-size: 26rpx;
 color: #FFFFFF;}
 		}
 	}
-	.tabtop{padding-bottom: 40rpx;padding-top: 26rpx;
-		.tabt{font-weight: 500;font-size: 32rpx;color: #666666;position: relative;line-height: 56rpx;padding: 0 40rpx;
+	.tabtop{padding-bottom: 40rpx;padding-top: 26rpx;overflow: auto;
+		.tabt{font-weight: 500;font-size: 32rpx;color: #666666;position: relative;line-height: 56rpx;flex: 0 0 auto;text-align: center;margin: 0 10rpx;padding: 0 20rpx;
 			&.act{font-weight: bold;font-size: 32rpx;color: #272727;
 			&::after{content: '';width: 40rpx;height: 10rpx;background: #0156FE;border-radius: 6rpx;position: absolute;left: 50%;margin-left: -20rpx;bottom: -10rpx;}
 			}