推广二维码

master
tping 3 years ago
parent b25d363396
commit f3992c963b

@ -196,7 +196,7 @@
<body>
<div class="page full">
<div id="public-web-container" class="hidden">
<p class="">正在打开 “2”...</p> <!-- replace -->
<p class="">正在打开 “小程序”...</p> <!-- replace -->
<a id="public-web-jump-button" href="javascript:" class="weui-btn weui-btn_primary weui-btn_loading" onclick="jumpToMp()">
<!--<span id="public-web-jump-button-loading" class="weui-primary-loading weui-primary-loading_transparent"><i class="weui-primary-loading__dot"></i></span>
-->打开小程序

@ -0,0 +1,159 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/account.css" rel="stylesheet" >
</block>
<block name="body">
<div class="page-list normal_list promote-add_chlid-form">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>管理中心></span><span>编辑</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_ziqudao.png">
<span class="title_main">编辑</span>
</div>
<div class="trunk-content article">
<div class="trunk-list list_normal">
<form action="{:U('Promote/edit')}" novalidate="novalidate" method="post" class="base_info" id="form_reg">
<table class="table2">
<tr>
<input type="hidden" name="id" id="id" value="{$id}">
<input type="hidden" name="promote_type" value="{:I('promote_type', 0)}">
<td class="l"><span class="req">*</span>小程序背景图:</td>
<td class="r">
<input id="images" name="img" type="hidden" value="">
<span id="img"><img src="{$background_img}" width="40%" height="40%"/></span>
<input type="file" id="imgFile"/>
</td>
</tr>
<tr>
<td class="l"><span class="req">*</span>推广游戏名称:</td>
<td class="r">
<select name="base_game_id" class="select_gallery" id="game" style="width:220px;">
<option>{$game_name}</option>
</select>
</td>
</tr>
<tr>
<td class="l"></td>
<td class="r">
<input type="button" class="tj btn ajax-post add-submit" value="确认添加" title="" target-form="base_info" style="cursor: pointer;">
<a class="back_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();">返回</a>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
</block>
<block name="script">
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<link href="__STATIC__/uploadifive/uploadifive.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__STATIC__/uploadifive/jquery.uploadifive.min.js"></script>
<script type="text/javascript">
$('#imgFile').uploadifive({
'fileObjName':'file',
'removeCompleted' : true,
'formData' : {},
'buttonText' : '上传',
'uploadScript' : '/index.php?s=/Qrcode/QrCodePromotion/uploadQrCodeBackground',
'multi' : false,
'onUploadComplete' : function(file, data) {
var res = eval('(' + data + ')');
var src = res.path;
$('#img').html('<img src=' + src + ' width="40%" height="40%"/>')
$('#images').val(res.path);
}
});
$('.add-submit').on({
click: function() {
var id = $("#id").val();
var img = $('#images').val();
if (!img) {
return layer.msg('背景图不能为空')
}
$.ajax({
url: '{:U("edit")}',
type: 'post',
dataType: 'json',
data: { id: id, img: img },
success: function(result) {
if (result.status == 1) {
layer.msg(result.message)
setTimeout(function() {
window.location.href = "{:U('QrCodePromotion/lists')}";
}, 200)
} else {
layer.msg(result.message)
}
}
})
}
})
$(".select_gallery").select2();
function validation(){
var json_data = "";
if($('#account').val()==""){
return json_data = {'status':0,'msg':'子渠道账号不能为空'}
}
// if($.trim($('#account').val()).length < 6){
// return json_data = {'status':0,'msg':'子渠道账号不能小于6位字符'}
// }
if($.trim($('#account').val()).length < 6 || $.trim($('#account').val()).length > 15){
return json_data = {'status':0,'msg':'子渠道账号长度为6-15位字符'}
}
if ($.trim($('#real_name').val()) != '') {
if($.trim($('#real_name').val()).length < 2 || $.trim($('#real_name').val()).length > 4){
return json_data = {'status':0,'msg':'子渠道姓名长度为2-4位字符'}
}
}
if($('#password').val()==""){
return json_data = {'status':0,'msg':'子渠道密码不能为空'}
}
if($.trim($('#password').val()).length < 6){
return json_data = {'status':0,'msg':'子渠道密码不能小于6位字符'}
}
if($('#repassword').val()==""){
return json_data = {'status':0,'msg':'确认密码不能为空'}
}
if($('#repassword').val()!==$('#password').val()){
return json_data = {'status':0,'msg':'子渠道密码和确认密码不一致'}
}
var promote_type = parseInt($('[name=promote_type]').val());
if ((promote_type == 0 || promote_type == 1) && $.trim($('#group_remark').val()) == '') {
if (promote_type == 0) {
return json_data = {'status':0,'msg':'请输入部门名称'}
}
if (promote_type == 1) {
return json_data = {'status':0,'msg':'请输入小组名称'}
}
}
var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
// if(!myreg.test($('#mobile_phone').val())){
// return json_data = {'status':0,'msg':'请输入正确的手机号'}
// }
// var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
// if(!myreg.test($('#email').val())){
// return json_data = {'status':0,'msg':'请输入正确的邮箱'}
// }
// if($.trim($('#nickname').val()).length == 0){
// return json_data = {'status':0,'msg':'昵称不能为空'};
// }
return json_data = {'status':1,'msg':'成功'};
}
</script>
</block>

@ -0,0 +1,107 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/account.css" rel="stylesheet" >
</block>
<block name="body">
<div class="page-list normal_list promote-add_chlid-form">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>管理中心></span><span>添加{$promoteTypeName}</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_ziqudao.png">
<span class="title_main">添加{$promoteTypeName}</span>
</div>
<div class="trunk-content article">
<div class="trunk-list list_normal">
<form action="{:U('Promote/linkAdd')}" novalidate="novalidate" method="post" class="base_info" id="form_link_add">
<table class="table2">
<tr>
<td class="l"><span class="req">*</span>轮播二维码间隔时间(分钟):</td>
<td class="r">
<input id="id" name="id" value="{$id}" type="hidden" />
<input id="interval_min" type="text" name="interval_min" value="{$interval_min}" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^0-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^0-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}">
</td>
</tr>
<tr>
<td class="l"></td>
<td class="r">
<input type="button" class="tj btn ajax-post add-submit" value="确认修改" title="" target-form="base_info" style="cursor: pointer;">
<a class="back_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();">返回</a>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
</block>
<block name="script">
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<link href="__STATIC__/uploadifive/uploadifive.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__STATIC__/uploadifive/jquery.uploadifive.min.js"></script>
<script type="text/javascript">
var imgIndex = 0;
$('#imgFile').uploadifive({
'fileObjName':'file',
'removeCompleted' : true,
'formData' : {},
'buttonText' : '上传',
'uploadScript' : '/index.php?s=/Qrcode/QrCodePromotion/uploadQrCodeBackground',
'multi' : true,
'onUploadComplete' : function(file, data) {
var res = eval('(' + data + ')');
var src = res.path;
$('#img').append('<img src=' + src + ' width="150px" height="150px"/>');
$('#img').append('<input class="images" name="img['+ imgIndex +']" type="hidden" value="'+ src +'">');
imgIndex = imgIndex + 1;
// $('#img').html('<img src=' + src + ' width="40%" height="40%"/>')
// $('#images').val(arr);
}
});
function insertAfter(newElement, targentElement) {
var parent = targentElement.parentNode;
if (parent.lastChild == targentElement) {
parent.appendChild(newElement);
} else {
parent.insertBefore(newElement, targentElement.nextSibling)
}
}
$('.add-submit').on({
click: function() {
var imgs = $("#form_link_add").serialize();
if (!imgs) {
return layer.msg('二维码不能为空')
}
$.ajax({
url: '{:U("linkEdit")}',
type: 'post',
dataType: 'json',
data: imgs,
success: function(result) {
if (result.status == 1) {
layer.msg(result.message)
setTimeout(function() {
window.location.href = "{:U('QrCodePromotion/linkLists', ['id' => $qp_id])}";
}, 200)
} else {
layer.msg(result.message)
}
}
})
}
})
</script>
</block>
Loading…
Cancel
Save