"> Issues 0 Pull Requests 0 Commits 89 Releases 0 Wiki
Browse Source

完善功能,路由跳转等

luyanan 6 years ago
parent
commit
8b266f48cc
90 changed files with 2311 additions and 1164 deletions
  1. 2 6
      build/webpack.base.conf.js
  2. 0 3
      package.json
  3. 0 0
      src/assets/head-icon/porfile_icon_qiye_hig.png
  4. 0 0
      src/assets/head-icon/porfile_icon_shimin_nor.png
  5. 0 0
      src/assets/head-icon/porfile_icon_yuangong_hig.png
  6. 0 0
      src/assets/head-icon/porfile_icon_zhuanjia_nor.png
  7. 8 8
      src/components/BeyondTo/index.vue
  8. 145 0
      src/components/CityPicker/index.vue
  9. 91 10
      src/components/CollectCo/index.vue
  10. 1 2
      src/components/DynamicTags/index.vue
  11. 10 8
      src/components/global-component/citypick/CityPick.vue
  12. 4 4
      src/components/global-component/default/default.vue
  13. 0 0
      src/components/global-component/default/img/points_icon_ku_nor.png
  14. 4 4
      src/components/subTemplate/BaseContent.vue
  15. 3 3
      src/components/subTemplate/BaseExpert.vue
  16. 3 3
      src/components/subTemplate/BaseOrg.vue
  17. 7 3
      src/components/subTemplate/BaseProduct.vue
  18. 20 9
      src/components/subTemplate/BaseResource.vue
  19. 3 3
      src/components/subTemplate/BaseResult.vue
  20. 22 8
      src/components/subTemplate/BaseService.vue
  21. 4 6
      src/components/uploadFile/index.vue
  22. 2 2
      src/layout/TheFooter.vue
  23. 38 19
      src/layout/TheHeader.vue
  24. 21 22
      src/libs/axios.js
  25. 25 23
      src/libs/axiosk.js
  26. 0 107
      src/libs/http.js
  27. 18 0
      src/libs/loginStatus.js
  28. 11 0
      src/libs/request.js
  29. 23 205
      src/libs/util.js
  30. 0 1
      src/pages/center/center.html
  31. 0 16
      src/pages/center/center.js
  32. 15 2
      src/pages/center/center.vue
  33. 56 30
      src/pages/center/permission.js
  34. 54 50
      src/pages/center/router/index.js
  35. 174 8
      src/pages/center/views/attentionCollect.vue
  36. 77 0
      src/pages/center/views/common/Sidebar/SidebarItem.vue
  37. 39 0
      src/pages/center/views/common/Sidebar/index.vue
  38. 42 56
      src/pages/center/views/common/index.vue
  39. 1 1
      src/pages/center/views/layout/index.vue
  40. 13 8
      src/pages/center/views/modifyData.vue
  41. 2 2
      src/pages/center/views/modifyPassword.vue
  42. 393 1
      src/pages/center/views/myBusiness/companyInformation.vue
  43. 155 1
      src/pages/center/views/myBusiness/companyProduct.vue
  44. 245 1
      src/pages/center/views/myBusiness/publishProduct.vue
  45. 23 0
      src/pages/center/views/myBusiness/sty.scss
  46. 3 0
      src/pages/company/company.vue
  47. 35 20
      src/pages/company/show.vue
  48. 3 0
      src/pages/content/content.vue
  49. 23 17
      src/pages/content/show.vue
  50. 3 0
      src/pages/expert/expert.vue
  51. 67 31
      src/pages/expert/show.vue
  52. 0 14
      src/pages/index/index.js
  53. 1 24
      src/pages/index/index.vue
  54. 28 34
      src/pages/index/views/Dashboard/index.vue
  55. 2 2
      src/pages/index/views/ViewAboutUs.vue
  56. 6 6
      src/pages/index/views/ViewExpertPool/expItem.vue
  57. 38 0
      src/pages/index/views/ViewFindResource/css.scss
  58. 27 64
      src/pages/index/views/ViewFindResource/index.vue
  59. 14 47
      src/pages/index/views/ViewFindResult/index.vue
  60. 27 64
      src/pages/index/views/ViewFindServe/index.vue
  61. 3 3
      src/pages/index/views/ViewOrganization/orgItem.vue
  62. 4 4
      src/pages/index/views/ViewPlatTrend/index.vue
  63. 7 7
      src/pages/index/views/ViewPlatTrend/news.vue
  64. 3 3
      src/pages/index/views/ViewRegCompany/index.vue
  65. 2 0
      src/pages/index/views/logforms/loginPlat.vue
  66. 3 0
      src/pages/org/org.vue
  67. 70 35
      src/pages/org/show.vue
  68. 3 0
      src/pages/product/product.vue
  69. 9 9
      src/pages/product/show.vue
  70. 3 0
      src/pages/resource/resource.vue
  71. 12 12
      src/pages/resource/show.vue
  72. 3 0
      src/pages/result/result.vue
  73. 87 24
      src/pages/result/show.vue
  74. 3 0
      src/pages/serve/serve.vue
  75. 36 35
      src/pages/serve/show.vue
  76. 0 62
      src/store/modules/permission.js
  77. 10 2
      src/store/modules/user.js
  78. 1 1
      src/styles/base.scss
  79. 5 2
      src/styles/browse.scss
  80. 16 7
      src/styles/common.scss
  81. BIN
      static/comimg/g_article_icon_caogao_hig.png
  82. BIN
      static/comimg/g_article_icon_caogao_nor.png
  83. BIN
      static/comimg/g_article_icon_dingshi_hig.png
  84. BIN
      static/comimg/g_article_icon_dingshi_nor.png
  85. BIN
      static/comimg/g_article_icon_fabu_hig.png
  86. BIN
      static/comimg/g_article_icon_fabu_nor.png
  87. BIN
      static/comimg/g_article_icon_shanchu_hig.png
  88. BIN
      static/comimg/g_article_icon_shanchu_nor.png
  89. BIN
      static/comimg/g_article_icon_yulan_hig.png
  90. BIN
      static/comimg/g_article_icon_yulan_nor.png

+ 2 - 6
build/webpack.base.conf.js

@ -33,10 +33,11 @@ module.exports = {
33 33
      : config.dev.assetsPublicPath
34 34
  },
35 35
  resolve: {
36
    extensions: ['.js', '.vue', '.json', 'UE'],
36
    extensions: ['.js', '.vue', '.json'],
37 37
    alias: {
38 38
      'vue$': 'vue/dist/vue.esm.js',
39 39
      '@': resolve('src'),
40
      // '&': resolve('static')
40 41
    }
41 42
  },
42 43
  module: {
@ -52,11 +53,6 @@ module.exports = {
52 53
        loader: 'babel-loader',
53 54
        include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
54 55
      },
55
      {
56
        test: /\.css$/,
57
        loader: 'style-loader!css-loader',
58
        exclude: /node_modules/
59
      },
60 56
      {
61 57
        test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
62 58
        loader: 'url-loader',

+ 0 - 3
package.json

@ -15,12 +15,9 @@
15 15
    "element-ui": "^2.3.8",
16 16
    "js-cookie": "^2.2.0",
17 17
    "qrcodejs2": "0.0.2",
18
    "style-loader": "^0.20.3",
19
    "stylus": "^0.54.5",
20 18
    "swiper": "^4.2.6",
21 19
    "vue": "^2.5.2",
22 20
    "vue-router": "^3.0.1",
23
    "vuedraggable": "^2.16.0",
24 21
    "vuex": "^3.0.1"
25 22
  },
26 23
  "devDependencies": {

static/comimg/porfile_icon_qiye_hig.png → src/assets/head-icon/porfile_icon_qiye_hig.png


static/comimg/porfile_icon_shimin_nor.png → src/assets/head-icon/porfile_icon_shimin_nor.png


static/comimg/porfile_icon_yuangong_hig.png → src/assets/head-icon/porfile_icon_yuangong_hig.png


static/comimg/porfile_icon_zhuanjia_nor.png → src/assets/head-icon/porfile_icon_zhuanjia_nor.png


+ 8 - 8
src/components/BeyondTo/index.vue

@ -24,7 +24,7 @@
24 24
  </div>
25 25
</template>
26 26
<script>
27
  import util from '@/libs/util';
27
  import { ImageUrl, defaultSet, autho } from '@/libs/util';
28 28
  import queryBase from '@/libs/queryBase';
29 29
30 30
  export default {
@ -58,9 +58,9 @@
58 58
            that.ownerInfo.name = value.name
59 59
            that.ownerInfo.title = value.title
60 60
            if (that.ownerInfo.hasHeadImage) {
61
              that.ownerInfo.img = util.ImageUrl(('head/' + value.id + '_l.jpg'), true)
61
              that.ownerInfo.img = ImageUrl(('head/' + value.id + '_l.jpg'), true)
62 62
            } else {
63
              that.ownerInfo.img = util.defaultSet.img.expert
63
              that.ownerInfo.img = defaultSet.img.expert
64 64
            }
65 65
          }
66 66
        })
@ -72,9 +72,9 @@
72 72
            that.ownerInfo.name = value.name
73 73
            that.ownerInfo.insdutry = value.insdutry.replace(/,/, ' | ')
74 74
            if (that.ownerInfo.hasOrgLogo) {
75
              that.ownerInfo.img = util.ImageUrl(('org/' + value.id + '.jpg'), true)
75
              that.ownerInfo.img = ImageUrl(('org/' + value.id + '.jpg'), true)
76 76
            } else {
77
              that.ownerInfo.img = util.defaultSet.img.org
77
              that.ownerInfo.img = defaultSet.img.org
78 78
            }
79 79
          }
80 80
        })
@ -87,7 +87,7 @@
87 87
        //   if (res.success) {
88 88
        //     const obj = res.data
89 89
        //     if (obj.logo === '') {
90
        //       obj.logo = util.defaultSet.img.org
90
        //       obj.logo = defaultSet.img.org
91 91
        //     }
92 92
        //     this.ownerInfo = obj
93 93
        //   };
@ -97,7 +97,7 @@
97 97
          if (sc) {
98 98
            that.ownerInfo.name = value.name
99 99
            if (!value.logo) {
100
              that.ownerInfo.logo = util.defaultSet.img.org
100
              that.ownerInfo.logo = defaultSet.img.org
101 101
            } else {
102 102
              that.ownerInfo.logo = value.logo
103 103
            }
@ -105,7 +105,7 @@
105 105
        })
106 106
      },
107 107
      headIcon(item) {
108
        return util.autho(item.authType, item.orgAuth, item.authStatus);
108
        return autho(item.authType, item.orgAuth, item.authStatus);
109 109
      }
110 110
    }
111 111
  };

+ 145 - 0
src/components/CityPicker/index.vue

@ -0,0 +1,145 @@
1
<template>
2
  <div class="linkage">
3
    <el-row>
4
      <el-col :span="12">
5
        <el-select
6
          v-model="sheng"
7
          @change="choseProvince"
8
          placeholder="省/直辖市">
9
          <el-option
10
            v-for="item in provinceArr"
11
            :key="item.id"
12
            :label="item.value"
13
            :value="item.id">
14
          </el-option>
15
        </el-select>
16
      </el-col>
17
      <el-col :span="12">
18
        <el-select
19
          v-model="shi"
20
          @change="choseCity"
21
          placeholder="所在城市">
22
          <el-option
23
            v-for="item in cityArr"
24
            :key="item.id"
25
            :label="item.value"
26
            :value="item.id">
27
          </el-option>
28
        </el-select>
29
      </el-col>
30
      <!-- <el-col :span="8">
31
        <el-select
32
          v-model="qu"
33
          @change="choseBlock"
34
          placeholder="区(县)">
35
          <el-option
36
            v-for="item in areaArr"
37
            :key="item.id"
38
            :label="item.value"
39
            :value="item.id">
40
          </el-option>
41
        </el-select>
42
      </el-col> -->
43
    </el-row>
44
  </div>
45
</template>
46
<script>
47
import queryDict from '@/libs/queryDict'
48
export default {
49
  props: ['addrCode'],
50
  data() {
51
    return {
52
      firstFlag: false,
53
      provinceArr: [],
54
      cityArr: [],
55
      sheng: '',
56
      shi: '',
57
      // qu: '',
58
      // areaArr: [],
59
      city: '',
60
      block: ''
61
    }
62
  },
63
  watch: {
64
    addrCode: function() {
65
      var that = this
66
      setTimeout(function() {
67
        that.initpsq()
68
      }, 100)
69
    }
70
  },
71
  created() {
72
    this.getCityData()
73
  },
74
  methods: {
75
    getCityData: function() {
76
      var that = this
77
      queryDict.applyDict('XZQH', function(dictData) {
78
        if (dictData && dictData.length > 0) {
79
          var data = dictData.sort((obj1, obj2) => {
80
            return obj1.code - obj2.code
81
          })
82
          that.provinceArr = {}
83
          data.map(item => {
84
            if (item.code.match(/0000$/)) {
85
              that.provinceArr[item.code] = { id: item.code, value: item.caption, children: {} }
86
            } else if (item.code.match(/00$/)) {
87
              var p = that.provinceArr[item.code.slice(0, 2) + '0000']
88
              p.children[item.code] = { id: item.code, value: item.caption, children: {} }
89
              if (!p.defaultChild) {
90
                p.defaultChild = p.children[item.code]
91
              }
92
            } else {
93
              var pp = that.provinceArr[item.code.slice(0, 2) + '0000'].children[item.code.slice(0, 4) + '00']
94
              pp.children[item.code] = { id: item.code, value: item.caption }
95
              if (!pp.defaultChild) {
96
                pp.defaultChild = pp.children[item.code]
97
              }
98
            }
99
          })
100
        } else {
101
          console.log(dictData.status)
102
        }
103
      })
104
    },
105
    choseProvince: function(e) {
106
      var p = this.provinceArr[e]
107
      this.cityArr = p.children
108
      this.shi = p.defaultChild.value
109
      // this.areaArr = p.defaultChild.children
110
      // this.qu = p.defaultChild.defaultChild.value
111
      this.E = p.defaultChild.defaultChild.id
112
      this.sheng = p.value
113
      this.$emit('paren', this.E)
114
    },
115
    choseCity: function(e) {
116
      var p = this.provinceArr[e.slice(0, 2) + '0000'].children[e]
117
      this.shi = p.value
118
      // this.areaArr = p.children
119
      // this.qu = p.defaultChild.value
120
      this.E = p.defaultChild.id
121
      this.$emit('paren', this.E)
122
    },
123
    // choseBlock: function(e) {
124
    //   this.qu = this.provinceArr[e.slice(0, 2) + '0000'].children[e.slice(0, 4) + '00'].children[e].value
125
    //   this.E = e
126
    //   this.$emit('paren', this.E)
127
    // },
128
    initpsq: function() {
129
      if (!this.addrCode) {
130
        this.sheng = ''
131
        this.shi = ''
132
        // this.qu = ''
133
        return
134
      }
135
      const s = this.addrCode.substring(0, 2) + '0000'
136
      const si = this.addrCode.substring(0, 4) + '00'
137
      // const x = this.addrCode
138
      var p = this.provinceArr[s]
139
      this.sheng = p.value
140
      this.shi = p.children[si].value
141
      // this.qu = p.children[si].children[x].value
142
    }
143
  }
144
}
145
</script>

+ 91 - 10
src/components/CollectCo/index.vue

@ -1,21 +1,101 @@
1 1
<template>
2 2
  <div class="collect-block">
3
    <span>收藏</span>
4
    <em style="cursor: pointer;" class="icon-font" :class="ifCollect ? 'icon-yishoucang' : 'icon-shoucang'" @click="collectFun"></em>
3
    <div v-if="collectShow">
4
      <span>收藏</span>
5
      <em v-if="!ifCollect" class="icon-font icon-shoucang" @click="collectionAbout"></em>
6
      <em v-if="ifCollect" class="icon-font icon-yishoucang" @click="cancelCollectionAbout"></em>
7
    </div>
8
    <div v-if="!collectShow">
9
      <el-button v-if="!ifCollect" type="primary" icon="el-icon-plus" @click="collectionAbout">关注</el-button>
10
      <el-button v-if="ifCollect" type="info" @click="cancelCollectionAbout">已关注</el-button>
11
    </div>
5 12
  </div>
6 13
</template>
7 14
<script>
15
  import { loginStatus } from '@/libs/loginStatus';
8 16
  export default {
9
    props: {
10
      ifCollect: {
11
        type: Boolean
17
    props: ['watchOptions'],
18
    data() {
19
      return {
20
        ifCollect: false
12 21
      }
13 22
    },
14
    mounted() {
23
    watch: {
24
      ifCollect(value) {
25
        this.ifCollect = value
26
      }
27
    },
28
    computed: {
29
      collectShow() {
30
        const type = this.watchOptions.type
31
        return !(type === 1 || type === 2)
32
      },
33
      collectText(value) {
34
        const type = this.watchOptions.type
35
        return (type === 1 || type === 2) ? '关注' : '收藏'
36
      }
37
    },
38
    created() {
39
      this.ifcollectionAbout()
15 40
    },
16 41
    methods: {
17
      collectFun() {
18
        this.ifCollect = !this.ifCollect;
42
      /* 判断是否收藏/关注 */
43
      ifcollectionAbout() {
44
        var that = this;
45
        loginStatus(function() {
46
          that.$axios.get('/ajax/collection/check', {
47
            oid: that.watchOptions.oid,
48
            type: that.watchOptions.type
49
          }, function(res) {
50
            if (res.success) {
51
              if (res.data) {
52
                that.ifCollect = true
53
              } else {
54
                that.ifCollect = false
55
              }
56
            }
57
          })
58
        })
59
      },
60
      /* 收藏/关注 */
61
      collectionAbout() {
62
        var that = this;
63
        loginStatus(function() {
64
          that.$axios.post('/ajax/collection/insert', {
65
            oid: that.watchOptions.oid,
66
            type: that.watchOptions.type
67
          }, function(res) {
68
            if (res.success) {
69
              if (res.data) {
70
                that.ifCollect = true
71
                that.$message({
72
                  message: `${that.collectText}成功`,
73
                  type: 'success'
74
                })
75
              }
76
            }
77
          })
78
        })
79
      },
80
      /* 取消收藏/关注 */
81
      cancelCollectionAbout() {
82
        var that = this;
83
        loginStatus(function() {
84
          that.$axios.post('/ajax/collection/delete', {
85
            oid: that.watchOptions.oid,
86
            type: that.watchOptions.type
87
          }, function(res) {
88
            if (res.success) {
89
              if (res.data) {
90
                that.ifCollect = false
91
                that.$message({
92
                  message: `已取消${that.collectText}`,
93
                  type: 'success'
94
                })
95
              }
96
            }
97
          })
98
        })
19 99
      }
20 100
    }
21 101
  };
@ -31,11 +111,12 @@
31 111
    height:16px;
32 112
    margin-left:6px;
33 113
    background-size: cover;
114
    cursor: pointer;
34 115
    &.icon-shoucang{
35
      @include bg-image('/static/comimg/g_all_icon_shoucang_nor.png');
116
      @include bg-image('./img/icon_shoucang_nor.png');
36 117
    }
37 118
    &.icon-yishoucang{
38
      @include bg-image('/static/comimg/g_all_icon_shoucang_hig.png');
119
      @include bg-image('./img/icon_shoucang_hig.png');
39 120
    }
40 121
  }
41 122
}

+ 1 - 2
src/components/DynamicTags/index.vue

@ -55,8 +55,7 @@
55 55
 *  tagsNum: 3 //最多可以传输数量
56 56
 * }
57 57
*/
58
// import httpUrl from '@/libs/http'
59
import { trimStr } from '@/utils'
58
import { trimStr } from '@/libs/util'
60 59
export default {
61 60
  props: ['dyStr', 'tagInfo'],
62 61
  data() {

+ 10 - 8
src/components/global-component/citypick/CityPick.vue

@ -104,12 +104,14 @@
104 104
  };
105 105
</script>
106 106
107
<style lang="stylus" type="text/stylus">
108
  .cityParent
109
    position:relative
110
    z-index:2
111
    .cityChild
112
      position:absolute
113
      bottom:0
114
      z-index:1
107
<style lang="scss" scoped>
108
  .cityParent{
109
    position:relative;
110
    z-index:2;
111
    .cityChild{
112
      position:absolute;
113
      bottom:0;
114
      z-index:1;
115
    }
116
  }
115 117
</style>

+ 4 - 4
src/components/global-component/default/default.vue

@ -3,7 +3,7 @@
3 3
    <div class="notice_d" v-show="noResult">
4 4
        <img v-bind:src="infoImage" class="d_photo" />
5 5
        <div class="d_prompt">
6
            <p class="d_1">{{message}}</p>
6
            <!-- <p class="d_1">{{message}}</p> -->
7 7
            <p class="d_2">{{message2}}</p>
8 8
        </div>
9 9
    </div>
@ -11,7 +11,7 @@
11 11
</template>
12 12
13 13
<script>
14
14
import Img from './img/points_icon_ku_nor.png'
15 15
export default {
16 16
  props: {
17 17
    show: {
@ -23,11 +23,11 @@ export default {
23 23
      default: true
24 24
    },
25 25
    infoImage: {
26
      default: require('../../../../static/comimg/points_icon_ku_nor.png')
26
      default: Img
27 27
    },
28 28
    message: {
29 29
      type: String,
30
      default: '没有搜索结果╭(╯^╰)╮'
30
      default: '没有相关内容'
31 31
    },
32 32
    message2: {
33 33
      type: String,

static/comimg/points_icon_ku_nor.png → src/components/global-component/default/img/points_icon_ku_nor.png


+ 4 - 4
src/components/subTemplate/BaseContent.vue

@ -1,5 +1,5 @@
1 1
<template>
2
  <router-link class="list-item" :class="isShowImg(itemSingle.catalog)" :to="{name:'con_show',query:{id:itemSingle.id}}" target="_blank">
2
  <a class="list-item" :class="isShowImg(itemSingle.catalog)" :href="'content.html?id='+itemSingle.id" target="_blank">
3 3
    <div class="list-head" :style="{backgroundImage: 'url(' + imgUrl + ')'}"></div>
4 4
    <div class="list-info">
5 5
      <div class="list-tit">{{itemSingle.title}}</div>
@ -7,11 +7,11 @@
7 7
        <li>{{itemSingle.modifyTime}}</li>
8 8
      </ul>
9 9
    </div>
10
  </router-link>
10
  </a>
11 11
</template>
12 12
13 13
<script>
14
  import util from '@/libs/util';
14
  import { defaultSet } from '@/libs/util';
15 15
  export default {
16 16
    props: {
17 17
      itemSingle: {
@ -20,7 +20,7 @@
20 20
    },
21 21
    data() {
22 22
      return {
23
        imgUrl: this.itemSingle.imgUrl || util.defaultSet.img.article
23
        imgUrl: this.itemSingle.imgUrl || defaultSet.img.article
24 24
      };
25 25
    },
26 26
    methods: {

+ 3 - 3
src/components/subTemplate/BaseExpert.vue

@ -9,7 +9,7 @@
9 9
</template>
10 10
11 11
<script>
12
  import util from '@/libs/util';
12
  import { ImageUrl, defaultSet } from '@/libs/util';
13 13
14 14
  export default {
15 15
    props: {
@ -23,9 +23,9 @@
23 23
    computed: {
24 24
      imgUrl() {
25 25
        if (this.itemSingle.hasHeadImage) {
26
          return util.ImageUrl(('head/' + this.itemSingle.id + '_l.jpg'), true)
26
          return ImageUrl(('head/' + this.itemSingle.id + '_l.jpg'), true)
27 27
        } else {
28
          return util.defaultSet.img.expert
28
          return defaultSet.img.expert
29 29
        }
30 30
      }
31 31
    },

+ 3 - 3
src/components/subTemplate/BaseOrg.vue

@ -1,13 +1,13 @@
1 1
<template>
2
  <a class="list-item" :href="'company.html?id='+itemSingle.id" target="_blank">
2
  <a class="list-item" :href="'org.html?id='+itemSingle.orgId" target="_blank">
3 3
    <div class="list-head">
4 4
      <div class="item-pic-org">
5
        <img :src="item.logo">
5
        <img :src="itemSingle.logo">
6 6
      </div>
7 7
    </div>
8 8
    <div class="list-info">
9 9
      <div class="list-tit list-topic">{{itemSingle.name}}</div>
10
      <div class="list-desc" v-if="item.industry">{{item.industry.join(' | ')}}</div>
10
      <div class="list-desc" v-if="itemSingle.industry">{{itemSingle.industry.join(' | ')}}</div>
11 11
    </div>
12 12
  </a>
13 13
</template>

+ 7 - 3
src/components/subTemplate/BaseProduct.vue

@ -3,23 +3,27 @@
3 3
    <div class="list-head" :style="{backgroundImage: 'url(' + imgUrl + ')'}"></div>
4 4
    <div class="list-info">
5 5
      <div class="list-tit list-topic">{{itemSingle.name}}</div>
6
      <div class="list-desc" v-if="itemSingle.cnt">简介:{{itemSingle.cnt}}</div>
6
      <div class="list-tag" v-if="showTime">{{itemSingle.createTime}}</div>
7
      <div class="list-desc" v-if="itemSingle.cnt && !showTime">简介:{{itemSingle.cnt}}</div>
7 8
    </div>
8 9
  </a>
9 10
</template>
10 11
11 12
<script>
12
  import util from '@/libs/util';
13
  import { defaultSet, strToArr } from '@/libs/util';
13 14
14 15
  export default {
15 16
    props: {
16 17
      itemSingle: {
17 18
        type: Object
19
      },
20
      showTime: {
21
        type: Boolean
18 22
      }
19 23
    },
20 24
    data() {
21 25
      return {
22
        imgUrl: this.itemSingle.img ? util.strToArr(this.itemSingle.img)[0] : util.defaultSet.img.product
26
        imgUrl: this.itemSingle.img ? strToArr(this.itemSingle.img)[0] : defaultSet.img.product
23 27
      };
24 28
    },
25 29
    created() {

+ 20 - 9
src/components/subTemplate/BaseResource.vue

@ -10,7 +10,7 @@
10 10
</template>
11 11
12 12
<script>
13
  import util from '@/libs/util';
13
  import { ImageUrl, defaultSet, autho, strToArr } from '@/libs/util';
14 14
  import queryBase from '@/libs/queryBase';
15 15
16 16
  export default {
@ -28,18 +28,29 @@
28 28
    computed: {
29 29
      resourceInfo() {
30 30
        var obj = this.itemSingle
31
        if (obj && obj.images && obj.images.length) {
32
          obj.img = util.ImageUrl('resource/' + obj.images[0].imageSrc)
33
        } else {
34
          obj.img = util.defaultSet.img.resource
31
        if (obj.resourceId) {
32
          obj.id = obj.resourceId
35 33
        }
36
        if (obj.resourceType) {
37
          obj.otype = obj.resourceType
38
          obj.oid = obj.professorId || obj.orgId
34
        if (obj.resourceName) {
35
          obj.name = obj.resourceName
36
        }
37
        if (obj && obj.images) {
38
          obj.img = defaultSet.img.resource
39
          if (obj.images instanceof Array) {
40
            if (obj.images.length > 0) {
41
              obj.img = ImageUrl('resource/' + obj.images[0].imageSrc)
42
            }
43
          } else {
44
            obj.img = ImageUrl('resource/' + strToArr(obj.images))
45
          }
39 46
        }
40 47
        if (obj.supportedServices) {
41 48
          obj.cnt = obj.supportedServices
42 49
        }
50
        if (obj.resourceType) {
51
          obj.otype = obj.resourceType
52
          obj.oid = obj.professorId || obj.orgId
53
        }
43 54
        return obj
44 55
      }
45 56
    },
@ -53,7 +64,7 @@
53 64
          queryBase.getProfessor(item.oid, function(sc, value) {
54 65
            if (sc) {
55 66
              _this.ownerName = value.name;
56
              _this.ownerAuth = util.autho(value.authType, value.orgAuth, value.authStatus);
67
              _this.ownerAuth = autho(value.authType, value.orgAuth, value.authStatus);
57 68
              _this.$forceUpdate();
58 69
            }
59 70
          });

+ 3 - 3
src/components/subTemplate/BaseResult.vue

@ -3,14 +3,14 @@
3 3
    <div class="list-head" :style="{backgroundImage: 'url(' + imgUrl + ')'}"></div>
4 4
    <div class="list-info">
5 5
      <div class="list-tit list-topic">{{itemSingle.name}}</div>
6
      <div class="list-owner">发明人:{{itemSingle.authors.substring(0, itemSingle.authors.length - 1)}}</div>
6
      <div class="list-owner" v-if="itemSingle.authors">发明人:{{itemSingle.authors.substring(0, itemSingle.authors.length - 1)}}</div>
7 7
      <div class="list-desc">申请人:{{itemSingle.reqPerson}}</div>
8 8
    </div>
9 9
  </a>
10 10
</template>
11 11
12 12
<script>
13
  import util from '@/libs/util';
13
  import { defaultSet } from '@/libs/util';
14 14
15 15
  export default {
16 16
    props: {
@ -20,7 +20,7 @@
20 20
    },
21 21
    data() {
22 22
      return {
23
        imgUrl: util.defaultSet.img.patent
23
        imgUrl: defaultSet.img.patent
24 24
      };
25 25
    },
26 26
    created() {

+ 22 - 8
src/components/subTemplate/BaseService.vue

@ -1,16 +1,16 @@
1 1
<template>
2
  <a class="list-item" :href="'serve.html?id='+itemSingle.id" target="_blank">
3
    <div class="list-head" :style="{backgroundImage: 'url(' + veInfo.imgUrl + ')'}"></div>
2
  <a class="list-item" :href="'serve.html?id='+serveInfo.id" target="_blank">
3
    <div class="list-head" :style="{backgroundImage: 'url(' + serveInfo.veInfo.img + ')'}"></div>
4 4
    <div class="list-info">
5
      <div class="list-tit list-topic">{{itemSingle.name}}</div>
5
      <div class="list-tit list-topic">{{serveInfo.name}}</div>
6 6
      <div class="list-owner">{{ownerName}}<em class="authicon" :class="ownerAuth"></em></div>
7
      <div class="list-desc" v-if="itemSingle.cnt">内容:{{itemSingle.cnt}}</div>
7
      <div class="list-desc" v-if="serveInfo.cnt">内容:{{serveInfo.cnt}}</div>
8 8
    </div>
9 9
  </a>
10 10
</template>
11 11
12 12
<script>
13
  import util from '@/libs/util';
13
  import { ImageUrl, defaultSet, autho, strToArr } from '@/libs/util';
14 14
  import queryBase from '@/libs/queryBase';
15 15
16 16
  export default {
@ -21,13 +21,27 @@
21 21
    },
22 22
    data() {
23 23
      return {
24
        imgUrl: (this.itemSingle && this.itemSingle.images) ? util.ImageUrl('ware/' + this.itemSingle.images.split(',')[0]) : util.defaultSet.img.service,
25 24
        ownerName: '',
26 25
        ownerAuth: ''
27 26
      };
28 27
    },
28
    computed: {
29
      serveInfo() {
30
        var obj = this.itemSingle
31
        if (obj && obj.images) {
32
          obj.img = ImageUrl('ware' + strToArr(obj.images)[0])
33
        } else {
34
          obj.img = defaultSet.img.service
35
        }
36
        if (obj.category) {
37
          obj.otype = obj.category
38
          obj.oid = obj.owner
39
        }
40
        return obj
41
      }
42
    },
29 43
    created() {
30
      this.ownerByond(this.itemSingle);
44
      this.ownerByond(this.serveInfo);
31 45
    },
32 46
    methods: {
33 47
      ownerByond(item) {
@ -36,7 +50,7 @@
36 50
          queryBase.getProfessor(item.oid, function(sc, value) {
37 51
            if (sc) {
38 52
              _this.ownerName = value.name;
39
              _this.ownerAuth = util.autho(value.authType, value.orgAuth, value.authStatus);
53
              _this.ownerAuth = autho(value.authType, value.orgAuth, value.authStatus);
40 54
              _this.$forceUpdate();
41 55
            }
42 56
          });

+ 4 - 6
src/components/uploadFile/index.vue

@ -33,25 +33,23 @@
33 33
   *  tip: '上传平台LOGO图片', // 上传图片的提示tip
34 34
   *  width: '280px',
35 35
   *  height: '200px',
36
   *  fun: 'uploadfun',
37 36
   *  limit: 3 //最多可以传输数量
38 37
   * }
39 38
  */
40
  import util from '@/libs/util'
39
  import { strToArr, arrToStr } from '@/libs/util'
41 40
  export default {
42 41
    props: ['upImgsStr', 'uploadImg'],
43 42
    data() {
44 43
      return {
45
        imageUrl: util.strToArr(this.upImgsStr) || []
44
        imageUrl: strToArr(this.upImgsStr) || []
46 45
      }
47 46
    },
48 47
    watch: {
49 48
      upImgsStr(value) {
50
        console.log(value)
51
        this.imageUrl = util.strToArr(value)
49
        this.imageUrl = strToArr(value)
52 50
      },
53 51
      imageUrl(value) {
54
        const list = util.arrToStr(value)
52
        const list = arrToStr(value)
55 53
        this.$emit('uploadfun', list)
56 54
      }
57 55
    },

+ 2 - 2
src/layout/TheFooter.vue

@ -30,12 +30,12 @@
30 30
</template>
31 31
32 32
<script>
33
  import util from '@/libs/util';
33
  import { ekexiuUrl } from '@/libs/util';
34 34
35 35
  export default {
36 36
    data() {
37 37
      return {
38
        kexiuLink: util.ekexiuUrl,
38
        kexiuLink: ekexiuUrl,
39 39
        plat: ''
40 40
      };
41 41
    },

+ 38 - 19
src/layout/TheHeader.vue

@ -13,16 +13,16 @@
13 13
            <!-- <router-link class="marLeft" to='/loginPlat' tag="a">通知(99+)</router-link>
14 14
            <router-link class="marLeft" to='/loginPlat' tag="a">消息(99+)</router-link> -->
15 15
            <el-dropdown>
16
              <span class="el-dropdown-link">
16
              <span class="el-dropdown-link" style="cursor:pointer">
17 17
                {{account}}<i class="el-icon-arrow-down el-icon--right"></i>
18 18
              </span>
19 19
              <el-dropdown-menu slot="dropdown">
20
                <a href="center.html#/modifyData" target="_blank"><el-dropdown-item>修改资料</el-dropdown-item></a>
21
                <a href="center.html#/myDemand"><el-dropdown-item>我的需求</el-dropdown-item></a>
22
                <a href="center.html#/companyInformation"><el-dropdown-item>我的企业</el-dropdown-item></a>
23
                <a href="center.html#/modifyData"><el-dropdown-item>首都创新券</el-dropdown-item></a>
20
                <a href="center.html#/modifyData"><el-dropdown-item>修改资料</el-dropdown-item></a>
21
                <!-- <a href="center.html#/myDemand"><el-dropdown-item>我的需求</el-dropdown-item></a> -->
22
                <a href="center.html#/companyInformation" v-if="bindCompany"><el-dropdown-item>我的企业</el-dropdown-item></a>
23
                <a href="center.html#/attentionCollect"><el-dropdown-item>关注收藏</el-dropdown-item></a>
24 24
                <a href="center.html#/modifyPassword"><el-dropdown-item>账户设置</el-dropdown-item></a>
25
                <el-dropdown-item divided>退出登录</el-dropdown-item>
25
                <div @click="logout"><el-dropdown-item divided>退出登录</el-dropdown-item></div>
26 26
              </el-dropdown-menu>
27 27
            </el-dropdown>
28 28
          </div>
@ -38,7 +38,7 @@
38 38
    <div class="nav-wrapper minw-block">
39 39
      <div class="contain-wrapper">
40 40
        <div class="nav-menu">
41
          <a v-for="item in navArr" :key="item.url" :href="'/#/'+item.url" :class="{'active': currentPath === item.url}">{{item.tit}}</a>
41
          <a v-for="item in navArr" :key="item.url" :href="'/#/'+item.url" :class="activeCl(item.url)">{{item.tit}}</a>
42 42
        </div>
43 43
      </div>
44 44
    </div>
@ -48,7 +48,7 @@
48 48
<script>
49 49
  import { ekexiuUrl } from '@/libs/util';
50 50
  import Cookies from 'js-cookie';
51
  import { mapGetters } from 'vuex'
51
  import { MessageBox } from 'element-ui'
52 52
53 53
  export default {
54 54
    data() {
@ -91,23 +91,42 @@
91 91
            tit: '关于平台'
92 92
          }
93 93
        ],
94
        currentPath: 'home',
94
        account: '',
95
        bindCompany: '',
95 96
        kexiuLink: ekexiuUrl,
96
        plat: '',
97
        plf_user: ''
97
        plat: ''
98 98
      };
99 99
    },
100
    computed: {
101
      ...mapGetters([
102
        'account'
103
      ])
104
    },
105 100
    mounted () {
106 101
      /* eslint-disable no-undef */
107 102
      this.plat = PLAT.info;
108
      document.title = this.plat.title;
109
      Cookies.set('platId', process.env.PLAT_ID);
110
      Cookies.set('platSource', this.plat.source);
103
      this.account = Cookies.get('uaccount');
104
      this.bindCompany = Cookies.get('bcid');
105
    },
106
    methods: {
107
      activeCl(url) {
108
        if (this.$route && this.$route.name) {
109
          return this.$route.name === url ? 'active' : ''
110
        } else {
111
          return sessionStorage.getItem('isSelect') === url ? 'active' : ''
112
        }
113
      },
114
      logout() {
115
        var that = this
116
        MessageBox.confirm('您确认要退出登录吗?', '提示', {
117
          type: 'warning',
118
          center: true
119
        }).then(() => {
120
          that.$axios.get('/ajax/sys/logout', {}, function(res) {
121
            if (res.success) {
122
              Cookies.remove('userid')
123
              Cookies.remove('uaccount');
124
              Cookies.remove('bcid')
125
              location.href = '/#/loginPlat'
126
            }
127
          })
128
        }).catch(() => {})
129
      }
111 130
    }
112 131
  };
113 132
</script>

+ 21 - 22
src/libs/axios.js

@ -1,5 +1,6 @@
1 1
import axios from 'axios';
2 2
import qs from 'qs';
3
import { Message } from 'element-ui';
3 4
4 5
let axiosUtil = axios.create({
5 6
    baseURL: process.env.BASE_API
@ -17,29 +18,27 @@ axiosUtil.interceptors.request.use(function (config) {
17 18
});
18 19
19 20
axiosUtil.interceptors.response.use(function (response) {
20
    let data = response.data;
21
    let status = response.status;
22
    if (status === 200) {
23
        if (response.data === undefined) {
24
            // 解决IE9数据问题
25
            data = response.request.responseText;
26
        } else {
27
            data = response.data;
28
        }
29
        if (!(data instanceof Object)) {
30
            // 判断data不是Object时,解析成Object
31
            data = JSON.parse(data);
32
        }
33
        return data;
21
  let taR = response.data
22
  if (response && response.status === 200) {
23
    if (response.data === undefined) { // 解决IE9数据问题
24
      taR = response.request.responseText
34 25
    } else {
35
        // 业务异常
36
        console.log(response);
37
        return Promise.resolve(response);
26
      taR = response.data
38 27
    }
39
}, function (error) {
40
    // 系统异常(后期统一处理)
41
    console.log(error);
42
    return Promise.reject(error);
43
});
28
    if (!(taR instanceof Object)) { // 判断taR不是Object时,解析成Object
29
      taR = JSON.parse(taR)
30
    }
31
    if (!taR.success && taR.code === 0) {
32
      Message.error(taR.msg || taR.detailMsg)
33
    }
34
    return taR
35
  } else {
36
    Message.error('请求错误1,请重试')
37
    return Promise.resolve(response)
38
  }
39
}, error => {
40
  Message.error('请求错误2,请重试')
41
  return Promise.reject(error)
42
})
44 43
45 44
export default axiosUtil;

+ 25 - 23
src/libs/axiosk.js

@ -1,8 +1,12 @@
1 1
import axios from 'axios';
2 2
import qs from 'qs';
3
import { Message } from 'element-ui';
3 4
4 5
let axiosUtil = axios.create({
5
    baseURL: process.env.KX_API
6
    baseURL: process.env.KX_API,
7
    paramsSerializer: params => {
8
      return qs.stringify(params, { indices: false })
9
    }
6 10
});
7 11
8 12
axiosUtil.interceptors.request.use(function (config) {
@ -17,29 +21,27 @@ axiosUtil.interceptors.request.use(function (config) {
17 21
});
18 22
19 23
axiosUtil.interceptors.response.use(function (response) {
20
    let data = response.data;
21
    let status = response.status;
22
    if (status === 200) {
23
        if (response.data === undefined) {
24
            // 解决IE9数据问题
25
            data = response.request.responseText;
26
        } else {
27
            data = response.data;
28
        }
29
        if (!(data instanceof Object)) {
30
            // 判断data不是Object时,解析成Object
31
            data = JSON.parse(data);
32
        }
33
        return data;
24
    let taR = response.data
25
    if (response && response.status === 200) {
26
      if (response.data === undefined) { // 解决IE9数据问题
27
        taR = response.request.responseText
28
      } else {
29
        taR = response.data
30
      }
31
      if (!(taR instanceof Object)) { // 判断taR不是Object时,解析成Object
32
        taR = JSON.parse(taR)
33
      }
34
      if (!taR.success && taR.code === 0) {
35
        Message.error(taR.msg || taR.detailMsg)
36
      }
37
      return taR
34 38
    } else {
35
        // 业务异常
36
        console.log(response);
37
        return Promise.resolve(response);
39
      Message.error('请求错误1,请重试')
40
      return Promise.resolve(response)
38 41
    }
39
}, function (error) {
40
    // 系统异常(后期统一处理)
41
    console.log(error);
42
    return Promise.reject(error);
43
});
42
}, error => {
43
    Message.error('请求错误2,请重试')
44
    return Promise.reject(error)
45
})
44 46
45 47
export default axiosUtil;

+ 0 - 107
src/libs/http.js

@ -1,107 +0,0 @@
1
2
let http = { };
3
4
const kexiuUrl = process.env.KX_API; // 跳转科袖链接地址、图片访问路径
5
const platUrl = process.env.BASE_API; // api/邮箱配置的地址
6
7
http.platUrl = platUrl;
8
http.kexiuUrl = kexiuUrl;
9
10
http.hQuery = {
11
    sign: {
12
      login: '/ajax/platform/login',
13
      modifypw: '/ajax/platform/modifypw', // 修改密码
14
      resetpw: '/ajax/platform/resetpw', // 重置密码
15
      reqResetPw: '/ajax/platform/reqResetPw', // 请求重置密码
16
      bindMail: '/ajax/platform/bindMail', // 绑定新邮箱
17
      reqBindMail: '/ajax/platform/reqBindMail' // 请求绑定新邮箱
18
    },
19
    baseInfo: {
20
      query: '/ajax/platform/info',
21
      update: '/ajax/platform/info',
22
      upload: '/ajax/platform/upload' // 上传平台图片
23
    },
24
    buttedOrgs: { // 对接平台机构
25
      nopq: '/ajax/platform/info/buttedOrgs',
26
      pq: '/ajax/platform/info/pqButtedOrgs',
27
      add: '/ajax/platform/buttedOrg',
28
      del: '/ajax/platform/buttedOrg/delete'
29
    },
30
    buttedProfessors: { // 对接专家
31
      nopq: '/ajax/platform/info/buttedProfessors',
32
      pq: '/ajax/platform/info/pqButtedProfessors',
33
      add: '/ajax/platform/buttedProfessor',
34
      del: '/ajax/platform/buttedProfessor/delete'
35
    },
36
    platNews: { // 平台新闻
37
      nopq: '/ajax/article/qa',
38
      pq: '/ajax/article/pageQuery'
39
    },
40
    orgTrends: { // 企业动态
41
      nopq: '/ajax/article/publishInPlatform',
42
      pq: '/ajax/article/pgPublishInPlatform',
43
      pqun: '/ajax/article/pgPublishNotInPlatform', // 查询未加入企业动态的入驻企业发布中的文章(分页)
44
      add: '/ajax/platform/referencedArticle',
45
      del: '/ajax/platform/referencedArticle/delete'
46
    },
47
    residentOrgs: { // 入驻企业
48
      nopq: '/ajax/platform/info/residentOrgs',
49
      add: '/ajax/platform/resident',
50
      del: '/ajax/platform/resident/delete'
51
    },
52
    demand: {
53
      nopq: '/ajax/demand/search/platform', // 查询在平台发布的需求
54
      add: '/ajax/demand/publishInPlatform' // 平台新增需求
55
    },
56
    addOrgs: '/ajax/platform/add/info', // 增加企业
57
    queryWare: '/ajax/platform/info/wares', // 找服务
58
    queryResource: '/ajax/platform/info/resources' // 找资源
59
};
60
61
http.kxQurey = {
62
    sign: {
63
      isReg: '/ajax/isReg', // 手机是否注册
64
      msgLogin: '/ajax/mobileLogin', // 手机登录科袖
65
      msgLoginVc: '/ajax/sendMobileForLogin', // 登录科袖所需的短信验证码
66
      msgVC: '/ajax/phoneValidCode', // 发送手机验证码
67
      imgVC: '/ajax/PictureVC' // 图形验证
68
    },
69
    demand: {
70
      add: '/ajax/demand' // 新增需求
71
    },
72
    article: {
73
      save: '/ajax/article/save', // 新增文章
74
      draft: '/ajax/article/draft', // 存草稿/预览
75
      timing: '/ajax/article/timing', // 定时发布文章
76
      del: '/ajax/article/deleteArticle', // 删除文章
77
      query: '/ajax/article/query', // 文章详细内容
78
      pqpublish: '/ajax/article/pqpublish' // 已发布的文章列表
79
    },
80
    resource: {
81
      query: '/ajax/resource/queryOne'
82
    },
83
    server: {
84
      query: '/ajax/ware/qo'
85
    },
86
    patent: {
87
      query: '/ajax/ppatent/qo',
88
      author: '/ajax/ppatent/authors'
89
    },
90
    professor: {
91
      query: '/ajax/professor/baseInfo/', // 专家基础信息
92
      query2: '/ajax/professor/info/'
93
94
    },
95
    org: {
96
      query: '/ajax/org/', // 企业基础信息
97
      reg: '/ajax/org/regInfo' // 机构资质
98
    },
99
    leaveMsg: {
100
      count: '/ajax/leavemsg/count' // 留言数量
101
    },
102
    cachedFile: '/ajax/cachedFileUpload', // 上传缓存地址
103
    qaHotKey: '/ajax/dataDict/qaHotKey', // 检索关键词
104
    editor: '/ajax/editor/controller' // 图文编辑访问的地址
105
};
106
107
export default http;

+ 18 - 0
src/libs/loginStatus.js

@ -0,0 +1,18 @@
1
/**
2
 * Created by luyanan on 18/12/27.
3
 * loginStatus
4
 */
5
/* eslint-disable one-var */
6
import Vue from 'vue'
7
import Cookies from 'js-cookie'
8
9
export function loginStatus(fn) {
10
  if (Cookies.get('userid')) {
11
    fn()
12
  } else {
13
    Vue.$store.dispatch('FedLogOut').then(res => {
14
      Vue.$message.error('登录状态失效,请重新登录');
15
      location.href = '/#/loginPlat';
16
    })
17
  }
18
}

+ 11 - 0
src/libs/request.js

@ -25,6 +25,17 @@ var ret = {
25 25
      if (eh) eh(err);
26 26
    });
27 27
  },
28
  put: function(url, data, sh, eh) {
29
    requestP({
30
      method: 'put',
31
      url: url,
32
      data: data
33
    }).then(res => {
34
      sh(res);
35
    }).catch(err => {
36
      if (eh) eh(err);
37
    });
38
  },
28 39
  getk: function(url, data, sh, eh) {
29 40
    requestK({
30 41
      method: 'get',

+ 23 - 205
src/libs/util.js

@ -1,17 +1,10 @@
1
import httpUrl from './http.js';
2 1
3
let ekexiuUrl = httpUrl.kexiuUrl;
4
5
let util = {
6
7
};
8
9
util.ekexiuUrl = ekexiuUrl;
2
export const ekexiuUrl = process.env.KX_API;
10 3
11 4
/**
12 5
 * default img
13 6
 */
14
util.defaultSet = {
7
export const defaultSet = {
15 8
  img: {
16 9
    expert: '/static/comimg/default-expert.jpg',
17 10
    org: '/static/comimg/default-org.jpg',
@ -24,146 +17,10 @@ util.defaultSet = {
24 17
  }
25 18
};
26 19
27
/**
28
 * 跳转序列化页面
29
 */
30
util.pageUrl = function(type, item) {
31
  return (ekexiuUrl + '/shtml/' + type + '/' + item.createTime.substring(0, 8) + '/' + item.shareId + '.html');
32
};
33
34
/**
35
 * 正则匹配邮箱、手机
36
 * flag === 'mail' 是邮箱, flag === 'tel' 是手机
37
 */
38
util.regular = function(str, flag) {
39
  if (flag === 'mail') {
40
    var regMail = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
41
    return regMail.test(str);
42
  } else if (flag === 'tel') {
43
    var regTel = /^1[3|4|5|7|8][0-9]\d{8}$/;
44
    return regTel.test(str);
45
  };
46
};
47
48
/**
49
 * 邮箱mailHash
50
 */
51
util.mailHash = {
52
  'qq.com': 'http://mail.qq.com',
53
  'gmail.com': 'http://mail.google.com',
54
  'sina.com': 'http://mail.sina.com.cn',
55
  '163.com': 'http://mail.163.com',
56
  '126.com': 'http://mail.126.com',
57
  'yeah.net': 'http://www.yeah.net/',
58
  'sohu.com': 'http://mail.sohu.com/',
59
  'tom.com': 'http://mail.tom.com/',
60
  'sogou.com': 'http://mail.sogou.com/',
61
  '139.com': 'http://mail.10086.cn/',
62
  'hotmail.com': 'http://www.hotmail.com',
63
  'live.com': 'http://login.live.com/',
64
  'live.cn': 'http://login.live.cn/',
65
  'live.com.cn': 'http://login.live.com.cn',
66
  '189.com': 'http://webmail16.189.cn/webmail/',
67
  'yahoo.com.cn': 'http://mail.cn.yahoo.com/',
68
  'yahoo.cn': 'http://mail.cn.yahoo.com/',
69
  'eyou.com': 'http://www.eyou.com/',
70
  '21cn.com': 'http://mail.21cn.com/',
71
  '188.com': 'http://www.188.com/',
72
  'ustb.edu.cn': 'http://mail.ustb.edu.cn/',
73
  'foxmail.coom': 'http://www.foxmail.com'
74
};
75
76
/**
77
 * 数据字典
78
 */
79
util.Dictionary = {
80
  durationTime: [{
81
      value: '1',
82
      label: '1个月内'
83
    }, {
84
      value: '2',
85
      label: '1-3个月'
86
    }, {
87
      value: '3',
88
      label: '3-6个月'
89
    }, {
90
      value: '4',
91
      label: '6-12个月'
92
    }, {
93
      value: '5',
94
      label: '1年以上'
95
    }],
96
  costRange: [{
97
      value: '1',
98
      label: '1万元以内'
99
    }, {
100
      value: '2',
101
      label: '1-5万元'
102
    }, {
103
      value: '3',
104
      label: '5-10万元'
105
    }, {
106
      value: '4',
107
      label: '10-20万元'
108
    }, {
109
      value: '5',
110
      label: '20-50万元'
111
    }, {
112
      value: '6',
113
      label: '50万元以上'
114
    }]
115
};
116
117
/**
118
 * 数据字典
119
 */
120
util.workComm = {
121
  durationTime: [{ // 费用预算
122
      value: '',
123
      label: '全部'
124
    }, {
125
      value: '1',
126
      label: '1个月内'
127
    }, {
128
      value: '2',
129
      label: '1-3个月'
130
    }, {
131
      value: '3',
132
      label: '3-6个月'
133
    }, {
134
      value: '4',
135
      label: '6-12个月'
136
    }, {
137
      value: '5',
138
      label: '1年以上'
139
    }],
140
  costRange: [{ // 费用预算
141
      value: '',
142
      label: '全部'
143
    }, {
144
      value: '1',
145
      label: '1万元以内'
146
    }, {
147
      value: '2',
148
      label: '1-5万元'
149
    }, {
150
      value: '3',
151
      label: '5-10万元'
152
    }, {
153
      value: '4',
154
      label: '10-20万元'
155
    }, {
156
      value: '5',
157
      label: '20-50万元'
158
    }, {
159
      value: '6',
160
      label: '50万元以上'
161
    }]
162
};
163 20
/**
164 21
 * expert head symbol icon
165 22
 */
166
util.autho = function (a, b, c) {
23
export const autho = function (a, b, c) {
167 24
  if (a === 1) {
168 25
    return 'icon-pro';
169 26
  } else {
@ -182,14 +39,18 @@ util.autho = function (a, b, c) {
182 39
 * @example ?id=12345&a=b
183 40
 * @return Object {id:12345,a:b}
184 41
 */
185
util.urlParse = function (name) {
42
export const urlParse = function (name) {
186 43
  return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || ['', ''])[1].replace(/\+/g, '%20')) || null;
187 44
};
188 45
46
export const trimStr = function(str) {
47
  return str.replace(/(^\s*)|(\s*$)/g, '')
48
}
49
189 50
/**
190 51
 * 拼接图片链接地址
191 52
 */
192
util.ImageUrl = function (str, bol) {
53
export const ImageUrl = function (str, bol) {
193 54
  return bol ? (ekexiuUrl + '/images/' + str) : (ekexiuUrl + '/data/' + str);
194 55
};
195 56
@ -197,7 +58,7 @@ util.ImageUrl = function (str, bol) {
197 58
 * 拼接用户-所在机构,所属部门,职位
198 59
 * 拼接用户-职称/职位,所在机构 bol
199 60
 */
200
util.formatOfft = function (str, bol) {
61
export const formatOfft = function (str, bol) {
201 62
  var proOther = '';
202 63
  var proOtherBol = '';
203 64
  if (!bol) {
@ -250,29 +111,23 @@ util.formatOfft = function (str, bol) {
250 111
  return bol ? proOtherBol : proOther;
251 112
};
252 113
253
// util.cutOutUrl = function (str) {
254
//     var index = str.lastIndexOf(/\//);
255
//     str = str.substring(index + 1, str.length);
256
//     return str;
257
// };
258
259 114
/**
260 115
 * String与Array之间的转换
261 116
 */
262
util.strToArr = function (str) {
117
export const strToArr = function (str) {
118
  var subs = []
263 119
  if (str) {
264
    var subs = [];
265 120
    if (str.indexOf(',')) {
266
        subs = str.split(',');
121
      subs = str.split(',')
267 122
    } else {
268
        subs[0] = str;
123
      subs[0] = str
269 124
    }
270
    return subs;
125
    return subs
271 126
  } else {
272
    return [];
127
    return subs
273 128
  }
274 129
};
275
util.arrToStr = function (arr) {
130
export const arrToStr = function (arr) {
276 131
  var strs = ''
277 132
  if (arr) {
278 133
    strs = arr.join(',')
@ -289,14 +144,14 @@ util.arrToStr = function (arr) {
289 144
 * @example
290 145
 * getFormatCode('测\r\n\s试')  =>  “测<br/> 试”
291 146
 */
292
util.getFormatCode = function(strValue) {
147
export const getFormatCode = function(strValue) {
293 148
  return strValue.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
294 149
};
295 150
296 151
/**
297 152
 * 时间显示规则
298 153
 */
299
util.commenTime = function(startTime, flag) {
154
export const commenTime = function(startTime, flag) {
300 155
  var nowTimg = new Date();
301 156
  var startdate = new Date();
302 157
  startdate.setFullYear(parseInt(startTime.substring(0, 4)));
@ -331,44 +186,9 @@ util.commenTime = function(startTime, flag) {
331 186
  };
332 187
};
333 188
334
/**
335
 * 时间格式转换
336
 */
337
util.dateFormatter = function(str, fl, bol) { // 默认返回yyyy-MM-dd HH-mm-ss
338
    var hasTime = fl !== false; // 可传第二个参数false,返回yyyy-MM-dd
339
    var d = new Date(str);
340
    var year = d.getFullYear();
341
    var month = (d.getMonth() + 1) < 10 ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1);
342
    var day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate();
343
    var hour = d.getHours() < 10 ? '0' + d.getHours() : d.getHours();
344
    var minute = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes();
345
    var second = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds();
346
    if (hasTime) {
347
      if (bol) {
348
        return year + month + day + hour + minute + second;
349
      } else {
350
        return [year, month, day].join('-') + ' ' + [hour, minute, second].join(':');
351
      }
352
    } else {
353
      if (bol) {
354
        return year + month + day;
355
      } else {
356
        return [year, month, day].join('-');
357
      }
358
    }
359
};
360
361
util.dateChange = function(startTime) { // 默认返回yyyy月MM日dd HH:mm
362
    var nowTimg = new Date();
363
    if (nowTimg.getFullYear() !== startTime.substring(0, 4)) {
364
        return startTime.substring(4, 6).replace(/\b(0+)/gi, '') + '月' + startTime.substring(6, 8).replace(/\b(0+)/gi, '') + '日 ' + startTime.substring(8, 10) + ':' + startTime.substring(10, 12);
365
    } else {
366
        return startTime.substring(0, 4) + '年' + startTime.substring(4, 6).replace(/\b(0+)/gi, '') + '月' + startTime.substring(6, 8).replace(/\b(0+)/gi, '') + '日 ' + startTime.substring(8, 10) + ':' + startTime.substring(10, 12);
367
    }
368
};
369
370
util.TimeTr = function(dealtime) {
189
export const TimeTr = function(dealtime) {
371 190
  var myDate = new Date();
191
  var Fy = myDate.getFullYear();
372 192
  var s = dealtime;
373 193
  var y = s.substr(0, 4);
374 194
  var m = s.substr(4, 2);
@ -380,16 +200,14 @@ util.TimeTr = function(dealtime) {
380 200
    formatTime = y + '年' + m.replace(/\b(0+)/gi, '') + '月';
381 201
  } else if (s.length > 6 && s.length <= 8) {
382 202
    formatTime = m.replace(/\b(0+)/gi, '') + '月' + d.replace(/\b(0+)/gi, '') + '日 ';
383
    if (y !== myDate.getFullYear()) {
203
    if (Number(y) !== Fy) {
384 204
      formatTime = y + '年' + m.replace(/\b(0+)/gi, '') + '月' + d.replace(/\b(0+)/gi, '') + '日 ';
385 205
    }
386 206
  } else {
387 207
    formatTime = m.replace(/\b(0+)/gi, '') + '月' + d.replace(/\b(0+)/gi, '') + '日 ' + h + ':' + minute;
388
    if (y !== myDate.getFullYear()) {
208
    if (Number(y) !== Fy) {
389 209
      formatTime = y + '年' + m.replace(/\b(0+)/gi, '') + '月' + d.replace(/\b(0+)/gi, '') + '日 ' + h + ':' + minute;
390 210
    }
391 211
  }
392 212
  return formatTime;
393 213
};
394
395
export default util;

+ 0 - 1
src/pages/center/center.html

@ -6,7 +6,6 @@
6 6
  	<meta name="description" content="">
7 7
  	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
8 8
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
9
    <script type="text/javascript" src="/static/plat-info.js"></script>
10 9
  	<title></title>
11 10
  </head>
12 11
  <body>

+ 0 - 16
src/pages/center/center.js

@ -4,10 +4,6 @@ import App from './center.vue';
4 4
import router from './router';
5 5
import store from '@/store/index';
6 6
import './permission';
7
import CityPick from '@/components/global-component/citypick/CityPick'
8
9
import Cookies from 'js-cookie';
10
Vue.component('CityPick', CityPick);
11 7
12 8
/* eslint-disable no-new */
13 9
new Vue({
@ -15,18 +11,6 @@ new Vue({
15 11
  router: router,
16 12
  store: store,
17 13
  render: h => h(App),
18
  data() {
19
    return {
20
      plat: {}
21
    };
22
  },
23
  mounted() {
24
    /* eslint-disable no-undef */
25
    this.plat = PLAT.info;
26
    document.title = this.plat.title;
27
    Cookies.set('platId', process.env.PLAT_ID);
28
    Cookies.set('platSource', this.plat.source);
29
  },
30 14
  created () {
31 15
    router.afterEach((to, from, next) => {
32 16
      window.scrollTo(0, 0);

+ 15 - 2
src/pages/center/center.vue

@ -1,15 +1,28 @@
1 1
<template>
2 2
  <div class="app-main">
3
      <router-view></router-view>
3
      <router-view v-if="isRouterAlive"></router-view>
4 4
  </div>
5 5
</template>
6 6
7 7
<script>
8 8
  export default {
9
    provide() {
10
      return {
11
        reload: this.reload
12
      };
13
    },
9 14
    data() {
10
      return {};
15
      return {
16
        isRouterAlive: true
17
      };
11 18
    },
12 19
    methods: {
20
      reload() {
21
        this.isRouterAlive = false;
22
        this.$nextTick(function() {
23
          this.isRouterAlive = true;
24
        });
25
      }
13 26
    }
14 27
  };
15 28
</script>

+ 56 - 30
src/pages/center/permission.js

@ -1,43 +1,69 @@
1 1
import router from './router'
2 2
import store from '@/store'
3 3
import { Message } from 'element-ui'
4
import Cookies from 'js-cookie'
4
// import Cookies from 'js-cookie'
5 5
6
const whiteList = ['/publishProduct', '/companyProduct', '/companyInformation', '/myDemand', '/examineDemand', '/modifyDemand', '/modifyData', '/modifyPassword', '/attentionCollect']
6
// const whiteList = ['/publishProduct', '/companyProduct', '/companyInformation', '/myDemand', '/examineDemand', '/modifyDemand', '/modifyData', '/modifyPassword', '/attentionCollect']
7
// router.beforeEach((to, from, next) => {
8
//   if (Cookies.get('userid')) {
9
//     if (to.path === '/loginPlat') {
10
//       next({ name: 'home' });
11
//     } else {
12
//       if (!store.getters.account) { // 判断当前用户是否已拉取完user_info信息
13
//         store.dispatch('GetUserInfo').then(res => { // 拉取user_info
14
//           if (res.success && res.data) {
15
//             next();
16
//           } else {
17
//             store.dispatch('FedLogOut').then(() => {
18
//               if (whiteList.indexOf(to.path) !== -1) {
19
//                 Message.error('登录状态失效,请重新登录');
20
//                 router.push({ name: 'loginPlat' });
21
//               } else {
22
//                 next();
23
//               }
24
//             })
25
//           }
26
//         }).catch((err) => {
27
//           store.dispatch('FedLogOut').then(() => {
28
//             Message.error(err || '登录状态失效,请重新登录');
29
//             next({ name: 'loginPlat' })
30
//           })
31
//         })
32
//       } else {
33
//         next();
34
//       }
35
//     }
36
//   } else {
37
//     if (whiteList.indexOf(to.path) !== -1) {
38
//       router.push({ name: 'loginPlat' });
39
//     } else {
40
//       next();
41
//     }
42
//   }
43
// })
7 44
router.beforeEach((to, from, next) => {
8
  if (Cookies.get('userid')) {
9
    if (to.path === '/loginPlat') {
10
      next({ name: 'home' });
11
    } else {
12
      if (!store.getters.account) { // 判断当前用户是否已拉取完user_info信息
13
        store.dispatch('GetUserInfo').then(res => { // 拉取user_info
14
          if (res.success && res.data) {
15
            next();
16
          } else {
17
            store.dispatch('FedLogOut').then(() => {
18
              if (whiteList.indexOf(to.path) !== -1) {
19
                Message.error('登录状态失效,请重新登录');
20
                router.push({ name: 'loginPlat' });
21
              } else {
22
                next();
23
              }
24
            })
25
          }
26
        }).catch((err) => {
45
  /* 判断该路由是否需要登录权限 */
46
  if (to.matched.some(record => record.meta.requireAuth)) {
47
    // 是否登录
48
    if (!store.getters.account) { // 判断当前用户是否已拉取完user_info信息
49
      store.dispatch('GetUserInfo').then(res => { // 拉取user_info
50
        if (res.success && res.data) {
51
          next();
52
        } else {
27 53
          store.dispatch('FedLogOut').then(() => {
28
            Message.error(err || '登录状态失效,请重新登录');
29
            next({ name: 'loginPlat' })
54
            Message.error('登录状态失效,请重新登录');
55
            location.href = '/#/loginPlat'
30 56
          })
57
        }
58
      }).catch((err) => {
59
        store.dispatch('FedLogOut').then(() => {
60
          Message.error(err || '登录状态失效,请重新登录');
61
          location.href = '/#/loginPlat'
31 62
        })
32
      } else {
33
        next();
34
      }
35
    }
36
  } else {
37
    if (whiteList.indexOf(to.path) !== -1) {
38
      router.push({ name: 'loginPlat' });
63
      })
39 64
    } else {
40 65
      next();
41 66
    }
42 67
  }
68
  next();
43 69
})

+ 54 - 50
src/pages/center/router/index.js

@ -13,61 +13,65 @@ const constantRouterMap = [
13 13
    children: [
14 14
      {
15 15
        path: '/modifyData',
16
        alwaysShow: true,
16 17
        component: () => import('../views/modifyData'),
17 18
        name: 'modifyData',
18
        meta: { title: '修改资料' }
19
      }, {
20
        path: '/modifyPassword',
21
        component: () => import('../views/modifyPassword'),
22
        name: 'modifyPassword',
23
        meta: { title: '修改密码' }
24
         meta: { title: '我的需求' }, {
25
        path: '/attentionCollect',
26
        component: () => import('../views/attentionCollect'),
27
        name: 'attentionCollect',
28
        meta: { title: '关注收藏' }
29
      }, {
30
        path: '/myNeeds',
31
        component: () => import('../views/myNeeds/index'),
32
        name: 'myNeeds',
33
        meta: { title: '我的需求' },
34
        children: [{
35
          path: '/modifyDemand',
36
          component: () => import('../views/myNeeds/modifyDemand'),
37
          name: 'modifyDemand',
38
          meta: { title: '修改需求' }
39
        }, {
40
          path: '/examineDemand',
41
          component: () => import('../views/myNeeds/examineDemand'),
42
          name: 'examineDemand',
43
          meta: { title: '查看需求' }
44
        }, {
45
          path: '/myDemand',
46
          component: () => import('../views/myNeeds/myNeed'),
47
          name: 'myDemand',
48
          meta: { title: '我的需求' }
49
        }]
50
      }, {
19
        meta: { title: '修改资料', requireAuth: true }
20
      },
21
      // {
22
      //   path: '/myNeeds',
23
      //   component: () => import('../views/myNeeds/index'),
24
      //   name: 'myNeeds',
25
      //   meta: { title: '我的需求'    meta: { title: '我的需求' },
26
      //   children: [{
27
      //     path: '/modifyDemand',
28
      //     component: () => import('../views/myNeeds/modifyDemand'),
29
      //     name: 'modifyDemand',
30
      //     meta: { title: '修改需求' }
31
      //   }, {
32
      //     path: '/examineDemand',
33
      //     component: () => import('../views/myNeeds/examineDemand'),
34
      //     name: 'examineDemand',
35
      //     meta: { title: '查看需求' }
36
      //   }, {
37
      //     path: '/myDemand',
38
      //     component: () => import('../views/myNeeds/myNeed'),
39
      //     name: 'myDemand',
40
      //     meta: { title: '我的需求' }
41
      //   }]
42
      // },
43
      {
51 44
        path: '/myBusiness',
52 45
        component: () => import('../views/myNeeds/index'),
53 46
        name: 'myBusiness',
54
        meta: { title: '我的企业' },
55
        children: [{
56
          path: '/companyInformation',
57
          component: () => import('../views/myBusiness/companyInformation'),
58
          name: 'companyInformation',
59
          meta: { title: '企业信息' }
60
        }, {
61
          path: '/companyProduct',
62
          component: () => import('../views/myBusiness/companyProduct'),
63
          name: 'companyProduct',
64
          meta: { title: '企业产品' }
65
        }, {
66
          path: '/publishProduct',
67
          component: () => import('../views/myBusiness/publishProduct'),
68
          name: 'publishProduct',
69
          meta: { title: '发布产品' }
70
        }]
47
        meta: { title: '我的企业', requireAuth: true },
48
        children: [
49
          {
50
            path: '/companyInformation',
51
            component: () => import('../views/myBusiness/companyInformation'),
52
            name: 'companyInformation',
53
            meta: { title: '企业信息' }
54
          }, {
55
            path: '/companyProduct',
56
            component: () => import('../views/myBusiness/companyProduct'),
57
            name: 'companyProduct',
58
            meta: { title: '企业产品' }
59
          }
60
        ]
61
      },
62
      {
63
        path: '/attentionCollect',
64
        alwaysShow: true,
65
        component: () => import('../views/attentionCollect'),
66
        name: 'attentionCollect',
67
        meta: { title: '关注收藏', requireAuth: true }
68
      },
69
      {
70
        path: '/modifyPassword',
71
        alwaysShow: true,
72
        component: () => import('../views/modifyPassword'),
73
        name: 'modifyPassword',
74
        meta: { title: '修改密码', requireAuth: true }
71 75
      }
72 76
    ]
73 77
  }

+ 174 - 8
src/pages/center/views/attentionCollect.vue

@ -1,23 +1,189 @@
1 1
<template>
2 2
  <el-tabs v-model="activeName" @tab-click="handleClick">
3
    <el-tab-pane label="专家" name="first">专家</el-tab-pane>
4
    <el-tab-pane label="机构" name="second">机构</el-tab-pane>
5
    <el-tab-pane label="服务" name="third">服务</el-tab-pane>
6
    <el-tab-pane label="资源" name="fourth">资源</el-tab-pane>
7
    <el-tab-pane label="专利" name="fiveth">专利</el-tab-pane>
3
    <el-tab-pane v-for="item in navbarArray" :key="item.index" :label="item.text" :name="item.wtype">
4
      <div  v-if="watchList && watchList.length && ifDefault">
5
        <div class="con-item" v-if="watchList && watchList.length" v-for="watc in watchList" :key="watc.index">
6
          <baseExpert v-if="item.wtype==='1'" :itemSingle="watc"></baseExpert>
7
          <baseOrg v-if="item.wtype==='2'" :itemSingle="watc"></baseOrg>
8
          <baseService v-if="item.wtype==='3'" :itemSingle="watc"></baseService>
9
          <baseResource v-if="item.wtype==='4'" :itemSingle="watc"></baseResource>
10
          <baseResult v-if="item.wtype==='5'" :itemSingle="watc"></baseResult>
11
          <div class="dele">
12
            <el-button type="danger" size="mini" @click.stop="handerDel(watc)">移除</el-button>
13
          </div>
14
        </div>
15
      </div>
16
      <defaultPage v-else></defaultPage>
17
    </el-tab-pane>
18
    <div class="pagination-container" v-if="watchList && watchList.length">
19
      <el-pagination
20
        background
21
        @current-change="handleCurrentChange"
22
        :current-page.sync="pageNo"
23
        :page-size="pageSize"
24
        layout="prev, pager, next, jumper"
25
        :total="total">
26
      </el-pagination>
27
    </div>
8 28
  </el-tabs>
9 29
</template>
10 30
<script>
31
  import { loginStatus } from '@/libs/loginStatus';
32
  import baseExpert from '@/components/subTemplate/BaseExpert';
33
  import baseOrg from '@/components/subTemplate/BaseOrg';
34
  import baseService from '@/components/subTemplate/BaseService';
35
  import baseResource from '@/components/subTemplate/BaseResource';
36
  import baseResult from '@/components/subTemplate/BaseResult';
11 37
  export default {
12 38
    data() {
13 39
      return {
14
        activeName: 'second'
40
        activeName: '1',
41
        navbarArray: [{
42
          text: '专家',
43
          wtype: '1',
44
          url: '/ajax/professor/qm'
45
        }, {
46
          text: '机构',
47
          wtype: '2',
48
          url: '/ajax/org/qm'
49
        }, {
50
          text: '服务',
51
          wtype: '3',
52
          url: '/ajax/ware/qm'
53
        }, {
54
          text: '资源',
55
          wtype: '4',
56
          url: '/ajax/resource/qm'
57
        }, {
58
          text: '专利',
59
          wtype: '5',
60
          url: '/ajax/ppatent/qm'
61
        }],
62
        pageSize: 10,
63
        pageNo: 1,
64
        total: 0,
65
        watchList: [],
66
        ifDefault: false
15 67
      };
16 68
    },
69
    components: {
70
      baseExpert,
71
      baseOrg,
72
      baseService,
73
      baseResource,
74
      baseResult
75
    },
76
    created() {
77
      this.queryWatchList();
78
    },
17 79
    methods: {
18
      handleClick(tab, event) {
19
        console.log(tab, event);
80
      handleClick() {
81
        this.pageNo = 1
82
        this.total = 0
83
        this.watchList = []
84
        this.queryWatchList();
85
      },
86
      queryWatchList() {
87
        var that = this
88
        loginStatus(function () {
89
          that.$axios.get('/ajax/collection/pq', {
90
            type: that.activeName,
91
            pageSize: that.pageSize,
92
            pageNo: that.pageNo
93
          }, function(res) {
94
            if (res.success && res.data) {
95
              var arr = []
96
              const $info = res.data.data
97
              if ($info.length > 0) {
98
                var hdata = { num: 1, data: $info }
99
                for (let i in $info) {
100
                  hdata.num++
101
                  arr[i] = $info[i].oid;
102
                  hdata.num--
103
                }
104
                hdata.num--
105
                that.total = res.data.total
106
                if (hdata.num === 0) {
107
                  that.$axios.getk(that.navbarArray[that.activeName - 1].url, {
108
                    id: arr
109
                  }, function(data) {
110
                    if (data.success && data.data) {
111
                      if (data.data.length > 0) {
112
                        that.watchList = data.data
113
                        that.$forceUpdate()
114
                      }
115
                    }
116
                  })
117
                }
118
              }
119
              var liLen = that.watchList.length;
120
              if ($info.length === 0 && liLen === 0) {
121
                that.ifDefault = true;
122
              };
123
            }
124
          })
125
        })
126
      },
127
      handleCurrentChange(val) {
128
        this.pageNo = val
129
        this.queryWatchList()
130
      },
131
      handerDel(watc) {
132
        var that = this;
133
        var Id = ''
134
        switch (that.activeName) {
135
          case '1':
136
           Id = watc.professorId
137
           break
138
          case '2':
139
           Id = watc.orgId
140
           break
141
          case '3':
142
           Id = watc.id
143
           break
144
          case '4':
145
           Id = watc.resourceId
146
           break
147
          case '5':
148
           Id = watc.id
149
           break
150
        }
151
        loginStatus(function () {
152
          that.$axios.post('/ajax/collection/delete', {
153
            oid: Id,
154
            type: that.activeName
155
          }, function(res) {
156
            if (res.success) {
157
              if (res.data) {
158
                that.handleClick()
159
                that.$message({
160
                  message: `已移除`,
161
                  type: 'success'
162
                })
163
              }
164
            }
165
          })
166
        })
20 167
      }
21 168
    }
22 169
  };
23 170
</script>
171
<style lang="scss" scoped>
172
  .con-item{
173
    position:relative;
174
    cursor: pointer;
175
    &:hover{
176
      background: #EEEEEE;
177
      .dele{
178
        display: block;
179
      }
180
    }
181
    .dele{
182
      display: none;
183
      position: absolute;
184
      right: 10px;
185
      z-index: 20;
186
      top: 40%;
187
    }
188
  }
189
</style>

+ 77 - 0
src/pages/center/views/common/Sidebar/SidebarItem.vue

@ -0,0 +1,77 @@
1
<template>
2
  <div v-if="!item.hidden&&item.children" class="menu-wrapper">
3
4
      <router-link v-if="hasOneShowingChild(item.children) && !onlyOneChild.children&&!item.alwaysShow" :to="resolvePath(onlyOneChild.path)">
5
        <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
6
          <svg-icon v-if="onlyOneChild.meta&&onlyOneChild.meta.icon" :icon-class="onlyOneChild.meta.icon"></svg-icon>
7
          <span v-if="onlyOneChild.meta&&onlyOneChild.meta.title" slot="title">{{onlyOneChild.meta.title}}</span>
8
        </el-menu-item>
9
      </router-link>
10
11
      <el-submenu v-else :index="item.name||item.path">
12
        <template slot="title">
13
          <svg-icon v-if="item.meta&&item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
14
          <span v-if="item.meta&&item.meta.title" slot="title">{{item.meta.title}}</span>
15
        </template>
16
        <template v-for="child in item.children" v-if="!child.hidden">
17
          <sidebar-item :is-nest="true" class="nest-menu" v-if="child.children&&child.children.length>0" :item="child" :key="child.path" :base-path="resolvePath(child.path)"></sidebar-item>
18
19
          <router-link v-else :to="resolvePath(child.path)" :key="child.name" replace>
20
            <el-menu-item :index="resolvePath(child.path)">
21
              <svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
22
              <span v-if="child.meta&&child.meta.title" slot="title">{{child.meta.title}}</span>
23
            </el-menu-item>
24
          </router-link>
25
        </template>
26
      </el-submenu>
27
28
  </div>
29
</template>
30
31
<script>
32
import path from 'path'
33
34
export default {
35
  name: 'SidebarItem',
36
  props: {
37
    // route配置json
38
    item: {
39
      type: Object,
40
      required: true
41
    },
42
    isNest: {
43
      type: Boolean,
44
      default: false
45
    },
46
    basePath: {
47
      type: String,
48
      default: ''
49
    }
50
  },
51
  data() {
52
    return {
53
      onlyOneChild: null
54
    }
55
  },
56
  methods: {
57
    hasOneShowingChild(children) {
58
      const showingChildren = children.filter(item => {
59
        if (item.hidden) {
60
          return false
61
        } else {
62
          // temp set(will be used if only has one showing child )
63
          this.onlyOneChild = item
64
          return true
65
        }
66
      })
67
      if (showingChildren.length === 1) {
68
        return true
69
      }
70
      return false
71
    },
72
    resolvePath(...paths) {
73
      return path.resolve(this.basePath, ...paths)
74
    }
75
  }
76
}
77
</script>

+ 39 - 0
src/pages/center/views/common/Sidebar/index.vue

@ -0,0 +1,39 @@
1
<template>
2
  <el-menu
3
    mode="vertical"
4
    :default-openeds="['personalCenter', 'myBusiness']"
5
    :show-timeout="200"
6
    :default-active="$route.path">
7
    <sidebar-item v-for="route in routes" :key="route.name" :item="route" :base-path="route.path"></sidebar-item>
8
  </el-menu>
9
</template>
10
11
<script>
12
import { mapGetters } from 'vuex'
13
import SidebarItem from './SidebarItem'
14
15
export default {
16
  components: { SidebarItem },
17
  computed: {
18
    ...mapGetters([
19
      'bindCompany'
20
    ]),
21
    routes() {
22
      var aRouter = this.$router.options.routes
23
      var dRouter = []
24
      if (!this.bindCompany) {
25
        for (let i = 0; i < aRouter[0].children.length; ++i) {
26
          var Ltm = []
27
          if (aRouter[0].children[i].name !== 'myBuseiness') {
28
            Ltm.push(aRouter[0].children[i])
29
          }
30
        }
31
        dRouter.push(Ltm)
32
      } else {
33
        dRouter = aRouter
34
      }
35
      return dRouter
36
    }
37
  }
38
}
39
</script>

+ 42 - 56
src/pages/center/views/common/index.vue

@ -3,43 +3,12 @@
3 3
    <div class="boxLeft">
4 4
      <div class="headPhoto">
5 5
        <div class="userInfo">
6
          <img :src="headPhoto" alt="">
7
          <p>专家姓名</p>
6
          <div class="img-div" :style="{backgroundImage: 'url(' + headPhoto + ')'}"></div>
7
          <p>{{account}}</p>
8 8
        </div>
9 9
      </div>
10
      <el-menu default-active="modifyData" router class="el-menu-vertical-demo" @select="handleSelect" @open="handleOpen"
11
        @close="handleClose">
12
        <el-menu-item index="modifyData">
13
          <i class="el-icon-menu"></i>
14
          <span slot="title">修改资料</span>
15
        </el-menu-item>
16
        <el-submenu index="demand">
17
          <template slot="title">
18
            <i class="el-icon-location"></i>
19
            <span>我的需求</span>
20
          </template>
21
          <el-menu-item index="myDemand">我的需求</el-menu-item>
22
          <el-menu-item index="modifyDemand">修改需求</el-menu-item>
23
          <el-menu-item index="examineDemand">查看需求</el-menu-item>
24
        </el-submenu>
25
        <el-submenu index="2" v-if="bindCompany">
26
          <template slot="title">
27
            <i class="el-icon-location"></i>
28
            <span>我的企业</span>
29
          </template>
30
          <el-menu-item index="companyInformation">企业信息</el-menu-item>
31
          <el-menu-item index="companyProduct">企业产品</el-menu-item>
32
          <el-menu-item index="publishProduct">发布产品</el-menu-item>
33
        </el-submenu>
34
        <el-menu-item index="attentionCollect">
35
          <i class="el-icon-menu"></i>
36
          <span slot="title">关注收藏</span>
37
        </el-menu-item>
38
        <el-menu-item index="modifyPassword">
39
          <i class="el-icon-setting"></i>
40
          <span slot="title">账户设置</span>
41
        </el-menu-item>
42
      </el-menu>
10
      <sidebar></sidebar>
11
      <div class="exit-menu-item" @click="logout">退出登录</div>
43 12
    </div>
44 13
    <div class="boxRight">
45 14
      <transition name="fade" mode="out-in">
@ -50,30 +19,29 @@
50 19
</template>
51 20
52 21
<script>
22
  import Sidebar from './Sidebar';
53 23
  import { mapGetters } from 'vuex';
54 24
  export default {
55
    data() {
56
      return {
57
        img: ''
58
      };
59
    },
60 25
    computed: {
61 26
      ...mapGetters([
62 27
        'bindCompany',
63
        'headPhoto'
28
        'headPhoto',
29
        'account'
64 30
      ])
65 31
    },
66
    created() {
32
    components: {
33
      Sidebar
67 34
    },
68 35
    methods: {
69
      handleSelect(key, keyPath) {
70
        console.log(key, keyPath);
71
      },
72
      handleOpen(key, keyPath) {
73
        console.log(key, keyPath);
74
      },
75
      handleClose(key, keyPath) {
76
        console.log(key, keyPath);
36
      logout() {
37
        this.$confirm('您确认要退出登录吗?', '提示', {
38
          type: 'warning',
39
          center: true
40
        }).then(() => {
41
          this.$store.dispatch('LogOut').then(() => {
42
            location.href = '/#/loginPlat'
43
          })
44
        }).catch(() => {})
77 45
      }
78 46
    }
79 47
  };
@ -81,11 +49,14 @@
81 49
82 50
<style lang="scss" rel="stylesheet/scss" scoped>
83 51
  .main-content {
84
    margin-top: 20px;
52
    margin: 20px 0;
53
    min-height: 500px;
85 54
    .boxRight {
55
      padding:10px 20px;
86 56
      float: left;
87
      width: 900px;
88
      margin-left: 15px;
57
      width: 880px;
58
      margin-left: 20px;
59
      background: #ffffff;
89 60
      box-sizing: border-box;
90 61
    }
91 62
    .boxLeft {
@ -94,8 +65,8 @@
94 65
      width: 200px;
95 66
      .headPhoto {
96 67
        height: 146px;
97
        margin-bottom: 10px;
98
        border: 1px solid #ebebeb;
68
        background: #ffffff;
69
        margin-bottom: 20px;
99 70
        display: flex;
100 71
        justify-content: center;
101 72
        align-items: center;
@ -105,13 +76,28 @@
105 76
          p {
106 77
            margin-top: 10px;
107 78
          }
108
          img {
79
          .img-div {
109 80
            width: 80px;
110 81
            height: 80px;
111 82
            border-radius: 50%;
83
            margin: auto;
84
            background-size: cover;
112 85
          }
113 86
        }
114 87
      }
88
      .el-menu {
89
        border:none;
90
      }
91
      .exit-menu-item{
92
        padding-left: 20px;
93
        background: #ffffff;
94
        border-top: 10px solid #f4f6f8;
95
        box-sizing: content-box;
96
        height: 56px;
97
        line-height: 56px;
98
        font-size: 14px;
99
        cursor: pointer;
100
      }
115 101
    }
116 102
  }
117 103
</style>

+ 1 - 1
src/pages/center/views/layout/index.vue

@ -36,7 +36,7 @@
36 36
  border-radius: 0px !important;
37 37
  background:none;
38 38
  overflow:hidden;
39
  margin-bottom:-20px;
39
  margin:-20px 0;
40 40
  border-bottom: none;
41 41
  .hamburger-container{
42 42
    line-height: 58px;

+ 13 - 8
src/pages/center/views/modifyData.vue

@ -8,10 +8,10 @@
8 8
        <el-form :model="ruleForm2" status-icon :rules="rules2" ref="ruleForm2" label-width="80px" class="demo-ruleForm">
9 9
          <el-col :span="12">
10 10
            <el-form-item label="用户名" prop="account">
11
              <el-input v-model="ruleForm2.account" autocomplete="off" placeholder="请输入用户名" maxlength="20"></el-input>
11
              <el-input v-model="ruleForm2.account" auto-complete="off" placeholder="请输入用户名" maxlength="20"></el-input>
12 12
            </el-form-item>
13 13
            <el-form-item label="真实姓名" prop="name">
14
              <el-input v-model="ruleForm2.name" autocomplete="off" placeholder="请输入真实姓名" maxlength="10"></el-input>
14
              <el-input v-model="ruleForm2.name" auto-complete="off" placeholder="请输入真实姓名" maxlength="10"></el-input>
15 15
            </el-form-item>
16 16
            <el-form-item label="性别" prop="sex">
17 17
              <el-select v-model="ruleForm2.sex" placeholder="请选择性别" style="width: 100%">
@ -31,9 +31,9 @@
31 31
            <el-form-item label="联系邮箱" prop="email">
32 32
              <el-input v-model="ruleForm2.email" placeholder="请输入联系邮箱" maxlength="100"></el-input>
33 33
            </el-form-item>
34
            <CityPick ref="cityPick" :widthselect="180" :prov="province" :city="city"
35
              v-on:selectProv="getSelectProv($event)">
36
            </CityPick>
34
            <el-form-item label="所在城市" prop="addr">
35
              <cityPicker @paren="toshow" :addrCode="ruleForm2.addr"></cityPicker>
36
            </el-form-item>
37 37
          </el-col>
38 38
          <el-col :span="12">
39 39
            <el-form-item prop="head">
@ -53,6 +53,7 @@
53 53
54 54
<script>
55 55
  import uploadFile from '@/components/uploadFile/index';
56
  import cityPicker from '@/components/CityPicker'
56 57
  import Cookies from 'js-cookie'
57 58
  export default {
58 59
    data() {
@ -88,7 +89,8 @@
88 89
      };
89 90
    },
90 91
    components: {
91
      uploadFile
92
      uploadFile,
93
      cityPicker
92 94
    },
93 95
    created() {
94 96
      let id = Cookies.get('userid');
@ -121,9 +123,12 @@
121 123
      uploadfun(value) {
122 124
        this.ruleForm2.head = value
123 125
      },
124
      getSelectProv(prov) {
125
        this.ruleForm2.addr = prov;
126
      toshow(value) {
127
        this.ruleForm2.addr = value
126 128
      },
129
      // getSelectProv(prov) {
130
      //   this.ruleForm2.addr = prov;
131
      // },
127 132
      submitForm(formName) {
128 133
        this.$refs[formName].validate((valid) => {
129 134
          if (valid) {

+ 2 - 2
src/pages/center/views/modifyPassword.vue

@ -8,10 +8,10 @@
8 8
      <div class="boxCenter">
9 9
        <el-form :model="ruleForm2" status-icon :rules="rules2" ref="ruleForm2" label-width="100px" class="demo-ruleForm">
10 10
          <el-form-item label="原密码" prop="opw">
11
            <el-input type="password" v-model="ruleForm2.opw" autocomplete="off" placeholder="请输入原密码"></el-input>
11
            <el-input type="password" v-model="ruleForm2.opw" auto-complete="off" placeholder="请输入原密码"></el-input>
12 12
          </el-form-item>
13 13
          <el-form-item label="新密码" prop="npw">
14
            <el-input type="password" v-model="ruleForm2.npw" autocomplete="off" placeholder="请输入新密码"></el-input>
14
            <el-input type="password" v-model="ruleForm2.npw" auto-complete="off" placeholder="请输入新密码"></el-input>
15 15
          </el-form-item>
16 16
          <el-form-item label="再次输入" prop="npwCheck">
17 17
            <el-input type="password" v-model="ruleForm2.npwCheck" placeholder="请确认新密码"></el-input>

+ 393 - 1
src/pages/center/views/myBusiness/companyInformation.vue

@ -1 +1,393 @@
1
<template> <div>企业信息</div></template>
1
<template>
2
  <div>
3
    <el-tabs>
4
      <el-tab-pane label="企业信息"></el-tab-pane>
5
    </el-tabs>
6
    <div class="content-container">
7
      <div class="main-info">
8
        <el-form :model="formObj" :rules="rulesObj" ref="formObj" label-width="86px" class="update-wrapper demo-ruleForm" v-loading="formLoading">
9
          <el-row :gutter="25">
10
            <el-col :span="17">
11
              <el-row :gutter="20" class="update-main">
12
                <el-col :span="24">
13
                  <el-form-item label="企业名称" prop="name">{{formObj.name}}</el-form-item>
14
                </el-col>
15
                <el-col :span="12">
16
                  <el-form-item label="创立年份" prop="foundYear">
17
                    <el-date-picker
18
                      :editable="false"
19
                      v-model="formObj.foundYear"
20
                      type="year"
21
                      value-format="yyyy"
22
                      placeholder="请选择企业的创立年份">
23
                    </el-date-picker>
24
                  </el-form-item>
25
                </el-col>
26
                <el-col :span="12">
27
                  <el-form-item label="官方网址" prop="url">
28
                    <el-input v-model="formObj.url" placeholder="如: www.ekexiu.xom"></el-input>
29
                  </el-form-item>
30
                </el-col>
31
                <el-col :span="12">
32
                  <el-form-item label="企业规模" prop="size">
33
                    <el-select v-model="formObj.size" placeholder="请选择员工数量范围">
34
                      <el-option
35
                        v-for="item in numRanger"
36
                        :key="item.value"
37
                        :label="item.label"
38
                        :value="item.value"
39
                        @current-change="item.value">
40
                      </el-option>
41
                    </el-select>
42
                  </el-form-item>
43
                </el-col>
44
                <el-col :span="12">
45
                  <el-form-item label="企业类型" prop="type">
46
                    <el-select v-model="formObj.type" placeholder="请选择最符合的一项">
47
                      <el-option
48
                        v-for="item in compType"
49
                        :key="item.value"
50
                        :label="item.label"
51
                        :value="item.value"
52
                        @current-change="item.value">
53
                      </el-option>
54
                    </el-select>
55
                  </el-form-item>
56
                </el-col>
57
                <el-col :span="12">
58
                  <el-form-item label="所在城市" prop="addr">
59
                    <cityPicker @paren="toshow" :addrCode="formObj.addr"></cityPicker>
60
                  </el-form-item>
61
                </el-col>
62
                <el-col :span="12">
63
                  <el-form-item label="企业邮编" prop="zipCode">
64
                    <el-input v-model="formObj.zipCode" placeholder="请填写企业邮编" maxlength="20"></el-input>
65
                  </el-form-item>
66
                </el-col>
67
                <el-col :span="24">
68
                  <el-form-item label="企业地址" prop="location">
69
                    <el-input v-model="formObj.location" placeholder="请填写企业详细地址" maxlength="50"></el-input>
70
                  </el-form-item>
71
                </el-col>
72
                <el-col :span="12">
73
                  <el-form-item label="联系人" prop="linkman">
74
                    <el-input v-model="formObj.linkman" placeholder="请填写企业联系人" maxlength="10"></el-input>
75
                  </el-form-item>
76
                </el-col>
77
                <el-col :span="12"><el-form-item class="space-form-item"></el-form-item></el-col>
78
                <el-col :span="12">
79
                  <el-form-item label="联系电话" prop="linkphone">
80
                    <el-input v-model="formObj.linkphone" placeholder="请填写办公电话" maxlength="50"></el-input>
81
                  </el-form-item>
82
                </el-col>
83
                <el-col :span="12">
84
                  <el-form-item label="联系邮箱" prop="linkemail">
85
                    <el-input v-model="formObj.linkemail" placeholder="请填写联系邮箱" maxlength="50"></el-input>
86
                  </el-form-item>
87
                </el-col>
88
                <el-col :span="12">
89
                  <el-form-item label="客服电话" prop="servicePhone">
90
                    <el-input v-model="formObj.servicePhone" placeholder="请填写客服电话" maxlength="50"></el-input>
91
                  </el-form-item>
92
                </el-col>
93
                <el-col :span="12"><el-form-item class="space-form-item"></el-form-item></el-col>
94
                <el-col :span="12">
95
                  <el-form-item label="工作时间" prop="operateTime">
96
                    <el-input v-model="formObj.operateTime" placeholder="请填写客服工作时间" maxlength="50"></el-input>
97
                  </el-form-item>
98
                </el-col>
99
                <el-col :span="12">
100
                  <el-form-item label="客服邮箱" prop="serviceEmail">
101
                    <el-input v-model="formObj.serviceEmail" placeholder="请填写客服邮箱" maxlength="50"></el-input>
102
                  </el-form-item>
103
                </el-col>
104
                <el-col :span="24">
105
                  <el-form-item label="所属行业">
106
                    <dynamicTags :tagInfo="tagIndustry" :dyStr="keywordObj[1]" v-on:turnTags="turnIndustryTags($event)" ref="tagComponent"></dynamicTags>
107
                  </el-form-item>
108
                </el-col>
109
                <el-col :span="24">
110
                  <el-form-item label="专注领域">
111
                    <dynamicTags :tagInfo="tagSubject" :dyStr="keywordObj[2]" v-on:turnTags="turnSubjectTags($event)"></dynamicTags>
112
                  </el-form-item>
113
                </el-col>
114
                <el-col :span="24">
115
                  <el-form-item label="企业简介" prop="descp">
116
                    <el-input type="textarea" :rows="8" v-model="formObj.descp" placeholder="请填写一个简单的介绍,让大家更好地了解您的企业" maxlength="5000"></el-input>
117
                  </el-form-item>
118
                </el-col>
119
                <el-col :span="24">
120
                  <el-form-item label="企业资质">
121
                    <dynamicTags :tagInfo="tagProve" :dyStr="keywordObj[3]" v-on:turnTags="turnProveTags($event)"></dynamicTags>
122
                  </el-form-item>
123
                </el-col>
124
                <el-col :span="24">
125
                  <el-form-item label="供应商领域">
126
                    <dynamicTags :tagInfo="tagSubjectG" :dyStr="keywordObj[4]" v-on:turnTags="turnSubjectGTags($event)"></dynamicTags>
127
                  </el-form-item>
128
                </el-col>
129
                <el-col :span="24">
130
                  <el-form-item label="客户领域">
131
                    <dynamicTags :tagInfo="tagSubjectC" :dyStr="keywordObj[5]" v-on:turnTags="turnSubjectCTags($event)"></dynamicTags>
132
                  </el-form-item>
133
                </el-col>
134
                <el-col :span="24" class="el-btn-col">
135
                  <el-form-item class="el-btn-col-box">
136
                    <el-button type="primary" @click="submitForm('formObj')">保存修改</el-button>
137
                  </el-form-item>
138
                </el-col>
139
              </el-row>
140
            </el-col>
141
            <el-col :span="7">
142
              <uploadFile :upImgsStr="formObj.logo" :uploadImg="uploadImg" @uploadfun="uploadfun"></uploadFile>
143
            </el-col>
144
          </el-row>
145
        </el-form>
146
      </div>
147
    </div>
148
    <BackTop></BackTop>
149
  </div>
150
</template>
151
152
<script>
153
  import queryDict from '@/libs/queryDict'
154
155
  import cityPicker from '@/components/CityPicker'
156
  import uploadFile from '@/components/uploadFile'
157
  import dynamicTags from '@/components/DynamicTags'
158
  import { mapGetters } from 'vuex'
159
160
  export default {
161
    data() {
162
      var checkInterNum = (rule, value, callback) => {
163
        const reg = /^[0-9]*$/
164
        if (!value && !reg.test(value)) {
165
            return callback(new Error('请输入正确邮编'))
166
        } else {
167
            callback()
168
        }
169
      }
170
      return {
171
        companyId: '',
172
        numRanger: [],
173
        compType: [],
174
        keywordObj: {},
175
        formLoading: false,
176
        rulesObj: {
177
          name: [{ required: true, message: '请输入企业全部名称', trigger: 'blur' }],
178
          descp: [{ required: true, message: '请输入企业简介', trigger: 'blur' }],
179
          linkman: [{ required: true, message: '请输入企业联系人', trigger: 'blur' }],
180
          linkphone: [{ required: true, message: '请输入企业联系电话', trigger: 'blur' }],
181
          linkemail: [
182
            { required: true, message: '请输入企业联系邮箱', trigger: 'blur' },
183
            { type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur' }
184
          ],
185
          serviceEmail: [{ type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur' }],
186
          zipCode: [{ validator: checkInterNum, trigger: 'blur' }]
187
        },
188
        formObj: {
189
          name: '',
190
          logo: '',
191
          type: '',
192
          size: '',
193
          foundYear: '',
194
          descp: '',
195
          url: '',
196
          addr: '',
197
          location: '',
198
          zipCode: '',
199
          servicePhone: '',
200
          serviceEmail: '',
201
          operateTime: '',
202
          linkman: '',
203
          linkphone: '',
204
          linkemail: '',
205
          industry: [],
206
          subject: [],
207
          qualification: [],
208
          fieldOfSupplier: [],
209
          fieldOfCustomer: []
210
        },
211
        tagIndustry: {
212
          lableTit: '所属行业',
213
          placeholder: '请填写企业所属的行业,如:制造业、互联网、服务业',
214
          limitCount: 15,
215
          tagsNum: 3
216
        },
217
        tagSubject: {
218
          lableTit: '专注领域',
219
          placeholder: '请填写企业专注的领域,如:腐蚀防护、石墨烯、纳米材料',
220
          limitCount: 15,
221
          tagsNum: 20
222
        },
223
        tagProve: {
224
          lableTit: '企业资质',
225
          placeholder: '请填写企业获得的资质,如:ISO9000认证、高新技术企业认证',
226
          limitCount: 50,
227
          tagsNum: 5,
228
          tagblock: true
229
        },
230
        tagSubjectG: {
231
          lableTit: '供应商领域',
232
          placeholder: '请填写企业上游所涉及的领域',
233
          limitCount: 15,
234
          tagsNum: 10
235
        },
236
        tagSubjectC: {
237
          lableTit: '客户领域',
238
          placeholder: '请填写企业下游所涉及的领域',
239
          limitCount: 15,
240
          tagsNum: 5
241
        },
242
        uploadImg: {
243
          url: '/ajax/company/logo',
244
          tip: '上传企业LOGO',
245
          width: '200px',
246
          height: '140px'
247
        }
248
      }
249
    },
250
    components: {
251
      dynamicTags,
252
      cityPicker,
253
      uploadFile
254
    },
255
    computed: {
256
      ...mapGetters([
257
        'bindCompany'
258
      ])
259
    },
260
    created() {
261
      this.getDictoryData()
262
      if (this.bindCompany) {
263
        this.companyId = this.bindCompany
264
        this.formLoading = true
265
        this.getCompanyInfo()
266
        this.getCompanyKeyword()
267
      }
268
    },
269
    methods: {
270
      getDictoryData() {
271
        const that = this
272
        queryDict.applyDict('QYGM', function(dictData) {
273
          dictData.map(item => {
274
            that.numRanger.push({ value: item.code, label: item.caption })
275
          })
276
        }) // 企业规模
277
        queryDict.applyDict('QYLX', function(dictData) {
278
          dictData.map(item => {
279
            that.compType.push({ value: item.code, label: item.caption })
280
          })
281
        }) // 企业类型
282
      },
283
      getCompanyInfo() {
284
        var that = this
285
        that.$axios.get('/ajax/company/qo', {
286
          id: that.companyId
287
        }, function(res) {
288
          that.formLoading = false
289
          if (res.success) {
290
            const obj = res.data
291
            that.formObj = obj
292
          }
293
        })
294
      },
295
      getCompanyKeyword() {
296
        var that = this
297
        that.$axios.get('/ajax/company/qo/keyword', {
298
          id: that.companyId
299
        }, function(res) {
300
          if (res.success && res.data) {
301
            const str = res.data
302
            var objKey = {}
303
            if (str.length > 0) {
304
              str.map(item => {
305
                if (!objKey[item.type]) {
306
                  objKey[item.type] = []
307
                  objKey[item.type].push(item.value)
308
                } else {
309
                  objKey[item.type].push(item.value)
310
                }
311
              })
312
              // console.log(objKey)
313
            }
314
            that.keywordObj = objKey
315
            that.formObj.industry = objKey[1]
316
            that.formObj.subject = objKey[2]
317
            that.formObj.qualification = objKey[3]
318
            that.formObj.fieldOfSupplier = objKey[4]
319
            that.formObj.fieldOfCustomer = objKey[5]
320
          }
321
        })
322
      },
323
      submitForm(formName) {
324
        var that = this
325
        that.$refs[formName].validate((valid) => {
326
          if (valid) {
327
            const form = that.formObj
328
            const paramsData = {
329
              id: that.companyId,
330
              name: form.name,
331
              logo: form.logo,
332
              type: form.type,
333
              size: form.size,
334
              foundYear: form.foundYear,
335
              descp: form.descp,
336
              url: form.url,
337
              addr: form.addr,
338
              location: form.location,
339
              zipCode: form.zipCode,
340
              servicePhone: form.servicePhone,
341
              serviceEmail: form.serviceEmail,
342
              operateTime: form.operateTime,
343
              linkman: form.linkman,
344
              linkphone: form.linkphone,
345
              linkemail: form.linkemail,
346
              industry: JSON.stringify(form.industry),
347
              subject: JSON.stringify(form.subject),
348
              qualification: JSON.stringify(form.qualification),
349
              fieldOfSupplier: JSON.stringify(form.fieldOfSupplier),
350
              fieldOfCustomer: JSON.stringify(form.fieldOfCustomer)
351
            }
352
            that.$axios.put('/ajax/company/update', paramsData, function(res) {
353
            if (res.success) {
354
                that.$message({
355
                message: '企业信息修改成功',
356
                type: 'success'
357
                })
358
            }
359
            })
360
          } else {
361
            return false
362
          }
363
        })
364
      },
365
      turnIndustryTags(msg) {
366
        this.formObj.industry = msg
367
      },
368
      turnSubjectTags(msg) {
369
        this.formObj.subject = msg
370
      },
371
      turnProveTags(msg) {
372
        this.formObj.qualification = msg
373
      },
374
      turnSubjectGTags(msg) {
375
        this.formObj.fieldOfSupplier = msg
376
      },
377
      turnSubjectCTags(msg) {
378
        this.formObj.fieldOfCustomer = msg
379
      },
380
      uploadfun(value) {
381
        this.formObj.logo = value
382
      },
383
      toshow(value) {
384
        this.formObj.addr = value
385
      }
386
    }
387
  }
388
</script>
389
<style lang="scss">
390
  .el-date-editor.el-input, .el-date-editor.el-input__inner{
391
    width:100%;
392
  }
393
</style>

+ 155 - 1
src/pages/center/views/myBusiness/companyProduct.vue

@ -1 +1,155 @@
1
<template> <div>企业产品</div></template>
1
<template>
2
  <div class="newsmMain">
3
    <div class="newsRight">
4
      <el-tabs v-model="activeName">
5
        <el-tab-pane label="企业产品" name="first">
6
          <div class="search-wrapper" align="right">
7
            <el-button type="primary" icon="el-icon-edit" @click="handerAdd">发布产品</el-button>
8
          </div>
9
          <div class="con-box" v-loading="tableLoading">
10
            <div class="con-item" v-if="platProducts.length" v-for="item in platProducts" :key="item.index">
11
              <baseProduct :itemSingle="item" :showTime="true"></baseProduct>
12
              <div class="dele">
13
                <el-button type="primary" size="mini" @click.stop="handerUpdate(item.id)">修改</el-button>
14
                <el-button type="danger" size="mini" @click.stop="handerDel(item.id)">删除</el-button>
15
              </div>
16
            </div>
17
            <div class="pagination-container">
18
              <el-pagination
19
                background
20
                @current-change="handleCurrentChange"
21
                :current-page.sync="pageNo"
22
                :page-size="pageSize"
23
                layout="prev, pager, next, jumper"
24
                :total="total">
25
              </el-pagination>
26
            </div>
27
          </div>
28
        </el-tab-pane>
29
      </el-tabs>
30
    </div>
31
    <publishProduct ref="publishProduct" :operateM="operateM" @dialogChanged="dialogChanged"></publishProduct>
32
    <BackTop></BackTop>
33
  </div>
34
</template>
35
36
<script>
37
  import { mapGetters } from 'vuex';
38
  import { TimeTr } from '@/libs/util'
39
  import publishProduct from './publishProduct.vue';
40
  import baseProduct from '@/components/subTemplate/BaseProduct.vue';
41
42
  export default {
43
    data() {
44
      return {
45
        activeName: 'first',
46
        operateM: {},
47
        pageSize: 10,
48
        pageNo: 1,
49
        total: 0,
50
        platProducts: [],
51
        tableLoading: true
52
      };
53
    },
54
    components: {
55
      baseProduct,
56
      publishProduct
57
    },
58
    computed: {
59
      ...mapGetters([
60
        'bindCompany'
61
      ])
62
    },
63
    created() {
64
      this.getProductlist();
65
    },
66
    methods: {
67
      getProductlist() {
68
        var that = this
69
        this.$axios.get('/ajax/product/pq', {
70
          companyId: that.bindCompany,
71
          pageSize: that.pageSize,
72
          pageNo: that.pageNo
73
        }, function(res) {
74
          that.tableLoading = false
75
          if (res.success && res.data) {
76
            const obj = res.data.data
77
            if (obj.length > 0) {
78
              for (let i = 0; i < obj.length; ++i) {
79
                if (obj[i].createTime) {
80
                  obj[i].createTime = `发布于${TimeTr(obj[i].createTime)}`
81
                }
82
              }
83
              that.total = res.data.total
84
              that.platProducts = obj
85
            } else {
86
              that.pageNo = 1
87
              that.total = 0
88
              that.platProducts = []
89
            }
90
          } else {
91
            that.pageNo = 1
92
            that.total = 0
93
            that.platProducts = []
94
          }
95
        })
96
      },
97
      handleCurrentChange(val) {
98
        this.pageNo = val
99
        this.getProductlist()
100
      },
101
      dialogChanged() {
102
        this.pageNo = 1
103
        this.total = 0
104
        this.platProducts = []
105
        this.getProductlist()
106
      },
107
      handerAdd() {
108
        this.operateM = { tit: '发布产品', cid: this.bindCompany }
109
        this.$refs.publishProduct.parentFun()
110
      },
111
      handerUpdate(id) {
112
        this.operateM = { tit: '修改产品', cid: this.bindCompany }
113
        this.$refs.publishProduct.parentFun(id)
114
      },
115
      handerDel(id) {
116
        var that = this
117
        this.$cofirm('删除后,该产品将不能恢复,您确定要删除吗?', '提示', {
118
          type: 'warning',
119
          center: true
120
        }).then(() => {
121
          that.$axios.post('/ajax/product/delete', {
122
            id: id
123
          }).then((res) => {
124
            if (res.success) {
125
              that.dialogChanged();
126
            }
127
          });
128
        }).catch(() => {});
129
      }
130
    }
131
  };
132
</script>
133
134
<style lang="scss" scoped>
135
  .con-box{
136
    margin: 0 -15px;
137
    .con-item{
138
      position:relative;
139
      cursor: pointer;
140
      &:hover{
141
        background: #EEEEEE;
142
        .dele{
143
          display: block;
144
        }
145
      }
146
      .dele{
147
        display: none;
148
        position: absolute;
149
        right: 20px;
150
        z-index: 20;
151
        top: 40%;
152
      }
153
    }
154
  }
155
</style>

+ 245 - 1
src/pages/center/views/myBusiness/publishProduct.vue

@ -1 +1,245 @@
1
<template> <div>发布产品</div></template>
1
<template>
2
  <el-dialog :title="operateM.tit" :visible.sync="userDialogVisible" width="750px">
3
    <el-form :model="formObj" :rules="rulesObj" ref="formObj" label-width="80px" class="update-wrapper demo-ruleForm">
4
      <el-row :gutter="20" class="update-main">
5
        <el-col :span="24">
6
            <el-form-item label="产品图片" prop="img">
7
            <uploadFile :upImgsStr="formObj.img" :uploadImg="uploadImg" @uploadfun="uploadfun"></uploadFile>
8
            </el-form-item>
9
        </el-col>
10
        <el-col :span="24">
11
            <el-form-item label="产品名称" prop="name">
12
            <el-input v-model="formObj.name" placeholder="请填写产品名称" maxlength="30"></el-input>
13
            </el-form-item>
14
        </el-col>
15
        <el-col :span="24">
16
            <el-form-item label="关键词">
17
            <dynamicTags :dyStr="formObj.keyword" :tagInfo="tagKeyword" v-on:turnTags="turnKeywordTags"></dynamicTags>
18
            </el-form-item>
19
        </el-col>
20
        <el-col :span="24">
21
            <el-form-item label="产品简介" prop="cnt">
22
            <el-input type="textarea" :rows="4" v-model="formObj.cnt" placeholder="请填写产品简介" maxlength="250"></el-input>
23
            </el-form-item>
24
        </el-col>
25
        <el-col :span="24">
26
            <el-form-item label="厂商型号" prop="spec">
27
            <el-input v-model="formObj.spec" placeholder="请填写厂商型号" maxlength="50"></el-input>
28
            </el-form-item>
29
        </el-col>
30
        <el-col :span="12">
31
            <el-form-item label="产地" prop="producingArea">
32
            <el-input v-model="formObj.producingArea" placeholder="请填写产地" maxlength="50"></el-input>
33
            </el-form-item>
34
        </el-col>
35
        <el-col :span="12">
36
            <el-form-item label="官方价格" prop="price">
37
            <el-input v-model="formObj.price" placeholder="请填写官方价格" maxlength="50"></el-input>
38
            </el-form-item>
39
        </el-col>
40
        <el-col :span="24">
41
            <el-form-item label="性能参数" prop="parameter">
42
            <el-input type="textarea" :rows="6" v-model="formObj.parameter" placeholder="请填写产品简介" maxlength="1000"></el-input>
43
            </el-form-item>
44
        </el-col>
45
        <el-col :span="24">
46
            <el-form-item label="详情描述" prop="descp">
47
            <el-input type="textarea" :rows="8" v-model="formObj.descp" placeholder="请填写产品详情" maxlength="5000"></el-input>
48
            </el-form-item>
49
        </el-col>
50
        <el-col :span="24" class="el-btn-col">
51
          <el-form-item class="el-btn-col-box">
52
            <el-button type="primary" @click="submitForm('formObj')">保存</el-button>
53
          </el-form-item>
54
        </el-col>
55
      </el-row>
56
    </el-form>
57
  </el-dialog>
58
</template>
59
60
<script>
61
  import cityPicker from '@/components/CityPicker'
62
  import dynamicTags from '@/components/DynamicTags'
63
  import uploadFile from '@/components/uploadFile'
64
65
  export default {
66
    props: ['operateM'],
67
    data() {
68
      return {
69
        userDialogVisible: false,
70
        companyId: '',
71
        productId: '',
72
        tagKeyword: {
73
          lableTit: '关键词',
74
          placeholder: '请填写相关的关键词,如:腐蚀防护、石墨烯、纳米材料',
75
          limitCount: 10,
76
          tagsNum: 5
77
        },
78
        formLoading: true,
79
        formObj: {
80
          name: '',
81
          img: '',
82
          logo: '',
83
          cnt: '',
84
          descp: '',
85
          spec: '',
86
          producingArea: '',
87
          price: '',
88
          parameter: '',
89
          createTime: '',
90
          keyword: []
91
        },
92
        rulesObj: {
93
          img: [{ required: true, message: '请输入产品图片', trigger: 'blur' }],
94
          name: [{ required: true, message: '请输入产品名称', trigger: 'blur' }],
95
          cnt: [{ required: true, message: '请输入产品简介', trigger: 'blur' }]
96
        },
97
        uploadImg: {
98
          url: '/ajax/product/logo',
99
          tip: '上传产品图片',
100
          width: '200px',
101
          height: '200px',
102
          limit: 3
103
        }
104
      }
105
    },
106
    components: {
107
      dynamicTags,
108
      cityPicker,
109
      uploadFile
110
    },
111
    watch: {
112
      userDialogVisible(val) {
113
        !val && setTimeout(() => {
114
          this.$refs['formObj'].resetFields()
115
          this.$refs['formObj'].clearValidate()
116
        }, 0)
117
      }
118
    },
119
    methods: {
120
      parentFun(id) {
121
        var that = this
122
        if (id) {
123
          this.productId = id
124
          this.getProductInfo(id)
125
          this.getProductKeyword()
126
        } else {
127
          this.formObj = {
128
            name: '',
129
            img: '',
130
            logo: '',
131
            cnt: '',
132
            descp: '',
133
            spec: '',
134
            producingArea: '',
135
            price: '',
136
            parameter: '',
137
            createTime: '',
138
            keyword: []
139
          }
140
        }
141
        setTimeout(function() {
142
          that.userDialogVisible = true
143
        }, 0)
144
      },
145
      getProductInfo() {
146
        var that = this
147
        that.$axios.get('/ajax/product/qo', {
148
          id: that.productId
149
        }, function(res) {
150
          that.formLoading = false
151
          if (res.success) {
152
            const obj = res.data
153
              that.formObj = {
154
              name: obj.name,
155
              img: obj.img,
156
              logo: obj.logo,
157
              cnt: obj.cnt,
158
              descp: obj.descp,
159
              spec: obj.spec,
160
              producingArea: obj.producingArea,
161
              price: obj.price,
162
              parameter: obj.parameter,
163
              createTime: obj.createTime
164
            }
165
          }
166
        })
167
      },
168
      getProductKeyword() {
169
        var that = this
170
        that.$axios.get('/ajax/product/qo/keyword', {
171
          id: that.productId
172
        }, function(res) {
173
          if (res.success && res.data) {
174
            const str = res.data
175
            var objKey = []
176
            if (str.length > 0) {
177
              str.map(item => {
178
                objKey.push(item.keyword)
179
              })
180
            }
181
            that.formObj.keyword = objKey
182
          }
183
        })
184
      },
185
      submitForm(formName) {
186
        var that = this
187
        that.$refs[formName].validate((valid) => {
188
          if (valid) {
189
            const form = that.formObj
190
            const paramsData = {
191
              companyId: that.operateM.cid,
192
              name: form.name,
193
              img: form.img,
194
              logo: form.logo,
195
              cnt: form.cnt,
196
              spec: form.spec,
197
              descp: form.descp,
198
              producingArea: form.producingArea,
199
              price: form.price,
200
              parameter: form.parameter,
201
              keyword: JSON.stringify(form.keyword)
202
            }
203
            if (that.productId) {
204
              const paramsId = { id: that.productId }
205
              const obj = Object.assign(paramsId, paramsData)
206
              that.$axios.put('/ajax/product/update', obj, function(res) {
207
                if (res.success) {
208
                  that.$message({
209
                    message: '修改成功',
210
                    type: 'success'
211
                  })
212
                  setTimeout(function() {
213
                    that.userDialogVisible = false
214
                    that.$parent.getProductlist()
215
                  }, 0)
216
                }
217
              })
218
            } else {
219
              that.$axios.post('/ajax/product/insert', paramsData, function(res) {
220
                if (res.success) {
221
                  that.$message({
222
                    message: '发布成功',
223
                    type: 'success'
224
                  })
225
                  setTimeout(function() {
226
                    that.userDialogVisible = false
227
                    that.$parent.getProductlist()
228
                  }, 0)
229
                }
230
              })
231
            }
232
          } else {
233
            return false
234
          }
235
        })
236
      },
237
      turnKeywordTags(msg) {
238
        this.formObj.keyword = msg
239
      },
240
      uploadfun(value) {
241
        this.formObj.img = value
242
      }
243
    }
244
  }
245
</script>

+ 23 - 0
src/pages/center/views/myBusiness/sty.scss

@ -0,0 +1,23 @@
1
2
    .content-container{
3
      background:#ffffff;
4
      overflow:hidden;
5
      .operate-row{
6
        .el-button{
7
          width:70px;
8
          padding:6px;
9
          margin:5px;
10
        }
11
      }
12
      .contain-select{
13
        margin-bottom:15px;
14
        float:right;
15
        span{
16
          font-size:15px;
17
          color:#999;
18
        }
19
        .el-select{
20
          width: 120px;
21
        }
22
      }
23
    }

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

@ -20,6 +20,9 @@
20 20
      TheHeader,
21 21
      TheFooter,
22 22
      showTemplate
23
    },
24
    mounted() {
25
      sessionStorage.setItem('isSelect', 'comp')
23 26
    }
24 27
  };
25 28
</script>

+ 35 - 20
src/pages/company/show.vue

@ -21,14 +21,14 @@
21 21
      <div class="wrapper-left left-main">
22 22
        <el-tabs v-model="activeName">
23 23
          <el-tab-pane label="主页" name="first">
24
            <div class="content-wrapper split-other" v-if="platProducts.length">
24
            <div class="content-wrapper split-other" v-if="platThreeProducts && platThreeProducts.length">
25 25
              <div class="inner-wrapper">
26 26
                <div class="content-title">
27 27
                  <span>我们的产品</span>
28 28
                  <span class="content-more" @click="activeName='second'">更多</span>
29 29
                </div>
30
                <div>
31
                  <baseProduct v-if="platProducts.length" v-for="item in platProducts" :key="item.index" :itemSingle="item"></baseProduct>
30
                <div class="content content-nf">
31
                  <baseProduct v-if="platThreeProducts.length" v-for="item in platThreeProducts" :key="item.index" :itemSingle="item"></baseProduct>
32 32
                </div>
33 33
              </div>
34 34
            </div>
@ -110,7 +110,7 @@
110 110
        </el-tabs>
111 111
      </div>
112 112
      <div class="wrapper-right">
113
        <div class="content-wrapper" v-if="compContents">
113
        <div class="content-wrapper" v-if="compContents && compContents.length">
114 114
          <div class="content-title">
115 115
            <span>相关文章</span>
116 116
          </div>
@ -129,7 +129,7 @@
129 129
</template>
130 130
131 131
<script>
132
  import util from '@/libs/util';
132
  import { urlParse, defaultSet } from '@/libs/util';
133 133
  import queryDict from '@/libs/queryDict';
134 134
135 135
  import shareOut from '@/components/ShareOut';
@ -141,16 +141,14 @@
141 141
        activeName: 'first',
142 142
        orgInfo: '',
143 143
        elurl: '',
144
        pageSize: 30,
144
        pageSize: 10,
145 145
        pageNo: 1,
146 146
        total: 0,
147 147
        keywordObj: [],
148 148
        numRanger: [],
149 149
        compType: [],
150 150
        citys: [],
151
        // platProductsThree: [],
152 151
        platProducts: [],
153
        platResources: [],
154 152
        loadingModalShow: true,
155 153
        loadingComplete: false,
156 154
        isFormSearch: false,
@ -160,7 +158,7 @@
160 158
      };
161 159
    },
162 160
    created() {
163
      this.companyId = util.urlParse('id');
161
      this.companyId = urlParse('id');
164 162
      this.elurl = window.location.href;
165 163
      this.getDictoryData();
166 164
      this.getorgInfo();
@ -168,6 +166,20 @@
168 166
      this.getProductlist();
169 167
      this.getCompContent();
170 168
    },
169
    computed: {
170
      platThreeProducts() {
171
        var pt = this.platProducts
172
        var str = []
173
        if (pt.length > 3) {
174
          for (let i = 0; i < 3; ++i) {
175
            str[i] = pt[i]
176
          }
177
        } else {
178
          str = pt
179
        }
180
        return str
181
      }
182
    },
171 183
    components: {
172 184
      shareOut,
173 185
      baseProduct
@ -198,7 +210,7 @@
198 210
          if (res.success) {
199 211
            const obj = res.data
200 212
            if (obj.logo === '') {
201
              obj.logo = util.defaultSet.img.org
213
              obj.logo = defaultSet.img.org
202 214
            }
203 215
            this.orgInfo = obj
204 216
          };
@ -233,24 +245,27 @@
233 245
          pageSize: that.pageSize,
234 246
          pageNo: that.pageNo
235 247
        }, function(res) {
236
          if (res.success && res.data !== []) {
248
          if (res.success && res.data) {
237 249
            const obj = res.data.data
238 250
            if (obj.length > 0) {
239 251
              that.isFormSearch = true;
240 252
              that.total = res.data.total;
241
              // if (that.pageNo === 1) {
242
              //   that.platProductsThree = obj;
243
              // }
244 253
              that.platProducts = that.platProducts.concat(obj);
254
              if (obj.length < that.pageSize) {
255
                that.loadingModalShow = false;
256
                that.isFormSearch = false;
257
              };
258
            } else {
259
              this.loadingModalShow = false;
260
              this.isFormSearch = false;
245 261
            };
246
            var liLen = this.platProducts.length;
262
            var liLen = that.platProducts.length;
247 263
            if (obj.length === 0 && liLen === 0) {
248
              this.ifDefault = true;
249
            };
250
            if (obj.length < that.pageSize) {
251
              that.loadingModalShow = false;
252
              that.isFormSearch = false;
264
              that.ifDefault = true;
253 265
            };
266
          } else {
267
            that.loadingModalShow = false;
268
            that.isFormSearch = false;
254 269
          }
255 270
        })
256 271
      },

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

@ -20,6 +20,9 @@
20 20
      TheHeader,
21 21
      TheFooter,
22 22
      showTemplate
23
    },
24
    mounted() {
25
      sessionStorage.setItem('isSelect', 'trends')
23 26
    }
24 27
  };
25 28
</script>

+ 23 - 17
src/pages/content/show.vue

@ -7,11 +7,9 @@
7 7
            <div class="headcon-box detail-box">
8 8
              <div class="show-info">
9 9
                <div class="info-tit info-tit-big">{{contentInfo.title}}</div>
10
                <div class="info-operate zoom-operate">
11
                  <ul class="list-tag">
12
                    <li>{{contentInfo.modifyTime}}</li>
13
                    <li>作者/来源:{{contentInfo.source}}</li>
14
                  </ul>
10
                <div class="info-tag">
11
                  <span>{{contentInfo.modifyTime}}</span>
12
                  <span>作者/来源:{{contentInfo.source}}</span>
15 13
                </div>
16 14
              </div>
17 15
            </div>
@ -19,7 +17,7 @@
19 17
          <div class="inner-wrapper">
20 18
            <div class="content" v-html="contentInfo.cnt"></div>
21 19
          </div>
22
          <div class="inner-wrapper" v-if="platExperts">
20
          <div class="inner-wrapper" v-if="platExperts && platExperts.length">
23 21
            <div class="content-title">
24 22
              <span>相关专家</span>
25 23
            </div>
@ -27,7 +25,7 @@
27 25
              <baseExpert v-for="item in platExperts" :key="item.index" :itemSingle="item"></baseExpert>
28 26
            </div>
29 27
          </div>
30
          <div class="inner-wrapper" v-if="platOrgs">
28
          <div class="inner-wrapper" v-if="platOrgs && platOrgs.length">
31 29
            <div class="content-title">
32 30
              <span>相关机构</span>
33 31
            </div>
@ -35,7 +33,7 @@
35 33
              <baseOrg v-for="item in platOrgs" :key="item.index" :itemSingle="item"></baseOrg>
36 34
            </div>
37 35
          </div>
38
          <div class="inner-wrapper" v-if="platCompanys">
36
          <div class="inner-wrapper" v-if="platCompanys && platCompanys.length">
39 37
            <div class="content-title">
40 38
              <span>相关企业</span>
41 39
            </div>
@ -47,7 +45,7 @@
47 45
      </div>
48 46
      <div class="wrapper-right">
49 47
        <div class="wrapper-right">
50
          <div class="block-wrapper" v-if="plat.adinfo.length" v-for="item in plat.adinfo" :key="item.index">
48
          <div class="block-wrapper" v-if="adinfo.length" v-for="item in adinfo" :key="item.index">
51 49
            <a class="ad-wrapper" :href="item.adUrl" target="_blank">
52 50
              <img :src="item.imgUrl" width="280" height="200">
53 51
            </a>
@ -60,20 +58,17 @@
60 58
</template>
61 59
62 60
<script>
63
  import util from '@/libs/util';
61
  import { urlParse, commenTime } from '@/libs/util';
64 62
65 63
  import baseExpert from '@/components/subTemplate/BaseExpert';
66 64
  import baseCompany from '@/components/subTemplate/BaseCompany';
67 65
  import baseOrg from '@/components/subTemplate/BaseOrg';
68 66
69 67
  export default {
70
    props: {
71
      plat: {
72
        type: Object
73
      }
74
    },
75 68
    data() {
76 69
      return {
70
        /* eslint-disable no-undef */
71
        adinfo: PLAT.info.adinfo,
77 72
        contentInfo: '',
78 73
        platExperts: '',
79 74
        platOrgs: '',
@ -81,7 +76,7 @@
81 76
      };
82 77
    },
83 78
    created() {
84
      this.contentId = util.urlParse('id');
79
      this.contentId = urlParse('id');
85 80
      this.getContentInfo();
86 81
      this.getPlatExperts();
87 82
      this.getPlatOrgs();
@ -100,7 +95,7 @@
100 95
          if (res.success) {
101 96
            var $info = res.data;
102 97
            if ($info.modifyTime) {
103
              $info.modifyTime = util.commenTime($info.modifyTime, true)
98
              $info.modifyTime = commenTime($info.modifyTime, true)
104 99
            }
105 100
            this.contentInfo = $info;
106 101
          };
@ -139,3 +134,14 @@
139 134
    }
140 135
  };
141 136
</script>
137
138
<style lang="scss" scoped>
139
  .info-tag{
140
    span{
141
      display: inline-block;
142
      margin-right:15px;
143
      color: #999;
144
      font-size: 14px;
145
    }
146
  }
147
</style>

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

@ -20,6 +20,9 @@
20 20
      TheHeader,
21 21
      TheFooter,
22 22
      showTemplate
23
    },
24
    mounted() {
25
      sessionStorage.setItem('isSelect', 'exp')
23 26
    }
24 27
  };
25 28
</script>

+ 67 - 31
src/pages/expert/show.vue

@ -12,9 +12,9 @@
12 12
              <shareOut :tUrl="elurl"></shareOut>
13 13
            </div>
14 14
          </div>
15
          <el-row class="goSpan">
16
            <el-button type="primary" icon="el-icon-plus">关注</el-button>
17
            <el-button type="primary">联系</el-button>
15
          <el-row class="goSpan" :gutter="10">
16
            <el-col :span="12"><collectCo :watchOptions="{oid: expertId, type: 1}"></collectCo></el-col>
17
            <!-- <el-col :span="12"><el-button type="primary">联系</el-button></el-col> -->
18 18
          </el-row>
19 19
        </div>
20 20
      </div>
@ -23,14 +23,14 @@
23 23
      <div class="wrapper-left left-main">
24 24
        <el-tabs v-model="activeName">
25 25
          <el-tab-pane label="主页" name="first">
26
            <div class="content-wrapper split-other" v-if="platServices.length">
26
            <div class="content-wrapper split-other" v-if="platThreeServices && platThreeServices.length">
27 27
              <div class="inner-wrapper">
28 28
                <div class="content-title">
29 29
                  <span>可提供服务</span>
30 30
                  <span class="content-more" @click="activeName='second'">更多</span>
31 31
                </div>
32
                <div class="content">
33
                  <baseService v-if="platServices.length" v-for="item in platServices" :key="item.index" :itemSingle="item"></baseService>
32
                <div class="content content-nf">
33
                  <baseService v-if="platThreeServices.length" v-for="item in platThreeServices" :key="item.index" :itemSingle="item"></baseService>
34 34
                </div>
35 35
              </div>
36 36
            </div>
@ -73,13 +73,13 @@
73 73
                  </el-row>
74 74
                </div>
75 75
              </div>
76
              <div class="inner-wrapper" v-if="platPatents.lnegth">
76
              <div class="inner-wrapper" v-if="platOnePatents && platOnePatents.lnegth">
77 77
                <div class="content-title">
78 78
                  <span>专利</span>
79 79
                  <span class="content-more" @click="activeName='third'">更多</span>
80 80
                </div>
81 81
                <div class="content">
82
                  <baseResult v-if="platPatents.length" v-for="item in platPatents" :key="item.index" :itemSingle="item"></baseResult>
82
                  <baseResult v-if="platOnePatents.length" v-for="item in platOnePatents" :key="item.index" :itemSingle="item"></baseResult>
83 83
                </div>
84 84
              </div>
85 85
            </div>
@ -155,7 +155,7 @@
155 155
        </el-tabs>
156 156
      </div>
157 157
      <div class="wrapper-right">
158
        <div class="content-wrapper" v-if="coopExperts">
158
        <div class="content-wrapper" v-if="coopExperts && coopExperts.length">
159 159
          <div class="content-title">
160 160
            <span>合作专家</span>
161 161
          </div>
@ -170,7 +170,7 @@
170 170
            </a>
171 171
          </div>
172 172
        </div>
173
        <div class="content-wrapper" v-if="expContents">
173
        <div class="content-wrapper" v-if="expContents && expContents.length">
174 174
          <div class="content-title">
175 175
            <span>相关文章</span>
176 176
          </div>
@ -182,7 +182,7 @@
182 182
            </div>
183 183
          </div>
184 184
        </div>
185
        <div class="content-wrapper" v-if="likeExperts">
185
        <div class="content-wrapper" v-if="likeExperts && likeExperts.length">
186 186
          <div class="content-title">
187 187
            <span>您可能感兴趣的专家</span>
188 188
          </div>
@ -203,10 +203,11 @@
203 203
</template>
204 204
205 205
<script>
206
  import util from '@/libs/util';
206
  import { urlParse, ImageUrl, defaultSet, strToArr, formatOfft, autho } from '@/libs/util';
207 207
  import queryBase from '@/libs/queryBase';
208 208
209 209
  import shareOut from '@/components/ShareOut';
210
  import collectCo from '@/components/CollectCo';
210 211
  import baseService from '@/components/subTemplate/BaseService';
211 212
  import baseResult from '@/components/subTemplate/BaseResult';
212 213
@ -216,6 +217,7 @@
216 217
        activeIndex: '1',
217 218
        activeName: 'first',
218 219
        expertInfo: '',
220
        expertId: '',
219 221
        elurl: '',
220 222
        platServices: [],
221 223
        serCount: 0,
@ -243,7 +245,7 @@
243 245
      };
244 246
    },
245 247
    created() {
246
      this.expertId = util.urlParse('id');
248
      this.expertId = urlParse('id');
247 249
      this.elurl = window.location.href;
248 250
      this.getExpertInfo();
249 251
      this.getExpertWave();
@ -253,8 +255,35 @@
253 255
      this.getLikeExperts();
254 256
      this.getCoopExperts();
255 257
    },
258
    computed: {
259
      platThreeServices() {
260
        var pt = this.platServices
261
        var str = []
262
        if (pt.length > 3) {
263
          for (let i = 0; i < 3; ++i) {
264
            str[i] = pt[i]
265
          }
266
        } else {
267
          str = pt
268
        }
269
        return str
270
      },
271
      platOnePatents() {
272
        var pt = this.platPatents
273
        var str = []
274
        if (pt.length > 1) {
275
          for (let i = 0; i < 1; ++i) {
276
            str[i] = pt[i]
277
          }
278
        } else {
279
          str = pt
280
        }
281
        return str
282
      }
283
    },
256 284
    components: {
257 285
      shareOut,
286
      collectCo,
258 287
      baseService,
259 288
      baseResult
260 289
    },
@ -264,17 +293,17 @@
264 293
        }, (res) => {
265 294
          if (res.success) {
266 295
            var $info = res.data;
267
            $info.offt = util.formatOfft($info);
296
            $info.offt = formatOfft($info);
268 297
            if ($info.subject) {
269
              $info.subject = util.strToArr($info.subject);
298
              $info.subject = strToArr($info.subject);
270 299
            }
271 300
            if ($info.industry) {
272
              $info.industry = util.strToArr($info.industry);
301
              $info.industry = strToArr($info.industry);
273 302
            }
274 303
            if ($info.hasHeadImage) {
275
              $info.img = util.ImageUrl(('head/' + $info.id + '_l.jpg'), true)
304
              $info.img = ImageUrl(('head/' + $info.id + '_l.jpg'), true)
276 305
            } else {
277
              $info.img = util.defaultSet.img.expert
306
              $info.img = defaultSet.img.expert
278 307
            }
279 308
            $info.resAreas = [];
280 309
            if ($info.researchAreas && $info.researchAreas.length > 0) {
@ -299,15 +328,18 @@
299 328
              this.dataO.serModifyTime = $info[$info.length - 1].modifyTime;
300 329
              this.platServices = this.isFormSearch ? this.platServices.concat($info) : $info;
301 330
              this.isFormSearch = true;
331
              if ($info.length < this.rows) {
332
                this.loadingModalShow = false;
333
                this.isFormSearch = false;
334
              };
335
            } else {
336
              this.loadingModalShow = false;
337
              this.isFormSearch = false;
302 338
            };
303 339
            var liLen = this.platServices.length;
304 340
            if ($info.length === 0 && liLen === 0) {
305 341
              this.ifDefault = true;
306 342
            };
307
            if ($info.length < this.rows) {
308
              this.loadingModalShow = false;
309
              this.isFormSearch = false;
310
            };
311 343
          };
312 344
        });
313 345
      },
@ -330,15 +362,19 @@
330 362
              this.dataO.patId = $info[$info.length - 1].id;
331 363
              this.platPatents = this.isFormSearch2 ? this.platPatents.concat($info) : $info;
332 364
              this.isFormSearch2 = true;
365
              if ($info.length < this.rows) {
366
                this.loadingModalShow2 = false;
367
                this.isFormSearch2 = false;
368
              };
369
            } else {
370
              this.loadingModalShow2 = false;
371
              this.isFormSearch2 = false;
333 372
            };
334 373
            var liLen = this.platPatents.length;
335 374
            if ($info.length === 0 && liLen === 0) {
336 375
              this.ifDefault2 = true;
337 376
            };
338
            if ($info.length < this.rows) {
339
              this.loadingModalShow2 = false;
340
              this.isFormSearch2 = false;
341
            };
377
            
342 378
          };
343 379
        });
344 380
      },
@ -372,7 +408,7 @@
372 408
        });
373 409
      },
374 410
      headIcon(item) {
375
        return util.autho(item.authType, item.orgAuth, item.authStatus);
411
        return autho(item.authType, item.orgAuth, item.authStatus);
376 412
      },
377 413
      getExpContent() {
378 414
        var that = this
@ -414,9 +450,9 @@
414 450
                      str.name = value.name
415 451
                      str.title = value.title
416 452
                      if (str.hasHeadImage) {
417
                        str.img = util.ImageUrl(('head/' + value.id + '_l.jpg'), true)
453
                        str.img = ImageUrl(('head/' + value.id + '_l.jpg'), true)
418 454
                      } else {
419
                        str.img = util.defaultSet.img.expert
455
                        str.img = defaultSet.img.expert
420 456
                      }
421 457
                      that.$forceUpdate()
422 458
                    }
@ -443,9 +479,9 @@
443 479
                      str.name = value.name
444 480
                      str.title = value.title
445 481
                      if (str.hasHeadImage) {
446
                        str.img = util.ImageUrl(('head/' + value.id + '_l.jpg'), true)
482
                        str.img = ImageUrl(('head/' + value.id + '_l.jpg'), true)
447 483
                      } else {
448
                        str.img = util.defaultSet.img.expert
484
                        str.img = defaultSet.img.expert
449 485
                      }
450 486
                      that.$forceUpdate()
451 487
                    }

+ 0 - 14
src/pages/index/index.js

@ -4,26 +4,12 @@ import App from './index.vue';
4 4
import router from './router';
5 5
import store from '@/store/index';
6 6
7
import Cookies from 'js-cookie';
8
9 7
/* eslint-disable no-new */
10 8
new Vue({
11 9
  el: '#app',
12 10
  router: router,
13 11
  store: store,
14 12
  render: h => h(App),
15
  data() {
16
    return {
17
      plat: {}
18
    };
19
  },
20
  mounted() {
21
    /* eslint-disable no-undef */
22
    this.plat = PLAT.info;
23
    document.title = this.plat.title;
24
    Cookies.set('platId', process.env.PLAT_ID);
25
    Cookies.set('platSource', this.plat.source);
26
  },
27 13
  created () {
28 14
    router.afterEach((to, from, next) => {
29 15
      window.scrollTo(0, 0);

+ 1 - 24
src/pages/index/index.vue

@ -1,32 +1,9 @@
1 1
<template>
2 2
  <div class="app-main">
3
      <router-view v-if="isRouterAlive"></router-view>
3
      <router-view></router-view>
4 4
  </div>
5 5
</template>
6 6
7
<script>
8
  export default {
9
    provide() {
10
      return {
11
        reload: this.reload
12
      };
13
    },
14
    data() {
15
      return {
16
        isRouterAlive: true
17
      };
18
    },
19
    methods: {
20
      reload() {
21
        this.isRouterAlive = false;
22
        this.$nextTick(function() {
23
          this.isRouterAlive = true;
24
        });
25
      }
26
    }
27
  };
28
</script>
29
30 7
<style rel="stylesheet/scss" lang="scss" scoped>
31 8
  .app-main{
32 9
    width: 100%;

+ 28 - 34
src/pages/index/views/Dashboard/index.vue

@ -20,7 +20,7 @@
20 20
        <!-- <div class="video-mask" @click="showVideo">
21 21
          <img src="./img/video.png" width="80">
22 22
        </div> -->
23
        <img :src="plat.platimgurl" width="800" height="280">
23
        <img :src="platimgurl" width="800" height="280">
24 24
      </div>
25 25
      <div class="wrapper-right content-wrapper">
26 26
        <h3 class="info-main">
@ -77,7 +77,7 @@
77 77
      <div class="wrapper-right content-wrapper about-us">
78 78
        <div class="content-title">
79 79
          <span>关于我们</span>
80
          <router-link class="content-more" to="/about">更多</router-link>
80
          <router-link class="content-more" to="about">更多</router-link>
81 81
        </div>
82 82
        <div class="content">{{aboutUs}}</div>
83 83
      </div>
@ -95,7 +95,7 @@
95 95
          </div>
96 96
          <div class="content-more">
97 97
            <!-- <router-link class="item-more" v-for="item in 4" :key="item" to="">咨询服务</router-link> -->
98
            <router-link class="item-more" to="/findServe">更多</router-link>
98
            <router-link class="item-more" to="serve">更多</router-link>
99 99
          </div>
100 100
        </div>
101 101
        <div class="swiper-container" ref="findService">
@ -134,12 +134,12 @@
134 134
        </div>
135 135
        <div class="swiper-container" ref="findResource">
136 136
          <div class="swiper-wrapper">
137
            <a class="swiper-slide" v-for="item in platResources" :key="item.index" :href="'resource.html?id='+item.id" target="_blank">
137
            <a class="swiper-slide" v-for="item in platResources" :key="item.index" :href="'resource.html?id='+item.resourceId" target="_blank">
138 138
              <div class="item-block" >
139 139
                <div class="item-pic" :style="{backgroundImage: 'url(' + item.img + ')'}"></div>
140 140
                <div class="item-text">
141
                  <p class="title">{{item.name}}</p>
142
                  <p class="desc">{{item.cnt}}</p>
141
                  <p class="title">{{item.resourceName}}</p>
142
                  <p class="desc">{{item.supportedServices}}</p>
143 143
                  <p class="owner">{{item.ownerName}}</p>
144 144
                </div>
145 145
              </div>
@ -175,8 +175,7 @@
175 175
</template>
176 176
177 177
<script>
178
  import Cookies from 'js-cookie';
179
  import util from '@/libs/util';
178
  import { commenTime, defaultSet, ImageUrl, strToArr } from '@/libs/util';
180 179
  import queryBase from '@/libs/queryBase';
181 180
182 181
  import Swiper from 'swiper';
@ -188,13 +187,10 @@
188 187
  // import demandIssueLogin from '../form-views/DemandIssueLogin';
189 188
190 189
  export default {
191
    props: {
192
      plat: {
193
        type: Object
194
      }
195
    },
196 190
    data() {
197 191
      return {
192
        /* eslint-disable no-undef */
193
        platimgurl: PLAT.info.platimgurl,
198 194
        activeName: '1',
199 195
        conCatalog: [
200 196
          {
@ -214,7 +210,6 @@
214 210
            tit: '通知公告'
215 211
          }
216 212
        ],
217
        platId: '',
218 213
        rows: 20,
219 214
        orgTrends: '',
220 215
        paltNews: '',
@ -229,7 +224,6 @@
229 224
      };
230 225
    },
231 226
    created() {
232
       this.platId = Cookies.get('platId');
233 227
       this.getAboutUs();
234 228
       this.queryPaltNews();
235 229
       this.queryResidentComps();
@ -237,6 +231,7 @@
237 231
       this.queryPlatWares();
238 232
    },
239 233
    mounted() {
234
      sessionStorage.setItem('isSelect', '0')
240 235
      this.latestCmpSwiper = new Swiper(this.$refs.latestCmp, {
241 236
        slidesPerView: 3.6,
242 237
        spaceBetween: 20,
@ -306,7 +301,7 @@
306 301
            var $info = res.data.data;
307 302
            for (let i = 0; i < $info.length; ++i) {
308 303
              if ($info[i].modifyTime) {
309
                $info[i].modifyTime = util.commenTime($info[i].modifyTime, true)
304
                $info[i].modifyTime = commenTime($info[i].modifyTime, true)
310 305
              }
311 306
            }
312 307
            that.paltNews = $info;
@ -321,8 +316,8 @@
321 316
          if (res.success) {
322 317
            var $info = res.data.data;
323 318
            for (let i = 0; i < $info.length; ++i) {
324
              if ($info[i].logo === '') {
325
                $info[i].logo = util.defaultSet.img.org
319
              if (!$info[i].logo) {
320
                $info[i].logo = defaultSet.img.org
326 321
              }
327 322
            }
328 323
            this.residentComps = $info;
@ -330,18 +325,17 @@
330 325
        });
331 326
      },
332 327
      queryPlatResources() {
333
        this.$axios.getk('/ajax/platform/info/resources', {
334
          pid: this.platId,
328
        this.$axios.getk('/ajax/resource/index/search', {
335 329
          rows: this.rows
336 330
        }, (res) => {
337 331
          var _this = this;
338 332
          if (res.success) {
339 333
            var $info = res.data;
340 334
            for (let i = 0; i < $info.length; i++) {
341
              if ($info[i].images) {
342
                $info[i].img = util.ImageUrl('resource/' + $info[i].images.split(',')[0])
335
              if ($info[i].images.length > 0) {
336
                $info[i].img = ImageUrl('resource/' + $info[i].images[0].imageSrc)
343 337
              } else {
344
                $info[i].img = util.defaultSet.img.resource
338
                $info[i].img = defaultSet.img.resource
345 339
              }
346 340
              (function(m) {
347 341
                _this.ownerByond($info[m]);
@ -352,8 +346,7 @@
352 346
        });
353 347
      },
354 348
      queryPlatWares() {
355
        this.$axios.getk('/ajax/platform/info/wares', {
356
          pid: this.platId,
349
        this.$axios.getk('/ajax/ware/index/search', {
357 350
          rows: this.rows
358 351
        }, (res) => {
359 352
          var _this = this;
@ -361,9 +354,9 @@
361 354
            var $info = res.data;
362 355
            for (let i = 0; i < $info.length; i++) {
363 356
              if ($info[i].images) {
364
                $info[i].img = util.ImageUrl('ware' + $info.images.split(',')[0])
357
                $info[i].img = ImageUrl('ware' + strToArr($info[i].images)[0])
365 358
              } else {
366
                $info[i].img = util.defaultSet.img.service
359
                $info[i].img = defaultSet.img.service
367 360
              }
368 361
              (function(m) {
369 362
                _this.ownerByond($info[m]);
@ -403,15 +396,16 @@
403 396
          });
404 397
        }
405 398
      },
406
      ownerByond(item, flag) {
399
      ownerByond(item) {
407 400
        var _this = this;
408 401
        var type, id;
409
        if (flag) {
410
          type = item.articleType;
411
          id = item.ownerId;
412
        } else {
413
          type = item.otype;
414
          id = item.oid;
402
        if (item.resourceType) {
403
          type = item.resourceType;
404
          id = item.professorId || item.orgId;
405
        }
406
        if (item.category) {
407
          type = item.category;
408
          id = item.owner;
415 409
        };
416 410
        if (type === '1') {
417 411
          queryBase.getProfessor(id, function(sc, value) {

+ 2 - 2
src/pages/index/views/ViewAboutUs.vue

@ -7,7 +7,7 @@
7 7
</template>
8 8
9 9
<script>
10
  import util from '@/libs/util';
10
  import { getFormatCode } from '@/libs/util';
11 11
12 12
  export default {
13 13
    data() {
@ -22,7 +22,7 @@
22 22
      getAboutUs() {
23 23
        this.$axios.get('/ajax/platform/get', {
24 24
        }, (res) => {
25
          this.aboutUs = util.getFormatCode(res.data.descp);
25
          this.aboutUs = getFormatCode(res.data.descp);
26 26
        });
27 27
      }
28 28
    }

+ 6 - 6
src/pages/index/views/ViewExpertPool/expItem.vue

@ -15,7 +15,7 @@
15 15
</template>
16 16
17 17
<script>
18
  import util from '@/libs/util';
18
  import { formatOfft, ImageUrl, defaultSet, autho } from '@/libs/util';
19 19
  import queryBase from '@/libs/queryBase';
20 20
21 21
  export default {
@ -49,11 +49,11 @@
49 49
                  if (sc) {
50 50
                    var owner = $data[i]
51 51
                    owner.name = value.name
52
                    owner.offt = util.formatOfft(value, true)
52
                    owner.offt = formatOfft(value, true)
53 53
                    if (value.hasHeadImage) {
54
                      owner.img = util.ImageUrl(('head/' + value.id + '_l.jpg'), true)
54
                      owner.img = ImageUrl(('head/' + value.id + '_l.jpg'), true)
55 55
                    } else {
56
                      owner.img = util.defaultSet.img.expert
56
                      owner.img = defaultSet.img.expert
57 57
                    }
58 58
                  }
59 59
                })
@ -84,10 +84,10 @@
84 84
        });
85 85
      },
86 86
      headUrl(item) {
87
        return item.hasHeadImage ? util.ImageUrl(('head/' + item.id + '_l.jpg'), true) : util.defaultSet.img.expert;
87
        return item.hasHeadImage ? ImageUrl(('head/' + item.id + '_l.jpg'), true) : defaultSet.img.expert;
88 88
      },
89 89
      headIcon(item) {
90
        return util.autho(item.authType, item.orgAuth, item.authStatus);
90
        return autho(item.authType, item.orgAuth, item.authStatus);
91 91
      },
92 92
      loadLower() {
93 93
        if (this.loadingModalShow && !this.isLoading) {

+ 38 - 0
src/pages/index/views/ViewFindResource/css.scss

@ -0,0 +1,38 @@
1
.tab-wrapper{
2
  display:flex;
3
  align-items:baseline;
4
  padding:15px 20px;
5
  color: $commonFont;
6
  .tab-lable{
7
    width:100px;
8
  }
9
  .tab-sort{
10
    display:flex;
11
    flex-wrap:wrap;
12
    margin-right:-10px;
13
    margin-bottom:-10px;
14
    li{
15
      display:inline-block;
16
      margin-right:10px;
17
      margin-bottom:10px;
18
      padding:2px 10px;
19
      border: 1px solid $borderColor;
20
      @include border-radius(10px);
21
      cursor: pointer;
22
      &.active{
23
        color: $mainColor;
24
      }
25
    }
26
  }
27
}
28
29
.tab-contain{
30
  margin-top:20px;
31
  background:#fff;
32
}
33
.el-input-group__append{
34
  background:$mainColor;
35
  color:#fff;
36
  padding:10px 40px;
37
  border-color:$mainColor;
38
}

+ 27 - 64
src/pages/index/views/ViewFindResource/index.vue

@ -24,7 +24,7 @@
24 24
      </div>
25 25
    </div>
26 26
    <div class="wrapper-right">
27
      <div class="block-wrapper" v-if="plat.adinfo.length" v-for="item in plat.adinfo" :key="item.index">
27
      <div class="block-wrapper" v-if="adinfo.length" v-for="item in adinfo" :key="item.index">
28 28
        <a class="ad-wrapper" :href="item.adUrl" target="_blank">
29 29
          <img :src="item.imgUrl" width="280" height="200">
30 30
        </a>
@ -35,24 +35,20 @@
35 35
</template>
36 36
37 37
<script>
38
  import Cookies from 'js-cookie';
39
  import util from '@/libs/util';
38
  import { urlParse } from '@/libs/util';
40 39
41 40
  import baseResource from '@/components/subTemplate/BaseResource';
42 41
43 42
  export default {
44
    props: {
45
      plat: {
46
        type: Object
47
      }
48
    },
49 43
    data() {
50 44
      return {
51
        platId: '',
45
        /* eslint-disable no-undef */
46
        adinfo: PLAT.info.adinfo,
52 47
        rows: 20,
53 48
        dataO: {
54
          bShareId: '',
55
          bTime: ''
49
          resSortNum: '',
50
          resTime: '',
51
          resId: ''
56 52
        },
57 53
        keyVal: '',
58 54
        platResources: [],
@ -67,35 +63,38 @@
67 63
      baseResource
68 64
    },
69 65
    created() {
70
      this.platId = Cookies.get('platId');
71
      this.keyVal = util.urlParse('key');
66
      this.keyVal = urlParse('key');
72 67
      this.searchResource();
73 68
    },
74 69
    methods: {
75 70
      searchResource() {
76
        this.$axios.getk('/ajax/platform/info/resources', {
71
        this.$axios.getk('/ajax/resource/index/search', {
77 72
          key: this.keyVal,
78
          pid: this.platId,
79
          shareId: this.dataO.bShareId,
80
          time: this.dataO.bTime,
73
          sortNum: this.dataO.resSortNum,
74
          publishTime: this.dataO.resTime,
75
          id: this.dataO.resId,
81 76
          rows: this.rows
82 77
        }, (res) => {
83 78
          if (res.success) {
84 79
            var $info = res.data;
85 80
            if ($info.length > 0) {
86
              this.dataO.bShareId = $info[$info.length - 1].shareId;
87
              this.dataO.bTime = $info[$info.length - 1].time;
81
              this.dataO.resSortNum = $info[$info.length - 1].sortNum;
82
              this.dataO.resTime = $info[$info.length - 1].publishTime;
83
              this.dataO.resId = $info[$info.length - 1].resourceId;
88 84
              this.platResources = this.isFormSearch ? this.platResources.concat($info) : $info;
89 85
              this.isFormSearch = true;
86
              if ($info.length < this.rows) {
87
                this.loadingModalShow = false;
88
                this.isFormSearch = false;
89
              };
90
            } else {
91
              this.loadingModalShow = false;
92
              this.isFormSearch = false;
90 93
            };
91 94
            var liLen = this.platResources.length;
92 95
            if ($info.length === 0 && liLen === 0) {
93 96
              this.ifDefault = true;
94 97
            };
95
            if ($info.length < this.rows) {
96
              this.loadingModalShow = false;
97
              this.isFormSearch = false;
98
            };
99 98
          };
100 99
        });
101 100
      },
@ -109,8 +108,9 @@
109 108
      },
110 109
      keywordSearch() {
111 110
        if (this.keyVal) {
112
          this.dataO.bShareId = '';
113
          this.dataO.bTime = '';
111
          this.dataO.resSortNum = '';
112
          this.dataO.resTime = '';
113
          this.dataO.resId = '';
114 114
          this.isFormSearch = true;
115 115
          this.loadingModalShow = false;
116 116
          this.loadingComplete = true;
@ -130,43 +130,6 @@
130 130
  };
131 131
</script>
132 132
133
<style rel="stylesheet/scss" lang="scss" scoped>
134
  .tab-wrapper{
135
    display:flex;
136
    align-items:baseline;
137
    padding:15px 20px;
138
    color: $commonFont;
139
    .tab-lable{
140
      width:100px;
141
    }
142
    .tab-sort{
143
      display:flex;
144
      flex-wrap:wrap;
145
      margin-right:-10px;
146
      margin-bottom:-10px;
147
      li{
148
        display:inline-block;
149
        margin-right:10px;
150
        margin-bottom:10px;
151
        padding:2px 10px;
152
        border: 1px solid $borderColor;
153
        @include border-radius(10px);
154
        cursor: pointer;
155
        &.active{
156
          color: $mainColor;
157
        }
158
      }
159
    }
160
  }
161
162
  .tab-contain{
163
    margin-top:20px;
164
    background:#fff;
165
  }
166
  .el-input-group__append{
167
    background:$mainColor;
168
    color:#fff;
169
    padding:10px 40px;
170
    border-color:$mainColor;
171
  }
133
<style scoped>
134
 @import './css.scss';
172 135
</style>

+ 14 - 47
src/pages/index/views/ViewFindResult/index.vue

@ -17,7 +17,7 @@
17 17
      </div>
18 18
    </div>
19 19
    <div class="wrapper-right">
20
      <div class="block-wrapper" v-if="plat.adinfo.length" v-for="item in plat.adinfo" :key="item.index">
20
      <div class="block-wrapper" v-if="adinfo.length" v-for="item in adinfo" :key="item.index">
21 21
        <a class="ad-wrapper" :href="item.adUrl" target="_blank">
22 22
          <img :src="item.imgUrl" width="280" height="200">
23 23
        </a>
@ -28,20 +28,15 @@
28 28
</template>
29 29
30 30
<script>
31
  import Cookies from 'js-cookie';
32
  import util from '@/libs/util';
31
  import { urlParse } from '@/libs/util';
33 32
34 33
  import baseResult from '@/components/subTemplate/BaseResult';
35 34
36 35
  export default {
37
    props: {
38
      plat: {
39
        type: Object
40
      }
41
    },
42 36
    data() {
43 37
      return {
44
        platId: '',
38
        /* eslint-disable no-undef */
39
        adinfo: PLAT.info.adinfo,
45 40
        rows: 20,
46 41
        dataO: {
47 42
          patSortNum: '',
@ -58,8 +53,7 @@
58 53
      };
59 54
    },
60 55
    created() {
61
      this.platId = Cookies.get('platId');
62
      this.keyVal = util.urlParse('key');
56
      this.keyVal = urlParse('key');
63 57
      this.searchResource();
64 58
    },
65 59
    methods: {
@ -79,15 +73,18 @@
79 73
              this.dataO.patId = $info[$info.length - 1].id;
80 74
              this.platResources = this.isFormSearch ? this.platResources.concat($info) : $info;
81 75
              this.isFormSearch = true;
76
              if ($info.length < this.rows) {
77
                this.loadingModalShow = false;
78
                this.isFormSearch = false;
79
              };
80
            } else {
81
              this.loadingModalShow = false;
82
              this.isFormSearch = false;
82 83
            };
83 84
            var liLen = this.platResources.length;
84 85
            if ($info.length === 0 && liLen === 0) {
85 86
              this.ifDefault = true;
86 87
            };
87
            if ($info.length < this.rows) {
88
              this.loadingModalShow = false;
89
              this.isFormSearch = false;
90
            };
91 88
          };
92 89
        });
93 90
      },
@ -125,36 +122,6 @@
125 122
  };
126 123
</script>
127 124
128
<style lang="stylus" rel="stylesheet/stylus" scoped>
129
  .tab-wrapper
130
    display:flex
131
    align-items:baseline
132
    padding:15px 20px
133
    color: $commonFont
134
    .tab-lable
135
      width:100px
136
    .tab-sort
137
      display:flex
138
      flex-wrap:wrap
139
      margin-right:-10px
140
      margin-bottom:-10px
141
      li
142
        display:inline-block
143
        margin-right:10px
144
        margin-bottom:10px
145
        padding:2px 10px
146
        border: 1px solid $borderColor
147
        border-radius(10px)
148
        cursor: pointer
149
        &.active
150
          color: $mainColor
151
152
  .tab-contain
153
    margin-top:20px
154
    background:#fff
155
  .el-input-group__append
156
    background:$mainColor
157
    color:#fff
158
    padding:10px 40px
159
    border-color:$mainColor
125
<style scoped>
126
 @import '../ViewFindResource/css.scss';
160 127
</style>

+ 27 - 64
src/pages/index/views/ViewFindServe/index.vue

@ -24,7 +24,7 @@
24 24
      </div>
25 25
    </div>
26 26
    <div class="wrapper-right">
27
      <div class="block-wrapper" v-if="plat.adinfo.length" v-for="item in plat.adinfo" :key="item.index">
27
      <div class="block-wrapper" v-if="adinfo.length" v-for="item in adinfo" :key="item.index">
28 28
        <a class="ad-wrapper" :href="item.adUrl" target="_blank">
29 29
          <img :src="item.imgUrl" width="280" height="200">
30 30
        </a>
@ -35,24 +35,20 @@
35 35
</template>
36 36
37 37
<script>
38
  import Cookies from 'js-cookie';
39
  import util from '@/libs/util';
38
  import { urlParse } from '@/libs/util';
40 39
41 40
  import baseService from '@/components/subTemplate/BaseService';
42 41
43 42
  export default {
44
    props: {
45
      plat: {
46
        type: Object
47
      }
48
    },
49 43
    data() {
50 44
      return {
51
        platId: '',
45
        /* eslint-disable no-undef */
46
        adinfo: PLAT.info.adinfo,
52 47
        rows: 20,
53 48
        dataO: {
54
          bShareId: '',
55
          bTime: ''
49
          serSortFirst: '',
50
          serTime: '',
51
          serId: ''
56 52
        },
57 53
        keyVal: '',
58 54
        platServices: [],
@ -64,35 +60,38 @@
64 60
      };
65 61
    },
66 62
    created() {
67
      this.platId = Cookies.get('platId');
68
      this.keyVal = util.urlParse('key');
63
      this.keyVal = urlParse('key');
69 64
      this.searchService();
70 65
    },
71 66
    methods: {
72 67
      searchService() {
73
        this.$axios.getk('/ajax/platform/info/wares', {
68
        this.$axios.getk('/ajax/ware/index/search', {
74 69
            key: this.keyVal,
75
            pid: this.platId,
76
            shareId: this.dataO.bShareId,
77
            time: this.dataO.bTime,
70
            sortFirst: this.dataO.serSortFirst,
71
            time: this.dataO.serTime,
72
            id: this.dataO.serId,
78 73
            rows: this.rows
79 74
        }, (res) => {
80 75
          if (res.success) {
81 76
            var $info = res.data;
82 77
            if ($info.length > 0) {
83
              this.dataO.bShareId = $info[$info.length - 1].shareId;
84
              this.dataO.bTime = $info[$info.length - 1].time;
78
              this.dataO.serSortFirst = $info[$info.length - 1].sortFirst;
79
              this.dataO.serTime = $info[$info.length - 1].modifyTime;
80
              this.dataO.serId = $info[$info.length - 1].id;
85 81
              this.platServices = this.isFormSearch ? this.platServices.concat($info) : $info;
86 82
              this.isFormSearch = true;
83
              if ($info.length < this.rows) {
84
                this.loadingModalShow = false;
85
                this.isFormSearch = false;
86
              };
87
            } else {
88
              this.loadingModalShow = false;
89
              this.isFormSearch = false;
87 90
            };
88 91
            var liLen = this.platServices.length;
89 92
            if ($info.length === 0 && liLen === 0) {
90 93
              this.ifDefault = true;
91 94
            };
92
            if ($info.length < this.rows) {
93
              this.loadingModalShow = false;
94
              this.isFormSearch = false;
95
            };
96 95
          };
97 96
        });
98 97
      },
@ -103,8 +102,9 @@
103 102
      },
104 103
      keywordSearch() {
105 104
        if (this.keyVal) {
106
          this.dataO.bShareId = '';
107
          this.dataO.bTime = '';
105
          this.dataO.serSortFirst = '';
106
          this.dataO.serTime = '';
107
          this.dataO.serId = '';
108 108
          this.isFormSearch = true;
109 109
          this.loadingModalShow = false;
110 110
          this.loadingComplete = true;
@ -127,43 +127,6 @@
127 127
  };
128 128
</script>
129 129
130
<style rel="stylesheet/scss" lang="scss" scoped>
131
  .tab-wrapper{
132
    display:flex;
133
    align-items:baseline;
134
    padding:15px 20px;
135
    color: $commonFont;
136
    .tab-lable{
137
      width:100px;
138
    }
139
    .tab-sort{
140
      display:flex;
141
      flex-wrap:wrap;
142
      margin-right:-10px;
143
      margin-bottom:-10px;
144
      li{
145
        display:inline-block;
146
        margin-right:10px;
147
        margin-bottom:10px;
148
        padding:2px 10px;
149
        border: 1px solid $borderColor;
150
        @include border-radius(10px);
151
        cursor: pointer;
152
        &.active{
153
          color: $mainColor;
154
        }
155
      }
156
    }
157
  }
158
159
  .tab-contain{
160
    margin-top:20px;
161
    background:#fff;
162
  }
163
  .el-input-group__append{
164
    background:$mainColor;
165
    color:#fff;
166
    padding:10px 40px;
167
    border-color:$mainColor;
168
  }
130
<style scoped>
131
 @import '../ViewFindResource/css.scss';
169 132
</style>

+ 3 - 3
src/pages/index/views/ViewOrganization/orgItem.vue

@ -18,7 +18,7 @@
18 18
</template>
19 19
20 20
<script>
21
  import util from '@/libs/util';
21
  import { ImageUrl, defaultSet } from '@/libs/util';
22 22
  import queryBase from '@/libs/queryBase';
23 23
24 24
  export default {
@ -52,9 +52,9 @@
52 52
                    var owner = $data[i]
53 53
                    owner.name = value.name
54 54
                    if (value.hasOrgLogo) {
55
                      owner.logo = util.ImageUrl(('org/' + value.id + '.jpg'), true)
55
                      owner.logo = ImageUrl(('org/' + value.id + '.jpg'), true)
56 56
                    } else {
57
                      owner.logo = util.defaultSet.img.org
57
                      owner.logo = defaultSet.img.org
58 58
                    }
59 59
                    if (value.industry) {
60 60
                      owner.industry = value.industry.replace(/,/g, ' | ')

+ 4 - 4
src/pages/index/views/ViewPlatTrend/index.vue

@ -29,13 +29,13 @@
29 29
	import platNews from './news';
30 30
31 31
	export default {
32
    props: {
33
      plat: {
34
        type: Object
35
      }
32
    mounted() {
33
      sessionStorage.setItem('isSelect', '1')
36 34
    },
37 35
    data() {
38 36
      return {
37
        /* eslint-disable no-undef */
38
        plat: PLAT.info,
39 39
        activeName: '1',
40 40
        conCatalog: [
41 41
          {

+ 7 - 7
src/pages/index/views/ViewPlatTrend/news.vue

@ -7,7 +7,7 @@
7 7
8 8
<script>
9 9
  import Cookies from 'js-cookie';
10
  import util from '@/libs/util';
10
  import { commenTime } from '@/libs/util';
11 11
	import baseContent from '@/components/subTemplate/BaseContent';
12 12
13 13
	export default {
@ -40,21 +40,21 @@
40 40
          pageSize: that.pageSize,
41 41
          pageNo: that.pageNo
42 42
        }, (res) => {
43
          if (res.success) {
43
          if (res.success && res.data) {
44 44
            var $info = res.data.data;
45 45
            if ($info.length > 0) {
46 46
              for (let i = 0; i < $info.length; ++i) {
47 47
                if ($info[i].modifyTime) {
48
                  $info[i].modifyTime = util.commenTime($info[i].modifyTime, true)
48
                  $info[i].modifyTime = commenTime($info[i].modifyTime, true)
49 49
                }
50 50
              }
51 51
              that.paltNews = that.isFormSearch ? that.paltNews.concat($info) : $info;
52 52
              that.isFormSearch = true;
53
              if ($info.length < that.pageSize) {
54
                that.loadingModalShow = false;
55
                that.isFormSearch = false;
56
              };
53 57
            }
54
            if ($info.length < that.pageSize) {
55
              that.loadingModalShow = false;
56
              that.isFormSearch = false;
57
            };
58 58
          };
59 59
        });
60 60
      },

+ 3 - 3
src/pages/index/views/ViewRegCompany/index.vue

@ -21,7 +21,7 @@
21 21
</template>
22 22
23 23
<script>
24
	import util from '@/libs/util';
24
  import { defaultSet } from '@/libs/util';
25 25
26 26
  export default {
27 27
    props: {
@ -54,8 +54,8 @@
54 54
            var $info = res.data.data;
55 55
            if ($info.length > 0) {
56 56
              for (let i = 0; i < $info.length; ++i) {
57
                if ($info[i].logo === '') {
58
                  $info[i].logo = util.defaultSet.img.org
57
                if (!$info[i].logo) {
58
                  $info[i].logo = defaultSet.img.org
59 59
                }
60 60
                $info[i].industry = that.getCompanyKeyword($info[i].id)
61 61
                that.$forceUpdate()

+ 2 - 0
src/pages/index/views/logforms/loginPlat.vue

@ -95,6 +95,8 @@
95 95
                  this.$store.commit('SET_HEADPHOTO', res.data.head);
96 96
                  this.$store.commit('SET_BINDCOMPANY', res.data.bindCompany);
97 97
                  Cookies.set('userid', res.data.id);
98
                  Cookies.set('uaccount', res.data.account);
99
                  Cookies.set('bcid', res.data.bindCompany);
98 100
                  this.$router.push({name: 'home'});
99 101
                  this.logining = true;
100 102
                }

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

@ -20,6 +20,9 @@
20 20
      TheHeader,
21 21
      TheFooter,
22 22
      showTemplate
23
    },
24
    mounted() {
25
      sessionStorage.setItem('isSelect', 'org')
23 26
    }
24 27
  };
25 28
</script>

+ 70 - 35
src/pages/org/show.vue

@ -14,9 +14,9 @@
14 14
              <shareOut :tUrl="elurl"></shareOut>
15 15
            </div>
16 16
          </div>
17
          <el-row class="goSpan">
18
            <el-button type="primary" icon="el-icon-plus">关注</el-button>
19
            <el-button type="primary">联系</el-button>
17
          <el-row class="goSpan" :gutter="10">
18
            <el-col :span="12"><collectCo :watchOptions="{oid: orgId, type: 2}"></collectCo></el-col>
19
            <!-- <el-col :span="12"><el-button type="primary">联系</el-button></el-col> -->
20 20
          </el-row>
21 21
        </div>
22 22
      </div>
@ -25,23 +25,23 @@
25 25
      <div class="wrapper-left left-main">
26 26
        <el-tabs v-model="activeName">
27 27
          <el-tab-pane label="主页" name="first">
28
            <div class="content-wrapper split-other" v-if="platServices.length || platResources.length">
29
              <div class="inner-wrapper" v-if="platServices.length">
28
            <div class="content-wrapper split-other" v-if="platThreeServices.length || platThreeResources.length">
29
              <div class="inner-wrapper" v-if="platThreeServices.length">
30 30
                <div class="content-title">
31 31
                  <span>可提供服务</span>
32 32
                  <span class="content-more" @click="activeName='second'">更多</span>
33 33
                </div>
34
                <div class="content">
35
                  <baseService v-if="platServices.length" v-for="item in platServices" :key="item.index" :itemSingle="item"></baseService>
34
                <div class="content content-nf">
35
                  <baseService v-if="platThreeServices.length" v-for="item in platThreeServices" :key="item.index" :itemSingle="item"></baseService>
36 36
                </div>
37 37
              </div>
38
              <div class="inner-wrapper" v-if="platResources.length">
38
              <div class="inner-wrapper" v-if="platThreeResources.length">
39 39
                <div class="content-title">
40 40
                  <span>可共享资源</span>
41 41
                  <span class="content-more" @click="activeName='third'">更多</span>
42 42
                </div>
43
                <div>
44
                  <baseResource v-if="platResources.length" v-for="item in platResources" :key="item.index" :itemSingle="item"></baseResource>
43
                <div class="content content-nf">
44
                  <baseResource v-if="platThreeResources.length" v-for="item in platThreeResources" :key="item.index" :itemSingle="item"></baseResource>
45 45
                </div>
46 46
              </div>
47 47
            </div>
@ -65,18 +65,18 @@
65 65
            </div>
66 66
          </el-tab-pane>
67 67
          <el-tab-pane :label="'服务 ' + (serCount>0 ? serCount : '')" name="second">
68
            <div v-show="!ifDefault">
68
            <div v-if="!ifDefault && platServices.length">
69 69
              <baseService v-if="platServices.length" v-for="item in platServices" :key="item.index" :itemSingle="item"></baseService>
70 70
              <Loading v-show="loadingModalShow" :loadingComplete="loadingComplete" :isLoading="isLoading" v-on:upup="searchLower"></Loading>
71 71
            </div>
72
            <defaultPage v-show="ifDefault"></defaultPage>
72
            <defaultPage v-else></defaultPage>
73 73
          </el-tab-pane>
74 74
          <el-tab-pane :label="'资源 ' + (resCount>0 ? resCount : '')" name="third">
75
            <div v-show="!ifDefault2">
75
            <div v-if="!ifDefault2 && platResources.length">
76 76
              <baseResource v-if="platResources.length" v-for="item in platResources" :key="item.index" :itemSingle="item"></baseResource>
77 77
              <Loading v-show="loadingModalShow2" :loadingComplete="loadingComplete2" :isLoading="isLoading2" v-on:upup="searchLower2"></Loading>
78 78
            </div>
79
            <defaultPage v-show="ifDefault2"></defaultPage>
79
            <defaultPage v-else></defaultPage>
80 80
          </el-tab-pane>
81 81
          <el-tab-pane label="资料" name="fourth">
82 82
            <div class="content-wrapper">
@ -130,7 +130,7 @@
130 130
        </el-tabs>
131 131
      </div>
132 132
      <div class="wrapper-right">
133
        <div class="content-wrapper" v-if="orgContents">
133
        <div class="content-wrapper" v-if="orgContents && orgContents.length">
134 134
          <div class="content-title">
135 135
            <span>相关文章</span>
136 136
          </div>
@ -142,7 +142,7 @@
142 142
            </div>
143 143
          </div>
144 144
        </div>
145
        <div class="content-wrapper" v-if="likeOrgs">
145
        <div class="content-wrapper" v-if="likeOrgs && likeOrgs.length">
146 146
          <div class="content-title">
147 147
            <span>您可能感兴趣的机构</span>
148 148
          </div>
@ -163,11 +163,12 @@
163 163
</template>
164 164
165 165
<script>
166
  import util from '@/libs/util';
166
  import { urlParse, ImageUrl, defaultSet, strToArr, TimeTr } from '@/libs/util';
167 167
  import queryDict from '@/libs/queryDict';
168 168
  import queryBase from '@/libs/queryBase';
169 169
170 170
  import shareOut from '@/components/ShareOut';
171
  import collectCo from '@/components/CollectCo';
171 172
  import baseService from '@/components/subTemplate/BaseService';
172 173
  import baseResource from '@/components/subTemplate/BaseResource';
173 174
@ -178,6 +179,7 @@
178 179
        numRanger: [],
179 180
        compType: [],
180 181
        orgInfo: '',
182
        orgId: '',
181 183
        elurl: '',
182 184
        platServices: [],
183 185
        serCount: 0,
@ -204,7 +206,7 @@
204 206
      };
205 207
    },
206 208
    created() {
207
      this.orgId = util.urlParse('id');
209
      this.orgId = urlParse('id');
208 210
      this.elurl = window.location.href;
209 211
      this.getDictoryData();
210 212
      this.getorgInfo();
@ -214,8 +216,35 @@
214 216
      this.getOrgContent();
215 217
      this.getLikeOrgs();
216 218
    },
219
    computed: {
220
      platThreeServices() {
221
        var pt = this.platServices
222
        var str = []
223
        if (pt.length > 3) {
224
          for (let i = 0; i < 3; ++i) {
225
            str[i] = pt[i]
226
          }
227
        } else {
228
          str = pt
229
        }
230
        return str
231
      },
232
      platThreeResources() {
233
        var pt = this.platResources
234
        var str = []
235
        if (pt.length > 3) {
236
          for (let i = 0; i < 3; ++i) {
237
            str[i] = pt[i]
238
          }
239
        } else {
240
          str = pt
241
        }
242
        return str
243
      }
244
    },
217 245
    components: {
218 246
      shareOut,
247
      collectCo,
219 248
      baseService,
220 249
      baseResource
221 250
    },
@ -239,18 +268,18 @@
239 268
          if (res.success) {
240 269
            var $info = res.data;
241 270
            if ($info.hasOrgLogo) {
242
              $info.logo = util.ImageUrl(('org/' + $info.id + '.jpg'), true)
271
              $info.logo = ImageUrl(('org/' + $info.id + '.jpg'), true)
243 272
            } else {
244
              $info.logo = util.defaultSet.img.org
273
              $info.logo = defaultSet.img.org
245 274
            }
246 275
            if ($info.subject) {
247
              $info.subject = util.strToArr($info.subject);
276
              $info.subject = strToArr($info.subject);
248 277
            }
249 278
            if ($info.qualification) {
250
              $info.qualification = util.strToArr($info.qualification);
279
              $info.qualification = strToArr($info.qualification);
251 280
            }
252 281
            if ($info.foundTime) {
253
              $info.foundTime = util.TimeTr($info.foundTime);
282
              $info.foundTime = TimeTr($info.foundTime);
254 283
            }
255 284
            if ($info.orgSize) {
256 285
              $info.orgSize = this.numRanger[$info.orgSize];
@ -269,21 +298,24 @@
269 298
          modifyTime: this.dataO.serModifyTime,
270 299
          rows: this.rows
271 300
        }, (res) => {
272
          if (res.success) {
301
          if (res.success && res.data) {
273 302
            var $info = res.data;
274 303
            if ($info.length > 0) {
275 304
              this.dataO.serModifyTime = $info[$info.length - 1].modifyTime;
276 305
              this.platServices = this.isFormSearch ? this.platServices.concat($info) : $info;
277 306
              this.isFormSearch = true;
307
              if ($info.length < this.rows) {
308
                this.loadingModalShow = false;
309
                this.isFormSearch = false;
310
              };
311
            } else {
312
              this.loadingModalShow = false;
313
              this.isFormSearch = false;
278 314
            };
279 315
            var liLen = this.platServices.length;
280 316
            if ($info.length === 0 && liLen === 0) {
281 317
              this.ifDefault = true;
282 318
            };
283
            if ($info.length < this.rows) {
284
              this.loadingModalShow = false;
285
              this.isFormSearch = false;
286
            };
287 319
          };
288 320
        });
289 321
      },
@ -300,22 +332,25 @@
300 332
          shareId: this.dataO.resShareId,
301 333
          rows: this.rows
302 334
        }, (res) => {
303
          if (res.success) {
335
          if (res.success && res.data) {
304 336
            var $info = res.data;
305 337
            if ($info.length > 0) {
306 338
              this.dataO.resPublishTime = $info[$info.length - 1].publishTime;
307 339
              this.dataO.resShareId = $info[$info.length - 1].shareId;
308 340
              this.platResources = this.isFormSearch2 ? this.platResources.concat($info) : $info;
309 341
              this.isFormSearch2 = true;
342
              if ($info.length < this.rows) {
343
                this.loadingModalShow2 = false;
344
                this.isFormSearch2 = false;
345
              };
346
            } else {
347
              this.loadingModalShow2 = false;
348
              this.isFormSearch2 = false;
310 349
            };
311 350
            var liLen = this.platPatents.length;
312 351
            if ($info.length === 0 && liLen === 0) {
313 352
              this.ifDefault2 = true;
314 353
            };
315
            if ($info.length < this.rows) {
316
              this.loadingModalShow2 = false;
317
              this.isFormSearch2 = false;
318
            };
319 354
          };
320 355
        });
321 356
      },
@ -389,9 +424,9 @@
389 424
                      str.name = value.name
390 425
                      str.orgType = that.compType[value.orgType]
391 426
                      if (str.hasOrgLogo) {
392
                        str.logo = util.ImageUrl(('org/' + value.id + '.jpg'), true)
427
                        str.logo = ImageUrl(('org/' + value.id + '.jpg'), true)
393 428
                      } else {
394
                        str.logo = util.defaultSet.img.org
429
                        str.logo = defaultSet.img.org
395 430
                      }
396 431
                      that.$forceUpdate()
397 432
                    }

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

@ -20,6 +20,9 @@
20 20
      TheHeader,
21 21
      TheFooter,
22 22
      showTemplate
23
    },
24
    mounted() {
25
      sessionStorage.setItem('isSelect', 'comp')
23 26
    }
24 27
  };
25 28
</script>

+ 9 - 9
src/pages/product/show.vue

@ -52,9 +52,9 @@
52 52
      <div class="wrapper-right">
53 53
        <div class="content-wrapper">
54 54
          <div class="right-split">
55
            <beyondTo :ownerId="productInfo.companyId"></beyondTo>
55
            <beyondTo v-if="companyId" :ownerId="companyId"></beyondTo>
56 56
          </div>
57
          <div class="right-split" v-if="otherProducts">
57
          <div class="right-split" v-if="otherProducts && otherProducts.length">
58 58
            <div class="content-title">
59 59
              <span>其他产品</span>
60 60
            </div>
@ -75,7 +75,7 @@
75 75
</template>
76 76
77 77
<script>
78
  import util from '@/libs/util';
78
  import { urlParse, strToArr } from '@/libs/util';
79 79
80 80
  import previewMagnify from '@/components/previewMagnify';
81 81
  import shareOut from '@/components/ShareOut';
@ -93,11 +93,10 @@
93 93
      };
94 94
    },
95 95
    created() {
96
      this.productId = util.urlParse('id');
96
      this.productId = urlParse('id');
97 97
      this.elurl = window.location.href;
98 98
      this.getproductInfo();
99 99
      this.getProductKeyword();
100
      this.getOtherProducts();
101 100
    },
102 101
    components: {
103 102
      previewMagnify,
@ -112,10 +111,11 @@
112 111
          if (res.success) {
113 112
            var $info = res.data;
114 113
            if ($info.img) {
115
              $info.img = util.strToArr($info.img);
114
              $info.img = strToArr($info.img);
116 115
            }
116
            this.companyId = $info.companyId;
117 117
            this.productInfo = $info;
118
            this.companyId = $info.companyId
118
            this.getOtherProducts($info.companyId);
119 119
          };
120 120
        });
121 121
      },
@ -136,10 +136,10 @@
136 136
          }
137 137
        })
138 138
      },
139
      getOtherProducts() {
139
      getOtherProducts(id) {
140 140
        var that = this
141 141
        that.$axios.get('/ajax/product/pq', {
142
          id: that.companyId,
142
          companyId: id,
143 143
          pageSize: 6,
144 144
          pageNo: 1
145 145
        }, function(res) {

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

@ -20,6 +20,9 @@
20 20
      TheHeader,
21 21
      TheFooter,
22 22
      showTemplate
23
    },
24
    mounted() {
25
      sessionStorage.setItem('isSelect', 'reso')
23 26
    }
24 27
  };
25 28
</script>

+ 12 - 12
src/pages/resource/show.vue

@ -11,8 +11,7 @@
11 11
              <div class="info-tit info-tit-big">{{resourceInfo.resourceName}}</div>
12 12
              <div class="info-tag">应用用途:{{resourceInfo.supportedServices}}</div>
13 13
              <div class="info-operate zoom-operate">
14
                <!-- <div class="addr">浏览量 10</div> -->
15
                <collectCo></collectCo>
14
                <collectCo :watchOptions="{oid: resourceId, type: 4}"></collectCo>
16 15
                <shareOut :tUrl="elurl" :tPosition="tPosition"></shareOut>
17 16
              </div>
18 17
            </div>
@ -49,11 +48,11 @@
49 48
            </el-row>
50 49
          </div>
51 50
        </div>
52
        <div class="content-wrapper" v-if="likeResources">
51
        <div class="content-wrapper" v-if="likeResources && likeResources.length">
53 52
          <div class="content-title">
54 53
            <span>您可能感兴趣的资源</span>
55 54
          </div>
56
          <div class="content">
55
          <div class="content content-nf">
57 56
            <baseResource v-for="item in likeResources" :key="item.index" :itemSingle="item"></baseResource>
58 57
          </div>
59 58
        </div>
@ -63,7 +62,7 @@
63 62
          <div class="right-split">
64 63
            <beyondTo :ownerId="owner.id" :ownerType="owner.type"></beyondTo>
65 64
          </div>
66
          <div class="right-split" v-if="hotResources">
65
          <div class="right-split" v-if="hotResources && hotResources.length">
67 66
            <div class="content-title">
68 67
              <span>热门资源</span>
69 68
            </div>
@ -84,7 +83,7 @@
84 83
</template>
85 84
86 85
<script>
87
  import util from '@/libs/util';
86
  import { urlParse, ImageUrl, defaultSet, strToArr } from '@/libs/util';
88 87
89 88
  import previewMagnify from '@/components/previewMagnify';
90 89
  import shareOut from '@/components/ShareOut';
@ -97,6 +96,7 @@
97 96
    data() {
98 97
      return {
99 98
        resourceInfo: '',
99
        resourceId: '',
100 100
        elurl: '',
101 101
        tPosition: 'top-start',
102 102
        owner: {
@ -108,7 +108,7 @@
108 108
      };
109 109
    },
110 110
    created() {
111
      this.resourceId = util.urlParse('id');
111
      this.resourceId = urlParse('id');
112 112
      this.elurl = window.location.href;
113 113
      this.getResourceInfo();
114 114
      this.getLikeResources();
@ -128,15 +128,15 @@
128 128
          if (res.success) {
129 129
            var $info = res.data;
130 130
            if ($info.subject) {
131
              $info.subject = util.strToArr($info.subject);
131
              $info.subject = strToArr($info.subject);
132 132
            }
133 133
            var ImgUrl = []
134 134
            if ($info.images && $info.images.length) {
135 135
              for (let i = 0; i < $info.images.length; ++i) {
136
                ImgUrl.push(util.ImageUrl('resource/' + $info.images[i].imageSrc))
136
                ImgUrl.push(ImageUrl('resource/' + $info.images[i].imageSrc))
137 137
              }
138 138
            } else {
139
              ImgUrl.push(util.defaultSet.img.resource)
139
              ImgUrl.push(defaultSet.img.resource)
140 140
            }
141 141
            $info.img = ImgUrl
142 142
            if ($info.resourceType === '1') {
@ -176,9 +176,9 @@
176 176
                  }
177 177
                }
178 178
                if ($data[i].images.length) {
179
                  $data[i].img = util.ImageUrl('resource/' + $data[i].images[0].imageSrc)
179
                  $data[i].img = ImageUrl('resource/' + $data[i].images[0].imageSrc)
180 180
                } else {
181
                  $data[i].img = util.defaultSet.img.resource
181
                  $data[i].img = defaultSet.img.resource
182 182
                }
183 183
              }
184 184
            }

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

@ -20,6 +20,9 @@
20 20
      TheHeader,
21 21
      TheFooter,
22 22
      showTemplate
23
    },
24
    mounted() {
25
      sessionStorage.setItem('isSelect', 'resu')
23 26
    }
24 27
  };
25 28
</script>

+ 87 - 24
src/pages/result/show.vue

@ -6,9 +6,9 @@
6 6
          <div class="inner-wrapper">
7 7
            <div class="headcon-box detail-box">
8 8
              <div class="show-info">
9
                <div class="info-tit info-tit-big">{{patentInfo.title}}</div>
9
                <div class="info-tit info-tit-big">{{patentInfo.name}}</div>
10 10
                <div class="info-operate zoom-operate">
11
                  <collectCo></collectCo>
11
                  <collectCo :watchOptions="{oid: patentId, type: 5}"></collectCo>
12 12
                  <shareOut :tUrl="elurl"></shareOut>
13 13
                </div>
14 14
              </div>
@ -53,22 +53,35 @@
53 53
              </el-row>
54 54
            </div>
55 55
          </div>
56
          <div class="inner-wrapper">
56
          <div class="inner-wrapper" v-if="patentAuthors && patentAuthors.length">
57 57
            <div class="content-title">
58
              <span>发明人</span>
58
              <span>发明人{{authorCount > 0 ? `(${authorCount})` : ''}}</span>
59 59
            </div>
60 60
            <div class="content">
61
              <el-row :gutter="10">
62
                <el-col>
61
              <el-row :gutter="10" style="width:100%">
62
                <el-col :span="12" class="item-col" v-for="item in patentAuthors" :key="item.index">
63
                  <a v-if="item.professorId.substring(0, 1) !== '#'" class="list-item" :href="'expert.html?id='+item.professorId" target="_blank">
64
                    <div class="list-head" :style="{backgroundImage: 'url(' + headUrl(item) + ')'}"></div>
65
                    <div class="list-info">
66
                      <div class="list-tit">{{item.name}}</div>
67
                      <div class="list-desc">{{item.title}}</div>
68
                    </div>
69
                  </a>
70
                  <div class="list-item" v-else>
71
                    <div class="list-head" :style="{backgroundImage: 'url(' + headUrl(item) + ')'}"></div>
72
                    <div class="list-info">
73
                      <div class="list-tit">{{item.name}}</div>
74
                    </div>
75
                  </div>
63 76
                </el-col>
64 77
              </el-row>
65 78
            </div>
66 79
          </div>
67
          <div class="inner-wrapper" v-if="likePatents">
80
          <div class="inner-wrapper" v-if="likePatents && likePatents.length">
68 81
            <div class="content-title">
69 82
              <span>您可能感兴趣的专利</span>
70 83
            </div>
71
            <div class="content">
84
            <div class="content content-nf">
72 85
              <baseResult v-for="item in likePatents" :key="item.index" :itemSingle="item"></baseResult>
73 86
            </div>
74 87
          </div>
@ -76,7 +89,7 @@
76 89
      </div>
77 90
      <div class="wrapper-right">
78 91
        <div class="wrapper-right">
79
          <div class="block-wrapper" v-if="plat.adinfo.length" v-for="item in plat.adinfo" :key="item.index">
92
          <div class="block-wrapper" v-if="adinfo.length" v-for="item in adinfo" :key="item.index">
80 93
            <a class="ad-wrapper" :href="item.adUrl" target="_blank">
81 94
              <img :src="item.imgUrl" width="280" height="200">
82 95
            </a>
@ -89,32 +102,33 @@
89 102
</template>
90 103
91 104
<script>
92
  import util from '@/libs/util';
105
  import { urlParse, ImageUrl, defaultSet, strToArr, TimeTr } from '@/libs/util';
93 106
94 107
  import shareOut from '@/components/ShareOut';
95 108
  import collectCo from '@/components/CollectCo';
96 109
97 110
  import baseResult from '@/components/subTemplate/BaseResult';
111
  import queryBase from '@/libs/queryBase';
98 112
99 113
  export default {
100
    props: {
101
      plat: {
102
        type: Object
103
      }
104
    },
105 114
    data() {
106 115
      return {
116
        /* eslint-disable no-undef */
117
        adinfo: PLAT.info.adinfo,
107 118
        activeName: 'first',
108 119
        patentInfo: '',
120
        patentId: '',
109 121
        elurl: '',
110
        likePatents: ''
122
        likePatents: '',
123
        patentAuthors: ''
111 124
      };
112 125
    },
113 126
    created() {
114
      this.patentId = util.urlParse('id');
127
      this.patentId = urlParse('id');
115 128
      this.elurl = window.location.href;
116 129
      this.getPatentInfo();
117 130
      this.getLikePatents();
131
      this.getPatentAuthors();
118 132
    },
119 133
    components: {
120 134
      shareOut,
@ -129,23 +143,54 @@
129 143
          if (res.success) {
130 144
            var $info = res.data;
131 145
            if ($info.keywords) {
132
              $info.keywords = util.strToArr($info.keywords);
146
              $info.keywords = strToArr($info.keywords);
133 147
            }
134 148
            if ($info.reqDay) {
135
              $info.reqDay = util.TimeTr($info.reqDay);
149
              $info.reqDay = TimeTr($info.reqDay);
136 150
            }
137 151
            if ($info.pubDay) {
138
              $info.pubDay = util.TimeTr($info.pubDay);
152
              $info.pubDay = TimeTr($info.pubDay);
139 153
            }
140 154
            this.patentInfo = $info;
141 155
          };
142 156
        });
143 157
      },
144
      headUrl(item) {
145
        return item.hasHeadImage ? util.ImageUrl(('head/' + item.id + '_l.jpg'), true) : util.defaultSet.img.expert;
158
      getPatentAuthors() {
159
        var that = this
160
        that.$axios.getk('/ajax/ppatent/authors', {
161
          id: that.patentId
162
        }, function(res) {
163
          if (res.success && res.data) {
164
            const $data = res.data
165
            if ($data.length > 0) {
166
              that.authorCount = $data.length
167
              var hdata = { num: 1, data: $data }
168
              for (let i = 0; i < $data.length; ++i) {
169
                hdata.num++
170
                if ($data[i].professorId.substring(0, 1) !== '#') {
171
                  var item = $data[i]
172
                  queryBase.getProfessor(item.professorId, function(sc, value) {
173
                    alert(333)
174
                    if (sc) {
175
                      hdata.num--
176
                      item.name = value.name;
177
                      that.$forceUpdate();
178
                    }
179
                  });
180
                } else {
181
                  hdata.num--
182
                }
183
              }
184
              hdata.num--
185
              if (hdata.num === 0) {
186
                that.patentAuthors = $data
187
              }
188
            }
189
          }
190
        })
146 191
      },
147
      headIcon(item) {
148
        return util.autho(item.authType, item.orgAuth, item.authStatus);
192
      headUrl(item) {
193
        return item.hasHeadImage ? ImageUrl(('head/' + item.id + '_l.jpg'), true) : defaultSet.img.expert;
149 194
      },
150 195
      getLikePatents() {
151 196
        var that = this
@ -161,3 +206,21 @@
161 206
    }
162 207
  };
163 208
</script>
209
210
<style lang="scss" scoped>
211
.browse-main .block-wrapper .left-main .inner-wrapper .content
212
.item-col{
213
  margin-bottom: 10px;
214
  .list-item{
215
    border:1px solid #eaeaea;
216
    padding:10px 16px;
217
    .list-head{
218
      @include center-items(50px,50px);
219
    }
220
    .list-info{
221
      flex: 1 1 60px;
222
      padding-left: 10px;
223
    }
224
  }
225
}
226
</style>

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

@ -20,6 +20,9 @@
20 20
      TheHeader,
21 21
      TheFooter,
22 22
      showTemplate
23
    },
24
    mounted() {
25
      sessionStorage.setItem('isSelect', 'serve')
23 26
    }
24 27
  };
25 28
</script>

+ 36 - 35
src/pages/serve/show.vue

@ -5,13 +5,13 @@
5 5
        <div class="content-wrapper split-other">
6 6
          <div class="headcon-box hdetail-box">
7 7
            <div class="zoom-box">
8
              <previewMagnify v-if="resourceInfo.img && resourceInfo.img.length" :previewImg="resourceInfo.img"></previewMagnify>
8
              <previewMagnify v-if="serveInfo.img && serveInfo.img.length" :previewImg="serveInfo.img"></previewMagnify>
9 9
            </div>
10 10
            <div class="show-info reInfo-box">
11
              <div class="info-tit info-tit-big">{{resourceInfo.name}}</div>
12
              <div class="info-tag">服务内容:{{resourceInfo.cnt}}</div>
11
              <div class="info-tit info-tit-big">{{serveInfo.name}}</div>
12
              <div class="info-tag">服务内容:{{serveInfo.cnt}}</div>
13 13
              <div class="info-operate zoom-operate">
14
                <collectCo></collectCo>
14
                <collectCo :watchOptions="{oid: serveId, type: 3}"></collectCo>
15 15
                <shareOut :tUrl="elurl" :tPosition="tPosition"></shareOut>
16 16
              </div>
17 17
            </div>
@ -20,28 +20,28 @@
20 20
        <div class="content-wrapper">
21 21
          <div class="content">
22 22
            <el-row :gutter="10" class="rel-detail">
23
              <el-col class="rel-item" :span="24" v-if="resourceInfo.cooperation">
23
              <el-col class="rel-item" :span="24" v-if="serveInfo.cooperation">
24 24
                <div class="rel-tit">合作备注:</div>
25
                <div v-html="resourceInfo.cooperation"></div>
25
                <div v-html="serveInfo.cooperation"></div>
26 26
              </el-col>
27
              <el-col class="rel-item" :span="24" v-if="resourceInfo.descp">
27
              <el-col class="rel-item" :span="24" v-if="serveInfo.descp">
28 28
                <div class="rel-tit">详细介绍:</div>
29
                <div v-html="resourceInfo.descp"></div>
29
                <div v-html="serveInfo.descp"></div>
30 30
              </el-col>
31
              <el-col class="rel-item" :span="24" v-if="resourceInfo.keywords && resourceInfo.keywords.length">
31
              <el-col class="rel-item" :span="24" v-if="serveInfo.keywords && serveInfo.keywords.length">
32 32
                <el-row class="tag-item">
33
                  <el-tag v-for="sub in resourceInfo.keywords" :key="sub.index">{{sub}}</el-tag>
33
                  <el-tag v-for="sub in serveInfo.keywords" :key="sub.index">{{sub}}</el-tag>
34 34
                </el-row>
35 35
              </el-col>
36 36
            </el-row>
37 37
          </div>
38 38
        </div>
39
        <div class="content-wrapper" v-if="likeResources">
39
        <div class="content-wrapper" v-if="likeserves && likeserves.length">
40 40
          <div class="content-title">
41 41
            <span>您可能感兴趣的服务</span>
42 42
          </div>
43
          <div class="content">
44
            <baseService v-for="item in likeResources" :key="item.index" :itemSingle="item"></baseService>
43
          <div class="content content-nf">
44
            <baseService v-for="item in likeserves" :key="item.index" :itemSingle="item"></baseService>
45 45
          </div>
46 46
        </div>
47 47
      </div>
@ -50,12 +50,12 @@
50 50
          <div class="right-split">
51 51
            <beyondTo :ownerId="owner.id" :ownerType="owner.type"></beyondTo>
52 52
          </div>
53
          <div class="right-split" v-if="hotResources">
53
          <div class="right-split" v-if="hotserves && hotserves.length">
54 54
            <div class="content-title">
55 55
              <span>热门服务</span>
56 56
            </div>
57 57
            <div class="content">
58
              <a v-for="item in hotResources" :key="item.index" class="list-item" :href="'serve.html?id='+item.id" target="_blank">
58
              <a v-for="item in hotserves" :key="item.index" class="list-item" :href="'serve.html?id='+item.id" target="_blank">
59 59
                <div class="list-head" :style="{backgroundImage: 'url(' + item.img + ')'}"></div>
60 60
                <div class="list-info">
61 61
                  <div class="list-descp">{{item.name}}</div>
@ -71,7 +71,7 @@
71 71
</template>
72 72
73 73
<script>
74
  import util from '@/libs/util';
74
  import { urlParse, ImageUrl, defaultSet, strToArr } from '@/libs/util';
75 75
76 76
  import previewMagnify from '@/components/previewMagnify';
77 77
  import shareOut from '@/components/ShareOut';
@ -83,22 +83,23 @@
83 83
  export default {
84 84
    data() {
85 85
      return {
86
        resourceInfo: '',
86
        serveInfo: '',
87
        serveId: '',
87 88
        elurl: '',
88 89
        tPosition: 'top-start',
89 90
        owner: {
90 91
          id: '',
91 92
          type: ''
92 93
        },
93
        hotResources: '',
94
        likeResources: ''
94
        hotserves: '',
95
        likeserves: ''
95 96
      };
96 97
    },
97 98
    created() {
98
      this.resourceId = util.urlParse('id');
99
      this.serveId = urlParse('id');
99 100
      this.elurl = window.location.href;
100
      this.getResourceInfo();
101
      this.getLikeResources();
101
      this.getserveInfo();
102
      this.getLikeserves();
102 103
    },
103 104
    components: {
104 105
      previewMagnify,
@ -108,30 +109,30 @@
108 109
      baseService
109 110
    },
110 111
    methods: {
111
      getResourceInfo() {
112
      getserveInfo() {
112 113
        this.$axios.getk('/ajax/ware/qo', {
113
          id: this.resourceId
114
          id: this.serveId
114 115
        }, (res) => {
115 116
          if (res.success) {
116 117
            var $info = res.data;
117 118
            if ($info.keywords) {
118
              $info.keywords = util.strToArr($info.keywords);
119
              $info.keywords = strToArr($info.keywords);
119 120
            }
120 121
            if ($info.category === '1') {
121 122
              this.owner = {
122 123
                id: $info.owner,
123 124
                type: $info.category
124 125
              };
125
              this.getHotResources($info.category, $info.owner)
126
              this.getHotserves($info.category, $info.owner)
126 127
            }
127
            this.resourceInfo = $info;
128
            this.serveInfo = $info;
128 129
          };
129 130
        });
130 131
      },
131
      getHotResources(catagory, owner) {
132
      getHotserves(catagory, owner) {
132 133
        var that = this
133 134
        that.$axios.getk('/ajax/ware/byOwnerWithPageViews', {
134
          id: that.resourceId,
135
          id: that.serveId,
135 136
          category: catagory,
136 137
          owner: owner,
137 138
          rows: 5
@ -142,20 +143,20 @@
142 143
              var oLeng = $data.length < 5 ? $data.length : 5
143 144
              for (var i = 0; i < oLeng; i++) {
144 145
                if ($data[i].images) {
145
                  $data[i].img = util.ImageUrl('ware/' + util.strToArr($data[i].images))
146
                  $data[i].img = ImageUrl('ware/' + strToArr($data[i].images))
146 147
                } else {
147
                  $data[i].img = util.defaultSet.img.serve
148
                  $data[i].img = defaultSet.img.serve
148 149
                }
149 150
              }
150 151
            }
151
            that.hotResources = $data
152
            that.hotserves = $data
152 153
          }
153 154
        })
154 155
      },
155
      getLikeResources() {
156
      getLikeserves() {
156 157
        var that = this
157 158
        that.$axios.getk('/ajax/ware/ralateWare', {
158
          id: that.resourceId,
159
          id: that.serveId,
159 160
          rows: 5
160 161
        }, function(res) {
161 162
          if (res.success && res.data) {
@ -167,7 +168,7 @@
167 168
            that.$axios.getk('/ajax/ware/qm', {
168 169
              id: arr
169 170
            }, function(data) {
170
              that.likeResources = data.data
171
              that.likeserves = data.data
171 172
            })
172 173
          }
173 174
        })

+ 0 - 62
src/store/modules/permission.js

@ -1,62 +0,0 @@
1
import { asyncRouterMap, constantRouterMap } from '@/router'
2
3
/**
4
 * 通过meta.role判断是否与当前用户权限匹配
5
 * @param roles
6
 * @param route
7
 */
8
function hasPermission(roles, route) {
9
  if (route.meta && route.meta.roles) {
10
    return roles.some(role => route.meta.roles.indexOf(role) >= 0)
11
  } else {
12
    return true
13
  }
14
}
15
16
/**
17
 * 递归过滤异步路由表,返回符合用户角色权限的路由表
18
 * @param asyncRouterMap
19
 * @param roles
20
 */
21
function filterAsyncRouter(asyncRouterMap, roles) {
22
  const accessedRouters = asyncRouterMap.filter(route => {
23
    if (hasPermission(roles, route)) {
24
      if (route.children && route.children.length) {
25
        route.children = filterAsyncRouter(route.children, roles)
26
      }
27
      return true
28
    }
29
    return false
30
  })
31
  return accessedRouters
32
}
33
34
const permission = {
35
  state: {
36
    routers: constantRouterMap,
37
    addRouters: []
38
  },
39
  mutations: {
40
    SET_ROUTERS: (state, routers) => {
41
      state.addRouters = routers
42
      state.routers = constantRouterMap.concat(routers)
43
    }
44
  },
45
  actions: {
46
    GenerateRoutes({ commit }, data) {
47
      return new Promise(resolve => {
48
        const { roles } = data
49
        let accessedRouters
50
        if (roles.indexOf('1') >= 0) {
51
          accessedRouters = asyncRouterMap
52
        } else {
53
          accessedRouters = filterAsyncRouter(asyncRouterMap, roles)
54
        }
55
        commit('SET_ROUTERS', accessedRouters)
56
        resolve()
57
      })
58
    }
59
  }
60
}
61
62
export default permission

+ 10 - 2
src/store/modules/user.js

@ -1,6 +1,6 @@
1 1
import http from '@/libs/axios'
2 2
import Cookies from 'js-cookie'
3
import util from '@/libs/util'
3
import { defaultSet } from '@/libs/util';
4 4
5 5
const user = {
6 6
  state: {
@ -20,7 +20,7 @@ const user = {
20 20
      state.bindCompany = bindCompany
21 21
    },
22 22
    SET_HEADPHOTO: (state, headPhoto) => {
23
      state.headPhoto = headPhoto || util.defaultSet.img.expert;
23
      state.headPhoto = headPhoto || defaultSet.img.expert;
24 24
    }
25 25
  },
26 26
@ -36,11 +36,15 @@ const user = {
36 36
            commit('SET_HEADPHOTO', dataS.head);
37 37
            commit('SET_BINDCOMPANY', dataS.bindCompany);
38 38
            Cookies.set('userid', dataS.id);
39
            Cookies.set('uaccount', dataS.account);
40
            Cookies.set('bcid', dataS.bindCompany);
39 41
          } else {
40 42
            commit('SET_USERID', '')
41 43
            commit('SET_ACCOUNT', '')
42 44
            commit('SET_HEADPHOTO', '');
43 45
            Cookies.remove('userid')
46
            Cookies.remove('uaccount');
47
            Cookies.remove('bcid')
44 48
          }
45 49
          resolve(response)
46 50
        }).catch(error => {
@ -58,6 +62,8 @@ const user = {
58 62
          commit('SET_BINDCOMPANY', '')
59 63
          commit('SET_HEADPHOTO', '');
60 64
          Cookies.remove('userid')
65
          Cookies.remove('uaccount');
66
          Cookies.remove('bcid')
61 67
          resolve()
62 68
        }).catch(error => {
63 69
          reject(error)
@ -73,6 +79,8 @@ const user = {
73 79
        commit('SET_BINDCOMPANY', '')
74 80
        commit('SET_HEADPHOTO', '');
75 81
        Cookies.remove('userid')
82
        Cookies.remove('uaccount');
83
        Cookies.remove('bcid')
76 84
        resolve()
77 85
      })
78 86
    }

+ 1 - 1
src/styles/base.scss

@ -52,4 +52,4 @@ img{
52 52
      opacity: 0;
53 53
    }
54 54
  }
55
}
55
}

+ 5 - 2
src/styles/browse.scss

@ -86,7 +86,7 @@
86 86
          }
87 87
        }
88 88
        .goSpan{
89
          min-width: 180px;
89
          min-width: 200px;
90 90
        }
91 91
        &.org-head{
92 92
          .headimg-box{
@ -189,7 +189,7 @@
189 189
            font-weight:normal;
190 190
            word-break: break-all;
191 191
            .list-item{
192
              padding: 4px 0;
192
              padding: 8px 0;
193 193
            }
194 194
            .ulM{
195 195
              width:100%;
@ -223,6 +223,9 @@
223 223
              }
224 224
            }
225 225
          }
226
          .content-nf{
227
            display:block
228
          }
226 229
        }
227 230
      }
228 231
    }

+ 16 - 7
src/styles/common.scss

@ -80,9 +80,18 @@ a{
80 80
    top:0;
81 81
  }
82 82
}
83
.el-button--primary{
84
  background-color: $mainColor;
85
  border-color: $mainColor;
83
84
.pagination-container{
85
  padding: 20px;
86
  text-align:center;
87
}
88
89
.space-form-item{
90
  height:40px;
91
}
92
93
.el-date-editor.el-input, .el-date-editor.el-input__inner{
94
  width:100%;
86 95
}
87 96
88 97
/*认证标识相关*/
@ -93,17 +102,17 @@ a{
93 102
  height:16px;
94 103
  background-size: cover;
95 104
  &.icon-pro{
96
    @include bg-image('/static/comimg/porfile_icon_zhuanjia_nor.png');
105
    @include bg-image('../assets/head-icon/porfile_icon_zhuanjia_nor.png');
97 106
  }
98 107
  &.icon-com{
99
    @include bg-image('/static/comimg/porfile_icon_qiye_hig.png');
108
    @include bg-image('../assets/head-icon/porfile_icon_qiye_hig.png');
100 109
  }
101 110
  &.icon-staff{
102
    @include bg-image('/static/comimg/porfile_icon_yuangong_hig.png');
111
    @include bg-image('../assets/head-icon/porfile_icon_yuangong_hig.png');
103 112
  }
104 113
  &.icon-real{
105 114
    width:24px;
106
    @include bg-image('/static/comimg/porfile_icon_shimin_nor.png');
115
    @include bg-image('../assets/head-icon/porfile_icon_shimin_nor.png');
107 116
  }
108 117
}
109 118
  

BIN
static/comimg/g_article_icon_caogao_hig.png


BIN
static/comimg/g_article_icon_caogao_nor.png


BIN
static/comimg/g_article_icon_dingshi_hig.png


BIN
static/comimg/g_article_icon_dingshi_nor.png


BIN
static/comimg/g_article_icon_fabu_hig.png


BIN
static/comimg/g_article_icon_fabu_nor.png


BIN
static/comimg/g_article_icon_shanchu_hig.png


BIN
static/comimg/g_article_icon_shanchu_nor.png


BIN
static/comimg/g_article_icon_yulan_hig.png


BIN
static/comimg/g_article_icon_yulan_nor.png


console-front - Gogs: Go Git Service

暂无描述

standalone-framework.src.js 11KB

    /** * @license Highcharts JS v3.0.6 (2013-10-04) * * Standalone Highcharts Framework * * License: MIT License */ /*global Highcharts */ var HighchartsAdapter = (function () { var UNDEFINED, doc = document, emptyArray = [], timers = [], timerId, Fx; Math.easeInOutSine = function (t, b, c, d) { return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; }; /** * Extend given object with custom events */ function augment(obj) { function removeOneEvent(el, type, fn) { el.removeEventListener(type, fn, false); } function IERemoveOneEvent(el, type, fn) { fn = el.HCProxiedMethods[fn.toString()]; el.detachEvent('on' + type, fn); } function removeAllEvents(el, type) { var events = el.HCEvents, remove, types, len, n; if (el.removeEventListener) { remove = removeOneEvent; } else if (el.attachEvent) { remove = IERemoveOneEvent; } else { return; // break on non-DOM events } if (type) { types = {}; types[type] = true; } else { types = events; } for (n in types) { if (events[n]) { len = events[n].length; while (len--) { remove(el, n, events[n][len]); } } } } if (!obj.HCExtended) { Highcharts.extend(obj, { HCExtended: true, HCEvents: {}, bind: function (name, fn) { var el = this, events = this.HCEvents, wrappedFn; // handle DOM events in modern browsers if (el.addEventListener) { el.addEventListener(name, fn, false); // handle old IE implementation } else if (el.attachEvent) { wrappedFn = function (e) { fn.call(el, e); }; if (!el.HCProxiedMethods) { el.HCProxiedMethods = {}; } // link wrapped fn with original fn, so we can get this in removeEvent el.HCProxiedMethods[fn.toString()] = wrappedFn; el.attachEvent('on' + name, wrappedFn); } if (events[name] === UNDEFINED) { events[name] = []; } events[name].push(fn); }, unbind: function (name, fn) { var events, index; if (name) { events = this.HCEvents[name] || []; if (fn) { index = HighchartsAdapter.inArray(fn, events); if (index > -1) { events.splice(index, 1); this.HCEvents[name] = events; } if (this.removeEventListener) { removeOneEvent(this, name, fn); } else if (this.attachEvent) { IERemoveOneEvent(this, name, fn); } } else { removeAllEvents(this, name); this.HCEvents[name] = []; } } else { removeAllEvents(this); this.HCEvents = {}; } }, trigger: function (name, args) { var events = this.HCEvents[name] || [], target = this, len = events.length, i, preventDefault, fn; // Attach a simple preventDefault function to skip default handler if called preventDefault = function () { args.defaultPrevented = true; }; for (i = 0; i < len; i++) { fn = events[i]; // args is never null here if (args.stopped) { return; } args.preventDefault = preventDefault; args.target = target; args.type = name; // #2297 // If the event handler return false, prevent the default handler from executing if (fn.call(this, args) === false) { args.preventDefault(); } } } }); } return obj; } return { /** * Initialize the adapter. This is run once as Highcharts is first run. */ init: function (pathAnim) { /** * Compatibility section to add support for legacy IE. This can be removed if old IE * support is not needed. */ if (!doc.defaultView) { this._getStyle = function (el, prop) { var val; if (el.style[prop]) { return el.style[prop]; } else { if (prop === 'opacity') { prop = 'filter'; } /*jslint unparam: true*/ val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b) { return b.toUpperCase(); })]; if (prop === 'filter') { val = val.replace( /alpha\(opacity=([0-9]+)\)/, function (a, b) { return b / 100; } ); } /*jslint unparam: false*/ return val === '' ? 1 : val; } }; this.adapterRun = function (elem, method) { var alias = { width: 'clientWidth', height: 'clientHeight' }[method]; if (alias) { elem.style.zoom = 1; return elem[alias] - 2 * parseInt(HighchartsAdapter._getStyle(elem, 'padding'), 10); } }; } if (!Array.prototype.forEach) { this.each = function (arr, fn) { // legacy var i = 0, len = arr.length; for (; i < len; i++) { if (fn.call(arr[i], arr[i], i, arr) === false) { return i; } } }; } if (!Array.prototype.indexOf) { this.inArray = function (item, arr) { var len, i = 0; if (arr) { len = arr.length; for (; i < len; i++) { if (arr[i] === item) { return i; } } } return -1; }; } if (!Array.prototype.filter) { this.grep = function (elements, callback) { var ret = [], i = 0, length = elements.length; for (; i < length; i++) { if (!!callback(elements[i], i)) { ret.push(elements[i]); } } return ret; }; } //--- End compatibility section --- /** * Start of animation specific code */ Fx = function (elem, options, prop) { this.options = options; this.elem = elem; this.prop = prop; }; Fx.prototype = { update: function () { var styles, paths = this.paths, elem = this.elem, elemelem = elem.element; // if destroyed, it is null // Animating a path definition on SVGElement if (paths && elemelem) { elem.attr('d', pathAnim.step(paths[0], paths[1], this.now, this.toD)); // Other animations on SVGElement } else if (elem.attr) { if (elemelem) { elem.attr(this.prop, this.now); } // HTML styles } else { styles = {}; styles[elem] = this.now + this.unit; Highcharts.css(elem, styles); } if (this.options.step) { this.options.step.call(this.elem, this.now, this); } }, custom: function (from, to, unit) { var self = this, t = function (gotoEnd) { return self.step(gotoEnd); }, i; this.startTime = +new Date(); this.start = from; this.end = to; this.unit = unit; this.now = this.start; this.pos = this.state = 0; t.elem = this.elem; if (t() && timers.push(t) === 1) { timerId = setInterval(function () { for (i = 0; i < timers.length; i++) { if (!timers[i]()) { timers.splice(i--, 1); } } if (!timers.length) { clearInterval(timerId); } }, 13); } }, step: function (gotoEnd) { var t = +new Date(), ret, done, options = this.options, i; if (this.elem.stopAnimation) { ret = false; } else if (gotoEnd || t >= options.duration + this.startTime) { this.now = this.end; this.pos = this.state = 1; this.update(); this.options.curAnim[this.prop] = true; done = true; for (i in options.curAnim) { if (options.curAnim[i] !== true) { done = false; } } if (done) { if (options.complete) { options.complete.call(this.elem); } } ret = false; } else { var n = t - this.startTime; this.state = n / options.duration; this.pos = options.easing(n, 0, 1, options.duration); this.now = this.start + ((this.end - this.start) * this.pos); this.update(); ret = true; } return ret; } }; /** * The adapter animate method */ this.animate = function (el, prop, opt) { var start, unit = '', end, fx, args, name; el.stopAnimation = false; // ready for new if (typeof opt !== 'object' || opt === null) { args = arguments; opt = { duration: args[2], easing: args[3], complete: args[4] }; } if (typeof opt.duration !== 'number') { opt.duration = 400; } opt.easing = Math[opt.easing] || Math.easeInOutSine; opt.curAnim = Highcharts.extend({}, prop); for (name in prop) { fx = new Fx(el, opt, name); end = null; if (name === 'd') { fx.paths = pathAnim.init( el, el.d, prop.d ); fx.toD = prop.d; start = 0; end = 1; } else if (el.attr) { start = el.attr(name); } else { start = parseFloat(HighchartsAdapter._getStyle(el, name)) || 0; if (name !== 'opacity') { unit = 'px'; } } if (!end) { end = parseFloat(prop[name]); } fx.custom(start, end, unit); } }; }, /** * Internal method to return CSS value for given element and property */ _getStyle: function (el, prop) { return window.getComputedStyle(el).getPropertyValue(prop); }, /** * Downloads a script and executes a callback when done. * @param {String} scriptLocation * @param {Function} callback */ getScript: function (scriptLocation, callback) { // We cannot assume that Assets class from mootools-more is available so instead insert a script tag to download script. var head = doc.getElementsByTagName('head')[0], script = doc.createElement('script'); script.type = 'text/javascript'; script.src = scriptLocation; script.onload = callback; head.appendChild(script); }, /** * Return the index of an item in an array, or -1 if not found */ inArray: function (item, arr) { return arr.indexOf ? arr.indexOf(item) : emptyArray.indexOf.call(arr, item); }, /** * A direct link to adapter methods */ adapterRun: function (elem, method) { return parseInt(HighchartsAdapter._getStyle(elem, method), 10); }, /** * Filter an array */ grep: function (elements, callback) { return emptyArray.filter.call(elements, callback); }, /** * Map an array */ map: function (arr, fn) { var results = [], i = 0, len = arr.length; for (; i < len; i++) { results[i] = fn.call(arr[i], arr[i], i, arr); } return results; }, offset: function (el) { var left = 0, top = 0; while (el) { left += el.offsetLeft; top += el.offsetTop; el = el.offsetParent; } return { left: left, top: top }; }, /** * Add an event listener */ addEvent: function (el, type, fn) { augment(el).bind(type, fn); }, /** * Remove event added with addEvent */ removeEvent: function (el, type, fn) { augment(el).unbind(type, fn); }, /** * Fire an event on a custom object */ fireEvent: function (el, type, eventArguments, defaultFunction) { var e; if (doc.createEvent && (el.dispatchEvent || el.fireEvent)) { e = doc.createEvent('Events'); e.initEvent(type, true, true); e.target = el; Highcharts.extend(e, eventArguments); if (el.dispatchEvent) { el.dispatchEvent(e); } else { el.fireEvent(type, e); } } else if (el.HCExtended === true) { eventArguments = eventArguments || {}; el.trigger(type, eventArguments); } if (eventArguments && eventArguments.defaultPrevented) { defaultFunction = null; } if (defaultFunction) { defaultFunction(eventArguments); } }, washMouseEvent: function (e) { return e; }, /** * Stop running animation */ stop: function (el) { el.stopAnimation = true; }, /** * Utility for iterating over an array. Parameters are reversed compared to jQuery. * @param {Array} arr * @param {Function} fn */ each: function (arr, fn) { // modern browsers return Array.prototype.forEach.call(arr, fn); } }; }());