zhao_js
2023-11-15 b44e169dd8a6e0f15d3788970176922e96aec6e1
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
<template>
    <view class="invite-code-container colCen borderBox">
        <view class="model-title rowCenCen">
            请输入邀请码
        </view>
        <view class="grey-input-content rowCen borderBox">
            <input class="iptclas" type="text" v-model="inviteCode" placeholder="请填写邀请码" placeholder-class="pla-input"/>
        </view>
        
        <view class="btn-bar rowCenBet">
            <view class="close-btn rowCenCen borderBox" @tap="closeModel()">
                <view>以后再填</view>
            </view>
            <view class="next-btn rowCenCen borderBox" @tap="confrim()" :class="inviteCode?'pinkbtn':''">
                <view>下一步</view>
            </view>
        </view>
        
        <view class="model-tips" v-if="appInfo.isOpenOfficialCode==1">
            <view>填写邀请码有助于您的购物返佣哦!</view>
            <view class="rowCen">没有邀请码可填写以下<view style="color: #FF002C;">官方邀请码</view>:</view>
        </view>
        <view class="copy-bar rowCenBet borderBox" v-if="appInfo.isOpenOfficialCode==1">
            <view class="left-code">
                {{appInfo.officialInvitationCode}}
            </view>
            <view class="copybtn rowCenCen" @tap="useCode()">
                <view>使用邀请码</view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data(){
            return{
                inviteCode:'',
                appInfo:''
            }
        },
        mounted() {
            this.appInfo = uni.getStorageSync('appInfo')
        },
        methods:{
            closeModel(){
                this.$emit('closeModel')
            },
            confrim(){
                var that = this;
                if(this.inviteCode){
                    this.$u.api.getInviteInfo({
                        invite_code:this.inviteCode
                    }).then(e => {
                        if(e.code != 0) return that.$alert(e.msg)
                        this.$emit('confirm',e.data)
                    }).catch(function (err) {
                    })
                }
            },
            useCode(){
                this.inviteCode = this.appInfo.officialInvitationCode
            }
        }
    }
</script>
 
<style lang="scss">
    .invite-code-container{
        width: 640rpx;
        background: #FFFFFF;
        border-radius: 32rpx;
        padding: 0 46rpx;
        .model-title{
            width: 100%;
            height: 135rpx;
            font-size: 34rpx;
            font-weight: 500;
            color: #333333;
        }
        .grey-input-content{
            width: 100%;
            height: 90rpx;
            background: #F8F8F8;
            border-radius: 45rpx;
            padding: 0 21rpx;
            margin-bottom: 65rpx;
            .iptclas{
                flex: 1;
            }
            .pla-input{
                font-size: 28rpx;
                font-weight: 500;
                color: #999999;
            }
        }
        
        .btn-bar{
            width: 100%;
            margin-bottom: 50rpx;
            .close-btn{
                width: 263rpx;
                height: 90rpx;
                background: #F7F7F7;
                border: 1rpx solid #CBCBC9;
                border-radius: 45rpx;
                font-size: 28rpx;
                font-weight: 500;
                color: #999999;
            }
            .next-btn{
                width: 263rpx;
                height: 90rpx;
                background: #CBCBC9;
                border-radius: 45rpx;
                font-size: 28rpx;
                font-weight: 500;
                color: #FFFFFF;
            }
            .pinkbtn{
                background-color: #FD002F;
            }
        }
        
        .model-tips{
            width: 100%;
            font-size: 24rpx;
            font-weight: 500;
            color: #999999;
            margin-bottom: 25rpx;
        }
        
        .copy-bar{
            width: 100%;
            height: 72rpx;
            background: #F8F8F8;
            border-radius: 12rpx;
            margin-bottom: 30rpx;
            padding: 0 20rpx;
            .left-code{
                font-size: 26rpx;
                font-weight: 500;
                color: #FF002C;
            }
            .copybtn{
                width: 158rpx;
                height: 54rpx;
                background: #FFFFFF;
                border-radius: 12rpx;
                font-size: 26rpx;
                font-weight: 500;
                color: #333333;
            }
        }
    }
</style>