guojy 1 年之前
父節點
當前提交
dcca4c3058

+ 3 - 7
src/permission.js

@@ -3,8 +3,8 @@ import router from './router'
 import store from './store'
 import { getToken, getWxToken } from '@/utils/auth'
 //课程免登录名单
-const whiteList = ['/courseHome', '/courseLogin','/courseError','/courseAuth','/courseDeal', '/courseTeam', '/course/adlist', '/course/limitChange', '/course/courseManage', '/course/courseCreate', '/course/dealerManage']
-const whiteList2 = ['/courseDeal/', '/courseDetail/', '/courseAdDetail/', '/course/limitChange/', '/course/transfer/', '/course/video/', '/course/dealOrder/']
+const whiteList = ['/courseHome', '/courseLogin','/courseError','/courseAuth','/courseDeal', '/course/adlist', '/course/limitChange', '/course/courseManage', '/course/courseCreate', '/course/dealerManage']
+const whiteList2 = ['/courseDeal/', '/courseDetail/','/courseTeam/', '/courseAdDetail/', '/course/limitChange/', '/course/transfer/', '/course/video/', '/course/dealOrder/']
 function filterWhite(path) {
   return whiteList2.some(item => {
     return path.includes(item)
@@ -31,7 +31,6 @@ router.beforeEach((to, from, next) => {
     // next();
   } else if (whiteList.indexOf(to.path) != -1 || filterWhite(to.path)) {
     if (getWxToken() || to.path == '/courseAuth') {
-      console.log(1)
       if (typeof (window.$routes_map[to.name]) != 'undefined') {
         window.document.title = window.$routes_map[to.name].label
       } else {
@@ -40,15 +39,13 @@ router.beforeEach((to, from, next) => {
       next()
     } else{
       if(to.path.includes('/courseDetail/')&&to.query&&to.query.code){
-        console.log(2)
         next({
           path:`/courseAuth`,
           query:{
-            code:to.query.code
+            code:`${to.query.code}-${to.params.id}`
           }
         })
       }else if(to.fullPath.includes('/courseLogin')&&to.query&&to.query.pid != undefined){
-        console.log(3)
         next({
           path:`/courseAuth`,
           query:{
@@ -56,7 +53,6 @@ router.beforeEach((to, from, next) => {
           }
         })
       }else{
-        console.log(4)
         next({
           path:`/courseAuth`,
         })

+ 1 - 1
src/router/course.js

@@ -15,7 +15,7 @@
       need_login: true,
     },
     {
-      path: '/courseTeam',
+      path: '/courseTeam/:id',
       name: 'courseHome',
       component: () => import('@/view/course/user/team'),
       label: '我的团队',

+ 2 - 2
src/utils/axiosKc.js

@@ -17,8 +17,8 @@ if (window.plus) {
 }
 let url = '';
 const request = axios.create({
-  // baseURL: process.env.BASE_API, //
-  baseURL: 'https://oa.g107.com',
+  baseURL: process.env.BASE_API, //
+  // baseURL: 'https://oa.g107.com',
   // baseURL:'http://192.168.0.66:8081',
   timeout: 20000,
   headers: {

+ 3 - 3
src/view/course/components/CourseTeam.vue

@@ -3,13 +3,13 @@
     <form action="/">
       <van-search
         v-model="searchValue"
-        placeholder="请输入搜索团队成员"
+        placeholder="请输入搜索成员"
         @search="onSearch"
       />
     </form>
     <div class="team-desc">
       <p v-if="teamType == 1">团队人数:{{ count }}人</p>
-      <p v-if="teamType == 2">近{{ days }}天有交易的人</p>
+      <p v-if="teamType == 0">近{{ days }}天有交易的人</p>
     </div>
     <div class="team-list">
       <div class="team-flex" v-for="(item, index) in teamList">
@@ -38,7 +38,7 @@ export default {
   components: {},
   props: {
     teamType: {
-      type: Number,
+      type: String,
       default: 1
     },
     days: {

+ 2 - 2
src/view/course/components/courseList.vue

@@ -21,7 +21,7 @@
           </div>
           <div
             class="listLiTop"
-            :class="{ listLiTopT: showNum == 2 || showNum == 3 }"
+            :class="{ listLiTopT: showNum == 2 }"
             @click="toUrl(item)"
           >
             <img :src="item.subjectThumb" />
@@ -203,8 +203,8 @@ export default {
         margin-bottom: 0.2rem;
         border: 0;
         border-radius: 0.1rem;
+        padding-bottom: 0;
         &:not(:nth-last-child(1)) {
-          padding-bottom: 0;
           border-bottom: 0;
         }
       }

+ 10 - 4
src/view/course/deal/limitRecord.vue

@@ -21,7 +21,7 @@
           >
             <div class="flex-name-num">
               <p>{{ item.subjectName }}</p>
-              <span>{{Number(item.amount)>0?`+${item.amount}`:item.amount}}</span
+              <span :style="{color:Number(item.amount)>0?'#26A2FF':'red'}">{{Number(item.amount)>0?`+${item.amount}`:item.amount}}</span
               >
             </div>
             <p>{{ item.content }}</p>
@@ -116,6 +116,7 @@ img{
       .recordLi {
         background: #fff;
         padding: 0 0.2rem;
+        overflow: hidden;
         &:not(:nth-last-child(1)) {
           border-bottom: 1px solid #efefef;
         }
@@ -123,26 +124,31 @@ img{
           display: flex;
           justify-content: space-between;
           align-items: center;
+          padding-top: 0.1rem;
           & > p {
             font-size: 0.32rem;
             color: #000;
-            line-height: 2;
+            line-height: 1.5;
           }
           & > span {
             font-size: 0.32rem;
             color: #000;
             line-height: 2;
+            margin-left: .1rem;
           }
         }
         & > p {
           font-size: 0.28rem;
           color: #666;
-          line-height: 2;
+          line-height: 1;
         }
         & > span {
           font-size: 0.28rem;
           color: #666;
-          line-height: 2;
+          line-height: 1;
+          display: block;
+          margin-top: 0.2rem;
+          margin-bottom: 0.1rem;
         }
       }
     }

+ 1 - 0
src/view/course/deal/transfer.vue

@@ -182,6 +182,7 @@ img {
     }
   }
   .transferConetent {
+    margin: 0 .2rem;
     .content{
       margin: .2rem;
       border-top: 1px solid #efefef;

+ 142 - 86
src/view/course/home.vue

@@ -20,20 +20,20 @@
           ></userImage>
           <div class="info">
             <span
-              >{{ user_info.name?user_info.name:'未知'
+              >{{ user_info.name ? user_info.name : "未知"
               }}<van-icon
                 name="notes-o"
                 color="#E1B98B"
                 style="margin-left: .1rem;"
             /></span>
             <!-- <p>手机:{{ user_info.tel }}</p> -->
-            <p
+            <!-- <p
               class="userId"
               :aria-label="user_info.id"
               @click="copyLink('.userId')"
             >
               <i class="courseIcon icon-fuzhi"></i>复制身份ID
-            </p>
+            </p> -->
           </div>
         </div>
         <div class="user_leave">
@@ -44,43 +44,76 @@
     </div>
     <div class="user_tabs" v-if="user_info.marketable">
       <div class="tabs_content">
-        <div class="tabsLi" @click="toUrl('/courseTeam')">
-          <van-icon name="friends-o" />
+        <div class="tabsLi" @click="toUrl('/courseTeam/1')">
+          <van-image
+            src="../../../static/images/course_team.png"
+            style="width: .8rem;height: .8rem;"
+            type="contain"
+          />
           <span>我的团队</span>
         </div>
         <div class="tabsLi" @click="qropen">
-          <i class="courseIcon icon-erweima"></i>
-          <span>我的二维码</span>
+          <van-image
+            src="../../../static/images/course_ewm.png"
+            style="width: .8rem;height: .8rem;"
+            type="contain"
+          />
+          <span>邀请二维码</span>
+        </div>
+        <div class="tabsLi" @click="toUrl('/courseTeam/2')">
+          <van-image
+            src="../../../static/images/course_dingdan.png"
+            style="width: .8rem;height: .8rem;"
+            type="contain"
+          />
+          <span>交易往来</span>
         </div>
       </div>
     </div>
-    <div class="user_course_tabs">
-      <div class="tbsL" v-if='user_info.marketable'>
+    <div class="user_course_tabs" v-if='user_info.marketable'>
+      <van-tabs v-model="tbsIndex" style="width: 60%;">
+        <van-tab title="我的推广"></van-tab>
+        <van-tab title="我的学习"></van-tab>
+      </van-tabs>
+      <!-- <div class="tbsL" v-if='user_info.marketable'>
         <div class="tbsi" :class="{active:tbsIndex==0}" @click="selectTbs(0)">我的推广</div>
         <div class="tbsi" :class="{active:tbsIndex==1}" @click="selectTbs(1)">我的学习</div>
-      </div>
-      <div class="tbsR" v-if='user_info.marketable' @click="toMoreUrl">
-        <span>名额变动明细</span>
+      </div> -->
+      <div class="tbsR" v-if="user_info.marketable" @click="toMoreUrl">
+        <span>名额变动明细<van-icon name="arrow" /></span>
       </div>
     </div>
-    <van-search
+    <!-- <van-search
       v-model="wxId"
       placeholder="请输入wxid替换当前账号"
       show-action
       style="margin: 0.1rem 0.2rem 0;border-radius: 0.1rem;"
       @search="changeUSer"
-    />
-    <div class="courScroll" :style="{height:user_info.marketable?'calc(100vh - 3.32rem) !important':'calc(-2.05rem + 100vh) !important'}">
+    /> -->
+    <div
+      class="courScroll"
+      :style="{
+        height: user_info.marketable
+          ? 'calc(100vh - 4.38rem) !important'
+          : 'calc(-2.05rem + 100vh) !important'
+      }"
+    >
       <scroller ref="scroller" :isInitRefresh="false">
-        <van-loading v-show="showLoad" style="margin: 0px auto;position: relative;left: 50%;transform: translateX(-0.25rem);"/>
-        <div class="myCourseList" v-if="user_info.marketable&&tbsIndex==0&&!showLoad">
+        <van-loading
+          v-show="showLoad"
+          style="margin: 0px auto;position: relative;left: 50%;transform: translateX(-0.25rem);"
+        />
+        <div
+          class="myCourseList"
+          v-if="user_info.marketable && tbsIndex == 0 && !showLoad"
+        >
           <courseList
             :dataList="courseClass.proCourse.courseList"
             :showNum="1"
             :fixedTitle="courseClass.proCourse.title"
           ></courseList>
         </div>
-        <div class="myCourseList" v-if="tbsIndex==1&&!showLoad">
+        <div class="myCourseList" v-if="tbsIndex == 1 && !showLoad">
           <courseList
             :dataList="courseClass.learnCourse.courseList"
             :fixedTitle="courseClass.learnCourse.title"
@@ -92,8 +125,13 @@
     <van-overlay :show="qrVisible" @click="qrVisible = false">
       <div class="wrapper">
         <div class="qrContent">
-          <div class="tit">我的二维码</div>
+          <div class="tit">
+            邀请二维码
+          </div>
           <div class="qrcode-wrap" ref="qrCodeUrl"></div>
+          <div class="btm">
+            <p>邀请朋友成为经销商,并加入你的团队</p>
+          </div>
         </div>
       </div>
     </van-overlay>
@@ -103,8 +141,6 @@
 <script>
 import Clipboard from "clipboard";
 import QRCode from "qrcodejs2";
-import { getWxToken, setWxToken, openError } from "@/utils/auth";
-import { isWxEnv } from "./utils";
 import courseList from "./components/courseList.vue";
 import {
   getWxApiToken,
@@ -119,8 +155,8 @@ export default {
   },
   data() {
     return {
-      showLoad:false,
-      tbsIndex:0,
+      showLoad: false,
+      tbsIndex: 0,
       clipboard: null,
       qrVisible: false,
       qrcode: null,
@@ -166,20 +202,20 @@ export default {
   },
   methods: {
     // 推广/学习标签切换
-    selectTbs(i){
-      if(this.user_info.marketable){
-        if(i == 0&&this.tbsIndex != 0){
+    selectTbs(i) {
+      if (this.user_info.marketable) {
+        if (i == 0 && this.tbsIndex != 0) {
           this.tbsIndex = 0;
           this.showLoad = true;
-          setTimeout(()=>{
-            this.getDealerCourseList()
-          },1000)
-        }else if(i == 1&&this.tbsIndex != 1){
+          setTimeout(() => {
+            this.getDealerCourseList();
+          }, 1000);
+        } else if (i == 1 && this.tbsIndex != 1) {
           this.tbsIndex = 1;
           this.showLoad = true;
-          setTimeout(()=>{
-            this.getUserCourseList()
-          },1000)
+          setTimeout(() => {
+            this.getUserCourseList();
+          }, 1000);
         }
       }
     },
@@ -200,7 +236,7 @@ export default {
           this.user_info = JSON.parse(localStorage.getItem("wx_user_info"));
           if (this.user_info.marketable) {
             getDealerCourseList();
-          } else if (!this.user_info.marketable){
+          } else if (!this.user_info.marketable) {
             this.tbsIndex = 1;
           }
           getUserCourseList();
@@ -212,7 +248,7 @@ export default {
       this.user_info = JSON.parse(localStorage.getItem("wx_user_info"));
       if (this.user_info.marketable) {
         this.getDealerCourseList();
-      } else if (!this.user_info.marketable){
+      } else if (!this.user_info.marketable) {
         this.tbsIndex = 1;
       }
       this.getUserCourseList();
@@ -257,9 +293,11 @@ export default {
     // 创建二维码
     creatQrCode() {
       if (!this.qrcodeStatus) {
-        console.log(`${window.location.href.split("#")[0]}#/courseHome?pid=${
+        console.log(
+          `${window.location.href.split("#")[0]}#/courseHome?pid=${
             JSON.parse(localStorage.getItem("wx_user_info")).id
-          }`);
+          }`
+        );
         this.qrcode = new QRCode(this.$refs.qrCodeUrl, {
           text: `${window.location.href.split("#")[0]}#/courseHome?pid=${
             JSON.parse(localStorage.getItem("wx_user_info")).id
@@ -292,11 +330,11 @@ export default {
       });
     },
     //跳转内页
-    toUrl(url) {
+    toUrl(url, params) {
       this.$router.push({
         path: url
       });
-    },
+    }
   }
 };
 </script>
@@ -312,14 +350,15 @@ img {
 .curPage {
   height: 100%;
   position: relative !important;
-  padding-top: .4rem;
-  background: #F3F2EE;
-  background: linear-gradient(90deg, #F3F2EE, #E7EFF9);
+  padding-top: 0.4rem;
+  background: #f3f2ee;
+  background: linear-gradient(90deg, #f3f2ee, #e7eff9);
   .userInfo {
     padding: 0.24rem 0.32rem 0.12rem;
     .userImage {
       display: flex;
       align-items: center;
+      flex: 1;
       .info {
         display: flex;
         flex-direction: column;
@@ -357,63 +396,68 @@ img {
   }
   .user_tabs {
     padding: 0 0.2rem;
+    margin-top: 0.15rem;
     .tabs_content {
-      padding: 0.1rem 0.2rem;
+      box-sizing: border-box;
+      height: 1.5rem;
+      padding: 0.1rem 0;
       display: flex;
+      justify-content: space-around;
       border-radius: 0.1rem;
-      background: #E9F1FE;
-      background: linear-gradient(90deg, #E9F1FE, #C1D9FF);
+      background: #fff;
       .tabsLi {
-        flex: 1;
-        text-align: center;
-        position: relative;
-        &:nth-of-type(1)::after {
-          content: "";
-          width: 1px;
-          height: 80%;
-          position: absolute;
-          top: 10%;
-          right: 0;
-          background-color: #999;
-        }
+        // flex: 1;
+        display: flex;
+        flex-direction: column;
+        justify-content: center;
+        align-items: center;
         span {
-          font-size: 0.28rem;
+          font-size: 0.24rem;
           color: #333;
-          line-height: 0.6rem;
+          line-height: 0.3rem;
         }
       }
     }
   }
-  .user_course_tabs{
-    padding: .15rem .2rem 0;
+  .user_course_tabs {
+    margin: 0.15rem 0.2rem 0;
     display: flex;
     justify-content: space-between;
     align-items: center;
-    .tbsL{
+    background-color: #fff;
+    border-radius: .1rem;
+    overflow: hidden;
+    .ctbsL {
+      width: 2rem;
+      display: flex;
+      align-items: center;
+    }
+    .tbsL {
       width: 60%;
       display: flex;
       align-items: center;
-      .tbsi{
+      .tbsi {
         padding: 0 0.15rem;
         border-radius: 0.25rem;
         border: 0.02rem solid #999;
-        font-size: .24rem;
+        font-size: 0.24rem;
         color: #444;
-        line-height: .4rem;
+        line-height: 0.4rem;
         text-align: center;
         margin-right: 0.2rem;
-        &.active{
+        &.active {
           border: 1px solid rgb(22, 132, 252);
-          background-color: rgba(38, 162, 255,.1);
+          background-color: rgba(38, 162, 255, 0.1);
           color: rgb(22, 132, 252);
         }
       }
     }
-    .tbsR{
-      span{
-        font-size: .24rem;
-        color: rgb(22, 132, 252);
-        line-height: .3rem;
+    .tbsR {
+      margin-right: .2rem;
+      span {
+        font-size: 0.24rem;
+        color: #333;
+        line-height: 0.3rem;
       }
     }
   }
@@ -429,7 +473,7 @@ img {
         padding-bottom: 0.4rem;
       }
       padding: 0 0.2rem;
-      margin-top: 0.2rem;
+      // margin-top: 0.2rem;
     }
   }
   .wrapper {
@@ -437,30 +481,36 @@ img {
     justify-content: center;
     align-items: center;
     height: 100vh;
-    .qrContent{
+    .qrContent {
       width: 70%;
       border-radius: 0.2rem;
       overflow: hidden;
-      .tit{
+      background-color: #FFF;
+      .btm{
+        font-size: .23rem;
+        color: #666;
+        line-height: .6rem;
+        text-align: center;
+        border: 0;
+      }
+      .tit {
         position: relative;
         width: 100%;
-        background-color: #FFF;
         text-align: center;
-        font-size: .3rem;
+        font-size: 0.3rem;
         color: #333;
-        line-height: .8rem;
-        border-bottom: 1px solid #efefef;
-        &::after{
+        line-height: 0.8rem;
+        &::after {
           content: "X";
           position: absolute;
-          right: .2rem;
-          top: .2rem;
-          font-size: .3rem;
-          line-height: .3rem;
+          right: 0.2rem;
+          top: 0.2rem;
+          font-size: 0.3rem;
+          line-height: 0.3rem;
         }
       }
       .qrcode-wrap {
-        padding: 0.2rem;
+        padding: 0.2rem .2rem 0;
         background-color: #fff;
         text-align: center;
         display: flex;
@@ -469,7 +519,13 @@ img {
     }
   }
 }
-/deep/ .van-search .van-cell{
+/deep/ .van-search .van-cell {
   padding: 0.1rem 0.16rem 0.1rem 0.16rem;
 }
+/deep/ .van-tabs--line .van-tabs__wrap{
+  height: .68rem;
+}
+/deep/ .van-tab--active{
+  font-weight: 600;
+}
 </style>

+ 57 - 31
src/view/course/user/courseAdDeal.vue

@@ -27,9 +27,14 @@
             >
               <div class="flex-name-num">
                 <p>{{ item.subjectName }}</p>
-                <span>{{
-                  Number(item.amount) > 0 ? `+${item.amount}` : item.amount
-                }}</span>
+                <span
+                  :style="{
+                    color: Number(item.amount) > 0 ? '#26A2FF' : 'red'
+                  }"
+                  >{{
+                    Number(item.amount) > 0 ? `+${item.amount}` : item.amount
+                  }}</span
+                >
               </div>
               <p>{{ item.content }}</p>
               <span>{{ item.createTime }}</span>
@@ -51,11 +56,23 @@
     />
     <van-overlay :show="showGive" @click="showGive = false">
       <div class="wrapper" @click.stop>
-        <div class="tit">赠送课程给好友<div class="cancle" @click="showGive = false"><van-icon name="cross" /></div></div>
-        <div class="msg">请提醒好友尽快点击链接领取课程份额。链接分享后,1小时内有效。</div>
+        <div class="tit">
+          赠送课程给好友
+          <div class="cancle" @click="showGive = false">
+            <van-icon name="cross" />
+          </div>
+        </div>
+        <div class="msg">
+          请提醒好友尽快点击链接领取课程名额。链接分享后,1小时内有效。
+        </div>
         <div class="copy">
           <p><van-icon name="info-o" /> 链接分享后,1小时内有效</p>
-          <van-button style="padding: 0 1rem;border-radius: 0.4rem;" color="#26A2FF"  @click="getCourseCode">复制链接</van-button>
+          <van-button
+            style="padding: 0 1rem;border-radius: 0.4rem;"
+            color="#26A2FF"
+            @click="getCourseCode"
+            >复制链接</van-button
+          >
         </div>
       </div>
     </van-overlay>
@@ -80,7 +97,7 @@ export default {
       title: "课程详情",
       giveLink: "",
       noDate: false,
-      showGive:false,
+      showGive: false,
       options: [
         // { name: '微信', icon: 'wechat' },
         { name: "复制链接", icon: "link" }
@@ -148,11 +165,11 @@ export default {
       }
     },
     // 获取课程码
-    getCourseCode(){
+    getCourseCode() {
       createCourseCode(this.courseDetail.subjectId).then(res => {
-        this.giveLink = `${
-          window.location.href.split("#")[0]
-        }#/courseDetail/${this.$route.params.id}?code=${res}`;
+        this.giveLink = `${window.location.href.split("#")[0]}#/courseDetail/${
+          this.$route.params.id
+        }?code=${res}`;
         this.copyLink(this.giveLink);
       });
     },
@@ -257,11 +274,11 @@ export default {
         this.page.cur = res.current;
         this.page.total = res.total;
         if (res.pages == res.current) {
-          console.log('已无更多')
+          console.log("已无更多");
           if (done) done(true);
           this.noDate = true;
         } else {
-          console.log('更多...')
+          console.log("更多...");
           if (done) done();
           this.page.cur++; //下拉一次页数+1
           this.noDate = false;
@@ -298,7 +315,7 @@ img {
   box-sizing: border-box;
   position: relative;
   .courseContent {
-    height: calc(100vh - 0.9rem);
+    height: calc(100vh - 1.9rem);
     position: relative;
     .record {
       border-top: 1px solid #efefef;
@@ -316,6 +333,7 @@ img {
         .recordLi {
           background: #fff;
           padding: 0 0.2rem;
+          overflow: hidden;
           &:not(:nth-last-child(1)) {
             border-bottom: 1px solid #efefef;
           }
@@ -323,26 +341,31 @@ img {
             display: flex;
             justify-content: space-between;
             align-items: center;
+            padding-top: 0.1rem;
             & > p {
               font-size: 0.32rem;
               color: #000;
-              line-height: 2;
+              line-height: 1.5;
             }
             & > span {
               font-size: 0.32rem;
               color: #000;
               line-height: 2;
+              margin-left: 0.1rem;
             }
           }
           & > p {
             font-size: 0.28rem;
             color: #666;
-            line-height: 2;
+            line-height: 1;
           }
           & > span {
             font-size: 0.28rem;
             color: #666;
-            line-height: 2;
+            line-height: 1;
+            display: block;
+            margin-top: 0.2rem;
+            margin-bottom: 0.1rem;
           }
         }
       }
@@ -354,7 +377,7 @@ img {
     position: absolute;
     left: 0.3rem;
     bottom: 0.1rem;
-    background-color: #26A2FF;
+    background-color: #26a2ff;
     display: flex;
     align-items: center;
     justify-content: center;
@@ -364,7 +387,7 @@ img {
       color: #fff;
     }
   }
-  .wrapper{
+  .wrapper {
     background: #fff;
     width: 75%;
     position: absolute;
@@ -373,37 +396,40 @@ img {
     transform: translate(-50%, -50%);
     border-radius: 0.2rem;
     padding: 0.3rem 0.2rem;
-    .tit{
-      font-size: .32rem;
+    .tit {
+      font-size: 0.32rem;
       color: #333;
-      line-height: .8rem;
+      line-height: 0.8rem;
       text-align: center;
       position: relative;
       font-weight: 600;
       position: relative;
-      .cancle{
+      .cancle {
         position: absolute;
         top: 0;
         right: 0;
-        font-size: .3rem;
-        line-height: .3rem;
+        font-size: 0.3rem;
+        line-height: 0.3rem;
       }
     }
-    .msg{
-      font-size: .27rem;
+    .msg {
+      font-size: 0.27rem;
       text-align: center;
       padding: 0 0.1rem;
     }
-    .copy{
+    .copy {
       text-align: center;
       margin-top: 0.5rem;
-      p{
-        font-size: .22rem;
+      p {
+        font-size: 0.22rem;
         color: #888;
-        line-height: .3rem;
+        line-height: 0.3rem;
         margin-bottom: 0.15rem;
       }
     }
   }
 }
+/deep/ .van-tab--active{
+  font-weight: 600;
+}
 </style>

+ 6 - 1
src/view/course/user/courseDeal.vue

@@ -154,7 +154,12 @@ export default {
     },
     // 返回首页
     onClickLeft() {
-      this.$router.push('/courseHome');
+      if(this.$route.query&&this.$route.query.code){
+        this.$router.push('/courseHome');
+      }else{
+        this.$router.go(-1);
+      }
+      
     },
     // 初始化
     init() {

+ 28 - 19
src/view/course/user/deal.vue

@@ -60,10 +60,7 @@
         v-show="active == 0"
       >
         <div class="dealList">
-          <courseList
-            :dataList="courseList"
-            :listType="2"
-          ></courseList>
+          <courseList :dataList="courseList" :listType="2"></courseList>
         </div>
         <noData :list="courseList" />
       </scroller>
@@ -82,16 +79,20 @@
           >
             <div class="flex-name-num">
               <p>{{ item.subjectName }}</p>
-              <span
+              <span :style="{color:item.toUserId == target_user_info.id ?'#26A2FF':'#eb6f6f'}"
                 >{{ item.toUserId == target_user_info.id ? "收到" : "卖出"
-                }}{{ item.amount }}</span
+                }}{{ item.amount }}</span
               >
             </div>
             <p>{{ item.content }}</p>
             <span>{{ item.createTime }}</span>
           </div>
         </div>
-        <van-divider v-if="recordList.length != 0 && recordList.length == page1.total" style="line-height: .6rem;">没有更多了...</van-divider>
+        <van-divider
+          v-if="recordList.length != 0 && recordList.length == page1.total"
+          style="line-height: .6rem;"
+          >没有更多了...</van-divider
+        >
         <noData :list="recordList" />
       </scroller>
     </div>
@@ -112,7 +113,7 @@ export default {
   data() {
     return {
       title: "交易",
-      activeList: ["待确认的交易", "已交易的记录"],
+      activeList: ["待确认接收的名额", "已确认接收的名额"],
       active: 0,
       noDate: false,
       noDate1: false,
@@ -229,7 +230,7 @@ export default {
         this.page1.total = res.total;
         this.recordList = this.recordList.concat(res.list);
         if (res.pages == this.page1.cur) {
-          console.log("没有更多")
+          console.log("没有更多");
           if (done) done(true);
           this.noDate1 = true;
         } else {
@@ -266,6 +267,7 @@ export default {
     .userImage {
       display: flex;
       align-items: center;
+      flex: 1;
       .info {
         display: flex;
         flex-direction: column;
@@ -290,10 +292,11 @@ export default {
       padding: 0.15rem 0.3rem;
       font-size: 0.26rem;
       font-weight: 550;
-      color: #898989;
-      border: 1px solid #c9c3c0;
+      color: #26A2FF;
+      border: 1px solid #26A2FF;
       border-radius: 0.1rem;
       line-height: 1.5;
+      margin-left: .2rem;
     }
   }
   .user_tabs {
@@ -335,39 +338,45 @@ export default {
       .recordLi {
         background: #fff;
         padding: 0 0.2rem;
+        overflow: hidden;
         &:not(:nth-last-child(1)) {
           border-bottom: 1px solid #efefef;
         }
-        &:first-child{
-          border-radius: .1rem .1rem 0 0;
+        &:first-child {
+          border-radius: 0.1rem 0.1rem 0 0;
         }
-        &:last-child{
-          border-radius: 0 0 .1rem .1rem;
+        &:last-child {
+          border-radius: 0 0 0.1rem 0.1rem;
         }
         .flex-name-num {
           display: flex;
           justify-content: space-between;
           align-items: center;
+          padding-top: 0.1rem;
           & > p {
             font-size: 0.32rem;
             color: #000;
-            line-height: 2;
+            line-height: 1.5;
           }
           & > span {
-            font-size: 0.32rem;
+            font-size: 0.28rem;
             color: #000;
             line-height: 2;
+            margin-left: 0.1rem;
           }
         }
         & > p {
           font-size: 0.28rem;
           color: #666;
-          line-height: 2;
+          line-height: 1;
         }
         & > span {
           font-size: 0.28rem;
           color: #666;
-          line-height: 2;
+          line-height: 1;
+          display: block;
+          margin-top: 0.2rem;
+          margin-bottom: 0.1rem;
         }
       }
     }

+ 10 - 0
src/view/course/user/login.vue

@@ -76,6 +76,13 @@ export default {
       partternY: /\d{6}/
     };
   },
+  watch:{
+    '$route'(to){
+      if(to.path == 'courseLogin'){
+        this.init();
+      }
+    }
+  },
   created() {
     this.init();
   },
@@ -85,6 +92,9 @@ export default {
       if (this.$route.query && this.$route.query.pid) {
         this.pid = this.$route.query.pid;
       }
+      if(JSON.parse(localStorage.getItem("wx_user_info")).marketable){
+        this.$router.push('/courseHome')
+      }
     },
     // 手机号校验
     checkMobile(sMobile) {

+ 79 - 73
src/view/course/user/team.vue

@@ -4,122 +4,128 @@
       class="left-text-bold"
       :title="title"
       left-text="返回"
-      :right-text="type==1?'近30天交易':''"
       left-arrow
       @click-left="onClickLeft"
-      @click-right="onClickRight"
     ></van-nav-bar>
     <div class="teamContent">
-      <scroller
-        :isInitRefresh="false"
-        :on-infinite='getMoreList'
-      >
-      <Team :teamType="type" :teamList="teamList" :count="page.total" @search='search'></Team>
-      <van-divider  :style="{ color: '#333', borderColor: '#333', padding: '10px 16px' }" v-if='teamList.length == page.total'>没有更多了</van-divider>
-    </scroller>
+      <scroller :isInitRefresh="false" :on-infinite="getMoreList">
+        <Team
+          :teamType="type"
+          :teamList="teamList"
+          :count="page.total"
+          @search="search"
+        ></Team>
+        <van-divider
+          :style="{ color: '#333', borderColor: '#333', padding: '10px 16px' }"
+          v-if="teamList.length == page.total"
+          >没有更多了</van-divider
+        >
+      </scroller>
     </div>
   </div>
 </template>
 
 <script>
-import {getDealerTeam,getDealerPerson} from '../api'
-import Team from '../components/CourseTeam'
+import { getDealerTeam, getDealerPerson } from "../api";
+import Team from "../components/CourseTeam";
 export default {
   name: "",
-  components: {Team},
+  components: { Team },
   data() {
     return {
-      canReq:true,
-        type:1,
-        page:{
-          cur:1,
-          size:10,
-          total:0,
-        },
-        teamList:[],
-        keyword:''
+      canReq: true,
+      type: this.$route.params.id,//0 or 1
+      page: {
+        cur: 1,
+        size: 10,
+        total: 0
+      },
+      teamList: [],
+      keyword: ""
     };
   },
   computed: {
-    title(){
-        return this.type==1?'我的团队':'近30天交易'
-    },
+    title() {
+      return this.type == 1 ? "我的团队" : "近30天交易";
+    }
   },
   created() {
-    this.init()
+    this.init();
   },
   methods: {
     // 触底加载
-    getMoreList(){
-      console.log("到底了")
-      if(this.teamList.length<this.page.total && this.canReq){
-        this.canReq = false
+    getMoreList() {
+      console.log("到底了");
+      if (this.teamList.length < this.page.total && this.canReq) {
+        this.canReq = false;
         this.$toast.loading({
           duration: 1,
-          message: '加载中...',
-          forbidClick: true,
-        })
-        this.page.cur+=1
-        this.getList()
+          message: "加载中...",
+          forbidClick: true
+        });
+        this.page.cur += 1;
+        this.getList();
       }
     },
     // 初始化
-    init(){
-        this.getList()
+    init() {
+      this.type = this.$route.params.id;
+      this.getList();
     },
-     //导航左侧返回
-     onClickLeft() {
-      if(this.type){
-        this.$router.go(-1);
-      }else{
-        this.type = 1
-        this.total = 0
-        this.page.cur = 1
-        this.getList();
-      }
+    //导航左侧返回
+    onClickLeft() {
+      this.$router.go(-1);
+      // if (this.type) {
+      //   this.$router.go(-1);
+      // } else {
+      //   this.type = 1;
+      //   this.total = 0;
+      //   this.page.cur = 1;
+      //   this.getList();
+      // }
     },
     //导航右侧30天交易
     onClickRight() {
-        this.type = 0
-        this.total = 0
-        this.page.cur = 1
-        this.getList();
+      this.type = 0;
+      this.total = 0;
+      this.page.cur = 1;
+      this.getList();
     },
     // 获取团队列表
-    getList(){
+    getList() {
       let data = {
-        page:this.page.cur,
-        pageSize:this.page.size,
-        keyword:this.keyword
+        page: this.page.cur,
+        pageSize: this.page.size,
+        keyword: this.keyword
+      };
+      if (this.type==1) {
+        getDealerTeam(data).then(res => {
+          this.teamList = res.list;
+          this.page.total = res.total;
+        });
+      } else if(this.type==2) {
+        getDealerPerson(data).then(res => {
+          this.teamList = res.list;
+          this.page.total = res.total;
+          this.page.cur = res.current;
+        });
       }
-      if(this.type){
-        getDealerTeam(data).then(res=>{
-          this.teamList = res.list
-          this.page.total = res.total
-        })
-      }else{
-        getDealerPerson(data).then(res=>{
-          this.teamList = res.list
-          this.page.total = res.total
-          this.page.cur = res.current
-        })
-      }
-      if(this.teamList.length<this.page.total){
-          this.canReq = true
+      if (this.teamList.length < this.page.total) {
+        this.canReq = true;
       }
     },
     // 搜索
-    search(val){
+    search(val) {
       this.keyword = val;
       this.getList();
-    },
+    }
   }
 };
 </script>
 <style scoped lang="scss">
-.team-x{
-  .teamContent{
-    height: calc(100vh - .92rem);
+.team-x {
+  .teamContent {
+    height: calc(100vh - 0.92rem);
     position: relative;
   }
 }

+ 13 - 11
src/view/course/user/wxAuth.vue

@@ -1,6 +1,6 @@
 <template>
 <div>
-  <van-loading style="position: absolute;top: 10%;left: 50%;transform: translateX(-.3rem);"/>
+  <van-loading style="position: absolute;top: 10%;left: 50%;transform: translateX(-50%);" size="24px">请在微信端打开...</van-loading>
 </div>
 </template>
 
@@ -35,18 +35,20 @@ export default {
       getWxApiToken(wxid).then(token => {
         getUSerInfo(token).then(res => {
           this.user_info = JSON.parse(localStorage.getItem("wx_user_info"));
-          if (this.$route.query && this.$route.query.pid) {
+          if (this.$route.query && this.$route.query.pid&&!this.user_info.marketable) {
             localStorage.setItem("pid", this.$route.query.pid);
             this.$router.replace(`/courseLogin?pid=${this.$route.query.pid}`);
           }else if(this.$route.query && this.$route.query.code){
-            getCourseCodeDetail(this.$route.query.code).then(res=>{
-              if(res != null){
-                this.$router.replace(`/course/courseDeail/${res.subjectId}?code=${this.$route.query.code}`);
-              }else{
-                this.$toast.fail("课程码无效")
-                this.$router.replace(`/courseHome`);
-              }
-            })
+            let codeArr =  this.$route.query.code.split('-')
+            this.$router.replace(`/course/courseDeail/${codeArr[1]}?code=${codeArr[0]}`);
+            // getCourseCodeDetail(this.$route.query.code).then(res=>{
+            //   if(res != null){
+            //     this.$router.replace(`/course/courseDeail/${res.subjectId}?code=${this.$route.query.code}`);
+            //   }else{
+            //     this.$toast.fail("课程码无效")
+            //     this.$router.replace(`/courseHome`);
+            //   }
+            // })
           }else{
             console.log(19)
             this.$router.replace(`/courseHome`);
@@ -60,7 +62,7 @@ export default {
         this.$router.replace(`/courseHome`);
       }).catch(()=>{
         console.log(12)
-        this.getUerInfo(this.wxid)
+        // this.getUerInfo(this.wxid)
       })
     },
     //初始化判断

+ 6 - 3
src/view/course/utils/index.js

@@ -30,9 +30,12 @@ export function isWxEnv(type,data) {
 }
 //请求微信授权
 export function doWeixinLogin(type,data) {
-    let defaultUrl = 'https://3g954g5149.picp.vip/wx/mp/auth/wx65f4dde5ec7c31e7?marketing=1'
-    let dealerUrl = 'https://3g954g5149.picp.vip/wx/mp/auth/wx65f4dde5ec7c31e7?marketing=2&pid='
-    let timinalUrl = 'https://3g954g5149.picp.vip/wx/mp/auth/wx65f4dde5ec7c31e7?marketing=3&expendCode='
+    // let defaultUrl = 'https://3g954g5149.picp.vip/wx/mp/auth/wx65f4dde5ec7c31e7?marketing=1'
+    // let dealerUrl = 'https://3g954g5149.picp.vip/wx/mp/auth/wx65f4dde5ec7c31e7?marketing=2&pid='
+    // let timinalUrl = 'https://3g954g5149.picp.vip/wx/mp/auth/wx65f4dde5ec7c31e7?marketing=3&expendCode='
+    let defaultUrl = `${process.env.BASE_API}/wx/mp/auth/wx65f4dde5ec7c31e7?marketing=1`
+    let dealerUrl = `${process.env.BASE_API}/wx/mp/auth/wx65f4dde5ec7c31e7?marketing=2&pid=`
+    let timinalUrl = `${process.env.BASE_API}/wx/mp/auth/wx65f4dde5ec7c31e7?marketing=3&expendCode=`
     if (getCache("isAndroid")) {
         if (type == 'pid'&&data) {
             window.open(`${dealerUrl}${data}`)

+ 4 - 5
src/view/user/wxInit.vue

@@ -121,14 +121,13 @@ export default {
                 localStorage.setItem("Wx-Token", data.wo_token); // 保存平台账号登录的token
                 getUSerInfo(data.wo_token).then(ress=>{
                   localStorage.setItem("wx_user_info", JSON.stringify(ress));
-                  if(request.type == 10&&request.pid){
+                  if(request.type == 10&&request.pid&&!ress.marketable){
                     this.$router.push(`/courseHome?pid=${request.pid}`)
-                  }else if(request.type == 11&&request.expendCode){
-                    let arr = request.expendCode.toString().split('-');
+                  }else if(request.type == 11&&request.expendCode&&request.subjectId){
                     this.$router.push({
-                      path:`/course/courseDetail/${arr[1]}`,
+                      path:`/course/courseDetail/${request.subjectId}`,
                       query:{
-                        code:arr[0]
+                        code:request.expendCode
                       }
                     })
                   }else{

二進制
static/images/course_dingdan.png


二進制
static/images/course_ewm.png


二進制
static/images/course_team.png