search.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <view class="container">
  3. <!-- 导航栏 -->
  4. <view class="nav-bar">
  5. <text class="title">查快递</text>
  6. </view>
  7. <!-- 主体内容 -->
  8. <view class="main-content">
  9. <!-- Logo 和公司名称 -->
  10. <view class="company-section">
  11. <view class="logo-placeholder">
  12. <!-- 这里可以使用网络图片或本地图标 -->
  13. <image class="logo" src="@/static/img/logo.png" mode="aspectFit" />
  14. </view>
  15. <!-- <text class="company-name">瑞鲸科技</text>
  16. <text class="company-en-name">REJOIN</text> -->
  17. </view>
  18. <!-- 搜索区域 -->
  19. <view class="search-section">
  20. <view class="search-input-wrapper">
  21. <image class="search-icon" src="@/static/img/search.png" />
  22. <input class="search-input" placeholder="请输入要查询的运单号" placeholder-class="placeholder-style"
  23. @focus="onInputFocus" @blur="onInputBlur" v-model="trackingNumber" />
  24. <view class="search-btn" @click="handleSearch">
  25. 搜索
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script setup>
  33. import {
  34. ref
  35. } from 'vue'
  36. const trackingNumber = ref('')
  37. const isInputFocused = ref(false)
  38. const onInputFocus = () => {
  39. isInputFocused.value = true
  40. }
  41. const onInputBlur = () => {
  42. isInputFocused.value = false
  43. }
  44. const handleSearch = () => {
  45. uni.navigateTo({
  46. url:'/pages/logistics/index'
  47. })
  48. return
  49. if (!trackingNumber.value.trim()) {
  50. uni.showToast({
  51. title: '请输入运单号',
  52. icon: 'none'
  53. })
  54. return
  55. }
  56. // 这里处理搜索逻辑
  57. console.log('搜索运单号:', trackingNumber.value)
  58. uni.showLoading({
  59. title: '查询中...'
  60. })
  61. // 模拟API调用
  62. setTimeout(() => {
  63. uni.hideLoading()
  64. uni.showToast({
  65. title: '查询成功',
  66. icon: 'success'
  67. })
  68. }, 1500)
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .container {
  73. width: 100%;
  74. min-height: 100vh;
  75. background: linear-gradient( 135deg, #CFE9FF 0%, #F5F7FA 50.86%);
  76. display: flex;
  77. flex-direction: column;
  78. }
  79. /* 导航栏样式 */
  80. .nav-bar {
  81. margin-top: 100rpx;
  82. width: 100%;
  83. height: 52rpx;
  84. display: flex;
  85. justify-content: center;
  86. align-items: center;
  87. .title {
  88. height: 52rpx;
  89. line-height: 52rpx;
  90. font-size: 36rpx;
  91. font-weight: 600;
  92. color: #333;
  93. }
  94. }
  95. /* 主体内容 */
  96. .main-content {
  97. flex: 1;
  98. display: flex;
  99. flex-direction: column;
  100. align-items: center;
  101. padding-top: 300rpx;
  102. }
  103. /* 公司信息区域 */
  104. .company-section {
  105. display: flex;
  106. flex-direction: column;
  107. align-items: center;
  108. margin-bottom: 72rpx;
  109. .logo-placeholder {
  110. width: 244rpx;
  111. height: 70rpx;
  112. display: flex;
  113. justify-content: center;
  114. align-items: center;
  115. .logo {
  116. width: 100%;
  117. height: 100%;
  118. }
  119. }
  120. .company-name {
  121. font-size: 40rpx;
  122. font-weight: 600;
  123. color: #000000;
  124. margin-bottom: 8rpx;
  125. }
  126. .company-en-name {
  127. font-size: 28rpx;
  128. color: #666666;
  129. letter-spacing: 2rpx;
  130. }
  131. }
  132. /* 搜索区域 */
  133. .search-section {
  134. width: 100%;
  135. padding: 0 32rpx;
  136. display: flex;
  137. flex-direction: column;
  138. align-items: center;
  139. .search-input-wrapper {
  140. width: 100%;
  141. height: 88rpx;
  142. background: #FFFFFF;
  143. border-radius: 44rpx;
  144. font-size: 28rpx;
  145. color: #333;
  146. border: 4rpx solid #1B64F0;
  147. padding: 6rpx;
  148. display: flex;
  149. justify-content: center;
  150. justify-items: center;
  151. align-items: center;
  152. .search-icon{
  153. width: 40rpx;
  154. height: 40rpx;
  155. margin-left: 18rpx;
  156. }
  157. .search-input {
  158. flex: 1;
  159. margin-left: 8rpx;
  160. margin-right: 8rpx;
  161. }
  162. .placeholder-style {
  163. color: #999999;
  164. }
  165. .search-btn {
  166. width: 160rpx;
  167. height: 76rpx;
  168. background: #1B64F0;
  169. border-radius: 38rpx;
  170. font-weight: 400;
  171. font-size: 32rpx;
  172. color: #FFFFFF;
  173. line-height: 76rpx;
  174. text-align: center;
  175. font-style: normal;
  176. }
  177. }
  178. }
  179. </style>