index.nvue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563
  1. <template>
  2. <view class="shortVideo" @click="showManage = false">
  3. <!--
  4. 注意:这是 H5、微信小程序界面,请勿和 new_index.nvue、index.nvue 混用
  5. 1. new_index.nvue、index.nvue这两个是App页面
  6. 2. 另外:data.js 是上一版本留下的假数据,这一版改成了 URL 请求了(如不需要可以删除,也可作为后端请求参考)
  7. 3. 请各位大神多多留手,我已经把请求内存开到最大了
  8. 4. 视频 id 切记是字符串类型
  9. -->
  10. <!-- 头部导航 -->
  11. <!-- 头部导航 -->
  12. <view v-if="!isUser" class="header">
  13. <!-- #ifdef H5 -->
  14. <view class="tool-bar">
  15. <view class='iconfont icon-xiangzuo' @tap='goBack'></view>
  16. </view>
  17. <!-- #endif -->
  18. <view class="items" @click.stop="navTap(2)">
  19. <text class="tName" :class="currentNav==2?'on':''">关注</text>
  20. </view>
  21. <view class="items" @click.stop="navTap(1)">
  22. <text class="tName" :class="currentNav==1?'on':''">推荐</text>
  23. </view>
  24. </view>
  25. <swiper :style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px;'" :vertical="true" @animationfinish="animationfinish" @change="change" :current="k" :indicator-dots="false">
  26. <swiper-item v-for="(list,index) in dataList">
  27. <view v-if="max > index">
  28. <view>
  29. <!--
  30. 1.v-if:用于控制视频在节点的渲染数
  31. 2.muted的默认值是 false,代表默认是禁音视频的
  32. 3.http-cache默认开启视频缓存
  33. 4.poster(封面(方案一)):这里的封面默认处理存储在阿里云的视频
  34. 5.show-loading:这里默认去掉播放转圈的标志
  35. v-if="Math.abs(k-index)<=1"
  36. -->
  37. <video
  38. :id="list.community_id+''+index"
  39. :loop="true"
  40. :muted="list.isplay"
  41. :autoplay="index == k && isRoutine"
  42. :controls="false"
  43. :http-cache="true"
  44. :custom-cache="false"
  45. :page-gesture="false"
  46. :show-fullscreen-btn="false"
  47. :show-loading="false"
  48. :show-center-play-btn="false"
  49. :enable-progress-gesture="false"
  50. :src="list.video_link"
  51. @ended="ended"
  52. @play="play(index)"
  53. @click="tapVideoHover(list.state,$event)"
  54. @waiting="waiting(index)"
  55. :style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px;z-index: -1;'"
  56. ></video>
  57. </view>
  58. <!-- 播放状态:pause 的时候就会暂停 -->
  59. <view class="videoHover" @click="tapVideoHover(list.state,$event)" :style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px;'">
  60. <image v-if="list.state=='pause'" class="playState" src="../static/img/index/play.png"></image>
  61. </view>
  62. <!--审核状态-->
  63. <view v-if="list.status==-1 || list.status==0 || list.status==-2" class="video-status">
  64. <view v-if="list.status == -1 || list.status == -2" class="status-title">
  65. <image class="image" src="../static/img/index/video-failed.png"></image>
  66. <text class="title">{{list.status == -1 ? '审核未通过' : '已下架'}},内容仅自己可见</text>
  67. </view>
  68. <view v-else class="status-title">
  69. <image class="image" src="../static/img/index/video-review.png"></image>
  70. <text class="title">正在审核,内容仅自己可见</text>
  71. </view>
  72. <view class="status_info">
  73. <text class="refusal">{{(list.status == -1 || list.status == -2) ? list.refusal : '发布的内容审核通过后,将在首页展示!'}}</text>
  74. </view>
  75. </view>
  76. <view>
  77. <!-- 最底下的文字部分 -->
  78. <view class="content">
  79. <view class="cart">
  80. <text class="cartName">@{{list.author && list.author.nickname}}</text>
  81. </view>
  82. <view class="words" :style="'width: '+ (windowWidth - 120) +'px;'">
  83. <view v-if="list.isMore || list.content.length<=15">
  84. <text class="info">{{list.content}}</text>
  85. <view class="close">
  86. <text v-if="list.isMore" class="more" @click="moreTap(list)">收起</text>
  87. </view>
  88. </view>
  89. <view class="wordsCon" v-else>
  90. <text class="info">{{list.content.slice(0,15)}}...</text>
  91. <text class="more" @click.stop="moreTap(list)">展开</text>
  92. </view>
  93. </view>
  94. <view v-if="list.relevance.length == 1 && k===index" class="product">
  95. <scroll-view scroll-x="true" style="white-space: nowrap; display: flex;" scroll-with-animation show-scrollbar="true">
  96. <view class="product-item" v-for="(goods,idx) in list.relevance" :key="idx" v-if="goods.spu">
  97. <view v-if="goods.spu" class="item-count acea-row" @click="goDetail(goods.spu)">
  98. <view class="picture">
  99. <image :src="goods.spu.image"></image>
  100. </view>
  101. <view class="product-text">
  102. <view class="name line1">{{goods.spu.store_name}}</view>
  103. <view class="product-price">
  104. <view class="price">¥<text>{{goods.spu.price}}</text></view>
  105. <view class="buy-btn">购买</view>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </scroll-view>
  111. </view>
  112. <view v-else-if="list.relevance.length > 1 && k===index" class="product">
  113. <swiper
  114. :autoplay="true"
  115. :circular="circular"
  116. :interval="interval"
  117. :duration="duration"
  118. :loop="true"
  119. next-margin="20rpx"
  120. previous-margin="20rpx"
  121. >
  122. <block v-for="(goods,idx) in list.relevance" :key="idx" v-if="goods.spu">
  123. <swiper-item class="swiper-item">
  124. <view class="swiper-count">
  125. <view v-if="goods.spu" class="item-count acea-row" @click="goDetail(goods.spu)">
  126. <view class="picture">
  127. <image :src="goods.spu.image"></image>
  128. </view>
  129. <view class="product-text">
  130. <view class="name line1">{{goods.spu.store_name}}</view>
  131. <view class="product-price">
  132. <view class="price">¥<text>{{goods.spu.price}}</text></view>
  133. <view class="buy-btn">购买</view>
  134. </view>
  135. </view>
  136. </view>
  137. </view>
  138. </swiper-item>
  139. </block>
  140. </swiper>
  141. </view>
  142. <navigator v-if="list.topic" hover-class="none" class="product_cate" :url="'/pages/plantGrass/plant_search_list/index?id='+list.topic.topic_id">
  143. <view>
  144. <text class="icon">#</text><text class="text">{{list.topic.topic_name}}</text>
  145. </view>
  146. </navigator>
  147. </view>
  148. <view class="userInfo">
  149. <!-- 1.头像 -->
  150. <navigator v-if="list.author && userInfo.uid != list.author.uid" hover-class="none" :url="'/pages/plantGrass/plant_user/index?id='+list.uid" class="pictrue">
  151. <image class="userAvatar" :src="list.author&&list.author.avatar || '/static/images/f.png'" mode="aspectFill"></image>
  152. <view v-if="!list.is_fans || !userInfo.uid" class="guanzhu" @click.stop="followAuthor(list)"><text class="iconfont icon-shangpinshuliang-jia"></text></view>
  153. <view v-else class="yiguanzhu"><text class="iconfont"></text></view>
  154. </navigator>
  155. <!-- 2.点赞 -->
  156. <view @click="cLike(list);" style="margin-top: 5px;" :class="{'likeNumActive':list.relevance_id}">
  157. <text class="iconfont icon-shipindianzan-yidian" :class="{'likeNumActive':list.relevance_id}"></text>
  158. <text class="info-text">{{list.count_start > 0 ? list.count_start : '点赞'}}</text>
  159. </view>
  160. <!-- 3.评论 -->
  161. <view v-if="community_reply_status == 1 && list.status == 1" class="comment" @click="toComment(list,index)" style="margin-top: 18px;">
  162. <text class="iconfont icon-pinglun2"></text>
  163. <text class="info-text">{{list.count_reply>0 ? list.count_reply : '评论'}}</text>
  164. </view>
  165. <!-- 4.分享 -->
  166. <view v-if="list.status == 1" @click="listenerActionSheet" style="margin-top: 17px;">
  167. <text class="iconfont icon-fenxiang3"></text>
  168. <text class="info-text">分享</text>
  169. </view>
  170. <!-- 5.自己的视频 -->
  171. <view v-if="list.author && userInfo.uid == list.author.uid && isUser" style="margin-top: 17px;">
  172. <view class="video-my">
  173. <view class="video-dian" @click.stop="showManage = !showManage">
  174. <text class="dian"></text>
  175. <text class="dian"></text>
  176. <text class="dian"></text>
  177. </view>
  178. <view class="manage" v-show="showManage">
  179. <navigator hover-class="none" :url="'/pages/plantGrass/plant_release/index?id='+list.community_id+'&type=2'" class="items">
  180. <image class="image" src="../static/img/index/video-edit.png"></image>
  181. <text>编辑</text>
  182. </navigator>
  183. <view class="items" @click.stop="deleteTopic(list)">
  184. <image class="image" src="../static/img/index/video-delete.png"></image>
  185. <text>删除</text>
  186. </view>
  187. </view>
  188. </view>
  189. </view>
  190. <!-- 提到的商品 -->
  191. <view v-if="list.relevance.length>0 && k === index" @click="openMore(list)" class="mention" style="opacity: 0.9; margin-top: 18px;">
  192. <image src="../static/img/index/collection.png"></image>
  193. <text class="count">{{list.relevance.length}}</text>
  194. </view>
  195. </view>
  196. </view>
  197. </view>
  198. </swiper-item>
  199. </swiper>
  200. <view class="noVideo acea-row row-center-wrapper" v-if="!dataList.length && !loadVideo">
  201. <view>
  202. <image :src="imgHost+'/static/no-video.png'" class="pictrue"></image>
  203. <text class="tips">暂无短视频内容哦~</text>
  204. </view>
  205. </view>
  206. <comment
  207. ref="comments"
  208. :bottom="0"
  209. :isShow="showComment"
  210. :userInfo="userInfo"
  211. @successFul="pinlunFun"
  212. @close="closeScrollview"
  213. ></comment>
  214. <!-- 他提到的宝贝弹窗 -->
  215. <mentioned ref="mentioned" @close="closePopup" :list="moreList" :uid="authorUid"></mentioned>
  216. <image v-if="H5ShareBox" class="shareImg" :src="imgHost + '/static/images/share-info.png'" @click="H5ShareBox = false"></image>
  217. <!-- 分享按钮 -->
  218. <view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
  219. <!-- #ifndef MP -->
  220. <button class="item" :class="weixinStatus ? 'item3' : ''" hover-class='none' v-if="weixinStatus === true" @click="H5ShareBox = true">
  221. <view class="iconfont icon-weixin3"></view>
  222. <view class="">发送给朋友</view>
  223. </button>
  224. <!-- #endif -->
  225. <!-- #ifdef MP -->
  226. <button class="item" :class="weixinStatus ? 'item3' : ''" open-type="share" hover-class='none' @click="goFriend">
  227. <view class="iconfont icon-weixin3"></view>
  228. <view class="">发送给朋友</view>
  229. </button>
  230. <!-- #endif -->
  231. <button class="item" :class="weixinStatus ? 'item3' : ''" hover-class='none' @click="goPoster">
  232. <view class="iconfont icon-haibao"></view>
  233. <view class="">生成海报</view>
  234. </button>
  235. </view>
  236. <view class="mask" v-if="posters" @click="listenerActionClose"></view>
  237. <!-- 海报展示 -->
  238. <view class='mask' v-if="posterImageStatus"></view>
  239. <view class='poster-pop' v-if="posterImageStatus">
  240. <image src='/static/images/poster-close.png' class='close' @click="posterImageClose"></image>
  241. <image :src='posterImage' class="image"></image>
  242. <!-- #ifndef H5 -->
  243. <view class="keep" @click="savePosterPath">保存到相册</view>
  244. <!-- #endif -->
  245. </view>
  246. <canvas class="canvas" canvas-id='myCanvas' v-if="canvasStatus"></canvas>
  247. </view>
  248. </template>
  249. <script>
  250. // +----------------------------------------------------------------------
  251. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  252. // +----------------------------------------------------------------------
  253. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  254. // +----------------------------------------------------------------------
  255. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  256. // +----------------------------------------------------------------------
  257. // | Author: CRMEB Team <admin@crmeb.com>
  258. // +----------------------------------------------------------------------
  259. const app = getApp();
  260. import { toLogin } from '@/libs/login.js';
  261. import { mapGetters } from 'vuex';
  262. import { configMap } from '@/utils';
  263. import comment from '@/components/comment.vue';
  264. import mentioned from '@/components/mentioned.vue';
  265. import { HTTP_REQUEST_URL } from '@/config/app';
  266. import { videoList, myVideoList, graphicStartApi, followAuthorApi, getVideoCode, deletePlantApi, focusArticleLst } from '@/api/community.js';
  267. import { getUserInfo, imgToBase } from '@/api/user.js';
  268. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  269. export default {
  270. components:{
  271. comment,
  272. mentioned,
  273. },
  274. computed: configMap({community_reply_status:0},mapGetters(['isLogin', 'uid'])),
  275. data() {
  276. return {
  277. imgHost: HTTP_REQUEST_URL,
  278. videoID:0,
  279. pinlunNum:0,
  280. windowWidth: 0,
  281. windowHeight: 0,
  282. platform: "",
  283. deleteHeight: 0,
  284. dataList: [],
  285. shareItem: null,
  286. k: 0,
  287. max: 2,
  288. oldVideo: "",
  289. voice: "",
  290. timeout: "",
  291. authorUid: 0,
  292. current: 0,
  293. // 引入评论 - 参数
  294. heightNum: 1.3,
  295. // 双击点赞参数
  296. touchNum: 0,
  297. aixinLeft: 0,
  298. aixinTop: 0,
  299. Rotate: 0,
  300. currentNav:1,
  301. limit: 6,
  302. page: 1,
  303. oldCurrent: 1,
  304. H5ShareBox: false,
  305. showComment: false,
  306. loadVideo: true,
  307. loadend: false,
  308. userInfo: {},
  309. moreList: [],
  310. posters: false,
  311. weixinStatus: false,
  312. showManage: false,
  313. isUser: false,
  314. isSatrt: 0,
  315. userUid: 0,
  316. posterImageStatus: false,
  317. storeImage: '', //海报产品图
  318. PromotionCode: '', //二维码图片
  319. canvasStatus: false, //海报绘图标签
  320. posterImage: '', //海报路径
  321. posterbackgd: '../static/img/index/posterbackgd.png',
  322. avatar: '/static/images/f.png',
  323. codeImg: "",
  324. autoplay: false,
  325. circular: true,
  326. interval: 3000,
  327. duration: 500,
  328. actionSheetHidden: false,
  329. // #ifdef MP
  330. isRoutine: true,
  331. // #endif
  332. // #ifndef MP
  333. isRoutine: false,
  334. // #endif
  335. }
  336. },
  337. watch:{
  338. k(new_k,old_k){
  339. const max = new_k+2;
  340. if(this.max < max){
  341. this.max = max;
  342. }
  343. if (this.oldCurrent != this.currentNav) {
  344. this.oldCurrent = this.currentNav
  345. return false
  346. }
  347. this.dataList[old_k].playIng = false //如果视频暂停,就加载封面
  348. this.dataList[old_k].isplay = true
  349. this.dataList[old_k].state = 'pause'
  350. console.log('预留第' + (old_k + 1) + '个视频:' + this.dataList[old_k].community_id + '' + old_k)
  351. // 2.0版本已经去掉了下面这一句,视频不用暂停,只需要把声音禁止就行
  352. uni.createVideoContext(this.dataList[old_k].community_id + '' + old_k, this).pause() //如果视频暂停,那么旧视频停止,这里的this.dataList[old_k].id + '' + old_k,后面加 old_k 是为了每一个视频的 id 值不同,这样就可以大程度的避免串音问题
  353. console.log('已经暂停 --> 第' + (old_k + 1) + '个视频~') //提示
  354. // #ifdef MP
  355. this.dataList[new_k].state = 'play'
  356. this.dataList[new_k].isplay = false
  357. this.dataList[new_k].playIng = true
  358. setTimeout(() => {
  359. uni.createVideoContext(this.dataList[new_k].community_id + '' + new_k, this).play()
  360. }, 250)
  361. this.videoShare(this.dataList[new_k])
  362. // #endif
  363. }
  364. },
  365. onLoad(options) {
  366. this.getOptions(options);
  367. this.videoID = options.id;
  368. this.isUser = options.user==1 ? true : false;
  369. this.userUid = options.uid ? options.uid : 0;
  370. this.isSatrt = options.tab == 1 ? 1 : 0;
  371. this.get() //刚进入页面加载数据
  372. this.downloadFilePromotionCode(this.videoID);
  373. if(this.isLogin){
  374. this.getUserInfo();
  375. }
  376. // #ifdef H5
  377. this.setOpenShare();
  378. // #endif
  379. },
  380. onShow(){},
  381. onHide(){
  382. this.dataList[this.k].state = 'pause';//界面隐藏也要停止播放视频
  383. uni.createVideoContext(this.dataList[this.k].community_id+''+this.k,this).pause();//暂停以后继续播放
  384. },
  385. onReady: function() {
  386. this.windowWidth = uni.getSystemInfoSync().windowWidth
  387. this.windowHeight = uni.getSystemInfoSync().windowHeight
  388. },
  389. //发送给朋友
  390. onShareAppMessage(res) {
  391. let uid = this.uid?this.uid:0;
  392. return {
  393. title: this.shareItem.title || '',
  394. path: '/pages/short_video/nvueSwiper/index?id='+this.shareItem.community_id+'&pid='+uid,
  395. imageUrl: this.shareItem.image[0] || '' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  396. }
  397. },
  398. //分享到朋友圈
  399. onShareTimeline(res) {
  400. return {
  401. title: this.shareItem.title || '',
  402. query:{
  403. id: this.shareItem.community_id,
  404. pid: this.uid
  405. },//页面参数
  406. imageUrl: this.shareItem.image[0] || '' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  407. }
  408. },
  409. methods: {
  410. //#ifdef MP
  411. videoShare(item){
  412. this.shareItem = item;
  413. if(item && item.status == 1){
  414. uni.showShareMenu({
  415. withShareTicket: true,
  416. menus: ['shareAppMessage','shareTimeline'],
  417. })
  418. }else{
  419. uni.hideShareMenu()
  420. }
  421. },
  422. // #endif
  423. //#ifdef H5
  424. goBack: function() {
  425. uni.navigateBack();
  426. },
  427. //#endif
  428. navTap(n) {
  429. this.currentNav = n;
  430. this.dataList.forEach(item=>{
  431. item.state = 'pause';
  432. })
  433. this.k = 0;
  434. this.page = 1;
  435. this.loadVideo = true;
  436. this.loadend = false;
  437. this.dataList = [];
  438. n == 1 ? this.get() : this.getFocusList()
  439. },
  440. /**
  441. * 获取个人用户信息
  442. */
  443. getUserInfo: function() {
  444. let that = this;
  445. getUserInfo().then(res => {
  446. that.userInfo = res.data;
  447. });
  448. },
  449. // 关注作者
  450. followAuthor: function(item) {
  451. if (this.isLogin === false) {
  452. toLogin()
  453. }else{
  454. let status = 1
  455. followAuthorApi(item.uid,{status:status}).then(res => {
  456. if (res.status === 200) {
  457. item.is_fans = true
  458. }
  459. this.$util.Tips({
  460. title: res.message
  461. });
  462. }).catch(err=>{
  463. return uni.showToast({
  464. title: err,
  465. icon: 'none',
  466. duration: 2000
  467. });
  468. });
  469. }
  470. },
  471. // 删除话题
  472. deleteTopic(item){
  473. let that = this;
  474. uni.showModal({
  475. content: '确定要删除该话题么?',
  476. success: function(res) {
  477. if(res.confirm) {
  478. deletePlantApi(item.community_id).then(res => {
  479. if (res.status === 200) {
  480. that.$util.Tips({
  481. title: res.message
  482. });
  483. setTimeout(function() {
  484. uni.redirectTo({
  485. url: '/pages/plantGrass/plant_user/index?id='+item.uid
  486. })
  487. }, 1000);
  488. }
  489. })
  490. } else if(res.cancel) {
  491. console.log('用户点击取消');
  492. }
  493. }
  494. });
  495. },
  496. play(k){
  497. console.log(' 播放了',k)
  498. this.dataList[k].isplay = false
  499. this.dataList[k].playIng = true
  500. this.dataList[k].state = 'play'
  501. this.dataList[k].loading = false
  502. },
  503. waiting(k){
  504. console.log('视频缓冲了', k)
  505. this.dataList[k].loading = true
  506. },
  507. pinlunFun(e){
  508. this.pinlunNum = e;
  509. this.dataList.forEach(item=>{
  510. if(item.community_id == this.videoID){
  511. item.count_reply = item.count_reply+1;
  512. }
  513. })
  514. },
  515. getOptions(options){
  516. let that = this;
  517. // #ifdef MP
  518. if (options.scene) {
  519. let value = that.$util.getUrlParams(decodeURIComponent(options.scene));
  520. //记录推广人uid
  521. if (value.pid) app.globalData.spid = value.pid;
  522. }
  523. // #endif
  524. if (options.pid) app.globalData.spid = options.pid;
  525. },
  526. // #ifdef H5
  527. // 微信分享;
  528. setOpenShare: function() {
  529. let that = this;
  530. let uid = this.uid?this.uid:0;
  531. if (that.$wechat.isWeixin()) {
  532. let data = this.dataList[0];
  533. let configAppMessage = {
  534. desc: data.content,
  535. title: data.title,
  536. link: location.href+'?pid='+uid+'&id='+this.videoID,
  537. imgUrl: data.image
  538. };
  539. that.$wechat.wechatEvevt(['updateAppMessageShareData', 'updateTimelineShareData',
  540. 'onMenuShareAppMessage', 'onMenuShareTimeline'
  541. ],
  542. configAppMessage);
  543. }
  544. },
  545. // #endif
  546. moreTap(item){
  547. item.isMore = !item.isMore;
  548. },
  549. moveHandle(){},
  550. closeScrollview(){
  551. // 点击评论里面的叉叉,就会关闭评论
  552. this.showComment = false
  553. },
  554. toComment(item,index){
  555. // 注意点击评论之后会执行这里
  556. /*
  557. (1)先加载缓冲
  558. (2)获取当前视频 ID 信息
  559. (3)🌟🌟🌟🌟重要🌟🌟🌟🌟
  560. - 一定要记得看 index.vue 里面
  561. uni.setStorageSync("user",this.peopleList[i]);
  562. 这个东西,用于存储当前用户信息。在 插件里面会使用到这个东西,
  563. 记得写一下。
  564. (4)打开评论
  565. */
  566. this.showComment = true
  567. this.$refs.comments.getData(item,index);
  568. },
  569. ended(){
  570. // 1.播放当前视频结束时触发,自动切换下一个视频
  571. // this.current = this.k+1
  572. },
  573. //点击播放&&暂停
  574. tapVideoHover(state,event){
  575. // 1.启用双击点赞 --- start
  576. this.touchNum++;
  577. setTimeout(()=>{
  578. if(this.touchNum == 1){
  579. if(state=='play'||state=='continue'){
  580. this.dataList[this.k].state = 'pause';
  581. }else{
  582. this.dataList[this.k].state = 'continue';
  583. }
  584. if(this.dataList[this.k].state == 'continue'){
  585. uni.createVideoContext(this.dataList[this.k].community_id+''+this.k,this).play();//暂停以后继续播放
  586. }
  587. if(this.dataList[this.k].state == 'pause'){
  588. uni.createVideoContext(this.dataList[this.k].community_id+''+this.k,this).pause();//暂停以后继续播放
  589. }
  590. }
  591. this.touchNum = 0;
  592. },200)
  593. },
  594. change(event){
  595. this.k = event.detail.current;
  596. this.posterImage = false;
  597. if(this.isLogin && this.dataList[this.k]){
  598. this.downloadFilePromotionCode(this.dataList[this.k]['community_id']);
  599. }
  600. },
  601. animationfinish(event){
  602. // 1.这里进行判断,如果是最后一个视频就进入 get() 方法加载视频进入列表
  603. if(this.k == this.dataList.length - 1){
  604. this.loadVideo = true;
  605. this.currentNav == 1 ? this.GET() : this.getFocusList()
  606. }
  607. },
  608. //每一组结束时新的请求
  609. GET(){
  610. let that = this
  611. if(!that.loadVideo) return
  612. if(that.loadend) return
  613. that.loadVideo = true
  614. that.isUser ?
  615. myVideoList(that.userUid,{
  616. page: that.page,
  617. limit: that.limit,
  618. is_star: that.isSatrt,
  619. community_id: that.videoID
  620. }).then(res=>{
  621. that.videoData(res.data.list)
  622. that.loadVideo = false
  623. that.loadend = res.data.list.length < that.limit
  624. }).catch(err=>{
  625. return uni.showToast({
  626. title: err,
  627. icon: 'none',
  628. duration: 2000
  629. });
  630. }) :
  631. videoList({
  632. page: that.page,
  633. limit: that.limit,
  634. id: that.videoID
  635. }).then(res=>{
  636. that.loadVideo = false
  637. that.videoData(res.data.list)
  638. that.loadend = res.data.list.length < that.limit
  639. }).catch(err=>{
  640. return uni.showToast({
  641. title: err,
  642. icon: 'none',
  643. duration: 2000
  644. });
  645. })
  646. },
  647. get(){
  648. let that = this
  649. // 1.这里引入后端请求数据
  650. that.isUser ?
  651. myVideoList(that.userUid,{
  652. page: that.page,
  653. limit: that.limit,
  654. is_star: that.isSatrt,
  655. community_id: that.videoID
  656. }).then(res=>{
  657. that.page = that.page + 1;
  658. that.videoData(res.data.list)
  659. }).catch(err=>{
  660. return uni.showToast({
  661. title: err,
  662. icon: 'none',
  663. duration: 2000
  664. });
  665. }) :
  666. videoList({
  667. page: that.page,
  668. limit: that.limit,
  669. id: that.videoID
  670. }).then(res=>{
  671. that.page = that.page + 1;
  672. that.videoData(res.data.list)
  673. }).catch(err=>{
  674. return uni.showToast({
  675. title: err,
  676. icon: 'none',
  677. duration: 2000
  678. });
  679. })
  680. },
  681. getFocusList(){
  682. let that = this;
  683. if(!that.loadVideo) return
  684. if(that.loadend) return
  685. that.loadVideo = true
  686. focusArticleLst({
  687. page: that.page,
  688. limit: that.limit,
  689. }).then(res=>{
  690. that.loadVideo = false
  691. that.loadend = res.data.list.length < that.limit
  692. that.page = that.page + 1;
  693. that.videoData(res.data.list)
  694. }).catch(err=>{
  695. return uni.showToast({
  696. title: err,
  697. icon: 'none',
  698. duration: 2000
  699. });
  700. })
  701. },
  702. videoData(list){
  703. if(list.length == 0)return
  704. let that = this;
  705. var msg = list
  706. // 2.这里把视频添加到视频列表
  707. for (let i = 0; i < msg.length; i++) {
  708. msg[i]['isMore'] = false
  709. msg[i]['playIng'] = false
  710. msg[i]['state'] = 'pause'
  711. msg[i]['isplay'] = true
  712. msg[i]['loading'] = false
  713. that.dataList.push(msg[i])
  714. //#ifndef H5
  715. if(i == 0 && that.k == 0){
  716. this.dataList[0].isplay = false
  717. this.dataList[0].playIng = true
  718. this.dataList[0].state = 'play'
  719. this.dataList[0].loading = false
  720. uni.createVideoContext(that.dataList[0].community_id+''+0,that).play()
  721. }
  722. //#endif
  723. }
  724. //#ifdef MP
  725. if(this.k==0){
  726. this.videoShare(this.dataList[0]);
  727. }
  728. // #endif
  729. // #ifdef H5
  730. if (that.isLogin) {
  731. that.setOpenShare(that.videoID);
  732. }
  733. // #endif
  734. },
  735. share(){
  736. this.H5ShareBox = true;
  737. },
  738. /**
  739. * 分享打开
  740. *
  741. */
  742. listenerActionSheet: function() {
  743. // #ifdef H5
  744. if (this.$wechat.isWeixin() === true) {
  745. this.weixinStatus = true;
  746. }
  747. // #endif
  748. this.posters = true;
  749. },
  750. // 分享关闭
  751. listenerActionClose: function() {
  752. this.posters = false;
  753. },
  754. //隐藏海报
  755. posterImageClose: function() {
  756. this.posterImageStatus = false
  757. },
  758. // 小程序关闭分享弹窗;
  759. goFriend: function() {
  760. this.posters = false;
  761. },
  762. /* 获取产品分销二维码
  763. * @param function successFn 下载完成回调
  764. *
  765. */
  766. downloadFilePromotionCode: function(id) {
  767. let that = this;
  768. let type;
  769. // #ifndef MP
  770. type = 'wechat'
  771. // #endif
  772. // #ifdef MP
  773. type = 'routine'
  774. // #endif
  775. getVideoCode(id, {
  776. type: type
  777. }).then(async res => {
  778. that.codeImg = res.data.url
  779. }).catch(err => {
  780. that.$set(that, 'PromotionCode', '');
  781. });
  782. },
  783. /*
  784. * 保存到手机相册
  785. */
  786. // #ifdef MP
  787. savePosterPath: function() {
  788. let that = this;
  789. uni.getSetting({
  790. success(res) {
  791. if (!res.authSetting['scope.writePhotosAlbum']) {
  792. uni.authorize({
  793. scope: 'scope.writePhotosAlbum',
  794. success() {
  795. uni.saveImageToPhotosAlbum({
  796. filePath: that.posterImage,
  797. success: function(res) {
  798. that.posterImageClose();
  799. that.$util.Tips({
  800. title: '保存成功',
  801. icon: 'success'
  802. });
  803. },
  804. fail: function(res) {
  805. that.$util.Tips({
  806. title: '保存失败'
  807. });
  808. }
  809. })
  810. }
  811. })
  812. } else {
  813. uni.saveImageToPhotosAlbum({
  814. filePath: that.posterImage,
  815. success: function(res) {
  816. that.posterImageClose();
  817. that.$util.Tips({
  818. title: '保存成功',
  819. icon: 'success'
  820. });
  821. },
  822. fail: function(res) {
  823. that.$util.Tips({
  824. title: '保存失败'
  825. });
  826. },
  827. })
  828. }
  829. }
  830. })
  831. },
  832. // #endif
  833. /**
  834. * 生成海报
  835. */
  836. async goPoster() {
  837. if (this.posterImage) {
  838. this.posterImageStatus = true
  839. this.posters = false
  840. return
  841. }
  842. let that = this;
  843. let arr2
  844. that.posters = false;
  845. that.$set(that, 'canvasStatus', true);
  846. uni.showLoading({
  847. title: '海报生成中',
  848. mask: true
  849. });
  850. // #ifdef MP || APP-PLUS
  851. if(that.dataList[that.k].author.avatar){
  852. arr2 = [that.posterbackgd,await that.fileStoreImage(that.dataList[that.k].image[0]), await that.fileStoreImage(
  853. that.codeImg), await that.fileStoreImage(that.dataList[that.k].author.avatar)];
  854. }else{
  855. arr2 = [that.posterbackgd,await that.fileStoreImage(that.dataList[that.k].image[0]), await that.fileStoreImage(
  856. that.codeImg), that.avatar];
  857. }
  858. // #endif
  859. // #ifdef H5
  860. if(that.dataList[that.k].author.avatar){
  861. arr2 = [that.posterbackgd,await that.imgToBase(that.dataList[that.k].image[0]), await that.imgToBase(that.codeImg), await that.imgToBase(that.dataList[that.k].author.avatar)];
  862. }else{
  863. arr2 = [that.posterbackgd,await that.imgToBase(that.dataList[that.k].image[0]), await that.imgToBase(that.codeImg), that.avatar];
  864. }
  865. // #endif
  866. //生成推广海报
  867. that.$util.videoPosterCanvas(arr2, that.dataList[that.k].content, that.dataList[that.k].author.nickname, function(tempFilePath) {
  868. that.$set(that, 'posterImage', tempFilePath);
  869. that.$set(that, 'posterImageStatus', true);
  870. that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
  871. that.$set(that, 'canvasStatus', false);
  872. }, (err) => {
  873. that.$set(that, 'canvasStatus', false);
  874. });
  875. },
  876. //图片转符合安全域名路径
  877. fileStoreImage(url) {
  878. let that = this;
  879. // #ifdef MP || APP-PLUS
  880. let ishttps = url.split('//')[0] == 'https:'
  881. if (!ishttps) {
  882. url = 'https://'+url.split('//')[1]
  883. }
  884. // #endif
  885. return new Promise((resolve, reject) => {
  886. uni.downloadFile({
  887. url: url,
  888. success: function(res) {
  889. resolve(res.tempFilePath);
  890. },
  891. fail: function() {
  892. return that.$util.Tips({
  893. title: ''
  894. });
  895. }
  896. });
  897. })
  898. },
  899. /*
  900. * 保存到手机相册
  901. */
  902. // #ifdef MP
  903. savePosterPath: function() {
  904. let that = this;
  905. uni.getSetting({
  906. success(res) {
  907. if (!res.authSetting['scope.writePhotosAlbum']) {
  908. uni.authorize({
  909. scope: 'scope.writePhotosAlbum',
  910. success() {
  911. uni.saveImageToPhotosAlbum({
  912. filePath: that.posterImage,
  913. success: function(res) {
  914. that.posterImageClose();
  915. that.$util.Tips({
  916. title: '保存成功',
  917. icon: 'success'
  918. });
  919. },
  920. fail: function(res) {
  921. that.$util.Tips({
  922. title: '保存失败'
  923. });
  924. }
  925. })
  926. }
  927. })
  928. } else {
  929. uni.saveImageToPhotosAlbum({
  930. filePath: that.posterImage,
  931. success: function(res) {
  932. that.posterImageClose();
  933. that.$util.Tips({
  934. title: '保存成功',
  935. icon: 'success'
  936. });
  937. },
  938. fail: function(res) {
  939. that.$util.Tips({
  940. title: '保存失败'
  941. });
  942. },
  943. })
  944. }
  945. }
  946. })
  947. },
  948. // #endif
  949. async imgToBase(url) {
  950. let res = await imgToBase({
  951. image: url
  952. })
  953. return res.data.image
  954. },
  955. cLike(item){
  956. if(this.isLogin){
  957. let status = item.relevance_id ? 0 : 1
  958. graphicStartApi(item.community_id,{status: status}).then(res=>{
  959. if(item.relevance_id){
  960. item.count_start--;
  961. item.count_start = item.count_start == 0 ? 0 : item.count_start
  962. item.relevance_id = false
  963. }else{
  964. item.count_start++;
  965. item.relevance_id = true
  966. }
  967. }).catch(err=>{
  968. return uni.showToast({
  969. title: err,
  970. icon: 'none',
  971. duration: 2000
  972. });
  973. })
  974. }else{
  975. toLogin()
  976. }
  977. },
  978. /*查看提到的宝贝*/
  979. openMore(item){
  980. this.$refs.mentioned.showPopup()
  981. this.moreList = item.relevance;
  982. this.authorUid = item.uid
  983. },
  984. closePopup(){
  985. this.$refs.mentioned.closePopup()
  986. },
  987. goDetail(item){
  988. if (item.product_type === 1) {
  989. uni.navigateTo({
  990. url: `/pages/activity/goods_seckill_details/index?id=${item.product_id}&time=${item.stop_time}&spid=${this.uid}`
  991. })
  992. } else if (item.product_type === 2) {
  993. uni.navigateTo({
  994. url: `/pages/activity/presell_details/index?id=${item.activity_id}&spid=${this.uid}`
  995. })
  996. } else if (item.product_type === 0) {
  997. uni.navigateTo({
  998. url: `/pages/goods_details/index?id=${item.product_id}&spid=${this.uid}`
  999. })
  1000. }else if (item.product_type === 4) {
  1001. uni.navigateTo({
  1002. url: `/pages/activity/combination_details/index?id=${item.activity_id}&spid=${this.uid}`
  1003. })
  1004. }else if (item.product_type === 40) {
  1005. uni.navigateTo({
  1006. url: `/pages/activity/combination_status/index?id=${item.activity_id}&spid=${this.uid}`
  1007. })
  1008. }
  1009. }
  1010. }
  1011. }
  1012. </script>
  1013. <style lang="scss" scoped>
  1014. .header {
  1015. position: fixed;
  1016. z-index: 9;
  1017. width: 750rpx;
  1018. height: 86rpx;
  1019. flex-direction: row;
  1020. justify-content: center;
  1021. align-items: center;
  1022. top: 20rpx;
  1023. .tool-bar{
  1024. position: absolute;
  1025. left: 0;
  1026. top: 0;
  1027. width: 60rpx;
  1028. height: 86rpx;
  1029. display: flex;
  1030. justify-content: center;
  1031. .icon-xiangzuo {
  1032. margin-right: 40rpx;
  1033. margin-left: 20rpx;
  1034. font-size: 26rpx;
  1035. color: #fff;
  1036. }
  1037. }
  1038. .items {
  1039. margin: 0 30rpx;
  1040. .tName {
  1041. color: #ffffff;
  1042. font-size: 32rpx;
  1043. &.on{
  1044. font-size: 38rpx;
  1045. }
  1046. }
  1047. }
  1048. }
  1049. .shareImg{
  1050. z-index: 1000;
  1051. position: fixed;
  1052. left: 0;
  1053. top: 0;
  1054. width: 100%;
  1055. height: 100%;
  1056. }
  1057. .shortVideo,.container {background: linear-gradient(180deg, rgba(0,0,0,.8) 0%, #000000 100%);}
  1058. .item {
  1059. position: relative;
  1060. }
  1061. .video-status{
  1062. width: 690rpx;
  1063. position: absolute;
  1064. left: 30rpx;
  1065. background: #000;
  1066. border-radius: 10rpx;
  1067. top: 60rpx;
  1068. padding: 30rpx;
  1069. .status-title{
  1070. flex-direction: row;
  1071. align-items: center;
  1072. .title{
  1073. margin-left: 20rpx;
  1074. color: #ffffff;
  1075. font-size: 28rpx;
  1076. }
  1077. }
  1078. .refusal{
  1079. color: #ffffff;
  1080. font-size: 22rpx;
  1081. margin: 15rpx 0 0 48rpx;
  1082. }
  1083. .image{
  1084. width: 28rpx;
  1085. height: 28rpx;
  1086. }
  1087. }
  1088. .videoHover{
  1089. position: absolute;
  1090. top: 0;
  1091. left: 0;
  1092. flex: 1;
  1093. justify-content: center;
  1094. align-items: center;
  1095. }
  1096. .playState{
  1097. width: 160rpx;
  1098. height: 160rpx;
  1099. opacity: 0.2;
  1100. }
  1101. .userInfo{
  1102. position: absolute;
  1103. bottom:60rpx;
  1104. right: 20rpx;
  1105. flex-direction: column;
  1106. text-align: center;
  1107. .pictrue{
  1108. flex-direction: column;
  1109. justify-content: center;
  1110. align-items: center;
  1111. position: relative;
  1112. // margin-bottom: 18rpx;
  1113. image{
  1114. width: 92rpx;
  1115. height: 92rpx;
  1116. }
  1117. .guanzhu{
  1118. width: 42rpx;
  1119. height: 42rpx;
  1120. display: flex;
  1121. align-items: center;
  1122. justify-content: center;
  1123. color: #fff;
  1124. background: #E93323;
  1125. border-radius: 100%;
  1126. position: relative;
  1127. top: -20rpx;
  1128. left: 26rpx;
  1129. .iconfont{
  1130. font-size: 20rpx;
  1131. }
  1132. }
  1133. .yiguanzhu{
  1134. width: 42rpx;
  1135. height: 42rpx;
  1136. }
  1137. }
  1138. .mention{
  1139. width: 92rpx;
  1140. height: 92rpx;
  1141. position: relative;
  1142. image{
  1143. width: 58rpx;
  1144. height: 58rpx;
  1145. position: absolute;
  1146. right: 16rpx;
  1147. }
  1148. .count{
  1149. width: 30rpx;
  1150. height: 30rpx;
  1151. line-height: 30rpx;
  1152. background: #fff;
  1153. border-radius: 100%;
  1154. display: flex;
  1155. align-items: center;
  1156. justify-content: center;
  1157. color: #E93323;
  1158. position: absolute;
  1159. right: 8rpx;
  1160. top: -12rpx;
  1161. font-size: 20rpx;
  1162. }
  1163. }
  1164. .iconfont{
  1165. color: #ffffff;
  1166. &.likeNumActive{
  1167. color: #E93323;
  1168. }
  1169. }
  1170. }
  1171. .icon-shipindianzan-yidian{
  1172. font-size: 64rpx;
  1173. }
  1174. .icon-pinglun2{
  1175. font-size: 59rpx;
  1176. }
  1177. .icon-fenxiang3{
  1178. font-size: 58rpx;
  1179. }
  1180. .info-text{
  1181. margin-top: 10rpx;
  1182. color: #ffffff;
  1183. }
  1184. .userAvatar{
  1185. border-radius: 500%;
  1186. border-style: solid;
  1187. border-width: 2px;
  1188. border-color: #ffffff;
  1189. width : 80rpx;
  1190. height: 80rpx;
  1191. display: block;
  1192. }
  1193. .video-dian{
  1194. position: relative;
  1195. width: 66rpx;
  1196. height: 66rpx;
  1197. align-items: center;
  1198. justify-content: center;
  1199. flex-direction: row;
  1200. left: 12rpx;
  1201. .dian{
  1202. width: 13rpx;
  1203. height: 13rpx;
  1204. background-color: #fff;
  1205. border-radius: 100%;
  1206. margin-right: 10rpx;
  1207. &:last-child{
  1208. margin-right: 0;
  1209. }
  1210. }
  1211. }
  1212. .manage{
  1213. width: 210rpx;
  1214. background: #ffffff;
  1215. box-shadow: 0 2rpx 15rpx rgba(0, 0, 0, 0.1);
  1216. padding: 0 15rpx;
  1217. position: absolute;
  1218. bottom: -50rpx;
  1219. right: 110rpx;
  1220. z-index: 90;
  1221. border-radius: 16rpx;
  1222. &::before{
  1223. content: "";
  1224. display: inline-block;
  1225. width: 26rpx;
  1226. height: 26rpx;
  1227. background: #ffffff;
  1228. transform: rotate(140deg);
  1229. position: absolute;
  1230. top: 60rpx;
  1231. right: -14rpx;
  1232. box-shadow: -1rpx -1rpx 1rpx rgba(0, 0, 0, 0.05);
  1233. }
  1234. .items{
  1235. border-bottom: 1px solid #EEEEEE;
  1236. color: #282828;
  1237. font-size: 26rpx;
  1238. padding: 20rpx 0;
  1239. display: flex;
  1240. align-items: center;
  1241. flex-direction: row;
  1242. &:last-child{
  1243. border-bottom: none;
  1244. }
  1245. .image{
  1246. width: 32rpx;
  1247. height: 32rpx;
  1248. margin: 0 16rpx 0;
  1249. }
  1250. }
  1251. }
  1252. .likeNumActive{
  1253. color: #E93323;
  1254. }
  1255. .content{
  1256. width: 590rpx;
  1257. position: absolute;
  1258. bottom: 30rpx;
  1259. bottom: calc(30rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1260. bottom: calc(30rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1261. padding: 15rpx 0;
  1262. flex-direction: column;
  1263. justify-content: flex-start;
  1264. color: #ffffff;
  1265. left:50%;
  1266. margin-left: -345rpx;
  1267. .time{
  1268. font-size: 24rpx;
  1269. color: rgba(255,255,255,0.5);
  1270. margin-left: 12rpx;
  1271. }
  1272. .cart{
  1273. height: 48rpx;
  1274. flex-direction:row;
  1275. .cartName{
  1276. font-size: 24rpx;
  1277. color: #fff;
  1278. }
  1279. }
  1280. }
  1281. .canvas {
  1282. z-index: 300;
  1283. width: 750px;
  1284. height: 1036px;
  1285. }
  1286. .poster-pop {
  1287. width: 600rpx;
  1288. /*#ifdef H5*/
  1289. height: 820rpx;
  1290. /*#endif*/
  1291. /*#ifndef H5*/
  1292. height: 910rpx;
  1293. /*#endif*/
  1294. position: fixed;
  1295. left: 50%;
  1296. transform: translateX(-50%);
  1297. z-index: 399;
  1298. top: 50%;
  1299. margin-top: -410rpx;
  1300. border-radius: 30rpx;
  1301. }
  1302. .poster-pop .image {
  1303. width: 100%;
  1304. height: 100%;
  1305. display: block;
  1306. border-radius: 16rpx;
  1307. }
  1308. .poster-pop .close {
  1309. width: 46rpx;
  1310. height: 75rpx;
  1311. position: fixed;
  1312. right: 0;
  1313. top: -73rpx;
  1314. display: block;
  1315. }
  1316. .poster-pop .keep {
  1317. text-align: center;
  1318. width: 600rpx;
  1319. height: 70rpx;
  1320. line-height: 70rpx;
  1321. border-radius: 43rpx;
  1322. background: #E93323;
  1323. color: #ffffff;
  1324. font-size: 25rpx;
  1325. margin-top: 40rpx;
  1326. }
  1327. .mask {
  1328. position: fixed;
  1329. top: 0;
  1330. left: 0;
  1331. right: 0;
  1332. bottom: 0;
  1333. background-color: rgba(0, 0, 0, 0.6);
  1334. z-index: 9;
  1335. }
  1336. .words {
  1337. margin-top: 12rpx;
  1338. .close{
  1339. display: flex;
  1340. flex-direction: row;
  1341. align-items: center;
  1342. justify-content: flex-end;
  1343. margin-right: 20rpx;
  1344. .imgClose{
  1345. width: 18rpx;
  1346. height: 10rpx;
  1347. margin-left: 10rpx;
  1348. }
  1349. }
  1350. .wordsCon{
  1351. position: relative;
  1352. .more{
  1353. position: absolute;
  1354. bottom: 0;
  1355. right: 40rpx;
  1356. font-size: 26rpx;
  1357. }
  1358. .img{
  1359. width: 18rpx;
  1360. height: 10rpx;
  1361. margin-left: 4rpx;
  1362. position: absolute;
  1363. bottom: 7rpx;
  1364. right: 15rpx;
  1365. }
  1366. }
  1367. .info{
  1368. color: #fff;
  1369. font-size: 28rpx;
  1370. }
  1371. .more{
  1372. font-size: 26rpx;
  1373. color: #ffffff;
  1374. font-weight: 400;
  1375. }
  1376. }
  1377. .product{
  1378. display: block;
  1379. margin-top: 27rpx;
  1380. .product-item{
  1381. display: inline-block;
  1382. width: 444rpx;
  1383. height: 136rpx;
  1384. background: rgba(0,0,0,.55);
  1385. border-radius: 12rpx;
  1386. padding: 16rpx 15rpx;
  1387. margin-right: 30rpx;
  1388. }
  1389. /deep/uni-swiper,/deep/swiper{
  1390. display: block;
  1391. // width: 500rpx!important;
  1392. height: 136rpx!important;
  1393. .swiper-count{
  1394. display: block;
  1395. width: 444rpx!important;
  1396. height: 136rpx!important;
  1397. background: rgba(0,0,0,.55);
  1398. border-radius: 12rpx;
  1399. padding: 16rpx 15rpx;
  1400. }
  1401. .swiper-item{
  1402. display: block;
  1403. width: 480rpx!important;
  1404. }
  1405. }
  1406. .item-count{
  1407. width: 414rpx;
  1408. flex-direction: row;
  1409. justify-content: space-between;
  1410. border-radius: 12rpx;
  1411. .picture{
  1412. width: 104rpx;
  1413. height: 104rpx;
  1414. border-radius: 10rpx;
  1415. image{
  1416. width: 104rpx;
  1417. height: 104rpx;
  1418. border-radius: 10rpx;
  1419. }
  1420. }
  1421. .product-text{
  1422. width: 266rpx;
  1423. justify-content: space-between;
  1424. .name{
  1425. display: inline-block;
  1426. width: 266rpx;
  1427. }
  1428. .product-price{
  1429. display: flex;
  1430. flex-direction: row;
  1431. justify-content: space-between;
  1432. align-items: center;
  1433. .price{
  1434. display: flex;
  1435. flex-direction: row;
  1436. align-items: end;
  1437. text{
  1438. font-size: 34rpx;
  1439. }
  1440. }
  1441. .buy-btn{
  1442. width: 89rpx;
  1443. height: 36rpx;
  1444. display: flex;
  1445. align-items: center;
  1446. justify-content: center;
  1447. color: #fff;
  1448. border-radius: 26rpx;
  1449. background: #E93323;
  1450. font-size: 20rpx;
  1451. }
  1452. }
  1453. }
  1454. }
  1455. }
  1456. .product_cate{
  1457. margin: 20rpx 0;
  1458. flex-direction: row;
  1459. >view{
  1460. display: inline-block;
  1461. flex-direction: row;
  1462. align-items: center;
  1463. border-radius: 30rpx;
  1464. padding: 0 25rpx;
  1465. line-height: 40rpx;
  1466. border-radius: 29rpx;
  1467. border: 1px solid #ffffff;
  1468. .text{
  1469. font-size: 24rpx;
  1470. }
  1471. .icon{
  1472. display: inline-block;
  1473. font-size: 26rpx;
  1474. font-weight: bold;
  1475. position: relative;
  1476. top: 2rpx;
  1477. margin-right: 8rpx;
  1478. }
  1479. }
  1480. }
  1481. .generate-posters {
  1482. width: 100%;
  1483. height: 170rpx;
  1484. background-color: #fff;
  1485. position: fixed;
  1486. left: 0;
  1487. bottom: 0;
  1488. z-index: 388;
  1489. transform: translate3d(0, 100%, 0);
  1490. transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  1491. border-top: 1px solid #eee;
  1492. align-content: center;
  1493. align-items: center;
  1494. flex-direction: row;
  1495. }
  1496. .generate-posters.on {
  1497. transform: translate3d(0, 0, 0);
  1498. }
  1499. .generate-posters .item {
  1500. /* #ifdef H5 */
  1501. flex: 100%;
  1502. /* #endif */
  1503. /* #ifndef H5 */
  1504. flex: 33.33%;
  1505. /* #endif */
  1506. text-align: center;
  1507. font-size: 30rpx;
  1508. &.item3{
  1509. flex: 33.33%;
  1510. }
  1511. }
  1512. .generate-posters .item .iconfont {
  1513. font-size: 80rpx;
  1514. color: #5eae72;
  1515. }
  1516. .generate-posters .item .iconfont.icon-haibao {
  1517. color: #5391f1;
  1518. }
  1519. .mask {
  1520. position: fixed;
  1521. top: 0;
  1522. left: 0;
  1523. right: 0;
  1524. bottom: 0;
  1525. background-color: rgba(0, 0, 0, 0.6);
  1526. z-index: 9;
  1527. }
  1528. .noVideo {
  1529. position: fixed;
  1530. top: 400rpx;
  1531. z-index: 9;
  1532. width: 750rpx;
  1533. flex-direction: row;
  1534. justify-content: center;
  1535. .pictrue {
  1536. width: 414rpx;
  1537. height: 256rpx;
  1538. }
  1539. .tips {
  1540. text-align: center;
  1541. margin-top: 14rpx;
  1542. font-size: 26rpx;
  1543. color: #999;
  1544. }
  1545. }
  1546. </style>