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

166 lines
3.3 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 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. <view class="bottom">
  8. <view class="browse">
  9. {{ detail.isBrowse }}浏览
  10. </view>
  11. <view class="browse">
  12. {{ detail.isComment }}条评论
  13. </view>
  14. <!-- <view class="Leavingamessage"
  15. @click="openLocation(detail.latitude, detail.longitude)"
  16. v-if="detail.latitude && detail.longitude">
  17. <uv-icon size="40rpx" name="map"></uv-icon>
  18. 导航
  19. </view> -->
  20. <view class="phone"
  21. v-if="detail.phone"
  22. @click.stop="callPhone">
  23. <image src="/static/image/home/phone.png" mode=""></image>
  24. 联系{{ ta[detail.sex] }}
  25. </view>
  26. </view>
  27. </view>
  28. <commentList
  29. @getData="getData"
  30. :list="list"
  31. :params="params"
  32. />
  33. </view>
  34. </template>
  35. <script>
  36. import mixinsSex from '@/mixins/sex.js'
  37. import mixinsList from '@/mixins/list.js'
  38. import commentList from '../components/list/comment/commentList.vue'
  39. import userHeadItem from '@/components/list/dynamic/userHeadItem.vue'
  40. import daynamicInfo from '@/components/list/dynamic/daynamicInfo.vue'
  41. export default {
  42. mixins: [mixinsSex, mixinsList],
  43. components: {
  44. commentList,
  45. userHeadItem,
  46. daynamicInfo,
  47. },
  48. data() {
  49. return {
  50. detail: {},
  51. mixinsListApi : 'getCommentPage',
  52. params : {
  53. type : '0',
  54. orderId : '',
  55. name : '',
  56. },
  57. id : 0,
  58. }
  59. },
  60. onLoad(options) {
  61. // this.$route.query的参数
  62. console.log(options)
  63. this.id = options.id
  64. this.queryParams.type = this.params.type
  65. this.queryParams.orderId = options.id
  66. this.params.orderId = options.id
  67. },
  68. onShareAppMessage(res) {
  69. return {
  70. title: this.detail.title,
  71. path: '/pages_order/post/postDetail?id=' + this.id
  72. }
  73. },
  74. onPullDownRefresh() {
  75. this.getDetail()
  76. },
  77. onShow() {
  78. this.getDetail()
  79. },
  80. onShareAppMessage(res) {
  81. // return {
  82. // title: this.item.title,
  83. // desc: this.item.content && this.item.content.slice(0, 30),
  84. // path: '/pages/publish/postDetail?id=' + this.id
  85. // }
  86. },
  87. methods: {
  88. getDetail() {
  89. this.$api('getPostDetail', {
  90. id: this.id
  91. }, res => {
  92. uni.stopPullDownRefresh()
  93. if (res.code == 200) {
  94. this.params.name = res.result.userName
  95. this.detail = res.result
  96. }
  97. })
  98. },
  99. callPhone(){
  100. uni.makePhoneCall({
  101. phoneNumber: this.detail.phone,
  102. success() {
  103. console.log('安卓拨打成功');
  104. },
  105. fail() {
  106. console.log('安卓拨打失败');
  107. }
  108. })
  109. },
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. .postDetail {
  115. padding-bottom: env(safe-area-inset-bottom);
  116. .works {
  117. background-color: #fff;
  118. padding: 40rpx;
  119. border-radius: 20rpx;
  120. .bottom {
  121. display: flex;
  122. margin-top: 20rpx;
  123. font-size: 24rpx;
  124. .browse {
  125. margin: 0rpx 30rpx;
  126. color: rgb(132, 132, 132);
  127. }
  128. .Leavingamessage {
  129. margin-left: auto;
  130. display: flex;
  131. align-items: center;
  132. }
  133. .phone{
  134. background-color: rgba($uni-color, 0.2);
  135. color: $uni-color;
  136. padding: 8rpx 16rpx;
  137. border-radius: 10rpx;
  138. margin-left: auto;
  139. image{
  140. width: 20rpx;
  141. height: 20rpx;
  142. }
  143. }
  144. }
  145. }
  146. }
  147. </style>