推广二维码按时间轮播

master
tping 3 years ago
parent 35af729ded
commit b25d363396

@ -220,6 +220,30 @@ class QrCodePromotionController extends BaseController
$this->display();
}
public function linkEdit()
{
$id = I('request.id', 0);
if (!$id) return ;
if (IS_POST) {
M('qrcode_promotion_list', 'tab_')->where([
"id" => $id
])->save([
'interval_min' => I('post.interval_min')
]);
$this->ajaxReturn(['status' => 1, 'message' => '保存成功!']);
}
$qrcodePromotionList = M('qrcode_promotion_list', 'tab_')->where([
"id" => $id
])->find();
$this->assign('id', $id);
$this->assign('qp_id', $qrcodePromotionList['qp_id']);
$this->assign('interval_min', $qrcodePromotionList['interval_min']);
$this->display();
}
public function linkDel()
{
$id = I('request.id', 0);

@ -53,7 +53,6 @@
<div class="header">
<if condition="$company['marketing_director_show'] eq 1">
<div style="position: absolute;padding-left: 1.5%;">
<span class="pinfo" style="color: #1239f2">市场总监联系方式:<span>13637338237(李总监)</span></span>
</div>
</if>
<div class="header-right">

@ -28,7 +28,7 @@
<tr>
<td class="l"><span class="req">*</span>轮播二维码间隔时间(分钟):</td>
<td class="r">
<input id="interval_min" type="text" name="interval_min" value="0">
<input id="interval_min" type="text" name="interval_min" value="0" 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>
@ -63,7 +63,7 @@
'onUploadComplete' : function(file, data) {
var res = eval('(' + data + ')');
var src = res.path;
$('#img').append('<img src=' + src + ' width="40%" height="40%"/>');
$('#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%"/>')
@ -99,7 +99,7 @@
if (result.status == 1) {
layer.msg(result.message)
setTimeout(function() {
// window.location.href = "{:U('QrCodePromotion/linkLists')}";
window.location.href = "{:U('QrCodePromotion/linkLists', ['id' => $qp_id])}";
}, 200)
} else {
layer.msg(result.message)

@ -23,7 +23,7 @@
<th>推广链接短地址</th>
<th>添加人员</th>
<th>添加时间</th>
<th>二维码</th>
<!-- <th>二维码</th>-->
<th>操作</th>
</tr>
<empty name="records">
@ -36,9 +36,10 @@
<td>{$record.short_link}</td>
<td>{$record.admin_name}</td>
<td>{$record.create_time|date='Y-m-d H:i:s', ###}</td>
<td><img src="{$record.qrcode_img}" style="height: 100px;"/></td>
<!-- <td><img src="{$record.qrcode_img}" style="height: 100px;"/></td>-->
<td>
<div class="partakebtn">
<a class="edit-btn" data-id="{$record.id}" href="{:U('QrCodePromotion/linkEdit', ['id' => $record['id']])}">编辑</a>
<a class="delete-btn" data-id="{$record.id}" href="#">删除</a>
</div>
</td>
@ -100,7 +101,6 @@ $(function(){
$(".delete-btn").click(function() {
if (confirm("确认删除吗?")) {
var id = $(this).data('id');
alert(id);
$.ajax({
type: 'post',
dataType: 'json',

Loading…
Cancel
Save