فهرست منبع

修改houseid取值逻辑

zjs_project 1 سال پیش
والد
کامیت
d34377a2d7
5فایلهای تغییر یافته به همراه15 افزوده شده و 18 حذف شده
  1. 4 0
      src/App.vue
  2. 2 18
      src/pages/webgl_rxdz/webgl_rxdz.vue
  3. 5 0
      src/store/actions.js
  4. 3 0
      src/store/mutations.js
  5. 1 0
      src/store/state.js

+ 4 - 0
src/App.vue

@@ -43,9 +43,13 @@
 		},
 		created() {
 			let userId = this.$route.query.leavePhoneCustomerId ? this.$route.query.leavePhoneCustomerId : '129130';
+			let xcxHouseId = this.$route.query.xcxHouseId ? this.$route.query.xcxHouseId : '100296';
 			if (userId) { //如果存在用户id
 				this.$store.dispatch('setUserId', userId);
 			}
+			if (xcxHouseId) { //如果存在houseid
+				this.$store.dispatch('setHouseId', xcxHouseId);
+			}
 			let isIOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
 			this.isIOS = isIOS;
 			window.addEventListener('error', (error) => {

+ 2 - 18
src/pages/webgl_rxdz/webgl_rxdz.vue

@@ -32,7 +32,7 @@
 				pvCurPageName: "home_show",
 				locusBehaviorName: "主界面",
 				pvCurPageParams: null,
-				houseId: "100296",
+				houseId: "",
 				pvId: 'p_2cmina_23080401',
 				canvas:null,
 				navbar: {
@@ -166,7 +166,7 @@
         mounted() {
 			console.log("***onLoad-webgl_rxdz***", this.$route.query)
 			var that = this;
-			this.houseId = this.$route.query && this.$route.query.houseId ? this.$route.query.houseId : '100296';//
+			this.houseId = this.$store.state.houseId || '';
 			this.childLayout = '0';//4-测试户型
 			let unit = window.screen.width / 750;//单位rpm 对应 px 的值
 			that.canvasHeight = window.screen.height - (200 * unit) + (20 * unit);
@@ -1663,22 +1663,6 @@
 				setTimeout(()=> {
 					this.repeatFlag = false;
 				}, 1000);
-				// uni.navigateTo({
-				//     url: '/webgl/pages/webgl_rxdz_roam/webgl_rxdz_roam?houseId='+this.houseId,
-				// 	success: (res)=> {
-				// 		// 通过eventChannel向被打开页面传送数据
-				// 		res.eventChannel.emit('acceptDataFromOpenerPage', {
-				// 			data: data
-				// 		})
-				// 		this.showLables = true;
-				// 	},
-				//     fail: (res) =>{
-				//         console.log(res)
-				//     },
-				// 	complete: (res) => {
-				// 		this.repeatFlag = false;
-				// 	}
-				// });
 			},
 			//obj 物体对象,type 是否改变颜色
 			moveMeshCenter(obj,type){

+ 5 - 0
src/store/actions.js

@@ -34,6 +34,11 @@ const actions = {
 	}, wallList) {
 		commit('SET_WALLLIST', wallList)
 	},
+	setHouseId({
+		commit
+	}, houseId) {
+		commit('SET_HOUSEID', houseId)
+	},
 	// setCityListData({
 	// 	commit
 	// }, cityListData) {

+ 3 - 0
src/store/mutations.js

@@ -14,6 +14,9 @@ const mutations = {
 	SET_USERID(state, userId) {
 		state.userId = userId
 	},
+	SET_HOUSEID(state, houseId) {
+		state.houseId = houseId
+	},
 	SET_AIDATA(state, aiData) {
 		state.aiData = aiData
 	},

+ 1 - 0
src/store/state.js

@@ -4,6 +4,7 @@ const state = {
 	loadingMsg:"",
 	account:null,	//账号
 	userId:'',	//用户id-小程序当中提供的
+	houseId:'',	//项目id-小程序当中提供的
 	curHouseObj:null,
 	wallList:null,	//墙体数据
 	aiData:null,	//AI生成的数据