225 行
4.6 KiB
Vue
225 行
4.6 KiB
Vue
<script>
|
||
export default {
|
||
onLaunch: function (options) {
|
||
console.log('App Launch', options)
|
||
this.captureInvite(options)
|
||
},
|
||
onShow: function (options) {
|
||
console.log('App Show', options)
|
||
this.captureInvite(options)
|
||
},
|
||
onHide: function () {
|
||
console.log('App Hide')
|
||
},
|
||
methods: {
|
||
captureInvite(options) {
|
||
const query = (options && options.query) || {}
|
||
const ic = query.ic || query.inviteCode || query.invite_code
|
||
const inviterId = query.inviterId || query.inviter_id
|
||
if (ic) {
|
||
uni.setStorageSync('fc_invite_code', String(ic))
|
||
}
|
||
if (inviterId) {
|
||
uni.setStorageSync('fc_inviter_id', Number(inviterId))
|
||
}
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style>
|
||
/* ============================================================
|
||
* 全局基础样式 · 生态绿(Eco Green)
|
||
* ========================================================== */
|
||
page {
|
||
--fc-primary: #00e070;
|
||
--fc-primary-ink: #04301e;
|
||
--fc-primary-light: #5cf3a6;
|
||
--fc-primary-lighter: #e4fdf0;
|
||
--fc-bg: #f2fef7;
|
||
--fc-text: #04291c;
|
||
--fc-text-secondary: #3f6b57;
|
||
--fc-border: #d6f3e3;
|
||
--fc-price: #e0891b;
|
||
|
||
background-color: var(--fc-bg);
|
||
color: var(--fc-text);
|
||
font-size: 28rpx;
|
||
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||
-webkit-font-smoothing: antialiased;
|
||
}
|
||
|
||
view,
|
||
text,
|
||
scroll-view,
|
||
swiper,
|
||
image {
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
/* 通用容器 */
|
||
.fc-page {
|
||
min-height: 100vh;
|
||
background: var(--fc-bg);
|
||
padding-bottom: 120rpx;
|
||
}
|
||
|
||
.fc-card {
|
||
background: #ffffff;
|
||
border-radius: 24rpx;
|
||
padding: 30rpx;
|
||
margin: 24rpx;
|
||
box-shadow: 0 6rpx 24rpx rgba(4, 48, 30, 0.08);
|
||
}
|
||
|
||
/* 主按钮 */
|
||
.fc-btn {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 88rpx;
|
||
border-radius: 999rpx;
|
||
font-size: 30rpx;
|
||
font-weight: 600;
|
||
color: var(--fc-primary-ink);
|
||
background: linear-gradient(135deg, #00e070 0%, #00c860 55%, #00b85c 100%);
|
||
box-shadow: 0 8rpx 24rpx rgba(0, 168, 85, 0.28);
|
||
}
|
||
.fc-btn--ghost {
|
||
background: #ffffff;
|
||
color: var(--fc-primary-text);
|
||
border: 2rpx solid var(--fc-primary);
|
||
box-shadow: none;
|
||
}
|
||
.fc-btn--disabled {
|
||
background: #d6f3e3;
|
||
color: #ffffff;
|
||
box-shadow: none;
|
||
}
|
||
|
||
/* 标签 */
|
||
.fc-tag {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
padding: 4rpx 14rpx;
|
||
border-radius: 999rpx;
|
||
font-size: 22rpx;
|
||
background: var(--fc-primary-lighter);
|
||
color: var(--fc-primary-text);
|
||
}
|
||
|
||
/* 价格 */
|
||
.fc-price {
|
||
color: var(--fc-price);
|
||
font-weight: 700;
|
||
}
|
||
.fc-price__symbol {
|
||
font-size: 24rpx;
|
||
}
|
||
|
||
/* 渐变占位图(无外链图片时使用) */
|
||
.fc-thumb {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
border-radius: 20rpx;
|
||
background: linear-gradient(135deg, #d9fbe9 0%, #b6f3d4 50%, #8fecbd 100%);
|
||
font-size: 56rpx;
|
||
color: #ffffff;
|
||
}
|
||
|
||
.fc-safe-bottom {
|
||
height: env(safe-area-inset-bottom);
|
||
}
|
||
|
||
/* 文本截断 */
|
||
.fc-ellipsis {
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
}
|
||
.fc-ellipsis-2 {
|
||
display: -webkit-box;
|
||
-webkit-line-clamp: 2;
|
||
-webkit-box-orient: vertical;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.fc-empty {
|
||
padding: 120rpx 0;
|
||
text-align: center;
|
||
color: var(--fc-text-secondary);
|
||
font-size: 26rpx;
|
||
}
|
||
|
||
@keyframes fc-shimmer {
|
||
0% { opacity: 0.55; }
|
||
50% { opacity: 1; }
|
||
100% { opacity: 0.55; }
|
||
}
|
||
.fc-skeleton {
|
||
animation: fc-shimmer 1.2s ease-in-out infinite;
|
||
background: #e6fbf1;
|
||
border-radius: 16rpx;
|
||
}
|
||
|
||
/* ============================================================
|
||
* 图标(图片)与 LOGO
|
||
* 所有图标均为 static/icons/ 下的图片,可在后台
|
||
* 「系统设置 → LOGO 与图标」中替换。
|
||
* ========================================================== */
|
||
.fc-icon {
|
||
display: block;
|
||
width: 40rpx;
|
||
height: 40rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
.fc-icon--xs { width: 30rpx; height: 30rpx; }
|
||
.fc-icon--sm { width: 36rpx; height: 36rpx; }
|
||
.fc-icon--md { width: 48rpx; height: 48rpx; }
|
||
.fc-icon--lg { width: 64rpx; height: 64rpx; }
|
||
.fc-icon--xl { width: 88rpx; height: 88rpx; }
|
||
|
||
/* 徽章图标(图片自带圆角底色) */
|
||
.fc-icon--badge {
|
||
width: 96rpx;
|
||
height: 96rpx;
|
||
border-radius: 28rpx;
|
||
}
|
||
.fc-icon--badge-sm {
|
||
width: 76rpx;
|
||
height: 76rpx;
|
||
border-radius: 22rpx;
|
||
}
|
||
|
||
/* LOGO(图片自带 21.9% 圆角,CSS 圆角与之对齐避免裁切) */
|
||
.fc-logo {
|
||
display: block;
|
||
}
|
||
.fc-logo--sm {
|
||
width: 60rpx;
|
||
height: 60rpx;
|
||
border-radius: 13rpx;
|
||
}
|
||
.fc-logo--md {
|
||
width: 96rpx;
|
||
height: 96rpx;
|
||
border-radius: 21rpx;
|
||
}
|
||
.fc-logo--lg {
|
||
width: 140rpx;
|
||
height: 140rpx;
|
||
border-radius: 31rpx;
|
||
box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.12);
|
||
}
|
||
|
||
/* 图标 + 文字 的行内组合 */
|
||
.fc-inline {
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
.fc-inline__text {
|
||
margin-left: 10rpx;
|
||
}
|
||
</style>
|