四零语境前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

202 lines
5.2 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <template>
  2. <view class="plan-container">
  3. <!-- 加载动画 -->
  4. <view class="loading-container" v-if="loading">
  5. <uv-loading-icon text="加载中..." size="28"></uv-loading-icon>
  6. </view>
  7. <!-- 主体内容 -->
  8. <view class="main-content" v-if="!loading">
  9. <!-- 内容卡片 -->
  10. <view class="content-card">
  11. <!-- 富文本内容 -->
  12. <view class="rich-text-container">
  13. <!-- <rich-text :nodes="richTextContent"></rich-text> -->
  14. <uv-parse :content="richTextContent" :tagStyle="style" :lazyLoad="true" ></uv-parse>
  15. </view>
  16. </view>
  17. </view>
  18. <!-- 底部固定报名栏 -->
  19. <view class="bottom-bar" v-if="!loading && (type === 1 || type === '1')">
  20. <uv-button
  21. type="primary"
  22. text="报名"
  23. :custom-style="{
  24. width: '100%',
  25. height: '82rpx',
  26. borderRadius: '44rpx',
  27. backgroundColor: '#06DADC',
  28. fontSize: '36rpx',
  29. fontWeight: '500',
  30. border: '1px solid #06DADC'
  31. }"
  32. @click="handleSignUp"
  33. ></uv-button>
  34. <uv-safe-bottom></uv-safe-bottom>
  35. </view>
  36. <!-- 底部安全区域 -->
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. data() {
  42. return {
  43. loading: true, // 初始加载状态
  44. richTextContent: '',
  45. // richTextContent: `
  46. // <div style="padding: 0;">
  47. // <div style="margin-bottom: 40rpx; padding: 40rpx; background: #f8f9fa; ">
  48. // <h3 style="font-size: 36rpx; font-weight: bold; color: #333; margin: 0 0 20rpx 0;">灵活设置</h3>
  49. // <p style="font-size: 28rpx; color: #666; line-height: 1.6; margin: 0 0 30rpx 0;">语音合成支持中文、英文、粤语、四川话,也可以合成中英混读语音;</p>
  50. // <div style="width: 100%; height: 300rpx; overflow: hidden; background: #eee;">
  51. // <img src="/static/default-image.png" style="width: 100%; height: 100%; object-fit: cover; " />
  52. // </div>
  53. // </div>
  54. // <div style="padding: 40rpx; background: #f8f9fa; ">
  55. // <h3 style="font-size: 36rpx; font-weight: bold; color: #333; margin: 0 0 20rpx 0;">高拟真度</h3>
  56. // <p style="font-size: 28rpx; color: #666; line-height: 1.6; margin: 0 0 30rpx 0;">基于业界领先技术构建的语音合成系统,具备合成速度快、合成语音自然流畅等特点,合成语音拟真度高,能够符合多样化的应用场景,让设备和应用轻松发声,人机语音交互效果更加逼真。</p>
  57. // <div style="width: 100%; height: 300rpx; overflow: hidden; background: #eee;">
  58. // <img src="/static/default-image.png" style="width: 100%; height: 100%; object-fit: cover; " />
  59. // </div>
  60. // </div>
  61. // </div>
  62. // `,
  63. style: {
  64. img: 'borderRadius: 24rpx'
  65. },
  66. id: '',
  67. type: ''
  68. }
  69. },
  70. methods: {
  71. handleSignUp() {
  72. // console.log('点击报名')
  73. // 这里添加报名逻辑
  74. uni.navigateTo({
  75. url: '/subPages/home/submit?id=' + this.id
  76. })
  77. },
  78. },
  79. async onShow() {
  80. this.loading = true;
  81. try{
  82. const askRes = await this.$api.home.getLinkDetails({
  83. id: this.id
  84. })
  85. if (askRes.code === 200){
  86. this.richTextContent = askRes.result.content
  87. this.type = askRes.result.type
  88. }
  89. } catch (error) {
  90. console.error('获取链接详情失败:', error)
  91. } finally {
  92. this.loading = false;
  93. }
  94. },
  95. onLoad(options) {
  96. this.id = options.id
  97. this.type = options.type
  98. },
  99. }
  100. </script>
  101. <style scoped lang="scss">
  102. .plan-container {
  103. background: #fff;
  104. min-height: 100vh;
  105. display: flex;
  106. flex-direction: column;
  107. }
  108. .loading-container {
  109. display: flex;
  110. justify-content: center;
  111. align-items: center;
  112. height: 100vh;
  113. }
  114. .main-content {
  115. flex: 1;
  116. padding: 40rpx 32rpx 120rpx;
  117. }
  118. .title-section {
  119. margin-bottom: 40rpx;
  120. .main-title {
  121. font-size: 48rpx;
  122. font-weight: 700;
  123. color: $primary-text-color;
  124. line-height: 1.3;
  125. }
  126. }
  127. .content-card {
  128. background: #F8F8F8;
  129. border-radius: 32rpx;
  130. // padding: 48rpx 32rpx;
  131. // .feature-section {
  132. // margin-bottom: 60rpx;
  133. // &:last-child {
  134. // margin-bottom: 0;
  135. // }
  136. // .feature-title {
  137. // display: block;
  138. // font-size: 36rpx;
  139. // font-weight: 700;
  140. // color: $primary-text-color;
  141. // margin-bottom: 24rpx;
  142. // }
  143. // .feature-desc {
  144. // display: block;
  145. // font-size: 28rpx;
  146. // color: $secondary-text-color;
  147. // line-height: 1.6;
  148. // margin-bottom: 32rpx;
  149. // }
  150. // .feature-image {
  151. // width: 100%;
  152. // height: 320rpx;
  153. // border-radius: 24rpx;
  154. // overflow: hidden;
  155. // image {
  156. // width: 100%;
  157. // height: 100%;
  158. // }
  159. // }
  160. // }
  161. }
  162. .bottom-bar {
  163. position: fixed;
  164. bottom: 0;
  165. left: 0;
  166. right: 0;
  167. background: #fff;
  168. padding: 24rpx 50rpx;
  169. // border-top: 1rpx solid #f0f0f0;
  170. z-index: 999;
  171. }
  172. // 富文本容器样式
  173. .rich-text-container {
  174. width: 100%;
  175. border-radius: 36rpx;
  176. // img {
  177. // border-radius: 24rpx;
  178. // }
  179. }
  180. </style>