Browse Source

feat(lang+component): add new translation keys and update photo component

1. 新增拍照上传、文件上传的多语言翻译配置到cn/hk/en语言包
2. 在photo组件中新增文件上传按钮并调整样式
3. 修复setPhoto组件中标题显示错误的问题
4. 为上传成功后添加强制更新视图的逻辑
lsc 1 day ago
parent
commit
9b5c020807

+ 9 - 1
src/components/pages/workPage/components/photo.vue

@@ -21,8 +21,12 @@
         <span>{{ lang.ssTakePhoto }}</span>
         <span>{{ lang.ssTakePhoto }}</span>
       </button>
       </button>
       
       
+      <button class="photo-btn" @click="uploadImage">
+        <span class="plus-icon">+</span>
+        <span>{{ lang.ssFileUpload }}</span>
+      </button>
       <!-- 上传图片按钮 -->
       <!-- 上传图片按钮 -->
-      <span class="upload-btn" @click="uploadImage">{{ lang.ssContinueAddImage }}</span>
+      <!-- <span class="upload-btn" @click="uploadImage">{{ lang.ssContinueAddImage }}</span> -->
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
@@ -199,6 +203,10 @@ export default {
   background-color: #fff8f0;
   background-color: #fff8f0;
 }
 }
 
 
+.photo-btn + .photo-btn {
+  margin-left: 20px;
+}
+
 .plus-icon {
 .plus-icon {
   font-size: 1.2rem;
   font-size: 1.2rem;
   font-weight: bold;
   font-weight: bold;

+ 2 - 1
src/components/pages/workPage/components/setPhoto.vue

@@ -2,7 +2,7 @@
   <div class="setChoiceQuestion">
   <div class="setChoiceQuestion">
     <div class="testItem">
     <div class="testItem">
       <div class="ti_header">
       <div class="ti_header">
-        <span>{{ lang.ssTopic }}{{ 1 }}</span>
+        <span>{{ lang.ssPhotoTip }}</span>
       </div>
       </div>
 
 
       <div class="ti_title">
       <div class="ti_title">
@@ -111,6 +111,7 @@ export default {
           uploadOneFile(e.target.files[0]).then(res => {
           uploadOneFile(e.target.files[0]).then(res => {
             res.src = res.url
             res.src = res.url
             this.jsonData.imageList = [res];
             this.jsonData.imageList = [res];
+            this.$forceUpdate();
             // this.jsonData.testJson.find(item => item.id == id).timuList = [res];
             // this.jsonData.testJson.find(item => item.id == id).timuList = [res];
             this.setTestJson();
             this.setTestJson();
           })
           })

+ 2 - 0
src/lang/cn.json

@@ -1884,6 +1884,8 @@
   "ssInterVideo":"交互视频",
   "ssInterVideo":"交互视频",
   "ssPhoto":"拍照",
   "ssPhoto":"拍照",
   "ssPhotoTip":"拍照指引",
   "ssPhotoTip":"拍照指引",
+  "ssTakePhoto":"拍照上传",
+  "ssFileUpload":"文件上传",
   "ssAIAgent":"AI智能体",
   "ssAIAgent":"AI智能体",
   "ssPPT":"PPT",
   "ssPPT":"PPT",
   "ssModify":"修 改",
   "ssModify":"修 改",

+ 2 - 0
src/lang/en.json

@@ -1883,6 +1883,8 @@
   "ssInterVideo":"Interactive Video",
   "ssInterVideo":"Interactive Video",
   "ssPhoto":"Photo",
   "ssPhoto":"Photo",
   "ssPhotoTip":"Photo Guide",
   "ssPhotoTip":"Photo Guide",
+  "ssTakePhoto":"Take Photo",
+  "ssFileUpload":"File Upload",
   "ssAIAgent":"AI Agent",
   "ssAIAgent":"AI Agent",
   "ssPPT":"PPT",
   "ssPPT":"PPT",
   "ssModify":"Modify",
   "ssModify":"Modify",

+ 2 - 0
src/lang/hk.json

@@ -1884,6 +1884,8 @@
   "ssInterVideo":"交互視頻",
   "ssInterVideo":"交互視頻",
   "ssPhoto":"拍照",
   "ssPhoto":"拍照",
   "ssPhotoTip":"拍照指引",
   "ssPhotoTip":"拍照指引",
+  "ssTakePhoto":"拍照上傳",
+  "ssFileUpload":"文件上傳",
   "ssAIAgent":"AI智能體",
   "ssAIAgent":"AI智能體",
   "ssPPT":"PPT",
   "ssPPT":"PPT",
   "ssModify":"修 改",
   "ssModify":"修 改",