zhaojs
2023-06-03 dbf6208f1ad5cf4762df5c9c303565b56cee0ebd
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
<template>
    <view class="model-container colCen">
        <view class="title-box">
            请确认您的邀请人
        </view>
        <view class="subtitle-box">
            仅可填写一次,请核对邀请人信息
        </view>
 
        <view class="avatar-box defIcon">
            <image :src="inviterInfo.avatar" mode="aspectFill"></image>
        </view>
 
        <view class="username">
            {{inviterInfo.nickname}}
        </view>
 
        <view class="phoneInfo rowCenCen">
            <view>{{inviterInfo.account}}</view>
        </view>
 
        <view class="btn-bar rowCenBet">
            <view class="cancel rowCenCen" @tap="cancel()">
                <view>重新填写</view>
            </view>
            <view class="confirm rowCenCen" @tap="setinvite()">
                <view>确认添加</view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                inviteCode: '',
                inviterInfo: ''
            }
        },
        created() {
            this.inviterInfo = uni.getStorageSync('inviterInfo')
        },
        methods: {
            setinvite() {
                var that = this;
                this.$u.api.bindInvitation({
                    invite_code:this.inviterInfo.inviteCode
                }).then(e => {
                    if(e.code != 0) return that.$alert(e.msg)
                    uni.showToast({
                        title:'绑定成功!',
                        icon:'none'
                    })
                    setTimeout(function(){
                        that.$emit('setInvite')
                    },1000)
                }).catch(function (err) {
                })
                    
            },
            cancel(){
                this.$emit('rewrite')
            }
        }
    }
</script>
 
<style lang="scss">
    .model-container {
        width: 500rpx;
        background: #FFFFFF;
        padding: 0 30rpx;
 
        .title-box {
            font-size: 30rpx;
            font-weight: bold;
            color: #333333;
            margin-top: 20rpx;
        }
 
        .subtitle-box {
            font-size: 24rpx;
            font-weight: 500;
            color: #333333;
            margin-top: 25rpx;
        }
 
        .avatar-box {
            width: 126rpx;
            height: 126rpx;
            overflow: hidden;
            border-radius: 50%;
            margin-top: 30rpx;
        }
 
        .username {
            font-size: 24rpx;
            font-weight: 500;
            color: #333333;
            margin-top: 20rpx;
        }
 
        .phoneInfo {
            width: 100%;
            height: 104rpx;
            background: #F7F7F7;
            border-radius: 8rpx;
            font-size: 36rpx;
            font-weight: bold;
            color: #333333;
            margin-top: 20rpx;
        }
 
        .btn-bar {
            width: 100%;
            margin-top: 30rpx;
            margin-bottom: 30rpx;
 
            .cancel {
                width: 196rpx;
                height: 72rpx;
                background: #E5E5E5;
                font-size: 30rpx;
                font-weight: 500;
                color: #333333;
                border-radius: 36rpx;
            }
 
            .confirm {
                width: 196rpx;
                height: 72rpx;
                background: #FD002F;
                border-radius: 36rpx;
                font-size: 30rpx;
                font-weight: 500;
                color: #FFFFFF;
            }
        }
    }
</style>