index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <!-- 评价列表 -->
  3. <view class="evaluateWtapper">
  4. <view class="evaluateItem" v-for="(item, indexw) in reply" :key="indexw" @click.stop="details(item)">
  5. <view class="pic-text acea-row row-between-wrapper">
  6. <view class="acea-row row-middle">
  7. <view class="pictrue">
  8. <image :src="item.avatar" mode="aspectFill"></image>
  9. </view>
  10. <view class="acea-row row-middle">
  11. <view class="acea-row row-middle" style="margin-right: 15rpx;">
  12. <view class="name line1">{{ item.nickname }}</view>
  13. <view class="vipImg" v-if="item.is_money_level>0"><image src="../../static/images/vip.png"></image></view>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="start" :class="'star' + item.star"></view>
  18. </view>
  19. <view class="time">{{ item.add_time }} {{ item.suk }}</view>
  20. <view class="evaluate-infor">{{ item.comment }}</view>
  21. <view class="imgList acea-row">
  22. <view class="pictrue" :class="item.pics.length==1?'one':item.pics.length==2?'two':item.pics.length==3?'three':''" v-for="(itemn, indexn) in item.pics" :key="indexn">
  23. <image :src="itemn" class="image" @click.stop='getpreviewImage(indexw, indexn)' mode="aspectFill"></image>
  24. </view>
  25. </view>
  26. <view class="census acea-row row-between-wrapper" v-if="!fromTo">
  27. <view>浏览{{item.views_num}}次</view>
  28. <view class="icons acea-row row-middle">
  29. <view>
  30. <text class="iconfont icon-pinglun1"></text>{{item.replyComment?item.replyComment.sum:0}}
  31. </view>
  32. <view @click.stop="praise(item)">
  33. <text class="icon iconfont" :class="item.is_praise?'icon-weizan font-num':'icon-zan'"></text>{{item.praise}}
  34. </view>
  35. <!-- #ifdef H5 || APP-PLUS -->
  36. <slot name="bottom" :item="item"></slot>
  37. <!-- #endif -->
  38. <!-- #ifdef MP -->
  39. <slot name="bottom{{indexw}}"></slot>
  40. <!-- #endif -->
  41. </view>
  42. </view>
  43. <view class="reply" v-if="item.replyComment && !fromTo">
  44. <text :class="item.replyComment.uid?'':'font-num'">{{item.replyComment.user?item.replyComment.user.nickname:''}}</text><text class="store" v-if="!item.replyComment.uid">商家</text>:{{
  45. item.replyComment.content
  46. }}
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import {
  53. getReplyPraise,
  54. getUnReplyPraise
  55. } from '@/api/store.js';
  56. export default {
  57. props: {
  58. reply: {
  59. type: Array,
  60. default: () => []
  61. },
  62. fromTo: {
  63. type: Number,
  64. default: 0
  65. }
  66. },
  67. data: function() {
  68. return {};
  69. },
  70. methods: {
  71. details(item){
  72. uni.navigateTo({
  73. url: '/pages/goods/goods_comment_con/comment_con?id=' + item.id
  74. })
  75. },
  76. getpreviewImage: function(indexw, indexn) {
  77. uni.previewImage({
  78. urls: this.reply[indexw].pics,
  79. current: this.reply[indexw].pics[indexn]
  80. });
  81. },
  82. praise(item){
  83. if (item.is_praise) {
  84. getUnReplyPraise(item.id).then(res => {
  85. item.is_praise = !item.is_praise
  86. item.praise = item.praise - 1
  87. return this.$util.Tips({
  88. title: res.msg
  89. });
  90. });
  91. } else {
  92. getReplyPraise(item.id).then(res => {
  93. item.is_praise = !item.is_praise
  94. item.praise = item.praise + 1
  95. return this.$util.Tips({
  96. title: res.msg
  97. });
  98. });
  99. }
  100. }
  101. }
  102. }
  103. </script>
  104. <style scoped lang='scss'>
  105. .vipImg{
  106. width: 56rpx;
  107. height: 20rpx;
  108. margin-left: 10rpx;
  109. image{
  110. width: 100%;
  111. height: 100%;
  112. display: block;
  113. }
  114. }
  115. .evaluateWtapper .census{
  116. padding: 0 20rpx;
  117. font-size: 22rpx;
  118. color: #999;
  119. }
  120. .evaluateWtapper .census .iconfont{
  121. margin-right: 6rpx;
  122. }
  123. .evaluateWtapper .census .icons{
  124. color: #333;
  125. }
  126. .evaluateWtapper .census .icon{
  127. margin-left: 40rpx;
  128. }
  129. .evaluateWtapper .evaluateItem {
  130. background-color: #fff;
  131. padding-bottom: 25rpx;
  132. margin: 0 20rpx 20rpx 20rpx;
  133. border-radius: 12rpx;
  134. }
  135. .evaluateWtapper .evaluateItem~.evaluateItem {
  136. /* border-top: 1rpx solid #f5f5f5; */
  137. }
  138. .evaluateWtapper .evaluateItem .pic-text {
  139. font-size: 26rpx;
  140. color: #282828;
  141. height: 95rpx;
  142. padding: 0 20rpx;
  143. }
  144. .evaluateWtapper .evaluateItem .pic-text .pictrue {
  145. width: 56rpx;
  146. height: 56rpx;
  147. margin-right: 20rpx;
  148. }
  149. .evaluateWtapper .evaluateItem .pic-text .pictrue image {
  150. width: 100%;
  151. height: 100%;
  152. border-radius: 50%;
  153. }
  154. .evaluateWtapper .evaluateItem .pic-text .name {
  155. max-width: 450rpx;
  156. }
  157. .evaluateWtapper .evaluateItem .time {
  158. font-size: 24rpx;
  159. color: #82848f;
  160. padding: 0 20rpx;
  161. }
  162. .evaluateWtapper .evaluateItem .evaluate-infor {
  163. font-size: 28rpx;
  164. color: #282828;
  165. margin-top: 19rpx;
  166. padding: 0 20rpx;
  167. word-break: break-all;
  168. }
  169. .evaluateWtapper .evaluateItem .imgList {
  170. padding: 0 20rpx 0 6rpx;
  171. margin-top: 25rpx;
  172. }
  173. .evaluateWtapper .evaluateItem .imgList .pictrue {
  174. width: 156rpx;
  175. height: 156rpx;
  176. margin: 0 0 15rpx 15rpx;
  177. border-radius: 12rpx;
  178. }
  179. .evaluateWtapper .evaluateItem .imgList .pictrue.one{
  180. width: 400rpx;
  181. height: 400rpx;
  182. }
  183. .evaluateWtapper .evaluateItem .imgList .pictrue.two{
  184. width: 324rpx;
  185. height: 324rpx;
  186. }
  187. .evaluateWtapper .evaluateItem .imgList .pictrue.three{
  188. width: 214rpx;
  189. height: 214rpx;
  190. }
  191. .evaluateWtapper .evaluateItem .imgList .pictrue image {
  192. width: 100%;
  193. height: 100%;
  194. background-color: #f7f7f7;
  195. border-radius: 12rpx;
  196. }
  197. .evaluateWtapper .evaluateItem .reply {
  198. font-size: 26rpx;
  199. color: #454545;
  200. background-color: #f7f7f7;
  201. border-radius: 5rpx;
  202. margin: 20rpx 30rpx 0 30rpx;
  203. padding: 20rpx;
  204. position: relative;
  205. word-break: break-all;
  206. .store{
  207. background-color: var(--view-theme);
  208. font-size: 12rpx;
  209. color: #fff;
  210. border-radius: 15rpx;
  211. padding: 2rpx 5rpx;
  212. margin-left: 10rpx;
  213. }
  214. }
  215. .evaluateWtapper .evaluateItem .reply::before {
  216. content: "";
  217. width: 0;
  218. height: 0;
  219. border-left: 20rpx solid transparent;
  220. border-right: 20rpx solid transparent;
  221. border-bottom: 30rpx solid #f7f7f7;
  222. position: absolute;
  223. top: -14rpx;
  224. left: 40rpx;
  225. }
  226. </style>