index.nvue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348
  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 v-if="!isUser" class="header">
  15. <view class="items" @click.stop="navTap(2)">
  16. <text class="tName" :class="currentNav==2?'on':''">关注</text>
  17. </view>
  18. <view class="items" @click.stop="navTap(1)">
  19. <text class="tName" :class="currentNav==1?'on':''">推荐</text>
  20. </view>
  21. </view>
  22. <view class="noVideo acea-row row-center-wrapper" v-if="!dataList.length && !loadVideo">
  23. <view>
  24. <image :src="imgHost+'/static/no-video.png'" class="pictrue"></image>
  25. <text class="tips">暂无短视频内容哦~</text>
  26. </view>
  27. </view>
  28. <view :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;'">
  29. <!--
  30. 1.这里的 swiper 不是用来控制视频滑动的,而是用来控制左右滑动的,如果不需要的可以改成 view
  31. 2.为了 视频无限加载,已经把 21 行的 appear 去掉了,加上了 loadmore 方法(第10行)
  32. 3.由于方法比较多,可以采取下面的方式查看代码:
  33. (1)Mac:按住 option 键,然后点击方法名,即可跳转到方法
  34. (2)windows:按住 Alt 键,然后鼠标左击,即可跳转到方法
  35. -->
  36. <list @loadmore="getData" @scroll="scrolls" :loadmoreoffset="wHeight*1" :show-scrollbar="false" ref="listBox" :pagingEnabled="true" :scrollable="true">
  37. <!-- 刷新模块 -->
  38. <refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown" :display="refreshing ? 'show' : 'hide'">
  39. <loading style="background-color: #FFFFFF;">
  40. <image src="../static/img/index/logins.gif" :style="'width: 80upx; height: 40upx; margin-top: 80upx; margin-bottom: 30upx; margin-left: '+ (windowWidth - 200) +'px;'"></image>
  41. </loading>
  42. </refresh>
  43. <!-- 循环数据 -->
  44. <cell v-for="(item,i) in dataList" :key="i">
  45. <!-- 用div把视频模组套起来 -->
  46. <div :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;'">
  47. <!-- <view v-if="Math.abs(k-i)<=1"> -->
  48. <view v-if="max > i">
  49. <view class="root">
  50. <!--
  51. 具体视频参数可以参考官方文档
  52. 说明:
  53. 1.v-if很关键,这里主要是为了减少 dom 元素【这样才不会加载视频多了闪退】,
  54. 这里 Math.abs(k-i)<=5 也就是往上预加载 5 个视频,往下预加载 5
  55. 个视频这样做的目的是为了让视频能够提前加载但是不播放,在真正滑到位
  56. 置的时候播放视频。
  57. 【2.0.1就是 1 Math.abs(k-i)<=1:请勿修改,记住,要不然会提前播放很多视频】
  58. 2.要注意 @play="playIngs" 里面的 playIngs 方法,这个方法只是在视频播放的时候
  59. 起效果,我们控制视频播放不是用这个的。这个的主要作用是给视频封面的。我们先用
  60. 下面的视频封面盖住视频,等到视频播放的时候,我们不要急着直接播放,而是延迟一下下,
  61. 300-600ms左右。因为视频播放需要一点点时间,这点时间里会黑屏,这个时候我们就用
  62. 下面的封面盖住,这样用户就不会有从黑屏到有画面的感觉了,但是如果遇到视频太大,缓冲
  63. 时间太长,还是会出现短暂的黑屏,大部分是不会有黑屏的(这样盖住的话)。
  64. 【更新记录:2.0版】已经解决了视频黑屏问题,和加载速度慢的情况,如果还是出现了黑屏,
  65. 意味着此时手滑动的速度,已经超过了视频加载的速度,对于这个问题,建议修改 preloadNumber
  66. 变量,当它的值大一点的时候就会提前加载视频,这样用户在滑到视频的时候就不会有停顿感了
  67. 【注意】:老用户在 video 中增加和修改
  68. (1):muted="!item.playIng",
  69. (2)@timeupdate="timeupdate($event,i)"
  70. (3)把 199 行注释了,
  71. (4):id="item.id",
  72. (5)修改:uni.createVideoContext(this.dataList[this.k].id + '' + this.k,this) 为
  73. uni.createVideoContext(this.dataList[this.k].id,this)
  74. (6)在 timeupdate 方法里加入,if(index == this.k){把里面的加一个总的判断}
  75. 3.其他的下面有详解
  76. -->
  77. <video
  78. :ref="'item'+i"
  79. :id="item.community_id"
  80. :loop="true"
  81. :autoplay="i == k"
  82. :src="item.video_link"
  83. :muted="item.isplay"
  84. :enable-progress-gesture="false"
  85. :page-gesture="false"
  86. :controls="false"
  87. :show-loading="true"
  88. :show-fullscreen-btn="false"
  89. :show-center-play-btn="false"
  90. :style="boxStyle"
  91. :object-fit="object_fit"
  92. @timeupdate="timeupdate($event,i)"
  93. ></video>
  94. </view>
  95. <!-- 直接用 view 就行了,一样是可以覆盖原生组件的 -->
  96. <!-- 这个是暂停时出现的图标 -->
  97. <view class="videoHover" @click="tapVideoHover(item.state,$event)" :style="boxStyle">
  98. <image v-if="item.state=='pause'" class="playState" src="../static/img/index/play.png"></image>
  99. </view>
  100. <!--审核状态-->
  101. <view v-if="item.status==-1 || item.status==0 || item.status==-2" class="video-status">
  102. <view v-if="item.status == -1 || item.status == -2" class="status-title">
  103. <image class="image" src="../static/img/index/video-failed.png"></image>
  104. <text class="title">{{item.status == -1 ? '审核未通过' : '已下架'}},内容仅自己可见</text>
  105. </view>
  106. <view v-else class="status-title">
  107. <image class="image" src="../static/img/index/video-review.png"></image>
  108. <text class="title">正在审核,内容仅自己可见</text>
  109. </view>
  110. <view class="status_info">
  111. <text class="refusal">{{(item.status == -1 || item.status == -2) ? item.refusal : '发布的内容审核通过后,将在首页展示!'}}</text>
  112. </view>
  113. </view>
  114. <!-- 最底下的文字部分 -->
  115. <view class="content" v-if="dataList.length !== 0">
  116. <view class="cart">
  117. <text class="cartName">@{{item.author.nickname}}</text>
  118. </view>
  119. <view class="words" :style="'width: '+ (windowWidth - 120) +'px;'">
  120. <view v-if="item.isMore || item.content.length<=29">
  121. <text class="info">{{item.content}}</text>
  122. <view class="close">
  123. <text v-if="item.isMore" class="more" @click="moreTap(item)">收起</text>
  124. </view>
  125. </view>
  126. <view class="wordsCon" v-else>
  127. <text class="info">{{item.content.slice(0,29)}}...</text>
  128. <text class="more" @click="moreTap(item)">更多</text>
  129. </view>
  130. </view>
  131. <view v-if="item.relevance.length > 0 && k==i" class="product">
  132. <scroll-view class="scroll-view" scroll-x="true" style="white-space: nowrap; display: flex;" scroll-with-animation show-scrollbar="true">
  133. <view class="product-item" v-for="(goods,idx) in item.relevance" :key="idx">
  134. <view v-if="goods.spu" class="item-count acea-row" @click="goDetail(goods.spu)">
  135. <view class="picture">
  136. <image class="image" :src="goods.spu.image"></image>
  137. </view>
  138. <view class="product-text">
  139. <text class="name line1" v-if="goods.spu && goods.spu.store_name.length>=12">{{goods.spu.store_name.slice(0,12)}}...</text>
  140. <text class="name line1" v-else>{{goods.spu && goods.spu.store_name}}</text>
  141. <view class="product-price">
  142. <view class="price"><text class="sm">¥</text><text class="money">{{goods.spu.price}}</text></view>
  143. <text class="buy-btn">购买</text>
  144. </view>
  145. </view>
  146. </view>
  147. </view>
  148. </scroll-view>
  149. </view>
  150. <navigator v-if="item.topic" hover-class="none" class="product_cate" :url="'/pages/plantGrass/plant_search_list/index?id='+item.topic.topic_id">
  151. <view class="pro-view">
  152. <text class="icon">#</text><text class="text">{{item.topic.topic_name}}</text>
  153. </view>
  154. </navigator>
  155. </view>
  156. <view class="userInfo">
  157. <!-- 1.头像 -->
  158. <navigator v-if="userInfo.uid != item.author.uid" hover-class="none" :url="'/pages/plantGrass/plant_user/index?id='+item.uid" class="pictrue">
  159. <image class="userAvatar" :src="item.author.avatar || '/static/images/f.png'" mode="aspectFill"></image>
  160. <view v-if="!item.is_fans || userInfo.uid == 0" class="guanzhu" @click.stop="followAuthor(item)"><text class="iconfont icon-shangpinshuliang-jia">+</text></view>
  161. <view v-else class="yiguanzhu"><text class="iconfont"></text></view>
  162. </navigator>
  163. <!-- 2.点赞 -->
  164. <view @click="cLike(item);" style="margin-top: 5px;" :class="{'likeNumActive':item.relevance_id}">
  165. <image v-if="item.relevance_id" src="../static/img/index/xin.png" style="width: 32px; height: 32px;"></image>
  166. <image v-if="!item.relevance_id" src="../static/img/index/xin-2.png" style="width: 32px; height: 32px;"></image>
  167. <text class="info-text">{{item.count_start > 0 ? item.count_start : '点赞'}}</text>
  168. </view>
  169. <!-- 3.评论 -->
  170. <view v-if="community_reply_status == 1 && item.status == 1" class="comment" @click="toComment(item,i)" style="margin-top: 18px;">
  171. <image src="../static/img/index/evaluate.png" style="width: 54rpx; height: 50rpx;"></image>
  172. <text class="info-text">{{item.count_reply>0 ? item.count_reply : '评论'}}</text>
  173. </view>
  174. <!-- 4.分享 -->
  175. <view v-if="item.status == 1" @click="appShare('WXSceneSession',item.community_id)" style="margin-top: 17px;">
  176. <image src="../static/img/index/share-fill.png" style="width: 40px; height: 40px;"></image>
  177. <text class="info-text">分享</text>
  178. </view>
  179. <!-- 5.自己的视频 -->
  180. <view v-if="userInfo.uid == item.author.uid" style="margin-top: 17px;">
  181. <view class="video-my" @click="showManage = !showManage">
  182. <view class="video-dian">
  183. <text class="dian"></text>
  184. <text class="dian"></text>
  185. <text class="dian"></text>
  186. </view>
  187. </view>
  188. </view>
  189. <!-- 提到的商品 -->
  190. <view v-if="item.relevance.length>0 && k==i" @click="openMore(item)" class="mention" style="opacity: 0.9; margin-top: 18px;">
  191. <image class="image" src="../static/img/index/collection.png"></image>
  192. <text class="count">{{item.relevance.length}}</text>
  193. </view>
  194. </view>
  195. <view v-if="showManage" class="manage">
  196. <view class="manage-gou"></view>
  197. <navigator hover-class="none" :url="'/pages/plantGrass/plant_release/index?id='+item.community_id+'&type=2'" class="items">
  198. <image src="../static/img/index/video-edit.png" style="width: 16px; height: 16px;"></image>
  199. <text class="text">编辑</text>
  200. </navigator>
  201. <view class="items" @click.stop="deleteTopic(item)">
  202. <image src="../static/img/index/video-delete.png" style="width: 16px; height: 16px;"></image>
  203. <text class="text">删除</text>
  204. </view>
  205. </view>
  206. <!-- 1.视频预览时的图片,currenttimes:就是获取当前滑块的时间点,如果不需要,可以注释掉 -->
  207. <!-- 2.如果使用下面的视频预览的话要注意的是视频链接最好是阿里云上的,因为
  208. https://xxxxxxxxx.mp4?x-oss-process=video/snapshot,t_1000,f_jpg
  209. 这个是阿里云的东西,至于其他的视频截帧我还没有试过。
  210. -->
  211. <!-- 3.阿里云视频截帧地址:https://help.aliyun.com/document_detail/64555.html -->
  212. <image
  213. v-if="item.isShowimage == true"
  214. :src="item.src+'?x-oss-process=video/snapshot,t_'+ currenttimes +'000,f_jpg'"
  215. mode="aspectFill"
  216. :style="'width: 120upx; height: 160upx; border-radius: 10upx; position: absolute; bottom: '+ (ProgressBarBottom + 160) +'upx; left: '+ (currentPositions - 15) +'px;'"
  217. ></image>
  218. </view>
  219. </div>
  220. </cell>
  221. </list>
  222. </view>
  223. <!--
  224. 请前往 douyin-scrollview.nvue 文件查看
  225. 已经全部注释
  226. 这里就是引入评论插件
  227. -->
  228. <uni-popup type="bottom" ref="pinglun" @touchmove.stop.prevent="moveHandle">
  229. <view :style="'width: '+ windowWidth +'px; height: '+ (boxStyle.height/heightNum) +'px; background-color: #fff; border-top-left-radius: 10px; border-top-right-radius: 10px;'">
  230. <!--
  231. 注意:
  232. deleteIOSHeight
  233. deleteAndroidHeight
  234. 这两个参数用于控制评论等的高度
  235. -->
  236. <douyin-scrollview
  237. ref="comments"
  238. :deleteIOSHeight="36"
  239. :deleteAndroidHeight="15"
  240. :userInfo="userInfo"
  241. @closeScrollview="closeScrollview"
  242. @successFul="pinlunFun"
  243. ></douyin-scrollview>
  244. </view>
  245. </uni-popup>
  246. <!-- 他提到的宝贝弹窗 -->
  247. <uni-popup type="bottom" ref="pinglunMentioned">
  248. <view :style="'width: '+ windowWidth +'px;background-color: #F5F5F5; border-top-left-radius: 10px; border-top-right-radius: 10px;'">
  249. <mentioned ref="mentioned" @close="closePopup" :list="moreList" :uid="authorUid"></mentioned>
  250. </view>
  251. </uni-popup>
  252. <view class="fixed-head">
  253. <view class="sys-head" :style="{height:statusBarHeight}"></view>
  254. <view class="tool-bar" @click='goBack()'>
  255. <image class="icon-xiangzuo" src="../static/img/index/icon-back.png"></image>
  256. </view>
  257. </view>
  258. </view>
  259. </template>
  260. <script>
  261. // +----------------------------------------------------------------------
  262. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  263. // +----------------------------------------------------------------------
  264. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  265. // +----------------------------------------------------------------------
  266. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  267. // +----------------------------------------------------------------------
  268. // | Author: CRMEB Team <admin@crmeb.com>
  269. // +----------------------------------------------------------------------
  270. const app = getApp();
  271. let sysHeight = uni.getSystemInfoSync().statusBarHeight
  272. import { toLogin } from '@/libs/login.js';
  273. import { mapGetters } from 'vuex';
  274. import { configMap } from '@/utils';
  275. /*
  276. 引入评论组件
  277. */
  278. import douyinScrollview from '../components/douyin-scrollview/douyin-scrollview.nvue'
  279. import mentioned from '../components/mentioned/mentioned.vue'
  280. import { videoList, myVideoList, graphicStartApi, followAuthorApi, deletePlantApi, focusArticleLst } from '@/api/community.js';
  281. import { HTTP_REQUEST_URL } from '@/config/app.js';
  282. import { getUserInfo } from '@/api/user.js';
  283. export default {
  284. computed: configMap({statusBarHeight: 0,community_reply_status:0},mapGetters(['isLogin', 'uid'])),
  285. data() {
  286. return {
  287. imgHost: HTTP_REQUEST_URL,
  288. //下面打🌟号的是必须要的基础字段
  289. //下面打💗号的是拥有滑动条的必须字段
  290. dataList:[],//用于数据循环的列表🌟💗
  291. wHeight:0,//获取的屏幕高度🌟💗
  292. boxStyle:{//视频,图片封面样式🌟💗
  293. 'height': 0,
  294. 'width': 0,
  295. },
  296. k:0,//默认为0🌟💗
  297. max: 2,
  298. playIngIds:[],//正在播放的视频id列队,列队用于处理滑动过快导致的跳频问题🌟💗
  299. ready:false,//可忽略
  300. isDragging: false,//false代表停止滑动🌟💗
  301. refreshing: true,//用于下拉刷新🌟💗
  302. windowWidth: 0,//获取屏幕宽度🌟💗
  303. windowHeight: 0,
  304. dex: [0,0],//用于判断是上滑还是下滑,第一个存旧值,第二个存新值【目前在1.0.7已经废弃】
  305. currents: 0,//用于左右滑动,0代表视频界面,1代表右滑界面🌟💗
  306. platform: '',//用于获取操作系统:ios、android🌟💗
  307. playIng: false,//用于视频初始化时是否播放,默认不播放🌟💗
  308. videoTime: '',//视频总时长,这个主要用来截取时间数值💗
  309. videoTimes: '',//视频时长,用这个来获取时间值,例如:00:30这个时间值💗
  310. changeTime: '',//显示滑动进度条时变化的时间💗
  311. isShowimage: false,//是否显示封面【1.0.4已废弃,但是意思需要记住】
  312. currenttimes: 0,//当前时间💗
  313. isShowProgressBarTime: false,//是否拖动进度条,如果拖动(true)则显示进度条时间,否则不显示(false)【1.0.4已废弃,但是意思需要记住】
  314. ProgressBarOpacity: 0.7,//进度条不拖动时的默认值,就是透明的💗
  315. dotWidth: 0,//播放的小圆点,默认没有💗
  316. deleteHeight: 0,//测试高度🌟💗
  317. percent: 0,//百分小数💗
  318. currentPosition: 0,//滑块当前位置💗//2.0已弃用,现已用于后端参数
  319. currentPositions: 0,//滑块当前位置的副本💗//2.0已弃用,现已用于后端参数
  320. newTime: 0,//跟手滑动后的最新时间💗
  321. timeNumber: 0,//🌟💗
  322. ProgressBarBottom: 20,//进度条离底部的距离💗
  323. object_fit: 'contain',//视频样式默认包含🌟💗
  324. mode: 'aspectFit',//图片封面样式🌟💗
  325. timeout: "",//🌟用来阻止 setTimeout()方法
  326. voice: "",//🌟用来阻止 setTimeout()方法
  327. oldVideo: "",
  328. isAutoplay: false,//是否开启自动播放(默认不开启)
  329. autoplayText: "开启自动播放",
  330. timers: "",
  331. // 引入评论 - 参数
  332. heightNum: 1.8,
  333. // 双击点赞参数
  334. touchNum: 0,
  335. aixinLeft: 0,
  336. aixinTop: 0,
  337. showComment: false,
  338. loadVideo: true,
  339. loaded: false,
  340. Rotate: 0,
  341. currentNav:1,
  342. limit: 6,
  343. page: 1,
  344. userInfo: {uid: 0},
  345. moreList: [],
  346. authorUid: 0,
  347. showManage: false,
  348. isUser: false,
  349. isSatrt: 0,
  350. userUid: 0,
  351. sysHeight: sysHeight,
  352. }
  353. },
  354. components:{
  355. douyinScrollview,
  356. mentioned,
  357. },
  358. watch:{
  359. async k(new_k,old_k){//监听 k 值的变化,可以控制视频的播放与暂停
  360. const max = new_k+2;
  361. if(this.max < max){
  362. this.max = max;
  363. }
  364. this.dataList[old_k].playIng = false //如果视频暂停,就加载封面
  365. this.dataList[old_k].isplay = true
  366. this.dataList[old_k].state = 'pause'
  367. console.log('预留第' + (old_k) + '个视频:' + this.dataList[old_k].community_id)
  368. // 2.0版本已经去掉了下面这一句,视频不用暂停,只需要把声音禁止就行
  369. uni.createVideoContext(this.dataList[old_k].community_id, this).pause() //如果视频暂停,那么旧视频停止,这里的this.dataList[old_k].id + '' + old_k,后面加 old_k 是为了每一个视频的 id 值不同,这样就可以大程度的避免串音问题
  370. console.log('已经暂停 --> 第' + (old_k) + '个视频~') //提示
  371. this.dataList[new_k].state = 'play'
  372. this.dataList[new_k].isplay = false
  373. this.dataList[new_k].playIng = true
  374. uni.createVideoContext(this.dataList[new_k].community_id, this).play()
  375. }
  376. },
  377. onShow(){
  378. uni.hideLoading();
  379. console.log('回到前台'+this.dataList.length);
  380. if(this.dataList.length !== 0){
  381. this.dataList[this.k].state = 'play';
  382. setTimeout(() => {
  383. uni.createVideoContext(this.dataList[this.k].community_id,this).play()
  384. }, 250)
  385. }
  386. },
  387. onHide(){
  388. this.dataList[this.k].state = 'pause';//界面隐藏也要停止播放视频
  389. setTimeout(() => {
  390. uni.createVideoContext(this.dataList[this.k].community_id,this).pause();//暂停以后继续播放
  391. }, 250)
  392. },
  393. onLoad(options){
  394. this.videoID = options.id || 0;
  395. this.isUser = options.user==1 ? true : false;
  396. this.userUid = options.uid ? options.uid : 0;
  397. this.isSatrt = options.tab == 1 ? 1 : 0;
  398. if (options.pid) app.globalData.spid = options.pid;
  399. this.platform = uni.getSystemInfoSync().platform
  400. this.windowWidth = uni.getSystemInfoSync().screenWidth//获取屏幕宽度
  401. this.boxStyle.width = this.windowWidth + 'px'//给宽度加px
  402. this.wHeight = uni.getSystemInfoSync().screenHeight;//获取屏幕高度
  403. this.boxStyle.height = this.wHeight;//改变视频高度
  404. this.get()//这一步,加载视频数据
  405. if(this.isLogin)this.getUserInfo()
  406. },
  407. onReady() {
  408. },
  409. methods: {
  410. goBack: function() {
  411. uni.navigateBack();
  412. },
  413. navTap(n){
  414. this.currentNav = n;
  415. this.dataList.forEach(item=>{
  416. item.state = 'pause';
  417. })
  418. this.oldVideo = "";
  419. this.k = 0;
  420. this.page = 1;
  421. this.loadVideo = true;
  422. this.dataList = [];
  423. n == 1 ? this.get() : this.getFocusList()
  424. },
  425. pinlunFun(e){
  426. this.dataList[e]['count_reply']++
  427. },
  428. // #ifdef APP-PLUS
  429. appShare(scene,id) {
  430. let that = this
  431. uni.showLoading({
  432. title: '加载中',
  433. mask: true
  434. });
  435. let uid = this.uid?this.uid:0;
  436. let data = this.dataList[this.k];
  437. let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
  438. let curRoute = routes[routes.length - 1].$page.fullPath // 获取当前页面路由,也就是最后一个打开的页面路由
  439. uni.share({
  440. provider: "weixin",
  441. scene: scene,
  442. type: 0,
  443. href: `${HTTP_REQUEST_URL}/pages/short_video/nvueSwiper/index?&id=${id}`,
  444. title: data.title || '',
  445. summary: data.content || '',
  446. imageUrl: data.image[0] || '',
  447. success: function(res) {
  448. uni.showToast({
  449. title: '分享成功',
  450. icon: 'success'
  451. })
  452. uni.hideLoading();
  453. },
  454. fail: function(err) {
  455. uni.hideLoading();
  456. uni.showToast({
  457. title: '分享失败',
  458. icon: 'none',
  459. duration: 2000
  460. })
  461. }
  462. });
  463. },
  464. // #endif
  465. /**
  466. * 获取个人用户信息
  467. */
  468. getUserInfo: function() {
  469. let that = this;
  470. getUserInfo().then(res => {
  471. that.userInfo = res.data;
  472. });
  473. },
  474. // 关注作者
  475. followAuthor: function(item) {
  476. if (this.isLogin === false) {
  477. toLogin()
  478. }else{
  479. let status = 1
  480. followAuthorApi(item.uid,{status:status}).then(res => {
  481. if (res.status === 200) {
  482. item.is_fans = true
  483. }
  484. uni.showToast({
  485. title: res.message,
  486. icon: 'none',
  487. duration: 2000
  488. });
  489. }).catch(err=>{
  490. return uni.showToast({
  491. title: err,
  492. icon: 'none',
  493. duration: 2000
  494. });
  495. });
  496. }
  497. },
  498. // 删除话题
  499. deleteTopic(item){
  500. let that = this;
  501. uni.showModal({
  502. content: '确定要删除该话题么?',
  503. success: function(res) {
  504. if(res.confirm) {
  505. deletePlantApi(item.community_id).then(res => {
  506. uni.showToast({
  507. title: res.message,
  508. icon: 'none',
  509. duration: 2000
  510. });
  511. setTimeout(()=>{
  512. uni.redirectTo({
  513. url: `/pages/plantGrass/plant_user/index?id=${item.uid}`
  514. })
  515. },1000)
  516. })
  517. } else if(res.cancel) {
  518. console.log('用户点击取消');
  519. }
  520. }
  521. });
  522. },
  523. moreTap(item){
  524. item.isMore = !item.isMore;
  525. },
  526. autoPlay(){
  527. this.isAutoplay = !this.isAutoplay;
  528. if(!this.isAutoplay){
  529. this.autoplayText = "开启自动播放"
  530. uni.showToast({
  531. title: "关闭自动播放",
  532. icon: 'none',
  533. duration: 3000
  534. })
  535. } else {
  536. this.autoplayText = "关闭自动播放"
  537. uni.showToast({
  538. title: "开启自动播放",
  539. icon: 'none',
  540. duration: 3000
  541. })
  542. }
  543. },
  544. getData(){
  545. // 这里就是数据加载完以后再向后端发送数据的地方,
  546. let that = this;
  547. if(!that.loadVideo) return
  548. if(that.loaded) return
  549. that.loadVideo = true
  550. that.isUser ?
  551. myVideoList(that.userUid,{
  552. page: that.page,
  553. limit: that.limit,
  554. is_star: that.isSatrt,
  555. community_id: that.videoID
  556. }).then(res=>{
  557. that.loadVideo = false
  558. that.loadend = res.data.list.length < that.limit
  559. that.getVideoData(res.data.list);
  560. }).catch(err=>{
  561. return uni.showToast({
  562. title: err,
  563. icon: 'none',
  564. duration: 2000
  565. });
  566. }) :
  567. videoList({
  568. page: that.page,
  569. limit: that.limit,
  570. id: that.videoID
  571. }).then(res=>{
  572. that.loadVideo = false
  573. that.loadend = res.data.list.length < that.limit
  574. that.getVideoData(res.data.list);
  575. }).catch(err=>{
  576. return uni.showToast({
  577. title: err,
  578. icon: 'none',
  579. duration: 2000
  580. });
  581. })
  582. },
  583. getFocusList(){
  584. let that = this;
  585. if(!that.loadVideo) return
  586. that.loadVideo = true
  587. focusArticleLst({
  588. page: that.page,
  589. limit: that.limit,
  590. }).then(res=>{
  591. that.loadVideo = false
  592. that.getVideoData(res.data.list)
  593. }).catch(err=>{
  594. return uni.showToast({
  595. title: err,
  596. icon: 'none',
  597. duration: 2000
  598. });
  599. })
  600. },
  601. getVideoData(list){
  602. console.log(list.length)
  603. if(list.length == 0) return
  604. let that = this;
  605. that.loadVideo = list.length == that.limit
  606. that.page = that.page + 1;
  607. var msg = list
  608. for (let i = 0; i < msg.length; i++) {
  609. msg[i]['isMore'] = false
  610. msg[i]['playIng'] = false
  611. msg[i]['state'] = false
  612. msg[i]['isplay'] = false
  613. msg[i]['loading'] = false
  614. msg[i]['community_id'] = msg[i]['community_id'].toString()
  615. that.dataList.push(msg[i])
  616. }
  617. if(that.dataList.length !== 0){
  618. that.dataList[that.k].state = 'play';
  619. setTimeout(function() {
  620. uni.createVideoContext(that.dataList[that.k].community_id,that).play()
  621. }, 10);
  622. }
  623. },
  624. touchstart(event){
  625. this.dataList[this.k].isShowimage = true //刚触摸的时候就要显示预览视频图片了
  626. this.dataList[this.k].isShowProgressBarTime = true //显示时间线
  627. this.ProgressBarOpacity = 1 //让滑块显示起来更明显一点
  628. this.dotWidth = 10 //让点显示起来更明显一点
  629. },
  630. touchend(){//当手松开后,跳到最新时间
  631. uni.createVideoContext(this.dataList[this.k].community_id,this).seek(this.newTime)
  632. if(this.dataList[this.k].state == 'pause'){
  633. this.dataList[this.k].state = 'play'
  634. uni.createVideoContext(this.dataList[this.k].community_id,this).play()
  635. }
  636. this.dataList[this.k].isShowProgressBarTime = false //触摸结束后,隐藏时间线
  637. this.dataList[this.k].isShowimage = false //触摸结束后,隐藏时间预览
  638. this.ProgressBarOpacity = 0.5 //隐藏起来进度条,不那么明显了
  639. this.dotWidth = 0 //隐藏起来进度条,不那么明显了
  640. },
  641. touchmove(event){//当手移动滑块时,计算位置、百分小数、新的时间
  642. var msg = []
  643. if(this.videoTime !== ''){
  644. msg = this.videoTime.split(':')
  645. }
  646. var timeNumber = Number(msg[0])*60 + Number(msg[1])
  647. this.currentPositions = event.changedTouches[0].screenX
  648. this.percent = this.currentPositions / this.windowWidth
  649. this.newTime = this.percent*timeNumber
  650. this.currenttimes = parseInt(this.newTime)
  651. let theTime = this.newTime
  652. let middle = 0;// 分
  653. if(theTime > 60) {
  654. middle = parseInt(theTime/60);
  655. theTime = parseInt(theTime%60);
  656. }
  657. this.changeTime = `${Math.round(middle)>9?Math.round(middle):'0'+Math.round(middle)}:${Math.round(theTime)>9?Math.round(theTime):'0'+Math.round(theTime)}`
  658. },
  659. timeupdate(event,index){//计算滑块当前位置,计算当前百分小数
  660. if(index == this.k){
  661. var currenttime = event.detail.currentTime
  662. this.timeNumber = Math.round(event.detail.duration)
  663. this.getTime()
  664. this.percent = currenttime/this.timeNumber
  665. this.currentPosition = this.windowWidth*this.percent
  666. let theTime = currenttime
  667. let middle = 0;// 分
  668. if(theTime > 60) {
  669. middle = parseInt(theTime/60);
  670. theTime = parseInt(theTime%60);
  671. }
  672. this.changeTime = `${Math.round(middle)>9?Math.round(middle):'0'+Math.round(middle)}:${Math.round(theTime)>9?Math.round(theTime):'0'+Math.round(theTime)}`
  673. //自动切换视频
  674. if(this.isAutoplay){//true,代表自动播放
  675. if(Math.round(currenttime) == this.timeNumber - 1){
  676. const dom = uni.requireNativePlugin('dom')
  677. let doms = 'item'+(this.k+1)
  678. setTimeout(()=>{
  679. let el = this.$refs[doms][0]
  680. dom.scrollToElement(el,{
  681. offset: 0,
  682. animated: true
  683. })
  684. },500)
  685. }
  686. }
  687. }
  688. },
  689. getTime(){//得到时间函数
  690. this.videoTime = this.formatSeconds(this.timeNumber);
  691. var msg = []
  692. if(this.videoTime !== ''){
  693. msg = this.videoTime.split(':')
  694. }
  695. this.videoTimes = `${msg[0]>9?msg[0]:'0'+msg[0]}:${msg[1]>9?msg[1]:'0'+msg[1]}`;
  696. },
  697. formatSeconds(value) {//获取时间函数
  698. let theTime = parseInt(value);// 秒
  699. let middle= 0;// 分
  700. if(theTime > 60) {
  701. middle= parseInt(theTime/60);
  702. theTime = parseInt(theTime%60);
  703. }
  704. return `${middle>9?middle:middle}:${theTime>9?theTime:theTime}`;
  705. },
  706. moreVideo(index){
  707. },
  708. toVideo(index){
  709. },
  710. scrolls (event) {
  711. this.showManage = false;
  712. this.isDragging = event.isDragging;
  713. if (!event.isDragging) {//isDragging:判断用户是不是在滑动,滑动:true,停止滑动:false。我们要用户停止滑动时才给 k 赋值,这样就可以避免很多麻烦
  714. var i = Math.round(Math.abs(event.contentOffset.y) / (this.wHeight - this.deleteHeight + 1))//先用绝对值取出滑动的距离,然后除以屏幕高度,取一个整,就知道你现在滑动到哪一个视频了
  715. if(i !== this.k){//这里加判断是因为这个方法会执行很多次,会造成重复请求,所以这里写一个限制
  716. if(uni.getSystemInfoSync().platform == 'ios'){
  717. this.k = i//判断了用户没有滑动,确认了用户的确是在看这个视频,然后就赋值啦
  718. this.dataList[this.k].state = 'play'
  719. console.log('正在播放 --> 第' + (this.k + 1) + '个视频~')
  720. } else {
  721. clearTimeout(this.timers);
  722. this.timers = setTimeout(()=>{
  723. this.k = i//判断了用户没有滑动,确认了用户的确是在看这个视频,然后就赋值啦
  724. this.dataList[this.k].state = 'play'
  725. console.log('正在播放 --> 第' + (this.k + 1) + '个视频~')
  726. },80)
  727. }
  728. }
  729. }
  730. },
  731. get(){
  732. if(!this.loadVideo) return
  733. if(this.loaded) return
  734. this.loadVideo = true
  735. // 这个方法主要就是用来第一次进入视频播放时用来处理的
  736. this.isUser ?
  737. myVideoList(this.userUid,{
  738. page: this.page,
  739. limit: this.limit,
  740. is_star: this.isSatrt,
  741. community_id: this.videoID
  742. }).then(async (res)=>{
  743. this.loadVideo = false
  744. this.loadend = res.data.list.length < this.limit
  745. this.page = this.page + 1;
  746. var msg = res.data.list;
  747. for (let i = 0; i < msg.length; i++) {
  748. msg[i]['isMore'] = false
  749. msg[i]['playIng'] = false
  750. msg[i]['state'] = false
  751. msg[i]['isplay'] = false
  752. msg[i]['loading'] = false
  753. msg[i]['community_id'] = msg[i]['community_id'].toString()
  754. }
  755. this.dataList = msg;
  756. if(this.dataList.length !== 0){
  757. this.dataList[this.k].state = 'play';
  758. uni.createVideoContext(this.dataList[this.k].community_id,this).play()
  759. }
  760. }).catch(err=>{
  761. return uni.showToast({
  762. title: err,
  763. icon: 'none',
  764. duration: 2000
  765. });
  766. }) :
  767. videoList({
  768. page: this.page,
  769. limit: this.limit,
  770. id: this.videoID
  771. }).then(async (res)=>{
  772. console.log(res.data.list.length)
  773. this.loadend = res.data.list.length < this.limit
  774. this.page = this.page + 1;
  775. var msg = res.data.list;
  776. for (let i = 0; i < msg.length; i++) {
  777. msg[i]['isMore'] = false
  778. msg[i]['playIng'] = false
  779. msg[i]['state'] = false
  780. msg[i]['isplay'] = false
  781. msg[i]['community_id'] = msg[i]['community_id'].toString()
  782. }
  783. this.dataList = msg;
  784. }).catch(err=>{
  785. return uni.showToast({
  786. title: err,
  787. icon: 'none',
  788. duration: 2000
  789. });
  790. })
  791. },
  792. onpullingdown(){
  793. this.refreshing = true
  794. },
  795. onrefresh(){
  796. setTimeout(()=>{
  797. this.refreshing = false
  798. },1000)
  799. },
  800. //点击播放&&暂停
  801. tapVideoHover(state,event){
  802. this.dataList[this.k].isShowimage = false
  803. this.dataList[this.k].isShowProgressBarTime = false
  804. this.ProgressBarOpacity = 0.5
  805. this.dotWidth = 0
  806. this.touchNum++;
  807. setTimeout(()=>{
  808. if(this.touchNum == 1){
  809. if(state=='play'||state=='continue'){
  810. this.dataList[this.k].state = 'pause';
  811. }else{
  812. this.dataList[this.k].state = 'continue';
  813. }
  814. if(this.dataList[this.k].state == 'continue'){
  815. uni.createVideoContext(this.dataList[this.k].community_id,this).play();//暂停以后继续播放
  816. }
  817. if(this.dataList[this.k].state == 'pause'){
  818. uni.createVideoContext(this.dataList[this.k].community_id,this).pause();//暂停以后继续播放
  819. }
  820. }
  821. this.touchNum = 0;
  822. },200)
  823. },
  824. toComment(item,index){
  825. // 注意点击评论之后会执行这里
  826. /*
  827. (1)先加载缓冲
  828. (2)获取当前视频 ID 信息
  829. (3)🌟🌟🌟🌟重要🌟🌟🌟🌟
  830. - 一定要记得看 index.vue 里面
  831. uni.setStorageSync("user",this.peopleList[i]);
  832. 这个东西,用于存储当前用户信息。在 插件里面会使用到这个东西,
  833. 记得写一下。
  834. (4)打开评论
  835. */
  836. uni.setStorageSync("videoList",item);
  837. uni.setStorageSync("videoIndex",index);
  838. this.$refs.pinglun.open('bottom')
  839. },
  840. cLike(item){
  841. if (this.isLogin === false) {
  842. toLogin()
  843. }else{
  844. let status = item.relevance_id ? 0 : 1
  845. graphicStartApi(item.community_id,{status: status}).then(res=>{
  846. if(item.relevance_id){
  847. item.count_start--;
  848. item.count_start = item.count_start == 0 ? 0 : item.count_start
  849. item.relevance_id = false
  850. }else{
  851. item.count_start++;
  852. item.relevance_id = true
  853. }
  854. }).catch(err=>{
  855. return uni.showToast({
  856. title: err,
  857. icon: 'none',
  858. duration: 2000
  859. });
  860. })
  861. }
  862. },
  863. moveHandle(){},
  864. closeScrollview(){
  865. // 点击评论里面的叉叉,就会关闭评论
  866. this.$refs.pinglun.close();
  867. },
  868. /*查看提到的宝贝*/
  869. openMore(item){
  870. this.$refs.pinglunMentioned.open('bottom');
  871. this.moreList = item.relevance;
  872. this.authorUid = item.uid
  873. },
  874. closePopup(){
  875. this.$refs.pinglunMentioned.close();
  876. },
  877. goDetail(item){
  878. if (item.product_type === 1) {
  879. uni.navigateTo({
  880. url: `/pages/activity/goods_seckill_details/index?id=${item.product_id}&time=${item.stop_time}&spid=${this.uid}`
  881. })
  882. } else if (item.product_type === 2) {
  883. uni.navigateTo({
  884. url: `/pages/activity/presell_details/index?id=${item.activity_id}&spid=${this.uid}`
  885. })
  886. } else if (item.product_type === 0) {
  887. uni.navigateTo({
  888. url: `/pages/goods_details/index?id=${item.product_id}&spid=${this.uid}`
  889. })
  890. }else if (item.product_type === 4) {
  891. uni.navigateTo({
  892. url: `/pages/activity/combination_details/index?id=${item.activity_id}&spid=${this.uid}`
  893. })
  894. }else if (item.product_type === 40) {
  895. uni.navigateTo({
  896. url: `/pages/activity/combination_status/index?id=${item.activity_id}&spid=${this.uid}`
  897. })
  898. }
  899. }
  900. },
  901. // onReachBottom() {
  902. // uni.$emit('onReachBottom');
  903. // },
  904. }
  905. </script>
  906. <style lang="scss" scoped>
  907. .noVideo{
  908. position: fixed;
  909. top: 400rpx;
  910. z-index: 9;
  911. width:750rpx;
  912. flex-direction: row;
  913. justify-content: center;
  914. .pictrue{
  915. width: 414rpx;
  916. height: 256rpx;
  917. }
  918. .tips{
  919. text-align: center;
  920. margin-top: 14rpx;
  921. font-size: 26rpx;
  922. color: #999;
  923. }
  924. }
  925. .fixed-head{
  926. flex-direction: row;
  927. justify-content: center;
  928. align-items: center;
  929. position: fixed;
  930. left: 0;
  931. top: 70rpx;
  932. height: 86rpx;
  933. .icon-xiangzuo {
  934. margin-left: 10px;
  935. width: 13px;
  936. height: 14px;
  937. color: #ffffff;
  938. }
  939. }
  940. .header{
  941. position: fixed;
  942. z-index: 9;
  943. width: 750rpx;
  944. height: 86rpx;
  945. flex-direction: row;
  946. justify-content: center;
  947. align-items: center;
  948. top: 70rpx;
  949. .items{
  950. margin: 0 30rpx;
  951. .tName{
  952. color: #ffffff;
  953. font-size: 32rpx;
  954. &.on{
  955. font-size: 38rpx;
  956. }
  957. }
  958. }
  959. }
  960. .container {background: #000000;}
  961. .item {
  962. position: relative;
  963. }
  964. .videoHover{
  965. position: absolute;
  966. top: 0;
  967. left: 0;
  968. flex: 1;
  969. background-color: rgba(0,0,0,0.1);
  970. justify-content: center;
  971. align-items: center;
  972. }
  973. .playState{
  974. width: 160rpx;
  975. height: 160rpx;
  976. opacity: 0.2;
  977. }
  978. .video-status{
  979. width: 690rpx;
  980. position: absolute;
  981. left: 30rpx;
  982. background: #000;
  983. border-radius: 10rpx;
  984. top: 150rpx;
  985. padding: 30rpx;
  986. .status-title{
  987. flex-direction: row;
  988. align-items: center;
  989. .title{
  990. margin-left: 20rpx;
  991. color: #ffffff;
  992. font-size: 28rpx;
  993. }
  994. }
  995. .refusal{
  996. color: #ffffff;
  997. font-size: 22rpx;
  998. margin: 15rpx 0 0 48rpx;
  999. }
  1000. .image{
  1001. width: 28rpx;
  1002. height: 28rpx;
  1003. }
  1004. }
  1005. .userInfo{
  1006. position: absolute;
  1007. bottom: 30px;
  1008. right: 10px;
  1009. display: flex;
  1010. align-items: center;
  1011. flex-direction: column;
  1012. .pictrue{
  1013. flex-direction: column;
  1014. justify-content: center;
  1015. align-items: center;
  1016. position: relative;
  1017. // margin-bottom: 18rpx;
  1018. .guanzhu{
  1019. width: 42rpx;
  1020. height: 42rpx;
  1021. display: flex;
  1022. align-items: center;
  1023. justify-content: center;
  1024. color: #fff;
  1025. background: #E93323;
  1026. border-radius: 100%;
  1027. position: relative;
  1028. top: -20rpx;
  1029. left: 3rpx;
  1030. .iconfont{
  1031. font-size: 30rpx;
  1032. color: #fff;
  1033. }
  1034. }
  1035. .yiguanzhu{
  1036. width: 42rpx;
  1037. height: 42rpx;
  1038. }
  1039. }
  1040. }
  1041. .video-my{
  1042. position: relative;
  1043. align-items: center;
  1044. justify-content: center;
  1045. flex-direction: row;
  1046. }
  1047. .video-dian{
  1048. position: relative;
  1049. width: 33px;
  1050. height: 33px;
  1051. align-items: center;
  1052. justify-content: center;
  1053. flex-direction: row;
  1054. left: 3px;
  1055. .dian{
  1056. width: 7px;
  1057. height: 7px;
  1058. background-color: #fff;
  1059. border-radius: 100%;
  1060. margin-right: 3px;
  1061. &:last-child{
  1062. margin-right: 0;
  1063. }
  1064. }
  1065. }
  1066. .manage{
  1067. width: 115px;
  1068. background: #ffffff;
  1069. box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
  1070. padding: 0 8px;
  1071. position: absolute;
  1072. bottom: 10px;
  1073. right: 60px;
  1074. border-radius: 8px;
  1075. .manage-gou{
  1076. display: flex;
  1077. width: 13px;
  1078. height: 13px;
  1079. background: #ffffff;
  1080. transform: rotate(140deg);
  1081. position: absolute;
  1082. top: 30px;
  1083. right: -6px;
  1084. box-shadow: -1px -1px 1px rgba(0, 0, 0, 0.05);
  1085. }
  1086. .items{
  1087. border-bottom: 1px solid #EEEEEE;
  1088. padding: 10px 0;
  1089. display: flex;
  1090. align-items: center;
  1091. flex-direction: row;
  1092. .text{
  1093. color: #282828;
  1094. font-size: 13px;
  1095. }
  1096. &:last-child{
  1097. border-bottom-color: transparent;
  1098. }
  1099. .image{
  1100. width: 32rpx;
  1101. height: 32rpx;
  1102. margin: 0 16rpx 0;
  1103. }
  1104. }
  1105. }
  1106. .userAvatar{
  1107. border-radius: 500%;
  1108. border-style: solid;
  1109. border-width: 2px;
  1110. border-color: #ffffff;
  1111. width : 80rpx;
  1112. height: 80rpx;
  1113. }
  1114. .info-text{
  1115. display: flex;
  1116. margin-top: 10rpx;
  1117. color: #ffffff;
  1118. font-size: 22rpx;
  1119. text-align: center;
  1120. &.likeNumActive{
  1121. color: #E93323;
  1122. }
  1123. }
  1124. .likeIco,.shareIco,.commentIco{
  1125. width : 60rpx;
  1126. height: 60rpx;
  1127. margin-top: 15px;
  1128. }
  1129. .likeNum,.commentNum,.shareTex{
  1130. color: #ffffff;
  1131. font-size: 30rpx;
  1132. text-align: center;
  1133. margin: 5px;
  1134. }
  1135. .mention{
  1136. width: 46px;
  1137. height: 46px;
  1138. position: relative;
  1139. .image{
  1140. width: 30px;
  1141. height: 30px;
  1142. position: absolute;
  1143. right: 8px;
  1144. }
  1145. .count{
  1146. padding: 2px 6px;
  1147. background: #fff;
  1148. border-radius: 100%;
  1149. display: flex;
  1150. align-items: center;
  1151. justify-content: center;
  1152. color: #E93323;
  1153. position: absolute;
  1154. right: 6px;
  1155. top: 0;
  1156. font-size: 10px;
  1157. }
  1158. }
  1159. .content{
  1160. width: 325px;
  1161. position: absolute;
  1162. bottom: 15px;
  1163. /* justify-content: center; */
  1164. padding: 15rpx;
  1165. flex-direction: column;
  1166. justify-content: flex-start;
  1167. color: #ffffff;
  1168. .cart{
  1169. height: 48rpx;
  1170. flex-direction:row;
  1171. .cartName{
  1172. font-size: 24rpx;
  1173. color: #fff;
  1174. }
  1175. }
  1176. .product{
  1177. flex-direction: row;
  1178. margin-top: 27rpx;
  1179. .scroll-view{
  1180. flex-direction: row;
  1181. }
  1182. .product-item{
  1183. width: 444rpx;
  1184. height: 136rpx;
  1185. background: rgba(0,0,0,.55);
  1186. border-radius: 12rpx;
  1187. padding: 16rpx 15rpx;
  1188. margin-right: 30rpx;
  1189. }
  1190. .swiper{
  1191. width: 500rpx!important;
  1192. height: 136rpx!important;
  1193. .swiper-count{
  1194. width: 444rpx!important;
  1195. height: 136rpx!important;
  1196. background: rgba(0,0,0,.55);
  1197. border-radius: 12rpx;
  1198. padding: 16rpx 15rpx;
  1199. }
  1200. .swiper-item{
  1201. flex-direction: row;
  1202. }
  1203. }
  1204. .item-count{
  1205. flex-direction: row;
  1206. justify-content: space-between;
  1207. .picture{
  1208. width: 104rpx;
  1209. height: 104rpx;
  1210. border-radius: 10rpx;
  1211. .image{
  1212. width: 104rpx;
  1213. height: 104rpx;
  1214. border-radius: 10rpx;
  1215. }
  1216. }
  1217. .product-text{
  1218. width: 286rpx;
  1219. justify-content: space-between;
  1220. .name{
  1221. font-size: 24rpx;
  1222. width: 286rpx;
  1223. color: #fff;
  1224. }
  1225. .product-price{
  1226. display: flex;
  1227. flex-direction: row;
  1228. justify-content: space-between;
  1229. align-items: center;
  1230. .price{
  1231. display: flex;
  1232. flex-direction: row;
  1233. .sm,.money{
  1234. color: #ffffff;
  1235. font-size: 24rpx;
  1236. }
  1237. }
  1238. .buy-btn{
  1239. padding: 6rpx 20rpx;
  1240. display: flex;
  1241. align-items: center;
  1242. justify-content: center;
  1243. color: #fff;
  1244. border-radius: 26rpx;
  1245. background: #E93323;
  1246. font-size: 20rpx;
  1247. }
  1248. }
  1249. }
  1250. }
  1251. }
  1252. }
  1253. .product_cate{
  1254. margin: 20rpx 0;
  1255. flex-direction: row;
  1256. .pro-view{
  1257. flex-direction: row;
  1258. align-items: center;
  1259. border-radius: 30rpx;
  1260. padding: 0 25rpx;
  1261. line-height: 40rpx;
  1262. border-radius: 29rpx;
  1263. border: 1rpx solid #ffffff;
  1264. .text{
  1265. color: #ffffff;
  1266. font-size: 24rpx;
  1267. }
  1268. .icon{
  1269. font-size: 26rpx;
  1270. font-weight: bold;
  1271. margin-right: 8rpx;
  1272. color: #ffffff;
  1273. }
  1274. }
  1275. }
  1276. .timeCon{
  1277. flex-direction:row;
  1278. align-items: center;
  1279. .userName {
  1280. font-size: 30rpx;
  1281. color: #ffffff;
  1282. }
  1283. }
  1284. .words {
  1285. margin-top: 20rpx;
  1286. .close{
  1287. display: flex;
  1288. flex-direction: row;
  1289. align-items: center;
  1290. justify-content: flex-end;
  1291. margin-right: 20rpx;
  1292. .imgClose{
  1293. width: 18rpx;
  1294. height: 10rpx;
  1295. margin-left: 10rpx;
  1296. }
  1297. }
  1298. .wordsCon{
  1299. position: relative;
  1300. .more{
  1301. position: absolute;
  1302. bottom: 0;
  1303. right: 40rpx;
  1304. font-size: 26rpx;
  1305. color: #ffffff;
  1306. font-weight: bold;
  1307. }
  1308. .img{
  1309. width: 18rpx;
  1310. height: 10rpx;
  1311. margin-left: 4rpx;
  1312. position: absolute;
  1313. bottom: 7rpx;
  1314. right: 20rpx;
  1315. }
  1316. }
  1317. .info{
  1318. color: #fff;
  1319. font-size: 28rpx;
  1320. }
  1321. .more{
  1322. font-size: 26rpx;
  1323. color: #ffffff;
  1324. font-weight: bold;
  1325. }
  1326. }
  1327. .root{
  1328. background-color: #000000;
  1329. }
  1330. </style>