新增意见反馈、反馈历史 H5 页(去框 + 接 /api/v1/feedback,真机对齐)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
@@ -0,0 +1,335 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<link rel="stylesheet" href="../shared/fonts.css">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
|
||||||
|
<title>意见反馈 · 傻瓜比价</title>
|
||||||
|
<style>
|
||||||
|
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
|
||||||
|
html, body { height: 100%; overflow: hidden; }
|
||||||
|
/* 【去框】原型 body 黑底 + flex 居中(浏览器预览用)。WebView 里直接铺页面色、不居中。 */
|
||||||
|
body {
|
||||||
|
font-family: 'PuHuiTi', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
|
||||||
|
background: #F5F5F5;
|
||||||
|
color: #1A1A1A;
|
||||||
|
}
|
||||||
|
/* 【去框】原型 .device 是 375x812 预览框(圆角+阴影+固定宽高)→ 全屏自适应容器。 */
|
||||||
|
.device { position: relative; width: 100%; height: 100%; background: #F5F5F5; overflow: hidden; }
|
||||||
|
|
||||||
|
/* 意见反馈屏:灰底白卡(原型 #feedback background #F5F5F5) */
|
||||||
|
#feedback { position: absolute; inset: 0; display: flex; flex-direction: column; background: #F5F5F5; }
|
||||||
|
|
||||||
|
/* header —— 返回 | 标题 | 反馈历史(原型 .header space-between;去框后顶部内距由 40 改 10,状态栏交给原生) */
|
||||||
|
.header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 12px; background: #F5F5F5; flex-shrink: 0; position: relative; }
|
||||||
|
.btn-back { background: none; border: none; cursor: pointer; padding: 0; display: flex; align-items: center; }
|
||||||
|
.btn-back svg { width: 24px; height: 24px; display: block; }
|
||||||
|
.btn-back:active { opacity: .5; }
|
||||||
|
.header-title { position: absolute; left: 50%; transform: translateX(-50%); font-size: 17px; font-weight: 600; line-height: 1.4; color: #1A1A1A; }
|
||||||
|
.fb-history-entry { background: none; border: none; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 400; color: #666666; padding: 6px 0; white-space: nowrap; transition: opacity .15s; }
|
||||||
|
.fb-history-entry:active { opacity: .6; }
|
||||||
|
|
||||||
|
/* body —— 滚动区,确定按钮 margin-top:auto 贴底 */
|
||||||
|
.fb-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 16px 0; display: flex; flex-direction: column; gap: 16px; }
|
||||||
|
.fb-body::-webkit-scrollbar { display: none; }
|
||||||
|
.fb-card { background: #FFFFFF; border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
|
||||||
|
|
||||||
|
/* 顶部引导文案 + 奖励 chip */
|
||||||
|
.fb-intro { margin: -4px 2px 0; }
|
||||||
|
.fb-intro-text { font-size: 13px; font-weight: 400; line-height: 1.6; color: #666666; margin: 0; }
|
||||||
|
.fb-intro-reward { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; padding: 5px 10px; background: #FFF8E1; border-radius: 8px; font-size: 12px; font-weight: 600; color: #7A4F00; }
|
||||||
|
.fb-intro-reward .coin { width: 14px; height: 14px; display: block; flex-shrink: 0; }
|
||||||
|
|
||||||
|
.fb-section-label { font-size: 14px; font-weight: 400; line-height: 1.5; color: #1A1A1A; margin: 4px 0 8px; }
|
||||||
|
.fb-section-label .req { color: #E02E24; margin-left: 2px; }
|
||||||
|
.fb-section-label .count { color: #999999; font-weight: 400; font-size: 13px; margin-left: 4px; }
|
||||||
|
|
||||||
|
.fb-textarea { width: 100%; min-height: 140px; background: #FFFFFF; border: none; border-radius: 14px; padding: 14px 16px; font-size: 14px; font-weight: 400; color: #1A1A1A; line-height: 1.5; resize: none; outline: none; font-family: inherit; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
|
||||||
|
.fb-textarea::placeholder { color: #CCCCCC; font-weight: 400; }
|
||||||
|
|
||||||
|
.fb-upload-row { display: flex; flex-wrap: wrap; gap: 10px; }
|
||||||
|
.fb-upload-tile { width: 72px; height: 72px; background: #FFFFFF; border-radius: 14px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
|
||||||
|
.fb-thumb { position: relative; width: 72px; height: 72px; border-radius: 14px; overflow: hidden; flex-shrink: 0; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
|
||||||
|
.fb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
||||||
|
.fb-thumb-del { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.55); color: #FFFFFF; border: none; font-size: 13px; line-height: 1; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
|
||||||
|
|
||||||
|
/* 加群二维码卡 */
|
||||||
|
.fb-qr-card { display: flex; gap: 14px; align-items: center; padding: 14px; margin-top: 8px; }
|
||||||
|
.fb-qr { width: 88px; height: 88px; background: #FFFFFF; border-radius: 8px; flex-shrink: 0; display: block; border: 1px solid #F0F0F0; overflow: hidden; }
|
||||||
|
.fb-qr svg, .fb-qr img { width: 100%; height: 100%; display: block; }
|
||||||
|
.fb-qr img { object-fit: cover; }
|
||||||
|
.fb-qr-text { font-size: 13px; font-weight: 400; line-height: 1.6; color: #1A1A1A; }
|
||||||
|
.fb-qr-text .quote { font-weight: 600; }
|
||||||
|
|
||||||
|
/* 确定按钮(DESIGN cta-primary:17/700 + radius 24 + 黄渐变 + 高光 + 暖阴影) */
|
||||||
|
.fb-submit { width: 100%; border: none; padding: 14px 28px; border-radius: 24px; font-size: 17px; font-weight: 700; line-height: 1; font-family: inherit; background: linear-gradient(180deg, #FFE066 0%, #FFC400 100%); color: #1A1A1A; box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 2px 6px rgba(255,179,0,.35); cursor: not-allowed; opacity: .45; transition: opacity .15s; }
|
||||||
|
.fb-submit.active { opacity: 1; cursor: pointer; }
|
||||||
|
.fb-submit:disabled { cursor: not-allowed; }
|
||||||
|
.fb-submit-bar { flex-shrink: 0; padding: 8px 16px 16px; background: #F5F5F5; }
|
||||||
|
|
||||||
|
/* 居中 toast */
|
||||||
|
.toast { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.82); color: #fff; font-size: 14px; padding: 10px 18px; border-radius: 10px; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 70%; text-align: center; line-height: 1.5; }
|
||||||
|
.toast.show { opacity: 1; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="device" id="app">
|
||||||
|
<div class="screen active" id="feedback">
|
||||||
|
<div class="header">
|
||||||
|
<button class="btn-back" onclick="goBack()" aria-label="返回">
|
||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M15 6L9 12L15 18" stroke="#1A1A1A" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||||
|
</button>
|
||||||
|
<span class="header-title">意见反馈</span>
|
||||||
|
<button class="fb-history-entry" onclick="goHistory()" aria-label="反馈历史">反馈历史</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="fb-body">
|
||||||
|
<div class="fb-intro">
|
||||||
|
<p class="fb-intro-text">您的建议和问题我们都会认真查看,评价越真实详细,金币奖励越高,感谢您帮我们做得更好~</p>
|
||||||
|
<div class="fb-intro-reward">
|
||||||
|
<img class="coin" src="assets/welfare/index/checkin-coin-single.png" alt="" aria-hidden="true">
|
||||||
|
反馈采纳后,即得金币奖励
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="fb-section-label">问题和意见<span class="req">*</span></div>
|
||||||
|
<textarea class="fb-textarea" id="fbContent" inputmode="text" maxlength="200" placeholder="说说您的建议或问题,以便我们提供更好的服务(15个字以上)"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="fb-section-label">上传截图<span class="count" id="fbUpCount">(0/6)</span></div>
|
||||||
|
<div class="fb-upload-row" id="fbUpRow">
|
||||||
|
<div class="fb-upload-tile" id="fbAddTile" role="button" aria-label="上传截图" onclick="document.getElementById('fbFileInput').click()">
|
||||||
|
<svg width="26" height="26" viewBox="0 0 24 24" fill="none"><path d="M12 5V19M5 12H19" stroke="#CCCCCC" stroke-width="2" stroke-linecap="round"/></svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input type="file" id="fbFileInput" accept="image/*" multiple style="display: none;">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="fb-card fb-qr-card" id="fbQrCard" style="display: none;">
|
||||||
|
<div class="fb-qr" id="fbQrSlot">
|
||||||
|
<svg viewBox="0 0 88 88" xmlns="http://www.w3.org/2000/svg" aria-label="二维码">
|
||||||
|
<rect width="88" height="88" fill="#FFFFFF"/>
|
||||||
|
<g fill="#1A1A1A">
|
||||||
|
<rect x="6" y="6" width="20" height="20"/><rect x="9" y="9" width="14" height="14" fill="#FFFFFF"/><rect x="12" y="12" width="8" height="8"/>
|
||||||
|
<rect x="62" y="6" width="20" height="20"/><rect x="65" y="9" width="14" height="14" fill="#FFFFFF"/><rect x="68" y="12" width="8" height="8"/>
|
||||||
|
<rect x="6" y="62" width="20" height="20"/><rect x="9" y="65" width="14" height="14" fill="#FFFFFF"/><rect x="12" y="68" width="8" height="8"/>
|
||||||
|
<rect x="30" y="6" width="3" height="3"/><rect x="36" y="6" width="3" height="3"/><rect x="42" y="6" width="3" height="3"/><rect x="51" y="6" width="3" height="3"/><rect x="57" y="6" width="3" height="3"/>
|
||||||
|
<rect x="30" y="12" width="3" height="3"/><rect x="39" y="12" width="3" height="3"/><rect x="48" y="12" width="3" height="3"/><rect x="54" y="12" width="3" height="3"/>
|
||||||
|
<rect x="33" y="18" width="3" height="3"/><rect x="42" y="18" width="3" height="3"/><rect x="51" y="18" width="3" height="3"/><rect x="57" y="18" width="3" height="3"/>
|
||||||
|
<rect x="30" y="24" width="3" height="3"/><rect x="36" y="24" width="3" height="3"/><rect x="45" y="24" width="3" height="3"/><rect x="54" y="24" width="3" height="3"/>
|
||||||
|
<rect x="6" y="30" width="3" height="3"/><rect x="15" y="30" width="3" height="3"/><rect x="24" y="30" width="3" height="3"/><rect x="33" y="30" width="3" height="3"/><rect x="42" y="30" width="3" height="3"/><rect x="48" y="30" width="3" height="3"/><rect x="60" y="30" width="3" height="3"/><rect x="69" y="30" width="3" height="3"/><rect x="78" y="30" width="3" height="3"/>
|
||||||
|
<rect x="9" y="36" width="3" height="3"/><rect x="18" y="36" width="3" height="3"/><rect x="27" y="36" width="3" height="3"/><rect x="39" y="36" width="3" height="3"/><rect x="51" y="36" width="3" height="3"/><rect x="63" y="36" width="3" height="3"/><rect x="72" y="36" width="3" height="3"/>
|
||||||
|
<rect x="6" y="42" width="3" height="3"/><rect x="12" y="42" width="3" height="3"/><rect x="21" y="42" width="3" height="3"/><rect x="30" y="42" width="3" height="3"/><rect x="36" y="42" width="3" height="3"/><rect x="45" y="42" width="3" height="3"/><rect x="54" y="42" width="3" height="3"/><rect x="66" y="42" width="3" height="3"/><rect x="75" y="42" width="3" height="3"/>
|
||||||
|
<rect x="15" y="48" width="3" height="3"/><rect x="24" y="48" width="3" height="3"/><rect x="33" y="48" width="3" height="3"/><rect x="42" y="48" width="3" height="3"/><rect x="51" y="48" width="3" height="3"/><rect x="60" y="48" width="3" height="3"/><rect x="69" y="48" width="3" height="3"/><rect x="78" y="48" width="3" height="3"/>
|
||||||
|
<rect x="9" y="54" width="3" height="3"/><rect x="18" y="54" width="3" height="3"/><rect x="30" y="54" width="3" height="3"/><rect x="39" y="54" width="3" height="3"/><rect x="48" y="54" width="3" height="3"/><rect x="57" y="54" width="3" height="3"/><rect x="66" y="54" width="3" height="3"/><rect x="75" y="54" width="3" height="3"/>
|
||||||
|
<rect x="33" y="60" width="3" height="3"/><rect x="42" y="60" width="3" height="3"/><rect x="51" y="60" width="3" height="3"/><rect x="60" y="60" width="3" height="3"/><rect x="72" y="60" width="3" height="3"/>
|
||||||
|
<rect x="30" y="66" width="3" height="3"/><rect x="39" y="66" width="3" height="3"/><rect x="48" y="66" width="3" height="3"/><rect x="57" y="66" width="3" height="3"/><rect x="69" y="66" width="3" height="3"/><rect x="78" y="66" width="3" height="3"/>
|
||||||
|
<rect x="33" y="72" width="3" height="3"/><rect x="45" y="72" width="3" height="3"/><rect x="54" y="72" width="3" height="3"/><rect x="63" y="72" width="3" height="3"/><rect x="75" y="72" width="3" height="3"/>
|
||||||
|
<rect x="36" y="78" width="3" height="3"/><rect x="42" y="78" width="3" height="3"/><rect x="48" y="78" width="3" height="3"/><rect x="57" y="78" width="3" height="3"/><rect x="66" y="78" width="3" height="3"/><rect x="72" y="78" width="3" height="3"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div class="fb-qr-text">
|
||||||
|
<div id="fbQrTitle">长按图片保存二维码</div>
|
||||||
|
<div>直通<span class="quote" id="fbQrGroup">「傻瓜比价官方群」</span></div>
|
||||||
|
<div id="fbQrSub">一起唠嗑共创、解锁新玩法</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="fb-submit-bar">
|
||||||
|
<button class="fb-submit" id="fbSubmit" disabled>确定</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="toast" id="toast"></div>
|
||||||
|
|
||||||
|
<script src="../shared/bridge.js"></script>
|
||||||
|
<script src="../shared/api.js"></script>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
var content = document.getElementById('fbContent');
|
||||||
|
var submit = document.getElementById('fbSubmit');
|
||||||
|
var fileInput = document.getElementById('fbFileInput');
|
||||||
|
var row = document.getElementById('fbUpRow');
|
||||||
|
var addTile = document.getElementById('fbAddTile');
|
||||||
|
var countEl = document.getElementById('fbUpCount');
|
||||||
|
var toastEl = document.getElementById('toast');
|
||||||
|
if (!content || !submit) return;
|
||||||
|
|
||||||
|
var MAX_IMG = 6;
|
||||||
|
var files = []; // 已选 File 对象(提交时压缩后 multipart 上传)
|
||||||
|
var urls = []; // 与 files 对应的 objectURL(缩略图预览,删除时回收)
|
||||||
|
var submitting = false;
|
||||||
|
var toastTimer = null;
|
||||||
|
|
||||||
|
function showToast(msg) {
|
||||||
|
toastEl.textContent = msg;
|
||||||
|
toastEl.classList.add('show');
|
||||||
|
if (toastTimer) clearTimeout(toastTimer);
|
||||||
|
toastTimer = setTimeout(function () { toastEl.classList.remove('show'); }, 1600);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确定按钮:正文非空即可点(文案虽提示「15个字以上」但不强制下限,对齐原型 sync)
|
||||||
|
function sync() {
|
||||||
|
var ok = content.value.trim().length >= 1 && !submitting;
|
||||||
|
submit.classList.toggle('active', ok);
|
||||||
|
submit.disabled = !ok;
|
||||||
|
}
|
||||||
|
content.addEventListener('input', sync);
|
||||||
|
|
||||||
|
// 渲染已选截图缩略图(末尾保留「+」继续上传 tile)
|
||||||
|
function renderShots() {
|
||||||
|
row.querySelectorAll('.fb-thumb').forEach(function (t) { t.remove(); });
|
||||||
|
files.forEach(function (f, i) {
|
||||||
|
var thumb = document.createElement('div');
|
||||||
|
thumb.className = 'fb-thumb';
|
||||||
|
var img = document.createElement('img');
|
||||||
|
img.src = urls[i]; img.alt = '截图' + (i + 1);
|
||||||
|
var del = document.createElement('button');
|
||||||
|
del.className = 'fb-thumb-del'; del.type = 'button';
|
||||||
|
del.setAttribute('aria-label', '删除'); del.textContent = '×';
|
||||||
|
del.onclick = function () {
|
||||||
|
try { URL.revokeObjectURL(urls[i]); } catch (e) {}
|
||||||
|
files.splice(i, 1); urls.splice(i, 1); renderShots();
|
||||||
|
};
|
||||||
|
thumb.appendChild(img); thumb.appendChild(del);
|
||||||
|
row.insertBefore(thumb, addTile);
|
||||||
|
});
|
||||||
|
if (countEl) countEl.textContent = '(' + files.length + '/' + MAX_IMG + ')';
|
||||||
|
addTile.style.display = files.length >= MAX_IMG ? 'none' : 'flex';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点「+」→ 系统相册多选 → 回填缩略图,最多 6 张
|
||||||
|
if (fileInput) {
|
||||||
|
fileInput.addEventListener('change', function () {
|
||||||
|
Array.prototype.slice.call(fileInput.files || []).forEach(function (f) {
|
||||||
|
if (files.length >= MAX_IMG) return;
|
||||||
|
if (!/^image\//.test(f.type)) return;
|
||||||
|
files.push(f);
|
||||||
|
urls.push(URL.createObjectURL(f));
|
||||||
|
});
|
||||||
|
renderShots();
|
||||||
|
fileInput.value = ''; // 允许重复选择同一张
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交前逐张压缩(长边 ≤1600,jpeg .85);解码失败兜底原 file
|
||||||
|
function compressImage(file) {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
try {
|
||||||
|
var url = URL.createObjectURL(file);
|
||||||
|
var img = new Image();
|
||||||
|
img.onload = function () {
|
||||||
|
try {
|
||||||
|
var max = 1600, w = img.width, h = img.height;
|
||||||
|
if (w > max || h > max) { var s = Math.min(max / w, max / h); w = Math.round(w * s); h = Math.round(h * s); }
|
||||||
|
var canvas = document.createElement('canvas');
|
||||||
|
canvas.width = w; canvas.height = h;
|
||||||
|
canvas.getContext('2d').drawImage(img, 0, 0, w, h);
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
canvas.toBlob(function (blob) { resolve(blob || file); }, 'image/jpeg', 0.85);
|
||||||
|
} catch (e) { URL.revokeObjectURL(url); resolve(file); }
|
||||||
|
};
|
||||||
|
img.onerror = function () { URL.revokeObjectURL(url); resolve(file); };
|
||||||
|
img.src = url;
|
||||||
|
} catch (e) { resolve(file); }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加群二维码卡:接 /feedback/config(运营可配开关+图+三行文案)
|
||||||
|
function renderQr(cfg) {
|
||||||
|
var card = document.getElementById('fbQrCard');
|
||||||
|
// 明确关闭才隐藏;未拉到(null)按默认渲染,避免空白闪烁(对齐原生 QrCard)
|
||||||
|
if (cfg && cfg.enabled === false) { card.style.display = 'none'; return; }
|
||||||
|
card.style.display = 'flex';
|
||||||
|
var title = (cfg && cfg.title) || '长按图片保存二维码';
|
||||||
|
var group = (cfg && cfg.group_name) || '傻瓜比价官方群';
|
||||||
|
var sub = (cfg && cfg.subtitle) || '一起唠嗑共创、解锁新玩法';
|
||||||
|
document.getElementById('fbQrTitle').textContent = title;
|
||||||
|
document.getElementById('fbQrGroup').textContent = '「' + group + '」';
|
||||||
|
document.getElementById('fbQrSub').textContent = sub;
|
||||||
|
var imgUrl = cfg && cfg.image_url;
|
||||||
|
if (imgUrl) {
|
||||||
|
var slot = document.getElementById('fbQrSlot');
|
||||||
|
if (slot) {
|
||||||
|
var el = document.createElement('div');
|
||||||
|
el.className = 'fb-qr'; el.id = 'fbQrSlot';
|
||||||
|
var im = document.createElement('img');
|
||||||
|
im.src = imgUrl; im.alt = '官方群二维码';
|
||||||
|
el.appendChild(im);
|
||||||
|
slot.parentNode.replaceChild(el, slot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
renderQr(null); // 先按默认渲染
|
||||||
|
if (window.SGApi) { SGApi.get('/feedback/config').then(renderQr).catch(function () {}); }
|
||||||
|
|
||||||
|
// 提交反馈:真接 POST /api/v1/feedback(multipart:content + 逐张 images)
|
||||||
|
function submitFeedback() {
|
||||||
|
if (submit.disabled || submitting) return;
|
||||||
|
var text = content.value.trim();
|
||||||
|
if (!text) { showToast('请填写问题和意见'); return; }
|
||||||
|
|
||||||
|
var hasBridge = window.SGBridge && SGBridge.hasNative && typeof SGBridge.getToken === 'function';
|
||||||
|
if (!hasBridge) { // 浏览器预览(无原生桥):不真发
|
||||||
|
console.log('[stub] submitFeedback(浏览器预览,无 Bridge,不真发)', { content: text, images: files.length });
|
||||||
|
showToast('感谢您的反馈');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
submitting = true; sync();
|
||||||
|
var oldText = submit.textContent; submit.textContent = '提交中…';
|
||||||
|
(async function () {
|
||||||
|
try {
|
||||||
|
var token = SGBridge.getToken();
|
||||||
|
var blobs = [];
|
||||||
|
for (var i = 0; i < files.length; i++) { blobs.push(await compressImage(files[i])); }
|
||||||
|
var fd = new FormData();
|
||||||
|
fd.append('content', text);
|
||||||
|
blobs.forEach(function (b, i) { fd.append('images', b, 'fb_' + (i + 1) + '.jpg'); });
|
||||||
|
// 只放 Authorization,不手动设 Content-Type(让浏览器自动带 multipart boundary)
|
||||||
|
var res = await fetch('/api/v1/feedback', { method: 'POST', headers: { 'Authorization': 'Bearer ' + token }, body: fd });
|
||||||
|
if (res.ok) {
|
||||||
|
// 成功:页内居中 toast 显示后再 closePage 回我的(native 未实现 SGBridge.toast,故不走原生 toast)
|
||||||
|
showToast('感谢您的反馈');
|
||||||
|
setTimeout(function () { if (window.SGBridge && SGBridge.closePage) SGBridge.closePage(); }, 1200);
|
||||||
|
return; // 保持按钮禁用,等页面关闭,避免重复提交
|
||||||
|
} else if (res.status === 401) {
|
||||||
|
if (SGBridge.requestLogin) SGBridge.requestLogin();
|
||||||
|
showToast('请先登录');
|
||||||
|
} else {
|
||||||
|
var detail = '';
|
||||||
|
try { var j = await res.json(); detail = (j && j.detail) ? j.detail : ''; } catch (e) {}
|
||||||
|
showToast(detail || ('提交失败(' + res.status + '),请稍后再试'));
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
showToast('网络异常,提交失败');
|
||||||
|
}
|
||||||
|
// 失败兜底:恢复按钮,允许重试(成功分支已 return,不会走到这)
|
||||||
|
submitting = false; submit.textContent = oldText; sync();
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
submit.addEventListener('click', submitFeedback);
|
||||||
|
|
||||||
|
sync();
|
||||||
|
|
||||||
|
// 顶栏返回 / 反馈历史入口
|
||||||
|
window.goBack = function () {
|
||||||
|
if (window.SGBridge && SGBridge.closePage) { SGBridge.closePage(); }
|
||||||
|
else if (history.length > 1) { history.back(); }
|
||||||
|
};
|
||||||
|
window.goHistory = function () {
|
||||||
|
if (window.SGBridge && SGBridge.navigate) { SGBridge.navigate('feedbackHistory'); }
|
||||||
|
else { console.log('[nav] feedbackHistory'); }
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
@@ -0,0 +1,266 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<link rel="stylesheet" href="../shared/fonts.css">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
|
||||||
|
<title>反馈历史 · 傻瓜比价</title>
|
||||||
|
<style>
|
||||||
|
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--color-primary: #FFD600;
|
||||||
|
--color-on-primary: #1A1A1A;
|
||||||
|
--color-surface-page: #F5F5F5;
|
||||||
|
--color-surface-card: #FFFFFF;
|
||||||
|
--color-surface-muted: #FAFAFA;
|
||||||
|
--color-ink: #1A1A1A;
|
||||||
|
--color-ink-muted: #666666;
|
||||||
|
--color-ink-subtle: #999999;
|
||||||
|
--color-ink-disabled: #CCCCCC;
|
||||||
|
--color-divider: #F0F0F0;
|
||||||
|
--color-divider-strong: #E5E5E5;
|
||||||
|
--color-state-success-dark: #2E7D32;
|
||||||
|
--color-state-success-bg: #E8F5E9;
|
||||||
|
--color-state-warning-bg: #FFF3E0;
|
||||||
|
--color-state-warning-ink: #B57400;
|
||||||
|
--color-state-danger: #E53935;
|
||||||
|
--color-state-danger-bg: #FFEBEE;
|
||||||
|
--color-coin-deep: #5A3A00;
|
||||||
|
--radius: 14px;
|
||||||
|
--radius-sm: 10px;
|
||||||
|
--radius-pill: 999px;
|
||||||
|
--shadow-card: 0 1px 2px rgba(0,0,0,.03);
|
||||||
|
--font-num: 'DIN Alternate', 'DIN Pro', 'SF Pro Display', system-ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body { height: 100%; }
|
||||||
|
/* 【去框】原型 body 黑底 + flex 居中(浏览器预览用)→ 铺页面色、不居中。 */
|
||||||
|
body {
|
||||||
|
font-family: 'PuHuiTi', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
|
||||||
|
background: var(--color-surface-page);
|
||||||
|
color: var(--color-ink);
|
||||||
|
}
|
||||||
|
/* 【去框】原型 .device 375x812 预览框 → 全屏自适应容器。 */
|
||||||
|
.device { position: relative; width: 100%; height: 100%; min-height: 100vh; background: var(--color-surface-page); overflow: hidden; }
|
||||||
|
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
|
||||||
|
|
||||||
|
/* 隐藏原型假状态栏(顶部状态栏交给原生) */
|
||||||
|
.statusbar { display: none; }
|
||||||
|
|
||||||
|
.topnav { height: 44px; display: flex; align-items: center; padding: 0 12px; background: var(--color-surface-page); flex-shrink: 0; position: relative; }
|
||||||
|
.topnav-back { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: none; border: none; padding: 0; }
|
||||||
|
.topnav-back:active { opacity: .5; }
|
||||||
|
.topnav-title { position: absolute; left: 50%; transform: translateX(-50%); font-size: 17px; font-weight: 600; color: var(--color-ink); }
|
||||||
|
|
||||||
|
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 14px calc(24px + env(safe-area-inset-bottom, 0px)); }
|
||||||
|
.scroll::-webkit-scrollbar { display: none; }
|
||||||
|
|
||||||
|
/* === 顶部汇总:反馈采纳累计奖励 === */
|
||||||
|
.fb-summary { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, #FFF3CC 0%, #FFE9A8 100%); border-radius: var(--radius); padding: 14px 16px; margin: 4px 0 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 8px rgba(255,179,0,.18); }
|
||||||
|
.fb-summary-label { font-size: 12px; font-weight: 400; color: var(--color-coin-deep); opacity: .8; }
|
||||||
|
.fb-summary-num { font-family: var(--font-num); font-size: 28px; font-weight: 700; color: var(--color-coin-deep); line-height: 1.2; margin-top: 2px; }
|
||||||
|
.fb-summary-num .unit { font-family: 'PuHuiTi', -apple-system, 'PingFang SC', sans-serif; font-size: 13px; font-weight: 600; margin-left: 4px; }
|
||||||
|
.fb-summary-sub { font-size: 11px; font-weight: 400; color: var(--color-coin-deep); opacity: .7; margin-top: 4px; }
|
||||||
|
.fb-summary-coin { width: 52px; height: 52px; flex-shrink: 0; }
|
||||||
|
|
||||||
|
.filter-row { display: flex; gap: 8px; padding: 0 0 12px; overflow-x: auto; }
|
||||||
|
.filter-row::-webkit-scrollbar { display: none; }
|
||||||
|
.filter-chip { flex-shrink: 0; padding: 6px 14px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 400; color: var(--color-ink-muted); background: var(--color-surface-card); border: .5px solid var(--color-divider-strong); cursor: pointer; }
|
||||||
|
.filter-chip.active { background: var(--color-ink); color: #fff; font-weight: 600; border-color: var(--color-ink); }
|
||||||
|
.filter-chip .count { margin-left: 4px; opacity: .7; font-weight: 400; }
|
||||||
|
|
||||||
|
.rec-card { background: var(--color-surface-card); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-card); overflow: hidden; }
|
||||||
|
.rec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
|
||||||
|
.fb-headtext { flex: 1; min-width: 0; }
|
||||||
|
.fb-type-row { display: flex; align-items: center; gap: 8px; }
|
||||||
|
.fb-date { font-size: 12px; font-weight: 400; color: var(--color-ink-subtle); font-family: var(--font-num); }
|
||||||
|
.fb-content { font-size: 14px; font-weight: 400; color: var(--color-ink); line-height: 1.6; margin-top: 8px; word-break: break-word; }
|
||||||
|
|
||||||
|
/* 截图缩略 */
|
||||||
|
.fb-shots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
|
||||||
|
.fb-shot { width: 48px; height: 48px; border-radius: 8px; background: var(--color-divider); border: .5px solid var(--color-divider-strong); overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
|
||||||
|
.fb-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
||||||
|
|
||||||
|
.badge { flex-shrink: 0; display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
|
||||||
|
.badge svg { width: 12px; height: 12px; }
|
||||||
|
.badge-pending { background: var(--color-state-warning-bg); color: var(--color-state-warning-ink); }
|
||||||
|
.badge-success { background: var(--color-state-success-bg); color: var(--color-state-success-dark); }
|
||||||
|
.badge-danger { background: var(--color-state-danger-bg); color: var(--color-state-danger); }
|
||||||
|
|
||||||
|
/* 已采纳:金币奖励条 */
|
||||||
|
.rec-reward { margin-top: 12px; background: linear-gradient(90deg, #FFF8E1 0%, #FFFDE7 100%); border-radius: var(--radius-sm); padding: 8px 12px; display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--color-coin-deep); font-weight: 400; }
|
||||||
|
.rec-reward img { width: 16px; height: 16px; margin-right: 2px; }
|
||||||
|
.rec-reward-num { font-family: var(--font-num); font-size: 15px; font-weight: 700; }
|
||||||
|
|
||||||
|
/* 审核中:进度提示 */
|
||||||
|
.fb-pending-note { margin-top: 12px; background: var(--color-surface-muted); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px; color: var(--color-ink-subtle); line-height: 1.5; }
|
||||||
|
|
||||||
|
/* 未采纳:原因 */
|
||||||
|
.rec-reject { margin-top: 12px; background: var(--color-state-danger-bg); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; color: var(--color-state-danger); line-height: 1.5; }
|
||||||
|
.rec-reject b { font-weight: 600; }
|
||||||
|
|
||||||
|
.list-end { text-align: center; padding: 24px 0 8px; font-size: 12px; color: var(--color-ink-disabled); font-weight: 400; }
|
||||||
|
.list-empty { text-align: center; padding: 56px 0; font-size: 13px; color: var(--color-ink-subtle); }
|
||||||
|
|
||||||
|
/* === 空态:无任何反馈记录 === */
|
||||||
|
.empty-wrap { flex: 1; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 40px 80px; }
|
||||||
|
.empty-icon { width: 96px; height: 96px; border-radius: 50%; background: var(--color-divider); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
|
||||||
|
.empty-icon svg { width: 44px; height: 44px; }
|
||||||
|
.empty-title { font-size: 17px; font-weight: 600; color: var(--color-ink); margin-bottom: 8px; }
|
||||||
|
.empty-sub { font-size: 13px; font-weight: 400; color: var(--color-ink-subtle); line-height: 1.6; margin-bottom: 28px; }
|
||||||
|
.empty-cta { border: none; cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 700; color: var(--color-on-primary); padding: 0 32px; height: 44px; border-radius: 24px; background: linear-gradient(180deg, #FFE066 0%, #FFD600 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 6px 18px rgba(255,179,0,.35); transition: transform .12s ease, opacity .15s ease; }
|
||||||
|
.empty-cta:active { transform: translateY(1px); opacity: .9; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="device" id="app">
|
||||||
|
<div class="screen active" id="feedbackHistory">
|
||||||
|
<div class="topnav">
|
||||||
|
<button class="topnav-back" onclick="goBack()" aria-label="返回">
|
||||||
|
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#1A1A1A" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 18l-6-6 6-6"/></svg>
|
||||||
|
</button>
|
||||||
|
<div class="topnav-title">反馈历史</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="scroll" id="fbhScroll">
|
||||||
|
<div class="fb-summary" id="fbhSummary" style="display: none;">
|
||||||
|
<div>
|
||||||
|
<div class="fb-summary-label">反馈采纳累计奖励</div>
|
||||||
|
<div class="fb-summary-num"><span id="fbhCoinSum">0</span><span class="unit">金币</span></div>
|
||||||
|
<div class="fb-summary-sub">已采纳 <span id="fbhAdoptCount">0</span> 条 · 反馈越真实详细,奖励越高</div>
|
||||||
|
</div>
|
||||||
|
<img class="fb-summary-coin" src="assets/welfare/index/checkin-coin-single.png" alt="">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="filter-row">
|
||||||
|
<div class="filter-chip active" data-st="all">全部<span class="count" id="fbhCntAll">0</span></div>
|
||||||
|
<div class="filter-chip" data-st="pending">审核中<span class="count" id="fbhCntPending">0</span></div>
|
||||||
|
<div class="filter-chip" data-st="adopted">已采纳<span class="count" id="fbhCntAdopted">0</span></div>
|
||||||
|
<div class="filter-chip" data-st="rejected">未采纳<span class="count" id="fbhCntRejected">0</span></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="fbhList"></div>
|
||||||
|
<div class="list-end" id="fbhListEnd" style="display: none;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="empty-wrap" id="fbhEmpty">
|
||||||
|
<div class="empty-icon">
|
||||||
|
<svg viewBox="0 0 24 24" fill="none" stroke="#B3B3B3" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/><path d="M8.5 11h.01M12 11h.01M15.5 11h.01"/></svg>
|
||||||
|
</div>
|
||||||
|
<div class="empty-title">还没有反馈记录</div>
|
||||||
|
<div class="empty-sub">你的每条建议我们都会认真查看<br>被采纳还能领金币奖励</div>
|
||||||
|
<button class="empty-cta" onclick="goBack()">去反馈</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="../shared/bridge.js"></script>
|
||||||
|
<script src="../shared/api.js"></script>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
var scroll = document.getElementById('fbhScroll');
|
||||||
|
var listEl = document.getElementById('fbhList');
|
||||||
|
var emptyEl = document.getElementById('fbhEmpty');
|
||||||
|
var summaryEl = document.getElementById('fbhSummary');
|
||||||
|
var listEnd = document.getElementById('fbhListEnd');
|
||||||
|
var RECORDS = [], COUNTS = { all: 0, pending: 0, adopted: 0, rejected: 0 };
|
||||||
|
var filter = 'all';
|
||||||
|
|
||||||
|
function esc(s) { return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]; }); }
|
||||||
|
// created_at 取前 10 位(YYYY-MM-DD),避免时区换算偏移
|
||||||
|
function fmtDate(iso) { var s = String(iso || ''); return s.length >= 10 ? s.slice(0, 10) : s; }
|
||||||
|
|
||||||
|
var COIN = 'assets/welfare/index/checkin-coin-single.png';
|
||||||
|
var BADGE = {
|
||||||
|
pending: { cls: 'badge-pending', text: '审核中', icon: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg>' },
|
||||||
|
adopted: { cls: 'badge-success', text: '已采纳', icon: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5l4.5 4.5L19 7"/></svg>' },
|
||||||
|
rejected: { cls: 'badge-danger', text: '未采纳', icon: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M9 9l6 6M15 9l-6 6"/></svg>' }
|
||||||
|
};
|
||||||
|
|
||||||
|
function cardHtml(rec) {
|
||||||
|
var st = BADGE[rec.status] || BADGE.pending;
|
||||||
|
var shots = '';
|
||||||
|
if (rec.images && rec.images.length) {
|
||||||
|
shots = '<div class="fb-shots">' + rec.images.map(function (u) { return '<div class="fb-shot"><img src="' + esc(u) + '" alt=""></div>'; }).join('') + '</div>';
|
||||||
|
}
|
||||||
|
var extra = '';
|
||||||
|
if (rec.status === 'adopted') {
|
||||||
|
extra = '<div class="rec-reward"><img src="' + COIN + '" alt=""><span>+</span><span class="rec-reward-num">' + (rec.reward_coins || 0) + '</span><span>金币已到账</span></div>';
|
||||||
|
} else if (rec.status === 'rejected') {
|
||||||
|
extra = '<div class="rec-reject"><b>未采纳原因:</b>' + esc(rec.reject_reason || '经评估,本次反馈暂未采纳。') + '</div>';
|
||||||
|
} else {
|
||||||
|
extra = '<div class="fb-pending-note">我们正在认真查看,预计 5 个工作日内完成审核,采纳后金币自动到账。</div>';
|
||||||
|
}
|
||||||
|
return '<div class="rec-card"><div class="rec-head"><div class="fb-headtext"><div class="fb-type-row"><span class="fb-date">' + esc(fmtDate(rec.created_at)) + '</span></div><div class="fb-content">' + esc(rec.content) + '</div></div><span class="badge ' + st.cls + '">' + st.icon + st.text + '</span></div>' + shots + extra + '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
function currentList() { return filter === 'all' ? RECORDS : RECORDS.filter(function (r) { return r.status === filter; }); }
|
||||||
|
|
||||||
|
// 汇总卡:当前筛选视图里有「已采纳」≥1 才显示(对齐原型 refreshSummary)
|
||||||
|
function refreshSummary(view) {
|
||||||
|
var adopted = view.filter(function (r) { return r.status === 'adopted'; });
|
||||||
|
if (!adopted.length) { summaryEl.style.display = 'none'; return; }
|
||||||
|
summaryEl.style.display = 'flex';
|
||||||
|
var sum = adopted.reduce(function (s, r) { return s + (r.reward_coins || 0); }, 0);
|
||||||
|
document.getElementById('fbhCoinSum').textContent = sum.toLocaleString('en-US');
|
||||||
|
document.getElementById('fbhAdoptCount').textContent = adopted.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
// chip 计数:用后端全量 counts(固定,不随筛选变)
|
||||||
|
function renderCounts() {
|
||||||
|
document.getElementById('fbhCntAll').textContent = COUNTS.all || 0;
|
||||||
|
document.getElementById('fbhCntPending').textContent = COUNTS.pending || 0;
|
||||||
|
document.getElementById('fbhCntAdopted').textContent = COUNTS.adopted || 0;
|
||||||
|
document.getElementById('fbhCntRejected').textContent = COUNTS.rejected || 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function render() {
|
||||||
|
if (!RECORDS.length) { scroll.style.display = 'none'; emptyEl.style.display = 'flex'; return; }
|
||||||
|
emptyEl.style.display = 'none'; scroll.style.display = '';
|
||||||
|
var view = currentList();
|
||||||
|
if (!view.length) {
|
||||||
|
listEl.innerHTML = '<div class="list-empty">暂无该状态的反馈</div>';
|
||||||
|
listEnd.style.display = 'none';
|
||||||
|
} else {
|
||||||
|
listEl.innerHTML = view.map(cardHtml).join('');
|
||||||
|
listEnd.style.display = '';
|
||||||
|
listEnd.textContent = '— 已显示全部 ' + view.length + ' 条 —';
|
||||||
|
}
|
||||||
|
refreshSummary(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
Array.prototype.slice.call(document.querySelectorAll('.filter-chip')).forEach(function (chip) {
|
||||||
|
chip.addEventListener('click', function () {
|
||||||
|
document.querySelectorAll('.filter-chip').forEach(function (c) { c.classList.remove('active'); });
|
||||||
|
chip.classList.add('active');
|
||||||
|
filter = chip.getAttribute('data-st') || 'all';
|
||||||
|
render();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
async function load() {
|
||||||
|
var data = null;
|
||||||
|
try { if (window.SGApi) data = await SGApi.get('/feedback/records'); } catch (e) {}
|
||||||
|
if (data) { RECORDS = data.records || []; COUNTS = data.counts || COUNTS; }
|
||||||
|
else { RECORDS = []; }
|
||||||
|
renderCounts();
|
||||||
|
render();
|
||||||
|
}
|
||||||
|
load();
|
||||||
|
|
||||||
|
// 返回 / 「去反馈」:closePage 回意见反馈页(对齐原生 onGoFeedback = popBackStack)
|
||||||
|
window.goBack = function () {
|
||||||
|
if (window.SGBridge && SGBridge.closePage) { SGBridge.closePage(); }
|
||||||
|
else if (history.length > 1) { history.back(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
// 回前台刷新
|
||||||
|
if (window.SGBridge && SGBridge.on) { SGBridge.on('onResume', load); }
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user