Jelajahi Sumber

模拟考试成绩页面的ui修改和bug修复,三力测试的模块完成(也许需要移动一下提交成绩代码的位置?)

JXDS18FUJT 2 tahun lalu
induk
melakukan
1c4aaef88c

+ 1 - 1
src/api/request.js

@@ -13,7 +13,7 @@ const service = axios.create({
 	// axios中请求配置有baseURL选项,表示请求URL公共部分
 	//#ifdef MP-WEIXIN
 	//baseURL: process.env.NODE_ENV === 'development' ? 'https://jpcj-admin1.zzxcx.net/stage-api' : 'https://jpcj-admin.zzxcx.net/prod-api',
-	baseURL: process.env.NODE_ENV === 'development' ? 'https://nbjk1.zzxcx.net/nbjk-admin' : 'https://nbjk.zzxcx.net/nbjk-admin',
+	baseURL: process.env.NODE_ENV === 'development' ? 'https://1a0j71808.imdo.co/' : 'https://nbjk.zzxcx.net/nbjk-admin',
 	
 	//#endif
 	//#ifdef MP-TOUTIAO

+ 23 - 4
src/components/m-do-topic/m-do-topic.vue

@@ -1144,8 +1144,17 @@ export default {
       uni.showModal({
         title: "是否交卷",
         content: "交卷后不可再修改了",
-        success(res) {
+        async success(res) {
           if (res.confirm) {
+            uni.showLoading({
+              title: "提交成绩中",
+            });
+            await api.exam.studentScoreInfo({
+              score: score,
+              kskm: query.subject,
+              type: that.gsMap[query.gs],
+            });
+            uni.hideLoading();
             let useTime = that.useTime;
 
             uni.navigateTo({
@@ -1690,7 +1699,12 @@ export default {
         api.exam
           .studentQuestionInfoGetQuestionInfoByIds({
             ids: uni.getStorageSync(storageName)
-              ? uni.getStorageSync(storageName).map(item=>{return item.id}).reverse()
+              ? uni
+                  .getStorageSync(storageName)
+                  .map((item) => {
+                    return item.id;
+                  })
+                  .reverse()
               : null,
           })
           .then((res) => {
@@ -1734,7 +1748,12 @@ export default {
         api.exam
           .studentQuestionInfoGetQuestionInfoByIds({
             ids: uni.getStorageSync(storageName)
-              ? uni.getStorageSync(storageName).map(item=>{return item.id}).reverse()
+              ? uni
+                  .getStorageSync(storageName)
+                  .map((item) => {
+                    return item.id;
+                  })
+                  .reverse()
               : null,
           })
           .then((res) => {
@@ -1759,7 +1778,7 @@ export default {
                 }
               });
               element.isCompleted = false;
-              element.isCollect  = true;
+              element.isCollect = true;
               element.userAnswer = [];
             });
             that.problemListTotal = res.total;

+ 3 - 0
src/manifest.json

@@ -7,6 +7,8 @@
   "transformPx": false,
   "mp-weixin": {
     "appid": "wx97bbc22daac9362a",
+    "optimization":{"subPackages":true},
+    "lazyCodeLoading":"requiredComponents",
     "setting": {
       "urlCheck": false,
       "es6": true,
@@ -27,6 +29,7 @@
   },
   "mp-toutiao": {
     "appid": "tta896de2b37a8562901",
+  
     "setting": {
       "urlCheck": false,
       "es6": true,

File diff ditekan karena terlalu besar
+ 0 - 34
src/otherPages/components/ec-canvas/echarts.js


+ 12 - 2
src/otherPages/mockExam/index.vue

@@ -250,14 +250,24 @@ export default {
       let query = this.query;
       let that = this;
       let scorePerQuestion = 0;
-      console.log(query)
+      console.log(query);
       query.subject === "4" ? (scorePerQuestion = 2) : (scorePerQuestion = 1);
       score = this.trueNum * scorePerQuestion;
       uni.showModal({
         title: "是否交卷",
         content: "交卷后不可再修改了",
-        success(res) {
+        async success(res) {
           if (res.confirm) {
+            uni.showLoading({
+              title:"提交中"
+            })
+            await api.exam.studentScoreInfo({
+              score: score,
+              kskm: query.subject == 1 ? "科目一" : "科目四",
+              type: that.gsMap[query.gs],
+            });
+            uni.hideLoading()
+            
             let useTime = "";
             let useTimer = new Date(that.examTimeUse);
             clearInterval(that.examTimer);

+ 1 - 7
src/otherPages/mockExamEnd/index.vue

@@ -123,13 +123,7 @@ export default {
     this.useTime = query.useTime;
     this.subject = query.subject;
     this.gs = query.gs;
-    if (query.type === "exam") {
-      api.exam.studentScoreInfo({
-        score: Number(this.score),
-        kskm: this.subject == 1 ? "科目一" : "科目四",
-        type: this.gsMap[this.gs],
-      });
-    }
+ 
   },
 };
 //提交考试成绩

+ 137 - 56
src/otherPages/testScores/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <view>
+  <view style="background-image:url('https://ct.zzxcx.net/ctjk/mp-wx/testScores/bg.png')" class="vh100">
     <div class="header-back">
       <m-nav-bar
         :transparent="true"
@@ -8,7 +8,7 @@
       />
       <div class="user-data">
         <div class="left">
-          <m-user-avatar />
+          <image class="head" :src="headImage"></image>
           <div class="name">
             <m-user-name />
             <span
@@ -17,16 +17,21 @@
             >
           </div>
         </div>
-        <button
-          @click="goMockTest"
-          class="continue"
-          width="90px"
-          height="30px"
-          text="继续考试"
-        >继续考试</button>
+        <view class="right">
+          <view
+            @click="goMockTest"
+            class="continue"
+            width="90px"
+            height="30px"
+            text="继续考试"
+          >
+            继续考试
+            <van-icon size="28rpx" color="#498EF5" name="arrow" />
+          </view>
+        </view>
       </div>
     </div>
-    <div class="summary content-box">
+    <div style="background-image:url('https://ct.zzxcx.net/ctjk/mp-wx/testScores/summaryBg1.png')" class="summary content-box">
       <div class="item">
         <div>
           <span class="number">{{ testScoresList.length }}</span
@@ -51,20 +56,44 @@
     </div>
     <div class="test-scores content-box">
       <view class="table">
-        <view class="flex lh60" style="font-weight:600">
-          <view class="w25per">车型</view>
-          <view class="w25per">科目</view>
-          <view class="w25per">分数</view>
-          <view class="w25per">时间</view>
+        <view class="flex lh60" style="font-weight: 600">
+          <view class="w120">车型</view>
+          <view class="w120">科目</view>
+          <view class="w120">分数</view>
+          <view style="text-align: center" class="flex-grow-1">时间</view>
         </view>
       </view>
-      <view class="flex lh60" v-for="(item, index) in testScoresList" :key="index">
-        <view class="w25per">{{ item.type }}</view>
-        <view class="w25per">{{ item.kskm }}</view>
-        <view class="w25per">{{ item.score }}</view>
-        <view class="w25per">{{ item.createTime.split(" ")[0] }}</view>
+      <view
+        class="flex lh100"
+        v-for="(item, index) in testScoresList"
+        :key="index"
+        :style="{
+          background: index % 2 == 1 ? '#fff' : 'rgba(73,142,245,0.15);',
+        }"
+      >
+        <view class="w120">{{ item.type }}</view>
+        <view
+          v-if="item.kskm == '科目四' || item.kskm == '科目一'"
+          class="w120"
+          >{{ item.kskm }}</view
+        >
+        <view v-else class="w120">{{
+          item.kskm == 1 ? "科目一" : "科目四"
+        }}</view>
+
+        <view class="w120">{{ item.score }}</view>
+        <view style="text-align: center" class="flex-grow-1">{{
+          item.createTime
+        }}</view>
       </view>
     </div>
+    <view style="padding: 0 30rpx">
+      <ad
+        class="wxad"
+        :ad-intervals="100"
+        unit-id="adunit-f9ac1a546be5b3f0"
+      ></ad>
+    </view>
   </view>
 </template>
 
@@ -73,15 +102,13 @@
 <script>
 import api from "@/api/index";
 import utils from "@/utils/index";
+import { mapGetters } from "vuex";
 export default {
   data() {
     return {
-      query:{
-
-      },
-      testScoresList: [
-     
-      ],
+      userInfo: uni.getStorageSync("userInfo"),
+      query: {},
+      testScoresList: [],
       testScoresInfo: {
         maxScore: 0,
         avgScore: 0,
@@ -89,47 +116,82 @@ export default {
       },
     };
   },
+  computed: {
+    headImage() {
+      return this.$store.state.user.userInfo.headImage;
+    },
+  },
   onLoad(query) {
+    this.query = query;
     this.getTestScoresList();
     this.getTestScoresInfo();
-    this.query = query
   },
   methods: {
-    goMockTest(){
+    goMockTest() {
       uni.navigateTo({
-        url:'/otherPages/beforeMockExam/index?'+utils.mapToUrlQuery(this.query)
-      })
-
+        url:
+          "/otherPages/beforeMockExam/index?" + utils.mapToUrlQuery(this.query),
+      });
     },
     getTestScoresInfo() {
       api.exam.studentScoreInfoGetScoreInfoAll({}).then((res) => {
- 
-        this.testScoresInfo = res.data;
+        if (res.data) {
+          this.testScoresInfo = res.data;
+        }
       });
     },
     getTestScoresList() {
-      api.exam.studentScoreInfoList({}).then((res) => {
-        console.log(res)
-        this.testScoresList = res.rows;
-      });
+      api.exam
+        .studentScoreInfoList({
+          type: this.query.vehicle,
+        })
+        .then((res) => {
+          console.log(res);
+
+          this.testScoresList = res.rows;
+        });
     },
   },
 };
 </script>
 
 <style scoped lang="scss">
-.lh60{
-    line-height: 60rpx;
+.vh100{
+  height: 100vh;
+}
+.pl20 {
+  padding-left: 20rpx;
+}
+.pr20 {
+  padding-right: 20rpx;
+}
+.lh60 {
+  line-height: 60rpx;
+}
+.lh100 {
+  line-height: 100rpx;
 }
 .flex {
   display: flex;
   text-align: center;
 }
+.flex-grow-1 {
+  flex-grow: 1;
+}
 .w25per {
   width: 25%;
 }
+.w20per {
+  width: 25%;
+}
+.w120per {
+  width: 40%;
+}
+.w120 {
+  width: 120rpx;
+}
 .header-back {
-  width: 375px;
+  width: 750rpx;
   padding-bottom: 82px;
   background: linear-gradient(180deg, #498ef5 0%, #4da8e6 100%);
   border-radius: 0px 0px 82px 82px;
@@ -137,11 +199,15 @@ export default {
     display: flex;
     justify-content: space-between;
     align-items: center;
-    padding: 19px 17px 24px;
+    padding-left: 30rpx;
     .left {
       display: flex;
       justify-content: space-between;
       align-items: center;
+      .head {
+        width: 112rpx;
+        height: 112rpx;
+      }
       .name {
         display: flex;
         flex-direction: column;
@@ -150,50 +216,64 @@ export default {
         justify-content: space-between;
         margin-left: 6px;
         .grade {
-          font-size: 24px;
+          font-size: 48rpx;
           padding: 4px;
         }
       }
     }
-    .continue {
-      font-size: 24rpx;
-      font-family: PingFang SC;
-      font-weight: 400;
-      line-height: 60rpx;
-      color: #ffffff;
-      background: #01c18d;
-      border-radius:32rpx;
+    .right {
+      display: inline-block;
+      .continue {
+        width: 200rpx;
+        line-height: 60rpx;
+        background: #ebf8ff;
+        border-radius: 60rpx 0px 0px 60rpx;
+        opacity: 1;
+        font-size: 24rpx;
+        font-family: PingFang SC;
+        font-weight: 400;
+        line-height: 60rpx;
+        color: #ffffff;
+        background: #ebf8ff;
+        color: #498ef5;
+        padding-left: 36rpx;
+      }
     }
   }
 }
 .content-box {
-  width: 345px;
-  background: #ffffff;
+  width: 690rpx;
+
   box-shadow: 0px 0px 8px rgba(124, 129, 136, 0.2);
   border-radius: 10px;
   position: relative;
   left: 50%;
   transform: translateX(-50%);
   top: -82px;
-  margin-top: 10px;
+
 }
 .summary {
   display: flex;
   justify-content: space-around;
-  padding: 25px 30px;
+ padding-top: 60rpx;
+ padding-bottom: 40rpx;
   box-sizing: border-box;
+  background-size: 100%;
+  background-repeat: no-repeat;
+  width: 642rpx;
+
   .item {
     font-size: 13px;
     font-family: PingFang SC;
     font-weight: 400;
     line-height: 19px;
-    color: #8a9099;
+    color: #B3DBFF;
     display: flex;
     flex-direction: column;
     align-items: center;
     .number {
       font-size: 24px;
-      color: #0a1a33;
+      color: #fff;
       padding: 4px;
     }
   }
@@ -206,6 +286,7 @@ export default {
   color: #0a1a33;
   padding: 15px;
   box-sizing: border-box;
+  background: #fff;
   .table {
     width: 100%;
     border-collapse: collapse;

+ 9 - 4
src/otherPages/threeExam/index.vue

@@ -371,7 +371,7 @@
             <view class="tip2-bottom">
               <!-- <view class="tip2-bottom-1">试试答题技巧,提分更快</view> -->
               <view
-                @click="goPath('/otherPages/threeExamScore/index')"
+                @click="goPath('/otherPages/threeExamScore/index?score='+score)"
                 class="tip2-bottom-2"
                 >现在交卷</view
               >
@@ -397,7 +397,6 @@
 import api from "@/api";
 import utils from "@/utils";
 import countDown from "@/components/countDown/index";
-import Toast from "../../../dist/build/mp-weixin/wxcomponents/vant/toast/toast";
 export default {
   data() {
     return {
@@ -478,7 +477,6 @@ export default {
       ],
       trueNum: 0,
       falseNum: 0,
-      score: 90,
       problemListIndex: 0,
       submitExamVisible: false,
       resultExamVisible: false,
@@ -487,6 +485,11 @@ export default {
       useTime: "",
     };
   },
+  computed: {
+    score() {
+      return this.trueNum * 5;
+    },
+  },
   onLoad(query) {
     this.query = query;
     if (this.query.showSubmit == "1") {
@@ -524,6 +527,7 @@ export default {
   methods: {
     goPath(url) {
       console.log(url);
+
       uni.navigateTo({
         url,
       });
@@ -533,13 +537,14 @@ export default {
       this.useTime = b;
     },
     submitExam(e) {
+      let that = this;
       console.log(e);
       uni.showModal({
         title: "是否交卷",
         success(res) {
           if (res.confirm) {
             uni.navigateTo({
-              url: "/otherPages/threeExamScore/index",
+              url: "/otherPages/threeExamScore/index?score=" + that.score,
             });
           }
         },

+ 151 - 114
src/otherPages/threeExamScore/index.vue

@@ -31,124 +31,22 @@
         /></view>
       </view>
       <view class="content">
-        <ec-canva
+        <ec-canvas
           :ec="ec"
           :init-chart="initChart"
           canvasId="line-canvas1"
-        ></ec-canva>
+        ></ec-canvas>
+        <!-- <view style="width: 100%; height: 250rpx"></view> -->
       </view>
+      <view style="width: 100%; height: 150rpx"></view>
     </view>
   </view>
 </template>
 
 <script>
-import ecCanva from "./../components/ec-canvas/index";
+import ecCanvas from "./../components/ec-canvas/index";
 import * as echarts from "./../components/ec-canvas/echarts";
-
-function initChart(canvas, width, height, dpr) {
-  const chart = echarts.init(canvas, null, {
-    width: width,
-    height: height,
-    devicePixelRatio: dpr, // new
-  });
-  canvas.setChart(chart);
-
-  var option = {
-    color: ["#01C18D", "#00DDFF", "#37A2FF", "#FF0087", "#FFBF00"],
-    title: {
-      text: "",
-    },
-    tooltip: {
-      trigger: "axis",
-      axisPointer: {
-        type: "cross",
-        label: {
-          backgroundColor: "#6a7985",
-        },
-      },
-    },
-    legend: {
-      data: [],
-    },
-
-    grid: {
-      left: "3%",
-      right: "4%",
-      bottom: "3%",
-      containLabel: true,
-    },
-    xAxis: [
-      {
-        type: "category",
-        boundaryGap: true,
-        data: [],
-        axisLine: {
-          lineStyle: {
-            color: "#F0F0F0",
-          },
-        },
-      },
-    ],
-    yAxis: [
-      {
-        type: "value",
-        max: 100,
-        minInterval: 30,
-      },
-    ],
-    series: [
-      {
-        name: "Line 1",
-        type: "line",
-        stack: "Total",
-        smooth: false,
-        lineStyle: {
-          width: 2,
-        },
-        markLine: {
-          data: [
-            [
-              {
-                name: "及格线",
-                yAxis: 90,
-                x: "10%",
-                label: {
-                  color: "#01C18D",
-                },
-              },
-              {
-                name: "及格线",
-                yAxis: 90,
-                x: "85%",
-              },
-            ],
-          ],
-        },
-        showSymbol: true,
-        areaStyle: {
-          opacity: 0.8,
-          color: new echarts.graphic.LinearGradient(1, 0, 1, 1, [
-            {
-              offset: 0,
-              color: "#E1F8F1",
-            },
-            {
-              offset: 1,
-              color: "#FEFEFE",
-            },
-          ]),
-        },
-        emphasis: {
-          focus: "series",
-        },
-        data: [20, 40, 70, 60, 50],
-      },
-    ],
-  };
-
-  chart.setOption(option);
-  return chart;
-}
+import api from "@/api";
 
 export default {
   data() {
@@ -160,7 +58,15 @@ export default {
     };
   },
   onLoad(query) {
-    // this.query = query
+    this.query = {
+      ...query,
+      score: Number(query.score||0),
+    };
+    //登记成绩
+    // api.exam.studentScoreInfo({
+    //   type: "三力测试",
+    //   score: Number(query.score),
+    // });
   },
   onReady() {
     let that = this;
@@ -183,7 +89,131 @@ export default {
       });
   },
   methods: {
-    initChart,
+    initChart: async function initChart(canvas, width, height, dpr) {
+      let that = this;
+      const chart = echarts.init(canvas, null, {
+        width: width,
+        height: height,
+        devicePixelRatio: dpr, // new
+      });
+      canvas.setChart(chart);
+      let res = await api.exam.studentScoreInfoList({
+        type: "三力测试",
+        
+      });
+      let optionSeriesData0 = res.rows.map(item=>{
+        return item.score
+      })
+      optionSeriesData0.reverse()
+      console.log(res);
+      var option = {
+        color: ["#01C18D", "#00DDFF", "#37A2FF", "#FF0087", "#FFBF00"],
+        title: {
+          text: "",
+        },
+        toolbox: {
+          left: "center",
+          itemSize: 0,
+          top: 0,
+          feature: {
+            dataZoom: {
+              type:'inside',
+              xAxisIndex: 0,
+              start:0,
+              end:100
+            },
+          },
+        },
+        tooltip: {
+          trigger: "axis",
+          axisPointer: {
+            type: "cross",
+            label: {
+              backgroundColor: "#6a7985",
+            },
+          },
+        },
+        legend: {
+          data: [],
+        },
+
+        grid: {
+          left: "3%",
+          right: "4%",
+          bottom: "3%",
+          containLabel: true,
+        },
+        xAxis: [
+          {
+            type: "category",
+            boundaryGap: true,
+            axisLine: {
+              lineStyle: {
+                color: "#F0F0F0",
+              },
+            },
+          },
+        ],
+        yAxis: [
+          {
+            type: "value",
+            max: 100,
+            minInterval: 30,
+          },
+        ],
+        series: [
+          {
+            name: "Line 1",
+            type: "line",
+            stack: "Total",
+            smooth: false,
+            lineStyle: {
+              width: 2,
+            },
+            markLine: {
+              data: [
+                [
+                  {
+                    name: "及格线",
+                    yAxis: 90,
+                    x: "10%",
+                    label: {
+                      color: "#01C18D",
+                    },
+                  },
+                  {
+                    name: "及格线",
+                    yAxis: 90,
+                    x: "85%",
+                  },
+                ],
+              ],
+            },
+            showSymbol: true,
+            areaStyle: {
+              opacity: 0.8,
+              color: new echarts.graphic.LinearGradient(1, 0, 1, 1, [
+                {
+                  offset: 0,
+                  color: "#E1F8F1",
+                },
+                {
+                  offset: 1,
+                  color: "#FEFEFE",
+                },
+              ]),
+            },
+            emphasis: {
+              focus: "series",
+            },
+            data: optionSeriesData0,
+          },
+        ],
+      };
+
+      chart.setOption(option);
+      return chart;
+    },
     /**
      * @function 绘制半圆和分数
      * @param ctx {WechatMiniprogram.CanvasContext}
@@ -214,8 +244,8 @@ export default {
 
       //绘制渐变环
       ctx.moveTo(x1, y1);
-      let scoreColor1 = that.query.score>=90?"#01C18D":"#FF6D4E";
-      let scoreColor2 = that.query.score>=90?"#3ED2AA":"#FE3B2B";
+      let scoreColor1 = that.query.score >= 90 ? "#01C18D" : "#FF6D4E";
+      let scoreColor2 = that.query.score >= 90 ? "#3ED2AA" : "#FE3B2B";
 
       var arcColor = ctx.createLinearGradient(15, 125, 155, 125);
       arcColor.addColorStop(0, scoreColor1);
@@ -257,14 +287,21 @@ export default {
       ctx.textAlign = "center";
       ctx.font = "18px sans-serif";
       ctx.fillStyle = "#333333";
-      ctx.fillText(that.query.score>=90?"恭喜你,成绩合格!":"很遗憾,考试不合格!", x1, y1 + 40);
+      ctx.fillText(
+        that.query.score >= 90 ? "恭喜你,成绩合格!" : "很遗憾,考试不合格!",
+        x1,
+        y1 + 40
+      );
     },
   },
-  components: { ecCanva },
+  components: { ecCanvas },
 };
 </script>
 
 <style lang="less" scoped>
+.vh100{
+  height: 100vh;
+}
 .top {
   width: 750rpx;
   height: 726rpx;

+ 1 - 1
src/pages.json

@@ -532,7 +532,7 @@
         "query": "liceCar=1&liceTruck=&liceBus=&liceMoto=&name=&gs=xc&cert=C1/C2/C3&vehicle=轿车&subject=1&title=精选考题&sort=3"
       },
       {
-        "path": "otherPages/threeExamScore/index",
+        "path": "otherPages/threeExamScore/index?Score=90",
         "name": "三力测试结果页"
       },
       {

+ 3 - 3
src/pages/carVideo/index.vue

@@ -319,7 +319,7 @@ export default {
       name: "科目一",
       gs: "xc",
       cert: "C1/C2/C3",
-      vehicle: "轿车",
+      vehicle: "车",
       subject: 1,
       title: "顺序练习",
       sort: 3,
@@ -445,7 +445,7 @@ export default {
     carType: [
       {
         img: "https://ndata.zzxcx.net/ctjk/mp-wx/carVideo/xc.png",
-        typeName: "轿车",
+        typeName: "车",
         title: "C1/C2/C3",
       },
       {
@@ -599,7 +599,7 @@ export default {
       this.tabQuery.vehicle = item.typeName;
       this.tabQuery.cert = item.title;
       switch (item.typeName) {
-        case "轿车":
+        case "车":
           this.tabQuery.liceCar = 1;
           this.tabQuery.liceTruck = "";
           this.tabQuery.liceBus = "";

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini