goodsEvaluate.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <!--<view class="container">
  3. <view class="tui-header">商品好评度 <text>98%</text></view>
  4. <view class="tui-attr-box">
  5. <view class="tui-attr-item tui-attr-active">全部 <text>90+</text></view>
  6. <view class="tui-attr-item">最新</view>
  7. <view class="tui-attr-item">好评<text>80+</text></view>
  8. <view class="tui-attr-item">差评<text>1</text></view>
  9. <view class="tui-attr-item">有图<text>8</text></view>
  10. <view class="tui-attr-item">追加评价<text>8</text></view>
  11. </view>
  12. <view class="tui-evaluate__box" v-for="(item,index) in evaluateList" :key="index">
  13. <view class="tui-flex__center">
  14. <image src="/static/images/news/avatar_1.jpg" class="tui-avatar"></image>
  15. <view class="tui-nickname">zmh06721</view>
  16. </view>
  17. <view class="tui-content__box">
  18. <view class="tui-rate__box">
  19. <tui-rate :current="item.star" :size="14"></tui-rate>
  20. <text>2020-06-21</text>
  21. </view>
  22. <view class="tui-desc">
  23. 收到大大惊喜了下,真的好可爱,很温顺,给兽医检查了下,猫很正常,店家打好了防疫针,这点很赞,很满意!
  24. </view>
  25. <view class="tui-img__box" v-if="item.imgs && item.imgs.length>0">
  26. <block v-for="(src,subIndex) in item.imgs" :key="subIndex">
  27. <image @tap.stop="previewImage(index,subIndex)" :class="{'tui-image':item.imgs.length===1}" :src="webURL+src"
  28. :mode="item.imgs.length===1?'widthFix':'aspectFill'"></image>
  29. </block>
  30. </view>
  31. <view class="tui-op__box tui-flex__center">
  32. <view class="tui-specs">双血统;公母随机</view>
  33. <view class="tui-flex__center">
  34. <view class="tui-op-item">
  35. <text :class="{'tui-color-red':item.zan}">12</text>
  36. <tui-icon :name="item.zan?'agree-fill':'agree'" :size="34" unit="rpx" :color="item.zan?'#EB0909':'#333'"></tui-icon>
  37. </view>
  38. <view class="tui-op-item" @tap="evaluateDetail">
  39. <text>1</text>
  40. <tui-icon name="message" :size="40" unit="rpx" color="#333"></tui-icon>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <tui-divider gradual width="50%">没有更多了</tui-divider>
  47. </view>-->
  48. </template>
  49. <script>
  50. export default {
  51. data() {
  52. return {
  53. webURL: 'https://thorui.cn/images/mall/',
  54. evaluateList: [{
  55. star: 5,
  56. imgs: ['cat_1.jpg', 'cat_2.jpg', 'cat_1.jpg', 'cat_2.jpg', 'cat_2.jpg'],
  57. zan: false
  58. }, {
  59. star: 4,
  60. imgs: ['cat_1.jpg'],
  61. zan: true
  62. }, {
  63. star: 5,
  64. imgs: [],
  65. zan: false
  66. }, {
  67. star: 5,
  68. imgs: ['cat_1.jpg', 'cat_2.jpg', 'cat_2.jpg'],
  69. zan: false
  70. }, {
  71. star: 5,
  72. imgs: ['cat_1.jpg', 'cat_2.jpg'],
  73. zan: false
  74. }]
  75. }
  76. },
  77. methods: {
  78. previewImage(index, current) {
  79. let imgs = this.evaluateList[index].imgs
  80. let urls = imgs.map(item => {
  81. return this.webURL + item
  82. })
  83. uni.previewImage({
  84. current: current,
  85. urls: urls
  86. })
  87. },
  88. evaluateDetail(){
  89. this.tui.href('/pages/evaluateDetail/evaluateDetail')
  90. }
  91. },
  92. /**
  93. * 页面相关事件处理函数--监听用户下拉动作
  94. */
  95. onPullDownRefresh: function() {
  96. setTimeout(() => {
  97. uni.stopPullDownRefresh()
  98. }, 200);
  99. },
  100. }
  101. </script>
  102. <style>
  103. .tui-header {
  104. font-size: 24rpx;
  105. color: #999;
  106. padding: 16rpx 30rpx;
  107. }
  108. .tui-header text {
  109. font-weight: bold;
  110. padding-left: 12rpx;
  111. color: #333;
  112. }
  113. .tui-attr-box {
  114. width: 100%;
  115. padding: 24rpx 25rpx 0;
  116. box-sizing: border-box;
  117. font-size: 0;
  118. background-color: #fff;
  119. border-radius: 24rpx;
  120. }
  121. .tui-attr-item {
  122. max-width: 100%;
  123. min-width: 128rpx;
  124. height: 64rpx;
  125. display: -webkit-inline-flex;
  126. display: inline-flex;
  127. align-items: center;
  128. justify-content: center;
  129. background: #fcedea;
  130. padding: 0 26rpx;
  131. box-sizing: border-box;
  132. border-radius: 32rpx;
  133. margin-right: 20rpx;
  134. margin-bottom: 20rpx;
  135. font-size: 26rpx;
  136. border: 1rpx solid #fcedea;
  137. }
  138. .tui-attr-active {
  139. color: #e41f19;
  140. border: 1rpx solid #e41f19;
  141. }
  142. .tui-attr-item text {
  143. font-weight: bold;
  144. padding-left: 12rpx;
  145. }
  146. .tui-evaluate__box {
  147. width: 100%;
  148. padding: 25rpx;
  149. box-sizing: border-box;
  150. background-color: #ffffff;
  151. box-shadow: 0 3rpx 20rpx rgba(183, 183, 183, 0.1);
  152. overflow: hidden;
  153. margin-top: 20rpx;
  154. border-radius: 24rpx;
  155. }
  156. .tui-flex__center {
  157. display: flex;
  158. align-items: center;
  159. }
  160. .tui-avatar {
  161. width: 64rpx;
  162. height: 64rpx;
  163. border-radius: 50%;
  164. }
  165. .tui-nickname {
  166. font-size: 28rpx;
  167. padding-left: 12rpx;
  168. }
  169. .tui-content__box {
  170. width: 100%;
  171. padding: 0 30rpx;
  172. box-sizing: border-box;
  173. }
  174. .tui-rate__box {
  175. width: 100%;
  176. display: flex;
  177. justify-content: space-between;
  178. align-items: center;
  179. font-size: 24rpx;
  180. color: #999;
  181. padding: 24rpx 0;
  182. }
  183. .tui-desc {
  184. font-size: 28rpx;
  185. word-break: break-all;
  186. text-align: justify;
  187. }
  188. .tui-img__box {
  189. width: 100%;
  190. font-size: 0;
  191. padding-top: 4rpx;
  192. }
  193. .tui-img__box image {
  194. width: 200rpx;
  195. height: 200rpx;
  196. margin-right: 12rpx;
  197. margin-top: 12rpx;
  198. }
  199. .tui-image {
  200. width: 400rpx !important;
  201. height: auto;
  202. }
  203. .tui-op__box {
  204. width: 100%;
  205. padding-top: 24rpx;
  206. font-size: 24rpx;
  207. font-weight: 500;
  208. justify-content: space-between;
  209. }
  210. .tui-op-item {
  211. display: flex;
  212. align-items: center;
  213. margin-left: 40rpx;
  214. }
  215. .tui-op-item text {
  216. padding-right: 6rpx;
  217. }
  218. .tui-specs {
  219. font-size: 24rpx;
  220. color: #999;
  221. font-weight: 400;
  222. word-break: break-all;
  223. }
  224. .tui-color-red {
  225. color: #EB0909;
  226. }
  227. </style>