|
@@ -1,10 +1,42 @@
|
|
|
import { css, cx } from "@linaria/core";
|
|
|
import { IconMore } from "@queenjs/icons";
|
|
|
import { Image, View } from "@queenjs/ui";
|
|
|
-import { Divider, Dropdown, Menu, Tag } from "ant-design-vue";
|
|
|
+import { Divider, Dropdown, Menu, Tag, Button } from "ant-design-vue";
|
|
|
import dayjs from "dayjs";
|
|
|
import { defineUI } from "queenjs";
|
|
|
-import { any } from "vue-types";
|
|
|
+import { defineComponent } from "vue";
|
|
|
+import { any, string } from "vue-types";
|
|
|
+import { useQRCode } from "@vueuse/integrations/useQRCode";
|
|
|
+import { useClipboard } from "@vueuse/core";
|
|
|
+
|
|
|
+const ShareBox = defineComponent({
|
|
|
+ props: {
|
|
|
+ id: string(),
|
|
|
+ },
|
|
|
+
|
|
|
+ setup(props) {
|
|
|
+
|
|
|
+ let shareLink =
|
|
|
+ location.origin + "/share.html?id=" + props.id;
|
|
|
+ if (location.host == "www.infish.cn") {
|
|
|
+ shareLink = location.origin + "/projects/queenshow/share.html?id=" + props.id;
|
|
|
+ }
|
|
|
+
|
|
|
+ const qrUrl = useQRCode(shareLink);
|
|
|
+ const { copy, copied } = useClipboard();
|
|
|
+
|
|
|
+ return () => (
|
|
|
+ <div class="p-20px bg-dark-500 text-center">
|
|
|
+ <img src={qrUrl.value} />
|
|
|
+ <div class="mb-20px"></div>
|
|
|
+ <Button onClick={() => copy(shareLink)} disabled={copied.value}>
|
|
|
+ {copied.value ? "已复制" : "复制链接"}
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+});
|
|
|
+
|
|
|
|
|
|
export default defineUI({
|
|
|
props: {
|
|
@@ -33,9 +65,17 @@ export default defineUI({
|
|
|
>
|
|
|
编辑
|
|
|
</div>
|
|
|
- <div onClick={()=>emit("preview")} class="text-white icon_action w-60px leading-60px ml-10px cursor-pointer rounded-1/2 text-center">
|
|
|
- 预览
|
|
|
- </div>
|
|
|
+
|
|
|
+ <Dropdown
|
|
|
+ overlay={<ShareBox id={record._id}/>}
|
|
|
+ trigger="click"
|
|
|
+ placement="bottomCenter"
|
|
|
+ >
|
|
|
+ <div class="text-white icon_action w-60px leading-60px ml-10px cursor-pointer rounded-1/2 text-center">
|
|
|
+ 预览
|
|
|
+ </div>
|
|
|
+ </Dropdown>
|
|
|
+
|
|
|
</div>
|
|
|
</View>
|
|
|
<div class="item_footer rounded-b-4px flex items-center justify-between p-15px">
|