jobSearch.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <template>
  2. <view class="job-search-page">
  3. <!-- 自定义导航栏 -->
  4. <view class="custom-navbar">
  5. <view class="navbar-content">
  6. <view class="nav-left" @click="goBack">
  7. <u-icon name="arrow-leftward" color="#333" size="42"></u-icon>
  8. </view>
  9. <view class="nav-title">职位搜索</view>
  10. <view class="nav-right"></view>
  11. </view>
  12. </view>
  13. <!-- 主要内容 -->
  14. <view class="main-content">
  15. <!-- 搜索框区域 -->
  16. <view class="search-section">
  17. <view class="search-container">
  18. <view class="search-input-container">
  19. <u-icon name="search" color="#999" size="36" class="search-icon"></u-icon>
  20. <input
  21. class="search-input"
  22. placeholder="搜索职位或公司"
  23. v-model="searchKeyword"
  24. />
  25. </view>
  26. <view class="search-btn" @click="handleSearch">
  27. <text class="search-btn-text">搜索</text>
  28. </view>
  29. </view>
  30. </view>
  31. <!-- 历史搜索 -->
  32. <view class="history-section">
  33. <view class="section-header">
  34. <text class="section-title">历史搜索</text>
  35. <image src="../../static/images/shanchu22.svg" style="width: 32rpx; height: 32rpx;" mode="aspectFit" @click="clearHistory"></image>
  36. </view>
  37. <view class="history-tags">
  38. <view
  39. class="history-tag"
  40. v-for="(item, index) in historyList"
  41. :key="index"
  42. @click="selectHistory(item)"
  43. >
  44. {{ item }}
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 近期热招 -->
  49. <view class="hot-jobs-section">
  50. <view class="section-header">
  51. <text class="section-title">近期热招</text>
  52. <image src="../../static/images/shanchu22.svg" style="width: 32rpx; height: 32rpx;" mode="aspectFit" @click="clearHotJobs"></image>
  53. </view>
  54. <view class="hot-jobs-grid">
  55. <view
  56. class="hot-job-item"
  57. v-for="(job, index) in hotJobsList"
  58. :key="index"
  59. @click="selectHotJob(job)"
  60. >
  61. <text class="job-name">{{ job.name }}</text>
  62. <view class="hot-tag" v-if="job.isHot">
  63. <text class="hot-tag-text">Hot</text>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. export default {
  73. data() {
  74. return {
  75. searchKeyword: '',
  76. historyList: ['四海芯舟', '汉睿国际', '璀璨城邦'],
  77. hotJobsList: [
  78. { name: '美国亚马逊运营', isHot: false },
  79. { name: '采购经理', isHot: false },
  80. { name: 'Tik Tok运营助理', isHot: true },
  81. { name: 'Temu运营专员', isHot: false },
  82. { name: '跨境电商运营助理', isHot: false },
  83. { name: '产品开发经理', isHot: false },
  84. { name: '海外仓管理经理', isHot: false },
  85. { name: '人事经理', isHot: false }
  86. ]
  87. }
  88. },
  89. methods: {
  90. goBack() {
  91. uni.navigateBack()
  92. },
  93. handleSearch() {
  94. if (this.searchKeyword.trim()) {
  95. console.log('搜索关键词:', this.searchKeyword)
  96. // 这里可以添加搜索逻辑
  97. uni.showToast({
  98. title: '搜索功能待实现',
  99. icon: 'none'
  100. })
  101. }
  102. },
  103. selectHistory(item) {
  104. this.searchKeyword = item
  105. this.handleSearch()
  106. },
  107. selectHotJob(job) {
  108. this.searchKeyword = job.name
  109. this.handleSearch()
  110. },
  111. clearHistory() {
  112. this.historyList = []
  113. uni.showToast({
  114. title: '历史搜索已清空',
  115. icon: 'success'
  116. })
  117. },
  118. clearHotJobs() {
  119. this.hotJobsList = []
  120. uni.showToast({
  121. title: '热招职位已清空',
  122. icon: 'success'
  123. })
  124. }
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. .job-search-page {
  130. min-height: 100vh;
  131. background-color: #ffffff;
  132. }
  133. .custom-navbar {
  134. padding-top: 80rpx;
  135. background-color: #ffffff;
  136. z-index: 9999;
  137. .navbar-content {
  138. display: flex;
  139. align-items: center;
  140. justify-content: space-between;
  141. height: 100%;
  142. padding: 0 40rpx;
  143. .nav-left, .nav-right {
  144. width: 60rpx;
  145. height: 60rpx;
  146. display: flex;
  147. align-items: center;
  148. justify-content: center;
  149. }
  150. .nav-title {
  151. color: rgba(51, 51, 51, 1);
  152. font-family: DM Sans;
  153. font-size: 36rpx;
  154. font-weight: 700;
  155. line-height: 26px;
  156. letter-spacing: 0px;
  157. text-align: center;
  158. }
  159. }
  160. }
  161. .main-content {
  162. padding: 40rpx 40rpx 0 40rpx;
  163. }
  164. .search-section {
  165. margin-bottom: 60rpx;
  166. .search-container {
  167. display: flex;
  168. align-items: center;
  169. gap: 20rpx;
  170. .search-input-container {
  171. flex: 1;
  172. height: 70rpx;
  173. background: #F5F5F5;
  174. border-radius: 40rpx;
  175. display: flex;
  176. align-items: center;
  177. padding: 0 30rpx;
  178. .search-icon {
  179. margin-right: 20rpx;
  180. }
  181. .search-input {
  182. color: rgba(153, 153, 153, 1);
  183. font-family: DM Sans;
  184. font-size: 24rpx;
  185. font-weight: 500;
  186. line-height: 48rpx;
  187. text-align: left;
  188. &::placeholder {
  189. color: #999;
  190. }
  191. }
  192. }
  193. .search-btn {
  194. display: flex;
  195. align-items: center;
  196. justify-content: center;
  197. .search-btn-text {
  198. color: rgba(1, 107, 246, 1);
  199. font-family: DM Sans;
  200. font-size: 26rpx;
  201. font-weight: 500;
  202. line-height: 48rpx;
  203. letter-spacing: undefined;
  204. text-align: center;
  205. }
  206. }
  207. }
  208. }
  209. .history-section, .hot-jobs-section {
  210. margin-bottom: 60rpx;
  211. .section-header {
  212. display: flex;
  213. align-items: center;
  214. justify-content: space-between;
  215. margin-bottom: 30rpx;
  216. .section-title {
  217. color: rgba(34, 37, 42, 1);
  218. font-family: DM Sans;
  219. font-size: 28rpx;
  220. font-weight: 400;
  221. line-height: 48rpx;
  222. letter-spacing: 0px;
  223. text-align: left;
  224. }
  225. }
  226. }
  227. .history-tags {
  228. display: flex;
  229. flex-wrap: wrap;
  230. gap: 8rpx;
  231. .history-tag {
  232. padding: 8rpx;
  233. border-radius: 8rpx;
  234. background: rgba(153, 153, 153, 0.1);
  235. color: rgba(102, 102, 102, 1);
  236. font-family: DM Sans;
  237. font-size: 20rpx;
  238. font-weight: 400;
  239. line-height: 20rpx;
  240. text-align: left;
  241. }
  242. }
  243. .hot-jobs-grid {
  244. display: flex;
  245. flex-wrap: wrap;
  246. gap: 8rpx;
  247. .hot-job-item {
  248. width: calc(50% - 4rpx);
  249. padding: 8rpx;
  250. background: #ffffff;
  251. border-radius: 12rpx;
  252. position: relative;
  253. .job-name {
  254. color: rgba(102, 102, 102, 1);
  255. font-family: DM Sans;
  256. font-size: 20rpx;
  257. font-weight: 400;
  258. line-height: 44rpx;
  259. letter-spacing: 0px;
  260. text-align: left;
  261. }
  262. .hot-tag {
  263. position: absolute;
  264. top: 8rpx;
  265. right: 10rpx;
  266. border-radius: 12rpx;
  267. background: rgba(237, 66, 69, 1);
  268. padding: 4rpx 12rpx;
  269. .hot-tag-text {
  270. color: rgba(255, 255, 255, 1);
  271. font-family: DM Sans;
  272. font-size: 16rpx;
  273. font-weight: 400;
  274. line-height: 32rpx;
  275. letter-spacing: 0.5%;
  276. text-align: center;
  277. }
  278. }
  279. }
  280. }
  281. </style>