Tang 3 жил өмнө
parent
commit
f3e8e7ff72

+ 15 - 14
src/pages/person-center/my-bank/bank-detail/index.vue

@@ -155,10 +155,11 @@
                                 <div class="bank-section__item__text">
                                   {{ section.examName }}
                                 </div>
-                                <el-button
+                                <div
                                   style="width: auto; padding: 0px 14px"
-                                  class="btn"
-                                  >正确率
+                                  class="btn_div"
+                                >
+                                  正确率
                                   <span style="color: rgb(52, 216, 71)"
                                     >{{
                                       computedNums(
@@ -171,8 +172,8 @@
                                     section.doQuestionNum || 0
                                   }}</span>
                                   /
-                                  {{ section.questionNum || 0 }}</el-button
-                                >
+                                  {{ section.questionNum || 0 }}
+                                </div>
                                 <el-button
                                   v-if="section.recordStatus == -1"
                                   type="primary"
@@ -220,10 +221,11 @@
                             <div class="bank-section__item__text">
                               {{ item.name }}
                             </div>
-                            <el-button
+                            <div
                               style="width: auto; padding: 0px 14px"
-                              class="btn"
-                              >正确率
+                              class="btn_div"
+                            >
+                              正确率
                               <span style="color: rgb(52, 216, 71)"
                                 >{{
                                   computedNums(
@@ -235,8 +237,8 @@
                               ><span style="color: blue">{{
                                 item.doQuestionNum || 0
                               }}</span>
-                              / {{ item.questionNum || 0 }}</el-button
-                            >
+                              / {{ item.questionNum || 0 }}
+                            </div>
                             <el-button
                               v-if="item.recordStatus == -1"
                               type="primary"
@@ -693,10 +695,8 @@ export default {
     computedNums: function () {
       return function (doNum, totalNum) {
         let ary = 0;
-        if (doNum && totalNum) {
-          ary = parseInt(doNum) / parseInt(totalNum);
-        }
-        return ary.toFixed(0);
+        ary = parseInt(doNum ? doNum : 0) / parseInt(totalNum ? totalNum : 0);
+        return (ary * 100).toFixed(0);
       };
     },
   },
@@ -1098,6 +1098,7 @@ export default {
 <!-- Add "scoped" attribute to limit CSS to this component only -->
 <style scoped lang="scss">
 .btn_div {
+  user-select: none;
   color: #666666;
   margin-right: 10px;
   padding: 0px 14px;