吉光研途前端代码仓库
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.

218 lines
4.9 KiB

  1. <template>
  2. <view class="page__view">
  3. <!-- 导航栏 -->
  4. <navbar :title="details.title" leftClick @leftClick="$utils.navigateBack" bgColor="#4883F9" color="#FFFFFF" />
  5. <!-- 轮播图 -->
  6. <view class="swiper">
  7. <uv-swiper :list="bannerList" keyName="image" :autoplay="bannerList.length > 1" :indicator="bannerList.length > 1" indicatorMode="dot" indicatorActiveColor="#4883F9" indicatorInactiveColor="#FFFFFF" height="424rpx"></uv-swiper>
  8. </view>
  9. <!-- 学生情况 -->
  10. <view class="section">
  11. <view class="section-header">
  12. <arrow></arrow>
  13. <view>学生情况</view>
  14. </view>
  15. <view class="section-content">
  16. <uv-parse :content="details.studentCondition"></uv-parse>
  17. </view>
  18. </view>
  19. <!-- 服务项目 -->
  20. <view class="section">
  21. <view class="section-header">
  22. <arrow></arrow>
  23. <view>服务项目</view>
  24. </view>
  25. <view class="section-content">
  26. <uv-parse :content="details.serviceItem"></uv-parse>
  27. </view>
  28. </view>
  29. <!-- 服务过程 -->
  30. <view class="section">
  31. <view class="section-header">
  32. <arrow></arrow>
  33. <view>服务过程</view>
  34. </view>
  35. <view class="section-content">
  36. <uv-parse :content="details.serviceProcess"></uv-parse>
  37. </view>
  38. </view>
  39. <!-- 服务结果 -->
  40. <view class="section">
  41. <view class="section-header">
  42. <arrow></arrow>
  43. <view>服务结果</view>
  44. </view>
  45. <view class="section-content">
  46. <uv-parse :content="details.serviceResult"></uv-parse>
  47. </view>
  48. </view>
  49. <!-- 服务感受 -->
  50. <view class="section">
  51. <view class="section-header">
  52. <arrow></arrow>
  53. <view>服务感受</view>
  54. </view>
  55. <view class="section-content">
  56. <uv-parse :content="details.serviceFeeling"></uv-parse>
  57. </view>
  58. </view>
  59. <view class="flex bottom">
  60. <view class="flex btns">
  61. <button class="btn" @click="jumpToPoster">保存海报</button>
  62. <button class="btn btn-share" open-type="share">分享文章</button>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import arrow from '@/components/base/arrow.vue'
  69. export default {
  70. components: {
  71. arrow,
  72. },
  73. data() {
  74. return {
  75. details: {},
  76. }
  77. },
  78. onLoad({ articleId }) {
  79. this.getData(articleId)
  80. },
  81. onShareAppMessage(res) {
  82. return {
  83. title: this.posterData.paperDesc,
  84. imageUrl: this.posterData.paperImage,
  85. path: this.posterData.path,
  86. }
  87. },
  88. computed: {
  89. bannerList() {
  90. const { image } = this.details || {}
  91. return (image || '').split(',').map(url => ({ image: url }))
  92. },
  93. posterData() {
  94. const { id, title, paperDesc, paperImage } = this.details || {}
  95. return {
  96. paperDesc: paperDesc || title,
  97. paperImage: paperImage || this.bannerList?.[0]?.image || '',
  98. path: `pages_order/case/index?articleId=${id}`
  99. }
  100. },
  101. },
  102. methods: {
  103. async getData(articleId) {
  104. try {
  105. this.details = await this.$fetch('queryAriticleById', { articleId })
  106. } catch (err) {
  107. }
  108. },
  109. jumpToPoster() {
  110. uni.setStorageSync('posterData', this.posterData)
  111. uni.navigateTo({
  112. url: `/pages_order/poster/index`
  113. })
  114. },
  115. },
  116. }
  117. </script>
  118. <style scoped lang="scss">
  119. .page__view {
  120. box-sizing: border-box;
  121. background: #FFFFFF;
  122. padding-bottom: calc(36rpx + 110rpx + env(safe-area-inset-bottom));
  123. }
  124. .swiper {
  125. margin: 20rpx 18rpx 47rpx 18rpx;
  126. border-radius: 25rpx;
  127. overflow: hidden;
  128. /deep/ .uv-swiper-indicator__wrapper__dot {
  129. width: 15rpx;
  130. height: 15rpx;
  131. }
  132. /deep/ .uv-swiper-indicator__wrapper__dot--active {
  133. width: 15rpx;
  134. }
  135. }
  136. .section {
  137. width: 100%;
  138. padding: 0 18rpx;
  139. box-sizing: border-box;
  140. & + & {
  141. margin-top: 40rpx;
  142. }
  143. &-header {
  144. display: flex;
  145. align-items: center;
  146. justify-content: flex-start;
  147. column-gap: 5rpx;
  148. padding-left: 11rpx;
  149. font-size: 32rpx;
  150. font-weight: 700;
  151. color: #000000;
  152. }
  153. &-content {
  154. margin-top: 24rpx;
  155. padding: 24rpx;
  156. box-sizing: border-box;
  157. white-space: pre-line;
  158. font-size: 28rpx;
  159. color: #000000;
  160. background: #F8F8F8;
  161. border-radius: 15rpx;
  162. }
  163. }
  164. .bottom {
  165. position: fixed;
  166. left: 0;
  167. bottom: 0;
  168. width: 100vw;
  169. height: 110rpx;
  170. padding-bottom: env(safe-area-inset-bottom);
  171. background: #FFFFFF;
  172. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  173. .btns {
  174. column-gap: 34rpx;
  175. }
  176. .btn {
  177. padding: 20rpx 90rpx;
  178. font-size: 28rpx;
  179. color: #FFFFFF;
  180. background: #4883F9;
  181. border-radius: 42rpx;
  182. &-share {
  183. background: #FFD019;
  184. }
  185. }
  186. }
  187. </style>