Browse Source

解决搜索页,进入播放页慢的问题

DESKTOP-6ESHLVF\admin 4 years ago
parent
commit
289759d43f

+ 2 - 1
src/views/patient/reservation/specialist.vue

@@ -201,11 +201,12 @@ export default {
     jumpToVideoDetail(currentVideoIndex, currentVideoList, currentPageIndex) {
       // this.$router.push({ name: "healthCourse", query: { id } });
       console.log(currentVideoIndex, currentVideoList, currentPageIndex);
+      localStorage.setItem("currentVideoList", JSON.stringify(currentVideoList) )
       this.$router.push({
         name: "videoPlay",
         query: {
           currentVideoIndex,
-          currentVideoList: JSON.stringify(currentVideoList),
+          // currentVideoList: JSON.stringify(currentVideoList),
           currentPageIndex,
           videoTotal: this.videoTotal,
           source: "specialist",

+ 2 - 1
src/views/shortVideo/LikeVideo.vue

@@ -47,10 +47,11 @@ export default {
     // 跳转到视频播放页面
     jumpTo(currentVideoIndex, currentVideoList, currentPageIndex){
       console.log(currentVideoIndex, currentVideoList, currentPageIndex);
+      localStorage.setItem("currentVideoList", JSON.stringify(currentVideoList) )
       this.$router.push({
         name: 'videoPlay',
         query: {currentVideoIndex, 
-        currentVideoList: JSON.stringify(currentVideoList), 
+        // currentVideoList: JSON.stringify(currentVideoList), 
         currentPageIndex, source: "likeVideo", videoTotal: this.videoTotal}
       })
     },

+ 2 - 1
src/views/shortVideo/MyVideos.vue

@@ -143,11 +143,12 @@ export default {
 
     // 跳转视频播放页面
     jumpTo(currentVideoIndex, currentVideoList, currentPageIndex) {
+      localStorage.setItem("currentVideoList", JSON.stringify(currentVideoList) )
       this.$router.push(
         {
           name: "videoPlay",
           query: { currentVideoIndex, 
-          currentVideoList: JSON.stringify(currentVideoList), 
+          // currentVideoList: JSON.stringify(currentVideoList), 
           currentPageIndex, source: "myVideos", videoTotal: this.videoTotal }
         }
       )

+ 4 - 2
src/views/shortVideo/SearchVideo.vue

@@ -231,9 +231,11 @@ export default {
     // 跳转
     jumpTo(currentVideoIndex, currentVideoList, currentPageIndex) {
       console.log(currentVideoIndex, currentVideoList, currentPageIndex)
-      
+      localStorage.setItem("currentVideoList", JSON.stringify(currentVideoList) )
+
+
       this.$router.push({ name: "videoPlay", query: { currentVideoIndex, 
-      currentVideoList: JSON.stringify(currentVideoList), 
+      // currentVideoList, 
       currentPageIndex, source: "searchVideo", userKey: this.userKey, videoTotal: this.videoTotal } })
     },
 

+ 6 - 2
src/views/shortVideo/VideoPlay.vue

@@ -49,6 +49,8 @@ import { Swiper, SwiperSlide } from "vue-awesome-swiper";
 import videos from "../../components/shortVideo/Videos";
 import infoBar from "../../components/shortVideo/InfoBar";
 import comment from "../../components/shortVideo/Comment";
+var host2 = process.env.VUE_APP_Url; 
+
 import {
   addPlay,
   searchVideoList,
@@ -154,7 +156,9 @@ export default {
     this.currentVideoIndex = this.$route.query.currentVideoIndex;
     this.videoTotal = this.$route.query.videoTotal;
     this.params.name = this.$route.query.userKey || "";
-    this.videoList = JSON.parse(this.$route.query.currentVideoList) ;
+    // this.videoList = this.$route.query.currentVideoList ;
+    this.videoList =JSON.parse(localStorage.getItem("currentVideoList")) 
+    localStorage.removeItem("currentVideoList")
     this.params.accountid = this.$route.query.accountid || "";
     this.customShare()
   },
@@ -175,7 +179,7 @@ export default {
       wx.onMenuShareAppMessage({
         title: '亮健优医', // 分享标题
         desc: that.videoList[that.page].videoTitle, // 分享描述
-        link: `https://mem.360lj.com/ym2/api/Home/Login?identity=0&backurl=https://mem.360lj.com/ym2/dist/oneVideoPlayer?id=${that.videoList[that.page].id}`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+        link: host2+`/ymallWechat/code?redirectCode=oneVideoPlayer?id=${that.videoList[that.page].id}`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
         imgUrl: 'https://image.360lj.com/userfiles/images/202005ymall/d5d11cda-826a-42fa-a1d0-78181de4a9cd.png', // 分享图标
         type: '', // 分享类型,music、video或link,不填默认为link
         dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空