gemercheung 2 年之前
父节点
当前提交
fbd07e3f99

+ 7 - 5
packages/qjkankan-editor/src/Store/modules/index.js

@@ -1,6 +1,8 @@
-import scene from './scene'
-import tags from './tags'
+import scene from "./scene";
+import tags from "./tags";
+import notice from "./notice";
 export default {
-    scene,
-    tags
-}
+  scene,
+  tags,
+  notice,
+};

+ 71 - 0
packages/qjkankan-editor/src/Store/modules/notice.js

@@ -0,0 +1,71 @@
+import { getNoticeApi } from "@/api";
+
+export default {
+  namespaced: true,
+  state() {
+    return {
+      isOPen: false,
+      data: {
+        id: "",
+        tipEndTime: "",
+        tipStartTime: "",
+        imageUrl: "",
+        imageUrlEn: "",
+        title: "",
+        titleEn: "",
+        description: "",
+        descriptionEn: "",
+        infoUrl: "",
+        infoUrlEn: "",
+        version: "",
+      },
+    };
+  },
+  getters: {
+    content: (state) => state.data,
+    status: (state) => state.isOPen,
+  },
+  mutations: {
+    setData(state, payload) {
+      state.data = payload;
+    },
+    setStatus(state, payload) {
+      state.isOPen = payload;
+    },
+  },
+  actions: {
+    async getNotice({ commit, state }) {
+      const data = await getNoticeApi();
+      console.log("state", state);
+      const preState = state.data;
+      Object.keys(data.data).forEach((i) => {
+        if (i in preState) {
+          preState[i] = data.data[i];
+        }
+      });
+
+      if (preState.tipStartTime && preState.tipEndTime) {
+        const start = new Date(preState.tipStartTime);
+        const end = new Date(preState.tipEndTime);
+        const date = Date.now();
+        const noticeIds = localStorage.getItem("noticeIds")
+          ? Array.isArray(JSON.parse(localStorage.getItem("noticeIds")))
+            ? JSON.parse(localStorage.getItem("noticeIds"))
+            : []
+          : [];
+
+        if (date > start && date < end) {
+          if (!Array.from(noticeIds).includes(preState.id)) {
+            noticeIds.push(preState.id);
+            localStorage.setItem("noticeIds", JSON.stringify(noticeIds));
+            commit("setStatus", true);
+          }
+        } else {
+          commit("setStatus", false);
+        }
+      }
+      console.log("preState", preState);
+      commit("setData", preState);
+    },
+  },
+};

+ 144 - 0
packages/qjkankan-editor/src/components/notify.vue

@@ -0,0 +1,144 @@
+<template>
+  <div class="upgrade-popup" @click.stop="" v-if="status">
+    <h2 class="upgrade-text">
+      {{ $i18n.locale == "zh" ? upgradeInfo.title : upgradeInfo.titleEn }}
+    </h2>
+    <div
+      class="upgrade-image"
+      :style="`background-image:url(${
+        $i18n.locale == 'zh' ? upgradeInfo.imageUrl : upgradeInfo.imageUrlEn
+      });`"
+    ></div>
+    <div class="upgrade-content">
+      <div class="info">
+        <span class="info-text">{{
+          $i18n.t("components.user_guid.upgradeInfo")
+        }}</span>
+      </div>
+      <div
+        class="desc"
+        style="white-space: pre-wrap"
+        v-html="
+          $i18n.locale == 'zh'
+            ? upgradeInfo.description
+            : upgradeInfo.descriptionEn
+        "
+      ></div>
+    </div>
+    <div class="upgrade-btn">
+      <button class="ui-button primary" @click="close">
+        {{ $i18n.t("components.user_guid.set") }}
+      </button>
+
+      <button
+        class="ui-button submit"
+        @click.stop="
+          gotoView(
+            $i18n.locale == 'zh' ? upgradeInfo.infoUrl : upgradeInfo.infoUrlEn
+          )
+        "
+      >
+        {{ $i18n.t("components.user_guid.seeMore") }}
+      </button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+
+export default {
+  name: "notify",
+  props: {},
+  computed: {
+    ...mapGetters({
+      upgradeInfo: "notice/content",
+      status: "notice/status",
+    }),
+  },
+  methods: {
+    gotoView(url) {
+      window.open(url);
+      close();
+    },
+    close() {
+      this.$store.commit("notice/setStatus", false);
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.upgrade-popup {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background: rgba(27, 27, 28, 0.9);
+  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25),
+    inset 0px 0px 0px 2px rgba(255, 255, 255, 0.1);
+  z-index: 10001;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-flow: column;
+  color: #fff;
+  overflow-y: auto;
+  z-index: 10000000001;
+  .upgrade-text {
+    width: 560px;
+    font-size: 24px;
+    margin-bottom: 40px;
+    word-break: break-all;
+  }
+  .upgrade-image {
+    width: 560px;
+    height: 320px;
+    // background: #f2f2f2;
+    border-radius: 10px;
+    background-repeat: no-repeat;
+    background-size: cover;
+  }
+  .upgrade-content {
+    width: 560px;
+    margin-top: 30px;
+    .info {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      .info-text {
+        font-size: 16px;
+      }
+      .info-time {
+        font-size: 12px;
+        color: rgba(255, 255, 255, 0.7);
+        .time {
+          margin-left: 5px;
+        }
+      }
+    }
+
+    .desc {
+      margin-top: 10px;
+      word-break: break-all;
+      font-size: 14px;
+      line-height: 28px;
+      max-height: 200px;
+      overflow: auto;
+    }
+  }
+  .upgrade-btn {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin-top: 40px;
+    .ui-button {
+      width: 160px;
+      height: 40px;
+      &:first-child {
+        margin-right: 30px;
+      }
+    }
+  }
+}
+</style>

+ 6 - 2
packages/qjkankan-editor/src/framework/EditorAppLayout.vue

@@ -2,17 +2,21 @@
   <div class="app-layout">
     <app-head class="app-head"></app-head>
     <app-main></app-main>
+    <notify></notify>
   </div>
 </template>
 <script>
 import AppHead from "./EditorHead.vue";
 import AppMain from "./EditorMain.vue";
+import Notify from "@/components/notify.vue";
+
 export default {
   name: "app-layout",
   components: {
     AppHead,
-    AppMain
-  }
+    AppMain,
+    Notify
+  },
 };
 </script>
 <style lang="less">

+ 3 - 1
packages/qjkankan-editor/src/lang/_en.json

@@ -523,7 +523,9 @@
       "pano": "Walk<br />Click to move.",
       "rotate": "Roam<br />Swipe the screen to roam.",
       "zoom": "Zoom<br />Zoom in or out.",
-      "set": "Got it"
+      "set": "Got it",
+      "seeMore": "More Details",
+      "upgradeInfo": "Content"
     }
   },
   "material": {

+ 3 - 1
packages/qjkankan-editor/src/lang/_zh.json

@@ -523,7 +523,9 @@
       "pano": "行走<br />点击任意方向移动",
       "rotate": "旋转视角<br />左右滑动屏幕,旋转视觉",
       "zoom": "缩放<br />双指滑动放大或缩小视图",
-      "set": "我知道了"
+      "set": "我知道了",
+      "seeMore": "查看详情",
+      "upgradeInfo": "更新内容"
     }
   },
   "material": {

+ 1 - 0
packages/qjkankan-editor/src/pages/Edit.vue

@@ -30,6 +30,7 @@ export default {
         capture: true,
       }
     );
+    this.$store.dispatch('notice/getNotice')
   },
 };
 </script>

+ 1 - 1
packages/qjkankan-view/public/show.html

@@ -29,7 +29,7 @@
 
     <link
       rel="stylesheet"
-      href="//at.alicdn.com/t/c/font_2625385_1un5khf0xqy.css"
+      href="//at.alicdn.com/t/c/font_2625385_ksvtsfnbizb.css"
     />
 
     <link

+ 2 - 2
packages/qjkankan-view/public/showviewer/lib/krpano/skin/vtourskin.xml

@@ -1271,11 +1271,11 @@
      <include url="%SWFPATH%/tooltip.xml" />
 
 	<!-- 底部logo -->
-	<hotspot name="nadirlogo" visible="false" keep="true" url="masking.png" ath="0" atv="90" handcursor="false" zoom="true" width="26%" height="prop" distorted="true" scale="0.5" rotate="0.0" />
+	<hotspot name="nadirlogo" renderer="css3d"  visible="false" keep="true" url="masking.png" ath="0" atv="90" handcursor="false" zoom="true" width="26%" height="prop" distorted="true" scale="0.5" rotate="0.0" />
 
 
 	<!-- 顶部logo -->
-	<hotspot name="peaklogo" visible="false" keep="true" url="masking.png" ath="0" atv="-90" width="26%" height="prop" handcursor="false" zoom="true" distorted="true" scale="0.5" rotate="0.0" />
+	<hotspot name="peaklogo" renderer="css3d"	visible="false" keep="true" url="masking.png" ath="0" atv="-90" width="26%" height="prop" handcursor="false" zoom="true" distorted="true" scale="0.5" rotate="0.0" />
 
 	<action name="animationComplete">
 			set(control.usercontrol, all);

+ 1 - 1
packages/qjkankan-view/src/components/assembly/Tags/metas/fixaudio.vue

@@ -51,7 +51,7 @@
         >
         </i>
         <!-- <ui-icon @click="$emit('close')" type="player_close"></ui-icon> -->
-        <i @click="$emit('close')" class="iconfont icon-close"> </i>
+        <i @click="$emit('close')" class="iconfont icon-close-middle"> </i>
       </div>
     </div>
 

+ 144 - 91
packages/qjkankan-view/src/utils/wxshare.js

@@ -1,107 +1,160 @@
 function toConfigure() {
-    return new Promise((resolve, reject) => {
-        $.ajax({
-            url: '//www.4dage.com/wechat/jssdk/share',
-            type: "get",
-            data: {
-                uri: location.href.split("#")[0],
-                name: "厦门四维时代微信公众号"
-            },
-            dataType: "jsonp",
-            //jsonpCallback: "success_jsonp",
-            success: function (data, textStatus) {
-                wx.config({
-                    debug: false,
-                    appId: data.appId,
-                    timestamp: data.timestamp,
-                    nonceStr: data.nonceStr,
-                    signature: data.signature,
-                    jsApiList: ['checkJsApi',
-                        'updateAppMessageShareData',
-                        'updateTimelineShareData',
-                        'onMenuShareQQ',
-                        'onMenuShareWeibo', 'hideMenuItems',
-                        'showMenuItems', 'hideAllNonBaseMenuItem',
-                        'showAllNonBaseMenuItem', 'translateVoice',
-                        'startRecord', 'stopRecord', 'onRecordEnd',
-                        'playVoice', 'pauseVoice', 'stopVoice',
-                        'uploadVoice', 'downloadVoice', 'chooseImage',
-                        'previewImage', 'uploadImage', 'downloadImage',
-                        'getNetworkType', 'openLocation', 'getLocation',
-                        'hideOptionMenu', 'showOptionMenu', 'closeWindow',
-                        'scanQRCode', 'chooseWXPay',
-                        'openProductSpecificView', 'addCard', 'chooseCard',
-                        'openCard'
-                    ]
-                });
-                resolve()
-            },
-            error: function (XMLHttpRequest, textStatus, errorThrown) {
-                reject("jsonp.error:" + textStatus)
-            }
+  return new Promise((resolve, reject) => {
+    $.ajax({
+      url: "//www.4dage.com/wechat/jssdk/share",
+      type: "get",
+      data: {
+        uri: location.href.split("#")[0],
+        name: "厦门四维时代微信公众号",
+      },
+      dataType: "jsonp",
+      //jsonpCallback: "success_jsonp",
+      success: function (data, textStatus) {
+        wx.config({
+          debug: false,
+          appId: data.appId,
+          timestamp: data.timestamp,
+          nonceStr: data.nonceStr,
+          signature: data.signature,
+          jsApiList: [
+            "checkJsApi",
+            "updateAppMessageShareData",
+            "updateTimelineShareData",
+            "onMenuShareAppMessage",
+            "onMenuShareTimeline",
+            "updateTimelineShareData",
+            "onMenuShareQQ",
+            "onMenuShareWeibo",
+            "hideMenuItems",
+            "showMenuItems",
+            "hideAllNonBaseMenuItem",
+            "showAllNonBaseMenuItem",
+            "translateVoice",
+            "startRecord",
+            "stopRecord",
+            "onRecordEnd",
+            "playVoice",
+            "pauseVoice",
+            "stopVoice",
+            "uploadVoice",
+            "downloadVoice",
+            "chooseImage",
+            "previewImage",
+            "uploadImage",
+            "downloadImage",
+            "getNetworkType",
+            "openLocation",
+            "getLocation",
+            "hideOptionMenu",
+            "showOptionMenu",
+            "closeWindow",
+            "scanQRCode",
+            "chooseWXPay",
+            "openProductSpecificView",
+            "addCard",
+            "chooseCard",
+            "openCard",
+          ],
         });
-    })
+        resolve();
+      },
+      error: function (XMLHttpRequest, textStatus, errorThrown) {
+        reject("jsonp.error:" + textStatus);
+      },
+    });
+  });
 }
 
 function strToJSON(search) {
-    let args = search.substr(1).split('&')
-    let obj = {}
-    args.forEach(arg => {
-        let index = arg.indexOf('=')
-        if (!~index) {
-            obj[arg] = null
-        } else {
-            obj[arg.substr(0, index)] = arg.substr(index + 1)
-        }
-    })
+  let args = search.substr(1).split("&");
+  let obj = {};
+  args.forEach((arg) => {
+    let index = arg.indexOf("=");
+    if (!~index) {
+      obj[arg] = null;
+    } else {
+      obj[arg.substr(0, index)] = arg.substr(index + 1);
+    }
+  });
 
-    return obj
+  return obj;
 }
 
 function jsonToStr(data) {
-    let strs = []
-    Object.keys(data).forEach(k => {
-        if (data[k] !== null) {
-            strs.push(`${k}=${data[k]}`)
-        }
-    })
-    return '?' + strs.join('&')
+  let strs = [];
+  Object.keys(data).forEach((k) => {
+    if (data[k] !== null) {
+      strs.push(`${k}=${data[k]}`);
+    }
+  });
+  return "?" + strs.join("&");
 }
 
-
 function setup({ title, link, imgUrl, desc }) {
-    let defaultFn = () => { }
-    let defaultChar = ''
-    let search = link.substr(link.indexOf('?'))
-    let path = link.substr(0, link.indexOf('?'))
-    let data = strToJSON(search)
+  let defaultFn = () => {};
+  let defaultChar = "";
+  let search = link.substr(link.indexOf("?"));
+  let path = link.substr(0, link.indexOf("?"));
+  let data = strToJSON(search);
 
-
-
-    wx.ready(function () {
-        // 微信朋友圈
-        data.open = 'wx_friends'
-        // wx.onMenuShareTimeline({ title, link: path + jsonToStr(data), imgUrl, desc });
-        wx.updateTimelineShareData({ title, link: path + jsonToStr(data), imgUrl, desc });
-        // 微信好友
-        data.open = 'wx_friend'
-        wx.updateAppMessageShareData({ title, desc, link: path + jsonToStr(data), imgUrl, type: defaultChar, dataUrl: defaultChar })
-        // 微博
-        data.open = 'weibo'
-        wx.onMenuShareWeibo({ title, desc, link: path + jsonToStr(data), imgUrl, success: defaultFn, cancel: defaultFn });
-        // 空间
-        data.open = 'qq_zone'
-        wx.onMenuShareQZone({ title, desc, link: path + jsonToStr(data), imgUrl, success: defaultFn, cancel: defaultFn });
-        // QQ好友
-        data.open = 'qq'
-        wx.onMenuShareQQ({ title, desc, link: path + jsonToStr(data), imgUrl, success: defaultFn, cancel: defaultFn });
-        wx.error(function (e) { })
-    })
+  wx.ready(function () {
+    // 微信朋友圈
+    data.open = "wx_friends";
+    // wx.onMenuShareTimeline({ title, link: path + jsonToStr(data), imgUrl, desc });
+    wx.updateTimelineShareData({
+      title,
+      link: path + jsonToStr(data),
+      imgUrl,
+      desc,
+    });
+    // 微信好友
+    data.open = "wx_friend";
+    wx.updateAppMessageShareData({
+      title,
+      desc,
+      link: path + jsonToStr(data),
+      imgUrl,
+      type: defaultChar,
+      dataUrl: defaultChar,
+    });
+    // 微博
+    data.open = "weibo";
+    wx.onMenuShareWeibo({
+      title,
+      desc,
+      link: path + jsonToStr(data),
+      imgUrl,
+      success: defaultFn,
+      cancel: defaultFn,
+    });
+    // 空间
+    data.open = "qq_zone";
+    wx.onMenuShareQZone({
+      title,
+      desc,
+      link: path + jsonToStr(data),
+      imgUrl,
+      success: defaultFn,
+      cancel: defaultFn,
+    });
+    // QQ好友
+    data.open = "qq";
+    wx.onMenuShareQQ({
+      title,
+      desc,
+      link: path + jsonToStr(data),
+      imgUrl,
+      success: defaultFn,
+      cancel: defaultFn,
+    });
+    wx.error(function (e) {});
+  });
 }
 
 export default async (args) => {
-    if (typeof wx != "undefined") { //需要引入 https://res.wx.qq.com/open/js/jweixin-1.2.0.js
-        await toConfigure()
-        setup(args)
-    }
-}
+  if (typeof wx != "undefined") {
+    //需要引入 https://res.wx.qq.com/open/js/jweixin-1.2.0.js
+    await toConfigure();
+    setup(args);
+  }
+};