tremble пре 3 година
родитељ
комит
bfc77a058b

+ 5 - 0
.env

@@ -12,3 +12,8 @@ VUE_APP_STATIC_DIR=viewer
 
 # 云存储环境
 VUE_APP_REGION_URL=aws
+
+
+# 接口请求地址
+VUE_APP_APIS_URL=http://192.168.0.38:8888/
+

+ 5 - 1
.env.development

@@ -10,4 +10,8 @@ VUE_APP_STATIC_DIR=viewer
 
 
 # 云存储环境
-VUE_APP_REGION_URL=
+VUE_APP_REGION_URL=
+
+# 接口请求地址
+VUE_APP_APIS_URL=http://192.168.0.38:8888/
+

+ 18 - 0
.env.prod

@@ -0,0 +1,18 @@
+
+# 场景资源地址
+VUE_APP_RESOURCE_URL=https://eurs3.4dkankan.com/
+# 静态资源地址
+VUE_APP_CDN_URL=https://4dkk.4dage.com/v4/www/
+# sdk文件地址
+VUE_APP_SDK_DIR=https://eurs3.4dkankan.com/v4/cdfg/sdk
+
+
+# 静态资源目录
+VUE_APP_STATIC_DIR=viewer
+
+# 云存储环境
+VUE_APP_REGION_URL=aws
+
+# 接口请求地址
+VUE_APP_APIS_URL=https://vr.cdfmembers.com/
+

+ 1 - 0
package.json

@@ -4,6 +4,7 @@
   "private": true,
   "scripts": {
     "serve": "vue-cli-service serve",
+    "serve-prod": "vue-cli-service serve --mode prod",
     "build": "vue-cli-service build",
     "lint": "vue-cli-service lint"
   },

BIN
public/viewer/marker.png


+ 27 - 35
src/app.vue

@@ -182,21 +182,19 @@ const onClickTagInfo = (el) => {
       type: "goodlist",
       data: item,
     });
-  } else if (item.type == "waterfall") {
-    store.commit("tag/setTagClickType", {
-      type: "waterfall",
-      data: item,
-    });
   }
 };
 
 onMounted(async () => {
-  apis.burying_point({type:0});
+  apis.burying_point({ type: 0 });
   app = createApp({
     num: browser.getURLParam("m"),
     dom: scene$.value,
     mobile: true,
     isLoadTags: false,
+    scene: {
+      markerURL: "https://eurs3.4dkankan.com/cdf/file/43aa29799bfd472298a47cc6370b10cc.png",
+    },
   });
   app.use("MinMap", { theme: { camera_fillStyle: "#ED5D18" } });
   app.use("Tag");
@@ -204,21 +202,7 @@ onMounted(async () => {
     .use("TagView", {
       render(data) {
         if (data.type == "waterfall") {
-          let arr = data.products.map((item) => item.price);
-          let priceMin = Math.min.apply(null, arr)
-          let priceMax = Math.max.apply(null, arr)
-          let price = priceMin==priceMax ? priceMax : `${priceMin}-${priceMax}`
-          let range = `${data.products[0].symbol} ${price}`;
-          return `<span class="tag-icon animate" style="background-image:url({{icon}})"></span>
-                      <div class="tag-body">
-                        <div data-id="${data.sid}" class="tag-commodity">
-                          <div  style="background-image:url(${data.products[0].pic})" class='tag-avatar'>
-                          </div>
-                          <p class="tag-title">${data.title}</p>
-                          <p class="tag-info">${range} | 查看 ></p>
-                        </div>
-                      </div>
-                  `;
+          return `<span class="tag-icon waterfall animate" style="background-image:url({{icon}})"></span>`;
         } else if (data.type == "coupon") {
           return `<span class="tag-icon coupon animate" style="background-image:url({{icon}})"></span>`;
         } else if (data.type == "applet_link") {
@@ -232,9 +216,9 @@ onMounted(async () => {
           return `<span class="tag-icon animate" style="background-image:url({{icon}})"></span>`;
         } else if (data.type == "commodity") {
           let arr = data.products.map((item) => item.price);
-          let priceMin = Math.min.apply(null, arr)
-          let priceMax = Math.max.apply(null, arr)
-          let price = priceMin==priceMax ? priceMax : `${priceMin}-${priceMax}`
+          let priceMin = Math.min.apply(null, arr);
+          let priceMax = Math.max.apply(null, arr);
+          let price = priceMin == priceMax ? priceMax : `${priceMin}-${priceMax}`;
           let range = `${data.products[0].symbol} ${price}`;
           return `<span class="tag-icon animate" style="background-image:url({{icon}})"></span>
                       <div class="tag-body">
@@ -261,10 +245,14 @@ onMounted(async () => {
               type: "treasure",
               data: tag,
             });
-          apis.burying_point({type:2});
-
+            apis.burying_point({ type: 2 });
+          } else if (tag.type == "waterfall") {
+            store.commit("tag/setTagClickType", {
+              type: "waterfall",
+              data: tag,
+            });
           } else if (tag.type == "applet_link") {
-            browser.openLink(tag.hotContent.liveLink)
+            browser.openLink(tag.hotContent.liveLink);
           } else if (tag.type == "link_scene") {
             let sceneFirstView = tag.hotContent.sceneFirstView;
             window.location.href = "".concat(window.location.pathname, "?").concat(`m=${sceneFirstView.num}&novideo=1&${sceneFirstView.sceneview}`);
@@ -274,12 +262,12 @@ onMounted(async () => {
 
       view.on("focus", (e) => {
         document.querySelectorAll("[xui_tags_view] >div").forEach((el) => {
-          if (el.getAttribute("data-tag-type") == "commodity" || el.getAttribute("data-tag-type") == "waterfall") {
+          if (el.getAttribute("data-tag-type") == "commodity") {
             el.querySelector(".tag-body").classList.remove("show");
             el.style.zIndex = "auto";
           }
         });
-        if (e.data.type == "commodity" || e.data.type == "waterfall") {
+        if (e.data.type == "commodity") {
           e.target.style.zIndex = "999";
           e.target.querySelector(".tag-body").classList.add("show");
           e.target.querySelector(".tag-commodity").removeEventListener("click", onClickTagInfo);
@@ -336,12 +324,12 @@ onMounted(async () => {
     store.commit("setFlying", false);
     store.commit("setPanoId", targetPano.id);
     if (app.Scene.isCurrentPanoHasVideo) {
-      apis.burying_point({type:5});
+      apis.burying_point({ type: 5 });
     }
   });
 
   app.Camera.on("pano.chosen", (pano) => {
-    apis.burying_point({type:4});
+    apis.burying_point({ type: 4 });
   });
   app.store.on("tour", async (tour) => {
     app.TourManager.load(tour);
@@ -372,12 +360,11 @@ onMounted(async () => {
 
   app.render();
 
-  document.addEventListener('visibilitychange',()=>{
+  document.addEventListener("visibilitychange", () => {
     if (document.hidden) {
-      apis.burying_point({type:1});
+      apis.burying_point({ type: 1 });
     }
-  })
-  
+  });
 });
 </script>
 <style lang="scss">
@@ -525,6 +512,11 @@ onMounted(async () => {
     }
   }
 
+  .waterfall {
+    width: 70px !important;
+    height: 70px !important;
+  }
+
   .applet_link {
     width: 64px !important;
     height: 64px !important;

BIN
src/assets/images/icon/logo.png


+ 6 - 3
src/components/Controls/Panel/Main.vue

@@ -23,7 +23,7 @@
         <div class="h3">專櫃導航</div>
         <div class="swiper-container" id="sw-navigation">
           <ul class="swiper-wrapper">
-            <li class="swiper-slide" :class="{liactive:item.sceneUrl === currentM}"  @click.stop="onClickShop(item)" v-for="(item, i) in brandlist" :key="i">
+            <li class="swiper-slide" :class="{liactive:item.sceneUrl === currentM && (item.inPosition.indexOf(currentPose)>-1)}"  @click.stop="onClickShop(item)" v-for="(item, i) in brandlist" :key="i">
               <div v-if="item.shopLogo" class="img" :style="{ 'background-image': `url(${item.shopLogo})` }"></div>
               <div class="name" v-if="item.shopName">
                 <span :class="{active:item.shopName.length>6}">
@@ -82,7 +82,9 @@ const currentCategory = ref({
 });
 
 const currentM = computed(()=>(browser.getURLParam("m")))
-console.log(currentM.value,'=============================');
+const currentPose = computed(()=>(browser.getURLParam("pose")))
+
+console.log(currentPose.value,'=============================');
 
 const isPlay = computed(() => {
   let status = store.getters["tour/isPlay"];
@@ -232,7 +234,8 @@ const onClickMenu = (item) => {
   if (item.id == "kefu") {
     let mglink =
       "https://webpage.qidian.qq.com/2/chat/h5/index.html?linkType=1&env=ol&kfuin=3009110132&fid=3655&key=9b4334768c39150ead3f23e11e5dc2e4&cate=7&source=0&isLBS=0&isCustomEntry=0&type=10&ftype=1&_type=wpa&qidian=true&_pid=kvrmvu.74cg11.l43qvbcu&translateSwitch=0&isSsc=0&roleValue=4&roleData=922223821";
-    window.location.href = mglink;
+    window.open(mglink,'_blank')
+
   } else if (item.id == "shopping") {
     browser.openLink("/subPackage/pages/shoppingcart/shoppingcart", "https://m.cdfmembers.com/shop/600667208/shoppingcart", "/pages/shoppingcart/main");
   }

+ 8 - 2
src/components/Tags/goods-list.vue

@@ -108,13 +108,19 @@ const onClickSku = (item) => {
 const addCart = async (item) => {
   Loading.show();
 
-  await apis.inCat({
+  let result = await apis.inCat({
     accessToken: browser.getURLParam("AccessToken"),
     skuId: item.currentSku.id,
     num: item.cartnum,
   });
+
+
   Loading.hide();
-  return Dialog.toast({ content: `添加成功`, type: 'success' })
+  if (result.data.status!=200) {
+   return Dialog.toast({ content: `添加成功`, type: 'success' })
+  } else{
+   return Dialog.toast({ content: `登录状态失效,添加失败`, type: 'error' })
+  }
   
 };
 

+ 16 - 1
src/components/openVideo/index.vue

@@ -3,7 +3,7 @@
     <div class="open-video">
       <!-- <div class="vmask"></div> -->
       <video x5-playsinline="true" playsinline="true" webkit-playsinline="true" class="video" ref="openvideo$" preload autoplay :src="videourl"></video>
-      <div v-show="videourl" @click.stop="emit('close')" class="jump">跳過</div>
+      <div v-show="videourl" @click.stop="countdown==0&&emit('close')" class="jump">{{countdown>0?countdown:'跳過'}}</div>
       <img v-show="videourl && bofanging" @click.stop="bofang" class="bofang" :src="require('@/assets/images/icon/bofang.png')" alt="" />
     </div>
   </transition>
@@ -15,6 +15,11 @@ import * as apis from "@/apis/index.js";
 const openvideo$ = ref(null);
 
 const videourl = ref(null);
+const countdown = ref(5);
+
+const timer = ref(null);
+
+
 const bofanging = ref(true);
 
 const emit = defineEmits(["close"]);
@@ -38,6 +43,16 @@ onMounted(() => {
       if (bofanging.value) {
         bofanging.value = false;
       }
+      if (countdown.value >0 && !timer.value) {
+        timer.value = setInterval(() => {
+          if (countdown.value ==0) {
+            clearInterval(timer.value)
+            timer.value=null
+            return
+          }
+          countdown.value --
+        }, 1000);
+      }
     });
 
     openvideo$.value.addEventListener("pause", () => {

+ 2 - 2
src/utils/browser.js

@@ -365,7 +365,7 @@ var browser = {
           }
         } else {
           if (h5link) {
-            window.location.href = h5link;
+            window.open(h5link,'_blank')
           }
           // 不在小程序里
         }
@@ -378,7 +378,7 @@ var browser = {
       }
     } else {
       if (h5link) {
-        window.location.href = h5link;
+        window.open(h5link, '_blank')
       }
     }
   },

+ 2 - 2
vue.config.js

@@ -19,11 +19,11 @@ module.exports = defineConfig({
     proxy: {
       "/service": {
         // target: "https://v4-test.4dkankan.com/",
-        target: 'http://192.168.0.38:8888/',
+        target: process.env.VUE_APP_APIS_URL,
         changeOrigin: true,
       },
       "/api": {
-        target: 'http://192.168.0.38:8888/',
+        target: process.env.VUE_APP_APIS_URL,
         changeOrigin: true,
       },
     },