wangchao 3 jaren geleden
bovenliggende
commit
e9c2cfd4f1

+ 81 - 51
components/linzq-citySelect/linzq-citySelect.vue

@@ -1,41 +1,41 @@
 <template>
 	<div class="wrapper" :style="'top:'+statusBarHeight+'px'">
 		<div class="header">
-			<view class="back_div">
+<!-- 			<view class="back_div">
 				<image class="back_img" @click="back_city()" src="../../static/img/login/logo@2x.png" mode=""></image>
-			</view>
-			<input class="input" @input="onInput" placeholder="中文/拼音/首字母" v-model="searchValue" />
+			</view> -->
+			<input class="input" @input="onInput" placeholder="请输入城市中文/拼音/首字母" v-model="searchValue" />
 		</div>
 		<scroll-view class="calendar-list" scroll-y="true" :scroll-into-view="scrollIntoId">
 			<view v-if="disdingwei" id="hot">
 				<!-- 定位模块 -->
 				<view class="dingwei">
 					<view class="dingwei_Tips">
-						当前定位
+						当前城市
 					</view>
-					<view class="dingwei_city">
-						<view class="dingwei_city_one">
+					<view class="dingwei_citytop">
+						<view class="" style="margin-bottom: 0;">
 							{{position}}
 						</view>
 						<view class="dingweis_div" @click="getWarpweft">
-							<image class="dingweis" src="../../static/img/login/logo@2x.png" mode=""></image>
 							<text>{{po_tips}}</text>
 						</view>
 					</view>
 				</view>
 
-				<!-- 最近模块 -->
-				<view class="dingwei" v-if="Visit.length>=0">
-					<view class="dingwei_Tips">
-						最近访问
-					</view>
-					<view class="dingwei_city dingwei_city_zuijin">
-						<view class="dingwei_city_one toright" v-for="(item,index) in Visit" v-if="index<2" @click="back_city(item)">
-							{{item.cityName}}
-						</view> 
-					</view>
-				</view>
+		
 
+			</view>
+			<!-- 最近模块 -->
+			<view class="dingwei vist-list" v-if="Visit.length>=0">
+				<view class="dingwei_Tips">
+					访问记录
+				</view>
+				<view class="dingwei_city dingwei_city_zuijin">
+					<view class="dingwei_city_one toright" v-for="(item,index) in Visit" @click="back_city(item)">
+						{{item.cityName}}
+					</view> 
+				</view>
 			</view>
 
 
@@ -54,7 +54,7 @@
 
 		<!-- 右侧字母 -->
 		<view class="letters" v-if="searchValue == ''">
-			<view class="letters-item" @click="scrollTo('hot')">最近</view>
+			<!-- <view class="letters-item" @click="scrollTo('hot')">最近</view> -->
 			<view class="letters-item" v-for="item in letter" :key="item" @click="scrollTo(item)">{{ item }}</view>
 		</view>
 
@@ -83,7 +83,8 @@
 
 		data() {
 			return {
-				statusBarHeight: this.statusBarHeight,
+				// statusBarHeight: this.statusBarHeight,
+				statusBarHeight: 45,
 				ImgUrl: this.ImgUrl,
 				letter: [],
 				selectLetter: '',
@@ -95,7 +96,7 @@
 				showMask: false,
 				disdingwei: true,
 				Visit: [], //最近访问
-				position: '青岛',
+				position: '营口',
 				longitude: '', //经度
 				latitude: '', //纬度
 				seconds: 3,
@@ -190,7 +191,7 @@
 				}
 			},
 
-			back_city(item) {
+			back_city(item) {debugger
 				if (item) {
 					this.$emit('back_city', item);
 					//unshift 把数据插入到首位,与push相反
@@ -209,6 +210,7 @@
 						return newArr
 					}
 					this.Visit = distinct(arr)
+					debugger
 					console.log(this.Visit, "---最近访问")
 					uni.setStorage({
 						key: 'Visit_key',
@@ -225,12 +227,13 @@
 				let countdown = setInterval(() => {
 					that.seconds--;
 					uni.getLocation({
-						type: 'wgs84',
+						type: 'gcj02',
 						success: function(res) {
 							console.log('当前位置的经度:' + res.longitude);
 							console.log('当前位置的纬度:' + res.latitude);
 							that.longitude = res.longitude
 							that.latitude = res.latitude
+							that.position = res.address.city
 						}
 					});
 					if (that.seconds <= 0) {
@@ -248,7 +251,7 @@
 	.wrapper {
 		position: fixed;
 		z-index: 999999;
-		background: #ffffff;
+		/* background: #ffffff; */
 		height: 100%;
 		width: 100%;
 		top: 0px;
@@ -273,7 +276,7 @@
 		width: 120upx;
 		border-radius: 60upx;
 		display: flex;
-		background: rgba(0, 0, 0, 0.5);
+		background:#22C572;
 		justify-content: center;
 		align-items: center;
 		font-size: 40upx;
@@ -283,14 +286,15 @@
 	.content {
 		height: 100%;
 		width: 100%;
-		background-color: #ffffff;
+		/* background-color: #ffffff; */
 	}
 
 	.header {
 		height: 85upx;
 		display: flex;
-		justify-content: flex-start;
+		justify-content: center;
 		align-items: center;
+		background: white;
 	}
 
 
@@ -309,7 +313,7 @@
 
 	.input {
 		font-size: 28upx;
-		width: 620upx;
+		width: 90%;
 		height: 55upx;
 		border-radius: 40upx;
 		background-color: #F5F5F5;
@@ -346,7 +350,7 @@
 		top: 83upx;
 		bottom: 0upx;
 		width: 100%;
-		background-color: #FFFFFF;
+		/* background-color: #FFFFFF; */
 	}
 
 	.letters {
@@ -355,7 +359,7 @@
 		bottom: 0px;
 		width: 50upx;
 		top: 260upx;
-		color: #2f9bfe;
+		color: #333333;
 		text-align: center;
 		font-size: 24upx;
 	}
@@ -398,7 +402,9 @@
 		width: 100%;
 		padding-top: 25upx;
 		box-sizing: border-box;
-		margin-bottom: 26upx;
+		/* margin-bottom: 26upx; */
+		background: reds;
+		padding-bottom: 20rpx;
 	}
 
 	.dingwei_Tips {
@@ -410,32 +416,38 @@
 
 	.dingwei_city {
 		width: 100%;
-		height: 60upx;
-		padding-left: 55upx;
-		padding-right: 70upx;
-		box-sizing: border-box;
+		/* height: 60upx; */
+/* 		padding-left: 55upx;
+		padding-right: 70upx; */
+/* 		box-sizing: border-box;
 		display: flex;
-		justify-content: space-between;
+		justify-content: space-between; */
+		/* width: 25%; */
+		padding-left: 20rpx;
+		display: inline-block;
 	}
 
 	.dingwei_city_one {
-		width: 185upx;
-		height: 60upx;
-		background-color: #F5F5F5;
-		border-radius: 10upx;
-		font-size: 32upx;
+		
+		display: inline-block;
+		text-align: center;
+		line-height: 60rpx;
+		width: 25%;
+		height: 60rpx;
+        background: #F5F6F9;
+		border-radius: 40rpx;
+		font-size: 24rpx;
 		color: #333333;
-		display: flex;
-		justify-content: center;
-		align-items: center;
+		margin-bottom: 20rpx;
+		
 	}
 
 	.dingweis_div {
-		display: flex;
-		align-content: flex-end;
-		align-items: center;
+		display: inline-block;
 		font-size: 24upx;
-		color: #FD5745;
+		color: #22C572;
+		font-weight: 400;
+		
 	}
 
 	.dingweis {
@@ -444,11 +456,29 @@
 	}
 
 	.dingwei_city_zuijin {
-		display: flex;
-		justify-content: flex-start;
+/* 		display: flex;
+		justify-content: flex-start; */
 	}
 
 	.toright {
-		margin-right: 25upx;
+		margin-right: 30upx;
+	}
+	.dingwei_citytop{
+		/* background: red; */
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 0 30rpx;
+	}
+	#hot{
+		background:white;
+		font-size: 28rpx;
+		padding-bottom: 1rpx;
+		border-radius: 0 0 30rpx 30rpx;
+	}
+	.vist-list{
+		background: white;
+		margin-top: 20rpx;
+		border-radius: 30rpx 30rpx 0 0 ;
 	}
 </style>

+ 134 - 0
components/uni-segmented-control/uni-segmented-control.vue

@@ -0,0 +1,134 @@
+<template>
+	<view class="segmented-control" :class="styleType" :style="wrapStyle">
+		<view v-for="(item, index) in values" class="segmented-control-item" :class="styleType" :key="index" :style="index === currentIndex ? activeStyle : itemStyle" @click="onClick(index)">
+			{{item}}
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: 'uni-segmented-control',
+		props: {
+			current: {
+				type: Number,
+				default: 0
+			},
+			values: {
+				type: Array,
+				default () {
+					return [];
+				}
+			},
+			activeColor: {
+				type: String,
+				default: '#007aff'
+			},
+			styleType: {
+				type: String,
+				default: 'button'
+			}
+		},
+		data() {
+			return {
+				currentIndex: this.current
+			}
+		},
+		watch: {
+			current(val) {
+				if (val !== this.currentIndex) {
+					this.currentIndex = val;
+				}
+			}
+		},
+		computed: {
+			wrapStyle() {
+				let styleString = '';
+				switch (this.styleType) {
+					case 'text':
+						styleString = `border:0;`;
+						break;
+					default:
+						styleString = `border-color: ${this.activeColor}`;
+						break;
+				}
+				return styleString;
+			},
+			itemStyle() {
+				let styleString = '';
+				switch (this.styleType) {
+					case 'text':
+						styleString = `color:#000;border-left:0;`;
+						break;
+					default:
+						styleString = `color:${this.activeColor};border-color:${this.activeColor};`;
+						break;
+				}
+				return styleString;
+			},
+			activeStyle() {
+				let styleString = '';
+				switch (this.styleType) {
+					case 'text':
+						styleString = `color:${this.activeColor};border-left:0;border-bottom-style:solid;`;
+						break;
+					default:
+						styleString = `color:#fff;border-color:${this.activeColor};background-color:${this.activeColor}`;
+						break;
+				}
+				return styleString;
+			}
+		},
+		methods: {
+			onClick(index) {
+				if (this.currentIndex !== index) {
+					this.currentIndex = index;
+					this.$emit('clickItem', index);
+				}
+			}
+		},
+	}
+</script>
+
+<style>
+	.segmented-control {
+		display: flex;
+		flex-direction: row;
+		justify-content: center;
+		width: 75%;
+		font-size: 28upx;
+		border-radius: 10upx;
+		box-sizing: border-box;
+		margin: 0 auto;
+		overflow: hidden;
+	}
+
+	.segmented-control.button {
+		border: 2upx solid;
+	}
+
+	.segmented-control.text {
+		border: 0;
+		border-radius: 0upx;
+	}
+
+
+	.segmented-control-item {
+		flex: 1;
+		text-align: center;
+		line-height: 60upx;
+		box-sizing: border-box;
+	}
+
+	.segmented-control-item.button {
+		border-left: 1upx solid;
+	}
+
+	.segmented-control-item.text {
+		border-left: 0;
+	}
+
+	.segmented-control-item:first-child {
+		border-left-width: 0;
+	}
+</style>

+ 272 - 0
js_sdk/wa-permission/permission.js

@@ -0,0 +1,272 @@
+/**
+ * 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
+ */
+
+var isIos
+// #ifdef APP-PLUS
+isIos = (plus.os.name == "iOS")
+// #endif
+
+// 判断推送权限是否开启
+function judgeIosPermissionPush() {
+	var result = false;
+	var UIApplication = plus.ios.import("UIApplication");
+	var app = UIApplication.sharedApplication();
+	var enabledTypes = 0;
+	if (app.currentUserNotificationSettings) {
+		var settings = app.currentUserNotificationSettings();
+		enabledTypes = settings.plusGetAttribute("types");
+		console.log("enabledTypes1:" + enabledTypes);
+		if (enabledTypes == 0) {
+			console.log("推送权限没有开启");
+		} else {
+			result = true;
+			console.log("已经开启推送功能!")
+		}
+		plus.ios.deleteObject(settings);
+	} else {
+		enabledTypes = app.enabledRemoteNotificationTypes();
+		if (enabledTypes == 0) {
+			console.log("推送权限没有开启!");
+		} else {
+			result = true;
+			console.log("已经开启推送功能!")
+		}
+		console.log("enabledTypes2:" + enabledTypes);
+	}
+	plus.ios.deleteObject(app);
+	plus.ios.deleteObject(UIApplication);
+	return result;
+}
+
+// 判断定位权限是否开启
+function judgeIosPermissionLocation() {
+	var result = false;
+	var cllocationManger = plus.ios.import("CLLocationManager");
+	var status = cllocationManger.authorizationStatus();
+	result = (status != 2)
+	console.log("定位权限开启:" + result);
+	// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
+	/* var enable = cllocationManger.locationServicesEnabled();
+	var status = cllocationManger.authorizationStatus();
+	console.log("enable:" + enable);
+	console.log("status:" + status);
+	if (enable && status != 2) {
+		result = true;
+		console.log("手机定位服务已开启且已授予定位权限");
+	} else {
+		console.log("手机系统的定位没有打开或未给予定位权限");
+	} */
+	plus.ios.deleteObject(cllocationManger);
+	return result;
+}
+
+// 判断麦克风权限是否开启
+function judgeIosPermissionRecord() {
+	var result = false;
+	var avaudiosession = plus.ios.import("AVAudioSession");
+	var avaudio = avaudiosession.sharedInstance();
+	var permissionStatus = avaudio.recordPermission();
+	console.log("permissionStatus:" + permissionStatus);
+	if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
+		console.log("麦克风权限没有开启");
+	} else {
+		result = true;
+		console.log("麦克风权限已经开启");
+	}
+	plus.ios.deleteObject(avaudiosession);
+	return result;
+}
+
+// 判断相机权限是否开启
+function judgeIosPermissionCamera() {
+	var result = false;
+	var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
+	var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
+	console.log("authStatus:" + authStatus);
+	if (authStatus == 3) {
+		result = true;
+		console.log("相机权限已经开启");
+	} else {
+		console.log("相机权限没有开启");
+	}
+	plus.ios.deleteObject(AVCaptureDevice);
+	return result;
+}
+
+// 判断相册权限是否开启
+function judgeIosPermissionPhotoLibrary() {
+	var result = false;
+	var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
+	var authStatus = PHPhotoLibrary.authorizationStatus();
+	console.log("authStatus:" + authStatus);
+	if (authStatus == 3) {
+		result = true;
+		console.log("相册权限已经开启");
+	} else {
+		console.log("相册权限没有开启");
+	}
+	plus.ios.deleteObject(PHPhotoLibrary);
+	return result;
+}
+
+// 判断通讯录权限是否开启
+function judgeIosPermissionContact() {
+	var result = false;
+	var CNContactStore = plus.ios.import("CNContactStore");
+	var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
+	if (cnAuthStatus == 3) {
+		result = true;
+		console.log("通讯录权限已经开启");
+	} else {
+		console.log("通讯录权限没有开启");
+	}
+	plus.ios.deleteObject(CNContactStore);
+	return result;
+}
+
+// 判断日历权限是否开启
+function judgeIosPermissionCalendar() {
+	var result = false;
+	var EKEventStore = plus.ios.import("EKEventStore");
+	var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
+	if (ekAuthStatus == 3) {
+		result = true;
+		console.log("日历权限已经开启");
+	} else {
+		console.log("日历权限没有开启");
+	}
+	plus.ios.deleteObject(EKEventStore);
+	return result;
+}
+
+// 判断备忘录权限是否开启
+function judgeIosPermissionMemo() {
+	var result = false;
+	var EKEventStore = plus.ios.import("EKEventStore");
+	var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
+	if (ekAuthStatus == 3) {
+		result = true;
+		console.log("备忘录权限已经开启");
+	} else {
+		console.log("备忘录权限没有开启");
+	}
+	plus.ios.deleteObject(EKEventStore);
+	return result;
+}
+
+// Android权限查询
+function requestAndroidPermission(permissionID) {
+	return new Promise((resolve, reject) => {
+		plus.android.requestPermissions(
+			[permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
+			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) {
+				// gotoAppPermissionSetting()
+				// }
+			},
+			function(error) {
+				console.log('申请权限错误:' + error.code + " = " + error.message);
+				resolve({
+					code: error.code,
+					message: error.message
+				});
+			}
+		);
+	});
+}
+
+// 使用一个方法,根据参数判断权限
+function judgeIosPermission(permissionID) {
+	if (permissionID == "location") {
+		return judgeIosPermissionLocation()
+	} else if (permissionID == "camera") {
+		return judgeIosPermissionCamera()
+	} else if (permissionID == "photoLibrary") {
+		return judgeIosPermissionPhotoLibrary()
+	} else if (permissionID == "record") {
+		return judgeIosPermissionRecord()
+	} else if (permissionID == "push") {
+		return judgeIosPermissionPush()
+	} else if (permissionID == "contact") {
+		return judgeIosPermissionContact()
+	} else if (permissionID == "calendar") {
+		return judgeIosPermissionCalendar()
+	} else if (permissionID == "memo") {
+		return judgeIosPermissionMemo()
+	}
+	return false;
+}
+
+// 跳转到**应用**的权限页面
+function gotoAppPermissionSetting() {
+	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 {
+		// console.log(plus.device.vendor);
+		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);
+	}
+}
+
+// 检查系统的设备服务是否开启
+// var checkSystemEnableLocation = async function () {
+function checkSystemEnableLocation() {
+	if (isIos) {
+		var result = false;
+		var cllocationManger = plus.ios.import("CLLocationManager");
+		var result = cllocationManger.locationServicesEnabled();
+		console.log("系统定位开启:" + result);
+		plus.ios.deleteObject(cllocationManger);
+		return result;
+	} else {
+		var context = plus.android.importClass("android.content.Context");
+		var locationManager = plus.android.importClass("android.location.LocationManager");
+		var main = plus.android.runtimeMainActivity();
+		var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
+		var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
+		console.log("系统定位开启:" + result);
+		return result
+	}
+}
+
+module.exports = {
+	judgeIosPermission: judgeIosPermission,
+	requestAndroidPermission: requestAndroidPermission,
+	checkSystemEnableLocation: checkSystemEnableLocation,
+	gotoAppPermissionSetting: gotoAppPermissionSetting
+}

+ 19 - 16
pages.json

@@ -529,23 +529,8 @@
             "style" :                                                                                    
             {
                 "navigationBarTitleText": "分布",
-                "enablePullDownRefresh": false,
-				"app-plus": {  
-				                "subNVues":[{  
-				                    "id": "popup", 
-				                    "path": "pages/grain_pulse/distribution/popup",
-				                    "type": "popup",
-				                    "style": {  
-				                        "position": "absolute",  
-				                        "dock": "bottom",  
-				                        "width": "100upx",  
-				                        "height": "150upx",  
-				                        "background": "transparent"  
-				                    }  
-				                }]  
-				            } 
+                "enablePullDownRefresh": false
             }
-            
         }
         ,{
             "path" : "pages/grain_pulse/position/position",
@@ -573,6 +558,24 @@
                 "enablePullDownRefresh": false
             }
             
+        }
+		,{
+		    "path" : "pages/grain_pulse/localtion/coordinate",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "坐标",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
+        ,{
+            "path" : "pages/grain_pulse/distribution/distribution",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
         }
     ],
 	"subpackages": [{

+ 269 - 0
pages/grain_pulse/distribution/distribution.nvue

@@ -0,0 +1,269 @@
+<template>
+	<view class="container">
+		<view class="header">
+			<view class="now-location">
+				<u-icon name="map" size="36" class="icon"></u-icon>
+				<text class="text Medium title">{{address}}</text>
+			</view>
+			<view class="selectType">
+				<text @click="selectType" class="header-type Regular">{{typeStr}}</text>
+				<!-- 				<u-icon :style="{transform:(showType?'rotate(180deg)':'')}" name="arrow-down-fill" size="8"
+					color="#AFB3BF" class="icon"></u-icon> -->
+			</view>
+		</view>
+		<view class="uni-common-mt">
+			<view class="content">
+				<map class="map" @markertap="markertap" :latitude="nowLocation.latitude"
+					:longitude="nowLocation.longitude" :markers="covers" :enable-poi="true">
+				</map>
+			</view>
+		</view>
+		<view class="alert">
+			<view class="select-alert" v-if="showType">
+				<view class="select-top">
+					<text class="cancel" @click="cancel">取消</text>
+					<text class="confirm" @click="confirm">确定</text>
+				</view>
+				<view class="select">
+					<text class="select-item" v-for="(item,index) in typeList" :key="index">
+						{{item.name}}
+					</text>
+				</view>
+			</view>
+		</view>
+
+		<view class="content2">
+			<view class="no-enterprise Regular" v-if="enterpriseList.length!=0">
+				附近暂无相关企业
+			</view>
+			<view class="warp">
+				<view class="top-line"></view>
+				<view class="bottom-list-item">
+					<view class="left"><img src="../../../static/img/location.png" alt=""></view>
+					<view class="middle">
+						<view class="title Medium">中天昊元粮库中天昊元粮库</view>
+						<view class="location Regular">辽宁省营口市鲅鱼圈区xx路108号</view>
+					</view>
+					<view class="line"></view>
+					<view class="right">
+						<view class="top">
+							<img src="../../../static/img/location.png" alt="">
+						</view>
+						<view class="bottom Regular">500m</view>
+					</view>
+				</view>
+				<view class="bottom-list-item">
+					<view class="left"><img src="../../../static/img/location.png" alt=""></view>
+					<view class="middle">
+						<view class="title Medium">中天昊元粮库中天昊元粮库</view>
+						<view class="location Regular">辽宁省营口市鲅鱼圈区xx路108号</view>
+					</view>
+					<view class="line"></view>
+					<view class="right">
+						<view class="top">
+							<img src="../../../static/img/location.png" alt="">
+						</view>
+						<view class="bottom Regular">500m</view>
+					</view>
+				</view>
+			</view>
+
+		</view>
+	</view>
+</template>
+<script>
+	// import amap from '@/js_sdk/js-amap/amap-wx.130.js'
+	export default {
+		data() {
+			return {
+				address: {},
+				nowLocation: {
+					longitude: '',
+					latitude: ''
+				},
+				showType: false,
+				enterpriseList: [],
+				typeStr: '全部类型',
+				typeList: [{
+						name: "全部"
+					},
+					{
+						name: "粮库"
+					},
+					{
+						name: "加工厂"
+					}
+				],
+				title: 'map',
+				latitude: 39.909,
+				longitude: 116.39742,
+				covers: [{
+					id: 0,
+					latitude: 39.9085,
+					longitude: 116.39747,
+					iconPath: '../../../static/img/location.png',
+				}]
+			}
+		},
+		onShow() {
+
+		},
+		onLoad() {
+			//获取当前位置
+			this.getLocation()
+			// var subnvue = uni.getSubNVueById('popup') // 获取nvue
+			// 	subnvue.show()  // 显示nvue
+			// uni.$on('popup', (data) => {
+			// 	console.log(data)
+			// })  
+		},
+		methods: {
+			confirm() {
+				console.log('确定')
+				this.showType = false
+			},
+			cancel() {
+				console.log('取消')
+				this.showType = false
+			},
+			selectType() {
+				this.showType = true
+				console.log(1)
+			},
+			typeConfirm(e) {
+				console.log(e)
+				this.typeStr = this.typeList[e[0]].name
+
+			},
+			getLocation() {
+				let that = this;
+				uni.getLocation({
+					type: 'gcj02',
+					geocode: true,
+					success: function(res) {
+						that.nowLocation.longitude = res.longitude
+						that.nowLocation.latitude = res.latitude
+						that.covers[0].longitude = res.longitude
+						that.covers[0].latitude = res.latitude
+						let _coverrsData = []
+						for (let i = 0; i < 50; i++) {
+							let _obj = {
+								id: i,
+								latitude: res.latitude += 0.00150,
+								longitude: res.longitude + 0.00150,
+								iconPath: '../../../static/img/location.png',
+								width:30,
+								height:30,
+								callout: {
+									content: '中天昊元粮库',
+									color: '#333333',
+									fontSize: 24,
+									borderRadius: 20,
+									padding:10,
+									bgColor: 'white',
+									display: 'ALWAYS',
+								},
+							}
+							_coverrsData.push(_obj)
+						}
+						that.covers = _coverrsData
+						console.log('获取位置数据:', res);
+						console.log('当前位置的经度:' + res.longitude);
+						console.log('当前位置的纬度:' + res.latitude);
+						//拼接当前定位回显地址
+						let _address = res.address
+
+						that.address = _address.province + _address.city + _address.district + _address.poiName
+						console.log(that.address)
+					}
+				});
+			},
+			markertap(e) {
+				console.log(e)
+				uni.showToast({
+					title: "点击id为" + e.detail.markerId + "的坐标",
+					icon: 'none',
+					duration: 2000
+				})
+			}
+
+		}
+	}
+</script>
+<style scoped>
+	.header {
+		flex-direction: row;
+		justify-content: space-between;
+		margin-bottom: 20rpx;
+		padding: 20rpx;
+	}
+
+	.title {
+		font-size: 32rpx;
+	}
+
+	.content {
+		width: 750px;
+		flex: 1;
+	}
+
+	.map {
+		height: 1350rpx;
+	}
+
+	.content2 {
+		position: fixed;
+		bottom: 0;
+		width: 750rpx;
+		flex: 1;
+		font-size: 34px;
+		background: pink;
+	}
+
+	.header-type {
+		font-size: 26rpx;
+	}
+
+	.alert {
+		flex: 1;
+	}
+
+	.select-alert {
+		background-color: green;
+		position: fixed;
+		bottom: 0;
+		width: 750rpx;
+		flex: 1;
+	}
+
+	.select-top {
+		flex-direction: row;
+		align-items: center;
+		justify-content: space-around;
+		background: yellow;
+		height: 80rpx;
+	}
+
+
+	.select {
+		width: 750rpx;
+		flex: 1;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		background: white;
+	}
+	.cancel{
+		font-size: 24rpx;
+		color: white;
+		font-weight: bold;
+	}
+	.confirm{
+		font-size: 24rpx;
+		color: green;
+		font-weight: bold;
+	}
+	.select-item{
+		font-size: 24rpx;
+	}
+</style>

+ 101 - 151
pages/grain_pulse/distribution/distribution.vue

@@ -1,27 +1,38 @@
 <template>
 	<view class="container">
-<!-- 		<view class="header">
+		<view class="header">
 			<view class="now-location">
 				<u-icon name="map" size="36" class="icon"></u-icon>
-				<view class="text Medium">{{address}}</view>
+				<text class="text Medium title">{{address}}</text>
 			</view>
 			<view class="selectType">
-				<view @click="selectType" class="header-type Regular">{{typeStr}}</view>
-				<u-icon :style="{transform:(showType?'rotate(180deg)':'')}" name="arrow-down-fill" size="8"
-					color="#AFB3BF" class="icon"></u-icon>
+				<text @click="selectType" class="header-type Regular">{{typeStr}}</text>
+				<!-- 				<u-icon :style="{transform:(showType?'rotate(180deg)':'')}" name="arrow-down-fill" size="8"
+					color="#AFB3BF" class="icon"></u-icon> -->
 			</view>
-			<u-picker mode="selector" v-model="showType" @confirm='typeConfirm' confirm-color='#22C572'
-				:range="typeList" range-key="name" :default-selector="[0]"></u-picker>
-		</view> -->
+		</view>
 		<view class="uni-common-mt">
 			<view class="content">
 				<map class="map" @markertap="markertap" :latitude="nowLocation.latitude"
 					:longitude="nowLocation.longitude" :markers="covers" :enable-poi="true">
 				</map>
-				<view @click='show'>显示</view>
 			</view>
 		</view>
-<!-- 		<view class="content2">
+		<view class="alert">
+			<view class="select-alert" v-if="showType">
+				<view class="select-top">
+					<text class="cancel" @click="cancel">取消</text>
+					<text class="confirm" @click="confirm">确定</text>
+				</view>
+				<view class="select">
+					<text class="select-item" v-for="(item,index) in typeList" :key="index">
+						{{item.name}}
+					</text>
+				</view>
+			</view>
+		</view>
+
+		<view class="content2">
 			<view class="no-enterprise Regular" v-if="enterpriseList.length!=0">
 				附近暂无相关企业
 			</view>
@@ -57,7 +68,7 @@
 				</view>
 			</view>
 
-		</view> -->
+		</view>
 	</view>
 </template>
 <script>
@@ -65,7 +76,7 @@
 	export default {
 		data() {
 			return {
-				address: "黑龙江中天...",
+				address: {},
 				nowLocation: {
 					longitude: '',
 					latitude: ''
@@ -95,25 +106,29 @@
 			}
 		},
 		onShow() {
-		
+
 		},
 		onLoad() {
 			//获取当前位置
 			this.getLocation()
-			 var subnvue = uni.getSubNVueById('popup') // 获取nvue
-					subnvue.show()  // 显示nvue
-					uni.$on('popup', (data) => {
-					    vm.title = data.title;  
-					    vm.content = data.content;  
-					})  
+			// var subnvue = uni.getSubNVueById('popup') // 获取nvue
+			// 	subnvue.show()  // 显示nvue
+			// uni.$on('popup', (data) => {
+			// 	console.log(data)
+			// })  
 		},
 		methods: {
-			show(){
-				var subnvue = uni.getSubNVueById('popup') // 获取nvue
-									subnvue.show()
+			confirm() {
+				console.log('确定')
+				this.showType = false
+			},
+			cancel() {
+				console.log('取消')
+				this.showType = false
 			},
 			selectType() {
 				this.showType = true
+				console.log(1)
 			},
 			typeConfirm(e) {
 				console.log(e)
@@ -137,11 +152,14 @@
 								latitude: res.latitude += 0.00150,
 								longitude: res.longitude + 0.00150,
 								iconPath: '../../../static/img/location.png',
+								width:30,
+								height:30,
 								callout: {
 									content: '中天昊元粮库',
 									color: '#333333',
-									fontSize: 12,
+									fontSize: 24,
 									borderRadius: 20,
+									padding:10,
 									bgColor: 'white',
 									display: 'ALWAYS',
 								},
@@ -153,8 +171,10 @@
 						console.log('当前位置的经度:' + res.longitude);
 						console.log('当前位置的纬度:' + res.latitude);
 						//拼接当前定位回显地址
-						// let _address = res.address
-						// this.address = _address
+						let _address = res.address
+
+						that.address = _address.province + _address.city + _address.district + _address.poiName
+						console.log(that.address)
 					}
 				});
 			},
@@ -170,150 +190,80 @@
 		}
 	}
 </script>
-<style lang="scss" scoped>
+<style scoped>
 	.header {
-		display: flex;
-		padding: 20rpx 35rpx;
-		background: white;
+		flex-direction: row;
 		justify-content: space-between;
-		align-items: center;
-
-		.selectType {
-			display: flex;
-			justify-content: center;
-			align-items: flex-end;
-
-			.icon {
-				position: relative;
-				top: -4rpx
-			}
-		}
-
-		.header-type {
-			font-size: 26rpx;
-			color: #333333;
-			margin-right: 10rpx;
-
-		}
-
-		.now-location {
-			display: flex;
-			align-items: center;
-
-			.icon {
-				margin-right: 10rpx;
-			}
+		margin-bottom: 20rpx;
+		padding: 20rpx;
+	}
 
-			.text {
-				font-size: 32rpx;
-				color: #333333;
-			}
-		}
+	.title {
+		font-size: 32rpx;
 	}
 
 	.content {
-		height: calc(100vh - 100px);
-
-		.map {
-			width: 100%;
-			height: 100%;
-		}
+		width: 750px;
+		flex: 1;
 	}
 
-	.no-enterprise {
-		position: fixed;
-		bottom: 20px;
-		height: 84rpx;
-		width: 94%;
-		left: 0;
-		right: 0;
-		margin: auto;
-		background: #FFFFFF;
-		font-size: 26rpx;
-		color: #333333;
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		border-radius: 20rpx;
+	.map {
+		height: 1350rpx;
 	}
 
 	.content2 {
-
 		position: fixed;
 		bottom: 0;
-		width: 100%;
-		background: white;
-		border-radius: 20px 20px 0 0;
-		padding: 37rpx 35rpx 20rpx 35rpx;
-
-		.warp {
-			.top-line {
-				width: 68rpx;
-				height: 8rpx;
-				background: #B4B7C3;
-				border-radius: 4px;
-				content: '';
-				display: block;
-				position: absolute;
-				top: 16rpx;
-				left: 0;
-				right: 0;
-				margin: auto;
-			}
-
-			.bottom-list-item {
-				display: flex;
-				justify-content: space-between;
-				align-items: flex-start;
-				border-bottom: 1px solid #EEEEEE;
-				padding: 20rpx 0;
-
-				.left {
-					img {
-						width: 102rpx;
-						border-radius: 10px;
-						background: red;
-					}
-				}
-
-				.middle {
-					position: relative;
-					left: -10rpx;
+		width: 750rpx;
+		flex: 1;
+		font-size: 34px;
+		background: pink;
+	}
 
-					.title {
-						font-size: 32rpx;
-						color: #333333;
-						margin-bottom: 6rpx;
-					}
+	.header-type {
+		font-size: 26rpx;
+	}
 
-					.location {
-						font-size: 24rpx;
-						color: #AFB3BF;
-					}
-				}
+	.alert {
+		flex: 1;
+	}
 
-				.line {
-					width: 1px;
-					height: 80rpx;
-					border: 1px solid #EEEEEE;
-				}
+	.select-alert {
+		background-color: green;
+		position: fixed;
+		bottom: 0;
+		width: 750rpx;
+		flex: 1;
+	}
 
-				.right {
-					display: flex;
-					flex-direction: column;
-					justify-content: center;
-					align-items: center;
+	.select-top {
+		flex-direction: row;
+		align-items: center;
+		justify-content: space-around;
+		background: yellow;
+		height: 80rpx;
+	}
 
-					img {
-						width: 21px;
-					}
 
-					.bottom {
-						font-size: 24rpx;
-						color: #AFB3BF;
-					}
-				}
-			}
-		}
+	.select {
+		width: 750rpx;
+		flex: 1;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		background: white;
+	}
+	.cancel{
+		font-size: 24rpx;
+		color: white;
+		font-weight: bold;
+	}
+	.confirm{
+		font-size: 24rpx;
+		color: green;
+		font-weight: bold;
+	}
+	.select-item{
+		font-size: 24rpx;
 	}
 </style>

+ 0 - 127
pages/grain_pulse/distribution/subNvue/popup.nvue

@@ -1,127 +0,0 @@
-<template>
-	<view class="videos">
-		<view class="videos_e">
-			<view class="videos_title">
-				<view class="videos_titles">
-					<text class="videos_titles_one">提示</text>
-				</view>
-				<view class="videos_titless">
-					<text class="videos_titless_one">是否保存为草稿?</text>
-				</view>
-			</view>
-			<view class="videos_operation">
-				<view class="videos_operations">
-					<text class="videos_operations_one" >取消</text>
-				</view>
-				<view class="videos_operationss">
-					<text class="videos_operationss_one">确认</text>
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-
-			}
-		},
-		onLoad() {
-
-		},
-		onShow() {
-
-		},
-		methods: {
-			// 默认给父级加一个定时器就不会出现点击关闭子窗体的问题了
-			onEvents() {
-
-			},
-			// 取消
-			onCancel() {
-				//向原生子窗体传递数据
-				uni.$emit('page-popup', {
-					msg: "取消"
-				});
-			},
-			// 确定
-			onDetermine() {
-				//向原生子窗体传递数据
-				uni.$emit('page-popup', {
-					msg: "确定"
-				});
-			}
-		}
-	}
-</script>
-
-<style>
-	.videos {
-		background-color: rgba(0, 0, 0, 0);
-		align-items: center;
-		justify-content: center;
-	}
-
-	.videos_e {
-		background-color: #FFFFFF;
-		height: 299rpx;
-		width: 560rpx;
-		border-radius: 30rpx;
-	}
-
-	.videos_title {
-		width: 560rpx;
-		height: 200rpx;
-		align-items: center;
-		justify-content: center;
-		border-bottom-width: 1rpx;
-		border-color: #E5E5E5;
-		border-style: solid;
-	}
-
-	.videos_titles_one {
-		font-size: 38rpx;
-		font-weight: 700;
-	}
-
-	.videos_titless {
-		margin-top: 15rpx;
-	}
-
-	.videos_titless_one {
-		font-size: 32rpx;
-
-	}
-
-	.videos_operation {
-		width: 560rpx;
-		height: 99rpx;
-		flex-direction: row;
-	}
-
-	.videos_operationss {
-		border-left-width: 1rpx;
-		border-color: #E5E5E5;
-		border-style: solid;
-	}
-
-	.videos_operations,
-	.videos_operationss {
-		width: 280rpx;
-		height: 99rpx;
-		align-items: center;
-		justify-content: center;
-	}
-
-	.videos_operations_one {
-		font-size: 36rpx;
-		color: #343434;
-	}
-
-	.videos_operationss_one {
-		font-size: 36rpx;
-		color: #FF0423;
-	}
-</style>

+ 135 - 0
pages/grain_pulse/localtion/coordinate.nvue

@@ -0,0 +1,135 @@
+<template>
+	<view class="container">
+		<view class="content">
+			<text class="title-style">{{nowLocation.address}}</text>
+			<map class="map" @tap="tap" @markertap="markertap" :latitude="nowLocation.latitude"
+				:longitude="nowLocation.longitude" :markers="covers"
+				:style="{height: nowMapIndex ? nintyPercentScreenHeight : seventyPercentScreenHeight,width:'750rpx,flex:1'}">
+			</map>
+		</view>
+		<view class="bottom">
+			<text>
+				{{longitude}},{{latitude}}
+			</text>
+			<view class="" @click="config">确定</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				nowMapIndex: true,
+				phoneHeight: '', //屏幕高
+				phoneWidth: '', //屏幕宽
+				detail: {
+					longitude: '',
+					latitude: ''
+				},
+				nowLocation: {
+					longitude: '',
+					latitude: '',
+					address: '山海广场'
+				},
+				title: 'map',
+				latitude: 39.909,
+				longitude: 116.39742,
+				covers: [{
+					id: 0,
+					latitude: 39.9085,
+					longitude: 116.39747,
+					iconPath: '../../../static/img/location.png',
+				}]
+			}
+		},
+		onReady() {
+			// 计算屏幕高度 ,宽度
+			let _this = this;
+			uni.getSystemInfo({
+				success(res) {
+					_this.phoneHeight = res.windowHeight;
+					_this.phoneWidth = res.windowWidth
+				}
+			});
+		},
+		computed: { //计算
+			nintyPercentScreenHeight() { //百分之九十的屏幕高
+				if (this.phoneHeight !== '' && this.phoneWidth !== '') {
+					return 750 / (this.phoneWidth) * (this.phoneHeight) * 0.9 + 'rpx'
+				} else {
+					return '1250rpx'
+				}
+
+			},
+			seventyPercentScreenHeight() { //百分之七十的屏幕高
+				if (this.phoneHeight !== '' && this.phoneWidth !== '') {
+					return 750 / (this.phoneWidth) * (this.phoneHeight) * 0.7 + 'rpx'
+				} else {
+					return '1000rpx'
+				}
+
+			},
+		},
+		onLoad() {
+			this.getLocation()
+		},
+		methods: {
+			getLocation() {
+				let that = this;
+				uni.getLocation({
+					type: 'gcj02',
+					geocode: true,
+					success: function(res) {
+						that.nowLocation.longitude = res.longitude
+						that.nowLocation.latitude = res.latitude
+						that.covers[0].longitude = res.longitude
+						that.covers[0].latitude = res.latitude
+						console.log('获取位置数据:', res);
+						console.log('当前位置的经度:' + res.longitude);
+						console.log('当前位置的纬度:' + res.latitude);
+						//拼接当前定位回显地址
+						// let _address = res.address
+						// this.address = _address
+					}
+				});
+			},
+			tap(e) {
+				this.longitude = e.detail.longitude;
+				this.latitude = e.detail.latitude;
+				console.log(this.longitude)
+				console.log(this.latitude)
+
+			},
+			config(){
+				uni.navigateTo({
+					
+				})
+			}
+		}
+	}
+</script>
+
+<style scoped>
+	.content {
+flex: 1;
+width: 750rpx;
+	}
+	
+	.bottom {
+		width: 96%;
+		background: white;
+		position: fixed;
+		bottom: 54rpx;
+		left: 0;
+		right: 0;
+		margin: auto;
+		padding: 27rpx 37rpx;
+	}
+
+	.title-style {
+		font-size: 32rpx;
+		font-weight: 500;
+		color: #333333;
+	}
+</style>

+ 146 - 0
pages/grain_pulse/localtion/coordinate.vue

@@ -0,0 +1,146 @@
+<template>
+	<view class="container">
+		<view class="content">
+			<text class="title-style">{{nowLocation.address}}</text>
+			<map class="map" @tap="tap" @markertap="markertap" :latitude="nowLocation.latitude"
+				:longitude="nowLocation.longitude" :markers="covers"
+				:style="{height: nowMapIndex ? nintyPercentScreenHeight : seventyPercentScreenHeight,width:'750rpx,flex:1'}">
+			</map>
+		</view>
+		<view class="bottom">
+			<text class="bottom-text">
+				{{longitude}},{{latitude}}
+			</text>
+			<text class="config" @click="config">确定</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				nowMapIndex: true,
+				phoneHeight: '', //屏幕高
+				phoneWidth: '', //屏幕宽
+				detail: {
+					longitude: '',
+					latitude: ''
+				},
+				nowLocation: {
+					longitude: '',
+					latitude: '',
+					address: '山海广场'
+				},
+				title: 'map',
+				latitude: 39.909,
+				longitude: 116.39742,
+				covers: [{
+					id: 0,
+					latitude: 39.9085,
+					longitude: 116.39747,
+					iconPath: '../../../static/img/location.png',
+				}]
+			}
+		},
+		onReady() {
+	
+		},
+		computed: { //计算
+			nintyPercentScreenHeight() { //百分之九十的屏幕高
+				if (this.phoneHeight !== '' && this.phoneWidth !== '') {
+					return 750 / (this.phoneWidth) * (this.phoneHeight) * 0.9 + 'rpx'
+				} else {
+					return '1250rpx'
+				}
+
+			},
+			seventyPercentScreenHeight() { //百分之七十的屏幕高
+				if (this.phoneHeight !== '' && this.phoneWidth !== '') {
+					return 750 / (this.phoneWidth) * (this.phoneHeight) * 0.7 + 'rpx'
+				} else {
+					return '1000rpx'
+				}
+
+			},
+		},
+		onLoad() {
+			// 计算屏幕高度 ,宽度
+			let _this = this;
+			uni.getSystemInfo({
+				success(res) {
+					_this.phoneHeight = res.windowHeight;
+					_this.phoneWidth = res.windowWidth
+				}
+			});
+			this.getLocation()
+		},
+		methods: {
+			getLocation() {
+				let that = this;
+				uni.getLocation({
+					type: 'gcj02',
+					geocode: true,
+					success: function(res) {
+						that.nowLocation.longitude = res.longitude
+						that.nowLocation.latitude = res.latitude
+						that.covers[0].longitude = res.longitude
+						that.covers[0].latitude = res.latitude
+						console.log('获取位置数据:', res);
+						console.log('当前位置的经度:' + res.longitude);
+						console.log('当前位置的纬度:' + res.latitude);
+						//拼接当前定位回显地址
+						// let _address = res.address
+						// this.address = _address
+					}
+				});
+			},
+			tap(e) {
+				this.longitude = e.detail.longitude;
+				this.latitude = e.detail.latitude;
+				console.log(this.longitude)
+				console.log(this.latitude)
+
+			},
+			config() {
+				uni.navigateTo({
+
+				})
+			}
+		}
+	}
+</script>
+
+<style scoped>
+	.content {
+		flex: 1;
+		width: 750rpx;
+	}
+
+	.bottom {
+		width: 750rpx;
+		flex: 1;
+		background: white;
+		position: fixed;
+		bottom: 54rpx;
+		left: 0;
+		right: 0;
+		display: flex;
+		flex-direction: row;
+		justify-content: space-between;
+		height: 84rpx;
+		align-items: center;
+	}
+
+	.title-style {
+		font-size: 32rpx;
+		font-weight: 500;
+		color: #333333;
+	}
+	.bottom-text{
+		
+	}
+	.config{
+		background:#22C572 ;
+	}
+</style>

+ 135 - 0
pages/grain_pulse/localtion/localtion.nvue

@@ -0,0 +1,135 @@
+<template>
+	<view class="container">
+		<view class="content">
+			<map class="map" @markertap="markertap" :latitude="nowLocation.latitude" :longitude="nowLocation.longitude"
+				:markers="covers">
+			</map>
+		</view>
+		<view class="bottom">
+			<view class="title Medium">
+				{{dataList.title}}
+			</view>
+			<view class="bottom-content Regular">
+				{{dataList.content}}
+			</view>
+			<view class="Regular location">
+				<view class="left">
+					<u-icon name="map" size="36" class="icon"></u-icon>
+					<view>{{dataList.localtion}}</view>
+				</view>
+				
+				<view class="metre">
+				<u-line color="#A3A9B8" direction='col' length="20rpx"/>
+				<text  class="line" >
+				{{dataList.rice}}</text>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				dataList: {
+					title: '中天昊元粮库中天昊元粮库',
+					content: '我是企业介绍我是企业介绍我是企业介绍我是企业介绍我是企业介绍…',
+					localtion: "辽宁省营口市鲅鱼圈区熊岳镇火车站…",
+					rice: '500m'
+				},
+				nowLocation: {
+					longitude: '',
+					latitude: ''
+				},
+				title: 'map',
+				latitude: 39.909,
+				longitude: 116.39742,
+				covers: [{
+					id: 0,
+					latitude: 39.9085,
+					longitude: 116.39747,
+					iconPath: '../../../static/img/location.png',
+				}]
+			}
+		},
+		onLoad() {
+			this.getLocation()
+		},
+		methods: {
+			getLocation() {
+				let that = this;
+				uni.getLocation({
+					type: 'gcj02',
+					geocode: true,
+					success: function(res) {
+						that.nowLocation.longitude = res.longitude
+						that.nowLocation.latitude = res.latitude
+						that.covers[0].longitude = res.longitude
+						that.covers[0].latitude = res.latitude
+						console.log('获取位置数据:', res);
+						console.log('当前位置的经度:' + res.longitude);
+						console.log('当前位置的纬度:' + res.latitude);
+						//拼接当前定位回显地址
+						// let _address = res.address
+						// this.address = _address
+					}
+				});
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content {
+		width: 100vw;
+		height: 100vh;
+	}
+
+	.map {
+		width: 100%;
+		height: 100%;
+	}
+
+	.bottom {
+		width: 96%;
+		background: white;
+		position: fixed;
+		bottom: 54rpx;
+		left: 0;
+		right: 0;
+		margin: auto;
+		padding: 27rpx 37rpx;
+
+		.title {
+			font-size: 30rpx;
+			color: #333333;
+			margin-bottom: 12rpx;
+		}
+
+		.bottom-content {
+			font-size: 22rpx;
+		}
+
+		.location {
+			color: #AFB3BF;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			margin-top: 15rpx;
+
+			.left {
+				display: flex;
+				flex-wrap: nowrap;
+			}
+			.metre{
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				.line{
+					margin-left:13rpx ;
+				}
+			}
+		}
+	}
+</style>

+ 176 - 21
pages/grain_pulse/position/position.vue

@@ -2,10 +2,11 @@
 	<view class="">
 		<view class="header">
 			<view class="city Medium">
-				<text class="select-city">营口市</text>
+				<text class="select-city" @click="loadCity">{{city}}</text>
 				<u-icon name="arrow-down"></u-icon>
 			</view>
-			<u-search input-align="left" :show-action="false" height="70" placeholder="请输入位置信息"></u-search>
+			<u-search input-align="left" :disabled="true" @click="searchAddress" :show-action="false" height="70"
+				placeholder="请输入位置信息" v-model="addressName"></u-search>
 		</view>
 		<view class="header2">
 			<view class="header2-tip Regular">
@@ -14,36 +15,169 @@
 			<view class="header2-content">
 				<view class="left Medium">
 					<u-icon name="arrow-down"></u-icon>
-					<view class="">山海广场</view>
+					<view class="">{{address}}</view>
+					<view class="" v-if="isposition">{{text}}</view>
 				</view>
-				<view class="reposition Regular">重新定位</view>
+				<view class="reposition Regular" @click="reloadPosition">重新定位</view>
 			</view>
 
 		</view>
+
 		<view class="position-list Regular">
-			<view class="list-item">
-				<view class="row row1">
-					<view>
-						山海广场
-					</view>
-					<view>4.2千米</view>
-				</view>
-				<view class="row row2">
-					山海广场
+			<view class="search">
+				<view>最近搜索</view>
+				<u-icon name="trash-fill" color="#AFB3BF" size="28" @click="delList"></u-icon>
+			</view>
+			<view class="search-list">
+				<view v-for="(item,index) in list" class="search-list-item" @click="toHome(item)">
+					{{item}}
 				</view>
 			</view>
+
 		</view>
 
 	</view>
 </template>
 
 <script>
+	import permision from "@/js_sdk/wa-permission/permission.js"
+	import uniSegmentedControl from "@/components/uni-segmented-control/uni-segmented-control.vue"
 	export default {
-		components: {},
+		components: {
+			uniSegmentedControl
+		},
 		data() {
-			return {}
+			return {
+				addressName: "",
+				isposition: false,
+				isIos: true,
+				address: "定位失败,请点击重新定位",
+				city: '营口市',
+				list: [],
+				src: {},
+				addressObj: {}
+			}
 		},
-		methods: {}
+		onLoad(e) {
+			debugger
+			if (e.city) {
+				this.city = e.city
+			}
+			let that = this
+			uni.getStorage({
+				key: 'SearchList_key',
+				success: function(res) {
+					debugger
+					that.list = res.data
+				}
+			});
+			// 获取定位
+			this.utils.getLocation().then(function(res) {
+				debugger
+				console.log("定位信息",res)
+				if (res.errMsg != "getLocation:ok") {
+					// 定位权限未开启,引导设置
+					uni.showModal({
+						title: '温馨提示',
+						content: '您已拒绝定位,请开启',
+						confirmText: '去设置',
+						success(res) {
+							if (res.confirm) {
+								//打开授权设置
+								this.utils.openSetting()
+							}
+						}
+					})
+				}
+			})
+		},
+		methods: {
+			// 删除最近搜索
+			delList() {
+				uni.setStorage({
+					key: 'SearchList_key',
+					data: []
+				});
+			},
+			// 重新定位
+			reloadPosition() {
+				// this.getLocation()
+			},
+			openSetting() {
+				// App跳转系统的设置界面
+				// #ifdef APP-PLUS
+				uni.getSystemInfo({
+					success(res) {
+						if (res.platform == 'ios') { //IOS
+							plus.runtime.openURL("app-settings://");
+						} else if (res.platform == 'android') { //安卓
+							let main = plus.android.runtimeMainActivity();
+							let Intent = plus.android.importClass("android.content.Intent");
+							let mIntent = new Intent('android.settings.ACTION_SETTINGS');
+							main.startActivity(mIntent);
+						}
+					}
+				});
+				// #endif
+			},
+			// 跳转ios权限界面
+			judgeIosPermission: function(permisionID) {
+				var result = permision.judgeIosPermission(permisionID)
+				console.log(result);
+				var strStatus = (result) ? "已" : "未"
+				uni.showModal({
+					content: permisionID + '权限' + strStatus + "获得授权",
+					showCancel: false
+				});
+			},
+			// 跳转安卓权限界面
+			async requestAndroidPermission(permisionID) {
+				var result = await permision.requestAndroidPermission(permisionID)
+				var strStatus
+				if (result == 1) {
+					strStatus = "已获得授权"
+				} else if (result == 0) {
+					strStatus = "未获得授权"
+				} else {
+					strStatus = "被永久拒绝权限"
+				}
+				uni.showModal({
+					content: permisionID + strStatus,
+					showCancel: false
+				});
+			},
+			// 搜索
+			searchAddress(val) {
+				console.log(val)
+				let that = this;
+				uni.chooseLocation({
+					success: function(res) {
+						console.log('位置名称:' + res.name);
+						console.log('详细地址:' + res.address);
+						console.log('纬度:' + res.latitude);
+						console.log('经度:' + res.longitude);
+						that.list.push(res.name)
+						this.src = res
+						uni.setStorage({
+							key: 'SearchList_key',
+							data: that.list
+						});
+					}
+				});
+
+			},
+			// 切换城市
+			loadCity() {
+				uni.navigateTo({
+					url: "../selectCity/selectCity"
+				})
+			},
+			toHome(item) {
+				uni.navigateTo({
+					url: "../home?src=" + this.src
+				})
+			}
+		}
 	}
 </script>
 
@@ -101,10 +235,31 @@
 			}
 		}
 	}
-	.position-list{
-		background: pink;
-		border-radius: 20rpx;
-		
-		
+
+	.position-list {
+		margin-top: 20rpx;
+		background: white;
+		border-radius: 20rpx 20rpx 0 0;
+		padding: 10rpx;
+
+
+	}
+
+	.search {
+		display: flex;
+		justify-content: space-between;
+		padding: 0 20rpx;
+	}
+
+	.search-list {
+		padding: 20rpx;
+	}
+
+	.search-list-item {
+		display: inline-block;
+		background: #F5F6F9;
+		border-radius: 32rpx;
+		padding: 16rpx 24rpx;
+		margin: 0 20rpx 20rpx 0;
 	}
 </style>

+ 16 - 4
pages/grain_pulse/selectCity/selectCity.vue

@@ -1,6 +1,5 @@
 <template>
 	<view class="container">
-		<view>定位</view>
 		<citySelect @back_city="back_city"></citySelect>
 	</view>
 </template>
@@ -13,15 +12,28 @@
 		},
 		data() {
 			return {
+				statusBarHeight:''
 			}
 		},
+		onLoad() {
+			uni.getSystemInfo({
+				success: function(res) {debugger
+					console.log("statusBarHeight", res.statusBarHeight)
+					that.statusBarHeight += res.statusBarHeight + "px"; //这就是状态栏的高度
+				},
+			});
+		},
 		methods: {
-			back_city(e) {
+			back_city(e) {debugger
 				if (e !== 'no') {
 					this.region = e.cityName 
-					this.$refs.popupRef.close();
+					// this.$refs.popupRef.close();
+					uni.navigateTo({
+						url:"../position/position?city="+this.region
+					})
+					
 				} else {
-					this.$refs.popupRef.close();
+					// this.$refs.popupRef.close();
 				}
 			}
 		}

+ 49 - 5
util/util.js

@@ -373,7 +373,7 @@ const utils = {
 	isNumber: function(val) {
 		let regPos = /^\d+(\.\d+)?$/; //非负浮点数
 		let regNeg =
-		/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
+			/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
 		if (regPos.test(val) || regNeg.test(val)) {
 			return true;
 		} else {
@@ -399,11 +399,52 @@ const utils = {
 		}
 	},
 	// null赋值空字符串
-	nullToString:function(obj){
-		for(key in obj){
-			if(obj[key]==null) obj[key] = ""
+	nullToString: function(obj) {
+		for (key in obj) {
+			if (obj[key] == null) obj[key] = ""
 		}
 	},
+	//获取当前定位
+	getPosition: function(option) {
+
+	},
+
+	getLocation: function() {
+		return new Promise(function(resolve, reject) {
+			uni.getLocation({
+				type: 'gcj02',
+				geocode: true,
+				success: function(res) {
+					debugger
+					if (res.errMsg == "getLocation:ok") {
+						resolve(res);
+					} else {
+						reject(res);
+					}
+				},
+				fail(e) {
+					reject(err);
+				}
+			});
+		});
+	},
+	openSetting: function() {
+		// App跳转系统的设置界面
+		// #ifdef APP-PLUS
+		uni.getSystemInfo({
+			success(res) {
+				if (res.platform == 'ios') { //IOS
+					plus.runtime.openURL("app-settings://");
+				} else if (res.platform == 'android') { //安卓
+					let main = plus.android.runtimeMainActivity();
+					let Intent = plus.android.importClass("android.content.Intent");
+					let mIntent = new Intent('android.settings.ACTION_SETTINGS');
+					main.startActivity(mIntent);
+				}
+			}
+		});
+		// #endif
+	},
 	expireTime: function(str) {
 		if (!str) {
 			return;
@@ -547,5 +588,8 @@ module.exports = {
 	expireTime: utils.expireTime,
 	payOrder: utils.payOrder,
 	login: utils.login,
-	nullToString:utils.nullToString
+	nullToString: utils.nullToString,
+	getLocation: utils.getLocation,
+	openSetting: utils.openSetting,
+
 }