com.js
4.49 KB
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
/**
* Created by webshow on 2018/8/13.
*/
$ip="http://test.api.lvdou66.com/";
cdn="https://zhibocdn.lvdou66.com/comm";
$(function () {
if($.cookie("ukk")!=undefined){
$.ajax({
url:$ip+"weblive/myinfo.html",
data:{
uid:$.cookie("ukk"),
token: $.cookie("tbb")
},
type:"post",
error: function (msg) {
console.log('请求出错');
$.cookie("ukk", null, {
path: "/",
expires: -1
});
$.cookie("tbb", null, {
path: "/",
expires: -1
});
layer.msg("登录失效,请重新登录。")
},
success: function (msg) {
var data=JSON.parse(msg);
// console.log(data)
if(data.code==1){
$(".login-no").hide();
$(".lonin-yes").css("display","inline-block");
$(".header-avatar").attr("src",cdn+data.user.face+'?x-oss-process=image/resize,w_100');
$(".header-name").text(data.user.nickname);
$(".info-avatar").attr("src",cdn+data.user.face+'?x-oss-process=image/resize,w_100');
$(".info-name").text(data.user.nickname);
$(".info-uid").text("Yabo ID:"+data.user.uid);
$(".diamond").text(data.diamond);
$(".coin").text(data.coin);
$(".login-out").on("click", function () {
$.ajax({
url:$ip+"/weblive/logout.html",
data:{
uid:$.cookie("ukk"),
token: $.cookie("tbb")
},
type:"post",
error: function (msg) {
console.log('请求出错');
},
success: function (msg) {
var data=JSON.parse(msg);
// console.log(data)
if(data.code==1){
$.cookie("ukk", null, {
path: "/",
expires: -1
});
$.cookie("tbb", null, {
path: "/",
expires: -1
});
window.location.reload()
}
}
})
})
}else{
$.cookie("ukk", null, {
path: "/",
expires: -1
});
$.cookie("tbb", null, {
path: "/",
expires: -1
});
layer.msg("登录失效,请重新登录。")
}
}
})
}else{
}
})
$(".login-btn").on("click", function () {
layer.open({
type: 2,
title: false,
shadeClose: true,
skin: "yourclass",
area: ["760px", "620px"],
content: "../pop/login.html",
})
})
$(".register").on("click", function () {
layer.open({
type: 2,
title: false,
shadeClose: true,
skin: "yourclass",
area: ["760px", "790px"],
content: "../pop/registered.html",
})
})
$(".pay").on("click", function () {
layer.open({
type: 2,
title: false,
shadeClose: true,
skin: "yourclass",
area: ["760px", "600px"],
content: "../pop/pay.html",
})
})
$(".lonin-yes").hover(function () {
$(this).find(".info-pop-box").stop();
$(this).find(".info-pop-box").slideDown(100);
},function () {
$(this).find(".info-pop-box").stop();
$(this).find(".info-pop-box").slideUp(100);
});
/*退出登录*/
$(".outlogin").click(function () {
$(".pop-outlogin").fadeIn(100);
$(".black-bg").fadeIn(100);
});
$(".pop-outlogin .close").click(function () {
$(".pop-outlogin").fadeOut(100);
$(".black-bg").fadeOut(100);
});
$(".pop-outlogin .canceloutlogin").click(function () {
$(".pop-outlogin").fadeOut(100);
$(".black-bg").fadeOut(100);
});