codernight 1 week ago
parent
commit
fb005c01c0
4 changed files with 76 additions and 19 deletions
  1. 9 0
      pages/index/index.vue
  2. 38 5
      pages/index/taskDeatils.vue
  3. 8 8
      pages/login/login.vue
  4. 21 6
      pages/risk/riskDetail.vue

+ 9 - 0
pages/index/index.vue

@@ -51,6 +51,15 @@
 					<view class="text">
 					<view class="text">
 						管线单元名称 :{{item.lineUnitName}}
 						管线单元名称 :{{item.lineUnitName}}
 					</view>
 					</view>
+					<view class="text">
+						创建时间 :{{item.createDate}}
+					</view>
+					<view class="text">
+						创建人 :{{item.createName}}
+					</view>
+					<view class="text">
+						接收人 :{{item.receivedUserName?item.receivedUserName:"暂无"}}
+					</view>
 					<view class="text">
 					<view class="text">
 						任务状态:
 						任务状态:
 						<span :style="{ color: isReceivedColor[item.isReceived] }">
 						<span :style="{ color: isReceivedColor[item.isReceived] }">

+ 38 - 5
pages/index/taskDeatils.vue

@@ -37,6 +37,8 @@
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
+		<u-action-sheet :actions="list" :title="title" :show="show" @close='show=false'
+			@select="selectClick"></u-action-sheet>
 		<view class="btns">
 		<view class="btns">
 			<u-button v-if="dataForm.isReceived==='0'" type='error' :plain="true" text="拒绝"
 			<u-button v-if="dataForm.isReceived==='0'" type='error' :plain="true" text="拒绝"
 				@click="refuseTaskArrange"></u-button>
 				@click="refuseTaskArrange"></u-button>
@@ -46,8 +48,8 @@
 				@click="receiveTaskArrange"></u-button>
 				@click="receiveTaskArrange"></u-button>
 			<u-button class="custom-style" v-if="dataForm.isReceived==='6'" type="primary" text="完成"
 			<u-button class="custom-style" v-if="dataForm.isReceived==='6'" type="primary" text="完成"
 				@click="completeTaskArrange"></u-button>
 				@click="completeTaskArrange"></u-button>
-			<span style="margin-left: 15rpx;width: 100%;">
-				<u-button class="custom-style" type="primary" text="导航到起飞点" @click="toFly"></u-button>
+			<span style="margin-left: 15rpx;width: 300rpx;">
+				<u-button class="custom-style" type="primary" text="导航到起飞点" @click="selectClick"></u-button>
 			</span>
 			</span>
 		</view>
 		</view>
 	</view>
 	</view>
@@ -57,6 +59,15 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
+				title: '导航到起飞点',
+				list: [{
+						name: '高德',
+					},
+					{
+						name: '百度',
+					},
+				],
+				show: false,
 				dataForm: {},
 				dataForm: {},
 				isApp: false,
 				isApp: false,
 			}
 			}
@@ -68,10 +79,32 @@
 			this.dataForm = JSON.parse(x.data)
 			this.dataForm = JSON.parse(x.data)
 		},
 		},
 		methods: {
 		methods: {
-			toFly() {
+			selectClick(index) {
+				this.changelang(this.dataForm.takeoffLongitude, this.dataForm.takeoffLatitude)
+				// console.log(index);
+				// if (index.name == '高德') {
+				// } else {
+				// 	this.toFly(this.dataForm.takeoffLongitude, this.dataForm.takeoffLatitude)
+				// }
+			},
+			changelang(long, lat) {
+				let that = this
+				uni.request({
+					url: `https://restapi.amap.com/v3/assistant/coordinate/convert?locations=${long},${lat}&coordsys=gps&key=74d5aa7c4270effe9a18d9cfa6149abf`,
+					success(res) {
+						console.log(res.data.locations);
+						let locations = res.data.locations.split(',')
+						that.toFly(locations[0], locations[1])
+					},
+					fail(fail) {
+						console.log(fail);
+					}
+				})
+			},
+			toFly(lang, lat) {
 				// 定义目的地的坐标和名称
 				// 定义目的地的坐标和名称
-				const latitude = this.dataForm.takeoffLatitude; // 纬度
-				const longitude = this.dataForm.takeoffLongitude; // 经度
+				const latitude = lat; // 纬度
+				const longitude = lang; // 经度
 				const name = '起飞点'; // 地点名称
 				const name = '起飞点'; // 地点名称
 				const address = '起飞点'; // 地址
 				const address = '起飞点'; // 地址
 
 

+ 8 - 8
pages/login/login.vue

@@ -20,10 +20,10 @@
 			</u-input>
 			</u-input>
 		</view>
 		</view>
 		<view class="sure" v-if="account||decode">
 		<view class="sure" v-if="account||decode">
-			<view class="protocol">
+			<!-- <view class="protocol">
 				<checkbox value="cb" @click="checked=!checked" :checked="checked" />选中我已阅读并同意<span
 				<checkbox value="cb" @click="checked=!checked" :checked="checked" />选中我已阅读并同意<span
 					@click='toRead'>《用户隐私政策》</span>
 					@click='toRead'>《用户隐私政策》</span>
-			</view>
+			</view -->
 			<view class="lo" @click='login'>
 			<view class="lo" @click='login'>
 				登录
 				登录
 			</view>
 			</view>
@@ -389,12 +389,12 @@
 			},
 			},
 			// 获取版本号
 			// 获取版本号
 			login() {
 			login() {
-				if (!this.checked) {
-					return this.$refs.uToast.show({
-						message: '请勾选用户隐私政策',
-						type: 'fail	',
-					})
-				}
+				// if (!this.checked) {
+				// 	return this.$refs.uToast.show({
+				// 		message: '请勾选用户隐私政策',
+				// 		type: 'fail	',
+				// 	})
+				// }
 				let that = this
 				let that = this
 				//#ifdef APP-PLUS
 				//#ifdef APP-PLUS
 				that.tologin()
 				that.tologin()

+ 21 - 6
pages/risk/riskDetail.vue

@@ -51,7 +51,8 @@
 					风险点位置
 					风险点位置
 				</view>
 				</view>
 				<view class="value">
 				<view class="value">
-					<u-text class="success" type="primary" text="点击前往" @click="topicUrl"></u-text>
+					<u-text class="success" type="primary" text="点击前往"
+						@click="changelang(dataForm.photoLongitude,dataForm.photoLatitude)"></u-text>
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
@@ -150,16 +151,29 @@
 			this.getInit()
 			this.getInit()
 		},
 		},
 		methods: {
 		methods: {
+			changelang(long, lat) {
+				let that = this
+				uni.request({
+					url: `https://restapi.amap.com/v3/assistant/coordinate/convert?locations=${long},${lat}&coordsys=gps&key=74d5aa7c4270effe9a18d9cfa6149abf`,
+					success(res) {
+						let locations = res.data.locations.split(',')
+						that.topicUrl(locations[0], locations[1])
+					},
+					fail(fail) {
+						console.log(fail);
+					}
+				})
+			},
 			confirm(x) {
 			confirm(x) {
-				console.log(x);
 				this.dataForm.riskTypeId = x.value[0].id
 				this.dataForm.riskTypeId = x.value[0].id
 				this.dataForm.riskTypeName = x.value[0].dictLabel
 				this.dataForm.riskTypeName = x.value[0].dictLabel
 				this.show = false
 				this.show = false
 			},
 			},
-			topicUrl() {
+
+			topicUrl(photoLongitude, photoLatitude) {
 				// 定义目的地的坐标和名称
 				// 定义目的地的坐标和名称
-				const latitude = this.dataForm.photoLatitude; // 纬度
-				const longitude = this.dataForm.photoLongitude; // 经度
+				const latitude = photoLatitude; // 纬度
+				const longitude = photoLongitude; // 经度
 				const name = '风险点'; // 地点名称
 				const name = '风险点'; // 地点名称
 				const address = '风险点'; // 地址
 				const address = '风险点'; // 地址
 
 
@@ -356,7 +370,8 @@
 			display: grid;
 			display: grid;
 			grid-gap: 20rpx;
 			grid-gap: 20rpx;
 			grid-template-columns: 1fr 1fr 1fr 1fr;
 			grid-template-columns: 1fr 1fr 1fr 1fr;
-			image{
+
+			image {
 				border-radius: 20rpx;
 				border-radius: 20rpx;
 			}
 			}
 		}
 		}