123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import { isWeixinBrowser } from "@/controllers/wxController";
- import { EditorModule } from "..";
- import PreviewImagesModal from "../../components/PreviewImagesModal";
- export const ImgCompActions = EditorModule.action({
- handleImageHotKey(key: string) {
- if (!this.store.isEditMode) return;
- if (this.store.currComp?.compKey !== "Image") return;
- const value = this.store.currComp.value;
- return;
- // if (key == "w") {
- // value.y = (parseFloat(value.y) - 0.5).toFixed(2);
- // return;
- // }
- // if (key == "s") {
- // value.y = (parseFloat(value.y) + 0.5).toFixed(2);
- // return;
- // }
- // if (key == "a") {
- // value.x = (parseFloat(value.x) - 0.5).toFixed(2);
- // return;
- // }
- // if (key == "d") {
- // value.x = (parseFloat(value.x) + 0.5).toFixed(2);
- // return;
- // }
- // if (key == "q") {
- // value.s = (parseFloat(value.s) - 0.05).toFixed(2);
- // return;
- // }
- // if (key == "e") {
- // value.s = (parseFloat(value.s) + 0.05).toFixed(2);
- // return;
- // }
- },
- previewImage(url, previewImageList) {
- if (this.controls.screenCtrl.state.screen.useFor == "pc") return;
- if (isWeixinBrowser()) {
- this.controls.wxCtrl.setPreviewData(url, previewImageList);
- } else {
- this.showModal(
- <PreviewImagesModal data={previewImageList} current={url} />,
- {
- fullscreen: true,
- }
- );
- }
- },
- });
|