浏览代码

修复了收藏取消问题,完善了单项测试模式

JXDS18FUJT 1 年之前
父节点
当前提交
c14f98a1e9

+ 14 - 9
src/components/m-do-topic/m-do-topic.vue

@@ -325,7 +325,7 @@
               </view>
               <view>
                 <text style="font-size: 24rpx">
-                  {{ trueNum + falseNum }}/{{ problemList.length }}</text>
+                  {{ problemListIndex + 1 }}/{{ problemList.length }}</text>
               </view>
             </view>
           </view>
@@ -355,7 +355,7 @@
               size="18px" /><text style="font-size: 24rpx">下一题</text>
           </view>
         </view>
-        <view v-if="type == 'exam'" class="submit">
+        <view v-if="type == 'exam' || 'singleTest'" class="submit">
           <view @click="submitExam" class="submit-button">交卷</view>
         </view>
       </view>
@@ -748,6 +748,7 @@ export default {
             });
             await api.exam.studentScoreInfo({
               score: score,
+
               kskm: query.subject,
               type: that.gsMap[query.gs],
             });
@@ -758,6 +759,7 @@ export default {
               url:
                 "/otherPages/mockExamEnd/index?" +
                 utils.mapToUrlQuery({
+                  totalScore: scorePerQuestion * (that.problemList.length),
                   score,
                   useTime,
                   questionIds: that.errQuestionIds.join(","),
@@ -795,14 +797,17 @@ export default {
         });
       } else {
         if (
-          userCollectionIds.indexOf(
-            this.problemList[this.problemListIndex].id
-          ) > 0
+          userCollectionIds.some((item) => {
+            return item.id === this.problemList[this.problemListIndex].id;
+          })
         ) {
+
           userCollectionIds.splice(
-            userCollectionIds.indexOf(
-              this.problemList[this.problemListIndex].id
-            ),
+            userCollectionIds.findIndex(item => {
+              return item.id ===  this.problemList[this.problemListIndex].id
+
+
+            }),
             1
           );
           uni.setStorageSync(storageName, userCollectionIds);
@@ -1363,7 +1368,7 @@ export default {
             : null
 
         } else if (that.query.orderBy == 'desc') {
-          ids=  uni.getStorageSync(storageName)
+          ids = uni.getStorageSync(storageName)
             ? uni
               .getStorageSync(storageName)
               .map((item) => {

+ 52 - 34
src/otherPages/mockExamEnd/index.vue

@@ -2,44 +2,28 @@
   <view class="bg">
     <m-nav-bar theme="black"></m-nav-bar>
     <div class="result-box">
-      <img class="img" v-if="score >= 90" :src="hege" />
-      <img class="img" v-if="score < 90" :src="buhege" />
+      <img class="img" v-if="score >= hegeScore" :src="hege" />
+      <img class="img" v-if="score < hegeScore" :src="buhege" />
       <view class="intro">
         <div class="fraction-box">
           <text class="fraction">{{ score }}</text>
         </div>
-        <view v-if="score >= 90" class="text">恭喜你,测试通过~</view>
-        <view v-if="score < 90" class="text" style="color: red"
-          >抱歉,测试未通过~</view
-        >
-        <view class="hint">(满分:100;合格:90)</view>
+        <view v-if="score >= hegeScore" class="text">恭喜你,测试通过~</view>
+        <view v-if="score < hegeScore" class="text" style="color: red">抱歉,测试未通过~</view>
+        <view class="hint">{{ '(满分:' + totalScore + ';合格:' + hegeScore }})</view>
 
         <view class="time">
           <text class="time-content">用时:{{ useTime }}</text>
         </view>
-        <view class="evaluation"
-          ><text v-if="score >= 90"
-            >天赋异禀、骨骼惊奇! \n 想来是百年难得一见的考试奇才!</text
-          >
-          <text v-if="score < 90"
-            >学车之路,任重而道远!\n 路漫漫其修远兮,吾将上下而求索。</text
-          >
+        <view class="evaluation"><text v-if="score >= hegeScore">天赋异禀、骨骼惊奇! \n 想来是百年难得一见的考试奇才!</text>
+          <text v-if="score < hegeScore">学车之路,任重而道远!\n 路漫漫其修远兮,吾将上下而求索。</text>
+        </view>
+        <view @click="goSkillBook" style="text-align: center;margin-top: 40rpx;">
+          <image mode="widthFix" style="width: 590rpx;margin: 0 auto;" :src="buyExamSerectBg"></image>
         </view>
         <div class="btn-box">
-          <m-button
-            width="270rpx"
-            height="90rpx"
-            @tap="goExerciseSpecify"
-            class="btn1"
-            text="错题重做"
-          />
-          <m-button
-            width="270rpx"
-            height="90rpx"
-            @tap="refreshTest"
-            class="btn2"
-            text="重新测试"
-          />
+          <m-button width="270rpx" height="90rpx" @tap="goExerciseSpecify" class="btn1" text="错题重做" />
+          <m-button width="270rpx" height="90rpx" @tap="refreshTest" class="btn2" text="重新测试" />
         </div>
       </view>
     </div>
@@ -66,13 +50,18 @@
 import api from "@/api/index";
 import utils from "@/utils/index";
 import mNavBar from "../../components/m-nav-bar/m-nav-bar.vue";
+import buyExamSerectBg from './static/buyExamSerect.gif'
+import { mapGetters,mapState } from "vuex";
 export default {
   components: { mNavBar },
   data() {
     return {
+      buyExamSerectBg,
       hege: "https://ndata.zzxcx.net/ctjk/mp-wx/mockExamEnd/smile.png",
       buhege: "https://ndata.zzxcx.net/ctjk/mp-wx/mockExamEnd/sad.png",
       score: 0,
+      totalScore: 0,
+      hegeScore: 0,
       useTime: "",
       subject: 1,
       query: {},
@@ -86,6 +75,14 @@ export default {
     };
   },
   methods: {
+    goSkillBook(){
+      let that =this
+      console.log(that.nkjk_sph)
+      wx.openChannelsActivity({
+        finderUserName:that.nkjk_sph.video_accout_id,
+        feedId:that.nkjk_sph.skill_book
+      })
+    },
     refreshTest() {
       let routes = getCurrentPages();
       if (routes.length < 2) {
@@ -119,11 +116,16 @@ export default {
   onLoad(query) {
     this.query = query;
     // console.log(getCurrentPages())
-    this.score = query.score;
+    this.score = Number(query.score);
+
     this.useTime = query.useTime;
     this.subject = query.subject;
+    this.totalScore = Number(query.totalScore)
     this.gs = query.gs;
- 
+    this.hegeScore = Math.ceil(this.totalScore * 0.9)
+  },
+  computed: {
+    ...mapGetters(['nkjk_sph'])
   },
 };
 //提交考试成绩
@@ -138,26 +140,35 @@ export default {
 <style lang="scss" scoped>
 .bg {
   background-image: url("https://ndata.zzxcx.net/ctjk/mp-wx/mockExamEnd/bg.png");
+  width: 100%;
+  min-height: 100vh;
+  padding-bottom: constant(safe-area-inset-bottom);
+  padding-bottom: env(safe-area-inset-bottom);
 }
+
 .result-box {
   display: flex;
   flex-direction: column;
   align-items: center;
   padding: 30rpx 30rpx;
+
   .img {
     width: 624rpx;
     height: 529rpx;
     position: absolute;
     top: 0;
   }
+
   .intro {
     width: 100%;
     display: inline-block;
     flex-wrap: wrap;
     background: #fff;
     border-radius: 20rpx;
-    height: 906rpx;
+    height: auto;
+    padding-bottom: 20rpx;
     margin-top: 224rpx;
+
     .text {
       font-size: 15px;
       font-family: PingFang SC;
@@ -166,16 +177,17 @@ export default {
       line-height: 23px;
       text-align: center;
     }
+
     .fraction-box {
       font-size: 15px;
       font-family: PingFang SC;
       font-weight: bold;
       color: #8a9099;
-      margin-top: 30px;
       width: 100%;
       text-align: center;
-      margin-top: 220rpx;
+      margin-top: 160rpx;
       height: auto;
+
       .fraction {
         font-size: 87rpx;
         font-family: PingFang SC;
@@ -183,6 +195,7 @@ export default {
         color: #ff4d53;
       }
     }
+
     .hint {
       font-size: 13px;
       font-family: PingFang SC;
@@ -192,11 +205,13 @@ export default {
       width: 100%;
       text-align: center;
     }
+
     .time {
       border-radius: 10rpx;
       width: 100%;
       text-align: center;
       margin-top: 30rpx;
+
       .time-content {
         font-size: 30rpx;
         font-family: PingFang SC;
@@ -224,6 +239,7 @@ export default {
     }
   }
 }
+
 .btn-box {
   margin: 0 auto;
   width: 600rpx;
@@ -235,11 +251,13 @@ export default {
   font-family: PingFang SC;
   font-weight: 400;
   line-height: 23px;
-  margin-top: 90rpx;
+  margin-top: 40rpx;
+
   .btn1 {
     background-color: #498ef5;
     border-radius: 40rpx;
   }
+
   .btn2 {
     background-color: #01c18d;
     border-radius: 40rpx;

二进制
src/otherPages/mockExamEnd/static/buyExamSerect.gif


+ 2 - 0
src/pages/carVideo/index.vue

@@ -479,6 +479,8 @@ export default {
         this.$store.commit("SET_USERINFO", res.data);
         this.$store.dispatch("GetRoadExamVip");
         this.$store.dispatch("GetNbjkSet");
+        this.$store.dispatch("GetNbjkSph");
+        
         // if (!res.data.nickName) {
         //   uni.showModal({
         //     title: "新用户更新信息",

+ 3 - 0
src/store/getters.js

@@ -77,6 +77,9 @@ const getters = {
   nbjk_set:state=>{
     return state.user.nbjk_set
   },
+  nkjk_sph:state=>{
+    return state.user.nbjk_sph
+  },
   avatar: state => state.user.avatar,
   name: state => state.user.name,
   introduction: state => state.user.introduction,

+ 25 - 0
src/store/modules/user.js

@@ -9,6 +9,12 @@ const user = {
 		},
 		jpcjUserInfo: {
 
+		},
+		nbjk_sph:{
+			video_accout_id:"sphQVbhe9O04tqB",
+			skill_book:"export/UzFfAgtgekIEAQAAAAAA_28Vw2QtxAAAAAstQy6ubaLX4KHWvLEZgBPEz6FscmQHJf2EzNPgMJop8x9nIWpt5Bxn-VOBUagD",
+			weak_color_glass:"export/UzFfAgtgekIEAQAAAAAA_28Vw2QtxAAAAAstQy6ubaLX4KHWvLEZgBPEz6FscmQHJf2EzNPgMJop8x9nIWpt5Bxn-VOBUagD"
+
 		},
 		nbjk_set: {
 			IS_SWITCH: '0',
@@ -38,6 +44,10 @@ const user = {
 		}
 	},
 	mutations: {
+		SET_NBJK_SPH:(state,config)=>{
+			state.nbjk_sph = config
+
+		},
 		SET_NBJK_SET: (state, config) => {
 			state.nbjk_set = config
 
@@ -179,6 +189,21 @@ const user = {
 			})
 			// store.commit('SET_GZH_GUANZHU',GZH_GUANZHU[0].dictValue)
 		},
+		async GetNbjkSph(store){
+			let res = await openApi.systemDictDataType("nbjk_sph")
+			let config = {
+
+			}
+			res.data.forEach(item=>{
+				config[item.dictLabel] = item.dictValue
+
+			})
+			
+		
+			store.commit('SET_NBJK_SPH',config)
+			 console.log('...',store)
+
+		},
 		/**
 		 * 获取用户信息
 		 * @param {Object} store