|
@@ -1,114 +1,159 @@
|
|
|
<template>
|
|
|
<div class="home-slice">
|
|
|
-<!-- <el-row style="padding-top: 40px" v-loading="loading" element-loading-text="权限检查中...">-->
|
|
|
<el-row style="padding-top: 40px">
|
|
|
- <el-col :span="14">
|
|
|
- <div class="slice-wrapper" style="padding-left: 20%">
|
|
|
- <div class="slice-title"><img src="../../assets/img/homeslice1.png" alt="slice1"></div>
|
|
|
- <div class="slice-info">1分钟带你玩转众测服务平台</div>
|
|
|
- <div class="slice-btn" @click="goToCreateProject" style="cursor: pointer">立即进入<img src="../../assets/img/home-btn1.png" style="margin-left: 5px"></div>
|
|
|
+ <div class="slice-wrapper">
|
|
|
+ <div class="slice-title">{{ title }}</div>
|
|
|
+ <div class="slice-info">
|
|
|
+ <span class="line"></span>
|
|
|
+ <span class="txt">{{ subtitle }}</span>
|
|
|
+ <span class="line"></span>
|
|
|
</div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="10">
|
|
|
- <div class="slice-wrapper">
|
|
|
- <div class="slice-title"><img src="../../assets/img/homeslice2.png" alt="slice2"></div>
|
|
|
- <div class="slice-info">入住众测服务平台流程</div>
|
|
|
- <div class="slice-btn" @click="goToCreateTask" style="cursor: pointer">立即进入<img src="../../assets/img/home-btn2.png" style="margin-left: 5px"></div>
|
|
|
+ <div>
|
|
|
+ <el-button class="crowd-btn publish-btn" @click="goToCreateProject">发布项目</el-button>
|
|
|
+ <el-button class="crowd-btn participate-btn" @click="goToCreateTask">参与众测</el-button>
|
|
|
</div>
|
|
|
- </el-col>
|
|
|
+ </div>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import Apis from '@/js/api'
|
|
|
- import Http from '@/js/http'
|
|
|
- import {storageGet} from '@/js/index.js'
|
|
|
- import {notify} from "../../constants";
|
|
|
+import Apis from '@/js/api'
|
|
|
+import Http from '@/js/http'
|
|
|
+import {storageGet} from '@/js/index.js'
|
|
|
+import {notify} from "../../constants";
|
|
|
+import {title, subtitle} from '../../config/index'
|
|
|
|
|
|
- export default {
|
|
|
- name: 'HomeSlice',
|
|
|
- data() {
|
|
|
- return {
|
|
|
- user: {},
|
|
|
- isLogin: false,
|
|
|
- loading:false
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- showLoading() {
|
|
|
- this.loading = true
|
|
|
- },
|
|
|
- hideLoading() {
|
|
|
- this.loading = false
|
|
|
- },
|
|
|
- loadData(){
|
|
|
- if (storageGet('user') != null) {
|
|
|
- this.isLogin = true;
|
|
|
- this.user = storageGet('user').userVO;
|
|
|
- }
|
|
|
- },
|
|
|
- checkCreateProjectAuth() {
|
|
|
- if (!this.isLogin) {
|
|
|
- console.log("请登录后访问");
|
|
|
- notify('warning', '请登录后访问');
|
|
|
- }
|
|
|
- else if(this.isLogin){
|
|
|
- this.showLoading();
|
|
|
- Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.id)).then((res) => {
|
|
|
- console.log(res)
|
|
|
- this.hideLoading()
|
|
|
- this.$router.push('/project/create');
|
|
|
- }).catch((error) => {
|
|
|
- this.hideLoading()
|
|
|
- notify('error', error.data)
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- checkCreateTaskAuth() {
|
|
|
- if (!this.isLogin) {
|
|
|
- console.log("请登录后访问");
|
|
|
- notify('warning', '请登录后访问');
|
|
|
- }
|
|
|
- else if(this.isLogin){
|
|
|
- this.showLoading();
|
|
|
- Http.get(Apis.USER.IS_AGENCY.replace('{userId}', this.user.id)).then((res) => {
|
|
|
- console.log(res)
|
|
|
- this.hideLoading()
|
|
|
- this.$router.push('/square');
|
|
|
- }).catch((error) => {
|
|
|
- this.hideLoading()
|
|
|
- notify('error', error.data)
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- goToCreateProject(){
|
|
|
- this.checkCreateProjectAuth();
|
|
|
- },
|
|
|
- goToCreateTask(){
|
|
|
- this.checkCreateTaskAuth();
|
|
|
- },
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.loadData();
|
|
|
- }
|
|
|
+export default {
|
|
|
+ name: 'HomeSlice',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ user: {},
|
|
|
+ isLogin: false,
|
|
|
+ loading: false,
|
|
|
+ title,
|
|
|
+ subtitle
|
|
|
}
|
|
|
-</script>
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ showLoading() {
|
|
|
+ this.loading = true
|
|
|
+ },
|
|
|
+ hideLoading() {
|
|
|
+ this.loading = false
|
|
|
+ },
|
|
|
+ loadData() {
|
|
|
+ if (storageGet('user') != null) {
|
|
|
+ this.isLogin = true;
|
|
|
+ this.user = storageGet('user').userVO;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkCreateProjectAuth() {
|
|
|
+ if (!this.isLogin) {
|
|
|
+ console.log("请登录后访问");
|
|
|
+ notify('warning', '请登录后访问');
|
|
|
+ } else if (this.isLogin) {
|
|
|
+ this.showLoading();
|
|
|
+ Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.id)).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ this.hideLoading()
|
|
|
+ this.$router.push('/project/create');
|
|
|
+ }).catch((error) => {
|
|
|
+ this.hideLoading()
|
|
|
+ notify('error', error.data)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkCreateTaskAuth() {
|
|
|
+ if (!this.isLogin) {
|
|
|
+ console.log("请登录后访问");
|
|
|
+ notify('warning', '请登录后访问');
|
|
|
+ } else if (this.isLogin) {
|
|
|
+ this.showLoading();
|
|
|
+ Http.get(Apis.USER.IS_AGENCY.replace('{userId}', this.user.id)).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ this.hideLoading()
|
|
|
+ this.$router.push('/square');
|
|
|
+ }).catch((error) => {
|
|
|
+ this.hideLoading()
|
|
|
+ notify('error', error.data)
|
|
|
+ })
|
|
|
|
|
|
-<style scoped>
|
|
|
- .slice-info {
|
|
|
- font-size: 16px;
|
|
|
- font-family: Source Han Sans CN;
|
|
|
- color: rgba(243, 224, 10, 1);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goToCreateProject() {
|
|
|
+ this.checkCreateProjectAuth();
|
|
|
+ },
|
|
|
+ goToCreateTask() {
|
|
|
+ this.checkCreateTaskAuth();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.loadData();
|
|
|
}
|
|
|
+}
|
|
|
+</script>
|
|
|
|
|
|
- .slice-btn {
|
|
|
- display: flex;
|
|
|
- margin-top: 5px;
|
|
|
- line-height: 30px;
|
|
|
- color: white;
|
|
|
- font-weight: 400;
|
|
|
- }
|
|
|
+<style scoped lang="scss">
|
|
|
+@import "../../style/main";
|
|
|
+.home-slice {
|
|
|
+ background-image: url("../../assets/image/slice.png");
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.slice-title {
|
|
|
+ font-size: 40px;
|
|
|
+ font-family: Source Han Sans CN;
|
|
|
+ font-weight: bold;
|
|
|
+ letter-spacing:10px;
|
|
|
+ color: $--color-title-color;
|
|
|
+}
|
|
|
+
|
|
|
+.slice-info {
|
|
|
+ font-size: 16px;
|
|
|
+ font-family: Source Han Sans CN;
|
|
|
+ color: $--color-publish-background;
|
|
|
+ letter-spacing: 8px;
|
|
|
+}
|
|
|
|
|
|
+.slice-btn {
|
|
|
+ display: flex;
|
|
|
+ margin-top: 5px;
|
|
|
+ line-height: 30px;
|
|
|
+ color: white;
|
|
|
+ font-weight: 400;
|
|
|
+}
|
|
|
+.slice-info {
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ font-size: 24px;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.slice-info .line {
|
|
|
+ display: inline-block;
|
|
|
+ width: 150px;
|
|
|
+ border: 1px solid $--color-publish-background;
|
|
|
+}
|
|
|
+.slice-info .txt {
|
|
|
+ vertical-align: middle;
|
|
|
+ vertical-align: -20%;
|
|
|
+ margin: 0 20px;
|
|
|
+ font-size: 16px;
|
|
|
+ color: $--color-publish-background;
|
|
|
+ letter-spacing: 8px;
|
|
|
+}
|
|
|
+.crowd-btn {
|
|
|
+ border: none;
|
|
|
+ color: white;
|
|
|
+ margin: 20px;
|
|
|
+ cursor:pointer;
|
|
|
+ padding: 8px 10px !important;
|
|
|
+}
|
|
|
+.publish-btn {
|
|
|
+ background-color: $--color-publish-background;
|
|
|
+ margin-right: 100px;
|
|
|
+}
|
|
|
+.participate-btn {
|
|
|
+ background-color: $--color-participate-background;
|
|
|
+ margin-left: 100px;
|
|
|
+}
|
|
|
</style>
|