作者 潘浩文
1 个管道 的构建 通过 耗费 0 秒

首页渲染

... ... @@ -6,21 +6,24 @@
<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">
</head>
<body>
<div class="content">
<div class="head">
<div class="city">
<div class="city_name">
<text>北京</text>
<image src="__TMPL__/public/assets//images/aicon03@2x.png"></image>
<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>
<image src="__TMPL__/public/assets/images/fangdajing.png" class="icon" onclick="enterSearch()"></image>
</div>
</div>
... ... @@ -52,5 +55,20 @@
function enterSearch() {
window.location.href = '../blessing-cards.html';
}
$('.city-name').click(function () {
weui.picker([
{label: '北京', value: 0},
{label: '天津', value: 1},
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('.city-name').text(res[0].label)
}
}
)
})
</script>
</html>
\ No newline at end of file
... ...
... ... @@ -124,4 +124,10 @@ body, html {
display: flex;
align-items: center;
justify-content: center;
}
.picker {
width: 2rem;
height: 1rem;
background-color: #e5e5e5;
display: none;
}
\ No newline at end of file
... ...
.weui-picker__item {
font-size: 0.3rem !important;
}
.weui-picker__hd {
width: auto !important;
font-size: 0.3rem;
}
.weui-picker__action {
display: block;
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
color: rgba(0, 153, 204, 1);
}
.weui-toast {
position: fixed;
z-index: 5000;
width: 2.5rem;
min-height: 2.5rem;
top: 180px;
left: 50%;
margin-left: -1.25rem;
background: rgba(17, 17, 17, 0.7);
text-align: center;
border-radius: 5px;
color: #FFFFFF;
}
.weui-dialog__title {
font-weight: 500;
}
.weui-dialog__hd {
padding: 0rem 0rem 0rem !important;
}
.weui-skin_android .weui-dialog__hd {
text-align: left;
padding: 0rem .6rem 0rem !important;
}
.weui-skin_android .weui-dialog__title {
font-size: .38rem;
font-family: PingFang-SC-Medium;
color: rgba(0, 0, 0, 1);
}
.weui-skin_android .weui-dialog__bd {
color: #999999;
padding: 0rem .6rem .6rem;
font-size: .3rem;
text-align: left;
}
.weui-skin_android .weui-dialog__btn {
color: rgba(51, 51, 51, 1);
}
.weui-toast__content {
font-size: .3rem;
}
.weui-picker__item {
font-size: 0.3rem !important;
}
.weui-picker__hd {
width: auto !important;
font-size: 0.3rem;
}
.weui-picker__action {
display: block;
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
color: rgba(247, 123, 32, 1);
}
.weui-toast__content {
width: 100% !important;
text-align: center !important;
color: rgba(255, 255, 255, 1);
margin-top: 0.2rem;
text-align: center;
}
\ No newline at end of file
... ...
var mo = function(e) {
e.preventDefault();
};
/***禁止滑动***/
function stop() {
document.body.style.overflow = 'hidden';
document.addEventListener("touchmove", mo, false); //禁止页面滑动
}
/***取消滑动限制***/
function move() {
document.body.style.overflow = ''; //出现滚动条
document.removeEventListener("touchmove", mo, false);
}
function toast(that) {
var $toast = $('#toast');
stop()
$toast.find(".weui-toast__content").html(that)
if($toast.css('display') != 'none') return;
$toast.fadeIn(100);
setTimeout(function() {
$toast.fadeOut(100);
move()
}, 2000);
}
function toastsuccess(that) {
var $toast = $('#toastsuccess');
stop()
$toast.find(".weui-toast__content").html(that)
if($toast.css('display') != 'none') return;
$toast.fadeIn(100);
setTimeout(function() {
$toast.fadeOut(100);
move()
}, 2000);
}
$('.js_dialog').on('click', '.weui-dialog__btn', function() {
$(this).parents('.js_dialog').fadeOut(200);
move()
});
... ...