123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362 |
- <template>
- <view class="switch-roles">
- <nav-bar title="选择公司规模" color="#000"></nav-bar>
- <view class="roles-content">
- <view class="content">
- <view class="progress-num"> <text>1</text>/8 </view>
- <view class="title">公司标准工作时间</view>
- <view class="desc">
- 开始完善公司主页吧,让求职者了解公司、信任职位
- 添加工作时间,标准时间仅为求职者提供参考;不代表公司下所有职位工作时间
- </view>
- <view class="check-title-big">工作时间</view>
- <view class="time-picker-container">
- <view class="time-item-box" @click="showStartTime = true">
- <view class="time-label">开始时间</view>
- <view class="time-value time-item">{{ startTime || "请选择开始时间" }}</view>
- </view>
- <text class="time-separator">至</text>
- <view class="time-item-box" @click="showEndTime = true">
- <view class="time-label">结束时间</view>
- <view class="time-value time-item">{{ endTime || "请选择结束时间" }}</view>
- </view>
- </view>
- <view class="selected-time" v-if="startTime && endTime">
- 已选择:{{ startTime }} - {{ endTime }}
- </view>
- <view class="check-title-big">休息时间(可选)</view>
- <view class="check-box">
- <view
- class="check-item"
- :class="{ 'is-check': check == index }"
- v-for="(item, index) in peopleList"
- :key="index"
- @click="checkPeople(index)"
- >
- {{ item }}
- </view>
- </view>
- <view class="check-title-big">加班情况(可选)</view>
- <view class="check-box grid-three">
- <view
- class="check-item"
- :class="{ 'is-check': work == index }"
- v-for="(item, index) in workList"
- :key="index"
- @click="checkWork(index)"
- >
- {{ item }}
- </view>
- </view>
- </view>
- </view>
- <view class="submit-btn" @click="goJobPostingSecond">下一步</view>
- <!-- 开始时间选择器 -->
- <u-picker
- mode="time"
- v-model="showStartTime"
- @confirm="onStartTimeConfirm"
- :params="timeParams"
- ></u-picker>
- <!-- 结束时间选择器 -->
- <u-picker
- mode="time"
- v-model="showEndTime"
- @confirm="onEndTimeConfirm"
- :params="timeParams"
- ></u-picker>
- </view>
- </template>
- <script>
- import navBar from "@/components/nav-bar/index.vue";
- export default {
- data() {
- return {
- peopleList: ["双休", "排版轮休"],
- workList: ["不加班", "偶尔加班", "弹性工作"],
- check: 0,
- work: 0,
- text: "",
- showStartTime: false,
- showEndTime: false,
- startTime: "",
- endTime: "",
- timeParams: {
- year: false,
- month: false,
- day: false,
- hour: true,
- minute: true,
- second: false,
- },
- numList: [
- {
- name: "填写基本信息",
- },
- {
- name: "选择职位要求",
- },
- ],
- };
- },
- components: {
- navBar,
- },
- onLoad(options) {
- if (options.text) {
- this.text = options.text;
- }
- },
- methods: {
- goBusinessLicense() {
- uni.navigateTo({ url: "/pages/my/businessLicense" });
- },
- checkPeople(index) {
- this.check = index;
- },
- checkWork(index) {
- this.work = index;
- },
- // 开始时间确认
- onStartTimeConfirm(e) {
- this.startTime = `${e.hour}:${e.minute}`;
- },
- // 结束时间确认
- onEndTimeConfirm(e) {
- this.endTime = `${e.hour}:${e.minute}`;
- },
- goJobPostingSecond() {
- // 验证时间选择
- if (!this.startTime || !this.endTime) {
- uni.showToast({
- title: "请选择完整的工作时间",
- icon: "none",
- });
- return;
- }
- // 这里可以添加时间逻辑验证,比如结束时间不能早于开始时间
- if (this.compareTime(this.startTime, this.endTime) >= 0) {
- uni.showToast({
- title: "结束时间必须晚于开始时间",
- icon: "none",
- });
- return;
- }
- // 将选择的时间数据传递到下一页或保存
- const workTimeData = {
- workTime: `${this.startTime}-${this.endTime}`,
- restTime: this.peopleList[this.check],
- };
- uni.navigateTo({
- url:
- "/my/renzheng/companyDev?workTime=" +
- encodeURIComponent(workTimeData.workTime),
- });
- },
- // 比较时间大小
- compareTime(time1, time2) {
- const [h1, m1] = time1.split(":").map(Number);
- const [h2, m2] = time2.split(":").map(Number);
- if (h1 !== h2) {
- return h1 - h2;
- }
- return m1 - m2;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .switch-roles {
- background-color: #fff;
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- display: flex;
- flex-direction: column;
- .roles-content {
- width: 100%;
- flex: 1;
- overflow: hidden;
- overflow-y: auto;
- .content {
- padding: 40rpx;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- .progress-num {
- color: #016bf6;
- font-family: DM Sans;
- font-size: 24rpx;
- font-weight: 500;
- width: 100%;
- padding-bottom: 20rpx;
- box-sizing: border-box;
- text {
- font-size: 48rpx;
- font-weight: 700;
- }
- }
- .title {
- color: #333;
- width: 100%;
- font-family: DM Sans;
- font-size: 48rpx;
- font-weight: 700;
- }
- .desc {
- color: rgba(102, 102, 102, 1);
- width: 100%;
- font-family: DM Sans;
- font-size: 24rpx;
- font-weight: 400;
- line-height: 32rpx;
- letter-spacing: 0.5%;
- text-align: left;
- padding: 20rpx 0;
- box-sizing: border-box;
- }
- .time-picker-container {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 20rpx;
- .time-item-box {
- text-align: center;
- min-width: 40%;
- }
- .time-item {
- flex: 1;
- border-radius: 100rpx;
- padding: 20rpx 32rpx;
- box-sizing: border-box;
- border: 2rpx solid rgba(227, 231, 236, 1);
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .time-label {
- color: rgba(153, 153, 153, 1);
- font-family: DM Sans;
- font-size: 20rpx;
- font-weight: 400;
- padding-bottom: 20rpx;
- box-sizing: border-box;
- }
- .time-value {
- color: rgba(51, 51, 51, 1);
- font-family: DM Sans;
- font-size: 24rpx;
- font-weight: 500;
- }
- .time-separator {
- margin: 0 20rpx;
- padding-top: 40rpx;
- box-sizing: border-box;
- color: rgba(102, 102, 102, 1);
- font-family: DM Sans;
- font-size: 24rpx;
- font-weight: 500;
- }
- }
- .selected-time {
- width: 100%;
- text-align: center;
- color: #016bf6;
- font-family: DM Sans;
- font-size: 28rpx;
- font-weight: 500;
- margin-bottom: 20rpx;
- padding: 16rpx;
- background: rgba(245, 248, 254, 1);
- border-radius: 16rpx;
- }
- .check-title-big {
- color: rgba(31, 44, 55, 1);
- font-family: DM Sans;
- font-size: 28rpx;
- font-weight: 500;
- line-height: 44rpx;
- letter-spacing: 0.5%;
- width: 100%;
- padding: 20rpx 0;
- box-sizing: border-box;
- }
- .check-box {
- width: 100%;
- display: grid;
- grid-template-columns: repeat(2, 1fr);
- gap: 24rpx;
- .check-item {
- border-radius: 16rpx;
- background: rgba(245, 248, 254, 1);
- color: rgba(153, 153, 153, 1);
- font-family: DM Sans;
- font-size: 28rpx;
- font-weight: 400;
- line-height: 44rpx;
- text-align: center;
- padding: 12rpx 48rpx;
- box-sizing: border-box;
- }
- .is-check {
- box-sizing: border-box;
- border: 1rpx solid #016bf6;
- border-radius: 16rpx;
- background: rgba(252, 233, 220, 1);
- color: #016bf6;
- }
- }
- .grid-three {
- grid-template-columns: repeat(3, 1fr) !important;
- }
- }
- }
- .submit-btn {
- flex-shrink: 0;
- border-radius: 999px;
- background: #ff6600;
- color: rgba(255, 255, 255, 1);
- font-family: DM Sans;
- font-size: 32rpx;
- font-weight: 400;
- line-height: 48rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- padding: 16rpx 32rpx;
- box-sizing: border-box;
- margin: 60rpx 62rpx;
- }
- }
- </style>
|