3***@qq.com
3***@qq.com
  • 发布:2025-03-21 17:57
  • 更新:2025-03-21 17:57
  • 阅读:38

快手小程序视频列表指定下标播放问题

分类:uni-app
<swiper class="swiper" vertical :interval="interval" :duration="duration" @animationfinish="animationfinish"  
        :current="position" @touchstart="onTouchStart" @touchend="onTouchEnd">  
        <swiper-item v-for="(item, index) in list" :key="item.id">  
            <view class="swiper-item uni-bg-red">  

                <view @click="change">  
                    <video class="video" :id="'video'+index" :src="item.videoUrl" :controls="false"  
                        :show-center-play-btn="false" :show-play-btn="false" :show-fullscreen-btn="false"  
                        @play="handleVideoPlay(index, item.id,item.uid)" @error="videoErrorCallback"  
                        @fullscreenchange="onFullscreenchange" @click.stop="change(item.uid)">  
                    </video>  
                    <!-- 暂停时播放按钮 -->  
                    <view class="play-btn" :style="{left:`${width/2-20}px`,top:`${height/2-50}px`}"  
                        v-if="showPlayBtn">  
                        <image src="/static/home/icon_paly_home.png"  
                            style="height: 58rpx;width: 58rpx; display: flex;justify-content: center;align-items: center;">  
                        </image>  
                    </view>  
                </view>  
                <!-- 标题及小标题 -->  
                <view class="info">  
                    <view class="text_title">@{{ item.nickname }}</view>  
                    <view style="text_title">{{ item.title }}</view>  
                    <!-- <text-over-flow placeholder1="展开" :dt="item.title" enableButton="true" expandText="展开"  
                            foldHint="收起" line="2"></text-over-flow> -->  
                </view>  

                <!-- 右侧按钮 -->  
                <view class="btns" :style="{height: height_tou+'px'}" @click.stop>  
                    <view class="avatar-container">  
                        <!-- 头像 -->  
                        <image class="toux" :style="avatarStyle"  
                            :src="item && item.avatarurl ? $http.imgPath(item.avatarurl) : '/static/placeholder/placeholder_avatar.png'"  
                            @click="user(item.uid)">  
                        </image>  
                        <view class="follow-btn" v-if="user_id!== item.uid">  
                            <image class="follow-icon"  
                                :src="item.is_follow==1 ? '/static/home/icon_follow_dui.png' : '/static/home/icon_follow_jia.png'"  
                                @click="toggleFollow(index, item)">  

                        </view>  
                    </view>  

                    <view class="buttons-container">  
                        <image class="btn"  
                            :src="item.is_zan==1 ? '/static/home/icon_collect_img2.png' : '/static/home/icon_collect_img.png'"  
                            @click="toggleCollect(index, item)">  
                            <text class="text">{{item.zan}}</text>  

                            <!-- #ifdef MP-WEIXIN || MP-KUAISHOU -->  

                            <button style="border-color: transparent;" size="mini" type="default" plain="true"  
                                @click="showShare(item.id)" open-type="share">  
                                <image class="btn" src="/static/home/fenxiang.png">  
                                </image>  

                            </button>  
                            <text class="text">{{item.share}}</text>  

                            <!-- #endif -->  
                            <!-- #ifdef APP -->  
                            <image class="btn" src="/static/home/fenxiang.png" @click="showShare(item.id)"></image>  
                            <text class="text">{{item.share}}</text>  

                            <!-- #endif -->  

                            <image class="btn" src="/static/home/icon_report_img.png" @click="showReport(item.id)">  
                            </image>  
                            <text class="text">举报</text>  

                            <image class="btn" src="/static/home/icon_by_telephone.png"  
                                @click="showByTelephone(item.mobile)">  
                            </image>  
                            <text class="text">咨询</text>  

                            <text class="text2">{{ item.hits > 999 ? item.hits + '+' : item.hits }}</text>  
                            <text class="text">播放量</text>  
                    </view>  
                </view>  
            </view>  
        </swiper-item>  
    </swiper>  

onLoad(options) {
const index = options.index; // 获取传递的下标
const currentPage = options.currentPage; // 获取传递的当前页数

        this.currentPage = options.currentPage;  
        this.class_id = options.classid;  
        this.address = options.address;  
        this.type = options.type;  
        this.user_id = options.user_id;  
        console.log('当前分类===:', this.user_id);  
        this.keywords = options.keywords;  
        this.brand_id = options.brand_id;  
        this.vehicle_id = options.vehicle_id  
        this.position = Number(options.index);}   以上代码实现全屏视频列表上下滑动功能,遇到的问题是,快手端小程序  上个页面传值对应的下标,没有播放到对应的下标视频,uni.navigateTo({  
                url: '/pages/home/home_video_ks_details' + '?index=' + index + '&currentPage=' + currentPage +  
                    '&classid=' + classid +  
                    '&address=' + address + '&type=1' + '&keywords=' + keywords +  
                    '&brand_id=' + brand_id + '&vehicle_id=' + vehicle_id,  

            });     :current="position"  这个方法动态不生效
2025-03-21 17:57 负责人:无 分享
已邀请:

要回复问题请先登录注册