.mui-table-view li {
overflow: hidden;
margin: 1.25rem 3% 0;
border-radius: 0.21rem;
background-color: #FFFFFF;
}
.i-da {
background: url(../img/zhifu.png) no-repeat;
background-position: right 6% bottom 2.25rem;
background-size: 8.63rem 4.92rem;
}
.i-ed {
background: url(../img/daizhifu.png) no-repeat;
background-position: right 6% bottom 2.25rem;
background-size: 8.63rem 4.92rem;
}
.mui-table-view li a {
display: block;
height: 11.33rem;
}
.m_num {
height: 3.33rem;
padding-left: 6%;
color: #fff;
font-size: 0.92rem;
line-height: 3.33rem;
background: #f86442;
}
.i-ed .m_num {
background: #77b7ff;
}
.m_num strong {
font-size: 1.5rem;
}
.mui-table-view li dl {
padding-top: 1.08rem;
padding-left: 6%;
}
.mui-table-view li dl dt, .mui-table-view li dl dd {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mui-table-view li dl dt {
padding-bottom: 0.83rem;
border-bottom: 1px solid #ececec;
font-size: 1.42rem;
line-height: 1.42rem;
color: #585858;
}
.mui-table-view li dd {
width: 100%;
padding-left: 7%;
color: #808080;
font-size: 1.17rem;
line-height: 1.6;
}
.add {
margin-top: 0.32rem;
background: url(../img/tuoyuan.png) left center no-repeat;
background-size: 1.17rem 1.17rem;
}
.time {
background: url(../img/yuan.png) left center no-repeat;
background-size: 1.17rem 1.17rem;
}
.time span:nth-child(1),
.time span:nth-child(2) {
padding-right: 5%;
}
$(function(){
$(window).resize(getWidth);
function getWidth() {
var windowWidth = $(window).width();
if(windowWidth >= 640) {
$("html").css({
'font-size' : '24px'
})
}
else {
$("html").css({
'font-size' : 24 / 640 * windowWidth + 'px'
})
}
}getWidth();
})
// 作为全站都需要使用的JS,需要提取到JS文件当中,不要书写在HTML当中
// 为了防止全局作用域被污染,会使用$(function(){}) 或匿名函数进行封装
mui.init({
swipeBack: false,
pullRefresh: {
container: '#refreshContainer',
down: {
height: 50,
callback: pulldownRefresh
},
up: {
contentrefresh: '正在加载...',
callback: pullupRefresh
}
}
});
/**
* 下拉刷新具体业务实现
*/
function pulldownRefresh() {
setTimeout(function() {
var table = document.body.querySelector('#tabcon');
var cells = document.body.querySelectorAll('#tabcon li');
for (var i = cells.length, len = i + 3; i < len; i++) {
var li = document.createElement('li');
li.className = '#tabcon li';
li.innerHTML = '
//下拉刷新,新纪录插到最前面;
table.insertBefore(li, table.firstChild);
}
mui('#refreshContainer').pullRefresh().endPulldownToRefresh(); //refresh completed
}, 1000);
}
var count = 0;
/**
* 上拉加载具体业务实现
*/
function pullupRefresh() {
setTimeout(function() {
mui('#refreshContainer').pullRefresh().endPullupToRefresh((++count > 2)); //参数为true代表没有更多数据了。
var table = document.body.querySelector('#tabcon');
var cells = document.body.querySelectorAll('#tabcon li');
for (var i = cells.length, len = i + 20; i < len; i++) {
var li = document.createElement('li');
li.className = '#tabcon li';
li.innerHTML = '
table.appendChild(li);
}
}, 1000);
}