shop.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view>
  3. <u-navbar placeholder leftIconSize="22px" @leftClick="leftClick">
  4. <view class="u-nav-slot" slot="center">
  5. <!-- <u-icon name="arrow-left" size="22" @leftClick="leftClick"></u-icon> -->
  6. <view>
  7. <u-search v-model="keyword" height="60rpx" placeholder="请输入药品" borderColor="#4CAF50" bgColor="#fff"
  8. :showAction="false"></u-search>
  9. </view>
  10. </view>
  11. </u-navbar>
  12. <view class="box_shop_card">
  13. <view class="box_shop_item" @click="goMerchant">
  14. <view class="store_img center_in">{{ 1}}</view>
  15. <view class="home_box_content">
  16. <view class="home_name_shop">阳关大药房</view>
  17. <view class="subhead_title">距离您 0.8 公里</view>
  18. <view class="subhead_title">营业时间:08:00-22:00</view>
  19. </view>
  20. </view>
  21. <view class="shop_tabs_box">
  22. <view class="item_tab_box" v-for="(item,index) in list" :key="index">
  23. <view class="box_shop">{{index+1}}</view>
  24. <view class="tab_title">{{item.title}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="card_commodity">
  29. <view class="box_shop_commodity" v-for="(item,index) in shopList" :key="index" @click="goDetails">
  30. <view class="image_shop_drug">{{index + 1}}</view>
  31. <view class="shop_headline">{{item.title}}</view>
  32. <view class="shop_subhead">{{item.title}}</view>
  33. <view class="space_between box_trolley">
  34. <view class="font_green title_money">¥{{item.money}}</view>
  35. <view class="shopping_cart">加入购物车</view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. keyword: '',
  46. list: [{
  47. title: '感冒药'
  48. }, {
  49. title: '维生素'
  50. }, {
  51. title: '医疗器械'
  52. }, {
  53. title: '外用药'
  54. }, {
  55. title: '中药'
  56. }],
  57. shopList: [{
  58. title: '布洛芬环视胶囊',
  59. money: 29.8,
  60. }, {
  61. title: '维生素c片',
  62. money: 29.8,
  63. }, {
  64. title: '布洛芬环视胶囊',
  65. money: 29.8,
  66. }, {
  67. title: '布洛芬环视胶囊',
  68. money: 29.8,
  69. }, {
  70. title: '维生素c片',
  71. money: 29.8,
  72. }]
  73. }
  74. },
  75. methods: {
  76. leftClick() {
  77. uni.navigateBack({
  78. delta: 1
  79. });
  80. },
  81. // 商品详情
  82. goDetails() {
  83. uni.navigateTo({
  84. url: '/pages/home/productDetails'
  85. });
  86. },
  87. // 商家资质
  88. goMerchant() {
  89. uni.navigateTo({
  90. url: '/pages/home/certification'
  91. });
  92. }
  93. }
  94. }
  95. </script>
  96. <style lang="scss">
  97. .u-nav-slot {
  98. width: 75%;
  99. // width: calc(100% - 88rpx);
  100. display: flex;
  101. justify-content: flex-start;
  102. // margin-left: 70rpx;
  103. }
  104. ::v-deep .u-navbar__content {
  105. justify-content: flex-end;
  106. }
  107. .box_shop_card {
  108. background-color: #fff;
  109. }
  110. .box_shop_item {
  111. display: flex;
  112. padding: 20rpx;
  113. border-radius: 10rpx;
  114. }
  115. .store_img {
  116. flex: none;
  117. width: 150rpx;
  118. height: 130rpx;
  119. background-color: #F3F4F6;
  120. }
  121. .subhead_title {
  122. margin-top: 8rpx;
  123. font-size: 28rpx;
  124. color: #82848a;
  125. }
  126. .home_box_content {
  127. display: flex;
  128. flex-direction: column;
  129. justify-content: space-between;
  130. width: calc(100% - 20rpx);
  131. margin-left: 20rpx;
  132. }
  133. .home_name_shop {
  134. font-size: 30rpx;
  135. font-weight: bold;
  136. }
  137. .shop_tabs_box {
  138. display: flex;
  139. justify-content: space-evenly;
  140. padding-bottom: 20rpx;
  141. }
  142. .item_tab_box {
  143. display: flex;
  144. flex-direction: column;
  145. align-items: center;
  146. }
  147. .box_shop {
  148. width: 80rpx;
  149. height: 80rpx;
  150. background-color: #F3F4F6;
  151. }
  152. .tab_title {
  153. font-size: 30rpx;
  154. margin-top: 5rpx;
  155. }
  156. .card_commodity {
  157. display: grid;
  158. grid-template-columns: repeat(2, 1fr);
  159. grid-column-gap: 20rpx;
  160. padding: 20rpx;
  161. }
  162. .image_shop_drug {
  163. width: 100%;
  164. height: 200rpx;
  165. background-color: #F3F4F6;
  166. }
  167. .box_shop_commodity {
  168. padding: 10px;
  169. break-inside: avoid;
  170. flex: none;
  171. // display: grid;
  172. margin-bottom: 20rpx;
  173. background-color: #fff;
  174. border-radius: 10px;
  175. }
  176. .shop_headline {
  177. font-size: 30rpx;
  178. font-weight: bold;
  179. padding: 10rpx 0rpx;
  180. }
  181. .shop_subhead {
  182. font-size: 26rpx;
  183. }
  184. .box_trolley {
  185. margin-top: 10rpx;
  186. }
  187. .title_money {
  188. font-weight: bold;
  189. }
  190. .shopping_cart {
  191. background-color: $x-color;
  192. padding: 6px 10px;
  193. border-radius: 30px;
  194. color: #fff;
  195. font-size: 24rpx;
  196. }
  197. </style>