|
|
|
@ -13,19 +13,25 @@
|
|
|
|
|
</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_reg">
|
|
|
|
|
<form action="{:U('Promote/linkAdd')}" novalidate="novalidate" method="post" class="base_info" id="form_link_add">
|
|
|
|
|
<table class="table2">
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<input id="qp_id" type="hidden" name="id" value="{$qp_id}">
|
|
|
|
|
<td class="l"><span class="req">*</span>推广二维码:</td>
|
|
|
|
|
<td class="r">
|
|
|
|
|
<input id="images" name="img" type="hidden" value="">
|
|
|
|
|
<span id="img"><img src="" width="40%" height="40%"/></span>
|
|
|
|
|
<span id="img"></span>
|
|
|
|
|
<input type="file" id="imgFile"/>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="l"><span class="req">*</span>轮播二维码间隔时间(分钟):</td>
|
|
|
|
|
<td class="r">
|
|
|
|
|
<input id="interval_min" type="text" name="interval_min" value="0">
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="l"></td>
|
|
|
|
|
<td class="r">
|
|
|
|
@ -46,27 +52,41 @@
|
|
|
|
|
<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' : false,
|
|
|
|
|
'multi' : true,
|
|
|
|
|
'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);
|
|
|
|
|
$('#img').append('<img src=' + src + ' width="40%" height="40%"/>');
|
|
|
|
|
$('#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 id = $("#qp_id").val();
|
|
|
|
|
var img = $('#images').val();
|
|
|
|
|
|
|
|
|
|
if (!img) {
|
|
|
|
|
var imgs = $("#form_link_add").serialize();
|
|
|
|
|
if (!imgs) {
|
|
|
|
|
return layer.msg('二维码不能为空')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -74,12 +94,12 @@
|
|
|
|
|
url: '{:U("linkAdd")}',
|
|
|
|
|
type: 'post',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
data: { id: id, img: img },
|
|
|
|
|
data: imgs,
|
|
|
|
|
success: function(result) {
|
|
|
|
|
if (result.status == 1) {
|
|
|
|
|
layer.msg(result.message)
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
window.location.href = "{:U('QrCodePromotion/linkLists')}";
|
|
|
|
|
// window.location.href = "{:U('QrCodePromotion/linkLists')}";
|
|
|
|
|
}, 200)
|
|
|
|
|
} else {
|
|
|
|
|
layer.msg(result.message)
|
|
|
|
|