commemt.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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" :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. </view>
  36. </template>
  37. <script>
  38. import assess from '@/component/assess.vue' // 评价列表
  39. export default{
  40. components: {
  41. assess
  42. },
  43. data(){
  44. return {
  45. goodId: 0,
  46. assesslist:[],
  47. store_id: 0
  48. }
  49. },
  50. onLoad(options) {
  51. this.goodId = options.goodId; // 商品Id
  52. this.store_id = options.store_id;
  53. this.getassess();
  54. },
  55. methods: {
  56. getassess() {
  57. this.request({
  58. url: '/api/index.php?do=getevaluategoods',
  59. method: 'post',
  60. data: {
  61. goodsid: this.goodId
  62. },
  63. success: (res) => {
  64. console.log(res.data);
  65. res.data.forEach(item => {
  66. item.images = item.geval_image.split(',');
  67. })
  68. this.assesslist = res.data;
  69. console.log(this.assesslist)
  70. }
  71. })
  72. }
  73. }
  74. }
  75. </script>
  76. <style>
  77. </style>