index.vue 38 KB

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