const fs = require('fs'); const path = require('path'); const CSS_DIR = path.join(__dirname, '../common/style/memberInfo/pages'); const STYLE_PREFIX = '@/common/style/memberInfo/pages'; const PAGES = { booking: { cssFile: 'booking-pixso.css', pageCssFile: 'booking-page.css', rootClass: 'Pixso-frame-2_964', backFrameClass: 'Pixso-frame-2_969', extraData: `, activeTab: 'ongoing'`, extraMethods: `, switchTab(tab) { this.activeTab = tab }, cancelBooking() { uni.showModal({ title: '取消预约', content: '确定要取消该预约吗?', success: (res) => { if (res.confirm) { uni.showToast({ title: '已取消', icon: 'success' }) } } }) }` }, memberCard: { cssFile: 'member-card-pixso.css', pageCssFile: 'member-card-page.css', rootClass: 'Pixso-frame-2_877', backFrameClass: 'Pixso-frame-2_882', extraData: `, activeFilter: 'all'`, extraMethods: `, switchFilter(filter) { this.activeFilter = filter }, renewCard() { uni.showToast({ title: '续费功能开发中', icon: 'none' }) }` }, userInfo: { cssFile: 'user-info-pixso.css', pageCssFile: 'user-info-page.css', rootClass: 'Pixso-frame-2_791', backFrameClass: 'Pixso-frame-2_796', navWrapperClass: 'stroke-wrapper-2_795', navContentClass: 'frame-content-2_795', navTitleClass: 'Pixso-paragraph-2_799', saveFrameClass: 'Pixso-frame-2_800', extraData: `, name: '张小芳', phone: '138****6789', gender: 'female', birthday: '1995年06月15日', height: '165', weight: '63.5', fitnessGoals: ['增肌']`, extraMethods: `, handleSave() { uni.showToast({ title: '保存成功', icon: 'success' }) }, changeAvatar() { uni.showToast({ title: '更换头像功能开发中', icon: 'none' }) }, rebindPhone() { uni.showToast({ title: '换绑功能开发中', icon: 'none' }) }, selectGender(gender) { this.gender = gender }, toggleGoal(goal) { const index = this.fitnessGoals.indexOf(goal) if (index >= 0) { this.fitnessGoals.splice(index, 1) } else { this.fitnessGoals.push(goal) } }, isGoalSelected(goal) { return this.fitnessGoals.includes(goal) }` } }; function alignCss(css) { let result = css.replace(/@import\s+['"]\.\/base\.css['"];\s*/g, ''); const replacements = [ ['url(@/assets/images/', 'url(@/static/images/'], ['box-shadow: 0px 8px 16px 0px rgba(255, 107, 53, 0.25098039215686274)', 'box-shadow: var(--shadow-orange-glow)'], ['background-color: rgba(255, 255, 255, 1)', 'background-color: var(--bg-white)'], ['color: rgba(255, 255, 255, 1)', 'color: var(--text-inverse)'], ['border-color: rgba(255, 255, 255, 1)', 'border-color: var(--bg-white)'], ['rgba(11, 43, 75, 1)', 'var(--primary-dark)'], ['rgba(26, 74, 111, 1)', 'var(--primary-deep)'], ['rgba(255, 107, 53, 1)', 'var(--accent-orange)'], ['rgba(255, 140, 90, 1)', 'var(--accent-orange-light)'], ['rgba(249, 250, 254, 1)', 'var(--bg-light)'], ['rgba(30, 42, 58, 1)', 'var(--text-dark)'], ['rgba(94, 111, 141, 1)', 'var(--text-muted)'], ['rgba(138, 153, 180, 1)', 'var(--text-light)'], ['rgba(233, 237, 242, 1)', 'var(--border-light)'], ['rgba(46, 204, 113, 1)', 'var(--success-green)'], ['rgba(231, 76, 60, 1)', 'var(--error-red)'], ['height: 900px', 'height: auto;\n min-height: 100%'], ['height: 2300px', 'height: auto;\n min-height: 100%'], ['height: 1901px', 'height: auto'] ]; for (const [from, to] of replacements) { result = result.split(from).join(to); } return result; } function convertTemplate(template, config) { let result = template.replace(/\r\n/g, '\n'); result = result.replace(/
/g, '');
result = result.replace(/\s+id="[^"]*"/g, '');
result = result.replace(/\{\{\s*"([^"]*?)"\s*\}\}/gs, '$1');
result = result.replace(/\{\{\s*'([^']*?)'\s*\}\}/gs, '$1');
result = result.replace(
'