爱简收旧衣按件回收前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

184 lines
4.7 KiB

2 weeks ago
2 weeks ago
2 weeks ago
2 weeks ago
2 weeks ago
  1. <template>
  2. <view class="byc-container" :style="{paddingTop: (statusBarHeight + 88) + 'rpx'}">
  3. <!-- 顶部导航栏 -->
  4. <view class="nav-bar" :style="{height: (statusBarHeight + 88) + 'rpx', paddingTop: statusBarHeight + 'px'}">
  5. <view class="back" @tap="goBack">
  6. <uni-icons type="left" size="20" color="#fff"></uni-icons>
  7. </view>
  8. <!-- <text class="title">包邮服务城市</text> -->
  9. </view>
  10. <!-- 蓝色banner卡片 -->
  11. <view class="byc-banner">
  12. <image class="byc-banner-img" src="https://oss.budingxiaoshuo.com/upload/已开通包邮服务的城市-banner_1748252607736.png" mode="widthFix" />
  13. </view>
  14. <!-- 主内容卡片 -->
  15. <view class="byc-main-card">
  16. <view class="byc-main-title">已开通包邮服务的城市</view>
  17. <view class="byc-main-desc">
  18. 我们很高兴为以下城市的用户提供一键包邮的便捷服务进一步简化旧衣回收流程降低参与环保行动的门槛期待未来能将这一服务拓展至更多地区邀请全国人民共同投身于旧衣回收的环保事业中
  19. </view>
  20. <view class="byc-dashed-line"></view>
  21. <view class="byc-province-list">
  22. <view class="byc-province-item" v-for="(province, idx) in cityList" :key="province.id">
  23. <view class="byc-province-name">{{ province.name }}</view>
  24. <view class="byc-city-list">
  25. <text v-for="(city, cidx) in (province.children || [])" :key="city.id" class="byc-city">
  26. <text v-if="cidx !== 0" class="byc-dot">·</text>{{ city.name }}
  27. </text>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. statusBarHeight: 0,
  39. navBarHeight: 88, // 默认
  40. menuButtonInfo: null,
  41. cityList: [],
  42. bannerTop: 0 // banner距离顶部距离
  43. }
  44. },
  45. onLoad() {
  46. const sysInfo = uni.getSystemInfoSync()
  47. this.statusBarHeight = sysInfo.statusBarHeight
  48. let menuButtonInfo = null
  49. try {
  50. menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  51. } catch (e) {}
  52. this.menuButtonInfo = menuButtonInfo
  53. if (menuButtonInfo && menuButtonInfo.height) {
  54. // 导航栏高度 = 胶囊 bottom + top - 状态栏高度
  55. this.navBarHeight = menuButtonInfo.bottom + menuButtonInfo.top - sysInfo.statusBarHeight
  56. } else {
  57. this.navBarHeight = 88 // 兜底
  58. }
  59. this.bannerTop = this.statusBarHeight + this.navBarHeight
  60. this.$api('getFreeCityList', {}, res => {
  61. if (res && res.success && Array.isArray(res.result)) {
  62. this.cityList = res.result.filter(item => item.open === 'Y');
  63. // console.log(this.cityList);
  64. }
  65. });
  66. },
  67. methods: {
  68. goBack() {
  69. uni.navigateBack()
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .byc-container {
  76. min-height: 100vh;
  77. background: #f8f8f8;
  78. padding-bottom: env(safe-area-inset-bottom);
  79. }
  80. .nav-bar {
  81. background: #2180ee;
  82. position: fixed;
  83. top: 0;
  84. left: 0;
  85. right: 0;
  86. z-index: 999;
  87. // padding: 0 30rpx;
  88. }
  89. .back {
  90. width: 100%;
  91. padding: 10rpx;
  92. color: #fff;
  93. // margin-left: -20rpx;
  94. left: 0;
  95. display: flex;
  96. align-items: center;
  97. // justify-content: center;
  98. }
  99. .byc-banner {
  100. margin: 0;
  101. // border-radius: 24rpx;
  102. overflow: hidden;
  103. box-shadow: 0 4rpx 24rpx rgba(60, 167, 250, 0.10);
  104. background: none;
  105. position: relative;
  106. z-index: 1;
  107. }
  108. .byc-banner-left {
  109. flex: 1;
  110. }
  111. .byc-banner-title {
  112. color: #fff;
  113. font-size: 44rpx;
  114. font-weight: bold;
  115. margin-bottom: 16rpx;
  116. text-shadow: 0 4rpx 12rpx rgba(0,0,0,0.12);
  117. }
  118. .byc-banner-desc {
  119. color: #e3f2fd;
  120. font-size: 28rpx;
  121. margin-top: 4rpx;
  122. }
  123. .byc-banner-img {
  124. width: 100%;
  125. display: block;
  126. }
  127. .byc-main-card {
  128. background: #fff;
  129. border-radius: 36rpx;
  130. margin: -60rpx 0 0 0;
  131. box-shadow: 0 8rpx 32rpx rgba(60, 167, 250, 0.08);
  132. padding: 48rpx 32rpx 32rpx 32rpx;
  133. position: relative;
  134. z-index: 2;
  135. }
  136. .byc-main-title {
  137. font-size: 36rpx;
  138. font-weight: bold;
  139. color: #222;
  140. margin-bottom: 24rpx;
  141. }
  142. .byc-main-desc {
  143. color: #888;
  144. font-size: 28rpx;
  145. line-height: 1.7;
  146. margin-bottom: 32rpx;
  147. }
  148. .byc-dashed-line {
  149. border-bottom: 2rpx dashed #e5e5e5;
  150. margin-bottom: 32rpx;
  151. }
  152. .byc-province-list {
  153. .byc-province-item {
  154. margin-bottom: 36rpx;
  155. &:last-child { margin-bottom: 0; }
  156. }
  157. .byc-province-name {
  158. font-size: 32rpx;
  159. font-weight: bold;
  160. color: #222;
  161. margin-bottom: 12rpx;
  162. }
  163. .byc-city-list {
  164. display: flex;
  165. flex-wrap: wrap;
  166. font-size: 28rpx;
  167. color: #999;
  168. line-height: 1.7;
  169. }
  170. .byc-city {
  171. margin-right: 18rpx;
  172. display: flex;
  173. align-items: center;
  174. }
  175. .byc-dot {
  176. margin-right: 8rpx;
  177. color: #bbb;
  178. font-size: 28rpx;
  179. }
  180. }
  181. </style>