index.nvue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167
  1. <template>
  2. <view class="container">
  3. <!--
  4. 注意:这是 App 所用页面,请勿引入微信小程序或浏览器运行,最好运行在真机
  5. 1. new_index.nvue、index.nvue这两个是App页面
  6. 2. index.nvue - 页面预加载使用 - 在线预加载方案
  7. 3. 另外:data.js 是上一版本留下的假数据,这一版改成了 URL 请求了(如不需要可以删除,也可作为后端请求参考)
  8. 4. 请各位大神多多留手,我已经把请求内存开到最大了
  9. 5. 视频 id 切记是字符串类型
  10. 6. 这里仅 App 端引入了 App 端专用评论,小程序 、H5 引入的时候 可以作为参考
  11. App、小程序、H5评论请参考插件:https://ext.dcloud.net.cn/plugin?id=7875
  12. -->
  13. <!-- 头部导航 -->
  14. <view class="header">
  15. <view class="items" @click.stop="navTap(2)">
  16. <text class="tName">推荐</text>
  17. <view class="tLine" v-if="currentNav==2"></view>
  18. </view>
  19. <view class="items" @click.stop="navTap(1)">
  20. <text class="tName">最新</text>
  21. <view class="tLine" v-if="currentNav==1"></view>
  22. </view>
  23. </view>
  24. <view class="footer">
  25. <text class="items" @click="goIndex">首页</text>
  26. <text class="items on">视频</text>
  27. <view class="items" @click="goCarts"><text class="cart">购物车</text><text class="cartNum" v-if="cartNum>0">{{cartNum}}</text></view>
  28. <text class="items" @click="goUser">我的</text>
  29. </view>
  30. <view class="noVideo acea-row row-center-wrapper" v-if="!dataList.length">
  31. <view>
  32. <image :src="imgHost+'/statics/images/no-video.png'" class="pictrue"></image>
  33. <text class="tips">暂无短视频内容哦~</text>
  34. </view>
  35. </view>
  36. <!-- <view @click="tolistVideo" style="position: fixed; margin-top: 100upx; right: 40upx;">
  37. <text style="padding: 10upx; padding-left: 40upx; padding-right: 40upx; border-radius: 20upx; background-color: #F8F8F8; font-size: 14px;">H5/小程序</text>
  38. </view>
  39. <view @click="autoPlay" style="position: fixed; margin-top: 100upx; left: 40upx;">
  40. <text style="padding: 10upx; padding-left: 40upx; padding-right: 40upx; border-radius: 20upx; background-color: #F8F8F8; color: #007AFF; font-weight: bold; font-size: 14px;">{{autoplayText}}</text>
  41. </view>
  42. <view @click="previewVideo" style="position: fixed; margin-top: 200upx; right: 40upx;">
  43. <text style="padding: 10upx; padding-left: 40upx; padding-right: 40upx; border-radius: 20upx; background-color: #F8F8F8; font-size: 14px;">App端-预览视频界面</text>
  44. </view>
  45. <view @click="wxh5Video" style="position: fixed; margin-top: 300upx; right: 40upx;">
  46. <text style="padding: 10upx; padding-left: 40upx; padding-right: 40upx; border-radius: 20upx; background-color: #F8F8F8; font-size: 14px;">微信/H5端-预览视频界面</text>
  47. </view> -->
  48. <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>
  49. <view :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;'">
  50. <!--
  51. 1.这里的 swiper 不是用来控制视频滑动的,而是用来控制左右滑动的,如果不需要的可以改成 view
  52. 2.为了 视频无限加载,已经把 21 行的 appear 去掉了,加上了 loadmore 方法(第10行)
  53. 3.由于方法比较多,可以采取下面的方式查看代码:
  54. (1)Mac:按住 option 键,然后点击方法名,即可跳转到方法
  55. (2)windows:按住 Alt 键,然后鼠标左击,即可跳转到方法
  56. -->
  57. <list @loadmore="getData" @scroll="scrolls" :loadmoreoffset="wHeight*1" :show-scrollbar="false" ref="listBox" :pagingEnabled="true" :scrollable="true">
  58. <!-- 刷新模块 -->
  59. <refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown" :display="refreshing ? 'show' : 'hide'">
  60. <loading style="background-color: #FFFFFF;">
  61. <image src="../static/img/index/logins.gif" :style="'width: 80upx; height: 40upx; margin-top: 80upx; margin-bottom: 30upx; margin-left: '+ (windowWidth - 200) +'px;'"></image>
  62. </loading>
  63. </refresh>
  64. <!-- 循环数据 -->
  65. <cell v-for="(item,i) in dataList" :key="i">
  66. <!-- 用div把视频模组套起来 -->
  67. <div :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;'" @disappear="stop()">
  68. <view v-if="Math.abs(k-i)<=1">
  69. <view class="root">
  70. <!--
  71. 具体视频参数可以参考官方文档
  72. 说明:
  73. 1.v-if很关键,这里主要是为了减少 dom 元素【这样才不会加载视频多了闪退】,
  74. 这里 Math.abs(k-i)<=5 也就是往上预加载 5 个视频,往下预加载 5
  75. 个视频这样做的目的是为了让视频能够提前加载但是不播放,在真正滑到位
  76. 置的时候播放视频。
  77. 【2.0.1就是 1 Math.abs(k-i)<=1:请勿修改,记住,要不然会提前播放很多视频】
  78. 2.要注意 @play="playIngs" 里面的 playIngs 方法,这个方法只是在视频播放的时候
  79. 起效果,我们控制视频播放不是用这个的。这个的主要作用是给视频封面的。我们先用
  80. 下面的视频封面盖住视频,等到视频播放的时候,我们不要急着直接播放,而是延迟一下下,
  81. 300-600ms左右。因为视频播放需要一点点时间,这点时间里会黑屏,这个时候我们就用
  82. 下面的封面盖住,这样用户就不会有从黑屏到有画面的感觉了,但是如果遇到视频太大,缓冲
  83. 时间太长,还是会出现短暂的黑屏,大部分是不会有黑屏的(这样盖住的话)。
  84. 【更新记录:2.0版】已经解决了视频黑屏问题,和加载速度慢的情况,如果还是出现了黑屏,
  85. 意味着此时手滑动的速度,已经超过了视频加载的速度,对于这个问题,建议修改 preloadNumber
  86. 变量,当它的值大一点的时候就会提前加载视频,这样用户在滑到视频的时候就不会有停顿感了
  87. 【注意】:老用户在 video 中增加和修改
  88. (1):muted="!item.playIng",
  89. (2)@timeupdate="timeupdate($event,i)"
  90. (3)把 199 行注释了,
  91. (4):id="item.id",
  92. (5)修改:uni.createVideoContext(this.dataList[this.k].id + '' + this.k,this) 为
  93. uni.createVideoContext(this.dataList[this.k].id,this)
  94. (6)在 timeupdate 方法里加入,if(index == this.k){把里面的加一个总的判断}
  95. 3.其他的下面有详解
  96. -->
  97. <video
  98. :ref="'item'+i"
  99. :id="item.id"
  100. :loop="true"
  101. :src="item.video_url"
  102. :muted="item.isplay"
  103. @play="playIngs(i)"
  104. :enable-progress-gesture="false"
  105. :page-gesture="false"
  106. :controls="false"
  107. :http-cache="true"
  108. :show-loading="false"
  109. :show-fullscreen-btn="false"
  110. :show-center-play-btn="false"
  111. :style="boxStyle"
  112. :object-fit="object_fit"
  113. @timeupdate="timeupdate($event,i)"
  114. ></video>
  115. <!-- 这里是封面 -->
  116. <image
  117. v-if="!item.playIng"
  118. :src="item.video_url+'?x-oss-process=video/snapshot,t_100,f_jpg'"
  119. :mode="mode"
  120. :style="'width: '+ windowWidth +'px; height: '+ (wHeight - deleteHeight) +'px; position: absolute;'"
  121. ></image>
  122. <!--
  123. mode: 图片裁剪、缩放的模式
  124. mode 有 14 种模式,其中 5 种是缩放模式,9 种是裁剪模式。
  125. https://uniapp.dcloud.io/component/image
  126. -->
  127. </view>
  128. <!-- 直接用 view 就行了,一样是可以覆盖原生组件的 -->
  129. <!-- 这个是暂停时出现的图标 -->
  130. <view class="videoHover" @click="tapVideoHover(item.state,$event)" @touchstart="touchstartHover" :style="boxStyle">
  131. <image v-if="item.state=='pause'" class="playState" src="../static/img/index/play.png"></image>
  132. </view>
  133. <view class="userInfo">
  134. <!-- 1.头像 -->
  135. <image v-if="item.isShowProgressBarTime == false" @click="tozuozhe(item)" class="userAvatar" :src="item.type_image" mode="aspectFill"></image>
  136. <!-- 2.点赞 -->
  137. <view v-if="item.isShowProgressBarTime == false" @click="cLike(item);" style="opacity: 0.9; margin-top: 5px;">
  138. <image v-if="item.is_like" src="../static/img/index/xin.png" style="width: 29px; height: 29px; position: absolute; right: 6px;"></image>
  139. <image v-if="!item.is_like" src="../static/img/index/xin-2.png" style="width: 29px; height: 29px; position: absolute; right: 6px;"></image>
  140. <text style="color: #FFFFFF; margin-top: 5px; font-size: 12px; text-align: center; margin-top: 32px; font-weight: 400;">{{item.like_num}}</text>
  141. </view>
  142. <!-- 3.评论 -->
  143. <view v-if="item.isShowProgressBarTime == false" class="comment" @click="toComment(item)" style="opacity: 0.9; margin-top: 18px;">
  144. <image src="../static/img/index/evaluate.png" style="width: 54rpx; height: 50rpx; position: absolute; right: 7px;"></image>
  145. <text style="color: #FFFFFF; font-size: 12px; font-weight: 400; text-align: center; margin-top: 29px;">{{item.comment_num}}</text>
  146. </view>
  147. <!-- 收藏 -->
  148. <view @click="cCollect(item);" style="opacity: 0.9; margin-top: 18px;">
  149. <image v-if="item.is_collect" src="../static/img/index/collection02.png" style="width: 29px; height: 29px; position: absolute; right: 6px;"></image>
  150. <image v-if="!item.is_collect" src="../static/img/index/collection01.png" style="width: 29px; height: 29px; position: absolute; right: 6px;"></image>
  151. <text style="color: #FFFFFF; margin-top: 5px; font-size: 12px; text-align: center; margin-top: 36px; font-weight: 400;">{{item.collect_num}}</text>
  152. </view>
  153. <!-- 4.分享 -->
  154. <view v-if="item.isShowProgressBarTime == false" @click="appShare('WXSceneSession',item.id)" style="opacity: 0.9; margin-top: 17px;">
  155. <image src="../static/img/index/share-fill.png" style="width: 40px; height: 40px; position: absolute; right: 5px;"></image>
  156. <text style="color: #FFFFFF; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px;">分享</text>
  157. </view>
  158. </view>
  159. <!-- 最底下的文字部分 -->
  160. <view class="content" v-if="dataList.length !== 0 && dataList[k].isShowProgressBarTime == false">
  161. <view class="cart" @click="goCart(item)" v-if="item.product_num>0">
  162. <image class="cartPic" src="../static/img/index/shopping-car.png"></image>
  163. <text class="cartName">购物</text>
  164. <text class="line"></text>
  165. <text class="cartName">视频款请点击这里购买</text>
  166. </view>
  167. <view class="timeCon" :style="'width: '+ (windowWidth - 90) +'px;'">
  168. <text class="userName" v-if="item.type_name.length<=12">{{item.type_name}}</text>
  169. <text class="userName" v-else>{{item.type_name.slice(0,12)}}...</text>
  170. <text class="time">.{{item.date}}</text>
  171. </view>
  172. <view class="words" :style="'width: '+ (windowWidth - 120) +'px;'">
  173. <view v-if="item.isMore || item.desc.length<=29">
  174. <text class="info">{{item.desc}}</text>
  175. <view class="close">
  176. <text v-if="item.isMore" class="more" @click="moreTap(item)">收起</text>
  177. <image v-if="item.isMore" class="imgClose" src="../static/img/index/drop-down.png"></image>
  178. </view>
  179. </view>
  180. <view class="wordsCon" v-else>
  181. <text class="info">{{item.desc.slice(0,29)}}...</text>
  182. <text class="more" @click="moreTap(item)">更多</text>
  183. <image class="img" src="../static/img/index/drop-down.png"></image>
  184. </view>
  185. </view>
  186. </view>
  187. <!-- 1.视频预览时的图片,currenttimes:就是获取当前滑块的时间点,如果不需要,可以注释掉 -->
  188. <!-- 2.如果使用下面的视频预览的话要注意的是视频链接最好是阿里云上的,因为
  189. https://xxxxxxxxx.mp4?x-oss-process=video/snapshot,t_1000,f_jpg
  190. 这个是阿里云的东西,至于其他的视频截帧我还没有试过。
  191. -->
  192. <!-- 3.阿里云视频截帧地址:https://help.aliyun.com/document_detail/64555.html -->
  193. <image
  194. v-if="item.isShowimage == true"
  195. :src="item.src+'?x-oss-process=video/snapshot,t_'+ currenttimes +'000,f_jpg'"
  196. mode="aspectFill"
  197. :style="'width: 120upx; height: 160upx; border-radius: 10upx; position: absolute; bottom: '+ (ProgressBarBottom + 160) +'upx; left: '+ (currentPositions - 15) +'px;'"
  198. ></image>
  199. </view>
  200. </div>
  201. </cell>
  202. </list>
  203. <!-- 1.注意:进度条这类拖拽的东西不能放进block\cell这些循环体中的,要不然touchmove方法会捕捉有误 -->
  204. <!-- <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;'">
  205. <text style="font-size: 22px; font-weight: bold; color: #F1F1F1;">{{changeTime}} / {{videoTimes}}</text>
  206. </view> -->
  207. <!-- 这里就是进度条了:纯手工进度条,调整位置的话就把他们的 bottom 改成一下就行了 -->
  208. <!-- <view v-if="isDragging == false" @touchmove="touchmove" @touchend="touchend" @touchstart="touchstart" style="position: absolute; bottom: 0; left: 0;"> -->
  209. <!-- 1.这一步必须加,为了适配低端机型 -->
  210. <!-- <text :style="'width: '+ windowWidth +'px; opacity: 0;'">.</text> -->
  211. <!-- 2.这是未加载的时的右边的灰色部分 -->
  212. <!-- <view :style="'width: '+ windowWidth +'px; height: 4upx; background-color: #C8C7CC; position: absolute; bottom: '+ ProgressBarBottom +'upx; opacity: '+ ProgressBarOpacity +';'"></view> -->
  213. <!-- 3.这里我采用的分离式办法:就是让滑动样式和不滑动的样式分开,这样相互不干扰,可以避免进度条闪动的问题 -->
  214. <!-- 4.注意:isShowProgressBarTime 加入了返回数据中 -->
  215. <!-- <view v-if="dataList.length !== 0 && dataList[k].isShowProgressBarTime == false" :style="'width: '+ (currentPosition) +'px; height: 4upx; background-color: #FFFFFF; position: absolute; bottom: '+ ProgressBarBottom +'upx; left: 0; opacity: '+ (ProgressBarOpacity - 0.1) +';'"></view>
  216. <view v-if="dataList.length !== 0 && dataList[k].isShowProgressBarTime == true" :style="'width: '+ (currentPositions) +'px; height: 8upx; background-color: #FFFFFF; position: absolute; bottom: '+ ProgressBarBottom +'upx; left: 0; opacity: '+ (ProgressBarOpacity + 0.05) +';'"></view>
  217. <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) +'upx; left: '+ (currentPosition) +'px; opacity: '+ ProgressBarOpacity +';'"></view>
  218. <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) +'upx; left: '+ (currentPositions - 5) +'px; opacity: '+ ProgressBarOpacity +';'"></view> -->
  219. <!-- </view> -->
  220. </view>
  221. <!--
  222. 请前往 douyin-scrollview.nvue 文件查看
  223. 已经全部注释
  224. 这里就是引入评论插件
  225. -->
  226. <uni-popup type="bottom" ref="pinglun" @touchmove.stop.prevent="moveHandle">
  227. <view :style="'width: '+ windowWidth +'px; height: '+ (boxStyle.height/heightNum) +'px; background-color: #fff; border-top-left-radius: 10px; border-top-right-radius: 10px;'">
  228. <!--
  229. 注意:
  230. deleteIOSHeight
  231. deleteAndroidHeight
  232. 这两个参数用于控制评论等的高度
  233. -->
  234. <douyin-scrollview
  235. :Width="windowWidth"
  236. :Height="(boxStyle.height/1.18)"
  237. :deleteIOSHeight="36"
  238. :deleteAndroidHeight="15"
  239. @closeScrollview="closeScrollview"
  240. @pinlunFun="pinlunFun"
  241. ></douyin-scrollview>
  242. </view>
  243. </uni-popup>
  244. <uni-popup type="bottom" ref="pinglunGoods" @touchmove.stop.prevent="moveHandle">
  245. <view :style="'width: '+ windowWidth +'px;background-color: #F5F5F5; border-top-left-radius: 10px; border-top-right-radius: 10px;'">
  246. <goodsList
  247. :Width="windowWidth"
  248. :Height="(boxStyle.height/1.18)"
  249. ></goodsList>
  250. </view>
  251. </uni-popup>
  252. </view>
  253. </template>
  254. <script>
  255. // import userList from './data.js'//这个是假数据
  256. const app = getApp();
  257. import {
  258. toLogin
  259. } from '@/libs/login.js';
  260. import {
  261. mapGetters
  262. } from 'vuex';
  263. /*
  264. 引入评论组件
  265. */
  266. import douyinScrollview from '../components/douyin-scrollview/douyin-scrollview.nvue'
  267. import goodsList from '../components/goodsList/index.vue'
  268. import {
  269. videoList,
  270. markeVideo
  271. } from '@/api/short-video.js';
  272. import {
  273. HTTP_REQUEST_URL
  274. } from '@/config/app.js';
  275. import {
  276. getCartCounts,
  277. } from '@/api/order.js';
  278. export default {
  279. computed: mapGetters(['isLogin','uid','cartNum']),
  280. data() {
  281. return {
  282. isGoods:false,
  283. //下面打🌟号的是必须要的基础字段
  284. //下面打💗号的是拥有滑动条的必须字段
  285. dataList:[],//用于数据循环的列表🌟💗
  286. wHeight:0,//获取的屏幕高度🌟💗
  287. boxStyle:{//视频,图片封面样式🌟💗
  288. 'height': 0,
  289. 'width': 0,
  290. },
  291. k:0,//默认为0🌟💗
  292. playIngIds:[],//正在播放的视频id列队,列队用于处理滑动过快导致的跳频问题🌟💗
  293. ready:false,//可忽略
  294. isDragging: false,//false代表停止滑动🌟💗
  295. refreshing: true,//用于下拉刷新🌟💗
  296. windowWidth: 0,//获取屏幕宽度🌟💗
  297. windowHeight: 0,
  298. dex: [0,0],//用于判断是上滑还是下滑,第一个存旧值,第二个存新值【目前在1.0.7已经废弃】
  299. currents: 0,//用于左右滑动,0代表视频界面,1代表右滑界面🌟💗
  300. platform: '',//用于获取操作系统:ios、android🌟💗
  301. playIng: false,//用于视频初始化时是否播放,默认不播放🌟💗
  302. videoTime: '',//视频总时长,这个主要用来截取时间数值💗
  303. videoTimes: '',//视频时长,用这个来获取时间值,例如:00:30这个时间值💗
  304. changeTime: '',//显示滑动进度条时变化的时间💗
  305. isShowimage: false,//是否显示封面【1.0.4已废弃,但是意思需要记住】
  306. currenttimes: 0,//当前时间💗
  307. isShowProgressBarTime: false,//是否拖动进度条,如果拖动(true)则显示进度条时间,否则不显示(false)【1.0.4已废弃,但是意思需要记住】
  308. ProgressBarOpacity: 0.7,//进度条不拖动时的默认值,就是透明的💗
  309. dotWidth: 0,//播放的小圆点,默认没有💗
  310. deleteHeight: 0,//测试高度🌟💗
  311. percent: 0,//百分小数💗
  312. currentPosition: 0,//滑块当前位置💗//2.0已弃用,现已用于后端参数
  313. currentPositions: 0,//滑块当前位置的副本💗//2.0已弃用,现已用于后端参数
  314. newTime: 0,//跟手滑动后的最新时间💗
  315. timeNumber: 0,//🌟💗
  316. ProgressBarBottom: 20,//进度条离底部的距离💗
  317. object_fit: 'contain',//视频样式默认包含🌟💗
  318. mode: 'aspectFit',//图片封面样式🌟💗
  319. timeout: "",//🌟用来阻止 setTimeout()方法
  320. voice: "",//🌟用来阻止 setTimeout()方法
  321. oldVideo: "",
  322. isAutoplay: false,//是否开启自动播放(默认不开启)
  323. autoplayText: "开启自动播放",
  324. timers: "",
  325. // 引入评论 - 参数
  326. heightNum: 1.18,
  327. // 双击点赞参数
  328. touchNum: 0,
  329. aixinLeft: 0,
  330. aixinTop: 0,
  331. isShowAixin: false,
  332. Rotate: 0,
  333. currentNav:1,
  334. limit: 6,
  335. page: 1
  336. }
  337. },
  338. components:{
  339. douyinScrollview,
  340. goodsList
  341. },
  342. watch:{
  343. async k(k,old_k){//监听 k 值的变化,可以控制视频的播放与暂停
  344. // console.log('的点点滴滴多',this.dataList[k].id);
  345. this.dataList[old_k].state = 'stop'//如果是被滑走的视频,就停止播放
  346. this.dataList[old_k].playIng = false//如果视频暂停,就加载封面
  347. this.dataList[old_k].isplay = true
  348. // uni.createVideoContext(this.dataList[old_k].id,this).seek(0)
  349. uni.createVideoContext(this.dataList[old_k].id,this).play()
  350. clearTimeout(this.oldVideo)
  351. this.oldVideo = await setTimeout(()=>{
  352. uni.createVideoContext(this.dataList[old_k].id,this).seek(0)
  353. uni.createVideoContext(this.dataList[old_k].id,this).pause()
  354. console.log('预留第' + (old_k + 1) + '个视频:' + this.dataList[old_k].id)
  355. },500)
  356. uni.createVideoContext(this.dataList[k].id,this).play();
  357. clearTimeout(this.voice)
  358. this.voice = await setTimeout(()=>{
  359. this.dataList[k].isplay = false
  360. },300)
  361. await setTimeout(()=>{
  362. this.dataList[k].playIng = true
  363. },850)
  364. //【2.0版本更新内容】- start
  365. var p = k
  366. ++p
  367. await setTimeout(async ()=>{
  368. uni.createVideoContext(this.dataList[p].id,this).play()
  369. clearTimeout(this.timeout)
  370. this.timeout = await setTimeout(()=>{
  371. uni.createVideoContext(this.dataList[p].id,this).seek(0)
  372. uni.createVideoContext(this.dataList[p].id,this).pause()
  373. console.log('预加载第' + (p + 1) + '个视频:' + this.dataList[p].id)
  374. },1500)
  375. },20)
  376. //【2.0版本更新内容】- end
  377. //【此处处理进度条卡住的问题】
  378. if(uni.getSystemInfoSync().platform !== 'ios'){
  379. await setTimeout(()=>{
  380. uni.createVideoContext(this.dataList[k].id,this).pause()
  381. uni.createVideoContext(this.dataList[k].id,this).play()
  382. },100)
  383. }
  384. }
  385. },
  386. onShow(){
  387. console.log('回到前台');
  388. if(this.dataList.length !== 0){
  389. this.dataList[this.k].state = 'play';
  390. uni.createVideoContext(this.dataList[this.k].id,this).play()
  391. }
  392. },
  393. onHide(){
  394. this.dataList[this.k].state = 'pause';//界面隐藏也要停止播放视频
  395. uni.createVideoContext(this.dataList[this.k].id,this).pause();//暂停以后继续播放
  396. console.log('到后台');
  397. },
  398. onLoad(options){
  399. this.videoID = options.id || 0;
  400. if (options.pid) app.globalData.spid = options.pid;
  401. console.log('到后台');
  402. this.platform = uni.getSystemInfoSync().platform
  403. var model = uni.getSystemInfoSync().model
  404. if(this.platform == 'ios' && (model !== 'iPhone6' || model !== 'iPhone6s' || model !== 'iPhone7' || model !== 'iPhone8')){
  405. this.deleteHeight = 32//有 tabbar的 修改这里可以改变视频高度
  406. /*
  407. 引入评论参数
  408. */
  409. this.heightNum = 1.27
  410. } else {
  411. this.deleteHeight = 0
  412. /*
  413. 引入评论参数
  414. */
  415. this.heightNum = 1.18
  416. }
  417. this.windowWidth = uni.getSystemInfoSync().screenWidth//获取屏幕宽度
  418. this.boxStyle.width = this.windowWidth + 'px'//给宽度加px
  419. this.wHeight = uni.getSystemInfoSync().screenHeight;//获取屏幕高度
  420. this.boxStyle.height = this.wHeight - this.deleteHeight;//改变视频高度
  421. this.get()//这一步,加载视频数据
  422. if (this.isLogin) {
  423. this.getCartNum()
  424. }
  425. },
  426. onReady() {
  427. },
  428. methods: {
  429. getCartNum: function() {
  430. let id = uni.getStorageSync('user_store_id') || 0;
  431. getCartCounts(0,id).then(res => {
  432. this.$store.commit('indexData/setCartNum', res.data.count > 99 ? '..' : res.data.count + '')
  433. });
  434. },
  435. goIndex(){
  436. uni.switchTab({
  437. url: '/pages/index/index'
  438. })
  439. },
  440. goCarts(){
  441. uni.switchTab({
  442. url: '/pages/order_addcart/order_addcart'
  443. })
  444. },
  445. goUser(){
  446. uni.switchTab({
  447. url: '/pages/user/index'
  448. })
  449. },
  450. pinlunFun(e){
  451. let videoID = uni.getStorageSync("videoID");
  452. this.dataList.forEach(item=>{
  453. if(item.id == videoID){
  454. item.comment_num = e;
  455. }
  456. })
  457. },
  458. cShare(id){
  459. markeVideo('share',id).then(res=>{}).catch(err=>{
  460. return uni.showToast({
  461. title: err,
  462. icon: 'none',
  463. duration: 2000
  464. });
  465. })
  466. },
  467. // 分享
  468. // #ifdef APP-PLUS
  469. appShare(scene,id) {
  470. let that = this
  471. uni.showLoading({
  472. title: '加载中',
  473. mask: true
  474. });
  475. let uid = this.uid?this.uid:0;
  476. let data = this.dataList[this.k];
  477. let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
  478. let curRoute = routes[routes.length - 1].$page.fullPath // 获取当前页面路由,也就是最后一个打开的页面路由
  479. uni.share({
  480. provider: "weixin",
  481. scene: scene,
  482. type: 0,
  483. href: `${HTTP_REQUEST_URL}${curRoute}&pid=${that.uid}&id=${id}`,
  484. title: data.type_name || '',
  485. summary: data.desc || '',
  486. imageUrl: data.image || '',
  487. success: function(res) {
  488. uni.hideLoading();
  489. that.cShare(id);
  490. },
  491. fail: function(err) {
  492. uni.showToast({
  493. title: '分享失败',
  494. icon: 'none',
  495. duration: 2000
  496. })
  497. }
  498. });
  499. },
  500. // #endif
  501. onMyEvent: function() {
  502. this.$set(this, 'isGoods', false);
  503. },
  504. goCart(item){
  505. if (this.isLogin === false) {
  506. return toLogin();
  507. }
  508. uni.showToast({
  509. title: '加载中...',
  510. icon: 'none',
  511. position: 'bottom',
  512. duration: 300
  513. })
  514. uni.setStorageSync("videoID",parseInt(item.id));
  515. this.$refs.pinglunGoods.open('bottom');
  516. },
  517. navTap(n){
  518. this.currentNav = n;
  519. this.oldVideo = "";
  520. this.k = 0;
  521. this.page = 1;
  522. this.dataList = [];
  523. this.get();
  524. },
  525. moreTap(item){
  526. item.isMore = !item.isMore;
  527. },
  528. autoPlay(){
  529. this.isAutoplay = !this.isAutoplay;
  530. if(!this.isAutoplay){
  531. this.autoplayText = "开启自动播放"
  532. uni.showToast({
  533. title: "关闭自动播放",
  534. icon: 'none',
  535. duration: 3000
  536. })
  537. } else {
  538. this.autoplayText = "关闭自动播放"
  539. uni.showToast({
  540. title: "开启自动播放",
  541. icon: 'none',
  542. duration: 3000
  543. })
  544. }
  545. },
  546. getData(){
  547. // 这里就是数据加载完以后再向后端发送数据的地方,
  548. videoList({
  549. page: this.page,
  550. limit: this.limit,
  551. order_type: this.currentNav,
  552. id: this.page > 1 ? 0 : this.videoID
  553. }).then(res=>{
  554. this.page = this.page + 1;
  555. var msg = res.data
  556. for (let i = 0; i < msg.length; i++) {
  557. this.dataList.push(msg[i])
  558. }
  559. }).catch(err=>{
  560. return uni.showToast({ title: err, icon: 'none', duration: 2000 });
  561. })
  562. },
  563. touchstart(event){
  564. this.dataList[this.k].isShowimage = true //刚触摸的时候就要显示预览视频图片了
  565. this.dataList[this.k].isShowProgressBarTime = true //显示时间线
  566. this.ProgressBarOpacity = 1 //让滑块显示起来更明显一点
  567. this.dotWidth = 10 //让点显示起来更明显一点
  568. },
  569. touchend(){//当手松开后,跳到最新时间
  570. uni.createVideoContext(this.dataList[this.k].id,this).seek(this.newTime)
  571. if(this.dataList[this.k].state == 'pause'){
  572. this.dataList[this.k].state = 'play'
  573. uni.createVideoContext(this.dataList[this.k].id,this).play()
  574. }
  575. this.dataList[this.k].isShowProgressBarTime = false //触摸结束后,隐藏时间线
  576. this.dataList[this.k].isShowimage = false //触摸结束后,隐藏时间预览
  577. this.ProgressBarOpacity = 0.5 //隐藏起来进度条,不那么明显了
  578. this.dotWidth = 0 //隐藏起来进度条,不那么明显了
  579. },
  580. touchmove(event){//当手移动滑块时,计算位置、百分小数、新的时间
  581. var msg = []
  582. if(this.videoTime !== ''){
  583. msg = this.videoTime.split(':')
  584. }
  585. var timeNumber = Number(msg[0])*60 + Number(msg[1])
  586. this.currentPositions = event.changedTouches[0].screenX
  587. this.percent = this.currentPositions / this.windowWidth
  588. this.newTime = this.percent*timeNumber
  589. this.currenttimes = parseInt(this.newTime)
  590. let theTime = this.newTime
  591. let middle = 0;// 分
  592. if(theTime > 60) {
  593. middle = parseInt(theTime/60);
  594. theTime = parseInt(theTime%60);
  595. }
  596. this.changeTime = `${Math.round(middle)>9?Math.round(middle):'0'+Math.round(middle)}:${Math.round(theTime)>9?Math.round(theTime):'0'+Math.round(theTime)}`
  597. },
  598. timeupdate(event,index){//计算滑块当前位置,计算当前百分小数
  599. // console.log(index)
  600. if(index == this.k){
  601. // console.log(event)
  602. var currenttime = event.detail.currentTime
  603. this.timeNumber = Math.round(event.detail.duration)
  604. this.getTime()
  605. this.percent = currenttime/this.timeNumber
  606. this.currentPosition = this.windowWidth*this.percent
  607. let theTime = currenttime
  608. let middle = 0;// 分
  609. if(theTime > 60) {
  610. middle = parseInt(theTime/60);
  611. theTime = parseInt(theTime%60);
  612. }
  613. this.changeTime = `${Math.round(middle)>9?Math.round(middle):'0'+Math.round(middle)}:${Math.round(theTime)>9?Math.round(theTime):'0'+Math.round(theTime)}`
  614. //自动切换视频
  615. if(this.isAutoplay){//true,代表自动播放
  616. if(Math.round(currenttime) == this.timeNumber - 1){
  617. const dom = uni.requireNativePlugin('dom')
  618. let doms = 'item'+(this.k+1)
  619. setTimeout(()=>{
  620. let el = this.$refs[doms][0]
  621. dom.scrollToElement(el,{
  622. offset: 0,
  623. animated: true
  624. })
  625. },500)
  626. }
  627. }
  628. }
  629. },
  630. getTime(){//得到时间函数
  631. this.videoTime = this.formatSeconds(this.timeNumber);
  632. // console.log(that.videoTime)
  633. var msg = []
  634. if(this.videoTime !== ''){
  635. msg = this.videoTime.split(':')
  636. }
  637. this.videoTimes = `${msg[0]>9?msg[0]:'0'+msg[0]}:${msg[1]>9?msg[1]:'0'+msg[1]}`;
  638. },
  639. formatSeconds(value) {//获取时间函数
  640. let theTime = parseInt(value);// 秒
  641. let middle= 0;// 分
  642. if(theTime > 60) {
  643. middle= parseInt(theTime/60);
  644. theTime = parseInt(theTime%60);
  645. }
  646. return `${middle>9?middle:middle}:${theTime>9?theTime:theTime}`;
  647. },
  648. playIngs(index) {
  649. //
  650. },
  651. moreVideo(index){
  652. },
  653. toVideo(index){
  654. },
  655. erweima(){
  656. },
  657. tozuozhe(item){
  658. this.currents = 1//点击头像以后就会切换
  659. if(item.type==0){
  660. uni.reLaunch({
  661. url: `/pages/index/index`
  662. });
  663. }else{
  664. uni.reLaunch({
  665. url: `/pages/store_cate/store_cate?id=`+item.relation_id
  666. });
  667. }
  668. },
  669. stop(){
  670. // console.log('stop')
  671. },
  672. scrolls (event) {
  673. this.isDragging = event.isDragging
  674. if (!event.isDragging) {//isDragging:判断用户是不是在滑动,滑动:true,停止滑动:false。我们要用户停止滑动时才给 k 赋值,这样就可以避免很多麻烦
  675. var i = Math.round(Math.abs(event.contentOffset.y) / (this.wHeight - this.deleteHeight + 1))//先用绝对值取出滑动的距离,然后除以屏幕高度,取一个整,就知道你现在滑动到哪一个视频了
  676. if(i !== this.k){//这里加判断是因为这个方法会执行很多次,会造成重复请求,所以这里写一个限制
  677. if(uni.getSystemInfoSync().platform == 'ios'){
  678. this.k = i//判断了用户没有滑动,确认了用户的确是在看这个视频,然后就赋值啦
  679. this.dataList[this.k].state = 'play'
  680. console.log('正在播放 --> 第' + (this.k + 1) + '个视频~')
  681. } else {
  682. clearTimeout(this.timers);
  683. this.timers = setTimeout(()=>{
  684. this.k = i//判断了用户没有滑动,确认了用户的确是在看这个视频,然后就赋值啦
  685. this.dataList[this.k].state = 'play'
  686. console.log('正在播放 --> 第' + (this.k + 1) + '个视频~')
  687. },80)
  688. }
  689. }
  690. }
  691. },
  692. get(){
  693. // 这个方法主要就是用来第一次进入视频播放时用来处理的
  694. videoList({
  695. page: this.page,
  696. limit: this.limit,
  697. order_type: this.currentNav,
  698. id: this.videoID
  699. }).then(async (res)=>{
  700. this.page = this.page + 1;
  701. var msg = res.data;
  702. this.dataList = msg;
  703. this.dataList[0].state = "play";
  704. await setTimeout(()=>{
  705. //这里的延迟是为了避免执行时间太快而直接跳过执行的bug
  706. uni.createVideoContext(this.dataList[0].id,this).seek(0)
  707. uni.createVideoContext(this.dataList[0].id,this).play()
  708. },200)
  709. this.dataList[0].isplay = false
  710. await setTimeout(()=>{
  711. this.dataList[0].playIng = true
  712. },500)
  713. var p = 0
  714. await setTimeout(async ()=>{
  715. ++p
  716. uni.createVideoContext(this.dataList[p].id,this).play()
  717. await setTimeout(()=>{
  718. uni.createVideoContext(this.dataList[p].id,this).seek(0)
  719. uni.createVideoContext(this.dataList[p].id,this).pause()
  720. console.log('预加载第' + (p + 1) + '个视频s:' + this.dataList[p].id)
  721. },800)
  722. },50)
  723. }).catch(err=>{
  724. return uni.showToast({
  725. title: err,
  726. icon: 'none',
  727. duration: 2000
  728. });
  729. })
  730. },
  731. onpullingdown(){
  732. // console.log('正在下拉刷新,此时手还在触摸没有松开')
  733. this.refreshing = true
  734. },
  735. onrefresh(){
  736. // console.log('下拉刷新完毕,此时手松开了')
  737. setTimeout(()=>{
  738. this.refreshing = false
  739. },1000)
  740. },
  741. // 双击点赞效果
  742. touchstartHover(event){
  743. if(this.touchNum >= 1){
  744. // console.log('双击 -- X坐标:'+ event.touches[0].screenX);
  745. // console.log('双击 -- Y坐标:'+ event.touches[0].screenY);
  746. this.aixinLeft = event.touches[0].screenX - 50;
  747. this.aixinTop = event.touches[0].screenY - 50;
  748. this.isShowAixin = true;
  749. let max = 40; let min = -40;
  750. this.Rotate = Math.floor(Math.random() * (max - min + 1)) + min;
  751. setTimeout(()=>{
  752. this.isShowAixin = false;
  753. },700)
  754. this.onTabItemTaps();
  755. }
  756. },
  757. //点击播放&&暂停
  758. tapVideoHover(state,event){
  759. this.dataList[this.k].isShowimage = false
  760. this.dataList[this.k].isShowProgressBarTime = false
  761. this.ProgressBarOpacity = 0.5
  762. this.dotWidth = 0
  763. console.log('state--',state);
  764. // 1.启用双击点赞 --- start
  765. this.touchNum++;
  766. setTimeout(()=>{
  767. if(this.touchNum == 1){
  768. if(state=='play'||state=='continue'){
  769. this.dataList[this.k].state = 'pause';
  770. }else{
  771. this.dataList[this.k].state = 'continue';
  772. }
  773. if(this.dataList[this.k].state == 'continue'){
  774. uni.createVideoContext(this.dataList[this.k].id,this).play();//暂停以后继续播放
  775. }
  776. if(this.dataList[this.k].state == 'pause'){
  777. uni.createVideoContext(this.dataList[this.k].id,this).pause();//暂停以后继续播放
  778. }
  779. }
  780. if(this.touchNum >= 2){
  781. this.doubleLike();
  782. }
  783. this.touchNum = 0;
  784. },200)
  785. // --------------- ending
  786. // 2. 不启用双击点赞 start
  787. // if(state=='play'||state=='continue'){
  788. // this.dataList[this.k].state = 'pause';
  789. // }else{
  790. // this.dataList[this.k].state = 'continue';
  791. // }
  792. // if(this.dataList[this.k].state == 'continue'){
  793. // uni.createVideoContext(this.dataList[this.k].id,this).play();//暂停以后继续播放
  794. // }
  795. // if(this.dataList[this.k].state == 'pause'){
  796. // uni.createVideoContext(this.dataList[this.k].id,this).pause();//暂停以后继续播放
  797. // }
  798. // --------------- ending
  799. },
  800. doubleLike(){
  801. if(this.dataList[this.k].is_like == false){
  802. this.dataList[this.k].like_num += 1;
  803. this.dataList[this.k].is_like = true;
  804. }
  805. /*
  806. 点赞
  807. */
  808. },
  809. toComment(item){
  810. // 注意点击评论之后会执行这里
  811. /*
  812. (1)先加载缓冲
  813. (2)获取当前视频 ID 信息
  814. (3)🌟🌟🌟🌟重要🌟🌟🌟🌟
  815. - 一定要记得看 index.vue 里面
  816. uni.setStorageSync("user",this.peopleList[i]);
  817. 这个东西,用于存储当前用户信息。在 插件里面会使用到这个东西,
  818. 记得写一下。
  819. (4)打开评论
  820. */
  821. uni.showToast({
  822. title: '加载中...',
  823. icon: 'none',
  824. position: 'bottom',
  825. duration: 300
  826. })
  827. uni.setStorageSync("videoID",parseInt(item.id));
  828. uni.setStorageSync("pinlunNum",item.comment_num);
  829. this.$refs.pinglun.open('bottom')
  830. },
  831. wxh5Video(){
  832. uni.navigateTo({
  833. url: '../wxh5previewVideo/wxh5previewVideo'
  834. })
  835. },
  836. previewVideo(){
  837. uni.navigateTo({
  838. url: '../previewVideo/previewVideo'
  839. })
  840. },
  841. toTwoVideo(){
  842. uni.navigateTo({
  843. url: '../new_index/new_index'
  844. })
  845. },
  846. tolistVideo(){
  847. uni.navigateTo({
  848. url: '../nvueSwiper/nvueSwiper'
  849. })
  850. },
  851. cLike(item){
  852. markeVideo('like',item.id).then(res=>{
  853. this.dataList[this.k].is_like = !this.dataList[this.k].is_like
  854. const video = this.dataList[this.k];
  855. item.is_like?video.like_num += 1:video.like_num -= 1;
  856. }).catch(err=>{
  857. return uni.showToast({
  858. title: err,
  859. icon: 'none',
  860. duration: 2000
  861. });
  862. })
  863. /*
  864. 点赞
  865. */
  866. },
  867. /*
  868. 收藏
  869. */
  870. cCollect(item){
  871. markeVideo('collect',item.id).then(res=>{
  872. this.dataList[this.k].is_collect = !this.dataList[this.k].is_collect
  873. const video = this.dataList[this.k];
  874. item.is_collect?video.collect_num += 1:video.collect_num -= 1;
  875. }).catch(err=>{
  876. return uni.showToast({
  877. title: err,
  878. icon: 'none',
  879. duration: 2000
  880. });
  881. })
  882. },
  883. moveHandle(){},
  884. closeScrollview(){
  885. // 点击评论里面的叉叉,就会关闭评论
  886. this.$refs.pinglun.close();
  887. },
  888. onTabItemTaps() {
  889. // #ifdef APP-PLUS
  890. if (uni.getSystemInfoSync().platform == "ios") {
  891. let UIImpactFeedbackGenerator = plus.ios.importClass('UIImpactFeedbackGenerator');
  892. let impact = new UIImpactFeedbackGenerator();
  893. impact.prepare();
  894. impact.init(1);
  895. impact.impactOccurred();
  896. }
  897. if (uni.getSystemInfoSync().platform == "android") {
  898. uni.vibrateShort({
  899. success: () => {
  900. console.log('点击震动');
  901. }
  902. });
  903. }
  904. // #endif
  905. }
  906. }
  907. }
  908. </script>
  909. <style lang="scss">
  910. .noVideo{
  911. position: fixed;
  912. top: 400rpx;
  913. z-index: 9;
  914. width:750rpx;
  915. flex-direction: row;
  916. justify-content: center;
  917. .pictrue{
  918. width: 414rpx;
  919. height: 256rpx;
  920. }
  921. .tips{
  922. text-align: center;
  923. margin-top: 14rpx;
  924. font-size: 26rpx;
  925. color: #999;
  926. }
  927. }
  928. .footer{
  929. align-items: center;
  930. justify-content: space-around;
  931. flex-direction: row;
  932. background-color: #161616;
  933. height: 100rpx;
  934. position: fixed;
  935. bottom: 0;
  936. z-index: 9;
  937. width: 750rpx;
  938. line-height: 100rpx;
  939. .items{
  940. position: relative;
  941. color: #999999;
  942. font-size: 30rpx;
  943. .cart{
  944. color: #999999;
  945. font-size: 30rpx;
  946. display: flex;
  947. height: 100rpx;
  948. line-height: 100rpx;
  949. }
  950. &.on{
  951. color: #fff;
  952. }
  953. .cartNum{
  954. position:absolute;
  955. height: 28rpx;
  956. background: #E93323;
  957. border-radius: 15rpx;
  958. color: #fff;
  959. line-height: 27rpx;
  960. padding: 0 8rpx;
  961. right: 0px;
  962. top: 20rpx;
  963. font-size: 22rpx;
  964. }
  965. }
  966. }
  967. .header{
  968. position: fixed;
  969. z-index: 9;
  970. width: 750rpx;
  971. height: 86rpx;
  972. flex-direction:row;
  973. justify-content: center;
  974. top: 80rpx;
  975. .items{
  976. margin: 0 41rpx;
  977. .tName{
  978. color: #FFFFFF;
  979. font-size: 28rpx;
  980. }
  981. .tLine{
  982. width: 30rpx;
  983. height: 4rpx;
  984. background: #FFFFFF;
  985. border-radius: 2rpx;
  986. margin-left: 15rpx;
  987. margin-top: 10rpx;
  988. }
  989. }
  990. }
  991. .container {background-color: #000000;}
  992. .item {
  993. /* width : 750rpx; */
  994. background-color: #000000;
  995. position: relative;
  996. }
  997. .videoHover{
  998. position: absolute;
  999. top: 0;
  1000. left: 0;
  1001. flex: 1;
  1002. background-color: rgba(0,0,0,0.1);
  1003. justify-content: center;
  1004. align-items: center;
  1005. /* border-style: dashed;
  1006. border-color: #DD524D;
  1007. border-width: 1px; */
  1008. }
  1009. .playState{
  1010. width: 160rpx;
  1011. height: 160rpx;
  1012. opacity: 0.2;
  1013. }
  1014. .userInfo{
  1015. position: absolute;
  1016. bottom:160px;
  1017. right: 10px;
  1018. flex-direction: column;
  1019. }
  1020. .userAvatar{
  1021. border-radius: 500%;
  1022. margin-bottom: 15px;
  1023. border-style: solid;
  1024. border-width: 2px;
  1025. border-color: #ffffff;
  1026. }
  1027. .userAvatar{
  1028. width : 80rpx;
  1029. height: 80rpx;
  1030. }
  1031. .likeIco,.shareIco,.commentIco{
  1032. width : 60rpx;
  1033. height: 60rpx;
  1034. margin-top: 15px;
  1035. }
  1036. .likeNum,.commentNum,.shareTex{
  1037. color: #ffffff;
  1038. font-size: 30rpx;
  1039. text-align: center;
  1040. margin: 5px;
  1041. }
  1042. .content{
  1043. width: 720rpx;
  1044. z-index: 99;
  1045. position: absolute;
  1046. bottom: 80px;
  1047. /* justify-content: center; */
  1048. padding: 15rpx;
  1049. flex-direction: column;
  1050. justify-content: flex-start;
  1051. color: #ffffff;
  1052. .time{
  1053. font-size: 24rpx;
  1054. color: rgba(255,255,255,0.5);
  1055. margin-left: 12rpx;
  1056. }
  1057. .cart{
  1058. background: rgba(153,153,153,0.3);
  1059. width: 376rpx;
  1060. height: 48rpx;
  1061. border-radius: 4rpx;
  1062. margin-bottom: 22rpx;
  1063. flex-direction:row;
  1064. justify-content: center;
  1065. align-items: center;
  1066. .cartPic{
  1067. width: 36rpx;
  1068. height: 36rpx;
  1069. margin-right: 14rpx;
  1070. }
  1071. .cartName{
  1072. font-size: 24rpx;
  1073. color: #fff;
  1074. }
  1075. .line{
  1076. width: 2rpx;
  1077. height: 22rpx;
  1078. background-color: rgba(255,255,255,0.3);
  1079. margin: 0 12rpx;
  1080. }
  1081. }
  1082. }
  1083. .timeCon{
  1084. flex-direction:row;
  1085. align-items: center;
  1086. .userName {
  1087. font-size: 30rpx;
  1088. color: #ffffff;
  1089. }
  1090. }
  1091. .words {
  1092. margin-top: 20rpx;
  1093. .close{
  1094. display: flex;
  1095. flex-direction: row;
  1096. align-items: center;
  1097. justify-content: flex-end;
  1098. margin-right: 20rpx;
  1099. .imgClose{
  1100. width: 18rpx;
  1101. height: 10rpx;
  1102. margin-left: 10rpx;
  1103. }
  1104. }
  1105. .wordsCon{
  1106. position: relative;
  1107. .more{
  1108. position: absolute;
  1109. bottom: 0;
  1110. right: 40rpx;
  1111. font-size: 26rpx;
  1112. }
  1113. .img{
  1114. width: 18rpx;
  1115. height: 10rpx;
  1116. margin-left: 4rpx;
  1117. position: absolute;
  1118. bottom: 7rpx;
  1119. right: 20rpx;
  1120. }
  1121. }
  1122. .info{
  1123. color: #fff;
  1124. font-size: 28rpx;
  1125. }
  1126. .more{
  1127. font-size: 26rpx;
  1128. color: #AAAAAA;
  1129. font-weight: 400;
  1130. }
  1131. }
  1132. .root{
  1133. background-color: #000000;
  1134. }
  1135. </style>