Bladeren bron

检测单

twt 1 maand geleden
bovenliggende
commit
56c04cb7cd
2 gewijzigde bestanden met toevoegingen van 51 en 6 verwijderingen
  1. 50 5
      pages/user/reportUni.vue
  2. 1 1
      utils/request.js

+ 50 - 5
pages/user/reportUni.vue

@@ -143,7 +143,8 @@
 											<view class="kuang"
 												:class="{'report-color-red':item2.ValueType===3,'report-color-yellow':item2.ValueType===2}">
 												{{item2.ValueType===3?'急需处理':item2.ValueType===2?'密切关注':'状态良好'}}</view>
-
+                                             <view class="seeImg " v-if="item2.photoPath" @click="seeImg(item2.photoPath)">查看图片</view>
+										    
 										</view>
 										<view class="contentB">
 											<view class="leftT">备注:</view>
@@ -153,6 +154,7 @@
 											<view class="leftT">说明:</view>
 											<view v-if="item.Describe" class="contentStr">{{item.Describe}}</view>
 										</view>
+										<view class="seeImg2" v-if="item.value[0].photoAllPath" @click="seeImg(item.value[0].photoAllPath)">查看图片</view>
 									</view>
 									<view class="warning-lamp" v-if="item.SectionType===2">
 
@@ -165,19 +167,23 @@
 									</view>
 									<view v-if="item.SectionType===1">
 										<view class="car-report-rv">
-											<img :src="item.SectionPic" style="width: 100%; height: 100%;" alt="图片加载失败">
+											<img v-if="item.SectionPic" :src="item.SectionPic" style="width: 100%; height: 100%;" alt="图片加载失败">
+										   <img v-else src="http://api.dms.66km.com.cn/static/img/huanshi.png" style="width: 100%; height: 100%;" alt="图片加载失败">
 										</view>
 										<view class="car-report-rv-buttom"></view>
 									</view>
+									<view v-if="item.SectionType===2||item.SectionType===1">
+										<view class="seeImg" v-if="item.photoPath.length" @click="seeImg2(item.photoPath)">查看图片</view>
+									</view>
 									<view class="video-button carjcvideo-button" v-if="item.VideoName&&!item.showVideo">
 										<view class="video-play" @click="ckVideo(item)"></view>
 										{{item.VideoName}}
 									</view>
 									<view class="image-list">
-										<view class="image-list-item" v-for="(file,index) in item.photoPath"
+										<!-- <view class="image-list-item" v-for="(file,index) in item.photoPath"
 											:key="file.id">
 											<img mode='aspectFit' :src="file"  @click="sphotos(item.photoPath,index)" class="image-list-item-img"/>
-										</view>
+										</view> -->
 										<view v-if="item.VideoPath.length>0" class="image-list-item " >
 											<view  v-for="(vi,vindex) in item.VideoPath" class="videoLine">
 											<!-- 	<video :src="vi" style="width: 160rpx;height: 160rpx;" ></video> -->
@@ -251,7 +257,7 @@
 		onLoad(opt) {
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 			this.id = opt.id;
-			//this.id='761BD9FD-B5B4-468D-A136-3DB2AF68A203'//'761BD9FD-B5B4-468D-A136-3DB2AF68A203'
+			//this.id='C108AADE-9C50-43AE-A152-9A7C6E9BD7F4'//'761BD9FD-B5B4-468D-A136-3DB2AF68A203'
 			this.userInfo = this.$store.state.userInfo;
 			this.ext = this.$common.getExtStoreId();
 			if (this.userInfo) {
@@ -274,11 +280,41 @@
 
 		},
 		methods: {
+			seeImg2(arr){
+				uni.previewImage({
+					urls: arr,
+					//current: index,
+					longPressActions: {
+						itemList: ['发送给朋友', '保存图片', ],
+						success: function(data) {
+						},
+						fail: function(err) {
+						}
+					}
+				});
+			},
 			showVideoFN(url){
 				console.log(url)
 				this.videoUrl=url
 				this.videoUrlShow=true
 			},
+			seeImg(img){
+				console.log(img)
+				var arr=img.split(',')
+				uni.previewImage({
+					urls: arr,
+					//current: index,
+					longPressActions: {
+						itemList: ['发送给朋友', '保存图片', '收藏'],
+						success: function(data) {
+							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+						},
+						fail: function(err) {
+							console.log(err.errMsg);
+						}
+					}
+				});
+			},
 			sphotos(arr,index){
 				uni.previewImage({
 					urls: arr,
@@ -384,6 +420,7 @@
 							this.$set(item2, 'Describe', item2.value[0].Describe)
 							this.$set(item2, 'SectionType', item2.value[0].SectionType)
 							this.$set(item2, 'SectionPic', item2.value[0].SectionPic)
+							this.$set(item2, 'photoAllPath', item2.value[0].photoAllPath)
 						})
 					})
 					console.log(data)
@@ -1266,4 +1303,12 @@
 		display: flex;
 		align-items: center;
 	}
+	.seeImg{
+		padding-left: 20rpx;font-size: 26rpx;
+		color: #1677FF;line-height: 40rpx;
+	}
+	.seeImg2{
+		font-size: 26rpx;
+		color: #1677FF;line-height: 40rpx;
+	}
 </style>

+ 1 - 1
utils/request.js

@@ -9,7 +9,7 @@ import $store from '../store'
 const extConfig = uni.getExtConfigSync();		
 console.log(extConfig)
 const baseUrl=extConfig.url+'/'
-
+/* const baseUrl='http://192.168.1.18:20187/' */
 //const baseUrl='http://dms.66km.com.cn/'
 //const baseUrl='http://apidms.dqcarlink.com/' 
 //const baseUrl='https://store-api.qdbtl.cn/'