Przeglądaj źródła

修复服务评价功能BUG

fanghuisheng 3 tygodni temu
rodzic
commit
c995ce4d11
1 zmienionych plików z 49 dodań i 56 usunięć
  1. 49 56
      src/pages/common/evaluate/index.vue

+ 49 - 56
src/pages/common/evaluate/index.vue

@@ -9,86 +9,80 @@
     :refresherBackground="'#f5f6f7'"
     :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
   >
-  <view v-if="projectName">
-    <view class="menu-list">
-      <view class="list-cell">
-        <view class="menu-item">
-          <view style="font-size: 14px"> 
-            为了更好提升我们的服务,请您对我们的服务人员在 <span style="font-weight: 600;font-size: 16px;">{{ projectName }}</span> 项目上的服务进行评价、留下您宝贵的意见,我们将会不断完善我们的服务。 
+    <view v-if="projectName">
+      <view class="menu-list">
+        <view class="list-cell">
+          <view class="menu-item">
+            <view style="font-size: 14px">
+              为了更好提升我们的服务,请您对我们的服务人员在
+              <span style="font-weight: 600; font-size: 16px">{{ projectName }}</span> 项目上的服务进行评价、留下您宝贵的意见,我们将会不断完善我们的服务。
+            </view>
           </view>
-        </view>
-        <view class="menu-item" v-if="handleTime">
-          <view style="font-size: 14px;margin-top:10px;"> 
-            工单提交时间:{{ handleTime.replace(/T/g, " ")}}
+          <view class="menu-item" v-if="handleTime">
+            <view style="font-size: 14px; margin-top: 10px"> 工单提交时间:{{ handleTime.replace(/T/g, " ") }} </view>
           </view>
         </view>
       </view>
-    </view>
 
-    <view class="menu-list">
-      <view class="list-cell">
-        <view class="menu-item mb15">
-          <view style="font-size: 14px; font-weight: 600"> 总体满意度 </view>
-        </view>
-        <view class="menu-item">
-          <u-rate :count="rateCount" v-model="rateValue" :size="24" :gutter="0" :minCount="0" :touchable="true" :allowHalf="true" :activeColor="proxy.$settingStore.themeColor.color"></u-rate>
-          <view style="font-size: 14px; margin: auto 0 auto auto">我的评分: {{ rateValue }}分</view>
+      <view class="menu-list">
+        <view class="list-cell">
+          <view class="menu-item mb15">
+            <view style="font-size: 14px; font-weight: 600"> 总体满意度 </view>
+          </view>
+          <view class="menu-item">
+            <u-rate :count="rateCount" v-model="rateValue" :size="24" :gutter="0" :minCount="0" :touchable="true" :allowHalf="true" :activeColor="proxy.$settingStore.themeColor.color"></u-rate>
+            <view style="font-size: 14px; margin: auto 0 auto auto">我的评分: {{ rateValue }}分</view>
+          </view>
         </view>
       </view>
-    </view>
 
-    <view class="menu-list">
-      <view class="list-cell">
-        <view class="menu-item mb15">
-          <view style="font-size: 14px; font-weight: 600"> 建议或意见 </view>
-        </view>
-        <view class="menu-item">
-          <u--textarea v-model="textareaValue" border="none" placeholder="请留下您的宝贵意见,这对我们很重要哦~" maxlength="100" style="padding: 0"></u--textarea>
+      <view class="menu-list">
+        <view class="list-cell">
+          <view class="menu-item mb15">
+            <view style="font-size: 14px; font-weight: 600"> 建议或意见 </view>
+          </view>
+          <view class="menu-item">
+            <u--textarea v-model="textareaValue" border="none" placeholder="请留下您的宝贵意见,这对我们很重要哦~" maxlength="100" style="padding: 0"></u--textarea>
+          </view>
         </view>
       </view>
-    </view>
 
-    <view class="app-button" v-if="!rateValue">
-      <view class="app-button-padding"></view>
-      <view class="app-button-fixed">
-        <u-button class="app-buttom" type="primary" @click="handleSubmit('提交')" shape="circle"> 提交 </u-button>
+      <view class="app-button" v-if="!isWhether">
+        <view class="app-button-padding"></view>
+        <view class="app-button-fixed">
+          <u-button class="app-buttom" type="primary" @click="handleSubmit('提交')" shape="circle"> 提交 </u-button>
+        </view>
       </view>
     </view>
-  </view>
-  <view v-if="!projectName">
-    <view class="menu-list">
-      <view class="list-cell">
-        <view class="menu-item">
-          <view style="font-size: 14px"> 
-            服务评价编号有误,请核对服务评价页面地址是否正确。
+    <view v-if="!projectName">
+      <view class="menu-list">
+        <view class="list-cell">
+          <view class="menu-item">
+            <view style="font-size: 14px"> 服务评价编号有误,请核对服务评价页面地址是否正确。 </view>
           </view>
         </view>
       </view>
     </view>
-  </view>
   </oa-scroll>
 </template>
 <script setup>
-import config from "@/config";
 import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
 import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
-import { useStores, commonStores } from "@/store/modules/index";
-
 import { score } from "@/api/common/index.js";
 import { page } from "@/api/business/fireIot/repairManage.js";
 const { proxy } = getCurrentInstance();
-const commonStore = commonStores();
 
 const data = reactive({
+  isWhether: false,
   rateCount: 5,
   rateValue: 0,
   textareaValue: "",
   repairCode: "",
   statusBool: true,
   handleTime: "",
-  projectName:"",
+  projectName: "",
 });
-const { rateCount, rateValue, textareaValue, repairCode, statusBool, handleTime, projectName } = toRefs(data);
+const { rateCount, rateValue, textareaValue, repairCode, statusBool, handleTime, projectName, isWhether } = toRefs(data);
 
 /**
  * @提交
@@ -119,16 +113,15 @@ onLoad((options) => {
     repairCode: repairCode.value,
     current: 1,
     size: 1,
-  })
-    .then((requset) => {
-      if(requset.data?.records.length>0){
-        rateValue.value = requset.data.records[0].score;
-        projectName.value = requset.data.records[0].projectName;
-        handleTime.value = requset.data.records[0].handleTime;
-        textareaValue.value = requset.data.records[0].appraiseContent;
-      }
-    })
-
+  }).then((requset) => {
+    if (requset.data?.records.length > 0) {
+      isWhether.value = true;
+      rateValue.value = requset.data.records[0].score;
+      projectName.value = requset.data.records[0].projectName;
+      handleTime.value = requset.data.records[0].handleTime;
+      textareaValue.value = requset.data.records[0].appraiseContent;
+    }
+  });
 });
 
 onReady(() => {});