coursePay.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view class="container">
  3. <view class="pay-content">
  4. <image :src="`${FILE_URL}/edu-icon/pay.png`" class="pay-img"></image>
  5. <text class="pay-text">支付成功</text>
  6. <button class="play-btn" @click="toWatch">点击观看</button>
  7. </view>
  8. <view class="pay-member" v-if="!isMember" @click="toJoin">
  9. <text>个人会员或单位会员免费,点击现在入会></text>
  10. </view>
  11. </view>
  12. </template>
  13. <script setup>
  14. import { ref } from 'vue'
  15. import { onLoad } from '@dcloudio/uni-app'
  16. import configService from '@/utils/baseurl.js'
  17. const FILE_URL = configService.FILE_URL;
  18. import {
  19. useAuthStore
  20. } from '@/store/authStore'
  21. const authStore = useAuthStore();
  22. const isMember = computed(() => {
  23. authStore.loadUserInfo()
  24. return authStore.userInfo.isMember == '0' ? false : true
  25. })
  26. const toJoin = () =>{
  27. uni.navigateTo({
  28. url: '/pages/joinClub/joinClub'
  29. })
  30. }
  31. const courseId = ref("");
  32. const toWatch = () => {
  33. // uni.redirectTo({
  34. // url:"/pages/goOnEdu/course/courseDetail/courseDetail?id=" + courseId.value
  35. // })
  36. uni.navigateBack({
  37. delta: 1
  38. });
  39. }
  40. onLoad((option) => {
  41. const { id } = option
  42. courseId.value = id
  43. console.log('onLoad')
  44. })
  45. </script>
  46. <style lang="scss" scoped>
  47. .container {
  48. height: 100vh;
  49. width: 100vw;
  50. // padding: 0 20rpx;
  51. }
  52. .pay-content{
  53. height: 70%;
  54. display: flex;
  55. flex-direction: column;
  56. justify-content: center;
  57. align-items: center;
  58. .pay-img{
  59. width: 180rpx;
  60. height: 180rpx;
  61. margin-bottom: 20rpx;
  62. }
  63. .pay-text{
  64. font-size: 70rpx;
  65. }
  66. .play-btn{
  67. margin-top: 100rpx;
  68. width: 200rpx;
  69. height: 70rpx;
  70. line-height: 70rpx;
  71. background-color: #0069f6;
  72. color: #fff;
  73. border-radius: 40rpx;
  74. }
  75. }
  76. .pay-member{
  77. color: red;
  78. text-align: center;
  79. font-size: 32rpx;
  80. }
  81. </style>