commemt.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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, indexs) in item.images" @click="shoupicture(item.images)" :key="indexs" :src="items"
  29. style="width: 100upx;height: 100upx;float:left;padding-right: 20upx;"></image>
  30. </view>
  31. </view>
  32. </view>
  33. <view style="text-align: center;" v-if="assesslist.length == 0">
  34. 暂无评价
  35. </view>
  36. <unipopup :images="images" :show="ishow"/>
  37. </view>
  38. </template>
  39. <script>
  40. import assess from '@/component/assess.vue' // 评价列表
  41. import unipopup from '@/component/openpictrue.vue'
  42. export default{
  43. components: {
  44. assess,
  45. unipopup
  46. },
  47. data(){
  48. return {
  49. goodId: 0,
  50. ishow: false,
  51. images: '',
  52. assesslist:[],
  53. store_id: 0
  54. }
  55. },
  56. onLoad(options) {
  57. this.goodId = options.goodId; // 商品Id
  58. this.store_id = options.store_id;
  59. this.getassess();
  60. uni.$on('changshow', (e) => {
  61. this.changeshow();
  62. })
  63. // changshow
  64. },
  65. methods: {
  66. shoupicture(e) {
  67. uni.previewImage({
  68. urls: e,
  69. longPressActions: {
  70. itemList: ['发送给朋友', '保存图片', '收藏'],
  71. success: function(data) {
  72. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  73. },
  74. fail: function(err) {
  75. console.log(err.errMsg);
  76. }
  77. }
  78. });
  79. // this.ishow = true;
  80. },
  81. changeshow() {
  82. this.ishow = false;
  83. },
  84. getassess() {
  85. this.request({
  86. url: '/api/index.php?do=getevaluategoods',
  87. method: 'post',
  88. data: {
  89. goodsid: this.goodId
  90. },
  91. success: (res) => {
  92. res.data.forEach(item => {
  93. item.images = item.geval_image.split(',');
  94. })
  95. this.assesslist = res.data;
  96. }
  97. })
  98. }
  99. }
  100. }
  101. </script>
  102. <style>
  103. </style>