classify.vue 5.0 KB

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