瑶都万能墙
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.

254 lines
5.3 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
10 months ago
11 months ago
8 months ago
10 months ago
8 months ago
11 months ago
8 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
8 months ago
8 months ago
11 months ago
11 months ago
8 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
8 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  1. <template>
  2. <view class="postDetail">
  3. <navbar leftClick @leftClick="$utils.navigateBack" title="详情" />
  4. <view class="works">
  5. <userHeadItem :item="detail"/>
  6. <daynamicInfo :item="detail"/>
  7. <dynamicToShop
  8. :shop="detail.shop"
  9. />
  10. <statisticalDataInfo :item="detail"/>
  11. </view>
  12. <view style="background-color: #fff;margin-top: 20rpx;">
  13. <uv-tabs :list="tags"
  14. :activeStyle="{color : '#000', fontWeight : 900}"
  15. lineColor="#5baaff"
  16. lineHeight="8rpx"
  17. lineWidth="50rpx"
  18. :scrollable="false"
  19. @click="tabsClick"></uv-tabs>
  20. </view>
  21. <view class="" v-if="tagIndex == 1">
  22. <!-- 头像堆叠组件 - 显示查看过的用户 -->
  23. <avatarStack
  24. :avatars="viewedUsers || []"
  25. :maxDisplay="5"
  26. :avatarSize="50"
  27. :overlapOffset="12"
  28. descriptionType="viewed"
  29. @avatarClick="handleAvatarClick"
  30. @moreClick="handleMoreViewers"
  31. v-if="viewedUsers && viewedUsers.length > 0"
  32. />
  33. </view>
  34. <commentList v-if="tagIndex == 0" @getData="getData" :list="list" :params="params" />
  35. <!-- <commentList
  36. @getData="getData"
  37. :list="list"
  38. :params="params"
  39. /> -->
  40. </view>
  41. </template>
  42. <script>
  43. import mixinsSex from '@/mixins/sex.js'
  44. import mixinsList from '@/mixins/list.js'
  45. import commentList from '../components/list/comment/commentList.vue'
  46. import userHeadItem from '@/components/list/dynamic/userHeadItem.vue'
  47. import daynamicInfo from '@/components/list/dynamic/daynamicInfo.vue'
  48. import statisticalDataInfo from '@/components/list/statisticalDataInfo.vue'
  49. import dynamicToShop from '@/components/list/dynamic/dynamicToShop.vue'
  50. import avatarStack from '@/components/list/avatarStack.vue'
  51. export default {
  52. mixins: [mixinsSex, mixinsList],
  53. components: {
  54. commentList,
  55. userHeadItem,
  56. daynamicInfo,
  57. statisticalDataInfo,
  58. dynamicToShop,
  59. avatarStack,
  60. },
  61. data() {
  62. return {
  63. detail: {
  64. },
  65. // 测试数据 - 查看过帖子的用户头像
  66. viewedUsers: [
  67. {
  68. id: '1',
  69. userHead: '/static/image/logo.jpg',
  70. name: '用户A'
  71. },
  72. {
  73. id: '2',
  74. userHead: 'https://image.hhlm1688.com/2025-06-08/67fbe844-da4a-4272-8d51-364453d0f3aa.jpeg',
  75. name: '用户B'
  76. },
  77. {
  78. id: '3',
  79. userHead: '/static/image/logo.jpg',
  80. name: '用户C'
  81. },
  82. {
  83. id: '4',
  84. userHead: 'https://image.hhlm1688.com/2025-06-08/67fbe844-da4a-4272-8d51-364453d0f3aa.jpeg',
  85. name: '用户D'
  86. },
  87. {
  88. id: '5',
  89. userHead: '/static/image/logo.jpg',
  90. name: '用户E'
  91. },
  92. {
  93. id: '6',
  94. userHead: 'https://image.hhlm1688.com/2025-06-08/67fbe844-da4a-4272-8d51-364453d0f3aa.jpeg',
  95. name: '用户F'
  96. },
  97. {
  98. id: '7',
  99. userHead: '/static/image/logo.jpg',
  100. name: '用户G'
  101. }
  102. ],
  103. mixinsListApi : 'getCommentPage',
  104. params : {
  105. type : '0',
  106. orderId : '',
  107. name : '',
  108. },
  109. tags : [
  110. {
  111. name : '评论'
  112. },
  113. {
  114. name : '浏览'
  115. },
  116. {
  117. name : '点赞'
  118. },
  119. {
  120. name : '分享'
  121. },
  122. ],
  123. tagIndex : 0,
  124. id : 0,
  125. }
  126. },
  127. onLoad(options) {
  128. // this.$route.query的参数
  129. console.log(options)
  130. this.id = options.id
  131. this.queryParams.type = this.params.type
  132. this.queryParams.orderId = options.id
  133. this.params.orderId = options.id
  134. },
  135. onShareAppMessage(res) {
  136. return {
  137. title: this.detail.title,
  138. path: '/pages_order/post/postDetail?id=' + this.id
  139. }
  140. },
  141. onPullDownRefresh() {
  142. this.getDetail()
  143. },
  144. onShow() {
  145. this.getDetail()
  146. },
  147. onShareAppMessage(res) {
  148. // return {
  149. // title: this.item.title,
  150. // desc: this.item.content && this.item.content.slice(0, 30),
  151. // path: '/pages/publish/postDetail?id=' + this.id
  152. // }
  153. },
  154. methods: {
  155. tabsClick({index}){
  156. this.tagIndex = index
  157. },
  158. getDetail() {
  159. this.$api('getPostDetail', {
  160. id: this.id
  161. }, res => {
  162. uni.stopPullDownRefresh()
  163. if (res.code == 200) {
  164. this.params.name = res.result.userName
  165. this.detail = res.result
  166. }
  167. })
  168. },
  169. // 处理头像点击事件
  170. handleAvatarClick(avatar, index) {
  171. console.log('点击头像:', avatar, index);
  172. // 可以跳转到用户详情页面
  173. this.$u.route({
  174. url: '/pages_order/user/userDetail',
  175. params: {
  176. userId: avatar.id
  177. }
  178. });
  179. },
  180. // 处理查看更多用户事件
  181. handleMoreViewers() {
  182. console.log('查看更多查看者');
  183. // 可以跳转到查看者列表页面
  184. this.$u.route({
  185. url: '/pages_order/post/viewersList',
  186. params: {
  187. postId: this.detail.id
  188. }
  189. });
  190. },
  191. }
  192. }
  193. </script>
  194. <style lang="scss" scoped>
  195. .postDetail {
  196. padding-bottom: env(safe-area-inset-bottom);
  197. .works {
  198. background-color: #fff;
  199. padding: 40rpx;
  200. border-radius: 20rpx;
  201. .bottom {
  202. display: flex;
  203. margin-top: 20rpx;
  204. font-size: 24rpx;
  205. .browse {
  206. margin: 0rpx 30rpx;
  207. color: rgb(132, 132, 132);
  208. }
  209. .Leavingamessage {
  210. margin-left: auto;
  211. display: flex;
  212. align-items: center;
  213. }
  214. .phone{
  215. background-color: rgba($uni-color, 0.2);
  216. color: $uni-color;
  217. padding: 8rpx 16rpx;
  218. border-radius: 10rpx;
  219. margin-left: auto;
  220. image{
  221. width: 20rpx;
  222. height: 20rpx;
  223. }
  224. }
  225. }
  226. }
  227. }
  228. </style>