classify.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view class="w-full">
  3. <!-- <top-search :isSearch="false" @searchClick="searchClick"></top-search>
  4. <view class="w-full padding-lr-sm box-sizing-b dflex-b">
  5. <scroll-view class="goods-category" scroll-x>
  6. <view class="category-box">
  7. <view class="category-item padding-lr-lg" v-for="item in 8" :key="item" :class="{'on-category':onIndex === item}">分类{{item+1}}</view>
  8. </view>
  9. </scroll-view>
  10. <view class="classify-icon">
  11. <u-icon name="grid-fill" size="30" @click="show = true" />
  12. </view>
  13. </view>
  14. <u-popup :show="show" mode="left" @close="show = false">
  15. <view class="classify-popup padding-lr-lg padding-tb box-sizing-b">
  16. <view class="padding-tb-sm">全部</view>
  17. <view class="padding-tb-sm" v-for="index in 8">分类{{index+1}}</view>
  18. </view>
  19. </u-popup> -->
  20. <view class="w-full dflex-b padding-sm box-sizing-b dflex-wrap-w">
  21. <view class="goods-item margin-bottom-sm" v-for="index in 4" :key="index">
  22. <view class="img dflex-c">
  23. <image mode="aspectFit" :src="'../../static/x'+ index%2 +'.jpg'"></image>
  24. </view>
  25. <view class="title">我是标题我是标题我是标题我是标题</view>
  26. <view class="dflex padding-bottom-xs">
  27. <u-tag text="夏季校服" type="error" bgColor="#E8341F" size="mini"></u-tag>
  28. </view>
  29. <view class="w-full dflex-b">
  30. <view class="price">23.30</view>
  31. <u-tag text="加购" bgColor="#000" shape="circle" size="mini" @click="goCart"></u-tag>
  32. </view>
  33. </view>
  34. </view>
  35. <my-gap :height="130" />
  36. <view class="cart-bottom padding-sm dflex-b">
  37. <view class="cart padding-lr">
  38. <uni-badge size="small" :text="100" absolute="rightTop">
  39. <u-icon name="shopping-cart-fill" size="28" color="#FF873D" @click="showCart"></u-icon>
  40. </uni-badge>
  41. <text class="cart-total">¥35.60</text>
  42. </view>
  43. <view class="balance dflex-c">去结算</view>
  44. </view>
  45. <cartPopupVue ref="cartPopup" />
  46. </view>
  47. </template>
  48. <script>
  49. import cartPopupVue from '../../components/cartPopup.vue'
  50. export default {
  51. components:{cartPopupVue},
  52. data() {
  53. return {
  54. onIndex:0,
  55. show:false
  56. }
  57. },
  58. methods: {
  59. // 加购
  60. goCart(){},
  61. showCart(){
  62. this.$refs.cartPopup.setShow(true);
  63. }
  64. }
  65. }
  66. </script>
  67. <style scoped lang="scss">
  68. .goods-category{
  69. width: calc(100% - 100rpx);
  70. border-radius: 14rpx;
  71. overflow: hidden;
  72. .category-box{
  73. height: 70rpx;
  74. width: 100%;
  75. display: flex;
  76. align-items: center;
  77. .category-item{
  78. font-size: 14px;
  79. flex-shrink: 0;
  80. height: 100%;
  81. line-height: 70rpx;
  82. }
  83. .on-category{
  84. color: #FFF;
  85. background-color: #000;
  86. }
  87. }
  88. .classify-icon{
  89. width: 100rpx;
  90. display: flex;
  91. align-items: center;
  92. justify-content: flex-end;
  93. }
  94. }
  95. .goods-item{
  96. width: 48%;
  97. overflow: hidden;
  98. box-sizing: border-box;
  99. border:solid 4px #FFF;
  100. border-radius: 5px;
  101. box-shadow: 0px 3px 10px 0px rgba(213,221,232,0.5);
  102. .img{
  103. width: 100%;
  104. height: 350rpx;
  105. overflow: hidden;
  106. background: #EEE;
  107. }
  108. .title{
  109. width: 100%;
  110. overflow: hidden;
  111. white-space: nowrap;
  112. text-overflow: ellipsis;
  113. padding: 10rpx;
  114. }
  115. }
  116. .cart-bottom{
  117. width: 100%;
  118. position: fixed;
  119. left: 0;
  120. bottom: 0;
  121. height: 130rpx;
  122. box-sizing: border-box;
  123. background-color: #FFF;
  124. box-shadow: 0px -4px 16px 0px rgba(0,0,0,0.15);
  125. z-index: 10800;
  126. .cart{
  127. width: calc(100% - 220rpx);
  128. border-radius: 5px;
  129. background-color: #FEEEE4;
  130. display: flex;
  131. align-items: center;
  132. height: 100%;
  133. .cart-total{
  134. padding-left: 40rpx;
  135. font-size: 16px;
  136. font-weight: 700;
  137. }
  138. }
  139. .balance{
  140. width: 200rpx;
  141. height: 100%;
  142. background-color: #FF0000;
  143. font-size: $uni-font-size-lg;
  144. border-radius: 5px;
  145. color: #FFF;
  146. }
  147. }
  148. .classify-popup{
  149. width: 400rpx;
  150. }
  151. </style>