projectUpdateDetails.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="project-update-details">
  3. <view class="custom-navbar" :style="navBgStyle">
  4. <view class="navbar-left scale-tap" @click="goBack">
  5. <image src="@/static/crowdFunding/back.png" mode="widthFix"></image>
  6. </view>
  7. <view class="navbar-center one-omit" style="max-width: 70vw" :style="{ opacity: navBgOpacity }">
  8. {{ datails.title }}
  9. </view>
  10. <view class="navbar-right scale-tap" @click="showShare = true">
  11. <image src="@/static/crowdFunding/share.png" mode="widthFix"></image>
  12. </view>
  13. </view>
  14. <image class="top-img" :src="datails.image" mode="widthFix"></image>
  15. <view class="update-info">
  16. <view class="update-title-row">
  17. <text class="update-title">· 第{{ datails.numb }}次更新</text>
  18. <text class="update-time">{{ datails.create_time }}</text>
  19. </view>
  20. <view class="update-user-row">
  21. <image class="user-avatar" :src="author.avator"></image>
  22. <text class="user-nickname">{{ author.nickname }}</text>
  23. </view>
  24. </view>
  25. <view class="content">
  26. <uv-parse :content="datails.content" :selectable="true"></uv-parse>
  27. </view>
  28. <!-- 分享弹窗 -->
  29. <SharePopup :visible="showShare" :userId="0" :share-title="shareTitle" :share-desc="shareDesc" :share-img="shareImg"
  30. view="crowdfundingDetails" @close="showShare = false" :isReportContent="true" />
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. data() {
  36. return {
  37. navBgOpacity: 0,
  38. content: ` `,
  39. datails: {},
  40. author: {},
  41. showShare: false,
  42. shareTitle: '',
  43. shareDesc: '',
  44. shareImg: '',
  45. shareLink:"",
  46. };
  47. },
  48. computed: {
  49. navBgStyle() {
  50. return {
  51. id: 0,
  52. background: `rgba(255,255,255,${this.navBgOpacity})`,
  53. transition: "background 0.3s",
  54. };
  55. },
  56. },
  57. onLoad(options) {
  58. this.id = options.id
  59. this.getDetails()
  60. },
  61. methods: {
  62. goBack() {
  63. uni.navigateBack();
  64. },
  65. getDetails() {
  66. uni.request({
  67. url: this.$apiHost + '/crowdfund/article/detail',
  68. method: 'GET',
  69. data: {
  70. id: this.id,
  71. uuid: getApp().globalData.uuid,
  72. skey: getApp().globalData.skey
  73. },
  74. success: (res) => {
  75. console.log('获取到详情数据', res.data.data);
  76. if (res.data && res.data.success === 'yes' && res.data.data) {
  77. this.datails = res.data.data
  78. }
  79. }
  80. });
  81. uni.request({
  82. url: this.$apiHost + '/crowdfund/detail',
  83. method: 'GET',
  84. data: {
  85. id: this.projectId,
  86. uuid: getApp().globalData.uuid,
  87. skey: getApp().globalData.skey
  88. },
  89. success: (res) => {
  90. if (res.data && res.data.success === 'yes' && res.data.data) {
  91. this.author = {
  92. "id": res.data.data.creator_id,
  93. "nickname": res.data.data.creator_nickname,
  94. "avator": res.data.data.creator_avatar,
  95. }
  96. // 可根据接口返回字段设置isFavorite等
  97. }
  98. }
  99. });
  100. }
  101. },
  102. onPageScroll(e) {
  103. const threshold = this.swiperHeight || uni.upx2px(400); // 优先用实际高度
  104. let opacity = 0;
  105. if (e.scrollTop > 0) {
  106. opacity = Math.min(e.scrollTop / threshold, 1);
  107. }
  108. this.navBgOpacity = opacity;
  109. },
  110. };
  111. </script>
  112. <style scoped lang="scss">
  113. .project-update-details {
  114. min-height: 100vh;
  115. padding-bottom: 20vh;
  116. /* 自定义导航栏样式 */
  117. .custom-navbar {
  118. display: flex;
  119. flex-direction: row;
  120. align-items: center;
  121. justify-content: space-between;
  122. width: 100%;
  123. height: calc(90rpx + var(--status-bar-height));
  124. padding: 0 20rpx;
  125. position: fixed;
  126. top: 0;
  127. z-index: 100;
  128. padding: 12rpx 24rpx;
  129. padding-top: calc(var(--status-bar-height) + 12rpx);
  130. background: transparent;
  131. transition: background 0.3s;
  132. image {
  133. width: 64rpx;
  134. height: 64rpx;
  135. }
  136. }
  137. .top-img {
  138. width: 100%;
  139. }
  140. .update-info {
  141. background: #fff;
  142. padding: 32rpx 32rpx 0 32rpx;
  143. .update-title-row {
  144. display: flex;
  145. justify-content: space-between;
  146. align-items: center;
  147. margin-bottom: 24rpx;
  148. .update-title {
  149. font-size: 26rpx;
  150. color: #222;
  151. }
  152. .update-time {
  153. font-size: 24rpx;
  154. color: #bdbdbd;
  155. }
  156. }
  157. .update-user-row {
  158. display: flex;
  159. align-items: center;
  160. .user-avatar {
  161. width: 48rpx;
  162. height: 48rpx;
  163. border-radius: 50%;
  164. margin-right: 16rpx;
  165. }
  166. .user-nickname {
  167. font-size: 26rpx;
  168. color: #222;
  169. font-weight: 500;
  170. }
  171. }
  172. }
  173. .content {
  174. padding: 42rpx 28rpx;
  175. }
  176. }
  177. </style>