DESKTOP-70VPDLK\Administrator hace 1 año
padre
commit
aff32bfdd7

+ 3 - 2
page_task/task_details/module/record.vue

@@ -28,8 +28,9 @@
 					<view class="sys-from-background-color p-20 r-20 m-t20" v-if="msg.file_list.length>0">
 						<view class="file-item row-c m-b20" @click.stop="openFile(file)"
 							v-for="(file,fileIndex) in msg.file_list" :key="index">
-							<image class="wh-45 m-r20" src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task-details/icon-pdf.png" mode="aspectFill">
-							</image>
+              <image class="wh-45 m-r20" src="/static/img/task-details/icon-pdf.png" v-if="file.file_type===1" mode="aspectFill"></image>
+              <image class="wh-45 m-r20" src="/static/img/task-details/icon-word.png" v-else-if="file.file_type===2" mode="aspectFill"> </image>
+              <image class="wh-45 m-r20" src="/static/img/task-details/icon-excel.png" v-else mode="aspectFill"> </image>
 							<text class="size-24 color-111827">{{ file.name }}</text>
 						</view>
 					</view>

+ 4 - 5
page_task/task_details/module/send_chat.vue

@@ -21,11 +21,10 @@
 				<view class="sys-from-background-color row-justify-sb center p-20 m-b16 r-20" v-for="(file,fileIndex) in msgData.file_list"
 					:key="fileIndex">
           <view class="row-c">
-            <image class="wh-60 m-r20" src="/static/img/task-details/icon-pdf.png" v-if="file.file_type===1" mode="aspectFill">
-            </image>
-            <image class="wh-60 m-r20" src="/static/img/task-details/icon-word.png" v-else-if="file.file_type===2" mode="aspectFill">
-              <image class="wh-60 m-r20" src="/static/img/task-details/icon-excel.png" v-else mode="aspectFill">
-                <text class="size-24 text-color-666"> {{file.name}}</text>
+            <image class="wh-60 m-r20" src="/static/img/task-details/icon-pdf.png" v-if="file.file_type===1" mode="aspectFill"></image>
+            <image class="wh-60 m-r20" src="/static/img/task-details/icon-word.png" v-else-if="file.file_type===2" mode="aspectFill"> </image>
+            <image class="wh-60 m-r20" src="/static/img/task-details/icon-excel.png" v-else mode="aspectFill"> </image>
+            <text class="size-24 text-color-666"> {{file.name}}</text>
 					</view>
 					<image class="delete-iocn wh-25" src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/information/hint-subtract.png" @click.stop="delFile(delFile)" mode=""></image>
 				</view>

+ 8 - 5
service/txOssSts.js

@@ -60,9 +60,6 @@ function txUploadFile(file){
     }
     tools.showLoading()
     return new Promise((resolve, reject) => {
-        console.log('cos-*-------------------------',cos)
-        console.log(file)
-        console.log('/app-serve/'+tools.getDate()+tools.getRandFileName(file))
         // 分片上传文件
         cos.postObject({
             Bucket: Bucket,
@@ -77,9 +74,15 @@ function txUploadFile(file){
             },
         }, function (err, data) {
             tools.hideLoading()
-            console.log(err, data);
             if(data.Location!==undefined){
-                data.Location='https://'+data.Location+'?imageMogr2/quality/50';
+                let suffixArr = ['.pdf', '.doc', '.docx', '.xlsx', '.xls','.mp4']
+                let suffix = data.Location.substring(data.Location.lastIndexOf("."));
+                let suffixKey = suffixArr.indexOf(suffix)
+                if (suffixKey < 0){
+                    data.Location='https://'+data.Location+'?imageMogr2/quality/50';
+                }else {
+                    data.Location='https://'+data.Location;
+                }
                 resolve( data)
             }else {
                 resolve( false)