Commit b1001144 by 陈超

A

parent bbf743f9
<include file="__THEME__/public_header_w3g"/>
<style>
body {
padding: 0 !important;
}
.info{line-height: 20px;}
.info i{transform: translateY(2px);font-size:18px;padding-right:5px;}
.newslist h3{min-height: 40px;}
</style>
<div id="app">
<van-sticky>
<div class="tabs_container">
<div @click="onChange(idx)" v-for="(opt, idx) in options" :key="idx" :class="idx == tab ? 'tab_item_selected' : 'tab_item_normal'" >
<span>{{opt.title}}</span>
</div>
<div class="min-height-wrap">
<!--content start-->
<div class="body">
<div id="slideBox" class="slideBox">
<div class="bd">
<ul>
<volist name="ad_list" id="vo" offset="0" length="5">
<li>
<a target="_blank" href="{$vo.bannerurl}">
<img src="{:getCover($vo['banner'],640,320)}" title="{$vo.banner_title}" alt="{$vo.banner_title}" class="lazyloading"/>
</a>
</li>
</volist>
</ul>
</div>
</van-sticky>
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad">
<template v-if="tab == 0">
<div v-for="(item, index) in options[0].items" class="layout_h news_hire_info">
<van-image height="72" width="72" :src="item.cover" fit="cover" ></van-image>
<div class="layout_v_b weight_full" style="margin-left: 0.75rem;">
<div class="text_14_600 color_333333">{{item.title}}</div>
<div class="layout_h_b" style="align-items: flex-end;">
<div class="layout_h">
<span class="text_12_400 color_999999" style="margin-right: 0.75rem;">{{item.location}}</span>
<span class="text_12_400 color_999999" style="margin-right: 0.75rem;">{{item.type}}</span>
<span class="text_12_400 color_999999">{{item.date}}</span>
<div class="hd">
<ul></ul>
</div>
<div class="layout_h_r weight_full">
<div @click="onItem(item)" class="news_see_button layout_center text_12_400 color_white">查看</div>
</div>
<script type="text/javascript">
// TouchSlide({
// slideCell:"#slideBox",
// titCell:".hd ul", //开启自动分页 autoPage:true ,此时设置 titCell 为导航元素包裹层
// mainCell:".bd ul",
// effect:"leftLoop",
// autoPage:true,//自动分页
// autoPlay:true //自动播放
// });
</script>
<ul class="newsnav">
<li><a href="{:U('news/Topic/index')}" <if condition="$_GET['cate'] eq ''">style="color: #00BED4;"</if> >全部资讯</a></li>
<volist name="cate" id="vo">
<li><a href="{:U('news/Topic/index',['cate'=>$vo['zy_topic_category_id']])}" <if condition="$_GET['cate'] eq $vo['zy_topic_category_id']">style="color: #00BED4;border-bottom: 2px solid #00BED4;"</if> >{:t($vo['title'])}</a></li>
</volist>
</ul>
<!--<div class="searchdiv"><if condition="$cate_name_one">在“<span>{$cate_name_one}</span>”分类下,</if>找到{$topic_data.count}条资讯</div>-->
<ul class="newslist more_newslist">
<volist name="topic_data.data" id="vo">
<li><a href="{:U('news/Topic/view',array('id'=>$vo['id']))}">
<img src="{:getCover($vo['image'],150,90)}" />
<h3>{$vo.title|mStr=###,'25'}</h3>
<!-- <p>{$vo.desc|mStr=###,'85'}</p> -->
<div class="info"><span><i class="iconfontNEW">&#xe6e6;</i>{$vo.readcount}浏览</span><span style="float:right;transform: translateY(1px)">{$vo.dateline|friendlyDate}</span></div>
</a></li>
</volist>
</ul>
</div>
<div class="loadding">
<php>if($topic_data['data']){</php>
<if condition="$topic_data['nowPage'] eq $topic_data['totalPages']">
<div>再拉也没有了。。</div><else/>正在加载更多。。
</if></div>
<php>}else{</php>
<div>再拉也没有了。。</div>
<php>}</php>
</div>
</div>
</template>
<template v-if="tab == 1">
</template>
<template v-if="tab == 2">
</template>
</van-list>
<a class="backtop"></a>
</div>
<script>
var p = 1;
$(window).scroll(function () {
new Vue({
el: "#app",
data: function() {
return {
tab: 0,
loading: false,
finished: false,
options: [{
title: "招聘信息",
items: [{
title: "2020年西藏高校毕业生公开考录公务员计划及职位信息公告",
location: "西藏",
type: "公务员",
date: "2020-02-20"
}],
page: 0,
finished: false
},{
title: "平台公告",
items: [],
page: 0,
finished: false
},{
title: "考试信息",
items: [],
page: 0,
finished: false
}]
}
},
methods: {
onChange: function(tab) {
this.tab = tab
},
onLoad: function() {
//已经滚动到上面的页面高度
var scrollTop = $(this).scrollTop();
//页面高度
var scrollHeight = $(document).height();
//浏览器窗口高度
var windowHeight = $(this).height();
//此处是滚动条到底部时候触发的事件,在这里写要加载的数据,或者是拉动滚动条的操作
if (scrollHeight-(scrollTop + windowHeight)<60) {
if(!p || p >= "{$topic_data['totalPages']}"){
return false;
},
onItem: function(item) {
}else{
p = p + 1;
ajaxBang();
}
}
});
//请求事件
function ajaxBang(){
$.ajax({
type: "GET",
url:"{:U('news/Topic/getTopicList')}",
data:"p="+p+"&cate={$_GET['cate']}",
dataType:"json",
success:function(data){
appendHtml(data);
}
});
}
//追加html
function appendHtml(data){
$(".more_newslist").append(data.data);
if(!p || p >= data.totalPages){
$('.loadding').html('<div>再拉也没有了。。</div>')
return false;
}else{
p = data.nowPage;//下一页
}
}
})
</script>
<!--footer-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment