214 lines
6.2 KiB
HTML
214 lines
6.2 KiB
HTML
{extend name="public/base" /}
|
|
{block name="body"}
|
|
<style>
|
|
.clinhei{width:100%;height:20px;}
|
|
.inp{width:200px;}
|
|
.md-list{
|
|
width: 100%;
|
|
height: 120px;
|
|
background: #fff;
|
|
border-radius:5px;
|
|
}
|
|
.md-list p{
|
|
float: left;
|
|
margin-top: 42px;
|
|
font-size: 18px;
|
|
color: #000;
|
|
margin-left:20px;
|
|
letter-spacing: 1px;
|
|
}
|
|
.md-list img{
|
|
float: left;
|
|
width: 165px;
|
|
height: 100px;
|
|
margin-top: 9px;
|
|
margin-left:10px;
|
|
}
|
|
.bot{
|
|
float:right;
|
|
margin-right: 20px;
|
|
margin-top: 30px;
|
|
}
|
|
.bot a{
|
|
|
|
}
|
|
.upwx{
|
|
width: 100%;
|
|
position: fixed;
|
|
bottom: 8%;
|
|
}
|
|
.upwx span{
|
|
display:block;
|
|
width: 120px;
|
|
height: 40px;
|
|
line-height: 40px;
|
|
color: #fff;
|
|
background-color: teal;
|
|
text-align: center;
|
|
border-radius: 3px;
|
|
cursor: pointer;
|
|
}
|
|
</style>
|
|
{if $upwx==0}
|
|
<a href="{:url('Wxpushall/addnavshow',array('mid'=>$mid,'wxid'=>$wxid))}" class="btn btn-danger">添加栏目</a>
|
|
{/if}
|
|
<a href="javascript:history.back(-1)" class="btn btn-success">返回</a>
|
|
<a href="#" onclick="reset()" class="btn btn-primary">重置上传</a>
|
|
<div class="clinhei"></div>
|
|
{volist name="list" id="v"}
|
|
<div class="md-list">
|
|
<p>栏目位置:<font color="red">{$v.index}</font></p>
|
|
<p>图片:</p>
|
|
<img src="{$v.thumb_url}" alt="">
|
|
<p>标题:{$v.title|mb_substr=0,17,'utf-8'}</p>
|
|
<p>是否为封面:{if $v.show_cover_pic==1}<font color="#ffb515">是</font>{else/}<font color="#eee">否</font>{/if}</p>
|
|
<div class="bot">
|
|
<a href="{:url('Wxpushall/editshow',array('id'=>$v.id,'wxid'=>$v.wxid))}" class="btn btn-primary">编辑</a>
|
|
<br>
|
|
{if $v.show_cover_pic==0}
|
|
{if $upwx==0}
|
|
<a href="#" class="btn btn-danger" style="margin-top: 5px;" onclick="del('{$v.id}')">删除</a>
|
|
{/if}
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
<div class="clinhei"></div>
|
|
{/volist}
|
|
<div class="upwx">
|
|
{if $upwx==0}
|
|
<span onclick="add('{$mid}')">上传公众号</span>
|
|
{/if}
|
|
</div>
|
|
{/block}
|
|
{block name="script"}
|
|
<script>
|
|
function del(id){
|
|
var wxid = "{$wxid}";
|
|
swal({
|
|
title: '确定删除?',
|
|
text: "上传公众号后将 不可增加 删除",
|
|
type: 'warning',
|
|
buttons:{
|
|
confirm: {
|
|
text : '确认',
|
|
className : 'btn btn-success'
|
|
},
|
|
cancel: {
|
|
text : '关闭',
|
|
visible: true,
|
|
className: 'btn btn-danger'
|
|
}
|
|
}
|
|
}).then((Delete) => {
|
|
if (Delete) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url:"{:url('Wxpushall/del')}",
|
|
data: {id:id,wxid:wxid},
|
|
dataType:"json",
|
|
success: function(data) {
|
|
if(data.status==1){
|
|
swal('成功',"", {icon : "success",buttons:{confirm:{className : 'btn btn-success'}},});
|
|
window.location = "";
|
|
}else{
|
|
swal('错误',data.reg, {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
} else {
|
|
//关闭执行
|
|
swal.close();
|
|
}
|
|
});
|
|
}
|
|
|
|
function reset(){
|
|
var wxid = "{$wxid}";
|
|
var mid = "{$mid}";
|
|
swal({
|
|
title: '确定重置?',
|
|
text: "确定重置",
|
|
type: 'warning',
|
|
buttons:{
|
|
confirm: {
|
|
text : '确认',
|
|
className : 'btn btn-success'
|
|
},
|
|
cancel: {
|
|
text : '关闭',
|
|
visible: true,
|
|
className: 'btn btn-danger'
|
|
}
|
|
}
|
|
}).then((Delete) => {
|
|
if (Delete) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url:"{:url('Wxpushall/mdlistreset')}",
|
|
data: {mid:mid,wxid:wxid},
|
|
dataType:"json",
|
|
success: function(data) {
|
|
if(data.status==1){
|
|
swal('成功',"", {icon : "success",buttons:{confirm:{className : 'btn btn-success'}},});
|
|
window.location = "";
|
|
}else{
|
|
swal('错误',data.reg, {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
} else {
|
|
//关闭执行
|
|
swal.close();
|
|
}
|
|
});
|
|
}
|
|
// 上传到公众号
|
|
function add(mid){
|
|
var wxid = "{$wxid}";
|
|
swal({
|
|
title: '确定上传?',
|
|
text: "上传公众号后 栏目将不可增加 删除",
|
|
type: 'warning',
|
|
buttons:{
|
|
confirm: {
|
|
text : '确认',
|
|
className : 'btn btn-success'
|
|
},
|
|
cancel: {
|
|
text : '关闭',
|
|
visible: true,
|
|
className: 'btn btn-danger'
|
|
}
|
|
}
|
|
}).then((Delete) => {
|
|
if (Delete) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url:"{:url('Wxpushall/upMaterial')}",
|
|
data: {mid:mid,wxid:wxid},
|
|
dataType:"json",
|
|
success: function(data) {
|
|
if(data.status==1){
|
|
swal('成功',data.reg, {icon : "success",buttons:{confirm:{className : 'btn btn-success'}},});
|
|
window.location = "";
|
|
}else{
|
|
swal('错误',data.reg, {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
} else {
|
|
//关闭执行
|
|
swal.close();
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
{/block}
|