Browse Source

Merge branches 'master' and 'master' of http://git.cc-lotus.info/smart-jobs/web-mobile

guhongwei 5 years ago
parent
commit
d96ff47e86

+ 1 - 1
.env

@@ -1,2 +1,2 @@
-VUE_APP_AXIOS_BASE_URL = /api
+VUE_APP_AXIOS_BASE_URL = 
 VUE_APP_ROUTER="/mobile"
 VUE_APP_ROUTER="/mobile"

+ 9 - 1
src/layout/list-layout.vue

@@ -11,6 +11,11 @@
           </el-col>
           </el-col>
         </el-row>
         </el-row>
       </el-header>
       </el-header>
+      <el-header v-else style="height:2.5rem">
+        <el-row class="title">
+          <el-col :span="24" style="text-align:center;">{{ title }}</el-col>
+        </el-row>
+      </el-header>
       <el-main class="toZero">
       <el-main class="toZero">
         <listContent v-on="$listeners" :hasMore="hasMore" v-if="needInfinteLoading">
         <listContent v-on="$listeners" :hasMore="hasMore" v-if="needInfinteLoading">
           <template v-slot:list>
           <template v-slot:list>
@@ -34,6 +39,7 @@ export default {
     needInfinteLoading: { type: Boolean, default: true },
     needInfinteLoading: { type: Boolean, default: true },
     hasMore: { type: Boolean },
     hasMore: { type: Boolean },
     searchName: { type: String },
     searchName: { type: String },
+    title: null,
   },
   },
   components: {
   components: {
     listContent,
     listContent,
@@ -52,7 +58,6 @@ export default {
       } else {
       } else {
         data = this.searchVal;
         data = this.searchVal;
       }
       }
-      console.log(type, data);
       this.$emit('searchBar', { type: type, value: data });
       this.$emit('searchBar', { type: type, value: data });
     },
     },
   },
   },
@@ -70,6 +75,9 @@ export default {
     margin-bottom: 0;
     margin-bottom: 0;
   }
   }
 }
 }
+.title {
+  padding: 0.3rem;
+}
 .search_btn {
 .search_btn {
   background: #f0f2f5;
   background: #f0f2f5;
   color: #333333;
   color: #333333;

+ 8 - 0
src/pages/index/store/index.js

@@ -1,11 +1,19 @@
 import Vue from 'vue';
 import Vue from 'vue';
 import Vuex from 'vuex';
 import Vuex from 'vuex';
 import * as user from '@/store/user';
 import * as user from '@/store/user';
+import * as site from '@/store/site';
+import * as modules from '@/store/module';
+import * as column from '@/store/column';
+import * as news from '@/store/news';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 
 
 export default new Vuex.Store({
 export default new Vuex.Store({
   modules: {
   modules: {
     user: user,
     user: user,
+    site: site,
+    module: modules,
+    column: column,
+    news: news,
   },
   },
 });
 });

+ 133 - 60
src/pages/index/views/home.vue

@@ -1,15 +1,5 @@
 <template>
 <template>
   <div id="home">
   <div id="home">
-    <!-- <nut-navbar>
-      &nbsp;
-      <template v-slot:left>
-        关闭
-      </template>
-      <template v-slot:right> </template>
-      <template v-slot:more-icon>
-        &nbsp;
-      </template>
-    </nut-navbar> -->
     <!-- <test-user></test-user> -->
     <!-- <test-user></test-user> -->
     <el-image style="width: 100%; height: 10rem" :src="url"></el-image>
     <el-image style="width: 100%; height: 10rem" :src="url"></el-image>
     <el-row type="flex" align="middle" class="menu_list">
     <el-row type="flex" align="middle" class="menu_list">
@@ -19,23 +9,7 @@
         <el-col :span="24">
         <el-col :span="24">
           <el-link type="info" :underline="false">宣讲会</el-link>
           <el-link type="info" :underline="false">宣讲会</el-link>
         </el-col>
         </el-col>
-        <!-- <el-drawer :visible.sync="drawerTalk" direction="btt">
-          <template #title>
-            <el-row>
-              <el-col :span="20">选择查看类型</el-col>
-            </el-row>
-          </template>
-          <el-row class="drawer__row">
-            <el-col :span="24" @click.native="toHtml('/talkList.html#/?type=in')">
-              <el-button type="text">校内宣讲会</el-button>
-            </el-col>
-            <el-col :span="24" @click.native="toHtml('/talkList.html#/?type=out')">
-              <el-button type="text">校外宣讲会</el-button>
-            </el-col>
-          </el-row>
-        </el-drawer> -->
       </el-col>
       </el-col>
-      <!-- drawerJobfair = true -->
       <el-col :span="6" class="list_border" @click.native="toHtml('jobfairList.html#/')">
       <el-col :span="6" class="list_border" @click.native="toHtml('jobfairList.html#/')">
         <el-col :span="24"><div class="el-icon-s-custom icon_zoom"></div></el-col>
         <el-col :span="24"><div class="el-icon-s-custom icon_zoom"></div></el-col>
         <el-col :span="24">
         <el-col :span="24">
@@ -65,44 +39,33 @@
         <el-col :span="24"><div class="el-icon-user icon_zoom"></div></el-col>
         <el-col :span="24"><div class="el-icon-user icon_zoom"></div></el-col>
         <el-col :span="24"><el-link type="info" :underline="false">个人中心</el-link></el-col>
         <el-col :span="24"><el-link type="info" :underline="false">个人中心</el-link></el-col>
       </el-col>
       </el-col>
-      <!-- <el-drawer :visible.sync="drawerCenter" direction="btt">
-        <template #title>
-          <el-row>
-            <el-col :span="20">选择类型</el-col>
-          </el-row>
-        </template>
-        <el-row class="drawer__row">
-          <el-col :span="24" >
-            <el-button type="text">学生个人中心</el-button>
-          </el-col>
-          <el-col :span="24" @click.native="toHtml('', 'check')">
-            <el-button type="text">企业中心</el-button>
-          </el-col>
-        </el-row>
-      </el-drawer> -->
     </el-row>
     </el-row>
     <!-- list部分 -->
     <!-- list部分 -->
     <div class="list">
     <div class="list">
       <el-row class="tip" type="flex">
       <el-row class="tip" type="flex">
-        <el-col :span="16"> test<b class="tip_en">TEST</b> </el-col>
+        <el-col :span="16">
+          {{ news.title }}<b class="tip_en">{{ news.title }}</b>
+        </el-col>
         <el-col :span="8" class="more">
         <el-col :span="8" class="more">
           查看更多
           查看更多
         </el-col>
         </el-col>
       </el-row>
       </el-row>
-      <el-row type="flex" v-for="(item, index) in list" :key="index" class="data_list">
-        <el-col :span="6"> 【{{ item.type === 1 ? '测试1' : '其他类型' }}】 </el-col>
+      <el-row type="flex" v-for="(item, index) in news.infoList" :key="index" class="data_list">
+        <el-col :span="6"> 【{{ news.title }}】 </el-col>
         <el-col :span="18">{{ item.title }}</el-col>
         <el-col :span="18">{{ item.title }}</el-col>
       </el-row>
       </el-row>
     </div>
     </div>
     <div class="list">
     <div class="list">
       <el-row class="tip" type="flex">
       <el-row class="tip" type="flex">
-        <el-col :span="16"> test1<b class="tip_en">TEST1</b> </el-col>
+        <el-col :span="16">
+          {{ notice.title }}<b class="tip_en">{{ notice.title }}</b>
+        </el-col>
         <el-col :span="8" class="more">
         <el-col :span="8" class="more">
           查看更多
           查看更多
         </el-col>
         </el-col>
       </el-row>
       </el-row>
-      <el-row type="flex" v-for="(item, index) in list" :key="index" class="data_list">
-        <el-col :span="6"> 【{{ item.type === 1 ? '测试1' : '招聘' }}】 </el-col>
+      <el-row type="flex" v-for="(item, index) in notice.infoList" :key="index" class="data_list">
+        <el-col :span="6"> 【{{ notice.title }}】 </el-col>
         <el-col :span="18">{{ item.title }}</el-col>
         <el-col :span="18">{{ item.title }}</el-col>
       </el-row>
       </el-row>
     </div>
     </div>
@@ -111,23 +74,27 @@
         <el-col :span="24"> 联系我们<b class="tip_en">CONTACT</b> </el-col>
         <el-col :span="24"> 联系我们<b class="tip_en">CONTACT</b> </el-col>
       </el-row>
       </el-row>
       <el-row style="font-size: 0.85rem;padding: 0 0.6rem;">
       <el-row style="font-size: 0.85rem;padding: 0 0.6rem;">
-        <el-col :span="24">联系地址: 吉林省长春市朝阳区卫星路6543号,综合楼C区203室 </el-col>
-        <el-col :span="24">邮政编码: 130000</el-col>
-        <el-col :span="24">服务热线: 0431-88888888</el-col>
+        <el-col :span="24" v-html="site.content"></el-col>
       </el-row>
       </el-row>
     </div>
     </div>
     <div class="list">
     <div class="list">
       <el-row class="tip" type="flex">
       <el-row class="tip" type="flex">
         <el-col :span="24"> 关注我们<b class="tip_en">WECHAT</b> </el-col>
         <el-col :span="24"> 关注我们<b class="tip_en">WECHAT</b> </el-col>
       </el-row>
       </el-row>
-      qrcode
+      <el-row>
+        <el-col :span="24" style="text-align:center">
+          <canvas id="canvas"></canvas>
+        </el-col>
+      </el-row>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
+import QRCode from 'qrcode';
 import { mapActions, mapState } from 'vuex';
 import { mapActions, mapState } from 'vuex';
 import testUser from '@/components/test-user.vue';
 import testUser from '@/components/test-user.vue';
+import _ from 'lodash';
 export default {
 export default {
   name: 'home',
   name: 'home',
   props: {},
   props: {},
@@ -135,25 +102,28 @@ export default {
     // testUser,
     // testUser,
   },
   },
   data: () => ({
   data: () => ({
-    url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
-    list: [
-      { type: '1', title: '测试标题1' },
-      { type: '1', title: '测试标题2' },
-      { type: '1', title: '测试标题3' },
-      { type: '1', title: '测试标题4' },
-      { type: '1', title: '测试标题5' },
-    ],
+    url: '',
     drawerTalk: false,
     drawerTalk: false,
     drawerJobfair: false,
     drawerJobfair: false,
     drawerCenter: false,
     drawerCenter: false,
+    site: {},
+    news: {},
+    notice: {},
   }),
   }),
-  created() {},
+  async created() {
+    await this.getSite();
+    await this.getModule();
+    this.$nextTick(() => {
+      this.initQrcode();
+    });
+  },
   computed: {
   computed: {
     ...mapState({
     ...mapState({
       user: state => state.user.user,
       user: state => state.user.user,
     }),
     }),
   },
   },
   methods: {
   methods: {
+    ...mapActions(['siteOperation', 'moduleOperation', 'columnOperation', 'newsOperation']),
     toHtml(uri, type) {
     toHtml(uri, type) {
       if (type) {
       if (type) {
         let url = '';
         let url = '';
@@ -167,6 +137,109 @@ export default {
         window.location.href = uri;
         window.location.href = uri;
       }
       }
     },
     },
+    async getSite() {
+      let site = sessionStorage.getItem('site');
+      if (!site) {
+        let result = await this.siteOperation({ type: 'search', data: { site: this.$site } });
+        if (`${result.errcode}` === `0`) {
+          sessionStorage.setItem('site', JSON.stringify(result.data));
+          this.$set(this, `site`, result.data);
+        }
+      } else {
+        this.$set(this, `site`, JSON.parse(site));
+      }
+      this.$set(this, `url`, this.site.banner);
+    },
+    //获取固定的4个模块
+    async getModule() {
+      //获取分站所有模块 TODO:site=>_tenant
+      let result = await this.moduleOperation({ type: 'list' });
+      if (`${result.errcode}` === '0') {
+        let moduleList = result.data;
+        for (let item of moduleList) {
+          //item为模块信息,拿着模块信息去查该模块下有什么栏目
+          if (`${item.is_use}` === '0') {
+            item = await this.getColumn(item);
+            await this.makeList(item);
+          } // console.log(item);
+        }
+      }
+    },
+    //根据条件获取栏目
+    async getColumn(item) {
+      let res = await this.columnOperation({ type: 'list', data: { parent_id: item.id } });
+      //查詢模块下所有的栏目(因为修改关联方是:抓取栏目和正常栏目关联,栏目类型(type)为bugList.所以bugList需要用content_id再去查下面关联的信息
+      if (`${res.errcode}` === '0') {
+        for (const col of res.data) {
+          if (col.type === 'bugList') {
+            col.path = `/info/list/${col.content_id}`;
+            col.children = await this.getNewsList(col, '0');
+          } else if (col.type === 'column') {
+            col.path = `/info/list/${col.id}`;
+            col.children = await this.getNewsList(col, '1');
+          } else if (col.type === 'content') {
+            col.path = `/info/detail?id=${col.content_id}`;
+          }
+        }
+        item.children = res.data;
+      }
+      return item;
+    },
+    //根据条件获取信息
+    async getNewsList(item, news_type) {
+      let data = { skip: 0, limit: 4, news_type: news_type };
+      data.parent_id = news_type === '1' ? item.id : item.content_id;
+      let res = await this.newsOperation({ type: 'list', data: data });
+      if (`${res.errcode}` === '0') {
+        for (const val of res.data) {
+          let result = await this.newsOperation({ type: 'search', data: { id: val.id } });
+          if (`${result.errcode}` === '0') {
+            val.content = result.data.content;
+          } else {
+            this.$message.error(result.errmsg ? result.errmsg : 'error');
+          }
+        }
+        return res.data;
+      } else {
+        this.$message.error(res.errmsg ? res.errmsg : 'error');
+      }
+    },
+    //组合数据
+    makeList(item) {
+      if (!item) return;
+      if (item.category === 'news') {
+        let arr = [];
+        let colObject = {};
+        for (const col of item.children) {
+          if (!colObject.id) colObject = col;
+          for (const news of col.children) {
+            arr.push(news);
+          }
+        }
+        let object = { ...JSON.parse(JSON.stringify(item)), infoList: arr, column: colObject };
+        this.$set(this, `news`, object);
+      } else if (item.category === 'notice') {
+        let arr = [];
+        let colObject = {};
+        for (const col of item.children) {
+          if (!colObject.id) colObject = col;
+          for (const news of col.children) {
+            arr.push(news);
+          }
+        }
+        let object = { ...JSON.parse(JSON.stringify(item)), infoList: arr, column: colObject };
+        // console.log(object);
+        this.$set(this, `notice`, object);
+      }
+    },
+    async initQrcode() {
+      let url = 'http://smart.cc-lotus.info/weixin/auth?redirect_uri=http://smart.cc-lotus.info/mobile/#/';
+      await QRCode.toCanvas(document.getElementById('canvas'), url, {
+        width: 100,
+        margin: 0,
+        // color: { dark: '#ff4400' }, //{ dark: this.$route.query.type === '0' ? '#00ff14' : '#FF9900' }
+      });
+    },
   },
   },
 };
 };
 </script>
 </script>

+ 7 - 2
src/pages/jobfairList/views/list.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div id="jobfair">
   <div id="jobfair">
-    <list-layout searchPlaceHolder="请输入企业名称" @search="search" @searchBar="searchBar" :hasMore="hasMore" :searchName="`corpname`">
+    <list-layout :needSearch="false" title="校园招聘会">
       <template v-slot:content>
       <template v-slot:content>
         <span v-if="list.length > 0">
         <span v-if="list.length > 0">
           <el-row class="jobfair_list" v-for="(item, index) in list" :key="index" @click.native="link(item.id)">
           <el-row class="jobfair_list" v-for="(item, index) in list" :key="index" @click.native="link(item.id)">
@@ -10,6 +10,10 @@
                 招聘
                 招聘
               </el-col>
               </el-col>
               <el-col :span="18" class="jobfair_info">
               <el-col :span="18" class="jobfair_info">
+                <div style="float:left">
+                  <el-tag effect="plain" v-if="item.schid === $site" class="jobfair_tags">校内</el-tag>
+                  <el-tag type="warning" effect="plain" v-else>校外</el-tag>
+                </div>
                 <div class="info_word">
                 <div class="info_word">
                   {{ item.title }}
                   {{ item.title }}
                 </div>
                 </div>
@@ -131,9 +135,10 @@ export default {
 
 
 <style lang="less" scoped>
 <style lang="less" scoped>
 .jobfair_list {
 .jobfair_list {
-  padding: 0.7rem;
+  padding: 1rem;
   background: #fff;
   background: #fff;
   box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
   box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+  border-bottom: 1px dashed;
 }
 }
 .jobfair_icon {
 .jobfair_icon {
   background-color: #25b6ed;
   background-color: #25b6ed;

+ 2 - 2
src/pages/student/views/delivery/ticket.vue

@@ -3,8 +3,8 @@
     <el-row v-for="(item, index) in list" :key="index" class="main" @click.native="getQrcode(item.id)">
     <el-row v-for="(item, index) in list" :key="index" class="main" @click.native="getQrcode(item.id)">
       <el-col :span="18" class="mainTit">
       <el-col :span="18" class="mainTit">
         <el-col :span="24" class="text">标题:{{ item.fair.title || '' }}</el-col>
         <el-col :span="24" class="text">标题:{{ item.fair.title || '' }}</el-col>
-        <el-col :span="24" class="text">类型:{{ item && `${item.is_talk}` === `0` ? '招聘会' : '宣讲会' }}</el-col>
-        <el-col :span="24" class="text">时间:{{ item.fair.date || '' }} {{ item.fair.time || '' }}</el-col>
+        <el-col :span="24" class="text">类型:{{ item && `${item.is_talk}` === `1` ? '招聘会' : '宣讲会' }}</el-col>
+        <el-col :span="24" class="text">时间:{{ item.fair.time || '' }}</el-col>
       </el-col>
       </el-col>
       <!-- <el-col :span="6" class="mainBtn">
       <!-- <el-col :span="6" class="mainBtn">
         <el-button type="primary" @>二维码</el-button>
         <el-button type="primary" @>二维码</el-button>

+ 1 - 1
src/pages/talk/views/detail.vue

@@ -13,7 +13,7 @@
             <li>
             <li>
               <el-row :span="24">
               <el-row :span="24">
                 <i class="el-icon-alarm-clock el-icon--left"></i>
                 <i class="el-icon-alarm-clock el-icon--left"></i>
-                {{ info.date }}&nbsp;{{ info.time }}
+                {{ info.time }}
               </el-row>
               </el-row>
             </li>
             </li>
             <li>
             <li>

+ 2 - 0
src/pages/talkList/store/index.js

@@ -2,6 +2,7 @@ import Vue from 'vue';
 import Vuex from 'vuex';
 import Vuex from 'vuex';
 import * as talks from '@/store/talks';
 import * as talks from '@/store/talks';
 import * as user from '@/store/user';
 import * as user from '@/store/user';
+import * as corp from '@/store/corp';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 
 
@@ -9,5 +10,6 @@ export default new Vuex.Store({
   modules: {
   modules: {
     talks: talks,
     talks: talks,
     user: user,
     user: user,
+    corp: corp,
   },
   },
 });
 });

+ 13 - 28
src/pages/talkList/views/list.vue

@@ -9,25 +9,16 @@
               <el-col :span="8" style="text-align:center;border-right: 1px solid #ccc;"><el-button @click="btnIn('out')">校外</el-button></el-col>
               <el-col :span="8" style="text-align:center;border-right: 1px solid #ccc;"><el-button @click="btnIn('out')">校外</el-button></el-col>
             </span>
             </span>
             <el-col :span="canSpan" style="text-align:center;border-right: 1px solid #ccc;">
             <el-col :span="canSpan" style="text-align:center;border-right: 1px solid #ccc;">
-              <el-button icon="el-icon-date" v-on:click="toggle()">
+              <el-button icon="el-icon-date" @click="toggle()">
                 {{ Rili }}
                 {{ Rili }}
                 <i class="el-icon-arrow-down el-icon--right"></i>
                 <i class="el-icon-arrow-down el-icon--right"></i>
               </el-button>
               </el-button>
             </el-col>
             </el-col>
             <nut-calendar :is-visible="isVisible2" :is-auto-back-fill="true" @close="switchPicker('isVisible2')" @choose="talkRili"> </nut-calendar>
             <nut-calendar :is-visible="isVisible2" :is-auto-back-fill="true" @close="switchPicker('isVisible2')" @choose="talkRili"> </nut-calendar>
-            <!-- <el-button type="primary" v-on:click="toggleXueli()">{{ talkXueli }}<i class="el-icon-arrow-down el-icon--right"></i></el-button>
-            <nut-actionsheet
-              :is-visible="isVisible1"
-              :isClickCloseMask="false"
-              @close="switchActionSheet('isVisible1')"
-              cancelTxt="取消"
-              :menu-items="menuItems2"
-              @choose="chooseItemAgeSpec"
-            ></nut-actionsheet> -->
           </el-row>
           </el-row>
           <span v-if="list.length > 0">
           <span v-if="list.length > 0">
             <el-row :span="24" class="talk_li" v-for="(item, index) in list" :key="index" @click.native="link(item.id)">
             <el-row :span="24" class="talk_li" v-for="(item, index) in list" :key="index" @click.native="link(item.id)">
-              <el-col :span="4"><el-image :src="src1"></el-image> </el-col>
+              <el-col :span="4"><el-image :src="item.corp.identity.logo_url"></el-image> </el-col>
               <el-col :span="14" class="talk_li14">
               <el-col :span="14" class="talk_li14">
                 <el-row class="talk_li14_1" :span="4">{{ item.corpname }}</el-row>
                 <el-row class="talk_li14_1" :span="4">{{ item.corpname }}</el-row>
                 <el-row><i class="el-icon-location-outline el-icon--left"></i>{{ item.schname }}</el-row>
                 <el-row><i class="el-icon-location-outline el-icon--left"></i>{{ item.schname }}</el-row>
@@ -35,7 +26,6 @@
               </el-col>
               </el-col>
               <el-col :span="6" class="talk_li6">
               <el-col :span="6" class="talk_li6">
                 <el-row class="talk_li6_2"> {{ item.date }}<br /> </el-row>
                 <el-row class="talk_li6_2"> {{ item.date }}<br /> </el-row>
-                <!-- <el-tag type="danger">{{ item.time }}</el-tag> -->
                 <el-row class="talk_li6_3"><i class="el-icon-view el-icon--left"></i>2019</el-row>
                 <el-row class="talk_li6_3"><i class="el-icon-view el-icon--left"></i>2019</el-row>
               </el-col>
               </el-col>
             </el-row>
             </el-row>
@@ -110,7 +100,7 @@ export default {
     }),
     }),
   },
   },
   methods: {
   methods: {
-    ...mapActions(['talksOperation']),
+    ...mapActions(['talksOperation', 'corpOperation']),
     async search(type) {
     async search(type) {
       let skip = 0;
       let skip = 0;
       //判断下type,如果type存在.当前页加一
       //判断下type,如果type存在.当前页加一
@@ -123,10 +113,11 @@ export default {
       let result = await this.talksOperation({ type: 'list', data: { skip: skip, limit: this.$limit, ...this.searchInfo } }); //查询,添加skip和limit参数
       let result = await this.talksOperation({ type: 'list', data: { skip: skip, limit: this.$limit, ...this.searchInfo } }); //查询,添加skip和limit参数
       if (`${result.errcode}` === '0') {
       if (`${result.errcode}` === '0') {
         //给this=>vue的实例下在中的list属性,赋予result。data的值
         //给this=>vue的实例下在中的list属性,赋予result。data的值
+        let arr = await this.searchCorp(result.data);
         if (type && type === 'nextPage') {
         if (type && type === 'nextPage') {
-          this.$set(this, `list`, this.list.concat(result.data)); //将现有的列表和请求来的数据列表合并到一起,自动追加在下面import '@/plugins/var';
+          this.$set(this, `list`, this.list.concat(arr)); //将现有的列表和请求来的数据列表合并到一起,自动追加在下面import '@/plugins/var';
         } else {
         } else {
-          this.$set(this, `list`, result.data);
+          this.$set(this, `list`, arr);
         }
         }
         this.$set(this, `totalRow`, result.total); //将数据库返回的总数放到页面的totalRow变量中,用来判断
         this.$set(this, `totalRow`, result.total); //将数据库返回的总数放到页面的totalRow变量中,用来判断
         this.$set(this, `hasMore`, this.list.length < this.totalRow); //此处是根据数据库总数的结果和当前列表的总条数比较,看看是否可以继续请求数据
         this.$set(this, `hasMore`, this.list.length < this.totalRow); //此处是根据数据库总数的结果和当前列表的总条数比较,看看是否可以继续请求数据
@@ -163,7 +154,7 @@ export default {
       this.search();
       this.search();
     },
     },
     changeState(schIn) {
     changeState(schIn) {
-      if (!this.user || this.user.schid === undefined) {
+      if (this.$site === 'master') {
         this.searchInfo.schid = undefined;
         this.searchInfo.schid = undefined;
         this.changeStateBtn = false;
         this.changeStateBtn = false;
         this.canSpan = 24;
         this.canSpan = 24;
@@ -175,18 +166,12 @@ export default {
         }
         }
       }
       }
     },
     },
-
-    toggleXueli: function() {
-      this.isVisible1 = !this.isVisible1;
-    },
-    switchActionSheet(param) {
-      this[`${param}`] = !this[`${param}`];
-    },
-    chooseItemAgeSpec(item) {
-      this.searchInfo.date = item.value;
-      this.$set(this, `talkXueli`, item.name);
-      this.hasMore = true;
-      this.search();
+    async searchCorp(data) {
+      for (const item of data) {
+        let res = await this.corpOperation({ type: 'search', data: { corpid: item.corpid } });
+        item.corp = res;
+      }
+      return data;
     },
     },
   },
   },
 };
 };

+ 15 - 0
src/plugins/var.js

@@ -1,9 +1,24 @@
 import Vue from 'vue';
 import Vue from 'vue';
 
 
+const getSiteId = () => {
+  let host = `${window.location.hostname}`; //`999991.smart.jilinjobswx.cn ${window.location.hostname}`
+  let schId;
+  host = host.replace('http://', '');
+  let arr = host.split('.');
+  if (arr.length > 0) {
+    schId = arr[0];
+    if (schId === 'smart') schId = 'master';
+    else `${schId}`.includes('localhost') || `${schId}`.includes('127.0.0.1') ? (schId = '99991') : '';
+    sessionStorage.setItem('schId', `${schId}`.includes('localhost') || `${schId}`.includes('127.0.0.1') ? '99991' : schId);
+  }
+  return schId;
+};
+
 const Plugin = {
 const Plugin = {
   install(vue, options) {
   install(vue, options) {
     // 4. 添加实例方法
     // 4. 添加实例方法
     vue.prototype.$limit = 15;
     vue.prototype.$limit = 15;
+    vue.prototype.$site = getSiteId();
   },
   },
 };
 };
 
 

+ 30 - 0
src/store/column.js

@@ -0,0 +1,30 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+
+Vue.use(Vuex);
+const api = {
+  columnQuery: `/api/cms/column/list`,
+  columnFetch: `/api/cms/column/fetch/{id}`,
+};
+export const state = () => ({});
+export const mutations = {};
+export const actions = {
+  //栏目管理
+  async columnOperation({ state }, { type, data }) {
+    let { skip, limit } = data;
+    let result;
+    if (type === 'list') {
+      //TODO
+      let { parent_id } = data;
+      result = await this.$axios.$get(api.columnQuery, {}, { parent_id: parent_id, is_use: '0' });
+    }
+    if (type === 'search') {
+      let { parent_id } = data;
+      result = await this.$axios.$get(api.columnFetch, {
+        id: parent_id,
+      });
+    }
+    return result;
+  },
+};

+ 3 - 3
src/store/corp.js

@@ -4,9 +4,9 @@ import _ from 'lodash';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  corpInfo: '/corp/corps/{corpid}/info',
-  corpBase: '/corp/corps/{corpid}',
-  corpIdentity: '/corp/corps/{corpid}/identity',
+  corpInfo: '/api/corp/corps/{corpid}/info',
+  corpBase: '/api/corp/corps/{corpid}',
+  corpIdentity: '/api/corp/corps/{corpid}/identity',
 };
 };
 
 
 export const state = () => ({});
 export const state = () => ({});

+ 2 - 2
src/store/dictionary.js

@@ -4,8 +4,8 @@ import _ from 'lodash';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  dictionary: '/code/{type}/items', //type === xzqh:query:level(1/2);parent(无/code)
-  findOne: '/code/xzqh/findOne', //query:name
+  dictionary: '/api/code/{type}/items', //type === xzqh:query:level(1/2);parent(无/code)
+  findOne: '/api/code/xzqh/findOne', //query:name
 };
 };
 
 
 export const state = () => ({});
 export const state = () => ({});

+ 2 - 2
src/store/hr.js

@@ -4,8 +4,8 @@ import _ from 'lodash';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  hr: '/corp/corps/{corpid}/users', //list,add
-  hrImp: '/corp/users/{id}', //查询:id:手机号,用户肯定不知道id啊!那就手机号呗;修改:用id
+  hr: '/api/corp/corps/{corpid}/users', //list,add
+  hrImp: '/api/corp/users/{id}', //查询:id:手机号,用户肯定不知道id啊!那就手机号呗;修改:用id
 };
 };
 
 
 export const state = () => ({});
 export const state = () => ({});

+ 5 - 5
src/store/jobfair.js

@@ -4,11 +4,11 @@ import _ from 'lodash';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  fairs: '/jobs/fairs',
-  profilesinfo: '/jobs/fairs/{id}',
-  faircorps: '/jobs/faircorps',
-  faircorpsInfo: '/jobs/faircorps/{id}',
-  fairJobs: '/faircorps/{id}/jobs',
+  fairs: '/api/jobs/fairs',
+  profilesinfo: '/api/jobs/fairs/{id}',
+  faircorps: '/api/jobs/faircorps',
+  faircorpsInfo: '/api/jobs/faircorps/{id}',
+  fairJobs: '/api/faircorps/{id}/jobs',
 };
 };
 export const state = () => ({});
 export const state = () => ({});
 export const mutations = {};
 export const mutations = {};

+ 2 - 2
src/store/jobinfo.js

@@ -4,8 +4,8 @@ import _ from 'lodash';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  info: '/jobs/infos',
-  infos: '/jobs/infos/{id}',
+  info: '/api/jobs/infos',
+  infos: '/api/jobs/infos/{id}',
 };
 };
 export const state = () => ({});
 export const state = () => ({});
 
 

+ 2 - 2
src/store/jobs.js

@@ -4,8 +4,8 @@ import _ from 'lodash';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  posts: '/jobs/posts',
-  postsinfo: '/jobs/posts/{id}',
+  posts: '/api/jobs/posts',
+  postsinfo: '/api/jobs/posts/{id}',
 };
 };
 export const state = () => ({});
 export const state = () => ({});
 
 

+ 2 - 2
src/store/letters.js

@@ -4,8 +4,8 @@ import _ from 'lodash';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  letters: '/jobs/letters',
-  lettersInfo: '/jobs/letters/{id}',
+  letters: '/api/jobs/letters',
+  lettersInfo: '/api/jobs/letters/{id}',
 };
 };
 export const state = () => ({});
 export const state = () => ({});
 
 

+ 26 - 0
src/store/menu.js

@@ -0,0 +1,26 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+
+Vue.use(Vuex);
+const api = {
+  menuQuery: `/api/cms/menu/list`,
+  menuSearch: `/api/cms/menu/fetch/{id}`,
+};
+export const state = () => ({});
+export const mutations = {};
+export const actions = {
+  //分站菜单
+  async menuOperation({ state }, { type, data }) {
+    let result;
+    if (type === 'list') {
+      let { site } = data;
+      result = await this.$axios.$get(api.menuQuery, {}, { is_use: '0' });
+    }
+    if (type === 'search') {
+      let { id } = data;
+      result = await this.$axios.$get(api.menuSearch, { id: id });
+    }
+    return result;
+  },
+};

+ 20 - 0
src/store/module.js

@@ -0,0 +1,20 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+
+Vue.use(Vuex);
+const api = {
+  moduleQuery: `/api/cms/modules/list`,
+};
+export const state = () => ({});
+export const mutations = {};
+export const actions = {
+  //模块管理
+  async moduleOperation({ state }, { type, data }) {
+    let result;
+    if (type === 'list') {
+      result = await this.$axios.$get(api.moduleQuery, {}, { is_use: '0' });
+    }
+    return result;
+  },
+};

+ 32 - 0
src/store/news.js

@@ -0,0 +1,32 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+
+Vue.use(Vuex);
+const api = {
+  bugList: `/api/cms/newscreeper/list`,
+  newsQuery: `/api/cms/news/list`,
+  bugInfo: `/api/cms/newscreeper/fetch/{id}`,
+};
+export const state = () => ({});
+export const mutations = {};
+export const actions = {
+  // 信息管理
+  async newsOperation({ state }, { type, data }) {
+    let { skip, limit } = data;
+    let result;
+    if (type === 'list') {
+      let { parent_id, news_type } = data;
+      if (news_type === '0') {
+        result = await this.$axios.$get(api.bugList, {}, { parent_id: parent_id, skip: skip, limit: limit, is_use: '0' });
+      } else {
+        result = await this.$axios.$get(api.newsQuery, {}, { parent_id: parent_id, skip: skip, limit: limit, is_use: '0' });
+      }
+    }
+    if (type === 'search') {
+      let { id, news_type } = data;
+      result = await this.$axios.$get(api.bugInfo, { id: id });
+    }
+    return result;
+  },
+};

+ 2 - 2
src/store/profiles.js

@@ -4,8 +4,8 @@ import _ from 'lodash';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  profiles: '/jobs/profiles',
-  profilesinfo: '/jobs/profiles/{id}',
+  profiles: '/api/jobs/profiles',
+  profilesinfo: '/api/jobs/profiles/{id}',
 };
 };
 export const state = () => ({});
 export const state = () => ({});
 
 

+ 2 - 2
src/store/register.js

@@ -4,8 +4,8 @@ import _ from 'lodash';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  registers: '/stud/registers',
-  corpReg: '/corp/corps',
+  registers: '/api/stud/registers',
+  corpReg: '/api/corp/corps',
 };
 };
 export const state = () => ({});
 export const state = () => ({});
 
 

+ 2 - 2
src/store/resumes.js

@@ -4,8 +4,8 @@ import _ from 'lodash';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  resumes: '/jobs/resumes',
-  resumesInfo: '/jobs/resumes/{id}',
+  resumes: '/api/jobs/resumes',
+  resumesInfo: '/api/jobs/resumes/{id}',
 };
 };
 export const state = () => ({});
 export const state = () => ({});
 
 

+ 1 - 1
src/store/schoolList.js

@@ -4,7 +4,7 @@ import _ from 'lodash';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  corpSchInfo: '/corp/corps/{corpid}/schs',
+  corpSchInfo: '/api/corp/corps/{corpid}/schs',
 };
 };
 export const state = () => ({});
 export const state = () => ({});
 export const mutations = {};
 export const mutations = {};

+ 22 - 0
src/store/site.js

@@ -0,0 +1,22 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+
+Vue.use(Vuex);
+const api = {
+  siteFetch: `/api/cms/site/config`,
+  siteContent: `/api/cms/site/content`,
+};
+export const state = () => ({});
+export const mutations = {};
+export const actions = {
+  async siteOperation({ state }, { type, data }) {
+    let result;
+    let content = await this.$axios.$get(api.siteContent, {});
+    result = await this.$axios.$get(api.siteFetch, {});
+    if (content.data && `${content.errcode}` === '0') {
+      result.data.content = content && content.data ? content.data : '';
+    }
+    return result;
+  },
+};

+ 2 - 2
src/store/talks.js

@@ -4,8 +4,8 @@ import _ from 'lodash';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  talks: '/jobs/talks',
-  talksinfo: '/jobs/talks/{id}',
+  talks: '/api/jobs/talks',
+  talksinfo: '/api/jobs/talks/{id}',
 };
 };
 export const state = () => ({});
 export const state = () => ({});
 export const mutations = {};
 export const mutations = {};

+ 2 - 2
src/store/ticket.js

@@ -4,8 +4,8 @@ import _ from 'lodash';
 Vue.use(Vuex);
 Vue.use(Vuex);
 
 
 const api = {
 const api = {
-  tickets: '/jobs/tickets',
-  ticketsinfo: '/jobs/tickets/{id}',
+  tickets: '/api/jobs/tickets',
+  ticketsinfo: '/api/jobs/tickets/{id}',
 };
 };
 export const state = () => ({});
 export const state = () => ({});
 export const mutations = {};
 export const mutations = {};

+ 3 - 3
src/store/user.js

@@ -3,9 +3,9 @@ import Vuex from 'vuex';
 import _ from 'lodash';
 import _ from 'lodash';
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  userReg: '/stud/registers/{id}',
-  studLogin: '/stud/login', //query:type:0=>用户名+密码 account(学号@学校id)+passwd;1-微信(wxtoken)
-  corpLogin: '/corp/login',
+  userReg: '/api/stud/registers/{id}',
+  studLogin: '/api/stud/login', //query:type:0=>用户名+密码 account(学号@学校id)+passwd;1-微信(wxtoken)
+  corpLogin: '/api/corp/login',
 };
 };
 export const state = () => ({});
 export const state = () => ({});
 export const mutations = {
 export const mutations = {

+ 3 - 1
vue.config.js

@@ -41,8 +41,10 @@ module.exports = {
     proxy: {
     proxy: {
       '/api': {
       '/api': {
         target: 'http://smart.cc-lotus.info',
         target: 'http://smart.cc-lotus.info',
-        changeOrigin: true,
         ws: true,
         ws: true,
+        onProxyReq(proxyReq, req, res) {
+          proxyReq.setHeader('x-tenant', '99991');
+        },
       },
       },
       '/wxtoken': {
       '/wxtoken': {
         target: 'http://smart.cc-lotus.info/weixin',
         target: 'http://smart.cc-lotus.info/weixin',