Skip to content

Commit

Permalink
fix(bug): 修复bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
eleliauk committed Dec 10, 2024
1 parent ce7b4fb commit 75967e4
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/modules/guide/components/Selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ const Selector: React.FC<SelectorProps> = memo(
</View>
{children}
<Popup open={isOpen} placement="bottom">
<Popup.Close />
<ConfigProvider theme={{ pickerConfirmActionColor: '#f18900' }}>
<Picker
style={{ marginBottom: '15vh' }}
defaultValue={['全部', '全部']}
title="选择学年和学期"
cancelText="取消"
confirmText="确定"
columns={Times()}
onConfirm={(value) => {
setSelection({ year: value[0], term: value[1] });
Expand Down
2 changes: 1 addition & 1 deletion src/modules/notification/components/Items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const OfficialItem = memo(
return (
<>
<View className="flex w-full flex-col items-center gap-4">
<AlertOfficial title="此版块暫未开放,未来将会有更多精彩内容" />
<AlertOfficial title="此版块暂未开放,未来将会有更多精彩内容" />
</View>
{/* <View className="flex w-full flex-col items-center gap-4">
<View className="text-xs text-gray-500">07:25</View>
Expand Down
2 changes: 0 additions & 2 deletions src/modules/notification/components/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,8 @@ const Notification: React.FC = memo(() => {
} else {
console.log('官方');
}

Taro.hideLoading();
setLoading(false);
// console.log('最终 ' + JSON.stringify(message));
} catch (error) {
// eslint-disable-next-line no-console
console.error('Error fetching data:', error);
Expand Down
6 changes: 6 additions & 0 deletions src/pages/classInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export default function Index() {
<View className="p">
综合评分: <ShowStar score={course.composite_score} />
<Text>(共{course.rater_count}人评价)</Text>
{/* <Text> 收藏该课程</Text> */}
</View>
<View className="p">
课程分类: <Label3 content={translateCourseProperty(course.type)} />
Expand All @@ -164,6 +165,11 @@ export default function Index() {
<Label3 key={keyindex} content={feature} />
))}
</View>
{/* <View className="p">
<Label3 content="收藏该课程" handleClick={
}/>
</View> */}
<View className="mx-auto flex w-[90%] pt-1.5">
<LineChart
className="mx-auto text-center"
Expand Down
1 change: 0 additions & 1 deletion src/pages/editUser/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { post } from '@/common/utils';

const EditUser: React.FC = () => {
const [avatarUrl, setAvatarUrl] = useState('');
// const [editing, setEditing] = useState(false);
const [nickName, setNickName] = useState('请修改昵称');
const [isEditingNickname, setIsEditingNickname] = useState(false);
const [editableNickName, setEditableNickName] = useState(nickName);
Expand Down
13 changes: 9 additions & 4 deletions src/pages/evaluate/evaluate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ export default function evaluate() {
}, []); // 这个 effect 仅在组件挂载时运行一次

const postEvaluation = () => {
if (selectedStarIndex === -1) {
void Taro.showToast({
title: '请为课程选择星级',
icon: 'none',
});
return;
}
const evaluationobj = {
star_rating: selectedStarIndex,
content: comment,
Expand Down Expand Up @@ -153,9 +160,7 @@ export default function evaluate() {
}
};

return accoutInfo.miniProgram.envVersion === 'develop' ? (
<>因为政策原因,暂时无法评价课程</>
) : (
return (
<Form className="view">
<View className="p">
<Text> 选择课程 : </Text>
Expand All @@ -172,7 +177,7 @@ export default function evaluate() {
<Radio
key={item.value}
className="myradio"
checked={selectedValues.includes(item.value)} // 判断是否包含该项的 value
checked={selectedValues.includes(item.value)}
value={item.value}
color="transparent"
onClick={() => handleRadioChange(item.value)}
Expand Down

0 comments on commit 75967e4

Please sign in to comment.