<template>
  <view class="switch-roles">
    <nav-bar title="岗位描述" color="#000"></nav-bar>
    <view class="roles-content">
      <view class="content">
        <view class="title">添加地址</view>
        <view class="form-item">
          <view class="item-label"> 工作地址 </view>
          <u-input
            placeholder="请输入办公大楼名称，例：碧桂园凤凰智谷"
            v-model="address"
            clearable
            class="custom-input"
            :customStyle="{ padding: '8rpx 24rpx ' }"
          >
            <template #prefix>
              <u-icon name="phone" size="36rpx" color="#999" marginRight="20rpx"></u-icon>
            </template>
          </u-input>
        </view>
        <view class="form-item">
          <view class="item-label"> 楼层/单元室 </view>
          <u-input
            placeholder="楼层/单元室/门牌号，例：3层302室"
            v-model="addressDetail"
            clearable
            class="custom-input"
            :customStyle="{ padding: '8rpx 24rpx ' }"
          >
            <template #prefix>
              <u-icon name="phone" size="36rpx" color="#999" marginRight="20rpx"></u-icon>
            </template>
          </u-input>
        </view>
      </view>
    </view>
    <view class="submit-btn" @click="goBack">确定</view>
  </view>
</template>
<script>
import navBar from "@/components/nav-bar/index.vue";
export default {
  data() {
    return {
      address: "",
      addressDetail: '',
    };
  },
  components: {
    navBar,
  },
  onLoad(options) {
    if (options.text) {
      this.text = options.text;
    }
  },
  methods: {
    onInput(e) {
      //   console.log(e);
      // 如果需要额外的输入控制
      //   this.text = e.detail.value;
    },
    goBack() {
      uni.navigateBack();
    },
  },
};
</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;
      .title {
        color: #333;
        width: 100%;
        font-family: DM Sans;
        font-size: 40rpx;
        font-weight: 600;
      }
    }
  }
  .submit-btn {
    flex-shrink: 0;
    border-radius: 999px;
    box-shadow: 0px 2px 4px 0px rgba(9, 196, 116, 0.3);
    background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
    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 20rpx;
  }
}
.form-item {
  margin-bottom: 32rpx;
  width: 100%;
}
.item-label {
  color: rgba(18, 26, 44, 1);
  font-family: Roboto;
  font-size: 32rpx;
  font-weight: 400;
  line-height: 51.2rpx;
  letter-spacing: 0px;
  text-align: left;
  padding-bottom: 6rpx;
  padding: 10rpx 0;
  box-sizing: border-box;
}

.custom-input {
  box-sizing: border-box;
  border: 2rpx solid rgba(158, 161, 168, 1);
  border-radius: 100rpx;
  background: rgba(255, 255, 255, 1);
  padding: 8rpx 24rpx !important;
}
::v-deep .u-input {
  text-align: left !important;
}
</style>
