home.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <!-- 首页 -->
  3. <view>
  4. <u-navbar bgColor="#4CAF50" placeholder>
  5. <view class="u-nav-slot" slot="left">
  6. <view class="buy_medicine">宝智达买药</view>
  7. <view class="same_row_in">
  8. <u-icon name="map" size="15" color="#fff"></u-icon>
  9. <view class="address_box">请选择收货地址</view>
  10. <u-icon name="arrow-right" color="#fff"></u-icon>
  11. </view>
  12. </view>
  13. </u-navbar>
  14. <view class="home_head_search">
  15. <u-search placeholder="请输入药品" borderColor="#4CAF50" v-model="keyword"></u-search>
  16. </view>
  17. <view class="center_in">
  18. <view style="margin-top: 20rpx;width: 95%;">
  19. <u-swiper :list="list1" indicator circular indicatorMode="dot"></u-swiper>
  20. </view>
  21. </view>
  22. <view class="box_notice">
  23. <u-notice-bar :text="notification" bgColor="#fff" color="#606266" :speed="30"></u-notice-bar>
  24. </view>
  25. <view style="padding: 0rpx 20rpx 20rpx 20rpx;">
  26. <u-scroll-list>
  27. <view class="box_classify">
  28. <view class="card_classify" v-for="(item, index) in list" :key="index">
  29. <image class="classify_img" :src="item.thumb"></image>
  30. <view>{{index + 1}}</view>
  31. </view>
  32. </view>
  33. </u-scroll-list>
  34. </view>
  35. <view class="title_store">门店列表</view>
  36. <view class="box_shop_list">
  37. <view class="box_shop_item" v-for="(item,index) in shopData" :key="index">
  38. <view class="store_img center_in">{{index + 1}}</view>
  39. <view class="home_box_content">
  40. <view class="home_name_shop">{{item.title}}</view>
  41. <view class="space_between" style="width: 100%;">
  42. <view style="display: flex;flex-direction: column;">
  43. <view class="subhead_title">距离您{{item.distance}}公里</view>
  44. <view class="subhead_title">营业时间:{{item.time}}</view>
  45. </view>
  46. <view class="box_enter_into center_in" @click="enterStore">进入门店</view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. keyword: '',
  58. list1: [
  59. "/static/image/swiper1.png",
  60. "/static/image/swiper2.png",
  61. "/static/image/swiper3.png",
  62. ],
  63. notification: '亲爱的顾客,宝智达商场标注【跨境】字样的所有产品均为跨境产品,不支持非质量问题的退单退款,请在您购买时仔细核实好订单内容,避免买错/买重/地址或联系方式错误,感谢您的理解与支持。',
  64. shopData: [{
  65. title: '阳光大药房',
  66. distance: 0.8,
  67. time: '08:00-22:00'
  68. }, {
  69. title: '阳光大药房',
  70. distance: 0.8,
  71. time: '08:00-22:00'
  72. }],
  73. list: [{
  74. thumb: "/static/image/swiper3.png",
  75. }, {
  76. thumb: "/static/image/swiper3.png",
  77. }, {
  78. thumb: "/static/image/swiper3.png",
  79. }, {
  80. thumb: "/static/image/swiper3.png",
  81. }, {
  82. thumb: "/static/image/swiper3.png",
  83. }, {
  84. thumb: "/static/image/swiper3.png",
  85. }, {
  86. thumb: "/static/image/swiper3.png",
  87. }, {
  88. thumb: "/static/image/swiper3.png",
  89. }, {
  90. thumb: "/static/image/swiper3.png",
  91. }, {
  92. thumb: "/static/image/swiper3.png",
  93. }, {
  94. thumb: "/static/image/swiper3.png",
  95. }, {
  96. thumb: "/static/image/swiper3.png",
  97. }, {
  98. thumb: "/static/image/swiper3.png",
  99. }, {
  100. thumb: "/static/image/swiper3.png",
  101. }, ],
  102. }
  103. },
  104. onLoad() {
  105. uni.setNavigationBarColor({
  106. frontColor: '#ffffff', // 前景色值,包括按钮、标题、状态栏的颜色
  107. backgroundColor: '#4CAF50', // 背景颜色值,有效的颜色值,Hex颜色值
  108. });
  109. },
  110. methods: {
  111. enterStore() {
  112. uni.navigateTo({
  113. url: '/pages/home/shop'
  114. });
  115. }
  116. }
  117. }
  118. </script>
  119. <style lang="scss">
  120. page {
  121. background-color: #fff;
  122. }
  123. .home_head_search {
  124. padding-top: 30rpx;
  125. margin: 0rpx 30rpx;
  126. }
  127. .u-nav-slot {
  128. display: flex;
  129. align-items: center;
  130. }
  131. .buy_medicine {
  132. font-size: 32rpx;
  133. color: #fff;
  134. margin-right: 15rpx;
  135. }
  136. .address_box {
  137. font-size: 28rpx;
  138. color: #fff;
  139. margin-left: 5rpx;
  140. }
  141. .title_store {
  142. padding: 0rpx 30rpx 10rpx 30rpx;
  143. font-size: 30rpx;
  144. font-weight: 600;
  145. }
  146. .box_shop_list {
  147. display: flex;
  148. flex-direction: column;
  149. margin: 0rpx 20rpx;
  150. }
  151. .box_shop_item {
  152. display: flex;
  153. background-color: #fff;
  154. margin: 10rpx;
  155. padding: 20rpx;
  156. border-radius: 10rpx;
  157. }
  158. .store_img {
  159. flex: none;
  160. width: 150rpx;
  161. height: 130rpx;
  162. background-color: #F3F4F6;
  163. }
  164. .subhead_title {
  165. margin-top: 10rpx;
  166. font-size: 28rpx;
  167. color: #82848a;
  168. }
  169. .home_box_content {
  170. display: flex;
  171. flex-direction: column;
  172. justify-content: space-between;
  173. width: calc(100% - 20rpx);
  174. margin-left: 20rpx;
  175. }
  176. .home_name_shop {
  177. font-size: 30rpx;
  178. font-weight: bold;
  179. }
  180. .box_enter_into {
  181. flex: none;
  182. width: fit-content;
  183. padding: 12rpx 20rpx;
  184. border-radius: 35rpx;
  185. color: #fff;
  186. font-size: 28rpx;
  187. background-color: $x-color;
  188. }
  189. .box_classify {
  190. display: flex;
  191. height: 370rpx;
  192. flex-direction: column;
  193. flex-wrap: wrap;
  194. }
  195. .card_classify {
  196. display: flex;
  197. align-items: center;
  198. flex-direction: column;
  199. margin: 20rpx 20rpx 0rpx 0rpx;
  200. }
  201. .classify_img {
  202. width: 120rpx;
  203. height: 120rpx;
  204. border-radius: 50%;
  205. }
  206. .box_notice ::v-deep .u-icon__icon {
  207. color: red !important;
  208. }
  209. ::v-deep .u-scroll-list {
  210. padding-bottom: 0px !important;
  211. }
  212. ::v-deep .u-scroll-list__indicator{
  213. margin: 0px !important;
  214. }
  215. </style>