517 行
18 KiB
HTML
517 行
18 KiB
HTML
<style>
|
|
.ag-tabs {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 4px;
|
|
}
|
|
.ag-tabs > li > a {
|
|
font-weight: 600;
|
|
color: #4b5563;
|
|
}
|
|
.ag-tabs > li.active > a {
|
|
color: #f0710d !important;
|
|
}
|
|
.ag-tab-badge {
|
|
display: inline-block;
|
|
margin-left: 6px;
|
|
padding: 1px 6px;
|
|
border-radius: 10px;
|
|
font-size: 11px;
|
|
font-weight: 500;
|
|
background: #fff7ed;
|
|
color: #ea580c;
|
|
border: 1px solid #fed7aa;
|
|
}
|
|
.ag-tab-badge.is-hidden {
|
|
background: #f3f4f6;
|
|
color: #6b7280;
|
|
border-color: #d1d5db;
|
|
}
|
|
|
|
.ag-meta-banner {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
padding: 10px 14px;
|
|
margin-bottom: 16px;
|
|
background: #f8fafc;
|
|
border: 1px solid #e2e8f0;
|
|
border-left: 3px solid #f0710d;
|
|
border-radius: 6px;
|
|
font-size: 13px;
|
|
color: #475569;
|
|
}
|
|
.ag-meta-time {
|
|
font-size: 12px;
|
|
color: #64748b;
|
|
}
|
|
.ag-dirty-pill {
|
|
display: none;
|
|
padding: 2px 8px;
|
|
border-radius: 10px;
|
|
font-size: 11px;
|
|
background: #fef3c7;
|
|
color: #b45309;
|
|
font-weight: 600;
|
|
margin-left: 8px;
|
|
}
|
|
.ag-dirty-pill.is-visible {
|
|
display: inline-block;
|
|
}
|
|
|
|
.ag-editor-wrap {
|
|
border: 1px solid #d2d6de;
|
|
border-radius: 6px;
|
|
overflow: hidden;
|
|
background: #ffffff;
|
|
transition: border-color 0.15s ease;
|
|
}
|
|
.ag-editor-wrap:focus-within {
|
|
border-color: #f0710d;
|
|
}
|
|
.ag-toolbar {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 6px;
|
|
padding: 8px 10px;
|
|
background: #f8fafc;
|
|
border-bottom: 1px solid #e2e8f0;
|
|
}
|
|
.ag-tool-groups {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
.ag-tool-sep {
|
|
width: 1px;
|
|
height: 18px;
|
|
background: #cbd5e1;
|
|
margin: 0 4px;
|
|
}
|
|
.ag-tool-btn {
|
|
height: 28px;
|
|
padding: 0 9px;
|
|
border: 1px solid #e2e8f0;
|
|
border-radius: 4px;
|
|
background: #ffffff;
|
|
color: #334155;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
line-height: 26px;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
}
|
|
.ag-tool-btn:hover {
|
|
background: #fff7ed;
|
|
border-color: #fdba74;
|
|
color: #ea580c;
|
|
}
|
|
.ag-tool-btn.is-active {
|
|
background: #f0710d;
|
|
border-color: #f0710d;
|
|
color: #ffffff;
|
|
}
|
|
|
|
.ag-editor-surface {
|
|
min-height: 430px;
|
|
max-height: 600px;
|
|
overflow-y: auto;
|
|
padding: 16px 18px;
|
|
font-size: 14px;
|
|
line-height: 1.75;
|
|
color: #334155;
|
|
outline: none;
|
|
background: #ffffff;
|
|
}
|
|
.ag-editor-surface h2 {
|
|
font-size: 17px;
|
|
font-weight: 700;
|
|
color: #1f1f1f;
|
|
margin: 18px 0 10px;
|
|
}
|
|
.ag-editor-surface h3 {
|
|
font-size: 15px;
|
|
font-weight: 700;
|
|
color: #1f1f1f;
|
|
margin: 14px 0 8px;
|
|
}
|
|
.ag-editor-surface p {
|
|
margin: 0 0 10px;
|
|
}
|
|
.ag-editor-surface ul,
|
|
.ag-editor-surface ol {
|
|
padding-left: 22px;
|
|
margin: 8px 0 12px;
|
|
}
|
|
.ag-editor-surface blockquote {
|
|
margin: 10px 0;
|
|
padding: 10px 14px;
|
|
background: #fff7f0;
|
|
border-left: 3px solid #f0710d;
|
|
color: #444444;
|
|
font-size: 13.5px;
|
|
border-radius: 0 4px 4px 0;
|
|
}
|
|
.ag-source-textarea {
|
|
min-height: 430px;
|
|
max-height: 600px;
|
|
border: none !important;
|
|
border-radius: 0 !important;
|
|
font-family: Consolas, Monaco, "Courier New", monospace;
|
|
font-size: 13px;
|
|
line-height: 1.6;
|
|
resize: vertical;
|
|
padding: 14px;
|
|
}
|
|
|
|
.ag-submit-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
margin-top: 18px;
|
|
padding-top: 16px;
|
|
border-top: 1px solid #eef0f3;
|
|
}
|
|
.ag-btn-primary {
|
|
background: #f0710d;
|
|
border-color: #f0710d;
|
|
color: #ffffff;
|
|
}
|
|
.ag-btn-primary:hover,
|
|
.ag-btn-primary:focus {
|
|
background: #d96207;
|
|
border-color: #d96207;
|
|
color: #ffffff;
|
|
}
|
|
|
|
/* 右侧小程序实时预览模拟框 */
|
|
.ag-preview-card {
|
|
background: #f5f6f8;
|
|
border: 1px solid #e2e8f0;
|
|
border-radius: 12px;
|
|
padding: 14px;
|
|
}
|
|
.ag-preview-caption {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
flex-wrap: wrap;
|
|
gap: 6px;
|
|
margin-bottom: 10px;
|
|
font-size: 12.5px;
|
|
font-weight: 600;
|
|
color: #475569;
|
|
}
|
|
.ag-preview-mode-group {
|
|
display: inline-flex;
|
|
border: 1px solid #cbd5e1;
|
|
border-radius: 6px;
|
|
overflow: hidden;
|
|
background: #ffffff;
|
|
}
|
|
.ag-preview-mode-btn {
|
|
border: none;
|
|
background: transparent;
|
|
padding: 3px 10px;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
color: #64748b;
|
|
cursor: pointer;
|
|
}
|
|
.ag-preview-mode-btn.is-active {
|
|
background: #fff7ed;
|
|
color: #f0710d;
|
|
font-weight: 600;
|
|
}
|
|
.ag-phone-diff-tip {
|
|
display: none;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 8px 10px;
|
|
margin-bottom: 10px;
|
|
background: #fff7f0;
|
|
border: 1px solid #fed7aa;
|
|
border-radius: 8px;
|
|
font-size: 12px;
|
|
color: #9a3412;
|
|
line-height: 1.5;
|
|
}
|
|
.ag-phone-diff-tip.is-visible {
|
|
display: flex;
|
|
}
|
|
.ag-phone-diff-swatch {
|
|
display: inline-block;
|
|
width: 12px;
|
|
height: 12px;
|
|
border-radius: 3px;
|
|
background: #ffe2b0;
|
|
border: 1px solid #fdba74;
|
|
flex-shrink: 0;
|
|
}
|
|
.ag-phone-frame {
|
|
background: #f5f6f8;
|
|
border: 1px solid #cbd5e1;
|
|
border-radius: 16px;
|
|
overflow: hidden;
|
|
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
|
|
}
|
|
.ag-phone-topbar {
|
|
height: 44px;
|
|
background: #ffffff;
|
|
border-bottom: 1px solid #f0f0f2;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
position: relative;
|
|
padding: 0 44px;
|
|
}
|
|
.ag-phone-back {
|
|
position: absolute;
|
|
left: 14px;
|
|
color: #1f1f1f;
|
|
font-size: 15px;
|
|
}
|
|
.ag-phone-nav-title {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: #1f1f1f;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
.ag-phone-body {
|
|
height: 540px;
|
|
overflow-y: auto;
|
|
padding: 12px;
|
|
}
|
|
.ag-phone-doc-head {
|
|
background: #ffffff;
|
|
border-radius: 10px;
|
|
padding: 14px;
|
|
margin-bottom: 10px;
|
|
}
|
|
.ag-phone-doc-title {
|
|
font-size: 17px;
|
|
font-weight: 700;
|
|
color: #1f1f1f;
|
|
line-height: 1.4;
|
|
margin-bottom: 8px;
|
|
}
|
|
.ag-phone-doc-meta {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
gap: 8px;
|
|
font-size: 12px;
|
|
color: #888888;
|
|
}
|
|
.ag-phone-ver-pill {
|
|
background: #fff7f0;
|
|
color: #f0710d;
|
|
border: 1px solid rgba(240, 113, 13, 0.24);
|
|
padding: 1px 8px;
|
|
border-radius: 999px;
|
|
font-weight: 600;
|
|
font-size: 11px;
|
|
}
|
|
.ag-phone-doc-content {
|
|
background: #ffffff;
|
|
border-radius: 10px;
|
|
padding: 14px;
|
|
font-size: 13.5px;
|
|
line-height: 1.75;
|
|
color: #444444;
|
|
word-break: break-word;
|
|
}
|
|
.ag-phone-doc-content h2 {
|
|
font-size: 16px;
|
|
font-weight: 700;
|
|
color: #1f1f1f;
|
|
margin: 14px 0 8px;
|
|
}
|
|
.ag-phone-doc-content h3 {
|
|
font-size: 14.5px;
|
|
font-weight: 700;
|
|
color: #1f1f1f;
|
|
margin: 12px 0 6px;
|
|
}
|
|
.ag-phone-doc-content h2:first-child,
|
|
.ag-phone-doc-content h3:first-child {
|
|
margin-top: 0;
|
|
}
|
|
.ag-phone-doc-content p {
|
|
margin: 0 0 10px;
|
|
}
|
|
.ag-phone-doc-content ul,
|
|
.ag-phone-doc-content ol {
|
|
padding-left: 18px;
|
|
margin: 6px 0 10px;
|
|
}
|
|
.ag-phone-doc-content blockquote {
|
|
margin: 10px 0;
|
|
padding: 8px 12px;
|
|
background: #fff7f0;
|
|
border-left: 3px solid #f0710d;
|
|
color: #444444;
|
|
font-size: 13px;
|
|
}
|
|
</style>
|
|
|
|
<div class="panel panel-default panel-intro">
|
|
<div class="panel-heading">
|
|
{:build_heading(null, FALSE)}
|
|
<ul class="nav nav-tabs ag-tabs" id="ag-tabs">
|
|
{foreach $agreements as $idx => $ag}
|
|
<li class="{$idx === 0 ? 'active' : ''}" data-code="{$ag.code|htmlentities}">
|
|
<a href="javascript:;" class="js-ag-tab" data-code="{$ag.code|htmlentities}">
|
|
<i class="fa fa-file-text-o"></i> {$ag.tab_name|htmlentities}
|
|
{if $ag.status === 'hidden'}
|
|
<span class="ag-tab-badge is-hidden">已停用</span>
|
|
{/if}
|
|
</a>
|
|
</li>
|
|
{/foreach}
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
<div class="row">
|
|
<!-- 左侧编辑表单 -->
|
|
<div class="col-xs-12 col-md-7">
|
|
<div class="ag-meta-banner">
|
|
<div>
|
|
<i class="fa fa-info-circle text-warning"></i>
|
|
<span id="ag-scene-desc"></span>
|
|
<span id="ag-dirty-pill" class="ag-dirty-pill">有未保存修改</span>
|
|
</div>
|
|
<div class="ag-meta-time">
|
|
编码:<code id="ag-code-label"></code> · 修订 #<span id="ag-revision-num">1</span> · 最近更新:<span id="ag-update-time"></span>
|
|
</div>
|
|
</div>
|
|
|
|
<form id="agreement-form" class="form-horizontal" role="form" method="POST" action="{:url('agreement/save')}">
|
|
{:token()}
|
|
<input type="hidden" id="ag-input-code" name="code" value="">
|
|
|
|
<div class="form-group">
|
|
<label class="control-label col-xs-12 col-sm-2">协议标题:</label>
|
|
<div class="col-xs-12 col-sm-10">
|
|
<input type="text" id="ag-input-title" name="row[title]" maxlength="100" class="form-control" placeholder="请输入协议展示标题,如:优匠优服用户服务协议" {if !$canSave}readonly{/if}>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="control-label col-xs-12 col-sm-2">版本与日期:</label>
|
|
<div class="col-xs-6 col-sm-4">
|
|
<div class="input-group">
|
|
<span class="input-group-addon">版本</span>
|
|
<input type="text" id="ag-input-version" name="row[version]" maxlength="32" class="form-control" placeholder="如 v1.0" {if !$canSave}readonly{/if}>
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-6 col-sm-6">
|
|
<div class="input-group">
|
|
<span class="input-group-addon">生效日期</span>
|
|
<input type="date" id="ag-input-effective" name="row[effective_date]" class="form-control" {if !$canSave}readonly{/if}>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group" id="ag-status-group">
|
|
<label class="control-label col-xs-12 col-sm-2">展示状态:</label>
|
|
<div class="col-xs-12 col-sm-10">
|
|
<div class="radio">
|
|
<label><input type="radio" name="row[status]" value="normal" {if !$canSave}disabled{/if}> 正常展示</label>
|
|
<label style="margin-left:16px;"><input type="radio" name="row[status]" value="hidden" id="ag-status-hidden" {if !$canSave}disabled{/if}> 暂不展示</label>
|
|
</div>
|
|
<span class="help-block" id="ag-core-tip" style="margin:4px 0 0;font-size:12px;color:#64748b;"></span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="control-label col-xs-12 col-sm-2">协议正文:</label>
|
|
<div class="col-xs-12 col-sm-10">
|
|
<div class="ag-editor-wrap">
|
|
<div class="ag-toolbar">
|
|
<div class="ag-tool-groups" id="ag-toolbar-btns">
|
|
<button type="button" class="ag-tool-btn js-cmd" data-cmd="formatBlock" data-val="H2" title="一级章节标题">章节 H2</button>
|
|
<button type="button" class="ag-tool-btn js-cmd" data-cmd="formatBlock" data-val="H3" title="二级小节标题">小节 H3</button>
|
|
<button type="button" class="ag-tool-btn js-cmd" data-cmd="formatBlock" data-val="P" title="正文段落">正文</button>
|
|
<span class="ag-tool-sep"></span>
|
|
<button type="button" class="ag-tool-btn js-cmd" data-cmd="bold" title="加粗"><i class="fa fa-bold"></i></button>
|
|
<button type="button" class="ag-tool-btn js-cmd" data-cmd="italic" title="斜体"><i class="fa fa-italic"></i></button>
|
|
<button type="button" class="ag-tool-btn js-cmd" data-cmd="underline" title="下划线"><i class="fa fa-underline"></i></button>
|
|
<span class="ag-tool-sep"></span>
|
|
<button type="button" class="ag-tool-btn js-cmd" data-cmd="insertUnorderedList" title="无序列表"><i class="fa fa-list-ul"></i></button>
|
|
<button type="button" class="ag-tool-btn js-cmd" data-cmd="insertOrderedList" title="有序列表"><i class="fa fa-list-ol"></i></button>
|
|
<button type="button" class="ag-tool-btn js-cmd" data-cmd="formatBlock" data-val="BLOCKQUOTE" title="重点提示框"><i class="fa fa-quote-left"></i> 提示框</button>
|
|
<button type="button" class="ag-tool-btn js-cmd" data-cmd="insertHorizontalRule" title="分割线">—</button>
|
|
<span class="ag-tool-sep"></span>
|
|
<button type="button" class="ag-tool-btn js-cmd" data-cmd="removeFormat" title="清除格式"><i class="fa fa-eraser"></i></button>
|
|
</div>
|
|
<button type="button" class="ag-tool-btn" id="ag-toggle-source"><i class="fa fa-code"></i> HTML 源码</button>
|
|
</div>
|
|
|
|
<div id="ag-visual-editor" class="ag-editor-surface" contenteditable="{if $canSave}true{else}false{/if}"></div>
|
|
<textarea id="ag-source-editor" name="row[content]" class="form-control ag-source-textarea hidden" {if !$canSave}readonly{/if}></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{if $canSave}
|
|
<div class="ag-submit-bar">
|
|
<div class="col-sm-offset-2 col-sm-10" style="padding-left:0;">
|
|
<button type="submit" id="ag-submit-btn" class="btn ag-btn-primary">
|
|
<i class="fa fa-save"></i> 保存并发布生效
|
|
</button>
|
|
<button type="button" id="ag-reset-btn" class="btn btn-default" style="margin-left:8px;">
|
|
<i class="fa fa-undo"></i> 撤销当前修改
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
</form>
|
|
</div>
|
|
|
|
<!-- 右侧小程序独立页实时预览 -->
|
|
<div class="col-xs-12 col-md-5">
|
|
<div class="ag-preview-card">
|
|
<div class="ag-preview-caption">
|
|
<span><i class="fa fa-mobile fa-lg"></i> 小程序独立页面实时预览</span>
|
|
<div class="ag-preview-mode-group hidden" id="ag-preview-mode-group">
|
|
<button type="button" class="ag-preview-mode-btn is-active js-preview-mode" data-mode="normal">标准正文</button>
|
|
<button type="button" class="ag-preview-mode-btn js-preview-mode" data-mode="diff">首看变更高亮</button>
|
|
</div>
|
|
</div>
|
|
<div class="ag-phone-frame">
|
|
<div class="ag-phone-topbar">
|
|
<span class="ag-phone-back"><i class="fa fa-angle-left"></i></span>
|
|
<span class="ag-phone-nav-title" id="ag-preview-nav-title">协议详情</span>
|
|
</div>
|
|
<div class="ag-phone-body">
|
|
<div class="ag-phone-doc-head">
|
|
<div class="ag-phone-doc-title" id="ag-preview-title"></div>
|
|
<div class="ag-phone-doc-meta">
|
|
<span class="ag-phone-ver-pill" id="ag-preview-version"></span>
|
|
<span id="ag-preview-effective"></span>
|
|
</div>
|
|
</div>
|
|
<div class="ag-phone-diff-tip" id="ag-preview-diff-tip">
|
|
<span class="ag-phone-diff-swatch"></span>
|
|
<span id="ag-preview-diff-tip-text">条款已更新,浅橙色背景为本次调整内容(仅用户首次查看时标注)</span>
|
|
</div>
|
|
<div class="ag-phone-doc-content" id="ag-preview-content"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script id="agreements-initial-data" type="application/json">{$agreementsJson}</script>
|