commemt.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view>
  3. <view v-for="(item,index) in assesslist" :key="index" class="uni-padding-wrap" style="border-bottom: 1px solid #EEEEEE;padding-bottom: 10upx;">
  4. <view class="uni-comment">
  5. <view class="uni-comment-list">
  6. <view class="uni-comment-face"><image style="width: 100%;height: 100%;" :src="item.member_avatar"></image></view>
  7. <view class="uni-comment-body">
  8. <view class="uni-comment-top">
  9. <text style="font-size: 28upx;color: #303133">{{item.member_truename}}</text>
  10. <uniIcon type="star" size="16"></uniIcon>
  11. </view>
  12. <view class="uni-comment-date">
  13. <text style="color: #909399;font-size: 20upx;">{{item.geval_addtime}}</text>
  14. </view>
  15. </view>
  16. <view>
  17. <van-rate
  18. :value="item.geval_scores"
  19. void-icon="star"
  20. void-color="#eee"
  21. color="#ee0a24"
  22. readonly='true'
  23. />
  24. </view>
  25. </view>
  26. <view style="color: #303133;font-size: 28upx;" class="uni-comment-content">{{item.geval_content}}</view>
  27. <view>
  28. <image v-for="(items, index) in item.images" @click="shoupicture(items)" :key="index" :src="items" style="width: 100upx;height: 100upx;float:left;"></image>
  29. </view>
  30. </view>
  31. </view>
  32. <view style="text-align: center;" v-if="assesslist.length == 0">
  33. 暂无评价
  34. </view>
  35. <unipopup :images="images" :show="ishow"/>
  36. </view>
  37. </template>
  38. <script>
  39. import assess from '@/component/assess.vue' // 评价列表
  40. import unipopup from '@/component/openpictrue.vue'
  41. export default{
  42. components: {
  43. assess,
  44. unipopup
  45. },
  46. data(){
  47. return {
  48. goodId: 0,
  49. ishow: false,
  50. images: '',
  51. assesslist:[],
  52. store_id: 0
  53. }
  54. },
  55. onLoad(options) {
  56. this.goodId = options.goodId; // 商品Id
  57. this.store_id = options.store_id;
  58. this.getassess();
  59. uni.$on('changshow', (e) => {
  60. this.changeshow();
  61. })
  62. // changshow
  63. },
  64. methods: {
  65. shoupicture(e) {
  66. this.images = e;
  67. this.ishow = true;
  68. console.log(this.ishow)
  69. },
  70. changeshow() {
  71. this.ishow = false;
  72. },
  73. getassess() {
  74. this.request({
  75. url: '/api/index.php?do=getevaluategoods',
  76. method: 'post',
  77. data: {
  78. goodsid: this.goodId
  79. },
  80. success: (res) => {
  81. console.log(res.data);
  82. res.data.forEach(item => {
  83. item.images = item.geval_image.split(',');
  84. })
  85. this.assesslist = res.data;
  86. console.log(this.assesslist)
  87. }
  88. })
  89. }
  90. }
  91. }
  92. </script>
  93. <style>
  94. </style>