evaluateDetail.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view>
  3. <view class="exaluate-member-view">
  4. <view class="member-view">
  5. <view class="member-img">
  6. <u-image width="82rpx" style="border: 1px solid #ededed" height="82rpx" shape="circle" :src="comment.memberProfile || '/static/missing-face.png'"></u-image>
  7. </view>
  8. <view class="member-info">
  9. <view class="memName">{{ comment.memberName }}</view>
  10. <view class="creName">{{ comment.createTime }}</view>
  11. </view>
  12. </view>
  13. <view class="goods-view">
  14. <view class="goods-title">商品评价: {{ gradeList[comment.grade] }}</view>
  15. <view class="goods-subtitle">
  16. {{ comment.content }}
  17. </view>
  18. <!-- 如果有图片则会循环显示评价的图片 -->
  19. <view class="goods-imgs-view" v-if="comment.images != null && comment.images.length != 0">
  20. <view class="img-view" v-for="(img, imgIndex) in comment.images.split(',')" :key="imgIndex">
  21. <u-image @click.native="preview(comment.images.split(','),imgIndex)" width="160rpx" height="160rpx" :src="img"></u-image>
  22. </view>
  23. </view>
  24. <view class="goods-name">
  25. {{ comment.goodsName }}
  26. </view>
  27. <view class="goods-subtitle"></view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. comment: {}, //评论信息
  37. gradeList: {
  38. //评价grade
  39. GOOD: "好评",
  40. MODERATE: "中评",
  41. WORSE: "差评",
  42. haveImage: "有图",
  43. },
  44. };
  45. },
  46. onLoad(options) {
  47. this.comment = JSON.parse(decodeURIComponent(options.comment));
  48. },
  49. methods: {
  50. /**
  51. * 点击图片放大或保存
  52. */
  53. preview(urls, index) {
  54. uni.previewImage({
  55. current: index,
  56. urls: urls,
  57. longPressActions: {
  58. itemList: ["保存图片"],
  59. success: function (data) {},
  60. fail: function (err) {},
  61. },
  62. });
  63. },
  64. },
  65. };
  66. </script>
  67. <style lang="scss" scoped>
  68. .memName {
  69. font-size: 28rpx;
  70. }
  71. .goods-name {
  72. border-bottom: 1px solid #ededed;
  73. padding-bottom: 30rpx;
  74. }
  75. .creName,
  76. .goods-name {
  77. font-size: 24rpx;
  78. color: $u-tips-color;
  79. }
  80. page,
  81. .content {
  82. background: $page-color-base;
  83. height: 100%;
  84. }
  85. .exaluate-member-view {
  86. background-color: #fff;
  87. margin-top: 12rpx;
  88. padding: 20rpx;
  89. .member-view {
  90. display: flex;
  91. flex-direction: row;
  92. align-items: center;
  93. .member-img {
  94. width: 100rpx;
  95. margin: 20rpx;
  96. }
  97. .member-info {
  98. margin-left: 15rpx;
  99. }
  100. }
  101. .goods-view {
  102. margin-left: 15rpx;
  103. }
  104. }
  105. .border-bottom {
  106. padding-bottom: 20rpx;
  107. border-bottom: 1px solid #ededed;
  108. }
  109. .goods-title {
  110. margin-bottom: 10rpx;
  111. }
  112. .goods-subtitle {
  113. margin-bottom: 20rpx;
  114. color: #909399;
  115. }
  116. .goods-imgs-view {
  117. margin: 20rpx 0;
  118. display: flex;
  119. flex-direction: row;
  120. align-items: center;
  121. .img-view {
  122. margin-right: 15rpx;
  123. }
  124. }
  125. </style>