Ver Fonte

查看课程 价格为0 不显示价格,且去掉购买流程,机构免费授权也去掉购买流程

dusenyao há 2 anos atrás
pai
commit
e09fc84d3b
2 ficheiros alterados com 13 adições e 8 exclusões
  1. 2 1
      .vscode/settings.json
  2. 11 7
      src/views/course_details/index.vue

+ 2 - 1
.vscode/settings.json

@@ -5,7 +5,8 @@
     "titleBar.activeForeground": "#15202b",
     "titleBar.inactiveBackground": "#42b88399",
     "titleBar.inactiveForeground": "#15202b99",
-    "sash.hoverBorder": "#65c89b"
+    "sash.hoverBorder": "#65c89b",
+    "commandCenter.border": "#15202b99"
   },
   "peacock.color": "#42b883",
   "i18n-ally.localesPaths": ["src/locales/lang"],

+ 11 - 7
src/views/course_details/index.vue

@@ -82,13 +82,13 @@
               </div>
 
               <div v-if="!readonly">
-                <span class="price">
+                <span v-show="CourseData.price !== 0" class="price">
                   ¥
                   <span class="price_1" v-text="changePrice('1', CourseData.price)"></span>
                   <span class="price_2" v-text="changePrice('2', CourseData.price)"></span>
                 </span>
                 <button class="get" @click="getPurchase">
-                  {{ is_buy ? $t('Key390') : $t('Key391') }}
+                  {{ is_buy || is_free_license || CourseData.price === 0 ? $t('Key390') : $t('Key391') }}
                 </button>
                 <span class="collection" @click="addOrDeleteMyCollection">
                   <svg-icon :icon-class="collection ? 'collection-solid' : 'collection'" />
@@ -314,7 +314,7 @@ export default {
     return {
       goods_id: query.goods_id,
       goods_type: Number(query.goods_type),
-      readonly: 'readonly' in query ? query.readonly : false,
+      readonly: 'readonly' in query ? query.readonly === 'true' : false,
       // 调用模块
       invok_module: query.invok_module,
       collection: false,
@@ -324,6 +324,7 @@ export default {
       auditShow: false,
       loading: false,
       is_buy: false,
+      is_free_license: false, // 是否机构免费授权
       CourseData: null,
       isData: false,
       courseContentList: [
@@ -342,9 +343,12 @@ export default {
   created() {
     // 获取课程详情
     this.loading = true;
-    CheckMyGoodsBuyStatus({ goods_type: this.goods_type, goods_id: this.goods_id }).then(({ is_buy }) => {
-      this.is_buy = is_buy === 'true';
-    });
+    CheckMyGoodsBuyStatus({ goods_type: this.goods_type, goods_id: this.goods_id }).then(
+      ({ is_buy, is_free_license }) => {
+        this.is_buy = is_buy === 'true';
+        this.is_free_license = is_free_license === 'true';
+      }
+    );
     GetCourseInfoBox({ id: this.goods_id })
       .then((res) => {
         this.CourseData = res;
@@ -427,7 +431,7 @@ export default {
     // 购买   需要先加入课程 审核 审核通过之后才能购买课程
     getPurchase() {
       // 购买通道关闭
-      if (this.is_buy) {
+      if (this.is_buy || this.is_free_license || this.CourseData.price === 0) {
         return this.$router.push('/');
       }
       if (!this.backTime) {