search.vue 3.7 KB

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