Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 fix: 修改标志 字体大小,增加点赞功能 #197

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/common/components/Comment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
import { useCourseStore } from '@/pages/main/store/store';

import IconFont from '@/common/components/iconfont';
import { CourseDetailsType, PublisherDetailsType } from '@/pages/main/store/types';

Check failure on line 12 in src/common/components/Comment/index.tsx

View workflow job for this annotation

GitHub Actions / lint-and-format

'@/common/utils' imported multiple times
import ShowStar from '../showStar/showStar';

import { post } from '@/common/utils';

Check failure on line 16 in src/common/components/Comment/index.tsx

View workflow job for this annotation

GitHub Actions / lint-and-format

'@/common/utils' imported multiple times
interface CommentProps extends CommentInfo {
type?: string;
isHot?: boolean;
Expand All @@ -37,7 +39,7 @@
setPublisherInfo(res);
});
}, [props.course_id, props.publisher_id]);
const navigateToPage = async () => {

Check warning on line 42 in src/common/components/Comment/index.tsx

View workflow job for this annotation

GitHub Actions / lint-and-format

React Hook useEffect has missing dependencies: 'course_id' and 'publisher_id'. Either include them or remove the dependency array
await Taro.navigateTo({
url: `/pages/classInfo/index?course_id=${course_id}`, // 传递 course_id 参数
});
Expand All @@ -45,7 +47,7 @@

const handleClickToClass = () => {
void navigateToPage().then((r) => console.log(r)); // 这里调用异步函数,但不返回 Promise
};

Check warning on line 50 in src/common/components/Comment/index.tsx

View workflow job for this annotation

GitHub Actions / lint-and-format

Unexpected console statement

return (
<>
Expand Down Expand Up @@ -95,6 +97,12 @@
onClick && onClick(props);
}, [onClick]);

const handlEndorse = (a: number) => {
void post(`/evaluations/${id}/endorse`, { stance: a }).then((res) => {
console.log(res);

Check warning on line 102 in src/common/components/Comment/index.tsx

View workflow job for this annotation

GitHub Actions / lint-and-format

React Hook useCallback has a missing dependency: 'props'. Either include it or remove the dependency array
});
};

return (
<View className="bigcomment" onClick={handleClick}>
<View className="commentplus">
Expand All @@ -106,7 +114,7 @@

{type === 'inner' && (
<View className="likes">
<View className="icon">
<View className="icon" onClick={() => handlEndorse(1)}>
<IconFont name="like" />
{/* <Navigator className="iconfont">&#xe786;</Navigator> */}
</View>
Expand Down
19 changes: 12 additions & 7 deletions src/common/components/Comment/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ $content-line-height: 30;
}
.content {
// clear: both;
font-size: 22rpx;
font-size: 28rpx;
font-family:
Segoe UI-Regular,
Segoe UI;
Expand All @@ -124,24 +124,29 @@ $content-line-height: 30;
}
}
.icon {
width: 40rpx;
height: 40rpx;
position: relative;
width: 50rpx;
height: 50rpx;
box-shadow: 0rpx 5rpx 11rpx 2rpx rgba(0, 0, 0, 0.16);
opacity: 1;
border-radius: 50%;
display: inline-block;
text-align: center;
line-height: 40rpx;
margin-left: 15rpx;
Image {
width: 100%;
height: 100%;
margin-right: 15rpx;
> Iconfont {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
.text1 {
font-size: 22rpx;
font-size: 28rpx;
font-weight: bold;
color: black;
line-height: 50rpx;
}
}
.text-overflow {
Expand Down
Loading