Browse Source

本地化场景配置修改

shaogen1995 2 years ago
parent
commit
66cf9d93ca

+ 2 - 2
H5场景本地化/public/static/css/css/main.css

@@ -831,7 +831,7 @@ hr {
 
 .icon-fullscreen-exit:before {
     content: "";
-    background: url("https://super.4dage.com/images/narrow_off.png") center top no-repeat;
+    background: url("../../images/narrow_off.png") center top no-repeat;
     background-size: 100%;
     display: inline-block;
     width: 24px;
@@ -840,7 +840,7 @@ hr {
 
 .icon-fullscreen:before {
     content: "";
-    background: url("https://super.4dage.com/images/enlarge_on.png")center top no-repeat;
+    background: url("../../images/enlarge_on.png")center top no-repeat;
     background-size: 100%;
     display: inline-block;
     width: 24px;

+ 1 - 1
H5场景本地化/public/static/css/css/oldVer/main0.css

@@ -52,7 +52,7 @@ iframe{
 	opacity:0.1; 
 }
 #closepop {
-	background: url(https://super.4dage.com/images/close1.png) no-repeat;
+	background: url('../../../images/close1.png') no-repeat;
 	width: 60px;
 	height: 60px;
 	cursor: pointer;

+ 3 - 3
H5场景本地化/public/static/js/loadCAD.js

@@ -15,7 +15,7 @@ window.grendCAD = (function grendCAD() {
     if (initScript) return cb()
 
     let $script = document.createElement('script')
-    $script.src = '//www.4dmodel.com/CAD/bundle.js'
+    $script.src = 'static/js/bundle.js'
     $script.onload = function() {
       initScript = true
       cb()
@@ -121,7 +121,7 @@ window.grendCAD = (function grendCAD() {
 
 
 $.ajax({
-  url: g_Prefix + "data/" + window.number + "/someData.json" + "?" + Date.now(),
+  url: "../../data/" + window.number + "/someData.json" + "?" + Date.now(),
   method: 'GET',
   success(data) {
     if (!data.showCad) return
@@ -129,7 +129,7 @@ $.ajax({
 
     
     $.ajax({
-      url: '//super.4dage.com/data/'+ window.number +'/floor.json', 
+      url: '../../data/'+ window.number +'/floor.json', 
       method: 'GET',
       success(res) {
         grendCAD(res, document.querySelector('body'), data.cadSignColor, data.cadBorderColor, data.cadBorderWidth)

+ 8 - 2
H5场景本地化/public/static/js/main_2020_show.js

@@ -14461,7 +14461,7 @@ window.Modernizr = function(n, e, t) {
                 
                 window.wx && manage.weixinShare();  
                 //初始画面
-                data.camera_start && data.camera_start.thumbImg && E(data.camera_start.thumbImg)
+                data.camera_start && data.camera_start.thumbImg && E(manage.dealURL(data.camera_start.thumbImg))
                 function E(e) {
                     $("<img/>").attr("src", e).on("load", function() {
                         $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
@@ -17075,7 +17075,13 @@ window.Modernizr = function(n, e, t) {
                         if (cameraMode === a.MESH) return 
                                      
                         
-                        if(window.isLocal)src = manage.dealURL(src)
+                        if(window.isLocal){
+                            src = manage.dealURL(src)
+                            //本地文件莫名少了个"."
+                            if(src[src.length-1]=='.'){
+                               src = src.slice(0,-1) 
+                            }
+                        }
                         else src = "one" === g_version ? g_Prefix + src + "?" + randomTime().getTime() :  src + "?" + randomTime().getTime()
                          
                         var l = { 

+ 7 - 4
H5场景本地化/public/static/js/manage.js

@@ -1,12 +1,14 @@
   
 var g_ProjectName=window.location.pathname.substring(window.location.pathname.indexOf("/")+1,window.location.pathname.lastIndexOf("/"));
-var g_Prefix="https://super.4dage.com/";
+// var g_Prefix="https://super.4dage.com/";
 // var g_Prefix="http://project.4dage.com:8017/";//有自己的大场景编辑后台的 - 线上场景调试
 // var g_Prefix=window.origin+'/';//有自己的大场景编辑后台的 - 打包
-// var g_Prefix=window.location.href.substring(0,window.location.href.indexOf("/index.html")+1);
+var g_Prefix=window.location.href.substring(0,window.location.href.indexOf("/index.html")+1);
 var s = window.location.href.split('/');
     s.pop();
 //var g_Prefix = s.join('/');
+window.isLocal = true
+
 var g_index=null;
 var g_modeldata=null;
 
@@ -85,7 +87,8 @@ var settings = {
     tourRotTime:2,  //默认停留2秒
     //dontExamHot:true  
     transparentBg: false,
-    bgImg:  null 
+    bgImg:  null,
+    localPrefix: ''
 }
 if(window.number == '725'||window.number == '724'){
     settings.mobileNavHigh = true
@@ -353,7 +356,7 @@ var Manage = function(){
     this.weixinURL = "https://res.wx.qq.com/open/js/jweixin-1.2.0.js",
     this.time = "?"+new Date().getTime();
     this.loadAudio();
-    this.loadWeixin();
+    // this.loadWeixin();
 }
 //动态加载js文件
 Manage.prototype.LoadJs = function(_files, succes){

+ 3 - 2
H5场景本地化/public/static/js/myShow.js

@@ -1,7 +1,8 @@
 var g_ProjectName=window.location.pathname.substring(window.location.pathname.indexOf("/")+1,window.location.pathname.lastIndexOf("/"));
-var g_Prefix="https://super.4dage.com/";
-// var g_Prefix=window.location.href.substring(0,window.location.href.indexOf("/index.html")+1);
+// var g_Prefix="https://super.4dage.com/";
+var g_Prefix=window.location.href.substring(0,window.location.href.indexOf("/index.html")+1);
 var s = window.location.href.split('/');
+window.isLocal = true
 s.pop();
 //var g_Prefix = s.join('/');
 var g_index=null;

+ 14 - 2
定制化热点/src/views/Home.vue

@@ -8,7 +8,15 @@
       <div class="imgBox" :class="{ imgBoxOne: !myTxt }">
         <Swiper class="warpper" ref="mySwiper" :options="swiperOptions">
           <SwiperSlide v-for="item in myImgArr" :key="item">
-            <img :src="item" alt="" @click="lookImg(item)" />
+            <!-- 线上数据 -->
+            <!-- <img :src="item" alt="" @click="lookImg(item)" /> -->
+
+            <!-- 本地化部署 -->
+            <img
+              :src="item.replace('https://super.4dage.com', '')"
+              alt=""
+              @click="lookImg(item.replace('https://super.4dage.com', ''))"
+            />
           </SwiperSlide>
         </Swiper>
         <!-- 索引 -->
@@ -71,7 +79,11 @@ export default {
     },
     async getData() {
       // https://www.4dmodel.com/
-      let url = `https://super.4dage.com/data/${
+
+      //线上数据
+      // let url = `https://super.4dage.com/data/${
+      let url = `/data/${
+        //本地化部署
         this.id
       }/hot/js/data.js?time=${Math.random()}`;
       let result = (await this.$http.get(url)).data;