test_service d3170b4d1c 1
2023-12-01 15:43:29 +08:00

153 lines
7.3 KiB
HTML
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="row-content am-cf">
<div class="row">
<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
<div class="widget am-cf">
<div class="widget-head am-cf">
<div class="widget-title am-cf">二维码规则列表</div>
</div>
{if $user['applet']['status']['value'] == 1}
<div class="widget-body am-fr">
{if $list['errcode']==0}
<div class="tips am-margin-bottom-sm am-u-sm-12">
<div class="pre-warning">
<p>规则数量:{$list['total_count']},本月还可发布{$list['qrcodejump_pub_quota']}次</p>
</div>
</div>
{/if}
<div class="am-u-sm-12 am-u-md-6 am-u-lg-6 am-cf">
<div class="am-form-group">
<div class="am-btn-toolbar">
<div class="am-btn-group am-btn-group-sm">
<a href="javascript:void(0);" class="hema-add am-btn am-btn-primary am-radius">
<span class="am-icon-plus"></span> 添加
</a>
</div>
</div>
</div>
</div>
<div class="am-form-group am-fr">
<a href="https://www.kancloud.cn/he_ma/hema_wechat/3169821" target="_blank">
<i class="am-icon-question-circle am-warning"></i> 帮助文档
</a>
</div>
<div class="am-u-sm-12">
<table width="100%" class="am-table am-table-hover tpl-table-black">
<thead>
<tr>
<th>二维码规则</th>
<th>跳转页面</th>
<th>使用范围</th>
<th>发布状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{if $list['errcode']==0 AND sizeof($list['rule_list'])>0}
{foreach $list['rule_list'] as $item}
<tr>
<td class="am-text-middle">{$item['prefix']}</td>
<td class="am-text-middle">{$item['path']}</td>
<td class="am-text-middle">
{$item['open_version']==1?'开发版':''}
{$item['open_version']==2?'体验版':''}
{$item['open_version']==3?'正式版':''}
</td>
<td class="am-text-middle">
<span class="am-badge
{$item['state'] == 1 ? ' am-badge-warning j-status' : ''}
{$item['state'] == 2 ? ' am-badge-success' : ''}"
data-id="{$item['prefix']}">
{$item['state']==1?'未发布':''}
{$item['state']==2?'已发布':''}
</span>
</td>
<td class="am-text-middle">
<div class="tpl-table-black-operation">
<a href="javascript:;" class="hema-edit"
data-prefix="{$item['prefix']}"
data-path="{$item['path']}"
data-open_version="{$item['open_version']}">
<i class="am-icon-pencil"></i> 编辑
</a>
<a href="javascript:;" class="hema-del tpl-table-black-operation-del"
data-id="{$item['prefix']}">
<i class="am-icon-trash"></i> 删除
</a>
</div>
</td>
</tr>
{/foreach}
{else /}
<tr>
<td colspan="5" class="am-text-center">
{$list['errcode'] == 0 ? '暂无记录' : 'code'.$list['errcode'].'msg'.$list['errmsg']}
</td>
</tr>
{/if}
</tbody>
</table>
</div>
</div>
{else /}
<div class="tips am-margin-bottom-sm am-u-sm-12">
<div class="pre-error">
{$user['applet']['app_id'] == '' ?'未授权绑定小程序':'非授权模式,无操作权限'}
</div>
</div>
{/if}
</div>
</div>
</div>
</div>
{include file="wxapp/qrcode/add" /}
{include file="wxapp/qrcode/edit" /}
<script>
$(function () {
//添加
$('.hema-add').on('click', function () {
let model = {prefix:'{$prefix}'};
$.showAction({
title: '添加二维码规则',
area: '750px',
content: template('tpl-add', {model:model}),
uCheck: true,
success: function ($content) {
$('#my-form').formPost({
url: "{:url('wxapp.qrcode/add')}"
});
},
btn2: function ($content) {
return true;
}
});
});
//编辑
$('.hema-edit').on('click', function () {
var data = $(this).data();
$.showAction({
title: '编辑二维码规则',
area: '750px',
content: template('tpl-edit', {model:data}),
uCheck: true,
success: function ($content) {
$('#my-form').formPost({
url: "{:url('wxapp.qrcode/edit')}"
});
},
btn2: function ($content) {
return true;
}
});
});
// 切换上架状态
$('.j-status').click(function () {
var data = $(this).data();
var msg = '确定要进行发布操作?';
var url = "{:url('wxapp.qrcode/status')}";
$('.j-status').del('id', url,msg);
});
// 删除元素
var url = "{:url('wxapp.qrcode/delete')}";
$('.hema-del').del('id', url);
});
</script>