jobSkills.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. <template>
  2. <view class="job-skills">
  3. <!-- 自定义导航栏 -->
  4. <view class="custom-navbar">
  5. <view class="navbar-content">
  6. <view class="nav-left" @click="goBack">
  7. <u-icon name="close" color="#333" size="32"></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. <view class="job-title">{{ jobTitle }}-职业技能</view>
  16. <view class="description">根据你的偏好设置,为你推荐更匹配的职位,最多选择8个</view>
  17. <!-- 运营方向 -->
  18. <view class="skills-section">
  19. <view class="section-title">运营方向</view>
  20. <!-- 技能标签网格 -->
  21. <view class="skills-grid">
  22. <view
  23. v-for="(item, index) in operationOptions"
  24. :key="index"
  25. class="skill-tag"
  26. :class="{ active: selectedOperation.includes(item) }"
  27. @click="toggleOperation(item)"
  28. >
  29. <text>{{ item }}</text>
  30. </view>
  31. </view>
  32. </view>
  33. <!-- 电商品类 -->
  34. <view class="skills-section">
  35. <view class="section-title">电商品类</view>
  36. <!-- 技能标签网格 -->
  37. <view class="skills-grid">
  38. <view
  39. v-for="(item, index) in categoryOptions"
  40. :key="index"
  41. class="skill-tag"
  42. :class="{ active: selectedCategory.includes(item) }"
  43. @click="toggleCategory(item)"
  44. >
  45. <text>{{ item }}</text>
  46. </view>
  47. </view>
  48. </view>
  49. <!-- 自定义标签 -->
  50. <view class="skills-section">
  51. <view class="section-title">自定义标签</view>
  52. <!-- 自定义标签区域 -->
  53. <view class="custom-tags">
  54. <view
  55. v-for="(item, index) in customTags"
  56. :key="index"
  57. class="custom-tag"
  58. @click="removeCustomTag(index)"
  59. >
  60. <text>{{ item }}</text>
  61. <u-icon name="close" color="#007AFF" size="24"></u-icon>
  62. </view>
  63. <view class="add-tag" @click="showAddTagModal">
  64. <text>添加标签</text>
  65. <u-icon name="plus" color="#333" size="24"></u-icon>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <!-- 底部确定按钮 -->
  71. <view class="bottom-btn-container">
  72. <view class="confirm-btn" @click="confirmSelection">
  73. <text>确定</text>
  74. </view>
  75. </view>
  76. <!-- 添加标签弹窗 -->
  77. <u-popup v-model="showAddTag" mode="center" border-radius="24" width="80%">
  78. <view class="add-tag-popup">
  79. <view class="popup-title">添加自定义标签</view>
  80. <view class="popup-content">
  81. <input
  82. v-model="newTagName"
  83. placeholder="请输入标签名称"
  84. class="tag-input"
  85. maxlength="10"
  86. />
  87. </view>
  88. <view class="popup-buttons">
  89. <view class="popup-btn cancel-btn" @click="cancelAddTag">取消</view>
  90. <view class="popup-btn confirm-btn" @click="addCustomTag">确定</view>
  91. </view>
  92. </view>
  93. </u-popup>
  94. </view>
  95. </template>
  96. <script>
  97. export default {
  98. data() {
  99. return {
  100. jobTitle: '亚马逊运营总监',
  101. showAddTag: false,
  102. newTagName: '',
  103. selectedOperation: ['独立站'],
  104. selectedCategory: ['独立站'],
  105. customTags: ['全领域'],
  106. operationOptions: [
  107. '精品铺货', '独立站', '3C数码', '美妆日用', '服装配饰', '家居用品',
  108. '户外运动', '母婴用品', '食品饮料', '宠物用品', '汽车用品', '图书文具',
  109. '数码配件', '办公用品', '礼品玩具', '健康保健', '珠宝首饰', '箱包皮具',
  110. '手表眼镜', '乐器音响', '摄影摄像', '运动健身', '旅游出行', '教育培训',
  111. '金融服务', '生活服务', '其他'
  112. ],
  113. categoryOptions: [
  114. '精品铺货', '独立站', '3C数码', '美妆日用', '服装配饰', '家居用品',
  115. '户外运动', '母婴用品', '食品饮料', '宠物用品', '汽车用品', '图书文具',
  116. '数码配件', '办公用品', '礼品玩具', '健康保健', '珠宝首饰', '箱包皮具',
  117. '手表眼镜', '乐器音响', '摄影摄像', '运动健身', '旅游出行', '教育培训',
  118. '金融服务', '生活服务', '其他'
  119. ]
  120. }
  121. },
  122. onLoad(options) {
  123. if (options.jobTitle) {
  124. this.jobTitle = decodeURIComponent(options.jobTitle)
  125. }
  126. },
  127. methods: {
  128. goBack() {
  129. uni.navigateBack()
  130. },
  131. toggleOperation(item) {
  132. const index = this.selectedOperation.indexOf(item)
  133. if (index > -1) {
  134. this.selectedOperation.splice(index, 1)
  135. } else {
  136. if (this.selectedOperation.length < 8) {
  137. this.selectedOperation.push(item)
  138. } else {
  139. uni.showToast({
  140. title: '最多选择8个标签',
  141. icon: 'none'
  142. })
  143. }
  144. }
  145. },
  146. toggleCategory(item) {
  147. const index = this.selectedCategory.indexOf(item)
  148. if (index > -1) {
  149. this.selectedCategory.splice(index, 1)
  150. } else {
  151. if (this.selectedCategory.length < 8) {
  152. this.selectedCategory.push(item)
  153. } else {
  154. uni.showToast({
  155. title: '最多选择8个标签',
  156. icon: 'none'
  157. })
  158. }
  159. }
  160. },
  161. showAddTagModal() {
  162. this.showAddTag = true
  163. this.newTagName = ''
  164. },
  165. cancelAddTag() {
  166. this.showAddTag = false
  167. this.newTagName = ''
  168. },
  169. addCustomTag() {
  170. if (this.newTagName.trim()) {
  171. if (this.customTags.length < 5) {
  172. this.customTags.push(this.newTagName.trim())
  173. this.showAddTag = false
  174. this.newTagName = ''
  175. } else {
  176. uni.showToast({
  177. title: '最多添加5个自定义标签',
  178. icon: 'none'
  179. })
  180. }
  181. } else {
  182. uni.showToast({
  183. title: '请输入标签名称',
  184. icon: 'none'
  185. })
  186. }
  187. },
  188. removeCustomTag(index) {
  189. this.customTags.splice(index, 1)
  190. },
  191. confirmSelection() {
  192. // 返回选中的技能设置
  193. uni.navigateBack({
  194. delta: 1
  195. })
  196. // 通知父页面更新技能设置
  197. uni.$emit('skillsUpdated', {
  198. jobTitle: this.jobTitle,
  199. operation: this.selectedOperation,
  200. category: this.selectedCategory,
  201. customTags: this.customTags
  202. })
  203. uni.showToast({
  204. title: '技能设置已保存',
  205. icon: 'success'
  206. })
  207. }
  208. }
  209. }
  210. </script>
  211. <style lang="scss" scoped>
  212. .job-skills {
  213. min-height: 100vh;
  214. background: #fff;
  215. display: flex;
  216. flex-direction: column;
  217. padding: 88rpx 40rpx 40rpx 40rpx;
  218. }
  219. .navbar-content {
  220. display: flex;
  221. align-items: center;
  222. justify-content: space-between;
  223. height: 88rpx;
  224. }
  225. .nav-left, .nav-right {
  226. width: 60rpx;
  227. height: 60rpx;
  228. display: flex;
  229. align-items: center;
  230. justify-content: center;
  231. }
  232. .nav-title {
  233. color: rgba(51, 51, 51, 1);
  234. font-family: DM Sans;
  235. font-size: 36rpx;
  236. font-weight: 700;
  237. line-height: 26px;
  238. letter-spacing: 0px;
  239. text-align: center;
  240. }
  241. .main-content {
  242. margin-top: 20rpx;
  243. }
  244. .job-title {
  245. color: rgba(51, 51, 51, 1);
  246. font-family: DM Sans;
  247. font-size: 52rpx;
  248. font-weight: 700;
  249. line-height: 30px;
  250. letter-spacing: 0px;
  251. text-align: left;
  252. }
  253. .description {
  254. margin: 20rpx 0;
  255. color: rgba(102, 102, 102, 1);
  256. font-family: DM Sans;
  257. font-size: 28rpx;
  258. font-weight: 400;
  259. letter-spacing: 0px;
  260. text-align: left;
  261. }
  262. .skills-section {
  263. margin-bottom: 40rpx;
  264. }
  265. .section-title {
  266. color: rgba(34, 37, 42, 1);
  267. font-family: DM Sans;
  268. font-size: 36rpx;
  269. font-weight: 400;
  270. line-height: 24px;
  271. letter-spacing: 0px;
  272. text-align: left;
  273. margin-bottom: 20rpx;
  274. }
  275. .skills-grid {
  276. display: flex;
  277. flex-wrap: wrap;
  278. gap: 12rpx;
  279. }
  280. .skill-tag {
  281. width: calc((100% - 72rpx) / 6);
  282. padding: 8rpx 6rpx;
  283. background: #F7F8FA;
  284. border: 1rpx solid #F7F8FA;
  285. border-radius: 12rpx;
  286. transition: all 0.3s ease;
  287. display: flex;
  288. align-items: center;
  289. justify-content: center;
  290. text {
  291. font-size: 20rpx;
  292. color: rgba(102, 102, 102, 1);
  293. font-weight: 400;
  294. text-align: center;
  295. line-height: 1.2;
  296. }
  297. &.active {
  298. background: rgba(153, 196, 250, 0.4);
  299. border: 0.5px solid rgba(1, 107, 246, 1);
  300. text {
  301. color: rgba(1, 107, 246, 1);
  302. font-weight: 400;
  303. }
  304. }
  305. &:active {
  306. transform: scale(0.95);
  307. }
  308. }
  309. .custom-tags {
  310. display: flex;
  311. flex-wrap: wrap;
  312. gap: 12rpx;
  313. }
  314. .custom-tag {
  315. padding: 8rpx 12rpx;
  316. background: rgba(153, 196, 250, 0.4);
  317. border: 0.5px solid rgba(1, 107, 246, 1);
  318. border-radius: 12rpx;
  319. display: flex;
  320. align-items: center;
  321. gap: 8rpx;
  322. text {
  323. font-size: 18rpx;
  324. color: rgba(1, 107, 246, 1);
  325. font-weight: 400;
  326. }
  327. }
  328. .add-tag {
  329. padding: 8rpx 12rpx;
  330. background: #F7F8FA;
  331. border: 1rpx solid #F7F8FA;
  332. border-radius: 12rpx;
  333. display: flex;
  334. align-items: center;
  335. gap: 8rpx;
  336. text {
  337. font-size: 18rpx;
  338. color: rgba(102, 102, 102, 1);
  339. font-weight: 400;
  340. }
  341. }
  342. .bottom-btn-container {
  343. position: fixed;
  344. bottom: 0;
  345. left: 0;
  346. right: 0;
  347. padding: 32rpx;
  348. background: #fff;
  349. border-top: 1px solid #f0f0f0;
  350. }
  351. .confirm-btn {
  352. width: 100%;
  353. height: 88rpx;
  354. background: linear-gradient(90deg, #007AFF 0%, #5AC8FA 100%);
  355. border-radius: 44rpx;
  356. display: flex;
  357. align-items: center;
  358. justify-content: center;
  359. text {
  360. font-size: 32rpx;
  361. font-weight: 600;
  362. color: #fff;
  363. }
  364. &:active {
  365. background: linear-gradient(90deg, #0056CC 0%, #4A9FE7 100%);
  366. }
  367. }
  368. // 添加标签弹窗样式
  369. .add-tag-popup {
  370. background: #fff;
  371. border-radius: 24rpx;
  372. padding: 40rpx;
  373. .popup-title {
  374. color: rgba(34, 37, 42, 1);
  375. font-family: DM Sans;
  376. font-size: 36rpx;
  377. font-weight: 500;
  378. line-height: 24px;
  379. text-align: center;
  380. margin-bottom: 30rpx;
  381. }
  382. .popup-content {
  383. margin-bottom: 30rpx;
  384. .tag-input {
  385. width: 100%;
  386. height: 80rpx;
  387. padding: 0 20rpx;
  388. border: 1rpx solid #E5E5EA;
  389. border-radius: 12rpx;
  390. font-size: 28rpx;
  391. color: rgba(34, 37, 42, 1);
  392. background: #F7F8FA;
  393. }
  394. }
  395. .popup-buttons {
  396. display: flex;
  397. gap: 20rpx;
  398. .popup-btn {
  399. flex: 1;
  400. height: 80rpx;
  401. border-radius: 12rpx;
  402. display: flex;
  403. align-items: center;
  404. justify-content: center;
  405. font-size: 28rpx;
  406. font-weight: 500;
  407. }
  408. .cancel-btn {
  409. background: #F7F8FA;
  410. color: rgba(102, 102, 102, 1);
  411. }
  412. .confirm-btn {
  413. background: #007AFF;
  414. color: #fff;
  415. }
  416. }
  417. }
  418. </style>