四零语境前端代码仓库
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.

186 lines
4.8 KiB

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