-
Notifications
You must be signed in to change notification settings - Fork 0
/
stick_single_decOperate_content.html
264 lines (208 loc) · 10.3 KB
/
stick_single_decOperate_content.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
254
255
256
257
258
259
260
261
262
263
264
<!DOCTYPE HTML>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, user-scalable=no" />
<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/jquery-2.0.3.min.js"></script>
<script src="js/beihai365_comman.js"></script>
<script src="js/beihai365_global.js"></script>
<script src="js/laytpl.js"></script>
<script src="js/iscroll.js"></script>
<script src="js/iscrollAssist.js"></script>
<script src="js/share_read.js"></script>
</head>
<!-- 贴单详情 列表-->
<body class="bg365 um-vp" style="">
<section class="head_single" id="head-single">
</section>
<section class="single_dec_ul">
<ul id="creatHtml">
</ul>
</section>
<!-- 操作 -->
<section class="poule_bg hide js-pouple">
<ul class="pouple_ul js-operation">
<li data-operation="edit">
编辑
</li>
<li data-operation="del">
删除
</li>
</ul>
</section>
<!-- 操作 -->
<section class="poule_bg hide js-pouple-del poule_bg_ab">
<div class="js-del-wap del_wap">
<h1 class="del_h1 js-del-title">删除帖单</h1>
<p class="c_grey_66 f16 js-del-desc">
确定要删除该帖单么?
</p>
<div class="ub del_text">
<p class="ub-f1 js-true-btn">
删除
</p>
<p class="ub-f1 js-close">
取消
</p>
</div>
</div>
</section>
<script>
var uid = localStorage.uid,
cid = localStorage.singleCid;
//用于存储
var htmlHead = localStorage.decHtml;
var decMian = localStorage.decMian;
//把缓存的内容放进来
$('#head-single').html(htmlHead);
$('#creatHtml').html(decMian);
$('.js-edit-btn,.js-all-oper').removeClass('hide');
$('.js-set-btn,.js-share-btn').addClass('hide');
;(function() {
window.uexOnload = function() {
if (uexWidgetOne.iOS7Style) {
$("#header").css({
"padding-top" : "1.25rem"
});
$(".header_single").css({
"padding-top" : "1.25rem"
});
}
//监听侧滑
uexWindow.onSwipeRight = function() {
//uexWindow.evaluateScript("single-decOperate", 0, "uexWindow.close('-1');");
}
intfun();
}
function intfun() {
//其它事件
var delarray = {
delpaste : {
'title' : '删除贴子',
'describe' : '确定要删除该帖子么?',
'posturl' : '/index.php?c=threadslist&do=del_post'
},
delsingle : {
'title' : '删除帖单',
'describe' : '确定要删除该帖单么?',
'posturl' : '/index.php?c=threadslist&do=del_collection'
}
}
var delfun = function(sign, tid, that) {
var onedata = delarray[sign];
$('.js-del-title').html(onedata.title);
$('.js-del-desc').html(onedata.describe);
var st = $(window).scrollTop();
var winh = $(window).height();
var h = $('html').height();
if(winh > h){
h = winh;
}
$('.js-pouple-del').height(h).removeClass('hide');
$('.js-del-wap').css('top', st + ~~(winh/3));
//$('.js-pouple-del').removeClass('hide')
//$('.js-del-wap').css('top', st);
ifnomeove = true;
var posturl = reLink(onedata.posturl + '&cid=' + cid + '&tid=' + tid + 'id&category=0');
$('.js-true-btn').bind('click', function() {
AJAX.get(posturl, function(data) {
var data = JSON.parse(data);
console.log('data');
if (data.result == 'success') {
refreshDec();
uexWindow.toast("0", "5", '删除成功', "2000");
that.parents('li').remove();
$('.js-pouple-del').addClass('hide');
ifnomeove = false;
} else {
uexWindow.toast("0", "5", data.msg, "2000");
}
}, function() {
alert('数据获取失败');
})
})
}
//编辑自己的帖单,删除帖子
$('.js-del-paste').click(function(e) {
e.stopPropagation();
var that = $(this);
var tid = that.parents('.js-all-oper').attr('data-tid');
delfun('delpaste', tid, that);
})
//置顶
$('.js-stick-btn').click(function() {
var that = $(this);
var tid = that.parents('.js-all-oper').attr('data-tid');
var stick = '/index.php?c=threadslist&do=posts_top&cid=' + cid + '&category=0&tid=' + tid;
stick = reLink(stick);
AJAX.get(stick, function(data) {
var data = JSON.parse(data);
console.log(data);
if (data.result == 'success') {
$('#creatHtml').prepend(that.parents('li'));
refreshDec();
uexWindow.toast("0", "5", '置顶成功', "2000");
} else {
uexWindow.toast("0", "5", data.msg, "2000");
}
}, function() {
alert('数据获取失败');
})
})
//编辑标题
$('.js-edit-btn').click(function() {
var cid = $(this).attr('data-colleid');
var title = $(this).attr('data-title');
localStorage.singleCid = cid;
localStorage.ifedit = 'edit';
localStorage.titleName = title;
localStorage.uid = uid;
newOpenWin('single-title', 'stick_single_title.html');
})
//取消事件
$('.js-close,.js-pouple,.js-pouple-del').click(function() {
var per = $(this).parents('.js-pouple-del').length != 0 ? $(this).parents('.js-pouple-del') : $(this);
per.addClass('hide');
$('.js-true-btn').unbind('click');
ifnomeove = false;
})
}
// 以下主要用来消除沙发里浏览器的滚动事件
$('body').bind('touchmove', function(e) {
if (ifnomeove) {
e.preventDefault();
}
});
})();
//来自父窗口的点击
function _setBtn(h) {
var st = $(window).scrollTop();
$('.js-pouple-del').height(h).removeClass('hide').css();
ifnomeove = true;
}
function openMySingleDec(tidsing) {
uexWindow.toast("0", "5", '您目前处于编辑状态,无法跳转哦', "3000");
}
function refreshDec() {
var reName = ("single-dec" + localStorage.tiedanDecWindowId);
uexWindow.evaluateScript(reName, 0, "onloadHtml.createHtml()");
}
function editTitle(text) {
$('.js-edit-title').html(text);
$('.js-edit-btn').attr('data-title',text);
uexWindow.evaluateScript("single-list", 0, "onloadHtml.createHtml()");
//预防其它途径进来的列表没有更新
var reName = ("single-list" + localStorage.tiedanWindowId);
uexWindow.evaluateScript(reName, 0, "window.location.reload();");
}
</script>
</body>
</html>