文件
huaqiapp/App.vue

224 行
4.2 KiB
Vue

<script>
import store from '@/utils/store.js'
export default {
onLaunch: function() {
store.restore()
},
onShow: function() {
// 启动时校验登录态:无 token 直接进入登录页(首页除外,首页会自行引导)
if (!store.token) {
const pages = getCurrentPages()
const route = pages.length ? pages[pages.length - 1].route : ''
if (route && route.indexOf('pages/login') === -1) {
uni.reLaunch({ url: '/pages/login/index' })
}
}
},
onHide: function() {}
}
</script>
<style>
/* ============================================================
全局样式 · 花期(暖色调 / 简洁大气)
============================================================ */
page {
background-color: #FFF9F5;
color: #3E2C27;
font-size: 28rpx;
line-height: 1.6;
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
/* 页面容器 */
.hq-page {
min-height: 100vh;
padding: 0 32rpx calc(180rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
background: linear-gradient(180deg, #FFF3EC 0%, #FFF9F5 34%, #FFFDFB 100%);
}
/* 卡片 */
.hq-card {
background-color: #FFFFFF;
border-radius: 32rpx;
padding: 32rpx;
margin-bottom: 24rpx;
box-shadow: 0 12rpx 36rpx rgba(232, 96, 76, 0.08);
box-sizing: border-box;
}
.hq-card-hover {
transform: scale(0.995);
transition: transform 0.15s ease;
}
/* 标题层级 */
.hq-section-head {
display: flex;
align-items: baseline;
justify-content: space-between;
margin: 8rpx 0 20rpx;
}
.hq-section-title {
font-size: 32rpx;
font-weight: 600;
color: #3E2C27;
letter-spacing: 1rpx;
}
.hq-section-more {
font-size: 24rpx;
color: #B9A79E;
}
.hq-sub {
font-size: 24rpx;
color: #8C7367;
line-height: 1.7;
}
.hq-muted {
font-size: 22rpx;
color: #B9A79E;
}
/* 按钮 */
.hq-btn {
display: flex;
align-items: center;
justify-content: center;
height: 88rpx;
border-radius: 44rpx;
font-size: 30rpx;
font-weight: 500;
letter-spacing: 2rpx;
background: linear-gradient(135deg, #F58C7C 0%, #E8604C 100%);
color: #FFFFFF;
box-shadow: 0 16rpx 32rpx rgba(232, 96, 76, 0.24);
}
.hq-btn-ghost {
display: flex;
align-items: center;
justify-content: center;
height: 88rpx;
border-radius: 44rpx;
font-size: 30rpx;
color: #E8604C;
background-color: #FFF1E9;
}
.hq-btn-plain {
color: #8C7367;
background-color: #FFFFFF;
box-shadow: none;
border: 2rpx solid #F5E7DF;
}
/* 标签 / 胶囊 */
.hq-chip {
display: inline-flex;
align-items: center;
padding: 10rpx 24rpx;
border-radius: 999rpx;
font-size: 24rpx;
color: #8C7367;
background-color: #FFF4EE;
margin: 0 16rpx 16rpx 0;
}
.hq-chip-active {
color: #FFFFFF;
background: linear-gradient(135deg, #F58C7C 0%, #E8604C 100%);
box-shadow: 0 8rpx 20rpx rgba(232, 96, 76, 0.2);
}
/* 分割线 */
.hq-divider {
height: 2rpx;
background-color: #F5E7DF;
margin: 24rpx 0;
}
/* 空状态 */
.hq-empty {
display: flex;
flex-direction: column;
align-items: center;
padding: 60rpx 0;
}
.hq-empty-text {
font-size: 26rpx;
color: #B9A79E;
text-align: center;
}
/* 行布局 */
.hq-row {
display: flex;
align-items: center;
}
.hq-between {
display: flex;
align-items: center;
justify-content: space-between;
}
/* 通用列表行 */
.hq-cell {
display: flex;
align-items: center;
justify-content: space-between;
padding: 28rpx 0;
}
.hq-cell + .hq-cell {
border-top: 2rpx solid #F5E7DF;
}
.hq-cell-label {
font-size: 28rpx;
color: #3E2C27;
}
.hq-cell-value {
font-size: 26rpx;
color: #8C7367;
}
.hq-arrow {
font-size: 26rpx;
color: #D8C6BD;
margin-left: 8rpx;
}
/* 滑动条(自定义进度) */
.hq-progress {
height: 12rpx;
border-radius: 999rpx;
background-color: #FFF1E9;
overflow: hidden;
}
.hq-progress-inner {
height: 100%;
border-radius: 999rpx;
background: linear-gradient(90deg, #F5A65B 0%, #E8604C 100%);
}
/* 动画 */
@keyframes hqFadeUp {
from { opacity: 0; transform: translateY(16rpx); }
to { opacity: 1; transform: translateY(0); }
}
.hq-fade-up {
animation: hqFadeUp 0.36s ease both;
}
</style>