Ver Fonte

Merge remote-tracking branch 'origin/chen' into dev

chenxiong há 3 anos atrás
pai
commit
fc3a9ba007

+ 8 - 0
src/apis/common.js

@@ -269,5 +269,13 @@ export default {
       noToken: true
     })
   },
+  advertisingHomeLocation(data) {
+		return request({
+			url: '/app/common/base/advertising/homeLocation',
+			method: 'get',
+			params: data,
+			noToken: true
+		})
+	},
 
 }

+ 19 - 14
src/axios.js

@@ -1,4 +1,5 @@
 import axios from 'axios'
+import store from './store'
 export const BASE_URL = 'http://42.192.164.187:19005'    //test
 export const tenantId = '867735392558919680'
 
@@ -53,16 +54,18 @@ request.interceptors.response.use(async (response) => {
       let userAccount = tools.getUserAccount();
 
       if (!userAccount) {
-        Message({
-          message: `登录失效,重新登录`,
-          type: "error",
-        });
-
-        setTimeout(() => {
+        // Message({
+        //   message: `登录失效,重新登录`,
+        //   type: "error",
+        // });
+
+        // setTimeout(() => {
+          
+          store.commit('setCurrentRouter',router.currentRoute)
           router.push({
             path: '/login'
           })
-        }, 1000);
+        // }, 1000);
       } else {
         let res = await refreshToken(response.config)
         return res
@@ -107,16 +110,18 @@ async function refreshToken(response) {
     let onset = await request(response)
     return onset
   } else {
-    Message({
-      message: `登录失效,重新登录`,
-      type: "error",
-    });
-
-    setTimeout(() => {
+    // Message({
+    //   message: `登录失效,重新登录`,
+    //   type: "error",
+    // });
+
+    // setTimeout(() => {
+      
+      store.commit('setCurrentRouter',router.currentRoute)
       router.push({
         path: '/login'
       })
-    }, 1000);
+    // }, 1000);
   }
 }
 

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

@@ -1536,7 +1536,7 @@ export default {
     ...mapGetters(["userInfo"]),
   },
   mounted() {
-    this.courseId = this.$route.query.courseId || "";
+    this.courseId = +this.$route.query.courseId || "";
     this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
     this.goodsId = this.$route.params.goodsId;
     this.orderGoodsId = this.$route.query.orderGoodsId;

+ 7 - 0
src/pages/course-list/index.vue

@@ -183,6 +183,9 @@ export default {
     };
   },
   mounted() {
+    this.params.educationTypeId = this.$route.query.educationId;
+    this.params.projectId = this.$route.query.projectId;
+    this.params.businessId = this.$route.query.businessId;
     this.getEducationTypeList();
     this.changeSubject();
   },
@@ -286,6 +289,10 @@ export default {
     getEducationTypeList() {
       this.$request.educationTypeList().then((res) => {
         this.typeList = res.rows;
+
+        if (this.params.educationTypeId) {
+          this.getBusinessList();
+        }
       });
     },
   },

+ 12 - 4
src/pages/goods-detail/bank-detail.vue

@@ -1026,7 +1026,7 @@ export default {
     this.getGoodsBankList();
   },
   methods: {
-    ...mapMutations(["setCheckGoodsList"]),
+    ...mapMutations(["setCheckGoodsList", "setCurrentRouter"]),
     /**
      * @param {Object}
      * 单选点击确认
@@ -1592,16 +1592,25 @@ export default {
         });
     },
     buyNow() {
+      console.log(this.$route);
+      if (!this.$tools.isLogin()) {
+        this.setCurrentRouter(this.$route);
+        this.$router.push({
+          path: "/login",
+        });
+        return;
+      }
       let selectGoodsList = JSON.parse(JSON.stringify([this.goodsDetail]));
 
       this.setCheckGoodsList(selectGoodsList);
-
+      this.set;
       this.$router.push({
         path: "/payment",
       });
     },
     addCart() {
       if (!this.$tools.isLogin()) {
+        this.setCurrentRouter(this.$route);
         this.$router.push({
           path: "/login",
         });
@@ -1700,7 +1709,6 @@ export default {
           .img {
             width: 442px;
             height: 248px;
-            background: #ff9500;
             border-radius: 10px;
             overflow: hidden;
 
@@ -1708,7 +1716,7 @@ export default {
               max-width: 100%;
               max-height: 100%;
               width: 100%;
-              height: auto;
+              height: 100%;
             }
           }
 

+ 3 - 2
src/pages/goods-detail/course-detail.vue

@@ -438,7 +438,7 @@ export default {
     this.getProvinceList();
   },
   methods: {
-    ...mapMutations(["setCheckGoodsList"]),
+    ...mapMutations(["setCheckGoodsList", "setCurrentRouter"]),
     /**
      * 点击课程大目录
      */
@@ -1132,6 +1132,7 @@ export default {
     },
     addCart() {
       if (!this.$tools.isLogin()) {
+        this.setCurrentRouter(this.$route);
         this.$router.push({
           path: "/login",
         });
@@ -1251,7 +1252,7 @@ export default {
               max-width: 100%;
               max-height: 100%;
               width: 100%;
-              height: auto;
+              height: 100%;
             }
           }
 

+ 190 - 7
src/pages/home/index.vue

@@ -87,13 +87,43 @@
           <div class="left-box">
             <div class="left-box__header">课程导航</div>
             <div class="left-box__body">
+              <div class="bg"></div>
+              <div class="slide-list">
+                <div
+                  class="slide-list__item"
+                  v-for="(type, typeItem) in typeList"
+                  :key="'type' + typeItem"
+                >
+                  <div class="title" @click="goCourse(type)">
+                    {{ type.educationName }}
+                  </div>
+                  <ul class="nav">
+                    <li
+                      v-for="(slideItem, slideIndex) in slideList[typeItem]"
+                      :key="'item' + slideIndex"
+                      @click="goCourse(slideItem)"
+                    >
+                      <div class="text">
+                        {{ slideItem.projectName }}-{{ slideItem.businessName }}
+                      </div>
+                    </li>
+                  </ul>
+                </div>
+              </div>
               <ul class="list">
-                <li v-for="(item, index) in 5" :key="index">
+                <li v-for="(item, index) in typeList" :key="index">
                   <div class="text">
-                    <div class="text__title">继续教育</div>
+                    <div class="text__title" @click="goCourse(item)">
+                      {{ item.educationName }}
+                    </div>
                     <div class="text__desc">
-                      <a class="item">建造师-一级</a>
-                      <a class="item">建造师-一级</a>
+                      <a
+                        @click="goCourse(aItem)"
+                        class="item"
+                        v-for="(aItem, aIndex) in item.list"
+                        :key="'aItem' + aIndex"
+                        >{{ aItem.projectName }}</a
+                      >
                     </div>
                   </div>
                 </li>
@@ -103,6 +133,7 @@
 
           <div class="swiper">
             <swiper
+              v-if="bannerList.length > 1"
               ref="mySwiper"
               @slideChangeTransitionStart="slideChangeTransitionStart($event)"
               class=""
@@ -125,6 +156,7 @@
           </div>
 
           <div class="right-box">
+            <div class="bg"></div>
             <div class="no-login" v-if="!userInfo">
               <template v-if="loginType == 1">
                 <el-form :model="loginForm" ref="loginForm" :rules="loginRules">
@@ -446,7 +478,7 @@ export default {
     return {
       indexToken: "",
       indexUserAccount: "",
-      colors: ["red", "green", "blue", "gray", "black"],
+      colors: [],
       color: "",
       countDown: 0,
       countDownTimer: null,
@@ -479,10 +511,13 @@ export default {
       isloginSms: false,
       swiperOptions: {
         loop: true,
+        observer: true,
+        observeParents: true,
         speed: 300,
+        autoplayDisableOnInteraction: false,
+        autoplayStopOnLast: false,
         autoplay: {
-          delay: 3000,
-          stopOnLastSlide: false,
+          delay: 1000,
           disableOnInteraction: false,
         },
         // 显示分页
@@ -499,6 +534,8 @@ export default {
       bannerList: [],
       goodsList1: [{}], //推荐课程列表
       goodsList2: [{}], //推荐题库列表
+      typeList: [],
+      slideList: [],
       active1: 0, //推荐课程index
       active2: 0, //推荐题库index
     };
@@ -507,9 +544,17 @@ export default {
     this.getActivityList();
     // this.color = this.colors[0];
     this.advertisingList();
+    this.educationTypeList();
+    this.advertisingHomeLocation();
   },
   methods: {
     ...mapMutations(["setUserInfo"]),
+
+    advertisingHomeLocation() {
+      this.$request.advertisingHomeLocation().then((res) => {
+        this.swiperOptions.autoplay.delay = res.data.intervalTime * 1000;
+      });
+    },
     /**
      * 查看商品详情
      */
@@ -525,6 +570,22 @@ export default {
         });
       }
     },
+    educationTypeList() {
+      this.$request.educationTypeList().then((res) => {
+        this.typeList = res.rows.slice(0, 5);
+        this.typeList.forEach((typeItem, index) => {
+          this.businessList(typeItem.id, index);
+        });
+      });
+    },
+
+    businessList(educationId, index) {
+      this.$request.businessList({ educationId }).then((res) => {
+        this.$set(this.slideList, index, res.rows);
+        this.$set(this.typeList[index], "list", res.rows.slice(0, 2));
+      });
+    },
+
     /**
      * 加入购物车
      */
@@ -567,6 +628,16 @@ export default {
           this.goodsList2 = goodsList2;
         });
     },
+    goCourse(item) {
+      this.$router.push({
+        path: "/course-list",
+        query: {
+          educationId: item.educationId ? item.educationId : item.id || "",
+          projectId: item.projectId || "",
+          businessId: item.educationId ? item.id : "",
+        },
+      });
+    },
     slideChangeTransitionStart(e) {
       this.color = this.colors[this.$refs.mySwiper.swiper.realIndex];
     },
@@ -930,10 +1001,85 @@ export default {
           }
 
           &__body {
+            position: relative;
             height: 400px;
             background: rgba(0, 0, 0, 0.5);
+            overflow: hidden;
+
+            &:hover {
+              overflow: visible;
+              .slide-list {
+                opacity: 1;
+                left: 100%;
+              }
+            }
+            .slide-list {
+              opacity: 0;
+              transition: all 0.3s;
+              width: 672px;
+              padding: 0;
+              background: rgba(0, 0, 0, 0.8);
+              position: absolute;
+              top: 0;
+              left: 0;
+              padding-left: 24px;
+              z-index: 10;
+
+              &__item {
+                min-height: 80px;
+                display: flex;
+                align-items: center;
+                border-bottom: 1px solid rgba(255, 255, 255, 0.6);
+
+                &:nth-last-of-type(1) {
+                  border: 0;
+                }
+                .title {
+                  cursor: pointer;
+                  color: #fff;
+                  width: 120px;
+                  height: 28px;
+                  border: 1px solid #ffffff;
+                  border-radius: 14px;
+                  line-height: 26px;
+                  text-align: center;
+                  border-radius: 15px;
+                  margin-right: 10px;
+                }
+
+                .nav {
+                  flex: 1;
+                  display: flex;
+                  flex-wrap: wrap;
+                  li {
+                    margin: 9px 24px 9px 0;
+                    display: flex;
+
+                    .text {
+                      cursor: pointer;
+                      font-size: 14px;
+                      font-family: Microsoft YaHei;
+                      font-weight: 400;
+                      color: #ffffff;
+                    }
+                  }
+                }
+              }
+            }
+
+            .bg {
+              backdrop-filter: blur(10px);
+              position: absolute;
+              left: 0;
+              top: 0;
+              width: 100%;
+              height: 100%;
+              z-index: 12;
+            }
 
             .list {
+              position: relative;
+              z-index: 22;
               padding-left: 16px;
               li {
                 padding: 12px 0;
@@ -941,8 +1087,13 @@ export default {
                 border-bottom: 1px solid rgba(255, 255, 255, 0.6);
                 display: flex;
 
+                &:nth-last-of-type(1) {
+                  border: 0;
+                }
+
                 .text {
                   &__title {
+                    cursor: pointer;
                     font-size: 16px;
                     font-family: Microsoft YaHei;
                     font-weight: 400;
@@ -968,6 +1119,24 @@ export default {
         .swiper {
           .swiper-slide {
             height: 400px;
+
+            img {
+              width: 100%;
+              height: 100%;
+            }
+          }
+
+          .swiper-pagination {
+            text-align: right;
+            padding-right: 324px;
+
+            /deep/ .swiper-pagination-bullet {
+              background: rgba(255, 255, 255, 0.4);
+
+              &-active {
+                background: rgba(255, 255, 255, 1);
+              }
+            }
           }
         }
 
@@ -980,7 +1149,19 @@ export default {
           top: 0;
           z-index: 10;
 
+          .bg {
+            backdrop-filter: blur(10px);
+            position: absolute;
+            left: 0;
+            top: 0;
+            width: 100%;
+            height: 100%;
+            z-index: 2;
+          }
+
           .no-login {
+            position: relative;
+            z-index: 10;
             .input {
               margin: 16px;
               height: 40px;
@@ -1030,6 +1211,8 @@ export default {
           }
 
           .has-login {
+            position: relative;
+            z-index: 10;
             padding: 14px 0 0 14px;
 
             .userinfo {

+ 14 - 4
src/pages/login/index.vue

@@ -427,13 +427,13 @@ export default {
     };
   },
   computed: {
-    ...mapGetters(["header"]),
+    ...mapGetters(["header", "currentRouter"]),
   },
   mounted() {
     this.state = this.$route.query.state || 1;
   },
   methods: {
-    ...mapMutations(["setUserInfo"]),
+    ...mapMutations(["setUserInfo", "setCurrentRouter"]),
     /**
      * 账号密码登录
      */
@@ -543,7 +543,12 @@ export default {
           this.islogin = false;
           this.isloginSms = false;
           this.setUserInfo(res.data);
-          this.$router.replace("/");
+          if (JSON.stringify(this.currentRouter) != {}) {
+            this.$router.push(this.currentRouter);
+            this.setCurrentRouter({});
+          } else {
+            this.$router.replace("/");
+          }
         })
         .catch((err) => {
           this.isRegister = false;
@@ -686,7 +691,12 @@ export default {
               localStorage.setItem("user_account", this.user_account);
               localStorage.setItem("token", this.token);
               this.getInfo();
-              this.$router.replace("/");
+              if (JSON.stringify(this.currentRouter) != {}) {
+                this.$router.push(this.currentRouter);
+                this.setCurrentRouter({});
+              } else {
+                this.$router.replace("/");
+              }
             })
             .catch((err) => {
               this.isBind = false;

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

@@ -39,7 +39,7 @@
               <div class="title">我的题库</div>
               <div class="list">
                 <router-link to="/person-center/my-bank">
-                  <div class="item">我的题库</div>
+                  <div class="item">自购题卷</div>
                 </router-link>
                 <router-link to="/person-center/bank-record">
                   <div class="item">做题记录</div>

+ 38 - 21
src/pages/person-center/my-course/index.vue

@@ -355,7 +355,7 @@
             <div class="content__header">
               <div class="title">重要提示:</div>
               <div class="desc">
-                如对审核结果有异议,请勿点击确认重学。致电020-87085982咨询
+                您的学时审核不通过,不通过原因如下,请查阅,并重学不通过的课程内容。
               </div>
             </div>
 
@@ -380,7 +380,7 @@
                     {{ index + 1 }}、{{ item.name }}
                   </div>
                   <div class="desc">
-                    <div class="imgs">
+                    <!-- <div class="imgs">
                       <div
                         class="img"
                         v-for="(items, indexs) in item.userStudyRecordPhoto"
@@ -391,11 +391,11 @@
                           {{ $tools.timestampToTime(items.createTime, false) }}
                         </div>
                       </div>
-                    </div>
+                    </div> -->
                   </div>
                   <div class="desc">
                     原因:
-                    <span class="note">拍照异常/时间异常</span>
+                    <span class="note">{{ item.auditReason }}</span>
                   </div>
                 </div>
               </div>
@@ -404,7 +404,7 @@
         </div>
         <div class="rebuild__footer">
           <el-button class="confirm" @click="rebuildSubmit" type="primary"
-            >确认重学</el-button
+            >确认已阅读</el-button
           >
         </div>
       </div>
@@ -569,14 +569,21 @@ export default {
                 gradeId: item.gradeId,
               })
               .then((res) => {
-                this.$router.push({
-                  path: `/my-course-detail/${item.goodsId}`,
-                  query: {
-                    gradeId: item.gradeId,
-                    orderGoodsId: item.orderGoodsId,
-                    courseId: res.rows[0].courseId,
-                  },
-                });
+                if (res.rows.length) {
+                  this.$router.push({
+                    path: `/my-course-detail/${item.goodsId}`,
+                    query: {
+                      gradeId: item.gradeId,
+                      orderGoodsId: item.orderGoodsId,
+                      courseId: res.rows[0].courseId || "",
+                    },
+                  });
+                } else {
+                  this.$message({
+                    type: "warning",
+                    message: "课程内暂无可以学习的科目",
+                  });
+                }
               });
           });
       } else {
@@ -588,14 +595,21 @@ export default {
             gradeId: item.gradeId,
           })
           .then((res) => {
-            this.$router.push({
-              path: `/my-course-detail/${item.goodsId}`,
-              query: {
-                gradeId: item.gradeId,
-                orderGoodsId: item.orderGoodsId,
-                courseId: res.rows[0].courseId,
-              },
-            });
+            if (res.rows.length) {
+              this.$router.push({
+                path: `/my-course-detail/${item.goodsId}`,
+                query: {
+                  gradeId: item.gradeId,
+                  orderGoodsId: item.orderGoodsId,
+                  courseId: res.rows[0].courseId || "",
+                },
+              });
+            } else {
+              this.$message({
+                type: "warning",
+                message: "课程内暂无可以学习的科目",
+              });
+            }
           });
       }
     },
@@ -1044,6 +1058,9 @@ export default {
                 color: #333333;
 
                 .note {
+                  display: inline-block;
+                  text-align: center;
+                  line-height: 18px;
                   width: 32px;
                   height: 20px;
                   border: 1px solid #3f8dfd;

+ 11 - 2
src/pages/person-center/my-info/index.vue

@@ -52,11 +52,13 @@
         <el-form-item label="关联姓名">
           <el-input
             placeholder="请填写你的姓名"
+            readonly
             v-model="listData.realname"
           ></el-input>
         </el-form-item>
         <el-form-item label="关联身份证">
           <el-input
+            readonly
             placeholder="请输入你的身份证"
             v-model="listData.idCard"
           ></el-input>
@@ -122,7 +124,14 @@
 
         <el-form-item label="手机号">
           <div class="phone-wrap">
-            <div class="slide-btn" @click="showPhone = !showPhone">编辑▼</div>
+            <el-form-item
+              ><el-input
+                v-model="listData.telphone"
+                readonly
+                placeholder="请输入手机号"
+              ></el-input
+            ></el-form-item>
+            <!-- <div class="slide-btn" @click="showPhone = !showPhone">编辑▼</div>
             <div v-if="showPhone">
               <div class="note">重新修改密码请验证您的用户信息</div>
               <el-input
@@ -143,7 +152,7 @@
                 </span>
               </el-input>
               <div class="submit-btn" @click="submitForm">确认</div>
-            </div>
+            </div> -->
           </div>
         </el-form-item>
       </el-form>

+ 1 - 1
src/pages/person-center/my-order/index.vue

@@ -347,7 +347,7 @@ export default {
         this.formData.orderStatus = "0";
       }
       if (this.activeName == "2") {
-        this.formData.orderStatus = "1,2,3";
+        this.formData.orderStatus = "1,2,3,4";
       }
       if (this.activeName == "3") {
         this.formData.orderStatus = "-1,-2,4";

+ 1 - 0
src/pages/person-center/play-record/index.vue

@@ -22,6 +22,7 @@
                     go('/my-course-detail/' + sectionItem.goodsId, {
                       gradeId: sectionItem.gradeId,
                       orderGoodsId: sectionItem.orderGoodsId,
+                      courseId: sectionItem.courseId,
                     })
                   "
                 >

+ 5 - 0
src/store/index.js

@@ -9,6 +9,7 @@ export default new Vuex.Store({
   //所有的数据都放在state中
   state: {
     applyData: {}, //预约考试数据存放
+    currentRouter:{},
     token: '',
     user_account: '',
     userInfo: null,
@@ -30,10 +31,14 @@ export default new Vuex.Store({
     links: state => state.links,
     getApplyData: state => state.applyData,
     examResult: state => state.examResult,
+    currentRouter: state => state.currentRouter,
   },
 
   //操作数据,唯一的通道是mutations
   mutations: {
+    setCurrentRouter(state,data) {
+      state.currentRouter = data;
+    },
     setExamResult(state,data) {
       state.examResult = data;
     },