admin
2022-05-23 e88ac05ee96cbf0306958323bf3063133bd53649
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html>
<html>
    
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="chrome=1"/>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <title>邀请激活</title>
        <link rel="stylesheet" type="text/css" href="css/doui.min.css"/>
        <script src="js/doui.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="js/publicFunction.js" type="text/javascript" charset="utf-8"></script>
        <style type="text/css">
            /*输入*/
            .inputThis{ width: 5.6rem; height: 0.8rem; padding: 0.2rem; margin-bottom: 0.31rem; border-radius: 0.1rem; background-color: #F3F3F3; }
            .inputThis input{ text-align: center; }
            .inputThis input::-webkit-input-placeholder{ font-size: 0.3rem; color: #BBBBBB; }
            /*底部悬浮*/
            .footThis{ left: 0; bottom: 0; width: 7.5rem; height: 0.96rem; border-top: 1px solid #E0E0E0; background-color: rgba(255,255,255,0.96); }
            /*确认按钮*/
            .sumberBtn{ width: 5.2rem; height: 0.76rem; background-color: #E5005C; border-radius: 0.38rem; color: white; }
            /*如何获取邀请码 弹框*/
            .tanThis{ width: 7.5rem; position: fixed; top: 0; left: 0; background-color: rgba(0,0,0,0.5); z-index: 80; }
            .tan-nei{ width: 5.2rem; background-color: white; -webkit-border-radius: 0.3rem; border-radius: 0.3rem; }
        </style>
        <script type="text/javascript">
            doui.importSet([
                'http://cdn.yeshitv.com/js/vue.min.js',
                'js/yesApp.js',
            ]);
        </script>
    </head>
    
    <body style="display:none;">
        <div id="allwai" class="heightenBox fontMobile">
            
            
            <!--内容-->
            <div class="main bg-white" style="padding-bottom:0.96rem;">
                <!--重磅升级外层-->
                <div style="width:7.5rem; height:7.39rem; position:relative; background-image:url(img/AppPage/flq_activation/invite_bg.png); -webkit-background-size:100% 100%; background-size:100% 100%;">
                    <!--输入区域-->
                    <div class="fboxCol Xend Ycenter" style="width:6.9rem; height:2.64rem; position:absolute; left:0.3rem; bottom:0.39rem;">
                        <!--输入-->
                        <div class="inputThis fboxRow Xcenter Ycenter"><input id="yqm" class="font30 flex1" type="text" placeholder="请输入邀请者 邀请码 / 电话号码" v-on:focus="shuru.onFocus()" v-on:click="shuru.onFocus()" v-model="shuru.txt"/></div>
                        <!--没有蓝字-->
                        <div class="font30" style="margin-bottom:0.4rem; color:#0077E5;" v-on:click="tan.howClick()">没有邀请码?</div>
                    </div>
                </div>
                <!--特别提醒区域-->
                <div v-show="warn.show" style="width:7.5rem; padding:0.4rem 0.5rem;">
                    <div class="font34">{{warn.title}}:</div>
                    <div style="width:100%; margin-top:0.4rem;">
                        <div v-if="item" v-for="(item,index) in warn.list" class="font26 fboxRow Xstart Ystart" style="margin-bottom:0.4rem; color:#666666;">
                            <div style="width:0.4rem; line-height:0.4rem;">{{index+1}}.</div>
                            <div class="flex1" style="line-height:0.4rem;">{{item}}</div>
                        </div>
                    </div>
                </div>
            </div>
            
            
            <!--底部悬浮-->
            <div class="position-fixed footThis fboxRow Xcenter Ycenter">
                <!--确认按钮-->
                <div class="sumberBtn click-scale fboxRow Xcenter Ycenter" style="position: relative;" v-on:click="tan.jiClick()"><div class="font36">确认激活</div></div>
            </div>
            
            
            <!--隐藏弹框-->
            <div v-show="tan.show" class="tanThis fboxCol Xcenter Ycenter" v-bind:style="'height:'+sys.winH+'px;'" v-on:click.self="tan.close()">
                
                <!--如何获取邀请码-->
                <div v-show="tan.type==1" class="tan-nei">
                    <!--弹框标题-->
                    <div class="fboxCol Xcenter Ycenter" style="width:100%; padding:0.3rem; border-bottom:1px solid #E0E0E0;">
                        <div class="font36">如何获得邀请码?</div>
                    </div>
                    <!--弹框内容-->
                    <div class="fboxCol Xstart Ycenter" style="width:100%; padding:0.4rem;">
                        <div class="font28" style="width:3.86rem; line-height:0.42rem; color:#666666;">1. 全网搜索邀请者分享出来的邀请码;</div>
                        <div class="font28" style="width:3.86rem; margin-top:0.4rem; line-height:0.42rem; color:#666666;">2. 用积分兑换,敬请期待!</div>
                        <div class="click-scale fboxRow Xcenter Ycenter" style="width:3rem; height:0.68rem; margin-top:0.4rem; border-radius:0.34rem; background-color:#E5005C;" v-on:click.stop="tan.close()">
                            <div class="font34 font-white">知道了</div>
                        </div>
                    </div>
                </div>
                
                <!--确认信息-->
                <div v-show="tan.type==2" class="tan-nei">
                    <!--弹框标题-->
                    <div class="fboxCol Xcenter Ycenter" style="width:100%; padding:0.3rem; border-bottom:1px solid #E0E0E0;">
                        <div class="font36">确认信息</div>
                    </div>
                    <!--弹框内容-->
                    <div class="fboxCol Xstart Ycenter" style="width:100%; padding:0.4rem;">
                        <div class="font28" style="color:#888888;">你填写的邀请码是:</div>
                        <div class="font28 font-weight" style="margin-top:0.3rem;">{{shuru.txt}}</div>
                        <div class="font28 font-weight" style="margin-top:0.4rem;">激活后将获得你的邀请码</div>
                        <!--按钮-->
                        <div class="fboxRow Xstart Ycenter" style="margin-top:0.4rem;">
                            <!--确定-->
                            <div class="click-scale fboxRow Xcenter Ycenter" style="width:2.1rem; height:0.68rem; border-radius:0.34rem; background-color:#E5005C;" v-on:click="tan.subClick()">
                                <div class="font34 font-white">确定</div>
                            </div>
                            <!--重填-->
                            <div class="click-scale fboxRow Xcenter Ycenter" style="width:2.1rem; height:0.68rem; margin-left:0.4rem; border-radius:0.34rem; border:1px solid #E5005C;" v-on:click="tan.reClick();">
                                <div class="font34" style="color:#E5005C;">重填</div>
                            </div>
                        </div>
                    </div>
                </div>
                
            </div>
            
            
        </div>
    </body>
    
</html>
 
 
<script type="text/javascript">
    
    // vue 初始化
    var vm = null;
    doui.onReady(function()
    {
        yesApp.closeBtnHidden();
        
        vm = new Vue({
            el: "#allwai",
            // 数据
            data: {
                
                // 系统信息
                sys: {
                    winH: 0, // 屏幕高度px
                },
                
                // 邀请码输入部分
                shuru: {
                    txt: "",
                    timeout: null, // 定时器
                    // 输入框被遮盖解决
                    onFocus: function () 
                    {
                        if (vm.shuru.timeout != null) { clearTimeout(vm.shuru.timeout); }
                        vm.shuru.timeout = setTimeout(function(){ doui.scrollTo("body", 140, false); }, 600);
                    },
                    init: function () { vm.shuru.txt = ""; },
                },
                
                // 特别提醒
                warn: {
                    show: false,
                    title: "特别提醒",
                    list: [],
                    // 获取提醒
                    request: function ()
                    {
                        // 数据准备
                        var myurl = getHttp() + "/api/v1/invite/getActivationTip";
                        var mydata = yesApp.AjaxData({});
                        // 数据请求
                        doui.AjaxGet(myurl, mydata, function(res)
                        {
                            if (res.code != 0) { yesApp.showToast(res.msg); }
                            else {
                                vm.warn.list = res.data.tip; 
                                vm.warn.show = true; 
                            }
                        });
                    },
                },
                
                // 弹框
                tan: {
                    show: false,
                    type: 1, // 1-如何获取邀请码      2-确认信息
                    // 弹框动效关闭
                    close: function (callback) { vm.tan.init(); if (callback) { callback(); } },
                    // “ 没有邀请码 ” 点击
                    howClick: function () { vm.tan.type = 1; vm.tan.show = true; },
                    // 底部确认激活按钮 点击
                    jiClick: function () 
                    {
                        if (vm.shuru.txt) { vm.tan.type = 2; vm.tan.show = true; }
                        else { yesApp.showToast("请输入邀请码"); }
                    },
                    // 重填按钮 点击
                    reClick: function () 
                    {
                        // 关闭弹框
                        vm.tan.close(function()
                        {
                            // 输入组件获取焦点
                            vm.shuru.init();
                            document.getElementById("yqm").focus();
                        });
                    },
                    // 最终提交发送
                    subClick: function () 
                    {
                        // 关闭弹框
                        vm.tan.close(function()
                        {
                            yesApp.userInfo(function(user)
                            {
                                // 数据准备
                                var myurl = getHttp() + "/api/v1/invite/activationInvite";
                                var mydata = yesApp.AjaxData({
                                    uid: user.id,
                                    inviteCode: vm.shuru.txt,
                                });
                                // 数据请求
                                yesApp.showLoading("激活中");
                                doui.AjaxGet(myurl, mydata, function(res)
                                {
                                    yesApp.hideLoading();
                                    if (res.code != 0) { yesApp.showToast(res.msg); }
                                    else { 
                                        var pageUrl = getHost() + "flq_inviteCodeState.html";
                                        yesApp.pageToWeb(pageUrl, false);
                                    }
                                });
                            });
                        });
                    },
                    // 初始化
                    init: function () { vm.tan.show = false; vm.tan.type = 1; },
                },
                
            }
        });
        
        
        // 获取系统信息
        vm.sys.winH = doui.systemInfoGet().windowHeight;
        
        
        // 请求特别提醒数据
        vm.warn.request();
        
        
        document.body.style.display = "block";
    });
    
</script>