Browse Source

需求,消息chat,联系

lyn7568 6 years ago
parent
commit
8b7e6f6101
66 changed files with 2925 additions and 261 deletions
  1. 1 1
      build/utils.js
  2. 1 1
      package.json
  3. 7 1
      src/components/BeyondTo/index.vue
  4. 4 2
      src/components/CityPicker/index.vue
  5. 59 0
      src/components/ContactChat/index.vue
  6. 1 1
      src/components/PreviewMagnify/index.vue
  7. 6 2
      src/components/subTemplate/BaseExpert.vue
  8. 1 10
      src/layout/AppMain.vue
  9. 38 4
      src/layout/TheHeader.vue
  10. 9 3
      src/libs/axios.js
  11. 40 2
      src/libs/queryBase.js
  12. 86 25
      src/libs/util.js
  13. 12 28
      src/pages/center/router/index.js
  14. 30 20
      src/pages/center/views/attentionCollect.vue
  15. 1 1
      src/pages/center/views/modifyData.vue
  16. 5 5
      src/pages/center/views/myBusiness/companyProduct.vue
  17. 0 0
      src/pages/center/views/myBusiness/index.vue
  18. 1 1
      src/pages/center/views/myBusiness/publishProduct.vue
  19. 62 0
      src/pages/center/views/myDemands/BaseDemand.vue
  20. 342 0
      src/pages/center/views/myDemands/DemandIssue.vue
  21. 89 0
      src/pages/center/views/myDemands/delayDate.vue
  22. 204 0
      src/pages/center/views/myDemands/index.vue
  23. 0 1
      src/pages/center/views/myNeeds/examineDemand.vue
  24. 0 1
      src/pages/center/views/myNeeds/modifyDemand.vue
  25. 0 1
      src/pages/center/views/myNeeds/myNeed.vue
  26. 4 4
      src/pages/company/show.vue
  27. 2 2
      src/pages/content/show.vue
  28. 154 0
      src/pages/demand/closeOperate.vue
  29. 179 0
      src/pages/demand/completeOperate.vue
  30. 18 0
      src/pages/demand/demand.html
  31. 10 0
      src/pages/demand/demand.js
  32. 25 0
      src/pages/demand/demand.vue
  33. 326 0
      src/pages/demand/show.vue
  34. 11 9
      src/pages/expert/show.vue
  35. 1 0
      src/pages/index/index.js
  36. 30 0
      src/pages/index/permission.js
  37. 20 0
      src/pages/index/router/index.js
  38. 17 54
      src/pages/index/views/Dashboard/index.vue
  39. 72 0
      src/pages/index/views/InformList/index.vue
  40. 34 0
      src/pages/index/views/InformList/informItem.vue
  41. 271 0
      src/pages/index/views/MiniChat/components/list.vue
  42. 246 0
      src/pages/index/views/MiniChat/components/message.vue
  43. 162 0
      src/pages/index/views/MiniChat/components/text.vue
  44. 100 0
      src/pages/index/views/MiniChat/index.vue
  45. 2 8
      src/pages/index/views/ViewExpertPool/expItem.vue
  46. 4 4
      src/pages/index/views/ViewFindResource/index.vue
  47. 7 6
      src/pages/index/views/ViewFindResult/index.vue
  48. 4 4
      src/pages/index/views/ViewFindServe/index.vue
  49. 2 2
      src/pages/index/views/ViewOrganization/orgItem.vue
  50. 2 2
      src/pages/index/views/ViewPlatTrend/index.vue
  51. 1 1
      src/pages/index/views/logforms/enteringRegister.vue
  52. 1 1
      src/pages/index/views/logforms/findPwd.vue
  53. BIN
      src/pages/index/views/logforms/img/e-sign-on_bg_logo_nor.png
  54. 1 1
      src/pages/index/views/logforms/inviteCodeLogin.vue
  55. 1 1
      src/pages/index/views/logforms/loginPlat.vue
  56. 1 1
      src/pages/index/views/logforms/register.vue
  57. 3 3
      src/pages/index/views/logforms/style.scss
  58. 9 7
      src/pages/org/show.vue
  59. 42 1
      src/pages/resource/show.vue
  60. 35 37
      src/pages/result/show.vue
  61. 57 1
      src/pages/serve/show.vue
  62. 8 1
      src/store/getters.js
  63. 3 1
      src/store/index.js
  64. 41 0
      src/store/modules/chat.js
  65. 8 0
      src/store/modules/user.js
  66. 12 0
      src/styles/listitem.scss

+ 1 - 1
build/utils.js

@ -128,7 +128,7 @@ exports.createNotifierCallback = () => {
128 128
      title: packageConfig.name,
129 129
      message: severity + ': ' + error.name,
130 130
      subtitle: filename || '',
131
      icon: path.join(__dirname, 'logo.png')
131
      icon: path.join(__dirname, 'favicon.ico')
132 132
    })
133 133
  }
134 134
}

+ 1 - 1
package.json

@ -8,7 +8,7 @@
8 8
    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
9 9
    "linux-dev": "node --max_old_space_size=8192 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --progress --config build/webpack.dev.conf.js",
10 10
    "start": "npm run dev",
11
    "build": "node --max_old_space_size=4096 build/build.js"
11
    "build": "node build/build.js"
12 12
  },
13 13
  "dependencies": {
14 14
    "axios": "^0.17.1",

+ 7 - 1
src/components/BeyondTo/index.vue

@ -19,6 +19,7 @@
19 19
    </div>
20 20
    <div class="goSpan">
21 21
      <collectCo v-if="ownerType==='1'" :watchOptions="{oid: ownerId, type: 1}"></collectCo>
22
      <contactChat v-if="ownerType==='1'" :contactOptions="{oid: ownerId}"></contactChat>
22 23
      <collectCo v-if="ownerType==='2'" :watchOptions="{oid: ownerId, type: 2}"></collectCo>
23 24
    </div>
24 25
  </div>
@ -27,6 +28,7 @@
27 28
  import { ImageUrl, defaultSet, autho } from '@/libs/util';
28 29
  import queryBase from '@/libs/queryBase';
29 30
  import collectCo from '@/components/CollectCo';
31
  import contactChat from '@/components/ContactChat';
30 32
31 33
  export default {
32 34
    props: {
@ -43,7 +45,8 @@
43 45
      };
44 46
    },
45 47
    components: {
46
      collectCo
48
      collectCo,
49
      contactChat
47 50
    },
48 51
    created() {
49 52
      if (this.ownerId) {
@ -148,5 +151,8 @@
148 151
149 152
.beyond-block .goSpan{
150 153
  margin-top:15px;
154
  margin-right: -15px;
155
  display: flex;
156
  justify-content: center;
151 157
}
152 158
</style>

+ 4 - 2
src/components/CityPicker/index.vue

@ -108,17 +108,19 @@ export default {
108 108
      this.shi = p.defaultChild.value
109 109
      // this.areaArr = p.defaultChild.children
110 110
      // this.qu = p.defaultChild.defaultChild.value
111
      this.E = p.defaultChild.defaultChild.id
111
      this.E = p.defaultChild.id
112 112
      this.sheng = p.value
113 113
      this.$emit('paren', this.E)
114
      this.$emit('parenStr', this.shi)
114 115
    },
115 116
    choseCity: function(e) {
116 117
      var p = this.provinceArr[e.slice(0, 2) + '0000'].children[e]
117 118
      this.shi = p.value
118 119
      // this.areaArr = p.children
119 120
      // this.qu = p.defaultChild.value
120
      this.E = p.defaultChild.id
121
      this.E = p.id
121 122
      this.$emit('paren', this.E)
123
      this.$emit('parenStr', this.shi)
122 124
    },
123 125
    // choseBlock: function(e) {
124 126
    //   this.qu = this.provinceArr[e.slice(0, 2) + '0000'].children[e.slice(0, 4) + '00'].children[e].value

+ 59 - 0
src/components/ContactChat/index.vue

@ -0,0 +1,59 @@
1
<template>
2
  <div class="contact-block">
3
    <el-button type="primary" @click="contactChat" :disabled="contactOptions.type ? disableClick : false">联系</el-button>
4
  </div>
5
</template>
6
<script>
7
  import { loginStatus } from '@/libs/loginStatus';
8
  export default {
9
    props: ['contactOptions'],
10
    data() {
11
      return {
12
        disableClick: true,
13
        orglinkmans: []
14
      }
15
    },
16
    created() {
17
      if (this.contactOptions.type) {
18
        this.getDefaultLink()
19
      }
20
    },
21
    methods: {
22
      getDefaultLink() {
23
        var that = this
24
        this.$axios.getk('/ajax/org/linkman/queryAll',{
25
          oid: that.contactOptions.oid
26
        }, function(data) {
27
          if (data.success) {
28
            var $data = data.data;
29
            if ($data.length > 0) {
30
              that.disableClick = false
31
              for (var i = 0; i < $data.length; i++) {
32
                that.orglinkmans.push($data[i].pid)
33
              }
34
            } else {
35
              that.disableClick = true
36
            }
37
          }
38
        })
39
      },
40
      contactChat() {
41
        var that = this;
42
        loginStatus(function() {
43
          var linkId = that.contactOptions.oid
44
          if (that.contactOptions.type) {
45
            linkId = that.orglinkmans[0]
46
          }
47
          location.href='/#/miniChat?id='+ linkId
48
        })
49
      }
50
    }
51
  }
52
</script>
53
<style scoped>
54
.contact-block{
55
  margin-right:15px;
56
  font-size: 15px;
57
  line-height: 15px;
58
}
59
</style>

+ 1 - 1
src/components/PreviewMagnify/index.vue

@ -192,7 +192,7 @@ export default {
192 192
  }
193 193
194 194
  .magnify .zoom-box{
195
    background:rgba(0,0,0,.2);
195
    background:#FFFFFF;
196 196
    width: 300px;
197 197
    height: 300px;
198 198
    overflow: hidden;

+ 6 - 2
src/components/subTemplate/BaseExpert.vue

@ -1,6 +1,6 @@
1 1
<template>
2 2
  <a class="list-item" :href="'expert.html?id='+itemSingle.id" target="_blank">
3
    <div class="list-head" style="border-radius: 50%; width: 110px; height:110px" :style="{backgroundImage: 'url(' + imgUrl + ')'}"></div>
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 6
      <div class="list-desc">{{itemSingle.title}}</div>
@ -22,7 +22,7 @@
22 22
    },
23 23
    computed: {
24 24
      imgUrl() {
25
        if (this.itemSingle.hasHeadImage) {
25
        if (this.itemSingle && this.itemSingle.hasHeadImage) {
26 26
          return ImageUrl(('head/' + this.itemSingle.id + '_l.jpg'), true)
27 27
        } else {
28 28
          return defaultSet.img.expert
@ -35,3 +35,7 @@
35 35
    }
36 36
  };
37 37
</script>
38
39
<style scoped>
40
  .list-item .list-head{border-radius: 50%; width: 100px; height:100px}
41
</style>

+ 1 - 10
src/layout/AppMain.vue

@ -1,21 +1,12 @@
1 1
<template>
2 2
  <transition name="fade" mode="out-in">
3
    <router-view :key="key" :plat="plat"></router-view>
3
    <router-view :key="key"></router-view>
4 4
  </transition>
5 5
</template>
6 6
7 7
<script>
8 8
export default {
9 9
  name: 'AppMain',
10
  data() {
11
    return {
12
      plat: {}
13
    };
14
  },
15
  mounted() {
16
    /* eslint-disable no-undef */
17
    this.plat = PLAT.info;
18
  },
19 10
  computed: {
20 11
    key() {
21 12
      return this.$route.name !== undefined ? this.$route.name + +new Date() : this.$route + +new Date();

+ 38 - 4
src/layout/TheHeader.vue

@ -10,15 +10,15 @@
10 10
        </div>
11 11
        <div class="wrapper-right">
12 12
          <div v-if="account">
13
            <!-- <router-link class="marLeft" to='/loginPlat' tag="a">通知(99+)</router-link>
14
            <router-link class="marLeft" to='/loginPlat' tag="a">消息(99+)</router-link> -->
13
            <!-- <a class="marLeft marLeft_1" href='/#/inform'>通知({{informCount}})</a> -->
14
            <a class="marLeft marLeft_1" href='/#/miniChat'>消息({{unreadCount}})</a>
15 15
            <el-dropdown>
16 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 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> -->
21
                <a href="center.html#/myDemands"><el-dropdown-item>我的需求</el-dropdown-item></a>
22 22
                <a href="center.html#/companyInformation" v-if="bindCompany"><el-dropdown-item>我的企业</el-dropdown-item></a>
23 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>
@ -91,7 +91,9 @@
91 91
          }
92 92
        ],
93 93
        kexiuLink: ekexiuUrl,
94
        plat: ''
94
        plat: '',
95
        unreadCount: 0,
96
        informCount: 0
95 97
      };
96 98
    },
97 99
    computed: {
@ -107,6 +109,12 @@
107 109
        this.$store.dispatch('GetUserInfo').then(res => {})
108 110
      }
109 111
    },
112
    created() {
113
      if (localStorage.getItem('userid')) {
114
        this.queryMsgUnread()
115
        this.queryInformCount()
116
      }
117
    },
110 118
    methods: {
111 119
      activeCl(url) {
112 120
        if (this.$route && this.$route.name) {
@ -130,6 +138,32 @@
130 138
            }
131 139
          })
132 140
        }).catch(() => {})
141
      },
142
      queryMsgUnread() {
143
        this.$axios.get('/ajax/msg/unread', {}, function(res) {
144
          if (res.success) {
145
            var count = 0
146
            if (res.data > 99) {
147
              count = '99+'
148
            } else {
149
              count = res.data
150
            }
151
            this.unreadCount = count
152
          }
153
        })
154
      },
155
      queryInformCount() {
156
        // this.$axios.get('/ajax/inform/unread', {}, function(res) {
157
        //   if (res.success) {
158
        //     var count = 0
159
        //     if (res.data > 99) {
160
        //       count = '99+'
161
        //     } else {
162
        //       count = res.data
163
        //     }
164
        //     this.informCount = count
165
        //   }
166
        // })
133 167
      }
134 168
    }
135 169
  };

+ 9 - 3
src/libs/axios.js

@ -1,6 +1,7 @@
1
import axios from 'axios';
2
import qs from 'qs';
3
import { Message } from 'element-ui';
1
import axios from 'axios'
2
import qs from 'qs'
3
import store from '@/store'
4
import { Message } from 'element-ui'
4 5
5 6
let axiosUtil = axios.create({
6 7
    baseURL: process.env.BASE_API
@ -31,6 +32,11 @@ axiosUtil.interceptors.response.use(function (response) {
31 32
    if (!taR.success && taR.code === 0) {
32 33
      Message.error(taR.msg || taR.detailMsg)
33 34
    }
35
    if (!taR.success && taR.code === 1) {
36
      store.dispatch('FedLogOut').then(() => {
37
        Message.error('登录状态失效,请重新登录')
38
      })
39
    }
34 40
    return taR
35 41
  } else {
36 42
    Message.error('请求错误1,请重试')

+ 40 - 2
src/libs/queryBase.js

@ -6,12 +6,14 @@
6 6
var objCache = {
7 7
  professor: {},
8 8
  organization: {},
9
  company: {}
9
  company: {},
10
  pUser: {},
10 11
}
11 12
var objHcache = {
12 13
  professor: {},
13 14
  organization: {},
14
  company: {}
15
  company: {},
16
  pUser: {}
15 17
}
16 18
var objCacheHandler = {
17 19
  professor: function(id) {
@ -77,6 +79,28 @@ var objCacheHandler = {
77 79
        hc[i](false)
78 80
      }
79 81
    })
82
  },
83
  pUser: function(id) {
84
    var hc = objHcache.pUser[id]
85
    Vue.axios.get('/ajax/sys/user/get', {
86
      id: id
87
    }, function(data) {
88
      delete objHcache.pUser[id]
89
      if (data.success) {
90
        objCache.pUser[id] = data.data
91
        for (let i = 0; i < hc.length; ++i) {
92
          hc[i](true, data.data)
93
        }
94
      } else {
95
        for (let i = 0; i < hc.length; ++i) {
96
          hc[i](false)
97
        }
98
      }
99
    }, function() {
100
      for (let i = 0; i < hc.length; ++i) {
101
        hc[i](false)
102
      }
103
    })
80 104
  }
81 105
}
82 106
var cacheModel = {
@ -121,6 +145,20 @@ var cacheModel = {
121 145
        objCacheHandler.company(id)
122 146
      }
123 147
    }
148
  },
149
  getPUser: function(id, handler) {
150
    var data = objCache.pUser[id]
151
    if (data) {
152
      handler(true, data)
153
    } else {
154
      if (objHcache.pUser[id]) {
155
        objHcache.pUser[id].push(handler)
156
      } else {
157
        objHcache.pUser[id] = []
158
        objHcache.pUser[id].push(handler)
159
        objCacheHandler.pUser(id)
160
      }
161
    }
124 162
  }
125 163
}
126 164

+ 86 - 25
src/libs/util.js

@ -43,7 +43,7 @@ export const urlParse = function (name) {
43 43
  return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || ['', ''])[1].replace(/\+/g, '%20')) || null;
44 44
};
45 45
46
export const trimStr = function(str) {
46
export const trimStr = function (str) {
47 47
  return str.replace(/(^\s*)|(\s*$)/g, '')
48 48
}
49 49
@ -160,14 +160,14 @@ export const arrToStr = function (arr) {
160 160
 * @example
161 161
 * getFormatCode('测\r\n\s试')  =>  “测<br/> 试”
162 162
 */
163
export const getFormatCode = function(strValue) {
163
export const getFormatCode = function (strValue) {
164 164
  return strValue.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
165 165
};
166 166
167 167
/**
168 168
 * 时间显示规则
169 169
 */
170
export const commenTime = function(startTime, flag) {
170
export const commenTime = function (startTime, flag) {
171 171
  var nowTimg = new Date();
172 172
  var startdate = new Date();
173 173
  startdate.setFullYear(parseInt(startTime.substring(0, 4)));
@ -202,28 +202,89 @@ export const commenTime = function(startTime, flag) {
202 202
  };
203 203
};
204 204
205
export const TimeTr = function(dealtime) {
206
  var myDate = new Date();
207
  var Fy = myDate.getFullYear();
208
  var s = dealtime;
209
  var y = s.substr(0, 4);
210
  var m = s.substr(4, 2);
211
  var d = s.substr(6, 2);
212
  var h = s.substr(8, 2);
213
  var minute = s.substr(10, 2);
214
  var formatTime;
215
  if (s.length <= 6) {
216
    formatTime = y + '年' + m.replace(/\b(0+)/gi, '') + '月';
217
  } else if (s.length > 6 && s.length <= 8) {
218
    formatTime = m.replace(/\b(0+)/gi, '') + '月' + d.replace(/\b(0+)/gi, '') + '日 ';
219
    if (Number(y) !== Fy) {
220
      formatTime = y + '年' + m.replace(/\b(0+)/gi, '') + '月' + d.replace(/\b(0+)/gi, '') + '日 ';
221
    }
222
  } else {
223
    formatTime = m.replace(/\b(0+)/gi, '') + '月' + d.replace(/\b(0+)/gi, '') + '日 ' + h + ':' + minute;
224
    if (Number(y) !== Fy) {
225
      formatTime = y + '年' + m.replace(/\b(0+)/gi, '') + '' + d.replace(/\b(0+)/gi, '') + '日 ' + h + ':' + minute;
205
export const TimeTr = function (dealtime, flag) {
206
  if (dealtime) {
207
    var myDate = new Date()
208
    var Fy = myDate.getFullYear()
209
    var s = dealtime
210
    var y = s.substr(0, 4)
211
    var m = s.substr(4, 2)
212
    var d = s.substr(6, 2)
213
    var h = ''
214
    var minute = ''
215
    var formatTime
216
    if (s.length <= 6) {
217
      formatTime = y + '年' + m.replace(/\b(0+)/gi, '') + '月'
218
      if (flag) {
219
        formatTime = y + '/' + m.replace(/\b(0+)/gi, '')
220
      }
221
    } else if (s.length > 6 && s.length <= 8) {
222
      h = s.substr(8, 2)
223
      formatTime = m.replace(/\b(0+)/gi, '') + '月' + d.replace(/\b(0+)/gi, '') + '日 '
224
      if (flag) {
225
        formatTime = m.replace(/\b(0+)/gi, '') + '/' + d.replace(/\b(0+)/gi, '')
226
      }
227
      if (Number(y) !== Fy) {
228
        formatTime = y + '年' + m.replace(/\b(0+)/gi, '') + '月' + d.replace(/\b(0+)/gi, '') + '日 '
229
        if (flag) {
230
          formatTime = y + '/' + m.replace(/\b(0+)/gi, '') + '/' + d.replace(/\b(0+)/gi, '')
231
        }
232
      }
233
    } else {
234
      h = s.substr(8, 2)
235
      minute = s.substr(10, 2)
236
      formatTime = m.replace(/\b(0+)/gi, '') + '月' + d.replace(/\b(0+)/gi, '') + '日 ' + h + ':' + minute
237
      if (flag) {
238
        formatTime = m.replace(/\b(0+)/gi, '') + '/' + d.replace(/\b(0+)/gi, '') + ' ' + h + ':' + minute
239
      }
240
      if (Number(y) !== Fy) {
241
        formatTime = y + '年' + m.replace(/\b(0+)/gi, '') + '月' + d.replace(/\b(0+)/gi, '') + '日 ' + h + ':' + minute
242
        if (flag) {
243
          formatTime = y + '/' + m.replace(/\b(0+)/gi, '') + '/' + d.replace(/\b(0+)/gi, '') + ' ' + h + ':' + minute
244
        }
245
      }
226 246
    }
247
    return formatTime;
227 248
  }
228
  return formatTime;
229 249
};
250
251
export const delayDay = function (t) {
252
  var dateToday = new Date()
253
  var dateInvalid = new Date()
254
  dateInvalid.setFullYear(parseInt(t.substring(0, 4)))
255
  dateInvalid.setMonth(parseInt(t.substring(4, 6)) - 1)
256
  dateInvalid.setDate(parseInt(t.substring(6, 8)))
257
258
  var dateGap = Math.abs(dateToday.getTime() - dateInvalid.getTime())
259
  var ifDelay = false
260
  if (dateGap < 7 * 24 * 60 * 60 * 1000) {
261
    ifDelay = true
262
  }
263
  return ifDelay
264
}
265
266
267
// 对Date的扩展,将 Date 转化为指定格式的String   
268
// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,   
269
// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)   
270
// 例子:   
271
// (new Date()).Format('yyyy-MM-dd hh:mm:ss.S') ==> 2006-07-02 08:09:04.423   
272
// (new Date()).Format('yyyy-M-d h:m:s.S')      ==> 2006-7-2 8:9:4.18 
273
export const DateFormat = function (fmt) {
274
  var that = new Date()
275
  var o = {
276
    'M+': that.getMonth() + 1,                 //月份   
277
    'd+': that.getDate(),                    //日   
278
    'h+': that.getHours(),                   //小时   
279
    'm+': that.getMinutes(),                 //分   
280
    's+': that.getSeconds(),                 //秒   
281
    'q+': Math.floor((that.getMonth() + 3) / 3), //季度   
282
    'S': that.getMilliseconds()             //毫秒   
283
  };
284
  if (/(y+)/.test(fmt))
285
    fmt = fmt.replace(RegExp.$1, (that.getFullYear() + '').substr(4 - RegExp.$1.length))
286
  for (var k in o)
287
    if (new RegExp('(' + k + ')').test(fmt))
288
      fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
289
  return fmt
290
} 

+ 12 - 28
src/pages/center/router/index.js

@ -5,7 +5,7 @@ const constantRouterMap = [
5 5
    path: '/',
6 6
    name: 'personalCenter',
7 7
    redirect: { name: 'modifyData' },
8
    meta: { title: '个人中心' },
8
    meta: { title: '个人中心', requireAuth: true },
9 9
    component: Layout,
10 10
    children: [
11 11
      {
@ -13,35 +13,19 @@ const constantRouterMap = [
13 13
        alwaysShow: true,
14 14
        component: (resolve) => require(['../views/modifyData'], resolve),
15 15
        name: 'modifyData',
16
        meta: { title: '修改资料', requireAuth: true }
16
        meta: { title: '修改资料' }
17
      },
18
      {
19
        path: '/myDemands',
20
        component: (resolve) => require(['../views/myDemands/index'], resolve),
21
        name: 'myDemands',
22
        meta: { title: '我的需求' }
17 23
      },
18
      // {
19
      //   path: '/myNeeds',
20
      //   component: (resolve) => require(['../views/myNeeds/index'], resolve),
21
      //   name: 'myNeeds',
22
      //   meta: { title: '我的需求' },
23
      //   children: [{
24
      //     path: '/modifyDemand',
25
      //     component: (resolve) => require(['../views/myNeeds/modifyDemand'], resolve),
26
      //     name: 'modifyDemand',
27
      //     meta: { title: '修改需求' }
28
      //   }, {
29
      //     path: '/examineDemand',
30
      //     component: (resolve) => require(['../views/myNeeds/examineDemand'], resolve),
31
      //     name: 'examineDemand',
32
      //     meta: { title: '查看需求' }
33
      //   }, {
34
      //     path: '/myDemand',
35
      //     component: (resolve) => require(['../views/myNeeds/myNeed'], resolve),
36
      //     name: 'myDemand',
37
      //     meta: { title: '我的需求' }
38
      //   }]
39
      // },
40 24
      {
41 25
        path: '/myBusiness',
42
        component: (resolve) => require(['../views/myNeeds/index'], resolve),
26
        component: (resolve) => require(['../views/myBusiness/index'], resolve),
43 27
        name: 'myBusiness',
44
        meta: { title: '我的企业', requireAuth: true },
28
        meta: { title: '我的企业' },
45 29
        children: [
46 30
          {
47 31
            path: '/companyInformation',
@ -61,14 +45,14 @@ const constantRouterMap = [
61 45
        alwaysShow: true,
62 46
        component: (resolve) => require(['../views/attentionCollect'], resolve),
63 47
        name: 'attentionCollect',
64
        meta: { title: '关注收藏', requireAuth: true }
48
        meta: { title: '关注收藏' }
65 49
      },
66 50
      {
67 51
        path: '/modifyPassword',
68 52
        alwaysShow: true,
69 53
        component: (resolve) => require(['../views/modifyPassword'], resolve),
70 54
        name: 'modifyPassword',
71
        meta: { title: '修改密码', requireAuth: true }
55
        meta: { title: '修改密码' }
72 56
      }
73 57
    ]
74 58
  }

+ 30 - 20
src/pages/center/views/attentionCollect.vue

@ -2,34 +2,44 @@
2 2
  <el-tabs v-model="activeName" @tab-click="handleClick">
3 3
    <el-tab-pane v-for="item in navbarArray" :key="item.index" :label="item.text" :name="item.wtype" v-loading="loadingPane">
4 4
      <div v-if="watchList && watchList.length">
5
        <div class="con-item" v-if="item.wtype===activeName && activeName==='1'">
6
          <baseExpert v-for="watc in watchList" :key="watc.index" :itemSingle="watc"></baseExpert>
7
          <div class="dele">
8
            <el-button type="danger" size="mini" @click.stop="handerDel(watc)">移除</el-button>
5
        <div v-if="item.wtype===activeName && activeName==='1'">
6
          <div class="con-item" v-for="watc in watchList" :key="watc.index">
7
            <baseExpert :itemSingle="watc"></baseExpert>
8
            <div class="dele">
9
              <el-button type="danger" size="mini" @click.stop="handerDel(watc)">移除</el-button>
10
            </div>
9 11
          </div>
10 12
        </div>
11
        <div class="con-item" v-if="item.wtype===activeName && activeName==='2'">
12
          <baseOrg v-for="watc in watchList" :key="watc.index" :itemSingle="watc"></baseOrg>
13
          <div class="dele">
14
            <el-button type="danger" size="mini" @click.stop="handerDel(watc)">移除</el-button>
13
        <div v-if="item.wtype===activeName && activeName==='2'">
14
          <div class="con-item" v-for="watc in watchList" :key="watc.index">
15
            <baseOrg :itemSingle="watc"></baseOrg>
16
            <div class="dele">
17
              <el-button type="danger" size="mini" @click.stop="handerDel(watc)">移除</el-button>
18
            </div>
15 19
          </div>
16 20
        </div>
17
        <div class="con-item" v-if="item.wtype===activeName && activeName==='3'">
18
          <baseService v-for="watc in watchList" :key="watc.index" :itemSingle="watc"></baseService>
19
          <div class="dele">
20
            <el-button type="danger" size="mini" @click.stop="handerDel(watc)">移除</el-button>
21
        <div v-if="item.wtype===activeName && activeName==='3'">
22
          <div class="con-item" v-for="watc in watchList" :key="watc.index">
23
            <baseService :itemSingle="watc"></baseService>
24
            <div class="dele">
25
              <el-button type="danger" size="mini" @click.stop="handerDel(watc)">移除</el-button>
26
            </div>
21 27
          </div>
22 28
        </div>
23
        <div class="con-item" v-if="item.wtype===activeName && activeName==='4'">
24
          <baseResource v-for="watc in watchList" :key="watc.index" :itemSingle="watc"></baseResource>
25
          <div class="dele">
26
            <el-button type="danger" size="mini" @click.stop="handerDel(watc)">移除</el-button>
29
        <div v-if="item.wtype===activeName && activeName==='4'">
30
          <div class="con-item" v-for="watc in watchList" :key="watc.index">
31
            <baseResource :itemSingle="watc"></baseResource>
32
            <div class="dele">
33
              <el-button type="danger" size="mini" @click.stop="handerDel(watc)">移除</el-button>
34
            </div>
27 35
          </div>
28 36
        </div>
29
        <div class="con-item" v-if="item.wtype===activeName && activeName==='5'">
30
          <baseResult v-for="watc in watchList" :key="watc.index" :itemSingle="watc"></baseResult>
31
          <div class="dele">
32
            <el-button type="danger" size="mini" @click.stop="handerDel(watc)">移除</el-button>
37
        <div v-if="item.wtype===activeName && activeName==='5'">
38
          <div class="con-item" v-for="watc in watchList" :key="watc.index">
39
            <baseResult :itemSingle="watc"></baseResult>
40
            <div class="dele">
41
              <el-button type="danger" size="mini" @click.stop="handerDel(watc)">移除</el-button>
42
            </div>
33 43
          </div>
34 44
        </div>
35 45
      </div>

+ 1 - 1
src/pages/center/views/modifyData.vue

@ -32,7 +32,7 @@
32 32
              <el-input v-model="ruleForm2.email" placeholder="请输入联系邮箱" maxlength="100"></el-input>
33 33
            </el-form-item>
34 34
            <el-form-item label="所在城市" prop="addr">
35
              <cityPicker @paren="toshow" :addrCode="ruleForm2.addr"></cityPicker>
35
              <cityPicker v-if="ruleForm2.addr" @paren="toshow" :addrCode="ruleForm2.addr"></cityPicker>
36 36
            </el-form-item>
37 37
          </el-col>
38 38
          <el-col :span="12">

+ 5 - 5
src/pages/center/views/myBusiness/companyProduct.vue

@ -6,8 +6,8 @@
6 6
          <div class="search-wrapper" align="right">
7 7
            <el-button type="primary" icon="el-icon-edit" @click="handerAdd">发布产品</el-button>
8 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">
9
          <div class="con-box" v-if="platProducts.length" v-loading="tableLoading">
10
            <div class="con-item" v-for="item in platProducts" :key="item.index">
11 11
              <baseProduct :itemSingle="item" :showTime="true"></baseProduct>
12 12
              <div class="dele">
13 13
                <el-button type="primary" size="mini" @click.stop="handerUpdate(item.id)">修改</el-button>
@ -25,6 +25,7 @@
25 25
              </el-pagination>
26 26
            </div>
27 27
          </div>
28
          <defaultPage v-else></defaultPage>
28 29
        </el-tab-pane>
29 30
      </el-tabs>
30 31
    </div>
@ -113,9 +114,8 @@
113 114
      },
114 115
      handerDel(id) {
115 116
        var that = this
116
        this.$cofirm('删除后,该产品将不能恢复,您确定要删除吗?', '提示', {
117
          type: 'warning',
118
          center: true
117
        this.$cofirm('删除后,该产品将不能恢复,您确定要删除吗?', '删除产品', {
118
          type: 'warning'
119 119
        }).then(() => {
120 120
          that.$axios.post('/ajax/product/delete', {
121 121
            id: id

src/pages/center/views/myNeeds/index.vue → src/pages/center/views/myBusiness/index.vue


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

@ -121,7 +121,7 @@
121 121
        var that = this
122 122
        if (id) {
123 123
          this.productId = id
124
          this.getProductInfo(id)
124
          this.getProductInfo()
125 125
          this.getProductKeyword()
126 126
        } else {
127 127
          this.formObj = {

+ 62 - 0
src/pages/center/views/myDemands/BaseDemand.vue

@ -0,0 +1,62 @@
1
<template>
2
  <a class="list-item list-item-info" :href="'demand.html?id='+demandInfo.id" target="_blank">
3
    <div class="list-info">
4
      <div class="list-tit">{{demandInfo.title}}</div>
5
      <ul class="list-tag">
6
        <li>发布于 {{TimeTr(demandInfo.createTime)}}</li>
7
        <li>回复 {{count}}</li>
8
        <li v-if="expiredShow" class="colorRed">已于 {{TimeTr(demandInfo.invalidDay)}} 过期</li>
9
        <li v-if="!expiredShow && overdueShow" class="colorRed">即将于 {{TimeTr(demandInfo.invalidDay)}} 过期</li>
10
        <li v-if="demandInfo.state===2">已于 {{TimeTr(demandInfo.overTime)}} 完成</li>
11
        <li v-if="demandInfo.state===3">已于 {{TimeTr(demandInfo.closeTime)}} 关闭</li>
12
      </ul>
13
    </div>
14
  </a>
15
</template>
16
17
<script>
18
  import { delayDay, TimeTr } from '@/libs/util';
19
  export default {
20
    props: {
21
      itemSingle: {
22
        type: Object
23
      }
24
    },
25
    data() {
26
      return {
27
        curDate: (new Date()).toISOString().substring(0,10).replace(/-/g, ''),
28
        count: 0,
29
        TimeTr: TimeTr
30
      };
31
    },
32
    computed: {
33
      demandInfo() {
34
        var obj = this.itemSingle
35
        return obj
36
      },
37
      expiredShow() {
38
        return this.demandInfo.state === 1 && this.curDate > this.demandInfo.invalidDay
39
      },
40
      overdueShow() {
41
        return this.demandInfo.state === 1 && delayDay(this.demandInfo.invalidDay)
42
      }
43
    },
44
    created() {
45
      if (this.demandInfo.id) {
46
        this.rebackCount()
47
      }
48
    },
49
    methods: {
50
      rebackCount() {
51
        var that = this
52
        this.$axios.get('/ajax/demand/pro/count', {
53
          id: that.demandInfo.id
54
        }, function(res) {
55
          if (res.success) {
56
            that.count = res.data
57
          }
58
        })
59
      }
60
    }
61
  };
62
</script>

+ 342 - 0
src/pages/center/views/myDemands/DemandIssue.vue

@ -0,0 +1,342 @@
1
<template>
2
  <el-dialog :title="operateM.tit" :visible.sync="dialogFormVisible" width="700px" :close-on-click-modal="false" @close="closeDialog">
3
    <div class="tip-show" v-if="!demandId">
4
      <div class="tip-h2">1. 发布需求  →  2. 为您对接专家或机构  →  3. 在线沟通  →  4. 开展合作,解决您的需求</div>
5
    </div>
6
    <div class="demandIssue content-wrapper">
7
      <el-form :model="ruleFormDem" :rules="rules" ref="ruleFormDem" class="form-main">
8
        <el-row :gutter="10">
9
          <el-col :span="24">
10
            <el-form-item label="需求主题" prop="title">
11
              <el-input v-model="ruleFormDem.title" maxlength="50" placeholder="请用一句话概括您的需求"></el-input>
12
            </el-form-item>
13
          </el-col>
14
          <el-col :span="24">
15
            <el-form-item label="需求内容" prop="descp">
16
              <el-input type="textarea" :rows="4" v-model="ruleFormDem.descp" maxlength="1000" placeholder="请描述您的需求背景、具体问题、对专家的要求等等"></el-input>
17
            </el-form-item>
18
          </el-col>
19
          <el-col :span="12">
20
            <el-form-item label="所在城市" prop="city">
21
              <el-col :span="24">
22
                <cityPicker @paren="toshow" @parenStr="toshowStr" :addrCode="ruleFormDem.city"></cityPicker>
23
              </el-col>
24
            </el-form-item>
25
          </el-col>
26
          <el-col :span="12">
27
            <el-form-item label="需求有效期" prop="invalidDay">
28
              <el-date-picker
29
                v-model="ruleFormDem.invalidDay"
30
                type="date"
31
                format="yyyy-MM-dd"
32
                value-format="yyyyMMdd"
33
                :default-value="defaultDate"
34
                :editable="false"
35
                placeholder="请选择截止日期"
36
                :picker-options="pickerOptions0">
37
              </el-date-picker>
38
            </el-form-item>
39
          </el-col>
40
          <el-col :span="12">
41
            <el-form-item label="预计合作周期" prop="duration">
42
              <el-select v-model="ruleFormDem.duration" placeholder="请选择预计合作周期" @change="changeDuration">
43
                <el-option
44
                  v-for="item in longTime"
45
                  :key="item.value"
46
                  :label="item.label"
47
                  :value="item.value">
48
                </el-option>
49
              </el-select>
50
            </el-form-item>
51
          </el-col>
52
          <el-col :span="12">
53
            <el-form-item label="费用预算" prop="cost">
54
              <el-select v-model="ruleFormDem.cost" placeholder="请选择预算范围" @change="changeCost">
55
                <el-option
56
                  v-for="item in costRange"
57
                  :key="item.value"
58
                  :label="item.label"
59
                  :value="item.value">
60
                </el-option>
61
              </el-select>
62
            </el-form-item>
63
          </el-col>
64
          <el-col :span="24"><div class="form-line"></div></el-col>
65
          <el-col :span="12">
66
            <el-form-item label="需求方名称" prop="linkOrg">
67
              <el-input v-model="ruleFormDem.linkOrg" placeholder="建议填写您的企业名称" maxlength="50"></el-input>
68
            </el-form-item>
69
          </el-col>
70
          <el-col :span="12">
71
            <el-form-item label="联系电话" prop="linkPhone">
72
              <el-input v-model="ruleFormDem.linkPhone" placeholder="请输入您的联系电话" maxlength="50"></el-input>
73
            </el-form-item>
74
          </el-col>
75
          <el-col :span="24" ><el-form-item style="height:20px"></el-form-item></el-col>
76
          <el-col :span="24" >
77
            <el-form-item align="center">
78
              <el-button type="primary" @click="submitForm('ruleFormDem')" style="padding: 12px 50px">保存</el-button><br/>
79
            </el-form-item>
80
          </el-col>
81
        </el-row>
82
      </el-form>
83
    </div>
84
  </el-dialog>
85
</template>
86
<script>
87
  import queryDict from '@/libs/queryDict'
88
  import cityPicker from '@/components/CityPicker'
89
90
  export default {
91
    props: ['operateM'],
92
    data() {
93
      var delayValidate = (rule, value, callback) => {
94
        if (value === '') {
95
          callback(new Error('请选择截止日期'))
96
        } else {
97
          let curDate = (new Date()).toISOString().substring(0, 10).replace(/-/g, '')
98
          if (curDate > value) {
99
            callback(new Error('已过期,请重新选择'))
100
          } else {
101
            callback()
102
          }
103
        }
104
      }
105
      return {
106
        dialogFormVisible: false,
107
        pickerOptions0: {
108
          disabledDate(time) {
109
            return time.getTime() < Date.now()
110
          }
111
        },
112
        defaultDate: Date.now(),
113
        demandId: '',
114
        longTime: [],
115
        costRange: [],
116
        cityRange: [],
117
        ruleFormDem: {
118
          title: '',
119
          descp: '',
120
          city: '',
121
          invalidDay: '',
122
          linkPhone: '',
123
          linkOrg: '',
124
          cost: '',
125
          duration: '',
126
          cityStr: '',
127
          costStr: '',
128
          durationStr: ''
129
        },
130
        rules: {
131
          title: [
132
            { required: true, message: '请填写需求主题', trigger: 'blur' }
133
          ],
134
          descp: [
135
            { required: true, message: '请填写需求内容', trigger: 'blur' },
136
            { max: 1000, message: '不得超过1000个字', trigger: 'blur' }
137
          ],
138
          city: [
139
            { required: true, message: '请选择所在城市', trigger: 'blur' }
140
          ],
141
          invalidDay: [
142
            { required: true, validator: delayValidate, trigger: 'blur' }
143
          ],
144
          linkOrg: [
145
            { required: true, message: '请填写您所在的企业名称', trigger: 'blur' },
146
            { max: 50, message: '不得超过50个字', trigger: 'blur' }
147
          ],
148
          linkPhone: [
149
            { required: true, message: '请填写您的联系电话', trigger: 'blur' }
150
          ]
151
        }
152
      };
153
    },
154
    components: {
155
      cityPicker
156
    },
157
    created() {
158
      this.getDictoryData()
159
    },
160
    methods: {
161
      getDictoryData() {
162
        const that = this
163
        queryDict.applyDict('XZQH', function(dictData) {
164
          dictData.map(item => {
165
            that.cityRange[item.code] = item.caption
166
          })
167
        }) // 城市
168
        queryDict.applyDict('FYYS', function(dictData) {
169
          dictData.map(item => {
170
            that.costRange.push({ value: item.code, label: item.caption })
171
          })
172
        }) // 费用预算
173
        queryDict.applyDict('HZZQ', function(dictData) {
174
          dictData.map(item => {
175
            that.longTime.push({ value: item.code, label: item.caption })
176
          })
177
        }) // 合作周期
178
      },
179
      parentFun(id) {
180
        var that = this
181
        if (id) {
182
          this.demandId = id
183
          this.getDemandInfo()
184
        } else {
185
          this.ruleFormDem = {}
186
          const curphone = localStorage.getItem('curphone')
187
          const curcomp = localStorage.getItem('curcomp')
188
          this.ruleFormDem.linkPhone = (curphone && curphone !== 'undefined') ? curphone : ''
189
          this.ruleFormDem.linkOrg = (curcomp && curcomp !== 'undefined') ? curcomp : ''
190
        }
191
        setTimeout(function() {
192
          that.dialogFormVisible = true
193
        }, 0)
194
      },
195
      getDemandInfo() {
196
        var that = this
197
        that.$axios.get('/ajax/demand/qo', {
198
          id: that.demandId
199
        }, function(res) {
200
          if (res.success) {
201
            const obj = res.data
202
            if (obj.cost) {
203
              let costMM = that.costRange.find((item)=>{
204
                return item.value === obj.cost
205
              })
206
              obj.costStr = costMM.label
207
            }
208
            if (obj.duration) {
209
              let durationMM = that.longTime.find((item)=>{
210
                return item.value === obj.duration
211
              })
212
              obj.durationStr = durationMM.label
213
            }
214
            if (obj.city) {
215
              obj.cityStr = that.cityRange[obj.city]
216
            }
217
            that.ruleFormDem = obj
218
          }
219
        })
220
      },
221
      submitForm(formName) {
222
        var that = this
223
        this.$refs[formName].validate((valid) => {
224
          if (valid) {
225
            var obj = this.ruleFormDem
226
            let paramsData = {
227
              title: obj.title,
228
              descp: obj.descp,
229
              city: obj.city,
230
              invalidDay: obj.invalidDay,
231
              linkPhone: obj.linkPhone,
232
              linkOrg: obj.linkOrg,
233
              cost: obj.cost,
234
              duration: obj.duration,
235
              cityStr: obj.cityStr,
236
              costStr: obj.costStr,
237
              durationStr: obj.durationStr
238
            }
239
            if (that.demandId) {
240
              const paramsId = { id: that.demandId }
241
              const objPar = Object.assign(paramsId, paramsData)
242
              that.$axios.put('/ajax/demand/modify', objPar, function(res) {
243
                if (res.success) {
244
                  that.$message({
245
                    message: '修改成功',
246
                    type: 'success'
247
                  })
248
                  setTimeout(function() {
249
                    that.dialogFormVisible = false
250
                    if (!that.operateM.flag) {
251
                      that.$parent.handleClick()
252
                    }
253
                  }, 0)
254
                }
255
              })
256
            } else {
257
              that.$axios.post('/ajax/demand/publish', paramsData, function(res) {
258
                if (res.success) {
259
                  that.$alert('我们已收到您的需求,马上为您对接专家和机构,您可以在【我的需求】中查看。', '需求发布成功!', {
260
                    type: 'success',
261
                    center: true,
262
                    callback: action => {
263
                      if (action === 'confirm') {
264
                        setTimeout(function() {
265
                          that.dialogFormVisible = false
266
                          if (!that.operateM.flag) {
267
                            that.$parent.handleClick()
268
                            that.closeDialog()
269
                          }
270
                        }, 0)
271
                      }
272
                    }
273
                  })
274
                }
275
              })
276
            }
277
          } else {
278
            return false
279
          }
280
        })
281
      },
282
      changeDuration(val) {
283
        let obj = {}
284
        obj = this.longTime.find((item)=>{
285
          return item.value === val
286
        })
287
        this.ruleFormDem.durationStr = obj.label
288
      },
289
      changeCost(val) {
290
        let obj = {}
291
        obj = this.costRange.find((item)=>{
292
          return item.value === val
293
        })
294
        this.ruleFormDem.costStr = obj.label
295
      },
296
      toshow(value) {
297
        this.ruleFormDem.city = value
298
      },
299
      toshowStr(value) {
300
        this.ruleFormDem.cityStr = value
301
      },
302
      closeDialog() {
303
        this.dialogFormVisible = false
304
        this.$refs['ruleFormDem'].resetFields()
305
        this.$refs['ruleFormDem'].clearValidate()
306
      }
307
    }
308
  };
309
</script>
310
<style scoped>
311
.tip-show {
312
    background: #409eff;
313
    text-align: center;
314
    -ms-flex-pack: justify;
315
    justify-content: space-between;
316
    margin: -30px -20px 10px;
317
    padding: 20px;
318
    color: #fff;
319
}
320
.cityParent {
321
    position: relative;
322
    z-index: 2;
323
}
324
.el-form-item__content {
325
    line-height: 40px;
326
    position: relative;
327
    font-size: 14px;
328
}
329
.demandIssue{
330
  padding: 10px;
331
}
332
.demandIssue .form-main{
333
  width:100%
334
}
335
.demandIssue .form-main .form-line{
336
  border-top:1px dashed #ccc;
337
  margin-bottom:20px;
338
}
339
.demandIssue .el-select{
340
  width:100%;
341
}
342
</style>

+ 89 - 0
src/pages/center/views/myDemands/delayDate.vue

@ -0,0 +1,89 @@
1
<template>
2
  <el-dialog title="请设置需求有效期" :visible.sync="delayDialogVisible"
3
  :close-on-click-modal="false"
4
  @close="closedDiloag" width="420px">
5
    <div class="demandIssue content-wrapper">
6
      <el-date-picker style="margin-bottom:40px"
7
        v-model="invalidDay"
8
        type="date"
9
        format="yyyy-MM-dd"
10
        value-format="yyyyMMdd"
11
        :editable="false"
12
        placeholder="请选择截止日期"
13
        :picker-options="pickerOptions0">
14
      </el-date-picker>
15
      <div class="el-btn-col">
16
        <div class="el-btn-col-box" align="center">
17
          <el-button type="primary" @click="submitReq">确定</el-button>
18
          <el-button type="info" @click="closedDiloag">关闭</el-button>
19
        </div>
20
      </div>
21
    </div>
22
  </el-dialog>
23
</template>
24
<script>
25
  export default {
26
    data() {
27
      return {
28
        delayDialogVisible: false,
29
        pickerOptions0: {
30
          disabledDate(time) {
31
            return time.getTime() < Date.now();
32
          }
33
        },
34
        invalidDay: ''
35
      };
36
    },
37
    created() {
38
    },
39
    methods: {
40
      parentFun(id) {
41
        var that = this
42
        if (id) {
43
          this.demandId = id
44
        }
45
        setTimeout(function() {
46
          that.delayDialogVisible = true
47
        }, 0)
48
      },
49
      submitReq() {
50
        var that = this
51
        if (!that.invalidDay) {
52
          that.$message({
53
            message: '需求有效期不能为空',
54
            type: 'warning'
55
          })
56
          return
57
        }
58
        that.$axios.post('/ajax/demand/delay', {
59
          id: that.demandId,
60
          day: that.invalidDay
61
        }, function(res) {
62
          if (res.success) {
63
            that.$message({
64
              message: '需求有效期设置成功',
65
              type: 'success'
66
            })
67
            setTimeout(function() {
68
              that.delayDialogVisible = false
69
              that.$parent.handleClick()
70
            }, 0)
71
          }
72
        })
73
      },
74
      closedDiloag() {
75
        this.delayDialogVisible = false
76
      }
77
    }
78
  }
79
</script>
80
<style scoped>
81
.el-form-item__content {
82
    line-height: 40px;
83
    position: relative;
84
    font-size: 14px;
85
}
86
.demandIssue{
87
  padding: 10px;
88
}
89
</style>

+ 204 - 0
src/pages/center/views/myDemands/index.vue

@ -0,0 +1,204 @@
1
<template>
2
  <div class="newsmMain">
3
    <div class="newsRight">
4
      <el-tabs v-model="activeName" @tab-click="handleClick">
5
        <div class="search-wrapper" align="right">
6
          <el-button type="primary" icon="el-icon-edit" @click="handerAdd">发布需求</el-button>
7
        </div>
8
        <el-tab-pane v-for="item in navbarArray" :key="item.index" :label="item.text" :name="item.suoIndex" v-loading="loadingPane">
9
          <div class="con-box" v-if="demandList && demandList.length && item.suoIndex===activeName">
10
            <div class="con-item" v-for="dem in demandList" :key="dem.index">
11
              <baseDemand :itemSingle="dem"></baseDemand>
12
              <div class="dele">
13
                <el-button v-if="dem.state===1&&overdueShow(dem.invalidDay)" type="primary" size="mini" @click.stop="handerDelay(dem.id)">延期</el-button>
14
                <el-button v-if="dem.state===1" type="primary" size="mini" @click.stop="handerUpdate(dem.id)">修改</el-button>
15
                <el-button v-if="dem.state===2||dem.state===3" type="danger" size="mini" @click.stop="handerDel(dem.id)">删除</el-button>
16
              </div>
17
            </div>
18
            <div class="pagination-container">
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>
28
          </div>
29
          <defaultPage v-else></defaultPage>
30
        </el-tab-pane>
31
      </el-tabs>
32
    </div>
33
    <demandIssue ref="demandIssue" :operateM="operateM"></demandIssue>
34
    <delayDate ref="demandDelay"></delayDate>
35
    <BackTop></BackTop>
36
  </div>
37
</template>
38
<script>
39
  import { delayDay } from '@/libs/util';
40
  import { loginStatus } from '@/libs/loginStatus';
41
  import baseDemand from './BaseDemand';
42
  import demandIssue from './DemandIssue';
43
  import delayDate from './delayDate';
44
  export default {
45
    data() {
46
      return {
47
        activeName: '0',
48
        navbarArray: [
49
          {
50
            suoIndex: '0',
51
            text: '所有需求',
52
            wtype: '',
53
            order: 'createTime'
54
          }, {
55
            suoIndex: '1',
56
            text: '发布中',
57
            wtype: '1',
58
            order: 'createTime'
59
          }, {
60
            suoIndex: '2',
61
            text: '已过期',
62
            wtype: '',
63
            order: ''
64
          }, {
65
            suoIndex: '3',
66
            text: '已完成',
67
            wtype: '2',
68
            order: 'overTime'
69
          }, {
70
            suoIndex: '4',
71
            text: '已关闭',
72
            wtype: '3',
73
            order: 'closeTime'
74
          }
75
        ],
76
        pageSize: 10,
77
        pageNo: 1,
78
        total: 0,
79
        operateM: {},
80
        demandList: [],
81
        ifDefault: false,
82
        loadingPane: false,
83
        curTime: (new Date()).toISOString().substring(0,10).replace(/-/g, '')
84
      };
85
    },
86
    components: {
87
      baseDemand,
88
      demandIssue,
89
      delayDate
90
    },
91
    created() {
92
      this.queryDeamadList();
93
    },
94
    methods: {
95
      overdueShow(day) {
96
        return delayDay(day) || this.curDate < day
97
      },
98
      handleClick() {
99
        this.pageNo = 1
100
        this.total = 0
101
        this.demandList = []
102
        this.queryDeamadList();
103
      },
104
      queryDeamadList() {
105
        var that = this
106
        that.loadingPane = true
107
        var nav = that.navbarArray[that.activeName]
108
        if (that.activeName === '2') {
109
          that.$axios.get('/ajax/demand/pq/expired', {
110
            invalidDay: that.curTime,
111
            state: 1,
112
            actived: 1,
113
            pageSize: that.pageSize,
114
            pageNo: that.pageNo
115
          }, function(res) {
116
            that.loadingPane = false
117
            if (res.success && res.data) {
118
              const obj = res.data.data
119
              if (obj.length > 0) {
120
                that.total = res.data.total
121
                that.demandList = obj
122
              } else {
123
                that.loadingPane = false
124
                that.ifDefault = true;
125
              }
126
            }
127
          })
128
        } else {
129
          that.$axios.get('/ajax/demand/pq', {
130
            invalidDay: nav.wtype === 1 ? that.curTime : '',
131
            order: nav.order,
132
            state: nav.wtype,
133
            actived: 1,
134
            pageSize: that.pageSize,
135
            pageNo: that.pageNo
136
          }, function(res) {
137
            that.loadingPane = false
138
            if (res.success) {
139
              const obj = res.data.data
140
              if (obj.length > 0) {
141
                that.total = res.data.total
142
                that.demandList = obj
143
              } else {
144
                that.loadingPane = false
145
                that.ifDefault = true;
146
              }
147
            }
148
          })
149
        }
150
      },
151
      handleCurrentChange(val) {
152
        this.pageNo = val
153
        this.queryDeamadList()
154
      },
155
      handerAdd() {
156
        this.operateM = { tit: '发布需求' }
157
        this.$refs.demandIssue.parentFun()
158
      },
159
      handerDelay(id) {
160
        this.$refs.demandDelay.parentFun(id)
161
      },
162
      handerUpdate(id) {
163
        this.operateM = { tit: '修改需求' }
164
        this.$refs.demandIssue.parentFun(id)
165
      },
166
      handerDel(id) {
167
        var that = this
168
        this.$cofirm('删除后,该需求将不能恢复,您确定要删除吗?', '删除需求', {
169
          type: 'warning'
170
        }).then(() => {
171
          that.$axios.post('/ajax/demand/delete', {
172
            id: id
173
          }).then((res) => {
174
            if (res.success) {
175
              that.handleClick()
176
            }
177
          });
178
        }).catch(() => {});
179
      }
180
    }
181
  };
182
</script>
183
<style>
184
  .con-item{
185
    position:relative;
186
    cursor: pointer;
187
  }
188
  .con-item:hover{
189
    background: #EEEEEE;
190
  }
191
  .con-item:hover .dele{
192
    display: block;
193
  }
194
  .con-item .dele{
195
    display: none;
196
    position: absolute;
197
    right: 10px;
198
    z-index: 20;
199
    top: 40%;
200
  }
201
  .con-item .colorRed{
202
    color: #F56C6C
203
  }
204
</style>

+ 0 - 1
src/pages/center/views/myNeeds/examineDemand.vue

@ -1 +0,0 @@
1
<template> <div>查看需求</div></template>

+ 0 - 1
src/pages/center/views/myNeeds/modifyDemand.vue

@ -1 +0,0 @@
1
<template> <div>修改需求</div></template>

+ 0 - 1
src/pages/center/views/myNeeds/myNeed.vue

@ -1 +0,0 @@
1
<template> <div>我的需求</div></template>

+ 4 - 4
src/pages/company/show.vue

@ -27,8 +27,8 @@
27 27
                  <span>我们的产品</span>
28 28
                  <span class="content-more" @click="activeName='second'">更多</span>
29 29
                </div>
30
                <div class="content content-nf">
31
                  <baseProduct v-if="platThreeProducts.length" v-for="item in platThreeProducts" :key="item.index" :itemSingle="item"></baseProduct>
30
                <div class="content content-nf" v-if="platThreeProducts.length">
31
                  <baseProduct v-for="item in platThreeProducts" :key="item.index" :itemSingle="item"></baseProduct>
32 32
                </div>
33 33
              </div>
34 34
            </div>
@ -52,8 +52,8 @@
52 52
            </div>
53 53
          </el-tab-pane>
54 54
          <el-tab-pane :label="'产品 ' + (total>0 ? total : '')" name="second">
55
            <div v-show="!ifDefault">
56
              <baseProduct v-if="platProducts.length" v-for="item in platProducts" :key="item.index" :itemSingle="item"></baseProduct>
55
            <div v-show="!ifDefault" v-if="platProducts.length">
56
              <baseProduct v-for="item in platProducts" :key="item.index" :itemSingle="item"></baseProduct>
57 57
              <Loading v-show="loadingModalShow" :loadingComplete="loadingComplete" :isLoading="isLoading" v-on:upup="searchLower"></Loading>
58 58
            </div>
59 59
            <defaultPage v-show="ifDefault"></defaultPage>

+ 2 - 2
src/pages/content/show.vue

@ -45,8 +45,8 @@
45 45
      </div>
46 46
      <div class="wrapper-right">
47 47
        <div class="wrapper-right">
48
          <div class="block-wrapper" v-if="adinfo.length" v-for="item in adinfo" :key="item.index">
49
            <a class="ad-wrapper" :href="item.adUrl" target="_blank">
48
          <div class="block-wrapper" v-if="adinfo.length">
49
            <a class="ad-wrapper" v-for="item in adinfo" :key="item.index" :href="item.adUrl" target="_blank">
50 50
              <img :src="item.imgUrl" width="280" height="200">
51 51
            </a>
52 52
          </div>

+ 154 - 0
src/pages/demand/closeOperate.vue

@ -0,0 +1,154 @@
1
<template>
2
  <el-dialog :title="showStep ? '关闭需求' : '请选择关闭原因'" class="dialog-box"
3
    :visible.sync="operDialogVisible" width="420px"
4
    :close-on-click-modal="false"
5
    @close="closedDiloag">
6
    <el-form class="step-01" v-if="showStep" v-loading="stepOneLoading">
7
      <p class="tip-txt">关闭后,该需求将不能被专家和机构看到。<br />您确定要关闭吗?</p>
8
      <div class="el-btn-col">
9
        <div class="el-btn-col-box" align="center">
10
          <el-button type="primary" @click="closedDiloag">取消</el-button>
11
          <el-button type="info" @click="nextStep">确定</el-button>
12
        </div>
13
      </div>
14
    </el-form>
15
    <el-form ref="formTwo" :model="formTwo" class="step-02" v-if="!showStep" v-loading="stepTwoLoading">
16
      <el-form-item class="con-txt">
17
        <el-checkbox-group v-model="formTwo.selectReasons" @change="handleCheckedChange">
18
          <el-checkbox label="1">没有对接合适的专家和机构</el-checkbox>
19
          <el-checkbox label="2">没有联系上对接的专家和机构</el-checkbox>
20
          <el-checkbox label="3">已通过其他渠道解决</el-checkbox>
21
          <el-checkbox label="4">其他:</el-checkbox>
22
        </el-checkbox-group>
23
        <el-input v-show="textareaShow" style="margin-bottom: 10px;" type="textarea" :rows="2" placeholder="请填写其他原因" v-model="formTwo.textval"> </el-input>
24
      </el-form-item>
25
      <div class="el-btn-col">
26
        <div class="el-btn-col-box" align="center">
27
          <el-button type="primary" @click="submitReq">确定</el-button>
28
          <el-button type="info" @click="closedDiloag">关闭</el-button>
29
        </div>
30
      </div>
31
    </el-form>
32
  </el-dialog>
33
</template>
34
35
<script>
36
  export default {
37
    data() {
38
      return {
39
        operDialogVisible: false,
40
        showStep: true,
41
        stepOneLoading: false,
42
        stepTwoLoading: false,
43
        textareaShow: false,
44
        demandId: '',
45
        formTwo: {
46
          selectReasons: [],
47
          textval: ''
48
        }     
49
      }
50
    },
51
    methods: {
52
      openDiag(id) {
53
        if (id) {
54
          this.demandId = id
55
        }
56
        this.formTwo.selectReasons = []
57
        this.formTwo.textval = ''
58
        this.operDialogVisible = true
59
        this.showStep = true
60
      },
61
      nextStep() {
62
        var that = this
63
        that.stepOneLoading = true
64
        this.$axios.post('/ajax/demand/close', {
65
          id: that.demandId
66
        }, function(res) {
67
          that.stepOneLoading = false
68
          if (res.success && res.data) {
69
            that.showStep = false
70
            that.$parent.getdemandInfo()
71
          } else {
72
            that.$message.error('关闭需求操作失败,请重试')
73
          }
74
        })
75
      },
76
      handleCheckedChange(val) {
77
        if (val.indexOf('1') > -1) {
78
          this.textareaShow = true
79
          for (let i = 0; i < val.length; ++i) {
80
            if (val[i] === '1') {
81
              val[i] === this.formTwo.textval
82
            }
83
          }
84
        } else {
85
          this.textareaShow = false
86
        }
87
        this.formTwo.selectReasons = val
88
      },
89
      submitReq() {
90
        var that = this
91
        var selectR = that.formTwo.selectReasons
92
        var textR = that.formTwo.textval
93
        if (selectR.indexOf('1') > -1) {
94
          if (textR === '') {
95
            that.$message({
96
              message: '请填写其他关闭原因',
97
              type: 'warning'
98
            })
99
            return
100
          } else {
101
            for (let i = 0; i < selectR.length; ++i) {
102
              if (selectR[i] === '1') {
103
                selectR[i] = textR
104
              }
105
            }
106
          }
107
        }
108
        that.stepTwoLoading = true
109
        this.$axios.post('/ajax/demand/close/reason', {
110
          id: that.demandId,
111
          reason: selectR
112
        }, function(res) {
113
          that.stepTwoLoading = false
114
          if (res.success) {
115
            that.showStep = false
116
            that.closedDiloag()
117
          } else {
118
            that.$message.error('关闭需求操作失败,请重试')
119
          }
120
        })
121
      },
122
      closedDiloag() {
123
        this.operDialogVisible = false
124
        if (!this.showStep) {
125
          this.$refs['formTwo'].resetFields()
126
          this.$refs['formTwo'].clearValidate()
127
        }
128
      }
129
    }
130
  }
131
</script>
132
<style>
133
.dialog-box .el-dialog__body{
134
  padding: 10px 20px 20px;
135
}
136
.dialog-box .el-button {
137
  padding: 12px 60px;
138
}
139
.dialog-box .tip-txt{
140
  line-height: 20px;
141
  font-size: 14px;
142
  margin-bottom: 20px;
143
}
144
.dialog-box .con-txt{
145
  padding: 2px 10px;
146
  background: #f1f1f1;
147
}
148
.dialog-box .con-txt .el-checkbox-group .el-checkbox{
149
  width:100%;
150
}
151
.dialog-box .con-txt .el-checkbox-group .el-checkbox + .el-checkbox {
152
  margin-left:0;
153
}
154
</style>

+ 179 - 0
src/pages/demand/completeOperate.vue

@ -0,0 +1,179 @@
1
<template>
2
  <el-dialog :title="showStep ? '确认完成' : '需求完成'" class="dialog-box"
3
    :visible.sync="operDialogVisible" width="420px"
4
    :close-on-click-modal="false"
5
    @close="closedDiloag">
6
    <el-form ref="formOne" :model="formOne" :rules="formOneRules" class="step-01" v-if="showStep" v-loading="stepOneLoading">
7
      <p class="tip-txt">请选择最终合作方,可多选:</p>
8
      <el-form-item class="con-txt" v-if="demandButtExperts && demandButtExperts.length>0">
9
        <el-checkbox-group v-model="formOne.selectExperts" :min="1" @change="handleCheckedChange">
10
          <el-checkbox v-for="item in demandButtExperts" :key="item.index" :label="item.id">{{item.name + (item.orgName ? ','+item.orgName : '')}}</el-checkbox>
11
        </el-checkbox-group>
12
      </el-form-item>
13
      <div class="el-btn-col">
14
        <div class="el-btn-col-box" align="center">
15
          <el-button type="primary" @click="nextStep">确定</el-button>
16
          <el-button type="info" @click="closedDiloag">取消</el-button>
17
        </div>
18
      </div>
19
    </el-form>
20
    <el-form ref="formTwo" :model="formTwo" :rules="formTwoRules" class="step-02" v-if="!showStep" v-loading="stepTwoLoading">
21
      <p class="tip-txt">很荣幸解决了您的需求,希望您可以对我们的工作提出意见或建议:</p>
22
      <el-form-item>
23
        <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="formTwo.textval"> </el-input>
24
      </el-form-item>
25
      <div class="el-btn-col">
26
        <div class="el-btn-col-box" align="center">
27
          <el-button type="primary" @click="submitReq">确定</el-button>
28
          <el-button type="info" @click="closedDiloag">关闭</el-button>
29
        </div>
30
      </div>
31
    </el-form>
32
  </el-dialog>
33
</template>
34
35
<script>
36
  export default {
37
    data() {
38
      return {
39
        operDialogVisible: false,
40
        showStep: true,
41
        stepOneLoading: false,
42
        stepTwoLoading: false,
43
        formOne: {
44
          selectExperts: []
45
        },
46
        formOneRules: {
47
          selectExperts: [{ required: true, message: '至少选择一个合作方', trigger: 'blur'}]
48
        },
49
        formTwo: {
50
          textval: []
51
        },
52
        formTwoRules: {
53
          textval: [{ required: true, message: '请填写意见或建议', trigger: 'blur'}]
54
        },
55
        demandButtExperts: []       
56
      }
57
    },
58
    methods: {
59
      openDiag(id) {
60
        if (id) {
61
          this.demandId = id
62
          this.buttExpert()
63
        }
64
        this.formOne.selectExperts = []
65
        this.formTwo.textval = ''
66
        this.operDialogVisible = true
67
        this.showStep = true
68
      },
69
      buttExpert() {
70
        var that = this
71
        this.$axios.get('/ajax/demand/pro', {
72
          id: that.demandId,
73
          actived: 0
74
        }, (res) => {
75
          if (res.success) {
76
            var $info = res.data;
77
            var arr = []
78
            for (let i = 0; i < $info.length; ++i) {
79
              arr.push($info[i].uid)
80
            }
81
            if (arr.length) {
82
              that.$axios.getk('/ajax/professor/qm', {
83
                id: arr
84
              }, function(data) {
85
                if (data.success && data.data) {
86
                  if (data.data.length > 0) {
87
                    that.demandButtExperts = data.data
88
                  }
89
                }
90
              })
91
            }
92
          }
93
        })
94
      },
95
      nextStep() {
96
        var that = this
97
        this.$refs['formOne'].validate((valid) => {
98
          if (valid) {
99
            that.stepOneLoading = true
100
            this.$axios.post('/ajax/demand/confirm', {
101
              id: that.demandId,
102
              uid: that.formOne.selectExperts
103
            }, function(res) {
104
              that.stepOneLoading = false
105
              if (res.success) {
106
                that.showStep = false
107
                that.$parent.cooperateExpert()
108
              }
109
            })
110
          } else {
111
            return false;
112
          }
113
        })
114
      },
115
      handleCheckedChange(val) {
116
        this.formOne.selectExperts = val
117
      },
118
      submitReq() {
119
        var that = this
120
        this.$refs['formTwo'].validate((valid) => {
121
          if (valid) {
122
            that.stepTwoLoading = true
123
            setTimeout(function() {
124
              that.stepTwoLoading = false
125
              that.showStep = false
126
            }, 1000)
127
            // this.$http.post(addTask, {
128
            //   dataNum: that.dataBh,
129
            //   taskType: '1'
130
            // }, function(res) {
131
            //   that.stepOneLoading = false
132
            //   if (res.success) {
133
            //     console.log(res)
134
            //     that.$parent.getdemandInfo()
135
            //   }
136
            // })
137
          } else {
138
            return false;
139
          }
140
        })
141
      },
142
      closedDiloag() {
143
        if (!this.showStep) {
144
          this.$refs['formTwo'].resetFields();
145
          this.$refs['formTwo'].resetFields();
146
        } else {
147
          this.$refs['formOne'].resetFields();
148
          this.$refs['formOne'].resetFields(); 
149
        }
150
        this.operDialogVisible = false
151
        this.$parent.getdemandInfo()
152
      }
153
    }
154
  }
155
</script>
156
157
<style>
158
.dialog-box .el-dialog__body{
159
  padding: 10px 20px 20px;
160
}
161
.dialog-box .el-button {
162
  padding: 12px 60px;
163
}
164
.dialog-box .tip-txt{
165
  line-height: 20px;
166
  font-size: 14px;
167
  margin-bottom: 10px;
168
}
169
.dialog-box .con-txt{
170
  padding: 2px 10px;
171
  background: #f1f1f1;
172
}
173
.dialog-box .con-txt .el-checkbox-group .el-checkbox{
174
  width:100%;
175
}
176
.dialog-box .con-txt .el-checkbox-group .el-checkbox + .el-checkbox {
177
  margin-left:0;
178
}
179
</style>

+ 18 - 0
src/pages/demand/demand.html

@ -0,0 +1,18 @@
1
<!DOCTYPE html>
2
<html lang="en">
3
  <head>
4
    <meta charset="utf-8">
5
  	<meta name="keywords" content="">
6
  	<meta name="description" content="">
7
  	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
8
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
9
  	<title></title>
10
  </head>
11
  <body>
12
    <div id="app"></div>
13
    <script src="/static/plat-info.js"></script>
14
    <script src="/static/comtar/vue/vue.min.js"></script>
15
    <script src="/static/comtar/vuex/vuex.min.js"></script>
16
  </body>
17
</html>
18

+ 10 - 0
src/pages/demand/demand.js

@ -0,0 +1,10 @@
1
import '@/libs/common.js';
2
3
import store from '@/store/index';
4
import App from './demand.vue';
5
6
new Vue({
7
  el: '#app',
8
  store,
9
  render: h => h(App)
10
});

+ 25 - 0
src/pages/demand/demand.vue

@ -0,0 +1,25 @@
1
<template>
2
  <div class="main Site">
3
    <TheHeader></TheHeader>
4
    <div class="Site-content">
5
      <div class="contain-wrapper">
6
        <showTemplate></showTemplate>
7
      </div>
8
    </div>
9
    <TheFooter></TheFooter>
10
  </div>
11
</template>
12
13
<script>
14
  import { TheHeader, TheFooter } from '@/layout';
15
  import showTemplate from './show';
16
17
  export default {
18
    name: 'layout',
19
    components: {
20
      TheHeader,
21
      TheFooter,
22
      showTemplate
23
    }
24
  };
25
</script>

+ 326 - 0
src/pages/demand/show.vue

@ -0,0 +1,326 @@
1
<template>
2
  <div class="browse-main">
3
    <div class="block-wrapper">
4
      <div class="wrapper-left left-main">
5
        <div class="content-wrapper">
6
          <div class="inner-wrapper">
7
            <div class="headcon-box detail-box">
8
              <div class="show-info">
9
                <div class="info-tit info-tit-big">{{demandInfo.title}}</div>
10
                <div class="info-operate">
11
                    <span>需求方:{{demandInfo.linkOrg}}</span>
12
                    <span>当前状态:{{stateShow}}</span>
13
                    <span>发布时间:{{TimeTr(demandInfo.createTime)}}</span>
14
                    <span v-if="demandInfo.state===2">完成时间:{{TimeTr(demandInfo.overTime)}}</span>
15
                    <span v-if="demandInfo.state===3">关闭时间:{{TimeTr(demandInfo.closeTime)}}</span>
16
                </div>
17
              </div>
18
            </div>
19
          </div>
20
          <div class="inner-wrapper">
21
            <div class="content">
22
              <el-row :gutter="10" class="rel-detail">
23
                <el-col :span="24" v-html="demandInfo.descp" style="margin-bottom: 10px"></el-col>
24
                <el-col :span="6" v-if="demandInfo.city">
25
                  所在城市:{{cityRange[demandInfo.city]}}
26
                </el-col>
27
                <el-col :span="6" v-if="demandInfo.duration">
28
                  预计周期:{{longTime[demandInfo.duration]}}
29
                </el-col>
30
                <el-col :span="6" v-if="demandInfo.cost">
31
                  费用预算:{{costRange[demandInfo.cost]}}
32
                </el-col>
33
                <el-col :span="6" v-if="demandInfo.invalidDay">
34
                  有效期至:{{TimeTr(demandInfo.invalidDay)}}
35
                </el-col>
36
              </el-row>
37
            </div>
38
          </div>
39
          <div class="inner-wrapper" v-if="cooperateExperts && cooperateExperts.length>0">
40
            <div class="content-title">
41
              <span>合作方</span>
42
            </div>
43
            <div>
44
              <div class="con-item" v-for="item in cooperateExperts" :key="item.index">
45
                <baseExpert v-if="item.owner" :itemSingle="item.owner"></baseExpert>
46
                <div class="dele">
47
                  <contactChat :cantactOptions="{pid: item.uid}"></contactChat>
48
                  <collectCo :watchOptions="{oid: item.uid, type: 1}"></collectCo>
49
                </div>
50
              </div>
51
            </div>
52
          </div>
53
          <div class="inner-wrapper">
54
            <el-collapse v-model="collapseName" v-if="demandButtExperts && demandButtExperts.length>0">
55
              <el-collapse-item :title="`已为您对接${buttCount}位专家`" name="1">
56
                <div class="con-item" v-for="item in demandButtExperts" :key="item.index">
57
                  <baseExpert v-if="item.owner" :itemSingle="item.owner"></baseExpert>
58
                  <div class="dele">
59
                    <contactChat :cantactOptions="{pid: item.uid}"></contactChat>
60
                    <collectCo :watchOptions="{oid: item.uid, type: 1}"></collectCo>
61
                  </div>
62
                  <div class="leavemsg">
63
                    <div>留言:{{item.descp}}</div>
64
                    <span>{{item.assTime}}</span>
65
                  </div>
66
                </div>
67
              </el-collapse-item>
68
            </el-collapse>
69
            <div v-else class="content-title">正在为您对接专家...</div>
70
          </div>
71
          <div class="inner-wrapper" v-if="buttonShow">
72
            <div class="btn-need">
73
              <el-button type="primary" :disabled="completeDisable" @click="completeOper">需求已完成</el-button>
74
              <el-button type="info" class="close-btn" @click="closeOper">关闭该需求</el-button>
75
            </div>
76
          </div>
77
        </div>
78
      </div>
79
    </div>
80
    <completeOperate ref="operateComplete"></completeOperate>
81
    <closeOperate ref="operateClose"></closeOperate>
82
    <BackTop></BackTop>
83
  </div>
84
</template>
85
86
<script>
87
  import { urlParse, commenTime, TimeTr } from '@/libs/util'
88
  import queryDict from '@/libs/queryDict'
89
  import queryBase from '@/libs/queryBase'
90
91
  import baseExpert from '@/components/subTemplate/BaseExpert'
92
  import contactChat from '@/components/ContactChat'
93
  import collectCo from '@/components/CollectCo'
94
95
  import completeOperate from './completeOperate'
96
  import closeOperate from './closeOperate'
97
  export default {
98
    data() {
99
      return {
100
        collapseName: ['1'],
101
        completeDisable: false,
102
        demandInfo: '',
103
        demandId: '',
104
        TimeTr: TimeTr,
105
        costRange: [],
106
        longTime: [],
107
        cityRange: [],
108
        demandButtExperts: '',
109
        cooperateExperts: '',
110
        buttCount: 0
111
      };
112
    },
113
    created() {
114
      this.getDictoryData()
115
      this.demandId = urlParse('id')
116
      if (this.demandId) {
117
        this.getdemandInfo()
118
        this.buttExpert()
119
        this.cooperateExpert()
120
        this.rebackCount()
121
      }
122
    },
123
    computed: {
124
      stateShow() {
125
        let state = this.demandInfo.state
126
        let curTime = this.curTime
127
        let msg = '发布中'
128
        if (state === 1) {
129
          msg = '发布中'
130
          if (curTime > this.demandInfo.invalidDay) {
131
            msg = '已过期'
132
          }
133
        } else if (state === 2) {
134
          msg = '已完成'
135
        } else if (state === 3) {
136
          msg = '已关闭'
137
        }
138
        return msg
139
      },
140
      buttonShow() {
141
        let state = this.demandInfo.state
142
        return state === 1
143
      }
144
    },
145
    components: {
146
      baseExpert,
147
      collectCo,
148
      contactChat,
149
      completeOperate,
150
      closeOperate
151
    },
152
    methods: {
153
      getDictoryData() {
154
        const that = this
155
        queryDict.applyDict('XZQH', function(dictData) {
156
          dictData.map(item => {
157
            that.cityRange[item.code] = item.caption
158
          })
159
        }) // 城市
160
        queryDict.applyDict('FYYS', function(dictData) {
161
          dictData.map(item => {
162
            that.costRange[item.code] = item.caption
163
          })
164
        }) // 费用预算
165
        queryDict.applyDict('HZZQ', function(dictData) {
166
          dictData.map(item => {
167
            that.longTime[item.code] = item.caption
168
          })
169
        }) // 合作周期
170
      },
171
      getdemandInfo() {
172
        this.$axios.get('/ajax/demand/qo', {
173
          id: this.demandId
174
        }, (res) => {
175
          if (res.success) {
176
            var $info = res.data;
177
            this.demandInfo = $info;
178
          };
179
        });
180
      },
181
      completeOper() {
182
        this.$refs.operateComplete.openDiag(this.demandId)
183
      },
184
      closeOper() {
185
        this.$refs.operateClose.openDiag(this.demandId)
186
      },
187
      buttExpert() {
188
        var that = this
189
        this.$axios.get('/ajax/demand/pro', {
190
          id: this.demandId
191
        }, (res) => {
192
          if (res.success) {
193
            var $info = res.data;
194
            for (let i = 0; i < $info.length; ++i) {
195
              if ($info[i].assTime){
196
                $info[i].assTime = commenTime($info[i].assTime)
197
              }
198
              (function(item) {
199
                queryBase.getProfessor(item.uid, function(sc, value) {
200
                  if (sc) {
201
                    item.owner = value
202
                    that.$forceUpdate()
203
                  }
204
                })
205
              })($info[i])
206
            }
207
            this.demandButtExperts = $info;
208
          }
209
        })
210
      },
211
      rebackCount() {
212
        var that = this
213
        this.$axios.get('/ajax/demand/pro/count', {
214
          id: that.demandId
215
        }, function(res) {
216
          if (res.success) {
217
            if (res.data > 0) {
218
              that.buttCount = res.data
219
            } else {
220
              that.completeDisable = true
221
            }
222
          }
223
        })
224
      },
225
      cooperateExpert() {
226
        var that = this
227
        this.$axios.get('/ajax/demand/pro', {
228
          id: that.demandId,
229
          actived: 1
230
        }, (res) => {
231
          if (res.success) {
232
            var $info = res.data;
233
            var arr = []
234
            for (let i = 0; i < $info.length; ++i) {
235
              queryBase.getProfessor($info[i].uid, function(sc, value) {
236
                if (sc) {
237
                  $info[i].owner = value
238
                  that.$forceUpdate()
239
                }
240
              })
241
            }
242
            that.cooperateExperts = $info
243
          }
244
        })
245
      },
246
    }
247
  };
248
</script>
249
250
<style lang="scss">
251
.browse-main .block-wrapper .left-main .inner-wrapper{
252
  .detail-box{
253
    .info-operate{
254
      font-size: 14px;
255
      justify-content: space-between;
256
    }
257
  }
258
  .con-item{
259
    position:relative;
260
    cursor: pointer;
261
    border: 1px solid #eaeaea;
262
    margin-bottom: 10px;
263
    .list-item{
264
      border: none;
265
      &::after{
266
        content: none;
267
      }
268
      .list-head{
269
        @include center-items(60px,60px);
270
        border-radius: 50%;
271
      }
272
    }
273
    .dele{
274
      position: absolute;
275
      display: flex;
276
      right: 10px;
277
      z-index: 20;
278
      top: 30px;
279
    }
280
    .leavemsg{
281
      width: 100%;
282
      box-sizing: border-box;
283
      font-size: 14px;
284
      background: #eaeaea;
285
      padding: 8px 10px;
286
      position: relative;
287
      div {
288
        padding-right: 170px;
289
      }
290
      span{
291
        position: absolute;
292
        right: 10px;
293
        top: 8px;
294
        z-index: 2;
295
      }
296
    }
297
  }
298
  .btn-need {
299
    position:relative;
300
    padding: 20px;
301
    text-align: center;
302
    .el-button{
303
      padding:12px 60px;
304
    }
305
    .close-btn{
306
      position: absolute;
307
      right: 0;
308
      padding:12px 20px;
309
      top: 20px;
310
    }
311
  }
312
  .el-collapse{
313
    border:none;
314
  }
315
  .el-collapse-item__header{
316
    font-size: 16px;
317
    line-height: 30px;
318
    font-weight: bold;
319
    color: #303133;
320
    border:none;
321
  }
322
  .el-collapse-item__wrap{
323
    border: none;
324
  }
325
}
326
</style>

+ 11 - 9
src/pages/expert/show.vue

@ -14,7 +14,7 @@
14 14
          </div>
15 15
          <el-row class="goSpan" :gutter="10">
16 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> -->
17
            <el-col :span="12"><contactChat :contactOptions="{oid: expertId}"></contactChat></el-col>
18 18
          </el-row>
19 19
        </div>
20 20
      </div>
@ -29,8 +29,8 @@
29 29
                  <span>可提供服务</span>
30 30
                  <span class="content-more" @click="activeName='second'">更多</span>
31 31
                </div>
32
                <div class="content content-nf">
33
                  <baseService v-if="platThreeServices.length" v-for="item in platThreeServices" :key="item.index" :itemSingle="item"></baseService>
32
                <div class="content content-nf" v-if="platThreeServices.length">
33
                  <baseService v-for="item in platThreeServices" :key="item.index" :itemSingle="item"></baseService>
34 34
                </div>
35 35
              </div>
36 36
            </div>
@ -78,22 +78,22 @@
78 78
                  <span>专利</span>
79 79
                  <span class="content-more" @click="activeName='third'">更多</span>
80 80
                </div>
81
                <div class="content">
82
                  <baseResult v-if="platOnePatents.length" v-for="item in platOnePatents" :key="item.index" :itemSingle="item"></baseResult>
81
                <div class="content" v-if="platOnePatents.length">
82
                  <baseResult v-for="item in platOnePatents" :key="item.index" :itemSingle="item"></baseResult>
83 83
                </div>
84 84
              </div>
85 85
            </div>
86 86
          </el-tab-pane>
87 87
          <el-tab-pane :label="'服务 ' + (serCount>0 ? serCount : '')" name="second">
88
            <div v-show="!ifDefault">
89
              <baseService v-if="platServices.length" v-for="item in platServices" :key="item.index" :itemSingle="item"></baseService>
88
            <div v-show="!ifDefault" v-if="platServices.length">
89
              <baseService v-for="item in platServices" :key="item.index" :itemSingle="item"></baseService>
90 90
              <Loading v-show="loadingModalShow" :loadingComplete="loadingComplete" :isLoading="isLoading" v-on:upup="searchLower"></Loading>
91 91
            </div>
92 92
            <defaultPage v-show="ifDefault"></defaultPage>
93 93
          </el-tab-pane>
94 94
          <el-tab-pane :label="'专利 ' + (patCount>0 ? patCount : '')" name="third">
95
            <div v-show="!ifDefault2">
96
              <baseResult v-if="platPatents.length" v-for="item in platPatents" :key="item.index" :itemSingle="item"></baseResult>
95
            <div v-show="!ifDefault2" v-if="platPatents.length">
96
              <baseResult v-for="item in platPatents" :key="item.index" :itemSingle="item"></baseResult>
97 97
              <Loading v-show="loadingModalShow2" :loadingComplete="loadingComplete2" :isLoading="isLoading2" v-on:upup="searchLower2"></Loading>
98 98
            </div>
99 99
            <defaultPage v-show="ifDefault2"></defaultPage>
@ -208,6 +208,7 @@
208 208
209 209
  import shareOut from '@/components/ShareOut';
210 210
  import collectCo from '@/components/CollectCo';
211
  import contactChat from '@/components/ContactChat';
211 212
  import baseService from '@/components/subTemplate/BaseService';
212 213
  import baseResult from '@/components/subTemplate/BaseResult';
213 214
@ -284,6 +285,7 @@
284 285
    components: {
285 286
      shareOut,
286 287
      collectCo,
288
      contactChat,
287 289
      baseService,
288 290
      baseResult
289 291
    },

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

@ -2,6 +2,7 @@ import '@/libs/common.js';
2 2
import App from './index.vue';
3 3
import router from './router';
4 4
import store from '@/store';
5
import './permission';
5 6
6 7
new Vue({
7 8
  el: '#app',

+ 30 - 0
src/pages/index/permission.js

@ -0,0 +1,30 @@
1
import router from './router'
2
import store from '@/store'
3
import { Message } from 'element-ui'
4
5
router.beforeEach((to, from, next) => {
6
  /* 判断该路由是否需要登录权限 */
7
  if (to.matched.some(record => record.meta.requireAuth)) {
8
    // 是否登录
9
    if (store.getters && store.getters.userid && localStorage.getItem('userid')) { // 判断当前用户是否已拉取完user_info信息
10
      next();
11
    } else {
12
      store.dispatch('GetUserInfo').then(res => { // 拉取user_info
13
        if (res.success && res.data) {
14
          next();
15
        } else {
16
          store.dispatch('FedLogOut').then(() => {
17
            Message.error('登录状态失效,请重新登录');
18
            next('/loginPlat')
19
          })
20
        }
21
      }).catch((err) => {
22
        store.dispatch('FedLogOut').then(() => {
23
          Message.error(err || '登录状态失效,请重新登录');
24
          next('/loginPlat')
25
        })
26
      })
27
    }
28
  }
29
  next();
30
})

+ 20 - 0
src/pages/index/router/index.js

@ -118,6 +118,26 @@ const constantRouterMap = [
118 118
      name: 'about',
119 119
      meta: { title: '关于平台' }
120 120
    }]
121
  },
122
  {
123
    path: '',
124
    component: Layout,
125
    meta: { requireAuth: true },
126
    children: [{
127
      path: '/miniChat',
128
      component: (resolve) => require(['../views/MiniChat/index.vue'], resolve),
129
      name: 'miniChat'
130
    }]
131
  },
132
  {
133
    path: '',
134
    component: Layout,
135
    meta: { requireAuth: true },
136
    children: [{
137
      path: '/inform',
138
      component: (resolve) => require(['../views/InformList/index.vue'], resolve),
139
      name: 'inform'
140
    }]
121 141
  }
122 142
];
123 143

+ 17 - 54
src/pages/index/views/Dashboard/index.vue

@ -1,20 +1,5 @@
1 1
<template>
2 2
  <div class="home-main">
3
    <!-- <el-dialog title="发布需求" :visible.sync="dialogFormVisible" width="700px">
4
      <div class="tip-show">
5
        <div class="tip-h1">免费发布需求到科袖网,让企业没有难搞的研发</div>
6
        <div class="tip-h2">1. 发布需求  →  2. 为您对接专家或机构  →  3. 登录科袖网进行沟通  →  4. 开展合作,解决您的需求</div>
7
      </div>
8
      <el-tabs class="tab-show" v-model="activeName" type="card" >
9
        <el-tab-pane label="注册科袖网,发布需求" name="first">
10
          <demandIssue ref="issueDemand" :dialogFormVisible="dialogFormVisible" v-on:dialogChanged="getChildrenChange($event)"></demandIssue>
11
        </el-tab-pane>
12
        <el-tab-pane label="已有账户,快速发布" name="second">
13
          <demandIssueLogin ref="issueDemand" :dialogFormVisible="dialogFormVisible" v-on:dialogChangedLogin="getChildrenChangeLogin($event)"></demandIssueLogin>
14
        </el-tab-pane>
15
      </el-tabs>
16
    </el-dialog>-->
17
18 3
    <div class="block-wrapper">
19 4
      <div class="wrapper-left video-wrapper">
20 5
        <!-- <div class="video-mask" @click="showVideo">
@ -32,9 +17,10 @@
32 17
          将您的需求发布到科袖网,<br>
33 18
          我们为您对接专家和各类专业机构。
34 19
        </p>
35
        <el-button type="primary" @click="clickAlertDemand" style="margin-top:30px">发布需求</el-button>
20
        <el-button type="primary" @click="publishDemand" style="margin-top:30px">发布需求</el-button>
36 21
      </div>
37 22
    </div>
23
    <demandIssue ref="demandIssue" :operateM="operateM"></demandIssue>
38 24
39 25
    <div class="block-wrapper">
40 26
      <div class="wrapper-left">
@ -177,16 +163,17 @@
177 163
<script>
178 164
  import { commenTime, defaultSet, ImageUrl, strToArr } from '@/libs/util';
179 165
  import queryBase from '@/libs/queryBase';
166
  import { loginStatus } from '@/libs/loginStatus';
180 167
181 168
  import orgItem from '../ViewOrganization/orgItem';
182 169
  import expItem from '../ViewExpertPool/expItem';
183
  // import demandIssue from '../form-views/DemandIssue';
184
  // import demandIssueLogin from '../form-views/DemandIssueLogin';
170
  import demandIssue from '@/pages/center/views/myDemands/DemandIssue';
185 171
186 172
  export default {
187 173
    data() {
188 174
      return {
189 175
        /* eslint-disable no-undef */
176
        operateM: {},
190 177
        platimgurl: PLAT.info.platimgurl,
191 178
        activeName: '1',
192 179
        conCatalog: [
@ -216,8 +203,7 @@
216 203
        ownerInfo: '',
217 204
        aboutUs: '',
218 205
        inputSer: '',
219
        inputRes: '',
220
        dialogFormVisible: false
206
        inputRes: ''
221 207
      };
222 208
    },
223 209
    created() {
@ -272,19 +258,19 @@
272 258
        observeParents: true // 修改swiper的父元素时,自动初始化swiper
273 259
      });
274 260
    },
261
    components: {
262
      orgItem,
263
      expItem,
264
      demandIssue
265
    },
275 266
    methods: {
276
      getChildrenChange(msg) {
277
        this.dialogFormVisible = msg;
278
      },
279
      getChildrenChangeLogin(msg) {
280
        this.dialogFormVisible = msg;
281
      },
282
      clickAlertDemand() {
283
        this.dialogFormVisible = true;
267
      publishDemand() {
268
        var that = this
269
        loginStatus(function() {
270
          that.operateM = { tit: '发布需求', flag: true }
271
          that.$refs.demandIssue.parentFun()
272
        })
284 273
      },
285
      // pubDemand() {
286
      //   this.$refs.issueDemand.submitForm('ruleForm');
287
      // },
288 274
      queryPaltNews() {
289 275
        var that = this
290 276
        this.$axios.get('/ajax/article/pq', {
@ -420,12 +406,6 @@
420 406
        }
421 407
      }
422 408
    },
423
    components: {
424
      orgItem,
425
      expItem
426
      // demandIssue,
427
      // demandIssueLogin
428
    },
429 409
    beforeDestroy() {
430 410
      this.latestCmpSwiper.destroy()
431 411
      this.findServiceSwiper.destroy()
@ -623,23 +603,6 @@
623 603
        }
624 604
      }
625 605
    }
626
627
    .tip-show{
628
      background:$mainColor;
629
      text-align:center;
630
      justify-content: space-between;
631
      margin:-30px -20px 10px;
632
      padding:20px;
633
      color:#fff;
634
      .tip-h1{
635
        font-size:16px;
636
        line-height:40px;
637
      }
638
      .tip-h2{
639
        font-size:12px;
640
        line-height:30px;
641
      }
642
    }
643 606
    .tab-show{
644 607
      margin:20px -20px 0;
645 608
      .el-tabs__nav{

+ 72 - 0
src/pages/index/views/InformList/index.vue

@ -0,0 +1,72 @@
1
<template>
2
  <div class="inform">
3
    <div class="content-wrapper block-wrapper">
4
      <div class="content-title">全部通知</div>
5
      <div v-show="!ifDefault" v-if="platInforms.length">
6
        <informItem v-for="item in platInforms" :key="item.index" :itemSingle="item"></informItem>
7
        <Loading v-show="loadingModalShow" :loadingComplete="loadingComplete" :isLoading="isLoading" v-on:upup="searchLower"></Loading>
8
      </div>
9
      <defaultPage v-show="ifDefault"></defaultPage>
10
    </div>
11
    <BackTop></BackTop>
12
  </div>
13
</template>
14
<script>
15
  import informItem from './informItem'
16
  export default {
17
    data() {
18
      return {
19
        platInforms: [],
20
        loadingModalShow: true,
21
        loadingComplete: false,
22
        isFormSearch: false,
23
        isLoading: false,
24
        ifDefault: false 
25
      }
26
    },
27
    components: {
28
      informItem
29
    },
30
    created() {
31
      this.searchInform()
32
    },
33
    methods: {
34
      searchInform() {
35
        this.$axios.getk('/ajax/ppatent/index/search', {
36
          key: this.keyVal,
37
          sortNum: this.dataO.patSortNum,
38
          createTime: this.dataO.patCreateTime,
39
          id: this.dataO.patId,
40
          rows: this.rows
41
        }, (res) => {
42
          if (res.success) {
43
            var $info = res.data;
44
            if ($info.length > 0) {
45
              this.dataO.patSortNum = $info[$info.length - 1].sortNum;
46
              this.dataO.patCreateTime = $info[$info.length - 1].createTime;
47
              this.dataO.patId = $info[$info.length - 1].id;
48
              this.platInforms = this.isFormSearch ? this.platInforms.concat($info) : $info;
49
              this.isFormSearch = true;
50
              if ($info.length < this.rows) {
51
                this.loadingModalShow = false;
52
                this.isFormSearch = false;
53
              };
54
            } else {
55
              this.loadingModalShow = false;
56
              this.isFormSearch = false;
57
            };
58
            var liLen = this.platInforms.length;
59
            if ($info.length === 0 && liLen === 0) {
60
              this.ifDefault = true;
61
            };
62
          };
63
        });
64
      },
65
      searchLower() {
66
        if (this.loadingModalShow && !this.isLoading) {
67
          this.searchInform()
68
        }
69
      }
70
    }
71
  }
72
</script>

+ 34 - 0
src/pages/index/views/InformList/informItem.vue

@ -0,0 +1,34 @@
1
<template>
2
  <a class="list-item" :href="'product.html?id='+itemSingle.id" target="_blank">
3
    <div class="list-head" :style="{backgroundImage: 'url(' + imgUrl + ')'}"></div>
4
    <div class="list-info">
5
      <div class="list-tit list-topic">{{itemSingle.name}}</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>
8
    </div>
9
  </a>
10
</template>
11
12
<script>
13
  import { defaultSet, strToArr } from '@/libs/util';
14
15
  export default {
16
    props: {
17
      itemSingle: {
18
        type: Object
19
      },
20
      showTime: {
21
        type: Boolean
22
      }
23
    },
24
    data() {
25
      return {
26
        imgUrl: this.itemSingle.img ? strToArr(this.itemSingle.img)[0] : defaultSet.img.product
27
      };
28
    },
29
    created() {
30
    },
31
    methods: {
32
    }
33
  };
34
</script>

+ 271 - 0
src/pages/index/views/MiniChat/components/list.vue

@ -0,0 +1,271 @@
1
<template>
2
  <div class="msglist">
3
    <div class="message-tit">消息列表</div>
4
    <ul v-if="chatList && chatList.length>0">
5
      <li v-for="(item, index) in chatList" :key="item.index" class="sessionlist"
6
        v-show="urlPid===item.pid ? showChatLi : item.actived" :class="{ active: item.pid === selectChatId }"
7
        @click="handelView(item.pid, item.unread, item.kxUser)">
8
        <div class="list-left">
9
          <img class="avatar" width="42" height="42" v-if="item.kxUser" :alt="item.kxUser.img" :src="item.kxUser.img">
10
          <span class="badge" v-show="item.unread>0">{{item.unread}}</span>
11
        </div>
12
        <div class="list-right">
13
          <p class="name" v-if="item.kxUser">{{item.kxUser.name}}</p>
14
          <span class="time" v-if="item.opTime">{{TimeTr(item.opTime, true)}}</span>
15
          <p class="lastmsg" v-if="item.cnt">{{item.cnt}}</p>
16
        </div>
17
        <div class="dele">
18
          <el-button type="danger" icon="el-icon-delete" circle @click.stop="handerDel(item.pid, index)"></el-button>
19
        </div>
20
      </li>
21
    </ul>
22
    <div v-else class="no-message">暂无消息</div>
23
  </div>
24
</template>
25
26
<script>
27
import queryBase from '@/libs/queryBase'
28
import { urlParse, defaultSet, ImageUrl, TimeTr } from '@/libs/util'
29
export default {
30
  data() {
31
    return {
32
      kxUserIdArr: [],
33
      chatList: [],
34
      refreshListTime: '',
35
      TimeTr: TimeTr,
36
      urlPid: ''
37
    }
38
  },
39
  watch: {
40
    chatLsit(val) {
41
      this.chatLsit = val
42
    },
43
    selectChatId(val) {
44
      this.selectChatId = val
45
      clearTimeout(this.refreshListTime)
46
      this.queryChatList()
47
    },
48
    selectKxUser(val) {
49
      this.selectKxUser = val
50
    },
51
    kxUserIdArr(val) {
52
      this.kxUserIdArr = val
53
    }
54
  },
55
  computed: {
56
    ...Vuex.mapGetters([
57
      'selectChatId',
58
      'selectKxUser',
59
      'chatListLocal'
60
    ]),
61
    showChatLi() {
62
      return this.kxUserIdArr.indexOf(this.urlPid) > -1
63
    }
64
  },
65
  created() {
66
    this.urlPid = urlParse('id')
67
    this.queryChatList()
68
  },
69
  methods: {
70
    queryChatList() {
71
      var that = this
72
      this.$axios.get('/ajax/msg/idxList', {}, function(res) {
73
        if (res.success && res.data) {
74
          const dataS = res.data
75
          that.$store.dispatch('chatListLocalAction', dataS)
76
          if (that.urlPid) {
77
            var hasId = false
78
            for (let j = 0; j < dataS.length; ++j) {
79
              if (dataS[j].pid === that.urlPid) {
80
                hasId = true
81
                that.$store.dispatch('ifFirstChatActiion', true)
82
                break
83
              }
84
            }
85
            if (!hasId) {
86
              dataS.unshift({
87
                uid: localStorage.getItem('userid'),
88
                pid: urlParse('id'),
89
                cnt: '',
90
                opTime: '',
91
                unread: 0,
92
                actived: true
93
              })
94
            }
95
          }
96
          var num = 0
97
          if (dataS.length > 0) {
98
            for (let i = 0; i < dataS.length; ++i) {
99
              (function(item, num) {
100
                num++
101
                queryBase.getProfessor(item.pid, function(sc, value){
102
                  num--
103
                  if (sc) {
104
                    if (value.hasHeadImage) {
105
                      value.img = ImageUrl(('head/' + value.id + '_l.jpg'), true)
106
                    } else {
107
                      value.img = defaultSet.img.expert
108
                    }
109
                    item.kxUser = value
110
                    that.$forceUpdate()
111
                  }
112
                })
113
                that.kxUserIdArr.push(item.pid)
114
              })(dataS[i], num)
115
            }
116
            if (num === 0) {
117
              that.chatList = dataS
118
            }
119
          }
120
          if (that && !that._isDestroyed) {
121
            that.refreshListTime = setTimeout(() => {
122
              if (that && !that._isDestroyed) {
123
                that.queryChatList()
124
              }
125
            }, 1000)
126
          } else {
127
            that.refreshListTime = ''
128
          }
129
        }
130
      })
131
    },
132
    handelView(id, num, us) {
133
      this.$store.dispatch('selectSession', id)
134
      this.$store.dispatch('selectKxUserAction', us)
135
      for (let m = 0; m < this.chatListLocal.length; ++m) {
136
        if (this.chatListLocal[m].pid === id) {
137
          this.$store.dispatch('ifFirstChatActiion', true)
138
          break
139
        }
140
      }
141
      if (num > 0) {
142
        this.readedOperate(id)
143
      }
144
    },
145
    readedOperate(id) {
146
      this.$axios.post('/ajax/msg/readed', {
147
        pid: id
148
      }, function(res) {
149
        if (res.success && res.data) {}
150
      })
151
    },
152
    handerDel(id, index) {
153
      this.$axios.post('/ajax/msg/delete', {
154
        pid: id
155
      }, function(res) {
156
        if (res.success && res.data) {
157
          this.chatList.splice(index, 1)
158
        }
159
      })
160
    }
161
  },
162
  beforeDestroy() {
163
    var that = this
164
    this.$once('hook:beforeDestroy', () => {
165
      clearTimeout(that.refreshListTime)
166
    })
167
  }
168
}
169
</script>
170
171
<style scoped>
172
  .msglist{
173
    height: 540px;
174
    overflow-y: auto;
175
  }
176
  .msglist .message-tit{
177
    text-align:center;
178
    color: #666;
179
    line-height:60px;
180
    font-size: 16px;
181
    border-bottom: 1px solid #d8d8d8; 
182
  }
183
  .msglist .no-message{
184
    text-align:center;
185
    color: #999;
186
    font-size: 14px;
187
    line-height:100px;
188
  }
189
  .msglist .sessionlist{
190
    display: flex;
191
    padding: 12px;
192
    transition: background-color .1s;
193
    font-size: 0;
194
    position:relative;
195
    cursor: pointer;
196
  }
197
  .msglist .sessionlist .dele{
198
    display: none;
199
    position: absolute;
200
    right: 10px;
201
    z-index: 20;
202
    top: 20px;
203
  }
204
  .msglist .sessionlist .dele .el-button.is-circle{
205
    padding:6px;
206
  }
207
  .msglist .sessionlist:hover {
208
    background-color: rgb(220,220,220);
209
  }
210
  .msglist .sessionlist:hover .dele{
211
    display: block;
212
  }
213
  .msglist .sessionlist.active {
214
    background-color: #c4c4c4;
215
  }
216
  .msglist .sessionlist .list-left{
217
    position: relative;
218
    vertical-align: middle;
219
    display: inline-block;
220
  }
221
  .msglist .sessionlist .list-left .badge{
222
    position: absolute;
223
    right: 2px;
224
    top: -5px;
225
    background-color: #f56c6c;
226
    border-radius: 10px;
227
    color: #fff;
228
    display: inline-block;
229
    font-size: 12px;
230
    height: 18px;
231
    line-height: 18px;
232
    padding: 0 6px;
233
    text-align: center;
234
    white-space: nowrap;
235
    border: 1px solid #fff;
236
  }
237
  .msglist .sessionlist .avatar{
238
    border-radius: 50%;
239
    margin-right: 12px;
240
  }
241
  .msglist .sessionlist .list-right{
242
    position: relative;
243
    flex: 1;
244
    margin-top: 4px;
245
    font-size: 14px;
246
    line-height: 20px;
247
  }
248
249
  .msglist .sessionlist .list-right .name{
250
    display: inline-block;
251
    vertical-align: top;
252
    color: #333;
253
  }
254
  .msglist .sessionlist .list-right .time{
255
    float: right;
256
    color: #999;
257
    font-size: 10px;
258
    vertical-align: top;
259
  }
260
  .msglist .sessionlist .list-right .lastmsg{
261
    position: absolute;
262
    font-size: 12px;
263
    width: 100%;
264
    height: 20px;
265
    color: #999;
266
    bottom: 2px;
267
    overflow: hidden;
268
    white-space:nowrap;
269
    text-overflow:ellipsis;
270
  }
271
</style>

+ 246 - 0
src/pages/index/views/MiniChat/components/message.vue

@ -0,0 +1,246 @@
1
<template>
2
	<div class="message" v-if="selectChatId">
3
		<header class="header">
4
			<div class="friendname" v-if="selectKxUser">{{selectKxUser.name}} <span>{{selectKxUser.title}} {{selectKxUser.orgName}}</span></div>
5
      <a :href="'expert.html?id='+selectChatId"><el-button type="text">查看对方资料</el-button></a>
6
		</header>
7
		<div class="message-wrapper" ref="list">
8
      <ul v-if="chatDetailLocal && chatDetailLocal.length>0">
9
        <li v-for="(item,index) in chatDetailLocal" :key="item.index" class="message-item">
10
          <div class="time" v-if="!compareTwo(index, item.opTime)"><span>{{TimeTr(item.opTime, true)}}</span></div>
11
          <div class="main" :class="{ self: item.msgType }">
12
              <img class="avatar" width="36" height="36" :src="item.msgType ? headPhoto : selectKxUser.img" />
13
              <div class="content">
14
                  <div class="text" v-html="item.cnt"></div>
15
              </div>
16
          </div>
17
        </li>
18
      </ul>
19
		</div>
20
	</div>
21
</template>
22
23
<script>
24
import { TimeTr } from '@/libs/util'
25
export default {
26
  data() {
27
    return {
28
      TimeTr: TimeTr
29
    }
30
  },
31
  computed: {
32
    ...Vuex.mapGetters([
33
      'headPhoto',
34
      'selectChatId',
35
      'selectKxUser',
36
      'kxLastTime',
37
      'chatDetailLocal'
38
    ])
39
  },
40
  watch: {
41
    chatDetailLocal() {
42
      var that = this
43
      setTimeout(() => {
44
        that.$refs.list.scrollTop = that.$refs.list.scrollHeight
45
      }, 0)
46
    },
47
    selectChatId(val) {
48
      this.selectChatId = val
49
      clearTimeout(this.refreshChatTime)
50
      this.querySelectChatInfo()
51
    },
52
    selectKxUser(val) {
53
      this.selectKxUser = val
54
    }
55
  },
56
  created() {
57
    if (this.selectChatId) {
58
      this.querySelectChatInfo()
59
    }
60
  },
61
  mounted() {
62
    var that = this
63
    //  在页面加载时让信息滚动到最下面
64
    if (that.$refs.list) {
65
      setTimeout(() => {
66
        that.$refs.list.scrollTop = that.$refs.list.scrollHeight
67
      }, 0)
68
    }
69
  },
70
  methods: {
71
    querySelectChatInfo() {
72
      var that = this
73
      this.$axios.get('/ajax/msg/rec', {
74
        pid: that.selectChatId
75
      } ,function(res) {
76
        if (res.success && res.data) {
77
          const dataS = res.data
78
          if (dataS.length > 0) {
79
            for (let i = 0; i < dataS.length; ++i) {
80
              if (dataS[i].msgType === 0) {
81
                that.$store.dispatch('kxLastTimeAction', dataS[i].opTime)
82
              }
83
            }
84
          }
85
          that.$store.dispatch('chatDetailAction', dataS)
86
          that.queryRefreshChatDetal()
87
        }
88
      })
89
    },
90
    queryRefreshChatDetal() {
91
      var that = this
92
      this.$axios.get('/ajax/msg/refrec', {
93
        pid: that.selectChatId,
94
        opTime: that.kxLastTime
95
      } ,function(res) {
96
        if (res.success && res.data) {
97
          const dataS = res.data
98
          if (dataS.length > 0) {
99
            that.$store.dispatch('kxLastTimeAction', dataS[dataS.length - 1].opTime)
100
            dataS.map((item) => {
101
              that.chatDetailLocal.push(item)
102
            })
103
            that.chatDetailLocal.sort(function(a, b) {
104
              return a.opTime > b.opTime ? 1 : (a.opTime === b.opTime ? 0 : -1)
105
            })
106
            that.$store.dispatch('chatDetailAction', that.chatDetailLocal)
107
          }
108
          if (that && !that._isDestroyed) {
109
            that.refreshChatTime = setTimeout(() => {
110
              if (that && !that._isDestroyed) {
111
                that.queryRefreshChatDetal()
112
              }
113
            }, 1000)
114
          } else {
115
            that.refreshChatTime = ''
116
          }
117
        }
118
      })
119
    },
120
    /*超过时间10min*/
121
    timeCTen(t) {
122
      var d = new Date()
123
      d.setFullYear(parseInt(t.substring(0, 4)))
124
      d.setMonth(parseInt(t.substring(4, 6)) - 1)
125
      d.setDate(parseInt(t.substring(6, 8)))
126
      d.setHours(parseInt(t.substring(8, 10)))
127
      d.setMinutes(parseInt(t.substring(10, 12)))
128
      d.setSeconds(parseInt(t.substring(12, 14)))
129
      return d.getTime()
130
    },
131
    compareTwo(index, b) {
132
      var f = ''
133
      var l = this.timeCTen(b)
134
      let s = 10 * 60 * 1000
135
      if (index !== 0) {
136
        f = this.timeCTen(this.chatDetailLocal[index - 1].opTime)
137
      }
138
      return index !== 0 && (l - f) > s
139
    }
140
  },
141
  beforeDestroy() {
142
    var that = this
143
    this.$once('hook:beforeDestroy', () => {
144
      clearTimeout(that.refreshChatTime)
145
    })
146
  }
147
}
148
</script>
149
150
<style scoped>
151
  .message{
152
    width: 100%;
153
    height: 450px;
154
  }
155
  .message .header{
156
    height: 60px;
157
    padding: 10px 20px;
158
    box-sizing: border-box;
159
    border-bottom: 1px solid #e7e7e7;
160
    display: flex;
161
    justify-content: space-between;
162
    align-items: center
163
  }
164
  .message .header .friendname{
165
    font-size: 18px;
166
    color: #666;
167
  }
168
  .message .header .friendname span {
169
    font-size: 15px;
170
    color: #999;
171
  }
172
  .message .message-wrapper{
173
      min-height: 320px;
174
      max-height: 320px;
175
      padding: 10px 15px;
176
      box-sizing: border-box;
177
      overflow-y: auto;
178
      border-bottom: 1px solid #e7e7e7;
179
  }
180
  .message .message-wrapper .message-item{
181
    margin: 4px 0;
182
  }
183
  .message .message-wrapper .message{
184
    margin-bottom: 15px
185
  }
186
  .message .message-wrapper .time{
187
    width: 100%;
188
    font-size: 12px;
189
    margin: 7px auto;
190
    text-align: center;
191
  }
192
  .message .message-wrapper .time span{
193
    display: inline-block;
194
    padding: 4px 6px;
195
    color: #fff;
196
    border-radius: 3px;
197
    background-color: #dcdcdc;
198
  }
199
  .message .message-wrapper .main .avatar {
200
    float: left;
201
    margin-left: 15px;
202
    border-radius: 50%;
203
  }
204
  .message .message-wrapper .main .content{
205
    display: inline-block;
206
    margin-left: 10px;
207
    position: relative;
208
    padding: 6px 10px;
209
    max-width: 330px;
210
    min-height: 36px;
211
    line-height: 24px;
212
    box-sizing: border-box;
213
    font-size: 14px;
214
    text-align: left;
215
    background-color: #e2e1da;
216
    border-radius: 4px;
217
    overflow: hidden;
218
  }
219
  .message .message-wrapper .main .content .text {
220
    word-wrap: break-word;
221
  }
222
  .message .message-wrapper .main .content:before{
223
    content: " ";
224
    position: absolute;
225
    top: 12px;
226
    right: 100%;
227
    border: 6px solid transparent;
228
    border-right-color: #e2e1da;
229
  }
230
  .message .message-wrapper .self{
231
    text-align: right;
232
  }
233
  .message .message-wrapper .self .avatar{
234
    float: right;
235
    margin:0 15px;
236
  }
237
  .message .message-wrapper .self .content {
238
    background-color: #91c8f5;
239
  }
240
  .message .message-wrapper .self .content:before {
241
    right: -12px;
242
    vertical-align: middle;
243
    border-right-color: transparent;
244
    border-left-color: #91c8f5;
245
  }
246
</style>

+ 162 - 0
src/pages/index/views/MiniChat/components/text.vue

@ -0,0 +1,162 @@
1
<!-- 文本输入框 -->
2
<template>
3
  <div class="text">
4
    <textarea ref="text" v-model="content" @keyup="onKeyup"></textarea>
5
    <div class="send" @click="send">
6
    	<span>发送(Enter)</span>
7
    </div>
8
    <transition name="appear">
9
	    <div class="warn" v-show="warn">
10
	    	<div class="description">不能发送空白信息</div>
11
	    </div>
12
	</transition>
13
  </div>
14
</template>
15
16
<script>
17
import { DateFormat } from '@/libs/util'
18
export default {
19
  data () {
20
    return {
21
      content: '',
22
      frequency: 0,
23
      warn: false,
24
    }
25
  },
26
  computed: {
27
    ...Vuex.mapGetters([
28
      'selectChatId',
29
      'ifFirstChat',
30
      'chatDetailLocal'
31
    ])
32
  },
33
  methods: {
34
    onKeyup (e) {
35
      if (e.keyCode === 13) {
36
        this.send()
37
      }
38
    },
39
    send () {
40
      var that = this
41
      if (that.content.length === 0) {
42
        that.warn = true
43
        that.content = ''
44
        setTimeout(() => {
45
          that.warn = false
46
        }, 1000)
47
      } else {
48
        var url = '/ajax/msg/fsend'
49
        if (that.ifFirstChat) {
50
          url = '/ajax/msg/send'
51
        }
52
        that.$axios.post(url, {
53
          pid: that.selectChatId,
54
          cnt: that.content
55
        }, function(res) {
56
          if (res.success && res.data) {
57
            var msg = {
58
              cnt: that.content,
59
              opTime: DateFormat('yyyyMMddhhmmss'),
60
              msgType: '1',
61
            }
62
            that.chatDetailLocal.push(msg)
63
            that.chatDetailLocal.sort(function(a, b) {
64
              return a.opTime > b.opTime ? 1 : (a.opTime === b.opTime ? 0 : -1)
65
            })
66
            that.$store.dispatch('chatDetailAction', that.chatDetailLocal)
67
            that.content = ''
68
          }
69
        })
70
        
71
      }
72
    }
73
  },
74
  mounted() {
75
    this.$refs.text.focus()
76
  },
77
  watch: {
78
    selectChatId() {
79
      setTimeout(() => {
80
        this.$refs.text.focus()
81
      }, 0)
82
    },
83
    content() {
84
      if (this.content === '') {
85
        if ( this.frequency === 0) {
86
          this.warn = true
87
          this.frequency++
88
          setTimeout(() => {
89
            this.warn = false
90
          }, 1000)
91
        }
92
      }
93
    }
94
  }
95
}
96
</script>
97
98
<style scoped>
99
  .text{
100
    position: relative;
101
    height: 160px;
102
    background: #fff;
103
    z-index: 10;
104
  }
105
  .text textarea{
106
    box-sizing: border-box;
107
    padding: 10px 30px;
108
    height: 110px;
109
    width: 100%;
110
    border: none;
111
    outline: none;
112
    font-family: "Micrsofot Yahei";
113
    resize: none;
114
  }
115
  .text .send{
116
    position: absolute;
117
    bottom: 10px;
118
    right: 30px;
119
    padding: 0 20px;
120
    line-height: 28px;
121
    box-sizing: border-box;
122
    text-align: center;
123
    border: 1px solid #e5e5e5;
124
    border-radius: 4px;
125
    background: #f5f5f5;
126
    font-size: 14px;
127
    color: #7c7c7c;
128
    cursor: pointer;
129
  }
130
  .text .send:hover{
131
    background: #2693ec;
132
    color: #fff;
133
  }
134
  .text .warn{
135
    position: absolute;
136
    bottom: 50px;
137
    right: 10px;
138
    width: 110px;
139
    height: 30px;
140
    line-height: 30px;
141
    font-size: 12px;
142
    text-align: center;
143
    border: 1px solid #bdbdbd;
144
    border-radius: 4px;
145
    box-shadow:0 1px 5px 1px #bdbdbd;
146
  }
147
  .text .warn.appear-enter-active, .text .warn.appear-leave-active{
148
    transition: all 1s;
149
  }
150
  .text .warn.appear-enter, .text .warn.appear-leave-active{
151
    opacity: 0;
152
  }
153
  .text .warn::before{
154
    content: " ";
155
    position: absolute;
156
    top: 100%;
157
    right: 20px;
158
    border: 7px solid transparent;
159
    border-top-color: #fff;
160
    filter:drop-shadow(1px 3px 2px #bdbdbd);
161
  }
162
</style>

+ 100 - 0
src/pages/index/views/MiniChat/index.vue

@ -0,0 +1,100 @@
1
<template>
2
  <div class="chatBox">
3
    <div class="sidebar">
4
      <v-list></v-list>
5
    </div>
6
    <div class="main">
7
      <div v-show="selectChatId">
8
        <v-message></v-message>
9
        <v-text></v-text>
10
      </div>
11
    </div>
12
  </div>
13
</template>
14
<script>
15
  import queryBase from '@/libs/queryBase'
16
  import { urlParse, defaultSet, ImageUrl, TimeTr } from '@/libs/util'
17
  import VList from './components/list'
18
  import VText from './components/text'
19
  import VMessage from './components/message'
20
  export default {
21
    data() {
22
      return {
23
        urlParamsId: ''
24
      }
25
    },
26
    computed: {
27
      ...Vuex.mapGetters([
28
        'selectChatId'
29
      ])
30
    },
31
    components: {
32
      VList,
33
      VText,
34
      VMessage
35
    },
36
    created() {
37
      var that = this
38
      if (urlParse('id')) {
39
        that.urlParamsId = urlParse('id')
40
        queryBase.getProfessor(that.urlParamsId, function(sc, value){
41
          if (sc) {
42
            if (value.hasHeadImage) {
43
              value.img = ImageUrl(('head/' + value.id + '_l.jpg'), true)
44
            } else {
45
              value.img = defaultSet.img.expert
46
            }
47
            that.$store.dispatch('selectKxUserAction', value)
48
          }
49
        })
50
        that.$store.dispatch('selectSession', that.urlParamsId)
51
      } else {
52
        that.$store.dispatch('selectKxUserAction', '')
53
        that.$store.dispatch('selectSession', '')
54
      }
55
    }
56
  }
57
</script>
58
<style scoped>
59
  .chatBox {
60
    display: flex;
61
    overflow:hidden;
62
    margin-bottom: 20px;
63
    background: #fff;
64
  }
65
  .chatBox .sidebar, .main {
66
      height: 100%;
67
  }
68
  .chatBox .sidebar {
69
      float: left;
70
      width: 260px;
71
      color: #f4f4f4;
72
      border-right: 1px solid #ddd;
73
  }
74
  .chatBox .main {
75
      flex: 1;
76
      position: relative;
77
      overflow: hidden;
78
      height: 540px;
79
      background-color: #eee;
80
  }
81
  .chatBox .main::after{
82
    width: 100%;
83
    position: absolute;
84
    content: '点击左侧列表,查看对话记录';
85
    font-size: 14px;
86
    color: #999;
87
    line-height: 540px;
88
    text-align: center;
89
  }
90
  .chatBox .text {
91
      position: absolute;
92
      width: 100%;
93
      bottom: 0;
94
      left: 0;
95
  }
96
  .chatBox .message {
97
      height: 380px;
98
      background: #fff;
99
  }
100
</style>

+ 2 - 8
src/pages/index/views/ViewExpertPool/expItem.vue

@ -1,6 +1,6 @@
1 1
<template>
2
  <div class="block-container">
3
    <eItem v-if="userDataS && userDataS.length" v-for="item in userDataS" :key="item.index" :itemSinger="item"></eItem>
2
  <div class="block-container" v-if="userData && userData.length">
3
    <eItem v-for="item in userData" :key="item.index" :itemSinger="item"></eItem>
4 4
  </div>
5 5
</template>
6 6
@ -19,12 +19,6 @@
19 19
        userData: []
20 20
      };
21 21
    },
22
    computed: {
23
      userDataS() {
24
        // return this.num ? this.userData.splice(this.num) : this.userData
25
        return this.userData
26
      }
27
    },
28 22
    components: {
29 23
      eItem
30 24
    },

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

@ -15,16 +15,16 @@
15 15
          </ul>
16 16
        </div> -->
17 17
        <div class="tab-contain">
18
          <div v-show="!ifDefault">
19
            <baseResource v-if="platResources.length" v-for="item in platResources" :key="item.index" :itemSingle="item"></baseResource>
18
          <div v-show="!ifDefault" v-if="platResources.length">
19
            <baseResource v-for="item in platResources" :key="item.index" :itemSingle="item"></baseResource>
20 20
            <Loading v-show="loadingModalShow" :loadingComplete="loadingComplete" :isLoading="isLoading" v-on:upup="searchLower"></Loading>
21 21
          </div>
22 22
          <defaultPage v-show="ifDefault"></defaultPage>
23 23
        </div>
24 24
      </div>
25 25
    </div>
26
    <div class="wrapper-right">
27
      <div class="block-wrapper" v-if="adinfo.length" v-for="item in adinfo" :key="item.index">
26
    <div class="wrapper-right" v-if="adinfo.length">
27
      <div class="block-wrapper" 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>

+ 7 - 6
src/pages/index/views/ViewFindResult/index.vue

@ -8,16 +8,16 @@
8 8
      </div>
9 9
      <div class="block-wrapper">
10 10
        <div class="tab-contain">
11
          <div v-show="!ifDefault">
12
            <baseResult v-if="platResources.length" v-for="item in platResources" :key="item.index" :itemSingle="item"></baseResult>
11
          <div v-show="!ifDefault" v-if="platResources.length">
12
            <baseResult v-for="item in platResources" :key="item.index" :itemSingle="item"></baseResult>
13 13
            <Loading v-show="loadingModalShow" :loadingComplete="loadingComplete" :isLoading="isLoading" v-on:upup="searchLower"></Loading>
14 14
          </div>
15 15
          <defaultPage v-show="ifDefault"></defaultPage>
16 16
        </div>
17 17
      </div>
18 18
    </div>
19
    <div class="wrapper-right">
20
      <div class="block-wrapper" v-if="adinfo.length" v-for="item in adinfo" :key="item.index">
19
    <div class="wrapper-right" v-if="adinfo.length">
20
      <div class="block-wrapper" 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>
@ -98,8 +98,9 @@
98 98
      },
99 99
      keywordSearch() {
100 100
        if (this.keyVal) {
101
          this.dataO.bShareId = '';
102
          this.dataO.bTime = '';
101
          this.dataO.patSortNum = '',
102
          this.dataO.patCreateTime = '',
103
          this.dataO.patId = '',
103 104
          this.isFormSearch = true;
104 105
          this.loadingModalShow = false;
105 106
          this.loadingComplete = true;

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

@ -15,16 +15,16 @@
15 15
          </ul>
16 16
        </div> -->
17 17
        <div class="tab-contain">
18
          <div v-show="!ifDefault">
19
            <baseService v-if="platServices.length" v-for="item in platServices" :key="item.index" :itemSingle="item"></baseService>
18
          <div v-show="!ifDefault" v-if="platServices.length">
19
            <baseService v-for="item in platServices" :key="item.index" :itemSingle="item"></baseService>
20 20
            <Loading v-show="loadingModalShow" :loadingComplete="loadingComplete" :isLoading="isLoading" v-on:upup="searchLower"></Loading>
21 21
          </div>
22 22
          <defaultPage v-show="ifDefault"></defaultPage>
23 23
        </div>
24 24
      </div>
25 25
    </div>
26
    <div class="wrapper-right">
27
      <div class="block-wrapper" v-if="adinfo.length" v-for="item in adinfo" :key="item.index">
26
    <div class="wrapper-right" v-if="adinfo.length">
27
      <div class="block-wrapper" 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>

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

@ -1,6 +1,6 @@
1 1
<template>
2
  <div class="block-container">
3
    <oItem v-if="orgData && orgData.length" v-for="item in orgData" :key="item.index" :itemSinger="item"></oItem>
2
  <div class="block-container" v-if="orgData && orgData.length">
3
    <oItem v-for="item in orgData" :key="item.index" :itemSinger="item"></oItem>
4 4
  </div>
5 5
</template>
6 6

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

@ -15,8 +15,8 @@
15 15
			</div>
16 16
		</div>
17 17
		<div class="wrapper-right">
18
      <div class="block-wrapper" v-if="plat.adinfo.length" v-for="item in plat.adinfo" :key="item.index">
19
        <a class="ad-wrapper" :href="item.adUrl" target="_blank">
18
      <div class="block-wrapper" v-if="plat.adinfo.length">
19
        <a class="ad-wrapper" v-for="item in plat.adinfo" :key="item.index" :href="item.adUrl" target="_blank">
20 20
          <img :src="item.imgUrl" width="280" height="200">
21 21
        </a>
22 22
      </div>

+ 1 - 1
src/pages/index/views/logforms/enteringRegister.vue

@ -1,6 +1,6 @@
1 1
<template>
2 2
  <div class="login">
3
    <div class="logo-wrapper"></div>
3
    <router-link to="home" class="logo-wrapper"></router-link>
4 4
    <div class="form-wrapper">
5 5
      <div class="form-contain">
6 6
        <p class="form-title">{{$route.query.orgName}}</p>

+ 1 - 1
src/pages/index/views/logforms/findPwd.vue

@ -1,6 +1,6 @@
1 1
<template>
2 2
  <div class="login">
3
    <div class="logo-wrapper"></div>
3
    <router-link to="home" class="logo-wrapper"></router-link>
4 4
    <div class="form-wrapper">
5 5
      <div class="form-contain">
6 6
        <p class="form-title">密码重置</p>

BIN
src/pages/index/views/logforms/img/e-sign-on_bg_logo_nor.png


+ 1 - 1
src/pages/index/views/logforms/inviteCodeLogin.vue

@ -1,6 +1,6 @@
1 1
<template>
2 2
  <div class="login">
3
    <div class="logo-wrapper"></div>
3
    <router-link to="home" class="logo-wrapper"></router-link>
4 4
    <div class="form-wrapper">
5 5
      <div class="form-contain">
6 6
        <p class="form-title">登录</p>

+ 1 - 1
src/pages/index/views/logforms/loginPlat.vue

@ -1,6 +1,6 @@
1 1
<template>
2 2
  <div class="login">
3
    <div class="logo-wrapper"></div>
3
    <router-link to="home" class="logo-wrapper"></router-link>
4 4
    <div class="form-wrapper">
5 5
      <div class="form-contain">
6 6
        <p class="form-title">登录</p>

+ 1 - 1
src/pages/index/views/logforms/register.vue

@ -1,6 +1,6 @@
1 1
<template>
2 2
  <div class="login">
3
    <div class="logo-wrapper"></div>
3
    <router-link to="home" class="logo-wrapper"></router-link>
4 4
    <div class="form-wrapper">
5 5
      <div class="form-contain">
6 6
        <p class="form-title">注册</p>

+ 3 - 3
src/pages/index/views/logforms/style.scss

@ -12,9 +12,9 @@
12 12
    position: absolute;
13 13
    top: 30px;
14 14
    left: 30px;
15
    height: 64px;
16
    width: 292px;
17
    background-image:url('./img/e-sign-on_bg_logo_nor.png');
15
    height: 25px;
16
    width: 230px;
17
    background-image:url('/static/xtkfq/icon-logo.png');
18 18
    background-position: center center;
19 19
    background-repeat: no-repeat;
20 20
    background-size:cover;

+ 9 - 7
src/pages/org/show.vue

@ -16,7 +16,7 @@
16 16
          </div>
17 17
          <el-row class="goSpan" :gutter="10">
18 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> -->
19
            <el-col :span="12"><contactChat :contactOptions="{oid: orgId, type: 1}"></contactChat></el-col>
20 20
          </el-row>
21 21
        </div>
22 22
      </div>
@ -31,8 +31,8 @@
31 31
                  <span>可提供服务</span>
32 32
                  <span class="content-more" @click="activeName='second'">更多</span>
33 33
                </div>
34
                <div class="content content-nf">
35
                  <baseService v-if="platThreeServices.length" v-for="item in platThreeServices" :key="item.index" :itemSingle="item"></baseService>
34
                <div class="content content-nf" v-if="platThreeServices.length">
35
                  <baseService v-for="item in platThreeServices" :key="item.index" :itemSingle="item"></baseService>
36 36
                </div>
37 37
              </div>
38 38
              <div class="inner-wrapper" v-if="platThreeResources.length">
@ -40,8 +40,8 @@
40 40
                  <span>可共享资源</span>
41 41
                  <span class="content-more" @click="activeName='third'">更多</span>
42 42
                </div>
43
                <div class="content content-nf">
44
                  <baseResource v-if="platThreeResources.length" v-for="item in platThreeResources" :key="item.index" :itemSingle="item"></baseResource>
43
                <div class="content content-nf" v-if="platThreeResources.length">
44
                  <baseResource v-for="item in platThreeResources" :key="item.index" :itemSingle="item"></baseResource>
45 45
                </div>
46 46
              </div>
47 47
            </div>
@ -66,14 +66,14 @@
66 66
          </el-tab-pane>
67 67
          <el-tab-pane :label="'服务 ' + (serCount>0 ? serCount : '')" name="second">
68 68
            <div v-if="!ifDefault && platServices.length">
69
              <baseService v-if="platServices.length" v-for="item in platServices" :key="item.index" :itemSingle="item"></baseService>
69
              <baseService 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 72
            <defaultPage v-else></defaultPage>
73 73
          </el-tab-pane>
74 74
          <el-tab-pane :label="'资源 ' + (resCount>0 ? resCount : '')" name="third">
75 75
            <div v-if="!ifDefault2 && platResources.length">
76
              <baseResource v-if="platResources.length" v-for="item in platResources" :key="item.index" :itemSingle="item"></baseResource>
76
              <baseResource 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 79
            <defaultPage v-else></defaultPage>
@ -169,6 +169,7 @@
169 169
170 170
  import shareOut from '@/components/ShareOut';
171 171
  import collectCo from '@/components/CollectCo';
172
  import contactChat from '@/components/ContactChat';
172 173
  import baseService from '@/components/subTemplate/BaseService';
173 174
  import baseResource from '@/components/subTemplate/BaseResource';
174 175
@ -245,6 +246,7 @@
245 246
    components: {
246 247
      shareOut,
247 248
      collectCo,
249
      contactChat,
248 250
      baseService,
249 251
      baseResource
250 252
    },

+ 42 - 1
src/pages/resource/show.vue

@ -62,6 +62,23 @@
62 62
          <div class="right-split">
63 63
            <beyondTo v-if="owner.id" :ownerId="owner.id" :ownerType="owner.type"></beyondTo>
64 64
          </div>
65
          <div class="right-split" v-if="reslinkmans.length">
66
            <div class="content-title">
67
              <span>联系人</span>
68
            </div>
69
            <div class="content">
70
              <a v-for="item in reslinkmans" :key="item.index" class="list-item">
71
                <div class="list-head" style="border-radius: 50%" :style="{backgroundImage: 'url(' + item.uimg + ')'}"></div>
72
                <div class="list-info">
73
                  <div class="list-owner">{{item.professor.name}}</div>
74
                  <div class="list-desc">{{item.professor.title || item.professor.office}}</div>
75
                </div>
76
                <div class="list-link">
77
                  <contactChat :contactOptions="{oid: item.professorId }"></contactChat>
78
                </div>
79
              </a>
80
            </div>
81
          </div>
65 82
          <div class="right-split" v-if="hotResources && hotResources.length">
66 83
            <div class="content-title">
67 84
              <span>热门资源</span>
@ -89,6 +106,7 @@
89 106
  import shareOut from '@/components/ShareOut';
90 107
  import collectCo from '@/components/CollectCo';
91 108
  import beyondTo from '@/components/BeyondTo';
109
  import contactChat from '@/components/ContactChat';
92 110
93 111
  import baseResource from '@/components/subTemplate/BaseResource';
94 112
@ -104,7 +122,8 @@
104 122
          type: ''
105 123
        },
106 124
        hotResources: '',
107
        likeResources: ''
125
        likeResources: '',
126
        reslinkmans: []
108 127
      };
109 128
    },
110 129
    created() {
@ -112,12 +131,14 @@
112 131
      this.elurl = window.location.href;
113 132
      this.getResourceInfo();
114 133
      this.getLikeResources();
134
      this.getLinkmans();
115 135
    },
116 136
    components: {
117 137
      previewMagnify,
118 138
      shareOut,
119 139
      collectCo,
120 140
      beyondTo,
141
      contactChat,
121 142
      baseResource
122 143
    },
123 144
    methods: {
@ -191,6 +212,26 @@
191 212
            that.likeResources = $data
192 213
          }
193 214
        })
215
      },
216
      getLinkmans() {
217
        var that = this
218
        this.$axios.getk('/ajax/resource/qaLinkman',{
219
          resourceId: that.resourceId
220
        }, function(data) {
221
          if (data.success) {
222
            var $data = data.data;
223
            if ($data.length > 0) {
224
              for (var i = 0; i < $data.length; i++) {
225
                if ($data[i].professor.hasHeadImage) {
226
                  $data[i].uimg = ImageUrl(('head/' + $data[i].professorId + '_l.jpg'), true)
227
                } else {
228
                  $data[i].uimg = defaultSet.img.expert
229
                }
230
              }
231
              that.reslinkmans = $data
232
            }
233
          }
234
        })
194 235
      }
195 236
    }
196 237
  };

+ 35 - 37
src/pages/result/show.vue

@ -18,31 +18,31 @@
18 18
            <div class="content">
19 19
              <el-row :gutter="10" class="rel-detail">
20 20
                <el-col :span="12" v-if="patentInfo.code">
21
                  <el-col :span="5">专利号</el-col>
22
                  <el-col :span="19">{{patentInfo.code}}</el-col>
21
                  <el-col :span="4">专利号:</el-col>
22
                  <el-col :span="20">{{patentInfo.code}}</el-col>
23 23
                </el-col>
24 24
                <el-col :span="12" v-if="patentInfo.pubDay">
25
                  <el-col :span="5">公开日</el-col>
26
                  <el-col :span="19">{{patentInfo.pubDay}}</el-col>
25
                  <el-col :span="4">公开日:</el-col>
26
                  <el-col :span="20">{{patentInfo.pubDay}}</el-col>
27 27
                </el-col>
28 28
                <el-col :span="12" v-if="patentInfo.reqCode">
29
                  <el-col :span="5">申请号</el-col>
30
                  <el-col :span="19">{{patentInfo.reqCode}}</el-col>
29
                  <el-col :span="4">申请号:</el-col>
30
                  <el-col :span="20">{{patentInfo.reqCode}}</el-col>
31 31
                </el-col>
32 32
                <el-col :span="12" v-if="patentInfo.pubDay">
33
                  <el-col :span="5">申请日</el-col>
34
                  <el-col :span="19">{{patentInfo.pubDay}}</el-col>
33
                  <el-col :span="4">申请日:</el-col>
34
                  <el-col :span="20">{{patentInfo.pubDay}}</el-col>
35 35
                </el-col>
36 36
                <el-col :span="12" v-if="patentInfo.reqPerson">
37
                  <el-col :span="5">申请人</el-col>
38
                  <el-col :span="19">{{patentInfo.reqPerson}}</el-col>
37
                  <el-col :span="4">申请人:</el-col>
38
                  <el-col :span="20">{{patentInfo.reqPerson}}</el-col>
39 39
                </el-col>
40 40
                <el-col :span="24" v-if="patentInfo.summary">
41
                  <el-col :span="24">摘要</el-col>
41
                  <el-col :span="24">摘要:</el-col>
42 42
                  <el-col :span="24" v-html="patentInfo.summary"></el-col>
43 43
                </el-col>
44 44
                <el-col :span="24" v-if="patentInfo.cooperation">
45
                  <el-col :span="24">合作备注</el-col>
45
                  <el-col :span="24">合作备注:</el-col>
46 46
                  <el-col :span="24" v-html="patentInfo.cooperation"></el-col>
47 47
                </el-col>
48 48
                <el-col :span="24" v-if="patentInfo.keywords && patentInfo.keywords.length">
@ -60,15 +60,18 @@
60 60
            <div class="content">
61 61
              <el-row :gutter="10" style="width:100%">
62 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>
63
                  <div v-if="item.professorId.substring(0, 1) !== '#' && item.owner" class="list-item">
64
                    <a :href="'expert.html?id='+item.professorId" target="_blank"><div class="list-head" style="border-radius:50%" :style="{backgroundImage: 'url(' + item.owner.img + ')'}"></div></a>
65 65
                    <div class="list-info">
66
                      <div class="list-tit">{{item.name}}</div>
67
                      <div class="list-desc">{{item.title}}</div>
66
                      <div class="list-tit">{{item.owner.name}}</div>
67
                      <div class="list-desc">{{item.owner.title}}</div>
68
                    </div>
69
                    <div class="list-link" style="right: 0">
70
                      <contactChat :contactOptions="{oid: item.professorId }"></contactChat>
68 71
                    </div>
69
                  </a>
72
                  </div>
70 73
                  <div class="list-item" v-else>
71
                    <div class="list-head" :style="{backgroundImage: 'url(' + headUrl(item) + ')'}"></div>
74
                    <div class="list-head" style="border-radius:50%" :style="{backgroundImage: 'url(' + defaultExpertImg + ')'}"></div>
72 75
                    <div class="list-info">
73 76
                      <div class="list-tit">{{item.name}}</div>
74 77
                    </div>
@ -89,8 +92,8 @@
89 92
      </div>
90 93
      <div class="wrapper-right">
91 94
        <div class="wrapper-right">
92
          <div class="block-wrapper" v-if="adinfo.length" v-for="item in adinfo" :key="item.index">
93
            <a class="ad-wrapper" :href="item.adUrl" target="_blank">
95
          <div class="block-wrapper" v-if="adinfo.length">
96
            <a class="ad-wrapper" v-for="item in adinfo" :key="item.index" :href="item.adUrl" target="_blank">
94 97
              <img :src="item.imgUrl" width="280" height="200">
95 98
            </a>
96 99
          </div>
@ -106,6 +109,7 @@
106 109
107 110
  import shareOut from '@/components/ShareOut';
108 111
  import collectCo from '@/components/CollectCo';
112
  import contactChat from '@/components/ContactChat';
109 113
110 114
  import baseResult from '@/components/subTemplate/BaseResult';
111 115
  import queryBase from '@/libs/queryBase';
@ -120,7 +124,8 @@
120 124
        patentId: '',
121 125
        elurl: '',
122 126
        likePatents: '',
123
        patentAuthors: ''
127
        patentAuthors: '',
128
        defaultExpertImg: defaultSet.img.expert
124 129
      };
125 130
    },
126 131
    created() {
@ -133,6 +138,7 @@
133 138
    components: {
134 139
      shareOut,
135 140
      collectCo,
141
      contactChat,
136 142
      baseResult
137 143
    },
138 144
    methods: {
@ -164,34 +170,26 @@
164 170
            const $data = res.data
165 171
            if ($data.length > 0) {
166 172
              that.authorCount = $data.length
167
              var hdata = { num: 1, data: $data }
168 173
              for (let i = 0; i < $data.length; ++i) {
169
                hdata.num++
170 174
                if ($data[i].professorId.substring(0, 1) !== '#') {
171
                  var item = $data[i]
172
                  queryBase.getProfessor(item.professorId, function(sc, value) {
173
                    alert(333)
175
                  queryBase.getProfessor($data[i].professorId, function(sc, value) {
174 176
                    if (sc) {
175
                      hdata.num--
176
                      item.name = value.name;
177
                      if (value.hasHeadImage) {
178
                        value.img = ImageUrl(('head/' + value.id + '_l.jpg'), true)
179
                      } else {
180
                        value.img = defaultSet.img.expert
181
                      }
182
                      $data[i].owner = value
177 183
                      that.$forceUpdate();
178 184
                    }
179 185
                  });
180
                } else {
181
                  hdata.num--
182 186
                }
183 187
              }
184
              hdata.num--
185
              if (hdata.num === 0) {
186
                that.patentAuthors = $data
187
              }
188
              that.patentAuthors = $data
188 189
            }
189 190
          }
190 191
        })
191 192
      },
192
      headUrl(item) {
193
        return item.hasHeadImage ? ImageUrl(('head/' + item.id + '_l.jpg'), true) : defaultSet.img.expert;
194
      },
195 193
      getLikePatents() {
196 194
        var that = this
197 195
        that.$axios.getk('/ajax/ppatent/ralatePatents', {

+ 57 - 1
src/pages/serve/show.vue

@ -50,6 +50,23 @@
50 50
          <div class="right-split">
51 51
            <beyondTo v-if="ownerB.id" :ownerId="ownerB.id" :ownerType="ownerB.type"></beyondTo>
52 52
          </div>
53
          <div class="right-split" v-if="reslinkmans.length">
54
            <div class="content-title">
55
              <span>联系人</span>
56
            </div>
57
            <div class="content">
58
              <a v-for="item in reslinkmans" :key="item.index" class="list-item">
59
                <div class="list-head" style="border-radius: 50%" :style="{backgroundImage: 'url(' + item.img + ')'}"></div>
60
                <div class="list-info">
61
                  <div class="list-owner">{{item.name}}</div>
62
                  <div class="list-desc">{{item.title || item.office}}</div>
63
                </div>
64
                <div class="list-link">
65
                  <contactChat :contactOptions="{oid: item.id }"></contactChat>
66
                </div>
67
              </a>
68
            </div>
69
          </div>
53 70
          <div class="right-split" v-if="hotserves && hotserves.length">
54 71
            <div class="content-title">
55 72
              <span>热门服务</span>
@ -77,6 +94,7 @@
77 94
  import shareOut from '@/components/ShareOut';
78 95
  import collectCo from '@/components/CollectCo';
79 96
  import beyondTo from '@/components/BeyondTo';
97
  import contactChat from '@/components/ContactChat';
80 98
81 99
  import baseService from '@/components/subTemplate/BaseService';
82 100
@ -92,7 +110,8 @@
92 110
          type: ''
93 111
        },
94 112
        hotserves: '',
95
        likeserves: ''
113
        likeserves: '',
114
        reslinkmans: []
96 115
      };
97 116
    },
98 117
    created() {
@ -100,12 +119,14 @@
100 119
      this.elurl = window.location.href;
101 120
      this.getserveInfo();
102 121
      this.getLikeserves();
122
      this.getLinkmans();
103 123
    },
104 124
    components: {
105 125
      previewMagnify,
106 126
      shareOut,
107 127
      collectCo,
108 128
      beyondTo,
129
      contactChat,
109 130
      baseService
110 131
    },
111 132
    methods: {
@ -185,6 +206,41 @@
185 206
            }
186 207
          }
187 208
        })
209
      },
210
      getLinkmans() {
211
        var that = this
212
        this.$axios.getk('/ajax/ware/pro',{
213
          id: that.serveId
214
        }, function(res) {
215
          if (res.success) {
216
            var $data = res.data;
217
            var arr = []
218
            if ($data.length > 0) {
219
              for (var i = 0; i < $data.length; i++) {
220
                arr.push($data[i].professor)
221
              }
222
              if (arr.length) {
223
                that.$axios.getk('/ajax/professor/qm', {
224
                  id: arr
225
                }, function(data) {
226
                  if (data.success && data.data) {
227
                    if (data.data.length > 0) {
228
                      var str = data.data
229
                      for (var j = 0; j < str.length; j++) {
230
                        if (str[j].hasHeadImage) {
231
                          str[j].img = ImageUrl(('head/' + str[j].id + '_l.jpg'), true)
232
                        } else {
233
                          str[j].img = defaultSet.img.expert
234
                        }
235
                      }
236
                      that.reslinkmans = data.data
237
                    }
238
                  }
239
                })
240
              }
241
            }
242
          }
243
        })
188 244
      }
189 245
    }
190 246
  };

+ 8 - 1
src/store/getters.js

@ -1,7 +1,14 @@
1 1
const getters = {
2 2
  account: state => state.user.account,
3 3
  bindCompany: state => state.user.bindCompany,
4
  headPhoto: state => state.user.headPhoto
4
  headPhoto: state => state.user.headPhoto,
5
6
  chatListLocal: state => state.chat.chatListLocal,
7
  chatDetailLocal: state => state.chat.chatDetailLocal,
8
  selectChatId: state => state.chat.selectChatId,
9
  selectKxUser: state => state.chat.selectKxUser,
10
  ifFirstChat: state => state.chat.ifFirstChat,
11
  kxLastTime: state => state.chat.kxLastTime
5 12
}
6 13
7 14
export default getters

+ 3 - 1
src/store/index.js

@ -1,9 +1,11 @@
1 1
import user from './modules/user';
2
import chat from './modules/chat';
2 3
import getters from './getters';
3 4
4 5
const store = new Vuex.Store({
5 6
  modules: {
6
    user
7
    user,
8
    chat
7 9
  },
8 10
  getters
9 11
})

+ 41 - 0
src/store/modules/chat.js

@ -0,0 +1,41 @@
1
const chat = {
2
  state: {
3
    chatListLocal: [],
4
    chatDetailLocal: [],
5
    selectChatId: '',
6
    selectKxUser: '',
7
    ifFirstChat: false,
8
    kxLastTime: '0'
9
  },
10
  mutations: {
11
    chatListLocal(state, value) {
12
      state.chatListLocal = value
13
    },
14
    chatDetailLocal(state, value) {
15
      state.chatDetailLocal = value
16
    },
17
    selectChatId(state, value) {
18
      state.selectChatId = value
19
    },
20
    selectKxUser(state, value) {
21
      state.selectKxUser = value
22
    },
23
    ifFirstChat(state, value) {
24
      state.ifFirstChat = value
25
    },
26
    kxLastTime(state, value) {
27
      state.kxLastTime = value
28
    }
29
  },
30
31
  actions: {
32
    chatListAction: ({ commit }, value) => commit('chatListLocal', value),
33
    chatDetailAction: ({ commit }, value) => commit('chatDetailLocal', value),
34
    selectSession: ({ commit }, value) => commit('selectChatId', value),
35
    selectKxUserAction: ({ commit }, value) => commit('selectKxUser', value),
36
    ifFirstChatActiion: ({ commit }, value) => commit('ifFirstChat', value),
37
    kxLastTimeAction: ({ commit }, value) => commit('kxLastTime', value)
38
  }
39
}
40
41
export default chat

+ 8 - 0
src/store/modules/user.js

@ -42,6 +42,8 @@ const user = {
42 42
              localStorage.setItem('userid', dataS.id);
43 43
              localStorage.setItem('uaccount', dataS.account);
44 44
              localStorage.setItem('bcid', dataS.bindCompany);
45
              localStorage.setItem('curcomp', dataS.comp);
46
              localStorage.setItem('curphone', dataS.linkPhone);
45 47
            }
46 48
          }
47 49
          resolve(response)
@ -64,6 +66,8 @@ const user = {
64 66
            localStorage.setItem('userid', dataS.id);
65 67
            localStorage.setItem('uaccount', dataS.account);
66 68
            localStorage.setItem('bcid', dataS.bindCompany);
69
            localStorage.setItem('curcomp', dataS.comp);
70
            localStorage.setItem('curphone', dataS.linkPhone);
67 71
          } else {
68 72
            commit('SET_USERID', '')
69 73
            commit('SET_ACCOUNT', '')
@ -71,6 +75,8 @@ const user = {
71 75
            localStorage.removeItem('userid');
72 76
            localStorage.removeItem('uaccount');
73 77
            localStorage.removeItem('bcid');
78
            localStorage.removeItem('curcomp');
79
            localStorage.removeItem('curphone');
74 80
          }
75 81
          resolve(response)
76 82
        }).catch(error => {
@ -90,6 +96,8 @@ const user = {
90 96
          localStorage.removeItem('userid');
91 97
          localStorage.removeItem('uaccount');
92 98
          localStorage.removeItem('bcid');
99
          localStorage.removeItem('curcomp');
100
          localStorage.removeItem('curphone');
93 101
          resolve()
94 102
        }).catch(error => {
95 103
          reject(error)

+ 12 - 0
src/styles/listitem.scss

@ -79,9 +79,11 @@
79 79
.list-item{
80 80
  width: 100%;
81 81
  display:flex;
82
  position: relative;
82 83
  align-items:center;
83 84
  background:#fff;
84 85
  padding:20px;
86
  box-sizing: border-box;
85 87
  @include border-1px();
86 88
  &:last-child{
87 89
    @include border-none();
@ -122,6 +124,16 @@
122 124
      color:$commonFont;
123 125
    }
124 126
  }
127
  .list-link{
128
    position: absolute;
129
    right: -14px;
130
    top: 50%;
131
    margin-top:-12px;
132
    .el-button{
133
      padding: 6px 8px;
134
      font-size: 12px;
135
    }
136
  }
125 137
}
126 138
.wrapper-right .list-item{
127 139
  padding: 10px 0;