comment-detail.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <app-layout>
  3. <view class="comment-detail">
  4. <view class="top-text dir-left-nowrap main-left">
  5. <view class="prompt">买家评价</view>
  6. <view class="show" v-if="detail.is_show === '0'">已隐藏</view>
  7. </view>
  8. <view class="content">
  9. <view class="top dir-left-nowrap">
  10. <image class="image" :src="detail.cover_pic"></image>
  11. <view class="name dir-left-nowrap main-between">
  12. <view class="name-text">
  13. <view class="text">{{detail.goods_name}}</view>
  14. <view v-if="detail.attr_list.length > 0" class="attr">{{detail.attr_list[0].attr_group_name}}:{{detail.attr_list[0].attr_name}}</view>
  15. </view>
  16. <view class="name-icon dir-top-nowrap main-center cross-center">
  17. <image class="icon" :src="`${detail.score === '3' ? '../image/praise.png' : detail.score === '2' ? '../image/average.png' : '../image/bad-review.png'}`"></image>
  18. <view class="evaluation">{{detail.score === '3' ? '好评' : detail.score === '2' ? '中评' : detail.score === '1' ? '差评' : ''}}</view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="bottom">
  23. <view class="bottom-text">{{detail.content}}</view>
  24. <view class="bottom-image dir-left-wrap">
  25. <image @click="screen(index)" :key="index" lazy-load :src="item" v-for="(item, index) in detail.pic_url"></image>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="seller">卖家回复</view>
  30. <view class="area">
  31. <textarea maxlength="-1" :show-confirm-bar="true" @input="bindTextAreaBlur" @confirm="bindTextAreaBlur" @blur="bindTextAreaBlur" placeholder="请输入回复内容" placeholder-class="place" :value="detail.reply_content"></textarea>
  32. </view>
  33. <view class="button" @click="reply">发布回复</view>
  34. </view>
  35. </app-layout>
  36. </template>
  37. <script>
  38. export default {
  39. name: 'comment-detail',
  40. data() {
  41. return {
  42. detail: {}
  43. }
  44. },
  45. onLoad(options) {
  46. this.$showLoading({
  47. type: 'global',
  48. text: '加载中...'
  49. });
  50. this.$request({
  51. url: this.$api.app_admin.comments_reply,
  52. data: {
  53. id: options.id,
  54. }
  55. }).then(response => {
  56. this.$hideLoading();
  57. if(response.code === 0) {
  58. this.detail = response.data.list;
  59. }
  60. });
  61. },
  62. methods: {
  63. screen(index) {
  64. uni.previewImage({
  65. current: index,
  66. urls: this.detail.pic_url
  67. })
  68. },
  69. reply() {
  70. this.$request({
  71. url: this.$api.app_admin.comments_reply,
  72. method: 'post',
  73. data: {
  74. id: this.detail.id,
  75. reply_content: this.detail.reply_content,
  76. }
  77. }).then(response => {
  78. if (response.code === 0) {
  79. uni.navigateBack();
  80. }
  81. });
  82. },
  83. bindTextAreaBlur(e) {
  84. this.detail.reply_content = e.detail.value;
  85. }
  86. }
  87. }
  88. </script>
  89. <style scoped lang="scss">
  90. @import "./comment-detail.scss";
  91. </style>