zhuxinbo пре 5 година
родитељ
комит
29d514711c

+ 46 - 44
src/views/modules/headerLibrary/index.vue

@@ -15,14 +15,21 @@
   <a-row :gutter="10">
     <a-col :sm="10" style="margin-bottom: 20px;z-index: 10">
       <a-card class="search-box" style="min-height:500px">
-        行业
-        <a-cascader
-          style="margin-top: 1rem;width:300px"
-          :options="options"
-          placeholder="Please select"
-        >
-          <a-icon type="smile" slot="suffixIcon" class="test" />
-        </a-cascader>
+        <div>
+          行业
+          <a-cascader
+            style="margin-top: 1rem;width:300px"
+            :options="options"
+            :showSearch="{ filter }"
+            expandTrigger="hover"
+            @change="onChange"
+            placeholder="请选择行业"
+          >
+            <a-icon type="smile" slot="suffixIcon" class="test" />
+          </a-cascader>
+        </div>
+
+        关键词
       </a-card>
     </a-col>
     <a-col :sm="14" style="margin-bottom: 20px;z-index: 10">
@@ -41,53 +48,48 @@ export default {
   name: 'online-training-list',
   data() {
     return {
-      options: [
-        {
-          value: 'zhejiang',
-          label: 'Zhejiang',
-          children: [
-            {
-              value: 'hangzhou',
-              label: 'Hangzhou',
-              children: [
-                {
-                  value: 'xihu',
-                  label: 'West Lake'
-                }
-              ]
-            }
-          ]
-        },
-        {
-          value: 'jiangsu',
-          label: 'Jiangsu',
-          children: [
-            {
-              value: 'nanjing',
-              label: 'Nanjing',
-              children: [
-                {
-                  value: 'zhonghuamen',
-                  label: 'Zhong Hua Men'
-                }
-              ]
-            }
-          ]
-        }
-      ]
+      options: []
     }
   },
   components: {},
   methods: {
     getHangye() {
-      postAction('/ctop/creativeTitle/getTitleLabel', '').then(res => {
+      getAction('/ctop/creativeTitle/getTitleLabel', '').then(res => {
         console.log(res)
+        if (res.success) {
+          this.options = res.result.map(item => {
+            return {
+              label: item.label,
+              value: item.value,
+              children:
+                item.children.length > 0
+                  ? [{ label: '不限', value: 0 }].concat(item.children)
+                  : [{ label: '不限', value: 0 }]
+            }
+          })
+        }
       })
+    },
+    onChange(value, selectedOptions) {
+      console.log(value, selectedOptions)
+    },
+    getTitle() {
+      // /ctop/creativeTitle/titleSearch
+      getAction('/ctop/creativeTitle/titleSearch', { firstCategory: 1, secondCategory: 0, keywords: '游戏' }).then(
+        res => {
+          console.log(res)
+        }
+      )
+      // firstCategory,secondCategory,keywords
+    },
+    filter(inputValue, path) {
+      return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1)
     }
   },
   mounted() {
     this.$nextTick(() => {
-        this.getHangye()
+      this.getHangye()
+      this.getTitle()
     })
   },
   created() {}

+ 10 - 30
src/views/modules/onlineTraining/onlineTrainingList.vue

@@ -231,21 +231,21 @@ export default {
             this.course = res.result
             if (res.result.fileType == 1) {
               this.startList = false
-              var videoObject = null
-              var isChrome = window.navigator.userAgent.indexOf('Chrome') !== -1 //不同的浏览器显示方式不一样, 不是chrome的浏览器需要使用hls.js这个文件
-              if (isChrome) {
-                videoObject = this.videoObject
-              } else {
-                videoObject = this.videoObjectNot
-              }
+            //   var videoObject = null
+            //   var isChrome = window.navigator.userAgent.indexOf('Chrome') !== -1 //不同的浏览器显示方式不一样, 不是chrome的浏览器需要使用hls.js这个文件
+            //   if (isChrome) {
+            //     videoObject = this.videoObject
+            //   } else {
+            //     videoObject = this.videoObjectNot
+            //   }
               if (res.result.fileId) {
-                videoObject.video = textDes(
+                this.videoObject.video = textDes(
                   'https://aweme.snssdk.com/aweme/v1/playwm/?video_id=' + res.result.fileId + '&line=0'
                 )
               } else {
-                videoObject.video = textDes(res.result.fileUrl)
+                this.videoObject.video = textDes(res.result.fileUrl)
               }
-              let player = new ckplayer(videoObject)
+              let player = new ckplayer(this.videoObject)
             } else {
               this.startList = true
               getAction('http://www.ljserver.cn:8088/v1/api/file/getViewUrlWebPath', {
@@ -260,26 +260,6 @@ export default {
             }
           }
         })
-
-        // if (keys[0] == '11') {
-        //   this.startList = false
-        //   this.videoObject.video = textDes(
-        //     'https://ctop-media.oss-cn-beijing.aliyuncs.com/video/2020-03-25/0324%E6%96%97%E5%9C%B0%E4%B8%BB%20%E6%9B%B9%E7%90%B33-1585130744273.mp4'
-        //   )
-        // } else {
-        //   this.startList = true
-        //   getAction('http://www.ljserver.cn:8088/v1/api/file/getViewUrlWebPath', {
-        //     fileUrl: 'https://ctop-media.oss-cn-beijing.aliyuncs.com/zixingche.docx'
-        //   }).then(res => {
-        //     console.log(res)
-        //     let r = res.data
-        //     sessionStorage.wpsUrl = r.wpsUrl
-        //     sessionStorage.token = r.token
-        //     this.openWps(r.wpsUrl, r.token)
-        //   })
-        // }
-
-        // let player = new ckplayer(this.videoObject)
       } else {
         return
       }