index.nvue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. <template>
  2. <view class="">
  3. <!-- 加载中提示 -->
  4. <u-loading-page bg-color="#000000" :loading="isLoading" loading-text="加载中..." loading-mode="semicircle"
  5. loading-color="#ffffff" font-size="18" icon-size="46" color="#ffffff"></u-loading-page>
  6. <view class="content" v-if="!isLoading">
  7. <u-navbar :leftText="topTitle" @leftClick="leftClick" titleStyle="color:#fff;" bgColor="#000"
  8. leftIconColor="#fff" :autoBack="false">
  9. </u-navbar>
  10. <swiper :style="'width: '+ windowWidth +'px; height:100vh; background-color: #000;'" class="swiper"
  11. :circular='false' @change="swiperChange" :current="swiperCurrent" :vertical="true" duration="200">
  12. <block v-for="content in swiperList" :key="content">
  13. <swiper-item :key="content">
  14. <view :style="'width: '+ windowWidth +'px; height:'+heightxw+'vh;'"
  15. v-if="isShowVideo(content) && shouldRender(content)">
  16. <!-- @controlstoggle="controlstoggle" -->
  17. <video v-if="isShowVideo(content)" autoplay :key="content" id="myVideo" :controls="controls"
  18. :loop="!isplay" preload="auto" :enable-progress-gesture="true"
  19. :show-center-play-btn="false" :show-loading="false" :show-fullscreen-btn="false"
  20. :poster="videoInfo.cover_image" @ended="ended" @click="tapVides()"
  21. :style="'width: '+ windowWidth +'px; height:'+heightxw+'vh;'"
  22. :src="currentVideoInfo.video_url" class="tsvideo">
  23. </video>
  24. <view v-if="isqp" class="userInfo">
  25. <!-- 2.点赞 -->
  26. <view style="opacity: 0.9; margin-top: 17px;">
  27. <image v-if="currentVideoInfo.is_zan" src="@/static/img/video/aixinRed.png"
  28. @click="myLike(2)"
  29. style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
  30. <image v-else src="@/static/img/video/aixin.png" @click="myLike(1)"
  31. style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
  32. <text
  33. style="color: #FFFFFF; margin-top: 5px; font-size: 14px; text-align: center; margin-top: 40px; font-weight: bold;">{{currentVideoInfo.total_zan}}</text>
  34. </view>
  35. <!-- 3.分享 -->
  36. <!-- <view style="opacity: 0.9; margin-top: 17px;">
  37. <image src="@/static/img/video/share-fill.png"
  38. style="width: 40px; height: 40px; position: absolute; right: 5px;"></image>
  39. <text
  40. style="color: #FFFFFF; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px;">分享</text>
  41. <button open-type="share"
  42. style="position: absolute; background: none; width: 100%; height: 100%;"
  43. @click.stop="share"></button>
  44. </view> -->
  45. <!-- 4.追剧 -->
  46. <view class="comment" style="opacity: 0.9; margin-top: 17px;">
  47. <view v-if="videoInfo.is_binge_watch" @click="unBingewatch">
  48. <image src="@/static/img/video/scRed.png"
  49. style="width: 40px; height: 40px; position: absolute; right: 6px;">
  50. </image>
  51. <text
  52. style="color: #ff0000; margin-top: 5px; font-size: 14px; font-weight: bold; text-align: center; margin-top: 40px;">已追</text>
  53. </view>
  54. <view v-else @click="bingewatch">
  55. <image src="@/static/img/video/sc.png"
  56. style="width: 40px; height: 40px; position: absolute; right: 6px;">
  57. </image>
  58. <text
  59. style="color: #FFFFFF; margin-top: 5px; font-size: 14px; font-weight: bold; text-align: center; margin-top: 40px;">追剧</text>
  60. </view>
  61. </view>
  62. </view>
  63. <!-- 最底下的文字部分 -->
  64. <view v-if="isqp" class="contentcd" @click.stop="sellxj()">
  65. <text class="userName">《{{videoInfo.name}}》</text>
  66. <text class="userName">更新到第{{videoInfo.updated_episode_num}}集</text>
  67. <text class="userName">|</text>
  68. <text class="userName">选集</text>
  69. </view>
  70. </view>
  71. <image v-if="shouldRender(content) && !isShowVideo(content)" mode="scaleToFill"
  72. :style="'width: '+ windowWidth +'px; height:'+heightxw+'vh;'" :src="videoInfo.cover_image">
  73. </image>
  74. </swiper-item>
  75. </block>
  76. </swiper>
  77. <uni-popup type="bottom" ref="select" style="z-index: 100;" :mask-click="true">
  78. <view v-if="fenji==1" class="pop-my"
  79. style=" border-top-left-radius: 10px; border-top-right-radius: 10px;">
  80. <view class="ju-top">
  81. <view style="display: flex; flex-direction: column; ">
  82. <view style="display: flex; flex-direction: column;">
  83. <view style="display: flex; flex-direction: column;">
  84. <view class="utabs-top">
  85. <u-tabs v-if="fenji==1" :activeStyle="activeStyle" lineColor="none"
  86. :inactiveStyle="inactiveStyle" class="utabs-top" :list="list1"
  87. :current="current"></u-tabs>
  88. </view>
  89. <view class="ju-top-title">
  90. {{videoInfo.name}}
  91. </view>
  92. <view class="ju-top-update"> 已更新至{{videoInfo.updated_episode_num}}集 </view>
  93. </view>
  94. <u-tabs v-if="fenji==1" :activeStyle="activeStyle" lineColor="none"
  95. :inactiveStyle="inactiveStyle" :current="tabcurrent" :list="labelList"
  96. @click="labelListClick"></u-tabs>
  97. </view>
  98. <view class="down" @click="down">
  99. <text class="down-text">收起</text>
  100. <image class="down-img" src="@/static/img/video/down.png">
  101. </image>
  102. </view>
  103. </view>
  104. </view>
  105. <scroll-view class="scroll-my" :scroll-y="true" :scroll-top="scrollTop">
  106. <view class="ju-wrapper">
  107. <block v-for="content in labelList[tabcurrent].content" :key="content">
  108. <view class="ju-content" :class="activeIndex ==content?'active':'' "
  109. @click="playVideo(content)">
  110. <!-- <view :class="isShowUpdate(content)?'lock-wrapper-no':'lock-wrapper'" -->
  111. <view class="lock-wrapper" v-if="isShowUpdate(content)">
  112. <text class="update-title">待更新</text>
  113. </view>
  114. <text class="title">第{{content}}集 </text>
  115. <view class="lock-wrapper" v-if="isShowVip(content)">
  116. <image class="lock-img" src="@/static/img/video/vip.png"></image>
  117. </view>
  118. </view>
  119. </block>
  120. </view>
  121. <view style="width: 1px; height: 1px; margin-top: 30px;"></view>
  122. </scroll-view>
  123. </view>
  124. <view v-if="fenji==2"
  125. :style="'width: '+ windowWidth +'px;height:70vh; background-color: #fff; border-top-left-radius: 10px; border-top-right-radius: 10px;'">
  126. <view class="charge-wrapper">
  127. <view class="top">
  128. <text class="charge-title">充值购买后可继续观看{{popUpTitle}} </text>
  129. <text class="charge-info">为保护创作者权益,当前内容需要付费观看。</text>
  130. <view class="charge-coin">
  131. <text class="ji">本集:</text>
  132. <text class="bi">{{videoInfo.charge_coin}}k币</text>
  133. </view>
  134. </view>
  135. <view class="ft14"
  136. style="display: flex;flex-direction: row;justify-content: flex-start;padding: 0 20px;">
  137. 账户余额<text class="ft14" style="color: #FF9800;">{{user_info.total_coin}}</text>K币</view>
  138. <scroll-view class="scroll-charge" :scroll-y="true" :scroll-top="scrollTop">
  139. <view class="pay-box">
  140. <block v-for="(item,key) in payOptions" :key="key">
  141. <view v-if="item.type =='COIN'" @click="selectPayItem(item)"
  142. :class="item.id == pay_select_id ?'pay-select' :'' " class="box pay-box-items">
  143. <view style="height: 20px;align-self: flex-end;"><text class="ft12 top-lab"
  144. v-if="item.tip_text">{{item.tip_text}}</text></view>
  145. <text class="ft18 pay-box-items-txt"
  146. style="color: #FF9800;">{{item.price}}元</text>
  147. <view class="ft14 pay-box-items-txt" style="flex-direction: row;">
  148. {{item.price_text}} <text class="ft14"
  149. style="color: #FF9800;">+{{item.given}}K币</text>
  150. </view>
  151. <view class="ft14 pay-box-items-txt"
  152. style="flex-direction: row;justify-content: space-between;"
  153. :class=" item.id == pay_select_id ?'select-text' :'given-txt'">
  154. {{item.given_amount}} <text v-if="item.id == pay_select_id"
  155. class="ft14">&#10003;️</text>
  156. </view>
  157. </view>
  158. <view v-else @click="selectPayItem(item)"
  159. :class="item.id == pay_select_id ?'pay-select' :'' " class="box pay-box-items">
  160. <view style="height: 20px;align-self: flex-end;"><text class="ft12 top-lab"
  161. v-if="item.tip_text">{{item.tip_text}}</text></view>
  162. <view class="vip-center">
  163. <view class="">
  164. <text class="ft18 pay-box-items-txt"
  165. style="color: #FF9800;">{{item.price}}元</text>
  166. <view class="ft14 pay-box-items-txt">{{item.price_text}}</text></view>
  167. </view>
  168. <image class="vip-level-icon" src="/static/icon/vip.png"></image>
  169. </view>
  170. <view class="ft14 pay-box-items-txt"
  171. style="flex-direction: row;justify-content: space-between;"
  172. :class=" item.id == pay_select_id ?'select-text' :'given-txt'">
  173. {{item.given_amount}} <text v-if="item.id == pay_select_id"
  174. class="ft14">&#10003;️</text>
  175. </view>
  176. </view>
  177. </block>
  178. </view>
  179. <view class="ft14" style="margin: 10px 0; padding: 0 20px;">付费须知</view>
  180. <view class="ft14" style="padding: 0 20px;">
  181. <text class="ft12">1、虚拟商品,一经购买不得退换</text>
  182. <text class="ft12">2、充值后K币可能有延迟,1小时未到账请在“我的”页面联系客服</text>
  183. <text class="ft12">3、未满18岁的未成年需要在监护人陪同下购买并观看短剧剧</text>
  184. <text class="ft12">4、购买成功后,“K币”仅在本小程序中使用</text>
  185. <text class="ft12">5、购买成功后可在”我的”页面订单中心进行查看</text>
  186. </view>
  187. </scroll-view>
  188. </view>
  189. </view>
  190. </uni-popup>
  191. </view>
  192. <u-overlay :show="centerShow" :duration="400" closeOnClickOverlay :z-index="999" @click="closeOverlay">
  193. <view class="warp">
  194. <view class="rect" @tap.stop>
  195. <text class="rect-text">剧集暂未更新</text>
  196. <view class="rect-button" @tap.stop @click="closeOverlay"><text class="rect-button-text">确定</text>
  197. </view>
  198. </view>
  199. </view>
  200. </u-overlay>
  201. </view>
  202. </template>
  203. <script>
  204. import {
  205. getVideoInfo,
  206. videoEpisodePlay,
  207. videoEpisodeZan,
  208. } from '@/common/apis/video.js';
  209. import {
  210. delShelf,
  211. storeshelf
  212. } from '@/common/apis/zju.js'
  213. import {
  214. userRanse
  215. } from "@/common/apis/common.js"
  216. import configs from "@/common/config.js"
  217. import wxpay from '@/mixins/wxpay.js';
  218. export default {
  219. mixins: [wxpay],
  220. data() {
  221. return {
  222. isLoading: true, // 页面加载中的状态
  223. centerShow: false, //暂未更新弹窗
  224. limitPage: 15,
  225. top_height: 0,
  226. episode: 1,
  227. ranse_id: 0,
  228. swiperCurrent: 0,
  229. videoContext: '',
  230. currentVideoInfo: {},
  231. activeStyle: {
  232. color: '#f95d27',
  233. fontWeight: 'bold',
  234. transform: 'scale(1.05)'
  235. },
  236. inactiveStyle: {
  237. color: '#606266',
  238. transform: 'scale(1)'
  239. },
  240. activeIndex: 1,
  241. tabcurrent: 0,
  242. videoInfo: {},
  243. labelList: [],
  244. list1: [{
  245. name: '当前剧集',
  246. }],
  247. sharedata: {
  248. type: 2,
  249. strShareUrl: "",
  250. strShareTitle: "分享标题",
  251. strShareSummary: "分享总结",
  252. strShareImageUrl: ""
  253. },
  254. isShow: true,
  255. fenji: 2,
  256. controls: true,
  257. windowWidth: 0,
  258. windowHeight: 0,
  259. current: 0,
  260. isplay: true, //是否自动播放下一个视频
  261. duration: 500,
  262. isqp: true,
  263. urls: configs.webUrl,
  264. scrollTop: 0,
  265. video_id: 0,
  266. safeArea: 0,
  267. ttuop: 0,
  268. heightxw: 100,
  269. };
  270. },
  271. computed: {
  272. shouldRender(index) {
  273. return (index) => {
  274. // 判断是否应该渲染当前索引的前后各一个索引的swiper item
  275. return Math.abs(index - this.swiperCurrent) <= 1;
  276. }
  277. },
  278. swiperList() {
  279. // return Number(2800) + 1
  280. return Number(this.videoInfo.updated_episode_num) + 1
  281. },
  282. isShowVideo(item) {
  283. return (item) => {
  284. return this.swiperCurrent == item && this.isShow
  285. }
  286. },
  287. isShowVip(item) {
  288. return (item) => {
  289. return item >= this.videoInfo.charge_sequence && item <= this.videoInfo.updated_episode_num
  290. }
  291. },
  292. isShowUpdate(item) {
  293. return (item) => {
  294. return item > this.videoInfo.updated_episode_num
  295. }
  296. },
  297. popUpTitle() {
  298. return `《${this.videoInfo.name}》 第${this.episode}集`
  299. },
  300. topTitle() {
  301. return `第${this.episode}集`
  302. }
  303. },
  304. onReady: function(res) {
  305. // 将 isLoading 状态设置为 false,表示页面加载完成
  306. this.isLoading = false;
  307. this.videoContext = uni.createVideoContext('myVideo')
  308. },
  309. mounted() {
  310. getVideoInfo({
  311. video_id: this.video_id
  312. }).then(res => {
  313. // console.log(res, 'getVideoInfogetVideoInfogetVideoInfo')
  314. this.videoInfo = res.data
  315. this.initTabs();
  316. this.initSwiperData(this.swiperCurrent + 1)
  317. })
  318. },
  319. async onLoad(e) {
  320. // console.log('11111111111111111111',e)
  321. let that = this;
  322. uni.getSystemInfo({
  323. success(res) {
  324. that.top_height = res.statusBarHeight; //data中 声明 top_height:0
  325. }
  326. });
  327. if (e.video_id) {
  328. this.video_id = Number(e.video_id)
  329. }
  330. if (e.sequence && Number(e.sequence) > 0) {
  331. this.swiperCurrent = Number(e.sequence) - 1;
  332. }
  333. // 染色参数接收
  334. if (e.ranse_id && Number(e.ranse_id) > 0) {
  335. try {
  336. this.ranse_id = Number(e.ranse_id);
  337. let res = await userRanse(this.ranse_id);
  338. } catch (e) {
  339. console.log("player-errr:", e)
  340. }
  341. }
  342. uni.getSystemInfo({
  343. success: res => {
  344. this.safeArea = res.safeAreaInsets.bottom;
  345. if (this.safeArea > 0) {
  346. this.heightxw = 97
  347. }
  348. }
  349. })
  350. // #ifdef MP-TOUTIAO
  351. this.ttuop = 64
  352. // #endif
  353. this.windowWidth = uni.getSystemInfoSync().windowWidth
  354. this.windowHeight = uni.getSystemInfoSync().windowHeight - this.safeArea - this.ttuop
  355. console.log(this.windowHeight)
  356. },
  357. onShow() {
  358. },
  359. onShareAppMessage: function(res) {
  360. // #ifdef MP-WEIXIN
  361. var href = '/pages/video/index?video_id=' + this.video_id + "&"
  362. console.log(res)
  363. let that = this;
  364. const obj = {
  365. title: "发送给好友",
  366. imageUrl: '',
  367. path: href,
  368. success: function(res) {
  369. console.log(res, "转发成功")
  370. },
  371. fail: function(res) {
  372. wx.showToast({
  373. title: '发送失败',
  374. icon: 'none'
  375. })
  376. }
  377. }
  378. return obj
  379. // #endif
  380. },
  381. watch: {
  382. activeIndex: {
  383. handler(newVal, oldVal) {
  384. let index = this.labelList.findIndex(el => el.content.includes(newVal))
  385. console.log(index, 'newValnewVal', this.labelList, newVal)
  386. this.tabcurrent = index
  387. },
  388. }
  389. },
  390. onBackPress() {},
  391. methods: {
  392. closeOverlay() {
  393. this.centerShow = false
  394. // console.log('open');
  395. },
  396. bingewatch() {
  397. storeshelf(this.video_id).then(res => {
  398. this.videoInfo.is_binge_watch = !Boolean(this.videoInfo.is_binge_watch)
  399. uni.showToast({
  400. title: '追剧成功',
  401. duration: 1000,
  402. icon: 'none'
  403. });
  404. })
  405. },
  406. unBingewatch() {
  407. delShelf(this.video_id).then(res => {
  408. this.videoInfo.is_binge_watch = !Boolean(this.videoInfo.is_binge_watch)
  409. })
  410. },
  411. leftClick(e) {
  412. if (!this.videoInfo?.is_binge_watch) {
  413. uni.showModal({
  414. title: '加入追剧',
  415. content: '喜欢就加入追剧吧',
  416. confirmText: '加入追剧',
  417. confirmColor: '#FFA500',
  418. cancelText: '不用了',
  419. success: (res) => {
  420. if (res.confirm) {
  421. this.bingewatch()
  422. uni.switchTab({
  423. url: '/pages/index/index'
  424. });
  425. // 用户点击了确定按钮
  426. // 执行加入追剧的逻辑
  427. } else if (res.cancel) {
  428. // 用户点击了取消按钮
  429. // 执行取消逻辑
  430. uni.switchTab({
  431. url: '/pages/index/index'
  432. });
  433. }
  434. }
  435. });
  436. } else {
  437. uni.switchTab({
  438. url: '/pages/index/index'
  439. });
  440. // uni.navigateBack()
  441. }
  442. },
  443. myLike(like) {
  444. videoEpisodeZan({
  445. episode_id: this.currentVideoInfo.id,
  446. zan: like
  447. }).then(res => {
  448. this.$nextTick(() => {
  449. this.currentVideoInfo.is_zan = !Boolean(this.currentVideoInfo.is_zan)
  450. if (this.currentVideoInfo.is_zan) {
  451. this.currentVideoInfo.total_zan++
  452. } else {
  453. this.currentVideoInfo.total_zan--
  454. }
  455. })
  456. })
  457. },
  458. initTabs() {
  459. function innit(i, num) {
  460. let arr = [];
  461. for (i; i <= num; i++) {
  462. arr.push(i)
  463. }
  464. return arr
  465. }
  466. const pageSize = this.limitPage;
  467. const total = this.videoInfo.total_episode_num;
  468. const pageCount = Math.ceil(total / pageSize);
  469. for (let i = 0; i < pageCount; i++) {
  470. const start = i * pageSize + 1;
  471. const end = i === pageCount - 1 ? total : (i + 1) * pageSize;
  472. let label;
  473. if (i === pageCount - 1) {
  474. if (start === total) {
  475. label = `${total}`
  476. } else {
  477. label = `${start}-${total}`
  478. }
  479. } else {
  480. label = `${start}-${end}`
  481. }
  482. let index;
  483. if (label.split('-')[1]) {
  484. index = label.split('-')[1]
  485. } else {
  486. index = total
  487. }
  488. this.labelList.push({
  489. name: label,
  490. page: pageCount,
  491. content: innit(start, index)
  492. })
  493. }
  494. // let index = this.labelList.findIndex(el => el.content.includes(this.activeIndex))
  495. // this.tabcurrent = index
  496. },
  497. playVideo(item) {
  498. if (this.isShowVip(item)) {
  499. // this.fenji = 2
  500. this.swiperCurrent = item - 1;
  501. this.getPayInfo(item);
  502. // this.activeIndex = ''
  503. } else if (this.isShowUpdate(item)) {
  504. // this.activeIndex = ''
  505. this.centerShow = true
  506. // this.swiperCurrent = this.videoInfo.updated_episode_num + 1;
  507. // uni.showToast({
  508. // title: '剧集暂未更新',
  509. // duration: 500,
  510. // icon: 'none'
  511. // });
  512. } else {
  513. this.activeIndex = item;
  514. this.swiperCurrent = item - 1;
  515. this.episode = this.swiperCurrent
  516. // this.initSwiperData(item)
  517. this.down();
  518. }
  519. },
  520. labelListClick(item) {
  521. this.tabcurrent = item.index
  522. },
  523. share() {
  524. var href = '/pages/video/index?video_id=' + this.video_id
  525. // #ifdef H5
  526. uni.setClipboardData({
  527. data: this.urls + '/h5/#' + href,
  528. complete() {
  529. uni.showToast({
  530. title: "分享连接已复制到剪贴板"
  531. })
  532. }
  533. })
  534. // #endif
  535. // #ifndef H5
  536. uni.share({
  537. provider: "weixin",
  538. scene: "WXSenceTimeline",
  539. type: 0,
  540. href: href,
  541. title: '分享标题',
  542. summary: '分享总结',
  543. imageUrl: '',
  544. success: function(res) {
  545. console.log("success:" + JSON.stringify(res));
  546. },
  547. fail: function(err) {
  548. console.log("fail:" + JSON.stringify(err));
  549. }
  550. })
  551. // #endif
  552. },
  553. down() {
  554. this.$refs.select.close();
  555. },
  556. sellxj() {
  557. this.fenji = 1
  558. this.$refs.select.open('bottom');
  559. this.$nextTick(() => {
  560. let num1 = (this.windowHeight / 1.6) * 0.85;
  561. let num2 = num1 / 4.78;
  562. this.scrollTop = num2 * Number(this.k);
  563. })
  564. },
  565. tapVideoHover(index, pays) {
  566. this.videoContext.play()
  567. // this.$refs.select.open('bottom');
  568. },
  569. tapVides() {
  570. this.isqp = !this.isqp
  571. },
  572. ended() {
  573. //console.log('isplay----',this.isplay)
  574. // 1.播放当前视频结束时触发,自动切换下一个视频
  575. if (this.isplay) {
  576. if (this.displayIndex < 2) {
  577. this.current = this.displayIndex + 1
  578. } else {
  579. this.current = 0
  580. }
  581. this.isqp = true
  582. // console.log('显示swiper Index:', this.displayIndex)
  583. }
  584. },
  585. initSwiperData(originIndex) {
  586. this.episode = originIndex;
  587. this.isqp = true
  588. console.log(this.videoInfo.updated_episode_num, 'this.swiperCurrent', this.swiperCurrent)
  589. if (this.swiperList != this.swiperCurrent + 1) {
  590. videoEpisodePlay({
  591. video_id: this.video_id,
  592. sequence: originIndex,
  593. }).then(res => {
  594. if (res.code == 0) {
  595. this.currentVideoInfo = res.data
  596. this.activeIndex = this.episode;
  597. this.isShow = true
  598. this.down();
  599. } else if (res.code == 500101) {
  600. // console.log(this.currentVideoInfo, 'res.code == 500101res.code == 500101')
  601. this.currentVideoInfo.video_url = ""
  602. this.isShow = false
  603. this.isqp = false
  604. this.fenji = 2
  605. this.getPayInfo(originIndex);
  606. this.$refs.select.open('bottom');
  607. // this.currentVideoInfo = {}
  608. } else {
  609. this.isqp = false
  610. this.currentVideoInfo.video_url = ""
  611. this.isShow = false
  612. }
  613. // console.log(res, 'getVideoEpisodePlaygetVideoEpisodePlay')
  614. })
  615. } else {
  616. this.isqp = false
  617. this.centerShow = true
  618. this.currentVideoInfo.video_url = ""
  619. this.isShow = false
  620. }
  621. },
  622. /**
  623. * swiper滑动时候
  624. */
  625. swiperChange(event) {
  626. const {
  627. current
  628. } = event.detail;
  629. this.swiperCurrent = current
  630. // console.log(this.swiperCurrent, 'this.swiperCurrentthis.swiperCurrent')
  631. this.initSwiperData(current + 1)
  632. },
  633. controlstoggle(e) {
  634. // console.log(e.detail.show);
  635. },
  636. },
  637. };
  638. </script>
  639. <style lang="scss" scoped>
  640. @import "./style/index.scss"
  641. </style>