123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462 |
- <template>
- <view class="job-skills">
- <!-- 自定义导航栏 -->
- <view class="custom-navbar">
- <view class="navbar-content">
- <view class="nav-left" @click="goBack">
- <u-icon name="close" color="#333" size="32"></u-icon>
- </view>
- <view class="nav-title">岗位职业技能</view>
- <view class="nav-right"></view>
- </view>
- </view>
-
- <!-- 主要内容 -->
- <view class="main-content">
- <view class="job-title">{{ jobTitle }}-职业技能</view>
- <view class="description">根据你的偏好设置,为你推荐更匹配的职位,最多选择8个</view>
-
- <!-- 运营方向 -->
- <view class="skills-section">
- <view class="section-title">运营方向</view>
-
- <!-- 技能标签网格 -->
- <view class="skills-grid">
- <view
- v-for="(item, index) in operationOptions"
- :key="index"
- class="skill-tag"
- :class="{ active: selectedOperation.includes(item) }"
- @click="toggleOperation(item)"
- >
- <text>{{ item }}</text>
- </view>
- </view>
- </view>
-
- <!-- 电商品类 -->
- <view class="skills-section">
- <view class="section-title">电商品类</view>
-
- <!-- 技能标签网格 -->
- <view class="skills-grid">
- <view
- v-for="(item, index) in categoryOptions"
- :key="index"
- class="skill-tag"
- :class="{ active: selectedCategory.includes(item) }"
- @click="toggleCategory(item)"
- >
- <text>{{ item }}</text>
- </view>
- </view>
- </view>
-
- <!-- 自定义标签 -->
- <view class="skills-section">
- <view class="section-title">自定义标签</view>
-
- <!-- 自定义标签区域 -->
- <view class="custom-tags">
- <view
- v-for="(item, index) in customTags"
- :key="index"
- class="custom-tag"
- @click="removeCustomTag(index)"
- >
- <text>{{ item }}</text>
- <u-icon name="close" color="#007AFF" size="24"></u-icon>
- </view>
- <view class="add-tag" @click="showAddTagModal">
- <text>添加标签</text>
- <u-icon name="plus" color="#333" size="24"></u-icon>
- </view>
- </view>
- </view>
- </view>
-
- <!-- 底部确定按钮 -->
- <view class="bottom-btn-container">
- <view class="confirm-btn" @click="confirmSelection">
- <text>确定</text>
- </view>
- </view>
-
- <!-- 添加标签弹窗 -->
- <u-popup v-model="showAddTag" mode="center" border-radius="24" width="80%">
- <view class="add-tag-popup">
- <view class="popup-title">添加自定义标签</view>
- <view class="popup-content">
- <input
- v-model="newTagName"
- placeholder="请输入标签名称"
- class="tag-input"
- maxlength="10"
- />
- </view>
- <view class="popup-buttons">
- <view class="popup-btn cancel-btn" @click="cancelAddTag">取消</view>
- <view class="popup-btn confirm-btn" @click="addCustomTag">确定</view>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- jobTitle: '亚马逊运营总监',
- showAddTag: false,
- newTagName: '',
- selectedOperation: ['独立站'],
- selectedCategory: ['独立站'],
- customTags: ['全领域'],
- operationOptions: [
- '精品铺货', '独立站', '3C数码', '美妆日用', '服装配饰', '家居用品',
- '户外运动', '母婴用品', '食品饮料', '宠物用品', '汽车用品', '图书文具',
- '数码配件', '办公用品', '礼品玩具', '健康保健', '珠宝首饰', '箱包皮具',
- '手表眼镜', '乐器音响', '摄影摄像', '运动健身', '旅游出行', '教育培训',
- '金融服务', '生活服务', '其他'
- ],
- categoryOptions: [
- '精品铺货', '独立站', '3C数码', '美妆日用', '服装配饰', '家居用品',
- '户外运动', '母婴用品', '食品饮料', '宠物用品', '汽车用品', '图书文具',
- '数码配件', '办公用品', '礼品玩具', '健康保健', '珠宝首饰', '箱包皮具',
- '手表眼镜', '乐器音响', '摄影摄像', '运动健身', '旅游出行', '教育培训',
- '金融服务', '生活服务', '其他'
- ]
- }
- },
- onLoad(options) {
- if (options.jobTitle) {
- this.jobTitle = decodeURIComponent(options.jobTitle)
- }
- },
- methods: {
- goBack() {
- uni.navigateBack()
- },
- toggleOperation(item) {
- const index = this.selectedOperation.indexOf(item)
- if (index > -1) {
- this.selectedOperation.splice(index, 1)
- } else {
- if (this.selectedOperation.length < 8) {
- this.selectedOperation.push(item)
- } else {
- uni.showToast({
- title: '最多选择8个标签',
- icon: 'none'
- })
- }
- }
- },
- toggleCategory(item) {
- const index = this.selectedCategory.indexOf(item)
- if (index > -1) {
- this.selectedCategory.splice(index, 1)
- } else {
- if (this.selectedCategory.length < 8) {
- this.selectedCategory.push(item)
- } else {
- uni.showToast({
- title: '最多选择8个标签',
- icon: 'none'
- })
- }
- }
- },
- showAddTagModal() {
- this.showAddTag = true
- this.newTagName = ''
- },
- cancelAddTag() {
- this.showAddTag = false
- this.newTagName = ''
- },
- addCustomTag() {
- if (this.newTagName.trim()) {
- if (this.customTags.length < 5) {
- this.customTags.push(this.newTagName.trim())
- this.showAddTag = false
- this.newTagName = ''
- } else {
- uni.showToast({
- title: '最多添加5个自定义标签',
- icon: 'none'
- })
- }
- } else {
- uni.showToast({
- title: '请输入标签名称',
- icon: 'none'
- })
- }
- },
- removeCustomTag(index) {
- this.customTags.splice(index, 1)
- },
- confirmSelection() {
- // 返回选中的技能设置
- uni.navigateBack({
- delta: 1
- })
-
- // 通知父页面更新技能设置
- uni.$emit('skillsUpdated', {
- jobTitle: this.jobTitle,
- operation: this.selectedOperation,
- category: this.selectedCategory,
- customTags: this.customTags
- })
-
- uni.showToast({
- title: '技能设置已保存',
- icon: 'success'
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .job-skills {
- min-height: 100vh;
- background: #fff;
- display: flex;
- flex-direction: column;
- padding: 88rpx 40rpx 40rpx 40rpx;
- }
- .navbar-content {
- display: flex;
- align-items: center;
- justify-content: space-between;
- height: 88rpx;
- }
- .nav-left, .nav-right {
- width: 60rpx;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .nav-title {
- color: rgba(51, 51, 51, 1);
- font-family: DM Sans;
- font-size: 36rpx;
- font-weight: 700;
- line-height: 26px;
- letter-spacing: 0px;
- text-align: center;
- }
- .main-content {
- margin-top: 20rpx;
- }
- .job-title {
- color: rgba(51, 51, 51, 1);
- font-family: DM Sans;
- font-size: 52rpx;
- font-weight: 700;
- line-height: 30px;
- letter-spacing: 0px;
- text-align: left;
- }
- .description {
- margin: 20rpx 0;
- color: rgba(102, 102, 102, 1);
- font-family: DM Sans;
- font-size: 28rpx;
- font-weight: 400;
- letter-spacing: 0px;
- text-align: left;
- }
- .skills-section {
- margin-bottom: 40rpx;
- }
- .section-title {
- color: rgba(34, 37, 42, 1);
- font-family: DM Sans;
- font-size: 36rpx;
- font-weight: 400;
- line-height: 24px;
- letter-spacing: 0px;
- text-align: left;
- margin-bottom: 20rpx;
- }
- .skills-grid {
- display: flex;
- flex-wrap: wrap;
- gap: 12rpx;
- }
- .skill-tag {
- width: calc((100% - 72rpx) / 6);
- padding: 8rpx 6rpx;
- background: #F7F8FA;
- border: 1rpx solid #F7F8FA;
- border-radius: 12rpx;
- transition: all 0.3s ease;
- display: flex;
- align-items: center;
- justify-content: center;
-
- text {
- font-size: 20rpx;
- color: rgba(102, 102, 102, 1);
- font-weight: 400;
- text-align: center;
- line-height: 1.2;
- }
-
- &.active {
- background: rgba(153, 196, 250, 0.4);
- border: 0.5px solid rgba(1, 107, 246, 1);
-
- text {
- color: rgba(1, 107, 246, 1);
- font-weight: 400;
- }
- }
-
- &:active {
- transform: scale(0.95);
- }
- }
- .custom-tags {
- display: flex;
- flex-wrap: wrap;
- gap: 12rpx;
- }
- .custom-tag {
- padding: 8rpx 12rpx;
- background: rgba(153, 196, 250, 0.4);
- border: 0.5px solid rgba(1, 107, 246, 1);
- border-radius: 12rpx;
- display: flex;
- align-items: center;
- gap: 8rpx;
-
- text {
- font-size: 18rpx;
- color: rgba(1, 107, 246, 1);
- font-weight: 400;
- }
- }
- .add-tag {
- padding: 8rpx 12rpx;
- background: #F7F8FA;
- border: 1rpx solid #F7F8FA;
- border-radius: 12rpx;
- display: flex;
- align-items: center;
- gap: 8rpx;
-
- text {
- font-size: 18rpx;
- color: rgba(102, 102, 102, 1);
- font-weight: 400;
- }
- }
- .bottom-btn-container {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- padding: 32rpx;
- background: #fff;
- border-top: 1px solid #f0f0f0;
- }
- .confirm-btn {
- width: 100%;
- height: 88rpx;
- background: linear-gradient(90deg, #007AFF 0%, #5AC8FA 100%);
- border-radius: 44rpx;
- display: flex;
- align-items: center;
- justify-content: center;
-
- text {
- font-size: 32rpx;
- font-weight: 600;
- color: #fff;
- }
-
- &:active {
- background: linear-gradient(90deg, #0056CC 0%, #4A9FE7 100%);
- }
- }
- // 添加标签弹窗样式
- .add-tag-popup {
- background: #fff;
- border-radius: 24rpx;
- padding: 40rpx;
-
- .popup-title {
- color: rgba(34, 37, 42, 1);
- font-family: DM Sans;
- font-size: 36rpx;
- font-weight: 500;
- line-height: 24px;
- text-align: center;
- margin-bottom: 30rpx;
- }
-
- .popup-content {
- margin-bottom: 30rpx;
-
- .tag-input {
- width: 100%;
- height: 80rpx;
- padding: 0 20rpx;
- border: 1rpx solid #E5E5EA;
- border-radius: 12rpx;
- font-size: 28rpx;
- color: rgba(34, 37, 42, 1);
- background: #F7F8FA;
- }
- }
-
- .popup-buttons {
- display: flex;
- gap: 20rpx;
-
- .popup-btn {
- flex: 1;
- height: 80rpx;
- border-radius: 12rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 28rpx;
- font-weight: 500;
- }
-
- .cancel-btn {
- background: #F7F8FA;
- color: rgba(102, 102, 102, 1);
- }
-
- .confirm-btn {
- background: #007AFF;
- color: #fff;
- }
- }
- }
- </style>
|