瀏覽代碼

添加axios,登录,修改资料

luyanan 6 年之前
父節點
當前提交
5e043b1426
共有 39 個文件被更改,包括 1001 次插入237 次删除
  1. 12 2
      build/utils.js
  2. 13 1
      config/index.js
  3. 21 5
      package-lock.json
  4. 2 0
      package.json
  5. 1 0
      plat-info.json
  6. 10 6
      src/common/stylus/common.styl
  7. 1 2
      src/common/stylus/index.styl
  8. 7 39
      src/components/sub-component/style.styl
  9. 16 16
      src/common/stylus/mixin.styl
  10. 6 4
      src/components/Main.vue
  11. 335 0
      src/components/bench-views/UpdateInfo.vue
  12. 4 4
      src/components/bench-views/WorkCommon.vue
  13. 84 91
      src/components/bench-views/WorkHead.vue
  14. 155 1
      src/components/bench-views/WorkHome.vue
  15. 二進制
      src/components/bench-views/img/home_icon_cmplogo.png
  16. 二進制
      src/components/bench-views/img/home_icon_logo_orange.png
  17. 38 2
      src/components/form-views/loginPlat.vue
  18. 0 2
      src/components/form-views/style.styl
  19. 30 7
      src/components/main-views/TheFooter.vue
  20. 9 4
      src/components/main-views/TheHeader.vue
  21. 0 2
      src/components/main-views/ViewAboutUs.vue
  22. 1 3
      src/components/main-views/ViewCooperationAgency.vue
  23. 0 2
      src/components/main-views/ViewFindResource.vue
  24. 0 1
      src/components/main-views/ViewFindServe.vue
  25. 55 10
      src/components/main-views/ViewHome.vue
  26. 0 1
      src/components/main-views/ViewPlatTrend.vue
  27. 10 12
      src/components/sub-component/BaseAgency.vue
  28. 0 4
      src/components/sub-component/BaseArticle.vue
  29. 0 4
      src/components/sub-component/BaseExpert.vue
  30. 0 4
      src/components/sub-component/BaseResource.vue
  31. 0 4
      src/components/sub-component/BaseService.vue
  32. 62 0
      src/libs/axios.js
  33. 64 0
      src/libs/http.js
  34. 62 0
      src/libs/util.js
  35. 3 4
      src/main.js
  36. 二進制
      static/comimg/porfile_icon_qiye_hig.png
  37. 二進制
      static/comimg/porfile_icon_shimin_nor.png
  38. 二進制
      static/comimg/porfile_icon_yuangong_hig.png
  39. 二進制
      static/comimg/porfile_icon_zhuanjia_nor.png

+ 12 - 2
build/utils.js

@ -54,6 +54,16 @@ exports.cssLoaders = function (options) {
54 54
    }
55 55
  }
56 56
57
  var stylusOptions = {
58
      import: [
59
          path.join(__dirname, "../src/common/stylus/mixin.styl"), // mixin.styl全局变量文件
60
      ],
61
      paths: [
62
          path.join(__dirname, "../src/common/stylus/"),
63
          path.join(__dirname, "../"),
64
      ],
65
  }
66
57 67
  // https://vue-loader.vuejs.org/en/configurations/extract-css.html
58 68
  return {
59 69
    css: generateLoaders(),
@ -61,8 +71,8 @@ exports.cssLoaders = function (options) {
61 71
    less: generateLoaders('less'),
62 72
    sass: generateLoaders('sass', { indentedSyntax: true }),
63 73
    scss: generateLoaders('sass'),
64
    stylus: generateLoaders('stylus'),
65
    styl: generateLoaders('stylus')
74
    stylus: generateLoaders('stylus', stylusOptions),
75
    styl: generateLoaders('stylus', stylusOptions)
66 76
  }
67 77
}
68 78

+ 13 - 1
config/index.js

@ -4,13 +4,25 @@
4 4
5 5
const path = require('path')
6 6
7
// var ServerPost = {
8
//   'api': 'http://192.168.3.233:81'
9
// }
10
7 11
module.exports = {
8 12
  dev: {
9 13
10 14
    // Paths
11 15
    assetsSubDirectory: 'static',
12 16
    assetsPublicPath: '/',
13
    proxyTable: {},
17
    proxyTable: {
18
    	// '/api': {
19
     //    target: ServerPost.api,
20
     //    changeOrigin: true,
21
     //    pathRewrite: {
22
     //      '^/api': ''
23
     //    }
24
     //  }
25
    },
14 26
15 27
    // Various Dev Server settings
16 28
    host: 'localhost', // can be overwritten by process.env.HOST

+ 21 - 5
package-lock.json

@ -1799,6 +1799,11 @@
1799 1799
      "integrity": "sha1-Ro9XGkQ1wkJI9f0MsOjYfDw0Hn0=",
1800 1800
      "dev": true
1801 1801
    },
1802
    "china-area-data": {
1803
      "version": "4.0.0",
1804
      "resolved": "https://registry.npmjs.org/china-area-data/-/china-area-data-4.0.0.tgz",
1805
      "integrity": "sha512-RG9b/ic5ZIGrPXfWgeDvf1DpMZyD6jKAi5ZBjzAlt500nF5uqH9javgKC7ookGtJzFPHwc7+9hs8NRiGj+nFNw=="
1806
    },
1802 1807
    "chokidar": {
1803 1808
      "version": "2.0.3",
1804 1809
      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.3.tgz",
@ -2054,8 +2059,7 @@
2054 2059
    "commander": {
2055 2060
      "version": "2.15.1",
2056 2061
      "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
2057
      "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
2058
      "dev": true
2062
      "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag=="
2059 2063
    },
2060 2064
    "commondir": {
2061 2065
      "version": "1.0.1",
@ -2989,6 +2993,15 @@
2989 2993
      "integrity": "sha1-AOheIidUFaiHUF5KtJc3GU8YubA=",
2990 2994
      "dev": true
2991 2995
    },
2996
    "element-china-area-data": {
2997
      "version": "4.1.0",
2998
      "resolved": "https://registry.npmjs.org/element-china-area-data/-/element-china-area-data-4.1.0.tgz",
2999
      "integrity": "sha512-bv0g/BSTRLWBzWwT/wlZb0W9m2I9C61L0pR442eq1t3LAnfZLtL15X47VDJMMxfDJH0jWt3v0aPtnpmeQOlphw==",
3000
      "requires": {
3001
        "china-area-data": "4.0.0",
3002
        "uglify-js": "3.3.25"
3003
      }
3004
    },
2992 3005
    "element-ui": {
2993 3006
      "version": "2.3.8",
2994 3007
      "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.3.8.tgz",
@ -6022,6 +6035,11 @@
6022 6035
        "path-key": "2.0.1"
6023 6036
      }
6024 6037
    },
6038
    "nprogress": {
6039
      "version": "0.2.0",
6040
      "resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz",
6041
      "integrity": "sha1-y480xTIT2JVyP8urkH6UIq28r7E="
6042
    },
6025 6043
    "nth-check": {
6026 6044
      "version": "1.0.1",
6027 6045
      "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz",
@ -9567,8 +9585,7 @@
9567 9585
    "source-map": {
9568 9586
      "version": "0.6.1",
9569 9587
      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
9570
      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
9571
      "dev": true
9588
      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
9572 9589
    },
9573 9590
    "source-map-resolve": {
9574 9591
      "version": "0.5.2",
@ -10165,7 +10182,6 @@
10165 10182
      "version": "3.3.25",
10166 10183
      "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.25.tgz",
10167 10184
      "integrity": "sha512-hobogryjDV36VrLK3Y69ou4REyrTApzUblVFmdQOYRe8cYaSmFJXMb4dR9McdvYDSbeNdzUgYr2YVukJaErJcA==",
10168
      "dev": true,
10169 10185
      "requires": {
10170 10186
        "commander": "2.15.1",
10171 10187
        "source-map": "0.6.1"

+ 2 - 0
package.json

@ -12,7 +12,9 @@
12 12
  },
13 13
  "dependencies": {
14 14
    "axios": "^0.17.1",
15
    "element-china-area-data": "^4.1.0",
15 16
    "element-ui": "^2.3.8",
17
    "nprogress": "^0.2.0",
16 18
    "style-loader": "^0.20.3",
17 19
    "stylus": "^0.54.5",
18 20
    "swiper": "^4.2.6",

+ 1 - 0
plat-info.json

@ -1,5 +1,6 @@
1 1
{
2 2
  "plat": {
3
  	"id":"9619237FAF5E4B908F0F88A5845C8C9F",
3 4
    "name": "邢台经济开发区",
4 5
    "website": "http://www.xtkfq.gov.cn",
5 6
    "address": "中国河北省邢台市中兴东大街1888号",

+ 10 - 6
src/common/stylus/common.styl

@ -60,8 +60,8 @@ a
60 60
61 61
62 62
.el-button--primary
63
  background-color: $mainColor;
64
  border-color: $mainColor;
63
  background-color: $mainColor
64
  border-color: $mainColor
65 65
66 66
/*认证标识相关*/
67 67
.authicon
@ -71,11 +71,15 @@ a
71 71
  height:16px
72 72
  background-size: cover
73 73
  &.icon-pro
74
    bg-image($iconPro)
74
    bg-image('/static/comimg/porfile_icon_zhuanjia_nor.png')
75 75
  &.icon-com
76
    bg-image($iconCmp)
76
    bg-image('/static/comimg/porfile_icon_qiye_hig.png')
77 77
  &.icon-staff
78
    bg-image($iconStaff)
78
    bg-image('/static/comimg/porfile_icon_yuangong_hig.png')
79 79
  &.icon-real
80 80
    width:24px
81
    bg-image($iconReal)
81
    bg-image('/static/comimg/porfile_icon_shimin_nor.png')
82
83
84
85
  

+ 1 - 2
src/common/stylus/index.styl

@ -1,4 +1,3 @@
1 1
@import './base'
2 2
@import './common'
3
/*@import './icon'*/
4
@import './mixin'
3
@import './listitem'

+ 7 - 39
src/components/sub-component/style.styl

@ -1,37 +1,4 @@
1
@import '../../common/stylus/mixin';
2
3
.item-block
4
  width:180px
5
  overflow:hidden
6
  .item-pic
7
    width:180px
8
    height:120px
9
    box-sizing:border-box
10
    border:1px solid $borderColor
11
    background-size:cover
12
    overflow:hidden
13
  .item-text
14
    margin-top:6px
15
    line-height:30px
16
    &.item-left
17
      text-ellipsis()
18
    .item-tit
19
      text-align:center
20
      display:flex
21
      align-items:center
22
      span
23
        display: inline-block
24
        max-width: 86%
25
        text-ellipsis()
26
    .title
27
      text-ellipsis()
28
    .desc
29
      margin-top:3px
30
      text-ellipsis(2,20px)
31
    .owner
32
      margin-top:10px
33
      text-ellipsis()
34
1
/*home--cmp、expert*/
35 2
.block-container
36 3
  display: flex
37 4
  flex-wrap: wrap
@ -39,7 +6,6 @@
39 6
  margin-bottom:-10px
40 7
  .block-item
41 8
    display:flex
42
    justify-content: space-between
43 9
    width:346px
44 10
    height:140px
45 11
    box-sizing:border-box
@ -53,7 +19,8 @@
53 19
      border:1px solid $borderColor
54 20
      border-radius(50%)
55 21
    .show-info
56
      width:230px
22
      flex:1 0 80px
23
      padding-left:15px
57 24
      .info-tit
58 25
        font-size:18px
59 26
        line-height:28px
@ -75,7 +42,9 @@
75 42
        .item-tag
76 43
          color:$secondaryFont
77 44
          text-ellipsis(1,20px)
45
/*home--cmp、expert*/
78 46
47
/*list--图文*/
79 48
.list-item
80 49
  display:flex
81 50
  align-items:center
@ -85,9 +54,7 @@
85 54
  &:last-child
86 55
    border-none()
87 56
  .list-head
88
    width:180px
89
    height:120px
90
    background:red
57
    center-items()
91 58
  .list-info
92 59
    flex: 1 1 180px
93 60
    padding-left:15px
@ -110,3 +77,4 @@
110 77
    .list-desc
111 78
      text-ellipsis(2,20px)
112 79
      color:$commonFont
80
/*list*/

+ 16 - 16
src/common/stylus/mixin.styl

@ -1,11 +1,13 @@
1
/*main color#319dff*/
2
$mainColor = #409EFF
1
/*main color#319dff*/ $mainColor = #409EFF
2
3 3
/*mian-font*/
4 4
/*主要文字*/ $mainFont = #303133
5 5
/*常规文字*/ $commonFont = #606266
6 6
/*次要文字*/ $secondaryFont = #909399
7 7
/*占位文字*/ $occupancyFont = #C0C4CC
8 8
9
/*boder-color*/ $borderColor = #e4e7ed
10
9 11
10 12
/*bg-about s*/
11 13
bg-blue-color()
@ -34,7 +36,6 @@ border-radius($radius = 6px)
34 36
  -moz-border-radius: $radius
35 37
  border-radius: $radius
36 38
37
$borderColor = #e4e7ed
38 39
border-1px()
39 40
  position:relative
40 41
  &:after
@ -50,10 +51,6 @@ border-none()
50 51
    display:none
51 52
/*border-about e*/
52 53
53
/*margin-about s*/
54
55
/*margin-about e*/
56
57 54
/*text-about s*/
58 55
text-ellipsis($n = 1,$lineH = 30px)
59 56
  display: -webkit-box
@ -67,12 +64,15 @@ text-ellipsis($n = 1,$lineH = 30px)
67 64
  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RuXobZ/ijuOb4aF3KLToe4wCdiIEel6N8bJF/OVnDOxWExQXGmn6YPtscwXmBKhB90Aw6fc/JnkozOMgTCJyoy+gup1yspsSYm621lvpRli06MUt+VzaQ6znrB2yLAxNq5YHfk1rKLICvYIdAYUkPGQ2MSCI2gcYpl8COBQxwlrauaQAbJEp2xcjf9+xO75lXci5yUifxTbJkg9L71E7UyQFDI2GJR9ybjTSKY018X2SV+VxzPWHr4O0hsp3mtNOQ05t0WEa7SMbowczSBqVFZlgeCwieX9irZLNJnC9CcLLkYimJpBWDSycvnV7M+lnHDTr1xjgZEXcu+hNjJqUkGRT958JwNzdVsDRfo3nl64X8XaHRI/ibGiqigvBiPQMzns65RCaTa9UwFPA77CoTgB6+sAuC1gzGOAMzFzuvh1J7mE0FonGYCTwuFBXKt8aGbK0XB1gwasWgH2+tjQDeAHA7Y1BDyk6JQMGxVGSCe71CynvxaksdRpdiMTZS9NR4r/9TbzaBOg5AiIKcOtYgBsFPNaxgF4U0E74SofGo80d2EbxF0Y1YQNhJaz+P3qnZ43vIxT+CjAAwIp3rArpHr4AAAAASUVORK5CYII=";
78
/*head icon*/
67
/*justify align-items center*/
68
center-items($w = 180px,$h = 120px)
69
  display: flex
70
  align-items: center
71
  border: 1px solid $borderColor
72
  box-sizing:border-box
73
  width: $w+2px
74
  height: $h+2px
75
  border-radius(4px)
76
  img
77
    max-width: $w
78
    max-height: 100%

+ 6 - 4
src/components/Main.vue

@ -14,9 +14,11 @@
14 14
  </div>
15 15
</template>
16 16
17
<script>
17
<script type="text/ecmascript-6">
18 18
  import TheHeader from './main-views/TheHeader.vue';
19 19
  import TheFooter from './main-views/TheFooter.vue';
20
  import Cookies from 'js-cookie';
21
  import httpUrl from '@/libs/http';
20 22
21 23
  const ERR_OK = 0;
22 24
@ -27,11 +29,11 @@
27 29
      };
28 30
    },
29 31
    created() {
30
      this.$axios.get('./api/plat').then((res) => {
31
        // console.log(res);
32
        res = res.data;
32
      this.$axios.get(httpUrl.webbase).then(res => {
33
        console.log(res);
33 34
        if (res.errno === ERR_OK) {
34 35
          this.plat = res.data;
36
          Cookies.set('platId', res.data.id);
35 37
        };
36 38
      });
37 39
    },

+ 335 - 0
src/components/bench-views/UpdateInfo.vue

@ -0,0 +1,335 @@
1
<template>
2
  <div class="workbench">
3
    <div class="content-wrapper block-wrapper">
4
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" class="update-wrapper demo-ruleForm">
5
        <div class="update-logo">
6
          <el-upload
7
            class="avatar-uploader"
8
            :action="uploadUrl"
9
            :show-file-list="false"
10
            ref="uploadLogo"
11
            :on-success="handleAvatarSuccess"
12
            :before-upload="beforeAvatarUpload">
13
            <img v-if="imageUrl" :src="imageUrl" class="avatar">
14
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
15
          </el-upload>
16
          <div class="update-tip">PNG/JPG/JPEG格式<br>大小2M以内</div>
17
        </div>
18
        <div class="update-main">
19
          <div class="update-title">{{plf_name}}</div>
20
          <el-form-item label="联系人" prop="linkman">
21
            <el-input v-model="ruleForm.linkman" class="shortW" placeholder="请填写平台联系人姓名"></el-input>
22
          </el-form-item>
23
          <el-form-item label="联系电话" prop="tel">
24
            <el-input v-model="ruleForm.tel" placeholder="请填写联系电话"></el-input>
25
          </el-form-item>
26
          <el-form-item label="联系邮箱" prop="mail">
27
            <el-input v-model="ruleForm.mail" placeholder="请填写联系邮箱"></el-input>
28
          </el-form-item>
29
          <el-form-item label="所在城市" prop="selectedOptions">
30
            <el-cascader
31
              :options="optionsCity"
32
              v-model="selectedOptions"
33
              @change="handleChange" class="shortW"
34
              placeholder="请选择所在的城市">
35
            </el-cascader>
36
          </el-form-item>
37
          <el-form-item label="联系地址" prop="address">
38
            <el-input v-model="ruleForm.address" placeholder="如:北京市海淀区学院路方兴大厦"></el-input>
39
          </el-form-item>
40
          <el-form-item label="官方网址" prop="website">
41
            <el-input v-model="ruleForm.website" placeholder="如:www.ekexiu.com"></el-input>
42
          </el-form-item>
43
          <el-form-item label="面向行业" prop="industry">
44
            <el-tag
45
              :key="tag"
46
              v-for="tag in dynamicTags"
47
              closable
48
              :disable-transitions="false"
49
              @close="handleClose(tag)">
50
              {{tag}}
51
            </el-tag>
52
            <el-input
53
              class="input-new-tag"
54
              v-if="inputVisible"
55
              v-model="inputValue"
56
              ref="saveTagInput"
57
              size="small"
58
              @keyup.enter.native="handleInputConfirm"
59
              @blur="handleInputConfirm"
60
            >
61
            </el-input>
62
            <el-button v-else class="button-new-tag" v-show="isShowAdd" size="small" @click="showInput">+ 请填写园区面向的行业,如:互联网/智能制造/新材料</el-button>
63
          </el-form-item>
64
          <el-form-item label="平台介绍" prop="desc">
65
            <el-input type="textarea" v-model="ruleForm.desc" placeholder="请填写一个简单的介绍,让大家更好地了解平台"></el-input>
66
          </el-form-item>
67
          <el-form-item></el-form-item>
68
          <el-form-item>
69
            <el-button type="primary" @click="submitForm('ruleForm')">保存</el-button>
70
            <el-button @click="resetForm">取消</el-button>
71
          </el-form-item>
72
        </div>
73
      </el-form>
74
    </div>
75
  </div>
76
</template>
77
78
<script type="text/ecmascript-6">
79
  import Vue from 'vue';
80
  import {
81
    provinceAndCityData,
82
    CodeToText,
83
    TextToCode
84
  } from 'element-china-area-data';
85
86
  import Cookies from 'js-cookie';
87
  import util from '@/libs/util';
88
  import httpUrl from '@/libs/http';
89
90
  export default {
91
    props: {
92
      plat: {
93
        type: Object
94
      }
95
    },
96
    data() {
97
      return {
98
        plf_user: '',
99
        plf_name: '',
100
        imageUrl: '', // 临时地址
101
        imgName: '', // 图片的name
102
        uploadUrl: httpUrl.workbench.uploadImg,
103
        optionsCity: provinceAndCityData,
104
        selectedOptions: [],
105
        dynamicTags: [],
106
        isShowAdd: true,
107
        inputVisible: false,
108
        inputValue: '',
109
        ruleForm: {
110
          linkman: '',
111
          tel: '',
112
          mail: '',
113
          address: '',
114
          website: '',
115
          industry: '',
116
          desc: ''
117
        },
118
        rules: {
119
          linkman: [
120
            { required: true, message: '请填写平台联系人姓名', trigger: 'blur' },
121
            { max: 10, message: '不得超过10个字', trigger: 'blur' }
122
          ],
123
          tel: [
124
            { required: true, message: '请填写联系电话', trigger: 'blur' },
125
            { max: 50, message: '不得超过50个字', trigger: 'blur' }
126
          ],
127
          mail: [
128
            { required: true, message: '请填写联系邮箱', trigger: 'blur' },
129
            { type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur' },
130
            { max: 50, message: '不得超过50个字', trigger: 'blur' }
131
          ],
132
          desc: [
133
            { required: true, message: '请填写平台介绍', trigger: 'blur' },
134
            { max: 1000, message: '不得超过1000个字', trigger: 'blur' }
135
          ],
136
          address: [
137
            { max: 50, message: '不得超过50个字', trigger: 'blur' }
138
          ],
139
          website: [
140
            { max: 50, message: '不得超过50个字', trigger: 'blur' }
141
          ]
142
        }
143
      };
144
    },
145
    computed: {
146
    },
147
    created() {
148
      this.plf_user = Cookies.get('plf_user');
149
      this.getPlatInfo(this.plf_user);
150
    },
151
    methods: {
152
      getPlatInfo(id) {
153
        this.$axios.get(httpUrl.workbench.platBase, {
154
          params: {
155
            id: id
156
          }
157
        }).then((res) => {
158
          console.log(res);
159
          let str = res.data;
160
          this.plf_name = str.name;
161
          this.imageUrl = util.orgLogoUrl(str.logo);
162
          this.imgName = str.logo;
163
          this.ruleForm.linkman = str.linkman;
164
          this.ruleForm.tel = str.linkphone;
165
          this.ruleForm.mail = str.linkemail;
166
          if (str.province) {
167
            Vue.set(this.selectedOptions, 0, TextToCode[str.province].code);
168
          }
169
          if (str.city) {
170
            Vue.set(this.selectedOptions, 1, TextToCode[str.province][str.city].code);
171
          }
172
          this.ruleForm.address = str.addr;
173
          this.ruleForm.website = str.url;
174
          if (str.industry) {
175
            this.ruleForm.industry = str.industry;
176
            this.dynamicTags = str.industry.split(',');
177
            if (this.dynamicTags.length === 10) {
178
              this.isShowAdd = false;
179
            }
180
          }
181
          this.ruleForm.desc = str.descp;
182
        });
183
      },
184
      submitForm(formName) {
185
        this.$refs[formName].validate((valid) => {
186
          if (valid) {
187
            this.$refs.uploadLogo.submit(); // 确认上传图片
188
189
            let paramsData = {
190
              'id': this.plf_user,
191
              'name': this.plf_name,
192
              'linkman': this.ruleForm.linkman,
193
              'logo': this.imgName,
194
              'linkphone': this.ruleForm.tel,
195
              'linkemail': this.ruleForm.mail,
196
              'province': CodeToText[this.selectedOptions[0]],
197
              'city': CodeToText[this.selectedOptions[1]],
198
              'addr': this.ruleForm.address,
199
              'url': this.ruleForm.website,
200
              'industry': this.ruleForm.industry,
201
              'descp': this.ruleForm.desc
202
            };
203
            this.$axios.post(httpUrl.workbench.updateInfo, paramsData).then((res) => {
204
              this.$message({
205
                message: '平台信息修改成功!',
206
                type: 'success'
207
              });
208
              Cookies.set('plf_logo', this.imgName);
209
              this.$router.push({path: '/WorkHome'});
210
            }).catch(error => {
211
              console.log(error);
212
            });
213
          } else {
214
            console.log('error submit!!');
215
            return false;
216
          }
217
        });
218
      },
219
      resetForm(formName) {
220
        this.$router.push({path: '/WorkHome'});
221
      },
222
      // cityPicker
223
      handleChange (value) {
224
        console.log(value);
225
      },
226
      // cityPicker
227
      // upload img
228
      handleAvatarSuccess(res, file) {
229
        this.imageUrl = URL.createObjectURL(file.raw);
230
        this.imgName = 'platform' + res.data[0].uri;
231
      },
232
      beforeAvatarUpload(file) {
233
        const isJPG = file.type === 'image/jpeg';
234
        const isPNG = file.type === 'image/png';
235
        const isLt2M = file.size / 1024 / 1024 < 2;
236
        if (!isJPG && !isPNG) {
237
          this.$message.error('请上传PNG/JPG/JPEG格式的图片');
238
        }
239
        if (!isLt2M) {
240
          this.$message.error('上传logo大小不能超过 2MB!');
241
        }
242
        return (!isJPG || !isPNG) && isLt2M;
243
      },
244
      // upload img
245
      // add tag
246
      handleClose(tag) {
247
        this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
248
        this.ruleForm.industry = this.dynamicTags.join(',');
249
        if (this.dynamicTags.length < 10) {
250
          this.isShowAdd = true;
251
        }
252
      },
253
      showInput() {
254
        this.inputVisible = true;
255
        this.$nextTick(_ => {
256
          this.$refs.saveTagInput.$refs.input.focus();
257
        });
258
      },
259
      handleInputConfirm() {
260
        let inputValue = this.inputValue;
261
        if (inputValue.length > 15) {
262
          this.$message.error('面向行业不得超过15个字,添加失败!');
263
        }
264
        if (this.dynamicTags.length === 10) {
265
          this.isShowAdd = false;
266
        }
267
        if (inputValue && inputValue.length < 15 && this.dynamicTags.length < 10) {
268
          this.dynamicTags.push(inputValue);
269
        }
270
        this.ruleForm.industry = this.dynamicTags.join(',');
271
        this.inputVisible = false;
272
        this.inputValue = '';
273
      }
274
      // add tag
275
    }
276
  };
277
</script>
278
279
<style lang="stylus" rel="stylesheet/stylus">
280
  .update-wrapper
281
    display:flex
282
    .update-logo
283
      width:280px
284
      .avatar-uploader
285
        .el-upload
286
          display:flex
287
          align-items:center
288
          border: 1px dashed #d9d9d9
289
          border-radius: 6px
290
          cursor: pointer
291
          position: relative
292
          width: 280px
293
          height: 187px
294
          overflow: hidden
295
          &:hover
296
            border-color: $mainColor
297
          .avatar-uploader-icon
298
            font-size: 40px
299
            color: #8c939d
300
            width: 280px
301
            height: 187px
302
            line-height: 187px
303
            text-align: center
304
          .avatar
305
            max-width: 280px
306
            max-height: 187px
307
            display: block
308
      .update-tip
309
        margin-top:15px
310
        text-align:center
311
        font-size:14px
312
        color:$secondaryFont
313
    .update-main
314
      flex:1 0 280px
315
      padding-left:25px
316
      .update-title
317
        font-size:30px
318
        line-height:54px
319
        margin-bottom:16px
320
        padding-left:10px
321
322
      .el-tag + .el-tag
323
        margin-left: 10px
324
      .button-new-tag
325
        height: 32px
326
        line-height: 30px
327
        padding-top: 0
328
        padding-bottom: 0
329
      .input-new-tag
330
        width: 90px
331
        margin-left: 10px
332
        vertical-align: bottom
333
    .shortW
334
      width:300px
335
</style>

+ 4 - 4
src/components/bench-views/WorkCommon.vue

@ -14,9 +14,10 @@
14 14
  </div>
15 15
</template>
16 16

17
<script>
17
<script type="text/ecmascript-6">
18 18
  import TheHeader from './WorkHead.vue';
19 19
  import TheFooter from '../main-views/TheFooter.vue';
20
  import httpUrl from '@/libs/http';
20 21

21 22
  const ERR_OK = 0;
22 23

@ -27,9 +28,8 @@
27 28
      };
28 29
    },
29 30
    created() {
30
      this.$axios.get('./api/plat').then((res) => {
31
        // console.log(res);
32
        res = res.data;
31
      this.$axios.get(httpUrl.webbase).then(res => {
32
        console.log(res);
33 33
        if (res.errno === ERR_OK) {
34 34
          this.plat = res.data;
35 35
        };

+ 84 - 91
src/components/bench-views/WorkHead.vue

@ -1,22 +1,22 @@
1 1
<template>
2 2
	<div class="workHeader">
3 3
		<div class="workHeaderWrapper">
4
				<ul class="workHeaderMain">
4
				<ul class="contain-wrapper workHeaderMain">
5 5
					<li>
6
						<a href="http://www.ekexiu.com" target="_blank" >
6
						<a :href="kexiuLink" target="_blank">
7 7
							<h1 class="kexiuLogo"></h1>
8 8
						</a>
9 9
					</li>
10 10
					<li>
11 11
            <div @mouseover="overShow" @mouseout="outHide" class="logoBox">
12 12
              <div class="loginLogo">
13
                <img src="./img/home_icon_logo_orange.png"/>
13
                <img :src="plf_logo"/>
14 14
              </div>
15 15
              <el-collapse-transition>
16 16
                <div class="logoChild" v-show="animateStatus">
17 17
                  <div class="triangle"></div>
18 18
                  <ul>
19
                    <li> <span class="icon1"></span>修改资料</li>
19
                    <li @click="updateInfo"> <span class="icon1"></span>修改资料</li>
20 20
                    <li> <span class="icon2"></span>账户设置</li>
21 21
                    <li> <span class="icon3"></span>退出登录</li>
22 22
                  </ul>
@ -29,10 +29,15 @@
29 29
	</div>
30 30
</template>
31 31

32
<script>
32
<script type="text/ecmascript-6">
33
  import Cookies from 'js-cookie';
34
  import util from '@/libs/util';
35

33 36
	export default {
34 37
    data() {
35 38
      return {
39
        kexiuLink: util.ekexiuUrl,
40
        plf_logo: '',
36 41
        animateStatus: false
37 42
      };
38 43
    },
@ -42,101 +47,89 @@
42 47
      },
43 48
      outHide() {
44 49
        this.animateStatus = false;
50
      },
51
      updateInfo() {
52
        this.$router.push({path: '/updateInfo'});
45 53
      }
54
    },
55
    created() {
56
      this.plf_logo = util.orgLogoUrl(Cookies.get('plf_logo'));
46 57
    }
47 58
	};
48 59
</script>
49 60

50 61
<style lang="stylus" rel="stylesheet/stylus">
51
  @import '../../common/stylus/mixin'
52
    .workHeader
53
      .workHeaderWrapper
54
        width: 100%
55
        height: 60px
56
        background: #fff
57
        border-bottom: 2px solid #e5e5e5
58
        box-sizing: border-box
59
        position: fixed
60
        top: 0
61
        left: 0
62
        right: 0
63
        z-index: 1000
64
        font-size: 16px
65
        line-height: 32px
62
  .workHeader
63
    .workHeaderWrapper
64
      height: 60px
65
      background: #fff
66
      border-bottom: 2px solid $borderColor
67
      box-sizing: border-box
68
      z-index: 1000
69
      font-size: 16px
70
      line-height: 32px
71
      display: flex
72
      justify-content: center
73
    .workHeaderMain
74
      display: flex
75
      justify-content: space-between
76
      li
66 77
        display: flex
67
        display: -webkit-flex
68
        justify-content: center
69
      .workHeaderMain
70
        width: 1100px
71
        padding: 0 10px
72
        display: flex
73
        display: -webkit-flex
74
        justify-content: space-between
75
        li
76
          display: flex
77
          align-items: center
78
        align-items: center
78 79

79
          .kexiuLogo
80
            width: 60px
81
            height: 30px
82
            bg-image('./img/home_icon_logo_orange.png')
83
            background-size: contain
84
            overflow: hidden
85
          .logoBox
86
            position:relative
87
            .logoChild
80
        .kexiuLogo
81
          width: 60px
82
          height: 30px
83
          bg-image('./img/home_icon_cmplogo.png')
84
          background-size: contain
85
          overflow: hidden
86
        .logoBox
87
          position:relative
88
          .logoChild
89
            position: absolute
90
            top: 45px
91
            right: 0
92
            width: 180px
93
            height: 140px
94
            z-index: 1000
95
            .triangle
96
              width: 0
97
              height: 0
98
              border: 8px solid transparent
99
              border-bottom-color: $mainColor
88 100
              position: absolute
89
              top: 45px
90
              right: 0
91
              width: 180px
92
              height: 140px
93
              .triangle
94
                width: 0
95
                height: 0
96
                border: 8px solid transparent
97
                border-bottom-color: #28b8fa
98
                position: absolute
99
                right: 10px
100
                top: 0
101
              right: 10px
102
              top: 0
101 103

102
              ul
104
            ul
105
              width: 100%
106
              bg-blue-color()
107
              border-radius()
108
              overflow: hidden
109
              position: absolute
110
              top: 16px
111
              li
103 112
                width: 100%
104
                background: #28b8fa
105
                border-radius: 8px
106
                overflow: hidden
107
                position: absolute
108
                top: 16px
109
                li
110
                  width: 100%
111
                  height: 40px
112
                  line-height: 40px
113
                  font-size: 13px
114
                  color: #fff
115
                  cursor: pointer
116
                  &:hover
117
                    background: #17a4e4
118
                  span
119
                    background-image: url('./img/index-icon.png')
120
                    background-repeat: no-reapt
121
                    margin:0 10px
122
                    display: block
123
                    width: 20px
124
                    height: 20px
125
                  .icon1
126
                     background-position: -40px 0
127
                  .icon2
128
                     background-position: -60px 0
129
                  .icon3
130
                     background-position: -20px 0
131
            .loginLogo
132
              display: flex
133
              align-items: center
134
              cursor: pointer
135
              border: 1px solid #e5e5e5
136
              width: 42px
137
              height: 42px
138
              img
139
                display:block
140
                max-width: 40px
141
                max-height: 100%
113
                height: 40px
114
                line-height: 40px
115
                font-size: 13px
116
                color: #fff
117
                cursor: pointer
118
                &:hover
119
                  bg-blue-active-color()
120
                span
121
                  bg-image('./img/index-icon.png')
122
                  margin:0 10px
123
                  display: block
124
                  width: 20px
125
                  height: 20px
126
                .icon1
127
                   background-position: -40px 0
128
                .icon2
129
                   background-position: -60px 0
130
                .icon3
131
                   background-position: -20px 0
132
          .loginLogo
133
            cursor: pointer
134
            center-items(40px,40px)
142 135
</style>

+ 155 - 1
src/components/bench-views/WorkHome.vue

@ -1,3 +1,157 @@
1 1
<template>
2
  <div>我是工作台主页</div>
2
  <div class="workbench">
3
    <div class="content-wrapper head-wrapper block-wrapper">
4
      <div class="logo-show">
5
        <img :src="imgUrl" />
6
      </div>
7
      <div class="info-show">
8
        <div class="info-tit">{{platInfo.name}}</div>
9
        <div class="info-desc">
10
          <p v-show="platInfo.addr">联系地址:{{platInfo.addr}}</p>
11
          <p v-show="platInfo.linkphone">联系电话:{{platInfo.linkphone}}</p>
12
        </div>
13
      </div>
14
      <div class="btn-show">
15
        <el-button type="primary" @click="updateInfo">修改资料</el-button>
16
      </div>
17
    </div>
18
    <div class="main-wrapper block-wrapper">
19
      <ul>
20
        <li @click="conManage">
21
          <div class="li-content">
22
            <p class="li-tit">内容管理</p>
23
            <p class="li-tip">管理【平台新闻】和【企业动态】栏目</p>
24
          </div>
25
        </li>
26
        <li @click="cmpManage">
27
          <div class="li-content">
28
            <p class="li-tit">企业管理</p>
29
            <p class="li-tip">管理入驻平台的企业</p>
30
          </div>
31
        </li>
32
        <li @click="demandManage">
33
          <div class="li-content">
34
            <p class="li-tit">需求查询</p>
35
            <p class="li-tip">查看用户在平台发布的需求</p>
36
          </div>
37
        </li>
38
        <li @click="serviceManage">
39
          <div class="li-content">
40
            <p class="li-tit">对接服务</p>
41
            <p class="li-tip">查看我们为您对接的专家与机构</p>
42
          </div>
43
        </li>
44
        <li>
45
          <div class="li-content">
46
            <p class="li-tip">更多功能 敬请期待</p>
47
          </div>
48
        </li>
49
      </ul>
50
    </div>
51
  </div>
3 52
</template>
53

54
<script>
55
  import Cookies from 'js-cookie';
56
  import util from '@/libs/util';
57
  import httpUrl from '@/libs/http';
58

59
  export default {
60
    data() {
61
      return {
62
        platInfo: '',
63
        imgUrl: '',
64
        plf_user: ''
65
      };
66
    },
67
    computed: {
68
    },
69
    created () {
70
      this.plf_user = Cookies.get('plf_user');
71
      this.getPlatInfo(this.plf_user);
72
    },
73
    methods: {
74
      getPlatInfo(id) {
75
        this.$axios.get(httpUrl.workbench.platBase, {
76
          params: {
77
            id: id
78
          }
79
        }).then((res) => {
80
          console.log(res);
81
          this.platInfo = res.data;
82
          this.imgUrl = util.orgLogoUrl(res.data.logo);
83
        });
84
      },
85
      updateInfo() {
86
        this.$router.push({path: '/updateInfo'});
87
      },
88
      conManage() {
89
        this.$router.push({path: '/findPwd'});
90
      },
91
      cmpManage() {
92
        this.$router.push({path: '/findPwd'});
93
      },
94
      demandManage() {
95
        this.$router.push({path: '/findPwd'});
96
      },
97
      serviceManage() {
98
        this.$router.push({path: '/findPwd'});
99
      }
100
    }
101
  };
102
</script>
103

104
<style lang="stylus" rel="stylesheet/stylus">
105
  .head-wrapper
106
    display:flex
107
    align-items:center
108
    .logo-show
109
      center-items(210px,140px)
110
    .info-show
111
      flex:1 0 210px
112
      padding-left:15px
113
      .info-tit
114
        font-size:24px
115
        line-height:34px
116
      .info-desc
117
        margin-top:10px
118
        font-size:14px
119
        line-height:22px
120
  .main-wrapper
121
    ul
122
      display:flex
123
      flex-wrap:wrap
124
      margin-right:-10px
125
      margin-bottom:-10px
126
      li
127
        display:flex
128
        align-items:center
129
        text-align:center
130
        background:#fff
131
        width:360px
132
        height:180px
133
        margin-right:10px
134
        margin-bottom:10px
135
        cursor:pointer
136
        .li-content
137
          width:100%
138
          line-height:34px
139
          .li-tit
140
            font-size:18px
141
          .li-tip
142
            color:$secondaryFont
143
            font-size:14px
144
        &:hover
145
          background:$mainColor
146
          color:#fff
147
          .li-tip
148
            color:#fff
149
        &:last-child
150
          background:#e5e5e5
151
          cursor:auto
152
          &:hover
153
            background:#e5e5e5
154
            .li-tip
155
              color:$secondaryFont
156

157
</style>

二進制
src/components/bench-views/img/home_icon_cmplogo.png


二進制
src/components/bench-views/img/home_icon_logo_orange.png


+ 38 - 2
src/components/form-views/loginPlat.vue

@ -13,7 +13,7 @@
13 13
          </el-form-item>
14 14
          <el-form-item></el-form-item>
15 15
          <el-form-item>
16
            <el-button type="primary" :disabled="isDisabl" @click="submitForm('ruleForm')">登录</el-button>
16
            <el-button type="primary" :disabled="isDisabl" :loading="logining" @click="submitForm('ruleForm')">登录</el-button>
17 17
            <el-button type="text" @click="goBackPwd">忘记密码?</el-button>
18 18
          </el-form-item>
19 19
        </el-form>
@ -23,9 +23,12 @@
23 23
</template>
24 24

25 25
<script type="text/ecmascript-6">
26
  import httpUrl from '@/libs/http';
27

26 28
  export default {
27 29
     data() {
28 30
      return {
31
        logining: false,
29 32
        isDisabl: false,
30 33
        ruleForm: {
31 34
          mail: '',
@ -47,7 +50,40 @@
47 50
      submitForm(formName) {
48 51
        this.$refs[formName].validate((valid) => {
49 52
          if (valid) {
50
            this.$router.push({path: '/WorkHome'});
53
            this.logining = true;
54
            let paramsData = {
55
              'email': this.ruleForm.mail,
56
              'pw': this.ruleForm.pass
57
            };
58
            this.$axios.post(httpUrl.workbench.login, paramsData).then(res => {
59
              this.logining = false;
60
              console.log(res);
61
              if (res.success) {
62
                this.$router.push({path: '/WorkHome'});
63
              } else {
64
                let errorCode = [{
65
                  code: -600001,
66
                  msg: '用户不存在'
67
                }, {
68
                  code: -600002,
69
                  msg: '密码不正确'
70
                }, {
71
                  code: -600003,
72
                  msg: '平台信息不存在'
73
                }, {
74
                  code: -600004,
75
                  msg: '用户被禁用'
76
                }];
77
                for (let i = 0; i < errorCode.length; i++) {
78
                  if (res.code === errorCode[i].code) {
79
                    this.$message.error(errorCode[i].msg);
80
                    return;
81
                  };
82
                };
83
              }
84
            }).catch(error => {
85
              console.log(error);
86
            });
51 87
          } else {
52 88
            return false;
53 89
          }

+ 0 - 2
src/components/form-views/style.styl

@ -1,5 +1,3 @@
1
@import '../../common/stylus/mixin';
2

3 1
.login 
4 2
  position:relative
5 3
  width:100%

+ 30 - 7
src/components/main-views/TheFooter.vue

@ -6,13 +6,13 @@
6 6
					<img class="logo-block" :src="plat.logourl">
7 7
					<div>
8 8
						<router-link to='aboutUs'>关于我们 |</router-link>
9
						<a :href="plat.website" class="a-link">{{plat.name}} |</a>
10
						<a href="http://www.ekexiu.com/" target="_blank">科袖网 |</a>
11
						<router-link to="loginPlat">平台管理员登录</router-link>
9
						<a :href="plat.website">{{plat.name}} |</a>
10
						<a :href="kexiuLink" target="_blank">科袖网 |</a>
11
						<a @click="goWorkBench">平台管理员登录</a>
12 12
					</div>
13 13
					<div>
14
						<span class="listlink">客服热线: 010-62343359</span>
15
						<span class="listlink">客服邮箱:<a rel="nofollow" href="mailto:service@ekexiu.com"> service@ekexiu.com</a></span>
14
						<span class="listlink">客服热线: {{plat.tel}}</span>
15
						<span class="listlink">客服邮箱:<a rel="nofollow" :href="'mailto:'+ plat.mailbox"> {{plat.mailbox}}</a></span>
16 16
					</div>
17 17
					<div>
18 18
						<span class="listlink">工作时间: 周一至周五  9:00-18:00 </span>
@ -28,17 +28,40 @@
28 28
</template>
29 29
30 30
<script type="text/javascript">
31
  import Cookies from 'js-cookie';
32
  import util from '@/libs/util';
33
31 34
  export default {
32 35
    props: {
33 36
      plat: {
34 37
        type: Object
35 38
      }
39
    },
40
    data() {
41
      return {
42
        kexiuLink: util.ekexiuUrl,
43
        plf_user: ''
44
      };
45
    },
46
    methods: {
47
      init () {
48
        this.plf_user = Cookies.get('plf_user');
49
      },
50
      goWorkBench() {
51
        if (this.plf_user) {
52
          this.$router.push({path: '/WorkHome'});
53
        } else {
54
          this.$router.push({path: '/loginPlat'});
55
        };
56
      }
57
    },
58
    mounted () {
59
      this.init();
36 60
    }
37 61
  };
38 62
</script>
39 63
40 64
<style lang="stylus" rel="stylesheet/stylus">
41
  @import '../../common/stylus/mixin';
42 65
43 66
  .footer
44 67
    bg-grey-color()
@ -56,7 +79,7 @@
56 79
          margin-right:25px
57 80
        a
58 81
          color:#888
59
82
          cursor:pointer
60 83
    .copy-wrapper
61 84
      margin-top:20px
62 85
      font-size:12px

+ 9 - 4
src/components/main-views/TheHeader.vue

@ -5,11 +5,11 @@
5 5
        <div class="wrapper-left">
6 6
          <a :href="plat.website" class="a-link">{{plat.name}}</a>
7 7
          <span> X </span>
8
          <a href="http://www.ekexiu.com" class="a-link">科袖网</a>
8
          <a :href="kexiuLink" class="a-link">科袖网</a>
9 9
          <span>联合为您服务</span>
10 10
        </div>
11 11
        <div class="wrapper-right">
12
          <a href="https://www.ekexiu.com/cmp-portal/cmp-settled-log.html" class="a-link">进入企业版</a>
12
          <a :href="kexiuLink + '/cmp-portal/cmp-settled-log.html'" class="a-link">进入企业版</a>
13 13
        </div>
14 14
      </div>
15 15
    </div>
@ -32,18 +32,23 @@
32 32
</template>
33 33
34 34
<script type="text/javascript">
35
  import util from '@/libs/util';
36
35 37
  export default {
36 38
    props: {
37 39
      plat: {
38 40
        type: Object
39 41
      }
42
    },
43
    data() {
44
      return {
45
        kexiuLink: util.ekexiuUrl
46
      };
40 47
    }
41 48
  };
42 49
</script>
43 50
44 51
<style lang="stylus" rel="stylesheet/stylus">
45
  @import '../../common/stylus/mixin';
46
47 52
  .header
48 53
    .top-wrapper
49 54
      width: 100%

+ 0 - 2
src/components/main-views/ViewAboutUs.vue

@ -34,8 +34,6 @@
34 34
</script>
35 35
36 36
<style lang="stylus" rel="stylesheet/stylus">
37
  @import '../../common/stylus/mixin';
38
39 37
  .aboutUs
40 38
    margin-bottom:20px
41 39
    padding:20px

+ 1 - 3
src/components/main-views/ViewCooperationAgency.vue

@ -2,9 +2,7 @@
2 2
	<div class="cooperation">
3 3
		<div class="content-wrapper">
4 4
			<div class="content-title">平台合作机构</div>
5
			<div class="block-container">
6
				<baseAgency v-for="item in 10" :key="item"></baseAgency>
7
			</div>
5
			<baseAgency></baseAgency>
8 6
		</div>
9 7
	</div>
10 8
</template>

+ 0 - 2
src/components/main-views/ViewFindResource.vue

@ -53,8 +53,6 @@
53 53
</script>
54 54
55 55
<style lang="stylus" rel="stylesheet/stylus">
56
  @import '../../common/stylus/mixin';
57
58 56
  .tab-wrapper
59 57
    display:flex
60 58
    align-items:baseline

+ 0 - 1
src/components/main-views/ViewFindServe.vue

@ -53,7 +53,6 @@
53 53
</script>
54 54
55 55
<style lang="stylus" rel="stylesheet/stylus">
56
	@import '../../common/stylus/mixin';
57 56
58 57
	.tab-wrapper
59 58
		display:flex

+ 55 - 10
src/components/main-views/ViewHome.vue

@ -172,9 +172,7 @@
172 172
            <span>合作机构</span>
173 173
            <router-link class="content-more" to="">查看全部</router-link>
174 174
        </div>
175
        <div class="block-container">
176
          <baseAgency v-for="item in 3" :key="item"></baseAgency>
177
        </div>
175
        <baseAgency :num="3"></baseAgency>
178 176
      </div>
179 177
    </div>
180 178
    <!-- <Loading></Loading> -->
@ -182,6 +180,9 @@
182 180
</template>
183 181
184 182
<script type="text/ecmascript-6">
183
  import Cookies from 'js-cookie';
184
  import httpUrl from '@/libs/http';
185
185 186
  import Swiper from 'swiper';
186 187
  import 'swiper/dist/css/swiper.min.css';
187 188
@ -194,6 +195,16 @@
194 195
        type: Object
195 196
      }
196 197
    },
198
    data() {
199
      return {
200
        platId: '',
201
        rows: 20
202
      };
203
    },
204
    created() {
205
       this.platId = Cookies.get('platId');
206
       this.queryOrg(this.platId);
207
    },
197 208
    mounted() {
198 209
      this.latestCmpSwiper = new Swiper(this.$refs.latestCmp, {
199 210
        slidesPerView: 5.5,
@ -222,6 +233,18 @@
222 233
        }
223 234
      });
224 235
    },
236
    methods: {
237
      queryOrg(id) {
238
        this.$axios.get(httpUrl.homequery.residentOrgs, {
239
          params: {
240
            pid: id,
241
            rows: this.rows
242
          }
243
        }).then((res) => {
244
          console.log(res);
245
        });
246
      }
247
    },
225 248
    components: {
226 249
      baseAgency,
227 250
      baseExpert
@ -230,7 +253,6 @@
230 253
</script>
231 254
232 255
<style lang="stylus" rel="stylesheet/stylus">
233
  @import '../../common/stylus/mixin';
234 256
235 257
  .home-main
236 258
    .block-wrapper
@ -260,12 +282,10 @@
260 282
        .content
261 283
          display: flex
262 284
          .pictures
263
            width:180px
264
            height:120px
265
            background:red
266
            margin-right:15px
285
            center-items()
267 286
          .maincon
268
            width:565px
287
            flex:1 0 180px
288
            padding-left:15px
269 289
            height:120px
270 290
            overflow:hidden
271 291
            li
@ -335,5 +355,30 @@
335 355
            display:inline-block
336 356
            padding-left:20px
337 357
            color:$secondaryFont
338
358
        .item-block
359
          width:182px
360
          overflow:hidden
361
          .item-pic
362
            center-items()
363
          .item-text
364
            margin-top:6px
365
            line-height:30px
366
            &.item-left
367
              text-ellipsis()
368
            .item-tit
369
              text-align:center
370
              display:flex
371
              align-items:center
372
              span
373
                display: inline-block
374
                max-width: 86%
375
                text-ellipsis()
376
            .title
377
              text-ellipsis()
378
            .desc
379
              margin-top:3px
380
              text-ellipsis(2,20px)
381
            .owner
382
              margin-top:10px
383
              text-ellipsis()
339 384
</style>

+ 0 - 1
src/components/main-views/ViewPlatTrend.vue

@ -52,7 +52,6 @@ import baseArticle from '../sub-component/BaseArticle';
52 52
</script>
53 53
54 54
<style lang="stylus" rel="stylesheet/stylus">
55
	@import '../../common/stylus/mixin';
56 55
57 56
	.tab-wrapper
58 57
		padding:10px 20px

+ 10 - 12
src/components/sub-component/BaseAgency.vue

@ -1,12 +1,14 @@
1 1
<template>
2
  <div class="block-item org-item">
3
    <div class="item-block">
4
      <div class="item-pic">
5
        <img src="">
6
      </div>
7
      <div class="item-text">
8
        <div class="item-tit"><span>北京科袖科技有限公司北京科有限公司北京科袖科技有限公司</span><em class="authicon icon-com"></em></div>
9
        <p class="item-tag">所属行业 | 所属行业 | 所属行业</p>
2
  <div class="block-container">
3
    <div class="block-item org-item" v-for="item in 3" :key="item">
4
      <div class="item-block">
5
        <div class="item-pic">
6
          <img src="">
7
        </div>
8
        <div class="item-text">
9
          <div class="item-tit"><span>北京科袖科技有限公司北京科有限公司北京科袖科技有限公司</span><em class="authicon icon-com"></em></div>
10
          <p class="item-tag">所属行业 | 所属行业 | 所属行业</p>
11
        </div>
10 12
      </div>
11 13
    </div>
12 14
  </div>
@ -17,7 +19,3 @@
17 19
18 20
  };
19 21
</script>
20
21
<style lang="stylus" rel="stylesheet/stylus">
22
  @import './style';
23
</style>

+ 0 - 4
src/components/sub-component/BaseArticle.vue

@ -19,7 +19,3 @@
19 19
20 20
  };
21 21
</script>
22
23
<style lang="stylus" rel="stylesheet/stylus">
24
  @import './style';
25
</style>

+ 0 - 4
src/components/sub-component/BaseExpert.vue

@ -19,7 +19,3 @@
19 19
20 20
  };
21 21
</script>
22
23
<style lang="stylus" rel="stylesheet/stylus">
24
  @import './style';
25
</style>

+ 0 - 4
src/components/sub-component/BaseResource.vue

@ -14,7 +14,3 @@
14 14
15 15
  };
16 16
</script>
17
18
<style lang="stylus" rel="stylesheet/stylus">
19
  @import './style';
20
</style>

+ 0 - 4
src/components/sub-component/BaseService.vue

@ -14,7 +14,3 @@
14 14
15 15
  };
16 16
</script>
17
18
<style lang="stylus" rel="stylesheet/stylus">
19
  @import './style';
20
</style>

+ 62 - 0
src/libs/axios.js

@ -0,0 +1,62 @@
1
import Vue from 'vue';
2
import axios from 'axios';
3
import qs from 'qs';
4
// import http from './http';
5
6
// const ajaxUrl = 'http://192.168.3.233:81';
7
// const ajaxUrl = env === 'development'
8
//     ? 'http://192.168.3.233:81'
9
//     : env === 'production'
10
//         ? 'https://www.url.com'
11
//         : 'https://debug.url.com';
12
13
let axiosUtil = axios.create({
14
    // baseURL: ajaxUrl,
15
    timeout: 30000
16
});
17
18
axiosUtil.interceptors.request.use(function (config) {
19
    // 配置config
20
    config.headers.Accept = 'application/json';
21
    if (config.method === 'post') {
22
        // if (config.url !== http.sample.list && config.url !== http.manage.kit.save) {
23
            config.data = qs.stringify(config.data);
24
            // 处理后后台无需添加RequestBody
25
            config.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
26
        // };
27
    };
28
    return config;
29
});
30
31
axiosUtil.interceptors.response.use(function (response) {
32
    let data = response.data;
33
    let status = response.status;
34
    if (status === 200) {
35
        if (response.data === undefined) {
36
            // 解决IE9数据问题
37
            data = response.request.responseText;
38
        } else {
39
            data = response.data;
40
        }
41
        if (!(data instanceof Object)) {
42
            // 判断data不是Object时,解析成Object
43
            data = JSON.parse(data);
44
        }
45
        return data;
46
    } else {
47
        // 业务异常
48
        console.log(response);
49
        return Promise.resolve(response);
50
    }
51
}, function (error) {
52
    // 系统异常(后期统一处理)
53
    console.log(error);
54
    return Promise.reject(error);
55
});
56
57
export default {
58
  install () {
59
    Vue.prototype.$axios = axiosUtil;
60
    Vue.axios = axiosUtil;
61
  }
62
};

+ 64 - 0
src/libs/http.js

@ -0,0 +1,64 @@
1
2
let http = { };
3
4
const utilUrl = 'http://localhost:7070/ajax';
5
6
http.utilUrl = utilUrl;
7
8
let webbase = '/api/plat';
9
http.webbase = webbase;
10
11
let workbench = {
12
    login: utilUrl + '/platform/login',
13
    platBase: utilUrl + '/platform/info',
14
    updateInfo: utilUrl + '/platform/info',
15
    uploadImg: utilUrl + '/platform/upload'
16
};
17
http.workbench = workbench;
18
19
let homequery = {
20
    residentOrgs: utilUrl + '/platform/info/residentOrgs'
21
};
22
http.homequery = homequery;
23
24
// let manage = {
25
//     user: {
26
//         list: utilUrl + '/user/list.do',
27
//         getById: utilUrl + '/user/getById.do',
28
//         save: utilUrl + '/user/save.do',
29
//         delete: utilUrl + '/user/delete.do',
30
//         validate: utilUrl + '/user/validate.do',
31
//         setPWD: utilUrl + '/user/setPWD.do'
32
//     },
33
//     reagent: {
34
//         list: utilUrl + '/reagent/list.do',
35
//         getById: utilUrl + '/reagent/getById.do',
36
//         save: utilUrl + '/reagent/save.do',
37
//         delete: utilUrl + '/reagent/delete.do'
38
//     },
39
//     kit: {
40
//         list: utilUrl + '/kit/list.do',
41
//         getById: utilUrl + '/kit/getById.do',
42
//         save: utilUrl + '/kit/save.do',
43
//         delete: utilUrl + '/kit/delete.do'
44
//     }
45
// };
46
47
// http.manage = manage;
48
49
// let sample = {
50
//     list: utilUrl + '/sample/list.do',
51
//     getById: utilUrl + '/sample/getById.do',
52
//     save: utilUrl + '/sample/save.do',
53
//     delete: utilUrl + '/sample/delete.do'
54
// };
55
56
// http.sample = sample;
57
58
let status = {
59
    sucess: '000000'
60
};
61
62
http.status = status;
63
64
export default http;

+ 62 - 0
src/libs/util.js

@ -0,0 +1,62 @@
1
// let ekexiuUrl = 'https://www.ekexiu.com';
2
let ekexiuUrl = 'http://192.168.3.233:81';
3
4
let util = {
5
6
};
7
8
util.ekexiuUrl = ekexiuUrl;
9
/**
10
 * 解析url参数
11
 * @example ?id=12345&a=b
12
 * @return Object {id:12345,a:b}
13
 */
14
util.urlParse = function (name) {
15
  let obj = {};
16
  let reg = /[?&][^?&]+=[^?&]+/g;
17
  let arr = name.match(reg);
18
  // ['?id=12345', '&a=b']
19
  if (arr) {
20
    arr.forEach((item) => {
21
      let tempArr = item.substring(1).split('=');
22
      let key = decodeURIComponent(tempArr[0]);
23
      let val = decodeURIComponent(tempArr[1]);
24
      obj[key] = val;
25
    });
26
  }
27
  return obj;
28
};
29
30
/**
31
 * 拼接图片链接地址
32
 */
33
util.orgLogoUrl = function (str) {
34
    return ekexiuUrl + '/data/' + str;
35
};
36
37
// util.cutOutUrl = function (str) {
38
//     var index = str.lastIndexOf(/\//);
39
//     str = str.substring(index + 1, str.length);
40
//     return str;
41
// };
42
43
/**
44
 * String与Array之间的转换
45
 */
46
// util.strToArr = function (str) {
47
//     if (str) {
48
//         var subs = new Array();
49
//         if (subs.indexOf(',')) {
50
//             subs = str.split(',');
51
//         } else {
52
//             subs[0] = str;
53
//         }
54
//         return subs;
55
//     }
56
// };
57
// util.arrToStr = function (arr) {
58
//     var newStr = arr.join(',');
59
//     return newStr;
60
// };
61
62
export default util;

+ 3 - 4
src/main.js

@ -3,15 +3,14 @@ import ElementUI from 'element-ui';
3 3
import 'element-ui/lib/theme-chalk/index.css';
4 4
import App from './App.vue';
5 5
import {router} from './router/index';
6
import axios from 'axios';
6
import axiosH from './libs/axios';
7 7
8 8
import Loading from './components/global-component/loading';
9
import BackTop from './components/global-component/backtop';
9
// import BackTop from './components/global-component/backtop';
10 10
11
Vue.prototype.$axios = axios;
11
Vue.use(axiosH);
12 12
Vue.use(ElementUI);
13 13
Vue.use(Loading);
14
Vue.use(BackTop);
15 14
16 15
/* eslint-disable no-new */
17 16
new Vue({

二進制
static/comimg/porfile_icon_qiye_hig.png


二進制
static/comimg/porfile_icon_shimin_nor.png


二進制
static/comimg/porfile_icon_yuangong_hig.png


二進制
static/comimg/porfile_icon_zhuanjia_nor.png