365 lines
11 KiB
HTML
365 lines
11 KiB
HTML
{extend name="public/base" /}
|
|
{block name="body"}
|
|
<style>
|
|
.clinhei{width:100%;height:25px;}
|
|
.inp{width:200px;}
|
|
.inpdiv{width:25%;}
|
|
.inpdivbut{width:10%;float:left;}
|
|
.so{width:80px;height:30px;border:0;margin-top:25px;text-align:center;line-height:30px;cursor: pointer;}
|
|
.tdinp{width:100%;border:0;}
|
|
.up{border:0;cursor: pointer;}
|
|
</style>
|
|
<div class="main-box clearfix">
|
|
<header class="main-box-header clearfix">
|
|
<div class="pull-left">
|
|
<h2>用户推送配置</h2>
|
|
</div>
|
|
|
|
</header>
|
|
<div class="main-box-body clearfix">
|
|
<p>未支付成功首次推送</p>
|
|
<div class="container">
|
|
<form id="formone" enctype="multipart/form-data">
|
|
<input type="hidden" id="gurl" value="{$pushinfo.imgurl}">
|
|
<div class="inpdiv" style="width:800px;">
|
|
<img src="{$pushinfo.imgurl}" style="width:250px">
|
|
</div>
|
|
<br>
|
|
<div class="form-group">
|
|
<label class="sr-only" for="inputfile">更改图片</label>
|
|
<input type="file" id="imgurl" name="imgurl">
|
|
</div>
|
|
|
|
<div class="inpdiv" style="width:800px;">
|
|
<label for="name">标题</label>
|
|
<input type="text" class="form-control inp" id="title" value="{$pushinfo.title}" style="width:800px;">
|
|
</div>
|
|
<br>
|
|
<div class="inpdiv" style="width:800px;">
|
|
<label for="name">描述</label>
|
|
<textarea class="form-control inp" id="d" style="width:800px;">{$pushinfo.d}</textarea>
|
|
</div>
|
|
<br>
|
|
<div class="inpdiv" style="width:800px;">
|
|
<label for="name">链接地址</label>
|
|
<input type="text" class="form-control inp" id="url" value="{$pushinfo.url}" style="width:800px;">
|
|
</div>
|
|
<br>
|
|
<div class="inpdiv">
|
|
<label for="name">支付链接</label>
|
|
<select id="pay" class="form-control inp">
|
|
{volist name="pay" id="v"}
|
|
<option value="{$v.id}">金额:{$v.price}</option>
|
|
{/volist}
|
|
</select>
|
|
<div class="btn-info so" onclick="addlink(1)">生成支付链接</div>
|
|
<p style="color:red;margin-top:10px;" id="pay-link"></p>
|
|
</div>
|
|
|
|
<div class="inpdiv">
|
|
<label for="name">是否开启</label>
|
|
<select id="open" class="form-control inp" style="width:100px;">
|
|
{if $pushinfo.open==1}
|
|
<option value="1">开启</option>
|
|
<option value="0">关闭</option>
|
|
{else}
|
|
<option value="0">关闭</option>
|
|
<option value="1">开启</option>
|
|
{/if}
|
|
</select>
|
|
</div>
|
|
<br>
|
|
<div class="inpdiv" style="width:800px;">
|
|
<label for="name">推送秒数 <font color="red">第一次推送后若还无充值 间隔X秒 给他第二次推送抵充</font></label>
|
|
<input type="text" class="form-control inp" id="pushtime" value="{$pushinfo.pushtime}">
|
|
</div>
|
|
|
|
<br>
|
|
<div class="inpdiv" style="width:800px;">
|
|
<label for="name" style="color: #e84e40;">测试ID 用于测试推送</label>
|
|
<input type="text" class="form-control inp" id="cid">
|
|
</div>
|
|
<br>
|
|
<p style="color: red;">注意:如有修改请先保存素材 在推送</p>
|
|
|
|
<div class="inpdivbut">
|
|
<div class="btn-info so" onclick="formsub()">保存素材</div>
|
|
</div>
|
|
|
|
<div class="inpdivbut">
|
|
<div class="btn-danger so" onclick="push()">测试推送</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
<div class="clinhei"></div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="main-box-body clearfix">
|
|
<p>未支付成功第二推送</p>
|
|
<div class="container">
|
|
<form id="formstwo" enctype="multipart/form-data">
|
|
<input type="hidden" id="gurlt" value="{$pushinfotwo.imgurl}">
|
|
<div class="inpdiv" style="width:800px;">
|
|
<img src="{$pushinfotwo.imgurl}" style="width:250px">
|
|
</div>
|
|
<br>
|
|
<div class="form-group">
|
|
<label class="sr-only" for="inputfile">更改图片</label>
|
|
<input type="file" id="imgurlo" name="imgurl">
|
|
</div>
|
|
|
|
<div class="inpdiv" style="width:800px;">
|
|
<label for="name">标题</label>
|
|
<input type="text" class="form-control inp" id="titleo" value="{$pushinfotwo.title}" style="width:800px;">
|
|
</div>
|
|
<br>
|
|
<div class="inpdiv" style="width:800px;">
|
|
<label for="name">描述</label>
|
|
<textarea class="form-control inp" id="do" style="width:800px;">{$pushinfotwo.d}</textarea>
|
|
</div>
|
|
<br>
|
|
<div class="inpdiv" style="width:800px;">
|
|
<label for="name">链接地址</label>
|
|
<input type="text" class="form-control inp" id="urlo" value="{$pushinfotwo.url}" style="width:800px;">
|
|
</div>
|
|
<br>
|
|
<div class="inpdiv">
|
|
<label for="name">支付链接</label>
|
|
<select id="paytwo" class="form-control inp">
|
|
{volist name="pay" id="v"}
|
|
<option value="{$v.id}">金额:{$v.price}</option>
|
|
{/volist}
|
|
</select>
|
|
<div class="btn-info so" onclick="addlink(2)">生成支付链接</div>
|
|
<p style="color:red;margin-top:10px;" id="pay-link-two"></p>
|
|
</div>
|
|
|
|
<div class="inpdiv">
|
|
<label for="name">是否开启</label>
|
|
<select id="openo" class="form-control inp" style="width:100px;">
|
|
{if $pushinfotwo.open==1}
|
|
<option value="1">开启</option>
|
|
<option value="0">关闭</option>
|
|
{else}
|
|
<option value="0">关闭</option>
|
|
<option value="1">开启</option>
|
|
{/if}
|
|
</select>
|
|
</div>
|
|
<br>
|
|
<div class="inpdiv" style="width:800px;">
|
|
<label for="name">推送秒数 <font color="red">第二次推送抵充 时间</font></label>
|
|
<input type="text" class="form-control inp" id="pushtimeo" value="{$pushinfotwo.pushtime}">
|
|
</div>
|
|
<br>
|
|
<div class="inpdiv" style="width:800px;">
|
|
<label for="name" style="color: #e84e40;">测试ID 用于测试推送</label>
|
|
<input type="text" class="form-control inp" id="cido">
|
|
</div>
|
|
<br>
|
|
<p style="color: red;">注意:如有修改请先保存素材 在推送</p>
|
|
|
|
<div class="inpdivbut">
|
|
<div class="btn-info so" onclick="formsubOne()">保存素材</div>
|
|
</div>
|
|
|
|
<div class="inpdivbut">
|
|
<div class="btn-danger so" onclick="pushOne()">测试推送</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
<div class="clinhei"></div>
|
|
</div>
|
|
|
|
</div>
|
|
{/block}
|
|
{block name="script"}
|
|
<script>
|
|
// 生成推广链接
|
|
function addlink(type){
|
|
if(type==1){
|
|
var payid = $('#pay').val();
|
|
}else{
|
|
var payid = $('#paytwo').val();
|
|
}
|
|
var formData = new FormData();
|
|
formData.append("id",payid);
|
|
formData.append("type",type);
|
|
$.ajax({
|
|
type: "POST",
|
|
url:"{:url('wxregpush/getlink')}",
|
|
data: formData,
|
|
async: false,
|
|
cache: false,
|
|
processData:false,
|
|
contentType:false,
|
|
dataType:"json",
|
|
error: function(request) {
|
|
|
|
},
|
|
success: function(data) {
|
|
if(data.type=='1'){
|
|
$('#pay-link').text(data.link)
|
|
}else{
|
|
$('#pay-link-two').text(data.link)
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
}
|
|
// 保存素材 1
|
|
function formsub(){
|
|
var title = $('#title').val();
|
|
var d = $('#d').val();
|
|
var url = $('#url').val();
|
|
var pushtime = $('#pushtime').val();
|
|
var open = $('#open').val();
|
|
if(title==''){
|
|
swal('错误','标题不能为空', {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
|
|
}else if(d==''){
|
|
swal('错误','描述不能为空', {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
|
|
}else if(url==''){
|
|
swal('错误','链接地址不能为空', {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
|
|
}else{
|
|
var formData = new FormData();
|
|
formData.append("imgurl",$('#imgurl')[0].files[0]);
|
|
formData.append("title",title);
|
|
formData.append("d",d);
|
|
formData.append("url",url);
|
|
formData.append("gurl",$('#gurl').val());
|
|
formData.append("pushtime",pushtime);
|
|
formData.append("open",open);
|
|
formData.append("id",1);
|
|
$.ajax({
|
|
type: "POST",
|
|
url:"{:url('Wxregpush/savepush')}",
|
|
data: formData,
|
|
async: false,
|
|
cache: false,
|
|
processData:false,
|
|
contentType:false,
|
|
dataType:"json",
|
|
error: function(request) {
|
|
console.log('错误')
|
|
},
|
|
success: function(data) {
|
|
if(data.status==1){
|
|
swal('保存成功',"", {icon : "success",buttons:{confirm:{className : 'btn btn-success'}},});
|
|
window.location.href=""
|
|
}else{
|
|
swal('错误',data.reg, {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// 保存素材 2
|
|
function formsubOne(){
|
|
var title = $('#titleo').val();
|
|
var d = $('#do').val();
|
|
var url = $('#urlo').val();
|
|
var pushtime = $('#pushtimeo').val();
|
|
var open = $('#openo').val();
|
|
if(title==''){
|
|
swal('错误','标题不能为空', {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
|
|
}else if(d==''){
|
|
swal('错误','描述不能为空', {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
|
|
}else if(url==''){
|
|
swal('错误','链接地址不能为空', {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
|
|
}else{
|
|
var formData = new FormData();
|
|
formData.append("imgurl",$('#imgurlo')[0].files[0]);
|
|
formData.append("title",title);
|
|
formData.append("d",d);
|
|
formData.append("url",url);
|
|
formData.append("gurl",$('#gurlt').val());
|
|
formData.append("pushtime",pushtime);
|
|
formData.append("open",open);
|
|
formData.append("id",2);
|
|
$.ajax({
|
|
type: "POST",
|
|
url:"{:url('Wxregpush/savepush')}",
|
|
data: formData,
|
|
async: false,
|
|
cache: false,
|
|
processData:false,
|
|
contentType:false,
|
|
dataType:"json",
|
|
error: function(request) {
|
|
console.log('错误')
|
|
},
|
|
success: function(data) {
|
|
if(data.status==1){
|
|
swal('保存成功',"", {icon : "success",buttons:{confirm:{className : 'btn btn-success'}},});
|
|
window.location.href=""
|
|
}else{
|
|
swal('错误',data.reg, {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
// 测试推送 1
|
|
function push(){
|
|
// 单个测试推送
|
|
var cid = $('#cid').val();
|
|
$.ajax({
|
|
type: "POST",
|
|
url:"{:url('Wxregpush/ceshipush')}",
|
|
data: {id:cid,type:1},
|
|
dataType:"json",
|
|
error: function(request) {
|
|
console.log('错误')
|
|
},
|
|
success: function(data) {
|
|
if(data.status==1){
|
|
swal('推送成功',"", {icon : "success",buttons:{confirm:{className : 'btn btn-success'}},});
|
|
}else{
|
|
swal('错误',data.reg, {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
}
|
|
// 测试推送 2
|
|
function pushOne(){
|
|
// 单个测试推送
|
|
var cid = $('#cido').val();
|
|
$.ajax({
|
|
type: "POST",
|
|
url:"{:url('Wxregpush/ceshipush')}",
|
|
data: {id:cid,type:2},
|
|
dataType:"json",
|
|
error: function(request) {
|
|
console.log('错误')
|
|
},
|
|
success: function(data) {
|
|
if(data.status==1){
|
|
swal('推送成功',"", {icon : "success",buttons:{confirm:{className : 'btn btn-success'}},});
|
|
}else{
|
|
swal('错误',data.reg, {icon : "error",buttons:{confirm:{className : 'btn btn-danger'}},});
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
}
|
|
</script>
|
|
{/block}
|