-
Notifications
You must be signed in to change notification settings - Fork 0
/
detail_open_plus_tiedan.html
253 lines (213 loc) · 10.9 KB
/
detail_open_plus_tiedan.html
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
249
250
251
252
253
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="css/ui-tab.css">
<link rel="stylesheet" href="css/ui-base.css">
<link rel="stylesheet" href="css/ui-box.css">
<link rel="stylesheet" href="css/ui-color.css">
<link rel="stylesheet" href="css/ui-res.css">
<link rel="stylesheet" href="css/ui-365.css">
<link rel="stylesheet" href="css/ui-single.css">
<script src="js/beihai365_comman.js"></script>
<script src="js/beihai365_global.js"></script>
<script src="js/zepto.min.js"></script>
</head>
<body class="fp-section um-vp" style="background: #fff;">
<div class="">
<div class="single-loading">
<img src="css/img/loadding.png" class="single-loadimg" />
<p class="c_grey_66 f14">
正在加载中
</p>
</div>
<div class="detail_pouper js-detail-po" style="display:none;">
<h1 class="">选择要加入的帖单 </h1>
<p class="js-create-list creat_btn" style="color: #fea714;">
创建新帖单
</p>
<ul class="detail_ul" id="js-creat-ul">
</ul>
<div class="clearfix pouper_bottom">
<div class="ifgolist fr js-change-w">
<p class="js-change golistwar">
<span class="golisticon js-change-icon"></span>
</p>
</div>
<p class="f14 fr js-text">
预览帖单
</p>
</div>
</div>
<div class="newSingle js-new-sing" style="display:none;">
<p class="single_btn js-create-list">
<span class="follow_icon"></span>创建新帖单
</p>
<h1 class="c_grey_33 f24">什么是帖单?</h1>
<p>
帖单是按主题收集帖子的工具。看到喜欢的帖子可以收藏到自己的帖单中,方便以后找到。你还可以关注感兴趣的帖单,去发现其他人收集的好东西。
</p>
</div>
<!--footer结束-->
</div>
</body>
<script>
//记录来路
// var uid = localStorage.uid;
//测试时需要
//uid = '461783';
console.log(localStorage.uid);
;(function() {
var showdec = 'true';
var windowHeight = localStorage.windowHeight;
window.uexOnload = function() {
intfun();
}
function intfun() {
var url = reLink('/index.php?c=threadslist&do=simple_collections_list&tid=' + localStorage.tid);
//console.log(url)
//摘取数据
AJAX.get(url, function(data) {
var data = JSON.parse(data);
//console.log(data);
if (data.result == 'success') {
if (data.data.length <= 0) {
if (!localStorage.nofristCtreate) {
$('.js-detail-po,.single-loading').hide();
$('.js-new-sing').show();
localStorage.nofristCtreate = true;
} else {
$('.js-new-sing,.single-loading').hide();
$('.js-detail-po').show();
}
} else {
var html = '';
var lists = data.data.collection_list;
for (var i = 0; i < lists.length; i++) {
var list = lists[i];
if (list.collection_name.length <= 0) {
continue;
}
var follow_num = '',
postsnum = '';
if (list.follow_num > 0) {
follow_num = ',' + list.follow_num + '人关注';
}
if (list.postsnum > 0) {
postsnum = list.postsnum + '个帖子';
}
html += '<li class="ub ub-ac" data-cid=' + list.collection_id + '>' + '<div class="liicon"></div>' + '<div class="ub-f1 listr">' + '<p class="detail_lispan">' + list.collection_name + '</p>' + '<p class="f14">' + postsnum + follow_num + '</p>' + '</div>' + '</li>';
}
$('#js-creat-ul').html(html).on('click', 'li', function() {
var cid = $(this).attr('data-cid');
localStorage.singleCid = cid;
localStorage.ifCreatorInv = 'true';
addList(cid)
});
$('.single-loading,.js-new-sing').hide();
$('.js-detail-po').show();
}
moveoff()
} else {
uexWindow.toast("0", "5", data.msg, "0");
}
})
function addList(cid) {
var joinlist = reLink('/index.php?c=threadslist&do=join_collection&category=0&cid=' + cid + '&tid=' + localStorage.tid);
AJAX.get(joinlist, function(data) {
var data = JSON.parse(data);
if (data.result == 'success') {
if (showdec == 'true') {
//for 记住打开single-dec这种要用统一的函数,不然会duang!这里不用是因为要换动画
var tiedanDecWindowId = 'single-dec' + localStorage.tiedanDecWindowId;
uexWindow.open(tiedanDecWindowId,'0','stick_single_dec.html','12','','','4');
//newOpenWin('single-dec', 'stick_single_dec.html');
} else {
uexWindow.toast("0", "5", '添加成功', "1000");
}
var reName = ("detail" + localStorage.detailWindowId);
uexWindow.evaluatePopoverScript(reName, "detail_content", "colseTiedan();oRead.loadData(0, true , 1)");
//uexWindow.evaluatePopoverScript(reName, "detail_content", "oRead.loadData()");
} else {
uexWindow.toast("0", "5", data.msg, "1000");
}
}, function() {
alert('拉不到数据')
})
}
$('.js-create-list').click(function() {
//创建帖单
localStorage.ifedit = 'create';
localStorage.username = localStorage.username;
localStorage.tid = localStorage.tid;
//帖子的tid
var reName = ("detail" + localStorage.detailWindowId);
uexWindow.evaluatePopoverScript(reName, "detail_content", "colseTiedan()");
//uexWindow.open('single-title', '0', 'stick_single_title.html', '12', '', '', '4');
newOpenWin('single-title', 'stick_single_title.html');
})
function moveoff(){
var popX = 0,
popY = 0,
moveX = 0,
moveY = 0;
var changeicon = $('.js-change-icon');
var w = $('.js-change').width() - changeicon.width();
if (!localStorage.ifchange) {
changeicon.css('left', w);
showdec = 'true';
$('.js-change-w').removeClass('goli_orange');
} else {
showdec = 'false';
changeicon.css('left', 0);
$('.js-change-w').addClass('goli_orange');
}
//
// //滚动事件
// $('.js-change-w').bind("touchstart",function(event){
// var touchPros = event.touches[0];
// popX = touchPros.pageX;
// });
//
// $('.js-change-w').bind("touchmove",function(event){
// var touchPros = event.touches[0];
// moveX = touchPros.pageX;
// moverf($(this))
// });
//
// $('.js-change-w').bind("touchend",function(event){
// moverf($(this))
// });
$('.js-change-w').click(function() {
console.log(showdec)
if (showdec == 'false') {
showdec = 'true';
$(this).removeClass('goli_orange');
changeicon.css('left', w);
localStorage.ifchange = '';
} else {
showdec = 'false';
$(this).addClass('goli_orange');
changeicon.css('left', 0);
localStorage.ifchange = 'noshow';
}
})
function moverf(that) {
changeicon.css('left', moveX - popX);
if (moveX - popX >= (w / 2)) {
showdec = 'true';
that.removeClass('goli_orange');
changeicon.css('left', w)
} else if (moveX - popX <= 0) {
showdec = 'flase';
that.addClass('goli_orange');
changeicon.css('left', 0)
}
}
}
}
})()
</script>
</html>