floors.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template name="floors">
  2. <view>
  3. <view class="floors-content clearfix">
  4. <view class="tui-block__box tui-mtop__20" v-for="(floor,index) in list" :key="index">
  5. <view class="tui-group-name" >
  6. <view>
  7. <text class="tui-sub__desc tui-color__pink">{{ floor.topic }}</text>
  8. </view>
  9. <view class="tui-more__box" @click="handleFloor(floor)">
  10. <text>更多</text>
  11. <text class="iconfont icon-xiangyou"></text>
  12. </view>
  13. </view>
  14. <scroll-view scroll-x>
  15. <view class="tui-goods__list">
  16. <view class="tui-goods__item" @tap="group(2)" v-for="pros in floor.products">
  17. <view class="tui-goods__imgbox">
  18. <image :src="pros.mainImage" mode="widthFix" class="tui-goods__img"></image>
  19. </view>
  20. <view class="tui-goods__namebox">
  21. <text>{{ pros.name }}</text>
  22. </view>
  23. <view class="tui-pri__box">
  24. <view class="tui-sale-pri" v-if="!hasLogin">
  25. ¥{{ pros.price }}
  26. </view>
  27. <view v-else class="tui-no-price">
  28. <view class="p-stars">
  29. <!-- <text class="p-no">¥</text> -->
  30. <uni-grader
  31. :grade="pros.priceGrade"
  32. :margin="14"
  33. ></uni-grader>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </scroll-view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import { mapState, mapMutations } from 'vuex'
  46. import uniGrader from '@/components/uni-grade/uni-grade.vue'
  47. export default{
  48. name:'floors',
  49. components: {
  50. uniGrader
  51. },
  52. props:{
  53. list:{
  54. type:Array
  55. }
  56. },
  57. data() {
  58. return{
  59. current:100,
  60. }
  61. },
  62. created(){
  63. },
  64. computed: {
  65. ...mapState(['hasLogin'])
  66. },
  67. methods:{
  68. handleFloor(floor){
  69. this.$api.navigateTo(`/pages/goods/good-floor?id=${floor.id}`)
  70. },
  71. initData(list){
  72. this.floorList = list
  73. },
  74. }
  75. }
  76. </script>
  77. <style lang="scss">
  78. .floors-content{
  79. width: 100%;
  80. height: auto;
  81. box-sizing: border-box;
  82. background: #FFFFFF;
  83. .tui-block__box {
  84. width: 100%;
  85. padding: 0 25rpx 25rpx;
  86. box-sizing: border-box;
  87. background-color: #ffffff;
  88. border-radius: 20rpx;
  89. overflow: hidden;
  90. }
  91. .tui-mtop__20 {
  92. margin-top: 20rpx;
  93. }
  94. .tui-group-name {
  95. width: 100%;
  96. line-height: 50rpx;
  97. font-weight: bold;
  98. text-align: center;
  99. padding: 24rpx 0 0 0;
  100. display: flex;
  101. align-items: center;
  102. justify-content: space-between;
  103. color: #333;
  104. }
  105. .tui-sub__desc {
  106. color: #333;
  107. font-size: 36rpx;
  108. font-weight: 400;
  109. }
  110. .tui-more__box {
  111. display: flex;
  112. align-items: center;
  113. font-weight: 400;
  114. color: #999;
  115. line-height: 50rpx;
  116. .iconfont{
  117. font-size: 28rpx;
  118. margin-left: 10rpx;
  119. }
  120. }
  121. .tui-more__box text{
  122. font-size: 24rpx;
  123. }
  124. .tui-goods__list {
  125. display: flex;
  126. align-items: center;
  127. }
  128. .tui-goods__item {
  129. background-color: #fff;
  130. width: 210rpx;
  131. height: 390rpx;
  132. border-radius: 6rpx;
  133. box-sizing: border-box;
  134. display: flex;
  135. align-items: center;
  136. justify-content: center;
  137. flex-direction: column;
  138. flex-shrink: 0;
  139. margin-right: 18rpx;
  140. }
  141. .tui-goods__imgbox {
  142. width: 210rpx;
  143. height: 210rpx;
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. box-sizing: border-box;
  148. border-radius: 8rpx;
  149. }
  150. .tui-goods__img {
  151. max-width: 210rpx;
  152. max-height: 210rpx;
  153. display: block;
  154. border-radius: 8rpx;
  155. }
  156. .tui-goods__namebox{
  157. width: 210rpx;
  158. height: 80rpx;
  159. margin-top: 16rpx;
  160. line-height: 40rpx;
  161. text-overflow: ellipsis;
  162. display: -webkit-box;
  163. word-break: break-all;
  164. -webkit-box-orient: vertical;
  165. -webkit-line-clamp: 2;
  166. overflow: hidden;
  167. font-size: 26rpx;
  168. color: #333333;
  169. }
  170. .tui-pri__box {
  171. width: 210rpx;
  172. display: flex;
  173. justify-content: center;
  174. align-items: center;
  175. }
  176. .tui-sale-pri {
  177. width: 210rpx;
  178. display: flex;
  179. align-items: flex-end;
  180. padding: 10rpx 0 8rpx;
  181. box-sizing: border-box;
  182. font-size: 28rpx;
  183. line-height: 40rpx;
  184. color: #EE2727;
  185. white-space: nowrap;
  186. text-overflow: ellipsis;
  187. overflow: hidden;
  188. text-align: left;
  189. }
  190. .tui-no-price {
  191. width: 210rpx;
  192. height: 40rpx;
  193. line-height: 40rpx;
  194. display: flex;
  195. box-sizing: border-box;
  196. .p-no {
  197. line-height: 40rpx;
  198. font-size: $font-size-28;
  199. color: $text-color;
  200. display: inline-block;
  201. float: left;
  202. }
  203. .p-stars {
  204. float: left;
  205. }
  206. }
  207. .tui-size-sm {
  208. font-size: 24rpx;
  209. line-height: 24rpx;
  210. transform: scale(0.8);
  211. transform-origin: 0 50%;
  212. }
  213. .tui-original__pri {
  214. font-size: 24rpx;
  215. line-height: 24rpx;
  216. color: #999999;
  217. transform-origin: center 10%;
  218. transform: scale(0.8);
  219. display: flex;
  220. align-items: center;
  221. justify-content: center;
  222. text-decoration: line-through;
  223. }
  224. }
  225. </style>