zhangback
2026-03-30 0bafa6aa253c9ef6f5cb24e9a24c5282860e4c59
ui/car_wx_app/pages/login/index.vue
@@ -1,51 +1,100 @@
<template>
  <view class="login-box">
    <u-transition :show="true" mode="slide-down">
      <view class="transition text-center">
        <image class="login-logo" mode='aspectFit' src="/static/image/jk.jpeg"></image>
  <view class="login-container">
    <!-- 背景装饰 -->
    <view class="bg-decoration">
      <view class="circle circle-1"></view>
      <view class="circle circle-2"></view>
      <view class="circle circle-3"></view>
    </view>
    <!-- 登录内容 -->
    <view class="login-content">
      <!-- Logo 和标题 -->
      <u-transition :show="true" mode="fade-up">
        <view class="header-section">
          <image class="login-logo" mode="aspectFit" src="/static/image/jk.jpeg"></image>
        <view class="login-title">{{title}}</view>
          <view class="login-subtitle">欢迎使用物流调度系统</view>
      </view>
    </u-transition>
    <u-transition :show="true" mode="slide-down">
      <view class="box">
      <!-- 登录表单卡片 -->
      <u-transition :show="true" mode="fade-up">
        <view class="form-card">
        <u--form labelPosition="left" :model="form" :rules="rules" ref="uForm">
          <u-form-item label="账户" prop="username" borderBottom ref="item1">
            <u--input v-model="form.username" placeholder="请输入账户" border="none"></u--input>
            <!-- 账户输入 -->
            <u-form-item label=" " labelWidth="0" prop="username" borderBottom>
              <view class="input-wrapper">
                <view class="input-icon">
                  <u-icon name="account" size="20" color="#909399"></u-icon>
                </view>
                <u--input
                  v-model="form.username"
                  placeholder="请输入账户"
                  border="none"
                  placeholderStyle="color: #c0c4cc"
                ></u--input>
              </view>
          </u-form-item>
          <u-form-item label="密码" prop="password" borderBottom ref="item1">
            <!-- 密码输入 -->
            <u-form-item label=" " labelWidth="0" prop="password" borderBottom>
              <view class="input-wrapper">
                <view class="input-icon">
                  <u-icon name="lock" size="20" color="#909399"></u-icon>
                </view>
            <u--input 
              :type="passwordType" 
              v-model="form.password" 
              placeholder="请输入密码" 
              clearable
              :focus="noFocus"
              border="none" 
              shape="circle"
                  placeholderStyle="color: #c0c4cc"
                  :focus="noFocus"
              ref="passwordInput"
            ></u--input>
                <view class="input-icon-right" @click="togglePasswordVisibility">
            <u-icon 
              slot="right"
              size="30"
              color="#999"
                    size="20"
                    color="#909399"
              :name="passwordIcon" 
              @click="togglePasswordVisibility"
              style="margin-right: 10px; cursor: pointer;"
            ></u-icon>
                </view>
              </view>
          </u-form-item>
        </u--form>
        <view style="margin-top: 20px;">
          <!-- 记住密码 -->
          <view class="remember-section">
          <u-checkbox-group v-model="rememberPassword">
            <u-checkbox label="记住密码" name="remember"></u-checkbox>
              <u-checkbox
                label="记住密码"
                name="remember"
                activeColor="#409eff"
                size="16"
              ></u-checkbox>
          </u-checkbox-group>
        </view>
       
        <view class="login-btn">
          <u-button shape="circle" @click="loginSubmit" type="primary" text="登录"></u-button>
          <!-- 登录按钮 -->
          <view class="login-btn-wrapper">
            <u-button
              @click="loginSubmit"
              type="primary"
              shape="circle"
              :customStyle="{
                background: 'linear-gradient(135deg, #66b1ff 0%, #409eff 100%)',
                border: 'none',
                height: '88rpx',
                fontSize: '32rpx',
                fontWeight: '500'
              }"
            >
              <text>登 录</text>
            </u-button>
        </view>
      </view>
    </u-transition>
    </view>
  </view>
</template>
@@ -159,38 +208,145 @@
</script>
<style scoped lang="scss">
.login-box {
  width: 80%;
  margin: 0 auto;
.login-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #66b1ff 0%, #409eff 100%);
  position: relative;
  overflow: hidden;
}
/* 背景装饰 */
.bg-decoration {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow: hidden;
  z-index: 0;
}
.circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 20s infinite ease-in-out;
}
.circle-1 {
  width: 300rpx;
  height: 300rpx;
  top: -100rpx;
  right: -50rpx;
  animation-delay: 0s;
}
.circle-2 {
  width: 200rpx;
  height: 200rpx;
  bottom: 100rpx;
  left: -50rpx;
  animation-delay: 5s;
}
.circle-3 {
  width: 150rpx;
  height: 150rpx;
  top: 50%;
  right: 50rpx;
  animation-delay: 10s;
}
@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-40rpx) rotate(180deg);
  }
}
/* 登录内容 */
.login-content {
  position: relative;
  z-index: 1;
  padding: 160rpx 40rpx 40rpx;
}
/* 头部区域 */
.header-section {
  text-align: center;
  margin-bottom: 60rpx;
}
  .login-logo {
    margin-top: 60px;
    height: 150px;
    text-align: center;
  width: 160rpx;
  height: 160rpx;
  border-radius: 50%;
  box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.15);
  background: #fff;
  padding: 10rpx;
  }
  .login-title {
    font-size: 22px;
    color: #000000;
  margin-top: 30rpx;
  font-size: 48rpx;
  color: #ffffff;
    font-weight: bold;
    text-align: center;
  letter-spacing: 2rpx;
  }
  .box {
    padding-top: 20px;
    .login-btn {
      margin-top: 50px;
    }
.login-subtitle {
  margin-top: 16rpx;
  font-size: 26rpx;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 1rpx;
  }
  .version {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    color: #999999;
    font-size: 14px;
/* 表单卡片 */
.form-card {
  background: #ffffff;
  border-radius: 24rpx;
  padding: 50rpx 40rpx;
  box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.2);
  }
/* 输入框包装 */
.input-wrapper {
  display: flex;
  align-items: center;
  padding: 20rpx 0;
}
.input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60rpx;
  flex-shrink: 0;
}
.input-icon-right {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60rpx;
  flex-shrink: 0;
  cursor: pointer;
}
/* 记住密码 */
.remember-section {
  margin-top: 30rpx;
  padding-left: 10rpx;
}
/* 登录按钮 */
.login-btn-wrapper {
  margin-top: 50rpx;
}
.login-btn-wrapper button {
  box-shadow: 0 8rpx 24rpx rgba(64, 158, 255, 0.4);
}
</style>