Sfoglia il codice sorgente

Merge branch 'master' of http://124.70.149.18:10880/lianghj/queenshow

lianghongjie 1 anno fa
parent
commit
4bf770148d

+ 3 - 2
scripts/deployHtmlToServer.js

@@ -13,8 +13,9 @@ fs.writeFileSync(nativePath + path.sep + 'index.html', indexHtml);
 
 var editHtml = fs.readFileSync('dist/editor.html');
 fs.writeFileSync(nativePath + path.sep + 'editor.html', editHtml);
-// var shareHtml = fs.readFileSync('dist/share.html');
-// fs.writeFileSync(nativePath + path.sep + 'share.html', shareHtml);
+
+var shareHtml = fs.readFileSync('dist/share.html');
+fs.writeFileSync(nativePath + path.sep + 'share.html', shareHtml);
 
 // var shareHtml = fs.readFileSync('dist/login.html');
 // fs.writeFileSync(nativePath + path.sep + 'login.html', shareHtml);

+ 2 - 2
src/dict/apis.ts

@@ -14,8 +14,8 @@ const Dict_Apis = {
   queentreeLocal: base,
   auth: `${baseURL}${baseVersion}/usercenter`,
   queentree: `${baseURL}${treeVersion}/assetcenter`,
-  // promotion: `${baseURL}${baseVersion}/promotion`,
-  promotion: `${localURL}/promotion`,
+  promotion: `${baseURL}${baseVersion}/promotion`,
+  // promotion: `${localURL}/promotion`,
 };
 
 export { Dict_Apis };

+ 5 - 1
src/modules/editor/components/Viewport/Header/ShareBox.tsx

@@ -7,8 +7,12 @@ import { defineComponent } from "vue";
 export const ShareBox = defineComponent({
   setup() {
     const { store } = useEditor();
-    const shareLink =
+    let shareLink =
       location.origin + "/share.html?id=" + store.designData._id;
+    if (location.host == "www.infish.cn") {
+      shareLink = location.origin + "/projects/queenshow/share.html?id=" + store.designData._id;
+    }
+
     const qrUrl = useQRCode(shareLink);
     const { copy, copied } = useClipboard();
 

+ 7 - 0
src/modules/resource/actions/promotion.ts

@@ -28,6 +28,13 @@ export const promotionAction = ResourceModule.action({
     });
     if (!title) return;
     const res = await this.https.createPromotion({ title });
+    console.log(location.host, location.host == "www.infish.cn")
+    if (location.host == "www.infish.cn") {
+      const url = `${location.origin}/projects/queenshow/editor.html#/?id=${res.result}`;
+      location.href = url;
+      return;
+    }
+
     const url = `${location.origin}/editor.html#/?id=${res.result}`;
     location.href = url;
   },

+ 5 - 0
src/modules/resource/components/PromotionItem.tsx

@@ -16,6 +16,11 @@ export default defineComponent({
     const resource = useResource();
 
     const goEdit = () => {
+      if (location.host == "www.infish.cn") {
+        const url = `${location.origin}/projects/queenshow/editor.html#/?id=${props.record._id}`;
+        location.href = url;
+        return;
+      }
       const url = `${location.origin}/editor.html#/?id=${props.record._id}`;
       location.href = url;
     };

+ 17 - 0
src/modules/resource/controllers/PromotionController.ts

@@ -9,7 +9,24 @@ export class PromotionController {
     console.log("onMenuClick", menu, item);
   }
   onEdit(item: any) {
+    if (location.host == "www.infish.cn") {
+      const url = `${location.origin}/projects/queenshow/editor.html#/?id=${item._id}`;
+      location.href = url;
+      return;
+    }
+
     const url = `${location.origin}/editor.html#/?id=${item._id}`;
     location.href = url;
   }
+  onPreview(item: any) {
+    if (location.host == "www.infish.cn") {
+      const url = `${location.origin}/projects/queenshow/share.html#/?id=${item._id}`;
+      location.href = url;
+      return;
+    }
+    const url = `${location.origin}/share.html#/?id=${item._id}`;
+    location.href = url;
+
+    
+  }
 }

+ 45 - 5
src/pages/website/Promotion2/components/PromotionItem.tsx

@@ -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">

+ 5 - 5
vue.config.js

@@ -7,11 +7,11 @@ const {
 } = require("@ckeditor/ckeditor5-dev-translations");
 const { styles } = require("@ckeditor/ckeditor5-dev-utils");
 
-// const publicPath =
-//   process.env.NODE_ENV === "production"
-//     ? `//infishwaibao.oss-cn-chengdu.aliyuncs.com/queenshow/`
-//     : "./";
-const publicPath = "./";
+const publicPath =
+  process.env.NODE_ENV === "production"
+    ? `//infishwaibao.oss-cn-chengdu.aliyuncs.com/queenshow/`
+    : "./";
+// const publicPath = "./";
 
 module.exports = defineConfig({
   pages: {