floors.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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 floorList" :key="index">
  5. <view class="tui-group-name" >
  6. <view>
  7. <text class="tui-sub__desc tui-color__pink">{{ floor.title }}</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.image" 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. floorList:[
  61. {
  62. title:'集采商品',
  63. products:[
  64. {
  65. image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
  66. name:'法国曼丽菲戈动能素抗衰DER...',
  67. price:'5000.00',
  68. priceGrade:1
  69. },
  70. {
  71. image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
  72. name:'法国曼丽菲戈动能素抗衰DER...',
  73. price:'5000.00',
  74. priceGrade:2
  75. },
  76. {
  77. image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
  78. name:'法国曼丽菲戈动能素抗衰DER...',
  79. price:'5000.00',
  80. priceGrade:3
  81. },
  82. {
  83. image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
  84. name:'法国曼丽菲戈动能素抗衰DER...',
  85. price:'5000.00',
  86. priceGrade:4
  87. },
  88. {
  89. image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
  90. name:'法国曼丽菲戈动能素抗衰DER...',
  91. price:'5000.00',
  92. priceGrade:5
  93. }
  94. ]
  95. },
  96. {
  97. title:'热门商品',
  98. products:[
  99. {
  100. image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
  101. name:'法国曼丽菲戈动能素抗衰DER...',
  102. price:'5000.00',
  103. priceGrade:1
  104. },
  105. {
  106. image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
  107. name:'法国曼丽菲戈动能素抗衰DER...',
  108. price:'5000.00',
  109. priceGrade:2
  110. },
  111. {
  112. image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
  113. name:'法国曼丽菲戈动能素抗衰DER...',
  114. price:'5000.00',
  115. priceGrade:3
  116. },
  117. {
  118. image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
  119. name:'法国曼丽菲戈动能素抗衰DER...',
  120. price:'5000.00',
  121. priceGrade:3
  122. },
  123. {
  124. image:'https://img0.baidu.com/it/u=2849507481,2245399031&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
  125. name:'法国曼丽菲戈动能素抗衰DER...',
  126. price:'5000.00',
  127. priceGrade:5
  128. }
  129. ]
  130. }
  131. ]
  132. }
  133. },
  134. created(){
  135. // this.initData(this.list)
  136. },
  137. computed: {
  138. ...mapState(['hasLogin'])
  139. },
  140. methods:{
  141. handleFloor(){
  142. this.$api.navigateTo('/pages/goods/good-floor')
  143. },
  144. initData(list){
  145. this.floorList = list
  146. },
  147. }
  148. }
  149. </script>
  150. <style lang="scss">
  151. .floors-content{
  152. width: 100%;
  153. height: auto;
  154. box-sizing: border-box;
  155. background: #FFFFFF;
  156. .tui-block__box {
  157. width: 100%;
  158. padding: 0 25rpx 25rpx;
  159. box-sizing: border-box;
  160. background-color: #ffffff;
  161. border-radius: 20rpx;
  162. overflow: hidden;
  163. }
  164. .tui-mtop__20 {
  165. margin-top: 20rpx;
  166. }
  167. .tui-group-name {
  168. width: 100%;
  169. line-height: 50rpx;
  170. font-weight: bold;
  171. text-align: center;
  172. padding: 24rpx 0 0 0;
  173. display: flex;
  174. align-items: center;
  175. justify-content: space-between;
  176. color: #333;
  177. }
  178. .tui-sub__desc {
  179. color: #333;
  180. font-size: 36rpx;
  181. font-weight: 400;
  182. }
  183. .tui-more__box {
  184. display: flex;
  185. align-items: center;
  186. font-weight: 400;
  187. color: #999;
  188. line-height: 50rpx;
  189. .iconfont{
  190. font-size: 28rpx;
  191. margin-left: 10rpx;
  192. }
  193. }
  194. .tui-more__box text{
  195. font-size: 24rpx;
  196. }
  197. .tui-goods__list {
  198. display: flex;
  199. align-items: center;
  200. }
  201. .tui-goods__item {
  202. background-color: #fff;
  203. width: 210rpx;
  204. height: 390rpx;
  205. border-radius: 6rpx;
  206. box-sizing: border-box;
  207. display: flex;
  208. align-items: center;
  209. justify-content: center;
  210. flex-direction: column;
  211. flex-shrink: 0;
  212. margin-right: 18rpx;
  213. }
  214. .tui-goods__imgbox {
  215. width: 210rpx;
  216. height: 210rpx;
  217. display: flex;
  218. align-items: center;
  219. justify-content: center;
  220. box-sizing: border-box;
  221. border-radius: 8rpx;
  222. }
  223. .tui-goods__img {
  224. max-width: 210rpx;
  225. max-height: 210rpx;
  226. display: block;
  227. border-radius: 8rpx;
  228. }
  229. .tui-goods__namebox{
  230. width: 210rpx;
  231. height: 80rpx;
  232. margin-top: 16rpx;
  233. line-height: 40rpx;
  234. text-overflow: ellipsis;
  235. display: -webkit-box;
  236. word-break: break-all;
  237. -webkit-box-orient: vertical;
  238. -webkit-line-clamp: 2;
  239. overflow: hidden;
  240. font-size: 26rpx;
  241. color: #333333;
  242. }
  243. .tui-pri__box {
  244. width: 210rpx;
  245. display: flex;
  246. justify-content: center;
  247. align-items: center;
  248. }
  249. .tui-sale-pri {
  250. width: 210rpx;
  251. display: flex;
  252. align-items: flex-end;
  253. padding: 10rpx 0 8rpx;
  254. box-sizing: border-box;
  255. font-size: 28rpx;
  256. line-height: 40rpx;
  257. color: #EE2727;
  258. white-space: nowrap;
  259. text-overflow: ellipsis;
  260. overflow: hidden;
  261. text-align: left;
  262. }
  263. .tui-no-price {
  264. width: 210rpx;
  265. height: 40rpx;
  266. line-height: 40rpx;
  267. display: flex;
  268. box-sizing: border-box;
  269. .p-no {
  270. line-height: 40rpx;
  271. font-size: $font-size-28;
  272. color: $text-color;
  273. display: inline-block;
  274. float: left;
  275. }
  276. .p-stars {
  277. float: left;
  278. }
  279. }
  280. .tui-size-sm {
  281. font-size: 24rpx;
  282. line-height: 24rpx;
  283. transform: scale(0.8);
  284. transform-origin: 0 50%;
  285. }
  286. .tui-original__pri {
  287. font-size: 24rpx;
  288. line-height: 24rpx;
  289. color: #999999;
  290. transform-origin: center 10%;
  291. transform: scale(0.8);
  292. display: flex;
  293. align-items: center;
  294. justify-content: center;
  295. text-decoration: line-through;
  296. }
  297. }
  298. </style>