Procházet zdrojové kódy

Merge branch 'master' of http://git.shengws.com/zhangbj/scrm-vue

庄逸洲 před 5 roky
rodič
revize
32c128cb6e

+ 10 - 0
package-lock.json Zobrazit soubor

@@ -12875,6 +12875,11 @@
12875 12875
       "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=",
12876 12876
       "dev": true
12877 12877
     },
12878
+    "spark-md5": {
12879
+      "version": "3.0.0",
12880
+      "resolved": "https://registry.npmjs.org/spark-md5/-/spark-md5-3.0.0.tgz",
12881
+      "integrity": "sha1-NyIifFTi+vJLHcbZM8wUTm9xv+8="
12882
+    },
12878 12883
     "spdx-correct": {
12879 12884
       "version": "3.1.0",
12880 12885
       "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz",
@@ -14311,6 +14316,11 @@
14311 14316
         "minimalistic-assert": "^1.0.0"
14312 14317
       }
14313 14318
     },
14319
+    "webim-tencent": {
14320
+      "version": "1.0.2",
14321
+      "resolved": "https://registry.npmjs.org/webim-tencent/-/webim-tencent-1.0.2.tgz",
14322
+      "integrity": "sha512-sdSRjcTsb/4t9riUpEv3+01wNMxP8hbWOllPbmkqKJ2jhXy88w57K7Ae4BnaeFH55prdcpsKwBhsX7BiJYGv/w=="
14323
+    },
14314 14324
     "webpack": {
14315 14325
       "version": "3.10.0",
14316 14326
       "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.10.0.tgz",

+ 2 - 0
package.json Zobrazit soubor

@@ -61,6 +61,7 @@
61 61
     "showdown": "1.8.5",
62 62
     "simplemde": "1.11.2",
63 63
     "sortablejs": "1.7.0",
64
+    "spark-md5": "^3.0.0",
64 65
     "vue": "2.5.16",
65 66
     "vue-count-to": "1.0.13",
66 67
     "vue-i18n": "7.3.2",
@@ -69,6 +70,7 @@
69 70
     "vue-splitpane": "1.0.2",
70 71
     "vuedraggable": "^2.16.0",
71 72
     "vuex": "3.0.1",
73
+    "webim-tencent": "^1.0.2",
72 74
     "xlsx": "^0.11.16"
73 75
   },
74 76
   "devDependencies": {

+ 20 - 2
src/App.vue Zobrazit soubor

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

+ 24 - 0
src/api/act/staffmanager.js Zobrazit soubor

@@ -0,0 +1,24 @@
1
+import request from '@/utils/request'
2
+
3
+export function addStaffInfo (data){
4
+    console.log("文章列表",data)
5
+    return request({
6
+        url: '/api/staff/addStaffInfo',
7
+        method: 'Post',
8
+        data: data
9
+    })
10
+}
11
+
12
+export function getAllStaffInfo (param,keyword) {
13
+    console.log("param",param,"keyword",keyword)
14
+    const params = {
15
+        param: param,
16
+        keyword:keyword,
17
+    }
18
+
19
+    return request({
20
+        url:'/api/staff/getAllStaffInfo',
21
+        method:'Get',
22
+        params:params
23
+    })
24
+}

+ 104 - 3
src/api/act/submitinfo.js Zobrazit soubor

@@ -18,11 +18,18 @@ export function getArticleType(params){
18 18
      })
19 19
 }
20 20
 
21
-export function GetAllArticles(params){
21
+export function GetAllArticles(param,status,keyword,id){
22
+    const params = {
23
+        param:param,
24
+        status:status,
25
+        keyword:keyword,
26
+        id:id,
27
+    }
28
+    console.log("params是什么?",params)
22 29
      return request({
23 30
          url:'/api/acticle/getAllArticles',
24 31
          method:'Get',
25
-         params:params
32
+         params:params,
26 33
      })
27 34
 }
28 35
 
@@ -75,4 +82,98 @@ export function Savedraft(data){
75 82
         method:"post",
76 83
         data:data,
77 84
     })
78
-}
85
+}
86
+
87
+export function previewArticle(data){
88
+    return request({
89
+        url:"/api/acticle/prviewArticle",
90
+        method:"post",
91
+        data:data
92
+    })
93
+}
94
+
95
+export function getarticlePreview(params){
96
+   return request({
97
+       url:"/api/acticle/getarticlePreview",
98
+       method:'Get',
99
+       params:params
100
+   })
101
+}
102
+
103
+export function save(data){
104
+   return request({
105
+       url:"/api/acticle/save",
106
+       method:"Post",
107
+       data:data
108
+   })
109
+}
110
+
111
+export function openDelete(data){
112
+    return request({
113
+        url:"/api/article/Delete",
114
+        method:"delete",
115
+        data:data
116
+    })
117
+}
118
+
119
+
120
+export function getEditArticle(id,param){
121
+    console.log("params是啥?",param)
122
+    return request({
123
+        url:"/api/acticle/getEditArticle?id="+id,
124
+        method:"Get",
125
+        param:param,
126
+    })
127
+}
128
+
129
+export function getMenus(params){
130
+    console.log("params是什么",params)
131
+    return request({
132
+        url:"/api/acticle/getMenus",
133
+        method:'Get',
134
+        params:params
135
+    })
136
+}
137
+
138
+export function UpdataArticleInfo(id,data){
139
+   console.log("修改文章内容",data)
140
+   return request({
141
+       url:"/api/acticle/updateArticlesInfo?id="+id,
142
+       method:'Post',
143
+       data:data
144
+   })
145
+}
146
+
147
+export function previewEditArticle(id,data){
148
+   return request({
149
+       url:"/api/acticle/previewEditArticle?id="+id,
150
+       method:'Post',
151
+       data:data
152
+   })
153
+}
154
+
155
+export function getPreviewInfo(params){
156
+    return request({
157
+        url:"/api/acticle/getPreviewInfo",
158
+        method:'Post',
159
+        params:params,
160
+    })
161
+}
162
+
163
+export function getAllComment(params){
164
+    console.log("评论",params)
165
+    return request({
166
+        url:"/api/acticle/getAllComment",
167
+        method:'Get',
168
+        params:params,
169
+    })
170
+}
171
+
172
+export function getArticleCommentDetail(params,id){
173
+    console.log("文章评论详情",id)
174
+    return request({
175
+        url:"/api/acticle/getArticleCommentDetail?id="+id,
176
+        method:'Get',
177
+        params:params,
178
+    })
179
+}

+ 8 - 0
src/api/kefu/tencentim.js Zobrazit soubor

@@ -0,0 +1,8 @@
1
+import request from '@/utils/request'
2
+
3
+export function getusersig() {
4
+  return request({
5
+    url: '/api/tencent/usersig', 
6
+    method: 'get',
7
+  })
8
+}

+ 2 - 0
src/lang/zh.js Zobrazit soubor

@@ -51,8 +51,10 @@ export default {
51 51
     articleCategory: '文章分类',
52 52
     commentList: '评论列表',
53 53
     articleComment: '文章评论',
54
+    articleCommentDetail:'文章评论详情',
54 55
     editArticle: '编辑文章',
55 56
     articleList: '文章列表',
57
+    articlePreview:'文章预览',
56 58
     errorPages: '错误页面',
57 59
     page401: '401',
58 60
     page404: '404',

+ 2 - 0
src/router/index.js Zobrazit soubor

@@ -13,6 +13,7 @@ import org from './modules/org'
13 13
 import marketing_tool from './modules/marketing_tool'
14 14
 import system from './modules/system'
15 15
 import site from './modules/site'
16
+import kefu from './modules/kefu'
16 17
 
17 18
 /** note: submenu only apppear when children.length>=1
18 19
  *   detail see  https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
@@ -79,6 +80,7 @@ var _constant_router_map = [{
79 80
 
80 81
 var _asy_router_map = [
81 82
   member,
83
+  kefu,
82 84
   article,
83 85
   marketing_tool,
84 86
   org,

+ 29 - 1
src/router/modules/article.js Zobrazit soubor

@@ -40,6 +40,34 @@ export default {
40 40
       component: () => import('@/scrm_pages/article/articleComment'),
41 41
       name: 'articleComment',
42 42
       meta: { title: 'articleComment', noCache: true }
43
-    }
43
+    },
44
+    {
45
+      path: '/articles/articlePreview',
46
+      component: () => import('@/scrm_pages/article/articlePreview'),
47
+      name: 'articlePreview',
48
+      hidden:true,
49
+      meta: { title: 'articlePreview', noCache: true }
50
+    },
51
+    {
52
+      path: '/articles/editArticle/:id',
53
+      component: () => import('@/scrm_pages/article/editArticle'),
54
+      name: 'editArticle',
55
+      hidden:true,
56
+      meta: { title: 'editArticle', noCache: true }
57
+    },
58
+    {
59
+      path: '/articles/articleEditPreview',
60
+      component: () => import('@/scrm_pages/article/articleEditPreview'),
61
+      name: 'articleEditPreview',
62
+      hidden:true,
63
+      meta: { title: 'articleEditPreview', noCache: true }
64
+    },
65
+    {
66
+      path: '/articles/articleCommentDetail/:id',
67
+      component: () => import('@/scrm_pages/article/articleCommentDetail'),
68
+      name: 'articleCommentDetail',
69
+      hidden:true,
70
+      meta: { title: 'articleCommentDetail', noCache: true }
71
+    },
44 72
   ]
45 73
 }

+ 23 - 0
src/router/modules/kefu.js Zobrazit soubor

@@ -0,0 +1,23 @@
1
+import Layout from '@/views/layout/Layout'
2
+//客服管理模块
3
+
4
+
5
+export default {
6
+    alwaysShow: true,
7
+    path: '/kefu',
8
+    component: Layout,
9
+    redirect: 'noredirect',
10
+    name: 'kefu',
11
+    meta: {
12
+      title: '客服管理',
13
+      icon: 'message'
14
+    },
15
+    children: [
16
+      {
17
+        path: '/kefu',
18
+        component: () => import('@/scrm_pages/kefu'),
19
+        name: 'kefuBox',
20
+        meta: { title: '咨询管理', noCache: true }
21
+      },
22
+    ]
23
+  }

+ 2 - 2
src/scrm_pages/article/acticleCategory.vue Zobrazit soubor

@@ -179,7 +179,7 @@
179 179
                 var res = response.data;
180 180
                 if(res.state === 1){
181 181
                     this.articsData.splice(index,1);
182
-                    this.$message.success("删除会员成功");
182
+                    this.$message.success("删除成功");
183 183
                 }else{
184 184
                    this.$message.error(res.msg);
185 185
                 }
@@ -193,7 +193,7 @@
193 193
         },
194 194
         openDeleteCategorys(){
195 195
             if (this.selectedMembers.length==0) {
196
-            this.$message.error("请选择要删除的会员");
196
+            this.$message.error("请选择要删除的信息");
197 197
             return false;
198 198
           }   
199 199
 

+ 47 - 14
src/scrm_pages/article/articleComment.vue Zobrazit soubor

@@ -6,28 +6,30 @@
6 6
     <div class="app-container">
7 7
       <el-row :gutter="12" style="margin-top: 10px">
8 8
         <el-table
9
-          :data="cancelStockDate"
10
-          :class="signAndWeighBoxPatients"
11
-          border
12
-          highlight-current-row
13
-          ref="multipleTable"
9
+         :data="articsData"
10
+          border fit highlight-current-row
14 11
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
15
-        >
12
+        >   
13
+           <el-table-column
14
+                align="center" 
15
+                type="selection"
16
+                width="55">
17
+          </el-table-column> 
16 18
           <el-table-column label="标题" align="center">
17 19
             <template slot-scope="scope">
18
-            123
20
+            {{scope.row.title}}
19 21
           </template>
20 22
           </el-table-column>
21 23
 
22 24
           <el-table-column label="评论状态" align="center">
23
-            <template slot-scope="scope">
24
-              456
25
+            <template>
26
+              <span>正常</span>
25 27
             </template>
26 28
           </el-table-column>
27 29
 
28 30
           <el-table-column label="总评论数" align="center">
29 31
             <template slot-scope="scope">
30
-              789
32
+             {{scope.row.comment_num}}
31 33
             </template>
32 34
           </el-table-column>
33 35
 
@@ -39,7 +41,7 @@
39 41
                   size="mini"
40 42
                   type="primary"
41 43
                   icon="el-icon-edit-outline"
42
-                  @click="handleEdit(scope.$index, scope.row)">
44
+                  @click="$router.push('/articles/articleCommentDetail/'+scope.row.id)">
43 45
                 </el-button>
44 46
               </el-tooltip>
45 47
             </template>
@@ -50,8 +52,8 @@
50 52
         <el-pagination
51 53
           @size-change="handleSizeChange"
52 54
           @current-change="handleCurrentChange"
53
-          :page-sizes="[7]"
54
-          :page-size="7"
55
+          :page-sizes="[10,20,50,100]"
56
+          :page-size="10"
55 57
           background
56 58
           style="margin-top:20px;float: right"
57 59
           layout="total, sizes, prev, pager, next, jumper"
@@ -65,6 +67,7 @@
65 67
 
66 68
 <script>
67 69
   import BreadCrumb from '../components/bread-crumb'
70
+   import { getAllComment } from '@/api/act/submitinfo'
68 71
   export default {
69 72
     name: 'articleComment',
70 73
     components:{
@@ -74,9 +77,39 @@
74 77
       return{
75 78
         crumbs: [
76 79
           { path: false, name: '文章管理' },
77
-          { path: '/articles/articleComment', name: '评论列表' }
80
+          { path: '/articles/articleComment', name: '文章评论' }
78 81
         ],
82
+        listQuery:{
83
+           page:1,
84
+           limit:10,
85
+           title:'',
86
+           commentNnum:'',
87
+        },
88
+         articsData:[],
89
+         handleSizeChange(limit) {
90
+            this.listQuery.limit = limit;
91
+            this.GetAllAritcles();
92
+        },
93
+         handleCurrentChange(page) {
94
+            this.listQuery.page = page;
95
+            this.GetAllAritcles();
96
+        },
97
+        total:0,
79 98
       }
99
+    },
100
+    methods:{
101
+         getAllComment(){
102
+           getAllComment(this.listQuery).then(response=>{
103
+                if(response.data.state == 1){
104
+                   this.articsData = response.data.data.articles; 
105
+                   console.log("文章内容",this.articsData)                 
106
+                   this.total =  response.data.data.total                 
107
+                }
108
+           });
109
+         }
110
+    },
111
+    created(){
112
+      this.getAllComment();
80 113
     }
81 114
   }
82 115
 </script>

+ 70 - 0
src/scrm_pages/article/articleCommentDetail.vue Zobrazit soubor

@@ -0,0 +1,70 @@
1
+<template>
2
+     <div class="main-contain">
3
+        <div class="position">
4
+            <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+             <el-button  style="float:right;" type="primary" size="small"  @click="$router.push('/articles/articleComment')">返回全部文章</el-button>
6
+        </div>
7
+        <div class="app-container">
8
+             <div class="title">{{listQuerty.title}}</div>
9
+             <div>{{listQuerty.publicTime}}</div>
10
+             <div class="sort">已按最新热度排序</div>
11
+            <div class="border"></div>          
12
+        </div>
13
+     </div>
14
+</template>
15
+
16
+<script>
17
+   import BreadCrumb from '../components/bread-crumb'
18
+   import { getArticleCommentDetail } from '@/api/act/submitinfo'
19
+    export default {
20
+        name: "articleCommentDetail",
21
+        components:{
22
+            BreadCrumb
23
+         },
24
+         data(){
25
+             return{
26
+                 crumbs: [
27
+                   { path: false, name: '文章管理' },
28
+                   { path: '/articles/articleComment', name: '文章评论详情' }
29
+                ],
30
+                listQuerty:{
31
+                   title:'',
32
+                   publicTime:'',
33
+                }
34
+             }
35
+         },
36
+         created(){
37
+            this.getArticleCommentDetail(); 
38
+         },
39
+         methods:{
40
+             getArticleCommentDetail(){
41
+                 const id = this.$route.params && this.$route.params.id
42
+                 console.log("id",id)
43
+                 getArticleCommentDetail(this.listQuerty,id).then(response=>{
44
+                        if(response.data.state == 1){
45
+                            var articles = response.data.data.articles
46
+                            this.listQuerty.title = articles.title
47
+                            this.listQuerty.publicTime =  articles.publicTime
48
+                            console.log("内容是设么",articles)
49
+                        }
50
+                 })
51
+             }
52
+         }
53
+    }
54
+
55
+</script>
56
+
57
+<style scoped>
58
+   .border{
59
+       border: 1px #dcdfe6 solid;
60
+       margin-top: 30px;
61
+   }
62
+   .title{
63
+       font-size: 25px;
64
+       margin-bottom: 20px;
65
+   }
66
+   .sort{
67
+      float: right;
68
+      font-size: 18px;
69
+   }
70
+</style>

+ 89 - 0
src/scrm_pages/article/articleEditPreview.vue Zobrazit soubor

@@ -0,0 +1,89 @@
1
+<template>
2
+     <div class="main-contain">
3
+         <div class="position">
4
+            <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+         </div>
6
+         <div class="app-container">
7
+            <el-form label-width="90px" class="clearfix" :model="form" ref="acticleform">
8
+                 <el-row :span=20>
9
+                    <el-form-item>
10
+                        <div class="title">
11
+                           {{form.title}}
12
+                        </div>
13
+                    </el-form-item>
14
+                 </el-row>
15
+                 <el-row :span=20>
16
+                     <el-form-item>
17
+                         <div  class="cont">
18
+                           <li v-html="form.content"></li>
19
+                         </div>
20
+                     </el-form-item>
21
+                 </el-row>
22
+                 <el-row :span=20>
23
+                 <el-form-item>
24
+                    <div class="but">
25
+                      <el-button type="primary" @click="clossPreview()">关闭预览</el-button>
26
+                    </div>    
27
+                 </el-form-item>
28
+          </el-row>        
29
+            </el-form>
30
+       </div>
31
+     </div>
32
+</template>
33
+
34
+<script>
35
+    import BreadCrumb from '../components/bread-crumb'
36
+      import { getPreviewInfo } from '@/api/act/submitinfo'
37
+    export default {
38
+        name: "articleEditPreview",
39
+         components:{
40
+            BreadCrumb
41
+        },
42
+        data(){
43
+            return{
44
+                 crumbs: [
45
+                     { path: false, name: '文章管理' },
46
+                     { path: '/articles/articleEditPreview', name: '文章编辑预览' }
47
+                ],
48
+                form:{
49
+                    title:'',
50
+                    content:'',
51
+                }
52
+            }
53
+        },
54
+        methods:{
55
+            articleEditPreview(){
56
+                getPreviewInfo(this.form).then(response=>{
57
+                      if(response.data.state == 1){
58
+                         this.form =  response.data.data.articles;
59
+                         var articles =  response.data.data.articles
60
+                         console.log("articles",articles)        
61
+                      }
62
+                })   
63
+            },
64
+            clossPreview(){
65
+              this.$router.push({path:'/articles/articleList'})
66
+            }
67
+        },
68
+        created(){
69
+            this.articleEditPreview();
70
+        }
71
+    }
72
+</script>
73
+      
74
+<style scoped>
75
+    .title{
76
+       font-size: 20px;
77
+       position: relative;
78
+       left: 750px;
79
+    }
80
+
81
+    .cont{
82
+      position: relative;
83
+      left: 200px;
84
+    }
85
+    .but{
86
+      position: relative;
87
+      left: 750px;
88
+    }
89
+</style>

+ 133 - 42
src/scrm_pages/article/articleList.vue Zobrazit soubor

@@ -2,14 +2,14 @@
2 2
   <div class="main-contain">
3 3
     <div class="position">
4 4
       <bread-crumb :crumbs='crumbs'></bread-crumb>
5
-      <el-button  style="float:right;" type="primary" size="small" icon="el-icon-circle-plus-outline">添加文章</el-button>
5
+      <el-button  style="float:right;" type="primary" size="small" icon="el-icon-circle-plus-outline" @click="AddArticle()">添加文章</el-button>
6 6
     </div>
7 7
     <div class="app-container">
8 8
           <div style="margin-bottom: 10px">
9 9
             <el-row :gutter="24">
10 10
               <el-col :span="8">
11
-                  <el-input style="width: 300px" v-model="listQuery.search"  placeholder="请输入您需要搜索的内容"></el-input>
12
-                  <el-button type="primary"  icon="el-icon-search" @click="changeKey">搜索</el-button>
11
+                  <el-input style="width: 300px" v-model="keyword"  placeholder="请输入您需要搜索的内容"></el-input>
12
+                  <el-button type="primary"  icon="el-icon-search" @click="changeKey()">搜索</el-button>
13 13
               </el-col>
14 14
             </el-row>
15 15
           </div>
@@ -17,8 +17,8 @@
17 17
             <label class="title"><span class="name">标签</span>:</label>
18 18
              <div class="time">
19 19
                 <ul class="">
20
-                  <li :class="0==schedulType?'active':''" @click="selectsign(0)">全部</li>
21
-                  <li :class="item.MenuId==schedulType?'active':''"  v-for="item in schedulArr" :key="item.MenuId" @click="selectsign(item.MenuId)">{{item.Name}}</li>
20
+                  <li :class="0==tagType?'active':''" @click="selectsign(0)">全部</li>
21
+                  <li :class="item.id==tagType?'active':''"  v-for="item in tagOptions" :key="item.id" @click="selectsign(item.id)">{{item.name}}</li>
22 22
                 </ul>
23 23
              </div>
24 24
           </div>
@@ -26,16 +26,18 @@
26 26
             <label class="title"><span class="name">状态:</span></label>
27 27
             <div class="time">
28 28
               <ul class="">
29
-                <!-- <li :class="0==systemType?'active':''" @click="selectStatus(0)">全部</li> -->
30
-                <li :class="item.value==systemType?'active':''" v-for="item in systemArr" :key="item.value">{{item.label}}</li>
29
+                 <li :class="{ active: selecting_status == 0 }" @click="changeSelectingStatus(0)">全部</li>
30
+                 <li :class="{ active: selecting_status == 1 }" @click="changeSelectingStatus(1)">已发布</li>
31
+                 <li :class="{ active: selecting_status == 2 }" @click="changeSelectingStatus(2)">草稿箱</li>
32
+                 <li :class="{ active: selecting_status == 3 }" @click="changeSelectingStatus(3)">未通过</li>
31 33
               </ul>
32 34
             </div>
33 35
           </div>
34 36
           <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
35
-            <el-checkbox style="width: 30px">全选</el-checkbox>
36
-            <el-button size="small" icon="el-icon-delete">删除</el-button>
37
+            <el-checkbox style="width: 30px" @change="changeCheck" v-model="checkAllStatus">全选</el-checkbox>
38
+            <el-button size="small" icon="el-icon-delete" @click="openDeletearticles">批量删除</el-button>
37 39
           </div>
38
-          <el-table ref="multipleTable" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="ArticleData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;">
40
+          <el-table ref="multipleTable" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="articsData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;"  @selection-change="handleSelectionChange">
39 41
               <el-table-column
40 42
                 align="center" 
41 43
                 type="selection"
@@ -43,7 +45,13 @@
43 45
               </el-table-column> 
44 46
              <el-table-column label="文章图片" align="center">
45 47
                <template slot-scope="scope">
46
-                  <img :src="memberAvatar(scope.row)" alt="" srcset="" style="width:100px;height:100px;" >
48
+                  <div class="parent">
49
+                 <span class="text">已发布</span>  
50
+                 <div class="triangle-topleft">
51
+                       
52
+                 </div>
53
+                <img :src="memberAvatar(scope.row)" style="width:100%;height:100%">
54
+          </div>     
47 55
                </template>
48 56
              </el-table-column>
49 57
             <el-table-column label="文章标题" align="center">
@@ -63,7 +71,7 @@
63 71
             </el-table-column>
64 72
             <el-table-column label="点赞数" align="center">
65 73
               <template slot-scope="scope">
66
-                  {{scope.row.num}}
74
+                  {{scope.row.star_num}}
67 75
               </template>
68 76
             </el-table-column>
69 77
             <el-table-column label="操作" align="center">
@@ -73,11 +81,11 @@
73 81
                     size="mini"
74 82
                     type="primary"
75 83
                     icon="el-icon-edit-outline"
76
-                    @click="handleEdit(scope.$index, scope.row)">
84
+                    @click="$router.push('/articles/editArticle/'+scope.row.id)">
77 85
                   </el-button>
78 86
                 </el-tooltip>
79 87
                  <el-tooltip class="item" effect="dark" content="删除" placement="top">
80
-                  <el-button size="mini" type="danger" icon="el-icon-delete" @click="openDelete(scope.row, scope.$index)" ></el-button>
88
+                  <el-button size="mini" type="danger" icon="el-icon-delete"  @click="openDelete(scope.row,scope.$index)" ></el-button>
81 89
                 </el-tooltip>
82 90
               </template>
83 91
             </el-table-column>
@@ -98,12 +106,13 @@
98 106
 
99 107
 <script>
100 108
   import BreadCrumb from '../components/bread-crumb'
101
-  import { GetAllArticles } from '@/api/act/submitinfo'
109
+  import { GetAllArticles,openDelete} from '@/api/act/submitinfo'
102 110
   export default {
103 111
     name: 'commentList',
104 112
     components:{
105 113
       BreadCrumb
106 114
     },
115
+    inject:['reload'],
107 116
     data(){
108 117
       return{
109 118
         crumbs: [
@@ -112,49 +121,42 @@
112 121
         ],
113 122
         time: '',
114 123
         active: true,
115
-        schedulType: 0,
116
-        schedulArr:[],
117
-        systemType: 0,
118
-        systemArr: [
119
-          { value: 0, label: "全部" },
120
-          { value: 1, label: "已发布" },
121
-          { value: 2, label: "草稿箱" },
122
-          { value: 2, label: "未通过" }
123
-        ],
124
+        tagType: 0,
125
+        tagOptions:[],
124 126
         listQuery:{
125 127
             page:1,
126 128
             limit:10,
127
-            search:'',
128 129
             classid:'',
130
+            name:'',
129 131
         },
130
-        ArticleData:[],
132
+        articsData:[],
131 133
         total:0,
134
+        selecting_status:'',
135
+        keyword:'',
136
+        dialogVisible: false,
137
+         checkAllStatus:false,
132 138
       }
133 139
     },
134 140
     methods:{
135 141
          GetAllArticles(){
136
-              GetAllArticles(this.listQuery).then(response=>{
142
+              GetAllArticles(this.listQuery,this.selecting_status,this.keyword,this.listQuery.classid).then(response=>{
137 143
                      if(response.data.state === 1){
138
-                        this.ArticleData = response.data.data.articles  
144
+                        this.articsData = response.data.data.articles  
139 145
                         this.total = response.data.data.total
140
-                        console.log("文章列表",this.ArticleData)
146
+                        console.log("文章列表",this.articsData)
141 147
                         console.log("total",this.total)                                                   
142 148
                      }
143 149
                      if(typeof(response.data.data.category != 'undefined')){
144
-                       this.schedulArr = response.data.data.category
145
-                        console.log("分类列表",response.data.data.category)
146
-                       
150
+                       this.tagOptions = response.data.data.category
151
+                        console.log("分类列表",this.tagOptions)                      
147 152
                      }
148 153
               })
149 154
          },
150
-         selectsign(MenuId){
151
-            this.listQuery.classid = MenuId;
152
-            this.schedulArr = MenuId;
153
-            this.GetAllArticles();
154
-         },
155
-         selectStatus(id){
156
-            this.listQuery.status = id;
157
-            this.systemType = id;
155
+         selectsign(id){
156
+           console.log("id",id)
157
+            this.listQuery.classid = id;
158
+            this.listQuery.name = name;
159
+            this.tagType = id;
158 160
             this.GetAllArticles();
159 161
          },
160 162
           handleSizeChange(limit) {
@@ -170,7 +172,75 @@
170 172
         },
171 173
         memberAvatar(row){
172 174
              return row.imgs
173
-        }
175
+        },
176
+        AddArticle(){
177
+           this.$router.push({path:'/articles/createArticle'})
178
+        },
179
+        changeSelectingStatus(status){
180
+          this.selecting_status = status;
181
+          this.GetAllArticles();
182
+        },
183
+        openDelete(row,index){
184
+             var  id = row.id;
185
+            this.$confirm('确认要删除该信息吗?删除后将无法恢复!',{
186
+              dangerouslyUseHTMLString:true,
187
+             confirmButtonText: '确定',
188
+             cancelButtonText: '取消',
189
+             type: 'warning' 
190
+            }).then(()=>{
191
+                var ids = [];
192
+                ids.push(row.id);
193
+                openDelete({ids:ids}).then(response=>{
194
+                    this.articsData.splice(index,1);
195
+                    this.$message.success("删除成功");
196
+                }).catch(e=>{});       
197
+          }).catch(e=>{});
198
+        },
199
+         
200
+          handleSelectionChange(val){
201
+             this.selectedArticles = val;
202
+         },
203
+         changeCheck(){
204
+          this.$refs.multipleTable.clearSelection();
205
+           if (this.checkAllStatus) {
206
+            this.$refs.multipleTable.toggleAllSelection();
207
+            }
208
+          },
209
+
210
+          openDeletearticles(){
211
+            if (this.selectedArticles.length==0) {
212
+              this.$message.error("请选择要删除的信息");
213
+            return false;
214
+           } 
215
+           this.$confirm('确定要删除吗?删除后信息将无法恢复!','删除提示',{
216
+               dangerouslyUseHTMLString:true,
217
+               confirmButtonText: '确定',
218
+               cancelButtonText: '取消',
219
+               type: 'warning'
220
+           }).then(()=>{
221
+                var ids = [];
222
+                var idMap = {};
223
+                for (const index in this.selectedArticles) {
224
+                ids.push(this.selectedArticles[index].id);
225
+                idMap[this.selectedArticles[index].id] = this.selectedArticles[index].id;
226
+            }
227
+               openDelete({ids:ids}).then(response=>{
228
+                   if(response.data.state == 1){
229
+                         var articsDatalength = this.articsData.length;
230
+                     for (let index = articsDatalength-1; index >= 0; index--) {
231
+                    if(this.articsData[index].id in idMap) {
232
+                    this.articsData.splice(index, 1);
233
+                   }                  
234
+                 }
235
+                  this.$message.success("删除成功");   
236
+                }else{
237
+                   this.$message.success("删除失败");   
238
+                 }
239
+               }).catch(e=>{});
240
+           }).catch(() => {
241
+              return false        
242
+           }); 
243
+          }
174 244
     },
175 245
     created(){
176 246
       this.GetAllArticles()
@@ -179,5 +249,26 @@
179 249
 </script>
180 250
 
181 251
 <style scoped>
182
-     
252
+      .parent{
253
+        position: relative;
254
+        width: 160px;
255
+        height: 120px;
256
+        left: 20px;
257
+    }
258
+    .parent .text{
259
+        display: inline-block;
260
+        transform: rotate(-45deg);
261
+        padding: 20px;
262
+        color:red;
263
+        position: relative;
264
+        left: -60px;
265
+    }
266
+   .triangle-topleft{
267
+        width: 0;
268
+        height: 0;
269
+        border-top: 70px solid yellow;
270
+        border-right: 70px solid transparent;
271
+        position: relative;
272
+        margin-top: -140px;       
273
+    }
183 274
 </style>

+ 90 - 0
src/scrm_pages/article/articlePreview.vue Zobrazit soubor

@@ -0,0 +1,90 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+    </div>
6
+    <div class="app-container">
7
+          <el-form label-width="90px" class="clearfix" :model="form" ref="acticleform">
8
+           <el-row :span=20>
9
+            <el-form-item>
10
+                <div class="title">
11
+                 {{form.title}}
12
+                </div>    
13
+            </el-form-item>
14
+          </el-row> 
15
+           <el-row :span=20>
16
+            <el-form-item>
17
+                <div class="cont">
18
+                   <!-- {{form.content}} -->
19
+                   <li v-html="form.content"></li>
20
+                </div>    
21
+            </el-form-item>
22
+          </el-row>
23
+           <el-row :span=20>
24
+            <el-form-item>
25
+                <div class="but">
26
+                   <el-button type="primary" @click="clossPreview()">关闭预览</el-button>
27
+                </div>    
28
+            </el-form-item>
29
+          </el-row>         
30
+        </el-form>
31
+    </div>
32
+  </div>
33
+</template>
34
+
35
+<script>
36
+  import BreadCrumb from '../components/bread-crumb'
37
+  import { getarticlePreview } from '@/api/act/submitinfo'
38
+  export default {
39
+    name: 'articlePreview',
40
+    components:{
41
+      BreadCrumb
42
+    },
43
+    data(){
44
+      return{
45
+        crumbs: [
46
+          { path: false, name: '文章管理' },
47
+          { path: '/articles/articlePreview', name: '文章预览' }
48
+        ],
49
+        form:{
50
+            title:'',
51
+            content:'',
52
+        },
53
+      }
54
+    },
55
+    methods:{
56
+          getarticlePreview(){
57
+              getarticlePreview(this.form).then(response=>{
58
+                    if(response.data.state == 1){
59
+                       this.form =  response.data.data.articles;
60
+                       console.log("预览数据",this.form);
61
+                    }  
62
+              });
63
+          },
64
+          clossPreview(){
65
+            this.$router.push({path:'/articles/articleList'})
66
+          }
67
+    },
68
+    created(){
69
+        this.getarticlePreview();
70
+    },
71
+  }
72
+</script>
73
+
74
+<style scoped>
75
+    .title{
76
+        font-size: 20px;
77
+        position: relative;
78
+        left: 750px;
79
+    }
80
+
81
+    .cont{
82
+      position: relative;
83
+      left: 200px;
84
+    }
85
+    .but{
86
+      position: relative;
87
+      left: 750px;
88
+    }
89
+
90
+</style>

+ 40 - 91
src/scrm_pages/article/commentList.vue Zobrazit soubor

@@ -4,23 +4,16 @@
4 4
           <bread-crumb :crumbs='crumbs'></bread-crumb>
5 5
         </div>
6 6
         <div class="app-container">
7
-           评论列表
8
-           <el-form-item ref="videocontentvideo" style="display:none;">
9
-              <img :src="imgurl">
10
-              <video width="320" height="240" controls id="upvideo">
11
-              </video>
12
-              <img :src="modlevidel" />
13
-            </el-form-item>
14
-
15
-            <el-form-item class="upload-demo-content" v-show="formLabelAlign.type==2">
16
-            <el-upload class="upload-demo" :limit="1" :on-exceed="exceedhandle" drag :file-list="filsListArray" :action="configuploadurl" :on-success="successuploadhandle" accept="video" name="fileList" :before-upload="beforeUploadVideo">
17
-              <i class="el-icon-upload"></i>
18
-              <div class="el-upload__text">将视频文件拖到此处,或
19
-                <em>点击上传</em>
20
-              </div>
21
-              <div class="el-upload__tip" slot="tip"></div>
22
-            </el-upload>
23
-          </el-form-item>
7
+          <div class="parent">
8
+                 <span class="text"></span>  
9
+                 <div class="triangle-topleft">
10
+                   
11
+                 </div>
12
+                <div class="title">
13
+                  已使用
14
+                </div>
15
+                 <img src="/static/images/a.jpg" style="width:100%;height:100%">
16
+          </div>           
24 17
         </div>
25 18
     </div>
26 19
 </template>
@@ -38,86 +31,42 @@
38 31
           { path: false, name: '文章管理' },
39 32
           { path: '/articles/commentList', name: '评论列表' }
40 33
         ],
41
-        imgurl:'',
42
-        modlevidel:'',
43
-        formLabelAlign:'',
44
-        modlevidel:'',
45
-        filsListArray:[],
46
-        elForm:'',
47
-        configuploadurl:'',
48 34
       }
49 35
     },
50 36
     methods:{
51
-      successuploadhandle(response, file, fileList) {
52
-      this.formLabelAlign.video = this.modlevidel =
53
-        response.data.fileList[0].url;
54
-        this.filsListArray = [];
55
-        this.filsListArray.push({
56
-        name: this.formLabelAlign.video,
57
-        url: this.formLabelAlign.video
58
-       });
59
-        this.findvideocover();
60
-    },
61
-      exceedhandle(files, fileList) {
62
-      this.$message.error("只能上传一个视频额");
63
-      },
64
-      beforeUploadVideo(file) {
65
-      if (
66
-        [
67
-          "video/mp4",
68
-          "video/ogg",
69
-          "video/flv",
70
-          "video/avi",
71
-          "video/wmv",
72
-          "video/rmvb"
73
-        ].indexOf(file.type) == -1
74
-      ) {
75
-        this.$message.error("请上传正确的视频格式");
76
-        return false;
77
-      }
78
-     },
79
-
80
-     findvideocover() {
81
-      let _this = this;
82
-      this.$nextTick(() => {
83
-        let video = document.getElementById("upvideo");
84
-        let source = document.createElement("source");
85
-        // source.src = require("../../assets/5b086751dbb7af1ea8fa8d05e66fe5c3.mp4");this.formLabelAlign.video
86
-        source.src = this.formLabelAlign.video;
87
-        source.type = "video/mp4";
88
-        video.appendChild(source);
89
-        video.addEventListener("loadeddata", function() {
90
-          var canvas = document.createElement("canvas");
91
-          canvas.width = "320";
92
-          canvas.height = "320";
93
-          canvas
94
-            .getContext("2d")
95
-            .drawImage(video, 0, 0, canvas.width, canvas.width);
96
-          var img = document.createElement("img");
97
-          let imgsrc = canvas.toDataURL("image/png");
98
-          _this.Videoframehandle(imgsrc.split(",")[1]);
99
-        });
100
-      });
101
-      },
102
-
103
-      showvideohandle() {
104
-       this.$alert(
105
-        `<video width="320" height="240" controls>
106
-                      <source src="${
107
-                        this.filsListArray[0].url
108
-                      }"  type="video/mp4">
109
-                      您的浏览器不支持 HTML5 video 标签。
110
-                    </video>`,
111
-        "视频预览",
112
-        {
113
-          dangerouslyUseHTMLString: true
114
-        }
115
-      );
116
-    },
117 37
     }
118 38
   }
119 39
 </script>
120 40
 
121 41
 <style scoped>
122
-
42
+    .parent{
43
+        position: relative;
44
+        width: 200px;
45
+        height: 200px;
46
+        background: yellow;
47
+        font-size: 6px;
48
+    }
49
+    .parent .text{
50
+        display: inline-block;
51
+        transform: rotate(-45deg);
52
+        padding: 20px;
53
+        color: #fff;
54
+        position: relative;
55
+    }
56
+   .triangle-topleft{
57
+        width: 0;
58
+        height: 0;
59
+        border-top: 100px solid red;
60
+        border-right: 100px solid transparent;
61
+        position: relative;
62
+        margin-top: -42px;
63
+        top: 0px;
64
+        z-index: 0;   
65
+    }
66
+    .title{
67
+       transform: rotate(-45deg);
68
+       position: relative;
69
+       margin-top: -115px;
70
+       margin-left: -8px;
71
+    }
123 72
 </style>

+ 3 - 3
src/scrm_pages/article/components/CreateArticleForm.vue Zobrazit soubor

@@ -93,9 +93,9 @@
93 93
                             });
94 94
                        }   
95 95
                    });         
96
-          },  
97
-       }
98
-    }
96
+              },  
97
+          }
98
+      }  
99 99
 </script>
100 100
 
101 101
 <style scoped>

+ 1 - 3
src/scrm_pages/article/components/EditArticleForm.vue Zobrazit soubor

@@ -89,12 +89,10 @@ export default {
89 89
                            console.log("返回响应",res.state)
90 90
                            if(res.state ===1 ){
91 91
                               var categorys = res.data.category; 
92
-                              console.log("categorys是什么",categorys)
92
+                              console.log("categorys是什么",categorys.name)
93 93
                               this.articsData[this.artilceIndex].name = categorys.name;
94 94
                               this.articsData[this.artilceIndex].summary = categorys.summary;
95 95
                               this.articsData[this.artilceIndex].order = categorys.order;
96
-                              //this.articsData.unshift(categorys);
97
-                              // this.resetForm("acticleform");
98 96
                               this.centerDialogVisible = false;
99 97
                               this.$message.success("编辑文章分类成功");
100 98
                            }

+ 33 - 9
src/scrm_pages/article/createArticle.vue Zobrazit soubor

@@ -7,7 +7,7 @@
7 7
     <div class="app-container">
8 8
     <el-tabs type="border-card">
9 9
       <el-tab-pane label="文章">
10
-        <el-form label-width="100px" class="clearfix" :model="form" ref="arctileform"  :element-loading-text="loadingText" :rules="artilcrules">
10
+        <el-form label-width="100px" class="clearfix" :model="form" ref="arctileform"  :element-loading-text="loadingText" :rules="staffrules">
11 11
           <el-row>
12 12
             <el-col :span="23">
13 13
                 <el-form-item label="文章标题:" required prop="act_name">
@@ -96,8 +96,8 @@
96 96
                 <el-form-item>
97 97
                       <el-button size="small" type="primary" style="width: 100px"  @click="submitForm('arctileform');centerDialogVisible=false">发布</el-button>
98 98
                       <el-button size="small" style="width: 100px" @click="preview('arctileform')">预览</el-button>
99
-                      <el-button size="small" style="width: 100px">保存草稿</el-button>
100
-                  <el-button size="small" style="width: 100px">取消</el-button>
99
+                      <el-button size="small" style="width: 100px" @click="save('arctileform');centerdraftVisible = false">保存草稿</el-button>
100
+                  <el-button size="small" style="width: 100px" @click="centercancelVisible = true">取消</el-button>
101 101
                 </el-form-item>
102 102
             </el-col>
103 103
           </el-row>
@@ -204,7 +204,7 @@
204 204
        center>
205 205
        <span style="center">是否确定取消编辑此文章/视频</span>
206 206
        <span slot="footer" class="dialog-footer">
207
-       <el-button type="primary" @click="centercancelVisible = false" >确认</el-button>
207
+       <el-button type="primary" @click="confirm()" >确认</el-button>
208 208
        <el-button @click="centercancelVisible = false">取消</el-button>   
209 209
         </span>   
210 210
       </el-dialog>
@@ -218,7 +218,7 @@
218 218
   import 'quill/dist/quill.snow.css'
219 219
   import 'quill/dist/quill.bubble.css'
220 220
   import Neditor from '@/components/Neditor'
221
-  import {submitForm,getArticleType,addVido,Savedraft} from '@/api/act/submitinfo'
221
+  import {submitForm,getArticleType,addVido,Savedraft,previewArticle,save} from '@/api/act/submitinfo'
222 222
   import { getToken } from '@/api/qiniu'
223 223
   import { getFileExtension} from '@/utils/tools'
224 224
   export default {
@@ -233,7 +233,7 @@
233 233
           { path: false, name: '文章管理' },
234 234
           { path: '/articles/createArticle', name: '发布文章' }
235 235
         ],
236
-         radio:'1',
236
+        radio:'1',
237 237
         options: [],
238 238
         value: '',
239 239
         show:false,
@@ -285,7 +285,6 @@
285 285
             act_type: [{required: true,message:"所属分类不能为空"}]
286 286
         },
287 287
         vidoform:[],
288
-        ue:'',
289 288
       }
290 289
     },
291 290
     created(){
@@ -390,6 +389,7 @@
390 389
             return false
391 390
       },
392 391
       beforeAvatarlastUpload(file) {
392
+        console.log("冷醒是",file.type)
393 393
         const isJPG = file.type === 'image/jpeg';
394 394
         const isLt2M = file.size / 1024 / 1024 < 2;
395 395
 
@@ -569,11 +569,35 @@
569 569
          console.log("文章内容",this.$refs.neditor.content)
570 570
          this.$refs[formName].validate((valid)=>{
571 571
             if(valid){
572
-               preview(this.form).then(response=>{
573
-                    this.$router.go(0);
572
+              //  console.log("内容是什么?",this.form)
573
+              //  this.$router.push({path:'/articles/articlePreview'})
574
+               previewArticle(this.form).then(response=>{
575
+                    if(response.data.state ==1){
576
+                        var art = response.data.data.art
577
+                        console.log("act的数据是",art);
578
+                        this.$router.push({path:'/articles/articlePreview'})
579
+                    }
574 580
                });
575 581
             }
576 582
          });
583
+      },
584
+      save(formName){
585
+         this.form.act_content = this.$refs.neditor.content;
586
+         console.log("文章内容",this.$refs.neditor.content);
587
+         this.$refs[formName].validate((valid)=>{
588
+             if(valid){
589
+                 save(this.form).then(response=>{
590
+                   if(response.data.state ==1){
591
+                     this.centerdraftVisible = true;
592
+                     var articles = response.data.data.articles;
593
+                     console.log("返回的数据是",articles)                   
594
+                   }
595
+                 });
596
+             }
597
+         });
598
+      },
599
+      confirm(){
600
+         this.$router.push({path:"/articles/articleList"})
577 601
       }
578 602
     },
579 603
   }

+ 428 - 0
src/scrm_pages/article/editArticle.vue Zobrazit soubor

@@ -0,0 +1,428 @@
1
+
2
+
3
+<template>
4
+    <div class="main-contain">
5
+        <div class="position">
6
+            <bread-crumb :crumbs='crumbs'></bread-crumb>
7
+        </div>
8
+        <div class="app-container">
9
+             <el-form label-width="100px" class="clearfix" :model="form" ref="arctileform"  :element-loading-text="loadingText" :rules="artilcrules">
10
+          <el-row>
11
+            <el-col :span="23">
12
+                <el-form-item label="文章标题:" required prop="title">
13
+                    <el-input v-model="form.title"></el-input>
14
+                </el-form-item>
15
+              <el-form-item label="文章内容:" required prop="content">
16
+                <keep-alive>
17
+                  <neditor ref="neditor"
18
+                           id="editor"
19
+                           v-bind:r_content="form.content">
20
+                  </neditor>
21
+                </keep-alive>
22
+              </el-form-item>
23
+              <el-form-item label="封面图片:">
24
+                  <el-radio v-model="radio" label="1" @click.native.prevent="select()" >单图</el-radio>
25
+                  <el-radio v-model="radio" label="2" @click.native.prevent="clickitem()" >三图</el-radio>
26
+              </el-form-item>
27
+              <el-form-item>
28
+                <el-col :span="3">
29
+                  <div>
30
+                    <el-upload
31
+                      v-loading="uploading"
32
+                      :element-loading-text="loadingText"
33
+                      class="avatar-uploader"
34
+                      :data="uploadData"
35
+                      action="https://upload.qiniup.com"
36
+                      :show-file-list="false"
37
+                      :on-error="handleAvatarError"
38
+                      :on-success="handleAvatarSuccess"
39
+                      :before-upload="beforeAvatarUpload">
40
+                      <img v-if="form.imgs" :src="form.imgs" class="avatar">
41
+                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
42
+                    </el-upload>
43
+                  </div>
44
+                </el-col>
45
+                <el-col :span="3">
46
+                  <div v-if="show">
47
+                    <el-upload
48
+                      v-loading="uploading"
49
+                      :element-loading-text="loadingText"
50
+                      class="avatar-uploader"
51
+                      :data="uploadData"
52
+                      action="https://upload.qiniup.com"
53
+                      :show-file-list="false"
54
+                      :on-error="handleAvatartwoError"
55
+                      :on-success="handleAvatartwoSuccess"
56
+                      :before-upload="beforeAvatartwoUpload">
57
+                      <img v-if="imageUrlSecond" :src="imageUrlSecond" class="avatar">
58
+                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
59
+                    </el-upload>
60
+                  </div>
61
+                </el-col>
62
+                <el-col :span="3">
63
+                  <div v-if="show">
64
+                    <el-upload
65
+                      v-loading="uploading"
66
+                      :element-loading-text="loadingText"
67
+                      class="avatar-uploader"
68
+                      :data="uploadData"
69
+                      action="https://upload.qiniup.com"
70
+                      :show-file-list="false"
71
+                      :on-error="handleAvatarlastError"
72
+                      :on-success="handleAvatarlastSuccess"
73
+                      :before-upload="beforeAvatarlastUpload">
74
+                      <img v-if="imageUrlLast" :src="imageUrlLast" class="avatar">
75
+                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
76
+                    </el-upload>
77
+                  </div>
78
+                </el-col>
79
+              </el-form-item>
80
+               <el-form-item label="所属分类:" prop="class_id">
81
+                 <el-select v-model="form.class_id" placeholder="请先选择文章所属分类"  @change="changeActtype()">
82
+                   <el-option
83
+                     v-for="item in options"
84
+                     :key="item.id"
85
+                     :label="item.name"
86
+                     :value="item.id">
87
+                   </el-option>
88
+                 </el-select>
89
+               </el-form-item>
90
+            </el-col>
91
+          </el-row>
92
+
93
+          <el-row :span="24">
94
+            <el-col :span="24">
95
+                <el-form-item>
96
+                      <el-button size="small" type="primary" style="width: 100px"  @click="UpdataArticleInfo('arctileform');">发布</el-button>
97
+                      <el-button size="small" style="width: 100px" @click="preview('arctileform')">预览</el-button>
98
+                      <el-button size="small" style="width: 100px" @click="save('arctileform');centerdraftVisible = false">保存草稿</el-button>
99
+                  <el-button size="small" style="width: 100px" @click="centercancelVisible = true">取消</el-button>
100
+                </el-form-item>
101
+            </el-col>
102
+          </el-row>
103
+        </el-form>
104
+
105
+        <el-dialog
106
+           title="发表成功"
107
+           :visible.sync="dialogVisible"
108
+            width="30%"
109
+            center>
110
+           <span>这是一段信息</span>
111
+           <span slot="footer" class="dialog-footer">
112
+           <el-button @click="gobackList()">返回文章列表</el-button>
113
+           </span>
114
+         </el-dialog>
115
+
116
+        <el-dialog
117
+           title="发表成功"
118
+           :visible.sync="dialogVisible"
119
+            width="30%"
120
+            center>
121
+           <span>这是一段信息</span>
122
+           <span slot="footer" class="dialog-footer">
123
+           <el-button @click="gobackList()">返回文章列表</el-button>
124
+           </span>
125
+         </el-dialog>
126
+         
127
+       <el-dialog
128
+         title="提示"
129
+         :visible.sync = "centercancelVisible"
130
+         width="30%"
131
+         center>
132
+         <span style="center">是否确定取消编辑此文章/视频</span>
133
+         <span slot="footer" class="dialog-footer">
134
+         <el-button type="primary" @click="centercancelVisible = false" >确认</el-button>
135
+         <el-button @click="centercancelVisible = false">取消</el-button>   
136
+        </span>   
137
+       </el-dialog>
138
+        </div>
139
+    </div>
140
+</template>
141
+
142
+<script>
143
+    import BreadCrumb from '../components/bread-crumb'
144
+    import { quillEditor } from 'vue-quill-editor'
145
+    import 'quill/dist/quill.core.css'
146
+    import 'quill/dist/quill.snow.css'
147
+    import 'quill/dist/quill.bubble.css'
148
+    import Neditor from '@/components/Neditor'
149
+    import { getToken } from '@/api/qiniu'
150
+    import { getFileExtension} from '@/utils/tools'
151
+    import {getEditArticle,getMenus,UpdataArticleInfo,previewEditArticle} from '@/api/act/submitinfo'
152
+    export default {
153
+        name: "editArticle",
154
+         components:{
155
+            BreadCrumb,
156
+            Neditor,
157
+         },
158
+         data(){
159
+            return {
160
+             crumbs: [
161
+              { path: false, name: '文章管理' },
162
+              { path: '/articles/editArticle/:id', name: '编辑文章' }
163
+              ],
164
+               radio:'1',
165
+        options: [],
166
+        value: '',
167
+        show:false,
168
+        content: '',
169
+        editorOption: {},
170
+        company:"",
171
+        fileList: [],
172
+        form:{
173
+          class_id:'', 
174
+          content:'',                        
175
+          imgs:'',                
176
+          title:'',                 
177
+          file:'',
178
+        },
179
+         acttypes:[],
180
+         imageUrl:'',
181
+         imageUrlSecond:'',
182
+         imageUrlLast:'',
183
+         formloading:false,
184
+         formsubmit:false,
185
+         qiniuDomain: 'https://images.shengws.com/',
186
+         uploading:false,
187
+         loadingText:'',
188
+         uploadData: { token: '', key: '' },
189
+         uploadFileData:{token:'',key:''},
190
+         uploadvidoData:{token:'',key:''},
191
+         centerDialogVisible: false,
192
+         centerdraftVisible:false,
193
+         centercancelVisible:false,
194
+         formLabelAlign:true,
195
+         modlevidel:'',
196
+         filsListArray:[],
197
+         show:true,
198
+         shows:false,
199
+         rules: {
200
+            vid_name: [{required: true, message: "视频标题不能为空"},],
201
+            vio_upload: [{required: true,message:"请上传视频"}],
202
+            vid_type: [{required: true,message:"所属分类不能为空"}]
203
+          },
204
+        artilcrules:{
205
+            title: [{required: true, message: "文章标题不能为空"},],
206
+            content: [{required: true,message:"文章内容不能为空"}],
207
+            class_id: [{required: true,message:"所属分类不能为空"}]
208
+        },
209
+        vidoform:[],
210
+        dialogVisible:false,
211
+        }
212
+    },
213
+         methods:{
214
+             //第一个图片
215
+      handleAvatarSuccess(res, file) {
216
+       this.form.org_logo = this.qiniuDomain + res.url;
217
+        this.uploading = false
218
+      },
219
+       handleAvatarError(err, file, fileList) {
220
+            this.$message.error(err);
221
+            this.uploading = false;
222
+            return false
223
+      },
224
+      beforeAvatarUpload(file) {
225
+        const isJPG = file.type === 'image/jpeg';
226
+        const isLt2M = file.size / 1024 / 1024 < 2;
227
+
228
+        if (!isJPG) {
229
+          this.$message.error('上传头像图片只能是 JPG 格式!');
230
+        }
231
+        if (!isLt2M) {
232
+          this.$message.error('上传头像图片大小不能超过 2MB!');
233
+        }
234
+
235
+            var date = new Date()
236
+            var ext = getFileExtension(file.name)
237
+            var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
238
+            this.uploading = true;
239
+            this.loadingText = '封面图片上传中'
240
+
241
+            const _self = this
242
+            return new Promise((resolve, reject) => {
243
+                getToken().then(response => {
244
+                    const token = response.data.data.uptoken
245
+                    console.log("token是什么?",token)
246
+                    _self._data.uploadData.token = token
247
+                    _self._data.uploadData.key = key
248
+                    resolve(true)
249
+                }).catch(err => {
250
+                    reject(false)
251
+                    this.uploading = false;
252
+                })
253
+            })
254
+      },
255
+      //第二个图片
256
+      handleAvatartwoSuccess(res, file) {
257
+        this.imageUrlSecond = URL.createObjectURL(file.raw);
258
+        this.form.org_logo = this.qiniuDomain + res.url;
259
+        this.uploading = false
260
+      },
261
+       handleAvatartwoError(err, file, fileList) {
262
+            this.$message.error(err);
263
+            this.uploading = false;
264
+            return false
265
+      },
266
+      beforeAvatartwoUpload(file) {
267
+        const isJPG = file.type === 'image/jpeg';
268
+        const isLt2M = file.size / 1024 / 1024 < 2;
269
+
270
+        if (!isJPG) {
271
+          this.$message.error('上传头像图片只能是 JPG 格式!');
272
+        }
273
+        if (!isLt2M) {
274
+          this.$message.error('上传头像图片大小不能超过 2MB!');
275
+        }
276
+
277
+            var date = new Date()
278
+            var ext = getFileExtension(file.name)
279
+            var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
280
+            this.uploading = true;
281
+            this.loadingText = '封面图片上传中'
282
+
283
+            const _self = this
284
+            return new Promise((resolve, reject) => {
285
+                getToken().then(response => {
286
+                    const token = response.data.data.uptoken
287
+                    console.log("token是什么?",token)
288
+                    _self._data.uploadData.token = token
289
+                    _self._data.uploadData.key = key
290
+                    resolve(true)
291
+                }).catch(err => {
292
+                    reject(false)
293
+                    this.uploading = false;
294
+                })
295
+            })
296
+      },
297
+
298
+      //第三张图片
299
+      handleAvatarlastSuccess(res, file) {
300
+        this.imageUrlLast = URL.createObjectURL(file.raw);
301
+        this.form.org_logo = this.qiniuDomain + res.url;
302
+        this.uploading = false
303
+      },
304
+       handleAvatarlastError(err, file, fileList) {
305
+            this.$message.error(err);
306
+            this.uploading = false;
307
+            return false
308
+      },
309
+      beforeAvatarlastUpload(file) {
310
+        const isJPG = file.type === 'image/jpeg';
311
+        const isLt2M = file.size / 1024 / 1024 < 2;
312
+
313
+        if (!isJPG) {
314
+          this.$message.error('上传头像图片只能是 JPG 格式!');
315
+        }
316
+        if (!isLt2M) {
317
+          this.$message.error('上传头像图片大小不能超过 2MB!');
318
+        }
319
+
320
+            var date = new Date()
321
+            var ext = getFileExtension(file.name)
322
+            var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
323
+            this.loadingText = '封面图片上传中'
324
+
325
+            const _self = this
326
+            return new Promise((resolve, reject) => {
327
+                getToken().then(response => {
328
+                    const token = response.data.data.uptoken
329
+                    console.log("token是什么?",token)
330
+                    _self._data.uploadData.token = token
331
+                    _self._data.uploadData.key = key
332
+                    resolve(true)
333
+                }).catch(err => {
334
+                    reject(false)
335
+                })
336
+            }) 
337
+        },
338
+        getEditArticle(id){
339
+           getEditArticle(id,this.form).then(response=>{
340
+                 if(response.data.state == 1){
341
+                     var articles = response.data.data.articles;
342
+                     this.form.title = articles.title;
343
+                     this.form.content = articles.content;
344
+                     this.form.imgs = articles.imgs;
345
+                     this.form.class_id = articles.class_id;
346
+                     console.log(articles.title)
347
+                     console.log("文章内容",articles)
348
+                 }
349
+           });
350
+        }, 
351
+        getMenus(){
352
+            getMenus().then(response =>{
353
+                if(response.data.state == 1){
354
+                   var categorys = response.data.data.categorys;
355
+                   this.options = categorys;
356
+                   console.log("分类号",categorys)
357
+                   
358
+                }
359
+            })
360
+        },
361
+        
362
+        UpdataArticleInfo(forName){
363
+              this.form.act_content = this.$refs.neditor.content;
364
+              const id = this.$route.params && this.$route.params.id;
365
+             console.log("文章内容",this.$refs.neditor.content);
366
+             console.log("id是多少?",id)
367
+             this.$refs[forName].validate((valid)=>{
368
+                 if(valid){
369
+                    UpdataArticleInfo(id,this.form).then(response=>{
370
+                         if(response.data.state == 1){
371
+                             this.dialogVisible = true;      
372
+                         }
373
+                    }); 
374
+                 }
375
+             })
376
+        },
377
+        gobackList(){
378
+           this.$router.push({path:'/articles/articleList'})
379
+        },
380
+        preview(forName){
381
+            this.form.act_content = this.$refs.neditor.content;
382
+            const id = this.$route.params && this.$route.params.id; 
383
+            this.$refs[forName].validate((valid)=>{
384
+              if(valid){
385
+                 previewEditArticle(id,this.form).then(response=>{
386
+                   if(response.data.state == 1){
387
+                       this.$router.push("/articles/articleEditPreview")
388
+                   }
389
+                 })
390
+              }
391
+            })
392
+        }
393
+      },
394
+      created(){
395
+         const id = this.$route.params && this.$route.params.id;
396
+         console.log("id是什么?",id)
397
+          this.getEditArticle(id)
398
+          this.getMenus()
399
+      },
400
+    }
401
+</script>
402
+
403
+<style scoped>
404
+     .avatar-uploader{
405
+    border: 1px solid #d9d9d9;
406
+    border-radius: 6px;
407
+    cursor: pointer;
408
+    overflow: hidden;
409
+    width: 140px;
410
+    height: 140px;
411
+  }
412
+  .avatar-uploader{
413
+    border-color: #f0f2f5;
414
+  }
415
+  .avatar-uploader-icon {
416
+    font-size: 25px;
417
+    color: #8c939d;
418
+    width: 140px;
419
+    height: 140px;
420
+    line-height: 140px;
421
+    text-align: center;
422
+  }
423
+  .avatar {
424
+    width: 178px;
425
+    height: 178px;
426
+    display: block;
427
+  }
428
+</style>

+ 762 - 49
src/scrm_pages/contactBox/index.vue Zobrazit soubor

@@ -1,13 +1,10 @@
1 1
 <template>
2 2
     <div class="contact-box" id="contact-box">
3 3
         <div class="contact-box-item msg-box" >
4
-            <div class="box-btn " @click="showMsgBox=true">
4
+            <div class="box-btn " @click="toggleMsgBox">
5 5
                 <i class="el-icon-service"></i>
6 6
                 <span>在线客服</span>
7 7
             </div>
8
-            <div class="contact-info-box" v-show="!showMsgBox">
9
-                点击打开在线客服
10
-            </div>
11 8
             <div class="contact-msg-box" v-show="showMsgBox">
12 9
                 <div class="msg-box-panel">
13 10
                     <div class="panel-header">
@@ -17,57 +14,669 @@
17 14
                     </div>
18 15
                     <div class="panel-body">
19 16
                         <ul class="msg-inner scroll-y">
20
-                            <li>1</li>
21
-                            <li>1</li>
22
-                            <li>1</li>
23
-                            <li>1</li>
24
-                            <li>1</li>
25
-                            <li>1</li>
26
-                            <li>1</li>
27
-                            <li>1</li>
28
-                            <li>1</li>
29
-                            <li>1</li>
30
-                            <li>1</li>
31
-                            <li>1</li>
32
-                            <li>1</li>
33
-                            <li>1</li>
34
-                            <li>1</li>
35
-                            <li>1</li>
36
-                            <li>1</li>
37
-                            <li>1</li>
38
-                            <li>1</li>
39
-                            <li>1</li>
40
-                            <li>1</li>
41
-                            <li>1</li>
42
-                            <li>1</li>
43
-                            <li>1</li>
44
-                            <li>1</li>
45
-                            <li>1</li>
17
+                            <li v-for="(messageitem, key) in messageBox" :key="key" :id="'id_'+messageitem.id" class="cell clearfix" :class="messageitem.float=='right'?'cell_right':''">
18
+                                <template v-if="messageitem.float=='right'">
19
+                                    <div class="msg_body fl">
20
+                                        <div class="inner" v-html="messageitem.message"></div>
21
+                                    </div>
22
+                                    <div class="cell_pic fl">
23
+                                        <div class="pic">
24
+                                            <img :src="messageitem.avatar" alt="">
25
+                                        </div>
26
+                                    </div>
27
+                                </template>
28
+                                <template v-else>
29
+                                    <div class="cell_pic fl">
30
+                                        <div class="pic">
31
+                                            <img :src="messageitem.avatar" alt="">
32
+                                        </div>
33
+                                    </div>
34
+                                    <div class="msg_body fl">
35
+                                        <div class="inner" v-html="messageitem.message"></div>
36
+                                    </div>
37
+                                </template>
38
+                            </li>
46 39
                         </ul>
47 40
                     </div>
41
+                    <div class="panel-tool">
42
+                        <i class="icon-face" title="表情" @click="showEmotion"></i>
43
+                        <el-upload
44
+                        class="avatar-uploader"
45
+                        action="https://jsonplaceholder.typicode.com/posts/"
46
+                        :show-file-list="false"
47
+                        :http-request='handleIMPicUload'
48
+                        :on-success="handleIMPicSuccess"
49
+                        :before-upload="beforeIMPicUpload">
50
+                        <i class="el-icon-picture" title="图片"></i>
51
+                        </el-upload>
52
+                        <div class="face-box" v-show="showFace">
53
+                            <div class="face-box-title">
54
+                                <span>表情</span>
55
+                                <i class="el-icon-close " @click="showFace=false" style="float:right" ></i>
56
+                            </div>
57
+                            <ul class="face-box-list clearfix">
58
+                                <li v-for="(faceitem, index) in facelist" :key="index" @click="selectEmotion(faceitem)" >
59
+                                    <img :src="faceitem[1]" :id="faceitem[0]"  alt="">
60
+                                </li>
61
+                            </ul>
62
+                        </div>
63
+
64
+                    </div>
65
+                    <div class="panel-booter">
66
+                        <div class="msg-input-box">
67
+                            <textarea class="textarea scroll-y message-textarea"  v-model="message" placeholder="请输入"></textarea>
68
+                        </div>
69
+                        <div class="msg-send-btn-box">
70
+                            <span class="time fl">服务时间:工作时间:9:00-22:00 节假日:9:00-18:00</span>
71
+                            <el-button type="primary" icon="el-icon-edit" class="fr" size="mini" @click="sendMessage">发送</el-button>
72
+                            <!-- <button type="submit" id="sendadminkfmsg" class="send_btn fr">发送</button> -->
73
+                        </div>
74
+                    </div>
48 75
                 </div>
49 76
             </div>
50 77
         </div>
51 78
         <div class="contact-box-item phone-box">
52
-            <div class="box-btn">
79
+            <div class="box-btn" @click="togglePhoneBox">
53 80
                 <i class="el-icon-phone-outline"></i>
54 81
                 <span>客服电话</span>
55 82
             </div>
56
-            <div class="contact-phone-box">
57
-                <i class="el-icon-phone-outline"></i>
83
+            <div class="contact-phone-box" v-show="showPhoneBox">
84
+                <i class="el-icon-phone-outline" ></i>
58 85
                 <span>0755-86526342</span>
59 86
             </div>
60 87
         </div>
61 88
     </div>
62 89
 </template>
63 90
 <script>
91
+import {getusersig} from "@/api/kefu/tencentim";
92
+import webim from 'webim-tencent';
93
+let selType =  webim.SESSION_TYPE.C2C;
94
+let reqMsgCount = 15; //每次请求的历史消息(c2c获取群)条数
95
+var msgList = [];
96
+var getPrePageC2CHistroyMsgInfoMap = {};
64 97
 export default {
65 98
     name:'contactBox',
66 99
     data(){
67 100
         return{
68 101
             showMsgBox:false,
102
+            showPhoneBox:false,
103
+            selToID:'',
104
+            loginInfo: {
105
+                sdkAppID: '', //用户所属应用id,必填
106
+                appIDAt3rd: '',
107
+                identifier: '', //当前用户ID,必须是否字符串类型,必填
108
+                accountType: '', //用户所属应用帐号类型,必填
109
+                userSig: '', //当前用户身份凭证,必须是字符串类型,必填
110
+                identifierNick: '', //当前用户昵称,不用填写,登录接口会返回用户的昵称,如果没有设置,则返回用户的id
111
+                headurl: '', //当前用户默认头像,选填,如果设置过头像,则可以通过拉取个人资料接口来得到头像信息
112
+            },
113
+            useradmin:{
114
+                usersig: '',
115
+                Indentifier: '',
116
+                appIDAt3rd:'',
117
+                IdentifierNick:'',
118
+                HeadURL:'',
119
+            },
120
+            kefuUrl:'https://images.shengws.com/ico_gjh.png',
121
+            userSigFlag:false,
122
+            imloginFlag:false,
123
+            message:'',
124
+            messageBox:[],
125
+            facelist:[],
126
+            showFace:false,
69 127
         }
70
-    }
128
+    },
129
+    created(){
130
+        
131
+        this.getusersig();
132
+    },
133
+    methods:{
134
+        getusersig() {
135
+            getusersig().then(response => {
136
+                if (response.data.state == 0) {
137
+                    this.$message.error(response.data.msg);
138
+                    return false;
139
+                } else {
140
+                    this.useradmin = {
141
+                        usersig: response.data.data.sig,
142
+                        Indentifier: response.data.data.Indentifier,
143
+                        appIDAt3rd:response.data.data.appIDAt3rd,
144
+                        IdentifierNick:response.data.data.IdentifierNick,
145
+                        HeadURL:response.data.data.HeadURL,
146
+                    } 
147
+                    
148
+                    this.loginInfo.appIDAt3rd = this.useradmin.appIDAt3rd
149
+                    this.loginInfo.identifier = this.useradmin.Indentifier
150
+                    this.loginInfo.userSig = this.useradmin.usersig
151
+                    this.loginInfo.identifierNick = this.useradmin.IdentifierNick
152
+                    this.loginInfo.headurl = this.useradmin.HeadURL
153
+                    this.loginInfo.sdkAppID = response.data.data.sdkAppID
154
+                    this.loginInfo.accountType = response.data.data.accountType
155
+                    this.selToID = response.data.data.selToAdmin;
156
+                    this.userSigFlag = true;
157
+                }
158
+            });
159
+        },
160
+        showEmotion:function(){
161
+            this.facelist = [];
162
+            for (const index in webim.Emotions) {
163
+                this.facelist.push(webim.Emotions[index]);
164
+            }
165
+            this.showFace = true;
166
+        },
167
+        selectEmotion:function(face){
168
+            this.message += face[0];
169
+            this.showFace = false;
170
+        },
171
+        sendMessage:function(){
172
+            var message = this.message.trim();
173
+            var msgLen = webim.Tool.getStrBytes(message);
174
+            if(message == '') {
175
+                this.$message.error('不能发送空消息');
176
+                return false;
177
+            }
178
+            var maxLen, errInfo;
179
+            if (selType == webim.SESSION_TYPE.C2C) {
180
+                maxLen = webim.MSG_MAX_LENGTH.C2C;
181
+                errInfo = "消息长度超出限制(最多" + Math.round(maxLen / 3) + "汉字)";
182
+            } else {
183
+                maxLen = webim.MSG_MAX_LENGTH.GROUP;
184
+                errInfo = "消息长度超出限制(最多" + Math.round(maxLen / 3) + "汉字)";
185
+            }
186
+            if (msgLen > maxLen) {
187
+                this.$message.error(errInfo);
188
+                return false;
189
+            }
190
+            this.handleMsgSend(message);
191
+        },
192
+        handleMsgSend(msgContent) {
193
+            var selSess = new webim.Session(selType, this.selToID, this.selToID, this.kefuUrl, Math.round(new Date().getTime() / 1000));
194
+            var isSend = true; //是否为自己发送
195
+            var seq = -1; //消息序列,-1表示sdk自动生成,用于去重
196
+            var random = Math.round(Math.random() * 4294967296); //消息随机数,用于去重
197
+            var msgTime = Math.round(new Date().getTime() / 1000); //消息时间戳
198
+            var subType; //消息子类型
199
+            if (selType == webim.SESSION_TYPE.C2C) {
200
+                subType = webim.C2C_MSG_SUB_TYPE.COMMON;
201
+            } else {
202
+                subType = webim.GROUP_MSG_SUB_TYPE.COMMON;
203
+            }
204
+            var msg = new webim.Msg(selSess, isSend, seq, random, msgTime, this.loginInfo.identifier, subType, this.loginInfo.identifierNick);
205
+
206
+            var text_obj, face_obj, tmsg, emotionIndex, emotion, restMsgIndex;
207
+            //解析文本和表情
208
+            var expr = /\[[^[\]]{1,3}\]/mg;
209
+            var emotions = msgContent.match(expr);
210
+            if (!emotions || emotions.length < 1) {
211
+                text_obj = new webim.Msg.Elem.Text(msgContent);
212
+                msg.addText(text_obj);
213
+            } else {
214
+                for (var i = 0; i < emotions.length; i++) {
215
+                    tmsg = msgContent.substring(0, msgContent.indexOf(emotions[i]));
216
+                    if (tmsg) {
217
+                        text_obj = new webim.Msg.Elem.Text(tmsg);
218
+                        msg.addText(text_obj);
219
+                    }
220
+                    emotionIndex = webim.EmotionDataIndexs[emotions[i]];
221
+                    emotion = webim.Emotions[emotionIndex];
222
+
223
+                    if (emotion) {
224
+                        face_obj = new webim.Msg.Elem.Face(emotionIndex, emotions[i]);
225
+                        msg.addFace(face_obj);
226
+                    } else {
227
+                        text_obj = new webim.Msg.Elem.Text(emotions[i]);
228
+                        msg.addText(text_obj);
229
+                    }
230
+                    restMsgIndex = msgContent.indexOf(emotions[i]) + emotions[i].length;
231
+                    msgContent = msgContent.substring(restMsgIndex);
232
+                }
233
+                if (msgContent) {
234
+                    text_obj = new webim.Msg.Elem.Text(msgContent);
235
+                    msg.addText(text_obj);
236
+                }
237
+            }
238
+
239
+            msg.PushInfo = {
240
+                "PushFlag": 0,
241
+                "Desc": '测试离线推送内容', //离线推送内容
242
+                "Ext": '测试离线推送透传内容', //离线推送透传内容
243
+                "AndroidInfo": {
244
+                    "Sound": "android.mp3" //离线推送声音文件路径。
245
+                },
246
+                "ApnsInfo": {
247
+                    "Sound": "apns.mp3", //离线推送声音文件路径。
248
+                    "BadgeMode": 1
249
+                }
250
+            };
251
+
252
+            msg.PushInfoBoolean = true; //是否开启离线推送push同步
253
+            msg.sending = 1;
254
+            msg.originContent = msgContent;
255
+            // turnoffFaces_box();
256
+            var _this = this;
257
+
258
+            webim.sendMsg(msg, function (resp) {
259
+                _this.addMsg(msg);
260
+                _this.message = '';
261
+            }, function (err) {
262
+                console.log(err)
263
+            });
264
+        },
265
+        addMsg(msg, prepage) {
266
+            var messageitem = {
267
+                id:'',
268
+                message:'',
269
+                avatar:'',
270
+                time:'',
271
+                float:''
272
+            };
273
+            var isSelfSend, fromAccount, fromAccountNick, fromAccountImage, sessType, subType;
274
+
275
+            //webim.SESSION_TYPE.GROUP-群聊,
276
+            //webim.SESSION_TYPE.C2C-私聊,
277
+            sessType = msg.getSession().type();
278
+            isSelfSend = msg.getIsSend();//消息是否为自己发的
279
+            fromAccount = msg.getFromAccount();
280
+            if (!fromAccount) {
281
+                return;
282
+            }
283
+            if (isSelfSend) {//如果是自己发的消息
284
+                messageitem.avatar = this.loginInfo.headurl;
285
+                messageitem.float = "right";
286
+            } else {
287
+                messageitem.avatar = this.kefuUrl;
288
+                messageitem.float = "left";
289
+            }
290
+            messageitem.id = msg.random;
291
+            messageitem.time = webim.Tool.formatText2Html(webim.Tool.formatTimeStamp(msg.getTime()));
292
+            messageitem.message = this.convertMsgtoHtml(msg)
293
+            this.messageBox.push(messageitem);
294
+
295
+            var msgflow = document.getElementsByClassName("msg-inner")[0];
296
+            if (prepage) {
297
+                //300ms后,等待图片加载完,滚动条自动滚动到底部
298
+                if (msgflow.scrollTop == 0) {
299
+                    setTimeout(function () {
300
+                        msgflow.scrollTop = 0;
301
+                    }, 300);
302
+                }
303
+            } else {
304
+                //300ms后,等待图片加载完,滚动条自动滚动到底部
305
+                setTimeout(function () {
306
+                    msgflow.scrollTop = msgflow.scrollHeight;
307
+                }, 300);
308
+            }
309
+        },
310
+        sendPic(images, imgName) {
311
+            var _this = this;
312
+            if (!this.selToID) {
313
+                alert("请先选择对话用户");
314
+                return;
315
+            }
316
+
317
+            if (!this.selSess) {
318
+                this.selSess = new webim.Session(selType, this.selToID, this.selToID, this.kefuUrl, Math.round(new Date().getTime() / 1000));
319
+            }
320
+            var msg = new webim.Msg(this.selSess, true, -1, -1, -1, this.loginInfo.identifier, 0, this.loginInfo.identifierNick);
321
+            var images_obj = new webim.Msg.Elem.Images(images.File_UUID);
322
+            for (var i in images.URL_INFO) {
323
+                var img = images.URL_INFO[i];
324
+                var newImg;
325
+                var type;
326
+                switch (img.PIC_TYPE) {
327
+                    case 1://原图
328
+                        type = 1;//原图
329
+                        break;
330
+                    case 2://小图(缩略图)
331
+                        type = 3;//小图
332
+                        break;
333
+                    case 4://大图
334
+                        type = 2;//大图
335
+                        break;
336
+                }
337
+                newImg = new webim.Msg.Elem.Images.Image(type, img.PIC_Size, img.PIC_Width, img.PIC_Height, img.DownUrl);
338
+                images_obj.addImage(newImg);
339
+            }
340
+            msg.addImage(images_obj);
341
+            //if(imgName){
342
+            //    var data=imgName;//通过自定义消息中的data字段保存图片名称
343
+            //    var custom_obj = new webim.Msg.Elem.Custom(data, '', '');
344
+            //    msg.addCustom(custom_obj);
345
+            //}
346
+            //调用发送图片消息接口
347
+            webim.sendMsg(msg, function (resp) {
348
+                if (selType == webim.SESSION_TYPE.C2C) {//私聊时,在聊天窗口手动添加一条发的消息,群聊时,长轮询接口会返回自己发的消息
349
+                    _this.addMsg(msg);
350
+                }
351
+            }, function (err) {
352
+                alert(err.ErrorInfo);
353
+            });
354
+        },
355
+        bindScrollHistoryEvent(axtion){
356
+            var msgflow = document.getElementsByClassName("msg-inner")[0];
357
+            var _this = this;
358
+            if (axtion=='init') {
359
+                msgflow.onscroll = function () {
360
+                    if (msgflow.scrollTop == 0) {
361
+                        msgflow.scrollTop = 10;
362
+                        if (selType == webim.SESSION_TYPE.C2C) {
363
+                            _this.getPrePageC2CHistoryMsgs();
364
+                        } 
365
+                    }
366
+                }
367
+            }else {
368
+                msgflow.onscroll = null;
369
+            }
370
+        },
371
+        getPrePageC2CHistoryMsgs  (cbOk, cbError) {
372
+            var _this = this;
373
+            if (selType == webim.SESSION_TYPE.GROUP) {
374
+                _this.$message.error("当前的聊天类型为群聊天,不能进行拉取好友历史消息操作");
375
+                return;
376
+            }
377
+            var tempInfo = getPrePageC2CHistroyMsgInfoMap[_this.selToID];//获取下一次拉取的c2c消息时间和消息Key
378
+            var lastMsgTime;
379
+            var msgKey;
380
+            if (tempInfo) {
381
+                lastMsgTime = tempInfo.LastMsgTime;
382
+                msgKey = tempInfo.MsgKey;
383
+            } else {
384
+                _this.$message.error("获取下一次拉取的c2c消息时间和消息Key为空");
385
+                return;
386
+            }
387
+            var options = {
388
+                'Peer_Account': _this.selToID, //好友帐号
389
+                'MaxCnt': reqMsgCount, //拉取消息条数
390
+                'LastMsgTime': lastMsgTime, //最近的消息时间,即从这个时间点向前拉取历史消息
391
+                'MsgKey': msgKey
392
+            };
393
+            webim.getC2CHistoryMsgs(
394
+                options,
395
+                function (resp) {
396
+                    var complete = resp.Complete;//是否还有历史消息可以拉取,1-表示没有,0-表示有
397
+                    if (resp.MsgList.length == 0) {
398
+                        webim.Log.warn("没有历史消息了:data=" + JSON.stringify(options));
399
+                        return;
400
+                    }
401
+                    getPrePageC2CHistroyMsgInfoMap[_this.selToID] = {//保留服务器返回的最近消息时间和消息Key,用于下次向前拉取历史消息
402
+                        'LastMsgTime': resp.LastMsgTime,
403
+                        'MsgKey': resp.MsgKey
404
+                    };
405
+                    if (cbOk) {
406
+                        cbOk(resp.MsgList);
407
+                    } else {
408
+                        _this.getHistoryMsgCallback(resp.MsgList, true);
409
+                    }
410
+                },
411
+                cbError
412
+            );
413
+        },
414
+        getLastC2CHistoryMsgs (cbOk, cbError) {
415
+            var _this = this;
416
+            var lastMsgTime = 0;//第一次拉取好友历史消息时,必须传0
417
+            var msgKey = '';
418
+            var options = {
419
+                'Peer_Account': this.selToID, //好友帐号
420
+                'MaxCnt': reqMsgCount, //拉取消息条数
421
+                'LastMsgTime': lastMsgTime, //最近的消息时间,即从这个时间点向前拉取历史消息
422
+                'MsgKey': msgKey
423
+            };
424
+            this.selSess = null;
425
+            webim.MsgStore.delSessByTypeId(selType, this.selToID);
426
+
427
+            webim.getC2CHistoryMsgs(
428
+                options,
429
+                function (resp) {
430
+                    var complete = resp.Complete;//是否还有历史消息可以拉取,1-表示没有,0-表示有
431
+
432
+                    if (resp.MsgList.length == 0) {
433
+                        webim.Log.warn("没有历史消息了:data=" + JSON.stringify(options));
434
+                        return;
435
+                    }
436
+                    getPrePageC2CHistroyMsgInfoMap[_this.selToID] = {//保留服务器返回的最近消息时间和消息Key,用于下次向前拉取历史消息
437
+                        'LastMsgTime': resp.LastMsgTime,
438
+                        'MsgKey': resp.MsgKey
439
+                    };
440
+                    
441
+                    if (cbOk)
442
+                        cbOk(resp.MsgList);
443
+                },
444
+                cbError
445
+            );
446
+        },
447
+        getHistoryMsgCallback(msgList, prepage) {
448
+            var msg;
449
+            var prepage = prepage || false;
450
+
451
+            //如果是加载前几页的消息,消息体需要prepend,所以先倒排一下
452
+            if (prepage) {
453
+                msgList.reverse();
454
+            }
455
+
456
+            for (var j in msgList) {//遍历新消息
457
+                msg = msgList[j];
458
+                if (msg.getSession().id() == this.selToID) {//为当前聊天对象的消息
459
+                    this.selSess = msg.getSession();
460
+                    //在聊天窗体中新增一条消息
461
+                    this.addMsg(msg, prepage);
462
+                }
463
+            }
464
+            //消息已读上报,并将当前会话的消息设置成自动已读
465
+            webim.setAutoRead(this.selSess, true, true);
466
+        },
467
+        convertMsgtoHtml(msg) {
468
+            var html = "",
469
+                elems, elem, type, content;
470
+            elems = msg.getElems(); //获取消息包含的元素数组
471
+            var count = elems.length;
472
+            for (var i = 0; i < count; i++) {
473
+                elem = elems[i];
474
+                type = elem.getType();//获取元素类型
475
+                content = elem.getContent();//获取元素对象
476
+                switch (type) {
477
+                    case webim.MSG_ELEMENT_TYPE.TEXT:
478
+                        var eleHtml = this.convertTextMsgToHtml(content);
479
+                        //转义,防XSS
480
+                        html += webim.Tool.formatText2Html(eleHtml);
481
+                        break;
482
+                    case webim.MSG_ELEMENT_TYPE.FACE:
483
+                        html += this.convertFaceMsgToHtml(content);
484
+                        break;
485
+                    case webim.MSG_ELEMENT_TYPE.IMAGE:
486
+                        if (i <= count - 2) {
487
+                            var customMsgElem = elems[i + 1];//获取保存图片名称的自定义消息elem
488
+                            var imgName = customMsgElem.getContent().getData();//业务可以自定义保存字段,demo中采用data字段保存图片文件名
489
+                            html += this.convertImageMsgToHtml(content, imgName);
490
+                            i++;//下标向后移一位
491
+                        } else {
492
+                            html += this.convertImageMsgToHtml(content);
493
+                        }
494
+                        break;
495
+                    case webim.MSG_ELEMENT_TYPE.SOUND:
496
+                        html += this.convertSoundMsgToHtml(content);
497
+                        break;
498
+                    case webim.MSG_ELEMENT_TYPE.FILE:
499
+                        html += this.convertFileMsgToHtml(content);
500
+                        break;
501
+                    case webim.MSG_ELEMENT_TYPE.LOCATION:
502
+                        html += this.convertLocationMsgToHtml(content);
503
+                        break;
504
+                    case webim.MSG_ELEMENT_TYPE.CUSTOM:
505
+                        var eleHtml = this.convertCustomMsgToHtml(content);
506
+                        //转义,防XSS
507
+                        html += webim.Tool.formatText2Html(eleHtml);
508
+                        break;
509
+                    case webim.MSG_ELEMENT_TYPE.GROUP_TIP:
510
+                        var eleHtml = this.convertGroupTipMsgToHtml(content);
511
+                        //转义,防XSS
512
+                        html += webim.Tool.formatText2Html(eleHtml);
513
+                        break;
514
+                    default:
515
+                        webim.Log.error('未知消息元素类型: elemType=' + type);
516
+                        break;
517
+                }
518
+            }
519
+            return html;
520
+        },
521
+        convertTextMsgToHtml(content) {
522
+            return content.getText();
523
+        },
524
+        //解析表情消息元素
525
+        convertFaceMsgToHtml(content) {
526
+            var faceUrl = null;
527
+            var data = content.getData();
528
+            var index = webim.EmotionDataIndexs[data];
529
+
530
+            var emotion = webim.Emotions[index];
531
+            if (emotion && emotion[1]) {
532
+                faceUrl = emotion[1];
533
+            }
534
+            if (faceUrl) {
535
+                return "<img src='" + faceUrl + "'/>";
536
+            } else {
537
+                return data;
538
+            }
539
+        },
540
+        //解析图片消息元素
541
+        convertImageMsgToHtml(content, imageName) {
542
+            var smallImage = content.getImage(webim.IMAGE_TYPE.SMALL);//小图
543
+            var bigImage = content.getImage(webim.IMAGE_TYPE.LARGE);//大图
544
+            var oriImage = content.getImage(webim.IMAGE_TYPE.ORIGIN);//原图
545
+            if (!bigImage) {
546
+                bigImage = smallImage;
547
+            }
548
+            if (!oriImage) {
549
+                oriImage = smallImage;
550
+            }
551
+            return "<img name='" + imageName + "' src='" + smallImage.getUrl() + "#" + bigImage.getUrl() + "#" + oriImage.getUrl() + "' style='CURSOR: hand' id='" + content.getImageId() + "' bigImgUrl='" + bigImage.getUrl() + "'/>";
552
+        }, 
553
+        handleIMPicUload:function(fileobj){
554
+            var file = fileobj.file
555
+            console.log("file", file);
556
+            var _this = this;
557
+            var businessType;//业务类型,1-发群图片,2-向好友发图片
558
+            if (selType != webim.SESSION_TYPE.C2C) {//向好友发图片
559
+                this.$message.error('不支持群聊');
560
+                return; 
561
+            } 
562
+            businessType = webim.UPLOAD_PIC_BUSSINESS_TYPE.C2C_MSG;
563
+            //封装上传图片请求
564
+            var opt = {
565
+                'file': file, //图片对象
566
+                'onProgressCallBack': this.onProgressCallBack, //上传图片进度条回调函数
567
+                //'abortButton': document.getElementById('upd_abort'), //停止上传图片按钮
568
+                'To_Account': this.selToID, //接收者
569
+                'businessType': businessType//业务类型
570
+            };
571
+            //上传图片
572
+            webim.uploadPic(opt,
573
+                function (resp) {
574
+                    //上传成功发送图片
575
+                    _this.sendPic(resp, file.name);
576
+                    
577
+                },
578
+                function (err) {
579
+                    alert(err.ErrorInfo);
580
+                }
581
+            );
582
+        },
583
+        handleIMPicSuccess:function(){},
584
+        beforeIMPicUpload:function(file){
585
+            var fileType = file.type;
586
+            const isJPG = fileType.indexOf("image") > -1;
587
+            if (!isJPG) {
588
+                this.$message.error('只能上传图片');
589
+            }
590
+            return isJPG;
591
+        },
592
+        togglePhoneBox:function(){
593
+            if (this.showPhoneBox) {
594
+                this.showPhoneBox = false;
595
+            }else {
596
+                this.showPhoneBox = true;
597
+            }
598
+            this.showMsgBox = false;
599
+        },
600
+        toggleMsgBox:function(){
601
+            if (this.showMsgBox) {
602
+                this.showMsgBox = false;
603
+            }else {
604
+                this.showMsgBox = true;
605
+            }
606
+            this.showPhoneBox = false;
607
+        },
608
+        webimlogin(){
609
+            let _this = this;
610
+            let listeners = {
611
+                "onConnNotify": this.onConnNotify //监听连接状态回调变化事件,必填
612
+                , "jsonpCallback": this.jsonpCallback //IE9(含)以下浏览器用到的jsonp回调函数,
613
+                , "onMsgNotify": this.onMsgNotify //监听新消息(私聊,普通群(非直播聊天室)消息,全员推送消息)事件,必填
614
+                , "onProfileSystemNotifys": this.onProfileSystemNotifys //监听资料系统(自己或好友)通知事件,选填
615
+                , "onKickedEventCall": this.onKickedEventCall //被其他登录实例踢下线
616
+                , "onC2cEventNotifys": this.onC2cEventNotifys //监听C2C系统消息通道
617
+            };
618
+            webim.login(this.loginInfo, listeners, this.loginOptions, 
619
+                function(resp){
620
+                    _this.$message.success('webim登录成功');
621
+                    _this.imloginFlag = true;
622
+                },
623
+                function(err) {
624
+                    _this.$message.error('webim登录错误');
625
+                }
626
+            );
627
+        },
628
+        onConnNotify(){},
629
+        jsonpCallback(){},
630
+        onMsgNotify(newMsgList){
631
+            //监听新消息事件
632
+            var msgList = [];
633
+            var dateStart = null;
634
+            var dateEnd = null;
635
+
636
+            //console.warn(newMsgList);
637
+            var sess, newMsg, formId;
638
+            //获取所有聊天会话
639
+            var sessMap = webim.MsgStore.sessMap();
640
+
641
+            for (var j in newMsgList) {//遍历新消息
642
+
643
+                newMsg = newMsgList[j];
644
+                formId = newMsg.getSession().id();
645
+                if (formId.indexOf("AdminKeFu")<0) {
646
+                    continue;
647
+                }else {
648
+                    if (newMsg.getSession().id() == this.selToID) {//为当前聊天对象的消息
649
+                        this.addMsg(newMsg);
650
+                    }
651
+                    msgList.push(newMsg.elems[0].content.text);
652
+                }
653
+                
654
+            }
655
+        },
656
+        onProfileSystemNotifys(){},
657
+        onKickedEventCall(){},
658
+        onC2cEventNotifys(){},
659
+    },
660
+    watch:{
661
+        'userSigFlag':function(value){
662
+            if(this.userSigFlag) {
663
+                this.webimlogin();
664
+            }
665
+        },
666
+        'imloginFlag':function(value) {
667
+            var _this = this;
668
+            if (this.imloginFlag) {
669
+                this.bindScrollHistoryEvent('reset');
670
+                this.getLastC2CHistoryMsgs(function (msgList) {
671
+                    _this.getHistoryMsgCallback(msgList);
672
+                    _this.bindScrollHistoryEvent('init');
673
+                    //绑定滚动操作
674
+                }, function (err) {
675
+                    alert(err.ErrorInfo);
676
+                });
677
+            }
678
+        }
679
+    },
71 680
 
72 681
 }
73 682
 </script>
@@ -78,7 +687,7 @@ export default {
78 687
     right: 12px;
79 688
     bottom: 10%;
80 689
     margin-top: -100px;
81
-    z-index: 99999;
690
+    z-index: 9999;
82 691
 }
83 692
     
84 693
 .contact-box .contact-box-item{
@@ -102,18 +711,17 @@ export default {
102 711
     color: #59a3ec;
103 712
     display: inline-block;
104 713
 }
105
-.contact-box .contact-box-item .box-btn:hover {
106
-    background: #5aa6f1;
107
-}
714
+/* .contact-box .contact-box-item .box-btn:hover {
715
+} */
108 716
 .contact-box .box-btn span{
109 717
     display: none;
110
-}
111
-
112
-.contact-box .box-btn:hover span{
113
-    display: block;
114 718
     color:#fff;
115 719
     padding: 8px;
116 720
     font-size: 14px;
721
+    background: #5aa6f1;
722
+}
723
+.contact-box .box-btn:hover span{
724
+    display: block;
117 725
 }
118 726
 .contact-box .box-btn:hover i{
119 727
     display: none;
@@ -124,10 +732,9 @@ export default {
124 732
     bottom: 0px;
125 733
     right: 56px;
126 734
     height: 48px;
127
-    /* display: block; */
735
+    display:flex;
128 736
     background: #fff;
129 737
     width: 230px;
130
-    display:none;
131 738
     align-items: center;
132 739
 }
133 740
 .contact-box .contact-phone-box i {
@@ -135,10 +742,6 @@ export default {
135 742
     font-size:30px; 
136 743
     margin: 9px;
137 744
 }
138
-.contact-box .phone-box:hover .contact-phone-box{
139
-    display:flex;
140
-}
141
-
142 745
 .contact-box .contact-phone-box span {
143 746
     font-size:20px; 
144 747
     margin-left: 15px;
@@ -153,7 +756,7 @@ export default {
153 756
     display: none;
154 757
     background: #fff;
155 758
     width: 175px;
156
-    z-index: 1000000;
759
+    z-index: 10000;
157 760
 }
158 761
 .contact-box .msg-box:hover .contact-info-box{
159 762
     display:block;
@@ -216,4 +819,114 @@ export default {
216 819
 .contact-box .scroll-y::-webkit-scrollbar-track {
217 820
     border-radius: 2px;
218 821
 }
822
+.contact-box .msg-inner .cell {
823
+    margin-bottom: 15px;
824
+}
825
+.contact-box .cell_right {
826
+    float: right;
827
+}
828
+
829
+.contact-box .clearfix {
830
+    clear: both;
831
+}
832
+.contact-box .msg-inner .msg_body {
833
+    border: 1px #e5e5e5 solid;
834
+    line-height: 22px;
835
+    display: inline-block;
836
+    padding: 6px;
837
+    max-width: 292px;
838
+}
839
+.contact-box .fl {
840
+    float: left;
841
+}
842
+.contact-box .msg-inner .msg_body .inner {
843
+    color: #465b6e;
844
+}
845
+.contact-box .msg-inner .cell_pic {
846
+    width: 40px;
847
+    height: 40px;
848
+    display: inline-block;
849
+    margin: 0 20px;
850
+}
851
+.contact-box .msg-inner .cell_pic .pic {
852
+    width: 40px;
853
+    height: 40px;
854
+    display: flex;
855
+}
856
+.contact-box .msg-inner .cell_pic .pic img {
857
+    width: 40px;
858
+    height: 40px;
859
+    border-radius: 50%;
860
+    object-fit: cover;
861
+    object-position: center;
862
+}
863
+
864
+.contact-box .msg-box-panel .panel-booter .textarea {
865
+    border: 1px #fff solid;
866
+    padding: 10px 20px;
867
+    color: #465b6e;
868
+    height: 100px;
869
+    resize: none;
870
+    width: 100%;
871
+}
872
+.contact-box .msg-box-panel .panel-booter .msg-send-btn-box {
873
+    padding: 0 20px 10px 20px;
874
+    float: left;
875
+    background: #fff;
876
+    width: 408px;
877
+}
878
+.contact-box .msg-box-panel .panel-booter .time {
879
+    font-size: 12px;
880
+    color: #bebebe;
881
+    height: 26px;
882
+    line-height: 26px;
883
+}
884
+.contact-box .msg-box-panel .panel-booter .msg-send-btn-box .send_btn {
885
+    color: #fff;
886
+    padding: 6px 20px;
887
+    border-radius: 4px;
888
+    font-size: 12px;
889
+    background: #58a1ed;
890
+    border: none;
891
+}
892
+
893
+.contact-box  .panel-tool {
894
+    color: #465b6e;
895
+    height: 30px;
896
+    border-bottom: 1px #e5e5e5 solid;
897
+    display:flex;
898
+    align-items: center;
899
+}
900
+
901
+.contact-box  .panel-tool i {
902
+    font-size: 20px;
903
+    padding: 0 5px;
904
+    margin: 0 5px;
905
+    cursor: pointer;
906
+}
907
+
908
+.contact-box  .panel-tool .icon-face::before {
909
+    content: '\1F642';
910
+    font-size: 15px;
911
+}
912
+.contact-box .face-box {
913
+    width: 304px;
914
+    z-index: 10001;
915
+    background: #fff;
916
+    position: relative;
917
+    bottom: 70px;
918
+    left: -100px;
919
+    border: 2px #e5e5e5 solid;
920
+}
921
+.contact-box .face-box-list li {
922
+    display: inline-block;
923
+    
924
+    border-right: 1px #CCC solid;
925
+    border-bottom: 1px #CCC solid;
926
+    cursor: pointer;
927
+}
928
+.contact-box .face-box-title {
929
+    border-bottom: 1px #e5e5e5 solid;
930
+    margin: 2px 0;
931
+}
219 932
 </style>

+ 965 - 0
src/scrm_pages/kefu/index.vue Zobrazit soubor

@@ -0,0 +1,965 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+    </div>
6
+    <div class="app-container">
7
+        <div class="customer_plate white-bg">
8
+            <div class="aside">
9
+                <div class="customer_search clearfix">
10
+                <div class="super_searchbox">
11
+                    <span class="search_icon"></span>
12
+                    <input type="text" class="cus_search_input" v-model="searchname" placeholder="请输入客户名称">
13
+                </div>
14
+                </div>
15
+                <div class="client_list_box">
16
+                <div class="client_list">
17
+                    <ul class="users-list">
18
+                    <li v-for="(patient, key) in patientsMap" v-show="searchname == '' || (patient.name.indexOf(searchname)>=0)" :class="thisPatient && patient.user_id==thisPatient.user_id?'Active':''" :key="key" :id="'sessDiv_User_'+patient.user_id" class="item" :data-username="patient.name" @click="chooseThisUser(patient)">
19
+                        <span :id="'badgeDiv_User_'+patient.user_id" class="circle-count" style="" v-show="patient.unread_msg_count"><i class="count">{{patient.unread_msg_count}}</i></span>
20
+                        <figure :id="'faceImg_User_'+patient.user_id" class="session-pic"><img :src="patient.avatar"></figure>
21
+                        <h3 :id="'nameDiv_User_'+patient.user_id" class="nick">{{patient.name}}</h3>
22
+                        <!-- <span class="square-close" title="退出接待" :data-toid="'User_'+patient.user_id">×</span> -->
23
+                    </li>
24
+                    </ul>
25
+                </div>
26
+                </div>
27
+            </div>
28
+
29
+            <div class="left_content">
30
+                <div class="conversation-admin">
31
+                <span class="nickname">
32
+                    <span></span>
33
+                </span>
34
+                </div>
35
+                <div class="message-list-wrap">
36
+                <div class="message-list-item">
37
+                    <ul class="message-list">
38
+                    
39
+                    <li v-for="(messageitem, key) in messageBox" :key="key" :id="'id_'+messageitem.id" class="message-item clearfix">
40
+                        <div class="time"><span v-html="messageitem.time"></span></div>
41
+                        <div class="user " :class="messageitem.float">
42
+                            <figure class="bg-pic circle-bg-pic">
43
+                            <div class="bg-pic-content">
44
+                                <img :src="messageitem.avatar">
45
+                            </div>
46
+                            </figure>
47
+                        </div>
48
+                        <div class="message-body " :class="messageitem.float"><div class="inner" v-html="messageitem.message"></div></div>
49
+                    </li>
50
+
51
+                    </ul>
52
+                </div>
53
+                <div class="no_session">
54
+                    <span class="no_session_pic"></span>
55
+                    <p class="no_session_txt">没有选中会话哦!</p>
56
+                </div>
57
+                </div>
58
+                <div class="send_box" v-loading="loadingbox" :element-loading-text="loadingboxtext">
59
+                <div class="inputer_actions">
60
+                    <!-- <div class="face">
61
+                    <span class="face_icon" @click="showEmotionDialog"></span>
62
+                    </div> -->
63
+                    <div class="picture">
64
+                    <span class="picture_icon" @click="selectPicClick"></span>
65
+                    </div>
66
+                </div>
67
+                <div id="wl_faces_box" class="wl_faces_box" v-bind:style="{left:'0px', display:facesBoxDisplay}">
68
+                    <div class="wl_faces_content">
69
+                    <div class="title">
70
+                        <ul>
71
+                        <li class="title_name">常用表情</li>
72
+                        <li class="wl_faces_close">
73
+                            <span @click="facesBoxDisplay='none'">&nbsp;</span>
74
+                        </li>
75
+                        </ul>
76
+                    </div>
77
+                    <div id="wl_faces_main" class="wl_faces_main">
78
+                        <ul id="emotionUL">
79
+                        <li v-for="(emotion, key) in emotionList" :key="key" @click="chooseThisFace(emotion)">
80
+                            <img :src="emotion.src" :id="emotion.id" alt="" style="cursor:pointer;">
81
+                        </li>
82
+                        </ul>
83
+                    </div>
84
+                    </div>
85
+                    <div class="wlf_icon"></div>
86
+                </div>
87
+                <div class="inputer-area">
88
+                    <textarea
89
+                    maxlength="500" v-model="message"
90
+                    class="message-textarea transparent-txta"
91
+                    placeholder
92
+                    id="message"
93
+                    ></textarea>
94
+                </div>
95
+                <div class="send_box_btn">
96
+                    <button class="send_btn" id="sendMessaeg" @click="sendMessage">发送</button>
97
+                </div>
98
+                </div>
99
+            </div>
100
+        </div>
101
+    </div>
102
+  </div>
103
+</template>
104
+
105
+<script>
106
+  import BreadCrumb from '../components/bread-crumb'
107
+  export default {
108
+    name: 'commentList',
109
+    components:{
110
+      BreadCrumb,
111
+    },
112
+    data(){
113
+      return{
114
+        crumbs: [
115
+          { path: false, name: '客服管理' },
116
+          { path: false, name: '咨询管理' }
117
+        ],
118
+        searchname:'',
119
+        patientsMap:{},
120
+        thisPatient:null,
121
+        messageBox:[],
122
+      }
123
+    },
124
+    methods:{},
125
+    created(){
126
+    }
127
+  }
128
+</script>
129
+
130
+<style scoped>
131
+  /*.app-container .cell.clearfix .time ul li {*/
132
+    /*float: left;*/
133
+    /*list-style: none;*/
134
+    /*cursor: pointer;*/
135
+    /*padding: 6px 20px;*/
136
+    /*color: #606266;*/
137
+    /*border-radius: 4px;*/
138
+    /*margin: 0 8px 0 0;*/
139
+    /*font-size: 14px;*/
140
+    /*text-align: center;*/
141
+  /*}*/
142
+
143
+  
144
+.app-container{
145
+  height: 750px;  
146
+}
147
+.customer_plate {
148
+  width: 100%;
149
+  display: -webkit-box;
150
+  display: -webkit-flex;
151
+  display: -moz-box;
152
+  display: -ms-flexbox;
153
+  display: flex;
154
+  -webkit-box-flex: 1;
155
+  -webkit-flex: 1;
156
+  -moz-box-flex: 1;
157
+  -ms-flex: 1;
158
+  flex: 1;
159
+  height:100%;
160
+}
161
+.customer_plate .aside {
162
+  width: 282px;
163
+  -webkit-flex-shrink: 0;
164
+  -ms-flex-negative: 0;
165
+  flex-shrink: 0;
166
+  position: relative;
167
+  border-right: 1px solid #e5e8ea;
168
+}
169
+.customer_plate .aside .client_list_box {
170
+  position: absolute;
171
+  width: 100%;
172
+  top: 50px;
173
+  left: 0;
174
+  bottom: 0;
175
+  overflow-x: visible;
176
+  overflow-y: auto;
177
+}
178
+.channelswitch-wrap {
179
+  position: absolute;
180
+  top: 0;
181
+  left: 0;
182
+  right: 0;
183
+  bottom: 0;
184
+}
185
+.customer_plate .aside .client_list_box .client_list {
186
+  height: 100%;
187
+  overflow: hidden;
188
+  overflow-y: auto;
189
+}
190
+.customer_plate .aside .customer_search {
191
+  margin: 0 10px;
192
+  height: 34px;
193
+}
194
+.customer_plate .aside .super_searchbox {
195
+  padding: 0 8px;
196
+  background-color: #f4f7fa;
197
+  border-radius: 30px;
198
+  margin-top: 15px;
199
+  font-size: 12px;
200
+}
201
+.customer_plate .aside .super_searchbox .cus_search_input {
202
+  border: none;
203
+  background: none;
204
+  width: 224px;
205
+  height: 22px;
206
+  line-height: 22px;
207
+}
208
+.customer_plate .aside .super_searchbox .search_icon {
209
+  display: inline-block;
210
+  width: 12px;
211
+  height: 12px;
212
+  background: url(http://jk.kuyicloud.com/static/images/ico.png) no-repeat;
213
+  float: left;
214
+  background-position: -460px -314px;
215
+  margin: 4px 5px 0 0;
216
+}
217
+.left_content {
218
+  -webkit-box-flex: 1;
219
+  -webkit-flex: 1;
220
+  -moz-box-flex: 1;
221
+  -ms-flex: 1;
222
+  flex: 1;
223
+  display: -webkit-box;
224
+  display: -webkit-flex;
225
+  display: -moz-box;
226
+  display: -ms-flexbox;
227
+  display: flex;
228
+  position: relative;
229
+  width: 100%;
230
+  justify-content: flex-start;
231
+  flex-direction: column;
232
+}
233
+.left_content .message-list-wrap {
234
+  position: absolute;
235
+  top: 50px;
236
+  overflow: hidden;
237
+  left: 0;
238
+  right: 0;
239
+  border-bottom: 1px #e5e8ea solid;
240
+  bottom: 210px;
241
+}
242
+.left_content .message-list-wrap .message-list-item {
243
+  height: 100%;
244
+  overflow-x: hidden;
245
+  overflow-y: auto;
246
+}
247
+.left_content .message-list-wrap .message-list {
248
+  padding: 0 12px 20px;
249
+}
250
+.left_content .conversation-admin {
251
+  height: 48px;
252
+  line-height: 48px;
253
+  border-bottom: 1px #e5e8ea solid;
254
+  margin-left: 2px;
255
+  width: 100%;
256
+}
257
+.left_content .conversation-admin .nickname {
258
+  padding-left: 22px;
259
+}
260
+.client_list ul {
261
+  list-style: none;
262
+}
263
+.client_list ul .item {
264
+  padding: 17px 12px 17px 62px;
265
+  min-height: 36px;
266
+  cursor: pointer;
267
+  font-size: 12px;
268
+  transition: background-color 0.2s linear;
269
+  -webkit-transition: background-color 0.2s linear;
270
+  -moz-transition: background-color 0.2s linear;
271
+  position: relative;
272
+}
273
+.client_list ul .Active {
274
+  background: #f4f7fa;
275
+}
276
+.client_list ul .item .nick {
277
+  font-size: 14px;
278
+  color: #485b6d;
279
+  margin-bottom: 7px;
280
+}
281
+.client_list ul .item:hover {
282
+  background: #dfedfb;
283
+}
284
+.client_list ul .item .time {
285
+  position: absolute;
286
+  top: 14px;
287
+  right: 12px;
288
+  color: #a8b3ba;
289
+}
290
+.client_list ul .item .circle-count {
291
+  padding: 2px;
292
+  background-color: #ff7979;
293
+  text-align: center;
294
+  left: 8px;
295
+  z-index: 2;
296
+  min-width: 17px;
297
+  min-height: 15px;
298
+  line-height: 12px;
299
+  border-radius: 10px;
300
+  position: absolute;
301
+  top: 12px;
302
+  display: inline-block;
303
+}
304
+.client_list ul .item .circle-count .count {
305
+  color: #fff;
306
+  display: inline-block;
307
+  -webkit-transform: scale(0.83);
308
+  -moz-transform: scale(0.83);
309
+  -ms-transform: scale(0.83);
310
+  transform: scale(0.83);
311
+}
312
+.client_list ul .item .session-pic {
313
+  position: absolute;
314
+  top: 17px;
315
+  left: 13px;
316
+  width: 40px;
317
+  height: 40px;
318
+  border-radius: 50%;
319
+  overflow: hidden;
320
+  display: inline-block;
321
+}
322
+.client_list ul .item .session-pic img {
323
+  width: 40px;
324
+  height: 40px;
325
+}
326
+.client_list ul .item .square-close {
327
+  color: #fff;
328
+  background-color: #d2d2d5;
329
+  display: none;
330
+  width: 14px;
331
+  height: 14px;
332
+  line-height: 12px;
333
+  text-align: center;
334
+  position: absolute;
335
+  top: 0;
336
+  right: 0;
337
+}
338
+.client_list ul .item:hover .square-close {
339
+  display: block;
340
+}
341
+.client_list ul .item .desc {
342
+  color: #a8b3ba;
343
+  text-overflow: ellipsis;
344
+  white-space: nowrap;
345
+  overflow: hidden;
346
+  width: 150px;
347
+}
348
+.service_fixed {
349
+  position: fixed;
350
+}
351
+.message-list-wrap ul li {
352
+  padding: 12px;
353
+}
354
+.message-list-wrap .message-item .time {
355
+  text-align: center;
356
+  margin: 20px 0 6px 0;
357
+}
358
+.message-list-wrap .message-item .time span {
359
+  font-size: 12px;
360
+  color: #a8b3ba;
361
+}
362
+.message-list .message-item .user .bg-pic {
363
+  display: inline-block;
364
+  margin-right: 20px;
365
+}
366
+.message-list .message-item .message-body {
367
+  background: #e5e8ea;
368
+  padding: 16px 12px 12px 12px;
369
+  border-radius: 4px;
370
+  color: #485b6d;
371
+  max-width: 520px;
372
+}
373
+.message-list .message-item .user .bg-pic .bg-pic-content {
374
+  border-radius: 50%;
375
+  display: inline-block;
376
+  width: 40px;
377
+  height: 40px;
378
+}
379
+.message-list .message-item .user .bg-pic img {
380
+  width: 40px;
381
+  height: 40px;
382
+  border-radius: 50%;
383
+  display: inline-block;
384
+}
385
+.no_session {
386
+  text-align: center;
387
+}
388
+.send_box {
389
+  position: absolute;
390
+  font-size: 13px;
391
+  bottom: 0;
392
+  height: 210px;
393
+  left: 0;
394
+  right: 0;
395
+  display: -webkit-box;
396
+  display: -webkit-flex;
397
+  display: -moz-box;
398
+  display: -ms-flexbox;
399
+  display: flex;
400
+  -webkit-box-orient: vertical;
401
+  -webkit-box-direction: normal;
402
+  -webkit-flex-direction: column;
403
+  -moz-box-orient: vertical;
404
+  -moz-box-direction: normal;
405
+  -ms-flex-direction: column;
406
+  flex-direction: column;
407
+}
408
+.send_box .inputer_actions {
409
+  padding: 10px;
410
+  background: #f5f5f5;
411
+}
412
+
413
+.send_box .inputer_actions .face {
414
+  float: left;
415
+  margin: 0;
416
+  height: auto;
417
+}
418
+.send_box .inputer_actions .face_icon {
419
+  width: 24px;
420
+  height: 22px;
421
+  background: url(http://jk.kuyicloud.com/static/images/ico.png) no-repeat -478px -314px;
422
+  display: inline-block;
423
+  margin-right: 22px;
424
+  cursor: pointer;
425
+}
426
+.send_box .inputer_actions .picture_icon {
427
+  width: 28px;
428
+  height: 24px;
429
+  background: url(http://jk.kuyicloud.com/static/images/ico.png) no-repeat -508px -314px;
430
+  display: inline-block;
431
+  margin-right: 22px;
432
+  cursor: pointer;
433
+}
434
+.inputer-area {
435
+  -webkit-box-flex: 1;
436
+  -webkit-flex: 1;
437
+  -moz-box-flex: 1;
438
+  -moz-flex: 1;
439
+  -ms-flex: 1;
440
+  flex: 1;
441
+  margin: 2px;
442
+  overflow: hidden;
443
+  display: -webkit-box;
444
+  display: -webkit-flex;
445
+  display: -moz-flex;
446
+  display: -ms-flexbox;
447
+  display: -moz-box;
448
+  display: flex;
449
+  -webkit-box-direction: normal;
450
+  -webkit-box-orient: vertical;
451
+  -webkit-flex-direction: column;
452
+  -moz-flex-direction: column;
453
+  -ms-flex-direction: column;
454
+  flex-direction: column;
455
+}
456
+.inputer-area .message-textarea {
457
+  display: -webkit-box;
458
+  display: -webkit-flex;
459
+  display: -moz-flex;
460
+  display: -ms-flexbox;
461
+  display: -moz-box;
462
+  display: flex;
463
+  -webkit-box-flex: 1;
464
+  -webkit-flex: 1;
465
+  -moz-box-flex: 1;
466
+  -moz-flex: 1;
467
+  -ms-flex: 1;
468
+  flex: 1;
469
+  width: auto;
470
+  height: 100%;
471
+  resize: none;
472
+  margin: 0;
473
+  padding: 9px 4px;
474
+  font-size: 14px;
475
+  line-height: 1.5em;
476
+  border: none;
477
+  overflow-x: hidden;
478
+  overflow-y: auto;
479
+  border-radius: 0;
480
+  -webkit-box-shadow: none;
481
+  box-shadow: none;
482
+  padding: 0 9px 4px;
483
+}
484
+.send_box .send_box_btn {
485
+  position: absolute;
486
+  bottom: 26px;
487
+  right: 40px;
488
+}
489
+.send_box .send_box_btn .send_btn {
490
+  background: #58a2ec;
491
+  color: #fff;
492
+  padding: 12px 55px;
493
+  border-radius: 4px;
494
+  border: none;
495
+  font-size: 14px;
496
+}
497
+/*
498
+To change this license header, choose License Headers in Project Properties.
499
+To change this template file, choose Tools | Templates
500
+and open the template in the editor.
501
+*/
502
+/*
503
+    Created on : 2015-7-6, 15:55:30
504
+    Author     : peakerdong
505
+*/
506
+
507
+#login {
508
+    display: block;
509
+    margin: 150px auto;
510
+    text-align: center;
511
+}
512
+
513
+.aio {
514
+    display: none;
515
+    width: 734px;
516
+    border: 1px black solid;
517
+    padding: 0px;
518
+    background: white;
519
+    margin: 20px auto;
520
+    font: 10px/1.5 "微软雅黑";
521
+}
522
+
523
+.titlebar {
524
+    height: 82px;
525
+    background: #5c95b3;
526
+}
527
+
528
+.titlebar #p_my_face {
529
+    position: relative;
530
+    width: 60px;
531
+    height: 60px;
532
+    border: 1px white solid;
533
+    margin: 10px;
534
+    float: left;
535
+}
536
+
537
+.titlebar #t_my_name {
538
+    position: relative;
539
+    top: 10px;
540
+    left: 10px;
541
+    float: left;
542
+    font-size: 20px;
543
+    color: white;
544
+}
545
+
546
+.titlebar #t_my_menu {
547
+    width: 150px;
548
+    position: relative;
549
+    top: 5px;
550
+    right: 5px;
551
+    float: right;
552
+
553
+}
554
+
555
+.sesspart {
556
+    clear: both;
557
+    float: left;
558
+    width: 208px;
559
+    height: 535px;
560
+    background: #d7eaf3;
561
+}
562
+
563
+.accordion {
564
+    margin-bottom: 18px;
565
+}
566
+
567
+.accordion-group {
568
+    margin-bottom: 2px;
569
+    border: 1px solid #e5e5e5;
570
+    -webkit-border-radius: 4px;
571
+    -moz-border-radius: 4px;
572
+    border-radius: 4px;
573
+}
574
+
575
+.accordion-heading {
576
+    border-bottom: 0;
577
+    background-color: bisque;
578
+}
579
+
580
+.accordion-heading .accordion-toggle {
581
+    display: block;
582
+    padding: 8px 15px;
583
+    font-size: medium;
584
+}
585
+
586
+.accordion-inner {
587
+    padding: 9px 15px;
588
+    border-top: 1px solid #e5e5e5;
589
+}
590
+.sesslist-recent {
591
+    height: 450px;
592
+    background: #f5f5f5;
593
+    border-width: 0px 1px 0px 0px;
594
+    border-color: #d5d6d7;
595
+    border-style: solid;
596
+}
597
+
598
+
599
+.sesslist {
600
+    /* height: 400px; */
601
+    height: 450px;
602
+    background: #f5f5f5;
603
+    border-width: 0px 1px 0px 0px;
604
+    border-color: #d5d6d7;
605
+    border-style: solid;
606
+    overflow: auto;
607
+}
608
+
609
+.sesslist-group {
610
+    /* height: 400px; */
611
+    height: 450px;
612
+    background: #f5f5f5;
613
+    border-width: 0px 1px 0px 0px;
614
+    border-color: #d5d6d7;
615
+    border-style: solid;
616
+    overflow: auto;
617
+}
618
+
619
+.sessinfo {
620
+    clear: both;
621
+    height: 50px;
622
+    border-width: 0px 0px 1px 0px;
623
+    border-color: #d5d6d7;
624
+    border-style: solid;
625
+}
626
+
627
+.sessinfo-sel {
628
+    clear: both;
629
+    height: 50px;
630
+    border-width: 0px 0px 1px 0px;
631
+    border-color: #d5d6d7;
632
+    border-style: solid;
633
+    background: #d7eaf3;
634
+}
635
+
636
+.face {
637
+    float: left;
638
+    width: 40px;
639
+    height: 40px;
640
+    margin: 5px 5px 5px 10px;
641
+}
642
+
643
+.name {
644
+    float: left;
645
+    height: 20px;
646
+    text-indent: 2px;
647
+    font-size: 12px;
648
+    color: #1f1f1f;
649
+    margin: 15px 0 0 0;
650
+}
651
+
652
+.badge {
653
+    display: none;
654
+    float: right;
655
+    margin: 18px 0 0 0;
656
+    width: 32px;
657
+    height: 20px;
658
+    background: #f00000;
659
+    color: white;
660
+    text-align: center;
661
+    -webkit-border-radius: 10px;
662
+    -moz-border-radius: 10px;
663
+    border-radius: 10px;
664
+}
665
+
666
+.badge span {
667
+    position: relative;
668
+    top: 1px;
669
+    font-size: 10px;
670
+}
671
+
672
+.chatpart {
673
+    float: right;
674
+    width: 526px;
675
+    border: 0px red solid;
676
+    background: #d7eaf3;
677
+    margin-top: -535px;
678
+}
679
+
680
+.msgflow {
681
+    width: 525px;
682
+    height: 380px;
683
+    border: 1px rgb(181, 178, 178) solid;
684
+    padding: 20px 6px 0 6px;
685
+    background: #f5f5f5;
686
+    overflow: auto;
687
+}
688
+.msgflow .onemsg{position:relative;}
689
+.msgflow .onemsg .msghead {
690
+    color: green;
691
+    line-height: 12px;
692
+    font-size: 12px;
693
+}
694
+
695
+.msgflow .onemsg .msgbody {
696
+    margin: 0 0 0 18px;
697
+    line-height: 13px;
698
+    font-size: 14px;
699
+}
700
+
701
+.msgflow .msgbody img {
702
+    max-width: 500px;
703
+}
704
+
705
+.editbar {
706
+    width: 526px;
707
+    height: 25px;
708
+}
709
+
710
+.chat02_title_btn {
711
+    background: url('http://jk.kuyicloud.com/static/plugins/tencentim/IMSDK_V1.7/img/icon.png') no-repeat 0 0;
712
+    cursor: pointer;
713
+    float: left;
714
+    display: block;
715
+    width: 15px;
716
+    height: 15px;
717
+    margin: 5px 6px;
718
+}
719
+
720
+.ctb01 {
721
+    background-position: 0 -90px;
722
+    margin-left: 18px;
723
+    _margin-left: 8px;
724
+}
725
+
726
+.ctb03 {
727
+    background-position: 0 -152px;
728
+}
729
+
730
+.ctb02 {
731
+    background-position: 0 -457px;
732
+}
733
+
734
+.ctb05 {
735
+    background-position: 0 -217px;
736
+}
737
+
738
+.ctb04 {
739
+    background-position: 0 -543px;
740
+}
741
+
742
+.wl_faces_box {
743
+    background: url('http://jk.kuyicloud.com/static/plugins/tencentim/IMSDK_V1.7/img/wlf_bg.png') repeat 0 0;
744
+    position: relative;
745
+    /*position: absolute;*/
746
+    width: 428px;
747
+    height: 225px;
748
+    bottom: 290px;
749
+    left: -42px;
750
+    display: none;
751
+}
752
+
753
+.wl_faces_content {
754
+    background: #fff;
755
+    border: 1px #ccc solid;
756
+    width: 417px;
757
+    height: 216px;
758
+    margin: 3px 4px;
759
+}
760
+
761
+.wl_faces_content .title {
762
+    background: url('http://jk.kuyicloud.com/static/plugins/tencentim/IMSDK_V1.7/img/wlf_title_bg.jpg') repeat-x 0 0;
763
+    height: 40px;
764
+    position: relative;
765
+}
766
+
767
+.wl_faces_content .title ul {
768
+
769
+}
770
+
771
+.wl_faces_content .title ul li {
772
+    position: absolute;
773
+    display: block;
774
+}
775
+
776
+.wl_faces_content .title ul li.title_name {
777
+    background: url('http://jk.kuyicloud.com/static/plugins/tencentim/IMSDK_V1.7/img/wlf_title_btn.jpg') no-repeat 0 0;
778
+    width: 82px;
779
+    height: 30px;
780
+    bottom: 0;
781
+    _bottom: -2px;
782
+    left: 15px;
783
+    text-align: center;
784
+    line-height: 32px;
785
+    font-weight: bold;
786
+    color: #333;
787
+}
788
+
789
+.wl_faces_content .title ul li.wl_faces_close {
790
+    right: 8px;
791
+    top: 15px;
792
+}
793
+
794
+.wl_faces_content .title ul li.wl_faces_close span {
795
+    background: url('http://jk.kuyicloud.com/static/plugins/tencentim/IMSDK_V1.7/img/icon.png') repeat-x 0 0;
796
+    cursor: pointer;
797
+    display: block;
798
+    width: 15px;
799
+    height: 15px;
800
+}
801
+
802
+.wl_faces_main {
803
+
804
+}
805
+
806
+.wl_faces_main ul {
807
+    margin: 12px 12px;
808
+    padding: 0px;
809
+    overflow: hidden;
810
+    border-top: 1px #CCC solid;
811
+    border-left: 1px #CCC solid;
812
+    list-style: none;
813
+    width: 393px;
814
+}
815
+
816
+.wl_faces_main ul li {
817
+    float: left;
818
+    border-right: 1px #CCC solid;
819
+    border-bottom: 1px #CCC solid;
820
+    height: 28px;
821
+    width: 28px;
822
+    margin: 0px 0px 0px 0px;
823
+    padding: 4px 2px;
824
+    text-align: center;
825
+}
826
+
827
+.wl_faces_main ul li img {
828
+    width: 24px;
829
+    height: 24px;
830
+}
831
+
832
+.wlf_icon {
833
+    background: url('http://jk.kuyicloud.com/static/plugins/tencentim/IMSDK_V1.7/img/layer_arrow.png') no-repeat 0 0;
834
+    position: absolute;
835
+    width: 22px;
836
+    height: 9px;
837
+    bottom: -4px;
838
+    _bottom: -11px;
839
+    left: 61px;
840
+}
841
+
842
+.msgedit {
843
+    width: 525px;
844
+    height: 100px;
845
+    border: 1px rgb(181, 178, 178) solid;
846
+    background: #f5f5f5;
847
+    padding: 6px 6px;
848
+    line-height: 1.5;
849
+}
850
+
851
+.sendbar {
852
+    width: 526px;
853
+    height: 30px;
854
+}
855
+
856
+.sendbtn {
857
+    float: right;
858
+    width: 80px;
859
+    margin-right: 10px;
860
+    font: 10px/1.5 "微软雅黑";
861
+}
862
+
863
+.closebtn {
864
+    float: right;
865
+    width: 80px;
866
+    margin-right: 10px;
867
+    font: 10px/1.5 "微软雅黑";
868
+}
869
+
870
+.bottom {
871
+    clear: both;
872
+    height: 3px;
873
+    background: #d7eaf3;
874
+}
875
+
876
+#demo_type_desc {
877
+    color: red;
878
+}
879
+
880
+#myself_type_desc {
881
+    display: none;
882
+    color: red;
883
+}
884
+
885
+#qcloudLink {
886
+    color: blue;
887
+}
888
+
889
+#sdkAppIdDiv {
890
+    display: none;
891
+}
892
+
893
+#accountTypeDiv {
894
+    display: none;
895
+}
896
+
897
+.pic_thumb {
898
+    width: 200px;
899
+    height: 200px;
900
+}
901
+
902
+
903
+
904
+.spinner {
905
+    width: 60px;
906
+    text-align: center;
907
+    position: absolute;
908
+    right: 10px;
909
+    top: 32px;
910
+    text-align: right;
911
+}
912
+
913
+.spinner > div {
914
+  width: 6px;
915
+  height: 6px;
916
+  background-color: #333;
917
+
918
+  border-radius: 100%;
919
+  display: inline-block;
920
+  -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
921
+  animation: sk-bouncedelay 1.4s infinite ease-in-out both;
922
+}
923
+
924
+.spinner .bounce1 {
925
+  -webkit-animation-delay: -0.32s;
926
+  animation-delay: -0.32s;
927
+}
928
+
929
+.spinner .bounce2 {
930
+  -webkit-animation-delay: -0.16s;
931
+  animation-delay: -0.16s;
932
+}
933
+
934
+@-webkit-keyframes sk-bouncedelay {
935
+  0%, 80%, 100% { -webkit-transform: scale(0) }
936
+  40% { -webkit-transform: scale(1.0) }
937
+}
938
+
939
+@keyframes sk-bouncedelay {
940
+  0%, 80%, 100% {
941
+    -webkit-transform: scale(0);
942
+    transform: scale(0);
943
+  } 40% {
944
+    -webkit-transform: scale(1.0);
945
+    transform: scale(1.0);
946
+  }
947
+}
948
+
949
+.headurlClass{
950
+    height: 30px;
951
+    width: 30px;
952
+    border-radius: 50%;
953
+}
954
+
955
+.delChat{
956
+    color: red;
957
+    width: 50px;
958
+    padding: 16px 0;
959
+    float: right;
960
+    margin-right: 5px;
961
+}
962
+figure {
963
+  margin: 0;
964
+}
965
+</style>

+ 1 - 1
src/scrm_pages/marketing_tool/activity_list.vue Zobrazit soubor

@@ -88,7 +88,7 @@ export default {
88 88
 
89 89
     getActivities() {
90 90
       this.loading_activities = true
91
-      fetchActivities(this.current_page, this.keyword, this.selecting_status).then(rs => {
91
+      fetchActivities(this.current_page, this.keyword,this.selecting_status).then(rs => {
92 92
         this.loading_activities = false
93 93
         var resp = rs.data
94 94
         if (resp.state == 1) {

+ 1 - 0
src/scrm_pages/members/members.vue Zobrazit soubor

@@ -222,6 +222,7 @@
222 222
                     this.total = res.data.total;
223 223
                     if(typeof(res.data.cards) != 'undefined') {
224 224
                         this.levelCards = res.data.cards;
225
+                        console.log("levelCard是什么",levelCards)
225 226
                     }
226 227
                     if(typeof(res.data.tags) != 'undefined') {
227 228
                         this.tagOptions = res.data.tags;

+ 292 - 0
src/scrm_pages/systemsetting/components/CreateStaffForm.vue Zobrazit soubor

@@ -0,0 +1,292 @@
1
+<template>
2
+        <div id="create-staff-form-box">
3
+        <el-dialog
4
+              title="添加会员"
5
+              :visible.sync="centerDialogVisible"
6
+              width="50%"
7
+              center>
8
+              <el-form label-width="100px" class="clearfix" :model="form" ref="staffform" :rules="staffrules">
9
+                 <el-row>
10
+                   <el-col :span="12">
11
+                      <el-form-item label="姓名:"  required prop="name">
12
+                           <el-input placeholder="请输入姓名" v-model="form.name">
13
+
14
+                           </el-input>
15
+                      </el-form-item>
16
+                   </el-col>
17
+                   <el-col :span="12">
18
+                     <el-form-item label="手机号:" required prop="phone">
19
+                       <el-input placeholder="请输入手机号" v-model="form.phone">
20
+
21
+                       </el-input>
22
+                     </el-form-item>
23
+                   </el-col>
24
+                 </el-row>
25
+                <el-row>
26
+                   <el-col :span="12">
27
+                       <el-form-item label="性别:" required prop="gender">
28
+                           <el-radio-group v-model="form.gender" @change="selectGender">
29
+                                <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in genderOptions" :key="index">{{gender.name}}</el-radio>
30
+                            </el-radio-group>
31
+                       </el-form-item>
32
+                   </el-col>
33
+                  <el-col :span="12">
34
+                    <el-form-item label="生日:" required prop="birthday">
35
+                          <el-date-picker v-model="form.birthday"  prefix-icon="el-icon-date" :editable="false" style="width: 100%;" type="date" placeholder="请选择日期" align="right" format="yyyy-MM-dd" value-format="yyyy-MM-dd" ></el-date-picker>
36
+                    </el-form-item>
37
+                  </el-col>
38
+                </el-row>
39
+                <el-row>
40
+                    <el-col :span="8">
41
+                        <el-form-item label="员工职称:" required prop="user_type">
42
+                          <template>
43
+                            <el-select v-model="form.user_type" placeholder="请选择">
44
+                             <el-option
45
+                                v-for="item in user_types"
46
+                                :key="item.index"
47
+                                :label="item.name"
48
+                                :value="item.index">
49
+                             </el-option>
50
+                            </el-select>
51
+                          </template>
52
+                        </el-form-item>
53
+                    </el-col>
54
+
55
+                  <el-col :span="6">
56
+                      <template>
57
+                        <el-select v-model="form.user_title"  placeholder="请选择">
58
+                          <el-option
59
+                            v-for="item in user_titles"
60
+                            :key="item.index"
61
+                            :label="item.name"
62
+                            :value="item.index">
63
+                          </el-option>
64
+                        </el-select>
65
+                      </template>
66
+                  </el-col>
67
+                  <el-col :span="4">
68
+                      <el-form-item label="医生头像:" required prop="dochead">
69
+                        <el-upload
70
+                          class="avatar-uploader"
71
+                          action="https://upload.qiniup.com"
72
+                          :show-file-list="false"
73
+                          :on-success="handleAvatarSuccess"
74
+                          :before-upload="beforeAvatarUpload"
75
+                          :on-error="handleAvatarError"
76
+                          :data="uploadData">
77
+                          <img v-if="form.dochead" :src="form.dochead" class="avatar">
78
+                          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
79
+                        </el-upload>
80
+                      </el-form-item>
81
+                    </el-col>
82
+                </el-row>
83
+                 <el-row>
84
+                     <el-col :span="24">
85
+                         <el-form-item label="医生简介:" required prop="content">
86
+                           <keep-alive>
87
+                             <neditor ref="neditor"
88
+                                      id="editor"
89
+                                      v-bind:r_content="form.content">
90
+                             </neditor>
91
+                           </keep-alive>
92
+                         </el-form-item>
93
+                     </el-col>
94
+                 </el-row>
95
+              </el-form>
96
+              <span slot="footer" class="dialog-footer">
97
+              <el-button @click="centerDialogVisible = false">取 消</el-button>
98
+              <el-button type="primary" @click="addStaffInfo('staffform');">保存</el-button>
99
+               </span>
100
+          </el-dialog>
101
+         </div>
102
+</template>
103
+
104
+<script>
105
+      import Neditor from '@/components/Neditor'
106
+      import {addStaffInfo} from '@/api/act/staffmanager'
107
+      import {getToken} from '@/api/qiniu'
108
+      import {getFileExtension,checkMobile,uParseTime} from '@/utils/tools'
109
+    export default {
110
+        name: "CreateStaffForm",
111
+         components:{
112
+           Neditor,
113
+       },
114
+      props:{
115
+        staffsData:{
116
+         type: Array,
117
+         default: function () {
118
+          return [];
119
+        }
120
+        }
121
+     },
122
+       data(){
123
+          var checkMobileRule = (rule, value, callback) => {
124
+            if (!checkMobile(value)) {
125
+            callback(new Error('请填写正确的手机号'));
126
+              }else {
127
+               callback();
128
+             }
129
+          };
130
+   
131
+           return {
132
+                crumbs: [
133
+          { path: false, name: '系统设置' },
134
+          { path: '/Systemsetting/staffmanagement', name: '员工管理' }
135
+        ],
136
+         centerDialogVisible: false,
137
+          radio: '1',
138
+          value: '',
139
+          qiniuDomain: 'https://images.shengws.com/',
140
+          uploadData: { token: '', key: '' },
141
+         user_types: [
142
+            { index: 2, name: '医生' },
143
+            { index: 3, name: '护士' },
144
+            { index: 4, name: '运营' },
145
+            ],
146
+        user_titles: [
147
+            { index: 1, name: '医士' },
148
+            { index: 2, name: '医师' },
149
+            { index: 3, name: '住院医师' },
150
+            { index: 4, name: '主治医师' },
151
+            { index: 5, name: '副主任医师' },
152
+            { index: 6, name: '主任医师' },
153
+            { index: 7, name: '护士' },
154
+            { index: 8, name: '护师' },
155
+            { index: 9, name: '主管护师' },
156
+            { index: 10, name: '副主任护师' },
157
+            { index: 11, name: '主任护师' },
158
+            { index: 12, name: '运营专员' },
159
+            { index: 13, name: '运营主管' },
160
+            ],
161
+        imageUrl: '',
162
+
163
+        form:{
164
+          name:'',
165
+          phone:'',
166
+          birthday:'',
167
+          gender:'',
168
+          user_type:'',
169
+          user_title:'',
170
+          dochead:'',
171
+          page:1,
172
+          limit:10,
173
+          content:'',
174
+        },
175
+         keyword:'',
176
+        staffform:[],
177
+         staffrules:{
178
+            name: [{required: true, message: "姓名不能为空"},],
179
+            phone: [{required: true,message:"手机号码不能为空"},{validator:checkMobileRule}],
180
+            birthday: [{required: true,message:"生日不能为空"}],
181
+            gender: [{required: true,message:"性别不能为空"}],
182
+            user_type: [{required: true,message:"职称类别不能为空"}],
183
+            user_title: [{required: true,message:"职称不能为空"}],
184
+            content: [{required: true,message:"医生简介不能为空"}],
185
+            dochead: [{required: true,message:"头像不能为空"}],
186
+        },
187
+         genderOptions:[
188
+          {id:1, name:'男'},
189
+          {id:2, name:'女'},
190
+         ],
191
+         staffData:[],
192
+          }
193
+           },
194
+          methods:{
195
+            open:function(){
196
+            this.centerDialogVisible = true;
197
+            },
198
+            resetForm(formName) {
199
+               if (typeof(this.$refs[formName]) !='undefined') {
200
+                this.$refs[formName].resetFields();
201
+                }
202
+              },
203
+            handleAvatarSuccess(res, file) {
204
+              this.form.dochead =  this.qiniuDomain + res.url;
205
+              },
206
+             beforeAvatarUpload(file) {
207
+              const isJPG = file.type === 'image/jpeg';
208
+              console.log("是什么呢",isJPG)
209
+              const isLt2M = file.size / 1024 / 1024 < 2;
210
+             if (!isJPG) {
211
+              this.$message.error('上传头像图片只能是JPG或者png格式!');
212
+            }
213
+            if (!isLt2M) {
214
+              this.$message.error('上传头像图片大小不能超过 2MB!');
215
+            }
216
+
217
+             var date = new Date()
218
+             var ext = getFileExtension(file.name)
219
+             var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
220
+             this.uploading = true;
221
+             this.loadingText = '封面图片上传中'
222
+             const _self = this
223
+            return new Promise((resolve, reject) => {
224
+            getToken().then(response => {
225
+            const token = response.data.data.uptoken
226
+            console.log("token是什么?",token)
227
+            _self._data.uploadData.token = token
228
+             _self._data.uploadData.key = key
229
+               resolve(true)
230
+              }).catch(err => {
231
+                reject(false)
232
+                })
233
+               })
234
+              },
235
+          selectGender:function(gender) {
236
+            if(gender == 2) {
237
+             this.form.avatar = 'https://images.shengws.com/201809182128222.png';
238
+            }else {
239
+              this.form.avatar = 'https://images.shengws.com/201809182128111.png';
240
+            }
241
+          },
242
+             handleAvatarError(err, file, fileList) {
243
+               this.$message.error(err);
244
+               return false
245
+              },
246
+
247
+                addStaffInfo(forName){
248
+                this.form.content = this.$refs.neditor.content;
249
+                console.log("文章内容",this.$refs.neditor.content)
250
+                this.$refs[forName].validate((valid)=>{
251
+                 if(valid){
252
+                addStaffInfo(this.form).then(response=>{
253
+                 if(response.data.state ==1){
254
+                    var staffInfo = response.data.data.staffInfo
255
+                    this.centerDialogVisible=false;
256
+                    this.staffsData.unshift(staffInfo);
257
+                    this.resetForm("staffform");
258
+                    this.$message.success("保存成功");     
259
+                 }
260
+               })
261
+              }
262
+             })
263
+            },
264
+          }
265
+       }
266
+</script>
267
+
268
+<style scoped>
269
+     .avatar-uploader{
270
+      border: 1px dashed  #d9d9d9;
271
+      border-radius: 1px;
272
+      cursor: pointer;
273
+      position: relative;
274
+      overflow: hidden;
275
+    }
276
+    .avatar-uploader{
277
+      border-color: #d9d9d9;
278
+    }
279
+    .avatar-uploader-icon {
280
+      font-size: 20px;
281
+      color: #8c939d;
282
+      width: 44px;
283
+      height: 50px;
284
+      line-height: 50px;
285
+      text-align: center;
286
+    }
287
+    .avatar {
288
+      width: 68px;
289
+      height: 50px;
290
+      display: block;
291
+    }
292
+</style>

+ 122 - 171
src/scrm_pages/systemsetting/staffmanagement.vue Zobrazit soubor

@@ -2,49 +2,58 @@
2 2
   <div class="main-contain">
3 3
     <div class="position">
4 4
       <bread-crumb :crumbs='crumbs'></bread-crumb>
5
-       <el-button  style="float:right;" type="primary" size="small" icon="el-icon-circle-plus-outline" @click="centerDialogVisible = true" >添加员工</el-button>
5
+       <el-button  style="float:right;" type="primary" size="small" icon="el-icon-circle-plus-outline" @click="openCreate()" >添加员工</el-button>
6 6
     </div>
7 7
     <div class="app-container">
8 8
          <div>
9 9
              <el-row :gutter="24">
10 10
                 <el-col :span="8">
11
-                  <el-input style="width: 300px"  placeholder="请输入您需要搜索的内容"></el-input>
12
-                  <el-button type="primary"  icon="el-icon-search" @click="changeKey">搜索</el-button>
11
+                  <el-input style="width: 300px" v-model="keyword"  placeholder="请输入您需要搜索的内容"></el-input>
12
+                  <el-button type="primary"  icon="el-icon-search" @click="changeKey()">搜索</el-button>
13 13
                 </el-col>
14 14
              </el-row>
15 15
          </div>
16 16
          <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
17
-            <el-checkbox style="width: 30px" v-model="checked" @change="changeAllSelected">全选</el-checkbox>
18
-            <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
17
+            <el-checkbox style="width: 30px">全选</el-checkbox>
18
+            <el-button size="small" icon="el-icon-delete" @click="">删除</el-button>
19 19
           </div>
20
-              <el-table ref="multipleTable" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="tableData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;">
20
+              <el-table ref="multipleTable" 
21
+              :header-cell-style="{ backgroundColor: 
22
+              'rgb(245, 247, 250)'}" 
23
+              :data="staffData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;">
21 24
               <el-table-column
22 25
                 type="selection"
23 26
                 width="55">
24 27
               </el-table-column>
25 28
               <el-table-column label="员工" align="center">
26 29
                <template slot-scope="scope">
27
-
30
+                  <div style="display:flex;align-items: center;">
31
+                   <img :src="staffAvatar(scope.row)" alt="" srcset="" style="width:50px;height:50px; border-radius:50%;margin-right:5px;" >
32
+                    <div>
33
+                     <span>{{scope.row.name}}</span>
34
+                    </div>
35
+                 </div>
36
+                  <!-- {{scope.row.name}} -->
28 37
                </template>
29 38
              </el-table-column>
30
-            <el-table-column label="职称" align="center">
39
+            <el-table-column label="职称" align="center" >
31 40
               <template slot-scope="scope">
32
-
41
+                   {{staffTitle(scope.row.user_title)}}
33 42
               </template>
34 43
             </el-table-column>
35 44
             <el-table-column label="介绍" align="center">
36 45
               <template slot-scope="scope">
37
-
46
+                 <li v-html="scope.row.content"></li>
38 47
               </template>
39 48
             </el-table-column>
40 49
             <el-table-column label="手机号" align="center">
41 50
               <template slot-scope="scope">
42
-
51
+                 {{scope.row.phone}}
43 52
               </template>
44 53
             </el-table-column>
45 54
             <el-table-column label="创建时间" align="center">
46 55
               <template slot-scope="scope">
47
-
56
+                {{staffCreateTime(scope.row.ctime)}}
48 57
               </template>
49 58
             </el-table-column>
50 59
             <el-table-column label="操作" align="center">
@@ -70,107 +79,8 @@
70 79
             layout="total, sizes, prev, pager, next, jumper"
71 80
             :total="total">
72 81
           </el-pagination>
73
-
74
-          <el-dialog
75
-              title="添加会员"
76
-              :visible.sync="centerDialogVisible"
77
-              width="50%"
78
-              center>
79
-              <el-form label-width="80px" class="clearfix" :model="form" ref="form">
80
-                 <el-row>
81
-                   <el-col :span="12">
82
-                      <el-form-item label="姓名:">
83
-                           <el-input placeholder="请输入姓名">
84
-
85
-                           </el-input>
86
-                      </el-form-item>
87
-                   </el-col>
88
-                   <el-col :span="12">
89
-                     <el-form-item label="手机号:">
90
-                       <el-input placeholder="请输入手机号">
91
-
92
-                       </el-input>
93
-                     </el-form-item>
94
-                   </el-col>
95
-                 </el-row>
96
-                <el-row>
97
-                   <el-col :span="12">
98
-                       <el-form-item label="性别:">
99
-                         <el-radio v-model="radio" label="1">男</el-radio>
100
-                         <el-radio v-model="radio" label="2">女</el-radio>
101
-                       </el-form-item>
102
-                   </el-col>
103
-                  <el-col :span="12">
104
-                    <el-form-item label="生日:">
105
-                          <el-time-select
106
-                            v-model="value"
107
-                            :picker-options="{
108
-                              start: '08:30',
109
-                              step: '00:15',
110
-                              end: '18:30'}"
111
-                            placeholder="选择时间">
112
-                        </el-time-select>
113
-                    </el-form-item>
114
-                  </el-col>
115
-                </el-row>
116
-                <el-row>
117
-                    <el-col :span="8">
118
-                        <el-form-item label="员工职称:">
119
-                          <template>
120
-                            <el-select v-model="value1" multiple placeholder="请选择">
121
-                              <el-option
122
-                                v-for="item in options"
123
-                                :key="item.value"
124
-                                :label="item.label"
125
-                                :value="item.value">
126
-                              </el-option>
127
-                            </el-select>
128
-                          </template>
129
-                        </el-form-item>
130
-                    </el-col>
131
-                  <el-col :span="6">
132
-                      <template>
133
-                        <el-select v-model="value2" multiple placeholder="请选择">
134
-                          <el-option
135
-                            v-for="item in options"
136
-                            :key="item.value"
137
-                            :label="item.label"
138
-                            :value="item.value">
139
-                          </el-option>
140
-                        </el-select>
141
-                      </template>
142
-                  </el-col>
143
-                  <el-col :span="4">
144
-                      <el-form-item label="医生头像:">
145
-                        <el-upload
146
-                          class="avatar-uploader"
147
-                          action="https://jsonplaceholder.typicode.com/posts/"
148
-                          :show-file-list="false"
149
-                          :on-success="handleAvatarSuccess"
150
-                          :before-upload="beforeAvatarUpload">
151
-                          <img v-if="imageUrl" :src="imageUrl" class="avatar">
152
-                          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
153
-                        </el-upload>
154
-                      </el-form-item>
155
-                    </el-col>
156
-                </el-row>
157
-                 <el-row>
158
-                     <el-col :span="24">
159
-                         <el-form-item label="医生简介:">
160
-                           <keep-alive>
161
-                             <neditor ref="neditor"
162
-                                      id="editor">
163
-                             </neditor>
164
-                           </keep-alive>
165
-                         </el-form-item>
166
-                     </el-col>
167
-                 </el-row>
168
-              </el-form>
169
-              <span slot="footer" class="dialog-footer">
170
-              <el-button @click="centerDialogVisible = false">取 消</el-button>
171
-              <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
172
-               </span>
173
-          </el-dialog>
82
+            <!-- 添加员工 -->
83
+          <create-staff-form ref="createStaffForm" :staffsData="staffsData"></create-staff-form>
174 84
 
175 85
     </div>
176 86
   </div>
@@ -178,12 +88,15 @@
178 88
 
179 89
 <script>
180 90
   import BreadCrumb from '../components/bread-crumb'
181
-  import Neditor from '@/components/Neditor'
91
+  import {getAllStaffInfo} from '@/api/act/staffmanager'
92
+  import {getToken} from '@/api/qiniu'
93
+  import {getFileExtension,uParseTime} from '@/utils/tools'
94
+  import CreateStaffForm from "./components/CreateStaffForm";
182 95
   export default {
183 96
     name: 'articleComment',
184 97
     components:{
185 98
       BreadCrumb,
186
-      Neditor,
99
+      CreateStaffForm,
187 100
     },
188 101
     data(){
189 102
       return{
@@ -194,69 +107,107 @@
194 107
          centerDialogVisible: false,
195 108
           radio: '1',
196 109
           value: '',
197
-          options: [{
198
-          value: '选项1',
199
-          label: '黄金糕'
200
-        }, {
201
-          value: '选项2',
202
-          label: '双皮奶'
203
-        }, {
204
-          value: '选项3',
205
-          label: '蚵仔煎'
206
-        }, {
207
-          value: '选项4',
208
-          label: '龙须面'
209
-        }, {
210
-          value: '选项5',
211
-          label: '北京烤鸭'
212
-        }],
213
-        value1: [],
214
-        value2: [],
215
-        imageUrl: ''
110
+          qiniuDomain: 'https://images.shengws.com/',
111
+          uploadData: { token: '', key: '' },
112
+         user_types: [
113
+            { index: 2, name: '医生' },
114
+            { index: 3, name: '护士' },
115
+            { index: 4, name: '运营' },
116
+            ],
117
+        user_titles: [
118
+            { index: 1, name: '医士' },
119
+            { index: 2, name: '医师' },
120
+            { index: 3, name: '住院医师' },
121
+            { index: 4, name: '主治医师' },
122
+            { index: 5, name: '副主任医师' },
123
+            { index: 6, name: '主任医师' },
124
+            { index: 7, name: '护士' },
125
+            { index: 8, name: '护师' },
126
+            { index: 9, name: '主管护师' },
127
+            { index: 10, name: '副主任护师' },
128
+            { index: 11, name: '主任护师' },
129
+            { index: 12, name: '运营专员' },
130
+            { index: 13, name: '运营主管' },
131
+            ],
132
+        imageUrl: '',
133
+        staffsData:[],
134
+        form:{
135
+          name:'',
136
+          phone:'',
137
+          birthday:'',
138
+          gender:'',
139
+          user_type:'',
140
+          user_title:'',
141
+          dochead:'',
142
+          page:1,
143
+          limit:10,
144
+          content:'',
145
+        },
146
+         total:0,
147
+         keyword:'',
148
+        staffform:[],
149
+         staffData:[],
216 150
       }
217 151
     },
218 152
     methods: {
219
-      handleAvatarSuccess(res, file) {
220
-        this.imageUrl = URL.createObjectURL(file.raw);
153
+      openCreate(){
154
+           this.$refs.createStaffForm.open();
155
+        },
156
+        staffAvatar(row) {
157
+          if(typeof(row.avatar) == "undefined" || !row.avatar || row.avatar.length==0) {
158
+              if(row.gender == 2) {
159
+             return 'https://images.shengws.com/201809182128222.png';
160
+              }else {
161
+                return 'https://images.shengws.com/201809182128111.png';
162
+              }
163
+           }else {
164
+             return row.avatar
165
+          }
166
+        },
167
+        handleSelectionChange(val){
168
+           this.selectedArticles = val;
169
+        },
170
+        handleSizeChange(limit) {
171
+            this.from.limit = limit;
172
+            this.getAllStaffInfo();
173
+          },
174
+        handleCurrentChange(page) {
175
+         this.form.page = page;
176
+          this.getAllStaffInfo();
177
+        },
178
+        getAllStaffInfo(){
179
+          getAllStaffInfo(this.form,this.keyword).then(response=>{
180
+            if(response.data.state ==1){
181
+              this.staffData = response.data.data.userStaffInfo;
182
+              console.log("数据",this.staffData)
183
+              this.total = response.data.data.total;
184
+              console.log("总页数",this.total)
185
+           }
186
+         })
221 187
       },
222
-      beforeAvatarUpload(file) {
223
-        const isJPG = file.type === 'image/jpeg';
224
-        const isLt2M = file.size / 1024 / 1024 < 2;
188
+        staffCreateTime(time) {
189
+          return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
190
+        },
191
+        staffTitle(title){
192
+            if(title == 1){
193
+              return "医士";
194
+            }else if(title == 2){
195
+                return "医师";
196
+            }else if(title == 3){
197
+                return "住院医师";
198
+            }
225 199
 
226
-        if (!isJPG) {
227
-          this.$message.error('上传头像图片只能是 JPG 格式!');
228
-        }
229
-        if (!isLt2M) {
230
-          this.$message.error('上传头像图片大小不能超过 2MB!');
231
-        }
232
-        return isJPG && isLt2M;
233
-      }
234
-    }
200
+        },     
201
+          changeKey(){
202
+          this.getAllStaffInfo()
203
+         },
204
+    },
205
+    created(){
206
+      this.getAllStaffInfo();
207
+     }
235 208
   }
236 209
 </script>
237 210
 
238 211
 <style scoped>
239
-    .avatar-uploader{
240
-      border: 1px solid #d9d9d9;
241
-      border-radius: 1px;
242
-      cursor: pointer;
243
-      position: relative;
244
-      overflow: hidden;
245
-    }
246
-    .avatar-uploader{
247
-      border-color: #d9d9d9;
248
-    }
249
-    .avatar-uploader-icon {
250
-      font-size: 20px;
251
-      color: #8c939d;
252
-      width: 65px;
253
-      height: 50px;
254
-      line-height: 50px;
255
-      text-align: center;
256
-    }
257
-    .avatar {
258
-      width: 50px;
259
-      height: 50px;
260
-      display: block;
261
-    }
212
+
262 213
 </style>

binární
static/images/a.jpg Zobrazit soubor


Diff nebyl zobrazen, protože je příliš veliký
+ 8282 - 0
static/webim.js