瀏覽代碼

修改用户中心中

zhangyujun 3 年之前
父節點
當前提交
17e972f873

+ 28 - 0
src/api/modules/buy.js

@@ -0,0 +1,28 @@
+import request from '../request'
+
+const buy={
+	/**
+	 * 逆地理编码
+	 * @param {
+		 location: string '经纬度坐标:经度在前,纬度在后,经纬度间以“,”分割'
+		 ...其他参数去高德官网看
+	 } params
+	 */
+    //微信支付的接口
+     studentXcxWxPrepareOrder(data) {
+		return request({
+			url: '/student/xcx/wx/prepareOrder',
+			method: 'POST',
+			data
+		})
+	},
+    //查询商品字典的接口
+    systemDictDataType(dictType){
+        return request({
+            url:'/system/dict/data/type/'+dictType,
+            method:'GET'
+        })
+    }
+}
+
+export default buy

+ 2 - 2
src/api/modules/carVideo.js

@@ -77,7 +77,7 @@ class CarVideo {
 	 */
 	async getTreeList() {
 		let res = await request({
-			url: `open-api/teachingVideo/info/treeList`
+			url: `https://zzjs.zzxcx.net/prod-api/open-api/teachingVideo/info/treeList`
 		})
 
 
@@ -130,4 +130,4 @@ class CarVideo {
 }
 
 
-export default new CarVideo
+export default new CarVideo

+ 6 - 5
src/api/modules/open.js

@@ -1,5 +1,6 @@
 import request from '../request'
-const openBaseUrl = process.env.NODE_ENV==='development'?"https://jpcj-admin1.zzxcx.net/twzd-admin/open-api":"https://jpcj-admin.zzxcx.net/twzd-admin/open-api"
+//金牌车教的open api
+const openBaseUrl1 = process.env.NODE_ENV==='development'?"https://jpcj-admin1.zzxcx.net/twzd-admin/open-api":"https://jpcj-admin.zzxcx.net/twzd-admin/open-api"
 const open = {
     //open-api/teachingVideo/info/treeList
     //获取视频列表
@@ -12,7 +13,7 @@ const open = {
     },
     questionInfoSelectTestQuestionInfo(params) {
         return request({
-            url: openBaseUrl+"/question/info/selectTestQuestionInfo",
+            url: "/open-api/question/info/selectTestQuestionInfo",
             method: "GET",
             params
         })
@@ -20,19 +21,19 @@ const open = {
     },
     lightingCombinationList() {
         return request({
-            url: openBaseUrl+"/lighting/combination/list",
+            url: "/open-api/lighting/combination/list",
             method: "GET"
         })
     },
     lightingCombinationId(id) {
         return request({
-            url: openBaseUrl+"/lighting/combination/" + id,
+            url: "/open-api/lighting/combination/" + id,
             method: "GET",
         })
     },
     lightingItemList(){
         return request({
-            url: openBaseUrl+"/lighting/item/list",
+            url: "/open-api/lighting/item/list",
             method: "GET",
         })
     }

+ 4 - 4
src/api/modules/user.js

@@ -8,7 +8,7 @@ const user = {
 	async login() {
 		let res = await wx.login()
 		return request({
-			url: '/login/jscode',
+			url: 'https://jpcj-admin1.zzxcx.net/twzd-admin/login/jscode',
 			method: 'post',
 			params: {
 				jscode: res.code
@@ -24,7 +24,7 @@ const user = {
 	 */
 	updateUserInfo(data) {
 		return request({
-			url: '/student/user/info',
+			url: '/student/xcx/user',
 			method: 'post',
 			data
 		})
@@ -34,7 +34,7 @@ const user = {
 	 */
 	getInfo() {
 		return request({
-			url: '/getInfo',
+			url: '/student/user/info',
 			method: 'get'
 		})
 	},
@@ -60,4 +60,4 @@ const user = {
 	}
 }
 
-export default user
+export default user

+ 2 - 2
src/api/request.js

@@ -11,8 +11,8 @@ const baseUrl = 'https://zzjs.zzxcx.net/prod-api';
 // 创建axios实例
 const service = axios.create({
 	// axios中请求配置有baseURL选项,表示请求URL公共部分
-	// baseURL: process.env.VUE_APP_BASE_API,
-	baseURL: baseUrl,
+	baseURL: process.env.NODE_ENV==='development'?'https://jpcj-admin1.zzxcx.net/twzd-admin':'https://jpcj-admin.zzxcx.net/twzd-admin',
+	// baseURL: baseUrl,
 })
 mock.init(service)
 

二進制
src/assets/img/diamond.png


二進制
src/assets/img/diamond_gray.png


二進制
src/assets/img/subject1@2x.png


二進制
src/assets/img/subject4@2x.png


+ 124 - 0
src/components/m-video-row2/m-video-row2.vue

@@ -0,0 +1,124 @@
+<template>
+  <view>
+    <van-cell
+      @click="clickCell"
+      :title="carVideoList.chapterName"
+      is-link
+      value="更多"
+    />
+    <!-- <view class="cell">
+			<text class="item-tit">{{carVideoList.chapterName}}</text>
+			<view class="right-box" @click='clickCell'>
+				<text class="item-tit-right">更多</text>
+				<m-icon type="arrow-right"></m-icon>
+			</view>
+		</view> -->
+    <view class="video-box" v-if="type == 'top-bottom'">
+      <m-video-topbottom
+        class="custom-video-topbottom"
+        :column="column"
+        :carVideoItem="item"
+        v-for="(item, index) in showList"
+        :key="index"
+        :palyObj="palyObj"
+        @click="returnData(item)"
+      />
+    </view>
+    <view class="video-box" v-if="type == 'left-right'">
+      <m-video-leftright
+        @click="returnData(item)"
+        :palyObj="palyObj"
+        :carVideoItem="item"
+        v-for="(item, index) in showList"
+        :key="index"
+      />
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  props: {
+    type: {
+      type: String,
+      default: "top-bottom",
+    },
+    column: {
+      type: Number,
+      default: 2,
+    },
+    carVideoList: {
+      type: Object,
+      default: {},
+    },
+    palyObj: {
+      type: Object,
+      default: null,
+    },
+  },
+  name: "m-video-box",
+  computed: {
+    showList() {
+      return this.carVideoList.list;
+    },
+  },
+  methods: {
+    returnData(item) {
+      if (this.palyObj) {
+        this.$emit("update:palyObj", item);
+      }
+    },
+    clickCell() {
+      this.$utils.route.goPage("/pages/carVideo/more", null, {
+        carVideoList: this.carVideoList,
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.cell {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  background-color: #ffffff;
+  padding: 10rpx 20rpx;
+  border-bottom: 1rpx solid #e8e8e8;
+
+  .item-tit {
+    border-left: 8rpx solid #e31818;
+    font-size: 30rpx;
+    font-weight: 400;
+    padding: 5rpx;
+  }
+
+  .right-box {
+    display: flex;
+    align-items: center;
+
+    .item-tit-right {
+      font-size: 26rpx;
+      color: #666666;
+      line-height: 58rpx;
+      padding: 11rpx;
+    }
+  }
+}
+
+.video-box {
+  background-color: #ffffff;
+  display: flex;
+  flex-wrap: wrap;
+  width: 690rpx;
+  margin-left: auto;
+  margin-right: auto;
+  margin-bottom: 30rpx;
+  z-index: 0;
+  justify-content: space-between;
+  .custom-video-topbottom ::v-deep .video-item {
+    margin-right: 0;
+    margin-bottom: 0;
+  }
+}
+</style>

+ 2 - 2
src/components/m-video-topbottom/m-video-topbottom.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="video-item" :style="{width: `${(750-30*column-30)/column}rpx`}"
+	<view class="video-item ^video-item" :style="{width: `${(750-30*column-30)/column}rpx`}"
 		@click="gotoPaly">
 		<view class="image-box">
 			<view class="img-box">
@@ -95,4 +95,4 @@
 			overflow: hidden;
 		}
 	}
-</style>
+</style>

+ 277 - 0
src/otherPages/buyVip/index.vue

@@ -0,0 +1,277 @@
+<template>
+  <view>
+    <m-nav-bar title="开通会员" :transparent="true" />
+    <div class="buyvip-box">
+      <img class="top-img" :src="topImg" alt="头部背景" />
+      <div class="info-warn">您还未开通完整版系统,付费购买后享受更多功能</div>
+      <div class="item-box">
+        <van-cell class="cell-title" title="选择充值方式" />
+        <div class="radio-box">
+          <div
+            v-for="(item, index) in goodsList"
+            class="radio-item"
+            :class="{ select: index === goodsIndex }"
+            :key="index"
+            @click="()=>{goodsIndex = index}"
+          >
+            <span>{{ item.dictLabel }}</span>
+            <div v-if="index === 1" class="radio-item-recom">推荐</div>
+            <span>¥{{ item.dictValue.split(",")[0] }}</span>
+            <span>原价{{ item.dictValue.split(",")[1] }}元</span>
+          </div>
+        </div>
+      </div>
+      <div class="item-box">
+        <van-cell class="cell-title" title="使用说明" />
+        <div class="readme">
+          <span>1. 有效期内拥有VIP权限.</span>
+          <span>2. 过期后可以使用免费用户的权限.</span>
+          <span>3. 可以续费.</span>
+        </div>
+      </div>
+      <div class="button-box">
+        <div class="button" @click="buy">立即开通</div>
+      </div>
+      <div style="height: 60px"></div>
+    </div>
+  </view>
+</template>
+
+<script>
+import topImg from "./top-background.png";
+import api from '@/api/index'
+export default {
+  data() {
+    return {
+      goodsList: [
+        {
+          searchValue: null,
+          createBy: "admin",
+          createTime: "2021-11-18 18:01:26",
+          updateTime: null,
+          updateBy: null,
+          remark: null,
+          params: {},
+          dictCode: 29,
+          dictSort: 0,
+          dictLabel: "一个月",
+          dictValue: "38,48,30",
+          dictType: "vip_type_price",
+          cssClass: null,
+          listClass: null,
+          isDefault: "N",
+          status: "0",
+          default: false,
+        },
+        {
+          searchValue: null,
+          createBy: "admin",
+          createTime: "2021-11-18 18:01:39",
+          updateTime: null,
+          updateBy: null,
+          remark: null,
+          params: {},
+          dictCode: 30,
+          dictSort: 0,
+          dictLabel: "六个月",
+          dictValue: "68,98,180",
+          dictType: "vip_type_price",
+          cssClass: null,
+          listClass: null,
+          isDefault: "N",
+          status: "0",
+          default: false,
+        },
+        {
+          searchValue: null,
+          createBy: "admin",
+          createTime: "2021-11-18 18:01:50",
+          updateTime: null,
+          updateBy: null,
+          remark: null,
+          params: {},
+          dictCode: 31,
+          dictSort: 0,
+          dictLabel: "两年",
+          dictValue: "98,128,730",
+          dictType: "vip_type_price",
+          cssClass: null,
+          listClass: null,
+          isDefault: "N",
+          status: "0",
+          default: false,
+        },
+      ],
+      goodsIndex:1,
+      topImg
+    };
+  },
+  methods: {
+    buy(e) {
+        api.buy.studentXcxWxPrepareOrder({
+            dictCode:this.goodsList[this.goodsIndex].dictCode
+        }).then(res=>{
+            uni.requestPayment({
+                ...res.data
+            })
+
+        })
+
+
+    },
+  },
+  mounted () {
+      api.buy.systemDictDataType("vip_type_price").then(res=>{
+          this.goodsList = res.data
+
+      })
+  },
+};
+// import { getVipPrice, prepareOrder } from "@/api";
+// const goodsIndex = ref(1);
+// const goodsList = ref<any[]>([]);
+// getVipPrice().then((res) => {
+//   goodsList.value = res.data;
+// });
+// const buy = () => {
+//   prepareOrder(goodsList.value[goodsIndex.value].dictCode);
+// };
+</script>
+
+<style scoped lang="scss">
+.buyvip-box {
+  width: 100%;
+  margin-top: -50px;
+  min-height: 100vh;
+  display: flex;
+  align-items: center;
+  flex-direction: column;
+  background: #ffdda6;
+  .top-img {
+    width: 100%;
+  }
+  .info-warn {
+    width: 345px;
+    height: 49px;
+    background: #ffffff;
+    border-radius: 10px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    font-size: 13px;
+    font-family: PingFang SC;
+    font-weight: 400;
+    color: #91540f;
+    margin-top: -70px;
+    margin-bottom: 10px;
+  }
+  .item-box {
+    width: 345px;
+    background: #ffffff;
+    border-radius: 10px;
+    padding: 15px;
+    margin-bottom: 10px;
+    .cell-title {
+      font-size: 16px;
+      font-family: PingFang SC;
+      font-weight: bold;
+      line-height: 20px;
+      color: #0a1a33;
+      margin-left: -10px;
+      margin-bottom: 15px;
+    }
+  }
+  .readme {
+    display: flex;
+    flex-direction: column;
+    font-size: 13px;
+    line-height: 20px;
+    span {
+      margin-bottom: 5px;
+    }
+  }
+  .radio-box {
+    display: flex;
+    justify-content: space-around;
+    align-items: center;
+    .select {
+      background: #fcf1de !important;
+    }
+    .radio-item {
+      position: relative;
+      .radio-item-recom {
+        position: absolute;
+        top: 0;
+        width: 30px;
+        height: 15px;
+        line-height: 15px;
+        font-size: 10px;
+        background: #ff4d53;
+        border-radius: 0%;
+        right: 0;
+        transform: translate(15%, -30%);
+        border-radius: 5px 0px 5px 0px;
+        color: #fff;
+      }
+    }
+    div {
+      width: 98px;
+      font-size: 20px;
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: space-around;
+      background: #ffffff;
+      border: 1px solid #faca93;
+      height: 124px;
+      border-radius: 5px;
+      span {
+        font-family: PingFang SC;
+        &:nth-of-type(1) {
+          font-size: 13px;
+          font-weight: bold;
+          color: #91540f;
+        }
+        &:nth-of-type(2) {
+          font-size: 30px;
+          font-weight: bold;
+          color: #ff4d53;
+        }
+        &:nth-of-type(3) {
+          font-size: 11px;
+          font-weight: 400;
+          color: #8a9099;
+          text-decoration: line-through;
+        }
+      }
+    }
+  }
+  .button-box {
+    position: fixed;
+    background-color: #ffffff;
+    bottom: 0;
+    width: 375px;
+    height: 60px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    .button {
+      width: 152px;
+      height: 40px;
+      background: #faca93;
+      border-radius: 30px;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      font-size: 15px;
+      font-family: PingFang SC;
+      font-weight: 500;
+      color: #91540f;
+      letter-spacing: 0px;
+      &:active {
+        background-color: red;
+      }
+    }
+  }
+}
+</style>

二進制
src/otherPages/buyVip/top-background.png


+ 55 - 0
src/otherPages/code/index.vue

@@ -0,0 +1,55 @@
+<template>
+  <view>
+    <text> {{ code }}</text>
+    <view class="menu">
+      <button @click="copyCode" style="background: red">复制code</button>
+      <button @click="freshCode" style="background: orange">
+        重新获取code
+      </button>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      code: "",
+    };
+  },
+  methods: {
+    freshCode() {
+      let that = this;
+      uni.login({
+        success(res) {
+          that.code = res.code;
+        },
+      });
+    },
+    copyCode(e) {
+      let that = this;
+      uni.setClipboardData({
+        data: that.code,
+        success(res) {
+          console.log(res);
+        },
+      });
+    },
+  },
+  onLoad(op) {
+    this.freshCode();
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.menu {
+  display: flex;
+  justify-content: space-between;
+  button {
+    margin-top: 15px;
+    width: 40%;
+    color: #fff;
+  }
+}
+</style>

+ 2 - 0
src/otherPages/marked/index.vue

@@ -241,6 +241,8 @@ export default {
     //   const name = this.$route.query.name
     const markdown = query.markdown
      api.json.markdown(markdown).then(res=>{
+       console.log(res)
+       this.jsonData = res.data
 
      });
   },

+ 35 - 15
src/pages.json

@@ -20,7 +20,7 @@
       "style": {}
     },
     {
-      "path": "pages/marked/index",
+      "path": "pages/classifyOrder/index",
       "style": {}
     },
     {
@@ -204,14 +204,24 @@
   ],
   "subPackages": [
     {
-      "root":"otherPages",
-      "pages":[{
-        "path":"marked/index",
-        "styles":{
-          
+      "root": "otherPages",
+      "pages": [
+        {
+          "path": "marked/index",
+          "styles": {}
+        },
+        {
+          "path": "code/index",
+          "styles": {}
+        },
+        {
+          "path": "buyVip/index",
+          "styles": {
+            "navigationBarTitleText": "购买vip",
+            "enablePullDownRefresh": false
+          }
         }
-      }]
-
+      ]
     }
   ],
   "tabBar": {
@@ -232,12 +242,12 @@
         "selectedIconPath": "static/imgs/video-avtive.png",
         "text": "学车"
       },
-      {
-        "pagePath": "pages/cinema/index",
-        "iconPath": "static/imgs/theFilm.png",
-        "selectedIconPath": "static/imgs/theFilm-avtive.png",
-        "text": "电影"
-      },
+      // {
+      //   "pagePath": "pages/cinema/index",
+      //   "iconPath": "static/imgs/theFilm.png",
+      //   "selectedIconPath": "static/imgs/theFilm-avtive.png",
+      //   "text": "电影"
+      // },
       {
         "pagePath": "pages/user/index",
         "iconPath": "static/imgs/user.png",
@@ -283,7 +293,9 @@
       "van-index-anchor": "./wxcomponents/vant/index-anchor/index",
       "van-stepper": "./wxcomponents/vant/stepper/index",
       "van-sidebar": "wxcomponents/vant/sidebar/index",
-      "van-sidebar-item": "wxcomponents/vant/sidebar-item/index"
+      "van-sidebar-item": "wxcomponents/vant/sidebar-item/index",
+      "van-grid": "wxcomponents/vant/grid/index",
+      "van-grid-item": "wxcomponents/vant/grid-item/index"
     }
   },
   "condition": {
@@ -303,6 +315,14 @@
       {
         "name": "灯光模拟",
         "path": "pages/lightMock/index"
+      },
+      {
+        "name": "获取code",
+        "path": "otherPages/code/index"
+      },
+      {
+        "name": "购买vip",
+        "path": "otherPages/buyVip/index"
       }
     ]
   }

+ 6 - 6
src/pages/carVideo/components/branchOne.vue

@@ -37,11 +37,11 @@
 			}
 		},
 		async mounted() {
-			let {
-				data: bannerListData
-			} = await this.$api.home.getHomePageDataList(['carouselChart'])
-			this.sidebarOnChange({detail:this.activeKey})
-			this.bannerList = bannerListData.carouselChart
+			// let {
+			// 	data: bannerListData
+			// } = await this.$api.home.getHomePageDataList(['carouselChart'])
+			// this.sidebarOnChange({detail:this.activeKey})
+			// this.bannerList = bannerListData.carouselChart
 			this.$nextTick(() => {
 				this.loading = false
 			})
@@ -71,4 +71,4 @@
 			overflow-y: auto;
 		}
 	}
-</style>
+</style>

+ 46 - 44
src/pages/carVideo/components/branchTwo.vue

@@ -1,51 +1,53 @@
 <template>
-	<loading v-if="loading"></loading>
-	<view v-else class="vant-tab">
-		<!-- <m-banner :bannerList="bannerList" height="150"></m-banner> -->
-		<ShortVideo type="slide" class="top-margin"></ShortVideo>
-		<view v-for="(item,index) in carVideoList" :key='index'>
-			<m-video-box :column="[2, 1, 3][index % 3]" :type="[2, 1, 3][index % 3]==1?'left-right':'top-bottom'"
-				:carVideoList='item' v-if="item.children.length==0" />
-			<VideoListBox :carVideoList='item' v-else />
-		</view>
-	</view>
+  <loading v-if="loading"></loading>
+  <view v-else class="vant-tab">
+    <!-- <m-banner :bannerList="bannerList" height="150"></m-banner> -->
+    <!-- <ShortVideo type="slide" class="top-margin"></ShortVideo> -->
+    <view v-for="(item, index) in carVideoList" :key="index">
+      <m-video-row2
+        :column="[2, 1, 3][index % 3]"
+        :type="[2, 1, 3][index % 3] == 1 ? 'left-right' : 'top-bottom'"
+        :carVideoList="item"
+        v-if="item.children.length == 0"
+      />
+      <VideoListBox :carVideoList="item" v-else />
+    </view>
+  </view>
 </template>
 
 <script>
-	import ShortVideo from './shortVideo.vue'
-	import VideoListBox from './videoListBox.vue'
-	export default {
-		components:{
-			ShortVideo,
-			VideoListBox
-		},
-		props: {
-			carVideoList: {
-				type: Array
-			}
-		},
-		data: () => ({
-			bannerList: [],
-			loading: true
-		}),
-		async mounted() {
-			let {
-				data: bannerListData
-			} = await this.$api.home.getHomePageDataList(['carouselChart'])
-			this.bannerList = bannerListData.carouselChart
-			this.$nextTick(() => {
-				this.loading = false
-			})
-		}
-	}
+import ShortVideo from "./shortVideo.vue";
+import VideoListBox from "./videoListBox.vue";
+export default {
+  components: {
+    ShortVideo,
+    VideoListBox
+
+  },
+  props: {
+    carVideoList: {
+      type: Array,
+    },
+  },
+  data: () => ({
+    bannerList: [],
+    loading: true,
+  }),
+  async mounted() {
+    // let { data: bannerListData } = await this.$api.home.getHomePageDataList([
+    //   "carouselChart",
+    // ]);
+    // this.bannerList = bannerListData.carouselChart;
+    this.$nextTick(() => {
+      this.loading = false;
+    });
+  },
+};
 </script>
 
 <style lang="scss">
-	.vant-tab{
-		height: calc(100vh - 130px);
-		overflow: auto;
-	}
-	.top-margin{
-		margin-top: 10px;
-	}
-</style>
+
+.top-margin {
+  margin-top: 10px;
+}
+</style>

+ 4 - 0
src/pages/carVideo/components/tabLeft.vue

@@ -29,6 +29,10 @@ export default {
         return [];
       },
     },
+    subject:{
+      type:Number,
+      default:1
+    }
   },
 };
 </script>

+ 5 - 0
src/pages/carVideo/components/tabRight.vue

@@ -29,6 +29,11 @@ export default {
         return [];
       },
     },
+    
+    subject: {
+      type: Number,
+      default: 1,
+    },
   },
 };
 </script>

+ 95 - 0
src/pages/carVideo/components/userInfoHead.vue

@@ -0,0 +1,95 @@
+<template>
+  <view class="box">
+    <image class="headImage" :src="userData.headImage"></image>
+    <view style="margin-left: 10px" class="">{{ userData.nickName }}</view>
+    <view
+      @click="goBuyVip"
+      v-if="!isVip"
+      style="color: #0a1a33; margin-left: 10px"
+      >开通VIP</view
+    >
+    <!-- <view v-if="isVip" style="color: #0a1a33; margin-left: 10px">VIP会员</view> -->
+    <view  @click="goBuyVip" v-if="isVip" style="color: #0a1a33; margin-left: 10px">{{expireTime}}</view>
+    <image
+     @click="goBuyVip"
+      v-if="isVip"
+      style="margin-left: 8px"
+      class="diamond"
+      :src="diamond"
+    ></image>
+    <image
+      @click="goBuyVip"
+      v-if="!isVip"
+      style="margin-left: 8px"
+      class="diamond"
+      :src="diamondGray"
+    ></image>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      diamond: require("@/assets/img/diamond.png"),
+      diamondGray: require("@/assets/img/diamond_gray.png"),
+    };
+  },
+  props: {
+    userData: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+  },
+  computed: {
+    jpcjUserInfo() {
+      return this.$store.state.user.jpcjUserInfo || {};
+    },
+    expireTime() {
+      return this.$store.state.user.userInfo.expireTime?this.$store.state.user.userInfo.expireTime.split(/\s+/)[0]:"";
+    },
+    isVip() {
+      console.log(this.$store.getters.isVip);
+      return this.$store.getters.isVip;
+    },
+  },
+  watch: {
+    userData(newVal, oldVal) {},
+  },
+  methods: {
+    goBuyVip(e) {
+      uni.navigateTo({
+        url: "/otherPages/buyVip/index",
+      });
+    },
+  },
+  mounted() {
+    //钻石
+    console.log(this.userData);
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.box {
+  margin-left: 7px;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  align-content: center;
+  flex-wrap: wrap;
+  width: 100%;
+}
+.diamond {
+  width: 16px;
+  height: 16px;
+}
+.headImage {
+  width: 25px;
+  height: 25px;
+  border-radius: 50%;
+}
+</style>

+ 86 - 31
src/pages/carVideo/index.vue

@@ -2,9 +2,39 @@
   <loading v-if="loading"></loading>
 
   <view v-else class="carVideo">
-    <topbar>
+    <!-- <topbar>
       <van-search shape="round" placeholder="搜索学车视频" @search="search" />
     </topbar>
+    <van-tabs id="tabs" :active="active" :sticky="true">
+      <van-tab
+        :title="item.chapterName"
+        v-for="(item, index) in typeList"
+        :key="index"
+        class="vant-tab"
+      >
+        <branch-one
+          v-if="index == 0"
+          :carVideoList="item.children"
+        ></branch-one>
+        <branch-two
+          v-else-if="index == 1"
+          :carVideoList="item.children"
+        ></branch-two>
+        <branch-two
+          v-else-if="index == 2"
+          :carVideoList="item.children"
+        ></branch-two>
+        <branch-one
+          v-else-if="index == 3"
+          :carVideoList="item.children"
+        ></branch-one>
+        <get-cert v-else-if="index == 4"></get-cert>
+        <branch-two v-else :carVideoList="item.children"></branch-two>
+      </van-tab>
+    </van-tabs> -->
+    <topbar>
+      <userInfoHead :userData="userData"></userInfoHead>
+    </topbar>
     <view>
       <swiper :indicator-dots="true" style="height: 200rpx">
         <swiper-item class="swiperBanner">
@@ -52,7 +82,14 @@
       </view>
     </view>
     <view class="tab">
-      <van-tabs class="custom-tabs" :active="active" bind:change="onChange">
+      <van-tabs
+        animated
+        class="custom-tabs"
+        :active="active"
+        id="tabs"
+        bind:change="onChange"
+        :sticky="true"
+      >
         <van-tab title="科目一">
           <view class="tab-container">
             <tab-left :subject="1" :leftList="leftList1"></tab-left>
@@ -61,28 +98,24 @@
           </view>
         </van-tab>
         <van-tab title="科目二">
-          <view v-for="(item, index) in typeList[1]" :key="index">
-            <m-video-box
-              :column="[2, 1, 3][index % 3]"
-              :type="[2, 1, 3][index % 3] == 1 ? 'left-right' : 'top-bottom'"
-              :carVideoList="item"
-              v-if="item.children.length == 0"
-            />
-            <VideoListBox :carVideoList="item" v-else />
+          <view v-for="(item, index) in typeList" :key="index">
+            <branch-two
+              v-if="index == 1"
+              :carVideoList="item.children"
+            ></branch-two>
           </view>
-          <!-- <view class="tab-container">
-            <tab-left :leftList="leftList"></tab-left>
-            <tab-center :centerList="centerList"></tab-center>
-            <tab-right :rightList="rightList"></tab-right>
-          </view> -->
         </van-tab>
         <van-tab title="科目三">
-          <!-- <view class="tab-container">
-            //不重要的 边角料
-            <tab-left :leftList="leftList"></tab-left>
-            <tab-center :centerList="centerList"></tab-center>
-            <tab-right :rightList="rightList"></tab-right>
-          </view> -->
+          <van-grid column-num="4">
+            <van-grid-item @click="goLightMock" icon="photo-o" text="灯光模拟">
+            </van-grid-item>
+          </van-grid>
+          <view v-for="(item, index) in typeList" :key="index">
+            <branch-two
+              v-if="index == 2"
+              :carVideoList="item.children"
+            ></branch-two>
+          </view>
         </van-tab>
         <van-tab title="科目四">
           <view class="tab-container">
@@ -101,10 +134,11 @@ import shortVideo from "./components/shortVideo.vue";
 import branchOne from "./components/branchOne.vue";
 import branchTwo from "./components/branchTwo.vue";
 import banner1 from "@/assets/img/banner1.jpg";
-import Test from "../mockExam/test.vue";
 import tabLeft from "./components/tabLeft.vue";
 import tabRight from "./components/tabRight.vue";
 import TabCenter from "./components/tabCenter.vue";
+import VideoListBox from "./components/videoListBox.vue";
+import userInfoHead from "./components/userInfoHead.vue";
 export default {
   components: {
     shortVideo,
@@ -113,6 +147,8 @@ export default {
     tabLeft,
     TabCenter,
     tabRight,
+    VideoListBox,
+    userInfoHead,
   },
   data: () => ({
     //科目一
@@ -130,7 +166,7 @@ export default {
       {
         img: "https://t1-1305573081.file.myqcloud.com/wxapp/static/imgs/home/NotesBeforeExamination@2x.png",
         text: "考前须知",
-        path: "/otherPages/marked/index?markdown=学车必看",
+        path: "/otherPages/marked/index?markdown=考前须知",
       },
       {
         img: "https://t1-1305573081.file.myqcloud.com/wxapp/static/imgs/home/LearnToSee@2x.png",
@@ -152,7 +188,7 @@ export default {
       {
         img: "https://t1-1305573081.file.myqcloud.com/wxapp/static/imgs/home/SequentialPractice@2x.png",
         text: "顺序练习",
-        path: "",
+        path: "/pages/classifyOrder/index",
       },
       {
         img: "https://t1-1305573081.file.myqcloud.com/wxapp/static/imgs/home/ClassificationExercise@2x.png",
@@ -260,9 +296,9 @@ export default {
         typeIcon: null,
         typeSort: 0,
         status: "0",
-        children:[]
+        children: [],
       },
-       {
+      {
         id: 2,
         typeName: "科目二",
         pid: 0,
@@ -270,9 +306,9 @@ export default {
         typeIcon: null,
         typeSort: 0,
         status: "0",
-        children:[]
+        children: [],
       },
-       {
+      {
         id: 3,
         typeName: "科目三",
         pid: 0,
@@ -280,9 +316,9 @@ export default {
         typeIcon: null,
         typeSort: 0,
         status: "0",
-        children:[]
+        children: [],
       },
-       {
+      {
         id: 4,
         typeName: "科目四",
         pid: 0,
@@ -290,23 +326,42 @@ export default {
         typeIcon: null,
         typeSort: 0,
         status: "0",
-        children:[]
+        children: [],
       },
     ],
     loading: true,
     banner1,
     query: {},
   }),
+  computed: {
+    userData() {
+      return this.$store.state.user.userInfo || {};
+    },
+  },
+  // onLoad() {
+  //   //获取code
+  //   wx.login({
+  //     success(res) {
+  //       console.log(res);
+  //     },
+  //   });
+  // },
 
   async mounted() {
     let { data } = await this.$api.carVideo.getTreeList();
     this.typeList = data;
     this.loading = false;
+    this.$store.dispatch("GetInfo");
     this.$nextTick(() => {
       this.selectComponent("#tabs").resize();
     });
   },
   methods: {
+    goLightMock(e) {
+      uni.navigateTo({
+        url: "/pages/lightMock/index",
+      });
+    },
     goAprilExam() {
       uni.navigateTo({
         url: "/pages/extraWeb/index?src=https://mn.zzxcx.net/#/aprilExam/test",

+ 1 - 1
src/pages/carVideo/play.vue

@@ -97,4 +97,4 @@
 			}
 		}
 	}
-</style>
+</style>

+ 253 - 0
src/pages/classifyOrder/index.vue

@@ -0,0 +1,253 @@
+<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>
+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月新规题",
+        },
+      ],
+    };
+  },
+  methods: {
+    name() {},
+  },
+};
+</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>

+ 1 - 1
src/pages/fulu/index.vue

@@ -193,4 +193,4 @@
 			}
 		}
 	}
-</style>
+</style>

+ 1 - 1
src/pages/index/index.vue

@@ -109,4 +109,4 @@
 			// overflow: auto;
 		}
 	}
-</style>
+</style>

+ 2 - 1
src/pages/lightMock/components/composeTopicsMask.vue

@@ -4,6 +4,7 @@
       <span
         @click="
           () => {
+            stopTopicsAudio()
             $emit('close');
           }
         "
@@ -56,7 +57,7 @@ export default {
   methods: {
     stopTopicsAudio() {
       const audio  = utils.wxUtils.getGlobAudio()
-      audio.pause()
+      audio.stop()
 
 
     },

+ 15 - 0
src/pages/lightMock/components/composeTopicsMaskList.vue

@@ -114,6 +114,15 @@ export default {
         this.playNextAudio(duration, interval);
       }
     },
+    init(){
+      if(this.list.length>0){
+        this.audio.pause()
+        this.listIndex = -1
+        this.selectItem(this.list[0],0)
+
+      }
+
+    }
   },
   props: {
     list: {
@@ -136,6 +145,12 @@ export default {
   },
   mounted() {
     this.audio = utils.wxUtils.getGlobAudio();
+    this.audio.pause();
+    setTimeout(()=>{
+      this.selectItem(this.list[0],0)
+    },500)
+    
+
   },
 };
 </script>

+ 9 - 4
src/pages/lightMock/components/examTopicList.vue

@@ -4,6 +4,7 @@
       <span
         @click="
           () => {
+            stopTopicsAudio()
             $emit('close');
           }
         "
@@ -161,8 +162,9 @@ export default {
     };
   },
   methods: {
-    stopTopicsAudio: () => {
-      audio.pause();
+    stopTopicsAudio() {
+   
+      this.audio.stop();
     },
     createRandSingleList() {
       let directives = this.$store.state.user.lightConfig.directives;
@@ -175,17 +177,19 @@ export default {
     nextGroup() {
       if (this.$store.state.user.lightConfig.type == 0) {
         this.randSingleList = this.createRandSingleList();
+        this.$refs["mid"].init()
       } else {
         if (this.randComlistIndex + 1 >= this.comList.length) {
           this.randComlistIndex = 0;
         } else {
           this.randComlistIndex = this.randComlistIndex + 1;
         }
-
         api.open
           .lightingCombinationId(this.newComList[this.randComlistIndex].id)
           .then((res) => {
             this.randComlist = res.data;
+            console.log(this.$refs["mid"])
+            this.$refs["mid"].init()
           });
       }
     },
@@ -219,7 +223,7 @@ export default {
         this.comList.length > 0 &&
         this.randComlistIndex < this.comList.length
       ) {
-        return this.comList[this.randComlistIndex].titile;
+        return this.newComList[this.randComlistIndex].titile;
       } else {
         return "";
       }
@@ -237,6 +241,7 @@ export default {
     this.audio = utils.wxUtils.getGlobAudio();
     this.randSingleList = this.createRandSingleList();
     this.newComList = this.comList.sort((a, b) => Math.random() - 0.5);
+    console.log(this.newComList)
     api.open.lightingCombinationId(this.newComList[0].id).then((res) => {
       this.randComlist = res.data;
     });

+ 14 - 6
src/pages/lightMock/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div style="height: 100vh; background: #eeeeee">
+  <div style="height: 100vh; background: #fff">
     <div class="header-border"></div>
     <lightConfig
       @close="
@@ -54,15 +54,16 @@
     ></examTopicList>
     <div class="fixBottom">
       <div class="button-halo">
-        <button
+        <view
+          class="button-text"
           @click="
             () => {
               examTopicListVisible = true;
             }
           "
         >
-          开始考试
-        </button>
+          <text>开始考试</text>
+        </view>
       </div>
     </div>
   </div>
@@ -215,7 +216,7 @@ export default {
   width: 100%;
   display: flex;
   justify-content: center;
-  font-size: 16px;
+
   .button-halo {
     width: 80px;
     height: 80px;
@@ -223,18 +224,25 @@ export default {
     justify-content: center;
     align-content: center;
     align-items: center;
+    flex-wrap: wrap;
     background: rgb(255, 255, 255);
     border-radius: 50%;
     box-shadow: 0px 0px 3px rgb(121, 121, 121);
   }
-  button {
+  .button-text {
     border: none;
     width: 60px;
     height: 60px;
+    display: flex;
+    justify-content: center;
+    align-content: center;
+    align-items: center;
+    text-align: center;
     color: white;
     background: #01c18d;
     padding: 0 10px;
     border-radius: 50%;
+    white-space: normal;
   }
 }
 </style>

+ 15 - 0
src/store/getters.js

@@ -1,6 +1,21 @@
 const getters = {
   token: state => state.user.token,
   userInfo: state => state.user.userInfo,
+  isVip: state => {
+    if (state.user.userInfo && state.user.userInfo.expireTime) {
+      let expireTime = new Date(state.user.userInfo.expireTime).getTime()
+      let nowTime = new Date().getTime()
+      if (expireTime >= nowTime) {
+        return true
+      }
+      else {
+        return false
+      }
+
+    } else {
+      return false
+    }
+  },
   avatar: state => state.user.avatar,
   name: state => state.user.name,
   introduction: state => state.user.introduction,

+ 9 - 1
src/store/modules/user.js

@@ -5,6 +5,9 @@ const user = {
 		tokenObj: {
 			token: '',
 			date: 0
+		},
+		jpcjUserInfo: {
+
 		},
 		userInfo: '',
 		name: '',
@@ -27,6 +30,10 @@ const user = {
 		SET_TOKENOBJ: (state, tokenObj) => {
 			state.tokenObj = tokenObj
 		},
+		//jpcjUserInfo
+		SET_JPCJUSERINFO(state,jpcjUserInfo ) {
+			state.jpcjUserInfo = jpcjUserInfo
+		},
 		REFRESH_TOKEN(state) {
 			if (state.tokenObj.token !== '')
 				state.tokenObj.date = new Date().getTime()
@@ -64,6 +71,7 @@ const user = {
 				token: res.data.token,
 				date: new Date().getTime()
 			})
+			// store.commit('SET_JPCJUSERINFO',res.data.jpcjUserInfo)
 			wx.hideLoading()
 			return res
 		},
@@ -86,7 +94,7 @@ const user = {
 		 */
 		async GetInfo(store) {
 			let res = await userApi.getInfo()
-			store.commit('SET_USERINFO', res.data.student)
+			store.commit('SET_USERINFO', res.data)
 			return res
 		}
 	}