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
<template>
    <view class="address-form" :data-theme='theme()' :class="theme() || ''">
        <view class="bg-white p-0-30 f30">
            <view class="d-b-c p-30-0 border-b">
                <text class="key-name">账号</text>
                <view class="flex-1">
                    {{detail.user_name}}
                </view>
            </view>
            <view class="d-b-c p-30-0 border-b">
                <text class="key-name">新密码</text>
                <view class="flex-1">
                    <input type="password" v-model="password" placeholder='请输入新密码' />
                </view>
            </view>
            <view class="d-b-c p-30-0 border-b">
                <text class="key-name">重复新密码</text>
                <view class="flex-1">
                    <input type="password" v-model="confirmPass" placeholder='请再输入一次新密码' />
                </view>
            </view>
            <view class="p-30-0">
                <view class="setup-btn" @tap="onSubmit()">确认修改</view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                password: '',
                confirmPass: '',
                detail:{},
            };
        },
        onShow() {
            this.getData();
        },
        methods: {
            getData() {
                let self = this;
                self._get('supplier.index/editPass', {
                        
                    },(res)=>{
                    self.detail = res.data.model;
                })
            },
 
            onSubmit() {
                let self = this;
                if (self.loading) {
                    return
                }
                if (self.password == '') {
                    uni.showToast({
                        title: '请输入新密码',
                        duration: 1000,
                        icon: "none"
                    });
                    return;
                }
                if (self.password != self.confirmPass) {
                    uni.showToast({
                        title: '两次输入的密码不一致',
                        duration: 1000,
                        icon: "none"
                    });
                    return;
                }
                uni.showLoading({
                    title:'加载中'
                })
                self.loading = true;
                self._post('supplier.index/editPass', {password: self.password, confirmPass: self.confirmPass}, function(res) {
                    self.showSuccess('修改成功', function() {
                            self.loading = false;
                            uni.hideLoading();
                            uni.navigateBack({});
                        },
                        function(err) {
                            uni.hideLoading();
                            self.loading = false;
                        }
                    )
 
                });
            },
        }
    };
</script>
 
<style lang="scss">
    .address-form .key-name {
        width: 200rpx;
    }
 
    .address-form .btn-red {
        height: 88rpx;
        line-height: 88rpx;
        border-radius: 44rpx;
    }
 
    .setup-btn {
        height: 80rpx;
        line-height: 80rpx;
        border-radius: 80rpx;
        @include background_color('background_color');
        color: #fff;
        font-size: 30rpx;
        display: flex;
        justify-content: center;
        margin: 0 auto;
    }
 
    .make-item {
        height: 60rpx;
    
    }
    
    .btn-red.code-btn {
        height: 54rpx;
        line-height: 54rpx;
    }
    
    .btn-red.code-btn.issend {
        background: #666666;
        border: none;
        color: #FFFFFF;
        box-shadow: none;
    }
    
    .sub-box {
        padding: 40rpx 0;
    
        .setup-btn {
            width: 686rpx;
            height: 84rpx;
            @include background_color('background_color');
            border-radius: 6rpx;
            line-height: 84rpx;
            color: #fff;
            font-size: 30rpx;
            display: flex;
            justify-content: center;
            margin: 0 auto;
        }
    }
</style>