瀏覽代碼

修改位置页面

wangchao 3 年之前
父節點
當前提交
d9d58e22d3
共有 1 個文件被更改,包括 47 次插入212 次删除
  1. 47 212
      pages/grain_pulse/localtion/localtion.nvue

+ 47 - 212
pages/grain_pulse/localtion/localtion.nvue

@@ -1,27 +1,16 @@
 <template>
 	<view class="container">
 		<view class="content">
-			<map class="map" @markertap="markertap" :latitude="nowLocation.latitude" :longitude="nowLocation.longitude"
+			<map class="map" @markertap="markertap" :latitude="dataList.latitude" :longitude="dataList.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 bottom-list-item">
-				<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>
+			<text class="title">{{dataList.title}}</text>
+			<text class="bottom-content">{{dataList.content}}</text>
+			<view class="bottom-list-item">
+				<text class="bottom-list-item-left">{{dataList.localtion}}</text>
+					<text class="metre">{{dataList.metre}}</text>
 			</view>
 		</view>
 	</view>
@@ -32,239 +21,85 @@
 		data() {
 			return {
 				dataList: {
-					title: '中天昊元粮库中天昊元粮库',
-					content: '我是企业介绍我是企业介绍我是企业介绍我是企业介绍我是企业介绍…',
-					localtion: "辽宁省营口市鲅鱼圈区熊岳镇火车站…",
-					rice: '500m'
-				},
-				nowLocation: {
-					longitude: '',
-					latitude: ''
+					tilte:'',
+					content:'',
+					localtion:'',
+					metre:""
 				},
 				title: 'map',
-				latitude: 39.909,
-				longitude: 116.39742,
-				covers: [{
-					id: 0,
-					latitude: 39.9085,
-					longitude: 116.39747,
-					iconPath: '../../../static/img/location.png',
-				}]
+				covers: []
 			}
 		},
 		onLoad() {
-			
-			this.getLocation()
 		},
 		onShow() {
 			var data=uni.getStorageSync('location')
 			this.dataList.title=data.title
 			this.dataList.content=data.companyProfile
 			this.dataList.localtion=data.province+data.city+data.area
-			this.datalist.rice=data._metre
+			this.dataList.latitude = data.latitude
+			this.dataList.longitude =data.longitude
+			this.dataList.metre=data._metre
+			console.log("data",data)
+			let newmarker =[];
+					var id=1;
+					let maker= {
+						id: id++,
+						latitude: data.latitude,
+						longitude:data.longitude,
+						iconPath: '../../../static/img/location.png',
+					}
+					newmarker.push(maker)
+					this.covers = newmarker
 		},
 		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>
-.active {
-		height: 583rpx !important;
-		
-	}
+<style scoped>
 
-	.header {
-		flex-direction: row;
-		justify-content: space-between;
-		margin-bottom: 20rpx;
-		padding: 20rpx;
+	.content {
+		width: 750px;
+		flex: 1;
 	}
-
 	.title {
 		font-size: 28rpx;
-		font-weight: 500;
 		color: #333333;
+		padding:0 20rpx;
+		
 	}
 	.bottom-content {
-		font-size: 11px;
-	}
-	.content {
-		width: 750px;
-		flex: 1;
-	}
-	.map {
-		height: 1350rpx;
-	}
-
-	.content2 {
-		position: fixed;
-		bottom: 0;
-		width: 750rpx;
-		flex: 1;
-		font-size: 34rpx;
-		background: white;
-		border-top-left-radius: 20rpx;
-		border-top-right-radius: 20rpx;
-	}
-
-	.warp {
-		/* 		flex-direction: row;
-		justify-content: center; */
-	}
-
-	.header-type {
-		font-size: 26rpx;
+		font-size: 22rpx;
 		font-weight: 400;
 		color: #333333;
+		padding: 20rpx;
 	}
-
-	.alert {
-		flex: 1;
+	.map {
+	 height: 1350rpx;
 	}
 
-	.select-alert {
-		background-color: green;
+	.bottom{
 		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;
+		bottom: 40px;
+		width: 700rpx;
+		left:25rpx;
+		height: 180rpx;
 		flex: 1;
-		flex-direction: column;
-		justify-content: center;
-		align-items: center;
 		background: white;
+		border-radius: 20rpx;
+		padding: 20rpx 0;
 	}
-
-	.cancel {
-		font-size: 24rpx;
-		color: white;
-		font-weight: bold;
-	}
-
-	.confirm {
-		font-size: 24rpx;
-		color: green;
-		font-weight: bold;
-	}
-
-	.select-item {
-		font-size: 24rpx;
-	}
-
-	.warp {}
-
-	.bottom-list-item {
+	.bottom-list-item{
 		flex-direction: row;
 		justify-content: space-between;
-		margin-bottom: 20rpx;
-		padding-bottom: 20rpx;
-		margin-top: 20rpx;
-		border-bottom: 1px solid #EEEEEE;
+		padding:0 20rpx;
 	}
-
-	.left {}
-
-	.left-img {
-		width: 102rpx;
-		height: 106rpx;
-	}
-
-	.localtion {
+	.bottom-list-item-left{
 		font-size: 24rpx;
-		font-weight: 400;
-		color: #AFB3BF;
 	}
-
-	.localtion {
-
-		flex-direction: column;
-	}
-
-	.right-img {
-		width: 21rpx;
-		height: 26rpx;
-		background: #AFB3BF;
-	}
-
-	.right {
-		flex-direction: column;
-		justify-content: center;
-		align-items: center;
-	}
-
-	.middle {
-		flex-direction: column;
-		justify-content: center;
-	}
-
-	.warp {
-		padding: 20rpx;
-	}
-
-	.right-bottom {
+	.metre{
 		font-size: 24rpx;
-		font-weight: 400;
-		color: #AFB3BF;
-	}
-
-	.top-line {
-		width: 68px;
-		height: 8px;
-		background: #B4B7C3;
-		border-radius: 4px;
-		flex-direction: row;
-		margin-bottom: 30rpx;
-	}
-
-	.line-style {
-		flex-direction: row;
-		justify-content: center;
-	}
-
-	.scroll-style {
-		height: 130rpx;
-	}
-	.bottom{
-		position: fixed;
-		bottom: 0;
-		width: 750rpx;
-		flex: 1;
-		font-size: 34rpx;
-		background: white;
-		border-top-left-radius: 20rpx;
-		border-top-right-radius: 20rpx;
 	}
 </style>