zhaojs
2023-06-03 2df0354b45e0d2f516ec8aa63c27bb96f486f06b
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
<template>
    <view class="modifyPass-container wrapperLayer">
        <titleBar titleText='' :pageForm='"modifyPass"'></titleBar>
        <view class="pageInfoContent-container colCen borderBox">
            <view class="titleText">
                修改邀请码
            </view>
            
            <view class="input-container colCen">
                <view class="outSidebox rowCenBet" data-type='code'>
                    <input 
                        maxlength="8"
                        type="text"
                        v-model="code"
                        placeholder="请输入新的邀请码" 
                        placeholder-class="input-placeHolder"/>
                </view>
            </view>
            
            <view class="txtTips">
                邀请码需设置为4~8位的数字与字母的组合。
            </view>
            
            <view class="login-btn rowCenCen" :class="true?'colorfulbtn':''" @click="modify()">
                <view class="btn-font">
                    确认修改
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    import titleBar from '../../../components/backTitlebar.vue'
    import MD5 from '../../../utils/md5.js'
    import config from '../../../utils/config.js'
    import utils from '../../../utils/utils.js'
    export default {
        components: {
            titleBar
        },
        data(){
            return{
                user:'',
                code:''
            }
        },
        onLoad() {
        },
        methods:{
            modify() {
                var that = this;
                var str = /^[a-zA-Z0-9]{4,8}$/;
                if (str.test(this.code)) {
                    this.$u.api.changeCode({
                        invite_code:this.code
                    }).then(e => {
                        if(e.code == 1)return that.$alert(e.msg);
                        that.$alert('修改成功');
                        setTimeout(function(){
                            uni.navigateBack({
                                delta:1
                            })
                        },1000)
                        
                    }).catch(function (err) {
                    })
                } else {
                    uni.showToast({
                        title: '邀请码不符合要求,请输入4~8位的数字与字母的组合',
                        icon: 'none',
                        position: 'bottom',
                        duration: 3000
                    });
                }
            }
        }
    }
</script>
 
<style lang="scss">
    .modifyPass-container{
        width: 100%;
        min-height: 100vh;
        background-color: #FFFFFF;
        .pageInfoContent-container{
            width: 100%;
            padding: 0 60rpx;
            .titleText{
                width: 100%;
                font-size: 42rpx;
                font-weight: bold;
                color: #333333;
                margin: 60rpx 0;
            }
            
            .input-container{
                width: 100%;
                margin-bottom: 20rpx;
                .outSidebox{
                    width: 100%;
                    height: 85rpx;
                    border-bottom: 2rpx solid #F1F1F1;
                    .input-placeHolder{
                        font-size: 34rpx;
                        font-weight: 500;
                        color: #CACACA;
                    }
                    input{
                        font-size: 34rpx;
                        font-weight: 500;
                        color: #222222;
                    }
                    .hidepass{
                        font-size: 32rpx;
                        font-weight: 800;
                        color: #CACACA;
                    }
                    .getcodebox{
                        font-size: 28rpx;
                        white-space: nowrap;
                        font-weight: 400;
                        color: #FF2851;
                        pointer-events: none;
                    }
                    .colorTxt{
                        pointer-events: auto;
                    }
                }
                .outSidebox-active{
                    border-bottom: 2rpx solid #FF2851;
                }
            }
            .login-btn{
                width: 100%;
                height: 86rpx;
                background: #E2E2E2;
                border-radius: 43rpx;
                margin-top: 80rpx;
                pointer-events: none;
                .btn-font{
                    font-size: 30rpx;
                    font-weight: 500;
                    color: #FFFFFF;
                }
            }
            .txtTips {
                font-size: 26rpx;
                font-weight: 400;
                color: #999999;
                line-height: 38rpx;
            }
            .colorfulbtn{
                background: #FD002F;
                pointer-events: auto;
            }
        }
    }
</style>