浏览代码

fix 修改 bug

ylong 2 周之前
父节点
当前提交
5dd607594c

+ 18 - 13
pages/index/audit/components/time-clock.vue

@@ -20,40 +20,45 @@ export default {
     },
     data() {
         return {
-            // 当前累计秒数(对应 Vue3 的 ref 响应式变量)
-            currentSeconds: this.initialSeconds,
+            // 当前累计
+            currentMillis: Math.floor(this.initialSeconds),
             // 定时器实例(用于清理)
             timer: null
         }
     },
     computed: {
-        // 格式化时间:秒 → 00:00:00 格式(逻辑与 Vue3 完全一致)
+        // 格式化时间:秒 → 00:00:00.000 格式
         formattedTime() {
-            const hours = String(Math.floor(this.currentSeconds / 3600)).padStart(2, '0')
-            const minutes = String(Math.floor((this.currentSeconds % 3600) / 60)).padStart(2, '0')
-            const seconds = String(this.currentSeconds % 60).padStart(2, '0')
-            return `${hours}:${minutes}:${seconds}`
+            const totalMs = this.currentMillis
+            const hours = String(Math.floor(totalMs / 3600000)).padStart(2, '0')
+            const minutes = String(Math.floor((totalMs % 3600000) / 60000)).padStart(2, '0')
+            const seconds = String(Math.floor((totalMs % 60000) / 1000)).padStart(2, '0')
+            const milliseconds = String(totalMs % 1000).padStart(3, '0')
+            return `${hours}:${minutes}:${seconds}.${milliseconds}`
         }
     },
     watch: {
         // 监听初始秒数变化(对应 Vue3 的 watch 函数)
         initialSeconds: {
             handler(newVal) {
-                this.currentSeconds = Math.floor(newVal / 1000); // 更新当前秒数为新初始值
+                // 同步为毫秒值并重启计时
+                const safeVal = Number(newVal)
+                this.currentMillis = Number.isFinite(safeVal) ? Math.floor(safeVal) : 0
                 this.startTimer() // 重启定时器
             },
             immediate: true
         }
     },
     methods: {
-        // 启动计时(逻辑与 Vue3 一致
+        // 启动计时(毫秒级递增
         startTimer() {
             // 清除已有定时器,避免重复计时
             if (this.timer) clearInterval(this.timer)
-            // 每秒递增 1 秒
+            // 每 10ms 递增 10 毫秒(兼顾性能与精度)
+            const step = 10
             this.timer = setInterval(() => {
-                this.currentSeconds += 1
-            }, 1000)
+                this.currentMillis += step
+            }, step)
         }
     },
     // 初始化时启动计时(对应 Vue3 的 setup 初始化逻辑)
@@ -74,4 +79,4 @@ export default {
     color: #ff0000;
     letter-spacing: 2px;
 }
-</style>
+</style>

+ 0 - 4
pages/index/detail/components/ReviewInfo.vue

@@ -35,10 +35,6 @@
                     </view>
                 </view>
             </view>
-
-            <view class="flex flex-a-c flex-j-c">
-                <u-button class="mt-24" type="primary">上传(最多上传3张)</u-button>
-            </view>
         </view>
 
         <view class="file-info-list">

+ 14 - 0
pages/index/detail/review-book.vue

@@ -79,6 +79,20 @@ const getBookInfoAndAuditInfo = (opts) => {
 const reviewInfoRef = ref(null)
 const handleAudit = () => {
     let form = reviewInfoRef.value.form
+    if(form.reviewImg && form.reviewImg.length == 0){
+        uni.$u.toast("请上传复审图片");
+        return;
+    }
+
+    if (!form.reviewAuditSts) {
+        uni.$u.toast("请选择复审状态");
+        return;
+    }
+    if(form.reviewAuditSts == 3 && !form.reviewAudit){
+        uni.$u.toast("请输入复审原因");
+        return;
+    }
+
     uni.$u.http
         .post("/app/orderreview/reviewBook", {
             auditReviewId: auditReviewId.value,