paysuccess.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <Container
  3. class="body-content"
  4. title="支付成功"
  5. bgColor="#f7f7f7"
  6. :onBack="onBack"
  7. :scrollStyle="{
  8. padding: 0,
  9. }"
  10. >
  11. <view class="info-area">
  12. <image
  13. class="success-icon"
  14. src="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/06/XTYZzM0uKjmKGV2cXN3QC5R1icHXmQDo10mUNZ6T.png"
  15. mode="aspectFill"
  16. ></image>
  17. </view>
  18. <view class="button-group">
  19. <view type="default" class="btn" @click="back">返回首页</view>
  20. </view>
  21. <view class="qr-code">
  22. <span>恭喜你成为VIP</span>
  23. <span>这是您的专属老师</span>
  24. <div class="card">
  25. <img :src="src" show-menu-by-longpress class="img" alt="" />
  26. <span>可长按识别二维码</span>
  27. </div>
  28. </view>
  29. </Container>
  30. </template>
  31. <script setup>
  32. import Container from "../../components/Container/Container.vue";
  33. import { ref } from "vue";
  34. import { router } from "../../utils/router";
  35. import { onShow } from "@dcloudio/uni-app";
  36. import { request } from "@/utils/request";
  37. const onBack = () => new Promise((resolve) => resolve("/pages/user/index"));
  38. const back = () => {
  39. router.switchTab("/pages/user/index");
  40. };
  41. const src = ref("");
  42. onShow(() => {
  43. request(
  44. "api/question_bank/question_reception/channel_active_code/random_detail"
  45. ).then((res) => {
  46. src.value = res.data.qr_code;
  47. });
  48. });
  49. </script>
  50. <style scoped lang="scss">
  51. @import "@/uni.scss";
  52. .qr-code {
  53. width: 100%;
  54. height: 100%;
  55. margin-top: 20px;
  56. display: flex;
  57. flex-direction: column;
  58. align-items: center;
  59. color: $success;
  60. gap: 12rpx;
  61. .card {
  62. margin: 10rpx auto 0;
  63. display: flex;
  64. align-items: center;
  65. justify-content: center;
  66. flex-direction: column;
  67. padding: 80rpx;
  68. background-color: #fff;
  69. gap: 40rpx;
  70. border-radius: 40rpx;
  71. width: calc(100% - 64rpx);
  72. box-sizing: border-box;
  73. color: #333;
  74. .img {
  75. width: 181px;
  76. height: 181px;
  77. }
  78. }
  79. }
  80. .success-icon {
  81. width: 180rpx;
  82. height: 180rpx;
  83. margin-bottom: 80rpx;
  84. margin-top: 50rpx;
  85. }
  86. /* 中间说明区域 */
  87. .info-area {
  88. flex: 2;
  89. text-align: center;
  90. margin: 0 20rpx;
  91. }
  92. .info-text {
  93. font-size: 28rpx;
  94. color: #666;
  95. }
  96. /* 底部按钮组 */
  97. .button-group {
  98. display: flex;
  99. flex-direction: column;
  100. justify-content: center;
  101. }
  102. .btn {
  103. border-radius: 40rpx;
  104. font-size: 32rpx;
  105. line-height: 84rpx;
  106. display: block;
  107. border: 1rpx solid green;
  108. text-align: center;
  109. width: 94%;
  110. margin: auto;
  111. }
  112. </style>