whx 2 месяцев назад
Родитель
Сommit
80af0ee68a

BIN
virgo.wzfrontend/.DS_Store


BIN
virgo.wzfrontend/src/.DS_Store


BIN
virgo.wzfrontend/src/main/.DS_Store


BIN
virgo.wzfrontend/src/main/resources/.DS_Store


+ 6 - 0
virgo.wzfrontend/workark/package-lock.json

@@ -3154,6 +3154,12 @@
         }
       }
     },
+    "crypto-js": {
+      "version": "4.2.0",
+      "resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
+      "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==",
+      "dev": true
+    },
     "css-declaration-sorter": {
       "version": "6.4.1",
       "resolved": "https://registry.npmmirror.com/css-declaration-sorter/-/css-declaration-sorter-6.4.1.tgz",

+ 1 - 0
virgo.wzfrontend/workark/package.json

@@ -22,6 +22,7 @@
 		"@vue/cli-plugin-babel": "~5.0.0",
 		"@vue/cli-plugin-eslint": "~5.0.0",
 		"@vue/cli-service": "~5.0.0",
+		"crypto-js": "^4.2.0",
 		"dayjs": "^1.11.11",
 		"eslint": "^7.32.0",
 		"eslint-plugin-vue": "^8.0.3",

+ 4 - 2
virgo.wzfrontend/workark/public/index.html

@@ -5,9 +5,11 @@
 		<meta http-equiv="X-UA-Compatible" content="IE=edge">
 		<meta name="viewport" content="width=device-width,initial-scale=1.0">
 		<link rel="icon" href="https://file-node.oss-cn-shanghai.aliyuncs.com/youji/2f7b4bfaf9e64817bc2cb46f3a632b01">
-		<title>WORKARK</title>
-		<link rel="stylesheet" type="text/css" href="<%= BASE_URL %>reset.css" />
+		<title>WORKARK</title>
+		<link rel="stylesheet" type="text/css" href="<%= BASE_URL %>reset.css" />
 		<link rel="stylesheet" href="//at.alicdn.com/t/c/font_4358860_u9q17n0qvwc.css">
+		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/5.4.5/css/swiper.min.css">
+		<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/5.4.5/js/swiper.min.js"></script>
 	</head>
 	<body>
 		<noscript>

+ 3 - 0
virgo.wzfrontend/workark/src/assets/css/common.scss

@@ -270,6 +270,9 @@
 .color-red {
 	color: $--color-danger;
 }
+.color-blue{
+	color: $--color-primary;
+}
 .yui-tree-box {
 	display: flex;
 	width: 100%;

+ 6 - 1
virgo.wzfrontend/workark/src/components/website/productItem.vue

@@ -1,5 +1,5 @@
 <template>
-	<div class="product-item">
+	<div class="product-item" @click="clickItem">
 		<div class="product-item-image">
 			<img :src="imageUrl(item.listDisplayImage)" :alt="item.name" />
 		</div>
@@ -15,6 +15,7 @@
 </template>
 
 <script>
+	import Crypto from '@/uitls/crypto'
 	export default {
 		props: ['item'],
 		methods: {
@@ -23,6 +24,10 @@
 				if (!data) return 'https://assets.api.uizard.io/api/cdn/stream/c05650d2-192b-4a56-ae97-05638f53804c.png';
 				return JSON.parse(data)[0].url;
 			},
+			clickItem() {
+				let id = Crypto.AES.encrypt(String(this.item.id), 'bosshand');
+				this.$router.push('/website/serveDetail?id=' + encodeURIComponent(id));
+			}
 		}
 	}
 </script>

+ 19 - 2
virgo.wzfrontend/workark/src/layout/components/indexFoot.vue

@@ -1,7 +1,7 @@
 <template>
 	<footer id="tell" class="footer">
 		<div class="footer-box">
-			<div class="footer-content" v-if="type === 'all'">
+			<div class="footer-content" v-if="pathUrl === '/'">
 				<div class="footer-download">
 					<div class="footer-title">产品下载</div>
 					<div class="footer-qr">
@@ -38,7 +38,24 @@
 
 <script>
 	export default {
-		props: ['type']
+		data() {
+			return {
+				pathUrl: ''
+			}
+		},
+		mounted() {
+			this.init();
+		},
+		methods: {
+			init() {
+				this.pathUrl = this.$route.path;
+			}
+		},
+		watch: {
+			$route(newValue) {
+				this.init();
+			}
+		},
 	}
 </script>
 

+ 21 - 9
virgo.wzfrontend/workark/src/layout/components/indexNav.vue

@@ -27,12 +27,15 @@
 		</div>
 		<el-dialog custom-class="login-custom" :close-on-click-modal="false" :visible.sync="dialogVisible"
 			:append-to-body="true">
-			<login @callback="callback"></login>
+			<login v-if="dialogVisible" @callback="callback"></login>
 		</el-dialog>
 	</div>
 </template>
 
 <script>
+	import {
+		removeToken
+	} from '@/uitls/auth';
 	const login = () => import('./login');
 	export default {
 		data() {
@@ -41,15 +44,27 @@
 				dialogVisible: false
 			}
 		},
+		mounted() {
+			this.init();
+		},
 		methods: {
+			init() {
+				this.user = this.$store.getters.user;
+			},
 			loginFunc() {
 				this.dialogVisible = true;
 			},
 			logout() {
-
+				this.$confirm('是否要退出登录?', () => {
+					removeToken();
+					this.$store.dispatch('app/resetState');
+					this.$message.success('退出成功');
+					this.init();
+				});
 			},
-			callback() {
+			callback(type) {
 				this.dialogVisible = false;
+				if (type == 'init') this.init();
 			}
 		},
 		components: {
@@ -60,8 +75,8 @@
 
 <style lang="scss">
 	.login-custom {
-		width: 440px;
-		height: auto;
+		width: 440px !important;
+		height: auto !important;
 
 		.el-dialog__header {
 			display: none;
@@ -69,14 +84,11 @@
 	}
 
 	.layout-title {
-		position: absolute;
 		width: 100%;
-		min-width: 1200px;
-		left: 0;
-		top: 0;
 		height: 60px;
 		z-index: 9;
 		background: $--color-white;
+		box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.1);
 
 		.title-box {
 			width: 1200px;

+ 2 - 2
virgo.wzfrontend/workark/src/layout/components/login.vue

@@ -162,7 +162,7 @@
 								this.$store.dispatch('app/changeMenuData', user.workarkResource ? JSON
 									.parse(user.workarkResource) : []);
 								setComment(user.workarkMenu ? user.workarkMenu : JSON.stringify([]));
-								return this.successLogin('/work');
+								this.successLogin()
 							} else {
 								this.loginLoading = false;
 							}
@@ -174,7 +174,7 @@
 			},
 			successLogin(url) {
 				this.loginLoading = false;
-				this.$router.push(url);
+				this.$emit('callback', 'init')
 				this.$message.success('登录成功');
 			}
 		}

+ 6 - 5
virgo.wzfrontend/workark/src/layout/components/topNav.vue

@@ -23,7 +23,7 @@
 				<el-dropdown-menu class="user-dropdown" slot="dropdown">
 					<el-dropdown-item command="user">{{users.name}}</el-dropdown-item>
 					<el-dropdown-item command="detail">个人信息</el-dropdown-item>
-					<el-dropdown-item command="loginout">退出登录</el-dropdown-item>
+					<el-dropdown-item command="logout">退出登录</el-dropdown-item>
 				</el-dropdown-menu>
 			</el-dropdown>
 		</div>
@@ -56,17 +56,18 @@
 				switch (command) {
 					case 'detail':
 						break;
-					case 'loginout':
-						this.loginout();
+					case 'logout':
+						this.logout();
 						break;
 					default:
 						break;
 				}
 			},
-			loginout() {
+			logout() {
 				this.$confirm('是否要退出登录?', () => {
 					removeToken();
-					this.$router.replace('/loginRegister/login')
+					this.$store.dispatch('app/resetState');
+					this.$router.replace('/loginRegister/login');
 					this.$message.success('退出成功');
 				});
 			},

+ 2 - 49
virgo.wzfrontend/workark/src/layout/indexLayout.vue

@@ -2,66 +2,19 @@
 	<div class="website-layout">
 		<index-nav></index-nav>
 		<router-view :key="key" />
-		<index-foot type="all"></index-foot>
+		<index-foot></index-foot>
 	</div>
 </template>
 
 <script>
 	const indexNav = () => import('./components/indexNav');
 	const indexFoot = () => import('./components/indexFoot');
-	import {
-		removeToken
-	} from '@/uitls/auth';
-	import {
-		getToken
-	} from '@/uitls/auth'
 	export default {
 		data() {
-			return {
-				visible: false,
-				user: {}
-			}
-		},
-		mounted() {
-			this.init();
-		},
-		methods: {
-			init() {
-				if (this.$store.getters.user) this.user = this.$store.getters.user;
-			},
-			login() {
-				this.visible = true;
-			},
-			callback(type) {
-				if (type === 'init') {
-					if (this.$route.path == '/website/homeDetail') {
-						this.$store.dispatch('app/changeEvent', {
-							type: 'homeDetailReload'
-						})
-					} else if (this.$route.path == '/website/search') {
-						this.$store.dispatch('app/changeEvent', {
-							type: 'searchReload'
-						})
-					}
-					this.init();
-				}
-				this.visible = false;
-			},
-			loginout() {
-				this.$confirm('是否要退出登录?', () => {
-					removeToken();
-					this.$store.dispatch('projectBase/changeProject', {});
-					this.$store.dispatch('app/changeUser', {});
-					this.$store.dispatch('app/changeOrganization', {});
-					this.$message.success('退出成功');
-					this.init();
-				});
-			},
+			return {}
 		},
 		computed: {
 			key() {
-				if ((this.$route.path == '/website/homeDetail' || this.$route.path == '/website/search') && !getToken())
-					this.login();
 				return this.$route.path;
 			}
 		},

+ 7 - 0
virgo.wzfrontend/workark/src/router/index.js

@@ -21,6 +21,13 @@ export default new Router({
 			meta: {
 				title: '首页'
 			}
+		},{
+			path: '/website/serveDetail',
+			component: () => import('@/views/website/serveDetail'),
+			name: '服务详情',
+			meta: {
+				title: '服务详情'
+			}
 		}]
 	}, { //404
 		path: '/404',

+ 1 - 1
virgo.wzfrontend/workark/src/router/permission.js

@@ -17,7 +17,7 @@ NProgress.configure({
 })
 
 const baseUrl = ['/work', '/message'];
-const noTokenUrl = ['/', '/401', '/404', '/loginRegister/login'];
+const noTokenUrl = ['/', '/401', '/404', '/loginRegister/login','/website/serveDetail'];
 
 const testBaseUrl = path => { //判断公共路由
 	return baseUrl.filter((item) => {

+ 14 - 6
virgo.wzfrontend/workark/src/store/modules/app.js

@@ -2,15 +2,15 @@
  *	app基本信息
  * 	
  */
-const state = {
+const getDefaultState = () => ({
 	codeNumber: 60,
 	menuData: [],
 	user: {},
 	organization: {},
 	project: {
 		id: -1
-	},
-}
+	}
+})
 
 const mutations = {
 	CHANGE_CODENUMBER: (state, num) => {
@@ -27,12 +27,15 @@ const mutations = {
 	},
 	CHANGE_PROJECT: (state, project) => {
 		state.project = project;
+	},
+	RESET_STATE(state) {
+		state = Object.assign(state, getDefaultState())
 	}
 }
 
 const actions = {
 	changeCodeNumber({
-		commit,
+		commit
 	}, num) {
 		commit('CHANGE_CODENUMBER', num < 0 ? 60 : num);
 	},
@@ -52,15 +55,20 @@ const actions = {
 		commit('CHANGE_ORGANIZATION', organization);
 	},
 	changeProject({
-		commit,
+		commit
 	}, project) {
 		commit('CHANGE_PROJECT', project);
+	},
+	resetState({
+		commit
+	}) {
+		commit('RESET_STATE');
 	}
 }
 
 export default {
 	namespaced: true,
-	state,
+	state: getDefaultState(),
 	mutations,
 	actions
 }

+ 2 - 1
virgo.wzfrontend/workark/src/uitls/auth.js

@@ -8,7 +8,8 @@ export function setToken(token) {
 	return sessionStorage.setItem(TokenKey, token);
 }
 
-export function removeToken() {
+export function removeToken() {
+	
 	return sessionStorage.removeItem(TokenKey);
 }
 

+ 15 - 0
virgo.wzfrontend/workark/src/uitls/crypto.js

@@ -0,0 +1,15 @@
+import CryptoJS from 'crypto-js';
+
+const Crypto = {
+	AES: {
+		encrypt: function(plaintext, secretKey) {
+			return CryptoJS.AES.encrypt(plaintext, secretKey).toString();
+		},
+		decrypt: function(ciphertext, secretKey) {
+			const bytes = CryptoJS.AES.decrypt(ciphertext, secretKey);
+			return bytes.toString(CryptoJS.enc.Utf8);
+		}
+	}
+};
+
+export default Crypto;

+ 365 - 0
virgo.wzfrontend/workark/src/views/website/serveDetail.vue

@@ -0,0 +1,365 @@
+<template>
+	<div class="home-detail">
+		<div class="container" v-loading="loading">
+			<div class="container-box" v-if="detail.id">
+				<div class="title">{{detail.name}}</div>
+				<div class="home-detail-content">
+
+				</div>
+			</div>
+			<div class="skeleton-box" v-else>
+				<el-empty description="暂未找到服务"></el-empty>
+			</div>
+		</div>
+	</div>
+</template>
+
+<script>
+	import {
+		getServeById
+	} from '@/api/serve'
+	import Crypto from '@/uitls/crypto'
+	export default {
+		data() {
+			return {
+				loading: false,
+				detailId: '',
+				detail: {}
+			};
+		},
+		mounted() {
+			window.scrollTo(0, 0);
+			this.init();
+		},
+		methods: {
+			init() {
+				this.loading = true;
+				this.detailId = Crypto.AES.decrypt(decodeURIComponent(this.$route.query.id), 'bosshand');
+				if (!this.detailId) return this.loading = false;
+				this.getDetail();
+			},
+			getDetail() {
+				getServeById(this.detailId).then(res => {
+					console.log(res);
+					this.detail = res.data;
+					this.loading = false;
+				})
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	.home-detail {
+		padding-top: 10px;
+		box-sizing: border-box;
+
+		.title {
+			font-size: 30px;
+			font-weight: bolder;
+			line-height: 30px;
+			margin: 20px 0;
+		}
+
+		.sub-title {
+			font-size: 24px;
+			font-weight: bolder;
+			line-height: 30px;
+			margin: 20px 0;
+		}
+
+		.map-container {
+			display: flex;
+			margin-bottom: 30px;
+
+			#map {
+				width: 670px;
+				height: 400px;
+			}
+
+			.content-device {
+				width: 470px;
+				height: 400px;
+				margin-left: 60px;
+
+				.chat {
+					cursor: pointer;
+					width: 40px;
+					height: 40px;
+					background: $--color-primary;
+					color: #fff;
+					border-radius: 40px;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					font-size: 20px;
+				}
+
+				.people-tell {
+					border-bottom: 1px solid #e7ebee;
+					display: flex;
+					align-items: center;
+					padding: 15px 0;
+					margin-bottom: 15px;
+
+					.people-avatar {
+						width: 50px;
+						height: 50px;
+						border-radius: 50%;
+						margin-right: 15px;
+						overflow: hidden;
+					}
+
+					.people-text {
+						flex: 1;
+						width: 0;
+						overflow: hidden;
+					}
+
+					.people-name {
+						font-size: 20px;
+						font-weight: 500;
+					}
+
+					.people-organization {
+						font-weight: 300;
+						font-size: 14px;
+					}
+				}
+
+				.device-list {
+					display: flex;
+					flex-wrap: wrap;
+					align-content: flex-start;
+				}
+
+				.device-item {
+					width: 50%;
+					display: flex;
+					align-items: center;
+					margin-bottom: 15px;
+
+					.device-label {
+						flex: 1;
+						width: 0;
+						font-weight: 200;
+						margin-left: 10px;
+					}
+
+					.device-icon {
+						font-size: 18px;
+						margin-right: 5px;
+					}
+				}
+			}
+		}
+
+
+		.container {
+			width: 1200px;
+			margin: 0 auto;
+			min-height: calc(100vh - 107px);
+			position: relative;
+		}
+
+		.skeleton-box {
+			position: absolute;
+			top: 0;
+			left: 0;
+			bottom: 0;
+			right: 0;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+		}
+
+		.home-detail-content {
+			display: flex;
+		}
+
+		.home-detail-swiper {
+			width: 670px;
+			height: 480px;
+
+			.swiper-container,
+			.swiper-wrapper,
+			.swiper-slide {
+				width: 100%;
+				height: 100%;
+			}
+
+			.swiper-slide {
+				background-size: cover;
+				background-position: center;
+				background-repeat: no-repeat;
+				cursor: pointer;
+				position: relative;
+
+				.open-video-icon {
+					position: absolute;
+					top: 50%;
+					left: 50%;
+					width: 40px;
+					height: 40px;
+					border-radius: 40px;
+					background: rgba(0, 0, 0, 0.6);
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					margin-left: -20px;
+					margin-top: -20px;
+					box-sizing: border-box;
+
+					.huifont-bofang {
+						color: #fff;
+						font-size: 20px;
+					}
+				}
+			}
+
+			.swiper-button-next:after,
+			.swiper-button-prev:after {
+				color: #eee;
+				font-size: 16px;
+			}
+
+			.swiper-button-prev,
+			.swiper-container-rtl .swiper-button-next {
+				left: 0;
+				background: rgba(0, 0, 0, 0.3);
+				height: 70px;
+				margin-top: -35px;
+			}
+
+			.swiper-button-next,
+			.swiper-container-rtl .swiper-button-prev {
+				right: 0;
+				background: rgba(0, 0, 0, 0.3);
+				height: 70px;
+				margin-top: -35px;
+			}
+		}
+
+		.home-detail-information {
+			width: 470px;
+			height: 480px;
+			margin-left: 60px;
+
+			.house-name {
+				font-size: 26px;
+				font-weight: 500;
+			}
+
+			.tag {
+				margin: 10px 0;
+
+				span {
+					background: #eee;
+					padding: 5px 10px;
+					border-radius: 4px;
+					margin: 5px 5px 5px 0;
+					font-size: 12px;
+					color: #7b7979;
+				}
+			}
+
+			.content-title {
+				font-size: 16px;
+				font-weight: 500;
+			}
+
+			.house-price {
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				border-bottom: 1px solid #e7ebee;
+				margin-bottom: 15px;
+				padding-bottom: 5px;
+
+				.hui-button {
+					color: #fff;
+					background: $--color-primary;
+					width: 100px;
+					height: 34px;
+					text-align: center;
+					line-height: 34px;
+					border-radius: 4px;
+					cursor: pointer;
+
+					&:hover {
+						opacity: 0.8;
+					}
+				}
+			}
+
+			.average {
+				font-size: 30px;
+				font-weight: 900;
+				margin-right: 5px;
+			}
+
+			.desc-text {
+				margin-top: 10px;
+			}
+
+			.information-list {
+				display: flex;
+				flex-wrap: wrap;
+				margin-bottom: 10px;
+
+				.information-box {
+					width: 50%;
+					display: flex;
+					padding: 7px 20px 7px 0;
+					box-sizing: border-box;
+				}
+
+				.information-title {
+					color: #979b9e;
+					font-weight: 500;
+				}
+
+				.information-div {
+					flex: 1;
+					width: 0;
+					overflow: hidden;
+					white-space: nowrap;
+					font-weight: 300;
+				}
+			}
+		}
+
+		.footer {
+			background: #212631;
+			min-width: 1200px;
+
+			.footer-box {
+				width: 1200px;
+				margin: 0 auto
+			}
+
+			.foot-information {
+				font-weight: 400;
+				font-size: 12px;
+				color: #98999d;
+				line-height: 17px;
+				display: flex;
+				align-items: center;
+				padding: 20px;
+				justify-content: center
+			}
+
+			.foot-information a {
+				color: #98999d;
+				margin-right: 30px
+			}
+
+			.foot-information img {
+				width: 14px;
+				height: 14px;
+				margin-left: 30px;
+				margin-right: 10px
+			}
+		}
+	}
+</style>