Эх сурвалжийг харах

顺序练习和分类练习设计中

zhangyujun 3 жил өмнө
parent
commit
078881d39c

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

@@ -0,0 +1,20 @@
+import request from '../request'
+
+const exam={
+	/**
+	 * 逆地理编码
+	 * @param {
+		 location: string '经纬度坐标:经度在前,纬度在后,经纬度间以“,”分割'
+		 ...其他参数去高德官网看
+	 } params
+	 */
+     studentQuestionInfoSelectSxQuestionInfo(params) {
+		return request({
+			url: 'student/question/info/selectSxQuestionInfo',
+			method: 'get',
+			params
+		})
+	}
+}
+
+export default exam

+ 159 - 0
src/otherPages/classifyOrder/index.vue

@@ -0,0 +1,159 @@
+<template>
+  <view class="bg-white">
+    <div class="cell-box">
+      <van-cell
+        value-class="custom-right-cell"
+        class="cell"
+        :title="
+          item.placeIssueName ||
+          item.classIssueName ||
+          item.excellIssueName ||
+          item.sequeIssueName
+        "
+        center
+        v-for="(item, index) in classData"
+        :key="index"
+        :border="false"
+      >
+        <div class="select">
+          <div
+            class="select-item0"
+            @click="
+              () => {
+                push({
+                  name: 'exercise',
+                  query: {
+                    ...query,
+                    classIssueName: item.classIssueName,
+                    placeIssueName: item.placeIssueName,
+                    excellIssueName: item.excellIssueName,
+                    sequeIssueName: item.sequeIssueName,
+                    placeIssue: item.placeIssue,
+                    classIssue: item.classIssue,
+                    excellIssue: item.excellIssue,
+                    sequeIssue: item.sequeIssue,
+                  },
+                });
+              }
+            "
+          >
+            语音讲解
+          </div>
+          <div
+            @click="
+              () => {
+                push({
+                  name: 'exerciseStrict',
+                  query: {
+                    ...query,
+                    classIssueName: item.classIssueName,
+                    placeIssueName: item.placeIssueName,
+                    excellIssueName: item.excellIssueName,
+                    sequeIssueName: item.sequeIssueName,
+                    placeIssue: item.placeIssue,
+                    classIssue: item.classIssue,
+                    excellIssue: item.excellIssue,
+                    sequeIssue: item.sequeIssue,
+                  },
+                });
+              }
+            "
+            class="select-item1"
+          >
+            单项测试
+          </div>
+        </div>
+        <template #icon>
+          <div class="icon">{{ index + 1 }}</div>
+        </template>
+      </van-cell>
+    </div>
+  </view>
+</template>
+
+<script>
+import api from '@/api/index'
+export default {
+  data() {
+    return {
+      classData: [
+  
+      ],
+      query:{
+
+      }
+    };
+  },
+  methods: {
+    name() {},
+  },
+  onLoad(op){
+    this.query = op
+  },
+  mounted () {
+    api.exam.studentQuestionInfoSelectSxQuestionInfo(this.query).then(res=>{
+      this.classData = res.data
+
+    });
+  },
+};
+</script>
+<style>
+.custom-right-cell {
+  flex: 1.2 !important;
+}
+</style>
+
+<style lang="scss" scoped>
+.bg-white{
+    background: #ffffff;
+}
+.cell-box {
+  display: flex;
+  padding: 5px 15px;
+  flex-wrap: wrap;
+  justify-content: space-between;
+  .cell {
+    width: 100%;
+    border-bottom: 1px solid #ddd;
+    line-height: 28px;
+
+    // box-shadow: 0px 0px 10px rgba(124, 129, 136, 0.2);
+  }
+  .select {
+    display: flex;
+    flex-direction: row;
+    color: white;
+    flex: 1.2;
+
+    .select-item0 {
+      padding: 0 12px;
+      background: #498ef5;
+      margin-right: 10px;
+      border-radius: 8px;
+      font-size: 12px;
+    }
+
+    .select-item1 {
+      padding: 0 12px;
+      background: #06bd5e;
+      font-size: 12px;
+      border-radius: 8px;
+    }
+  }
+  .icon {
+    width: 20px;
+    height: 20px;
+    background: #498ef5;
+    border-radius: 50%;
+    font-weight: 500;
+    font-family: PingFang SC;
+    font-size: 13px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    color: #ffffff;
+    margin-right: 5px;
+  }
+}
+</style>

+ 6 - 2
src/pages.json

@@ -183,8 +183,8 @@
     {
       "path": "pages/user/index",
       "style": {
-        "navigationBarTitleText": "",
-        "navigationStyle": "custom"
+        "navigationBarTitleText": "用户信息"
+        
       }
     },
     {
@@ -214,6 +214,10 @@
           "path": "code/index",
           "styles": {}
         },
+        {
+          "path": "classifyOrder/index",
+          "styles": {}
+        },
         {
           "path": "buyVip/index",
           "styles": {

+ 8 - 0
src/pages/carVideo/components/tabCenter.vue

@@ -13,6 +13,14 @@ export default {
     return {};
   },
   props: {
+    query:{
+      type:Object,
+      default:()=>{
+        return {
+          
+        }
+      }
+    },
     centerList: {
       type: Array,
       default: () => {

+ 14 - 5
src/pages/carVideo/components/tabLeft.vue

@@ -8,6 +8,7 @@
 </template>
 
 <script>
+import utils from "@/utils/index";
 export default {
   data() {
     return {};
@@ -16,8 +17,10 @@ export default {
     goPath(item) {
       console.log(item);
       if (item.path) {
+        let str = utils.mapToUrlQuery(this.query);
+        console.log(item.path + "?" + str,'str')
         uni.navigateTo({
-          url: item.path,
+          url: item.path + "?" + str,
         });
       }
     },
@@ -29,10 +32,16 @@ export default {
         return [];
       },
     },
-    subject:{
-      type:Number,
-      default:1
-    }
+    query: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+    subject: {
+      type: Number,
+      default: 1,
+    },
   },
 };
 </script>

+ 56 - 6
src/pages/carVideo/index.vue

@@ -49,7 +49,11 @@
       </swiper>
     </view>
     <view class="carType">
-      <view v-for="(item, index) in carType" :key="index">
+      <view
+        v-for="(item, index) in carType"
+        @click="changeVehicle(item)"
+        :key="index"
+      >
         <view
           @click="
             () => {
@@ -87,14 +91,26 @@
         class="custom-tabs"
         :active="active"
         id="tabs"
-        bind:change="onChange"
+        @change="changeSubject"
         :sticky="true"
       >
         <van-tab title="科目一">
           <view class="tab-container">
-            <tab-left :subject="1" :leftList="leftList1"></tab-left>
-            <tab-center :subject="1" :centerList="centerList1"></tab-center>
-            <tab-right :subject="1" :rightList="rightList1"></tab-right>
+            <tab-left
+              :subject="1"
+              :query="tabQuery"
+              :leftList="leftList1"
+            ></tab-left>
+            <tab-center
+              :subject="1"
+              :query="tabQuery"
+              :centerList="centerList1"
+            ></tab-center>
+            <tab-right
+              :subject="1"
+              :query="tabQuery"
+              :rightList="rightList1"
+            ></tab-right>
           </view>
         </van-tab>
         <van-tab title="科目二">
@@ -139,6 +155,7 @@ import tabRight from "./components/tabRight.vue";
 import TabCenter from "./components/tabCenter.vue";
 import VideoListBox from "./components/videoListBox.vue";
 import userInfoHead from "./components/userInfoHead.vue";
+import utils from '@/utils/index'
 export default {
   components: {
     shortVideo,
@@ -151,6 +168,15 @@ export default {
     userInfoHead,
   },
   data: () => ({
+    tabQuery: {
+      carType: "liceCar",
+      name: "科目一",
+      cert: "C1/C2/C3",
+      vehicle: "轿车",
+      subject: 1,
+      title: "顺序练习",
+      sort: 3,
+    },
     //科目一
     rightList1: [
       {
@@ -188,7 +214,7 @@ export default {
       {
         img: "https://t1-1305573081.file.myqcloud.com/wxapp/static/imgs/home/SequentialPractice@2x.png",
         text: "顺序练习",
-        path: "/pages/classifyOrder/index",
+        path: "/otherPages/classifyOrder/index",
       },
       {
         img: "https://t1-1305573081.file.myqcloud.com/wxapp/static/imgs/home/ClassificationExercise@2x.png",
@@ -357,6 +383,30 @@ export default {
     });
   },
   methods: {
+    changeVehicle(item) {
+      this.tabQuery.vehicle = item.typeName;
+      this.tabQuery.cert = item.title;
+      switch (item.typeName) {
+        case "轿车":
+          this.tabQuery.carType = "liceCar";
+          break;
+        case "货车":
+          this.tabQuery.carType = "liceTruck";
+          break;
+        case "客车":
+          this.tabQuery.carType = "liceBus";
+          break;
+        case "摩托车":
+          this.tabQuery.carType = "liceMoto";
+          break;
+        default:
+          break;
+      }
+    },
+    changeSubject(e) {
+      this.tabQuery.subject = e.detail.index + 1;
+      this.tabQuery.name = e.detail.title;
+    },
     goLightMock(e) {
       uni.navigateTo({
         url: "/pages/lightMock/index",

+ 15 - 108
src/pages/classifyOrder/index.vue

@@ -72,124 +72,31 @@
 </template>
 
 <script>
+import api from '@/api/index'
 export default {
   data() {
     return {
       classData: [
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: null,
-          sequeIssueName: "地方专题",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "1",
-          sequeIssueName: "技巧一",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "2",
-          sequeIssueName: "技巧二",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "3",
-          sequeIssueName: "技巧三",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "4",
-          sequeIssueName: "技巧四",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "5",
-          sequeIssueName: "交警信号",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "6",
-          sequeIssueName: "交通标线",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "7",
-          sequeIssueName: "机械仪表",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "8",
-          sequeIssueName: "扣分罚款",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "9",
-          sequeIssueName: "禁令标志",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "10",
-          sequeIssueName: "警告标志",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "11",
-          sequeIssueName: "指示标志",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "12",
-          sequeIssueName: "指路标志",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "13",
-          sequeIssueName: "灯光使用",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "14",
-          sequeIssueName: "救援毒品",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "15",
-          sequeIssueName: "驾驶证相关",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "16",
-          sequeIssueName: "基础补充",
-        },
-        {
-          createTime: null,
-          updateTime: null,
-          sequeIssue: "18",
-          sequeIssueName: "4月新规题",
-        },
+  
       ],
+      query:{
+
+      }
     };
   },
   methods: {
     name() {},
   },
+  onLoad(option){
+    this.query = option
+
+  },
+  mounted () {
+    api.exam.studentQuestionInfoSelectSxQuestionInfo(this.query).then(res=>{
+      this.classData = res.data
+
+    });
+  },
 };
 </script>
 <style>

+ 94 - 168
src/pages/user/index.vue

@@ -1,178 +1,104 @@
 <template>
-	<scroll-view scroll-y class="content">
-		<view class="top">
-			<view class="avabox">
-				<van-image round class="img" width="200rpx" height="200rpx" :src="userData.headImage" />
-				<view class="avatitbox">
-					<text>{{ userData.nickName }}</text>
-					<text v-if="userData.gzptUserId">{{ studentInfo.logincode }}</text>
-					<view class="sync-btn" @tap="getUserProfile">点击同步用户头像昵称</view>
-				</view>
-			</view>
-		</view>
-
-		<view class="serviceBox">
-			<view class="tit">
-				<text>我的订单</text>
-			</view>
-			<view class="btnBox">
-				<view class="item-box" :plain="true" @click="$utils.goPage('/pages/user/order?active=0')">
-					<m-icon type="qbdd" font-size='22px' />
-					<text class="text">全部订单</text>
-				</view>
-				<view class="item-box" :plain="true" @click="$utils.goPage('/pages/user/order?active=1')">
-					<m-icon type="dfh" font-size='22px' />
-					<text class="text">等待发货</text>
-				</view>
-				<view class="item-box" :plain="true" @click="$utils.goPage('/pages/user/order?active=2')">
-					<m-icon type="jywc" font-size='22px' />
-					<text class="text">交易完成</text>
-				</view>
-				<view class="item-box" :plain="true" @click="$utils.goPage('/pages/user/order?active=3')">
-					<m-icon type="tksh" font-size='22px' />
-					<text class="text">退款/售后</text>
-				</view>
-			</view>
-		</view>
-
-		<view class="serviceBox">
-			<view class="tit">
-				<text>我的信息</text>
-			</view>
-			<van-cell title="我的设置" is-link @tap="$utils.goPage('/pages/user/set')">
-				<m-icon slot="icon" type="shezhi" color="#d81e06"/>
-			</van-cell>
-			<button class="server" open-type="feedback" :plain="true">
-				<van-cell title="意见反馈" is-link>
-					<m-icon slot="icon" type="yjfk" color="#d81e06"/>
-				</van-cell>
-			</button>
-			<button class="server" open-type="contact" :plain="true">
-				<van-cell title="联系客服" is-link>
-					<m-icon slot="icon" type="lxkf" color="#d81e06"/>
-				</van-cell>
-			</button>
-		</view>
-
-		<!-- <view class="ad-box serviceBox">
+  <scroll-view scroll-y class="content">
+    <div class="user">
+      <van-cell  center :value="userInfo.nickName" @click="showVConsole">
+        <view slot="title">
+         <image class="user-headImg" :src="userInfo.headImage"></image>
+        </view>
+      </van-cell>
+      <van-cell-group class="group">
+        <van-cell title="我要提现" value="" is-link center @click="goCashOut">
+        </van-cell>
+        <!-- <van-cell title="我的下级" value="" is-link center @click="goMyBranch">
+				<template #icon>
+					<m-icon type="hyyxq" class="cell-icon" />
+				</template>
+			</van-cell> -->
+        <van-cell
+          title="我的推广积分"
+          value=""
+          is-link
+          center
+          @click="goMyIntegral"
+        >
+        </van-cell>
+        <van-cell
+          title="会员有效期"
+          :value="expireTime ? expireTime : '开通会员'"
+          is-link
+          center
+          url="/otherPages/buyVip/index"
+        >
+        </van-cell>
+      </van-cell-group>
+      <van-cell-group class="group">
+        <van-cell
+          title="反馈帮助"
+          is-link
+          center
+          url="/pages/webview/webview?src=https://support.qq.com/product/359609"
+        >
+          <template #icon>
+            <m-icon type="fkbz" class="cell-icon" />
+          </template>
+        </van-cell>
+      </van-cell-group>
+    </div>
+
+    <!-- <view class="ad-box serviceBox">
 			<ad unit-id="adunit-d8c1548cc9663765"></ad>
 		</view> -->
-		
-	</scroll-view>
+  </scroll-view>
 </template>
 
 <script>
-	export default {
-		computed: {
-			userData() {
-				return this.$store.state.user.userInfo;
-			},
-		},
-		mounted() {
-			this.$store.dispatch("GetInfo");
-		},
-		methods: {
-			async getUserProfile(e) {
-				let userInfo = await wx.getUserProfile({
-					desc: "业务需要",
-				});
-				let updateRes = await this.$api.user.updateUserInfo({
-					headImage: userInfo.userInfo.avatarUrl,
-					nickName: userInfo.userInfo.nickName,
-				});
-				if (updateRes.code == 200) {
-					uni.setStorageSync("userInfo",userInfo.userInfo)
-					this.$store.state.user.userInfo.headImage = userInfo.userInfo.avatarUrl;
-					this.$store.state.user.userInfo.nickName = userInfo.userInfo.nickName;
-				}
-			},
-		},
-	};
+export default {
+  computed: {
+    userInfo() {
+      return this.$store.state.user.userInfo;
+    },
+  },
+  mounted() {
+    this.$store.dispatch("GetInfo");
+  },
+  methods: {
+    async getUserProfile(e) {
+      let userInfo = await wx.getUserProfile({
+        desc: "业务需要",
+      });
+      let updateRes = await this.$api.user.updateUserInfo({
+        headImage: userInfo.userInfo.avatarUrl,
+        nickName: userInfo.userInfo.nickName,
+      });
+      if (updateRes.code == 200) {
+        uni.setStorageSync("userInfo", userInfo.userInfo);
+        this.$store.state.user.userInfo.headImage = userInfo.userInfo.avatarUrl;
+        this.$store.state.user.userInfo.nickName = userInfo.userInfo.nickName;
+      }
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.content {
-		height: 100%;
-		background-image: url("https://t1-1305573081.cos.ap-shanghai.myqcloud.com/wxapp/static/imgs/%E9%A1%B6%E9%83%A8%E8%83%8C%E6%99%AF3.png");
-		background-repeat: no-repeat;
-		background-size: 100% 90%;
-	}
-
-	.ad-box {
-		margin: 40rpx;
-		padding: 20rpx;
-		display: flex;
-		justify-content: center;
-		align-items: center;
-	}
-
-	.top {
-		padding-top: 100rpx;
-
-		.avabox {
-			display: flex;
-			padding: 10%;
-
-			.img {
-				border-radius: 50%;
-			}
-
-			.sync-btn {
-				margin-top: 20rpx;
-				height: 40rpx;
-			}
-
-			.avatitbox {
-				flex: 1;
-				display: flex;
-				flex-direction: column;
-				justify-content: space-between;
-				padding: 30rpx;
-				color: #ffffff;
-				height: 100rpx;
-			}
-		}
-	}
-
-	.serviceBox {
-		background-color: #fff;
-		margin: 30rpx;
-		border-radius: 10rpx;
-
-		.tit {
-			padding: 16rpx 26rpx;
-			border-bottom: 1rpx solid #e8e8e8;
-		}
-
-		.btnBox {
-			display: flex;
-			justify-content: space-around;
-			align-items: center;
-
-			.item-box {
-				display: flex;
-				flex-direction: column;
-				justify-content: space-around;
-				align-items: center;
-				padding: 20rpx;
-				border: none;
-
-				.text {
-					font-size: 26rpx;
-					font-family: PingFang SC;
-					font-weight: 400;
-					color: #666666;
-				}
-			}
-		}
-
-		.server {
-			border: none;
-			background-color: none;
-			margin: 0;
-			padding: 0;
-			text-align: left;
-			display: flexbox;
-		}
-	}
+.user {
+  background-color: #f2f3f5;
+  /* height: 100vh; */
+  .group {
+    margin: 10px 0;
+  }
+  .user-avatar {
+    width: 46px;
+    height: 46px;
+    margin-right: 10px;
+  }
+}
+.user-headImg{
+	width: 90rpx;
+	height: 90rpx;
+	border-radius: 50%;
+}
+.cell-icon {
+  margin-right: 5px;
+}
 </style>

+ 19 - 4
src/utils/index.js

@@ -10,6 +10,21 @@ dayjs.locale('zh-cn')
 let goMiniAppFlag = false
 
 const utils = {
+	mapToUrlQuery(map) {
+		let str = ""
+		if (typeof map !== 'object') {
+			return false
+		}
+		for (const key in map) {
+			if (Object.hasOwnProperty.call(map, key)) {
+				str += (key + "=" + map[key])+"&"
+
+			}
+		}
+		// console.log(str)
+		return str
+
+	},
 	//生成二维码图片
 	async qrcodeGenerate(data) {
 		let qrcodeRes = await QRCode.toString(data, {
@@ -28,7 +43,7 @@ const utils = {
 	testReq(data) {
 		return request(data)
 	},
-	
+
 	//vant通知组件调用函数
 	Toast(title) {
 		wx.showToast({
@@ -91,7 +106,7 @@ const utils = {
 		}
 		uni.navigateTo({
 			url,
-			success: function(res) {
+			success: function (res) {
 				// 通过eventChannel向被打开页面传送数据
 				res.eventChannel.emit('passParameters', data)
 			}
@@ -101,7 +116,7 @@ const utils = {
 	goPageGetData() {
 		return new Promise((res) => {
 			const eventChannel = this.getOpenerEventChannel()
-			eventChannel.on('passParameters', function(data) {
+			eventChannel.on('passParameters', function (data) {
 				res(data)
 			})
 		})
@@ -142,4 +157,4 @@ const utils = {
 }
 
 
-export default utils
+export default utils