feat: add router to detail and ignore css order problem
This commit is contained in:
@@ -18,6 +18,7 @@ export interface CommonPopupProps {
|
||||
zIndex?: number
|
||||
children?: React.ReactNode
|
||||
className?: string
|
||||
style?: React.CSSProperties
|
||||
}
|
||||
|
||||
const CommonPopup: React.FC<CommonPopupProps> = ({
|
||||
@@ -34,6 +35,7 @@ const CommonPopup: React.FC<CommonPopupProps> = ({
|
||||
position = 'bottom',
|
||||
round = true,
|
||||
zIndex,
|
||||
style,
|
||||
children
|
||||
}) => {
|
||||
const handleCancel = () => {
|
||||
@@ -52,7 +54,7 @@ const CommonPopup: React.FC<CommonPopupProps> = ({
|
||||
closeable={false}
|
||||
onClose={onClose}
|
||||
className={`${styles['common-popup']} ${className ? className : ''}`}
|
||||
style={zIndex ? { zIndex } : undefined}
|
||||
style={{ ...style, zIndex: zIndex ? zIndex : undefined }}
|
||||
>
|
||||
{showHeader && (
|
||||
<View className={styles['common-popup__header']}>
|
||||
@@ -78,4 +80,4 @@ const CommonPopup: React.FC<CommonPopupProps> = ({
|
||||
)
|
||||
}
|
||||
|
||||
export default CommonPopup
|
||||
export default CommonPopup
|
||||
@@ -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