绿满眶商城微信小程序-uniapp
peng
2025-06-27 7673b8272cfd9fc21161b70e35c263e455b59966
pages/health/healthVideo.vue
@@ -1,5 +1,6 @@
<template>
  <view class="video-container">
    <top-bar selectedTitleIndex="health" textColor="black" @changeTab="topBarChange" class="topBar"></top-bar>
   <!-- 视频加载 -->
   <zero-loading v-show="videoLoading" type="circle" color="#0ebd57" text=""></zero-loading>
    <!-- 视频列表 -->
@@ -35,7 +36,7 @@
            :autoplay="index === currentIndex"
            :controls="false"
            :loop="true"
            :object-fit="item.objectFit"
            :object-fit="item.videoFit"
            :enable-progress-gesture="false"
            :show-center-play-btn="false"
            class="video-item"
@@ -241,6 +242,7 @@
</template>
<script>
import TopBar from "@/components/TopBar.vue";
import { getHealthRecommendVideos, savePlayRecord, subscribe, getVideoComments, addVideoComment, thubmsUpComment, cancelThubmsUpComment } from "@/api/video.js";
import { changeCollect } from "@/api/collect.js";
import { saveShare, saveShareClickRecord } from "@/api/share.js";
@@ -248,6 +250,7 @@
import { getUserInfo } from "@/api/members";
import storage from "@/utils/storage.js";
export default {
  components: {TopBar},
  computed: {
       hasPlayTime() {
         return this.sliderFormatTime(this.progress > 0 ? this.duration * this.progress / 100 : 0);
@@ -379,6 +382,17 @@
     }
  },
  methods: {
     topBarChange(titleObj) {
        if (titleObj.index === 'home') {
           uni.switchTab({
              url: titleObj.pagePath
           });
        } else {
           uni.redirectTo({
              url: titleObj.pagePath
           });
        }
     },
     // 静默登录
     wxSilentLogin(callback) {
        //获取code
@@ -1361,4 +1375,10 @@
   .custom-share-btn::after {
     border: none;
   }
   .topBar {
      position: fixed;
      top: 20rpx;
      left: 20rpx;
      z-index: 1000
   }
</style>