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

127 lines
3.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>
<p style="color: seagreen;">用户接收时间早上7点到22点 每个新用户会自动推两轮 一天一轮 直到充值</p>
<div class="clinhei"></div>
{volist name="list" id="v"}
<div class="md-list">
<p><font color="red">{$v.id}</font> 次推送</p>
<p>图片:</p>
<img src="{$v.imgurl}" alt="">
<p>标题:{$v.title|mb_substr=0,14,'utf-8'}</p>
<p>间隔推送:{$v.interval}</p>
<div class="bot">
<a href="{:url('Smartpush/edit',array('id'=>$v.id))}" class="btn btn-primary">编辑</a>
</div>
</div>
<div class="clinhei"></div>
{/volist}
<div class="upwx">
{if $status==2}
<span onclick="openPush(1)">开启</span>
{else/}
<span onclick="openPush(2)">关闭</span>
{/if}
</div>
{/block}
{block name="script"}
<script>
function openPush(status){
if(status==1){
var tit = "确定开启?";
var text = "开启后新用户根据时间段会接收到推送"
}else{
var tit = "确定关闭";
var text = "关闭后新进用户将不在收到推送";
}
swal({
title: tit,
text: 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('Smartpush/open')}",
data: {status:status},
dataType:"json",
success: function(data) {
if(data.status==1){
swal(data.reg,"", {icon : "success",buttons:{confirm:{className : 'btn btn-success'}},});
setTimeout(function(){ window.location = ""; }, 1500);
}else{
swal('错误',data.reg, {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
}
}
});
} else {
//关闭执行
swal.close();
}
});
}
</script>
{/block}