Browse Source

前端gjy

gjy 3 years ago
parent
commit
548dc0c922

+ 12 - 2
pages/grain_pulse/distribution/distribution.vue

@@ -18,6 +18,7 @@
 				<map class="map" @markertap="markertap" :latitude="nowLocation.latitude"
 				<map class="map" @markertap="markertap" :latitude="nowLocation.latitude"
 					:longitude="nowLocation.longitude" :markers="covers" :enable-poi="true">
 					:longitude="nowLocation.longitude" :markers="covers" :enable-poi="true">
 				</map>
 				</map>
+				<view @click='show'>显示</view>
 			</view>
 			</view>
 		</view>
 		</view>
 <!-- 		<view class="content2">
 <!-- 		<view class="content2">
@@ -94,14 +95,23 @@
 			}
 			}
 		},
 		},
 		onShow() {
 		onShow() {
-		const subnvue = uni.getSubNVueById('popup') // 获取nvue
-					subnvue.show()  // 显示nvue
+		
 		},
 		},
 		onLoad() {
 		onLoad() {
 			//获取当前位置
 			//获取当前位置
 			this.getLocation()
 			this.getLocation()
+			 var subnvue = uni.getSubNVueById('popup') // 获取nvue
+					subnvue.show()  // 显示nvue
+					uni.$on('popup', (data) => {
+					    vm.title = data.title;  
+					    vm.content = data.content;  
+					})  
 		},
 		},
 		methods: {
 		methods: {
+			show(){
+				var subnvue = uni.getSubNVueById('popup') // 获取nvue
+									subnvue.show()
+			},
 			selectType() {
 			selectType() {
 				this.showType = true
 				this.showType = true
 			},
 			},

+ 0 - 300
pages/grain_pulse/distribution/popup.nvue

@@ -1,300 +0,0 @@
-<template>
-	<view class="container">
-		<text>12123321321213312132123132</text>
-		<!-- <view class="header">
-			<view class="now-location">
-				<u-icon name="map" size="36" class="icon"></u-icon>
-				<view class="text Medium">{{address}}</view>
-			</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>
-			</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 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',
-				}]
-			}
-		},
-		onLoad() {
-			//获取当前位置
-			// this.getLocation()
-		},
-		methods: {
-			selectType() {
-				this.showType = true
-			},
-			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',
-								callout: {
-									content: '中天昊元粮库',
-									color: '#333333',
-									fontSize: 12,
-									borderRadius: 20,
-									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
-						// this.address = _address
-					}
-				});
-			},
-			markertap(e) {
-				console.log(e)
-				uni.showToast({
-					title: "点击id为" + e.detail.markerId + "的坐标",
-					icon: 'none',
-					duration: 2000
-				})
-			}
-
-		}
-	}
-</script>
-<style lang="scss" scoped>
-	// .header {
-	// 	display: flex;
-	// 	padding: 20rpx 35rpx;
-	// 	background: white;
-	// 	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;
-	// 		}
-
-	// 		.text {
-	// 			font-size: 32rpx;
-	// 			color: #333333;
-	// 		}
-	// 	}
-	// }
-
-	// .content {
-	// 	height: calc(100vh - 100px);
-
-	// 	.map {
-	// 		width: 100%;
-	// 		height: 100%;
-	// 	}
-	// }
-
-	// .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;
-	// }
-
-	// .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;
-
-	// 				.title {
-	// 					font-size: 32rpx;
-	// 					color: #333333;
-	// 					margin-bottom: 6rpx;
-	// 				}
-
-	// 				.location {
-	// 					font-size: 24rpx;
-	// 					color: #AFB3BF;
-	// 				}
-	// 			}
-
-	// 			.line {
-	// 				width: 1px;
-	// 				height: 80rpx;
-	// 				border: 1px solid #EEEEEE;
-	// 			}
-
-	// 			.right {
-	// 				display: flex;
-	// 				flex-direction: column;
-	// 				justify-content: center;
-	// 				align-items: center;
-
-	// 				img {
-	// 					width: 21px;
-	// 				}
-
-	// 				.bottom {
-	// 					font-size: 24rpx;
-	// 					color: #AFB3BF;
-	// 				}
-	// 			}
-	// 		}
-	// 	}
-	// }
-</style>

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

@@ -0,0 +1,127 @@
+<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>