yin_yu820 2 年 前
コミット
0961a754fa

+ 2 - 1
src/utils/config.js

@@ -2,7 +2,8 @@ let APP_SERVER_URL = ""
 
 if (process.env.NODE_ENV === 'development') {
     // 开发环境
-    APP_SERVER_URL = 'http://192.168.139.110:8084'
+    //APP_SERVER_URL = 'http://192.168.139.110:8084'
+    APP_SERVER_URL = 'http://localhost:8084'
 } else {
     // 生产环境
     APP_SERVER_URL = 'http://123.57.226.179:8010/hs'

+ 36 - 3
src/views/activityMan/siteInspection/siteInspectionView.vue

@@ -117,7 +117,6 @@
         </van-field>
       </van-cell-group>
 
-
       <van-cell-group>
         <div class="rowTextArea">
           <van-field
@@ -143,6 +142,8 @@ import { reactive, ref } from "vue";
 import personList from "../personList.vue";
 import siteInspectionService from "@/api/siteInspection/siteInspectionService";
 import tools from "@/api/sys/tools";
+// 图片路径
+import $base from "@/utils/config";
 export default {
   components: { personList },
   setup() {
@@ -234,8 +235,29 @@ export default {
           // window.xm.showToast({
           //     message:data.url
           // })
-          fileList.value.push("http://localhost:3000"+data.url);
-          //siteInspection.value.enclosure = data.url;
+          // /fileList.value.push("http://localhost:3000"+data.url);
+          
+
+          data.name = decodeURIComponent(
+            data.url.substring(
+              data.url.lastIndexOf("/") + 1
+            )
+          );
+
+
+          data.url = `${$base}` + data.url;        
+          fileList.value.push(data);
+          siteInspection.value.enclosure = data.url;
+
+          //fileList.value[0].url = `${$base}` + fileList.value[0].url;
+          // fileList.value[0].name = decodeURIComponent(
+          //   fileList.value[0].url.substring(
+          //     fileList.value[0].url.lastIndexOf("/") + 1
+          //   )
+          // );
+
+
+
         });
     };
     // 提交数据
@@ -342,4 +364,15 @@ export default {
   width: 80%;
   top: 50%;
 }
+.preview-cover {
+    position: absolute;
+    bottom: 0;
+    box-sizing: border-box;
+    width: 100%;
+    padding: 4px;
+    color: #fff;
+    font-size: 12px;
+    text-align: center;
+    background: rgba(0, 0, 0, 0.3);
+  }
 </style>