Pārlūkot izejas kodu

讲义详情完成

谢杰标 2 gadi atpakaļ
vecāks
revīzija
da96bf4604

+ 10 - 0
components/course/handoutsBox.vue

@@ -2,6 +2,7 @@
   <view>
     <template v-if="courseHandoutsData.handoutsId">
       <u-search
+        v-if="isShowSearch"
         placeholder="搜索讲义名称"
         bg-color="#ffffff"
         margin="0 0 20rpx"
@@ -17,6 +18,7 @@
       >
         <handouts-tree
           :canDownload="courseHandoutsData.canDownload"
+          :isShowDownIcon="isShowDownIcon"
           :fileInfo="item"
         ></handouts-tree>
       </view>
@@ -33,6 +35,14 @@ export default {
     handoutsId: {
       type: Number,
     },
+    isShowSearch: {
+      type: Boolean,
+      default: true,
+    },
+    isShowDownIcon: {
+      type: Boolean,
+      default: true,
+    },
   },
   data() {
     return {

+ 8 - 2
components/course/handoutsTree.vue

@@ -18,6 +18,7 @@
       <view v-show="!down">
         <view v-for="item in fileInfo.children" :key="item.fileId">
           <handouts-tree
+            :isShowDownIcon="isShowDownIcon"
             :canDownload="canDownload"
             :fileInfo="item"
           ></handouts-tree>
@@ -33,7 +34,7 @@
           </view>
         </view>
 
-        <view @click="openDocument">
+        <view @click="openDocument" v-if="isShowDownIcon">
           <image
             v-if="!downLoading"
             src="/pages3/static/imgs/downLoad.png"
@@ -63,6 +64,10 @@ export default {
     canDownload: {
       type: Number,
     },
+    isShowDownIcon: {
+      type: Boolean,
+      default: true,
+    },
   },
   data() {
     return {
@@ -140,7 +145,8 @@ export default {
   height: 78rpx;
   padding-right: 20rpx;
   .title {
-    flex: 1;
+    // flex: 1;
+    width: 90%;
     font-size: 26rpx;
     color: #333;
     .pathtips {

+ 4 - 4
components/tabbar/index.vue

@@ -23,14 +23,14 @@ export default {
       list: [
         {
           pagePath: "/pages/index/index",
-          iconPath: "./../../static/nav1.png",
-          selectedIconPath: "./../../static/nav1_on.png",
+          iconPath: "/../../static/nav1.png",
+          selectedIconPath: "/../../static/nav1_on.png",
           text: "首页",
         },
         {
           pagePath: "/pages/course/index",
-          iconPath: "./../../static/nav2.png",
-          selectedIconPath: "./../../static/nav2_on.png",
+          iconPath: "/../../static/nav2.png",
+          selectedIconPath: "/../../static/nav2_on.png",
           text: "选课",
         },
         {

+ 16 - 0
pages.json

@@ -806,6 +806,22 @@
             }
           }
         },
+        {
+          "path": "course/jydetail",
+          "style": {
+            "navigationBarTitleText": "祥粤云学堂",
+            "navigationStyle": "custom", // 隐藏系统导航栏
+            "app-plus": {
+              "titleNView": false, //禁用原生导航栏
+              "bounce": "none"
+            },
+            "mp-weixin": {
+              "usingComponents": {
+                "polyv-player": "plugin://polyv-player/player"
+              }
+            }
+          }
+        },
         {
           "path": "live/detail",
           "style": {

+ 2 - 3
pages/information/index.vue

@@ -159,7 +159,7 @@ page {
   padding: 16rpx;
   position: relative;
   .search-box {
-    height: 96rpx;
+    height: 106rpx;
     width: calc(100% - 32rpx);
     position: fixed;
     background: #eaeef1;
@@ -168,10 +168,9 @@ page {
   }
 }
 .goods-list {
-  margin-top: 40px;
+  margin-top: 46px;
   .list_item {
     padding: 24rpx;
-    // height: 278rpx;
     background: #ffffff;
     box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(1, 99, 235, 0.1);
     border-radius: 24rpx;

+ 3 - 0
pages2/wd/stuff.vue

@@ -101,6 +101,9 @@ export default {
         });
         return;
       }
+      uni.navigateTo({
+        url: "/pages3/course/jydetail?id=" + item.goodsId,
+      });
     },
     toChoose() {
       uni.reLaunch({

+ 19 - 3
pages3/course/detail.vue

@@ -1,5 +1,5 @@
 <template>
-  <view>
+  <view style="padding-bottom: 140rpx">
     <nav-bar title="课程详情"></nav-bar>
     <view class="videoBox">
       <!-- <view > -->
@@ -263,7 +263,14 @@
         </view>
       </view>
       <!-- 讲义资料 -->
-      <view v-show="current == 3">123</view>
+      <view v-show="current == 3" style="padding: 0 10rpx">
+        <handouts-box
+          :isShowSearch="false"
+          :isShowDownIcon="false"
+          :handoutsId="detail.handoutsId"
+          v-if="detail.handoutsId"
+        />
+      </view>
     </view>
 
     <view class="bottomBox" v-if="!hideBuyState">
@@ -405,12 +412,14 @@
 import courseModule from "@/components/course/courseModule.vue";
 import courseChapter from "@/components/course/courseChapter.vue";
 import courseSection from "@/components/course/courseSection.vue";
+import handoutsBox from "@/components/course/handoutsBox.vue";
 import { mapGetters, mapMutations } from "vuex";
 export default {
   components: {
     courseModule,
     courseChapter,
     courseSection,
+    handoutsBox,
   },
   data() {
     return {
@@ -523,6 +532,14 @@ export default {
     if (!this.isJx) {
       this.goodsCourseList();
       this.appCommonGoodsCourseModuleFreeExamList();
+    } else {
+      this.list = [
+        {
+          name: "资料目录",
+          value: 3,
+        },
+      ];
+      this.current = 3;
     }
 
     // #ifdef MP-WEIXIN
@@ -664,7 +681,6 @@ export default {
     },
     select(val) {
       val.check = !val.check;
-      console.log(val, 6666);
     },
     checkboxChange(val) {
       if (!this.isSingleChoice) return;

+ 64 - 0
pages3/course/jydetail.vue

@@ -0,0 +1,64 @@
+<template>
+  <view class="detail_wrap">
+    <nav-logo title="祥粤云学堂"></nav-logo>
+    <view class="detail_wrap_title">{{ goodsDetail.goodsName }}</view>
+    <view class="content">
+      <handouts-box
+        :handoutsId="goodsDetail.handoutsId"
+        v-if="goodsDetail.handoutsId"
+      />
+    </view>
+  </view>
+</template>
+
+<script>
+import handoutsBox from "@/components/course/handoutsBox.vue";
+export default {
+  name: "SaasMiniprogramJydetail",
+
+  data() {
+    return {
+      options: {},
+      goodsDetail: {},
+    };
+  },
+
+  async onLoad(options) {
+    this.options = options;
+    if (this.options.skipPort) {
+      await this.$method.skipLogin(this.options.skipPort);
+    }
+    if (this.$method.isGoLogin()) {
+      return;
+    }
+    this.getGoodsDetail();
+  },
+
+  methods: {
+    getGoodsDetail() {
+      this.$api.goodsDetail(this.options.id).then((res) => {
+        this.goodsDetail = res.data.data;
+      });
+    },
+  },
+  components: {
+    handoutsBox,
+  },
+};
+</script>
+<style>
+page {
+  background: #eaeef1;
+}
+</style>
+<style lang="scss" scoped>
+.content {
+  padding: 16rpx;
+}
+.detail_wrap_title {
+  background: #ffffff;
+  color: #222222;
+  font-size: 32rpx;
+  padding: 30rpx 106rpx 28rpx 22rpx;
+}
+</style>