keynote.vue 14 KB

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