myComment.vue 921 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view style="padding: 20rpx;">
  3. <view class="box" v-for="item in commentList" :key="item.id" style="margin-bottom: 10rpx; color: #666;"
  4. @click="goDetail(item.orderId)">
  5. <view style="margin-bottom: 10rpx;">{{ item.content }}</view>
  6. <view style="display: flex;">
  7. <view style="flex: 1;">
  8. <uni-rate :value="item.star" readonly></uni-rate>
  9. </view>
  10. <view style="padding-top: 10rpx; font-size: 24rpx;">{{ item.time }}</view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. commentList: []
  20. }
  21. },
  22. onLoad() {
  23. this.load()
  24. },
  25. methods: {
  26. goDetail(orderId) {
  27. console.log(orderId)
  28. uni.navigateTo({
  29. url: '/pages/detail/detail?orderId=' + orderId
  30. })
  31. },
  32. load() {
  33. this.$request.get('/comment/selectComment').then(res => {
  34. this.commentList = res.data || []
  35. })
  36. }
  37. }
  38. }
  39. </script>
  40. <style>
  41. </style>