k94314517
2024-10-16 17efddc6a667670dca682bf36b51a43e99615e6d
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<template>
    <view class="box">
        <view class="list">
            <view class="list_item">
                <view class="list_item_label">
                    <text>旧密码</text>
                    <text>*</text>
                </view>
                <view class="list_item_content">
                    <input type="password" v-model="param.oldPwd" :maxlength="32" placeholder="请输入旧密码" placeholder-style="color: #999999;" />
                </view>
            </view>
            <view class="list_item">
                <view class="list_item_label">
                    <text>新密码</text>
                    <text>*</text>
                </view>
                <view class="list_item_content">
                    <input type="password" v-model="param.newPwd" :maxlength="32" placeholder="请输入6-18位数字、字母组合" placeholder-style="color: #999999;" />
                </view>
            </view>
            <view class="list_item">
                <view class="list_item_label">
                    <text>确认密码</text>
                    <text>*</text>
                </view>
                <view class="list_item_content">
                    <input type="password" v-model="param.newPwdTemp" :maxlength="32" placeholder="请再输一次新密码" placeholder-style="color: #999999;" />
                </view>
            </view>
        </view>
        <view class="box_tips">
            <u-icon name="info-circle" class="mr12" color="#4d99a8"></u-icon>
            <text>如密码遗忘,请联系园区系统管理员重置</text>
        </view>
        <view class="footer-box">
            <view class="submit-button" @click="onSubmit">提交</view>
        </view>
    </view>
</template>
 
<script>
import { uploadPassword } from '@/api'
    export default {
        data() {
            return {
                param: {}
            };
        },
        methods: {
            onSubmit() {
      const { param } = this
      if (!param.oldPwd) return uni.showToast({
        title: '旧密码不能为空',
        icon: 'none'
      })
      if (!param.newPwd) return uni.showToast({
        title: '新密码不能为空',
        icon: 'none'
      })
      if (!param.newPwdTemp) return uni.showToast({
        title: '确认密码不能为空',
        icon: 'none'
      })
      if (param.newPwdTemp != param.newPwd) return uni.showToast({
        title: '两次输入密码不一致',
        icon: 'none'
      })
      uploadPassword({
        ...param
      }).then(res => {
        if (res && res.code == 200) {
          setTimeout(() => {
            uni.showToast({
              title: '密码修改成功,请重新登录',
              icon: 'success',
              duration: 2000
            })
          })
          uni.redirectTo({
            url: "/pages/staffLogin/login"
          })
        }
      })
    }
        }
    }
</script>
<style>
    page {
        background-color: #f7f7f7 !important;
    }
</style>
<style lang="scss" scoped>
    .box {
        width: 100%;
        .box_tips {
            width: 100%;
            padding: 20rpx 30rpx;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            image {
                width: 20rpx;
                height: 20rpx;
                margin-right: 18rpx;
            }
            text {
                font-size: 26rpx;
                font-weight: 400;
                color: #4c99a7;
            }
        }
        .list {
            width: 100%;
            padding: 0 30rpx;
            box-sizing: border-box;
            background-color: #ffffff;
        
            .list_item {
                width: 100%;
                height: 98rpx;
                display: flex;
                align-items: center;
                justify-content: space-between;
                border-bottom: 1rpx solid #E5E5E5;
        
                .list_item_label {
                    flex-shrink: 0;
                    display: flex;
                    align-items: center;
        
                    text {
                        &:nth-child(1) {
                            font-size: 30rpx;
                            font-weight: 400;
                            color: #222222;
                        }
        
                        &:nth-child(2) {
                            font-size: 30rpx;
                            font-weight: 400;
                            color: #E42D2D;
                        }
                    }
                }
        
                .list_item_content {
                    flex: 1;
                    height: 100%;
                    margin-left: 30rpx;
                    display: flex;
                    align-items: center;
                    justify-content: flex-end;
        
                    text {
                        font-size: 28rpx;
                        font-weight: 400;
                        color: #999999;
                        margin-right: 6rpx;
                    }
        
                    input {
                        width: 100%;
                        height: 100%;
                        text-align: right;
                        font-size: 28rpx;
                        font-weight: 400;
                        color: #222222;
                    }
                }
            }
        }
        .footer-box {
            width: 100%;
            margin-top: 48rpx;
            height: 80rpx;
            display: flex;
            justify-content: center;
            align-items: center;
            .submit-button {
                width: calc(100% - 60rpx);
                height: 88rpx;
                line-height: 88rpx;
                background: #4d99a8;
                border-radius: 4rpx;
                color: #fff;
                border-radius: 44rpx;
                font-size: 32rpx;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }
    }
</style>