init
This commit is contained in:
218
app/mobile/view/article/catelists.phtml
Executable file
218
app/mobile/view/article/catelists.phtml
Executable file
@@ -0,0 +1,218 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>新闻动态</title>
|
||||
{include file="include/head" /}
|
||||
<script type="text/javascript">
|
||||
var navID = "1";
|
||||
</script>
|
||||
<style>
|
||||
.news_list .right {
|
||||
float: left;
|
||||
width: 65%;
|
||||
}
|
||||
.news_list .left {
|
||||
float: left;
|
||||
width: 30%;
|
||||
}
|
||||
.news_list_share img {
|
||||
vertical-align: bottom;
|
||||
margin-right: 0.16rem;
|
||||
width: 0.927rem;
|
||||
height: 0.927rem;
|
||||
margin-bottom: 0.05rem;
|
||||
}
|
||||
.m_Container_right {
|
||||
float: right;
|
||||
margin: 5px 0 0 0 !important;
|
||||
}
|
||||
.news_list_des_text {
|
||||
font-size: 0.48rem;
|
||||
color: #666;
|
||||
line-height: 0.88rem;
|
||||
text-align: left !important;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- 轮播 s -->
|
||||
<div id="content">
|
||||
<!--头部-->
|
||||
{include file="include/top_back1" /}
|
||||
<!--banner-->
|
||||
<div class="banner img-responsive margin-top-90">
|
||||
<img src="__PUBLIC__/m_web/images/news/news-banner.jpg">
|
||||
</div>
|
||||
<!--新闻列表-->
|
||||
<div class="swt-Container">
|
||||
<div class="news-vertu">
|
||||
<?php if($cate_list): ?>
|
||||
<div class="tab">
|
||||
<?php foreach ($cate_list as $key => $value): ?>
|
||||
<a href="__ORICOROOT__/article/category/<?php echo $value['id'] ?>.html" class="<?php if ($category['id'] == $value['id']): ?> on <?php endif; ?>"><?php echo $value['name']; ?></a>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="m_Container">
|
||||
<!-- Blog列表 s -->
|
||||
<div class="search_box">
|
||||
<input type="text" placeholder="" class="search" id="bg-blog-in" value="">
|
||||
<button id="blog-btnput" class="search-button-blog">搜索</button>
|
||||
</div>
|
||||
<?php if (!empty($list)): ?>
|
||||
<div class="blog_list">
|
||||
<ul class="clearfix">
|
||||
<?php foreach ($list as $key => $value): ?>
|
||||
<?php
|
||||
if($value['jump_link'] == ''){
|
||||
$alink = "__ORICOROOT__/article/detail/".$value['id'].".html";
|
||||
}
|
||||
else{
|
||||
$alink = $value['jump_link'];
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $alink;?>">
|
||||
<img src="<?php echo getImage($value['picture']); ?>">
|
||||
<h3><?php echo $value['name']; ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
if (utf8_strlen($value['description']) > 35) {
|
||||
$value['description'] = msubstr($value['description'], 0, 35);
|
||||
}
|
||||
echo $value['description'];
|
||||
?>
|
||||
</p>
|
||||
</a>
|
||||
<span class="blue"><?php echo date("Y-m-d", $value['createtime']); ?></span>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<!-- 分页 s -->
|
||||
<div class="Pages">
|
||||
<span class="p_page">
|
||||
<?php if ($page) echo $page; ?>
|
||||
</span>
|
||||
</div>
|
||||
<!-- 分页 e -->
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
<div class="news_list newfl">查询无此结果!</div>
|
||||
<?php endif; ?>
|
||||
<!-- Blog列表 e -->
|
||||
<script>
|
||||
|
||||
$(function(){
|
||||
$("#bg-blog-in").keyup(function(event) {
|
||||
if (event && event.keyCode === 13) {
|
||||
$("#blog-btnput").trigger("click");
|
||||
}
|
||||
});
|
||||
//$("#search-btnput").click(function() {
|
||||
$("#blog-btnput").bind("click", function(event) {
|
||||
|
||||
var keywords = $("#bg-blog-in").val();
|
||||
if(keywords){
|
||||
var href = "?name=" + encodeURIComponent(keywords);
|
||||
location.href = href;
|
||||
}
|
||||
else{
|
||||
var href = window.location.href;
|
||||
var cleanUrl = href.split('?')[0];
|
||||
|
||||
location.href = cleanUrl;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<!--精彩评论-->
|
||||
<?php if (!empty($hot_comment)): ?>
|
||||
<div class="m_Container">
|
||||
<div class="news-comments">
|
||||
<div class="title text_center title_margin-top">精彩评论</div>
|
||||
|
||||
<?php foreach ($hot_comment as $key => $value): ?>
|
||||
<div class="news-comment">
|
||||
<div class="Customer-information">
|
||||
<div class="left"><img src="<?php echo getImage($value['headimg']); ?>"></div>
|
||||
<div class="right">
|
||||
<span class="news_list_des_text"><?php echo $value['customer_name']; ?></span>
|
||||
<span class="news_list_share"><?php echo $value['createtime'] ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<p><?php echo $value['content']; ?></p>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<br class="bottom-margin">
|
||||
|
||||
<!--底部文件-->
|
||||
{include file="include/bottom1" /}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$(".newfl .addzan").click(function(event) {
|
||||
event.preventDefault();
|
||||
var love = $(this);
|
||||
var id = love.data("id"); //对应id
|
||||
if (!love.data("zan")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: "<?php echo url('__ORICOROOT__/article/zan'); ?>",
|
||||
data: {id: id},
|
||||
cache: false, //不缓存此页面
|
||||
success: function(data) {
|
||||
//console.log(data);
|
||||
if (data.code) {
|
||||
love.data("zan", true);
|
||||
love.html('<img src="__PUBLIC__/m_web/images/news/news-Collection.png">点赞(' + data.data + ')');
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert('您已点过赞了!');
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/*function zan(id) {
|
||||
var article_id = id;
|
||||
$.ajax({
|
||||
url: '/mobile/article/zan',
|
||||
type: 'post',
|
||||
data: {id: article_id},
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
if (res) {
|
||||
alert(res.msg);
|
||||
if (res.code == 1) {
|
||||
// 点赞成功
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}*/
|
||||
</script>
|
||||
275
app/mobile/view/article/detail.phtml
Executable file
275
app/mobile/view/article/detail.phtml
Executable file
@@ -0,0 +1,275 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/weben/css/cooperation.css">
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/m_web/css/jquery.bxslider.css">
|
||||
<script type="text/javascript" src="__PUBLIC__/m_web/js/jquery.bxslider.min.js"></script>
|
||||
{include file="include/head-seo" /}
|
||||
{include file="include/head" /}
|
||||
<script type="text/javascript">
|
||||
var navID = "1";
|
||||
function shareCustomers(){
|
||||
// 复制到粘贴板
|
||||
const input = document.createElement('input')
|
||||
input.setAttribute('readonly', 'readonly')
|
||||
let url=window.location.href
|
||||
input.setAttribute('value', url)
|
||||
document.body.appendChild(input)
|
||||
input.select()
|
||||
if (document.execCommand('copy')) {
|
||||
document.execCommand('copy')
|
||||
alert('链接复制成功')
|
||||
}
|
||||
document.body.removeChild(input)
|
||||
} </script>
|
||||
</head>
|
||||
<style>
|
||||
.bx-wrapper {margin-bottom:2rem !important;}
|
||||
.bx-wrapper .bx-pager, .bx-wrapper .bx-controls-auto {bottom: 0 !important;}
|
||||
.bx-wrapper .bx-pager.bx-default-pager a {width:10px !important;height:10px !important;color: transparent;margin-right:0.5rem;border-radius: 7px !important;border:none !important;background: #c6ced6; display:inline-block;}
|
||||
.bx-wrapper .bx-pager.bx-default-pager a.active { background: #004bfa;width: 20px;height: 10px;color: transparent;}
|
||||
.bx-wrapper .bx-pager {text-align: center;font-size: .85em;font-family: Arial;font-weight: bold;color: #666;padding-top: 20px;}
|
||||
.slide a {color: #333;}
|
||||
.slide a:hover {color: #333;}
|
||||
.slide p {height:32px; overflow: hidden;}
|
||||
</style>
|
||||
<body>
|
||||
|
||||
<div id="content">
|
||||
<!--头部-->
|
||||
{include file="include/top_back1" /}
|
||||
<!--banner-->
|
||||
<!-- 详情页 s -->
|
||||
<div class="content" style="margin-top: 60px;">
|
||||
<input type="hidden" class="b_id">
|
||||
<div class="clearfix">
|
||||
<div class="blog_detail">
|
||||
<div class="blog_title">
|
||||
<h2><?php echo $detail['name']; ?></h2>
|
||||
<p><?php echo date("Y-m-d H:i:s", $detail['createtime']); ?> </p>
|
||||
</div>
|
||||
<div class="blog_content">
|
||||
<?php echo $detail['content']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="share_box">
|
||||
<div class="blog_share">
|
||||
<h3>分享</h3>
|
||||
<ul class="share_list clearfix">
|
||||
<li><a target="_blank" href="https://weibo.com/"><img src="/frontend/web/images/blog/share1.png"/></a></li>
|
||||
<li class="wechat"><img src="/frontend/web/images/blog/share2.png"/><div class="wechat_code" ><img src="/frontend/web/images/erweima-blog.png"></div></li>
|
||||
<li><a target="_blank" href="https://creator.xiaohongshu.com/login?redirectReason=401"><img src="/frontend/web/images/blog/share3.png"/></a></li>
|
||||
<li><a href="javascript:shareCustomers();" title="submit to reddit"><img src="/frontend/web/images/blog/share4.png"></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="comment">
|
||||
<h3>留言</h3>
|
||||
<form class="comment_form clearfix">
|
||||
<div style="margin-right: 0.625rem; margin-bottom: 0.5rem;">姓名:<br/>
|
||||
<input class="form-control itinp new_name" type="text" name="name"/>
|
||||
</div>
|
||||
<div>电子邮件:<br/>
|
||||
<input class="form-control itinp new_email" type="email" name="email" />
|
||||
<p style="color: #C6C7C9; font-size: 0.75rem; margin-bottom: 0.5rem; ">您的电子邮件地址不会被公开</p>
|
||||
</div>
|
||||
<div class="comment_area">留言:<br/>
|
||||
<textarea class="form-control itinp new_comment" style="height: 3rem;border: 1px solid #DBDBDB;" name="comment"></textarea>
|
||||
</div>
|
||||
</form>
|
||||
<div class="comment_btn" style="color:#ffffff;">提交留言</div>
|
||||
</div>
|
||||
<div class="xq">
|
||||
<div class="swt-Container">
|
||||
<?php
|
||||
$articles = getDifferentArticle('default', 3, ['cid' => $detail['cid'], 'id' => ['neq', $detail['id']]]);
|
||||
if ($articles):
|
||||
?>
|
||||
<!-- 猜您喜欢 -->
|
||||
<div class="love">
|
||||
<div class="love1">
|
||||
<p>你可能还喜欢</p>
|
||||
<p><img src="/frontend/web/images/1line.png"></p>
|
||||
</div>
|
||||
<div class="love2 clearfix">
|
||||
<!--图片滑动-->
|
||||
<div class="loves">
|
||||
<?php foreach ($articles as $article): ?>
|
||||
<?php
|
||||
if($article['jump_link'] == ''){
|
||||
$rlink = "__ORICOROOT__/article/detail/".$article['id'].".html";
|
||||
}
|
||||
else{
|
||||
$rlink = $article['jump_link'];
|
||||
}
|
||||
?>
|
||||
<div class="slide">
|
||||
<a href="<?php echo $rlink; ?>">
|
||||
<img src="<?php echo getImage($article['picture']); ?>">
|
||||
<p class="lvtit"><?php echo msubstr($article['name'], 0, 40); ?></p>
|
||||
</a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
<!--图片滑动-->
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!--底部-->
|
||||
{include file="include/bottom1" /}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<input type="hidden" name="content_id" value="<?php echo $detail['id']; ?>">
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
// 提交表单
|
||||
$('.comment_btn').click(function(){
|
||||
var new_name = $('.new_name').val();
|
||||
var new_email = $('.new_email').val();
|
||||
var new_comment = $('.new_comment').val();
|
||||
|
||||
console.log('message');
|
||||
if (new_name == '') {
|
||||
//alert("The Name is Empty!");
|
||||
|
||||
$('.new_name').addClass('error');
|
||||
$('.new_name').next('span').removeClass('hide');
|
||||
return false;
|
||||
}else{
|
||||
$('.new_name').removeClass('error');
|
||||
$('.new_name').next('span').addClass('hide');
|
||||
}
|
||||
|
||||
|
||||
if (new_comment == '') {
|
||||
//alert("The Comment is Empty!");
|
||||
|
||||
$('.new_comment').addClass('error');
|
||||
$('.new_comment').next('span').removeClass('hide');
|
||||
return false;
|
||||
}else{
|
||||
$('.new_comment').removeClass('error');
|
||||
$('.new_comment').next('span').addClass('hide');
|
||||
}
|
||||
|
||||
if (new_email == '') {
|
||||
$('.new_email').addClass('error');
|
||||
$('.new_email').next('span').removeClass('hide');
|
||||
}
|
||||
else{
|
||||
if (/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(new_email) == false) {
|
||||
$('.new_email').addClass('error');
|
||||
$('.new_email').next('span').removeClass('hide');
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
$('.new_email').removeClass('error');
|
||||
$('.new_email').next('span').addClass('hide');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
var bid = "<?php echo $detail['id'];?>";
|
||||
//点击创建申请块
|
||||
if(new_name && new_email && new_comment && bid) {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/index/article/addcomment",
|
||||
data: {'name':new_name, 'email':new_email,'comment':new_comment,'article_id':bid},
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
if(data.code == 200) {
|
||||
alert("留言提交成功!");
|
||||
$(".new_name").val("");
|
||||
$(".new_email").val("");
|
||||
$(".new_comment").val("");
|
||||
}
|
||||
else{
|
||||
alert(data.msg);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
$(".Release").click(function() {
|
||||
if (user_data == null) {
|
||||
alert('请先登录');
|
||||
window.location.href = "__ORICOROOT__/customer/login";
|
||||
}
|
||||
|
||||
// console.log(user_data);
|
||||
var customer_id = user_data.user_info.id;
|
||||
var time = user_data.curr_time;
|
||||
var token = user_data.token;
|
||||
var firstname = user_data.user_info.firstname;
|
||||
var pid = 0; // 暂时是固定的
|
||||
var cid = $("input[name = 'content_id']").val();
|
||||
var content = $("#ccont").val();
|
||||
$.ajax({
|
||||
url: '__ORICOROOT__/pinglun/add',
|
||||
type: 'post',
|
||||
data: {id: customer_id, time: time, token: token, firstname: firstname, pid: pid, cid: cid, typeid: 'Article', content: content},
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
if (res) {
|
||||
if (res.code == 1) {
|
||||
// 评论成功
|
||||
alert(res.msg);
|
||||
location.reload();
|
||||
}else if (res.code == -101) {
|
||||
// token 过期
|
||||
|
||||
}else if (res.code == -1) {
|
||||
alert(res.msg);
|
||||
|
||||
}else if (res.code == -2) {
|
||||
// 前一分钟内评论过
|
||||
|
||||
}else if (res.code == -3) {
|
||||
// 未知错误
|
||||
|
||||
}else if (res.code == -4) {
|
||||
// 表单格式错误
|
||||
|
||||
}else if (res.code == -5) {
|
||||
// 插入数据库失败
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('.loves').bxSlider({
|
||||
slideWidth: 200,
|
||||
minSlides: 2,
|
||||
maxSlides: 2,
|
||||
infiniteLoop: false,
|
||||
slideMargin: 10
|
||||
});
|
||||
});
|
||||
</script>
|
||||
211
app/mobile/view/article/lists.phtml
Executable file
211
app/mobile/view/article/lists.phtml
Executable file
@@ -0,0 +1,211 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>新闻动态</title>
|
||||
{include file="include/head" /}
|
||||
<script type="text/javascript">
|
||||
var navID = "1";
|
||||
</script>
|
||||
<style>
|
||||
.news_list .right {
|
||||
float: left;
|
||||
width: 65%;
|
||||
}
|
||||
.news_list .left {
|
||||
float: left;
|
||||
width: 30%;
|
||||
}
|
||||
.news_list_share img {
|
||||
vertical-align: bottom;
|
||||
margin-right: 0.16rem;
|
||||
width: 0.927rem;
|
||||
height: 0.927rem;
|
||||
margin-bottom: 0.05rem;
|
||||
}
|
||||
.m_Container_right {
|
||||
float: right;
|
||||
margin: 5px 0 0 0 !important;
|
||||
}
|
||||
.news_list_des_text {
|
||||
font-size: 0.48rem;
|
||||
color: #666;
|
||||
line-height: 0.88rem;
|
||||
text-align: left !important;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- 轮播 s -->
|
||||
<div id="content">
|
||||
<!--头部-->
|
||||
{include file="include/top_back1" /}
|
||||
<!--banner-->
|
||||
<div class="banner img-responsive margin-top-90">
|
||||
<img src="__PUBLIC__/m_web/images/news/news-banner.jpg">
|
||||
</div>
|
||||
<!--新闻列表-->
|
||||
<div class="swt-Container">
|
||||
<div class="news-vertu">
|
||||
<?php if($cate_list): ?>
|
||||
<div class="tab">
|
||||
<?php foreach ($cate_list as $key => $value): ?>
|
||||
<a href="__ORICOROOT__/article/category/<?php echo $value['id'] ?>.html" class="<?php if ($category['id'] == $value['id']): ?> on <?php endif; ?>"><?php echo $value['name']; ?></a>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="m_Container">
|
||||
<!-- Blog列表 s -->
|
||||
<div class="search_box">
|
||||
<input type="text" placeholder="" class="search" id="bg-blog-in" value="">
|
||||
<button id="blog-btnput" class="search-button-blog">搜索</button>
|
||||
</div>
|
||||
<?php if (!empty($list)): ?>
|
||||
<div class="blog_list">
|
||||
<ul class="clearfix">
|
||||
<?php foreach ($list as $key => $value): ?>
|
||||
<?php
|
||||
if($value['jump_link'] == ''){
|
||||
$alink = "__ORICOROOT__/article/detail/".$value['id'].".html";
|
||||
}
|
||||
else{
|
||||
$alink = $value['jump_link'];
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $alink; ?>">
|
||||
<img src="<?php echo getImage($value['picture']); ?>">
|
||||
<h3><?php echo $value['name']; ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
if (utf8_strlen($value['description']) > 35) {
|
||||
$value['description'] = msubstr($value['description'], 0, 35);
|
||||
}
|
||||
echo $value['description'];
|
||||
?>
|
||||
</p>
|
||||
</a>
|
||||
<span class="blue"><?php echo date("Y-m-d", $value['createtime']); ?></span>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<!-- 分页 s -->
|
||||
<div class="Pages"><?php if ($page) echo $page; ?></div> <!-- 分页 e -->
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
<div class="news_list newfl">查询无此结果!</div>
|
||||
<?php endif; ?>
|
||||
<!-- Blog列表 e -->
|
||||
<script>
|
||||
|
||||
$(function(){
|
||||
$("#bg-blog-in").keyup(function(event) {
|
||||
if (event && event.keyCode === 13) {
|
||||
$("#blog-btnput").trigger("click");
|
||||
}
|
||||
});
|
||||
//$("#search-btnput").click(function() {
|
||||
$("#blog-btnput").bind("click", function(event) {
|
||||
|
||||
var keywords = $("#bg-blog-in").val();
|
||||
if(keywords){
|
||||
var href = "?name=" + encodeURIComponent(keywords);
|
||||
location.href = href;
|
||||
}
|
||||
else{
|
||||
var href = "/mobile/article.html";
|
||||
location.href = href;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<!--精彩评论-->
|
||||
<?php if (!empty($hot_comment)): ?>
|
||||
<div class="m_Container">
|
||||
<div class="news-comments">
|
||||
<div class="title text_center title_margin-top">精彩评论</div>
|
||||
|
||||
<?php foreach ($hot_comment as $key => $value): ?>
|
||||
<div class="news-comment">
|
||||
<div class="Customer-information">
|
||||
<div class="left"><img src="<?php echo getImage($value['headimg']); ?>"></div>
|
||||
<div class="right">
|
||||
<span class="news_list_des_text"><?php echo $value['customer_name']; ?></span>
|
||||
<span class="news_list_share"><?php echo $value['createtime'] ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<p><?php echo $value['content']; ?></p>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<br class="bottom-margin">
|
||||
|
||||
<!--底部文件-->
|
||||
{include file="include/bottom1" /}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$(".newfl .addzan").click(function(event) {
|
||||
event.preventDefault();
|
||||
var love = $(this);
|
||||
var id = love.data("id"); //对应id
|
||||
if (!love.data("zan")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: "<?php echo url('__ORICOROOT__/article/zan'); ?>",
|
||||
data: {id: id},
|
||||
cache: false, //不缓存此页面
|
||||
success: function(data) {
|
||||
//console.log(data);
|
||||
if (data.code) {
|
||||
love.data("zan", true);
|
||||
love.html('<img src="__PUBLIC__/m_web/images/news/news-Collection.png">点赞(' + data.data + ')');
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert('您已点过赞了!');
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/*function zan(id) {
|
||||
var article_id = id;
|
||||
$.ajax({
|
||||
url: '/mobile/article/zan',
|
||||
type: 'post',
|
||||
data: {id: article_id},
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
if (res) {
|
||||
alert(res.msg);
|
||||
if (res.code == 1) {
|
||||
// 点赞成功
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}*/
|
||||
</script>
|
||||
Reference in New Issue
Block a user