feat: add router to detail and ignore css order problem
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { View, Text, Image } from "@tarojs/components";
|
||||
import Taro from '@tarojs/taro'
|
||||
import img from "../../config/images";
|
||||
import { ListCardProps } from "../../../types/list/types";
|
||||
import "./index.scss";
|
||||
// import SkeletonComponent from "../../components/Skeleton";
|
||||
|
||||
const ListCard: React.FC<ListCardProps> = ({
|
||||
id,
|
||||
title,
|
||||
dateTime,
|
||||
location,
|
||||
@@ -20,6 +22,12 @@ const ListCard: React.FC<ListCardProps> = ({
|
||||
return <Image src={src} className="image" mode="aspectFill" />;
|
||||
};
|
||||
|
||||
const handleViewDetail = () => {
|
||||
Taro.navigateTo({
|
||||
url: `/pages/detail/index?id=${id || 1}&from=list&autoShare=0`
|
||||
})
|
||||
}
|
||||
|
||||
// 根据图片数量决定展示样式
|
||||
const renderImages = () => {
|
||||
if (images.length === 0) return null;
|
||||
@@ -60,7 +68,7 @@ const ListCard: React.FC<ListCardProps> = ({
|
||||
);
|
||||
};
|
||||
return (
|
||||
<View className="list-item">
|
||||
<View className="list-item" onClick={handleViewDetail}>
|
||||
{/* 左侧内容区域 */}
|
||||
<View className="content">
|
||||
{/* 标题 */}
|
||||
|
||||
Reference in New Issue
Block a user