keynote.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. <template>
  2. <view >
  3. <view class="video_body">
  4. <view class="video_box">
  5. <image :src="$method.splitImgHost(detail.coverUrl)" style="width: 100%;height: 460rpx;"></image>
  6. </view>
  7. <view>
  8. <u-row >
  9. <u-col span="8" offset="1">
  10. <view class="video_t1">
  11. {{detail.name}}
  12. </view>
  13. </u-col>
  14. <u-col span="3">
  15. <view class="price_num">
  16. ¥{{detail.price}}
  17. </view>
  18. </u-col>
  19. </u-row>
  20. </view>
  21. <view>
  22. <u-tabs :list="list" font-size="24" bar-width="110" :current="current" @change="change" active-color="#32467B"></u-tabs>
  23. </view>
  24. <u-line color="#D6D6DB" />
  25. <view v-if="current==0">
  26. <!-- 重点考点介绍-->
  27. <view style="margin-top: 15rpx;">
  28. <u-row >
  29. <u-col span="9" >
  30. <view class="video_t2" style="display: flex;align-items: center;">
  31. <view class="top_line"></view>
  32. 重点考点介绍
  33. </view>
  34. </u-col>
  35. </u-row>
  36. <view class="text_box">
  37. <u-parse :html="detail.introduction"></u-parse>
  38. </view>
  39. </view>
  40. <u-line color="#D6D6DB" />
  41. </view>
  42. <!-- 出题名师-->
  43. <view v-if="current<=1">
  44. <view style="margin: 15rpx 0;">
  45. <u-row >
  46. <u-col span="8" >
  47. <view class="video_t2" style="display: flex;align-items: center;">
  48. <view class="top_line"></view>
  49. 出题名师
  50. </view>
  51. </u-col>
  52. </u-row>
  53. <view v-for="(item,index) in teacherList" :key="index">
  54. <u-row >
  55. <view style="margin: 25rpx;display: flex;">
  56. <view >
  57. <image :src="$method.splitImgHost(item.avatar)" class="teacher_img"></image>
  58. </view>
  59. <view class="teacher_t">
  60. {{item.introduce}}
  61. </view>
  62. </view>
  63. </u-row>
  64. </view>
  65. </view>
  66. <u-line color="#D6D6DB" />
  67. </view>
  68. <!-- 相关推荐-->
  69. <view style="margin: 15rpx 0;">
  70. <u-row >
  71. <u-col span="8" >
  72. <view class="video_t2" style="display: flex;align-items: center;">
  73. <view class="top_line"></view>
  74. 相关推荐
  75. </view>
  76. </u-col>
  77. </u-row>
  78. <view style="margin: 10rpx;">
  79. <view class="tj_box" v-for="(item,index) in recommendList" :key="index" @click="jumpDetail(item)">
  80. <image :src="$method.splitImgHost(item.coverUrl)" style="width: 320rpx;height: 160rpx;"></image>
  81. <view style="font-size: 24rpx;color: #666666;text-align: left;">
  82. {{item.name}}
  83. </view>
  84. <view>
  85. <u-row >
  86. <u-col span="6" >
  87. <view style="margin-left: 20rpx;">
  88. <image src="/static/people.png" style="width: 20rpx;height: 20rpx;"></image>
  89. <text style="color: #999999;font-size: 20rpx;margin-left: 10rpx;">2023</text>
  90. </view>
  91. </u-col>
  92. <u-col span="6" text-align="right">
  93. <text style="color: #E91313;font-size: 16rpx;margin-left: 8rpx;">
  94. 活动价
  95. </text>
  96. <text style="color: #E91313;font-size: 24rpx;font-weight: bold;">
  97. ¥{{item.price}}
  98. </text>
  99. </u-col>
  100. </u-row>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <view class="footer_tab">
  107. <u-line color="#D6D6DB" />
  108. <view style="height: 100%;display: flex;align-items: center;position: relative;">
  109. <view style="text-align: center;margin-left: 30rpx;" @click="favorites">
  110. <image :src="collecStatus ? '/static/star.png' : '/static/sc.png'" class="sc"></image>
  111. <view class="sc_t">收藏</view>
  112. </view>
  113. <view class="buy" v-if="payStatus === 0" @click="buyTK">
  114. 立即购买
  115. </view>
  116. <view class="buy" v-if="payStatus === 1" @click="jumpPay">
  117. 开始阅读
  118. </view>
  119. </view>
  120. </view>
  121. <u-popup v-model="showPricePop" mode="bottom" border-radius="14">
  122. <view class="topBox">
  123. <view class="firstTopL">
  124. <view class="imageBs"><image :src="$method.splitImgHost(detail.coverUrl)" mode=""></image></view>
  125. <view class="textBs">{{ detail.name }}</view>
  126. </view>
  127. <view class="boldFonstType">
  128. 类型:
  129. <span style="font-weight: bold;">{{ detail.categoryName }}</span>
  130. </view>
  131. <view class="priceBxs">
  132. <view class="pricleft">
  133. 活动价
  134. <span style="font-weight: bold;">¥{{ detail.price }}</span>
  135. </view>
  136. <view class="pricright" style="text-decoration: line-through;color: #666;">¥{{ detail.price }}</view>
  137. </view>
  138. </view>
  139. <view class="btnspric">
  140. <view class="lefprL">
  141. 实付:
  142. <span style="color: #E91313;">¥{{ prices }}</span>
  143. </view>
  144. <view class="lefprR" @click="getorder">提交订单</view>
  145. </view>
  146. </u-popup>
  147. </view>
  148. </template>
  149. <script>
  150. export default {
  151. data() {
  152. return {
  153. list: [{
  154. name: '重点考点介绍'
  155. }, {
  156. name: '出题名师',
  157. }, {
  158. name: '相关推荐',
  159. }],
  160. current: 0,
  161. id:0,
  162. detail:{},
  163. teacherList:[],
  164. recommendList:[],
  165. showPricePop: false, //购买详情弹窗
  166. newDate: 0, //现在时间戳
  167. prices: 0, //实付
  168. payStatus: 0,//是否已购买
  169. collecStatus: false,
  170. }
  171. },
  172. onLoad(option) {
  173. this.id = option.id
  174. this.getDetail()
  175. this.noteRecommendList({fileId:this.id})
  176. this.getHaveThis()
  177. },
  178. onShow(){
  179. if (!uni.getStorageSync('union_id') && this.$store.state.token === '') {
  180. } else {
  181. this.favoritesStatus();
  182. }
  183. },
  184. methods: {
  185. favoritesStatus() {
  186. this.$api.noteCollects(this.id).then(result => {
  187. if (result.data.data === undefined) {
  188. this.collecStatus = false;
  189. } else {
  190. this.collecStatus = true;
  191. }
  192. });
  193. },
  194. //收藏
  195. favorites() {
  196. var self = this;
  197. if (!uni.getStorageSync('union_id') && this.$store.state.token === '') {
  198. uni.navigateTo({
  199. url: '/pages/login/login'
  200. });
  201. } else {
  202. if (this.collecStatus) {
  203. this.$api.noteCollects(self.id).then(results => {
  204. self.$api.noteCollectdelete(results.data.data.collectNoteId).then(resz => {
  205. self.favoritesStatus();
  206. });
  207. });
  208. } else {
  209. var data = {
  210. userId: this.$store.state.userInfo.userId,
  211. fileId: self.id
  212. };
  213. this.$api.noteCollectsadd(data).then(res => {
  214. self.favoritesStatus();
  215. });
  216. }
  217. }
  218. },
  219. //检测是否已购买该课程
  220. getHaveThis(){
  221. var self = this
  222. var data = {
  223. possessId: this.id,
  224. typeId: 3
  225. }
  226. if (this.$method.isLogin()) {
  227. this.$api.systemuserowner(data).then(res => {
  228. if(res.data.code === 200){
  229. self.payStatus = res.data.data.payStatus
  230. }
  231. })
  232. }
  233. },
  234. //提交订单
  235. getorder(){
  236. var self = this
  237. var data = {
  238. goodsList: [{
  239. goodsId: self.detail.fileId,
  240. num: 1,
  241. goodsType: 3
  242. }]
  243. }
  244. self.$api.order(data).then(res => {
  245. if(res.data.code === 200){
  246. let objarr = res.data.data
  247. wx.requestPayment({
  248. timeStamp: objarr.timeStamp,
  249. nonceStr: objarr.nonceStr,
  250. package: objarr.package,
  251. signType: objarr.signType,
  252. paySign: objarr.sign,
  253. success (result) {
  254. uni.showModal({
  255. title: '提示',
  256. content: '支付成功',
  257. showCancel: false,
  258. success: function (resst) {
  259. if(resst.confirm){
  260. self.showPricePop = false
  261. self.getHaveThis()
  262. }
  263. }
  264. });
  265. },
  266. fail (err){
  267. uni.showModal({
  268. title: '提示',
  269. content: '支付失败',
  270. showCancel: false,
  271. success: function (resst) {
  272. self.showPricePop = false
  273. self.getHaveThis()
  274. }
  275. });
  276. }
  277. })
  278. }
  279. })
  280. },
  281. //购买题库
  282. buyTK(){
  283. var self = this;
  284. uni.getStorage({
  285. key: 'union_id',
  286. success: function(res) {
  287. // 继续操作
  288. self.showPricePop = true;
  289. },
  290. fail: function(err) {
  291. //重新登入
  292. self.$navTo.togo('/pages/login/login', {});
  293. }
  294. });
  295. },
  296. jumpDetail(item) {
  297. this.$navTo.togo('/pages2/course/keynote', {
  298. id:item.fileId
  299. });
  300. },
  301. getDetail(){
  302. let self = this
  303. this.$api.noteInfo(this.id).then(res => {
  304. self.detail = res.data.data
  305. self.prices = res.data.data.price
  306. if(self.detail.teacherIds&&self.detail.teacherIds!=''){
  307. let param = {
  308. teacherIds : self.detail.teacherIds
  309. }
  310. self.getTeacherList(param);
  311. }
  312. })
  313. },
  314. getTeacherList(param){
  315. let self = this
  316. this.$api.teacherList(param).then(res => {
  317. self.teacherList = res.data.rows
  318. })
  319. },
  320. noteRecommendList(param){
  321. let self = this
  322. this.$api.noteRecommendList(param).then(res => {
  323. self.recommendList = res.data.data
  324. })
  325. },
  326. change(index) {
  327. this.current = index;
  328. },
  329. jumpPay(){
  330. this.$navTo.togo('/pages2/payment/payment', {})
  331. },
  332. jumpRead(){
  333. if(!this.$method.isLogin()){
  334. this.$navTo.togo('/pages/login/login');
  335. }else{
  336. let url = this.$method.splitImgHost(this.detail.fileUrls)
  337. console.log(url)
  338. uni.downloadFile({
  339. url:url,
  340. success(res){
  341. console.log(res)
  342. let data = res.tempFilePath;
  343. uni.openDocument({
  344. filePath:data,
  345. fileType:'pdf'
  346. })
  347. }
  348. })
  349. // this.$navTo.togo('/pages2/payment/payment', {})
  350. // this.$navTo.togo('/pages2/course/read', {})
  351. }
  352. }
  353. },
  354. }
  355. </script>
  356. <style>
  357. ::-webkit-scrollbar{
  358. width: 0;
  359. height: 0;
  360. color: transparent;
  361. }
  362. </style>
  363. <style scope>
  364. .btnspric {
  365. border-top: 1rpx solid #eee;
  366. display: flex;
  367. align-items: center;
  368. justify-content: space-between;
  369. height: 108rpx;
  370. padding-left: 43rpx;
  371. padding-right: 32rpx;
  372. }
  373. .btnspric > .lefprL {
  374. font-size: 36rpx;
  375. color: #0c141f;
  376. font-weight: bold;
  377. }
  378. .btnspric > .lefprR {
  379. padding: 0rpx 24rpx;
  380. height: 60rpx;
  381. line-height: 60rpx;
  382. text-align: center;
  383. color: #fff;
  384. background: #32467b;
  385. border-radius: 24rpx;
  386. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  387. }
  388. .yhj,
  389. .hdyhj {
  390. padding: 24rpx 29rpx 24rpx 34rpx;
  391. }
  392. .yhj {
  393. border-bottom: 16rpx solid #f9f9f9;
  394. }
  395. .yhjtit {
  396. font-size: 30rpx;
  397. color: #0c141f;
  398. font-weight: 500;
  399. margin-bottom: 14rpx;
  400. }
  401. .yhjList {
  402. display: flex;
  403. align-items: center;
  404. justify-content: space-between;
  405. margin-bottom: 14rpx;
  406. }
  407. .yhjList > .yhjLefts {
  408. display: flex;
  409. align-items: center;
  410. }
  411. .yhjLefts > .yhl {
  412. color: #32467b;
  413. font-size: 30rpx;
  414. margin-right: 31rpx;
  415. }
  416. .yhjLefts > .yhbq {
  417. font-size: 24rpx;
  418. color: #ff9500;
  419. border-radius: 18rpx;
  420. background-color: rgba(255, 149, 0, 0.2);
  421. border: 2rpx solid #ff9500;
  422. height: 38rpx;
  423. line-height: 38rpx;
  424. padding: 0rpx 16rpx;
  425. }
  426. .ts {
  427. font-size: 24rpx;
  428. color: #999;
  429. margin: 14rpx 0rpx;
  430. padding-right: 29rpx;
  431. padding-left: 34rpx;
  432. }
  433. .yh {
  434. padding-top: 20rpx;
  435. }
  436. .yh > .yhtitle {
  437. display: flex;
  438. align-items: center;
  439. justify-content: space-between;
  440. padding-right: 29rpx;
  441. padding-left: 34rpx;
  442. }
  443. .priceBxs {
  444. display: flex;
  445. align-items: center;
  446. }
  447. .priceBxs > .pricleft {
  448. border-radius: 24rpx;
  449. border: 1rpx solid #e91313;
  450. background-color: rgba(233, 19, 19, 0.1);
  451. padding: 0rpx 18rpx;
  452. height: 49rpx;
  453. line-height: 49rpx;
  454. text-align: center;
  455. font-size: 30rpx;
  456. font-weight: 500;
  457. color: #e91313;
  458. margin-right: 13rpx;
  459. }
  460. .topBox {
  461. padding: 32rpx 32rpx 24rpx;
  462. border-bottom: 1rpx solid #eeeeee;
  463. }
  464. .topBox > .boldFonstType {
  465. font-weight: 500;
  466. font-size: 30rpx;
  467. margin: 16rpx 0rpx 23rpx;
  468. }
  469. .topBox > .firstTopL {
  470. display: flex;
  471. align-items: center;
  472. }
  473. .topBox > .firstTopL > .imageBs {
  474. width: 331rpx;
  475. height: 160rpx;
  476. border-radius: 6rpx;
  477. overflow: hidden;
  478. margin-right: 8rpx;
  479. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  480. }
  481. .topBox > .firstTopL > .imageBs > image {
  482. width: 100%;
  483. height: 100%;
  484. }
  485. .topBox > .firstTopL > .textBs {
  486. font-size: 30rpx;
  487. font-weight: bold;
  488. color: #0c141f;
  489. }
  490. .text_box{
  491. font-size: 24rpx;
  492. font-family: PingFang SC;
  493. font-weight: 400;
  494. color: #666666;
  495. line-height: 36rpx;
  496. padding: 20rpx;
  497. }
  498. .price_num{
  499. font-size: 24rpx;
  500. font-family: PingFang SC;
  501. font-weight: bold;
  502. color: #E91313;
  503. }
  504. .price_t2{
  505. font-size: 18rpx;
  506. font-family: PingFang SC;
  507. font-weight: 500;
  508. text-decoration: line-through;
  509. color: #999999;
  510. }
  511. .price_t1{
  512. font-size: 33rpx;
  513. font-family: PingFang SC;
  514. font-weight: bold;
  515. color: #E91313;
  516. }
  517. .sc_t{
  518. font-size: 22rpx;
  519. color: #000000;
  520. }
  521. .sc{
  522. width: 29rpx ;
  523. height: 29rpx;
  524. }
  525. .buy{
  526. width: 138rpx;
  527. height: 48rpx;
  528. line-height: 48rpx;
  529. background: #32467B;
  530. border-radius: 10rpx;
  531. color: #FFFFFF;
  532. font-size: 28rpx;
  533. text-align: center;
  534. vertical-align: middle;
  535. position: absolute;
  536. right: 30rpx;
  537. }
  538. .video_body{
  539. padding-bottom: 96rpx;
  540. }
  541. .footer_tab{
  542. position:fixed;
  543. bottom:0;
  544. height: 96rpx;
  545. width: 100%;
  546. background-color: #FFFFFF;
  547. }
  548. .tj_box{
  549. width: 50%;
  550. display: inline-block;
  551. text-align: center;
  552. margin: 10rpx 0;
  553. }
  554. .teacher_t{
  555. font-size: 24rpx;
  556. font-family: PingFang SC;
  557. font-weight: 400;
  558. color: #666666;
  559. line-height: 36rpx;
  560. margin-left: 15rpx;
  561. }
  562. .teacher_img{
  563. width: 87rpx;
  564. height: 129rpx;
  565. }
  566. .t2{
  567. font-size: 24rpx;
  568. font-family: PingFang SC;
  569. color: #666666;
  570. line-height: 36rpx;
  571. margin: 15rpx;
  572. }
  573. .r_t2{
  574. width: 201rpx;
  575. height: 49rpx;
  576. background: rgba(22, 119, 255, 0.05);
  577. border: 1rpx solid #32467B;
  578. border-radius: 16rpx;
  579. color: #666666;
  580. font-size: 23rpx;
  581. text-align: center;
  582. display: flex;
  583. align-items: center;
  584. padding: 5rpx;
  585. }
  586. .scroll_box{
  587. width: 100%;
  588. height: 60rpx;
  589. background: #FFFFFF;
  590. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  591. white-space:nowrap;
  592. overflow: hidden;
  593. margin: 15rpx 0;
  594. }
  595. .r_sliper{
  596. padding: 0 20rpx;
  597. }
  598. .top_line{
  599. width: 6rpx;
  600. height: 22rpx;
  601. background: #32467B;
  602. margin-right: 10rpx;
  603. }
  604. .video_t2{
  605. font-size: 24rpx;
  606. font-family: PingFang SC;
  607. font-weight: 500;
  608. color: #666666;
  609. }
  610. .video_t1{
  611. font-size: 28rpx;
  612. font-family: PingFang SC;
  613. font-weight: bold;
  614. color: #333333;
  615. }
  616. .video_play{
  617. position:absolute;
  618. width: 95rpx;
  619. height: 95rpx;
  620. top:0;
  621. left:0;
  622. right:0;
  623. bottom:0;
  624. margin:auto;
  625. }
  626. .video_box{
  627. position: relative;
  628. }
  629. page {
  630. background: #FFFFFF;
  631. }
  632. </style>