|
@@ -1,79 +0,0 @@
|
|
|
-import Taro from "@tarojs/taro";
|
|
|
-import { View, Image } from "@tarojs/components";
|
|
|
-import WidgetCard from "@/components/widgets/widget-card/index";
|
|
|
-import style from "./index.module.less";
|
|
|
-import type { IEntityDocument, TEntityComponent } from "@/types/index";
|
|
|
-import IconStoreHome from "@/components/icon/icon-store-home";
|
|
|
-interface Props {
|
|
|
- index: number;
|
|
|
- editMode: boolean;
|
|
|
- component: TEntityComponent;
|
|
|
- components: TEntityComponent[];
|
|
|
- onSwitchChanged: (c: TEntityComponent, checked: boolean) => void;
|
|
|
- onDelete: (c: IEntityDocument) => void;
|
|
|
- onMove: (c: TEntityComponent, direction: number) => void;
|
|
|
- onClick: (c: TEntityComponent, url: string) => void;
|
|
|
-}
|
|
|
-
|
|
|
-export default ({
|
|
|
- index,
|
|
|
- editMode,
|
|
|
- component,
|
|
|
- components,
|
|
|
- onSwitchChanged,
|
|
|
- onDelete,
|
|
|
- onMove,
|
|
|
- onClick,
|
|
|
-}: Props) => {
|
|
|
- const data =
|
|
|
- component.data ||
|
|
|
- ({ value: {} } as {
|
|
|
- value: {
|
|
|
- shortLink: string;
|
|
|
- poster: string;
|
|
|
- name: string;
|
|
|
- };
|
|
|
- });
|
|
|
- const handleClick = () => {
|
|
|
- if (editMode) {
|
|
|
- onClick(component, `/pages/editor-pages/editor-store-home/index`);
|
|
|
- }
|
|
|
- };
|
|
|
- return (
|
|
|
- <>
|
|
|
- <WidgetCard
|
|
|
- className={style.card}
|
|
|
- editAreaClassName={style.editArea}
|
|
|
- disableChangeStyle
|
|
|
- index={index}
|
|
|
- enabled={component.enabled}
|
|
|
- onSwitchChanged={(checked) => onSwitchChanged(component, checked)}
|
|
|
- components={components}
|
|
|
- editMode={editMode}
|
|
|
- onDelete={() => onDelete(component)}
|
|
|
- onMove={(direction) => onMove(component, direction)}
|
|
|
- >
|
|
|
- <View className={`relative`} onClick={handleClick}>
|
|
|
- {editMode && <View className="absolute w-full h-full z-10 left-0 top-0"></View>}
|
|
|
- <View className="flex">
|
|
|
- <View className={style.leftColumn}>
|
|
|
- {IconStoreHome()}
|
|
|
- </View>
|
|
|
- <View className={style.rightColumn}>
|
|
|
- <View className="relative">
|
|
|
- <View className={style.coverBlocks}>
|
|
|
- <View className={`${style.block} -left-2 -top w-4 h-full`}></View>
|
|
|
- <View className={`${style.block} left-0 -top-2 h-4 w-full`}></View>
|
|
|
- <View className={`${style.block} -right-2 top-0 w-4 h-full`}></View>
|
|
|
- <View className={`${style.block} left-0 -bottom-1 h-4 w-full`}></View>
|
|
|
- </View>
|
|
|
- {/*@ts-ignore*/}
|
|
|
- <store-home appid={data.value.appid} />
|
|
|
- </View>
|
|
|
- </View>
|
|
|
- </View>
|
|
|
- </View>
|
|
|
- </WidgetCard>
|
|
|
- </>
|
|
|
- );
|
|
|
-};
|