search.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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. if (!trackingNumber.value.trim()) {
  46. uni.showToast({
  47. title: '请输入运单号',
  48. icon: 'none'
  49. })
  50. return
  51. }
  52. uni.navigateTo({
  53. url:'/pages/logistics/index?orderNo=' + trackingNumber
  54. })
  55. return
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .container {
  60. width: 100%;
  61. min-height: 100vh;
  62. background: linear-gradient( 135deg, #CFE9FF 0%, #F5F7FA 50.86%);
  63. display: flex;
  64. flex-direction: column;
  65. }
  66. /* 导航栏样式 */
  67. .nav-bar {
  68. margin-top: 100rpx;
  69. width: 100%;
  70. height: 52rpx;
  71. display: flex;
  72. justify-content: center;
  73. align-items: center;
  74. .title {
  75. height: 52rpx;
  76. line-height: 52rpx;
  77. font-size: 36rpx;
  78. font-weight: 600;
  79. color: #333;
  80. }
  81. }
  82. /* 主体内容 */
  83. .main-content {
  84. flex: 1;
  85. display: flex;
  86. flex-direction: column;
  87. align-items: center;
  88. padding-top: 300rpx;
  89. }
  90. /* 公司信息区域 */
  91. .company-section {
  92. display: flex;
  93. flex-direction: column;
  94. align-items: center;
  95. margin-bottom: 72rpx;
  96. .logo-placeholder {
  97. width: 244rpx;
  98. height: 70rpx;
  99. display: flex;
  100. justify-content: center;
  101. align-items: center;
  102. .logo {
  103. width: 100%;
  104. height: 100%;
  105. }
  106. }
  107. .company-name {
  108. font-size: 40rpx;
  109. font-weight: 600;
  110. color: #000000;
  111. margin-bottom: 8rpx;
  112. }
  113. .company-en-name {
  114. font-size: 28rpx;
  115. color: #666666;
  116. letter-spacing: 2rpx;
  117. }
  118. }
  119. /* 搜索区域 */
  120. .search-section {
  121. width: 100%;
  122. padding: 0 32rpx;
  123. display: flex;
  124. flex-direction: column;
  125. align-items: center;
  126. .search-input-wrapper {
  127. width: 100%;
  128. height: 88rpx;
  129. background: #FFFFFF;
  130. border-radius: 44rpx;
  131. font-size: 28rpx;
  132. color: #333;
  133. border: 4rpx solid #1B64F0;
  134. padding: 6rpx;
  135. display: flex;
  136. justify-content: center;
  137. justify-items: center;
  138. align-items: center;
  139. .search-icon{
  140. width: 40rpx;
  141. height: 40rpx;
  142. margin-left: 18rpx;
  143. }
  144. .search-input {
  145. flex: 1;
  146. margin-left: 8rpx;
  147. margin-right: 8rpx;
  148. }
  149. .placeholder-style {
  150. color: #999999;
  151. }
  152. .search-btn {
  153. width: 160rpx;
  154. height: 76rpx;
  155. background: #1B64F0;
  156. border-radius: 38rpx;
  157. font-weight: 400;
  158. font-size: 32rpx;
  159. color: #FFFFFF;
  160. line-height: 76rpx;
  161. text-align: center;
  162. font-style: normal;
  163. }
  164. }
  165. }
  166. </style>