test(fuc-xb): theme-plan-label-127 acceptance\n
This commit is contained in:
1 parent
6f6abdfc05
commit
824d0f4167
5 files changed
+6
-7
No files matched your search
@@ -6,7 +6,7 @@ import {copyText} from './clipboard.mjs?v=0.12.6';
|
||||
import {createCaptcha} from './captcha.mjs?v=0.12.6';
|
||||
import {showPayment,mountCard} from './payments.mjs?v=0.12.6';
|
||||
import {beginPageProgress,finishPageProgress} from './progress.mjs?v=0.12.6';
|
||||
import {nativeReady,prepareNativeMode,nativeMode,fillPurchaseModal,nativeHeader,nativeFooter,nativeDashboard,nativeHome,nativeAuth,nativeSecondary,paintNativeChart,paintNativeHome} from './native.mjs?v=0.12.6';
|
||||
import {nativeReady,prepareNativeMode,nativeMode,fillPurchaseModal,nativeHeader,nativeFooter,nativeDashboard,nativeHome,nativeAuth,nativeSecondary,paintNativeChart,paintNativeHome} from './native.mjs?v=0.12.7';
|
||||
import {escape as e, money, bytes, date, list, groupedList, periods, orderStates, soldOut, safeUrl, createApi, routeFromHash,canPurchase} from './core.mjs?v=0.12.6';
|
||||
const settings = window.fucSettings || {};
|
||||
const root = document.querySelector('#app');
|
||||
|
||||
@@ -4,7 +4,7 @@ import {escape as e,money,bytes,date,safeUrl,soldOut,trafficSummary,canPurchase,
|
||||
const base = new URL('./native/',import.meta.url).href;
|
||||
let templates = {},sourceStyles={};
|
||||
const styleReady=fetch(base+'styles.json?v=0.12.6').then(r=>r.json()).then(v=>sourceStyles=v);
|
||||
export const nativeReady = Promise.all(['footer','header','index','home','login','register','forget','reset','plans','myplan','wallet','invite','profile','tickets','ticket','servers','notices','knowledge','article','faq','orders','purchase','checkout','planlog','walletlog','afflog'].map(async name=>{const r=await fetch(`${base}${name}.html?v=0.12.6`);if(!r.ok)throw Error('原版模板加载失败');templates[name]=await r.text();})).then(()=>styleReady);
|
||||
export const nativeReady = Promise.all(['footer','header','index','home','login','register','forget','reset','plans','myplan','wallet','invite','profile','tickets','ticket','servers','notices','knowledge','article','faq','orders','purchase','checkout','planlog','walletlog','afflog'].map(async name=>{const r=await fetch(`${base}${name}.html?v=0.12.7`);if(!r.ok)throw Error('原版模板加载失败');templates[name]=await r.text();})).then(()=>styleReady);
|
||||
let nativeSwiper=null,swiperLibrary=null;
|
||||
export async function paintNativeHome(){if(!document.querySelector('.native-public .swiper-container'))return;if(!window.Swiper){if(!swiperLibrary)swiperLibrary=new Promise((resolve,reject)=>{const s=document.createElement('script');s.src=base+'assets/cool/swiper.min.js';s.onload=resolve;s.onerror=reject;document.head.append(s);});await swiperLibrary;}const el=document.querySelector('.native-public .swiper-container');if(!el)return;if(nativeSwiper){try{nativeSwiper.destroy(true,true);}catch{}}el.querySelectorAll('.swiper-slide').forEach(n=>{n.style.removeProperty('display');n.style.removeProperty('width');});el.querySelector('.swiper-wrapper')?.removeAttribute('style');nativeSwiper=new window.Swiper(el,{direction:'horizontal',loop:true,autoplay:{delay:5000,disableOnInteraction:true},navigation:{nextEl:'.swiper-button-next',prevEl:'.swiper-button-prev'}});}
|
||||
let currentMode='',currentStyleMode='',styleSequence=0,chartData=null,chartInstance=null,chartLibrary=null;
|
||||
@@ -176,7 +176,7 @@ export function nativeSecondary(name,ctx){
|
||||
const activeGroup=groups.some(g=>g.key===period)?period:groups[0]?.key;
|
||||
const tabs=[...host.querySelectorAll('.shop_tab a')];tabs.forEach((a,i)=>{const k=a.dataset.target?.replace('top-home-',''),group=groups.find(g=>g.key===k);a.querySelector('i')?.classList.remove('fa');a.querySelector('i')?.classList.add('fab');a.dataset.cycle=k;a.dataset.action='native-cycle';a.classList.toggle('active',k===activeGroup);a.setAttribute('aria-selected',String(k===activeGroup));a.querySelector('span').textContent=group?.name||'';a.id=`cycle-tab-${i}`;});
|
||||
host.querySelectorAll('.tab-pane').forEach(n=>{const active=n.id===`top-home-${activeGroup}`;n.classList.toggle('active',active);n.classList.toggle('show',active);});
|
||||
host.querySelectorAll('.pricing-card').forEach(n=>{const [id,...parts]=(n.querySelector('input[id^="product-name-"]')?.id.replace('product-name-','')||'').split('_');const plan=data.find(p=>String(p.id)===id),b=n.querySelector('button');if(!plan||!b)return;b.dataset.action='buy';b.dataset.id=id;b.dataset.period=parts.join('_');const purchasable=canPurchase(plan,user,b.dataset.period);b.textContent=purchasable?'购买':String(plan.id)===String(user.plan_id)?'不可续费':'已售罄';b.disabled=!purchasable;n.querySelector('.classify').textContent=periodLabels[b.dataset.period];if(!months[b.dataset.period])n.querySelector('.duration').textContent=periodLabels[b.dataset.period];const features=n.querySelectorAll('.pricing-content li');if(features[1]&&!months[b.dataset.period])features[1].textContent=periodLabels[b.dataset.period];if(features[2])features[2].lastElementChild.textContent=(plan.display_device_limit??plan.device_limit)||'不限制';if(features[3])features[3].lastElementChild.textContent=plan.speed_limit?plan.speed_limit+' Mbps':'不限制';if(features[4])features[4].lastElementChild.textContent=({0:'每月1号',1:'按月重置',2:'不重置',3:'每年1月1日',4:'按年重置'})[plan.reset_traffic_method]||'跟随系统设置';const stock=n.querySelector('.font-size-sm');if(stock)stock.textContent=plan.capacity_limit!=null?'库存以后端为准':'此商品无限制购买';if(plan.content){const desc=document.createElement('div');desc.innerHTML=richText(plan.content);n.querySelector('.pricing-content').after(desc);}});
|
||||
host.querySelectorAll('.pricing-card').forEach(n=>{const [id,...parts]=(n.querySelector('input[id^="product-name-"]')?.id.replace('product-name-','')||'').split('_');const plan=data.find(p=>String(p.id)===id),b=n.querySelector('button');if(!plan||!b)return;b.dataset.action='buy';b.dataset.id=id;b.dataset.period=parts.join('_');const purchasable=canPurchase(plan,user,b.dataset.period);b.textContent=purchasable?'购买':String(plan.id)===String(user.plan_id)?'不可续费':'已售罄';b.disabled=!purchasable;n.querySelector('.classify').textContent=periodLabels[b.dataset.period];const features=n.querySelectorAll('.pricing-content li');if(features[1]&&!months[b.dataset.period])features[1].textContent=periodLabels[b.dataset.period];if(features[2])features[2].lastElementChild.textContent=(plan.display_device_limit??plan.device_limit)||'不限制';if(features[3])features[3].lastElementChild.textContent=plan.speed_limit?plan.speed_limit+' Mbps':'不限制';if(features[4])features[4].lastElementChild.textContent=({0:'每月1号',1:'按月重置',2:'不重置',3:'每年1月1日',4:'按年重置'})[plan.reset_traffic_method]||'跟随系统设置';const stock=n.querySelector('.font-size-sm');if(stock)stock.textContent=plan.capacity_limit!=null?'库存以后端为准':'此商品无限制购买';if(plan.content){const desc=document.createElement('div');desc.innerHTML=richText(plan.content);n.querySelector('.pricing-content').after(desc);}});
|
||||
host.querySelector('.selling-slide')?.setAttribute('data-action','native-go-invite');
|
||||
const terms=host.querySelector('.selling-slide .badge-white');if(terms)terms.textContent='提现条件见返利页';const reward=host.querySelector('.selling-slide .right-content h2');if(reward)reward.textContent='返利收益可用于购买套餐';
|
||||
const couponButton=host.querySelector('#coupon_modal .modal-footer .btn-primary');
|
||||
|
||||
@@ -120,9 +120,8 @@
|
||||
<div class="price-value txt-primary" style="position: relative;">
|
||||
<span class="currency">¥</span>
|
||||
<span class="amount" id="product-price-__P_ID__">__P_PRICE__</span>
|
||||
<span class="duration">__P_PERIOD__</span>
|
||||
<input id="product-time-__P_ID__" hidden value="__P_PERIOD__">
|
||||
<span class="badge badge-primary classify"></span>
|
||||
<span class="badge badge-primary classify" style="position: static; margin-left: .375rem;"></span>
|
||||
</div>
|
||||
|
||||
<div class="d-flex flex-column w-100">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "Fuc",
|
||||
"description": "直接复用新版FUC原始用户模板、样式、图标及素材,接入XB接口;XB管理员后台保持原样。",
|
||||
"version": "0.12.6",
|
||||
"version": "0.12.7",
|
||||
"images": "",
|
||||
"configs": [
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>window.fucSettings = @json(['title' => ($theme_config['brand_name'] ?? '') ?: $title, 'description' => $theme_config['tagline'] ?? $description]);</script>
|
||||
<script type="module" src="/theme/{{ $theme }}/assets/app.mjs?v=0.12.6"></script>
|
||||
<script type="module" src="/theme/{{ $theme }}/assets/app.mjs?v=0.12.7"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user