06488f0237
功能: - Go后端 (Gin + GORM + PostgreSQL) - UniApp用户端 (iOS/Android/小程序) - DaisyUI5后台管理 - JWT认证 + 微信登录 - 盲选加权算法 - 会员系统 + 优惠券 - 打分评价 + 偏好学习
113 lines
1.9 KiB
Vue
113 lines
1.9 KiB
Vue
<script>
|
|
import { createPinia } from 'pinia'
|
|
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
|
|
|
const pinia = createPinia()
|
|
pinia.use(piniaPluginPersistedstate)
|
|
|
|
export default {
|
|
globalData: {
|
|
token: '',
|
|
userInfo: null
|
|
},
|
|
onLaunch() {
|
|
console.log('App launched')
|
|
},
|
|
onShow() {
|
|
const token = uni.getStorageSync('token')
|
|
if (!token) {
|
|
// 没有 token → 跳转到登录页
|
|
uni.redirectTo({ url: '/pages/login/login' })
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
/* 全局样式 */
|
|
page {
|
|
background-color: #f5f5f5;
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
|
|
'Microsoft YaHei', sans-serif;
|
|
font-size: 28rpx;
|
|
color: #333;
|
|
}
|
|
|
|
/* 通用 */
|
|
.container {
|
|
padding: 24rpx;
|
|
}
|
|
|
|
/* 卡片 */
|
|
.card {
|
|
background: #fff;
|
|
border-radius: 20rpx;
|
|
padding: 24rpx;
|
|
margin-bottom: 20rpx;
|
|
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
}
|
|
|
|
/* 按钮 */
|
|
.btn-primary {
|
|
background: linear-gradient(135deg, #FF6B35, #FF8C42);
|
|
color: #fff;
|
|
border: none;
|
|
border-radius: 40rpx;
|
|
font-size: 32rpx;
|
|
font-weight: 600;
|
|
padding: 20rpx 40rpx;
|
|
}
|
|
|
|
.btn-outline {
|
|
background: transparent;
|
|
color: #FF6B35;
|
|
border: 2rpx solid #FF6B35;
|
|
border-radius: 40rpx;
|
|
font-size: 28rpx;
|
|
padding: 16rpx 32rpx;
|
|
}
|
|
|
|
/* 评分 */
|
|
.stars {
|
|
display: flex;
|
|
gap: 8rpx;
|
|
}
|
|
|
|
.star {
|
|
font-size: 48rpx;
|
|
color: #ddd;
|
|
&.active {
|
|
color: #FFD700;
|
|
}
|
|
}
|
|
|
|
/* 标签 */
|
|
.tag {
|
|
display: inline-block;
|
|
padding: 6rpx 16rpx;
|
|
background: #FFF3E0;
|
|
color: #FF6B35;
|
|
border-radius: 20rpx;
|
|
font-size: 22rpx;
|
|
margin-right: 10rpx;
|
|
margin-bottom: 8rpx;
|
|
}
|
|
|
|
/* 空状态 */
|
|
.empty-state {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 100rpx 0;
|
|
color: #999;
|
|
.empty-icon {
|
|
font-size: 120rpx;
|
|
margin-bottom: 20rpx;
|
|
}
|
|
.empty-text {
|
|
font-size: 28rpx;
|
|
}
|
|
}
|
|
</style>
|