819527061@qq.com
2024-05-11 f73ed7862edc9c3cb78a2610486643a2fa079fde
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
197
198
199
200
201
202
203
204
205
206
207
<template>
    <view class="login-wrap">
        <pageNav style="width: 100%;">
            <slot-one>
                <span class="login-biaoti">唐山市烟草配送客户端</span>
            </slot-one>
        </pageNav>
        <view class="login-wrap-inside">
            <view class="login-main">
                <view class="login-bj">
                    <image src="./static/image/login-bj.png" mode="aspectFill"></image>
                </view>
                <view class="user-box">
                    <u-form :model="valiFormData" ref="valiFormData">
                        <u-form-item prop="licence">
                            <u-input v-model="valiFormData.licence" class="uni-input" border placeholder="请输入零售许可证号"/>
                        </u-form-item>
                        <u-form-item prop="linker">
                            <u-input v-model="valiFormData.linker" class="uni-input" border placeholder="请输入法人姓名"/>
                        </u-form-item>
                        <!-- <u-form-item prop="phone">
                            <u-input v-model="valiFormData.phone" class="uni-input" border placeholder="请输入手机号码"/>
                        </u-form-item> -->
                    </u-form>
                    <view class="login-btn">
                        <u-button plain hover-class="none" class="dengluBtn" open-type="getUserInfo" @getuserinfo="appLoginWx('valiFormData')">立 即 绑 定</u-button>
                    </view>
                    
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                valiFormData: {
                    licence: '',
                    openId:'',
                    linker:'',
                    // phone:''
                },
                rules: {
                    licence:[
                        {
                            required: true,
                            message: '零售许可证号不能为空',
                            trigger: ['change', 'blur']
                        }
                    ],
                    linker:[
                        {
                            required: true,
                            message: '法人姓名不能为空',
                            trigger: ['change', 'blur']
                        }
                    ]
                },
                showPassword: false,
                type_text: "text",
                type_password: "password",
                psdType:"password"
            }
        },
        onLoad(options) {
            console.log('options----',options)
            if(options.openId) {
                this.valiFormData.openId = options.openId
            }
        },
        onReady() {
            this.$refs.valiFormData.setRules(this.rules)
        },
        methods: {
            changePassword: function() {
                this.showPassword = !this.showPassword
            },
            appLoginWx(ref) {
                this.$refs.valiFormData.validate(valid => {
                    if(valid) {
                        if(this.valiFormData.openId.length != 28) {
                            this.$u.toast('openId不正确')
                            return
                        }
                        this.$u.api.bindWx(this.valiFormData).then(res => {
                            if(res.success) {
                                    this.$store.commit('login',res.result)
                                    // this.$store.commit('setOpenId',res.result.openId)
                                    uni.switchTab({
                                        url: '/pages/home/home'
                                    })
                                }else {
                                    this.$u.toast(res.message)
                                }
                        })
                    }
                })
            }
        }
    }
</script>
 
<style>
 
</style>
<style lang="scss" scoped>
    /deep/ .u-btn--default{
        background-color: transparent!important;
        color: #fff!important;
    }
    /deep/ .u-hairline-border:after{
        border:none!important;
    }
    /deep/ .u-border-bottom:after, .u-border-left:after, .u-border-right:after, .u-border-top-bottom:after, .u-border-top:after, .u-border:after{
        border-bottom-style:none!important;
    }
    .login-wrap {
        width: 100%;
        // height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .login-biaoti{
        font-size: 32rpx;
        color: #FFFFFF;
        line-height: 88rpx;
        margin-top: 88rpx;
        display: inline-block;
        margin-left: 40rpx;
        font-weight: Light;
        letter-spacing: 1rpx;
    }
    .login-bj{
        width: 627rpx;
        height: 447rpx;
        margin-top: 40rpx;
        image{
            width: 100%;
        }
    }
    .login-btn{
        display: flex;
        justify-content: center;
    }
    .login-flex-box{
        display: flex;
    }
    .login-wrap-inside {
        width: 100%;
        display: flex;
        justify-content: center;
 
        .login-main {
            display: flex;
            flex-direction: column;
            margin-top: 20%;
 
            .title {
                text-align: center;
                color: #34404e;
                font-size: 42rpx;
                text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.4);
            }
        }
    }
 
    .login-main-inside {
        margin-top: 100rpx;
 
        .welcom {
            color: #ff3c2e;
            font-size: 36rpx;
        }
    }
 
    // /deep/.uni-input-wrapper {
    //     /* #ifndef APP-NVUE */
    //     display: flex;
    //     /* #endif */
    //     padding: 8px 13px;
    //     flex-direction: row;
    //     flex-wrap: nowrap;
    // }
 
    .user-box {
        margin-top: 60rpx;
    }
 
    .dengluBtn {
        background-color: #1F9F4C;
        color: #fff;
        font-size: 30rpx;
        width: 280rpx;
        height: 76rpx;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 60rpx;
    }
 
    
 
    
</style>