wangchao 3 rokov pred
rodič
commit
b8ea07f2de

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 89 - 29
App.vue


+ 50 - 135
pages/grain_pulse/distribution/distribution.nvue

@@ -2,7 +2,7 @@
 	<view class="container">
 		<view class="header">
 			<view class="now-location">
-				<u-icon name="map" size="36" class="icon"></u-icon>
+				<!-- <u-icon name="map" size="36" class="icon"></u-icon> -->
 				<text class="text Medium title">{{position.name}}</text>
 			</view>
 			<view class="selectType">
@@ -25,131 +25,25 @@
 				附近暂无相关企业
 			</view>
 			<view class="warp">
-				<view class="line-style"  @click="lineClick">
+				<view class="line-style" @click="lineClick">
 					<text class="top-line"></text>
 				</view>
 				<scroll-view :scroll-top="scrollTop" :scroll-y="isscroll" @scrolltoupper="upper" @scrolltolower="lower"
 					@scroll="scroll" :class="{'active':isActive}" class="scroll-style">
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
+					<view class="bottom-list-item" v-for="(item,index) in datalist" :key="index">
+						<img class="left-img" :src="item.attachmentAddress" alt="">
 						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
+							<text class="title Medium">{{item.title}}</text>
+							<text
+								class="localtion Regular">{{item.province}}{{item.city}}{{item.area}}{{item.detailedAddress}}</text>
 						</view>
 						<text class="line"></text>
 						<view class="right">
 							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
+							<text class="right-bottom Regular">{{metreList[index]}}</text>
 						</view>
 					</view>
+
 				</scroll-view>
 
 			</view>
@@ -160,6 +54,7 @@
 </template>
 <script>
 	// import amap from '@/js_sdk/js-amap/amap-wx.130.js'
+	import * as config from '@/config'
 	export default {
 		data() {
 			return {
@@ -168,6 +63,8 @@
 				old: {
 					scrollTop: 0
 				},
+				metreList: [],
+				datalist: [],
 				"isActive": false,
 				position: {},
 				nowLocation: {
@@ -185,34 +82,52 @@
 					latitude: 39.9085,
 					longitude: 116.39747,
 					iconPath: '../../../static/img/location.png',
-				}]
+				}],
 			}
 		},
 		onShow() {
 
 		},
 		onLoad(e) {
-			this.position =  JSON.parse(e.position)
-			console.log("地点",this.position)
-			this.nowLocation.latitude = this.position.location.split(',')[1]
-			this.nowLocation.longitude = this.position.location.split(',')[0]
-			//获取标记点
-			this.getMarkers()
+			if (Object.keys(e).length) {
+				this.position = JSON.parse(e.position)
+				this.nowLocation.latitude = this.position.location.split(',')[1]
+				this.nowLocation.longitude = this.position.location.split(',')[0]
+				//获取列表数据
+			}
+			this.getList()
 		},
 		methods: {
-			getMarkers(){
-				//点击列表标记改变颜色,显示气泡提示
-				// this.$api.doRequest('get', '/settledCompanyInfo/selectSettledCompanyInfo', {
-				// 	pageSize: this.pageSize,
-				// 	currentPage: this.currentPage,
-				// }).then(res => {
-				// 	if (res.data.code == 200) {
-				// 		this.datalist = res.data.data.records
-				// 	}
-				// })
+			getList(val) {
+				this.metreList = []
+				let detailedAddress = ""
+				if (val) {
+					detailedAddress = this.position.name
+				}
+				console.log("-----------------------")
+				getApp().nvueRequst('get', '/settledCompanyInfo/selectSettledCompanyInfo', {
+					pageSize: 10000,
+					currentPage: 1,
+					detailedAddress:detailedAddress
+				}).then(res => {
+						console.log('res',res)
+					if (res.data.code == 200) {debugger
+					
+						this.datalist = res.data.data.records
+						let lat1 = this.nowLocation.latitude
+						let lng1 = this.nowLocation.longitude
+						for(let i = 0;i<this.datalist.length;i++){
+							let lat2 = this.datalist[i].latitude
+							let lng2 = this.datalist[i].longitude
+							console.log("lat1,lng1,lat2,lng2",lat1,lng1,lat2,lng2)
+							let _metre = getApp().getDistance(lat1,lng1,lat2,lng2)
+							this.metreList.push(_metre)
+						}
+					}
+				})
 			},
-			lineClick(){
-				this.isActive= !this.isActive
+			lineClick() {
+				this.isActive = !this.isActive
 				// this.isscroll = !this.isscroll
 			},
 			upper: function(e) {
@@ -308,7 +223,7 @@
 </script>
 <style scoped>
 	.active {
-		height: 583rpx!important;
+		height: 583rpx !important;
 	}
 
 	.header {

+ 45 - 134
pages/grain_pulse/distribution/distribution.vue

@@ -2,7 +2,7 @@
 	<view class="container">
 		<view class="header">
 			<view class="now-location">
-				<u-icon name="map" size="36" class="icon"></u-icon>
+				<!-- <u-icon name="map" size="36" class="icon"></u-icon> -->
 				<text class="text Medium title">{{position.name}}</text>
 			</view>
 			<view class="selectType">
@@ -25,131 +25,25 @@
 				附近暂无相关企业
 			</view>
 			<view class="warp">
-				<view class="line-style"  @click="lineClick">
+				<view class="line-style" @click="lineClick">
 					<text class="top-line"></text>
 				</view>
 				<scroll-view :scroll-top="scrollTop" :scroll-y="isscroll" @scrolltoupper="upper" @scrolltolower="lower"
 					@scroll="scroll" :class="{'active':isActive}" class="scroll-style">
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
+					<view class="bottom-list-item" v-for="(item,index) in datalist" :key="index">
+						<img class="left-img" :src="item.attachmentAddress" alt="">
 						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
+							<text class="title Medium">{{item.title}}</text>
+							<text
+								class="localtion Regular">{{item.province}}{{item.city}}{{item.area}}{{item.detailedAddress}}</text>
 						</view>
 						<text class="line"></text>
 						<view class="right">
 							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
-						</view>
-					</view>
-					<view class="bottom-list-item">
-						<img class="left-img" src="/static/location.png" alt="">
-						<view class="middle">
-							<text class="title Medium">中天昊元粮库中天昊元粮库</text>
-							<text class="localtion Regular">辽宁省营口市鲅鱼圈区xx路108号</text>
-						</view>
-						<text class="line"></text>
-						<view class="right">
-							<img class="right-img" src="/static/location.png" alt="">
-							<text class="right-bottom Regular">500m</text>
+							<text class="right-bottom Regular">{{metreList[index]}}</text>
 						</view>
 					</view>
+
 				</scroll-view>
 
 			</view>
@@ -160,6 +54,7 @@
 </template>
 <script>
 	// import amap from '@/js_sdk/js-amap/amap-wx.130.js'
+	import * as config from '@/config'
 	export default {
 		data() {
 			return {
@@ -168,6 +63,8 @@
 				old: {
 					scrollTop: 0
 				},
+				metreList: [],
+				datalist: [],
 				"isActive": false,
 				position: {},
 				nowLocation: {
@@ -185,36 +82,50 @@
 					latitude: 39.9085,
 					longitude: 116.39747,
 					iconPath: '../../../static/img/location.png',
-				}]
+				}],
 			}
 		},
 		onShow() {
 
 		},
 		onLoad(e) {
-			if(e.position){
-				this.position =  JSON.parse(e.position)
-				console.log("地点",this.position)
+			if (Object.keys(e).length) {
+				this.position = JSON.parse(e.position)
 				this.nowLocation.latitude = this.position.location.split(',')[1]
 				this.nowLocation.longitude = this.position.location.split(',')[0]
+				//获取列表数据
 			}
-			//获取标记点
-			this.getMarkers()
+			this.getList()
 		},
 		methods: {
-			getMarkers(){
-				//点击列表标记改变颜色,显示气泡提示
-				// this.$api.doRequest('get', '/settledCompanyInfo/selectSettledCompanyInfo', {
-				// 	pageSize: this.pageSize,
-				// 	currentPage: this.currentPage,
-				// }).then(res => {
-				// 	if (res.data.code == 200) {
-				// 		this.datalist = res.data.data.records
-				// 	}
-				// })
+			getList(val) {
+				this.metreList = []
+				let detailedAddress = ""
+				if (val) {
+					detailedAddress = this.position.name
+				}
+				console.log("-----------------------")
+				getApp().nvueRequst('get', '/settledCompanyInfo/selectSettledCompanyInfo', {
+					pageSize: 10000,
+					currentPage: 1,
+					detailedAddress:detailedAddress
+				}).then(res => {
+						console.log('res',res)
+					if (res.data.code == 200) {debugger
+						this.datalist = res.data.data.records
+						let lat1 = this.nowLocation.latitude
+						let lng1 = this.nowLocation.longitude
+						for(let i = 0;i<this.datalist.length;i++){
+							let lat2 = this.datalist[i].latitude
+							let lng2 = this.datalist[i].longitude
+							let _metre = this.utils.getDistance(lat1,lng1,lat2,lng2) +"千米"
+							this.metreList.push(_metre)
+						}
+					}
+				})
 			},
-			lineClick(){
-				this.isActive= !this.isActive
+			lineClick() {
+				this.isActive = !this.isActive
 				// this.isscroll = !this.isscroll
 			},
 			upper: function(e) {
@@ -310,7 +221,7 @@
 </script>
 <style scoped>
 	.active {
-		height: 583rpx!important;
+		height: 583rpx !important;
 	}
 
 	.header {

+ 49 - 29
pages/grain_pulse/localtion/coordinate.nvue

@@ -1,16 +1,19 @@
 <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"
+			<view @click='naviageToPage("/pages/grain_pulse/position/position")'>
+				<image class='location' src="@/static/img/liangmai/icon_ditu.png" mode=""></image>
+				<text class="title-style">{{position.name}}</text>
+			</view>
+			<map class="map" @tap="tap" @markertap="markertap" :latitude="position.latitude"
+				:longitude="position.longitude" :markers="covers"
 				:style="{height: nowMapIndex ? nintyPercentScreenHeight : seventyPercentScreenHeight,width:'750rpx,flex:1'}">
 			</map>
 		</view>
 		<view class="bottom">
 			<view class="bottom-left">
-				<text class="bottom-content">经度:{{longitude}}</text>
-				<text class="bottom-content">纬度:{{latitude}}</text>
+				<text class="bottom-content">经度:{{position.longitude}}</text>
+				<text class="bottom-content">纬度:{{position.latitude}}</text>
 			</view>
 			<text class="config-btn" @click="config">确定</text>
 		</view>
@@ -24,14 +27,14 @@
 				nowMapIndex: true,
 				phoneHeight: '', //屏幕高
 				phoneWidth: '', //屏幕宽
-				nowLocation: {
+				position: {
 					longitude: 116.39747,
 					latitude: 39.9085,
-					address: '山海广场'
+					address: '未指定地点'
 				},
+				longitude: 116.39747,
+				latitude: 39.9085,
 				title: 'map',
-				latitude: 39.909,
-				longitude: 116.39742,
 				// covers: [{
 				// 	id: 0,
 				// 	latitude: 39.9085,
@@ -69,40 +72,53 @@
 
 			},
 		},
+		onShow() {
+			let that = this
+			uni.getStorage({
+				key: 'setPosition',
+				success: (res) => {
+					console.log(res.data)
+					that.position = res.data
+					that.position.longitude = res.data.location.split(',')[0];
+					that.position.latitude = res.data.location.split(',')[1];
+					
+					console.log(that.position.longitude)
+					console.log(that.position.latitude)
+					// uni.removeStorage({
+					// 	key: 'setLocaltion'
+					// })
+				},
+			
+			})
+		},
 		onLoad() {
 			// this.getLocation()
 		},
 		methods: {
-			getLocation() {
-				let that = this;
-				uni.getLocation({
-					type: 'gcj02',
-					geocode: true,
+			naviageToPage(item) {
+				uni.setStorage({
+					key: 'setPositionType',
+					data:{type:1},
 					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
+						console.log(item)
+						uni.navigateTo({
+							url: item
+						})
 					}
 				});
+			
 			},
 			tap(e) {
 					let newmarker =[];
 							var id=1;
-				this.longitude = e.detail.longitude;
-				this.latitude = e.detail.latitude;
+				this.position.longitude = e.detail.longitude;
+				this.position.latitude = e.detail.latitude;
 				console.log(this.longitude)
 				console.log(this.latitude)
 				let maker= {
 					id: id++,
-					latitude: this.latitude,
-					longitude:this.longitude,
+					latitude: this.position.latitude,
+					longitude:this.position.longitude,
 					iconPath: '../../../static/img/location.png',
 				}
 				newmarker.push(maker)
@@ -111,7 +127,7 @@
 			},
 			config() {
 				uni.navigateTo({
-
+						url:"/pages/grain_pulse/enter?position="+JSON.stringify(this.position)
 				})
 			}
 		}
@@ -157,4 +173,8 @@
 	.bottom-content{
 		font-size: 28rpx;
 	}
+	.location {
+		width: 27rpx;
+		height: 31rpx;
+	}
 </style>

+ 98 - 64
pages/grain_pulse/localtion/coordinate.vue

@@ -1,17 +1,21 @@
 <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"
+			<view @click='naviageToPage("/pages/grain_pulse/position/position")'>
+				<image class='location' src="@/static/img/liangmai/icon_ditu.png" mode=""></image>
+				<text class="title-style">{{position.name}}</text>
+			</view>
+			<map class="map" @tap="tap" @markertap="markertap" :latitude="position.latitude"
+				:longitude="position.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 class="bottom-left">
+				<text class="bottom-content">经度:{{position.longitude}}</text>
+				<text class="bottom-content">纬度:{{position.latitude}}</text>
+			</view>
+			<text class="config-btn" @click="config">确定</text>
 		</view>
 	</view>
 </template>
@@ -23,33 +27,37 @@
 				nowMapIndex: true,
 				phoneHeight: '', //屏幕高
 				phoneWidth: '', //屏幕宽
-				detail: {
-					longitude: '',
-					latitude: ''
-				},
-				nowLocation: {
-					longitude: '',
-					latitude: '',
-					address: '山海广场'
+				position: {
+					longitude: 116.39747,
+					latitude: 39.9085,
+					address: '未指定地点'
 				},
+				longitude: 116.39747,
+				latitude: 39.9085,
 				title: 'map',
-				latitude: 39.909,
-				longitude: 116.39742,
-				covers: [{
-					id: 0,
-					latitude: 39.9085,
-					longitude: 116.39747,
-					iconPath: '../../../static/img/location.png',
-				}]
+				// covers: [{
+				// 	id: 0,
+				// 	latitude: 39.9085,
+				// 	longitude: 116.39747,
+				// 	iconPath: '../../../static/img/location.png',
+				// }],
+				covers: []
 			}
 		},
 		onReady() {
-	
+			// 计算屏幕高度 ,宽度
+			let _this = this;
+			uni.getSystemInfo({
+				success(res) {
+					_this.phoneHeight = res.windowHeight;
+					_this.phoneWidth = res.windowWidth
+				}
+			});
 		},
 		computed: { //计算
-			nintyPercentScreenHeight() { //百分之九十的屏幕高
+			nintyPercentScreenHeight() { //百分之的屏幕高
 				if (this.phoneHeight !== '' && this.phoneWidth !== '') {
-					return 750 / (this.phoneWidth) * (this.phoneHeight) * 0.9 + 'rpx'
+					return 750 / (this.phoneWidth) * (this.phoneHeight) + 'rpx'
 				} else {
 					return '1250rpx'
 				}
@@ -64,47 +72,62 @@
 
 			},
 		},
+		onShow() {
+			let that = this
+			uni.getStorage({
+				key: 'setPosition',
+				success: (res) => {
+					console.log(res.data)
+					that.position = res.data
+					that.position.longitude = res.data.location.split(',')[0];
+					that.position.latitude = res.data.location.split(',')[1];
+					
+					console.log(that.position.longitude)
+					console.log(that.position.latitude)
+					// uni.removeStorage({
+					// 	key: 'setLocaltion'
+					// })
+				},
+			
+			})
+		},
 		onLoad() {
-			// 计算屏幕高度 ,宽度
-			let _this = this;
-			uni.getSystemInfo({
-				success(res) {
-					_this.phoneHeight = res.windowHeight;
-					_this.phoneWidth = res.windowWidth
-				}
-			});
-			this.getLocation()
+			// this.getLocation()
 		},
 		methods: {
-			getLocation() {
-				let that = this;
-				uni.getLocation({
-					type: 'gcj02',
-					geocode: true,
+			naviageToPage(item) {
+				uni.setStorage({
+					key: 'setPositionType',
+					data:{type:1},
 					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
+						console.log(item)
+						uni.navigateTo({
+							url: item
+						})
 					}
 				});
+			
 			},
 			tap(e) {
-				this.longitude = e.detail.longitude;
-				this.latitude = e.detail.latitude;
+					let newmarker =[];
+							var id=1;
+				this.position.longitude = e.detail.longitude;
+				this.position.latitude = e.detail.latitude;
 				console.log(this.longitude)
 				console.log(this.latitude)
+				let maker= {
+					id: id++,
+					latitude: this.position.latitude,
+					longitude:this.position.longitude,
+					iconPath: '../../../static/img/location.png',
+				}
+				newmarker.push(maker)
+				this.covers = newmarker
 
 			},
-			config() {
+			config() {debugger
 				uni.navigateTo({
-
+						url:"/pages/grain_pulse/enter?position="+JSON.stringify(this.position)
 				})
 			}
 		}
@@ -118,18 +141,18 @@
 	}
 
 	.bottom {
-		width: 750rpx;
-		flex: 1;
-		background: white;
 		position: fixed;
 		bottom: 54rpx;
-		left: 0;
+		left: 25rpx;
 		right: 0;
-		display: flex;
+		width:700rpx;
+		background: white;
 		flex-direction: row;
+		flex: 1;
 		justify-content: space-between;
-		height: 84rpx;
 		align-items: center;
+		padding: 22rpx 20rpx 22rpx 49rpx;
+		border-radius: 20rpx;
 	}
 
 	.title-style {
@@ -137,10 +160,21 @@
 		font-weight: 500;
 		color: #333333;
 	}
-	.bottom-text{
-		
+	.config-btn{
+		width: 144rpx;
+		height: 67rpx;
+		line-height: 67rpx;
+		background: #22C572;
+		border-radius: 10rpx;
+		color: white;
+		text-align: center;
+		font-size: 28rpx;
+	}
+	.bottom-content{
+		font-size: 28rpx;
 	}
-	.config{
-		background:#22C572 ;
+	.location {
+		width: 27rpx;
+		height: 31rpx;
 	}
 </style>

+ 76 - 38
pages/grain_pulse/position/position.vue

@@ -34,7 +34,8 @@
 
 		</view>
 		<view class="search-content" v-if="addressName!=''">
-			<view v-for="(item,index) in searchList" :key="index" class="search-contnet-item" @click="addressClick(item)">
+			<view v-for="(item,index) in searchList" :key="index" class="search-contnet-item"
+				@click="addressClick(item)">
 				<view class="top">
 					<view v-html="item.newName" class="content"></view>
 					<view class="distance" v-if="address!='定位失败,请点击重新定位'">{{item.distance}}千米</view>
@@ -74,6 +75,9 @@
 				seach: {
 					latitude: 39.92,
 					longitude: 116.46,
+				},
+				positionType: {
+					type: ""
 				}
 			}
 		},
@@ -87,10 +91,19 @@
 					this.seach.longitude = res.data.longitude
 					this.seach.latitude = res.data.latitude
 					that.city = res.data.positionName.cityName
+					console.log("that.city", that.city)
 					// console.log("city", that.city)
-					uni.removeStorage({
-						key: 'nowRegion'
-					})
+					// uni.removeStorage({
+					// 	key: 'nowRegion'
+					// })
+				},
+			})
+			uni.getStorage({
+				key: 'setPositionType',
+				success: (res) => {
+					console.log("positionType", res.data)
+					this.positionType = res.data
+
 				},
 			})
 		},
@@ -107,23 +120,34 @@
 			this.getLocation()
 		},
 		methods: {
-			addressClick(item){
+			addressClick(item) {
+				debugger
 				this.list.push(item)
 				uni.setStorage({
 					key: 'SearchList_key',
 					data: this.list
 				});
-				uni.setStorage({
-					key: 'setLocaltion',
-					data: item,
-					success: (res) => {
-						uni.switchTab({
-							url:'../home'
-						})
-					},
-				
-				})
-				
+				if (this.positionType.type == 1) {
+					uni.setStorage({
+						key: 'setPosition',
+						data: item,
+						success: (res) => {
+							uni.navigateTo({
+								url: '../localtion/coordinate'
+							})
+						}
+					})
+				} else {
+					uni.setStorage({
+						key: 'setLocaltion',
+						data: item,
+						success: (res) => {
+							uni.switchTab({
+								url: '../home'
+							})
+						},
+					})
+				}
 			},
 			// 排序
 			compare(property) {
@@ -168,7 +192,7 @@
 						//拼接当前定位回显地址
 						// #ifdef APP-PLUS
 						let _address = res.address
-						that.city = _address.city
+						// that.city = _address.city
 						that.seach.longitude = res.longitude
 						that.seach.latitude = res.latitude
 						that.address = _address.province + _address.city + _address.district + _address
@@ -291,21 +315,29 @@
 				})
 			},
 			toHome(item) {
-				console.log("跳转首页")
-				uni.setStorage({
-					key: 'setLocaltion',
-					data: item,
-					success() {
-						uni.switchTab({
-							url: "../home",
-							success(e) {
-								console.log(e)
+				if (this.positionType.type == 1) {
+					uni.setStorage({
+						key: 'setPosition',
+						data: item,
+						success: (res) => {
+							uni.navigateTo({
+								url: '../localtion/coordinate'
+							})
+						}
+					})
+				} else {
 
-							}
-						});
-					}
+					uni.setStorage({
+						key: 'setLocaltion',
+						data: item,
+						success: (res) => {
+							uni.switchTab({
+								url: '../home'
+							})
+						},
 
-				})
+					})
+				}
 			}
 		}
 	}
@@ -392,29 +424,35 @@
 		padding: 16rpx 24rpx;
 		margin: 0 20rpx 20rpx 0;
 	}
-	.search-content{
+
+	.search-content {
 		border-radius: 20rpx 20rpx 0 0;
 		margin-top: 20rpx;
-		padding:10rpx 20rpx;
+		padding: 10rpx 20rpx;
 		background: white;
-		.search-contnet-item{
-			border-bottom:1px solid #EEEEEE;
+
+		.search-contnet-item {
+			border-bottom: 1px solid #EEEEEE;
 			padding-bottom: 10rpx;
 			margin-top: 20rpx;
-			.top{
+
+			.top {
 				display: flex;
 				justify-content: space-between;
-				.content{
+
+				.content {
 					font-size: 28rpx;
 					font-weight: 400;
 				}
-				.distance{
+
+				.distance {
 					font-size: 24rpx;
 					font-weight: 400;
 					color: #AFB3BF;
 				}
 			}
-			.bottom{
+
+			.bottom {
 				margin-top: 6rpx;
 				font-size: 24rpx;
 				font-weight: 400;

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov