index.nvue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927
  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. is_first_pay:item.is_first_pay,
  469. }
  470. let res = await getPayInfo(params);
  471. if (res) {
  472. // #ifdef MP-WEIXIN
  473. this.wxMinPay(res);
  474. // #endif
  475. }
  476. },wxMinPay(param){
  477. wx.requestPayment({
  478. timeStamp: param.timeStamp,
  479. nonceStr: param.nonceStr,
  480. package: param.package,
  481. signType: param.signType,
  482. paySign: param.paySign,
  483. success (res) {
  484. this.pay_success = true;
  485. uni.showToast({ title: '支付成功',icon:"none" });
  486. // console.log('success:' + JSON.stringify(res));
  487. },
  488. fail (e) {
  489. if(e.errMsg == "requestPayment:fail cancel"){
  490. uni.showToast({ title: '取消支付',icon:"none" });
  491. }else{
  492. uni.showToast({ title: '支付失败',icon:"none" });
  493. }
  494. }
  495. })
  496. },
  497. playTest(item) {
  498. console.log(item)
  499. if (this.isShowVip(item)) {
  500. console.log('111111111111111', item)
  501. this.fenji = 2
  502. this.getPayInfo(item);
  503. this.activeIndex = ''
  504. } else if (this.isShowUpdate(item)) {
  505. this.activeIndex = ''
  506. uni.showToast({
  507. title: '剧集暂未更新',
  508. duration: 1000,
  509. icon: 'none'
  510. });
  511. } else {
  512. this.activeIndex = item;
  513. this.swiperCurrent = item - 1;
  514. this.episode = this.swiperCurrent
  515. // this.initSwiperData(item)
  516. this.down();
  517. }
  518. },
  519. labelListClick(item) {
  520. this.tabcurrent = item.index
  521. console.log('itemitemitemitemitem', item);
  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. videoEpisodePlay({
  589. video_id: this.video_id,
  590. sequence: originIndex,
  591. }).then(res => {
  592. if (res.code == 0) {
  593. this.currentVideoInfo = res.data
  594. this.activeIndex = this.episode;
  595. this.isShow = true
  596. } else if (res.code == 500101) {
  597. console.log(this.currentVideoInfo, 'res.code == 500101res.code == 500101')
  598. this.currentVideoInfo.video_url = ""
  599. this.isShow = false
  600. this.isqp = false
  601. this.fenji = 2
  602. this.getPayInfo(originIndex);
  603. this.$refs.select.open('bottom');
  604. // this.currentVideoInfo = {}
  605. } else {
  606. this.isqp = false
  607. this.currentVideoInfo.video_url = ""
  608. this.isShow = false
  609. }
  610. console.log(res, 'getVideoEpisodePlaygetVideoEpisodePlay')
  611. })
  612. },
  613. /**
  614. * swiper滑动时候
  615. */
  616. swiperChange(event) {
  617. const {
  618. current
  619. } = event.detail;
  620. this.swiperCurrent = current
  621. console.log(this.swiperCurrent, 'this.swiperCurrentthis.swiperCurrent')
  622. this.initSwiperData(current + 1)
  623. },
  624. controlstoggle(e) {
  625. console.log(e.detail.show);
  626. },
  627. },
  628. };
  629. </script>
  630. <style lang="scss" scoped>
  631. .vip-center {
  632. display: flex;
  633. flex-direction: row;
  634. justify-content: space-between;
  635. align-items: center;
  636. }
  637. .vip-level-icon {
  638. margin-right: 10rpx;
  639. width: 80px;
  640. height: 30px;
  641. }
  642. .pay-box {
  643. background-color: #fff;
  644. display: flex;
  645. justify-content: space-between;
  646. flex-direction: row;
  647. padding: 0 20px;
  648. flex-wrap: wrap;
  649. }
  650. .top-lab {
  651. width: 40px;
  652. text-align: center;
  653. background-color: #ff5722;
  654. color: #fff;
  655. float: right;
  656. border-top: none;
  657. border-radius: 10px;
  658. }
  659. .pay-box-items {
  660. margin-top: 10px;
  661. width: 48%;
  662. flex-direction: column;
  663. border-radius: 10px;
  664. line-height: 25px;
  665. overflow: hidden;
  666. }
  667. .pay-box-items-txt {
  668. padding: 1rpx 13px;
  669. }
  670. .pay-box-items view text {
  671. line-height: 25px;
  672. }
  673. .pay-select {
  674. border: solid 1px #ff5722;
  675. }
  676. .select-text {
  677. background-color: #ff5722;
  678. color: #fff;
  679. height: 30px;
  680. border-radius: 0rpx 0rpx 10rpx 10rpx;
  681. }
  682. .given-txt {
  683. height: 30px;
  684. border-top: solid 1rpx #9e9e9e1f;
  685. }
  686. .content {
  687. background: #000000;
  688. }
  689. .userInfo {
  690. position: absolute;
  691. z-index: 99;
  692. bottom: 30%;
  693. right: 10px;
  694. width: 100rpx;
  695. text-align: center;
  696. flex-direction: column;
  697. }
  698. .contentcd {
  699. background-color: rgba(255, 255, 255, .3);
  700. width: 720rpx;
  701. z-index: 99;
  702. position: absolute;
  703. bottom: 70rpx;
  704. left: 50%;
  705. transform: translateX(-50%);
  706. padding: 15rpx;
  707. border-radius: 8px;
  708. display: flex;
  709. flex-direction: row;
  710. justify-content: flex-start;
  711. align-items: center;
  712. color: #ffffff;
  713. margin: 0 auto;
  714. }
  715. .userName {
  716. color: #fff;
  717. font-size: 30rpx;
  718. color: #ffffff;
  719. margin: 0 6rpx;
  720. }
  721. .tsvideo {
  722. animation: showDivAni 2s 1;
  723. }
  724. @keyframes showDivAni {
  725. 0% {
  726. opacity: 0;
  727. }
  728. 100% {
  729. opacity: 1;
  730. }
  731. }
  732. </style>
  733. <style lang="scss" scoped>
  734. .charge-wrapper {
  735. margin-top: 15px;
  736. width: 100%;
  737. .top {
  738. width: 100%;
  739. display: flex;
  740. align-items: center;
  741. .charge-title {
  742. font-size: 18px;
  743. font-weight: bold;
  744. }
  745. .charge-info {
  746. font-size: 15px;
  747. color: #868686;
  748. margin: 8px 0;
  749. }
  750. .charge-coin {
  751. display: flex;
  752. flex-direction: row;
  753. .ji {
  754. font-size: 18px;
  755. }
  756. .bi {
  757. font-size: 18px;
  758. color: $accent-color;
  759. }
  760. }
  761. }
  762. }
  763. .down {
  764. display: flex;
  765. flex-direction: row;
  766. width: 60px;
  767. height: 30px;
  768. margin-top: 5px;
  769. position: absolute;
  770. right: 0px;
  771. top: 50%;
  772. transform: translateY(-50%);
  773. .down-text {
  774. font-size: 16px;
  775. color: #000;
  776. }
  777. .down-img {
  778. width: 35rpx;
  779. height: 35rpx;
  780. object-fit: contain;
  781. }
  782. }
  783. .ju-top {
  784. // background-color: ;
  785. .ju-top-title {
  786. font-size: 16px;
  787. font-weight: bold;
  788. color: #000;
  789. margin-top: 9px;
  790. height: 22px;
  791. margin-left: 20px;
  792. // width: '+ (windowWidth*0.6) +' px;
  793. overflow: hidden;
  794. }
  795. .ju-top-update {
  796. font-size: 12px;
  797. color: #000;
  798. margin-top: 9px;
  799. height: 22px;
  800. margin-left: 20px;
  801. }
  802. }
  803. .pop-my {
  804. background-color: #FFFFFF;
  805. }
  806. .scroll-my {
  807. height: fit-content;
  808. }
  809. .scroll-charge {
  810. height: 50vh;
  811. }
  812. .ju-wrapper {
  813. display: flex;
  814. flex-direction: row;
  815. flex-wrap: wrap;
  816. align-items: center;
  817. justify-content: start;
  818. width: 100%;
  819. height: 100%;
  820. background-color: #FFFFFF;
  821. // margin: 6rpx;
  822. .ju-content.active {
  823. background-color: #ff7f02;
  824. }
  825. .ju-content {
  826. flex-grow: 1;
  827. position: relative;
  828. border-radius: 12rpx;
  829. background-color: #f6f6f6;
  830. width: 31%;
  831. height: 25rpx;
  832. align-items: center;
  833. justify-content: center;
  834. padding: 45rpx 68rpx;
  835. margin: 6rpx;
  836. .lock-wrapper,
  837. .lock-wrapper-no {
  838. position: absolute;
  839. width: 100%;
  840. height: 100%;
  841. border-radius: 12rpx;
  842. background-color: rgba(0, 0, 0, .3);
  843. .lock-img {
  844. position: absolute;
  845. left: 3rpx;
  846. top: 50%;
  847. transform: translateY(-50%);
  848. width: 50rpx;
  849. height: 50rpx;
  850. margin-left: 20rpx;
  851. }
  852. .update-title {
  853. width: fit-content;
  854. height: fit-content;
  855. border-radius: 8rpx;
  856. font-size: 10px;
  857. padding: 6rpx;
  858. background-color: #868686;
  859. color: #fff;
  860. }
  861. }
  862. .lock-wrapper-no {
  863. background-color: #f6f6f6;
  864. }
  865. .title {
  866. font-size: 16px;
  867. }
  868. }
  869. }
  870. .utabs-top /deep/ .u-tabs {
  871. align-items: flex-start;
  872. }
  873. </style>