keynote.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  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. this.$api.systemuserowner(data).then(res => {
  227. if(res.data.code === 200){
  228. self.payStatus = res.data.data.payStatus
  229. }
  230. })
  231. },
  232. //提交订单
  233. getorder(){
  234. var self = this
  235. var data = {
  236. goodsList: [{
  237. goodsId: self.detail.fileId,
  238. num: 1,
  239. goodsType: 3
  240. }]
  241. }
  242. self.$api.order(data).then(res => {
  243. if(res.data.code === 200){
  244. let objarr = res.data.data
  245. wx.requestPayment({
  246. timeStamp: objarr.timeStamp,
  247. nonceStr: objarr.nonceStr,
  248. package: objarr.package,
  249. signType: objarr.signType,
  250. paySign: objarr.sign,
  251. success (result) {
  252. uni.showModal({
  253. title: '提示',
  254. content: '支付成功',
  255. showCancel: false,
  256. success: function (resst) {
  257. if(resst.confirm){
  258. self.showPricePop = false
  259. self.getHaveThis()
  260. }
  261. }
  262. });
  263. },
  264. fail (err){
  265. uni.showModal({
  266. title: '提示',
  267. content: '支付失败',
  268. showCancel: false,
  269. success: function (resst) {
  270. self.showPricePop = false
  271. self.getHaveThis()
  272. }
  273. });
  274. }
  275. })
  276. }
  277. })
  278. },
  279. //购买题库
  280. buyTK(){
  281. var self = this;
  282. uni.getStorage({
  283. key: 'union_id',
  284. success: function(res) {
  285. // 继续操作
  286. self.showPricePop = true;
  287. },
  288. fail: function(err) {
  289. //重新登入
  290. self.$navTo.togo('/pages/login/login', {});
  291. }
  292. });
  293. },
  294. jumpDetail(item) {
  295. this.$navTo.togo('/pages2/course/keynote', {
  296. id:item.fileId
  297. });
  298. },
  299. getDetail(){
  300. let self = this
  301. this.$api.noteInfo(this.id).then(res => {
  302. self.detail = res.data.data
  303. self.prices = res.data.data.price
  304. if(self.detail.teacherIds&&self.detail.teacherIds!=''){
  305. let param = {
  306. teacherIds : self.detail.teacherIds
  307. }
  308. self.getTeacherList(param);
  309. }
  310. })
  311. },
  312. getTeacherList(param){
  313. let self = this
  314. this.$api.teacherList(param).then(res => {
  315. self.teacherList = res.data.rows
  316. })
  317. },
  318. noteRecommendList(param){
  319. let self = this
  320. this.$api.noteRecommendList(param).then(res => {
  321. self.recommendList = res.data.data
  322. })
  323. },
  324. change(index) {
  325. this.current = index;
  326. },
  327. jumpPay(){
  328. this.$navTo.togo('/pages2/payment/payment', {})
  329. },
  330. jumpRead(){
  331. if(!this.$method.isLogin()){
  332. this.$navTo.togo('/pages/login/login');
  333. }else{
  334. let url = this.$method.splitImgHost(this.detail.fileUrls)
  335. console.log(url)
  336. uni.downloadFile({
  337. url:url,
  338. success(res){
  339. console.log(res)
  340. let data = res.tempFilePath;
  341. uni.openDocument({
  342. filePath:data,
  343. fileType:'pdf'
  344. })
  345. }
  346. })
  347. // this.$navTo.togo('/pages2/payment/payment', {})
  348. // this.$navTo.togo('/pages2/course/read', {})
  349. }
  350. }
  351. },
  352. }
  353. </script>
  354. <style>
  355. ::-webkit-scrollbar{
  356. width: 0;
  357. height: 0;
  358. color: transparent;
  359. }
  360. </style>
  361. <style scope>
  362. .btnspric {
  363. border-top: 1rpx solid #eee;
  364. display: flex;
  365. align-items: center;
  366. justify-content: space-between;
  367. height: 108rpx;
  368. padding-left: 43rpx;
  369. padding-right: 32rpx;
  370. }
  371. .btnspric > .lefprL {
  372. font-size: 36rpx;
  373. color: #0c141f;
  374. font-weight: bold;
  375. }
  376. .btnspric > .lefprR {
  377. padding: 0rpx 24rpx;
  378. height: 60rpx;
  379. line-height: 60rpx;
  380. text-align: center;
  381. color: #fff;
  382. background: #32467b;
  383. border-radius: 24rpx;
  384. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  385. }
  386. .yhj,
  387. .hdyhj {
  388. padding: 24rpx 29rpx 24rpx 34rpx;
  389. }
  390. .yhj {
  391. border-bottom: 16rpx solid #f9f9f9;
  392. }
  393. .yhjtit {
  394. font-size: 30rpx;
  395. color: #0c141f;
  396. font-weight: 500;
  397. margin-bottom: 14rpx;
  398. }
  399. .yhjList {
  400. display: flex;
  401. align-items: center;
  402. justify-content: space-between;
  403. margin-bottom: 14rpx;
  404. }
  405. .yhjList > .yhjLefts {
  406. display: flex;
  407. align-items: center;
  408. }
  409. .yhjLefts > .yhl {
  410. color: #32467b;
  411. font-size: 30rpx;
  412. margin-right: 31rpx;
  413. }
  414. .yhjLefts > .yhbq {
  415. font-size: 24rpx;
  416. color: #ff9500;
  417. border-radius: 18rpx;
  418. background-color: rgba(255, 149, 0, 0.2);
  419. border: 2rpx solid #ff9500;
  420. height: 38rpx;
  421. line-height: 38rpx;
  422. padding: 0rpx 16rpx;
  423. }
  424. .ts {
  425. font-size: 24rpx;
  426. color: #999;
  427. margin: 14rpx 0rpx;
  428. padding-right: 29rpx;
  429. padding-left: 34rpx;
  430. }
  431. .yh {
  432. padding-top: 20rpx;
  433. }
  434. .yh > .yhtitle {
  435. display: flex;
  436. align-items: center;
  437. justify-content: space-between;
  438. padding-right: 29rpx;
  439. padding-left: 34rpx;
  440. }
  441. .priceBxs {
  442. display: flex;
  443. align-items: center;
  444. }
  445. .priceBxs > .pricleft {
  446. border-radius: 24rpx;
  447. border: 1rpx solid #e91313;
  448. background-color: rgba(233, 19, 19, 0.1);
  449. padding: 0rpx 18rpx;
  450. height: 49rpx;
  451. line-height: 49rpx;
  452. text-align: center;
  453. font-size: 30rpx;
  454. font-weight: 500;
  455. color: #e91313;
  456. margin-right: 13rpx;
  457. }
  458. .topBox {
  459. padding: 32rpx 32rpx 24rpx;
  460. border-bottom: 1rpx solid #eeeeee;
  461. }
  462. .topBox > .boldFonstType {
  463. font-weight: 500;
  464. font-size: 30rpx;
  465. margin: 16rpx 0rpx 23rpx;
  466. }
  467. .topBox > .firstTopL {
  468. display: flex;
  469. align-items: center;
  470. }
  471. .topBox > .firstTopL > .imageBs {
  472. width: 331rpx;
  473. height: 160rpx;
  474. border-radius: 6rpx;
  475. overflow: hidden;
  476. margin-right: 8rpx;
  477. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  478. }
  479. .topBox > .firstTopL > .imageBs > image {
  480. width: 100%;
  481. height: 100%;
  482. }
  483. .topBox > .firstTopL > .textBs {
  484. font-size: 30rpx;
  485. font-weight: bold;
  486. color: #0c141f;
  487. }
  488. .text_box{
  489. font-size: 24rpx;
  490. font-family: PingFang SC;
  491. font-weight: 400;
  492. color: #666666;
  493. line-height: 36rpx;
  494. padding: 20rpx;
  495. }
  496. .price_num{
  497. font-size: 24rpx;
  498. font-family: PingFang SC;
  499. font-weight: bold;
  500. color: #E91313;
  501. }
  502. .price_t2{
  503. font-size: 18rpx;
  504. font-family: PingFang SC;
  505. font-weight: 500;
  506. text-decoration: line-through;
  507. color: #999999;
  508. }
  509. .price_t1{
  510. font-size: 33rpx;
  511. font-family: PingFang SC;
  512. font-weight: bold;
  513. color: #E91313;
  514. }
  515. .sc_t{
  516. font-size: 22rpx;
  517. color: #000000;
  518. }
  519. .sc{
  520. width: 29rpx ;
  521. height: 29rpx;
  522. }
  523. .buy{
  524. width: 138rpx;
  525. height: 48rpx;
  526. line-height: 48rpx;
  527. background: #32467B;
  528. border-radius: 10rpx;
  529. color: #FFFFFF;
  530. font-size: 28rpx;
  531. text-align: center;
  532. vertical-align: middle;
  533. position: absolute;
  534. right: 30rpx;
  535. }
  536. .video_body{
  537. padding-bottom: 96rpx;
  538. }
  539. .footer_tab{
  540. position:fixed;
  541. bottom:0;
  542. height: 96rpx;
  543. width: 100%;
  544. background-color: #FFFFFF;
  545. }
  546. .tj_box{
  547. width: 50%;
  548. display: inline-block;
  549. text-align: center;
  550. margin: 10rpx 0;
  551. }
  552. .teacher_t{
  553. font-size: 24rpx;
  554. font-family: PingFang SC;
  555. font-weight: 400;
  556. color: #666666;
  557. line-height: 36rpx;
  558. margin-left: 15rpx;
  559. }
  560. .teacher_img{
  561. width: 87rpx;
  562. height: 129rpx;
  563. }
  564. .t2{
  565. font-size: 24rpx;
  566. font-family: PingFang SC;
  567. color: #666666;
  568. line-height: 36rpx;
  569. margin: 15rpx;
  570. }
  571. .r_t2{
  572. width: 201rpx;
  573. height: 49rpx;
  574. background: rgba(22, 119, 255, 0.05);
  575. border: 1rpx solid #32467B;
  576. border-radius: 16rpx;
  577. color: #666666;
  578. font-size: 23rpx;
  579. text-align: center;
  580. display: flex;
  581. align-items: center;
  582. padding: 5rpx;
  583. }
  584. .scroll_box{
  585. width: 100%;
  586. height: 60rpx;
  587. background: #FFFFFF;
  588. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  589. white-space:nowrap;
  590. overflow: hidden;
  591. margin: 15rpx 0;
  592. }
  593. .r_sliper{
  594. padding: 0 20rpx;
  595. }
  596. .top_line{
  597. width: 6rpx;
  598. height: 22rpx;
  599. background: #32467B;
  600. margin-right: 10rpx;
  601. }
  602. .video_t2{
  603. font-size: 24rpx;
  604. font-family: PingFang SC;
  605. font-weight: 500;
  606. color: #666666;
  607. }
  608. .video_t1{
  609. font-size: 28rpx;
  610. font-family: PingFang SC;
  611. font-weight: bold;
  612. color: #333333;
  613. }
  614. .video_play{
  615. position:absolute;
  616. width: 95rpx;
  617. height: 95rpx;
  618. top:0;
  619. left:0;
  620. right:0;
  621. bottom:0;
  622. margin:auto;
  623. }
  624. .video_box{
  625. position: relative;
  626. }
  627. page {
  628. background: #FFFFFF;
  629. }
  630. </style>