floors.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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">
  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. // this.initData(this.list)
  64. },
  65. computed: {
  66. ...mapState(['hasLogin'])
  67. },
  68. methods:{
  69. handleFloor(){
  70. this.$api.navigateTo('/pages/goods/good-floor')
  71. },
  72. initData(list){
  73. this.floorList = list
  74. },
  75. }
  76. }
  77. </script>
  78. <style lang="scss">
  79. .floors-content{
  80. width: 100%;
  81. height: auto;
  82. box-sizing: border-box;
  83. background: #FFFFFF;
  84. .tui-block__box {
  85. width: 100%;
  86. padding: 0 25rpx 25rpx;
  87. box-sizing: border-box;
  88. background-color: #ffffff;
  89. border-radius: 20rpx;
  90. overflow: hidden;
  91. }
  92. .tui-mtop__20 {
  93. margin-top: 20rpx;
  94. }
  95. .tui-group-name {
  96. width: 100%;
  97. line-height: 50rpx;
  98. font-weight: bold;
  99. text-align: center;
  100. padding: 24rpx 0 0 0;
  101. display: flex;
  102. align-items: center;
  103. justify-content: space-between;
  104. color: #333;
  105. }
  106. .tui-sub__desc {
  107. color: #333;
  108. font-size: 36rpx;
  109. font-weight: 400;
  110. }
  111. .tui-more__box {
  112. display: flex;
  113. align-items: center;
  114. font-weight: 400;
  115. color: #999;
  116. line-height: 50rpx;
  117. .iconfont{
  118. font-size: 28rpx;
  119. margin-left: 10rpx;
  120. }
  121. }
  122. .tui-more__box text{
  123. font-size: 24rpx;
  124. }
  125. .tui-goods__list {
  126. display: flex;
  127. align-items: center;
  128. }
  129. .tui-goods__item {
  130. background-color: #fff;
  131. width: 210rpx;
  132. height: 390rpx;
  133. border-radius: 6rpx;
  134. box-sizing: border-box;
  135. display: flex;
  136. align-items: center;
  137. justify-content: center;
  138. flex-direction: column;
  139. flex-shrink: 0;
  140. margin-right: 18rpx;
  141. }
  142. .tui-goods__imgbox {
  143. width: 210rpx;
  144. height: 210rpx;
  145. display: flex;
  146. align-items: center;
  147. justify-content: center;
  148. box-sizing: border-box;
  149. border-radius: 8rpx;
  150. }
  151. .tui-goods__img {
  152. max-width: 210rpx;
  153. max-height: 210rpx;
  154. display: block;
  155. border-radius: 8rpx;
  156. }
  157. .tui-goods__namebox{
  158. width: 210rpx;
  159. height: 80rpx;
  160. margin-top: 16rpx;
  161. line-height: 40rpx;
  162. text-overflow: ellipsis;
  163. display: -webkit-box;
  164. word-break: break-all;
  165. -webkit-box-orient: vertical;
  166. -webkit-line-clamp: 2;
  167. overflow: hidden;
  168. font-size: 26rpx;
  169. color: #333333;
  170. }
  171. .tui-pri__box {
  172. width: 210rpx;
  173. display: flex;
  174. justify-content: center;
  175. align-items: center;
  176. }
  177. .tui-sale-pri {
  178. width: 210rpx;
  179. display: flex;
  180. align-items: flex-end;
  181. padding: 10rpx 0 8rpx;
  182. box-sizing: border-box;
  183. font-size: 28rpx;
  184. line-height: 40rpx;
  185. color: #EE2727;
  186. white-space: nowrap;
  187. text-overflow: ellipsis;
  188. overflow: hidden;
  189. text-align: left;
  190. }
  191. .tui-no-price {
  192. width: 210rpx;
  193. height: 40rpx;
  194. line-height: 40rpx;
  195. display: flex;
  196. box-sizing: border-box;
  197. .p-no {
  198. line-height: 40rpx;
  199. font-size: $font-size-28;
  200. color: $text-color;
  201. display: inline-block;
  202. float: left;
  203. }
  204. .p-stars {
  205. float: left;
  206. }
  207. }
  208. .tui-size-sm {
  209. font-size: 24rpx;
  210. line-height: 24rpx;
  211. transform: scale(0.8);
  212. transform-origin: 0 50%;
  213. }
  214. .tui-original__pri {
  215. font-size: 24rpx;
  216. line-height: 24rpx;
  217. color: #999999;
  218. transform-origin: center 10%;
  219. transform: scale(0.8);
  220. display: flex;
  221. align-items: center;
  222. justify-content: center;
  223. text-decoration: line-through;
  224. }
  225. }
  226. </style>