删除预加载
This commit is contained in:
@@ -9,6 +9,17 @@
|
||||
<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>
|
||||
<!-- App/预览:首帧前就撑满 .device + 白底,避免原型黑 body 闪一下(原逻辑在 body 中段 JS 才注入,太晚)。
|
||||
仅 App(SGBridgeNative)或 ?wv=1 预览生效;浏览器裸开仍保留黑底手机壳。与 body 中段注入等价、只是提前。 -->
|
||||
<script>
|
||||
(function () {
|
||||
if (window.SGBridgeNative || /[?&]wv=1/.test(location.search)) {
|
||||
var s = document.createElement('style');
|
||||
s.textContent = 'html,body{background-color:#fff!important}.device{position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important;width:auto!important;height:auto!important;border-radius:0!important;box-shadow:none!important}.tab-bar{display:none!important}.prof-statusbar{display:none!important}.variant-panel{display:none!important}#debugBack{display:none!important}';
|
||||
(document.head || document.documentElement).appendChild(s);
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
|
||||
html { background: #000; }
|
||||
@@ -3562,6 +3573,31 @@ TODO: 补充 @owner / @from / @to / @notes(参照 FLOW.md)
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end profileLogged -->
|
||||
<!-- 首帧前定登录态:getAuthState() 是同步桥,已登录就先隐藏未登录态、显示已登录态,避免"未登录/立即登录"闪一下
|
||||
(原逻辑到 DOMContentLoaded 的 loadMineData 才判,太晚)。loadMineData 随后填真实数据。 -->
|
||||
<script>
|
||||
(function () {
|
||||
try {
|
||||
var raw = window.SGBridgeNative && window.SGBridgeNative.getAuthState();
|
||||
var auth = raw ? JSON.parse(raw) : null;
|
||||
if (auth && auth.loggedIn) {
|
||||
document.getElementById('profileUnlogged').style.display = 'none';
|
||||
document.getElementById('profileLogged').style.display = 'block';
|
||||
// 昵称/头像 getAuthState 首帧就有(与 loadMineData 同源),直接填,避免 mock 名/头像闪。
|
||||
var pn = document.getElementById('profName');
|
||||
if (pn && auth.nickname) { pn.textContent = auth.nickname; pn.setAttribute('data-fullname', auth.nickname); }
|
||||
if (auth.avatarUrl && /^https?:/.test(auth.avatarUrl)) {
|
||||
var av = document.querySelector('#profileLogged .prof-avatar');
|
||||
if (av) av.innerHTML = '<img src="' + auth.avatarUrl + '" style="width:100%;height:100%;border-radius:50%;object-fit:cover" onerror="this.style.display=\'none\'">';
|
||||
}
|
||||
// 统计数据要走接口:先清掉静态 mock 数值(省钱额 + 领券/比价/金币),等 loadMineData 填真值,绝不闪 mock。
|
||||
var amt = document.querySelector('#profSavingsCard .prof-amount');
|
||||
if (amt) amt.innerHTML = '';
|
||||
document.querySelectorAll('#profSavingsCard .prof-stat-num').forEach(function (n) { n.innerHTML = ''; });
|
||||
}
|
||||
} catch (e) {}
|
||||
})();
|
||||
</script>
|
||||
<div class="tab-bar">
|
||||
<div class="tab-item" onclick="go('home')"><span class="tab-icon"><svg class="i-outline" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#1a1a1a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12l9-8 9 8"></path><path d="M5 10v9a1 1 0 001 1h3v-5h6v5h3a1 1 0 001-1v-9"></path></svg><svg class="i-filled" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M3 12l9-8 9 8" stroke="#1a1a1a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M5 10v9a1 1 0 001 1h3v-5h6v5h3a1 1 0 001-1v-9" fill="#FFD600" stroke="#1a1a1a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></span><span class="tab-label">首页</span></div>
|
||||
<div class="tab-item" id="homeTabWelfare" onclick="go('welfare')"><span class="welfare-tab-dot" aria-hidden="true"></span><span class="tab-icon" id="homeTabWelfareIcon"><svg class="i-outline" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#1a1a1a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="8" width="18" height="4" rx="1"></rect><path d="M12 8v12"></path><path d="M5 12v7a1 1 0 001 1h12a1 1 0 001-1v-7"></path><path d="M7.5 8C6 8 5 6.5 6 5.5S9 4 9.5 5.5c.4 1.2 2.5 2.5 2.5 2.5s2.1-1.3 2.5-2.5C15 4 17 4.5 18 5.5s-1 2.5-2.5 2.5"></path></svg><svg class="i-filled" width="24" height="24" viewBox="0 0 24 24" fill="none"><rect x="3" y="8" width="18" height="4" rx="1" fill="#FFD600" stroke="#1a1a1a" stroke-width="2"></rect><path d="M5 12v7a1 1 0 001 1h12a1 1 0 001-1v-7" fill="#FFD600" stroke="#1a1a1a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 8v12" stroke="#1a1a1a" stroke-width="2"></path><path d="M7.5 8C6 8 5 6.5 6 5.5S9 4 9.5 5.5c.4 1.2 2.5 2.5 2.5 2.5s2.1-1.3 2.5-2.5C15 4 17 4.5 18 5.5s-1 2.5-2.5 2.5" stroke="#1a1a1a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></span><span class="tab-label">福利</span></div>
|
||||
|
||||
Reference in New Issue
Block a user