zjs_project 1 rok temu
rodzic
commit
e65f23ea74

+ 4 - 1
src/App.vue

@@ -1,6 +1,9 @@
 <template>
 	<div id="app">
-		<router-view v-if="isRouterAlive" />
+		<keep-alive>
+			<router-view v-if="$route.meta.keepAlive" />
+		</keep-alive>
+		<router-view v-if="!$route.meta.keepAlive" />
 		<div class="loadingShadow" v-show="loading">
 			<div class="loadData">
 				<img src="https://skyforest.static.elaber.cn/detail/loading.gif" alt="" />

+ 2 - 2
src/components/newBottomCom/viewMask/viewMask.html

@@ -71,8 +71,8 @@
 			</div>
 		</div>
 	</div>
-	<!-- <div class="loadData" v-show="myloading">
+	<div class="loadData" v-show="myloading">
 		<img src="https://skyforest.static.elaber.cn/detail/loading.gif" alt="" />
 		<div class="loadingMsg">{{loadingMsg}}</div>
-	</div> -->
+	</div>
 </div>

+ 1 - 0
src/components/newBottomCom/viewMask/viewMask.scss

@@ -311,6 +311,7 @@
     flex-direction: column;
     align-items: center;
     justify-content:center;
+	font-size:18rem;
     img{
         width:90px;
 		margin-top: 10px;

+ 14 - 45
src/components/newBottomCom/viewMask/viewMask.vue

@@ -104,8 +104,8 @@
 						englishRemark: "room",
 					},
 				],
-				// myloading:false,
-				// loadingMsg:'',
+				myloading:false,
+				loadingMsg:'',
 			}
 		},
 		props:{
@@ -218,7 +218,7 @@
 			        },
 			    }
 			    util.trackRequest(para);
-				if(navigator.userAgent.includes('miniProgram')){
+				if(navigator.userAgent.toLocaleLowerCase().includes('micromessenger')){
 					this.showToast("请长按图片保存!");
 				}else{
 					this.saveImageHandle(_resultImg);
@@ -256,36 +256,7 @@
 					}
 				};
 				util.trackRequest(param);
-				this.downloadIamge(_resultImg)
-				//表示图是临时文件,则可以直接保存
-				// if (_resultImg.startsWith("http://tmp/") || _resultImg.startsWith("wxfile://")) {
-				//     uni.saveImageToPhotosAlbum({
-				//         filePath: _resultImg,
-				//         success(result) {
-				//             this.showToast("保存成功!");
-				//         },
-				//         fail(err) {
-				//             // uni.hideLoading();
-				//         }
-				//     })
-				// } else { //表示该图是网络图片,需要先下载才能保存
-				//     console.log("***getSetting.save***网络图片", _resultImg);
-				//     uni.downloadFile({
-				//         url: _resultImg,
-				//         success: function(res) {
-				//             uni.saveImageToPhotosAlbum({
-				//                 filePath: res.tempFilePath,
-				//                 success(result) {
-				// 					this.showToast("保存成功!");
-				//                 },
-				//                 fail(err) {
-				//                 }
-				//             })
-				//         },
-				//         fail(err) {
-				//         }
-				//     });
-				// }
+				this.downloadIamge(_resultImg);
 			},
 		
 			//选项变更
@@ -363,9 +334,9 @@
 				if (this.img2imgTimer) {
 					clearInterval(this.img2imgTimer);
 					this.img2imgTimer = null;
-					this.random = 1;
-					// this.myloading = false;
 				}
+				this.random = 1;
+				this.myloading = false;
 			},
 			//风格选择
 			selectStyle(idx){
@@ -402,10 +373,10 @@
 			
 				this.clearInterval();
 				if(!this.showAIImage){
-					// this.myloading = true;
-					// this.loadingMsg = "设计中...";
-					this.$store.state.loading = true;
-					this.$store.state.loadingMsg="设计中...";
+					this.myloading = true;
+					this.loadingMsg = "设计中...";
+					// this.$store.state.loading = true;
+					// this.$store.state.loadingMsg="设计中...";
 				}
 				
 				// this.inputBase64Url = await this.shottingAction(2);//开始截图-返回的是base64的数据
@@ -622,7 +593,6 @@
 							if(this.$parent && typeof(this.$parent.clearHandle)=="function" ){
 								this.$parent.clearHandle();
 							}
-							// this.aiData;
 							let cpAiData = JSON.parse(JSON.stringify(this.aiData)) || []
 							if(cpAiData){//给上一个页面回传生成的数据
 								let space = cpAiData.find(it=>{
@@ -660,14 +630,13 @@
 								this.clearInterval();
 							}else {
 								this.random = parseInt(this.count * 2);
-								if(this.random>100){
+								if(this.random>=100){
 									this.random = 99;
 								}
 								if(!this.showAIImage){
-									this.$store.state.loadingMsg='生成中…' + this.random + '%';
-									// this.loadingMsg = '生成中…' + this.random + '%';
+									// this.$store.state.loadingMsg='生成中…' + this.random + '%';
+									this.loadingMsg = '生成中…' + this.random + '%';
 								}else{
-									// this.myloading = false;
 								}
 							}
 						}
@@ -684,7 +653,7 @@
 				this.$store.state.loadingMsg = title || "";
 				setTimeout(()=>{
 					this.$store.state.loading = false;
-				}, 1500);
+				}, 3000);
 			}
 		}
 	}

+ 1 - 1
src/mixins/screenshot.js

@@ -122,7 +122,7 @@ export default {
 			let data = {
 				"base64Str": file,
 			};
-			let result = await requestConfig("uploadBase64", data);
+			let result = await requestConfig("uploadBase64", data, true);
 			console.log(result, 'gggggg');
 			if (result && result.success) {
 				let shottingImg = result.single.filePath;

+ 4 - 3
src/pages/webgl_rxdz/webgl_rxdz.vue

@@ -139,10 +139,10 @@
 				console.log("当前墙体值变化", newVal, oldVal);
 			}
 		},
-		destroyed() {
+		beforeDestroy() {
 			cancelAnimationFrame(requestId, this.canvas)
 			this.worker && this.worker.terminate()
-			setTimeout(() => {
+			// setTimeout(() => {
 				if (this.renderer instanceof THREE.WebGLRenderer) {
 					this.renderer.dispose()
 					this.renderer.forceContextLoss()
@@ -160,7 +160,8 @@
 				this.instancedFurList = [];
 				this.wallList = [];
 				TWEEN && TWEEN.removeAll();//清除所有的tween;
-			}, 0)
+			// }, 0)
+			console.warn("***beforeDestroy-webgl_rxdz***");
 		},
         mounted() {
 			var that = this;

+ 3 - 3
src/pages/webgl_rxdz_customize/webgl_rxdz_customize.html

@@ -8,9 +8,9 @@
             <div class="master-pic">
 				<el-carousel :autoplay="false" :loop="false" :indicator-dots="false"
 					@change="swiperChangeImg" class="master-pic-swiper" 
-					:current="currImgIdx" >
+					:current="currImgIdx" ref="carousel">
                     <el-carousel-item v-for="(img,s) in hardboundEffect" :key="s" :item-id="s" class="master-pic-img">
-                        <img class="master-pic-img" :src="img" mode="aspectFill" />
+                        <img @touchstart="mytouchstart" @touchmove="mytouchmove" @touchend="mytouchend" class="master-pic-img" :src="img" mode="aspectFill" />
 						<div class="lookHouseView rows justify-center" v-if="tabIndex==0 && (!shareUserId || shareUserId==userId)" @click="toMode">
 							<img class="icon-ai" src="https://dm.static.elab-plus.com/miniProgram/iconfont/icon-ai.png" mode="widthFix"/>
 							查看户型
@@ -74,7 +74,7 @@
 				分享好友可获得私定高额优惠
 			</div>
 			<div class="rows rows-between">
-				<div class="bottom-btn btn-qw rows justify-center" @click="navigateFuc" data-jumplink="客服链接" data-jumptype="50" data-jumpvalue="企业id">
+				<div class="bottom-btn btn-qw rows justify-center" @click="navigateFuc">
 				    加企微 · 定制服务
 				</div>
 				<div class="bottom-btn btn-share rows justify-center" @click="optionChange(true)">

+ 26 - 76
src/pages/webgl_rxdz_customize/webgl_rxdz_customize.vue

@@ -5,12 +5,13 @@
     const util = require('@/utils/util.js').default;
 	const config = require('@/services/urlConfig.js');
 	import router from "@/router";
+	import touchHandle from '@/mixins/touchHandle.js';
 // const app = getApp(); //获取应用实例
 // import requestConfig from '@/static/lib/requestConfig.js';
 // import commonPageMethod from '@/common/commonPageMethod.js';
 // import commonMethod from '@/common/commonMethod.js';
 export default {
-    // mixins: [commonPageMethod,commonMethod],
+    mixins: [touchHandle],
     /**
      * 页面的初始数据
      */
@@ -64,10 +65,7 @@ export default {
         // this.spaceId = this.$route.query.spaceId?this.$route.query.spaceId:'';
         this.id = this.$route.query.id?this.$route.query.id:'6523d91af65c626211ee21c8';
 		if(!this.id){
-			uni.showToast({
-				icon: "none",
-				title: "没有数据!",
-			});
+			this.showToast("没有数据!");
 			return false;
 		}else{
 			this.getIdData();
@@ -85,8 +83,23 @@ export default {
 			this.currImgIdx = e.detail ? e.detail.current : e;
 			this.gsImage =  this.hardboundEffect[this.currImgIdx];//获取高斯模糊的图片
         },
+		rightScroll(){//右滑
+			if(this.currImgIdx <= (this.hardboundEffect.length - 1) && this.currImgIdx > 0){
+				this.$refs.carousel.prev();
+			}
+		},
+		leftScroll(){//继续生成
+			if(this.currImgIdx != this.hardboundEffect.length - 1){
+				if(this.currImgIdx<this.hardboundEffect.length - 1){
+					this.$refs.carousel.next();
+				}
+			}
+		},
         navigateFuc(){
-			
+			this.showToast("敬请期待!");
+		},
+		optionChange(){
+			this.showToast("敬请期待!");
 		},
         async getIdData(){
 			let userId = this.userId || '';
@@ -163,18 +176,6 @@ export default {
         },
         
         toMode(){
-			// uni.navigateTo({
-			// 	url: '/webgl/pages/webgl_rxdz_look/webgl_rxdz_look?houseId='+this.houseId,
-			// 	success: (res)=> {
-			// 		// 通过eventChannel向被打开页面传送数据
-			// 		res.eventChannel.emit('acceptDataFromOpenerPage', {
-			// 			layoutStruct:this.layoutStruct,
-			// 		})
-			// 	},
-			// 	fail: function(res) {
-			// 		console.log(res)
-			// 	},
-			// })
 			let data = {
 				houseId:this.houseId,
 				id:this.id,
@@ -193,64 +194,13 @@ export default {
 			};
 			util.trackRequest(param);
 		},
-        async afterShareOptionHandle(e) {
-            let sign = await app.setShareToken({
-                subtype: 'project',
-                houseId: this.houseId,
-                attrs: {
-                    shareType: 'qrcode',
-                    fromProject: app.globalData.projectShare,
-                    id: this.id,
-					shareUserId:this.shareUserId,
-                }
-            });
-			let shareImg = this.gsImage;
-            let obj = {
-                type: 8,
-                path: '/webgl/pages/webgl_rxdz_customize/webgl_rxdz_customize',
-                shareToken: sign || app.globalData.shareToken,
-                houseId: (this.houseId || ''),
-                logo: app.globalData.houseProject.logo || "",
-                gpName: app.globalData.houseProject.projectName || '',
-				mountHuangXcx:true,
-            };
-            if(shareImg){
-                obj.defaultImage = shareImg
-            }
-            app.globalData.shareCardData = JSON.stringify(obj);
-            uni.navigateTo({
-                url: '/pages/shareCard/shareCard?houseId=' + (this.houseId || ''),
-            })
-        },
-        /**
-         * 用户点击右上角分享
-         */
-        onShareAppMessage(options) {
-            let param = {
-                type: 'CLK', //埋点类型
-                clkId: 'clk_2cmina_18', //点击ID
-                clkName: 'system-share', //点击前往的页面名称
-                clkParams: {
-                    from: options.from
-                }
-            };
-            util.trackRequest(param);
-            let sharePath = this.shareInitPath();
-            let shareUserParam = "";
-            shareUserParam = ('&shareUserId='+((app.globalData.single && app.globalData.single.id) ? app.globalData.single.id : ''));
-            if(app.globalData.executeToHelpShare){//帮好友转发分享
-                shareUserParam = ('&shareUserId='+this.shareUserId);
-            }
-            app.globalData.executeToHelpShare = false;
-            let path = '/webgl/pages/webgl_rxdz_customize/webgl_rxdz_customize?' + sharePath + shareUserParam + '&id=' + this.id;
-            console.log(path)
-            let shareImg = this.gsImage;
-            return {
-                imageUrl: shareImg || app.globalData.shareImage || '',
-                title: app.globalData.projectName || '',
-                path: path
-            }
-        },
+        showToast(title){
+        	this.$store.state.loading = true;
+        	this.$store.state.loadingMsg = title || "";
+        	setTimeout(()=>{
+        		this.$store.state.loading = false;
+        	}, 1500);
+        }
     }
     
 }

+ 1 - 1
src/pages/webgl_rxdz_look/webgl_rxdz_look.vue

@@ -83,7 +83,7 @@
         watch:{
 
         },
-		destroyed() {
+		beforeDestroy() {
 			cancelAnimationFrame(requestId, this.canvas)
 			this.worker && this.worker.terminate()
 			setTimeout(() => {

+ 2 - 1
src/pages/webgl_rxdz_roam/webgl_rxdz_roam.vue

@@ -93,7 +93,7 @@
 				// ]
             }
         },
-		destroyed() {
+		beforeDestroy() {
 			cancelAnimationFrame(requestId, this.canvas)
 			this.worker && this.worker.terminate()
 			// setTimeout(() => {
@@ -107,6 +107,7 @@
 				}
 				TWEEN && TWEEN.removeAll();//清除所有的tween;
 			// }, 0)
+			console.warn("***beforeDestroy-webgl_rxdz_roam***");
 		},
         mounted(options) {
 			var that = this;

+ 4 - 1
src/router/index.js

@@ -25,7 +25,10 @@ const router = new Router({
 		{
 		    path: '/pages/webgl_rxdz',
 		    name: 'webgl_rxdz',
-		    component: webgl_rxdz
+		    component: webgl_rxdz,
+			meta:{
+				keepAlive:true
+			}
 		},
         {
             path: '/pages/webgl_rxdz_roam',