2023-01-29 10:26:52 +08:00

192 lines
5.9 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{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: 50px;
letter-spacing: 1px;
}
.md-list img{
float: left;
width: 165px;
height: 100px;
margin-top: 9px;
margin-left: 40px;
}
.bot{
float:right;
margin-right: 70px;
margin-top: 40px;
}
.bot a{
}
.list-show{
width:100%;
height:100%;
position: fixed;
top: 0;
left: 0;
z-index:999;
display: none;
}
.list-show-from{
width:90%;
height:100%;
display:block;
margin: 0 auto;
background: #fff;
overflow-y:scroll;
}
.wxlist .checkbox-inline{margin-top:25px;margin-left:25px}
.wxlist .checkbox-inline input{width:25px;height:25px;}
.wxlist .checkbox-inline p{font-size:18px;margin-left:20px;}
</style>
<a href="{:url('Wxpushall/addnavshow',array('wxid'=>$wxid))}" class="btn btn-danger">添加模板</a>
<a href="javascript:history.back(-1)" class="btn btn-success">返回</a>
<div class="clinhei"></div>
{volist name="list" id="v"}
<div class="md-list">
<p>模板ID<font color="red">{$v.id}</font></p>
<p>封面图:</p>
<img src="{$v.imgurl}" alt="">
<div class="bot">
<a href="{:url('Wxpushall/mdlist',array('mid'=>$v.id,'wxid'=>$wxid))}" class="btn btn-primary">查看详情</a>
<a href="{:url('Wxpushall/pushshow',array('mid'=>$v.id))}" class="btn btn-success">推送</a>
<a href="#" class="btn btn-danger" onclick="del('{$v.id}')">删除模板</a>
<div class="btn btn-danger" style="background:pink;" onclick="listshow('{$v.id}')">素材复制</div>
</div>
</div>
<div class="clinhei"></div>
{/volist}
<div class="list-show" id="list-show">
<div class="list-show-from">
<input type="hidden" value="" name="dataid" id="dataid">
<div class="wxlist">
{volist name="wxlist" id="v"}
<label class="checkbox-inline">
<input type="checkbox" value="{$v.id}" name="wxlist" id="checkboxwa">
<p>{$v.title}</p>
</label>
{/volist}
</div>
<a href="#" class="btn btn-danger close" onclick="listhide()">关闭</a>
<a href="#" class="btn btn-success" onclick="copydata()">复制</a>
</div>
</div>
{/block}
{block name="script"}
<script>
function copydata(){
swal({
title: '确定复制?',
text: "将复制选择的公众号",
type: 'warning',
buttons:{
confirm: {
text : '确认',
className : 'btn btn-success'
},
cancel: {
text : '关闭',
visible: true,
className: 'btn btn-danger'
}
}
}).then((Delete) => {
if (Delete) {
var wx_array=new Array();
$('input[id="checkboxwa"]:checked').each(function(){
wx_array.push($(this).val());//向数组中添加元素
});
var wxlist = wx_array.join(',');//将数组元素连接起来以构建一个字符串
var dataid = $('#dataid').val();
if(wxlist){
$.ajax({
type: "POST",
url:"{:url('Wxpushall/copyadvanced')}",
data: {dataid:dataid,wxlist:wxlist},
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('错误','选公众号啊', {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
}
} else {
//关闭执行
swal.close();
}
});
}
function listshow(id){
$('#list-show').show();
$('#dataid').val(id);
}
function listhide(){
$('#list-show').hide();
$('#dataid').val('');
}
function del(id){
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/delmd')}",
data: {id:id},
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}