Bladeren bron

online分支hiome

wjj 4 jaren geleden
bovenliggende
commit
90ffa0b1e9
5 gewijzigde bestanden met toevoegingen van 127 en 2 verwijderingen
  1. 6 2
      src/App.vue
  2. 114 0
      src/components/commons/HomeSliceOnline.vue
  3. 3 0
      src/pages/Homepage/Homepage.vue
  4. 2 0
      src/style/basic.scss
  5. 2 0
      src/style/main.scss

+ 6 - 2
src/App.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="body-content">
-    <home-slice v-if="showSlice"/>
+    <home-slice v-if="showSlice && slice_type === 1"/>
+    <home-slice-online v-if="showSlice && slice_type === 0"/>
     <header-container/>
     <div class="container-wrapper">
       <slot>
@@ -18,15 +19,18 @@ import Http from '@/js/http.js'
 import HeaderContainer from '@/components/commons/Header2.0'
 import FooterContainer from '@/components/commons/Footer2.0'
 import HomeSlice from '@/components/commons/HomeSlice'
+import HomeSliceOnline from '@/components/commons/HomeSliceOnline'
 import {getCurrentUser, storageGet, storageSave} from '@/js/index'
 import {setConfig} from '../src/config/index'
+import {slice_type} from "../tool4deploy/slider-type";
 
 export default {
   name: 'App',
-  components: {HeaderContainer, FooterContainer, HomeSlice},
+  components: {HeaderContainer, FooterContainer, HomeSlice ,HomeSliceOnline},
   data(){
     return {
       // showSlice:false
+      slice_type
     }
   },
   methods: {

+ 114 - 0
src/components/commons/HomeSliceOnline.vue

@@ -0,0 +1,114 @@
+<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>
+      </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-col>
+    </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";
+
+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();
+  }
+}
+</script>
+
+<style scoped lang="less">
+.slice-info {
+  font-size: 16px;
+  font-family: Source Han Sans CN;
+  color: rgba(243, 224, 10, 1);
+}
+
+.slice-btn {
+  display: flex;
+  margin-top: 5px;
+  line-height: 30px;
+  color: white;
+  font-weight: 400;
+}
+
+</style>

+ 3 - 0
src/pages/Homepage/Homepage.vue

@@ -50,6 +50,9 @@
           <el-row style="margin-top: 10px" v-if="HOME_DISPLAY.resource_and_tool">
             <ResourceAndTool :resourceList="homeDataNoCache.toolList && homeDataNoCache.toolList"></ResourceAndTool>
           </el-row>
+          <el-row>
+            <BrandCard :residentAgencyList=homeData.residentAgencyList></BrandCard>
+          </el-row>
         </el-col>
         <el-col :span="5" class="homepage-right-modules">
           <LoginCard v-if="HOME_DISPLAY.login_card"/>

+ 2 - 0
src/style/basic.scss

@@ -8,6 +8,8 @@ $color-publish-background:#FFE400;
 $color-participate-background:#FF1800;
 //配置slice title文本颜色
 $color-title-color:#FFFFFF;
+//配置footer灰色背景色
+$color-footer-background:#2f3030;
 
 .el-input-group__append {
   border-radius: 0 !important;

+ 2 - 0
src/style/main.scss

@@ -10,6 +10,8 @@ $--color-publish-background: $color-publish-background;
 $--color-participate-background: $color-participate-background;
 //配置slice title文本颜色
 $--color-title-color: $color-title-color;
+//配置footer灰色背景色
+$--color-footer-background:$color-footer-background;
 
 /* 改变 icon 字体路径变量,必需 */
 $--font-path: '~element-ui/lib/theme-chalk/fonts';