classify.vue 4.6 KB

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