index.nvue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926
  1. <template>
  2. <view class="content">
  3. <u-navbar :title="topTitle" @leftClick="leftClick" titleStyle="color:#fff;" bgColor="#000" leftIconColor="#fff"
  4. :autoBack="false">
  5. </u-navbar>
  6. <swiper :style="'width: '+ windowWidth +'px; height:100vh; background-color: #000;'" class="swiper"
  7. :circular='false' @change="swiperChange" :current="swiperCurrent" :vertical="true" duration="200">
  8. <block v-for="content in videoInfo.updated_episode_num">
  9. <swiper-item :key="content">
  10. <view :style="'width: '+ windowWidth +'px; height:'+heightxw+'vh;'">
  11. <!-- @controlstoggle="controlstoggle" -->
  12. <video v-if="isShowVideo(content)" autoplay :key="content" id="myVideo" :controls="controls"
  13. :loop="!isplay" preload="auto" :enable-progress-gesture="true" :show-center-play-btn="false"
  14. :show-loading="false" :show-fullscreen-btn="false" @ended="ended" @click="tapVides()"
  15. :style="'width: '+ windowWidth +'px; height:'+heightxw+'vh;'"
  16. :src="currentVideoInfo.video_url" class="tsvideo">
  17. </video>
  18. <view v-if="isqp" class="userInfo">
  19. <!-- 2.点赞 -->
  20. <view style="opacity: 0.9; margin-top: 17px;">
  21. <image v-if="currentVideoInfo.is_zan" src="@/static/aixinRed.png" @click="myLike(2)"
  22. style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
  23. <image v-else src="@/static/aixin.png" @click="myLike(1)"
  24. style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
  25. <text
  26. style="color: #FFFFFF; margin-top: 5px; font-size: 14px; text-align: center; margin-top: 40px; font-weight: bold;">{{currentVideoInfo.total_zan}}</text>
  27. </view>
  28. <!-- 3.分享 -->
  29. <!-- <view style="opacity: 0.9; margin-top: 17px;">
  30. <image src="@/static/share-fill.png"
  31. style="width: 40px; height: 40px; position: absolute; right: 5px;"></image>
  32. <text
  33. style="color: #FFFFFF; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px;">分享</text>
  34. <button open-type="share"
  35. style="position: absolute; background: none; width: 100%; height: 100%;"
  36. @click.stop="share"></button>
  37. </view> -->
  38. <!-- 4.追剧 -->
  39. <view class="comment" style="opacity: 0.9; margin-top: 17px;">
  40. <view v-if="videoInfo.is_binge_watch" @click="unBingewatch">
  41. <image src="@/static/scRed.png"
  42. style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
  43. <text
  44. style="color: #ff0000; margin-top: 5px; font-size: 14px; font-weight: bold; text-align: center; margin-top: 40px;">已追</text>
  45. </view>
  46. <view v-else @click="bingewatch">
  47. <image src="@/static/sc.png"
  48. style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
  49. <text
  50. style="color: #FFFFFF; margin-top: 5px; font-size: 14px; font-weight: bold; text-align: center; margin-top: 40px;">追剧</text>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 最底下的文字部分 -->
  55. <view v-if="isqp" class="contentcd" @click.stop="sellxj()">
  56. <text class="userName">《{{videoInfo.name}}》</text>
  57. <text class="userName">更新到第{{videoInfo.updated_episode_num}}集</text>
  58. <text class="userName">|</text>
  59. <text class="userName">选集</text>
  60. </view>
  61. </view>
  62. </swiper-item>
  63. </block>
  64. </swiper>
  65. <uni-popup type="bottom" ref="select" style="z-index: 100;" :mask-click="true">
  66. <view v-if="fenji==1" class="pop-my" style=" border-top-left-radius: 10px; border-top-right-radius: 10px;">
  67. <view class="ju-top">
  68. <view style="display: flex; flex-direction: column; ">
  69. <view style="display: flex; flex-direction: column;">
  70. <view style="display: flex; flex-direction: column;">
  71. <view class="utabs-top">
  72. <u-tabs v-if="fenji==1" :activeStyle="activeStyle" lineColor="none"
  73. :inactiveStyle="inactiveStyle" class="utabs-top" :list="list1"
  74. :current="current"></u-tabs>
  75. </view>
  76. <view class="ju-top-title">
  77. {{videoInfo.name}}
  78. </view>
  79. <view class="ju-top-update"> 已更新至{{videoInfo.updated_episode_num}}集 </view>
  80. </view>
  81. <u-tabs v-if="fenji==1" :activeStyle="activeStyle" lineColor="none"
  82. :inactiveStyle="inactiveStyle" :current="tabcurrent" :list="labelList"
  83. @click="labelListClick"></u-tabs>
  84. </view>
  85. <view class="down" @click="down">
  86. <text class="down-text">收起</text>
  87. <image class="down-img" src="@/static/img/index/down.png">
  88. </image>
  89. </view>
  90. </view>
  91. </view>
  92. <scroll-view class="scroll-my" :scroll-y="true" :scroll-top="scrollTop">
  93. <view class="ju-wrapper">
  94. <block v-for="content in labelList[tabcurrent].content">
  95. <view class="ju-content" :class="activeIndex ==content?'active':'' "
  96. @click="playTest(content)">
  97. <!-- <view :class="isShowUpdate(content)?'lock-wrapper-no':'lock-wrapper'" -->
  98. <view class="lock-wrapper" v-if="isShowUpdate(content)">
  99. <text class="update-title">待更新</text>
  100. </view>
  101. <text class="title">第{{content}}集 </text>
  102. <view class="lock-wrapper" v-if="isShowVip(content)">
  103. <image class="lock-img" src="@/static/shilu-login/2.png"></image>
  104. </view>
  105. </view>
  106. </block>
  107. </view>
  108. <view style="width: 1px; height: 1px; margin-top: 30px;"></view>
  109. </scroll-view>
  110. </view>
  111. <view v-if="fenji==2"
  112. :style="'width: '+ windowWidth +'px;height:70vh; background-color: #fff; border-top-left-radius: 10px; border-top-right-radius: 10px;'">
  113. <view class="charge-wrapper">
  114. <view class="top">
  115. <text class="charge-title">充值购买后可继续观看{{topTitle}} </text>
  116. <text class="charge-info">为保护创作者权益,当前内容需要付费观看。</text>
  117. <view class="charge-coin">
  118. <text class="ji">本集:</text>
  119. <text class="bi">{{videoInfo.charge_coin}}k币</text>
  120. </view>
  121. </view>
  122. <view class="ft14"
  123. style="display: flex;flex-direction: row;justify-content: flex-start;padding: 0 20px;">账户余额<text
  124. class="ft14" style="color: #FF9800;">{{user_info.total_coin}}</text>K币</view>
  125. <scroll-view class="scroll-charge" :scroll-y="true" :scroll-top="scrollTop">
  126. <view class="pay-box">
  127. <block v-for="(item,key) in payOptions" :key="key">
  128. <view v-if="item.type =='COIN'" @click="selectPayItem(item)"
  129. :class="item.id == pay_select_id ?'pay-select' :'' " class="box pay-box-items">
  130. <view style="height: 20px;align-self: flex-end;"><text class="ft12 top-lab"
  131. v-if="item.tip_text">{{item.tip_text}}</text></view>
  132. <text class="ft18 pay-box-items-txt" style="color: #FF9800;">{{item.price}}元</text>
  133. <view class="ft14 pay-box-items-txt" style="flex-direction: row;">
  134. {{item.price_text}} <text class="ft14"
  135. style="color: #FF9800;">+{{item.given}}K币</text> </view>
  136. <view class="ft14 pay-box-items-txt"
  137. style="flex-direction: row;justify-content: space-between;"
  138. :class=" item.id == pay_select_id ?'select-text' :'given-txt'">
  139. {{item.given_amount}} <text v-if="item.id == pay_select_id"
  140. class="ft14">&#10003;️</text></view>
  141. </view>
  142. <view v-else @click="selectPayItem(item)"
  143. :class="item.id == pay_select_id ?'pay-select' :'' " class="box pay-box-items">
  144. <view style="height: 20px;align-self: flex-end;"><text class="ft12 top-lab"
  145. v-if="item.tip_text">{{item.tip_text}}</text></view>
  146. <view class="vip-center">
  147. <view class="">
  148. <text class="ft18 pay-box-items-txt"
  149. style="color: #FF9800;">{{item.price}}元</text>
  150. <view class="ft14 pay-box-items-txt">{{item.price_text}}</text></view>
  151. </view>
  152. <image class="vip-level-icon" src="/static/icon/vip.png"></image>
  153. </view>
  154. <view class="ft14 pay-box-items-txt"
  155. style="flex-direction: row;justify-content: space-between;"
  156. :class=" item.id == pay_select_id ?'select-text' :'given-txt'">
  157. {{item.given_amount}} <text v-if="item.id == pay_select_id"
  158. class="ft14">&#10003;️</text></view>
  159. </view>
  160. </block>
  161. </view>
  162. <view class="ft14" style="margin: 10px 0; padding: 0 20px;">付费须知</view>
  163. <view class="ft14" style="padding: 0 20px;">
  164. <text class="ft12">1、虚拟商品,一经购买不得退换</text>
  165. <text class="ft12">2、充值后K币可能有延迟,1小时未到账请在“我的”页面联系客服</text>
  166. <text class="ft12">3、未满18岁的未成年需要在监护人陪同下购买并观看短剧剧</text>
  167. <text class="ft12">4、购买成功后,“K币”仅在本小程序中使用</text>
  168. <text class="ft12">5、购买成功后可在”我的”页面订单中心进行查看</text>
  169. </view>
  170. </scroll-view>
  171. </view>
  172. </view>
  173. </uni-popup>
  174. </view>
  175. </template>
  176. <script>
  177. import {
  178. getVideoInfo,
  179. videoEpisodePlay,
  180. videoEpisodeZan,
  181. } from '@/common/apis/video.js';
  182. import {
  183. delShelf,
  184. storeshelf
  185. } from '@/common/apis/zju.js'
  186. import {
  187. getUserInfo
  188. } from "@/common/apis/my.js";
  189. import {userRanse} from "@/common/apis/common.js"
  190. import {
  191. getOptions,
  192. getPayInfo
  193. } from "@/common/apis/recharge.js"
  194. import configs from "@/common/config.js"
  195. export default {
  196. data() {
  197. return {
  198. limitPage: 15,
  199. top_height: 0,
  200. episode: 1,
  201. ranse_id:0,
  202. swiperCurrent: 0,
  203. videoContext: '',
  204. currentVideoInfo: {},
  205. activeStyle: {
  206. color: '#f95d27',
  207. fontWeight: 'bold',
  208. transform: 'scale(1.05)'
  209. },
  210. inactiveStyle: {
  211. color: '#606266',
  212. transform: 'scale(1)'
  213. },
  214. activeIndex: 1,
  215. tabcurrent: 0,
  216. videoInfo: {},
  217. labelList: [],
  218. list1: [{
  219. name: '当前剧集',
  220. }, {
  221. name: '相似好剧',
  222. }],
  223. sharedata: {
  224. type: 2,
  225. strShareUrl: "",
  226. strShareTitle: "分享标题",
  227. strShareSummary: "分享总结",
  228. strShareImageUrl: ""
  229. },
  230. isShow: true,
  231. fenji: 2,
  232. pay_select_id: 0,
  233. controls: true,
  234. windowWidth: 0,
  235. windowHeight: 0,
  236. current: 0,
  237. isplay: true, //是否自动播放下一个视频
  238. duration: 500,
  239. isqp: true,
  240. urls: configs.webUrl,
  241. scrollTop: 0,
  242. video_id: 0,
  243. safeArea: 0,
  244. ttuop: 0,
  245. heightxw: 100,
  246. user_info: {},
  247. payVideoInfo: {},
  248. payOptions: []
  249. };
  250. },
  251. computed: {
  252. isShowVideo(item) {
  253. return (item) => {
  254. return this.swiperCurrent == item && this.isShow
  255. }
  256. },
  257. isShowVip(item) {
  258. return (item) => {
  259. return item >= this.videoInfo.charge_sequence && item <= this.videoInfo.updated_episode_num
  260. }
  261. },
  262. isShowUpdate(item) {
  263. return (item) => {
  264. return item > this.videoInfo.updated_episode_num
  265. }
  266. },
  267. topTitle() {
  268. return `《${this.videoInfo.name}》 第${this.episode}集`
  269. }
  270. },
  271. onReady: function(res) {
  272. this.videoContext = uni.createVideoContext('myVideo')
  273. },
  274. mounted() {
  275. this.initSwiperData(this.swiperCurrent + 1)
  276. getVideoInfo({
  277. video_id: this.video_id
  278. }).then(res => {
  279. // console.log(res, 'getVideoInfogetVideoInfogetVideoInfo')
  280. this.videoInfo = res.data
  281. this.initTabs();
  282. })
  283. },
  284. async onLoad(e) {
  285. // console.log('11111111111111111111',e)
  286. let that = this;
  287. uni.getSystemInfo({
  288. success(res) {
  289. that.top_height = res.statusBarHeight; //data中 声明 top_height:0
  290. }
  291. });
  292. if (e.video_id) {
  293. this.video_id = Number(e.video_id)
  294. }
  295. if(e.sequence && Number(e.sequence) > 0){
  296. this.swiperCurrent = Number(e.sequence) -1;
  297. }
  298. // 染色参数接收
  299. if(e.ranse_id && Number(e.ranse_id) > 0){
  300. try{
  301. this.ranse_id = Number(e.ranse_id);
  302. let res = await userRanse(this.ranse_id);
  303. }catch(e){
  304. console.log("player-errr:",e)
  305. }
  306. }
  307. uni.getSystemInfo({
  308. success: res => {
  309. this.safeArea = res.safeAreaInsets.bottom;
  310. if (this.safeArea > 0) {
  311. this.heightxw = 97
  312. }
  313. }
  314. })
  315. // #ifdef MP-TOUTIAO
  316. this.ttuop = 64
  317. // #endif
  318. this.windowWidth = uni.getSystemInfoSync().windowWidth
  319. this.windowHeight = uni.getSystemInfoSync().windowHeight - this.safeArea - this.ttuop
  320. console.log(this.windowHeight)
  321. },
  322. onShow() {
  323. },
  324. onShareAppMessage: function(res) {
  325. // #ifdef MP-WEIXIN
  326. var href = '/pages/video/index?video_id=' + this.video_id + "&"
  327. console.log(res)
  328. let that = this;
  329. const obj = {
  330. title: "发送给好友",
  331. imageUrl: '',
  332. path: href,
  333. success: function(res) {
  334. console.log(res, "转发成功")
  335. },
  336. fail: function(res) {
  337. wx.showToast({
  338. title: '发送失败',
  339. icon: 'none'
  340. })
  341. }
  342. }
  343. return obj
  344. // #endif
  345. },
  346. watch: {
  347. activeIndex(newVal, oldVal) {
  348. let index = this.labelList.findIndex(el => el.content.includes(newVal))
  349. this.tabcurrent = index
  350. }
  351. },
  352. onBackPress() {},
  353. methods: {
  354. bingewatch() {
  355. storeshelf(this.video_id).then(res => {
  356. console.log(res, 'storeshelfstoreshelfstoreshelf')
  357. this.videoInfo.is_binge_watch = !Boolean(this.videoInfo.is_binge_watch)
  358. uni.showToast({
  359. title: '追剧成功',
  360. duration: 1000,
  361. icon: 'none'
  362. });
  363. })
  364. },
  365. unBingewatch() {
  366. delShelf(this.video_id).then(res => {
  367. console.log(res, 'delShelfdelShelfdelShelfdelShelfdelShelf')
  368. this.videoInfo.is_binge_watch = !Boolean(this.videoInfo.is_binge_watch)
  369. })
  370. },
  371. leftClick(e) {
  372. if (!this.videoInfo?.is_binge_watch) {
  373. uni.showModal({
  374. title: '加入追剧',
  375. content: '喜欢就加入追剧吧',
  376. confirmText: '加入追剧',
  377. confirmColor: '#FFA500',
  378. cancelText: '不用了',
  379. success: (res) => {
  380. if (res.confirm) {
  381. this.bingewatch()
  382. uni.navigateBack()
  383. // 用户点击了确定按钮
  384. // 执行加入追剧的逻辑
  385. } else if (res.cancel) {
  386. // 用户点击了取消按钮
  387. // 执行取消逻辑
  388. uni.navigateBack()
  389. }
  390. }
  391. });
  392. } else {
  393. uni.navigateBack()
  394. }
  395. },
  396. myLike(like) {
  397. videoEpisodeZan({
  398. episode_id: this.currentVideoInfo.id,
  399. zan: like
  400. }).then(res => {
  401. console.log(res, 'VideoEpisodeZanVideoEpisodeZanVideoEpisodeZan')
  402. this.$nextTick(() => {
  403. this.currentVideoInfo.is_zan = !Boolean(this.currentVideoInfo.is_zan)
  404. if (this.currentVideoInfo.is_zan) {
  405. this.currentVideoInfo.total_zan++
  406. } else {
  407. this.currentVideoInfo.total_zan--
  408. }
  409. })
  410. })
  411. },
  412. initTabs() {
  413. function innit(i, num) {
  414. let arr = [];
  415. for (i; i <= num; i++) {
  416. arr.push(i)
  417. }
  418. return arr
  419. }
  420. const pageSize = this.limitPage;
  421. const total = this.videoInfo.total_episode_num;
  422. const pageCount = Math.ceil(total / pageSize);
  423. for (let i = 0; i < pageCount; i++) {
  424. const start = i * pageSize + 1;
  425. const end = i === pageCount - 1 ? total : (i + 1) * pageSize;
  426. let label;
  427. if (i === pageCount - 1) {
  428. if (start === total) {
  429. label = `${total}`
  430. } else {
  431. label = `${start}-${total}`
  432. }
  433. } else {
  434. label = `${start}-${end}`
  435. }
  436. let index;
  437. if (label.split('-')[1]) {
  438. index = label.split('-')[1]
  439. } else {
  440. index = total
  441. }
  442. this.labelList.push({
  443. name: label,
  444. page: pageCount,
  445. content: innit(start, index)
  446. })
  447. }
  448. },
  449. async getPayInfo(originIndex) {
  450. this.user_info = await getUserInfo();
  451. this.payOptions = await getOptions();
  452. this.payOptions.forEach((item, index) => {
  453. if (item.is_default == 1) {
  454. this.pay_select_id = item.id;
  455. }
  456. })
  457. this.payVideoInfo = {
  458. video_id: this.video_id,
  459. video_series_sequence: originIndex
  460. };
  461. },
  462. async selectPayItem(item) {
  463. this.pay_select_id = item.id;
  464. let params = {
  465. video_id: this.payVideoInfo.video_id,
  466. video_series_sequence: this.payVideoInfo.video_series_sequence,
  467. pay_proudct_id: item.id
  468. }
  469. let res = await getPayInfo(params);
  470. if (res) {
  471. // #ifdef MP-WEIXIN
  472. this.wxMinPay(res);
  473. // #endif
  474. }
  475. },wxMinPay(param){
  476. wx.requestPayment({
  477. timeStamp: param.timeStamp,
  478. nonceStr: param.nonceStr,
  479. package: param.package,
  480. signType: param.signType,
  481. paySign: param.paySign,
  482. success (res) {
  483. this.pay_success = true;
  484. uni.showToast({ title: '支付成功',icon:"none" });
  485. // console.log('success:' + JSON.stringify(res));
  486. },
  487. fail (e) {
  488. if(e.errMsg == "requestPayment:fail cancel"){
  489. uni.showToast({ title: '取消支付',icon:"none" });
  490. }else{
  491. uni.showToast({ title: '支付失败',icon:"none" });
  492. }
  493. }
  494. })
  495. },
  496. playTest(item) {
  497. console.log(item)
  498. if (this.isShowVip(item)) {
  499. console.log('111111111111111', item)
  500. this.fenji = 2
  501. this.getPayInfo(item);
  502. this.activeIndex = ''
  503. } else if (this.isShowUpdate(item)) {
  504. this.activeIndex = ''
  505. uni.showToast({
  506. title: '剧集暂未更新',
  507. duration: 1000,
  508. icon: 'none'
  509. });
  510. } else {
  511. this.activeIndex = item;
  512. this.swiperCurrent = item - 1;
  513. this.episode = this.swiperCurrent
  514. // this.initSwiperData(item)
  515. this.down();
  516. }
  517. },
  518. labelListClick(item) {
  519. this.tabcurrent = item.index
  520. console.log('itemitemitemitemitem', item);
  521. },
  522. share() {
  523. var href = '/pages/video/index?video_id=' + this.video_id
  524. // #ifdef H5
  525. uni.setClipboardData({
  526. data: this.urls + '/h5/#' + href,
  527. complete() {
  528. uni.showToast({
  529. title: "分享连接已复制到剪贴板"
  530. })
  531. }
  532. })
  533. // #endif
  534. // #ifndef H5
  535. uni.share({
  536. provider: "weixin",
  537. scene: "WXSenceTimeline",
  538. type: 0,
  539. href: href,
  540. title: '分享标题',
  541. summary: '分享总结',
  542. imageUrl: '',
  543. success: function(res) {
  544. console.log("success:" + JSON.stringify(res));
  545. },
  546. fail: function(err) {
  547. console.log("fail:" + JSON.stringify(err));
  548. }
  549. })
  550. // #endif
  551. },
  552. down() {
  553. this.$refs.select.close();
  554. },
  555. sellxj() {
  556. this.fenji = 1
  557. this.$refs.select.open('bottom');
  558. this.$nextTick(() => {
  559. let num1 = (this.windowHeight / 1.6) * 0.85;
  560. let num2 = num1 / 4.78;
  561. this.scrollTop = num2 * Number(this.k);
  562. })
  563. },
  564. tapVideoHover(index, pays) {
  565. this.videoContext.play()
  566. // this.$refs.select.open('bottom');
  567. },
  568. tapVides() {
  569. this.isqp = !this.isqp
  570. },
  571. ended() {
  572. //console.log('isplay----',this.isplay)
  573. // 1.播放当前视频结束时触发,自动切换下一个视频
  574. if (this.isplay) {
  575. if (this.displayIndex < 2) {
  576. this.current = this.displayIndex + 1
  577. } else {
  578. this.current = 0
  579. }
  580. this.isqp = true
  581. console.log('显示swiper Index:', this.displayIndex)
  582. }
  583. },
  584. initSwiperData(originIndex) {
  585. this.episode = originIndex;
  586. this.isqp = true
  587. videoEpisodePlay({
  588. video_id: this.video_id,
  589. sequence: originIndex,
  590. }).then(res => {
  591. if (res.code == 0) {
  592. this.currentVideoInfo = res.data
  593. this.activeIndex = this.episode;
  594. this.isShow = true
  595. } else if (res.code == 500101) {
  596. console.log(this.currentVideoInfo, 'res.code == 500101res.code == 500101')
  597. this.currentVideoInfo.video_url = ""
  598. this.isShow = false
  599. this.isqp = false
  600. this.fenji = 2
  601. this.getPayInfo(originIndex);
  602. this.$refs.select.open('bottom');
  603. // this.currentVideoInfo = {}
  604. } else {
  605. this.isqp = false
  606. this.currentVideoInfo.video_url = ""
  607. this.isShow = false
  608. }
  609. console.log(res, 'getVideoEpisodePlaygetVideoEpisodePlay')
  610. })
  611. },
  612. /**
  613. * swiper滑动时候
  614. */
  615. swiperChange(event) {
  616. const {
  617. current
  618. } = event.detail;
  619. this.swiperCurrent = current
  620. console.log(this.swiperCurrent, 'this.swiperCurrentthis.swiperCurrent')
  621. this.initSwiperData(current + 1)
  622. },
  623. controlstoggle(e) {
  624. console.log(e.detail.show);
  625. },
  626. },
  627. };
  628. </script>
  629. <style lang="scss" scoped>
  630. .vip-center {
  631. display: flex;
  632. flex-direction: row;
  633. justify-content: space-between;
  634. align-items: center;
  635. }
  636. .vip-level-icon {
  637. margin-right: 10rpx;
  638. width: 80px;
  639. height: 30px;
  640. }
  641. .pay-box {
  642. background-color: #fff;
  643. display: flex;
  644. justify-content: space-between;
  645. flex-direction: row;
  646. padding: 0 20px;
  647. flex-wrap: wrap;
  648. }
  649. .top-lab {
  650. width: 40px;
  651. text-align: center;
  652. background-color: #ff5722;
  653. color: #fff;
  654. float: right;
  655. border-top: none;
  656. border-radius: 10px;
  657. }
  658. .pay-box-items {
  659. margin-top: 10px;
  660. width: 48%;
  661. flex-direction: column;
  662. border-radius: 10px;
  663. line-height: 25px;
  664. overflow: hidden;
  665. }
  666. .pay-box-items-txt {
  667. padding: 1rpx 13px;
  668. }
  669. .pay-box-items view text {
  670. line-height: 25px;
  671. }
  672. .pay-select {
  673. border: solid 1px #ff5722;
  674. }
  675. .select-text {
  676. background-color: #ff5722;
  677. color: #fff;
  678. height: 30px;
  679. border-radius: 0rpx 0rpx 10rpx 10rpx;
  680. }
  681. .given-txt {
  682. height: 30px;
  683. border-top: solid 1rpx #9e9e9e1f;
  684. }
  685. .content {
  686. background: #000000;
  687. }
  688. .userInfo {
  689. position: absolute;
  690. z-index: 99;
  691. bottom: 30%;
  692. right: 10px;
  693. width: 100rpx;
  694. text-align: center;
  695. flex-direction: column;
  696. }
  697. .contentcd {
  698. background-color: rgba(255, 255, 255, .3);
  699. width: 720rpx;
  700. z-index: 99;
  701. position: absolute;
  702. bottom: 70rpx;
  703. left: 50%;
  704. transform: translateX(-50%);
  705. padding: 15rpx;
  706. border-radius: 8px;
  707. display: flex;
  708. flex-direction: row;
  709. justify-content: flex-start;
  710. align-items: center;
  711. color: #ffffff;
  712. margin: 0 auto;
  713. }
  714. .userName {
  715. color: #fff;
  716. font-size: 30rpx;
  717. color: #ffffff;
  718. margin: 0 6rpx;
  719. }
  720. .tsvideo {
  721. animation: showDivAni 2s 1;
  722. }
  723. @keyframes showDivAni {
  724. 0% {
  725. opacity: 0;
  726. }
  727. 100% {
  728. opacity: 1;
  729. }
  730. }
  731. </style>
  732. <style lang="scss" scoped>
  733. .charge-wrapper {
  734. margin-top: 15px;
  735. width: 100%;
  736. .top {
  737. width: 100%;
  738. display: flex;
  739. align-items: center;
  740. .charge-title {
  741. font-size: 18px;
  742. font-weight: bold;
  743. }
  744. .charge-info {
  745. font-size: 15px;
  746. color: #868686;
  747. margin: 8px 0;
  748. }
  749. .charge-coin {
  750. display: flex;
  751. flex-direction: row;
  752. .ji {
  753. font-size: 18px;
  754. }
  755. .bi {
  756. font-size: 18px;
  757. color: $accent-color;
  758. }
  759. }
  760. }
  761. }
  762. .down {
  763. display: flex;
  764. flex-direction: row;
  765. width: 60px;
  766. height: 30px;
  767. margin-top: 5px;
  768. position: absolute;
  769. right: 0px;
  770. top: 50%;
  771. transform: translateY(-50%);
  772. .down-text {
  773. font-size: 16px;
  774. color: #000;
  775. }
  776. .down-img {
  777. width: 35rpx;
  778. height: 35rpx;
  779. object-fit: contain;
  780. }
  781. }
  782. .ju-top {
  783. // background-color: ;
  784. .ju-top-title {
  785. font-size: 16px;
  786. font-weight: bold;
  787. color: #000;
  788. margin-top: 9px;
  789. height: 22px;
  790. margin-left: 20px;
  791. // width: '+ (windowWidth*0.6) +' px;
  792. overflow: hidden;
  793. }
  794. .ju-top-update {
  795. font-size: 12px;
  796. color: #000;
  797. margin-top: 9px;
  798. height: 22px;
  799. margin-left: 20px;
  800. }
  801. }
  802. .pop-my {
  803. background-color: #FFFFFF;
  804. }
  805. .scroll-my {
  806. height: fit-content;
  807. }
  808. .scroll-charge {
  809. height: 50vh;
  810. }
  811. .ju-wrapper {
  812. display: flex;
  813. flex-direction: row;
  814. flex-wrap: wrap;
  815. align-items: center;
  816. justify-content: start;
  817. width: 100%;
  818. height: 100%;
  819. background-color: #FFFFFF;
  820. // margin: 6rpx;
  821. .ju-content.active {
  822. background-color: #ff7f02;
  823. }
  824. .ju-content {
  825. flex-grow: 1;
  826. position: relative;
  827. border-radius: 12rpx;
  828. background-color: #f6f6f6;
  829. width: 31%;
  830. height: 25rpx;
  831. align-items: center;
  832. justify-content: center;
  833. padding: 45rpx 68rpx;
  834. margin: 6rpx;
  835. .lock-wrapper,
  836. .lock-wrapper-no {
  837. position: absolute;
  838. width: 100%;
  839. height: 100%;
  840. border-radius: 12rpx;
  841. background-color: rgba(0, 0, 0, .3);
  842. .lock-img {
  843. position: absolute;
  844. left: 3rpx;
  845. top: 50%;
  846. transform: translateY(-50%);
  847. width: 50rpx;
  848. height: 50rpx;
  849. margin-left: 20rpx;
  850. }
  851. .update-title {
  852. width: fit-content;
  853. height: fit-content;
  854. border-radius: 8rpx;
  855. font-size: 10px;
  856. padding: 6rpx;
  857. background-color: #868686;
  858. color: #fff;
  859. }
  860. }
  861. .lock-wrapper-no {
  862. background-color: #f6f6f6;
  863. }
  864. .title {
  865. font-size: 16px;
  866. }
  867. }
  868. }
  869. .utabs-top /deep/ .u-tabs {
  870. align-items: flex-start;
  871. }
  872. </style>