jiangping
2024-05-28 d154966cc9492a30c47809aa2824ba61d18e6fef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<template>
  <view class="login">
    <image class="login_bg" src="@/static/login_bg@2x.png" />
    <image class="login_logo" src="@/static/logo@2x.png" mode="widthFix" />
    <view class="login_title">安泰物流智慧园区</view>
    <view class="login_list">
      <view class="login_list_item">
        <image src="@/static/login_ic_phone@2x.png" mode="widthFix" />
        <input
          v-model="form.account"
          maxlength="18"
          type="number"
          placeholder="账号"
        />
      </view>
      <view class="login_list_item">
        <image src="@/static/login_ic_password@2x.png" mode="widthFix" />
        <input v-model="form.password" type="password" placeholder="密码" />
      </view>
    </view>
    <view class="login_btn">
      <view class="login_btn_n" @click="onLogin">立即登录</view>
      <view class="for_psd">忘记密码</view>
    </view>
 
    <view class="deal_wrap">
      <checkbox @change="dealChange" />
      <text>登录即同意</text>
      <text class="deal">《安泰物流用户协议》</text>
    </view>
  </view>
</template>
 
<script>
import { loginPost } from '@/api'
export default {
  name: 'login',
 
  data() {
    return {
      form: {
        account: '',
        password: '',
      }
    }
  },
 
  created() {
  },
 
  methods: {
    dealChange(e) {
      console.log(e)
    },
    onLogin() {
      const { form } = this
      if (!form.account) return uni.showToast({
        title: '账号后不能为空',
        icon: 'none'
      })
      if (!form.password) return uni.showToast({
        title: '密码不能为空',
        icon: 'none'
      })
      loginPost({
        ...form,
        openId: this.$store.state.openId
      }).then(res => {
        console.log('res', res);
      })
    }
  }
}
</script>
 
<style lang="scss" scoped>
.login {
  width: 100%;
  height: 100vh;
  display: flex;
  padding-top: 160rpx;
  box-sizing: border-box;
  align-items: center;
  flex-direction: column;
  background: linear-gradient(
    180deg,
    rgba(39, 155, 170, 0.2) 0%,
    rgba(39, 155, 170, 0) 100%
  );
  .login_logo {
    width: 180rpx;
    height: 180rpx;
  }
  .login_bg {
    position: absolute;
    top: 0;
    width: 750rpx;
  }
  .login_title {
    font-size: 44rpx;
    font-weight: 600;
    color: #333333;
    margin-top: 40rpx;
    margin-bottom: 120rpx;
  }
  .login_list {
    width: 100%;
    padding: 0 60rpx;
    box-sizing: border-box;
    .login_list_item {
      width: 100%;
      border-radius: 50rpx;
      height: 98rpx;
      padding: 0 40rpx;
      box-sizing: border-box;
      background: #ffffff;
      margin-bottom: 40rpx;
      display: flex;
      align-items: center;
      justify-content: space-between;
      &:last-child {
        margin-bottom: 0 !important;
      }
      image {
        flex-shrink: 0;
        width: 40rpx;
        height: 40rpx;
      }
      input {
        flex: 1;
        height: 100%;
        color: #666666;
        margin-left: 24rpx;
        border: none;
      }
    }
  }
  .login_btn {
    width: 100%;
    padding: 0 60rpx;
    box-sizing: border-box;
    margin-top: 80rpx;
    .for_psd {
      color: #279baa;
      margin-top: 40rpx;
      width: 140rpx;
      text-align: center;
      margin: 40rpx auto;
    }
    .login_btn_n {
      width: 100%;
      height: 98rpx;
      background: #279baa;
      box-shadow: 0rpx 12rpx 24rpx 0rpx rgba(39, 155, 170, 0.2);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 500;
      font-size: 32rpx;
      color: #ffffff;
      border-radius: 50rpx;
    }
  }
  .deal_wrap {
    position: absolute;
    width: 100%;
    left: 0;
    text-align: center;
    bottom: 108rpx;
    .deal {
      color: #279baa;
    }
  }
}
</style>