1121 lines
41 KiB
Plaintext
1121 lines
41 KiB
Plaintext
<template>
|
||
<view class="container">
|
||
<!--
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
注意:这是 App 所用页面,请勿引入微信小程序或浏览器运行,最好运行在真机
|
||
|
||
1. new_index.nvue、index.nvue这两个是App页面
|
||
|
||
2. index.nvue - 页面预加载使用 - 在线预加载方案
|
||
|
||
3. 另外:data.js 是上一版本留下的假数据,这一版改成了 URL 请求了(如不需要可以删除,也可作为后端请求参考)
|
||
|
||
4. 请各位大神多多留手,我已经把请求内存开到最大了
|
||
|
||
5. 视频 id 切记是字符串类型
|
||
|
||
6. 这里仅 App 端引入了 App 端专用评论,小程序 、H5 引入的时候 可以作为参考
|
||
|
||
【
|
||
App、小程序、H5评论请参考插件:https://ext.dcloud.net.cn/plugin?id=7875
|
||
】
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
-->
|
||
<!-- <view @click="tolistVideo" style="position: fixed; margin-top: 100rpx; right: 40rpx;">
|
||
<text style="padding: 10rpx; padding-left: 40rpx; padding-right: 40rpx; border-radius: 20rpx; background-color: #F8F8F8; font-size: 14px;">H5/小程序</text>
|
||
</view> -->
|
||
<!-- <view @click="autoPlay" style="position: fixed; margin-top: 100rpx; left: 40rpx;">
|
||
<text style="padding: 10rpx; padding-left: 40rpx; padding-right: 40rpx; border-radius: 20rpx; background-color: #F8F8F8; color: #007AFF; font-weight: bold; font-size: 14px;">{{autoplayText}}</text>
|
||
</view>
|
||
<view @click="previewVideo" style="position: fixed; margin-top: 200rpx; right: 40rpx;">
|
||
<text style="padding: 10rpx; padding-left: 40rpx; padding-right: 40rpx; border-radius: 20rpx; background-color: #F8F8F8; font-size: 14px;">App端-预览视频界面</text>
|
||
</view>
|
||
<view @click="wxh5Video" style="position: fixed; margin-top: 300rpx; right: 40rpx;">
|
||
<text style="padding: 10rpx; padding-left: 40rpx; padding-right: 40rpx; border-radius: 20rpx; background-color: #F8F8F8; font-size: 14px;">微信/H5端-预览视频界面</text>
|
||
</view> -->
|
||
<image v-if="isShowAixin" src="../static/img/index/aixining.png" :style="'position: fixed; margin-left: '+ aixinLeft +'px; margin-top: '+ aixinTop +'px; width: 70px; height: 65px; transform: rotate('+ Rotate +'deg);'"></image>
|
||
<view :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;'">
|
||
<!--
|
||
1.这里的 swiper 不是用来控制视频滑动的,而是用来控制左右滑动的,如果不需要的可以改成 view
|
||
|
||
2.为了 视频无限加载,已经把 21 行的 appear 去掉了,加上了 loadmore 方法(第10行)
|
||
|
||
3.由于方法比较多,可以采取下面的方式查看代码:
|
||
(1)Mac:按住 option 键,然后点击方法名,即可跳转到方法
|
||
(2)windows:按住 Alt 键,然后鼠标左击,即可跳转到方法
|
||
-->
|
||
<list @loadmore="getData" @scroll="scrolls" :loadmoreoffset="wHeight*3" :show-scrollbar="false" ref="listBox" :pagingEnabled="true" :scrollable="true">
|
||
<!-- 刷新模块 -->
|
||
<refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown" :display="refreshing ? 'show' : 'hide'">
|
||
<loading style="background-color: #FFFFFF;">
|
||
<image src="../static/img/index/logins.gif" :style="'width: 80rpx; height: 40rpx; margin-top: 80rpx; margin-bottom: 30rpx; margin-left: '+ (windowWidth - 200) +'px;'"></image>
|
||
</loading>
|
||
</refresh>
|
||
|
||
<!-- 循环数据 -->
|
||
<cell v-for="(item,i) in dataList" :key="i">
|
||
<!-- 用div把视频模组套起来 -->
|
||
<div :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;'" @disappear="stop()">
|
||
<view class="root">
|
||
<!--
|
||
具体视频参数可以参考官方文档
|
||
说明:
|
||
1.v-if很关键,这里主要是为了减少 dom 元素【这样才不会加载视频多了闪退】,
|
||
这里 Math.abs(k-i)<=5 也就是往上预加载 5 个视频,往下预加载 5
|
||
个视频这样做的目的是为了让视频能够提前加载但是不播放,在真正滑到位
|
||
置的时候播放视频。
|
||
【2.0.1就是 1 Math.abs(k-i)<=1:请勿修改,记住,要不然会提前播放很多视频】
|
||
|
||
2.要注意 @play="playIngs" 里面的 playIngs 方法,这个方法只是在视频播放的时候
|
||
起效果,我们控制视频播放不是用这个的。这个的主要作用是给视频封面的。我们先用
|
||
下面的视频封面盖住视频,等到视频播放的时候,我们不要急着直接播放,而是延迟一下下,
|
||
300-600ms左右。因为视频播放需要一点点时间,这点时间里会黑屏,这个时候我们就用
|
||
下面的封面盖住,这样用户就不会有从黑屏到有画面的感觉了,但是如果遇到视频太大,缓冲
|
||
时间太长,还是会出现短暂的黑屏,大部分是不会有黑屏的(这样盖住的话)。
|
||
|
||
【更新记录:2.0版】已经解决了视频黑屏问题,和加载速度慢的情况,如果还是出现了黑屏,
|
||
意味着此时手滑动的速度,已经超过了视频加载的速度,对于这个问题,建议修改 preloadNumber
|
||
变量,当它的值大一点的时候就会提前加载视频,这样用户在滑到视频的时候就不会有停顿感了
|
||
【注意】:老用户在 video 中增加和修改
|
||
(1):muted="!item.playIng",
|
||
(2)@timeupdate="timeupdate($event,i)"
|
||
(3)把 199 行注释了,
|
||
(4):id="item._id",
|
||
(5)修改:uni.createVideoContext(this.dataList[this.k]._id + '' + this.k,this) 为
|
||
uni.createVideoContext(this.dataList[this.k]._id,this)
|
||
(6)在 timeupdate 方法里加入,if(index == this.k){把里面的加一个总的判断}
|
||
3.其他的下面有详解
|
||
-->
|
||
<video :ref="'item'+i" :id="item.id" :loop="true" :src="item.story_video" :muted="item.isplay" @play="playIngs(i)" :enable-progress-gesture="false" :page-gesture="false" :controls="false" :http-cache="true" :show-loading="false" :show-fullscreen-btn="false" :show-center-play-btn="false" :style="boxStyle" :object-fit="object_fit" @timeupdate="timeupdate($event,i)"></video>
|
||
<!-- 这里是封面 -->
|
||
<image v-if="!item.playIng" :src="item.story_video+'?x-oss-process=video/snapshot,t_100,f_jpg'" :mode="mode" :style="'width: '+ windowWidth +'px; height: '+ (wHeight - deleteHeight) +'px; position: absolute;'"></image>
|
||
<!--
|
||
mode: 图片裁剪、缩放的模式
|
||
mode 有 14 种模式,其中 5 种是缩放模式,9 种是裁剪模式。
|
||
https://uniapp.dcloud.io/component/image
|
||
-->
|
||
</view>
|
||
<!-- 直接用 view 就行了,一样是可以覆盖原生组件的 -->
|
||
<!-- 这个是暂停时出现的图标 -->
|
||
<view class="videoHover" @click="tapVideoHover(item.state,$event)" @touchstart="touchstartHover" :style="boxStyle">
|
||
<image v-if="item.state=='pause'" class="playState" src="../static/img/index/play.png"></image>
|
||
</view>
|
||
<view class="userInfo">
|
||
<!-- 1.头像 -->
|
||
<!-- <image @click="tozuozhe(item.user_id)" class="userAvatar" :src="item.user_avatar" mode="aspectFill"></image> -->
|
||
<!-- 2.点赞 -->
|
||
<view @click="cLike(item.IsFabulous);" style="opacity: 0.9; margin-top: 17px;">
|
||
<image v-if="item.IsFabulous" src="../static/img/index/xin.png" style="width: 40px; height: 40px; position: absolute; right: 6px;" @click.stop="onUnLike" :data-story_id="item.story_id" :data-index="i"></image>
|
||
<image v-if="!item.IsFabulous" src="../static/img/index/xin-2.png" style="width: 40px; height: 40px; position: absolute; right: 6px;" @click.stop="onLike" :data-story_id="item.story_id" :data-index="i"></image>
|
||
<text style="color: #FFFFFF; margin-top: 5px; font-size: 14px; text-align: center; margin-top: 40px; font-weight: bold;" :class="{'likeNumActive':item.IsFabulous}">{{item.story_like_count}}</text>
|
||
</view>
|
||
<!-- 3.评论 -->
|
||
<view class="comment" @click="toComment(i)" style="opacity: 0.9; margin-top: 17px;">
|
||
<image src="../static/img/index/liaotian-2.png" style="width: 35px; height: 35px; position: absolute; right: 7px;"></image>
|
||
<text style="color: #FFFFFF; margin-top: 5px; font-size: 14px; font-weight: bold; text-align: center; margin-top: 40px;">{{item.story_comment_count}}</text>
|
||
</view>
|
||
<!-- 4.收藏 -->
|
||
<view class="fav" style="opacity: 0.9; margin-top: 17px;">
|
||
<image v-if="(item.IsCollection)" src="../static/img/index/sc-2.png" style="width: 35px; height: 35px; position: absolute; right: 7px;" @click.stop="onUnCollection" :data-story_id="item.story_id" :data-index="i"></image>
|
||
<image v-else src="../static/img/index/sc.png" style="width: 35px; height: 35px; position: absolute; right: 7px;" @click.stop="onCollection" :data-story_id="item.story_id" :data-index="i"></image>
|
||
<text style="color: #FFFFFF; margin-top: 5px; font-size: 14px; font-weight: bold; text-align: center; margin-top: 40px;">{{__('收藏')}}</text>
|
||
</view>
|
||
<!-- 5.投诉 -->
|
||
<view @click="report" style="opacity: 0.9; margin-top: 17px;">
|
||
<image src="../static/img/index/jubao.png" style="width: 40px; height: 40px; position: absolute; right: 5px;"></image>
|
||
<text style="color: #FFFFFF; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px;">{{__('举报')}}</text>
|
||
</view>
|
||
</view>
|
||
<!-- 最底下的文字部分 -->
|
||
<view class="view-product" v-if="item.product_id.length > 0 && item.product_item_name" @click.stop="onProduct(item.item_id)">
|
||
<view class="left-view" style="width: 100rpx;height: 100rpx;">
|
||
<image :src="item.product_image" class="product_img" style="width: 100rpx;height: 100rpx;"></image>
|
||
</view>
|
||
<view class="left-view" style="width: 400rpx;height: 100rpx;">
|
||
<view class="left-text uni-ellipsis" style="padding-left: 10rpx;"><text style="color: #FFFFFF;font-size:32rpx;">{{item.product_item_name}}</text></view>
|
||
<view class="left-text uni-ellipsis" style="padding-left: 10rpx;font-size: 24rpx;padding-top:4rpx;"><text style="color: #FFFFFF;font-size: 30rpx;">{{sprintf(__('价格:%s'), item.item_unit_price)}}</text></view>
|
||
</view>
|
||
</view>
|
||
<view class="content" v-if="dataList.length !== 0 ">
|
||
<image :src="item.user_avatar" @click="tozuozhe(item.user_id)" class="userAvatar" style="width: 50px; height: 50px; left: 7px;position: absolute;"></image>
|
||
<text class="userName" style="width: 250rpx;margin-left: 60px;">{{item.user_nickname}}</text><!-- i={{i}} -->
|
||
<text @click="onFollow(item.user_id,index)" class='box_title_guanzhu_text' v-if="(item.user_id != userInfo.user_id && !item.IsFollow)">{{__('关注')}}
|
||
</text>
|
||
|
||
<view class="words">
|
||
<text class="userName">{{item.story_content}}</text>
|
||
<!-- <rich-text :nodes="item.story_content"></rich-text> -->
|
||
<!-- <wxParse :content="item.story_content" :imageProp="{lazyLoad:true, mode:'widthFix'}" /> -->
|
||
|
||
</view><!-- k={{k}} -->
|
||
</view>
|
||
<!-- 1.视频预览时的图片,currenttimes:就是获取当前滑块的时间点,如果不需要,可以注释掉 -->
|
||
<!-- 2.如果使用下面的视频预览的话要注意的是视频链接最好是阿里云上的,因为
|
||
https://xxxxxxxxx.mp4?x-oss-process=video/snapshot,t_1000,f_jpg
|
||
这个是阿里云的东西,至于其他的视频截帧我还没有试过。
|
||
-->
|
||
<!-- 3.阿里云视频截帧地址:https://help.aliyun.com/document_detail/64555.html -->
|
||
<image v-if="false" :src="item.src+'?x-oss-process=video/snapshot,t_'+ currenttimes +'000,f_jpg'" mode="aspectFill" :style="'width: 120rpx; height: 160rpx; border-radius: 10rpx; position: absolute; bottom: '+ (ProgressBarBottom + 160) +'rpx; left: '+ (currentPositions - 15) +'px;'"></image>
|
||
</div>
|
||
</cell>
|
||
</list>
|
||
<!-- 1.注意:进度条这类拖拽的东西不能放进block\cell这些循环体中的,要不然touchmove方法会捕捉有误 -->
|
||
<view v-if="dataList.length !== 0 && dataList[k].isShowProgressBarTime == true" :style="'position: absolute; bottom: '+ (ProgressBarBottom + this.windowWidth*0.2)/2 +'px; left: '+ (windowWidth*2 - this.windowWidth*1.35)/2 +'px;'">
|
||
<text style="font-size: 22px; font-weight: bold; color: #F1F1F1;">{{changeTime}} / {{videoTimes}}</text>
|
||
</view>
|
||
<!-- 这里就是进度条了:纯手工进度条,调整位置的话就把他们的 bottom 改成一下就行了 -->
|
||
<view v-if="isDragging == false" @touchmove="touchmove" @touchend="touchend" @touchstart="touchstart" style="position: absolute; bottom: 0; left: 0;">
|
||
<!-- 1.这一步必须加,为了适配低端机型 -->
|
||
<text :style="'width: '+ windowWidth +'px; opacity: 0;'">.</text>
|
||
<!-- 2.这是未加载的时的右边的灰色部分 -->
|
||
<view :style="'width: '+ windowWidth +'px; height: 4rpx; background-color: #C8C7CC; position: absolute; bottom: '+ ProgressBarBottom +'rpx; opacity: '+ ProgressBarOpacity +';'"></view>
|
||
<!-- 3.这里我采用的分离式办法:就是让滑动样式和不滑动的样式分开,这样相互不干扰,可以避免进度条闪动的问题 -->
|
||
<!-- 4.注意:isShowProgressBarTime 加入了返回数据中 -->
|
||
<view v-if="dataList.length !== 0 && dataList[k].isShowProgressBarTime == false" :style="'width: '+ (currentPosition) +'px; height: 4rpx; background-color: #FFFFFF; position: absolute; bottom: '+ ProgressBarBottom +'rpx; left: 0; opacity: '+ (ProgressBarOpacity - 0.1) +';'"></view>
|
||
<view v-if="dataList.length !== 0 && dataList[k].isShowProgressBarTime == true" :style="'width: '+ (currentPositions) +'px; height: 8rpx; background-color: #FFFFFF; position: absolute; bottom: '+ ProgressBarBottom +'rpx; left: 0; opacity: '+ (ProgressBarOpacity + 0.05) +';'"></view>
|
||
<view v-if="dataList.length !== 0 && dataList[k].isShowProgressBarTime == false" :style="'width: 4px; height: 4px; background-color: #FFFFFF; border-radius: 10px; position: absolute; bottom: '+ (ProgressBarBottom - 2) +'rpx; left: '+ (currentPosition) +'px; opacity: '+ ProgressBarOpacity +';'"></view>
|
||
<view v-if="dataList.length !== 0 && dataList[k].isShowProgressBarTime == true" :style="'width: '+ dotWidth +'px; height: '+ dotWidth +'px; background-color: #FFFFFF; border-radius: 10px; position: absolute; bottom: '+ (ProgressBarBottom - 5) +'rpx; left: '+ (currentPositions - 5) +'px; opacity: '+ ProgressBarOpacity +';'"></view>
|
||
</view>
|
||
</view>
|
||
<!--
|
||
|
||
请前往 douyin-scrollview.nvue 文件查看
|
||
|
||
已经全部注释
|
||
|
||
这里就是引入评论插件
|
||
|
||
|
||
-->
|
||
<uni-popup type="bottom" ref="pinglun" @touchmove.stop.prevent="moveHandle">
|
||
<view :style="'width: '+ windowWidth +'px; height: '+ (boxStyle.height/heightNum) +'px; background-color: #242424; border-top-left-radius: 10px; border-top-right-radius: 10px;'">
|
||
|
||
<douyin-scrollview :Width="windowWidth" :story_id="story_id" :videouserID="user_id" :pinlunNum="pinlunNum" :Height="(boxStyle.height/1.23)" :deleteIOSHeight="36" :deleteAndroidHeight="15" @closeScrollview="closeScrollview"></douyin-scrollview>
|
||
</view>
|
||
</uni-popup>
|
||
</view>
|
||
</template>
|
||
<script>
|
||
import {
|
||
mapState,
|
||
mapMutations
|
||
} from 'vuex'
|
||
// import userList from './data.js'//这个是假数据
|
||
/*
|
||
引入评论组件
|
||
*/
|
||
import douyinScrollview from '@/community/components/douyin-scrollview/douyin-A-scrollview.nvue'
|
||
import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
||
import wxParse from '@/components/u-parse/u-parse.vue'
|
||
export default {
|
||
data() {
|
||
return {
|
||
//下面打🌟号的是必须要的基础字段
|
||
//下面打💗号的是拥有滑动条的必须字段
|
||
dataList: [], //用于数据循环的列表🌟💗
|
||
wHeight: 0, //获取的屏幕高度🌟💗
|
||
boxStyle: { //视频,图片封面样式🌟💗
|
||
'height': 0,
|
||
'width': 0,
|
||
},
|
||
k: 0, //默认为0🌟💗
|
||
playIngIds: [], //正在播放的视频id列队,列队用于处理滑动过快导致的跳频问题🌟💗
|
||
ready: false, //可忽略
|
||
isDragging: false, //false代表停止滑动🌟💗
|
||
refreshing: true, //用于下拉刷新🌟💗
|
||
windowWidth: 0, //获取屏幕宽度🌟💗
|
||
windowHeight: 0,
|
||
dex: [0, 0], //用于判断是上滑还是下滑,第一个存旧值,第二个存新值【目前在1.0.7已经废弃】
|
||
currents: 0, //用于左右滑动,0代表视频界面,1代表右滑界面🌟💗
|
||
platform: '', //用于获取操作系统:ios、android🌟💗
|
||
playIng: false, //用于视频初始化时是否播放,默认不播放🌟💗
|
||
videoTime: '', //视频总时长,这个主要用来截取时间数值💗
|
||
videoTimes: '', //视频时长,用这个来获取时间值,例如:00:30这个时间值💗
|
||
changeTime: '', //显示滑动进度条时变化的时间💗
|
||
isShowimage: false, //是否显示封面【1.0.4已废弃,但是意思需要记住】
|
||
currenttimes: 0, //当前时间💗
|
||
isShowProgressBarTime: false, //是否拖动进度条,如果拖动(true)则显示进度条时间,否则不显示(false)【1.0.4已废弃,但是意思需要记住】
|
||
ProgressBarOpacity: 0.7, //进度条不拖动时的默认值,就是透明的💗
|
||
dotWidth: 0, //播放的小圆点,默认没有💗
|
||
deleteHeight: 0, //测试高度🌟💗
|
||
percent: 0, //百分小数💗
|
||
currentPosition: 0, //滑块当前位置💗//2.0已弃用,现已用于后端参数
|
||
currentPositions: 0, //滑块当前位置的副本💗//2.0已弃用,现已用于后端参数
|
||
newTime: 0, //跟手滑动后的最新时间💗
|
||
timeNumber: 0, //🌟💗
|
||
ProgressBarBottom: 20, //进度条离底部的距离💗
|
||
object_fit: 'contain', //视频样式默认包含🌟💗
|
||
mode: 'aspectFit', //图片封面样式🌟💗
|
||
timeout: "", //🌟用来阻止 setTimeout()方法
|
||
voice: "", //🌟用来阻止 setTimeout()方法
|
||
oldVideo: "",
|
||
|
||
isAutoplay: false, //是否开启自动播放(默认不开启)
|
||
autoplayText: "开启自动播放",
|
||
timers: "",
|
||
|
||
page: 1,
|
||
story_id: 0,
|
||
pinlunNum: 0,
|
||
|
||
// 引入评论 - 参数
|
||
heightNum: 1.18,
|
||
|
||
// 双击点赞参数
|
||
touchNum: 0,
|
||
aixinLeft: 0,
|
||
aixinTop: 0,
|
||
isShowAixin: false,
|
||
Rotate: 0,
|
||
uid: 0,
|
||
}
|
||
},
|
||
computed: mapState(['Config', 'StateCode', 'notice', 'plantformInfo', 'shopInfo', 'userInfo', 'hasLogin', '__', '$',
|
||
'sprintf'
|
||
]),
|
||
components: {
|
||
douyinScrollview,
|
||
uniPopup,
|
||
wxParse
|
||
},
|
||
watch: {
|
||
k(k, old_k) { //监听 k 值的变化,可以控制视频的播放与暂停
|
||
console.log(k)
|
||
this.dataList[old_k].state = 'stop' //如果是被滑走的视频,就停止播放
|
||
this.dataList[old_k].playIng = false //如果视频暂停,就加载封面
|
||
this.dataList[old_k].isplay = true
|
||
uni.createVideoContext(this.dataList[old_k].id, this).play()
|
||
clearTimeout(this.oldVideo)
|
||
this.oldVideo = setTimeout(() => {
|
||
uni.createVideoContext(this.dataList[old_k].id, this).seek(0)
|
||
uni.createVideoContext(this.dataList[old_k].id, this).pause()
|
||
console.log('预留第' + (old_k + 1) + '个视频:' + this.dataList[old_k].id)
|
||
}, 500)
|
||
// 2.0版本已经去掉了下面这一句,视频不用暂停,只需要把声音禁止就行
|
||
// uni.createVideoContext(this.dataList[old_k]._id + '' + old_k,this).stop()//如果视频暂停,那么旧视频停止,这里的this.dataList[old_k]._id + '' + old_k,后面加 old_k 是为了每一个视频的 id 值不同,这样就可以大程度的避免串音问题
|
||
uni.createVideoContext(this.dataList[k].id, this).play();
|
||
|
||
|
||
console.log('已经暂停 --> 第' + (old_k) + '个视频~') //提示
|
||
clearTimeout(this.voice)
|
||
this.voice = setTimeout(() => {
|
||
this.dataList[k].isplay = false
|
||
}, 300)
|
||
setTimeout(() => {
|
||
this.dataList[k].playIng = true
|
||
}, 850)
|
||
//【2.0版本更新内容】- start
|
||
var p = k
|
||
++p
|
||
setTimeout(() => {
|
||
uni.createVideoContext(this.dataList[p].id, this).play()
|
||
}, 20)
|
||
clearTimeout(this.timeout)
|
||
this.timeout = setTimeout(() => {
|
||
uni.createVideoContext(this.dataList[p].id, this).seek(0)
|
||
uni.createVideoContext(this.dataList[p].id, this).pause()
|
||
console.log('预加载第' + (p + 1) + '个视频:' + this.dataList[p].id)
|
||
}, 1500)
|
||
//【2.0版本更新内容】- end
|
||
//【此处处理进度条卡住的问题】
|
||
setTimeout(() => {
|
||
uni.createVideoContext(this.dataList[k].id, this).seek(0)
|
||
// uni.createVideoContext(this.dataList[k].id,this).play()
|
||
}, 100)
|
||
}
|
||
},
|
||
onShow() {
|
||
|
||
uni.hideLoading();
|
||
console.log('回到前台');
|
||
if (this.dataList.length !== 0) {
|
||
this.dataList[this.k].state = 'play';
|
||
uni.createVideoContext(this.dataList[this.k].id, this).play()
|
||
}
|
||
},
|
||
onHide() {
|
||
this.dataList[this.k].state = 'pause'; //界面隐藏也要停止播放视频
|
||
uni.createVideoContext(this.dataList[this.k].id, this).pause(); //暂停以后继续播放
|
||
console.log('到后台');
|
||
},
|
||
onLoad(options) {
|
||
if (options.uid) {
|
||
this.uid = options.uid
|
||
}
|
||
this.platform = uni.getSystemInfoSync().platform
|
||
var model = uni.getSystemInfoSync().model
|
||
this.story_id = options.id ? options.id : 0;
|
||
if (this.platform == 'ios' && (model !== 'iPhone6' || model !== 'iPhone6s' || model !== 'iPhone7' || model !== 'iPhone8')) {
|
||
this.deleteHeight = 0 //有 tabbar的 修改这里可以改变视频高度
|
||
|
||
/*
|
||
引入评论参数
|
||
*/
|
||
|
||
this.heightNum = 1.27
|
||
} else {
|
||
this.deleteHeight = 0
|
||
/*
|
||
引入评论参数
|
||
*/
|
||
this.heightNum = 1.18
|
||
}
|
||
|
||
this.windowWidth = uni.getSystemInfoSync().screenWidth //获取屏幕宽度
|
||
this.boxStyle.width = this.windowWidth + 'px' //给宽度加px
|
||
this.wHeight = uni.getSystemInfoSync().screenHeight; //获取屏幕高度
|
||
this.boxStyle.height = this.wHeight - this.deleteHeight; //改变视频高度
|
||
this.get() //这一步,加载视频数据
|
||
|
||
},
|
||
|
||
onReady() {},
|
||
onShareAppMessage() {
|
||
// #ifdef MP-WEIXIN
|
||
wx.showShareMenu({
|
||
withShareTicket: true,
|
||
menus: ['shareAppMessage', 'shareTimeline']
|
||
});
|
||
// #endif
|
||
|
||
return {
|
||
imageUrl: this.dataList[0]['story_file'][0],
|
||
title: this.pname,
|
||
path: "/community/index/index?id=" + this.story_id + "&uid=" + this.userInfo.user_id
|
||
}
|
||
},
|
||
/**
|
||
* 用户点击右上角分享朋友圈
|
||
*/
|
||
onShareTimeline: function() {
|
||
return {
|
||
title: this.dataList[0].story_title,
|
||
query: {
|
||
uid: this.userInfo.user_id,
|
||
pid: this.story_id
|
||
},
|
||
imageUrl: this.dataList[0]['story_file'][0],
|
||
}
|
||
},
|
||
methods: {
|
||
...mapMutations(['logout', 'getPlantformInfo', 'forceUserInfo', 'getStoreInfo']),
|
||
//举报
|
||
report: function() {
|
||
this.$.gotopage('/member/member/feedback')
|
||
},
|
||
onProduct(item_id) {
|
||
this.$.gopage('/pages/product/detail?pid=' + item_id)
|
||
},
|
||
//取消收藏
|
||
onUnCollection: function(a) {
|
||
|
||
var that = this,
|
||
params = {
|
||
story_id: a.currentTarget.dataset.story_id
|
||
};
|
||
that.forceUserInfo(function(user) {
|
||
that.index = a.currentTarget.dataset.index;
|
||
that.$.request({
|
||
url: that.Config.URL.sns.story_collection_remove,
|
||
data: params,
|
||
success: function(data, status, msg, code) {
|
||
if (200 == status) {
|
||
that.dataList[that.index].IsCollection = false;
|
||
that.$forceUpdate();
|
||
} else {
|
||
that.$.confirm(msg)
|
||
}
|
||
}
|
||
});
|
||
})
|
||
|
||
},
|
||
|
||
//收藏
|
||
onCollection: function(a) {
|
||
var that = this,
|
||
params = {
|
||
story_id: a.currentTarget.dataset.story_id
|
||
};
|
||
that.forceUserInfo(function(user) {
|
||
that.index = a.currentTarget.dataset.index;
|
||
|
||
that.$.request({
|
||
url: that.Config.URL.sns.story_collection_add,
|
||
data: params,
|
||
success: function(data, status, msg, code) {
|
||
if (200 == status) {
|
||
that.dataList[that.index].IsCollection = true;
|
||
that.$forceUpdate();
|
||
} else {
|
||
that.$.confirm(msg)
|
||
}
|
||
}
|
||
});
|
||
})
|
||
|
||
},
|
||
|
||
onUnLike: function(a) {
|
||
let that = this;
|
||
that.forceUserInfo(function(user) {
|
||
that.canceldianzan(a.currentTarget.dataset.story_id)
|
||
that.index = a.currentTarget.dataset.index;
|
||
});
|
||
},
|
||
canceldianzan: function(story_id) {
|
||
var that = this,
|
||
params = {
|
||
story_id: story_id
|
||
};
|
||
|
||
that.$.request({
|
||
url: this.Config.URL.sns.story_like_remove,
|
||
data: params,
|
||
success: function(data, status, msg, code) {
|
||
if (200 == status) {
|
||
//修正当前记录数据
|
||
that.dataList[that.index].IsFabulous = false;
|
||
that.dataList[that.index].story_like_count--
|
||
} else {}
|
||
}
|
||
});
|
||
},
|
||
onLike: function(a) {
|
||
let that = this;
|
||
that.forceUserInfo(function(user) {
|
||
that.doLike(a.currentTarget.dataset.story_id);
|
||
that.index = a.currentTarget.dataset.index;
|
||
});
|
||
},
|
||
doLike: function(story_id) {
|
||
var that = this,
|
||
params = {
|
||
story_id: story_id
|
||
};
|
||
|
||
that.$.request({
|
||
url: this.Config.URL.sns.story_like_add,
|
||
data: params,
|
||
success: function(data, status, msg, code) {
|
||
if (200 == status) {
|
||
that.dataList[that.index].IsFabulous = true;
|
||
that.dataList[that.index].story_like_count++
|
||
} else {}
|
||
}
|
||
});
|
||
},
|
||
autoPlay() {
|
||
this.isAutoplay = !this.isAutoplay;
|
||
if (!this.isAutoplay) {
|
||
this.autoplayText = this.__("开启自动播放")
|
||
uni.showToast({
|
||
title: this.__("关闭自动播放"),
|
||
icon: 'none',
|
||
duration: 3000
|
||
})
|
||
} else {
|
||
this.autoplayText = this.__("关闭自动播放")
|
||
uni.showToast({
|
||
title: this.__("开启自动播放"),
|
||
icon: 'none',
|
||
duration: 3000
|
||
})
|
||
}
|
||
},
|
||
getData() {
|
||
// 这里就是数据加载完以后再向后端发送数据的地方
|
||
let that = this;
|
||
this.page = parseInt(this.page) + 1;
|
||
var params = {
|
||
page: this.page,
|
||
story_type: 4,
|
||
};
|
||
params['story_id'] = that.story_id;
|
||
that.$.request({
|
||
url: this.Config.URL.sns.story_lists,
|
||
data: params,
|
||
success: (data, status, msg, code) => {
|
||
var msg = data.items;
|
||
for (let i = 0; i < msg.length; i++) {
|
||
msg[i].id = msg[i].id + 'k';
|
||
msg[i].state = 'pause';
|
||
msg[i].playIng = false;
|
||
msg[i].isplay = true;
|
||
msg[i].isShowimage = false;
|
||
msg[i].isShowProgressBarTime = false;
|
||
|
||
|
||
that.dataList.push(msg[i])
|
||
}
|
||
}
|
||
})
|
||
},
|
||
touchstart(event) {
|
||
this.dataList[this.k].isShowimage = true //刚触摸的时候就要显示预览视频图片了
|
||
this.dataList[this.k].isShowProgressBarTime = true //显示时间线
|
||
this.ProgressBarOpacity = 1 //让滑块显示起来更明显一点
|
||
this.dotWidth = 10 //让点显示起来更明显一点
|
||
},
|
||
touchend() { //当手松开后,跳到最新时间
|
||
uni.createVideoContext(this.dataList[this.k].id, this).seek(this.newTime)
|
||
if (this.dataList[this.k].state == 'pause') {
|
||
this.dataList[this.k].state = 'play'
|
||
uni.createVideoContext(this.dataList[this.k].id, this).play()
|
||
}
|
||
this.dataList[this.k].isShowProgressBarTime = false //触摸结束后,隐藏时间线
|
||
this.dataList[this.k].isShowimage = false //触摸结束后,隐藏时间预览
|
||
this.ProgressBarOpacity = 0.5 //隐藏起来进度条,不那么明显了
|
||
this.dotWidth = 0 //隐藏起来进度条,不那么明显了
|
||
},
|
||
touchmove(event) { //当手移动滑块时,计算位置、百分小数、新的时间
|
||
var msg = []
|
||
if (this.videoTime !== '') {
|
||
msg = this.videoTime.split(':')
|
||
}
|
||
var timeNumber = Number(msg[0]) * 60 + Number(msg[1])
|
||
this.currentPositions = event.changedTouches[0].screenX
|
||
this.percent = this.currentPositions / this.windowWidth
|
||
this.newTime = this.percent * timeNumber
|
||
this.currenttimes = parseInt(this.newTime)
|
||
let theTime = this.newTime
|
||
let middle = 0; // 分
|
||
if (theTime > 60) {
|
||
middle = parseInt(theTime / 60);
|
||
theTime = parseInt(theTime % 60);
|
||
}
|
||
this.changeTime = `${Math.round(middle)>9?Math.round(middle):'0'+Math.round(middle)}:${Math.round(theTime)>9?Math.round(theTime):'0'+Math.round(theTime)}`
|
||
},
|
||
timeupdate(event, index) { //计算滑块当前位置,计算当前百分小数
|
||
// console.log(index)
|
||
if (index == this.k) {
|
||
// console.log(event)
|
||
var currenttime = event.detail.currentTime
|
||
this.timeNumber = Math.round(event.detail.duration)
|
||
this.getTime()
|
||
this.percent = currenttime / this.timeNumber
|
||
this.currentPosition = this.windowWidth * this.percent
|
||
let theTime = currenttime
|
||
let middle = 0; // 分
|
||
if (theTime > 60) {
|
||
middle = parseInt(theTime / 60);
|
||
theTime = parseInt(theTime % 60);
|
||
}
|
||
this.changeTime = `${Math.round(middle)>9?Math.round(middle):'0'+Math.round(middle)}:${Math.round(theTime)>9?Math.round(theTime):'0'+Math.round(theTime)}`
|
||
//自动切换视频
|
||
if (this.isAutoplay) { //true,代表自动播放
|
||
if (Math.round(currenttime) == this.timeNumber - 1) {
|
||
const dom = uni.requireNativePlugin('dom')
|
||
let doms = 'item' + (this.k + 1)
|
||
setTimeout(() => {
|
||
let el = this.$refs[doms][0]
|
||
dom.scrollToElement(el, {
|
||
offset: 0,
|
||
animated: true
|
||
})
|
||
}, 500)
|
||
}
|
||
}
|
||
}
|
||
},
|
||
getTime() { //得到时间函数
|
||
this.videoTime = this.formatSeconds(this.timeNumber);
|
||
// console.log(that.videoTime)
|
||
var msg = []
|
||
if (this.videoTime !== '') {
|
||
msg = this.videoTime.split(':')
|
||
}
|
||
this.videoTimes = `${msg[0]>9?msg[0]:'0'+msg[0]}:${msg[1]>9?msg[1]:'0'+msg[1]}`;
|
||
},
|
||
formatSeconds(value) { //获取时间函数
|
||
let theTime = parseInt(value); // 秒
|
||
let middle = 0; // 分
|
||
if (theTime > 60) {
|
||
middle = parseInt(theTime / 60);
|
||
theTime = parseInt(theTime % 60);
|
||
}
|
||
return `${middle>9?middle:middle}:${theTime>9?theTime:theTime}`;
|
||
},
|
||
playIngs(index) {
|
||
//
|
||
console.log('playIngs')
|
||
console.log(index)
|
||
},
|
||
pause(index) {
|
||
//
|
||
console.log('pause')
|
||
console.log(index)
|
||
},
|
||
moreVideo(index) {
|
||
|
||
},
|
||
toVideo(index) {
|
||
|
||
},
|
||
erweima() {
|
||
|
||
},
|
||
onFollow: function(user_id, index) {
|
||
let that = this;
|
||
that.forceUserInfo(function(user) {
|
||
that.AddFollow(user_id, index)
|
||
});
|
||
},
|
||
AddFollow: function(friend_id, index) {
|
||
var that = this,
|
||
params = {
|
||
/*user_id: that.userInfo.user_id,
|
||
OperateId: that.shopInfo.store_id,*/
|
||
friend_id: friend_id
|
||
};
|
||
var list = that.dataList;
|
||
|
||
that.$.request({
|
||
url: this.Config.URL.user.friend_agree,
|
||
data: params,
|
||
success: function(data, status, msg, code) {
|
||
if (200 == status) {
|
||
list[index].IsFollow = 1
|
||
that.$set(that.dataList, index, list[index]);
|
||
that.$.alert('关注成功')
|
||
} else {}
|
||
}
|
||
});
|
||
},
|
||
tozuozhe(uid) {
|
||
this.currents = 1 //点击头像以后就会切换
|
||
uni.navigateTo({
|
||
url: '/community/community/userspace?uid=' + uid
|
||
});
|
||
},
|
||
stop() {
|
||
// console.log('stop')
|
||
},
|
||
scrolls(event) {
|
||
this.isDragging = event.isDragging
|
||
if (!event.isDragging) { //isDragging:判断用户是不是在滑动,滑动:true,停止滑动:false。我们要用户停止滑动时才给 k 赋值,这样就可以避免很多麻烦
|
||
var i = Math.round(Math.abs(event.contentOffset.y) / (this.wHeight - this.deleteHeight + 1)) //先用绝对值取出滑动的距离,然后除以屏幕高度,取一个整,就知道你现在滑动到哪一个视频了
|
||
if (i !== this.k) { //这里加判断是因为这个方法会执行很多次,会造成重复请求,所以这里写一个限制
|
||
if (uni.getSystemInfoSync().platform == 'ios') {
|
||
this.k = i //判断了用户没有滑动,确认了用户的确是在看这个视频,然后就赋值啦
|
||
this.dataList[this.k].state = 'play'
|
||
console.log('正在播放 --> 第' + (this.k + 1) + '个视频~')
|
||
} else {
|
||
clearTimeout(this.timers);
|
||
this.timers = setTimeout(() => {
|
||
this.k = i //判断了用户没有滑动,确认了用户的确是在看这个视频,然后就赋值啦
|
||
this.dataList[this.k].state = 'play'
|
||
console.log('正在播放 --> 第' + (this.k + 1) + '个视频~')
|
||
}, 80)
|
||
}
|
||
}
|
||
}
|
||
},
|
||
get() {
|
||
|
||
// 这个方法主要就是用来第一次进入视频播放时用来处理的
|
||
// this.dataList = userList;//这个就是赋值加载视频啦
|
||
let that = this;
|
||
var params = {
|
||
page: this.page,
|
||
story_type: 4,
|
||
uid: this.uid
|
||
};
|
||
console.log(params)
|
||
params['story_id'] = that.story_id;
|
||
that.$.request({
|
||
url: this.Config.URL.sns.story_lists,
|
||
data: params,
|
||
success: (data, status, msg, code) => {
|
||
|
||
var msg = data.items
|
||
this.user_id = msg[0].user_id;
|
||
this.story_id = msg[0].story_id;
|
||
this.pinlunNum = msg[0].story_comment_count;
|
||
// 2.这里把视频添加到视频列表
|
||
for (let i = 0; i < msg.length; i++) {
|
||
msg[i].id = msg[i].id + 'k';
|
||
msg[i].state = 'pause';
|
||
msg[i].playIng = false;
|
||
msg[i].isplay = true;
|
||
msg[i].isShowimage = false;
|
||
msg[i].isShowProgressBarTime = false;
|
||
|
||
}
|
||
that.dataList = msg;
|
||
|
||
that.dataList[0].state = "play";
|
||
setTimeout(() => {
|
||
//这里的延迟是为了避免执行时间太快而直接跳过执行的 bug
|
||
uni.createVideoContext(that.dataList[0].id, that).seek(0)
|
||
uni.createVideoContext(that.dataList[0].id, that).play()
|
||
}, 200)
|
||
that.dataList[0].isplay = false
|
||
setTimeout(() => {
|
||
that.dataList[0].playIng = true
|
||
}, 500)
|
||
var p = 0
|
||
setTimeout(() => {
|
||
++p
|
||
uni.createVideoContext(that.dataList[p].id, that).play()
|
||
setTimeout(() => {
|
||
uni.createVideoContext(that.dataList[p].id, that).seek(0)
|
||
uni.createVideoContext(that.dataList[p].id, that).pause()
|
||
console.log('预加载第' + (p + 1) + '个视频:' + that.dataList[p].id)
|
||
}, 2000)
|
||
}, 50)
|
||
|
||
|
||
}
|
||
})
|
||
},
|
||
onpullingdown() {
|
||
// console.log('正在下拉刷新,此时手还在触摸没有松开')
|
||
this.refreshing = true
|
||
},
|
||
onrefresh() {
|
||
// console.log('下拉刷新完毕,此时手松开了')
|
||
setTimeout(() => {
|
||
this.refreshing = false
|
||
}, 1000)
|
||
},
|
||
// 双击点赞效果
|
||
touchstartHover(event) {
|
||
if (this.touchNum >= 1) {
|
||
// console.log('双击 -- X坐标:'+ event.touches[0].screenX);
|
||
// console.log('双击 -- Y坐标:'+ event.touches[0].screenY);
|
||
this.aixinLeft = event.touches[0].screenX - 50;
|
||
this.aixinTop = event.touches[0].screenY - 50;
|
||
this.isShowAixin = true;
|
||
let max = 40;
|
||
let min = -40;
|
||
this.Rotate = Math.floor(Math.random() * (max - min + 1)) + min;
|
||
setTimeout(() => {
|
||
this.isShowAixin = false;
|
||
}, 700)
|
||
this.onTabItemTaps();
|
||
}
|
||
},
|
||
//点击播放&&暂停
|
||
tapVideoHover(state, event) {
|
||
this.dataList[this.k].isShowimage = false
|
||
this.dataList[this.k].isShowProgressBarTime = false
|
||
this.ProgressBarOpacity = 0.5
|
||
this.dotWidth = 0
|
||
console.log('state--', state);
|
||
// 1.启用双击点赞 --- start
|
||
this.touchNum++;
|
||
setTimeout(() => {
|
||
if (this.touchNum == 1) {
|
||
if (state == 'play' || state == 'continue') {
|
||
this.dataList[this.k].state = 'pause';
|
||
} else {
|
||
this.dataList[this.k].state = 'continue';
|
||
}
|
||
if (this.dataList[this.k].state == 'continue') {
|
||
uni.createVideoContext(this.dataList[this.k].id, this).play(); //暂停以后继续播放
|
||
}
|
||
if (this.dataList[this.k].state == 'pause') {
|
||
uni.createVideoContext(this.dataList[this.k].id, this).pause(); //暂停以后继续播放
|
||
}
|
||
}
|
||
if (this.touchNum >= 2) {
|
||
this.doubleLike();
|
||
}
|
||
this.touchNum = 0;
|
||
}, 200)
|
||
// --------------- ending
|
||
// 2. 不启用双击点赞 start
|
||
// if(state=='play'||state=='continue'){
|
||
// this.dataList[this.k].state = 'pause';
|
||
// }else{
|
||
// this.dataList[this.k].state = 'continue';
|
||
// }
|
||
// if(this.dataList[this.k].state == 'continue'){
|
||
// uni.createVideoContext(this.dataList[this.k]._id,this).play();//暂停以后继续播放
|
||
// }
|
||
// if(this.dataList[this.k].state == 'pause'){
|
||
// uni.createVideoContext(this.dataList[this.k]._id,this).pause();//暂停以后继续播放
|
||
// }
|
||
// --------------- ending
|
||
},
|
||
doubleLike() {
|
||
if (this.dataList[this.k].like == false) {
|
||
this.dataList[this.k].like_n += 1;
|
||
this.dataList[this.k].like = true;
|
||
}
|
||
/*
|
||
点赞
|
||
*/
|
||
},
|
||
toComment(index) {
|
||
// 注意点击评论之后会执行这里
|
||
/*
|
||
(1)先加载缓冲
|
||
(2)获取当前视频 ID 信息
|
||
(3)🌟🌟🌟🌟重要🌟🌟🌟🌟
|
||
- 一定要记得看 index.vue 里面
|
||
uni.setStorageSync("user",this.peopleList[i]);
|
||
这个东西,用于存储当前用户信息。在 插件里面会使用到这个东西,
|
||
记得写一下。
|
||
|
||
(4)打开评论
|
||
*/
|
||
// uni.showToast({
|
||
// title: '加载中111...',
|
||
// icon: 'none',
|
||
// position: 'bottom',
|
||
// duration: 300
|
||
// })
|
||
uni.setStorageSync("videoID", this.dataList[index].id);
|
||
this.$refs.pinglun.open('bottom')
|
||
uni.hideLoading();
|
||
},
|
||
share() {
|
||
uni.showToast({
|
||
title: '分享',
|
||
icon: 'none'
|
||
})
|
||
},
|
||
wxh5Video() {
|
||
uni.navigateTo({
|
||
url: '../wxh5previewVideo/wxh5previewVideo'
|
||
})
|
||
},
|
||
previewVideo() {
|
||
uni.navigateTo({
|
||
url: '../previewVideo/previewVideo'
|
||
})
|
||
},
|
||
toTwoVideo() {
|
||
uni.navigateTo({
|
||
url: '../new_index/new_index'
|
||
})
|
||
},
|
||
tolistVideo() {
|
||
console.log(9999)
|
||
uni.navigateTo({
|
||
url: '../nvueSwiper/nvueSwiper'
|
||
})
|
||
},
|
||
cLike(sss) {
|
||
this.dataList[this.k].like = !this.dataList[this.k].like
|
||
const video = this.dataList[this.k];
|
||
sss ? video.like_n -= 1 : video.like_n += 1;
|
||
/*
|
||
点赞
|
||
*/
|
||
},
|
||
moveHandle() {},
|
||
closeScrollview() {
|
||
// 点击评论里面的叉叉,就会关闭评论
|
||
this.$refs.pinglun.close();
|
||
},
|
||
onTabItemTaps() {
|
||
// #ifdef APP-PLUS
|
||
if (uni.getSystemInfoSync().platform == "ios") {
|
||
let UIImpactFeedbackGenerator = plus.ios.importClass('UIImpactFeedbackGenerator');
|
||
let impact = new UIImpactFeedbackGenerator();
|
||
impact.prepare();
|
||
impact.init(1);
|
||
impact.impactOccurred();
|
||
}
|
||
if (uni.getSystemInfoSync().platform == "android") {
|
||
uni.vibrateShort({
|
||
success: () => {
|
||
console.log('点击震动');
|
||
}
|
||
});
|
||
}
|
||
// #endif
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
<style>
|
||
.container {
|
||
background-color: #000000;
|
||
}
|
||
|
||
.item {
|
||
/* width : 750rpx; */
|
||
background-color: #000000;
|
||
position: relative;
|
||
}
|
||
|
||
.videoHover {
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
flex: 1;
|
||
background-color: rgba(0, 0, 0, 0.1);
|
||
justify-content: center;
|
||
align-items: center;
|
||
|
||
/* border-style: dashed;
|
||
border-color: #DD524D;
|
||
border-width: 1px; */
|
||
}
|
||
|
||
.playState {
|
||
width: 160rpx;
|
||
height: 160rpx;
|
||
opacity: 0.2;
|
||
}
|
||
|
||
.userInfo {
|
||
position: absolute;
|
||
bottom: 230rpx;
|
||
right: 20rpx;
|
||
flex-direction: column;
|
||
width: 100rpx;
|
||
|
||
}
|
||
|
||
.userAvatar {
|
||
border-radius: 500%;
|
||
margin-bottom: 15px;
|
||
border-style: solid;
|
||
border-width: 2px;
|
||
border-color: #ffffff;
|
||
}
|
||
|
||
.userAvatar {
|
||
width: 100rpx;
|
||
height: 100rpx;
|
||
}
|
||
|
||
.likeIco,
|
||
.shareIco,
|
||
.commentIco {
|
||
width: 60rpx;
|
||
height: 60rpx;
|
||
margin-top: 15px;
|
||
}
|
||
|
||
.likeNum,
|
||
.commentNum,
|
||
.shareTex {
|
||
color: #ffffff;
|
||
font-size: 30rpx;
|
||
text-align: center;
|
||
margin: 5px;
|
||
}
|
||
|
||
.likeNumActive {
|
||
color: red;
|
||
}
|
||
|
||
.content {
|
||
width: 680rpx;
|
||
z-index: 99;
|
||
position: absolute;
|
||
bottom: 30px;
|
||
/* justify-content: center; */
|
||
padding: 15rpx;
|
||
flex-direction: column;
|
||
justify-content: flex-start;
|
||
color: #ffffff;
|
||
}
|
||
|
||
.userName {
|
||
font-size: 30rpx;
|
||
color: #ffffff;
|
||
margin-top: 24rpx;
|
||
white-space: nowrap;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
}
|
||
|
||
.words {
|
||
margin-top: 40rpx;
|
||
font-size: 26rpx;
|
||
color: #ffffff;
|
||
overflow: hidden;
|
||
/*文本超出隐藏*/
|
||
display: -webkit-box;
|
||
/*盒子模型微弹性伸缩模型*/
|
||
-webkit-box-orient: vertical;
|
||
/*伸缩盒子的子元素垂直排列*/
|
||
-webkit-line-clamp: 3;
|
||
/*文本显示3行*/
|
||
}
|
||
|
||
.root {
|
||
background-color: #000000;
|
||
}
|
||
|
||
.right-text-avater {
|
||
position: absolute;
|
||
font-size: 14px;
|
||
top: 80rpx;
|
||
left: 30rpx;
|
||
height: 40rpx;
|
||
width: 40rpx;
|
||
background-color: #DD524D;
|
||
color: #FFFFFF;
|
||
border-radius: 50%;
|
||
text-align: center;
|
||
line-height: 40rpx;
|
||
z-index: 999;
|
||
}
|
||
|
||
.box_title_guanzhu_text {
|
||
width: 140rpx;
|
||
position: absolute;
|
||
left: 400rpx;
|
||
top: -8px;
|
||
padding: 15rpx 0rpx;
|
||
/* line-height: 56rpx; */
|
||
border-radius: 35rpx;
|
||
margin-top: 49rpx;
|
||
background-color: #DB384C;
|
||
color: #fff;
|
||
font-size: 25rpx;
|
||
align-content: center;
|
||
align-items: center;
|
||
text-align: center;
|
||
line-height: 18px;
|
||
}
|
||
|
||
.view-product {
|
||
position: absolute;
|
||
margin-left: 16rpx;
|
||
width: 500rpx;
|
||
bottom: 280rpx;
|
||
z-index: 9999;
|
||
font-size: 32rpx;
|
||
color: #FFFFFF;
|
||
//#ifndef APP-PLUS-NVUE
|
||
white-space: pre-wrap;
|
||
text-overflow: ellipsis;
|
||
overflow: hidden;
|
||
//#endif
|
||
|
||
display: flex;
|
||
background-color: rgba(0, 0, 0, 0.2);
|
||
justify-content: space-between;
|
||
flex-direction: row
|
||
}
|
||
</style> |