index.vue 6.0 KB

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