feat: 分包 除了list

This commit is contained in:
2025-09-12 15:30:49 +08:00
parent bd628f2b5c
commit 859ffec852
26 changed files with 33 additions and 20 deletions

View File

@@ -0,0 +1,5 @@
export default definePageConfig({
navigationBarTitleText: "NTRP 评测",
// navigationBarBackgroundColor: '#FAFAFA',
// navigationStyle: 'custom',
});

View File

@@ -0,0 +1,64 @@
@use "~@/scss/images.scss" as img;
.container {
width: 100%;
padding: 20px;
box-sizing: border-box;
.title {
font-size: 24px;
font-weight: bold;
font-family: Arial, sans-serif;
text-align: center;
margin-bottom: 20px;
color: #333;
}
.content {
width: 100%;
height: 300px;
background-color: #f9f9f9;
border-radius: 8px;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.image {
/* width: 200px; */
/* height: 200px; */
/* object-fit: cover; */
}
.description {
padding: 10px;
box-sizing: border-box;
font-size: 16px;
color: #666;
}
}
.button {
position: fixed;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
width: 200px;
height: 50px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
font-weight: bold;
font-family: Arial, sans-serif;
text-align: center;
line-height: 50px;
transition: background-color 0.3s ease;
&:hover {
background-color: #0056b3;
}
}
}

View File

@@ -0,0 +1,53 @@
import { useState, useEffect } from "react";
import { View, Text, Image, Button } from "@tarojs/components";
import Taro, { useRouter } from "@tarojs/taro";
import { withAuth } from "@/components";
import evaluateService from "@/services/evaluateService";
import { useUserActions } from "@/store/userStore";
import { delay } from "@/utils";
import styles from "./index.module.scss";
function NtrpEvaluate() {
const { updateUserInfo } = useUserActions();
const { params } = useRouter();
const { redirect } = params;
useEffect(() => {
evaluateService.getEvaluateQuestions().then((data) => {
console.log(data);
});
}, []);
async function handleUpdateNtrp() {
await updateUserInfo({
ntrp_level: "4.0",
});
Taro.showToast({
title: "更新成功",
icon: "success",
duration: 2000,
});
await delay(2000);
if (redirect) {
Taro.redirectTo({ url: decodeURIComponent(redirect) });
}
}
return (
<View className={styles.container}>
<View className={styles.title}>NTRP评分</View>
<View className={styles.content}>
<Image
className={styles.image}
src="https://img.yzcdn.cn/vant/cat.jpeg"
/>
<Text className={styles.description}>NTRP评分是 4.0 </Text>
</View>
<Button className={styles.button} onClick={handleUpdateNtrp}>
</Button>
</View>
);
}
export default withAuth(NtrpEvaluate);