index.vue 6.2 KB

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