Bladeren bron

修复手机号的bug

JXDS18FUJT 2 jaren geleden
bovenliggende
commit
ea987626fd

+ 0 - 1
src/api/modules/exam.js

@@ -193,7 +193,6 @@ const exam = {
 			params
 		})
 
-
 	},
 	//根据用户获取收藏数
 	studentQuestionCollectionCollectionCountByUser(params) {

+ 3 - 2
src/components/m-do-topic/m-do-topic.vue

@@ -1690,7 +1690,7 @@ export default {
         api.exam
           .studentQuestionInfoGetQuestionInfoByIds({
             ids: uni.getStorageSync(storageName)
-              ? uni.getStorageSync(storageName).map(item=>{return item.id})
+              ? uni.getStorageSync(storageName).map(item=>{return item.id}).reverse()
               : null,
           })
           .then((res) => {
@@ -1734,7 +1734,7 @@ export default {
         api.exam
           .studentQuestionInfoGetQuestionInfoByIds({
             ids: uni.getStorageSync(storageName)
-              ? uni.getStorageSync(storageName).map(item=>{return item.id})
+              ? uni.getStorageSync(storageName).map(item=>{return item.id}).reverse()
               : null,
           })
           .then((res) => {
@@ -1759,6 +1759,7 @@ export default {
                 }
               });
               element.isCompleted = false;
+              element.isCollect  = true;
               element.userAnswer = [];
             });
             that.problemListTotal = res.total;

+ 4 - 3
src/components/topbar/topbar.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="tabbar">
-		<view :style="{ 'margin-top': tophight.top + 'px', 'margin-bottom': '15rpx' }">
-			<view class="slot-box" :style="{'padding-left': `calc(100vw - ${tophight.right}px)`,'padding-right': `calc(100vw - ${tophight.left}px)`,height: tophight.height + 'px'}">
+		<view :style="{ 'padding-top': tophight.top + 'px', 'padding-bottom': '15rpx',width:'100%',textAlign:'center' }">
+			<view class="slot-box" :style="{'padding-left': `calc(100vw - ${tophight.right}px)`,width:'100%','padding-right': `calc(100vw - ${tophight.left}px)`,height: tophight.height + 'px'}">
 				<slot></slot>
 			</view>
 		</view>
@@ -23,7 +23,8 @@
 <style lang="scss" scoped>
 	.tabbar {
 		display: flex;
-		background-color: #FFFFFF;
+	
+		width: 750rpx;
 		.slot-box{
 			display: flex;
 			align-items: center;

+ 5 - 0
src/main.js

@@ -17,7 +17,12 @@ Vue.prototype.goPageGetData = utils.goPageGetData
 Vue.prototype.$utils = utils
 //挂载请求接口
 Vue.prototype.$api = api
+Vue.mixin({
+	methods: {
+		dynaImagePrefix: utils.dynaImagePrefix
 
+	}
+});
 const app = new Vue({
 	store,
 	...App

+ 21 - 3
src/otherPages/collection/index.vue

@@ -97,7 +97,7 @@
             :hover-stop-propagation="true"
             data-type="collect"
             @tap.stop="clearTopics('collect')"
-            style="color: #498ef5"
+            style="color: #00a748"
             class="clear"
           >
             清空收藏
@@ -110,7 +110,7 @@
                 collectSyncShow = true;
               }
             "
-            style="color: #498ef5"
+            style="color: #00a748"
             class="sync"
           >
             同步收藏
@@ -250,6 +250,24 @@ export default {
     //     this.wrongListCount = res.data;
     //   });
   },
+  onShow() {
+    let storageName1 =
+      uni.getStorageSync("userInfo").xcxOpenid +
+      "_userWrongIds_" +
+      this.query.subject;
+
+    let storageName2 =
+      uni.getStorageSync("userInfo").xcxOpenid +
+      "_userCollectionIds_" +
+      this.query.subject;
+
+    this.wrongListCount = uni.getStorageSync(storageName1)
+      ? uni.getStorageSync(storageName1).length
+      : 0;
+    this.collectionListCount = uni.getStorageSync(storageName2)
+      ? uni.getStorageSync(storageName2).length
+      : 0;
+  },
   methods: {
     syncCollectQuestion(e) {
       let select = e.detail.value;
@@ -418,7 +436,7 @@ export default {
         "_userCollectionIds_" +
         this.query.subject;
       let query = Object.assign({}, this.query);
-      console.log(query)
+      console.log(query);
       if (type == "wrong" && this.wrongListCount == 0) {
         uni.showToast({
           title: "没有题目了",

+ 2 - 1
src/otherPages/examRoadVideo/index.vue

@@ -115,7 +115,8 @@ export default {
     };
   },
   methods: {
-    getCurrentCity() {
+    getCurrentCity(e) {
+      console.log(e)
       // uni.choosePoi({
       //   success(res){
       //     console.log(res)

+ 200 - 0
src/otherPages/threeExam/index.vue

@@ -0,0 +1,200 @@
+<template>
+  <view class="threeExam">
+    <topbar>
+      <view class="nav">
+        <image
+          mode="widthFix"
+          class="leftArrow"
+          src="https://ct.zzxcx.net/ctjk/mp-wx/mockExamEnd/arrow-left.png"
+        ></image>
+        <text class="title">三力测试</text>
+      </view>
+    </topbar>
+    <view class="mid1">
+      <view class="mid1-line1">
+        <view class="mid1-line1-title">考试类型 </view>
+        <view class="mid1-line1-content"
+          ><view>小车(C1/C2)</view> <view>摩托车(D/E/F)</view>
+          <view>轻型牵引挂车(C6)</view>
+        </view>
+      </view>
+      <view class="mid1-line1">
+        <view class="mid1-line1-title">考试标准 </view>
+        <view class="mid1-line1-content"><view>20题,20分钟 </view> </view>
+      </view>
+      <view class="mid1-line1">
+        <view class="mid1-line1-title">合格标准 </view>
+        <view class="mid1-line1-content"
+          ><view>90分及格(满分100分) </view>
+        </view>
+      </view>
+      <view class="mid1-line1">
+        <view class="mid1-line1-title">出题规则 </view>
+        <view class="mid1-line1-content"
+          ><view>根据公安部出题规则组卷</view>
+        </view>
+      </view>
+      <view class="mid1-line2">
+        <view class="mid1-line2-content">
+          温馨提示:考试模式不能修改答案,每错1题扣5分,错题累计超过2题,考试不能通过,系统自动提醒交卷。
+        </view>
+      </view>
+      <view class="mid1-submit">
+        <view class="mid1-submit-begin"> 开始考试</view>
+        <view class="mid1-submit-continue">继续练习</view>
+      </view>
+    </view>
+    <view class="mid2">
+      <view class="mid2-line1">
+        <image
+          class="mid2-line1-icon"
+          src="https://ct.zzxcx.net/ctjk/mp-wx/threeExam/%E9%97%AE%E5%8F%B7%402x.png"
+          mode="widthFix"
+        ></image>
+        <text style="color: #498ef5; font-size: 34rpx">什么是三力测试?</text>
+      </view>
+      <view class="mid2-line2">
+        “三力”测试是指70周岁以上的人群申领小型汽车、小型自动档汽车、轻便摩托车的驾照时需要增加记忆力、判断力、反应力的测试,
+        只有测试通过的才可报名。“三力”测试内容为驾驶理论,考生将随机抽取20道题(10道判断题、10道选择题),20分钟完成作答,
+        满分100分,90分合格,未通过的可以在三个月内补测两侧。
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {};
+  },
+  methods: {
+    name() {},
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.threeExam {
+  background: url("https://ct.zzxcx.net/ctjk/mp-wx/threeExam/bg.png");
+  background-size: 100%;
+  background-repeat: no-repeat;
+  padding-bottom: constant(safe-area-inset-bottom);
+  padding-bottom: env(safe-area-inset-bottom);
+  .nav {
+    width: 100%;
+    height: 100%;
+    position: relative;
+    display: flex;
+    align-items: center;
+    .leftArrow {
+      width: 18rpx;
+      position: absolute;
+      left: 30rpx;
+    }
+    .title {
+      position: absolute;
+      left: 50%;
+    }
+  }
+  .mid1 {
+    width: 690rpx;
+    padding-bottom: 60rpx;
+    background: #fff;
+    margin: 0 auto;
+    padding-top: 60rpx;
+
+    box-shadow: 0px 0px 12px 2px rgba(0, 0, 0, 0.1);
+    .mid1-line1 {
+      display: flex;
+
+      flex-direction: row;
+      margin-bottom: 38rpx;
+      padding: 0 30rpx;
+      padding-top: 40rpx;
+      padding-bottom: 30rpx;
+
+      .mid1-line1-title {
+        width: 270rpx;
+        padding-right: 66rpx;
+        text-align: right;
+        color: #8a9099;
+        font-size: 30rpx;
+      }
+      .mid1-line1-content {
+        width: 412rpx;
+        padding-right: 30rpx;
+        text-align: left;
+        font-size: 30rpx;
+        color: #5c6066;
+      }
+    }
+    .mid1-line2 {
+      padding: 0 30rpx;
+      margin-top: 28rpx;
+
+      .mid1-line2-content {
+        background: rgba(255, 77, 83, 0.1);
+        color: #ff4d53;
+        padding: 15rpx;
+        font-size: 26rpx;
+      }
+    }
+    .mid1-submit {
+      margin-top: 60rpx;
+      display: flex;
+      justify-content: center;
+      flex-wrap: wrap;
+      .mid1-submit-begin {
+        width: 532rpx;
+        height: 80rpx;
+        background: #498ef5;
+        border-radius: 40px 40px 40px 40px;
+        opacity: 1;
+        color: #fff;
+        line-height: 80rpx;
+        text-align: center;
+      }
+      .mid1-submit-continue {
+        width: 532rpx;
+        height: 80rpx;
+        line-height: 80rpx;
+        border-radius: 40rpx 40rpx 40rpx 40rpx;
+        opacity: 1;
+        border: 2rpx solid #498ef5;
+        margin-top: 40rpx;
+        color: #498ef5;
+        text-align: center;
+      }
+    }
+  }
+  .mid2 {
+    width: 690rpx;
+    background: #fff;
+    margin: 0 auto;
+    margin-top: 30rpx;
+    box-shadow: 0px 0px 12px 2px rgba(0, 0, 0, 0.1);
+    padding-top: 40rpx;
+    padding-bottom: 40rpx;
+    .mid2-line1 {
+      display: flex;
+
+      padding-bottom: 30rpx;
+      padding-left: 30rpx;
+      padding-right: 30rpx;
+      align-content: center;
+      align-items: center;
+      .mid2-line1-icon {
+        width: 58rpx;
+        margin-right: 16rpx;
+      }
+    }
+    .mid2-line2 {
+      width: 630rpx;
+      margin: 0 auto;
+      background: #f2f3f5;
+      color: #5c6066;
+      padding: 20rpx;
+    }
+  }
+}
+</style>

+ 11 - 0
src/pages.json

@@ -47,6 +47,7 @@
         "enablePullDownRefresh": false
       }
     },
+    
     {
       "path": "pages/lightMock/index",
       "style": {
@@ -225,6 +226,12 @@
             "navigationStyle": "custom"
           }
         },
+        {
+          "path": "threeExam/index",
+          "style": {
+            "navigationStyle": "custom"
+          }
+        },
         {
           "path": "courseCatalog/index",
           "styles": {
@@ -479,6 +486,10 @@
         "name": "分类练习",
         "query": "liceCar=1&liceTruck=&liceBus=&liceMoto=&name=&gs=xc&cert=C1/C2/C3&vehicle=轿车&subject=1&title=精选考题&sort=3"
       },
+      {
+        "path": "otherPages/threeExam/index",
+        "name": "三力测试"
+      },
       {
         "path": "otherPages/examRoadVideo/index",
         "name": "道路视频"

+ 29 - 19
src/pages/user/index.vue

@@ -7,7 +7,7 @@
             @click="
               () => {
                 userFormShow = true;
-                nickName = userInfo.nickName||'新用户';
+                nickName = userInfo.nickName || '新用户';
               }
             "
             class="userButton"
@@ -27,11 +27,19 @@
                 userInfo.nickName || "新用户"
               }}</view>
               <view style="font-size: 26rpx; color: #8a9099; width: 100%">
-                {{ "点击绑定手机号" }}</view
+                {{ userInfo.phone || "点击绑定手机号" }}</view
               >
             </view>
           </view>
         </van-cell>
+        <van-cell
+          title-class="uni-app-fontsize-paragraph"
+          title="三力测试"
+          is-link
+          center
+          url="/otherPages/threeExam/index"
+        >
+        </van-cell>
 
         <!-- <van-cell title="我要提现" value="" is-link center @click="goCashOut">
         </van-cell> -->
@@ -165,7 +173,11 @@
             </van-field>
           </view>
           <view class="userform-bind">
-            <van-button @click="sendUserInfo" custom-style="width:690rpx;" round type="primary"
+            <van-button
+              @click="sendUserInfo"
+              custom-style="width:690rpx;"
+              round
+              type="primary"
               >修改用户信息</van-button
             >
           </view>
@@ -211,28 +223,25 @@ export default {
     this.$store.dispatch("GetInfo");
   },
   methods: {
-    sendUserInfo(){
-      api.user.userInfoUserInfo({
-        nickName:this.nickName,
-        phone:this.phone
-      }).then(res=>{
-        this.userFormShow=false
+    sendUserInfo() {
+      api.user.userInfoUserInfo(this.userInfo).then((res) => {
+        this.userFormShow = false;
         this.$store.dispatch("GetInfo");
-      })
-
+      });
     },
     changeUserName(e) {
       console.log(e);
-      this.nickName = e.detail;
+      this.userInfo.nickName = e.detail;
     },
     getPhoneByUser(e) {
       console.log(e);
-      api.user.userInfoGetPhoneByCode({
-        code:e.detail.code
-      }).then(res=>{
-        this.phone = res.data
-        
-      })
+      api.user
+        .userInfoGetPhoneByCode({
+          code: e.detail.code,
+        })
+        .then((res) => {
+          this.userInfo.phone = res.data;
+        });
     },
     goPath(url) {
       uni.navigateTo({
@@ -289,8 +298,9 @@ export default {
 <style lang="scss" scoped>
 .userform {
   width: 100%;
-  height: 320rpx;
+  height: 450rpx;
   background: #fff;
+
   .userform-close {
     text-align: right;
     padding-right: 15rpx;

+ 4 - 1
src/utils/index.js

@@ -8,7 +8,10 @@ import route from './modules/route.js'
 dayjs.locale('zh-cn')
 
 let goMiniAppFlag = false
-let imagePrefix = 'https://ct.zzxcx.net/ctjk/mp-wx/'
+let imagePrefix = ''
+setTimeout(()=>{
+	imagePrefix="https://ct.zzxcx.net/ctjk/mp-wx/"
+},500)
 const utils = {
 	dynaImagePrefix(src){
 		return imagePrefix+src