作者 lihan

页面渲染首页、列表页、活动详情页

... ... @@ -28,7 +28,7 @@ class ActivityController extends HomeBaseController
//首页轮播图
$banner = Db::name('slide_item')->field('image,url')->where(['slide_id' => 1])->order('list_order')->select();
//分类
$type = Db::name('type')->field('type_name,type_url,type_icon')->order('listorder')->select();
$type = Db::name('type')->field('id as t_id,type_name,type_url,type_icon')->order('listorder')->select();
//活动
$model = new ActivityModel;
$t_id = request()->param('t_id');
... ... @@ -37,10 +37,19 @@ class ActivityController extends HomeBaseController
$result = [
'banner' => $banner,
'type' => $type,
'activity' => $activity
'activity' => $activity,
'type_name' => Db::name('type')->where(['id' => $t_id])->value('type_name'),
't_id' => $t_id,
'keyword' => request()->param('keyword')
];
if (request()->isPost()) {
echo json_encode(['data' => $result, 'code' => 20000]);
exit();
} else {
return $this->fetch(':_list', [
'result' => $result
]);
}
}
/**
... ... @@ -55,10 +64,10 @@ class ActivityController extends HomeBaseController
public function detail()
{
$request = request();
if ($request->isPost()) {
$id = $request->param('id');
$activity = new ActivityModel;
$info = $activity->activityDetail($id);
if ($request->isPost()) {
if (!empty($info)) {
echo json_encode(['data' => $info, 'code' => 20000]);
exit();
... ... @@ -66,6 +75,10 @@ class ActivityController extends HomeBaseController
echo json_encode(['msg' => '暂无数据', 'code' => 40000]);
exit();
}
} else {
return $this->fetch(':detail', [
'info' => $info
]);
}
}
... ...
... ... @@ -55,12 +55,12 @@ class ActivityModel extends Model
public function activityDetail($activityId)
{
$info = Db::name('activity')->field('banner,name,is_down_payment,down_price,content,notice')->where(['id' => $activityId])->find();
$info = Db::name('activity')->field('banner,name,is_down_payment,down_price,content,notice,display_price')->where(['id' => $activityId])->find();
if (!empty($info)) {
$arr = explode(',', $info['banner']);
$banner = [];
for ($i = 0; $i < count($arr); $i++) {
$banner[$i] = $arr[$i];
$banner[$i]['banner'] = $arr[$i];
}
$info['banner'] = $banner;
$info['schedule'] = $this->allSchedule($activityId);
... ... @@ -105,7 +105,7 @@ class ActivityModel extends Model
$where['deadline'] = ['gt', $nowTime];
$schedule = Db::name('activity_schedule')->field('start_time,price,real_join_num,addition_join_num,maximum')->where($where)->order('deadline')->select()->toArray();
foreach ($schedule as $k => $v) {
$v['start_time'] = date('Y-m-d', $v['start_time']);
$v['start_time'] = date('Y.m.d', $v['start_time']);
$v['sales_num'] = $v['real_join_num'] + $v['addition_join_num'];
$v['residue_num'] = $v['maximum'] - $v['sales_num'];
unset($v['real_join_num']);
... ... @@ -179,7 +179,13 @@ class ActivityModel extends Model
->select();
foreach ($res as $k => $v) {
$v['comment_time'] = date('Y.m.d', $v['comment_time']);
$star='';
for ($i = 0; $i < $v['rank_synthetical']; $i++) {
$star .= '<i class="iconfont icon-wuxing"></i>';
}
$v['star'] = $star;
$res[$k] = $v;
$star = '';
}
return $res;
}
... ...
... ... @@ -60,6 +60,7 @@ class OrderController extends HomeBaseController
$schedule[$k] = $v;
}
$result = [
'is_first' => Db::name('user')->where(['id' => session('user.id')])->value('is_first'),
'activity' => Db::name('activity')->field('id as activity_id,name, is_down_payment as type')->where(['id' => $post['activity_id']])->find(),
'schedule' => $schedule,
'coupons' => $couponsList,
... ...
... ... @@ -19,6 +19,7 @@ use EasyWeChat\Foundation\Application;
*/
class IndexController extends HomeBaseController
{
/**
* @title 接口返回参数说明
* @description 默认访问接口
... ... @@ -52,7 +53,7 @@ class IndexController extends HomeBaseController
* @description 默认访问接口
* @author sᴏᴜʟ ᴏғ ᴄɪɴᴅᴇʀ
* @url /portal/Index/index
* @method GET
* @method POST
*
* @return version:版本号
* @return code:错误码
... ... @@ -61,8 +62,12 @@ class IndexController extends HomeBaseController
{
//首页轮播图
$banner = Db::name('slide_item')->field('image,url')->where(['slide_id' => 1])->order('list_order')->select();
foreach ($banner as $k => $v) {
$v['image'] = cmf_get_image_url($v['image']);
$banner[$k] = $v;
}
//分类
$type = Db::name('type')->field('type_name,type_url,type_icon')->order('listorder')->select();
$type = Db::name('type')->field('id as t_id,type_name,type_url,type_icon')->order('listorder')->select();
//活动
$model = new ActivityModel;
$t_id = request()->param('t_id');
... ... @@ -75,8 +80,14 @@ class IndexController extends HomeBaseController
'is_new' => $is_new,
'is_hot' => $is_hot
];
if (request()->isPost()) {
echo json_encode(['data' => $result, 'code' => 20000]);
exit();
} else {
return $this->fetch('', [
'result' => $result
]);
}
}
}
\ No newline at end of file
... ...
... ... @@ -10,7 +10,7 @@
// [ 入口文件 ]
// 调试模式开关
define("APP_DEBUG", true);
define("APP_DEBUG", false);
// 定义CMF根目录,可更改此目录
define('CMF_ROOT', __DIR__ . '/../');
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{$result.type_name}</title>
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="__TMPL__/static/assets/css/weui.min.css" />
<link rel="stylesheet" type="text/css" href="__TMPL__/static/assets/css/swiper-3.4.2.min.css" />
<link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_773803_1qg03k1415.css" />
<script type="text/javascript" src="__TMPL__/static/assets/font/iconfont.js"></script>
<script type="text/javascript" src="__TMPL__/static/js/base.js"></script>
<link rel="stylesheet" href="__TMPL__/static/css/Peripheral-short-term.css" />
<style type="text/css">
.swiper-container {
height: 3.6rem;
}
.swiper-container-horizontal>.swiper-pagination-bullets,
.swiper-pagination-custom,
.swiper-pagination-fraction {
left: 44%;
}
.lis .iconfont {
color: #999999;
font-size: 0.5rem;
}
.
.active {
}
a:visited {color: #c8c8cd}
</style>
</head>
<body>
<div class="header_out">
<header>
<span class="left">
<i class="iconfont icon-dizhi"></i>
<span class="area" >天津</span>
</span>
<form action="{:url('Activity/_list')}" method="GET">
<span class="shu">
<i class="iconfont icon-sousuo fang"></i>
<input type="hidden" name="t_id" value="{$result.t_id}">
<input type="text" name="keyword" value="{$result.keyword}" class="in" placeholder="搜索活动名称" />
<input type="submit" id="S" style="display: none">
</span>
</form>
<label for="S"><span class="sousuo">搜索</span></label>
</header>
</div>
<div class="list">
<ul>
<volist name="result.type" id="vo">
<li class='activity_li'>
<a href="{:url('activity/Activity/_list',['t_id'=>$vo['t_id']])}">
<div class='li_imgbox <if condition="$vo.t_id eq $result.t_id">imgbox_active</if>'><img src="{$vo.type_icon}" alt="" /></div>
<div class="zhou zhou_txt">{$vo.type_name}</div>
</a>
</li>
</volist>
<li>
<a href="popular.html">
<div class="li_imgbox"><img src="__TMPL__/static/images/people.png" alt="" /></div>
<div class="zhou zhou_txt">人气最多</div>
</a>
</li>
<li>
<a href="start.html">
<div class="li_imgbox"><img src="__TMPL__/static/images/fa.png" alt="" /></div>
<div class="zhou zhou_txt">即将出发</div>
</a>
</li>
<li>
<a href="teamorder.html">
<div class="li_imgbox"><img src="__TMPL__/static/images/tuan.png" alt="" /></div>
<div class="zhou zhou_txt">团队定制</div>
</a>
</li>
<li>
<a href="outdoorChannel.html">
<div class="li_imgbox"><img src="__TMPL__/static/images/hu.png" alt="" /></div>
<div class="zhou zhou_txt">户外频道</div>
</a>
</li>
</ul>
</div>
<div></div>
<div class="zhou1">
{$result.type_name}
</div>
<volist name="result.activity" id="vo">
<div class="short_line" data-target="{:url('Activity/detail',['id'=>$vo['id']])}">
<div class="picture">
<img src="{$vo.thumb}" alt="" />
</div>
<div class="qing">
<div class="qing_out">
<span class="run">
{$vo.name}
</span>
<div class="year">
<div class="act act2">
<i class="iconfont icon-calendar"></i>
<span class="txt">
{$vo.schedule.start_time}
</span>
</div>
<div class="act act1" data-id="{$vo.id}">
<i <if condition="$vo.is_collect eq '1'">class='iconfont icon-wuxing'<else/>class='iconfont icon-shoucang'</if>></i>
<span class="txt">
收藏
</span>
</div>
</div>
</div>
<div class="mon">
<span class="jia">
¥{$vo.schedule.price}
</span>
<span class="shou">
售{$vo.schedule.sales_num} 剩{$vo.schedule.residue_num}
</span>
</div>
</div>
</div>
</volist>
<script type="text/javascript" src="__TMPL__/static/assets/js/jquery-2.1.0.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/swiper-3.4.2.min.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/weui.js"></script>
<!--<script type="text/javascript" src="../index.js"></script>-->
<script>
var mySwiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
autoplay: 1500, //可选选项,自动滑动
loop: true
})
</script>
</body>
</html>
<script>
$('.list li div').click(function(){
$(this).css('background','#FFEEDA')
})
$('.short_line').click(function(){
window.location.href=$(this).attr('data-target');
})
$('.act2').click(function(event){
event.stopPropagation();
});
//五星收藏阻止冒泡
$('.act1').click(function(event){
event.stopPropagation();
if($(this).find('.iconfont').attr('class')=='iconfont icon-wuxing'){
$(this).find('.iconfont').attr("class", "iconfont icon-shoucang");
}else{
$(this).find('.iconfont').attr("class", "iconfont icon-wuxing");
}
$.ajax({
url:"{:url('activity/Activity/collectDo')}",
data:{
id:$(this).attr('data-id')
},
type:"POST",
dataType:"JSON"
})
});
</script>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>套餐详情</title>
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
<script type="text/javascript" src="__TMPL__/static/js/base.js"></script>
<link rel="stylesheet" type="text/css" href="__TMPL__/static/assets/css/weui.min.css" />
<link rel="stylesheet" type="text/css" href="__TMPL__/static/assets/css/swiper-3.4.2.min.css" />
<link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_773803_3se1rq7vwl5.css" />
<script type="text/javascript" src="__TMPL__/static/assets/font/iconfont.js">
</script>
<link rel="stylesheet" href="__TMPL__/static/css/packageDetails.css" />
<script language="JavaScript" src="__TMPL__/static/cjjs/mydate.js"></script>
<style type="text/css">
.swiper-container {
height: 3.6rem;
}
.swiper-container-horizontal>.swiper-pagination-bullets,
.swiper-pagination-custom,
.swiper-pagination-fraction {
left: 44%;
}
.niuniu {
display: none;
height: 4.4rem;
}
.mold_out {
display: none;
}
</style>
</head>
<body>
<!--轮播图-->
<div class='pic'>
<div class="swiper-container ">
<div class="swiper-wrapper">
<volist name="info.banner" id="vo" key="k">
<div class="swiper-slide">
<img src="{$vo.banner}" alt="" />
</div>
</volist>
</div>
<div class="swiper-pagination">
<img src="__TMPL__/static/images/banner.png" alt="" />
</div>
</div>
</div>
<!--===============最新活动==========-->
<div class="piclist">
<div class="newxia">
<div class="left">
<div class="qing">
{$info.name}
</div>
<div class="nianout">
<div class="nian">
<div class="pelpe pl">
<span>¥{$info.display_price}起/人</span>
</div>
<div class="count pelpe" id="change">
<i class='iconfont icon-calendar shian'></i>
<span class="showcang">请选择出发批次</span>
</div>
</div>
</div>
</div>
</div>
</div>
<!--灰色间隔-->
<div class="hui"></div>
<!--预定信息-->
<div class="piclist1">
<div class="newxia1">
<li class="yu">
预定信息
</li>
</div>
<div class="dis">
<span class="dingjin">
定金:&nbsp;600/总价1190
</span>
<span class="yishou">
已售,1剩余29
</span>
</div>
<div class="newxia2 " id="newxia2">
<span class="tao active1" id="tao">
套餐详情
</span>
<span class="can" id="can">
套餐参数
</span>
<span class="yu1" id="yu1">
预定须知
</span>
<span class="yong" id="yong">
用户评价
</span>
</a>
</div>
</div>
<div class="xianshi_two">
<img src="../images/banner.png" alt="" />
</div>
<!--选项卡-->
<volist name="info.comment_list" id="vo">
<div class="niuniu">
<div class="xianshi1">
<div>
<span class="tu">
<img src="{$vo.avatar}" alt="" />
</span>
<span class="niu">{$vo.user_nickname}</span>
<div class="xing">
{$vo.star}
</div>
</div>
<span class="nianxian">2018.08.07</span>
</div>
<div>
<span class="pan">这次攀岩超刺激,特别安全!</span>
</div>
</div>
</volist>
<!--====底部=====-->
<a href="orders_submitted.html">
<footer class="foot ok">
立即预定
</footer>
</a>
<div class='mold_out'>
<div class='mold_center'>
<div class="scroll_out">
<div class="scroll">
<volist name="info.schedule" id="vo">
<div class="money">
<div class="year_change">
<img src="__TMPL__/static/images/circle.png"/>
<span>{$vo.start_time}&nbsp;&nbsp;{$vo.end_time}</span>
</div>
<div class="price">¥{$vo.price}</div>
</div>
</volist>
</div>
<button class="bottom_button" value="">确定</button>
</div>
</div>
</div>
<script type="text/javascript" src="__TMPL__/static/assets/js/jquery-2.1.0.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/swiper-3.4.2.min.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/weui.js"></script>
<script type="text/javascript" src="__TMPL__/static/index.js"></script>
<script>
var xianshi_two = $('.xianshi_two');
var yu1 = $('.yu1');
var can = $('.can');
var xianshi = $('.xianshi');
var niuniu = $('.niuniu');
var yong = $('.yong');
var tao = $('.tao');
var xianshi = $('.xianshi2');
tao.click(function() {
xianshi_two.css('display', 'block');
$("#tao").attr("class", "tao active1");
$("#can").attr("class", "can");
$("#yu1").attr("class", "yu1");
$("#yong").attr("class", "yong");
niuniu.css('display', 'none');
})
can.click(function() {
// xianshi.css('display', 'block');
xianshi_two.css('display', 'block');
niuniu.css('display', 'none');
// xianshi2.css('display', 'none');
$("#tao").attr("class", "tao");
$("#can").attr("class", "can active1");
$("#yu1").attr("class", "yu1");
$("#yong").attr("class", "yong");
// xianshi2.css('display', 'none');
})
yu1.click(function() {
// xianshi.css('display', 'none');
xianshi_two.css('display', 'block');
niuniu.css('display', 'none');
$("#tao").attr("class", "tao");
$("#yu1").attr("class", "yu1 active1");
$("#can").attr("class", "can");
$("#yong").attr("class", "yong");
// xianshi2.css('display', 'none');
})
yong.click(function() {
// xianshi.css('display', 'none');
niuniu.css('display', 'block');
$("#tao").attr("class", "tao");
$("#can").attr("class", "can");
$("#yong").attr("class", "yong active1");
$("#yu1").attr("class", "yu1");
// xianshi2.css('display', 'none');
xianshi_two.css('display', 'none');
})
</script>
</body>
</html>
<script type="text/javascript" src="__TMPL__/static/assets/js/jquery-2.1.0.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/swiper-3.4.2.min.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/weui.js"></script>
<!--<script type="text/javascript" src="index.js"></script>-->
<script>
var mySwiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
autoplay: 1500, //可选选项,自动滑动
loop: true
})
$('.money img').click(function(event) {
$(this).attr("src", "/themes/simpleboot3/static/images/circle1.png");
$(this).parents('.money').siblings().find('img').attr("src", "/themes/simpleboot3/static/images/circle.png");
});
//点击确定弹框隐藏
$('.count').click(function() {
if($('.mold_out').css('display') == 'block') {
$('.mold_out').css('display', 'none');
} else {
$('.mold_out').css('display', 'block');
}
})
//点击页面弹框隐藏
$('body').click(function() {
$('.mold_out').css('display', 'none');
})
$('#change').click(function(event) {
event.stopPropagation();
})
var index = 0;
var num = 0;
$('.bottom_button').click(function() {
var inputLength = $('.mold_center').find('i').length;
for(var i = 0; i < inputLength; i++) {
if($('.mold_center').find('i').eq(i).attr("class")=="iconfont icon-yuandianxiao") {
num = num + 1;
index = i;
}
}
if(num == 0) {
$('.mold_out').css('display', 'none');
} else {
$('.showcang').html($('.mold_center').find('span').eq(index).html());
$('.mold_out').css('display', 'none');
}
})
$('.mold_out').click(function() {
event.stopPropagation();
})
change
</script>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<title>{$article.post_title}</title>
<meta name="keywords" content="{$site_info.site_seo_keywords|default=''}"/>
<meta name="description" content="{$site_info.site_seo_description|default=''}">
<include file="public@head"/>
<style>
#article_content img {
height: auto !important;
max-width: 100%;
}
#article_content {
word-wrap: break-word;
}
</style>
<hook name="before_head_end"/>
</head>
<body class="body-white">
<include file="public@nav"/>
<div class="container tc-main">
<div class="row">
<div class="col-md-9">
<div class="tc-box article-box">
<h2>{$article.post_title}</h2>
<div class="article-infobox">
<span>{:date('Y-m-d H:i',$article.published_time)} by {$article.user.user_nickname}</span>
<span>
<a href="javascript:;"><i class="fa fa-eye"></i><span>{$article.post_hits}</span></a>
<a href="{:url('portal/Article/doLike',array('id'=>$article['id']))}" class="js-count-btn"><i
class="fa fa-thumbs-up"></i><span class="count">{$article.post_like}</span></a>
<a href="{:url('user/favorite/add')}"
class="js-favorite-btn"
data-title="{:base64_encode($article.post_title)}"
data-url="{:cmf_url_encode('portal/Article/index',array('id'=>$article['id']))}"
data-table="portal_post"
data-id="{$article['id']}"
>
<i class="fa fa-star-o"></i>
</a>
</span>
</div>
<hr>
<div id="article_content">
{$article.post_content}
</div>
<if condition="!empty($article['post_source'])">
<div>
<b>注:本文转载自{$article.post_source},转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如有侵权行为,请联系我们,我们会及时删除。</b>
</div>
</if>
<php>
$after_content_hook_param=[
'object_id'=>$article['id'],
'table_name'=>'portal_post',
'object_title'=>$article['post_title'],
'user_id'=>$article['user_id'],
'url'=>cmf_url_encode('portal/Article/index',array('id'=>$article['id'],'cid'=>$category['id'])),
'object'=>$article
];
</php>
<hook name="after_content" param="after_content_hook_param"/>
<php>
$comment_hook_param=[
'object_id'=>$article['id'],
'table_name'=>'portal_post',
'object_title'=>$article['post_title'],
'url'=>cmf_url_encode('portal/Article/index',array('id'=>$article['id'],'cid'=>$category['id']))
];
$comment=hook_one('comment',$comment_hook_param);
</php>
<if condition="empty($comment) && cmf_get_current_admin_id()">
<div style="border: 1px dashed #ddd;min-height: 200px;padding-top: 50px;">
<div class="alert alert-warning" role="alert">
此区域这为评论区,请安装评论插件!<br>
<em>注:普通用户不会看到此提示!</em>
</div>
</div>
</if>
{$comment}
</div>
</div>
<div class="col-md-3">
<div class="tc-box first-box">
<div class="headtitle">
<h2>热门文章</h2>
</div>
<div class="ranking">
<php>
$hot_articles=[];
</php>
<ul class="list-unstyled">
<portal:articles limit="5" order="post.post_hits DESC">
<php>$top=$key<3?"top3":"";</php>
<li class="{$top}">
<i>{$key+1}</i>
<a title="{$vo.post_title}"
href="{:url('portal/article/index',array('id'=>$vo['id']))}">
{$vo.post_title}
</a>
</li>
</portal:articles>
</ul>
</div>
</div>
</div>
</div>
<include file="public@footer"/>
</div>
<include file="public@scripts"/>
<hook name="before_body_end"/>
</body>
</html>
\ No newline at end of file
{
"name": "文章页",
"action": "portal/Article/index",
"description": "文章页模板文件",
"order": 10.0,
"more": {
"vars": {
"hot_articles_category_id": {
"title": "Hot Articles分类ID",
"name": "hot_articles_category_id",
"value": "1",
"type": "text",
"tip": "",
"rule": []
}
}
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>联系我们</title>
<meta name="keywords" content="{$site_info.site_seo_keywords|default=''}"/>
<meta name="description" content="{$site_info.site_seo_description|default=''}">
<include file="public@head"/>
<script src="//api.map.baidu.com/api?v=1.3"></script>
<style>
img {
max-width: none;
}
</style>
<hook name="before_head_end"/>
</head>
<body class="body-white">
<include file="public@nav"/>
<div class="section slice no-padding">
<div id="mapCanvas" class="map-canvas no-margin" style="height: 450px;">
<php>
$company_location=empty($theme_vars['company_location'])?'121.449222,31.193348':$theme_vars['company_location'];
$company_location=explode(',',$company_location);
$company_location_lng=$company_location[0];
$company_location_lat=$company_location[1];
</php>
<script type="text/javascript">
var map = new BMap.Map("mapCanvas"); // 创建Map实例
var point = new BMap.Point("{$company_location_lng}", "{$company_location_lat}"); // 创建点坐标
map.centerAndZoom(point, 15); // 初始化地图,设置中心点坐标和地图级别。
//map.enableScrollWheelZoom(); //启用滚轮放大缩小
//添加缩放控件
map.addControl(new BMap.NavigationControl());
map.addControl(new BMap.ScaleControl());
map.addControl(new BMap.OverviewMapControl());
var marker = new BMap.Marker(point); // 创建标注
map.addOverlay(marker); // 将标注添加到地图中
var infoWindow = new BMap.InfoWindow("{$theme_vars.baidu_map_info_window_text|htmlspecialchars_decode|default=''}"); // 创建信息窗口对象
marker.openInfoWindow(infoWindow);
</script>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-6">
<php>$guestbook=hook_one('guestbook');</php>
<if condition="empty($guestbook) && cmf_get_current_admin_id()">
<div style="border: 1px dashed #ddd;min-height: 300px;padding-top: 100px;">
<div class="alert alert-warning" role="alert">
此区域这为留言区,请安装留言插件!<br>
<em>注:普通用户不会看到此提示!</em>
</div>
</div>
</if>
{$guestbook}
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-6">
<h3 class="section-title">联系方式</h3>
<div class="contact-info">
<h5>地址</h5>
<p>{$theme_vars.address_cn|default=''}</p>
<h5>邮箱</h5>
<p>{$theme_vars.email|default=''}</p>
<h5>电话</h5>
<p>{$theme_vars.phone_cn|default=''}</p>
</div>
</div>
<div class="col-md-6">
<h3>Contact</h3>
<div class="contact-info">
<h5>Address</h5>
<p>{$theme_vars.address_en|default=''}</p>
<h5>Email</h5>
<p>{$theme_vars.email|default=''}</p>
<h5>Phone</h5>
<p>{$theme_vars.phone_en|default=''}</p>
</div>
</div>
</div>
<php>
$company_qq=empty($theme_vars['qq'])?'':$theme_vars['qq'];
$company_qq=explode(',',$company_qq);
</php>
<notempty name="company_qq">
<h3 class="section-title">快捷交流</h3>
<p>点击以下QQ图标,免加好友即时洽谈合作</p>
<div class="social-media">
<foreach name="company_qq" item="qq">
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin={$qq}&site=qq&menu=yes">
<img border="0"
src="http://wpa.qq.com/pa?p=2:{$qq}:51"
alt="点击这里给我发消息"
title="点击这里给我发消息"/>
</a>
</foreach>
</div>
</notempty>
</div>
</div>
<include file="public@footer"/>
</div>
<include file="public@scripts"/>
<hook name="before_body_end"/>
</body>
</html>
\ No newline at end of file
{
"name": "联系我们页",
"action": "portal/Page/index",
"description": "联系我们页模板文件",
"order": 10.0,
"more": {
"vars": {
"baidu_map_info_window_text": {
"title": "百度地图标注文字",
"name": "baidu_map_info_window_text",
"value": "bronet<br/><span class=''>地址:上海市徐汇区斜土路2601号</span>",
"type": "text",
"tip": "百度地图标注文字,支持简单html代码",
"rule": []
},
"company_location": {
"title": "公司坐标",
"value": "",
"type": "location",
"tip": "",
"rule": {
"require": true
}
},
"address_cn": {
"title": "公司地址",
"value": "上海市徐汇区斜土路0001号",
"type": "text",
"tip": "",
"rule": {
"require": true
}
},
"address_en": {
"title": "公司地址(英文)",
"value": "NO.0001 Xie Tu Road, Shanghai China",
"type": "text",
"tip": "",
"rule": {
"require": true
}
},
"email": {
"title": "公司邮箱",
"value": "catman@bronet.cn",
"type": "text",
"tip": "",
"rule": {
"require": true
}
},
"phone_cn": {
"title": "公司电话",
"value": "021 1000 0001",
"type": "text",
"tip": "",
"rule": {
"require": true
}
},
"phone_en": {
"title": "公司电话(英文)",
"value": "+8621 1000 0001",
"type": "text",
"tip": "",
"rule": {
"require": true
}
},
"qq": {
"title": "联系QQ",
"value": "478519726",
"type": "text",
"tip": "多个 QQ以英文逗号隔开",
"rule": {
"require": true
}
}
}
}
}
<!DOCTYPE html>
<html>
<head>
<title>首页 {$site_info.site_name|default=''}</title>
<meta name="keywords" content="{$site_info.site_seo_keywords|default=''}"/>
<meta name="description" content="{$site_info.site_seo_description|default=''}">
<include file="public@head"/>
<link href="__TMPL__/public/assets/css/slippry/slippry.css" rel="stylesheet">
<style>
.caption-wraper {
position: absolute;
left: 50%;
bottom: 2em;
}
.caption-wraper .caption {
position: relative;
left: -50%;
background-color: rgba(0, 0, 0, 0.54);
padding: 0.4em 1em;
color: #fff;
-webkit-border-radius: 1.2em;
-moz-border-radius: 1.2em;
-ms-border-radius: 1.2em;
-o-border-radius: 1.2em;
border-radius: 1.2em;
}
.tc-gridbox {
margin: 0;
}
@media (max-width: 767px) {
.caption-wraper {
left: 0;
bottom: 0.4em;
}
.caption-wraper .caption {
left: 0;
padding: 0.2em 0.4em;
font-size: 0.92em;
-webkit-border-radius: 0;
-moz-border-radius: 0;
-ms-border-radius: 0;
-o-border-radius: 0;
border-radius: 0;
}
}
</style>
<hook name="before_head_end"/>
</head>
<body class="body-white">
<include file="public@nav"/>
<ul id="home-slider" class="list-unstyled">
<php>
$top_slide_id=empty($theme_vars['top_slide'])?1:$theme_vars['top_slide'];
</php>
<slides id="$top_slide_id">
<li>
<div class="caption-wraper">
<div class="caption">{$vo.title|default=''}</div>
</div>
<a href="{$vo.url|default=''}"><img src="{:cmf_get_image_url($vo.image)}" alt=""></a>
</li>
</slides>
<noslides id="$top_slide_id">
<li>
<div class="caption-wraper">
<div class="caption">此幻灯片只是演示,您没有设置任何幻灯片,请到后台模板设置!</div>
</div>
<a href=""><img src="__TMPL__/public/assets/images/demo/1.jpg" alt=""></a>
</li>
<li>
<div class="caption-wraper">
<div class="caption">此幻灯片只是演示,您没有设置任何幻灯片,请到后台模板设置!</div>
</div>
<a href=""><img src="__TMPL__/public/assets/images/demo/2.jpg" alt=""></a>
</li>
<li>
<div class="caption-wraper">
<div class="caption">此幻灯片只是演示,您没有设置任何幻灯片,请到后台模板设置!</div>
</div>
<a href=""><img src="__TMPL__/public/assets/images/demo/3.jpg" alt=""></a>
</li>
</noslides>
</ul>
<div class="container">
<widget name="features">
<div>
<h1 class="text-center">{$widget.title}</h1>
<h3 class="text-center">{$widget.vars.sub_title}</h3>
</div>
<php>
$features_count = count($widget['vars']['features']);
$rows = ceil($features_count/3);
</php>
<for start="1" end="$rows" comparison="elt" step="1" name="row">
<php>
$first_row = ($row-1)*3;
$features = array_slice($widget['vars']['features'],$first_row,3);
</php>
<div class="row">
<foreach name="features" item="vo">
<div class="col-md-4">
<h2 class="font-large nospace"><i class="fa fa-{$vo.icon}"></i> {$vo.title}</h2>
<p>{$vo.content}</p>
</div>
</foreach>
</div>
</for>
</widget>
<widget name="last_news">
<div>
<h1 class="text-center">{$widget.title}</h1>
</div>
<div class="row">
<php>
$widget["vars"]["last_news_category_id"] = empty($widget["vars"]["last_news_category_id"])?1:$widget["vars"]["last_news_category_id"];
$last_news_limit=4;
</php>
<portal:articles limit="$last_news_limit" order="post.published_time DESC"
categoryIds="$widget.vars.last_news_category_id">
<div class="col-md-3">
<div class="tc-gridbox">
<div class="header">
<div class="item-image">
<a href="{:cmf_url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">
<present name="vo.more.thumbnail">
<empty name="vo.more.thumbnail">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
class="img-responsive"
alt="">
<else/>
<img src="{:cmf_get_image_url($vo.more.thumbnail)}"
class="img-responsive"
alt="">
</empty>
<else/>
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
class="img-responsive"
alt="">
</present>
</a>
</div>
<h3>
<a href="{:cmf_url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">{$vo.post_title}</a>
</h3>
<hr>
</div>
<div class="body">
<p>
<a href="{:cmf_url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">...</a>
</p>
</div>
</div>
</div>
</portal:articles>
</div>
</widget>
<include file="public@footer"/>
</div>
<!-- /container -->
<include file="public@scripts"/>
<script src="__TMPL__/public/assets/js/slippry.min.js"></script>
<script>
$(function () {
$("#home-slider").slippry({
transition: 'fade',
useCSS: true,
captions: false,
speed: 1000,
pause: 3000,
auto: true,
preload: 'visible'
});
$("#home-slider").show();
});
</script>
<hook name="before_body_end"/>
</body>
</html>
{
"name": "首页",
"action": "portal/Index/index",
"description": "首页模板文件",
"order": 5.0,
"more": {
"vars": {
"top_slide": {
"title": "顶部幻灯片",
"value": "",
"type": "text",
"dataSource": {
"api": "admin/Slide/index",
"multi": false
},
"placeholder": "请选择顶部幻灯片",
"tip": "",
"rule": {
"require": true
}
}
},
"widgets": {
"features": {
"title": "快速了解bronet",
"display": "1",
"vars": {
"sub_title": {
"title": "副标题",
"value": "Quickly understand the bronet",
"type": "text",
"placeholder": "请输入副标题",
"tip": "",
"rule": {
"require": true
}
},
"features": {
"title": "特性介绍",
"value": [
{
"title": "MVC分层模式",
"icon": "bars",
"content": "使用MVC应用程序被分成三个核心部件:模型(M)、视图(V)、控制器(C),他不是一个新的概念,只是bronet将其发挥到了极致。"
},
{
"title": "用户管理",
"icon": "group",
"content": "bronet内置了灵活的用户管理方式,并可直接与第三方站点进行互联互通,如果你愿意甚至可以对单个用户或群体用户的行为进行记录及分享,为您的运营决策提供有效参考数据。"
},
{
"title": "云端部署",
"icon": "cloud",
"content": "通过驱动的方式可以轻松支持云平台的部署,让你的网站无缝迁移,内置已经支持SAE、BAE,正式版将对云端部署进行进一步优化。"
},
{
"title": "安全策略",
"icon": "heart",
"content": "提供的稳健的安全策略,包括备份恢复,容错,防治恶意攻击登陆,网页防篡改等多项安全管理功能,保证系统安全,可靠,稳定的运行。"
},
{
"title": "应用模块化",
"icon": "cubes",
"content": "提出全新的应用模式进行扩展,不管是你开发一个小功能还是一个全新的站点,在bronet中你只是增加了一个APP,每个独立运行互不影响,便于灵活扩展和二次开发。"
},
{
"title": "免费开源",
"icon": "certificate",
"content": "代码遵循Apache2开源协议,免费使用,对商业用户也无任何限制。"
}
],
"type": "array",
"item": {
"title": {
"title": "标题",
"value": "",
"type": "text",
"rule": {
"require": true
}
},
"icon": {
"title": "图标",
"value": "",
"type": "text"
},
"content": {
"title": "描述",
"value": "",
"type": "textarea"
}
},
"tip": ""
}
}
},
"last_news": {
"title": "最新资讯",
"display": "1",
"vars": {
"last_news_category_id": {
"title": "文章分类ID",
"value": "",
"type": "text",
"dataSource": {
"api": "portal/category/index",
"multi": true
},
"placeholder": "请选择分类",
"tip": "",
"rule": {
"require": true
}
}
}
}
}
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>萨米公众号</title>
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
<script type="text/javascript" src="__TMPL__/static/js/base.js"></script>
<link rel="stylesheet" type="text/css" href="__TMPL__/static/assets/css/weui.min.css" />
<link rel="stylesheet" type="text/css" href="__TMPL__/static/assets/css/swiper-3.4.2.min.css" />
<link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_773803_tu2va42yqo.css" />
<script type="text/javascript" src="__TMPL__/static/assets/font/iconfont.js">
</script>
<link rel="stylesheet" href="__TMPL__/static/index.css" />
<style type="text/css">
.swiper-container {
height: 3.6rem;
}
.swiper-container-horizontal>.swiper-pagination-bullets,
.swiper-pagination-custom,
.swiper-pagination-fraction {
left: 1.7%;
bottom: -0.49rem;
}
.lis .iconfont {
/*color:#999999;*/
font-size: 0.5rem;
}
.active {
}
.piclist:last-child {
margin-bottom: 4rem;
}
title{text-align: center;width: 100%;}
</style>
</head>
<body>
<!--轮播图-->
<div class='pic'>
<div class="swiper-container ">
<div class="swiper-wrapper">
<volist name="result.banner" id="vo">
<div class="swiper-slide">
<img src="{$vo.image}" alt="" />
</div>
</volist>
</div>
<div class="swiper-pagination">
<img src="__TMPL__/static/images/banner.png" alt="" />
</div>
</div>
</div>
<!--图标-->
<div class="list">
<ul>
<volist name="result.type" id="vo">
<li class='activity_li'>
<a href="{:url('activity/Activity/_list',['t_id'=>$vo['t_id']])}">
<div class="li_imgbox"><img src="{$vo.type_icon}" alt="" /></div>
<div class="zhou zhou_txt">{$vo.type_name}</div>
</a>
</li>
</volist>
<li>
<a href="html/popular.html">
<div class="li_imgbox"><img src="__TMPL__/static/images/people.png" alt="" /></div>
<div class="zhou zhou_txt">人气最多</div>
</a>
</li>
<li>
<a href="html/start.html">
<div class="li_imgbox"><img src="__TMPL__/static/images/fa.png" alt="" /></div>
<div class="zhou zhou_txt">即将出发</div>
</a>
</li>
<li>
<a href="html/teamorder.html">
<div class="li_imgbox"><img src="__TMPL__/static/images/tuan.png" alt="" /></div>
<div class="zhou zhou_txt">团队定制</div>
</a>
</li>
<li>
<a href="html/outdoorChannel.html">
<div class="li_imgbox"><img src="__TMPL__/static/images/hu.png" alt="" /></div>
<div class="zhou zhou_txt">户外频道</div>
</a>
</li>
</ul>
</div>
<a href="html/travelCalendar.html">
<div class="riliout">
<div class="rili">
<i class='iconfont icon-rili'></i>
<span>行程日历</span>
</div>
</div>
</a>
<!--===============最新活动==========-->
<div class="piclist">
<div class="active">
<span>——最新活动——</span>
</div>
<volist name="result.is_new" id="vo">
<div class='center_mian'>
<div class="new_pic">
<img src="{$vo.thumb}" alt="" style="height: 180px" />
</div>
<div class="newxia">
<div class="left">
<div class="qing">
{$vo.name}
</div>
<div class="nianout">
<div class="nian">
<i class='iconfont icon-calendar'></i>
<span class="active_year">{$vo.schedule.start_time}</span>
</div>
<div class="ji" data-id="{$vo.id}">
<i <if condition="$vo.is_collect eq '1'">class='iconfont icon-wuxing'<else/>class='iconfont icon-shoucang'</if>></i>
<span class="showcang">收藏</span>
</div>
</div>
</div>
<div class="right">
<div class="jia">
<span><span></span>{$vo.schedule.price}</span>
</div>
<div class="show">
<span class="showspan">
<span>售{$vo.schedule.sales_num}</span>
</span>
<span class="sheng">
剩{$vo.schedule.residue_num}
</span>
</div>
</div>
</div>
</div>
</volist>
</div>
<div class="piclist">
<div class="active">
<span>——热门活动——</span>
</div>
<volist name="result.is_hot" id="vo">
<div class='center_mian'>
<div class="new_pic">
<img src="{$vo.thumb}" alt="" style="height: 180px" />
</div>
<div class="newxia">
<div class="left">
<div class="qing">
{$vo.name}
</div>
<div class="nianout">
<div class="nian">
<i class='iconfont icon-calendar'></i>
<span class="active_year">{$vo.schedule.start_time}</span>
</div>
<div class="ji" data-id="{$vo.id}">
<i <if condition="$vo.is_collect eq '1'">class='iconfont icon-wuxing'<else/>class='iconfont icon-shoucang'</if>></i>
<span class="showcang">收藏</span>
</div>
</div>
</div>
<div class="right">
<div class="jia">
<span><span></span>{$vo.schedule.price}</span>
</div>
<div class="show">
<span class="showspan">
<span>售{$vo.schedule.sales_num}</span>
</span>
<span class="sheng">
剩{$vo.schedule.residue_num}
</span>
</div>
</div>
</div>
</div>
</volist>
</div>
<!--====底部=====-->
<div class="base">
<div class="base_img">
<!--<img src="images/bei.png" alt=""/>-->
<ul class="baselist">
<a href="{:url('Index/index')}">
<li class="base_index baselis">
<img class="first" src="__TMPL__/static/images/first2.png" alt="" />
<span class="base_options common checked_active">首页</span>
</li>
</a>
<a href="html/travelCalendar.html">
<li class="base_travel baselis">
<span class="base_circle">
<i class='iconfont icon-rili base_rili mark '></i>
</span>
<span class="common">行程日历</span>
</li>
</a>
<a href="html/person.html">
<li class="base_our baselis">
<!--<div class="person">-->
<img class="first" src="__TMPL__/static/images/person1.png" alt="" />
<!--</div>-->
<span class="my common">我的</span>
</li>
</a>
</ul>
</div>
</div>
<script type="text/javascript" src="__TMPL__/static/assets/js/jquery-2.1.0.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/swiper-3.4.2.min.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/weui.js"></script>
<script type="text/javascript" src="__TMPL__/static/index.js"></script>
<script>
var mySwiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
autoplay: 1500, //可选选项,自动滑动
loop: true
})
</script>
</body>
</html>
<script>
$('.ji').click(function(event) {
event.stopPropagation();
if($(this).find('.iconfont').attr('class')=='iconfont icon-wuxing'){
$(this).find('.iconfont').attr("class", "iconfont icon-shoucang");
}else{
$(this).find('.iconfont').attr("class", "iconfont icon-wuxing");
}
$.ajax({
url:"{:url('activity/Activity/collectDo')}",
data:{
id:$(this).attr('data-id')
},
type:"POST",
dataType:"JSON"
})
});
$('.center_mian').click(function(){
if(''){
}
window.location.href='html/packageDetails.html'
})
$('.nian').click(function(event) {
event.stopPropagation();
});
$(".piclist:last").css('margin-bottom','1rem');
$('.list li div').click(function(){
$(this).css('background','#FFEEDA')
})
</script>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<title>{$category.name} {$category.seo_title} {$site_info.site_name|default=''}</title>
<meta name="keywords" content="{$category.seo_keywords},{$site_info.site_seo_keywords|default=''}"/>
<meta name="description" content="{$category.seo_description},{$site_info.site_seo_description|default=''}">
<include file="public@head"/>
<hook name="before_head_end"/>
</head>
<body class="body-white">
<include file="public@nav"/>
<div class="container">
<php>$demo_time=2;</php>
<h2>{$category.name}</h2>
<div class="row">
<div class="col-md-9">
<div class="">
<php>
$where=[
'post.create_time'=>['egt',0]
];
</php>
<portal:articles item="vo" where="$where" order="post.create_time DESC" page="10"
relation="categories"
categoryIds="$category.id"
returnVarName="articles_data">
<div class="list-boxes">
<h2><a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$category['id']))}">{$vo.post_title}</a>
</h2>
<p>{$vo.post_excerpt}</p>
<div>
<div class="pull-left">
<div class="list-actions">
<a href="javascript:;"><i class="fa fa-eye"></i><span>{$vo.post_hits}</span></a>
<a href="{:url('portal/Article/doLike',array('id'=>$vo['id']))}"
class="js-count-btn"><i class="fa fa-thumbs-up"></i><span class="count">{$vo.post_like}</span></a>
<a href="{:url('user/Favorite/add',array('id'=>$vo['id'],'cid'=>$category['id']))}"
class="js-favorite-btn"
data-id="{$vo.id}"
data-table="portal_post"
data-title="{:base64_encode($vo.post_title)}"
data-url="{:cmf_url_encode('portal/Article/index',array('id'=>$vo['id'],'cid'=>$category['id']))}"
>
<i class="fa fa-star-o"></i>
</a>
</div>
</div>
<a class="btn btn-warning btn-sm pull-right"
href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$category['id']))}">查看更多</a>
</div>
</div>
</portal:articles>
</div>
<ul class="pagination">
<page/>
</ul>
</div>
<div class="col-md-3">
<widget name="hottest_articles">
<div class="tc-box">
<div class="headtitle">
<h2>{$widget.title}</h2>
</div>
<div class="ranking">
<php>
$hot_articles=[];
</php>
<ul class="list-unstyled">
<portal:articles limit="5" order="post.post_hits DESC"
categoryIds="$widget.vars.hottest_articles_category_id">
<php>$top=$key<3?"top3":"";</php>
<li class="{$top}">
<i>{$key+1}</i>
<a title="{$vo.post_title}"
href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}">
{$vo.post_title}
</a>
</li>
</portal:articles>
</ul>
</div>
</div>
</widget>
<widget name="last_articles">
<div class="tc-box">
<div class="headtitle">
<h2>{$widget.title}</h2>
</div>
<div class="posts">
<portal:articles limit="5" order="post.published_time DESC"
categoryIds="$widget.vars.last_articles_category_id">
<dl class="dl-horizontal">
<dt>
<a class="img-wraper"
href="{:cmf_url('portal/Article/index',array('id'=>$vo.id))}">
<if condition="empty($vo.more.thumbnail)">
<img src="__TMPL__/public/assets/images/default_tupian4.png"
class="img-responsive" alt="{$vo.post_title}"/>
<else/>
<img src="{:cmf_get_image_url($vo.more.thumbnail)}"
class="img-responsive" alt="{$vo.post_title}"/>
</if>
</a>
</dt>
<dd>
<a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}">{$vo.post_title}</a>
</dd>
</dl>
</portal:articles>
</div>
</div>
</widget>
</div>
</div>
<include file="public@footer"/>
</div>
<include file="public@scripts"/>
<hook name="before_body_end"/>
</body>
</html>
\ No newline at end of file
{
"name": "文章列表页",
"action": "portal/List/index",
"description": "文章列表模板文件",
"order": 10.0,
"more": {
"vars": {
},
"widgets":{
"hottest_articles": {
"title": "热门文章",
"display": "1",
"vars": {
"hottest_articles_category_id": {
"title": "文章分类ID",
"value": "",
"type": "text",
"dataSource": {
"api": "portal/category/index",
"multi": true
},
"placeholder": "请选择分类",
"tip": "",
"rule": {
"require": true
}
}
}
},
"last_articles": {
"title": "最新发布",
"display": "1",
"vars": {
"last_articles_category_id": {
"title": "文章分类ID",
"value": "",
"type": "text",
"dataSource": {
"api": "portal/category/index",
"multi": true
},
"placeholder": "请选择分类",
"tip": "",
"rule": {
"require": true
}
}
}
}
}
}
}
<!DOCTYPE html>
<html>
<head>
<title>{$page.post_title}</title>
<meta name="keywords" content="{$page.post_keywords}"/>
<meta name="description" content="{$page.post_excerpt}">
<include file="public@head"/>
<style>
#article_content img {
height: auto !important;
max-width: 100%;
}
</style>
<hook name="before_head_end"/>
</head>
<body class="body-white">
<include file="public@nav"/>
<div class="container tc-main">
<div class="row">
<div class="col-md-9">
<div class="tc-box article-box">
<h2>{$page.post_title|default=''}</h2>
<hr>
<div id="article_content">
{$page.post_content|default=''}
</div>
<php>
$comment_hook_param=[
'post_id'=>$page['id'],
'post_table'=>'portal_post',
'post_title'=>$page['post_title']
];
</php>
<hook name="comment" param="comment_hook_param"/>
</div>
</div>
<div class="col-md-3">
<widget name="hottest_articles">
<div class="tc-box">
<div class="headtitle">
<h2>{$widget.title}</h2>
</div>
<div class="ranking">
<php>
$hot_articles=[];
</php>
<ul class="list-unstyled">
<portal:articles limit="5" order="post.post_hits DESC"
categoryIds="$widget.vars.hottest_articles_category_id">
<php>$top=$key<3?"top3":"";</php>
<li class="{$top}">
<i>{$key+1}</i>
<a title="{$vo.post_title}"
href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}">
{$vo.post_title}
</a>
</li>
</portal:articles>
</ul>
</div>
</div>
</widget>
<widget name="last_articles">
<div class="tc-box">
<div class="headtitle">
<h2>{$widget.title}</h2>
</div>
<div class="posts">
<portal:articles limit="5" order="post.published_time DESC"
categoryIds="$widget.vars.last_articles_category_id">
<dl class="dl-horizontal">
<dt>
<a class="img-wraper"
href="{:cmf_url('portal/Article/index',array('id'=>$vo.id))}">
<if condition="empty($vo.more.thumbnail)">
<img src="__TMPL__/public/assets/images/default_tupian4.png"
class="img-responsive" alt="{$vo.post_title}"/>
<else/>
<img src="{:cmf_get_image_url($vo.more.thumbnail)}"
class="img-responsive" alt="{$vo.post_title}"/>
</if>
</a>
</dt>
<dd>
<a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}">{$vo.post_title}</a>
</dd>
</dl>
</portal:articles>
</div>
</div>
</widget>
</div>
</div>
<include file="public@footer"/>
</div>
<include file="public@scripts"/>
<hook name="before_body_end"/>
</body>
</html>
\ No newline at end of file
{
"name": "单页面",
"action": "portal/Page/index",
"description": "单页面模板文件",
"order": 10.0,
"more": {
"widgets":{
"hottest_articles": {
"title": "热门文章",
"display": "1",
"vars": {
"hottest_articles_category_id": {
"title": "文章分类ID",
"value": "",
"type": "text",
"dataSource": {
"api": "portal/category/index",
"multi": true
},
"placeholder": "请选择分类",
"tip": "",
"rule": {
"require": true
}
}
}
},
"last_articles": {
"title": "最新发布",
"display": "1",
"vars": {
"last_articles_category_id": {
"title": "文章分类ID",
"value": "",
"type": "text",
"dataSource": {
"api": "portal/category/index",
"multi": true
},
"placeholder": "请选择分类",
"tip": "",
"rule": {
"require": true
}
}
}
}
}
}
}
<!DOCTYPE html>
<html>
<head>
<title>搜索 {$theme_vars.varName1|default=''} </title>
<meta name="keywords" content="" />
<meta name="description" content="">
<include file="public@head"/>
<hook name="before_head_end"/>
</head>
<body class="">
<include file="public@nav"/>
<div class="container tc-main">
<div class="row">
<div class="col-md-9">
<div class="main-title">
<h3>'{$keyword}' 搜索结果 </h3>
</div>
<php>
$where=[
'post.create_time'=>['egt',0],
'post.post_title'=>['like',"%$keyword%"]
];
</php>
<portal:articles item="vo" where="$where" order="post.create_time DESC" page="10">
<div class="list-boxes">
<h2><a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}">{$vo.post_title}</a>
</h2>
<p>{$vo.post_excerpt}</p>
<div>
<div class="pull-left">
<div class="list-actions">
<a href="javascript:;"><i class="fa fa-eye"></i><span>{$vo.post_hits}</span></a>
<a href="{:cmf_url('portal/Article/doLike',array('id'=>$vo['id']))}"
class="js-count-btn"><i class="fa fa-thumbs-up"></i><span class="count">{$vo.post_like}</span></a>
<i class="fa fa-star-o"></i>
</a>
</div>
</div>
<a class="btn btn-warning btn-sm pull-right"
href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}">查看更多</a>
</div>
</div>
</portal:articles>
<div class="pagination">
<page/>
</div>
</div>
</div>
<include file="public@footer"/>
</div>
<include file="public@scripts"/>
<hook name="before_body_end"/>
</body>
</html>
\ No newline at end of file
{
"name": "搜索页面",
"action": "portal/search/index",
"description": "搜索模板文件",
"order": 10.0,
"more": {
"vars": {
"varName1": {
"title": "热门搜索",
"value": "1",
"type": "text",
"tip": "这是一个text",
"rule": {
"require": true
}
}
}
}
}
\ No newline at end of file