Bladeren bron

请求多课程所有目录

xuqiaoying 3 jaren geleden
bovenliggende
commit
36c30187e5
2 gewijzigde bestanden met toevoegingen van 22 en 13 verwijderingen
  1. 6 6
      common/request.js
  2. 16 7
      pages3/polyv/detail.vue

+ 6 - 6
common/request.js

@@ -5,22 +5,22 @@ import method from '@/common/methodTool.js'
 import api from './api.js'
 var num = 1
 //接口api   
-export const BASE_URL = 'https://api.xyyxt.net'   //release
+// export const BASE_URL = 'https://api.xyyxt.net'   //release
 // export const BASE_URL = 'https://test.xyyxt.net'   //预发布
-// export const BASE_URL = 'http://120.79.166.78:19012' // 测试环境
+export const BASE_URL = 'http://120.79.166.78:19012' // 测试环境
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test(后端本地)
 // export const BASE_URL = 'http://192.168.1.222:5055'    //后端本地更新到222
 // export const BASE_URL = 'http://192.168.1.24:5055'    //后端本地
 // export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
 
  //图片上传api
-export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release
-// export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'  //test
+// export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release
+export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'  //test
 
 // web_view的
-export const WEBVIEW_URL = 'https://m.xyyxt.net/'  //release
+// export const WEBVIEW_URL = 'https://m.xyyxt.net/'  //release
 // export const WEBVIEW_URL = 'https://testm.xyyxt.net/'  //预发布
-// export const WEBVIEW_URL = 'http://120.79.166.78:18001/' // 测试环境
+export const WEBVIEW_URL = 'http://120.79.166.78:18001/' // 测试环境
 // export const WEBVIEW_URL = 'http://api.xyyxt.net:6066/'  //预发布(弃用了)
 
 // export const socket_url = 'ws://42.192.164.187:19005/webSocket/'  //test

+ 16 - 7
pages3/polyv/detail.vue

@@ -127,6 +127,8 @@
 						<view class="note">正在直播中</view>
 						<view class="title">{{livingItem.sectionName}}</view>
 					</view>
+          <!-- <view class="all_item" v-for="(cou, c_index) in goodsTeacher" :key="c_index"> -->
+            <!-- <view class="cou_title">{{ cou.}}</view> -->
           <view v-if="teacherList && teacherList.length > 0" class='teacher_names'>
               <view v-for="(tea, index) in teacherList" :key="index" class="names"
                 :class="{nactive: teacherIndex == index}" @click="activeFunc(tea, index)">
@@ -197,6 +199,7 @@
             ></view>
             <!-- @togoBack="togoBack($event)" -->
           </view>
+          <!-- </view> -->
         </view>
         <!--讲义 -->
         <view v-show="current == 1">
@@ -998,9 +1001,15 @@ export default {
             this.teacherList = item.teaList
           }
         })
+
+        this.goodsTeacher.forEach(async (item) => {
+          let courseItem = await this.getMenuList(item.courseList[0].courseId)
+          console.log('==', courseItem);
+          item['courseMeun'] = courseItem
+        })
+        console.log('===,== this.goodsTeacher', this.goodsTeacher);
       }) 
     },
-    
     // 原来onshow里面的内容
     originOnShow() {
       console.log('原来onshow里面的originOnShow')
@@ -3046,12 +3055,11 @@ export default {
           }
         });
     },
-    getMenuList() {
-      // console.log('menuList的目录');
-      let self = this;
+    getMenuList(courseId = this.courseId) {
+      console.log('menuList的目录courseId:', courseId);
       // /course/menuList 查询课程目录结构列表
-      this.$api
-        .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
+      return this.$api
+        .reMenuList({ courseId: courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
         .then((res) => {
           if (res.data.code == 200) {
             for (let i = 0; i < res.data.rows.length; i++) {
@@ -3061,7 +3069,7 @@ export default {
               item.name = item.menuName;
               item.menuType = item.type;
             }
-            self.menuList = res.data.rows;
+            this.menuList = res.data.rows;
             this.reStart = true
             for (let i = 0; i < res.data.rows.length; i++) {
               if (res.data.rows[i].type == 1) {
@@ -3092,6 +3100,7 @@ export default {
             }
             console.log('menuList: ---', this.menuList, 'menuIndex:', this.menuIndex);
           }
+          return Promise.resolve(this.menuList)
         });
     },
     courseDetail() {