-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathread.html
137 lines (133 loc) · 4.29 KB
/
read.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no, email=no" />
<meta name="screen-orientation" content="portrait">
<meta name="full-screen" content="yes">
<meta name="x5-orientation" content="portrait">
<meta name="x5-fullscreen" content="true">
<meta name="msapplication-tap-highlight" content="no">
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta content="dahuotu" name="author" />
<title>搜小说</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="Stylesheet" href="css/reset.css" />
<link rel="stylesheet" href="css/app.css" />
<link rel="stylesheet" href="css/pintuer.layer.m.css" />
<script type="text/javascript" src="js/flexible.js"></script>
<style type="text/css">
</style>
</head>
<body>
<header>
搜小说
</header>
<div style="height: 1.1rem;"></div>
<div class="form" id="appform" v-cloak="">
<div id="catalogList" class="catalog">
<div :class="tips_catalog">为您搜索到<span>{{searchVal}}</span>的最新章节。</div>
<ul class="list">
<template v-for="(item,index) in catalogList">
<li :key="index" :id="index" :class="{checked:index==isActive_catalog}" @click="postSearchPage(index,item.href)">
{{item.title}}
</li>
</template>
</ul>
</div>
<div id="htmlContent" :class="cs_content" v-html="content" :style="bgStyle">
</div>
</div>
<footer>
<div class="nav-flex">
<div class="li" onclick="location.href='index.html'">
<div class="img">搜</div>
<div class="tips">搜小说</div>
</div>
<div class="li" onclick="location.href='list.html'">
<div class="img img-chk">架</div>
<div class="tips">书架</div>
</div>
<div class="li" onclick="location.href='setting.html'">
<div class="img">设</div>
<div class="tips">设置</div>
</div>
</div>
</footer>
</body>
<script type="text/javascript" src="js/vue.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/layer.m/layer.min.js"></script>
<script src="https://cdn.bootcss.com/vue-resource/1.5.1/vue-resource.min.js"></script>
<script>
$(function() {
app.loadStyle();
app.loadSearchList(app.getQueryString('cid'));
});
var app = new Vue({
el: '#appform',
data: {
bgStyle:"",
isActive_catalog: -1,
tips_catalog: "tips hide",
baseUrl: "//dahuotu.bdery.com/api/",
searchVal: "",
catalogList: "",
content: "",
cs_content: "content hide",
},
methods: {
loadStyle: function() {
app.bgStyle = localStorage.getItem("configStyle");
},
loadSearchList: function(href) {
//搜索目录
layer.open({
type: 2,
content: '搜索最新章节中...'
});
this.$http.get(app.baseUrl + "api.aspx?act=xiaoshuo_list&val=" + href).then(function(res) {
//console.log(res.body.data);
app.catalogList = res.body.data;
app.tips_catalog = "tips show";
$("html,body").animate({
scrollTop: $("#catalogList").offset().top - 50
}, 500);
layer.closeAll();
}, function() {
//console.log('请求失败处理');
});
},
postSearchPage: function(index, href) {
//搜索正文
this.isActive_catalog = index;
layer.open({
type: 2,
content: '正在获取小说正文...'
});
this.$http.get(app.baseUrl + "api.aspx?act=xiaoshuo_page&val=" + href).then(function(res) {
//console.log(res.body);
app.content = res.body;
app.cs_content = "content show";
$("html,body").animate({
scrollTop: $("#htmlContent").offset().top - 50
}, 500);
layer.closeAll();
}, function() {
//console.log('请求失败处理');
});
},
getQueryString: function(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg); //search,查询?后面的参数,并匹配正则
if(r != null) return unescape(r[2]);
return null;
},
}
});
</script>
</html>