瀏覽代碼

企业列表初步; 本地无数据, 通过开发服务器查看数据.

huan-jie 5 年之前
父節點
當前提交
4739ede95f
共有 4 個文件被更改,包括 420 次插入1 次删除
  1. 106 0
      assets/css/company/index.scss
  2. 39 1
      assets/css/job/index.scss
  3. 269 0
      pages/company/list/_city.vue
  4. 6 0
      pages/job/index.vue

+ 106 - 0
assets/css/company/index.scss

@@ -0,0 +1,106 @@
+@import "../scssCommon";
+
+.companyList {
+    .contentArea {
+        background-color: #f7f7f7;
+        width: 1000px;
+        margin: 0 auto;
+        box-sizing: border-box;
+        .filter-box {
+            padding: 20px;
+            background: #ffffff;
+            display: flex;
+            flex-direction: column;
+            box-sizing: border-box;
+            .filter-title {
+                font-weight: 600;
+                font-size: 15px;
+                padding: 0;
+                margin: 24px 0 14px;
+                line-height: 20px;
+            }
+            .filter-content {
+                margin-top: 20px;
+                display: flex;
+                flex-flow: row wrap;
+                a {
+                    width: 66px;
+                    height: 30px;
+                    line-height: 30px;
+                    text-align: center;
+                    font-size: 13px;
+                }
+                .notOn {
+                    color: #555555;
+                }
+                .on {
+                    border: 1px solid #308EFF;
+                    border-radius: 3px;
+                    color: #258fe6;
+                }
+            }
+        }
+        .company-list-wrapper {
+            margin-top: 10px;
+            background: #ffffff;
+            display: flex;
+            flex-direction: column;
+            .company-item {
+                padding: 0 20px;
+                height: 100px;
+                display: flex;
+                align-items: center;
+                text-decoration: none;
+                .logo {
+                    width: 60px;
+                    height: 60px;
+                    border-radius: 5px;
+                }
+                .company-info {
+                    margin-left: 20px;
+                    flex-grow: 1;
+                    .name {
+                        font-size: 18px;
+                        height: 25px;
+                        line-height: 25px;
+                        color: #222222;
+                        margin: 0;
+                        font-weight: 700;
+                    }
+                    .intro {
+                        margin-right: 20px;
+                        height: 17px;
+                        line-height: 17px;
+                        color: #666666;
+                        overflow: hidden;
+                        text-overflow: ellipsis;
+                        white-space: nowrap;
+                    }
+                }
+                .recruit-info {
+                    flex-shrink: 0;
+                    display: flex;
+                    flex-direction: column;
+                    align-items: center;
+                    justify-content: center;
+                    .num {
+                        font-size: 25px;
+                        height: 30px;
+                        line-height: 30px;
+                        font-weight: 700;
+                        color: #308eff;
+                        margin: 0;
+                    }
+                    .title {
+                        font-size: 12px;
+                        color: #666666;
+                    }
+                }
+            }
+        }
+    }
+    .pagination {
+        margin: 20px auto;
+        text-align: center;
+    }
+}

+ 39 - 1
assets/css/job/index.scss

@@ -14,9 +14,47 @@
     margin: 0 auto;
     box-sizing: border-box;
 
+    .tabs {
+      display: flex;
+      align-items: center;
+      width: 100%;
+      height: 50px;
+      background: #fff;
+      padding: 0 13px;
+      .tabs-item {
+        position: relative;
+        height: 100%;
+        padding-left: 55px;
+        opacity: 1;
+        font-size: 16px;
+        color: #666666;
+        cursor: pointer;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        a {
+          color: inherit;
+        }
+      }
+      .tabs-item-active {
+        font-weight: 600;
+        color: #222222;
+        &:after {
+          position: absolute;
+          content: " ";
+          bottom: 1px;
+          width: 22px;
+          height: 3px;
+          opacity: 1;
+          background: #308eff;
+          border-radius: 2px;
+        }
+      }
+    }
+
     .selectArea {
       display: flex;
-      padding: 45px 45px 45px 10px;
+      padding: 39px 45px 45px 10px;
       flex-direction: column;
       background: #fff;
 

+ 269 - 0
pages/company/list/_city.vue

@@ -0,0 +1,269 @@
+<template>
+  <div :class="{ isMobile: mobile }">
+    <!-- web -->
+    <div v-if="!mobile">
+        <div class="companyList">
+            <div class="contentArea">
+                <div class="filter-box">
+                        <h3 class="filter-title">国内地区</h3>
+                        <div class="filter-content">
+                            <a href="" :class="currentCity === '' ? 'on' : 'notOn'">全部</a>
+                            <a
+                              href=""
+                              v-for="item in cityList"
+                              :key="'city' + item.id"
+                              :class="currentCity === item.city_op_name ? 'on' : 'notOn'">
+                              {{ item.city_op_name }}
+                            </a>
+                        </div>
+                </div>
+                <div class="company-list-wrapper">
+                    <a
+                      v-for="item in companyList"
+                      :key="'company' + item.id"
+                      href="todo"
+                      class="company-item">
+                        <img :src="item.logo" alt="logo" class="logo">
+                        <div class="company-info">
+                            <div class="name">{{ item.name }}</div>
+                            <div class="intro">{{ item.brief_introduction }}</div>
+                        </div>
+                        <div class="recruit-info">
+                            <span class="num">{{ item.recruit_num }}</span>
+                            <span class="title">在招职位</span>
+                        </div>
+                    </a>
+                </div>
+            </div>
+            <div class="pagination">
+                <el-pagination
+                    v-if="!isSeoList"
+                    background
+                    layout="prev, pager, next"
+                    :total="page.total"
+                    :page-size="page.pageSize"
+                    @current-change="pageChange"
+                    :current-page="Number(page.current)">
+                </el-pagination>
+                <div v-else>
+                    <div class="list">
+                        <nuxt-link
+                            v-for="(item, index) in new Array(Math.ceil(page.total / page.size))"
+                            :to="`/?page=${index + 1}`"
+                            :key="page + index">
+                            {{ index + 1 }}
+                        </nuxt-link>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <!-- mobile -->
+    <div v-else class="jobListMobile">
+      公司列表 mobile
+      <a v-if="!deviceType.app && mobile && !isBaiduxapp && !isWxapp" :class="{'downapp':isShowDownLoad}" :href="downloadhref">下载APP</a>
+    </div>
+  </div>
+</template>
+
+<script>
+  import {mapState, mapMutations} from "vuex";
+  import deviceType from "../../../plugins/deviceType";
+
+  export default {
+    name: "CompanyList",
+    showCommonFooter: false,
+    data() {
+      return {
+        isShowToast: false,
+        name: "",
+        loading: false,
+        refreshing: false,
+        firstLoading: false, //移动端加载loading
+        isLoading: false,
+        selected: {},
+        downloadhref: "",
+        type: "",
+        isShowDownLoad: false,
+        isBaiduxapp: false,
+        isWxapp: true,
+        siteurl: "",
+        jobUrl:"",
+        baseUrl: '',
+        isSeoList: false,
+        currentCity: '',
+      };
+    },
+    head() {
+      const {
+        title = "",
+        keyword = "",
+        description = "",
+        h1 = "",
+        canonical = "",
+        metaLocation
+      } = this.head || {};
+      let obj = {
+        title: title,
+        meta: [
+          {
+            name: "keywords",
+            content: keyword
+          },
+          {
+            name: "description",
+            content: description
+          },
+          {
+            name: "h1",
+            content: h1
+          }
+        ],
+        link: [{rel: "canonical", href: canonical}]
+      };
+      if (metaLocation) {
+        obj.meta.push({name: "location", content: metaLocation});
+      }
+      return obj;
+    },
+    async asyncData({...params}) {
+      console.log("*********params:", params);
+      // 获取城市列表
+      let cityList = []
+      const cityRes = await params.$axios.$post('/api/CompanyInfo/getCity')
+      if (Number(cityRes.data.status) === 1) {
+        cityList = cityRes.data.data || []
+      }
+      // 获取公司列表
+      let companyList = []
+      let page = {
+        total: 0,
+        pageSize: 20,
+        current: 1
+      }
+      const companyRes = await params.$axios.$post('/api/CompanyInfo/getCompanyList')
+      if (Number(companyRes.data.status) === 1) {
+        companyList = companyRes.data.list || []
+        page.total = Number(companyRes.data.total) || 0
+      }
+
+      console.log('query data: ', cityList, companyList)
+
+      return {
+        mobile: params.app.$deviceType.isMobile(),
+        cityList: cityList,
+        companyList: companyList,
+        page: page
+      };
+    },
+    watch: {},
+    computed: {
+      ...mapState(["isPC", "isWeixin", "deviceType", "noneCommonFooter"]),
+    },
+    created() {
+      console.log("created................");
+      const { city } = this.$route.params
+
+      this.currentCity = city || ''
+    },
+    mounted() {
+      console.log("mounted................");
+      if (this.mobile) {
+        document.body.style = "overflow:hidden;";
+      }
+
+      let UA = navigator.userAgent;
+      console.log("-------------", UA);
+      this.isWxapp = UA.indexOf('miniProgram') > -1;
+      console.error(this.isWxapp ? "是微信" : "不是微信");
+      this.isBaiduxapp = navigator.userAgent.indexOf('swan/') > -1;
+      console.log(this.$route.params);
+      var isAndroid = UA.indexOf("Android") > -1 || UA.indexOf("Adr") > -1; //android终端
+      console.error(isAndroid ? "是安卓" : "不是安卓");
+      var isiOS = !!UA.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
+      console.error(isiOS ? "是IOS" : "不是IOS");
+
+      if (this.isWxapp) {
+        this.downloadhref =
+          "http://a.app.qq.com/o/simple.jsp?pkgname=com.proginn";
+      } else if (isAndroid) {
+        this.downloadhref =
+          "http://inncms.storage.proginn.com/android/proginn-v4.10.0.apk";
+      } else if (isiOS) {
+        this.downloadhref =
+          "https://itunes.apple.com/cn/app/cheng-xu-yuan-ke-zhan/id979914687";
+      }
+      console.log("this.downloadhref =", this.downloadhref);
+
+      this.type = deviceType.app ? "APP" : "浏览器";
+
+      setTimeout(() => {
+        this.isShowDownLoad = true;
+        console.log("this.isShowDownload=", this.isShowDownLoad);
+      }, 500)
+
+      let ua = navigator.userAgent;
+
+      this.isBaiduxapp = navigator.userAgent.indexOf('swan/') > -1;
+      console.log(this.$route.params);
+      // this.isWxapp = this.$route.query.isWxMini && this.$route.query.isWxMini == 1;
+
+      this.baseUrl = this.$store.state.domainConfig.baseUrl
+      this.siteurl = this.$store.state.domainConfig.siteUrl
+      this.jobUrl = this.$store.state.domainConfig.jobUrl
+    },
+    methods: {
+      /**
+       * 获取公司列表
+       */
+      _getCompanyList () {
+
+      },
+      pageChange(i) {
+        this.page.current = i;
+        this._getCompanyList();
+      },
+      jumpToCompanyInfo(item) {
+        const {
+          companyInfo: {uid}
+        } = item;
+        window.open(
+          this.$store.state.domainConfig.baseUrl + `/wo/${uid}`,
+          `targetCompany${uid}`
+        );
+      },
+      /** 移动端下拉刷新 **/
+      onRefresh() {
+        // 清空列表数据
+        this.finished = false;
+        console.log("onRefresh");
+        this.onLoad();
+      },
+      onLoad() {
+        console.log("onLoad");
+        this.getList();
+      }
+    }
+  };
+</script>
+
+<style scope lang="scss">
+@import "../../../assets/css/company/index.scss";
+.main {
+    margin-bottom: 0 !important;
+}
+</style>
+<style lang="scss">
+.downapp {
+position: absolute;
+bottom: 0;
+z-index: 1000;
+width: 100vw;
+height: 50px;
+background: cornflowerblue;
+color: white;
+font-size: 15px;
+text-align: center;
+line-height: 50px;
+}
+</style>

+ 6 - 0
pages/job/index.vue

@@ -7,6 +7,12 @@
           <!--{{JSON.stringify(typeList)}}-->
         </div>
         <div class="contentArea">
+          <div class="tabs">
+            <div class="tabs-item tabs-item-active">职位</div>
+            <div class="tabs-item">
+              <nuxt-link to="/company/list">公司</nuxt-link>
+            </div>
+          </div>
           <div class="selectArea" v-if="!isSeoList">
             <!--职业角色、国内地区筛选-->
             <div class="selectContent" v-for="(key, i) in Object.keys(typeList)" :key="i + 'selectContent'">