USER-20230908AJ\Administrator 1 жил өмнө
parent
commit
34fe5fa5af

+ 31 - 14
page_task/task_details/module/send_chat.vue

@@ -5,13 +5,12 @@
 				v-model="msgData.msg" :maxlength="999" :placeholder="placeholder"></textarea>
 			<view class="size-26 m-t20 sys-weight-600">上传图片</view>
 			<view class="image-content">
-				<view class="image-box m-t20 r-10 m-r20" :key="pIndex" @click.stop="showImg(msgData.msg_img,pIndex)"
+				<view class="image-box m-t20 r-10 m-r20" :key="pIndex" @click.stop="showImg(msgImg,pIndex)"
 					v-for="(msgImg,pIndex) in msgData.msg_img">
 					<image class="image-item wh-110" :src="msgImg.type===1?msgImg.url:getVideoImg(msgImg.url)"
 						mode="aspectFill">
 					</image>
-					<image class="wh-45 video-icon" src="/static/img/task/play.png" mode="aspectFill"
-						@click.stop="showVideoImg(msgImg.url)" v-if="msgImg.type === 2">
+					<image class="wh-45 video-icon" src="/static/img/task/play.png" mode="aspectFill" v-if="msgImg.type === 2">
 					</image>
 					<image class="delete-iocn wh-25" src="/page_task/static/img/information/hint-subtract.png" mode=""
 						@click.stop="shutImg(pIndex)"></image>
@@ -112,17 +111,27 @@
         this.$refs.videoPopup.open('center')
       },
       showImg(item, index) {
-        let imgList=[]
-        for (const imgListKey in this.msgData.msg_img) {
-          if(this.msgData.msg_img[imgListKey].type===1){
-            imgList.push(this.msgData.msg_img[imgListKey].url)
+        if(item.type===2){
+          this.showVideoImg(item.url)
+        }else {
+          let imgList=[]
+          let key=0
+          for (const imgListKey in this.msgData.msg_img) {
+            if(this.msgData.msg_img[imgListKey].type===1){
+              imgList.push(this.msgData.msg_img[imgListKey].url)
+
+            }
+            if(index*1===imgListKey*1){
+              key=imgListKey
+            }
           }
+          uni.previewImage({
+            urls: imgList,
+            current: key,
+            success: () => {}
+          })
         }
-        uni.previewImage({
-          urls: imgList,
-          current: item.url,
-          success: () => {}
-        })
+
       },
 			clickBut() {
 				console.log('------butClick--------------')
@@ -173,8 +182,7 @@
 									} else {
 										console.log({
 											'name': tempFilePath.name,
-											'file_type': tools.getFileType(data
-												.Location),
+											'file_type': tools.getFileType(data.Location),
 											'url': data.Location
 										})
 										console.log(
@@ -266,6 +274,15 @@
 </script>
 
 <style lang="scss" scoped>
+.video-box {
+  height: 70vh;
+  width: 100vw;
+
+  .myVideo {
+    height: 70vh;
+    width: 100vw;
+  }
+}
 	.textarea {
 		width: calc(100% - 40rpx);
 		max-height: 100rpx;

+ 9 - 0
page_task/task_details/task_details.vue

@@ -592,4 +592,13 @@
 	.swiper-wrapper {
 		z-index: 0 !important;
 	}
+.video-box {
+  height: 70vh;
+  width: 100vw;
+
+  .myVideo {
+    height: 70vh;
+    width: 100vw;
+  }
+}
 </style>