index.html
6.0 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>十方台公众号</title>
<script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script>
<script src="__TMPL__/public/assets/js/fontsize.js"></script>
<script src="__TMPL__/public/assets/js/weui.js"></script>
<script src="__TMPL__/public/assets/js/myweui.js"></script>
<link href="__TMPL__/public/assets/css/home-index.css" rel="stylesheet">
<link href="__TMPL__/public/assets/css/weui.css" rel="stylesheet">
<link href="__TMPL__/public/assets/css/myweui.css" rel="stylesheet">
<style>
.no-data {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
color: #CCCCCC;
font-size: 0.3rem;
margin-top: 1rem;
}
</style>
</head>
<body>
<div class="content">
<div class="head">
<div class="city">
<div class="city_name">
<text class="city-name">全部</text>
<image src="__TMPL__/public/assets/images/aicon03@2x.png"></image>
</div>
</div>
<div class="input-box">
<input type="text" class="search-input" placeholder="输入寺庙名称"/>
<image src="__TMPL__/public/assets/images/fangdajing.png" class="icon" onclick="enterSearch()"></image>
</div>
</div>
<div class="section">
<foreach name="list" item="vo">
<a href="{:url('portal/index/area',array('id'=>$vo.id))}">
<div class="list-item">
<image src="{:cmf_get_image_preview_url($vo.thumbnail);}" class="img"></image>
<div class="name">{$vo.name}</div>
<div class="people-num">已有<span>{$vo.count}</span>人供奉</div>
<div class="enter">进入</div>
</div>
</a>
</foreach>
<!--<div class="list-item">-->
<!--<image src="__TMPL__/public/assets//images/aicon01@2x.png" class="img"></image>-->
<!--<div class="name">天津大悲禅院</div>-->
<!--<div class="people-num">已有<span>4268</span>人供奉</div>-->
<!--<div class="enter">进入</div>-->
<!--</div>-->
<!--<div class="list-item">-->
<!--<image src="__TMPL__/public/assets//images/aicon01@2x.png" class="img"></image>-->
<!--<div class="name">天津大悲禅院</div>-->
<!--<div class="people-num">已有<span>4268</span>人供奉</div>-->
<!--<div class="enter">进入</div>-->
<!--</div>-->
</div>
</div>
</body>
<script>
function enterSearch() {
$.ajax({
url: "{:url('portal/index/search')}",
type: "post",
data: {
name:$('.search-input').val(),
address:$('.city-name').text()
},
success: function (data) {
var html = "";
for (var i = 0; i < data.length; i++) {
html +=' <a href=" '+data[i]['url']+'">\n' +
' <div class="list-item">\n' +
' <image src="'+data[i]['thumbnail']+'" class="img"></image>\n' +
' <div class="name">'+data[i]['name']+'</div>\n' +
' <div class="people-num">已有<span>'+data[i]['count']+'</span>人供奉</div>\n' +
' <div class="enter">进入</div>\n' +
' </div>\n' +
' </a>'
}
if(data.length === 0) {
html += '<div class="no-data" style="">暂无数据</div>'
}
$(".section").html(html);
}
})
// window.location.href = '../blessing-cards.html';
}
$('.city-name').click(function () {
weui.picker([
{
label: "全部",
value: "",
},
<foreach name="address" item="u">
{
label: "{$u}",
value: "{$u}",
},
</foreach>
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('.city-name').text(res[0].label)
$.ajax({
url: "{:url('portal/index/search')}",
type: "post",
data: {
name:$('.search-input').val(),
address:$('.city-name').text()
},
success: function (data) {
var html = "";
for (var i = 0; i < data.length; i++) {
html +=' <a href=" '+data[i]['url']+'">\n' +
' <div class="list-item">\n' +
' <image src="'+data[i]['thumbnail']+'" class="img"></image>\n' +
' <div class="name">'+data[i]['name']+'</div>\n' +
' <div class="people-num">已有<span>'+data[i]['count']+'</span>人供奉</div>\n' +
' <div class="enter">进入</div>\n' +
' </div>\n' +
' </a>'
}
$(".section").html(html);
}
})
}
}
)
})
</script>
</html>