fml.html
7.32 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta content="telephone=no" name="format-detection">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Cache" content="no-cache">
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>家族</title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/layer.css">
<link rel="stylesheet" href="css/index.css?v=2020031801">
<script src="lib/fsize.js"></script>
</head>
<body>
<div style="height: 0.2rem;"></div>
<div class="input-box"><input type="text" placeholder="请输入家族名称" maxlength="8"><div class="input-btn">搜索</div></div>
<ul class="fml-ul">
<!-- <li>
<span class="fml-span1">
<img class="fml-face" src="https://zhibocdn.lvdou66.com/comm/user/boy.png?x-oss-process=image/resize,w_80" alt="">
<p class="fml-p1">MF</p>
<p class="fml-p2">族长:MF传媒魔法哥</p>
</span>
<span class="fml-span2">
<div class="fml-btn">申请加入</div>
</span>
</li> -->
</ul>
<div class="exc">换一换</div>
</body>
<script src="lib/jquery-3.1.1.min.js"></script>
<script src="layer-v3.1.0/layer/layer.js"></script>
<script>
// $ip = 'http://test.api.lvdou66.com/';
// $ip = 'https://zhibo.lvdou66.com/87server/'
$ip = 'https://zhibo.lvdou66.com/';
cdn = 'http://zhibocdn.ishuaji.cn/comm';
var bbb = location.href;
var data = url_get_params(bbb)
function url_get_params(url_path) {
var url = url_path;
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(url.indexOf("?") + 1);
strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
return theRequest;
}
//ajax设置默认参数
$.ajaxSetup({
global: false,
type: 'post',
data: {
uid:localStorage.uid,
token:localStorage.token
},
dataType:"JSON"
})
list()
$(".exc").on("click",function(){
list()
})
$(".input-box input").on("input",function(){
if($(".input-box input").val().length==0)list()
console.log(11)
})
$(".input-btn").on("click",function(){
$.ajax({
url:$ip+'weblive/webfamily/find.html',
data:{
family: $(".input-box input").val(),
debug:'debug'
},
type:"post",
success:function(msg){
var data=JSON.parse(msg);
console.log('主播申请列表',data)
var html=[];
$(".exc").hide()
for(var i=0;i<data.data.length;i++){
var list=data.data[i];
html+='<li>';
html+='<span class="fml-span1">';
html+='<img class="fml-face" src="https://zhibocdn.lvdou66.com/comm'+list.logo+'?x-oss-process=image/resize,w_80" alt="">';
html+='<p class="fml-p1">'+list.familyname+'</p>';
html+='<p class="fml-p2">族长:'+list.member.nickname+'</p>';
html+='</span>';
html+='<span class="fml-span2">';
if(list.isapply==1)html+='<div class="fml-btn fml-btn-yes">申请中</div>';
else html+='<div data-type='+list.familyid+' class="fml-btn fml-btn-no">申请加入</div>';
html+='</span>';
html+='</li>';
}
$(".fml-ul").html(html);
$(".fml-btn-no").unbind("click").on("click",function(){
var _self=$(this).attr("data-type")
var _this=$(this)
$.ajax({
url:$ip+'weblive/webfamily/applyadd.html',
data:{
debug:localStorage.token,
familyid:_self
},
success:function(msg){
var data=JSON.parse(msg);
console.log('家族申请入口',data)
if(data.code==1){
layer.msg("已申请成功,请等待申请结果")
_this.addClass("fml-btn-yes")
_this.text("申请中")
_this.unbind("click")
}else{
layer.msg(decodeURIComponent(data.msg));
}
}
})
})
}
})
})
function list(){
$.ajax({
url:$ip+'weblive/webfamily/lists.html',
data:{
debug:'debug',
},
success:function(msg){
var data=JSON.parse(msg);
console.log('主播申请列表',data)
var html=[];
$(".exc").show()
for(var i=0;i<data.data.length;i++){
var list=data.data[i];
html+='<li>';
html+='<span class="fml-span1">';
html+='<img class="fml-face" src="https://zhibocdn.lvdou66.com/comm'+list.logo+'?x-oss-process=image/resize,w_80" alt="">';
html+='<p class="fml-p1">'+list.familyname+'</p>';
html+='<p class="fml-p2">族长:'+list.member.nickname+'</p>';
html+='</span>';
html+='<span class="fml-span2">';
if(list.isapply==1)html+='<div class="fml-btn fml-btn-yes">申请中</div>';
else html+='<div data-type='+list.familyid+' class="fml-btn fml-btn-no">申请加入</div>';
html+='</span>';
html+='</li>';
}
$(".fml-ul").html(html);
$(".fml-btn-no").unbind("click").on("click",function(){
var _self=$(this).attr("data-type")
var _this=$(this)
$.ajax({
url:$ip+'weblive/webfamily/applyadd.html',
data:{
debug:localStorage.token,
familyid:_self
},
success:function(msg){
var data=JSON.parse(msg);
console.log('家族申请入口',data)
if(data.code==1){
layer.msg("已申请成功,请等待申请结果")
_this.addClass("fml-btn-yes")
_this.text("申请中")
_this.unbind("click")
}else{
layer.msg(decodeURIComponent(data.msg));
}
}
})
})
}
})
}
</script>
</html>