wgl 4 лет назад
Родитель
Сommit
8a7780e70b

+ 1 - 1
config/project.js

@@ -1 +1 @@
-exports.name = 'business'
+exports.name = 'home'

+ 3 - 3
src/projects/business/views/HouseKeeper/Admin/Center.vue

@@ -34,11 +34,11 @@
 							<img src="~$project/assets/img/cicon17.png" width="18" /> 切换身份
 						</a>
 					</li>
-					<!-- <li class="mui-table-view-cell">
-						<a href="" class="mui-navigate-right">
+					<li class="mui-table-view-cell">
+						<a href="../home/#/?project=business&exchange=1" class="mui-navigate-right jump">
 							<img src="~$project/assets/img/exit.png" width="18" /> 退出帐号
 						</a>
-					</li> -->
+					</li>
 				</ul>
 			</div>
 		</div>

+ 3 - 3
src/projects/business/views/Master/Center.vue

@@ -53,11 +53,11 @@
 							<img src="~$project/assets/img/cicon17.png" width="18" /> 切换身份
 						</a>
 					</li>
-					<!-- <li class="mui-table-view-cell">
-						<a href="" class="mui-navigate-right">
+					<li class="mui-table-view-cell">
+						<a href="../home/#/?project=business&exchange=1" class="mui-navigate-right jump">
 							<img src="~$project/assets/img/exit.png" width="18" /> 退出帐号
 						</a>
-					</li> -->
+					</li>
 				</ul>
 			</div>
 		</div>

+ 3 - 0
src/projects/home/App.vue

@@ -8,6 +8,9 @@
 	export default {
 		name: 'Home',
 		mounted() {
+			mui('body').on('tap', '.kfz', function() {
+				mui.toast('开发中');
+			});
 			mui('body').on('tap', '.jump', function() {
 				document.location.href = this.href;
 			});

+ 30 - 10
src/projects/home/views/Home.vue

@@ -17,7 +17,7 @@
 							</div>
 						</a>
 					</li>
-					<!-- <li class="mui-table-view-cell mui-media vongi-choose-zz">
+					<li class="mui-table-view-cell mui-media vongi-choose-zz kfz">
 						<a class="mui-navigate-right">
 							<img class="mui-media-object mui-pull-left" src="~$project/assets/img/icon17.png">
 							<div class="mui-media-body">
@@ -26,7 +26,7 @@
 							</div>
 						</a>
 					</li>
-					<li class="mui-table-view-cell mui-media vongi-choose-yl">
+					<li class="mui-table-view-cell mui-media vongi-choose-yl kfz">
 						<a class="mui-navigate-right">
 							<img class="mui-media-object mui-pull-left" src="~$project/assets/img/icon46.png">
 							<div class="mui-media-body">
@@ -34,13 +34,13 @@
 								<p class='mui-ellipsis'>适用于养老院、居家养老等场所</p>
 							</div>
 						</a>
-					</li> -->
+					</li>
 				</ul>
 			</div>
 		</div>
-		<!-- <div class="fyy-footer">
+		<div class="fyy-footer kfz">
 			<div class="bindfyy-btn"><button type="submit" class="mui-btn mui-btn-outlined">我是访客</button></div>
-		</div> -->
+		</div>
 	</div>
 </template>
 
@@ -71,7 +71,9 @@
 			}
 		},
 		created() {
-
+			if (this.vister_scene) {
+				this.visterScene = this.vister_scene;
+			}
 		},
 		methods: {
 			//页面跳转
@@ -85,16 +87,34 @@
 					}
 				})
 			},
+			//确认
+			sure() {
+				this.set_vister_scene(this.visterScene);
+				if (this.visterScene.project == 'business') {
+					if (this.visterScene.role == '1') {
+						window.location.href = "../" + this.visterScene.project + '/#/master';
+					} else if (this.visterScene.role == '2') {
+						window.location.href = "../" + this.visterScene.project + '/#/houseKeeper/admin';
+					} else if (this.visterScene.role == '3') {
+						window.location.href = "../" + this.visterScene.project + '/#/houseKeeper/control';
+					} else {
+						mui.toast('请选择角色');
+					}
+				} else {
+					mui.toast('未开放场景');
+				}
+			},
 			asynCallBack() {
-				
+				//如果场景是存在的则直接跳转
+				if (!this.$route.query.exchange && this.vister_scene.project && this.vister_scene.role) {
+					this.sure();
+				}
 			},
 			...mapMutations({
 				set_vister_scene: types.SET_VISTER_SCENE,
 			})
 		},
-		mounted() {
-
-		},
+		mounted() {},
 		destroyed() {
 
 		},

+ 1 - 1
src/projects/home/views/Role.vue

@@ -119,7 +119,7 @@
 				}
 
 				//如果场景是存在的则直接跳转
-				if (!this.$route.query.exchange && this.visterScene.project && this.vister_scene.role) {
+				if (!this.$route.query.exchange && this.vister_scene.project && this.vister_scene.role) {
 					this.sure();
 				}
 			},

+ 1 - 1
src/store/state.js

@@ -13,7 +13,7 @@ const state = {
 	token: getToken(),
 	person_data: getPersonData(storage_prefix),
 	company_data: getCompanyData(storage_prefix),
-	vister_scene: getCompanyData(storage_prefix),
+	vister_scene: getVisterScene(storage_prefix),
 	add_person_data: '',
 }