哥哥玩剑魂呢 il y a 3 ans
Parent
commit
50e795ded2
100 fichiers modifiés avec 2021 ajouts et 11880 suppressions
  1. 8 0
      css/reset.css
  2. 2 204
      src/App.vue
  3. 1 11
      src/api/configget.js
  4. 0 36
      src/api/login.js
  5. 0 21
      src/api/reg.js
  6. 0 201
      src/components/about/about.vue
  7. 0 229
      src/components/about/version.vue
  8. 0 59
      src/components/about/version_info.vue
  9. 0 49
      src/components/attendance/data/chart.vue
  10. 0 50
      src/components/attendance/data_com.vue
  11. 0 139
      src/components/attendance/index.vue
  12. 0 796
      src/components/attendance/push_card.vue
  13. 0 14
      src/components/attendance/remedy.vue
  14. 0 31
      src/components/attendance/setting.vue
  15. 18 64
      src/components/body/department.vue
  16. 0 436
      src/components/body/management.vue
  17. 0 439
      src/components/body/message_list.vue
  18. 285 36
      src/components/body/statistics.vue
  19. 2 12
      src/components/body/user_center.vue
  20. 3 408
      src/components/body/work.vue
  21. 0 287
      src/components/chat/index.vue
  22. 0 307
      src/components/chat/index_v.vue
  23. 0 52
      src/components/chat/user_list.vue
  24. 2 2
      src/components/common/DateSelectorDropdown.vue
  25. 2 2
      src/components/common/DeptSelectorCell.vue
  26. 930 0
      src/components/common/EmployeeSelector copy.vue
  27. 262 283
      src/components/common/EmployeeSelector.vue
  28. 5 5
      src/components/common/RuleCategorySelector1.vue
  29. 2 1
      src/components/common/TabsList.vue
  30. 0 329
      src/components/common/coreDialog.vue
  31. 3 1
      src/components/common/integralApplyItem.vue
  32. 9 2
      src/components/common/user_image.vue
  33. 0 1
      src/components/create_company.vue
  34. 0 199
      src/components/data_mange/bulletin_welfare.vue
  35. 0 196
      src/components/data_mange/bulletin_welfare_detail.vue
  36. 0 170
      src/components/data_mange/publish_bulletin_welfare.vue
  37. 0 142
      src/components/demo/form.vue
  38. 0 148
      src/components/demo/message_detail.vue
  39. 0 294
      src/components/ems/company_list.vue
  40. 0 176
      src/components/ems/invite_newbusiness.vue
  41. 0 102
      src/components/ems/login_company_list.vue
  42. 0 437
      src/components/ems/registration_experience.vue
  43. 0 1
      src/components/help.vue
  44. 7 3
      src/components/integral/application_popup/integral.vue
  45. 8 2
      src/components/integral/approval_detail.vue
  46. 5 5
      src/components/integral/approval_list.vue
  47. 15 7
      src/components/integral/batchList.vue
  48. 7 7
      src/components/integral/callback.vue
  49. 1 1
      src/components/integral/callback_new.vue
  50. 42 3
      src/components/integral/event_detail.vue
  51. 2 2
      src/components/integral/event_list.vue
  52. 2 2
      src/components/integral/integral_application_list.vue
  53. 12 3
      src/components/integral/integral_entry_b.vue
  54. 4 2
      src/components/integral/integral_entry_list.vue
  55. 27 2
      src/components/integral/integral_entry_n.vue
  56. 2 1
      src/components/integral/integral_rank.vue
  57. 1 1
      src/components/integral/rankB.vue
  58. 6 7
      src/components/integral/rule_category.vue
  59. 1 1
      src/components/integral/statistics_personal.vue
  60. 9 4
      src/components/integral/team_data.vue
  61. 0 412
      src/components/message_detail.vue
  62. 1 1
      src/components/pk/pk_ranking.vue
  63. 9 8
      src/components/power/edit_user_power.vue
  64. 3 3
      src/components/task/compile_temp_task.vue
  65. 3 3
      src/components/task/my_publish.vue
  66. 3 3
      src/components/task/my_task.vue
  67. 1 1
      src/components/task/task_detail.vue
  68. 2 2
      src/components/task/task_hall.vue
  69. 2 2
      src/components/task/temp_task.vue
  70. 2 2
      src/components/task/temp_task_edit.vue
  71. 0 176
      src/components/user/account.vue
  72. 40 5
      src/components/user/add_common_menu.vue
  73. 0 285
      src/components/user/bind_weixin.vue
  74. 0 303
      src/components/user/change_phone.vue
  75. 0 289
      src/components/user/change_pwd.vue
  76. 0 377
      src/components/user/change_role.vue
  77. 0 109
      src/components/user/comment.vue
  78. 0 452
      src/components/user/forget_pwd.vue
  79. 35 28
      src/components/user/index.vue
  80. 0 574
      src/components/user/invite_reg.vue
  81. 0 424
      src/components/user/join.vue
  82. 0 575
      src/components/user/login.vue
  83. 0 1
      src/components/user/login1.vue
  84. 0 1
      src/components/user/login2.vue
  85. 16 8
      src/components/user/login3.vue
  86. 0 562
      src/components/user/reg.vue
  87. 0 278
      src/components/user/user_reg.vue
  88. 0 95
      src/components/user/username_edit.vue
  89. 2 1
      src/main.js
  90. 22 30
      src/permission.js
  91. 114 0
      src/permissionbf.js
  92. 5 26
      src/router/index.js
  93. 11 111
      src/store/modules/user.js
  94. 13 0
      src/utils/auth.js
  95. 46 23
      src/utils/request.js
  96. 3 0
      src/utils/wx-auth-two.js
  97. 0 113
      src/view/android.vue
  98. 0 55
      src/view/guide.vue
  99. 0 80
      src/view/index.vue
  100. 3 37
      src/view/init.vue

+ 8 - 0
css/reset.css

@@ -410,3 +410,11 @@ body .van-search{padding:0.2rem 0.32rem;}
   -webkit-line-clamp: 2;
   -webkit-box-orient: vertical;
 }
+
+/* scitch修改颜色 */
+.switchall .van-switch__node{
+  transition: all .2s !important;
+}
+.scitchBlue .van-switch__node{
+  background-color:#1989fa !important;
+}

+ 2 - 204
src/App.vue

@@ -37,7 +37,6 @@ import Vue from 'vue'
 import VcKeepAlive from 'vc-keep-alive'
 import Echo from 'laravel-echo'
 import VcKeepAliveUpdateMixin from '@/utils/keep-alive-update'
-import request_user from '@/utils/request-user'
 import request from '@/utils/request'
 import moment from 'moment'
 
@@ -79,118 +78,6 @@ export default {
     }
   },
   methods: {
-    // 实现移动端拖拽
-    // down () {
-    //   this.flags = true
-    //   var touch
-    //   if (event.touches) {
-    //     touch = event.touches[0]
-    //   } else {
-    //     touch = event
-    //   }
-    //   this.position.x = touch.clientX
-    //   this.position.y = touch.clientY
-    //   this.dx = moveDiv.offsetLeft
-    //   this.dy = moveDiv.offsetTop
-    // },
-    // move () {
-    //   if (this.flags) {
-    //     var touch
-    //     if (event.touches) {
-    //       touch = event.touches[0]
-    //     } else {
-    //       touch = event
-    //     }
-    //     this.nx = touch.clientX - this.position.x
-    //     this.ny = touch.clientY - this.position.y
-    //     this.xPum = this.dx + this.nx
-    //     this.yPum = this.dy + this.ny
-    //     moveDiv.style.left = this.xPum + 'px'
-    //     moveDiv.style.top = this.yPum + 'px'
-    //     // 阻止页面的滑动默认事件;如果碰到滑动问题,1.2 请注意是否获取到 touchmove
-    //     document.addEventListener(
-    //       'touchmove',
-    //       function () {
-    //         event.preventDefault()
-    //       },
-    //       false
-    //     )
-    //   }
-    // },
-    // 鼠标释放时候的函数
-    // end () {
-    //   this.flags = false
-    // },
-    // downWgt (wgtUrl) {
-    //   let self = this
-    //   if (!window.plus) {
-    //     return false
-    //   }
-    //   plus.downloader
-    //     .createDownload(wgtUrl, { filename: '_doc/update/' }, function (d, status) {
-    //       if (status == 200) {
-    //         self.installWgt(d.filename)
-    //       } else {
-    //         self.$toast.clear()
-    //       }
-    //     })
-    //     .start()
-    // },
-    // installWgt (path) {
-    //   if (!window.plus) {
-    //     return false
-    //   }
-    //   this.$toast.clear()
-    //   plus.runtime.install(
-    //     path,
-    //     { force: true },
-    //     function () {
-    //       // plus.runtime.restart()
-    //     },
-    //     function (e) {
-    //       // plus.runtime.restart()
-    //     }
-    //   )
-    // },
-    // 检查更新
-    // get_ver () {
-    //   let self = this
-    //   if (!window.plus) {
-    //     return false
-    //   }
-    //   plus.runtime.getProperty(plus.runtime.appid, function (inf) {
-    //     wgtVer = inf.version
-    //     if (!localStorage.getItem('a-token-temp')) {
-    //       return false
-    //     }
-    //     if (plus.webview.currentWebview().id != plus.runtime.appid) {
-    //       return false
-    //     }
-    //     request_user('post', '/api/version/check', { version: wgtVer.toString() }).then(res => {
-    //       self.info = res.data.data
-    //       localStorage.setItem('Admin-Token', res.data.refresh_token)// 避免退出登录
-    //       // console.log('更新信息...................')
-    //       // console.log(wgtVer.toString())
-    //       // console.log(JSON.stringify(res.data.data))
-
-    //       if (res.data.code == 1) {
-    //         if (!res.data.data.status) {
-    //           // self.$dialog.confirm({
-    //           //   title: '发现新版本' + res.data.data.new_version.version,
-    //           //   message: '确定要更新吗?(更新完成将自动重启)'
-    //           // }).then(() => {
-    //           //   self.$toast.loading({
-    //           //     mask: true,
-    //           //     type: 'loading',
-    //           //     message: '更新中...'
-    //           //   })
-    //           self.downWgt(res.data.data.new_version.app_path)
-    //           // })
-    //         }
-    //       }
-    //     })
-    //   })
-    // },
     update_components () {
       if (window.plus) {
         let all_view = plus.webview.all()
@@ -212,23 +99,6 @@ export default {
         this.$store.dispatch('clear_cache')
       }
     },
-    // login2 (site_id, callback) {
-    //   let self = this
-    //   self.$toast.loading({
-    //     mask: false,
-    //     message: '正在切换组织'
-    //   })
-    //   request_user('post', '/api/employee-login', { site_id: site_id }).then(res => {
-    //     self.$toast.clear()
-    //     if (res.data.code == 1) {
-    //       self.$store.dispatch('clear_cache')
-    //       setToken(res.data.data.token)
-    //       callback()
-    //     } else {
-    //       self.$toast(res.data.msg)
-    //     }
-    //   })
-    // },
     create_params (p) {
       let ret = []
       for (let i in p) {
@@ -440,79 +310,7 @@ export default {
         this.$keep_alive_update('update_msgInformation', e)
         this.update_components()
       })
-
-      // echo.channel('integral:employee:' + this.$store.getters.user_info.id).listen('.server.msgTask', (e) => { // 通知前端任务消息有更新
-      //   this.$keep_alive_update('update_msgInformation', e)
-      //   this.update_components()
-      // })
-
-      // // 更新公司
-      // echo.channel('integral:site:' + this.$store.getters.user_info.site_id).listen('.server.siteEmployee', (e) => {
-      //   this.flush_cache()
-      // })
     },
-    // get_site_list () {
-    //   request_user('get', '/api/account/site').then(res => {
-    //     if (res.data.code === 1) {
-    //       if (res.data.data !== null && res.data.data.length && res.data.data.length != 0) {
-    //         this.$dialog.alert({ message: '您已成功加入' + res.data.data[0].site.name }).then(() => {
-    //           window.plus ? plus.storage.removeItem('user_info') : localStorage.removeItem('user_info')
-    //           this.login(res.data.data[0].site.id)
-    //         })
-    //       } else {
-    //         setTimeout(() => {
-    //           this.get_site_list()
-    //         }, 10000)
-    //       }
-    //     }
-    //   })
-    // },
-    // login (id) {
-    //   let self = this
-    //   self.$toast.loading({ mask: false, message: '正在登录' })
-    //   request_user('post', '/api/employee-login', { site_id: id })
-    //     .then(res => {
-    //       if (res.data.code === 1) {
-    //         this.$store.dispatch('clear_cache')
-    //         setToken(res.data.data.token)
-    //         this.$store.dispatch('get_user_info', getToken())
-    //         this.$keep_alive_update('update_message_list', {}) // 列新消息列表的数据
-    //         window.sessionStorage.setItem('__VCKEEPALIVE__', JSON.stringify(['/']))
-    //         window.sessionStorage.setItem('routers', '/')
-    //         window.location.href = window.location.href.split('#')[0]
-    //         window.location.reload()
-    //       } else {
-    //         this.$toast(res.data.msg)
-    //       }
-    //     })
-    //     .finally(() => this.$toast.clear())
-    // },
-    // applyBuyButton () {
-    //   this.buyPopupPage = true
-    // },
-    // getItemBuyPopupPage () {
-    //   localStorage.setItem('buyPopupPage', true)
-    //   this.buyPopupPage = false
-    // },
-    // applyButton () {
-    //   let self = this
-    //   let data = {
-    //     account_id: this.$store.getters.account_info.id,
-    //     // account_id: '114',
-    //     source_type: 1,
-    //     apply_type: 1
-    //   }
-    //   request_user('post', '/api/intentions/addbuy', data).then(res => {
-    //     if (res.data.code == 1) {
-    //       self.$toast(res.data.msg)
-    //     } else {
-    //       self.$toast(res.data.msg)
-    //     }
-    //   })
-    //     .finally(() => {
-    //       this.buyPopupPage = false
-    //     })
-    // },
     // 刷新token
     refreshToken () {
       var refreshTime = localStorage.getItem('refreshTime')
@@ -539,11 +337,11 @@ export default {
       this.user_info = JSON.parse(plus.storage.getItem('user_info'))
       if (plus.webview.currentWebview().id == plus.runtime.appid) {
         // APP只要主窗口监听就好了
-        this.socket_io_init()
+        // this.socket_io_init()
       }
     } else {
       this.user_info = JSON.parse(localStorage.getItem('user_info'))
-      this.socket_io_init()
+      // this.socket_io_init()
     }
     let self = this
     FastClick.attach(document.body)

+ 1 - 11
src/api/configget.js

@@ -1,20 +1,10 @@
 
 import request from '@/utils/request'
-import {getToken} from '@/utils/auth' // getToken from cookie
-export function allocation(){
-    let urls = window.location.href
-    console.log(urls.split('#')[0])
-    let params = {url : urls.split('#')[0]}
-    // let params = {url : 'http%3A%2F%2Fwechatdings.vaiwan.com%2F'}
-    return request('get','/api/wechat/config', params)
-}
-// import request from '@/utils/request'
+import {getToken} from '@/utils/auth'
 export async function allocations(body){
     console.log("请求配置")
-    console.log(body)
     if(getToken()){
         let params = {url : body}
-        // let params = {url : 'http%3A%2F%2Fwechatdings.vaiwan.com%2F'}
         return await request('get','/api/wechat/config', params)
     }
 }

+ 0 - 36
src/api/login.js

@@ -1,19 +1,5 @@
 import request from '@/utils/request'
-import request_user from '@/utils/request-user'
 
-//平台账号-账号信息
-export function get_account_info() {
-  return request_user('post','/api/account/info')
-}
-
-//平台账号登录
-export function login(userInfo) {
-  const data = userInfo
-  if (window.plus) {
-    data['client_id'] = plus.push.getClientInfo().clientid
-  }
-  return request('post','/api/login', data)
-}
 // 获取菜单与权限
 export function getMenu() {
   return request('get','/api/employee/menu');
@@ -30,25 +16,3 @@ export function get_employee_map() {
 export function get_info(token) {
   return request('get','/api/employee/detail','','token');
 }
-
-export function forgetSendMsg(mobile) {
-  const data = {
-    mobile: mobile
-  }
-  return request('get','/integral.php/verify/forget_send_msg',data);
-}
-
-export function pwd_reset(userInfo) {
-  const data = userInfo
-  return request('post','/integral.php/verify/reset_password',data);
-}
-
-//微信授权
-export function weixin_login(data) {
-  if (window.plus) {
-    data['client_id'] = plus.push.getClientInfo().clientid
-  }
-  return request.get('/api/wechat/auth', {
-    params: data
-  })
-}

+ 0 - 21
src/api/reg.js

@@ -1,21 +0,0 @@
-import request from '@/utils/request'
-
-//平台账号注册
-export function reg(userInfo) {
-  const data = userInfo
-  return request('post','/api/register',data)
-}
-
-//平台账号注册发送验证码
-export function sendMsg(mobile) {
-  const data = {
-    mobile: mobile,
-    type: 1
-  }
-  return request('post','/api/send-sms',data)
-}
-
-export function sendcheckcode(userInfo) {
-  const data = userInfo
-  return request('post','/api/sms/check',data)
-}

+ 0 - 201
src/components/about/about.vue

@@ -1,201 +0,0 @@
-<template>
-  <div>
-    <van-nav-bar title="关于" left-text="返回" @click-left="$route_back" left-arrow></van-nav-bar>
-    <div class="body_com has_header">
-      <div class="version_box">
-        <img style="width:1.5rem; height:1.5rem; border-radius: 1rem;" src="static/images/logo.png" />
-        <div class="app_name">{{ app_name }}</div>
-        <div class="app_version">{{ app_ver }}</div>
-      </div>
-      <div style="padding:0.32rem;">
-        <van-cell-group>
-          <van-cell title="更新日志" is-link to="/version" />
-          <van-cell title="检测更新" is-link @click="get_ver" />
-        </van-cell-group>
-      </div>
-    </div>
-    <div class="copy-right">
-      <p>
-        <a @click="$router.push({ name: 'user_agreement' })">《软件许可及服务协议》</a>
-        和
-        <a @click="$router.push({ name: 'privacy_agreement' })">《隐私保护指引》</a>
-      </p>
-      <p class="text">{{ copyright_cn }}</p>
-      <p class="text">{{ copyright_en }}</p>
-    </div>
-    <!-- <van-overlay :show="show">
-      <div class="wrapper" @click.stop>
-        <div class="block">{{Text}}</div>
-      </div>
-    </van-overlay> -->
-  </div>
-</template>
-
-<script>
-import Vue from 'vue'
-import { Cell, CellGroup, Notify } from 'vant'
-import request_user from '@/utils/request-user'
-Vue.use(Cell)
-  .use(CellGroup)
-  .use(Notify)
-export default {
-  name: 'about',
-  data () {
-    return {
-      // show:false,
-      // Text:'',
-      info: {},
-      app_ver: process.env.APP_VER,
-      app_name: process.env.APP_NAME,
-      copyright_cn: process.env.COPYRIGHT_CN,
-      copyright_en: process.env.COPYRIGHT_EN
-    }
-  },
-  created () {
-    this.get_ver()
-    let self = this
-    if (window.plus) {
-      plus.runtime.getProperty(plus.runtime.appid, function (inf) {
-        self.app_ver = inf.version
-      })
-    }
-  },
-  methods: {
-    get_ver () {
-      this.$toast.loading({
-        message: '正在检查...',
-        forbidClick: true
-      })
-      let self = this
-      if (!window.plus) {
-        self.$toast.clear()
-        self.$toast.success({ message: '当前已经是最新版本!', duration: 1000 })
-        return false
-      }
-      plus.runtime.getProperty(plus.runtime.appid, function (inf) {
-        wgtVer = inf.version
-        request_user('post', '/api/version/check', { version: wgtVer.toString() }).then(res => {
-          self.info = res.data.data
-          self.$toast.clear()
-          if (res.data.code == 1) {
-            console.log(wgtVer.toString())
-            console.log(JSON.stringify(res.data.data))
-            if (res.data.data.status) {
-              self.$toast.success({ message: '当前已经是最新版本!', duration: 1000 })
-            } else {
-              self.$dialog
-                .confirm({
-                  title: '发现新版本' + res.data.data.new_version.version,
-                  message: '确定要更新吗?(更新完成将自动重启)'
-                })
-                .then(() => {
-                  self.$toast.loading({
-                    duration: 0,
-                    mask: true,
-                    type: 'loading',
-                    message: '更新中...',
-                    forbidClick: true
-                  })
-                  self.downWgt(res.data.data.new_version.app_path)
-                })
-            }
-          } else {
-            self.$toast.success({ message: '当前已经是最新版本!', duration: 1000 })
-          }
-        })
-      })
-    },
-    downWgt (wgtUrl) {
-      let self = this
-      if (!window.plus) {
-        return false
-      }
-      plus.downloader
-        .createDownload(
-          wgtUrl,
-          {
-            filename: '_doc/update/'
-          },
-          function (d, status) {
-            if (status == 200) {
-              self.installWgt(d.filename)
-            } else {
-              self.$toast.clear()
-              Notify({ type: 'danger', message: '下载失败,请稍后重试', duration: 1000 })
-            }
-          }
-        )
-        .start()
-    },
-    installWgt (path) {
-      if (!window.plus) {
-        return false
-      }
-      this.$toast.clear()
-      plus.runtime.install(
-        path,
-        {
-          force: true
-        },
-        function () {
-          plus.runtime.restart()
-        },
-        function (e) {
-          plus.runtime.restart()
-        }
-      )
-    }
-  }
-}
-</script>
-
-<style scoped>
-.body_com {
-  height: calc(100% - 3rem);
-  position: relative;
-}
-.version_box {
-  padding: 1rem 0;
-  padding-bottom: 0;
-  text-align: center;
-}
-.app_version {
-  font-size: 0.28rem;
-  color: #999;
-}
-.app_name {
-  font-size: 0.32rem;
-  color: #000;
-}
-.copy-right {
-  height: 2rem;
-  text-align: center;
-  font-size: 0.24rem;
-}
-.copy-right p {
-  margin-bottom: 0;
-  line-height: 1;
-}
-.copy-right a {
-  color: #1989fa;
-}
-.copy-right .text {
-  color: #999;
-}
-
-.wrapper {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  height: 100%;
-}
-
-.block {
-  width: 120px;
-  height: 80px;
-  line-height: 80px;
-  text-align: center;
-  background-color: #f7ffff;
-  border-radius: 5px;
-}
-</style>

+ 0 - 229
src/components/about/version.vue

@@ -1,229 +0,0 @@
-<template>
-  <div class="aff_list_com">
-    <van-nav-bar title="版本更新" left-text="返回" @click-left="$route_back" left-arrow>
-    </van-nav-bar>
-    <div class="aff_list_com_body_com has_header">
-      <scroller ref="my_scroller" :on-refresh="refresh" :on-infinite="infinite">
-        <div style="height: 0.16rem;"></div>
-        <div class="aff_list_com_box">
-          <div class="aff_list_item" v-for="(item,index) in list" :key="index"
-               @click="go_detail(item)">
-            <div class="info_username">{{item.title}}</div>
-            <div class="reg_time">发布时间:{{item.createtime | datetime}}</div>
-          </div>
-        </div>
-      </scroller>
-    </div>
-    <!-- sku -->
-
-  </div>
-</template>
-
-<script>
-  import Vue from 'vue'
-  import {Lazyload} from 'vant'
-  import {getToken} from '@/utils/auth'
-  import moment from 'moment'
-
-  Vue.use(Lazyload)
-  import request from 'axios'
-
-  export default {
-    data: function () {
-
-      let sku = {
-        // 所有sku规格类目与其值的从属关系,比如商品有颜色和尺码两大类规格,颜色下面又有红色和蓝色两个规格值。
-        // 可以理解为一个商品可以有多个规格类目,一个规格类目下可以有多个规格值。
-        tree: [],
-        // 所有 sku 的组合列表,比如红色、M 码为一个 sku 组合,红色、S 码为另一个组合
-        list: [],
-        price: '0', // 默认价格(单位元)
-        stock_num: 0, // 商品总库存
-        collection_id: 0, // 无规格商品 skuId 取 collection_id,否则取所选 sku 组合对应的 id
-        none_sku: true, // 是否无规格商品
-        messages: [],
-        hide_stock: false // 是否隐藏剩余库存
-      }
-
-      return {
-        showCustomAction: false,
-        initialSku: sku,
-        sku: sku,
-        goods: {title: '', picture: ''},
-        list: [],
-        filter: {
-          page: 1,
-          cid:2345,
-          status:1,
-          offset:0,
-          limit: 10,
-          type: 0,
-        }
-      }
-    },
-    created () {
-      this.$nextTick(() => {
-        this.$refs.my_scroller.finishInfinite(false)
-      })
-      if (this.$route.query.category_id > 0) {
-        this.filter['category_id'] = this.$route.query.category_id
-      }
-    },
-
-    filters: {
-      parsePriceInt (val) {
-        return Math.floor(val)
-      },
-      parsePriceFloat (val) {
-        let arr = val.toString().split('.')
-        if (arr.length > 1) {
-          return '.' + arr[1]
-        }
-        return ''
-      },
-      datetime (val) {
-        return moment(val * 1000).format('YYYY-MM-DD HH:mm')
-      }
-    },
-    methods: {
-      go_detail(item){
-        localStorage.setItem('page_content_html', item.content)
-        this.$router.push({name:'version_info', query:{id:item.id}})
-      },
-      get_list (done) {
-        let self = this
-        request.get('https://www.g107.com/blog/ajax/getBlogPostList', {params: this.filter}).then((res) => {
-          done()
-          self.$refs.my_scroller.finishInfinite(res.data.data.data.length === 0)
-          for (let i in res.data.data.data) {
-            self.list.push(res.data.data.data[i])
-          }
-          self.filter.page++
-        })
-      },
-      refresh (done) {
-        let self = this
-        setTimeout(() => {
-          this.filter.page = 1
-          this.get_list(function () {
-            self.list = []
-            done()
-          })
-          // this.$refs.my_scroller.finishPullToRefresh()
-        }, 100)
-      },
-      del (id, index) {
-        request({
-          method: 'get',
-          url: '/public/index.php/index/address/del',
-          params: {id: id}
-        }).then((res) => {
-          if (res.data.code == 1) {
-            this.$toast(res.data.msg)
-            this.list.splice(index, 1)
-          } else {
-            this.$toast(res.data.msg)
-          }
-        })
-      },
-      infinite (done) {
-        this.get_list(done)
-      }
-    }
-  }
-</script>
-
-<style rel="stylesheet/scss" lang="scss" scoped>
-  .aff_list_com {
-    background-color: #f5f5f5;
-  }
-
-  .aff_list_com_box {
-    padding: 0 0.08rem;
-  }
-
-  .aff_list_com_item_box {
-    background-color: #fff;
-    border-radius: 0.1rem;
-    margin: 0.08rem;
-    overflow: hidden;
-    margin-top: 0.2rem;
-    padding-bottom: 0.2rem;
-  }
-
-  .aff_list_com_item .aff_list_com_link {
-    display: block;
-  }
-
-  .aff_list_com_item .aff_list_com_image {
-    max-width: 100%;
-  }
-
-  .aff_list_com_text {
-    padding: 0 0.16rem;
-  }
-
-  .aff_list_com_goods_name {
-    line-height: 1.75;
-    font-size: 0.32rem;
-    font-weight: normal;
-    margin: 0;
-  }
-
-  .aff_list_com_price {
-    color: #ff4a39;
-  }
-
-  .aff_list_com_price .aff_list_com_char {
-    font-size: 0.2rem;
-    margin-right: 0.1rem;
-  }
-
-  .aff_list_com_price .aff_list_com_price_number {
-    font-size: 0.32rem;
-    letter-spacing: 0.03rem;
-  }
-
-  .aff_list_com_price .price_small {
-    font-size: 0.2rem;
-  }
-
-  .aff_list_com_shopping_cart {
-    float: right;
-    font-size: 0.36rem;
-    margin-top: 0.1rem;
-    margin-right: 0.1rem;
-  }
-
-  .aff_list_com_body_com {
-    height: calc(100vh - 1rem);
-    position: relative;
-  }
-
-  .aff_list_com_body_com.has_header {
-    height: calc(100vh - 0.92rem);
-  }
-
-
-  .aff_list_item {
-    font-size: 0.32rem;
-    color: #333;
-    background-color: #fff;
-    padding: 0.16rem;
-    margin-bottom: 0.16rem;
-  }
-
-  .info_name {
-  }
-
-  .info_username {
-  }
-
-  .info_level_name {
-  }
-
-  .reg_time {
-    color: #999;
-    font-size: 0.24rem;
-  }
-</style>

+ 0 - 59
src/components/about/version_info.vue

@@ -1,59 +0,0 @@
-<template>
-  <div>
-    <van-nav-bar title="更新内容" left-text="返回" @click-left="$route_back" left-arrow>
-
-    </van-nav-bar>
-
-    <div class="body_com has_header">
-      <scroller>
-        <div class="content">
-          <div class="html-content" v-html="info.content"></div>
-        </div>
-      </scroller>
-    </div>
-
-
-  </div>
-</template>
-
-<script>
-  import request from '@/utils/request'
-  export default {
-    name: 'version_info',
-    data(){
-      return {
-        info:{
-          name:'',
-          content:''
-        }
-      }
-    },
-    created(){
-      this.get_info(this.$route.query.id)
-    },
-    methods:{
-      get_info(id){
-        this.info.content = localStorage.getItem('page_content_html')
-        return
-        this.$toast.loading({
-          message: '加载中...',
-          forbidClick: true
-        });
-        let self = this
-        request('get','/api/version/log_info.html',{id:id}).then((res) => {
-          self.info = res.data.data
-          self.$toast.clear()
-        })
-      }
-    }
-  }
-</script>
-
-
-<style scoped>
-  .submit_btn_box{padding:0.32rem;}
-  .body_com{height: calc(100% - 1rem); position: relative;}
-  .content{padding:0 0.32rem;}
-  .html-content{width:100%;}
-  .html-content img{max-width:100% !important; height: auto !important; width:100%;}
-</style>

+ 0 - 49
src/components/attendance/data/chart.vue

@@ -1,49 +0,0 @@
-<template>
-  <div>
-    <van-circle
-      v-model="currentRate"
-      :rate="rate"
-      :size="circle_size"
-      layer-color="#eee"
-    >
-
-      <template slot="default">
-        <div class="circle_remark_title">打卡人数/应到人数</div>
-        <div class="circle_remark_number">4/5</div>
-        <a class="circle_remark_link">打卡明细 > </a>
-      </template>
-
-    </van-circle>
-  </div>
-</template>
-
-<script>
-  export default {
-    name: "chart",
-    data(){
-      let circle_size = window.innerWidth - 250
-      return {
-        currentRate: 20,
-        rate: 60,
-        circle_size: circle_size+'px'
-      }
-    }
-  }
-</script>
-
-<style scoped>
-  .circle_remark_title{
-    padding-top:0.8rem;
-    color:#999;
-    font-size:0.24rem;
-  }
-  .circle_remark_number{
-    color:rgb(25, 137, 250);
-    font-size:0.5rem;
-    margin-top:0.16rem;
-  }
-  .circle_remark_link{
-    font-size:0.24rem;
-    color:rgb(25, 137, 250);
-  }
-</style>

+ 0 - 50
src/components/attendance/data_com.vue

@@ -1,50 +0,0 @@
-<template>
-  <div style="height: 100%;">
-    <van-nav-bar title="考勤统计" left-text="返回"
-                 @click-left="$parent.active_index = 0" left-arrow>
-
-    </van-nav-bar>
-    <van-tabs v-model="tab_active" color="#1989fa">
-      <van-tab title="实时数据">
-        <chart class="attendance_chart"></chart>
-      </van-tab>
-      <van-tab title="周月统计">内容 2</van-tab>
-      <van-tab title="我的">内容 3</van-tab>
-    </van-tabs>
-  </div>
-</template>
-
-<script>
-  import Vue from 'vue';
-  import chart from '@/components/attendance/data/chart'
-  import {Tab, Tabs, Circle} from 'vant'
-
-  Vue.use(Tab).use(Tabs).use(Circle)
-
-  export default {
-    name: "data_com",
-    components: {chart},
-    data() {
-      return {
-        tab_active: 0
-      }
-    },
-    methods: {
-      window_resize() {
-        var myEvent = new Event('resize');
-        window.dispatchEvent(myEvent);
-      }
-    },
-    created() {
-
-    }
-  }
-</script>
-
-<style scoped>
-  .attendance_chart {
-    margin:0 auto;
-    text-align: center;
-    padding:0.32rem 0;
-  }
-</style>

+ 0 - 139
src/components/attendance/index.vue

@@ -1,139 +0,0 @@
-<template>
-
-
-  <div style="background-color: #ffffff;">
-
-    <div class="user_index_scroller_com">
-
-      <div class="height100p" :class="{hidden_right:active_index != 0}">
-        <push_card></push_card>
-      </div>
-
-      <div class="height100p" :class="{hidden_right:active_index != 1}">
-
-        <data_com></data_com>
-
-      </div>
-
-
-      <div class="height100p" :class="{hidden_right:active_index != 2}">
-        <setting></setting>
-      </div>
-
-
-      <van-tabbar v-model="active_index">
-        <van-tabbar-item icon="location-o">打卡</van-tabbar-item>
-        <van-tabbar-item icon="chart-trending-o">统计</van-tabbar-item>
-        <van-tabbar-item icon="setting-o">设置</van-tabbar-item>
-      </van-tabbar>
-    </div>
-  </div>
-</template>
-
-<script>
-  import push_card from '@/components/attendance/push_card'
-  import data_com from '@/components/attendance/data_com'
-  import setting from '@/components/attendance/setting'
-  export default {
-    components:{push_card, setting, data_com},
-    methods: {
-
-    },
-    watch:{
-      active_index(){
-        setTimeout(() => {
-          let myEvent = new Event('resize');
-          window.dispatchEvent(myEvent);
-        }, 100)
-      }
-    },
-    data () {
-      return {
-        active_index: 0,
-        userinfo: null
-      }
-    },
-    created(){
-
-    }
-  }
-</script>
-
-<style scoped>
-  .user_index_scroller_com {
-    height: calc(100% - 1rem);
-    position: relative;
-  }
-  .user_index_header_com {
-    height: 2.5rem;
-    position: relative;
-    z-index: 2;
-  }
-
-  .header_avatar_com {
-    padding: 0.16rem;
-  }
-
-  .user_nickname_com {
-    text-align: left;
-    line-height: 1.5;
-    font-size:0.3rem;
-    font-weight: normal;
-  }
-
-  .user_index_header_com .header_avatar {
-    width: 1.5rem;
-    display: block;
-    margin: 0 auto;
-    height: 1.5rem;
-    -webkit-border-radius: 2.5rem;
-    -moz-border-radius: 2.5rem;
-    border-radius: 2.5rem;
-  }
-
-  .user_index_header_bg {
-    position: absolute;
-    width: 20rem;
-    height: 20rem;
-    -webkit-border-radius: 5rem;
-    top: -17rem;
-    left: 50%;
-    margin-left: -10rem;
-    background-color: #b8cc70;
-    -moz-border-radius: 10rem;
-    border-radius: 10rem;
-    z-index: 1;
-  }
-
-  .large_btn {
-    padding: 0.16rem;
-    line-height: 1;
-  }
-
-  .large_btn .van-button {
-    padding: 0.2rem 0;
-  }
-
-  .large_btn .van-icon {
-    font-size: 1rem;
-  }
-
-  .large_btn .van-button--large {
-    height: auto;
-    line-height: 1.5;
-  }
-  .aff_code_btn{
-
-    width: 1rem;
-    height: 0.44rem;
-    line-height: 0.44rem;
-    font-size: 0.2rem;
-
-  }
-  .user_setting_btn{position: absolute;top:0.32rem; color:#333; font-size:0.32rem; right:0.32rem;}
-  .user_setting_btn *{vertical-align: middle;}
-  .user_setting_btn .van-icon{font-size:0.32rem;}
-  .hidden_right{position: absolute; top:-1000000px; left:-100000px;}
-  .height100p{
-    height: 100%;}
-</style>

+ 0 - 796
src/components/attendance/push_card.vue

@@ -1,796 +0,0 @@
-<template>
-  <div style="height: 100%;">
-    <van-nav-bar title="考勤打卡" left-text="返回" :right-text="push_param.date" @click-right="show_week_calendar = true"
-                 @click-left="$route_back" left-arrow>
-
-    </van-nav-bar>
-
-    <div id="allmap" style="height: 3.5rem;">
-
-    </div>
-
-    <div style="padding:0.16rem; border-bottom:1px solid #eee; height:0.83rem;">
-      <van-button style="float:right;" icon="aim" size="small"
-                  type="warning" @click="get_location">重新定位
-      </van-button>
-      <span class="address_info" style="height:0.33rem; overflow: hidden;">地址:{{push_param.address}}</span>
-      <span class="address_info">最近打卡距离:{{distance}}米</span>
-    </div>
-
-    <div class="body_com has_header">
-      <scroller ref="time_line_scroller">
-        <van-steps class="time_line_box" direction="vertical" :active="-1" id="time-line-box">
-          <van-step v-for="(item,index) in time_line" :key="index" class="time_list_box_parent">
-
-            <div v-if="item.pre_id < 0 && item.pre_is_update == 0" id="check_box" :data-key="index">
-              <h4>{{item.remark}}:{{item.timestamp_time}}</h4>
-              <div
-                :class="{push_card_abnormal: (item.check_remark != '正常' && item.is_outside != 1), push_card_btn:true, disabled:!enabled_push_card, push_card_outside:item.is_outside == 1}"
-                @click="push_card">
-                <div class="msg_box" v-if="item.is_outside == 0">{{msg}}</div>
-                <div class="msg_box" v-if="item.is_outside == 1">外勤打卡</div>
-                <div class="time_box">{{times}}</div>
-              </div>
-              <div class="error_msg_box">{{error_msg}}</div>
-            </div>
-
-            <div v-if="item.pre_id == null">
-              <h4>{{item.remark}}:{{item.timestamp_time}}
-                <van-tag round type="danger" v-show="item.timestamp < current_time">缺卡</van-tag>
-              </h4>
-              <div class="update_btn" v-show="item.timestamp < current_time"
-                   @click="remedy_card(item.id, item.timestamp, '缺卡')">补卡>>
-              </div>
-            </div>
-
-            <div v-if="item.pre_id > 0 || item.pre_is_update == 1">
-              <h4>{{item.remark}}:{{item.timestamp_time}}</h4>
-              <div class="check_time_box">打卡时间:{{item.check_time_time}}
-                <van-tag round v-show="item.check_remark == '正常'" type="primary">正常</van-tag>
-                <van-tag round v-show="item.is_outside == 1" type="success">外勤</van-tag>
-                <van-tag round type="warning" v-show="item.check_remark != '正常'">{{item.check_remark}}</van-tag>
-              </div>
-              <div class="check_address_box">
-                <van-icon name="location-o"/>
-                {{item.check_location_name}}
-              </div>
-              <!-- 更新和补卡 -->
-              <div class="update_btn" @click="push_card" v-if="item.pre_is_update == 1">更新打卡>></div>
-              <div class="update_btn" @click="remedy_card(item.id, item.timestamp, item.check_remark)"
-                   v-if="item.pre_is_update == 0&&item.check_remark != '正常'">补卡>>
-              </div>
-              <div class="emptydiv"></div>
-            </div>
-          </van-step>
-
-        </van-steps>
-        <div style="height: 3.5rem;"></div>
-      </scroller>
-      <van-dialog confirmButtonText="我知道了" @confirm="success_confirm"
-                  v-model="result_show"
-                  :class="{push_card_abnormal_box: (check_result != '正常' && check_result != '外勤'), push_card_outside_box:check_result == '外勤'}">
-        <div class="check_success_box">
-          <van-icon name="passed"/>
-        </div>
-        <div class="check_result_time_box">{{check_time | check_datetime_format}}</div>
-        <div class="check_result_box">{{msg+'·'+check_result}}</div>
-      </van-dialog>
-
-      <van-dialog showCancelButton confirmButtonText="确认打卡" style="width:6rem;" :before-close="adv_push_card"
-                  v-model="check_not_normal">
-
-        <div style="padding-top:0.2rem;padding-left:0.2rem; float:left;">
-          <van-uploader capture="camera" :max-count="1" v-model="fileList" :after-read="afterRead"/>
-
-        </div>
-        <van-cell-group class="image_box" style="float:right; width:3.8rem; margin-right:0.2rem;">
-
-          <van-field style="padding:0; padding-top:0.3rem;"
-                     :border="false"
-                     v-model="push_param.remark"
-                     type="textarea"
-                     placeholder="输入备注最多20字"
-                     rows="3"
-                     maxlength="20"
-                     autosize
-          ></van-field>
-
-
-        </van-cell-group>
-        <div style="clear: both;"></div>
-      </van-dialog>
-
-      <van-dialog showCancelButton v-model="show_week_calendar" confirmButtonText="今天" @confirm="clickDay('')">
-        <Calendar
-          v-on:choseDay="clickDay"></Calendar>
-      </van-dialog>
-
-
-    </div>
-  </div>
-
-</template>
-
-<script>
-  import Vue from 'vue'
-  import {Step, Steps, Tag, Uploader, DatetimePicker} from 'vant'
-  import request from '@/utils/request'
-  import moment from 'moment'
-  import Calendar from 'vue-calendar-component'
-
-  Vue.use(Step).use(Steps).use(Tag).use(Uploader).use(DatetimePicker)
-  export default {
-    name: 'push_card',
-    components: {
-      Calendar
-    },
-    data() {
-      let date = moment().format('YYYY/MM/DD')
-      return {
-        show_week_calendar: false,
-        map: null,
-        check_not_normal: false,
-        result_show: false,
-        push_param: {
-          date: date,
-          coordinate: '0,0',
-          wifi: '',
-          address: '',
-          remark: '',
-          image: ''
-        },
-        current_time: 0,
-        is_outside: false,
-        fileList: [],
-        check_time: 0,
-        check_result: '',
-        distance: 0,
-        token: '',
-        time_line: [],
-        error_msg: '',
-        msg: '',
-        location_list: [],
-        times: '',
-        enabled_push_card: false,
-      }
-    },
-    created() {
-      let self = this
-      if (typeof(AMap) == 'undefined') {
-        setTimeout(() => {
-          self.loadScript("https://webapi.amap.com/maps?v=1.4.15&key=a3b5fef4a3a2984284387ae5e2c340ed&plugin=AMap.Geocoder", function () {
-            self.get_location()
-            self.datetime_format()
-          })
-        }, 100)
-
-      } else {
-        self.get_location()
-        self.datetime_format()
-      }
-    },
-    filters: {
-      check_datetime_format(t) {
-        return moment(t * 1000).format('HH:mm')
-      }
-    },
-    methods: {
-      loadScript(url, callback) {
-        var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement,
-          script,
-          options,
-          s;
-        if (typeof url === "object") {
-          options = url;
-          url = undefined;
-        }
-        s = options || {};
-        url = url || s.url;
-        callback = callback || s.success;
-        script = document.createElement("script");
-        script.async = s.async || false;
-        script.type = "text/javascript";
-        if (s.charset) {
-          script.charset = s.charset;
-        }
-        if (s.cache === false) {
-          url = url + (/\?/.test(url) ? "&" : "?") + "_=" + (new Date()).getTime();
-        }
-        script.src = url;
-        head.insertBefore(script, head.firstChild);
-        if (callback) {
-          document.addEventListener ? script.addEventListener("load", callback, false) : script.onreadystatechange = function () {
-            if (/loaded|complete/.test(script.readyState)) {
-              script.onreadystatechange = null
-              callback()
-            }
-          }
-        }
-      },
-      clickDay(data) {
-        if (data == '') {
-          this.push_param.date = moment().format('YYYY/MM/DD')
-        } else {
-          this.push_param.date = data
-        }
-        this.show_week_calendar = false
-        this.get_location()
-      },
-      remedy_card(id, timestamp, check_remark) {
-        this.$router.push({name: 'remedy', query: {id: id, timestamp: timestamp, check_remark: check_remark}})
-      },
-      afterRead(file) {
-        // 此时可以自行将文件上传至服务器
-        let self = this
-        self.$toast.loading({
-          mask: true,
-          message: '正在处理'
-        })
-        this.dealImage(file.content, {width: 500, quality: 0.7}, function (ret) {
-          self.push_param.image = ret
-          self.$toast.clear()
-          //console.log(self.push_param.image)
-        })
-
-      },
-      success_confirm() {
-        this.get_location()
-      },
-      datetime_format() {
-        setInterval(() => {
-          this.times = moment().format('HH:mm:ss')
-        }, 1000)
-
-      },
-
-      adv_push_card(action, done) {
-        //console.log(action)
-        if (this.is_outside && this.push_param.image == '' && action == 'confirm') {
-          this.$toast('请上传图片')
-          this.check_not_normal = true
-          done(false)
-          return false
-        }
-        if (action == 'confirm') {
-          setTimeout(() => {
-            done(true)
-            this.check_not_normal = false
-          }, 5)
-          this.push_card()
-        }
-        if (action == 'cancel') {
-          done(true)
-        }
-
-      },
-      push_card() {
-        let self = this
-        if (!self.enabled_push_card) {
-          return false
-        }
-        if (this.check_result != '正常' && this.check_not_normal == false) {
-          this.check_not_normal = true
-          return false
-        }
-
-        this.$toast.loading({
-          mask: true,
-          message: '正在处理'
-        })
-        request('post','/addons/ems/attendance/push_card',{token: self.token, image: self.push_param.image, remark: self.push_param.remark}).then((res) => {
-          if (res.data.code == 0) {
-            self.$dialog.alert({
-              title: '打卡失败',
-              message: res.data.msg
-            })
-            self.get_location()
-          } else {
-            let date = self.push_param.date
-            self.push_param = {
-              coordinate: '0,0',
-              wifi: '',
-              address: '',
-              remark: '',
-              image: '',
-              date: date
-            }
-            self.fileList = []
-            self.$toast(res.data.msg)
-            self.result_show = true
-          }
-
-        })
-      },
-      pre_push_card() {
-        let self = this
-        request('post','/addons/ems/attendance/pre_push_card',self.push_param).then((res) => {
-          self.$toast.clear()
-          self.current_time = res.data.time
-          if (res.data.code == 0) {
-            self.$toast(res.data.msg)
-          }
-          self.distance = res.data.data.distance
-          self.time_line = res.data.data.time_line
-          self.token = res.data.data.token
-          self.check_time = res.data.time
-          for (let i in self.time_line) {
-            if (self.time_line[i].pre_id < 0 && self.time_line[i].pre_id != null) {
-              self.check_result = self.time_line[i].check_remark
-              self.is_outside = (self.time_line[i].is_outside == 1)
-            }
-          }
-          self.msg = res.data.data.check_result
-          self.error_msg = res.data.msg
-          self.enabled_push_card = res.data.code == 1
-          self.location_list = res.data.data.location_list
-          let markers = []
-          let circleMarker = []
-          //生成范围
-          for (let i in self.location_list) {
-            let point = self.bd_decrypt(self.location_list[i].lng, self.location_list[i].lat)
-            let marker = new AMap.Marker({
-              position: new AMap.LngLat(point.lng, point.lat),   // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
-              icon: 'static/images/poi-marker-red.png',
-              offset: new AMap.Pixel(0, 0)
-            })
-
-            let circle = new AMap.Circle({
-              center: new AMap.LngLat(point.lng, point.lat),  // 圆心位置
-              radius: self.location_list[i].radius * 1, // 圆半径
-              fillColor: 'rgba(255,0,0, 0.1)',   // 圆形填充颜色
-              strokeColor: '#ff5659', // 描边颜色
-              strokeWeight: 1, // 描边宽度
-            })
-
-            markers.push(marker)
-            circleMarker.push(circle)
-          }
-          self.map.add(markers)
-          self.map.add(circleMarker)
-          self.$nextTick(() => {
-            setTimeout(() => {
-              let scroll_top = 0
-              let time_list = document.getElementsByClassName('time_list_box_parent')
-              let check_box = document.getElementById('check_box')
-
-              if (check_box) {
-                let data_key = document.getElementById('check_box').getAttribute('data-key')
-                for (let i = 0; i < time_list.length; i++) {
-                  if (i < data_key) {
-                    scroll_top += time_list[i].offsetHeight
-                  }
-                }
-                self.$refs['time_line_scroller'].scrollTo(0, scroll_top, true)
-              }
-            }, 500)
-          })
-        })
-      },
-      get_location() {
-        this.$toast.loading({
-          mask: true,
-          message: '获取定位中...'
-        })
-        this.push_param.address = '获取定位中...'
-        if (!this.is_app()) {
-          if (this.isWeiXin()) {
-            this.weixin_location()
-          } else {
-            this.h5_location()
-          }
-        } else {
-          let plusReady = function (callback) {
-            if (window.plus) {
-              callback();
-            } else {
-              document.addEventListener('plusready', callback);
-            }
-          };
-          plusReady(this.onPlusReady)
-        }
-
-      },
-
-      onPlusReady() {
-        let self = this
-        if (window.plus) {
-          plus.geolocation.getCurrentPosition(function (p) {
-            var longitude = p.coords.longitude
-            var latitude = p.coords.latitude
-            if (p.coordsType == 'gcj02') {
-              var ret = {lng: longitude * 1, lat: latitude * 1}
-            }
-            if (p.coordsType == 'wgs84') {
-              var ret = self.wgs84togcj02(longitude * 1, latitude * 1)
-            }
-
-            var baidu_ret = self.gcj02tobd09(ret.lng, ret.lat)
-            self.map_show(ret)
-          }, function (e) {
-            alert('Geolocation error: ' + e.message)
-          })
-        }
-      },
-
-      h5_location() {
-        let self = this
-        var map = new AMap.Map('allmap', {
-          resizeEnable: true
-        })
-        map.plugin('AMap.Geolocation', function () {
-          var geolocation = new AMap.Geolocation({
-            // 是否使用高精度定位,默认:true
-            enableHighAccuracy: true,
-            // 设置定位超时时间,默认:无穷大
-            timeout: 10000,
-            // 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
-            buttonOffset: new AMap.Pixel(10, 20),
-            //  定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
-            zoomToAccuracy: true,
-            //  定位按钮的排放位置,  RB表示右下
-            buttonPosition: 'RB'
-          })
-
-          geolocation.getCurrentPosition()
-          AMap.event.addListener(geolocation, 'complete', onComplete)
-          AMap.event.addListener(geolocation, 'error', onError)
-
-          function onComplete(data) {
-            var lng = data.position.lng
-            var lat = data.position.lat
-            if (data.message.indexOf('Don') > 0) {
-              var ret = self.wgs84togcj02(lng, lat)
-              lng = ret.lng
-              lat = ret.lat
-            }
-            var baidu_ret = self.gcj02tobd09(lng, lat)
-            self.map_show({lng: lng, lat: lat})
-          }
-          function onError(data) {
-            // 定位出错
-            alert(data.message)
-          }
-        })
-      },
-
-      weixin_location() {
-        axios.post('https://i.g107.com/564/Ajax/getJsSdk', {
-          url: window.location.href,
-        }, {
-          headers: {
-            'Content-Type': 'application/x-www-form-urlencoded'
-          },
-          transformRequest: [function (data) {
-            // 对 data 进行任意转换处理
-            return Qs.stringify(data)
-          }]
-        })
-          .then(function (response) {
-
-            var config = response.data
-            config['jsApiList'] = ['getLocation', 'getNetworkType']
-            wx.config(response.data)
-            wx.ready(function () {
-
-              wx.getNetworkType({
-                success: function (res) {
-                  //console.log(res)
-                }
-              })
-
-              wx.getLocation({
-                type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
-                success: function (res) {
-                  //console.log(res)
-                  var latitude = res.latitude // 纬度,浮点数,范围为90 ~ -90
-                  var longitude = res.longitude // 经度,浮点数,范围为180 ~ -180。
-                  var baidu_ret = this.gcj02tobd09(longitude, latitude)
-                  this.map_show({lng: res.longitude, lat: res.latitude})
-
-                }
-              })
-            })
-          })
-          .catch(function (error) {
-            //console.log(error)
-          })
-      },
-
-      bd_decrypt(bd_lng, bd_lat) {
-        var X_PI = Math.PI * 3000.0 / 180.0
-        var x = bd_lng - 0.0065
-        var y = bd_lat - 0.006
-        var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * X_PI)
-        var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * X_PI)
-        var gg_lng = z * Math.cos(theta)
-        var gg_lat = z * Math.sin(theta)
-        return {lng: gg_lng, lat: gg_lat}
-      }
-      ,
-      /**
-       * WGS84转GCj02
-       * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换
-       * @param lng
-       * @param lat
-       * @returns {*[]}
-       */
-      wgs84togcj02(lng, lat) {
-
-        const PI = 3.1415926535897932384626
-        const a = 6378245.0
-        const ee = 0.00669342162296594323
-        // WGS84转GCj02
-        let dlat = this.transformlat(lng - 105.0, lat - 35.0)
-        let dlng = this.transformlng(lng - 105.0, lat - 35.0)
-        let radlat = lat / 180.0 * PI
-        let magic = Math.sin(radlat)
-        magic = 1 - ee * magic * magic
-        let sqrtmagic = Math.sqrt(magic)
-        dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI)
-        dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI)
-        let mglat = lat + dlat
-        let mglng = lng + dlng
-        // 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换
-        return {lng: mglng, lat: mglat}
-        //return gcj02tobd09(mglng, mglat)
-      }
-      ,
-
-      gcj02tobd09(mglng, mglat) {
-        const xPI = 3.14159265358979324 * 3000.0 / 180.0
-        let z = Math.sqrt(mglng * mglng + mglat * mglat) + 0.00002 * Math.sin(mglat * xPI)
-        let theta = Math.atan2(mglat, mglng) + 0.000003 * Math.cos(mglng * xPI)
-        let bdlng = z * Math.cos(theta) + 0.0065
-        let bdlat = z * Math.sin(theta) + 0.006
-        // return [bdlng, bdlat]
-        return {lng: bdlng, lat: bdlat}
-      }
-      ,
-
-      transformlat(lng, lat) {
-        const PI = 3.1415926535897932384626
-        let ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng))
-        ret += (20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0 / 3.0
-        ret += (20.0 * Math.sin(lat * PI) + 40.0 * Math.sin(lat / 3.0 * PI)) * 2.0 / 3.0
-        ret += (160.0 * Math.sin(lat / 12.0 * PI) + 320 * Math.sin(lat * PI / 30.0)) * 2.0 / 3.0
-        return ret
-      }
-      ,
-
-      transformlng(lng, lat) {
-        const PI = 3.1415926535897932384626
-        let ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng))
-        ret += (20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0 / 3.0
-        ret += (20.0 * Math.sin(lng * PI) + 40.0 * Math.sin(lng / 3.0 * PI)) * 2.0 / 3.0
-        ret += (150.0 * Math.sin(lng / 12.0 * PI) + 300.0 * Math.sin(lng / 30.0 * PI)) * 2.0 / 3.0
-        return ret
-      }
-      ,
-
-      map_show(point) {
-        let self = this
-        this.map = new AMap.Map('allmap', {
-          center: [point.lng, point.lat],
-          zoom: 15
-        })
-        //this.$toast.clear()
-        var marker = new AMap.Marker({
-          icon: 'static/images/poi-marker-default.png',
-          position: [point.lng, point.lat],
-          offset: new AMap.Pixel(0, 0)
-        })
-        marker.setMap(this.map)
-
-        var geocoder = new AMap.Geocoder({
-          city: '010', //城市设为北京,默认:"全国"
-          radius: 1000 //范围,默认:500
-        })
-
-        var lnglat = [point.lng, point.lat]
-        geocoder.getAddress(lnglat, function (status, result) {
-          if (status === 'complete' && result.regeocode) {
-            var address = result.regeocode.formattedAddress
-            //console.log(result.regeocode)
-            self.push_param.address = address
-            var baidu_ret = self.gcj02tobd09(point.lng, point.lat)
-            self.push_param.coordinate = baidu_ret.lng + ',' + baidu_ret.lat
-
-            self.pre_push_card()
-          } else {
-            log.error('根据经纬度查询地址失败')
-          }
-        })
-      }
-      ,
-      dealImage(path, obj, callback) {
-
-        var img = new Image()
-        img.src = path
-        img.onload = function () {
-          var that = this
-          // 默认按比例压缩
-          var w = that.width,
-            h = that.height,
-            scale = w / h
-          w = obj.width || w
-          h = obj.height || (w / scale)
-          var quality = 0.3  // 默认图片质量为0.7
-          //生成canvas
-          var canvas = document.createElement('canvas')
-          var ctx = canvas.getContext('2d')
-          // 创建属性节点
-          var anw = document.createAttribute('width')
-          anw.nodeValue = w
-          var anh = document.createAttribute('height')
-          anh.nodeValue = h
-          canvas.setAttributeNode(anw)
-          canvas.setAttributeNode(anh)
-          ctx.drawImage(that, 0, 0, w, h)
-          // 图像质量
-          if (obj.quality && obj.quality <= 1 && obj.quality > 0) {
-            quality = obj.quality
-          }
-          // quality值越小,所绘制出的图像越模糊
-          var base64 = canvas.toDataURL('image/jpeg', quality)
-          // 回调函数返回base64的值
-          callback(base64)
-        }
-      },
-      isWeiXin() {
-        let ua = window.navigator.userAgent.toLowerCase()
-        if (
-          ua.match(/MicroMessenger/i) == 'micromessenger' &&
-          ua.match(/wxwork/i) != 'wxwork'
-        ) {
-          return true
-        } else {
-          return false
-        }
-      },
-      is_app() {
-        let ua = window.navigator.userAgent.toLowerCase()
-        if (
-          ua.match(/html5plus/i) == 'html5plus'
-        ) {
-          return true
-        } else {
-          return false
-        }
-      }
-
-    }
-  }
-</script>
-
-<style scoped>
-  .body_com {
-    height: calc(100% - 1rem);
-    position: relative;
-  }
-
-  .body_com.has_header {
-    height: calc(100% - 5.59rem);
-  }
-
-  .address_info {
-    font-size: 0.24rem;
-    display: block;
-  }
-
-  .push_card_btn {
-    width: 2.4rem;
-    height: 2.4rem;
-    background: #427bff;
-    border-radius: 3rem;
-    margin: 0 auto;
-    box-shadow: 0 0 0.2rem #427bff;
-    color: #fff;
-    text-align: center;
-  }
-
-  .push_card_btn .msg_box {
-    font-size: 0.32rem;
-    font-weight: bold;
-    margin-bottom: 0.16rem;
-    padding-top: 0.8rem;
-  }
-
-  .push_card_btn .time_box {
-    font-size: 0.32rem;
-  }
-
-  .push_card_btn.disabled {
-    background: #ccc;
-    box-shadow: 0 0 0.2rem #ccc;
-  }
-
-  .push_card_btn.push_card_outside {
-    background: #13cc72;
-    box-shadow: 0 0 0.2rem #13cc72;
-  }
-
-  .push_card_btn.push_card_abnormal {
-    background: #ffb000;
-    box-shadow: 0 0 0.2rem #ffb000;
-  }
-
-  .error_msg_box {
-    text-align: center;
-    margin-top: 0.3rem;
-  }
-
-  .time_line_box h4 {
-    margin-top: 0;
-    font-size: 0.28rem;
-    margin-bottom: 0.2rem;
-    font-weight: normal;
-  }
-
-  .check_address_box {
-    font-size: 0.28rem;
-    line-height: 0.36rem;
-  }
-
-  .check_time_box {
-    font-size: 0.32rem;
-    margin-bottom: 0.1rem;
-    font-weight: bold;
-    color: #000;
-  }
-
-  .check_address_box * {
-    vertical-align: bottom;
-  }
-
-  .check_address_box .van-icon {
-    font-size: 0.32rem;
-    float: left;
-  }
-
-  .time_line_scroller {
-    transition: all 2s;
-    -moz-transition: all 2s;
-    -webkit-transition: all 2s;
-    -o-transition: all 2s;
-  }
-
-  .check_success_box {
-    font-size: 1.5rem;
-    line-height: 1;
-    text-align: center;
-    padding-top: 1rem;
-    color: #24a1ff
-  }
-
-  .check_result_time_box {
-    font-size: 1.5rem;
-    text-align: center;
-    color: #24a1ff;
-  }
-
-  .check_result_box {
-    font-size: 0.4rem;
-    text-align: center;
-    color: #24a1ff;
-    padding-bottom: 0.5rem;
-  }
-
-  .time_line_box .emptydiv {
-    height: 0.3rem;
-  }
-
-  .time_line_box [class*=van-hairline]::after {
-    border: none;
-  }
-
-  .image_box:after {
-    border: none !important;
-  }
-
-  .update_btn {
-    color: #24a1ff;
-    line-height: 2;
-    display: inline;
-  }
-
-</style>

+ 0 - 14
src/components/attendance/remedy.vue

@@ -1,14 +0,0 @@
-<template>
-  <div>
-    <van-nav-bar title="页面标题" left-text="返回" @click-left="$route_back" left-arrow></van-nav-bar>
-    <div class="body_com has_header">
-      <scroller>
-      </scroller>
-    </div>
-  </div>
-</template>
-<script>
-</script>
-<style scoped>
-.body_com{height: calc(100% - 1rem); position: relative;}
-</style>

+ 0 - 31
src/components/attendance/setting.vue

@@ -1,31 +0,0 @@
-<template>
-  <div style="height: 100%;">
-    <van-nav-bar title="考勤设置" left-text="返回"
-                 @click-left="$parent.active_index = 0" left-arrow>
-
-    </van-nav-bar>
-
-  </div>
-</template>
-
-<script>
-
-  export default {
-    name: "data_com",
-    data() {
-      return {
-
-      }
-    },
-    methods: {
-
-    },
-    created() {
-
-    }
-  }
-</script>
-
-<style scoped>
-
-</style>

+ 18 - 64
src/components/body/department.vue

@@ -12,17 +12,11 @@
           <van-icon name="arrow-left" /><span class="van-nav-bar__text">返回</span>
         </div>
       </template>
-      <!-- <template slot="right"  v-if="this.getRole_noe"  class="department_right_nav">
-        <van-dropdown-menu  duration="0.3" text="text"  class="head_dropdown_menu">
-          <van-dropdown-item title="+" @change="plus_menu" :options="options" />
-        </van-dropdown-menu>
-      </template> -->
-
     </van-nav-bar>
 
     <div class="work_body_com">
       <scroller ref="scroller_com" :on-refresh="refresh">
-        <van-search class="scroller-blur" placeholder="请输入搜索姓名" :disabled="true" @click="parent_click" />
+        <van-search class="scroller-blur" v-model="keyOword" placeholder="请输入搜索姓名" @input="searchUser()" />
          <div class="dept_path" v-show="pid_list_arr.length > 0 ">
           <a href="javascript:void(0);" @click="back_by_index(0)">全公司</a>
           <a
@@ -48,39 +42,13 @@
               </template>
             </van-cell>
           </van-cell-group>
-
-          <!-- <van-cell-group :border="false" v-show="pid != 0" >
-            <van-cell :is-link="this.getRole_noe" :title="dept_info.name" :border="false" clickable class="company_info">
-              <template slot="icon">
-                <img src="static/images/e66f.jpg" class="company_dept_img"/>
-              </template>
-              <template slot="title">
-                <Wxopendata type="userName" :openid="dept_info.name"></Wxopendata>
-              </template>
-              <template slot="label">
-                 <div v-if="showDepart" style="color: #909399;font-size: 14px;">主管:
-                      <span style="color: #909399;font-size: 14px;" v-for="(item,index) in dept_info.manager" :key="index">{{item.name}}</span>
-                  </div>
-                 <div v-if="!showDepart" style="color: #F56C6C;">主管未设置</div>
-              </template>
-            </van-cell>
-          </van-cell-group> -->
           <van-cell-group>
             <van-cell  v-if="isApp && false" is-link title="邀请成员" @click="show_share" class="new_employee_cell employee_cell">
               <template slot="icon">
                 <icon name="message_newinvit" class="message_newinvit"></icon>
               </template>
             </van-cell>
-            <!-- <van-cell v-if="this.getRole_noe"  is-link title="新成员" :to="{name: 'new_employee'}" class="new_employee_cell employee_cell">
-              <template slot="default">
-                <van-tag class="tag" :class="new_employee_num > 9?'num10':'num9'" round type="danger" size="medium" v-show="new_employee_num > 0">{{new_employee_num}}</van-tag>
-              </template>
-              <template slot="icon">
-                <icon name="message_newmember" class="message_newmember"></icon>
-              </template>
-            </van-cell> -->
           </van-cell-group>
-
           <!-- 部门列表 -->
           <van-cell-group>
             <van-cell is-link v-for="(item,index) in dept_list" v-show="item.pid == pid" :key="index" :title="item.name + ' ('+ item.count +')'" class="employee_cell" @click="show_child(item)">
@@ -91,7 +59,6 @@
                 <Wxopendata type="departmentName" :openid="item.name"></Wxopendata>({{item.count}})
               </template>
             </van-cell>
-
             <van-cell v-if="user_info.id==owner_id && pid_list == false" is-link title="加入申请" class="employee_cell" to="/join_review">
               <template slot="icon">
                 <img src="static/images/join_review.jpg" class="employee_cell_head_img"/>
@@ -100,8 +67,6 @@
           </van-cell-group>
 
           <div class="employee_item" :class="{'letter-first': index == 0 || (index > 0 && employee_list[index-1].letter_index != item.letter_index)}" v-for="(item,index) in employee_list " :key="index">
-            <div v-if="index == 0" :data-pageindex="item.letter_index" class="pageIndexBtn pageIndexBtnText">{{item.letter_index}}</div>
-            <div v-if="index > 0 && employee_list[index-1].letter_index != item.letter_index" :data-pageindex="item.letter_index" class="pageIndexBtn pageIndexBtnText">{{item.letter_index}}</div>
             <van-cell class="employee_cell" :title="item.name">
               <template slot="icon">
                 <userImage  :user_name="item.name" :img_url="item.img_url" width="0.9rem" height="0.9rem" style="margin-right: 0.24rem;" ></userImage>
@@ -144,17 +109,6 @@
       <van-nav-bar class="headerbar no-down-icon" title="通讯录" left-text="返回" @click-left="close_search_popup" left-arrow></van-nav-bar>
       <van-search ref="search1" class="scroller-blur" placeholder="请输入搜索姓名" v-model="keyword" />
       <div class="search_list">
-        <div class="employee_item" :class="{'letter-first': index == 0 || (index > 0 && search_result_list[index-1].letter_index != item.letter_index)}" v-for="(item,index) in search_result_list " :key="index">
-          <van-cell class="employee_cell" @click="employee_info(item)" :title="item.name">
-            <template slot="icon">
-              <userImage  :user_name="item.name" :img_url="item.img_url" width="0.9rem" height="0.9rem" style="margin-right: 0.24rem;" ></userImage>
-            </template>
-            <template slot="right-icon">
-              <van-tag plain v-show="item.manage_dept_ids.length>0">主管</van-tag>
-              <van-tag plain v-show="item.status == 0 || item.status == 2">{{item.status == 0 ?'未加入':'离职'}}</van-tag>
-            </template>
-          </van-cell>
-        </div>
       </div>
       <noData v-show="search_show" v-model="search_result_list" ></noData>
     </van-popup>
@@ -164,21 +118,6 @@
     </van-action-sheet>
 
     <qrcode v-if="show_qrcode" :show="qrcode_popup_show" :logo="company_info.logo_url" @changeShow="qrcode_popup_show=false"></qrcode>
-    <!-- 引导页 -->
-<!--    <van-popup class="guild_notice" v-model="showHelp" :close-on-click-overlay="false">
-      <div class="guild_dept_border">+</div>
-      <div class="guild_down_icon"></div>
-      <van-cell class="list" title-class="title" title="添加成员">
-        <template slot="default">
-          <span class="num">3 / 5</span>
-          <van-button class="next" type="info" @click="goAddEmployee" round size="small">下一步</van-button>
-        </template>
-        <template slot="label">
-          <span class="des">添加部门和员工</span>
-        </template>
-      </van-cell>
-    </van-popup> -->
-
   </div>
 
 </template>
@@ -190,6 +129,7 @@ import share from '@/components/common/share'
 import qrcode from '@/components/common/coreDialog'
 import userImage from '@/components/common/user_image'
 import Echo from 'laravel-echo'
+import { _throttle } from '@/utils/auth';
 import Vue from 'vue'
 import {Search, Tag, IndexBar, IndexAnchor, Skeleton, DropdownMenu, DropdownItem, ActionSheet, Toast, SwipeCell} from 'vant'
 Vue.use(Search).use(Tag).use(IndexBar).use(IndexAnchor).use(Skeleton).use(DropdownMenu).use(DropdownItem).use(ActionSheet).use(SwipeCell)
@@ -235,7 +175,10 @@ export default {
       db: null,
       new_employee_num: 0,
       showHelp: false,
-      getRole_noe: ''// 权限判断
+      getRole_noe: '',// 权限判断
+
+      keyOword: '',//搜索
+      deptId: 0,
     }
   },
   // 组件
@@ -265,6 +208,12 @@ export default {
     }
   },
   methods: {
+		//搜索
+		searchUser: _throttle(function() {
+      //keyOword
+      console.log(this.keyOword)
+      this.get_employee_list()
+    }),
     // // 添加人员
     // goAddEmployee () {
     //   this.showHelp = false
@@ -292,6 +241,7 @@ export default {
         this.pid = this.pid_list[index]
         this.pid_list.splice(index, 100)
         this.pid_list_arr.splice(index, 100)
+        this.deptId = this.pid
         this.get_employee_list(this.pid)
         this.get_department_list()
         return
@@ -302,6 +252,7 @@ export default {
       this.pid = this.pid_list[index]
       this.pid_list.splice(index, 100)
       this.pid_list_arr.splice(index, 100)
+      this.deptId = item.id
       this.get_employee_list(item.id)
       this.get_department_list(item.id)
       // this.get_dept_info(this.pid)
@@ -321,6 +272,7 @@ export default {
     // 下拉刷新
     refresh (done) {
       let self = this
+      this.deptId = this.pid
       self.get_employee_list(this.pid)
       self.get_department_list()
       setTimeout(() => {
@@ -337,6 +289,7 @@ export default {
         this.pid = newarray[newarray.length - 1].id
         // this.get_dept_info(this.pid)
       }
+      this.deptId = this.pid
       this.get_employee_list(this.pid)
     },
     show_child (item) {
@@ -344,6 +297,7 @@ export default {
       this.pid_list_arr.push(item)
       this.pid_list.push(item.pid)
       // this.get_dept_info(item.id)
+      this.deptId = item.id
       this.get_employee_list(item.id)
     },
     department_parse (dept_list, first) {
@@ -472,7 +426,7 @@ export default {
     // 查询员工列表
     get_employee_list (d) {
       this.showLoading()
-      request('get', '/api/employee/list', {dept_id: d, page_size: 20000}).then((res) => {
+      request('get', '/api/employee/list', {dept_id: this.deptId, page_size: 20000, keywords: this.keyOword}).then((res) => {
         if (res.data.code == 1) {
           this.showDom = true
           this.employee_list = res.data.data.list

+ 0 - 436
src/components/body/management.vue

@@ -1,436 +0,0 @@
-<template>
-  <div style="height: 100%;">
-    <!-- <van-nav-bar class="headerbar no-down-icon left-text-bold" left-text="管理中心"></van-nav-bar> -->
-    <scroller ref="work_box_scroller" class="all" style="position: relative">
-      <header class="header" v-if="isShowImg">
-       <van-swipe class="my-swipe" :autoplay="3000" indicator-color="#228dfa">
-          <template v-if="images.length>0">
-           <van-swipe-item v-for="(item,index) in images" :key="index"><img :src="item" /></van-swipe-item>
-          </template>
-          <van-swipe-item v-else>
-            <div class="defaultImg" @click="openTs()" :style="{backgroundImage:defaultImg}"></div>
-          </van-swipe-item>
-        </van-swipe>
-      </header>
-      <div class="main">
-        <div class="diy-notice-bar">
-          <div class="notice-left"><img style="width:0.44rem; height:0.44rem; vertical-align: top; margin-top: 0.25rem;" src="static/images/messageicon.png" /></div>
-          <div class="notice-content">
-            <van-swipe class="my-swipes" v-if="notice_list.length > 0" :show-indicators="false" :autoplay="60000" indicator-color="white" :vertical="true">
-              <!-- <van-swipe-item @click="$router.push({ name: 'bulletin_welfare_detail', query: { id: item.id, isOne: true } })" v-for="(item, index) in notice_list" :key="index"> -->
-              <van-swipe-item @click="$router.push({ name: 'bulletin_welfare'})" v-for="(item, index) in notice_list" :key="index">
-                {{ item.name }}
-              </van-swipe-item>
-            </van-swipe>
-            <van-swipe class="my-swipes"  v-if="notice_list.length == 0" :show-indicators="false" :autoplay="30000" indicator-color="white" :vertical="true">
-              <van-swipe-item @click="$router.push({ name: 'bulletin_welfare' })">点此发布第一条公告!</van-swipe-item>
-            </van-swipe>
-          </div>
-          <!-- <div class="notice-right" @click="$router.push({ name: 'bulletin_welfare' })">更多<van-icon name="arrow" /></div> -->
-        </div>
-      </div>
-      <footer class="footer">
-        <div class="app_list_box">
-          <div class=" flex-box flex-v-ce">
-            <div class="menu_title flex-1">应用</div>
-            <div class="flex-box flex-v-ce" style="font-size: 0.28rem;cursor: pointer;color: #606266" @click="add_common_menu">
-              更多<i class="van-icon van-icon-arrow van-cell__right-icon" style="margin-left: 0rem"></i>
-              </div>
-          </div>
-          <van-grid :border="false">
-            <van-grid-item v-if="common_menu.length>0" v-for="(app, app_index) in common_menu" :key="app_index" @click="url_jump(app)" :icon="app.icon" :text="app.code">
-              <template slot="icon">
-                <img :src="app.icon" />
-                <span class="num9" :class="{ num10: total > 9 }" color="#F56C6C"  v-if="total > 0&&app.code_id=='att_review'">{{ total }}</span>
-              </template>
-            </van-grid-item>
-
-            <van-grid-item @click="open_common_menu" text="添加">
-              <template slot="icon">
-                <img src="static/images/add_common_menu.png" />
-              </template>
-            </van-grid-item>
-          </van-grid>
-        </div>
-      </footer>
-      <div style="height:1rem"></div>
-    </scroller>
-  </div>
-</template>
-
-<script>
-import request from '@/utils/request'
-import request_kq from '@/utils/request-kq'
-import {getRole_two} from '@/utils/auth'
-import Vue from 'vue'
-import { NoticeBar, Swipe, SwipeItem, Dialog} from 'vant'
-Vue.use(NoticeBar).use(Swipe).use(SwipeItem).use(Dialog)
-
-export default {
-  name: 'management',
-  components: {},
-  data () {
-    return {
-      notice_list: [],
-      common_menu: [],
-      menu: [],
-      images: [],
-      isShowImg: false,
-      defaultImg: 'url(static/images/qyc.jpg)',
-      total: 0
-    }
-  },
-  mounted () {
-    // this.getKqList()
-  },
-  methods: {
-    // 获取考勤待审批条数
-    // getKqList () {
-    //   var data = {
-    //     page: 1,
-    //     type: -1,
-    //     status: 'waiting',
-    //     page_size: 10,
-    //     keyword: '',
-    //     is_reviewer: 1
-    //   }
-    //   request_kq('post', '/ad/review', data).then(res => {
-    //     this.total = res.data.data.total
-    //   })
-    // },
-    openTs () {
-      if (getRole_two()) {
-        Dialog({ message: '可在功道云系统后台企业信息中设置文化墙' })
-      }
-    },
-    // 获取常用应用
-    getMenu (res) {
-      if (!res) { return }
-      var menuCommon = window.plus ? JSON.parse(plus.storage.getItem('menuCommon')) : JSON.parse(localStorage.getItem('menuCommon'))
-      var menus = []
-      if (menuCommon.length > 0) {
-        menuCommon.forEach(itme => { menus.push(this.forEachMenu(itme)) })
-      }
-      this.common_menu = menus
-    },
-    // 遍历获取常用应用
-    forEachMenu (id) {
-      var menu = window.plus ? JSON.parse(plus.storage.getItem('menu')) : JSON.parse(localStorage.getItem('menu'))
-      var obj = {}
-      menu.forEach(menuItme => {
-        if (menuItme.child.length > 0) {
-          menuItme.child.forEach(item => {
-            if (item.code_id == id) {
-              obj = item
-            }
-          })
-        }
-      })
-      return obj
-    },
-    open_app (url) {
-      if (window.plus) {
-        let webview = plus.webview.create(url, url)
-        let StatusBarStyle = plus.navigator.getStatusBarStyle()
-        plus.nativeUI.showWaiting('加载中....')
-        webview.show(
-          'pop-in',
-          300,
-          function () {
-            // 窗口显示动画完成
-          },
-          { acceleration: 'capture' }
-        )
-        webview.onloaded = function () {
-          plus.nativeUI.closeWaiting()
-        }
-        webview.onclose = function () {
-          plus.navigator.setStatusBarStyle(StatusBarStyle)
-        }
-      }
-    },
-    download_app (app_url, url) {
-      let self = this
-      if (window.plus) {
-        plus.nativeUI.showWaiting('加载中....')
-        plus.downloader.createDownload(app_url, { filename: '_doc/update/' }, function (d, status) { // 新建的下载任务对象
-          if (status == 200) {
-            plus.zip.decompress(d.filename, '_doc/dir/', function () { // 解压缩Zip文件
-              plus.nativeUI.closeWaiting()// 关闭系统等待对话框
-              plus.storage.setItem(url.split('#')[0], app_url)
-              self.open_app(url)
-            },
-            function (error) {
-              console.log(error)
-            })
-          } else {
-            plus.nativeUI.alert('下载失败!')
-          }
-          plus.nativeUI.closeWaiting()
-        })
-          .start()
-      }
-    },
-    // 打开安装包
-    get_app_and_open (app_url, _url) {
-      let self = this
-      let app_path = '_doc/dir/'
-      let url = app_path + _url
-      if (window.plus) {
-        plus.io.getFileInfo({// 获取文件信息
-          success: function (ret) {
-            if (plus.storage.getItem(url.split('#')[0]) == app_url) {
-              self.open_app(url)
-            } else {
-              self.download_app(app_url, url)
-            }
-          },
-          filePath: url.split('#')[0],
-          fail: function (ret) {
-            // 打开失败,如果是文件不存在,则需要从服务器上下载压缩包
-            self.download_app(app_url, url)
-          }
-        })
-      }
-    },
-    // 下载安装包
-    url_jump (app) {
-      let url = app.url
-      let self = this
-      // 当是安装包时打开安装里的内容
-      if (app.download_url.indexOf('.zip') >= 0) {
-        if (window.plus) {
-          self.get_app_and_open(app.download_url, url)
-        } else {
-          self.$emit('url_jump', app)
-          localStorage.setItem('work_scroller_top', self.$refs['work_box_scroller'].getPosition().top)
-          window.location.href = url
-        }
-        return false
-      }
-      // 当不是安装包时使用
-      if (url.indexOf('http://') == 0 || url.indexOf('https://') == 0) {
-        if (window.plus) {
-          var webview = plus.webview.create(url, url)// 创建新的Webview窗口
-          webview.setStyle({// 设置Webview窗口
-            titleNView: {
-              titleColor: '#000',
-              autoBackButton: true,
-              buttons: [
-                {
-                  type: 'close',
-                  float: 'left',
-                  onclick: function () {
-                    webview.close()
-                  }
-                }
-              ]
-            }
-          })
-          plus.key.addEventListener('backbutton', function () { // 添加监听设置返回事件
-            webview.canBack(function (e) { // 看能不能返回
-              if (e.canBack) {
-                webview.back()
-              } else { // 不行就关闭,调用路由的返回
-                webview.close()
-                self.$route_back()
-              }
-            })
-          })
-          webview.show()
-        } else {
-          window.location.href = url
-        }
-      } else {
-        this.$router.push({ path: url })
-      }
-    },
-    add_common_menu () {
-      this.$router.push({ name: 'work', query: {common_menu: JSON.stringify(this.common_menu)}})
-    },
-    open_common_menu () {
-      this.$router.push({ name: 'add_common_menu'})
-    },
-    // 获取公告或福利和轮播图
-    get_notice_list () {
-      this.$toast.loading({
-        message: '加载中...',
-        loadingType: 'spinner'
-      })
-      var http1 = request('get', '/api/information/index')// 获取获取公告或福利
-      var http2 = request('get', '/api/integral/site/config')// 获取轮播图
-      Promise.all([http1, http2]).then(res => {
-        this.isShowImg = true
-        if (res[0].data.code == 1) {
-          let notice_list = [], data = res[0].data.data
-          for (let i in data) {
-            for (let k in data[i].list) {
-              notice_list.push(data[i].list[k])
-            }
-          }
-          // 排序一下
-          notice_list = notice_list.sort((a, b) => {
-            return b.id - a.id
-          })
-          this.notice_list = notice_list
-        }
-        if (res[1].data.code == 1) {
-          this.images = res[1].data.data.bg
-        }
-      }).finally(() => {
-        this.$toast.clear()
-      })
-    }
-  },
-  keep_alive_update: {
-    // 运用缓存更新方法来完成返回后的更新
-    update_common_menu_list: function (vm, data) {
-      vm.common_menu = data
-    },
-    update_notice_list: function (vm, data) {
-      vm.get_notice_list()
-    }
-  }
-}
-</script>
-
-<style scoped="scoped">
-  .num9 {
-    position: absolute;
-    text-align: center;
-    line-height: 0.4rem;
-    font-size: 0.28rem;
-    width: 0.4rem;
-    height: 0.4rem;
-    padding: 0px;
-    border-radius: 0.4rem;
-    z-index: 1;
-    background-color: #f56c6c;
-    font-weight: normal;
-    color: #fff;
-    top: -5px;
-    right: -10px;
-  }
-  .num10 {
-    padding: 0 0.08rem !important;
-    width: auto !important;
-    max-width: 0.8rem;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-  }
-  .defaultImg{
-    box-sizing: border-box;
-    border-radius: 6px;
-    width: 100%;
-    height: 2.5rem;
-    background-repeat: no-repeat;
-    background-size: cover;
-  }
-.app_list_box {
-  padding: 0 0.28rem;
-  margin-bottom: 0.32rem;
-}
-.app_list_box .menu_title {
-  font-size: 0.32rem;
-  color: #1c1c1c;
-  font-weight: bold;
-  margin:0.32rem;
-}
-.app_list_box /deep/ .van-grid-item {
-  margin-bottom: 0.4rem;
-}
-.app_list_box /deep/ .van-grid-item .van-grid-item__content {
-  padding: 0 !important;
-}
-.app_list_box /deep/ .van-grid-item .van-grid-item__content .van-grid-item__text {
-  font-size: 0.28rem;
-  color: #606266;
-  line-height: 0.44rem;
-  width: 1.4rem;
-  text-align: center;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  white-space: nowrap;
-}
-.app_list_box /deep/ .van-grid-item .van-grid-item__content .van-grid-item__icon-wrapper img {
-  width: 1.16rem;
-  height: 1.16rem;
-  border-radius: 0.42rem;
-}
-
-/* header */
-.all {
-  /* height: calc(100% - 0.92rem); */
-  height: calc(100%);
-  position: relative;
-  background-color: #fff;
-}
-.left-text-bold /deep/ .van-nav-bar__left {
-  font-size: 0.4rem !important;
-  font-weight: bold;
-}
-.header {
-  box-sizing: border-box;
-  padding:0.26rem 0.35rem;
-  padding-bottom: 0rem;
-}
-.my-swipe{
-  border-radius: 6px;
-}
-.my-swipe .van-swipe-item {
-   border-radius: 6px;
-}
-.my-swipe img {
-  box-sizing: border-box;
-  border-radius: 6px;
-  width: 100%;
-  height: 2.5rem;
-}
-
-/* main */
-.diy-notice-bar {
-  height: 0.92rem;
-  line-height: 0.92rem;
-  padding-left: 0.32rem;
-  padding-right: 0.32rem;
-  position: relative;
-  color: #909399;
-  border-bottom: 0.2rem solid #f5f7fa;
-}
-.diy-notice-bar .notice-content {
-  height: 0.92rem;
-  line-height: 0.92rem;
-  position: absolute;
-  left: 1rem;
-  right: 0.26rem;
-  overflow: hidden;
-}
-.diy-notice-bar .notice-left {
-  float: left;
-}
-.diy-notice-bar .notice-right {
-  float: right;
-  line-height: 0.92rem;
-  font-size: 0.32rem;
-}
-.diy-notice-bar .notice-right i {
-  float: right;
-  line-height: 0.92rem;
-}
-.header /deep/ .van-swipe__track {
-  border-radius: 6px;
-}
-.diy-notice-bar /deep/ .van-swipe__track {
-  width: 100% !important;
-  height: 0.92rem !important;
-}
-.diy-notice-bar /deep/ .van-swipe-item {
-  width: 100% !important;
-  font-size: 0.32rem;
-  overflow: hidden;
-  height: 100% !important;
-  white-space: nowrap;
-  text-overflow: ellipsis;
-}
-</style>

+ 0 - 439
src/components/body/message_list.vue

@@ -1,439 +0,0 @@
-<template>
-  <div style="height: 100%;">
-    <!-- <van-nav-bar class="headerbar no-down-icon left-text-bold" :left-text="'消息通知'">
-      <template slot="right">
-        <van-icon v-if="is_app" name="scan" @click="$router.push({ name: 'scanqr' })"></van-icon>
-      </template>
-    </van-nav-bar> -->
-    <div class="work_body_com">
-      <scroller :on-refresh="chat_msg_session_list">
-        <div class="message-header-box"></div>
-        <div class="bgfff">
-          <div class="message-header">
-            <van-row gutter="20">
-              <van-col span="12" class="event_list">
-                <van-button class="event" block @click="$router.push({ name: 'approval_list' })" icon="static/images/a1.png">审批<van-tag class="num92" :class="{ num10: review_count > 9 }" color="#F56C6C" round v-show="review_count > 0">{{ review_count }}</van-tag> </van-button>
-              </van-col>
-              <van-col span="12" class="event_list">
-                <van-button class="event" block @click="$router.push({ name: 'my_task' })" icon="static/images/a7.png">任务<van-tag class="num92" :class="{ num10: task_count > 9 }" color="#F56C6C" round v-show="task_count > 0">{{ task_count }}</van-tag></van-button>
-              </van-col>
-            </van-row>
-          </div>
-        </div>
-        <van-cell v-if="list_map[index]" is-link v-for="(item, index) in list" :key="index" :title="list_map[index].name" @click="readMsg(index,list_map[index].name)" class="employee_cell">
-          <!-- 时间 -->
-          <span style="font-size:0.24rem;" v-if="item.newInfo">{{ item.newInfo.create_time | msg_time }}</span>
-          <!-- ICON -->
-          <template slot="icon">
-            <img :src="list_map[index].avatar" class="employee_cell_head_img"/>
-          </template>
-          <!-- 数量 -->
-          <template slot="default">
-            <div class="tag_box">
-              <van-tag class="tag num9" :class="{ num10: item.total > 9 }" v-if="item.total > 0" round color="#F56C6C"></van-tag>
-            </div>
-          </template>
-          <!-- 内容 -->
-          <template slot="label" v-if="item.newInfo">
-            <span v-if="item.newInfo.title != ''" style="white-space:nowrap;text-overflow:ellipsis; width:3rem; display: inline-block; overflow: hidden;font-size:0.28rem;">
-                {{item.newInfo.title}}
-            </span>
-            <span v-else style="white-space:nowrap;text-overflow:ellipsis; width:3rem; display: inline-block; overflow: hidden;font-size:0.28rem;">
-                {{item.newInfo.title }}
-            </span>
-          </template>
-          <template slot="label" v-else>
-            <span style="white-space:nowrap;text-overflow:ellipsis; width:3rem; display: inline-block; overflow: hidden;font-size:0.28rem;">没有新通知</span>
-          </template>
-        </van-cell>
-        <van-cell v-if="list != null && !list[index]" is-link v-for="(item, index) in list_map" :key="index" :title="item.name" class="employee_cell">
-          <template slot="icon">
-            <img :src="item.avatar" class="employee_cell_head_img" />
-          </template>
-          <template slot="label">
-            <span style="white-space:nowrap;text-overflow:ellipsis; width:3rem; display: inline-block; overflow: hidden;font-size:0.28rem;">没有新通知</span>
-          </template>
-        </van-cell>
-      </scroller>
-    </div>
-  </div>
-</template>
-
-<script>
-import request from '@/utils/request'
-import { getToken } from '@/utils/auth'
-import Vue from 'vue'
-import { Search, DropdownMenu, Empty, DropdownItem, SwipeCell, NoticeBar, Tag } from 'vant'
-import moment from 'moment'
-Vue.use(Search).use(DropdownMenu).use(DropdownItem).use(SwipeCell).use(NoticeBar).use(Tag).use(Empty)
-export default {
-  name: 'message_list',
-  data () {
-    return {
-      tips: '没有通知',
-      is_app: false,
-      no_network: false,
-      qr_scan_mark: false,
-      plus_show: false,
-      barcode: null,
-      set_flash: false,
-      list: [],
-      total: 0,
-      cid: '',
-      db: null,
-      review_count: 0,
-      task_count: 0,
-      list_map: {}
-    }
-  },
-  filters: {
-    msg_time (time) {
-      let now = moment().valueOf() / 1000
-      let sub = now - time
-      let ret = ''
-      if (sub < 3 * 24 * 3600) {
-        ret = moment(time * 1000).format('MM-DD')
-      } else if (sub < 24 * 3600) {
-        ret = moment(time * 1000).format('HH:MM')
-      } else if (sub < 3600) {
-        ret = '1小时前'
-      } else if (sub < 1800) {
-        ret = '刚刚'
-      }
-      return ret
-    }
-  },
-  sockets: {
-    new_msg (data) {
-      let self = this
-      self.chat_msg_session_list(function () {})
-    },
-    send_msg_success (data) {
-      let self = this
-      self.chat_msg_session_list(function () {})
-    },
-    get_badge_num (data) {
-      let json = JSON.parse(data)
-      setBadgeNumber(json.num)
-    }
-  },
-  methods: {
-    clu () {
-      this.$emit('shwoCunt', {data: 456})
-    },
-    get_message_cate () {
-      let cate_list = false
-      if (window.plus) {
-        cate_list = plus.storage.getItem('message_cate_list')
-      } else {
-        cate_list = localStorage.getItem('message_cate_list')
-      }
-      if (cate_list) {
-        this.list_map = JSON.parse(cate_list)
-        return
-      }
-      request('get', '/api/notice/cate').then(res => {
-        if (res.data.code == 1) {
-          try {
-            this.list_map = {}
-            for (let i in res.data.data) {
-              if (res.data.data[i].is_list == 1 && res.data.data[i].remark != "考勤通知") {//当前无考勤通知,在此处先做限制
-                this.list_map[res.data.data[i].cate] = { name: res.data.data[i].remark, avatar: res.data.data[i].icon }
-              }
-            }
-            if (window.plus) {
-              plus.storage.setItem('message_cate_list', JSON.stringify(this.list_map))
-            } else {
-              localStorage.setItem('message_cate_list', JSON.stringify(this.list_map))
-            }
-          } catch (e) {
-            console.log(e)
-          }
-        }
-      })
-    },
-    readMsg (item, title) {
-      console.log('11111111111')
-      console.log(item)
-      console.log(title)
-      this.$router.push({ name: 'message_detail', query: { cate: item, title: title }})
-    },
-    chat_msg_session_list (done) {
-      var http1 = request('get', '/api/notice/index', '', 'v2')// 获取未读信息
-      var http2 = request('get', '/api/integral/review/list', {type: 'waiting', page: 1, pt_id: 0, source_type: 0})// 获取为审批数量
-      var http3 = request('get', '/api/integral/work/list', {status: 'running', page: 1, pt_id: 0})// 获取任务数
-      Promise.all([http1, http2, http3]).then(item => {
-        if (item[0]) {
-          var data = item[0].data.data.list
-          this.list = data
-          this.total = 0
-          for (let i in data) { this.total += data[i].total }
-          // 设置APP的角标
-          if (window.plus) { setBadgeNumber(this.total) }
-        }
-        if (item[1]) {
-          this.review_count = item[1].data.data.total
-        }
-        if (item[2]) {
-          this.task_count = item[2].data.data.total
-          done()
-        }
-      })
-    },
-    get_review_count () {
-      request('get', '/api/integral/review/list', {
-        type: 'waiting',
-        page: 1,
-        pt_id: 0,
-        source_type: 0
-      }).then(res => {
-        if (res.data.code == 1) {
-          this.review_count = res.data.data.total
-        }
-      })
-    },
-    get_task_count () {
-      request('get', '/api/integral/work/list', {
-        status: 'running',
-        page: 1,
-        pt_id: 0
-      }).then(res => {
-        if (res.data.code == 1) {
-          this.task_coun = res.data.data.total
-        }
-      })
-    }
-  },
-  created () {
-    this.get_message_cate()
-  },
-  mounted () {
-    if (window.plus) {
-      this.is_app = true
-    }
-  },
-  keep_alive_update: {
-    // 运用缓存更新方法来完成返回后的更新
-    update_approval_list: function (vm, data) {
-      vm.chat_msg_session_list(function () {})
-      vm.clu();
-    },
-    update_task_message: function (vm, data) {
-      vm.chat_msg_session_list(function () {})
-      vm.clu();
-    },
-    update_message_list: function (vm, data) {
-      vm.$store.dispatch('get_user_info', getToken()).then(res => {
-        vm.chat_msg_session_list(function () {})
-        vm.clu();
-      })
-    },
-    update_msgInformation: function (vm, data) {
-      vm.chat_msg_session_list(function () {})
-      vm.clu();
-    }
-  }
-}
-</script>
-
-<style scoped>
-.left-text-bold /deep/ .van-nav-bar__left {
-  font-size: 0.4rem !important;
-  font-weight: bold;
-}
-.cur_company_name {
-  line-height: 1rem;
-  text-indent: 0.5em;
-  cursor: pointer;
-}
-
-.menu_title {
-  text-indent: 0.5em;
-  margin-bottom: 0.16rem;
-}
-
-.work_body_com {
-  /* height: calc(100% - 0.92rem); */
-  height: calc(100%);
-  position: relative;
-}
-
-.van-radio-group {
-  padding: 0.24rem 0.32rem;
-}
-
-.van-radio {
-  height: 0.8rem;
-}
-
-.employee_cell_head_img {
-  width: 0.96rem;
-  height: 0.96rem;
-  -webkit-border-radius: 0.1rem;
-  -moz-border-radius: 0.1rem;
-  border-radius: 0.1rem;
-  margin-right: 0.32rem;
-}
-
-.employee_cell {
-  padding: 0.2rem 0.32rem;
-}
-
-.employee_cell .van-cell__title {
-  line-height: 0.5rem;
-  font-size: 0.36rem;
-  font-weight: bold;
-}
-
-.employee_cell .van-cell__title .van-cell__value {
-  font-size: 0.28rem;
-}
-
-.employee_cell .van-cell__right-icon {
-  display: none;
-}
-
-.employee_cell .van-cell__label {
-  font-weight: normal;
-  font-size: 0.28rem;
-}
-
-.user_index_scroller_com .van-icon-scan {
-  color: #fff !important;
-  padding-right: 0.32rem;
-}
-
-.user_index_scroller_com .van-icon-scan:before {
-  font-size: 0.4rem;
-}
-
-.message-header .van-tag {
-  display: inline-block;
-  text-align: center;
-  line-height: 0.4rem;
-  font-size: 0.28rem;
-  width: 0.4rem;
-  height: 0.4rem;
-  padding: 0;
-  -webkit-border-radius: 0.4rem !important;
-  -moz-border-radius: 50px;
-  border-radius: 50px;
-  position: absolute;
-  /* font-family: Arial; */
-}
-
-.message-header .van-tag.gt9 {
-  padding: 0 0.1rem;
-  width: auto;
-}
-
-.message-header-box {
-  position: relative;
-  width: 100vw;
-  height: 0.8rem;
-  background: #26a2ff;
-  z-index: 1;
-}
-
-.message-header {
-  position: relative;
-  width: calc(100vw - 0.64rem);
-  height: 1.44rem;
-  padding: 0;
-  margin-top: -0.6rem;
-  margin-left: auto;
-  margin-right: auto;
-  background: #fff;
-  border-radius: 0.16rem;
-  box-shadow: 0rem 0.04rem 0.12rem rgba(0, 0, 0, 0.03);
-  z-index: 2;
-  background-color: #fff;
-}
-
-.message-header /deep/ .van-row {
-  margin: 0 !important;
-  padding: 0;
-}
-
-.message-header .event_list {
-  width: calc(100% / 2);
-  padding: 0 !important;
-  margin-left: -0.2rem;
-}
-
-.message-header .event_list .event {
-  display: block;
-  text-align: center;
-  margin: 0.24rem 0;
-  padding: 0;
-  border: none;
-  background: transparent;
-}
-
-.message-header .event_list .event:before {
-  display: none;
-  background: none;
-}
-
-.message-header .event_list .event img {
-  display: inline-block;
-  width: 0.98rem;
-  height: 0.98rem;
-  margin-right: 0.1rem;
-}
-
-.message-header .event_list .event /deep/ .van-button__text {
-  display: inline-block;
-  font-size: 0.32rem;
-  font-weight: bold;
-  margin-top: 0.1rem;
-}
-
-.message-header .event_list .event /deep/ .van-tag--round {
-  margin: 0.2rem 0 0 0.1rem;
-}
-.bgfff {
-  background-color: #fff;
-  padding-bottom: 0.32rem;
-}
-.employee_cell:after {
-  left: 0rem;
-}
-
-.num9 {
-  display: inline-block;
-  text-align: center;
-  line-height: 0.2rem;
-  font-size: 0.28rem;
-  width: 0.2rem;
-  height: 0.2rem;
-  padding: 0px;
-  border-radius: 0.4rem;
-  z-index: 1;
-  background-color: #f56c6c;
-  /* font-family: Arial; */
-  font-weight: normal;
-}
-.num92 {
-  display: inline-block;
-  text-align: center;
-  line-height: 0.4rem;
-  font-size: 0.28rem;
-  width: 0.4rem;
-  height: 0.4rem;
-  padding: 0px;
-  border-radius: 0.4rem;
-  z-index: 1;
-  background-color: #f56c6c;
-  /* font-family: Arial; */
-  font-weight: normal;
-}
-.num10 {
-  padding: 0 0.08rem !important;
-  width: auto !important;
-  max-width: 0.8rem;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  white-space: nowrap;
-}
-</style>

+ 285 - 36
src/components/body/statistics.vue

@@ -1,6 +1,5 @@
 <template>
   <div style="height: 100%;">
-    <!-- <van-nav-bar class="headerbar no-down-icon left-text-bold" left-text="首页"></van-nav-bar> -->
     <scroller ref="scroller" class="all" style="position: relative" :on-refresh="refresh">
       <!-- 我的积分 我的绩效 -->
       <template v-if="getRole_three">
@@ -25,41 +24,50 @@
                 </div>
               </div>
             </div>
-            <div class="flex-1 flex-box flex-v-ce integral_left" v-show="rankingIndex == 2" @click="openUrl(7)">
-              <div class="flex-1 integral_b2">
-                <div class="color_ccc">绩效分</div>
-                <div class="color-blue num">{{ userStatistics.performance.base_point || returnStr(userStatistics.performance.base_point) }}</div>
-              </div>
-              <div class="flex-1 integral_b2">
-                <div class="color_ccc">绩效进度</div>
-                <div class="color-blue num">
-                  {{ userStatistics.performance.complete_count || returnStr(userStatistics.performance.complete_count) }} /
-                  {{ userStatistics.performance.total_count || returnStr(userStatistics.performance.total_count) }}
-                </div>
-              </div>
-            </div>
             <div class="flex-box integral_right">
               <div :class="rankingIndex == 1 ? 'active' : ''" @click="rankingIndex = 1">A&B</div>
-              <!-- 暂时隐藏绩效 -->
-              <!-- <div :class="rankingIndex == 2 ? 'active' : ''" @click="rankingIndex = 2">绩效</div> -->
             </div>
           </div>
         </div>
       </template>
+      <div class="app_list_box" :class="{applistBox: !getRole_three}">
+        <div class="applist_col flex-box flex-d-center">
+          <span class="" style="font-size:0.32rem;">常用应用</span>
+          <span style="color: #909399;font-size:0.29rem;display:flex;" @click="$emit('active2',1)">全部应用<van-icon name="arrow" :class="isIos?'isIos':'isAnd'" /></span>
+        </div>
+        <van-grid :border="false">
+          <van-grid-item v-if="common_menu.length > 0" v-for="(app, app_index) in common_menu" :key="app_index" @click="url_jump(app)" :icon="app.icon" :text="app.code">
+            <template slot="icon">
+              <img :src="app.icon" />
+              <span class="num9" :class="{ num10: total > 9 }" color="#F56C6C"  v-if="total > 0&&app.code_id=='att_review'">{{ total }}</span>
+              <span class="num9" :class="{ num10: total > 9 }" color="#F56C6C"  v-if="review_count > 0&&app.code_id=='examine'">{{ review_count }}</span>
+              <span class="num9" :class="{ num10: total > 9 }" color="#F56C6C"  v-if="task_count > 0&&app.code_id=='task'">{{ task_count }}</span>
+            </template>
+          </van-grid-item>
+
+          <van-grid-item @click="open_common_menu" text="添加">
+            <template slot="icon">
+              <img src="static/images/add_common_menu.png" />
+            </template>
+          </van-grid-item>
+        </van-grid>
+      </div>
+
       <!-- 我的排行榜 -->
       <div class="rankingList" v-if="rankingList.length > 0">
-        <div class="curr-bpoint__title flex-box flex-v-ce">
-          <span class="flex-1" style="font-size:0.32rem;">排行榜</span>
-          <!-- <span style="font-size: 12px;color: #909399;">最近更新: {{ rankingList[0].update_time }}</span> -->
+        <div class="curr-bpoint__title flex-box flex-d-center">
+          <span class="chart-title__title" style="font-size:0.32rem;">排行榜</span>
           <span style="font-size: 12px;color: #909399;">每小时更新一次</span>
         </div>
         <div @click="openUrl(1, item)" v-for="(item, index) in rankingList" :key="index">
-          <div class="flex-box flex-v-ce ranking_list">
-            <div class="ranking_name font-flex-word">{{ item.group_name.slice(0, 2) }}</div>
-            <div class="ranking_num flex-1">
-              <div>{{ item.group_name }}</div>
-              <span class="color_ccc" v-if="getRole_four">第 {{ item.rank }} 名:<Wxopendata type="userName" :openid="item.employee_name"></Wxopendata></span>
-              <span class="color_ccc" v-else>第 {{ item.rank }} 名</span>
+          <div class="flex-box flex-d-center ranking_list">
+            <div class="flex-box">
+              <div class="ranking_name font-flex-word">{{ item.group_name.slice(0, 2) }}</div>
+              <div class="ranking_num">
+                <div>{{ item.group_name }}</div>
+                <span class="color_ccc" v-if="getRole_four">第 {{ item.rank }} 名:<Wxopendata type="userName" :openid="item.employee_name"></Wxopendata></span>
+                <span class="color_ccc" style="font-size:0.25rem;" v-else>第 {{ item.rank }} 名</span>
+              </div>
             </div>
             <i class="van-icon van-icon-arrow van-cell__right-icon"></i>
           </div>
@@ -72,7 +80,7 @@
       <!-- 管理者奖扣 -->
       <div class="chart-statistics__item" v-if="getRole_two">
         <div class="chart-title__bar">
-          <div class="chart-title__title">管理者奖扣</div>
+          <div class="chart-title__title">当月管理者奖扣</div>
           <div class="chart-legend__wrap">
             <span class="chart-legend__pink">奖分</span>
             <span class="chart-legend__green">扣分</span>
@@ -89,14 +97,6 @@
           <noData detail_text="暂无管理者" />
         </template>
       </div>
-      <!-- 团队绩效 -->
-      <!-- <div class="flex-box flex-v-ce team_performance" @click="openUrl(4)" v-if="getRole_two">
-        <div class="flex-1">
-          <div>本月团队绩效情况</div>
-          <div class="color_ccc">查看详情</div>
-        </div>
-        <i class="van-icon van-icon-arrow van-cell__right-icon"></i>
-      </div> -->
       <div style="height: 1rem;"></div>
     </scroller>
   </div>
@@ -108,11 +108,12 @@ import ECharts from 'echarts'
 import { getRole_three, getRole_two, getRole_four, getToken } from '@/utils/auth'
 import moment from 'moment'
 import Vue from 'vue'
-import { NoticeBar, Swipe, SwipeItem, Cell } from 'vant'
+import { NoticeBar, Swipe, SwipeItem, Cell, Icon } from 'vant'
 Vue.use(NoticeBar)
   .use(Swipe)
   .use(SwipeItem)
   .use(Cell)
+  .use(Icon)
 
 export default {
   name: 'statistics',
@@ -137,10 +138,37 @@ export default {
       pieTotal: 0,
       getRole_three: '',
       getRole_two: '',
-      getRole_four: ''
+      getRole_four: '',
+
+      
+      common_menu: [],
+      total: 0,
+      
+      review_count: 0,
+      task_count: 0,
+      new_list:[
+        {
+          code: '任务',
+          icon: 'static/images/a7.png',
+          code_id: 'task',
+          url: '/my_task',
+          download_url: '',
+        },
+        {
+          code: '审批',
+          icon: 'static/images/a1.png',
+          code_id: 'examine',
+          url: '/approval_list',
+          download_url: '',
+        },
+      ],
+      isIos: false,
     }
   },
   mounted () {
+    const u = navigator.userAgent;
+    const isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios终端
+    this.isIos = isIOS
     this.$store.dispatch('get_user_info', getToken()).then(res => {
       this.getRole_three = getRole_three()
       this.getRole_two = getRole_two()
@@ -150,6 +178,10 @@ export default {
       var myChart1 = ECharts.init(this.$refs.situationChart)
       myChart1.resize()
     })
+    
+    this.$store.dispatch('getMenu').then(res => {
+      this.getMenu(res)
+    })
   },
   beforeDestroy () {
   	// 离开路由
@@ -159,11 +191,62 @@ export default {
     })
   },
   methods: {
+    chat_msg_session_list () {
+      var http1 = request('get', '/api/integral/review/list', {type: 'waiting', page: 1, pt_id: 0, source_type: 0})// 获取为审批数量
+      var http2 = request('get', '/api/integral/work/list', {status: 'running', page: 1, pt_id: 0})// 获取任务数
+      Promise.all([http1, http2]).then(item => {
+        if (item[0]) {
+          this.review_count = item[0].data.data.total
+        }
+        if (item[1]) {
+          this.task_count = item[1].data.data.total
+        }
+      })
+    },
+    clu () {
+      this.$emit('shwoCunt', {data: 456})
+    },
+
+    // 获取常用应用
+    getMenu (res) {
+      if (!res) { return }
+      var menuCommon = window.plus ? JSON.parse(plus.storage.getItem('menuCommon')) : JSON.parse(localStorage.getItem('menuCommon'))
+      var menus = []
+      if (menuCommon.length > 0) {
+        menuCommon.forEach(itme => { menus.push(this.forEachMenu(itme)) })
+      }
+      this.new_list.forEach((item)=>{
+        menus.unshift(item)
+      })
+      this.common_menu = menus
+    },
+    // 遍历获取常用应用
+    forEachMenu (id) {
+      var menu = window.plus ? JSON.parse(plus.storage.getItem('menu')) : JSON.parse(localStorage.getItem('menu'))
+      var obj = {}
+      menu.forEach(menuItme => {
+        if (menuItme.child.length > 0) {
+          menuItme.child.forEach(item => {
+            if (item.code_id == id) {
+              obj = item
+            }
+          })
+        }
+      })
+      return obj
+    },
+    open_common_menu () {
+      this.$router.push({ name: 'add_common_menu'})
+    },
     returnStr (str) {
       return str == '0' ? '0' : '--'
     },
     // 下拉刷新
     refresh (done) {
+      this.chat_msg_session_list()
+      this.$store.dispatch('getMenu').then(res => {
+        this.getMenu(res)
+      })
       this.getInitData(done)
     },
     // 管理者奖扣
@@ -440,6 +523,102 @@ export default {
           break
         }
       }
+    },
+
+    
+    // 下载安装包
+    url_jump (app) {
+      let url = app.url
+      let self = this
+      // 当是安装包时打开安装里的内容
+      if (app.download_url.indexOf('.zip') >= 0) {
+        if (window.plus) {
+          self.get_app_and_open(app.download_url, url)
+        } else {
+          self.$emit('url_jump', app)
+          localStorage.setItem('work_scroller_top', self.$refs['work_box_scroller'].getPosition().top)
+          window.location.href = url
+        }
+        return false
+      }
+      // 当不是安装包时使用
+      if (url.indexOf('http://') == 0 || url.indexOf('https://') == 0) {
+        if (window.plus) {
+          var webview = plus.webview.create(url, url)// 创建新的Webview窗口
+          webview.setStyle({// 设置Webview窗口
+            titleNView: {
+              titleColor: '#000',
+              autoBackButton: true,
+              buttons: [
+                {
+                  type: 'close',
+                  float: 'left',
+                  onclick: function () {
+                    webview.close()
+                  }
+                }
+              ]
+            }
+          })
+          plus.key.addEventListener('backbutton', function () { // 添加监听设置返回事件
+            webview.canBack(function (e) { // 看能不能返回
+              if (e.canBack) {
+                webview.back()
+              } else { // 不行就关闭,调用路由的返回
+                webview.close()
+                self.$route_back()
+              }
+            })
+          })
+          webview.show()
+        } else {
+          window.location.href = url
+        }
+      } else {
+        this.$router.push({ path: url })
+      }
+    },
+  },
+  sockets: {
+    new_msg (data) {
+      let self = this
+      self.chat_msg_session_list(function () {})
+    },
+    send_msg_success (data) {
+      let self = this
+      self.chat_msg_session_list(function () {})
+    },
+    get_badge_num (data) {
+      let json = JSON.parse(data)
+      setBadgeNumber(json.num)
+    }
+  },
+  keep_alive_update: {
+    // 运用缓存更新方法来完成返回后的更新
+    update_common_menu_list: function (vm, data) {
+      vm.new_list.forEach((item)=>{
+        data.unshift(item)
+      })
+      vm.common_menu = data
+    },
+
+    update_approval_list: function (vm, data) {
+      vm.chat_msg_session_list(function () {})
+      vm.clu();
+    },
+    update_task_message: function (vm, data) {
+      vm.chat_msg_session_list(function () {})
+      vm.clu();
+    },
+    update_message_list: function (vm, data) {
+      vm.$store.dispatch('get_user_info', getToken()).then(res => {
+        vm.chat_msg_session_list(function () {})
+        vm.clu();
+      })
+    },
+    update_msgInformation: function (vm, data) {
+      vm.chat_msg_session_list(function () {})
+      vm.clu();
     }
   }
 }
@@ -637,4 +816,74 @@ export default {
 .num {
   font-family: DIN-Medium;
 }
+.num9 {
+  position: absolute;
+  text-align: center;
+  line-height: 0.4rem;
+  font-size: 0.28rem;
+  width: 0.4rem;
+  height: 0.4rem;
+  padding: 0px;
+  border-radius: 0.4rem;
+  z-index: 1;
+  background-color: #f56c6c;
+  font-weight: normal;
+  color: #fff;
+  top: -5px;
+  right: -5px;
+}
+.num10 {
+  padding: 0 0.08rem !important;
+  width: auto !important;
+  max-width: 0.8rem;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.applist_col{
+  // background-color: #f5f7fa;
+  padding: 0 0 .3rem 0;
+}
+.app_list_box {
+  background-color: #fff;
+  padding: 0 0.28rem;
+  margin-bottom: 0.32rem;
+}
+.app_list_box .menu_title {
+  font-size: 0.32rem;
+  color: #1c1c1c;
+  font-weight: bold;
+  margin:0.32rem;
+}
+.app_list_box /deep/ .van-grid-item {
+  margin-bottom: 0.4rem;
+}
+.app_list_box /deep/ .van-grid-item .van-grid-item__content {
+  padding: 0 !important;
+}
+.app_list_box /deep/ .van-grid-item .van-grid-item__content .van-grid-item__text {
+  font-size: 0.28rem;
+  color: #606266;
+  line-height: 0.44rem;
+  width: 1.4rem;
+  text-align: center;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.app_list_box /deep/ .van-grid-item .van-grid-item__content .van-grid-item__icon-wrapper img {
+  width: 1rem;
+  height: 1rem;
+  border-radius: 0.42rem;
+}
+.applistBox{
+  padding-top: .4rem;
+}
+
+.isIos{
+  margin: .06rem 0 0 .05rem;
+}
+.isAnd{
+  margin: .08rem 0 0 .05rem;
+}
 </style>

+ 2 - 12
src/components/body/user_center.vue

@@ -34,14 +34,14 @@
         <icon class="cell-item__icon" name="about_platform"/>
       </template>
     </van-cell> -->
-    <van-cell is-link to="help">
+    <!-- <van-cell is-link to="help">
       <template slot="title">
         <span class="cell-item__title">帮助与建议</span>
       </template>
       <template slot="icon">
         <icon class="cell-item__icon" name="help_suggest"/>
       </template>
-    </van-cell>
+    </van-cell> -->
     <van-cell is-link @click="openfx()">
       <template slot="title">
         <span class="cell-item__title">推荐功道云给好友</span>
@@ -144,16 +144,6 @@ export default {
     openfx () {
       this.$toast('请点击右上角分享')
       return
-      let pictures = '_www/static/images/logo.png'
-      if (window.plus && window.plus.os.name == 'Android') {
-        pictures = window.plus.io.convertLocalFileSystemURL(pictures)
-      }
-      this.share_data.type = 'web'
-      this.share_data.title = '30000+用户认可【功道云】,做您身边的管理顾问!'
-      this.share_data.content = '我正在使用功道云-专注员工激励,帮助企业解决管人难的问题'
-      this.share_data.thumbs = [pictures]
-      this.share_data.href = process.env.APP_DOWNDOAD_URL
-      this.show = true
     },
     // 重启应用
     restartApp () {

+ 3 - 408
src/components/body/work.vue

@@ -1,48 +1,8 @@
 <template>
   <div style="height: 100%;">
-   <van-nav-bar title="应用" left-text="返回" @click-left="$route_back" left-arrow></van-nav-bar>
     <div class="work_body_com">
-      <van-dialog @confirm="company_change" cancel-button-text="取消" :show-cancel-button="true" v-model="company_list_box_show" confirm-button-text="切换">
-        <van-radio-group v-model="cur_company_id">
-          <van-radio :name="item.id" v-for="(item, index) in company_list" :key="index">{{ item.name }}</van-radio>
-        </van-radio-group>
-      </van-dialog>
       <scroller ref="work_box_scroller" :onScrolling="get_scroller_top">
-<!--        <div class="diy-notice-bar">
-          <div class="notice-left"><img style="width:0.44rem; height:0.44rem; vertical-align: top;    margin-top: 0.25rem;" src="static/images/messageicon.png" /></div>
-          <div class="notice-content">
-            <van-swipe class="my-swipe" v-if="notice_list.length > 0" :show-indicators="false" :autoplay="60000" indicator-color="white" :vertical="true">
-              <van-swipe-item @click="$router.push({ name: 'bulletin_welfare_detail', query: { id: item.id,isOne:true } })" v-for="(item, index) in notice_list" :key="index">
-                {{ item.name }}
-              </van-swipe-item>
-            </van-swipe>
-            <van-swipe class="my-swipe" v-if="notice_list.length == 0" :show-indicators="false" :autoplay="30000" indicator-color="white" :vertical="true">
-              <van-swipe-item>欢迎使用功道云积分管理系统!!!</van-swipe-item>
-            </van-swipe>
-          </div>
-          <div class="notice-right" @click="$router.push({ name: 'bulletin_welfare' })">
-            更多
-            <van-icon name="arrow" />
-          </div>
-        </div> -->
-
         <div style="margin-top:0.32rem;"></div>
-<!--        <div class="app_list_box">
-          <div class="menu_title">常用</div>
-          <van-grid :border="false">
-            <van-grid-item v-for="(app, app_index) in common_menu" :key="app_index" @click="url_jump(app)" :icon="app.icon" :text="app.code">
-              <template slot="icon">
-                <img :src="app.icon" />
-              </template>
-            </van-grid-item>
-
-            <van-grid-item @click="add_common_menu" text="添加常用">
-              <template slot="icon">
-                <img src="static/images/add_common_menu.png" />
-              </template>
-            </van-grid-item>
-          </van-grid>
-        </div> -->
         <div v-for="(item, index) in app_list" :key="index" class="app_list_box">
           <div class="menu_title">{{ item.remark }}</div>
           <van-grid :border="false">
@@ -62,66 +22,17 @@
 
 <script>
 import request from '@/utils/request'
-import request_kq from '@/utils/request-kq'
 import Vue from 'vue'
-import { NoticeBar, Swipe, SwipeItem } from 'vant'
-Vue.use(NoticeBar).use(Swipe).use(SwipeItem)
 
 export default {
   name: 'work',
   data () {
     return {
-      ruleTrees: [],
-      // notice_list: [],
-      bottom_line_show: false,
-      cur_company_id: 0,
-      company_list_box_show: false,
-      company_list: [
-        {
-          id: 1,
-          name: '民之网',
-          is_main: 1
-        }
-      ],
-      common_menu: JSON.parse(this.$route.query.common_menu),
       app_list: window.plus ? JSON.parse(plus.storage.getItem('menu')) : JSON.parse(localStorage.getItem('menu')),
-      updating: false,
       total: 0
     }
   },
   methods: {
-    // getKqList () {
-    //   var data = {
-    //     page: 1,
-    //     type: -1,
-    //     status: 'waiting',
-    //     page_size: 10,
-    //     keyword: '',
-    //     is_reviewer: 1
-    //   }
-    //   request_kq('post', '/ad/review', data).then(res => {
-    //     this.total = res.data.data.total
-    //   })
-    // },
-    getLocalStorage (name) {
-      let employeeMap = window.plus ? JSON.parse(plus.storage.getItem('SET_EMPLOYEE_MAP')) : JSON.parse(localStorage.getItem('SET_EMPLOYEE_MAP'))
-      if (employeeMap) {
-        let arr = Object.keys(employeeMap)
-        if (window.plus) {
-          return plus.storage.getItem(name) || arr.length > 1
-        } else {
-          return localStorage.getItem(name) || arr.length > 1
-        }
-      }
-    },
-    goScrollTo () {
-      setTimeout(() => {
-        this.$refs.work_box_scroller.scrollTo(0, 2000)
-      }, 300)
-    },
-    add_common_menu () {
-      this.$router.push({ name: 'add_common_menu'})
-    },
     open_app (url) {
       if (window.plus) {
         let webview = plus.webview.create(url, url)
@@ -243,65 +154,6 @@ export default {
     get_scroller_top (top) {
       this.scrollertop = top
     },
-    get_company_list () {
-      return
-      let self = this
-      request('get', '/addons/ems/employee/get_company_list').then(res => {
-        if (res.data.code == 1) {
-          self.company_list = res.data.data
-          for (let i in res.data.data) {
-            if (res.data.data[i].is_main == 1) {
-              self.cur_company_id = res.data.data[i].id
-            }
-          }
-        } else {
-          if (res.data.code == 999) {
-            // 没有组织
-            setTimeout(() => {
-              self.$router.push({ name: 'create_company' })
-            }, 500)
-          }
-        }
-      })
-        .catch(e => {})
-    },
-    get_notice_list () {
-      request('get', '/api/information/index').then(res => {
-        if (res.data.code == 1) {
-          let notice_list = []
-          for (let i in res.data.data) {
-            for (let k in res.data.data[i].list) {
-              notice_list.push(res.data.data[i].list[k])
-            }
-          }
-          // 排序一下
-          notice_list = notice_list.sort((a, b) => {
-            return b.id - a.id
-          })
-          this.notice_list = notice_list
-        }
-      })
-    },
-    get_app_list () {
-      let self = this
-    },
-    company_change () {
-      let self = this
-      self.$toast.loading({
-        mask: true,
-        message: '正在切换...'
-      })
-      request('post', '/addons/ems/employee/company_change', { id: this.cur_company_id }).then(res => {
-        self.$toast.clear()
-        self.get_company_list()
-        self.get_app_list()
-      })
-    },
-    refresh (done) {
-      let self = this
-      self.get_app_list(done)
-      self.get_company_list()
-    }
   },
   created () {
     let self = this
@@ -315,15 +167,6 @@ export default {
       }
     })
   },
-  keep_alive_update: {
-    // 运用缓存更新方法来完成返回后的更新
-    update_common_menu_list: function (vm, data) {
-      vm.common_menu = data
-    },
-    update_notice_list: function (vm, data) {
-      // vm.get_notice_list()
-    }
-  }
 }
 </script>
 
@@ -352,76 +195,16 @@ export default {
     text-overflow: ellipsis;
     white-space: nowrap;
   }
-.cur_company_name {
-  line-height: 1rem;
-  text-indent: 0.5em;
-  cursor: pointer;
-  position: relative;
-}
-
-.cur_company_name:before {
-  content: ' ';
-  height: 1px; /*no*/
-  left: -50%;
-  bottom: 0;
-  right: -50%;
-  background: #eee;
-  -webkit-transform: scale(0.5);
-  transform: scale(0.5);
-}
-
-.bottom_line_show:before {
-  position: absolute;
-}
 
 .menu_title {
   margin: 0rem 0.32rem 0.3rem;
 }
 
 .work_body_com {
-  height: calc(100% - 0.92rem);
+  height: calc(100% - 0rem);
   position: relative;
   background-color: #fff;
 }
-
-.van-radio-group {
-  padding: 0.24rem 0.32rem;
-}
-
-.van-radio {
-  height: 0.8rem;
-}
-.work_center_header {
-  background-color: #26a2ff;
-}
-.work_center_header span,
-.work_center_header i {
-  color: #fff;
-}
-/deep/ .van-icon-success {
-  color: #238dfa;
-}
-/deep/ .van-popup {
-  border-radius: 0 0 0.16rem 0.16rem;
-}
-/deep/ .van-cell {
-  background: transparent !important;
-}
-/deep/ .van-cell span {
-  font-size: 0.3rem !important;
-}
-/deep/ .work_center_header .van-dropdown-menu__item {
-  background-color: #26a2ff;
-}
-/deep/ .work_center_header .van-dropdown-menu__title {
-  color: #fff;
-  padding-left: 0.2rem;
-  font-size: 0.34rem;
-}
-/deep/ .work_center_header .van-hairline--top-bottom:after,
-.van-hairline-unset--top-bottom:after {
-  border: none;
-}
 .app_list_box {
   padding: 0 0.28rem;
   margin-bottom: 0.32rem;
@@ -435,7 +218,6 @@ export default {
 }
 .app_list_box /deep/ .van-grid-item {
   margin-bottom: 0.4rem;
-  /* flex-basis:20% !important; */
 }
 .app_list_box /deep/ .van-grid-item .van-grid-item__content {
   padding: 0 !important;
@@ -451,8 +233,8 @@ export default {
   white-space: nowrap;
 }
 .app_list_box /deep/ .van-grid-item .van-grid-item__content .van-grid-item__icon-wrapper img {
-  width: 1.16rem;
-  height: 1.16rem;
+  width: 1rem;
+  height: 1rem;
   border-radius: 0.42rem;
 }
 
@@ -465,191 +247,4 @@ export default {
   color: #fff;
   border-radius: 0.4rem;
 }
-.notice_text {
-  margin-left: 0.16rem;
-  margin-right: 0.32rem;
-  overflow: hidden;
-}
-.diy-notice-bar {
-  height: 0.92rem;
-  line-height: 0.92rem;
-  padding-left: 0.32rem;
-  padding-right: 0.32rem;
-  position: relative;
-  color: #909399;
-  border-bottom: 0.2rem solid #f5f7fa;
-}
-.diy-notice-bar .notice-content {
-  height: 0.92rem;
-  line-height: 0.92rem;
-  position: absolute;
-  left: 1rem;
-  right: 1.5rem;
-  overflow: hidden;
-}
-.diy-notice-bar .notice-left {
-  float: left;
-}
-.diy-notice-bar .notice-right {
-  float: right;
-  line-height: 0.92rem;
-  font-size: 0.32rem;
-}
-.diy-notice-bar .notice-right i {
-  float: right;
-  line-height: 0.92rem;
-}
-.diy-notice-bar /deep/ .van-swipe__track {
-  width: 100% !important;
-  height: 0.92rem !important;
-}
-.diy-notice-bar /deep/ .van-swipe-item {
-  width: 100% !important;
-  font-size: 0.32rem;
-  overflow: hidden;
-  height: 100% !important;
-  white-space: nowrap;
-  text-overflow: ellipsis;
-}
-.left-text-bold /deep/ .van-nav-bar__left {
-  font-size: 0.4rem !important;
-  font-weight: bold;
-}
-.guild_notice {
-  top: calc(100vh - 5.5rem);
-  left: 3.4rem;
-  width: 6rem;
-  background: transparent;
-  border-radius: 0.12rem;
-  overflow-y: inherit;
-}
-.guild_notice .list {
-  position: relative;
-  padding: 0.2rem;
-  background: #238dfa;
-  border-radius: 0.12rem;
-}
-.title {
-  font-size: 0.32rem;
-  line-height: 0.48rem;
-  color: #ffffff;
-}
-.title:after {
-  position: absolute;
-  top: 0.825rem;
-  content: ' ';
-  width: 90%;
-  border-bottom: 0.02rem #3798fb solid;
-}
-.num {
-  display: block;
-  font-size: 0.32rem;
-  line-height: 0.48rem;
-  color: #ffffff;
-}
-.list .des {
-  display: block;
-  margin-top: 0.4rem;
-  font-size: 0.36rem;
-  font-weight: bold;
-  color: #fff;
-}
-.list .next {
-  margin-top: 0.3rem;
-  color: #238dfa;
-  background: #fff;
-  border-radius: 0.12rem;
-}
-.guild_notice .list:after {
-  border: none;
-}
-.guild_down_icon {
-  position: relative;
-  top: 0vh;
-  left: 6vw;
-  content: ' ';
-  width: 0;
-  height: 0;
-  border-left: 0.2rem solid transparent;
-  border-right: 0.2rem solid transparent;
-  border-top: 0.2rem solid #238dfa;
-}
-.guild_notice_pic {
-  position: relative;
-  top: 0.1rem;
-  left: 0.11rem;
-  width: 1.25rem;
-  font-size: 0.28rem;
-  color: #fff;
-  letter-spacing: 0.02rem;
-}
-
-.guild_rule {
-  top: calc(100vh - 5.5rem);
-  left: 3.4rem;
-  width: 6rem;
-  background: transparent;
-  border-radius: 0.12rem;
-  overflow-y: inherit;
-}
-.guild_rule .list {
-  position: relative;
-  padding: 0.2rem;
-  background: #238dfa;
-  border-radius: 0.12rem;
-}
-.guild_rule .title {
-  font-size: 0.32rem;
-  line-height: 0.48rem;
-  color: #ffffff;
-}
-.guild_rule .title:after {
-  position: absolute;
-  top: 0.825rem;
-  content: ' ';
-  width: 90%;
-  border-bottom: 0.02rem #3798fb solid;
-}
-.guild_rule .num {
-  display: block;
-  font-size: 0.32rem;
-  line-height: 0.48rem;
-  color: #ffffff;
-}
-.guild_rule .list .des {
-  display: block;
-  margin-top: 0.4rem;
-  font-size: 0.36rem;
-  font-weight: bold;
-  color: #fff;
-}
-.guild_rule .list .next {
-  margin-top: 0.3rem;
-  color: #238dfa;
-  background: #fff;
-  border-radius: 0.12rem;
-}
-.guild_rule .list:after {
-  border: none;
-}
-.guild_rule .guild_down_icon {
-  position: relative;
-  top: 0vh;
-  left: 53vw;
-  content: ' ';
-  width: 0;
-  height: 0;
-  border-left: 0.2rem solid transparent;
-  border-right: 0.2rem solid transparent;
-  border-top: 0.2rem solid #238dfa;
-}
-.guild_rule .guild_notice_pic {
-  position: relative;
-  top: 0.1rem;
-  left: 48vw;
-  width: 1.25rem;
-  font-size: 0.28rem;
-  color: #fff;
-  letter-spacing: 0.02rem;
-}
 </style>

+ 0 - 287
src/components/chat/index.vue

@@ -1,287 +0,0 @@
-<template>
-
-
-<div id="msg_list_box_div">
-  <van-nav-bar :title="title" left-text="返回" @click-left="$route_back" left-arrow>
-
-  </van-nav-bar>
-
-
-  <div style="position: relative; height: calc(100% - 1.8rem); background-color: #f7f7f7;"  @touchend="inputblur">
-<scroller class="msg_list_scroller" ref="msg_list_scroller">
-
-  <div class="toolbar_msg">
-    <a href="javascript:void(0);" @click="show_more" v-if="show_more_btn">显示更多</a>
-    <div class="no-data-text" v-show="no_more_show">没有更多了</div>
-  </div>
-
-<div id="msg-box">
-  <ul class="msg-box-ul" v-for="(item,index) in list" :key="index">
-
-
-
-
-    <li style="clear: both;"><div style="font-size:0.24rem; text-align: center; padding:0.16rem 0; color:#ccc;" v-if="index > 0 && list[index]['create_time'] - list[index-1]['create_time'] > 120">{{item.sendtimetext}}</div></li>
-
-
-    <li v-if="item.user_from == touser" class="msg-list-left msg-list-box">
-      <div class="msg-list-cell1 msg-list-cell"><img :src="item.from_avatar"/></div>
-      <div class="msg-list-cell2 msg-list-cell">
-        <div class="msg-list-nickname">{{item.from_nickname}}</div>
-        <div class="msg-list-tip">{{item.content}}</div>
-      </div>
-      <div class="msg-list-cell3 msg-list-cell"></div>
-
-    </li>
-    <li style="clear: both;"></li>
-    <li v-if="item.user_to == touser" class="msg-list-right msg-list-box">
-
-
-
-      <div class="msg-list-cell3 msg-list-cell"></div>
-
-      <div class="msg-list-cell2 msg-list-cell">
-        <div class="msg-list-nickname">{{item.from_nickname}}</div>
-        <div class="msg-list-tip">{{item.content}}</div>
-      </div>
-      <div class="msg-list-cell1 msg-list-cell"><img :src="item.from_avatar"/></div>
-    </li>
-    <li style="clear: both;"></li>
-  </ul>
-</div>
-
-
-</scroller>
-
-  </div>
-
-<div>
-  <van-field
-    v-model="formdata.content"
-    center
-    @focus="inputing"
-    clearable
-    style="width:6rem; float:left;"
-    id="send_input"
-    placeholder="请输入……"
-  >
-    <template slot="input">
-     <input v-model="formdata.content" type="text" id="send_input" @focus="inputing" placeholder="请输入……" class="van-field__control no-auto-blur">
-
-  </template>
-  </van-field>
-
-  <label>
-    <input class="no-auto-blur" type="text" style="position: absolute; left:-10000px;top:-100000px;"/>
-    <van-button style="float:right; margin-right:0.1rem; margin-top:0.15rem;" slot="button" @click="send_msg" :disabled="sending" :loading="sending" size="small" type="primary">发送</van-button>
-  </label>
-
-
-</div>
-
-</div>
-
-</template>
-
-<script>
-  import request from '@/utils/request'
-  export default {
-
-    name: 'index',
-    data(){
-      return {
-        show_more_btn:true,
-        no_more_show: false,
-        input_show2:false,
-        sending:false,
-        page:1,
-        list:[],
-        user_id:this.$store.getters.user_info.id,
-        touser: this.$route.query.touser,
-        list_height:0,
-        user_map: {},
-        title: '在线沟通',
-        topid:0,
-        formdata:{
-          content: '',
-          touser: this.$route.query.touser
-        }
-      }
-    },
-    sockets: {
-      new_msg (data) {
-        let self = this
-        let msg = JSON.parse(data)
-        //self.$toast(msg.content)
-        msg.data['from_nickname'] = self.user_map[msg.data.user_from].nickname
-        msg.data['to_nickname'] = self.user_map[msg.data.user_to].nickname
-        msg.data['to_avatar'] = self.user_map[msg.data.user_to].avatar
-        msg.data['from_avatar'] = self.user_map[msg.data.user_from].avatar
-        this.list.push(msg.data)
-
-      },
-      send_msg_success(data){
-        let self = this
-        self.sending = false
-        self.formdata.content = ''
-        let msg = JSON.parse(data)
-        msg.data['from_nickname'] = self.user_map[msg.data.user_from].nickname
-        msg.data['to_nickname'] = self.user_map[msg.data.user_to].nickname
-        msg.data['to_avatar'] = self.user_map[msg.data.user_to].avatar
-        msg.data['from_avatar'] = self.user_map[msg.data.user_from].avatar
-        this.list.push(msg.data)
-        document.getElementById('send_input').focus()
-      },
-      login_success(data){
-        let self = this
-        let msg = JSON.parse(data)
-      }
-    },
-    created(){
-      this.get_msg_list()
-      let self = this
-    },
-    watch:{
-      list_height(val,old){
-        let self = this
-        self.$refs['msg_list_scroller'].scrollBy(0, val - old)
-      },
-      list(val,old){
-        let self = this
-        self.$nextTick(() => {
-          setTimeout(()=>{
-            self.list_height = document.getElementById('msg-box').offsetHeight
-            let pos = this.$refs.msg_list_scroller && this.$refs.msg_list_scroller.getPosition() && this.$refs.msg_list_scroller.getPosition().top
-
-            let full_height = document.getElementById('msg-box').offsetHeight
-            let box_height = document.getElementsByClassName('msg_list_scroller').item(0).offsetHeight
-
-
-            if((full_height - box_height) - pos < 150){
-              self.$refs['msg_list_scroller'].scrollBy(0,document.getElementById('msg-box').offsetHeight)
-            }
-
-
-          }, 100)
-
-        })
-      }
-    },
-    methods:{
-      inputing(e){
-        //e.target.scrollIntoView(false)
-        e.target.classList.add('no-auto-blur')
-        self = this
-        setTimeout(() => {
-          if(window.plus){
-            var bar_height = plus.navigator.getStatusbarHeight();
-            document.getElementById('msg_list_box_div').style.height = (window.innerHeight - bar_height)+'px';
-          }
-        },1000)
-
-        window.addEventListener('resize',() => {
-          setTimeout(() => {
-            self.$refs['msg_list_scroller'].scrollBy(0,document.getElementById('msg-box').offsetHeight, true)
-          }, 200)
-        },false);
-
-      },
-      inputblur(){
-        var bar_height = 0
-        if(window.plus){
-          bar_height = plus.navigator.getStatusbarHeight();
-        }
-        document.documentElement.style.marginTop = bar_height+'px';
-        document.documentElement.style.height = 'calc(100% - '+bar_height+'px)'
-        var msg_list_box_div = document.getElementById('msg_list_box_div')
-        msg_list_box_div.style.height = '100%'
-      },
-      show_more(){
-        this.page ++
-        this.show_more_btn = false
-        this.get_msg_list()
-      },
-      send_text(txt){
-          this.$socket.emit('send_text', JSON.stringify({type: 0, to: this.touser, content: txt}))
-      },
-      send_msg(){
-        let self = this
-        if(this.formdata.content == ''){
-          self.$toast('请输入内容')
-          return false
-        }
-        self.sending = true
-        this.send_text(this.formdata.content)
-      },
-      get_msg_list(){
-        let self = this
-        self.$toast.loading({
-          mask: true,
-          message: '请稍等……'
-        })
-        request('get','/api/user/chat_msg_list', {topid:self.topid, page:self.page, touser:this.$route.query.touser}).then((ret) => {
-          let res_data = ret.data.data.list.reverse()
-          if(res_data.length > 0){
-            self.topid = res_data[0].id
-          }
-          self.user_map = ret.data.data.user_map
-          self.show_more_btn = true
-          self.no_more_show = false
-          if(res_data.length < 20){
-            self.show_more_btn = false
-            self.no_more_show = true
-          }
-          self.title = ret.data.data.touser.nickname
-          self.list = res_data.concat(self.list)
-          //拉到最下方
-          if(self.page == 1){
-            self.$nextTick(() => {
-              setTimeout(() => {
-                self.$refs['msg_list_scroller'].scrollBy(0,document.getElementById('msg-box').offsetHeight)
-              }, 200)
-            })
-          }
-          self.$toast.clear()
-        }).catch((e) => {
-
-        })
-      }
-    }
-  }
-</script>
-
-<style scoped>
-.msg-list-cell1 img{width:0.8rem;
-  -webkit-border-radius: 1rem;
-  -moz-border-radius: 1rem;
-  border-radius: 1rem;
-  height: 0.8rem;}
-  .msg-box-ul{padding:0.16rem;}
-  .msg-box-ul > li.msg-list-box{ display: table;}
-
-  .msg-list-nickname{font-size:0.28rem; color:#999;}
-  .msg-box-ul .msg-list-cell{display: table-cell; vertical-align: top; padding:0.1rem;}
-  .msg-list-tip{background-color: #fff; border:1px solid #eee; padding:0.1rem 0.16rem; font-size:0.3rem; display: inline-block; position: relative; color:#333;
-    -webkit-border-radius: 0.1rem;word-break: break-all;
-    -moz-border-radius: 0.1rem;
-    border-radius: 0.1rem;}
-.msg-list-tip:before{content:" "; position: absolute; width:0.1rem;
-  height: 0.1rem; border-bottom:1px solid #eee; border-left:1px solid #eee;transform:rotate(45deg);
-  -ms-transform:rotate(45deg); /* Internet Explorer */
-  -moz-transform:rotate(45deg); /* Firefox */
-  -webkit-transform:rotate(45deg); /* Safari 和 Chrome */
-  -o-transform:rotate(45deg); /* Opera */ left:-0.07rem; background-color: #fff; top:0.1rem;}
-  .msg-list-right{float:right;}
-  .msg-list-left{float:left;}
-  .msg-list-right .msg-list-tip{float:right;}
-  .msg-list-right .msg-list-tip:before{left:unset;right:-0.07rem; border:none;border-top:1px solid #eee; border-right:1px solid #eee;}
-  .msg-list-right .msg-list-nickname{
-    text-align: right;}
-  .msg-list-cell3{width:0.7rem;}
-
-  .toolbar_msg{
-    height: 0.88rem;
-    line-height: 0.88rem; text-align: center;}
-  .no-data-text{color:#ccc; font-size:0.32rem;}
-
-</style>

+ 0 - 307
src/components/chat/index_v.vue

@@ -1,307 +0,0 @@
-<template>
-
-
-<div id="msg_list_box_div">
-  <van-nav-bar :title="title" left-text="返回" @click-left="$route_back" left-arrow>
-
-  </van-nav-bar>
-
-
-  <div :style="'position: relative; height: '+sh+'; background-color: #f7f7f7;'"  @touchend="inputblur">
-<scroller class="msg_list_scroller" ref="msg_list_scroller">
-
-  <div class="toolbar_msg">
-    <a href="javascript:void(0);" @click="show_more" v-if="show_more_btn">显示更多</a>
-    <div class="no-data-text" v-show="no_more_show">没有更多了</div>
-  </div>
-
-<div id="msg-box">
-  <ul class="msg-box-ul" v-for="(item,index) in list" :key="index">
-
-
-
-
-    <li style="clear: both;"><div style="font-size:0.24rem; text-align: center; padding:0.16rem 0; color:#ccc;" v-if="index > 0 && list[index]['create_time'] - list[index-1]['create_time'] > 120">{{item.sendtimetext}}</div></li>
-
-
-    <li v-if="item.user_from == touser" class="msg-list-left msg-list-box">
-      <div class="msg-list-cell1 msg-list-cell"><img :src="item.from_avatar"/></div>
-      <div class="msg-list-cell2 msg-list-cell">
-        <div class="msg-list-nickname">{{item.from_nickname}}</div>
-        <div class="msg-list-tip">{{item.content}}</div>
-      </div>
-      <div class="msg-list-cell3 msg-list-cell"></div>
-
-    </li>
-    <li style="clear: both;"></li>
-    <li v-if="item.user_to == touser" class="msg-list-right msg-list-box">
-
-
-
-      <div class="msg-list-cell3 msg-list-cell"></div>
-
-      <div class="msg-list-cell2 msg-list-cell">
-        <div class="msg-list-nickname">{{item.from_nickname}}</div>
-        <div class="msg-list-tip">{{item.content}}</div>
-      </div>
-      <div class="msg-list-cell1 msg-list-cell"><img :src="item.from_avatar"/></div>
-    </li>
-    <li style="clear: both;"></li>
-  </ul>
-</div>
-
-
-</scroller>
-
-  </div>
-
-<div>
-  <van-field
-    v-model="formdata.content"
-    center
-    @focus="inputing"
-    clearable
-    style="width:6rem; float:left;"
-    id="send_input"
-    placeholder="请输入……"
-  >
-    <template slot="input">
-     <input v-model="formdata.content" type="text" id="send_input" @touchend="inputing" placeholder="请输入……" class="van-field__control no-auto-blur">
-
-  </template>
-  </van-field>
-
-  <label>
-    <van-button style="float:right; margin-right:0.1rem; margin-top:0.15rem;" slot="button" @click="send_msg" :disabled="sending" :loading="sending" size="small" type="primary">发送</van-button>
-  </label>
-
-
-</div>
-
-</div>
-
-</template>
-
-<script>
-  import request from '@/utils/request'
-  import {setToken, setUserId} from '@/utils/auth'
-  export default {
-
-    name: 'index_v',
-    data(){
-      return {
-        sh: 'calc(100% - 1.8rem)',
-        show_more_btn:true,
-        no_more_show: false,
-        input_show2:false,
-        sending:false,
-        page:1,
-        list:[],
-        user_id:this.$store.getters.user_info.id,
-        touser: this.$route.query.touser,
-        list_height:0,
-        user_map: {},
-        title: '在线沟通',
-        topid:0,
-        formdata:{
-          content: '',
-          touser: this.$route.query.touser
-        }
-      }
-    },
-    sockets: {
-      new_msg (data) {
-        let self = this
-        let msg = JSON.parse(data)
-        //self.$toast(msg.content)
-        msg.data['from_nickname'] = self.user_map[msg.data.user_from].nickname
-        msg.data['to_nickname'] = self.user_map[msg.data.user_to].nickname
-        msg.data['to_avatar'] = self.user_map[msg.data.user_to].avatar
-        msg.data['from_avatar'] = self.user_map[msg.data.user_from].avatar
-        this.list.push(msg.data)
-
-      },
-      send_msg_success(data){
-        let self = this
-        self.sending = false
-        self.formdata.content = ''
-        let msg = JSON.parse(data)
-        msg.data['from_nickname'] = self.user_map[msg.data.user_from].nickname
-        msg.data['to_nickname'] = self.user_map[msg.data.user_to].nickname
-        msg.data['to_avatar'] = self.user_map[msg.data.user_to].avatar
-        msg.data['from_avatar'] = self.user_map[msg.data.user_from].avatar
-        this.list.push(msg.data)
-        document.getElementById('send_input').focus()
-      },
-      login_success(data){
-        let self = this
-        let msg = JSON.parse(data)
-      }
-    },
-    created(){
-      //先登录
-      let self = this
-      request('get','/api/user/create_user_auto_login').then((response) => {
-        if (response.data.code == 1) {
-          setUserId(response.data.data.userinfo.id.toString())
-          setToken(response.data.data.userinfo.token)
-          self.$store.commit('SET_TOKEN', response.data.data.userinfo.token)
-          self.$store.commit('SET_USERID', response.data.data.userinfo.id)
-          self.$socket.emit('login', response.data.data.userinfo.id)
-          self.get_msg_list()
-        }
-      })
-    },
-    watch:{
-      list_height(val,old){
-        let self = this
-        self.$refs['msg_list_scroller'].scrollBy(0, val - old)
-      },
-      list(val,old){
-        let self = this
-        self.$nextTick(() => {
-          setTimeout(()=>{
-            self.list_height = document.getElementById('msg-box').offsetHeight
-            let pos = this.$refs.msg_list_scroller && this.$refs.msg_list_scroller.getPosition() && this.$refs.msg_list_scroller.getPosition().top
-
-            let full_height = document.getElementById('msg-box').offsetHeight
-            let box_height = document.getElementsByClassName('msg_list_scroller').item(0).offsetHeight
-
-
-            if((full_height - box_height) - pos < 150){
-              self.$refs['msg_list_scroller'].scrollBy(0,document.getElementById('msg-box').offsetHeight)
-            }
-
-
-          }, 100)
-
-        })
-      }
-    },
-    methods:{
-      inputing(e){
-        //e.target.focus()
-        let self = this
-        e.target.classList.add('no-auto-blur')
-        window.onscroll = function(){
-          if(document.body.scrollTop > 50){
-            self.sh = 'calc(100% - '+(document.body.scrollTop+'px')+')'
-            setTimeout(function(){
-              window.scroll(0, 0)
-            })
-          }
-        }
-        self = this
-        setTimeout(() => {
-          if(window.plus){
-            var bar_height = plus.navigator.getStatusbarHeight();
-            document.getElementById('msg_list_box_div').style.height = (window.innerHeight - bar_height)+'px';
-          }
-        },1000)
-
-        window.addEventListener('resize',() => {
-          setTimeout(() => {
-            self.$refs['msg_list_scroller'].scrollBy(0,document.getElementById('msg-box').offsetHeight, true)
-          }, 200)
-        },false);
-
-      },
-      inputblur(){
-        var bar_height = 0
-        if(window.plus){
-          bar_height = plus.navigator.getStatusbarHeight();
-        }
-        document.documentElement.style.marginTop = bar_height+'px';
-        document.documentElement.style.height = 'calc(100% - '+bar_height+'px)'
-        var msg_list_box_div = document.getElementById('msg_list_box_div')
-        msg_list_box_div.style.height = '100%'
-      },
-      show_more(){
-        this.page ++
-        this.show_more_btn = false
-        this.get_msg_list()
-      },
-      send_text(txt){
-          this.$socket.emit('send_text', JSON.stringify({type: 0, to: this.touser, content: txt}))
-      },
-      send_msg(){
-        let self = this
-        if(this.formdata.content == ''){
-          self.$toast('请输入内容')
-          return false
-        }
-        self.sending = true
-        this.send_text(this.formdata.content)
-      },
-      get_msg_list(){
-        let self = this
-        self.$toast.loading({
-          mask: true,
-          message: '请稍等……'
-        })
-        request('get','/api/user/chat_msg_list', {topid:self.topid, page:self.page, touser:this.$route.query.touser}).then((ret) => {
-          let res_data = ret.data.data.list.reverse()
-          if(res_data.length > 0){
-            self.topid = res_data[0].id
-          }
-          self.user_map = ret.data.data.user_map
-          self.show_more_btn = true
-          self.no_more_show = false
-          if(res_data.length < 20){
-            self.show_more_btn = false
-            self.no_more_show = true
-          }
-          self.title = ret.data.data.touser.nickname
-          self.list = res_data.concat(self.list)
-          //拉到最下方
-          if(self.page == 1){
-            self.$nextTick(() => {
-              setTimeout(() => {
-                self.$refs['msg_list_scroller'].scrollBy(0,document.getElementById('msg-box').offsetHeight)
-              }, 200)
-            })
-          }
-          self.$toast.clear()
-        }).catch((e) => {
-
-        })
-      }
-    }
-  }
-</script>
-
-<style scoped>
-.msg-list-cell1 img{width:0.8rem;
-  -webkit-border-radius: 1rem;
-  -moz-border-radius: 1rem;
-  border-radius: 1rem;
-  height: 0.8rem;}
-  .msg-box-ul{padding:0.16rem;}
-  .msg-box-ul > li.msg-list-box{ display: table;}
-
-  .msg-list-nickname{font-size:0.28rem; color:#999;}
-  .msg-box-ul .msg-list-cell{display: table-cell; vertical-align: top; padding:0.1rem;}
-  .msg-list-tip{background-color: #fff; border:1px solid #eee; padding:0.1rem 0.16rem; font-size:0.3rem; display: inline-block; position: relative; color:#333;
-    -webkit-border-radius: 0.1rem;word-break: break-all;
-    -moz-border-radius: 0.1rem;
-    border-radius: 0.1rem;}
-.msg-list-tip:before{content:" "; position: absolute; width:0.1rem;
-  height: 0.1rem; border-bottom:1px solid #eee; border-left:1px solid #eee;transform:rotate(45deg);
-  -ms-transform:rotate(45deg); /* Internet Explorer */
-  -moz-transform:rotate(45deg); /* Firefox */
-  -webkit-transform:rotate(45deg); /* Safari 和 Chrome */
-  -o-transform:rotate(45deg); /* Opera */ left:-0.07rem; background-color: #fff; top:0.1rem;}
-  .msg-list-right{float:right;}
-  .msg-list-left{float:left;}
-  .msg-list-right .msg-list-tip{float:right;}
-  .msg-list-right .msg-list-tip:before{left:unset;right:-0.07rem; border:none;border-top:1px solid #eee; border-right:1px solid #eee;}
-  .msg-list-right .msg-list-nickname{
-    text-align: right;}
-  .msg-list-cell3{width:0.7rem;}
-
-  .toolbar_msg{
-    height: 0.88rem;
-    line-height: 0.88rem; text-align: center;}
-  .no-data-text{color:#ccc; font-size:0.32rem;}
-  .set_top{position: absolute; top:0;}
-</style>

+ 0 - 52
src/components/chat/user_list.vue

@@ -1,52 +0,0 @@
-<template>
-
-
-<div>
-  <van-nav-bar title="在线聊天" left-text="返回" @click-left="$route_back" left-arrow>
-
-  </van-nav-bar>
-<scroller>
-
-  <div v-for="(item,index) in list" :key="index" @click="$router.push({name:'chat', query:{touser:item.id}})">
-
-    <van-panel  :icon="item.avatar" :title="item.nickname" >
-
-
-    </van-panel>
-  </div>
-
-</scroller>
-</div>
-
-
-
-
-</template>
-
-<script>
-  import request from '@/utils/request'
-  export default {
-    name: 'user_list',
-    data(){
-      return {
-        page:0,
-        list:[]
-      }
-    },
-    created(){
-      this.get_user_list()
-    },
-    methods:{
-      get_user_list(){
-        this.page ++
-        request('get','/user/api/get_user_list', {page:this.page}).then((res) => {
-          this.list = res.data.data
-        }).catch((e) => {})
-      }
-    }
-  }
-</script>
-
-<style scoped>
-
-</style>

+ 2 - 2
src/components/common/DateSelectorDropdown.vue

@@ -128,10 +128,10 @@
           if (startDate.getMonth() === now.getMonth() && startDate.getFullYear() === now.getFullYear()) {
             this.$emit('update:title', '本月')
           } else {
-            this.$emit('update:title', '月')
+            this.$emit('update:title', startDate.getMonth()+1 +'月')
           }
         } else {
-          this.$emit('update:title', '日')
+          this.$emit('update:title', startDate.getDate() + '日')
         }
       },
       onResetDate () {

+ 2 - 2
src/components/common/DeptSelectorCell.vue

@@ -13,11 +13,11 @@
   >
     <template slot="default">
       <div style="display: inline;" class="employee_cell_value" v-if="selected_data.dept.length <= 2">
-        <span v-for="(item, index) in selected_data.dept" :key="index"><em v-show="index > 0">,</em>{{item.dept_name}}</span>
+        <span v-for="(item, index) in selected_data.dept" :key="index"><em v-show="index > 0">,</em><Wxopendata type="departmentName" :openid="item.dept_name"></Wxopendata></span>
       </div>
 
       <div style="display: inline;" class="employee_cell_value" v-if="selected_data.dept.length > 2">
-        <span v-for="(item, index) in selected_data.dept" v-if="index < 2" :key="index"><em v-show="index > 0">,</em>{{item.dept_name}}</span>
+        <span v-for="(item, index) in selected_data.dept" v-if="index < 2" :key="index"><em v-show="index > 0">,</em><Wxopendata type="departmentName" :openid="item.dept_name"></Wxopendata></span>
         等{{selected_data.dept.length}}个
       </div>
     </template>

+ 930 - 0
src/components/common/EmployeeSelector copy.vue

@@ -0,0 +1,930 @@
+<template>
+  <van-popup
+    :duration="0.2"
+    :overlay="false"
+    class="employee_selector_popup"
+    v-model="visible_"
+    :position="position"
+    :style="'height:'+com_height"
+  >
+    <slot name="nav"></slot>
+    <van-nav-bar v-if="!$slots.nav" :title="title" left-text="取消" @click-left="close"></van-nav-bar>
+    <!-- <van-search v-model="keyword" v-if="can_select_employee" placeholder="请输入姓名搜索" />
+    <van-search v-model="keyword" v-else placeholder="请输入部门名称搜索" /> -->
+    <van-search v-model="keyword" style="margin-top: .2rem;" v-if="!can_select_employee" placeholder="请输入部门名称搜索" />
+    <div class="dept_path" v-show="pid_list_arr.length > 0">
+      <a href="javascript:void(0);" @click="back_by_index(0)">全公司</a>
+      <a
+        v-for="(item, index) in pid_list_arr"
+        :key="index"
+        href="javascript:void(0);"
+        @click="back_by_index(index + 1)"
+      >
+        <van-icon name="arrow" />
+        <Wxopendata type="departmentName" :openid="item.name"></Wxopendata>
+      </a>
+    </div>
+    <div class="body_com" :class="{show_dept_path:pid_list_arr.length > 0}">
+      <scroller :on-refresh="get_user_list" ref="scroller_com">
+        <!-- can_select_dept  选择部门传值 -->
+        <van-cell
+          :is-link="!can_select_dept"
+          v-for="(item,index) in dept_list"
+          :key="index"
+          :title="item.name"
+          v-show="item.pid == pid && item.name.indexOf(keyword) >= 0 && dept_not_select.indexOf(item.id) < 0"
+          class="employee_cell"
+          @click="select_dept(item)"
+        >
+          <template slot="icon">
+            <van-checkbox v-if="can_select_dept" v-model="item.checked"></van-checkbox>
+            <img v-if="can_select_dept" src="static/images/e66f.jpg" class="employee_cell_head_img" />
+            <!-- <userImage :id="item.id" width="0.8rem" height="0.8rem" ></userImage> -->
+          </template>
+          <template slot="title">
+            <Wxopendata type="departmentName" :openid="item.name"></Wxopendata>
+          </template>
+          <template slot="right-icon" v-if="(can_select_dept && item.child.length > 0) || (!can_select_dept && can_select_employee && item.count > 0)">
+            <a href="javascript:void(0);" class="child_btn" @click.stop="show_child(item)">| 下级</a>
+          </template>
+        </van-cell>
+
+        <div style="height: .4rem; background: rgb(245, 245, 245);" v-show="selected_all"></div>
+        <van-cell v-show="selected_all">
+          <template #title>
+            <van-checkbox v-model="checked_btn" @change="checked_change">全选</van-checkbox>
+          </template>
+        </van-cell>
+        <div v-for="(item,index) in list" :key="index" v-if="can_select_employee" v-show="item.name.indexOf(keyword) >= 0">
+          <!-- <div
+            v-if="index == 0"
+            :data-pageindex="item.letter_index"
+            class="pageIndexBtn"
+          >{{item.letter_index}}</div> -->
+          <!-- <div
+            v-if="index > 0 && list[index-1].letter_index != item.letter_index"
+            :data-pageindex="item.letter_index"
+            class="pageIndexBtn"
+          >{{item.letter_index}}</div> -->
+          <van-cell
+            :class="{'letter-first': index == 0 || (index > 0 && list[index-1].letter_index != item.letter_index)}"
+            v-if="can_select_employee"
+            :title="item.name+(item.identification?'(直属上级)':'')"
+            class="employee_cell"
+            @click="select_employee(item)"
+          >
+            <template slot="icon">
+              <van-checkbox
+                v-if="selectedQuitEmployee"
+                :style="item.status > 1 || employee_not_select.indexOf(item.id) >= 0?'opacity: 0':'opacity: 1'"
+                v-model="item.checked"
+              ></van-checkbox>
+              <van-checkbox
+                v-if="!selectedQuitEmployee"
+                :style="employee_not_select.indexOf(item.id) > 0?'opacity: 0':'opacity: 1'"
+                v-model="item.checked"
+              ></van-checkbox>
+
+              <!-- {opacity: item.status < 2 || employee_not_select.indexOf(item.id) < 0 ? 1 :0} -->
+              <userImage
+                class="employee_cell_head_img"
+                :img_url ="item.img_url"
+                :user_name="item.name"
+                width="0.8rem"
+                height="0.8rem"
+                fontSize="0.2"
+              ></userImage>
+              <!-- <img :src="item.img_url"class="employee_cell_head_img"/> -->
+            </template>
+            <template slot="title">
+              <Wxopendata type="userName" :openid="item.name"></Wxopendata>{{item.identification?'(直属上级)':''}}
+            </template>
+            <template slot="right-icon" v-if="typeof(item.status) != 'undefined'">
+              <van-tag plain v-show="item.status == 0 || item.status == 2">{{item.status == 0 ?'未加入':'离职'}}</van-tag>
+            </template>
+          </van-cell>
+        </div>
+      </scroller>
+    </div>
+    <slot name="footer"></slot>
+    <div class="bottom_menu flex-box flex-v-ce" :class="{isIos:isIos}">
+      <div class="selected_box flex-1">
+        <div class="flex-box flex-v-ce ul" :style="'width:'+selected_box_width">
+          <div v-for="(item,index) in employee_selected_list" :key="index" @click="employee_cancel(item)" class="li">
+            <userImage :img_url ="item.img_url" :user_name="item.name" width="0.9rem" height="0.9rem"  fontSize="0.2"></userImage>
+          </div>
+          <div v-for="(item,index) in dept_selected_list" :key="index" @click="dept_cancel(item)" class="fb">
+            <img src="static/images/e66f.jpg" />
+            <div class="name_mini"><Wxopendata type="departmentName" :openid="item.dept_name"></Wxopendata></div>
+          </div>
+        </div>
+      </div>
+      <div class="selected_btn" ref="selected_btn">
+        <van-button ref="selected_button" style="height: 0.7rem; line-height: 0.7rem;" type="info" @click="confirm">
+          确定<template v-if="multi && max*1 > 0">({{employee_selected_list.length}}/{{max}})</template>
+         </van-button>
+      </div>
+    </div>
+  </van-popup>
+</template>
+
+<script>
+import Vue from 'vue'
+import { ActionSheet, Popup, Checkbox, Tag, Search } from 'vant'
+
+import userImage from '@/components/common/user_image'
+import request from '@/utils/request'
+Vue.use(Popup).use(Tag)
+Vue.use(Checkbox)
+Vue.use(ActionSheet)
+Vue.use(Search)
+export default {
+  props: {
+    position: {// 弹窗从哪里出来
+      type: String,
+      default: 'bottom'
+    },
+    append_body: {// 销毁组件时清空标题的作用
+      type: Boolean,
+      default: false
+    },
+    visible: { // 是否显示组件
+      type: Boolean,
+      default: false
+    },
+    can_select_dept: { // 指定是否能选择部门
+      type: Boolean,
+      default: true
+    },
+    can_select_employee: { // 指定是否能选择员工
+      type: Boolean,
+      default: true
+    },
+    employee_not_select: { // 排除员工的ID,包含ID时不出现在选择列表中
+      type: Array,
+      default: () => { return [] }
+    },
+    dept_not_select: { // dept_not_select
+      type: Array,
+      default: () => { return [] }
+    },
+    selected: { // 已经选择的员工和部门
+      type: Object,
+      default: () => {
+        return { employee: [], dept: [] }
+      }
+    },
+    multi: { // 指定员工是否能多选
+      type: Boolean,
+      default: true
+    },
+    dept_multi: { // dept_multi
+      type: Boolean,
+      default: true
+    },
+    employee_list: { // 指定显示的员工列表,注意:传值后组件的员工数据将不是统一向服务器获取的,而是指定的员工列表,格式是:[{id: 1, name: “张三”, img_url: “”}]
+      type: Array,
+      default: null
+    },
+    use_employee_list: { // 为true时,employee_list才生效
+      type: Boolean,
+      default: false
+    },
+    close_clear_data: { // 关闭时是否清空选择的数据
+      type: Boolean,
+      default: true
+    },
+    max: { // 当multi为true时,用来限制选择人数,0不生效
+      type: Number,
+      default: 0
+    },
+    include_self: { // 是否显示当前登录的员工信息
+      type: Boolean,
+      default: true
+    },
+    show_manager_only: { // 是否只显示管理者列表
+      type: Boolean,
+      default: false
+    },
+    title: { // cell的显示名称
+      type: String,
+      default: ''
+    },
+    selected_all: { // 是否选择全部
+      type: Boolean,
+      default: false
+    },
+    selectedQuitEmployee: {//
+      type: Boolean,
+      default: true
+    },
+    is_filtration_creator: {// 是否过滤掉创始人
+      type: Boolean,
+      default: false
+    }
+  },
+  name: 'EmployeeSelector',
+  components: { userImage },
+  data () {
+    let selected = JSON.parse(JSON.stringify(this.selected))
+    return {
+      employee_selected_list: selected.employee,
+      dept_selected_list: selected.dept,
+      employee_selected: [],
+      dept_selected: [],
+      com_height: '100%',
+      company_info: {},
+      actions_show: false,
+      dept_name: '',
+      dept_id: 0,
+      list: [],
+      dept_list: [],
+      keyword: '',
+      owner_id: 0,
+      user_info: this.$store.getters.user_info,
+      pid: 0,
+      pid_list: [],
+      selected_box_width: '0',
+      pid_list_arr: [],
+      visible_: false,
+      cache_list: [],
+      checked_btn: false,
+	  isIos: false // 是否需要兼容IOS X以上
+    }
+  },
+  watch: {
+    max (val) {
+      this.set_button_width()
+    },
+    selected (val) {
+      let selected = JSON.parse(JSON.stringify(val))
+      this.employee_selected = []
+      this.dept_selected = []
+      this.employee_selected_list = selected.employee
+      this.dept_selected_list = selected.dept
+      for (let i in selected.employee) {
+        this.employee_selected.push(selected.employee[i].id)
+      }
+      for (let i in selected.dept) {
+        this.dept_selected.push(selected.dept[i].dept_id)
+      }
+      this.set_button_width()
+    },
+    // 显示组件并调用初始化数据接口
+    visible (val) {
+      this.visible_ = JSON.parse(JSON.stringify(val))
+      if (val) {
+        setTimeout(() => {
+          if (this.$route.query.pid) {
+            this.pid = this.$route.query.pid
+          }
+          this.get_user_list(function () {})
+          this.get_dept_list()
+        }, 200)
+      }
+      this.set_button_width()
+    },
+    employee_selected_list () {
+      let l = this.employee_selected_list.length + this.dept_selected_list.length
+      let width = 1 * l
+      this.selected_box_width = width + 'rem'
+      this.set_button_width()
+    },
+    dept_selected_list () {
+      let l = this.employee_selected_list.length + this.dept_selected_list.length
+      let width = 1 * l
+      this.selected_box_width = width + 'rem'
+      this.set_button_width()
+    },
+    keyword () {
+      this.get_user_list(function () {})
+    }
+  },
+  mounted () {
+  },
+  methods: {
+    checked_change (val) {
+      if (val) {
+        for (let i in this.list) {
+          this.$set(this.list[i], 'checked', true)
+        }
+        this.$nextTick(() => {
+          let employeeSelectedList = JSON.parse(JSON.stringify(this.employee_selected_list))
+          let employeeSelectedIds = [], total = 0
+          employeeSelectedList.forEach(element => {
+            employeeSelectedIds.push(element.id)
+          })
+          for (const i in this.list) {
+            if (this.employee_not_select.indexOf(this.list[i].id) < 0) {
+              this.$set(this.list[i], 'checked', true)
+              if (employeeSelectedIds.includes(this.list[i].id)) {
+                total += 1
+              } else {
+                this.employee_selected_list.push(this.list[i])
+              }
+            }
+          }
+        })
+      } else {
+        this.employee_selected_list = []
+        this.employee_selected = []
+        for (let i in this.list) {
+          this.$set(this.list[i], 'checked', false)
+        }
+        // this.clear_data()
+      }
+    },
+    set_button_width () {
+      this.$nextTick(() => {})
+    },
+    back () {
+      this.pid = this.pid_list[this.pid_list.length - 1]
+      this.pid_list.splice(this.pid_list.length - 1)
+      this.pid_list_arr.splice(this.pid_list_arr.length - 1)
+      this.get_user_list(function () {
+
+      })
+    },
+    back_by_index (index) {
+      if (index == this.pid_list.length) {
+        return false
+      }
+      this.pid = this.pid_list[index]
+      this.pid_list.splice(index, 100)
+      this.pid_list_arr.splice(index, 100)
+      this.get_user_list(function () {
+
+      })
+    },
+    show_child (item) {
+      this.pid_list.push(this.pid)
+      this.pid_list_arr.push(item)
+      this.pid = item.id
+      this.list = []
+      this.get_user_list(function () {
+
+      })
+    },
+    employee_cancel (item) {
+      this.employee_selected.splice(this.employee_selected.indexOf(item.id), 1)
+      let delete_index = -1
+      for (let i in this.employee_selected_list) {
+        if (this.employee_selected.indexOf(this.employee_selected_list[i].id) < 0) {
+          delete_index = i
+        }
+      }
+      if (delete_index >= 0) {
+        this.employee_selected_list.splice(delete_index, 1)
+        for (let i in this.list) {
+          if (this.list[i].id == item.id) {
+            this.$set(this.list[i], 'checked', false)
+          }
+        }
+      }
+    },
+    dept_cancel (item) {
+      this.dept_selected.splice(this.dept_selected.indexOf(item.id), 1)
+      let delete_index = -1
+      for (let i in this.dept_selected_list) {
+        if (this.dept_selected.indexOf(this.dept_selected_list[i].id) < 0) {
+          delete_index = i
+        }
+      }
+      if (delete_index >= 0) {
+        this.dept_selected_list.splice(delete_index, 1)
+        for (let i in this.dept_list) {
+          if (this.dept_list[i].dept_id == item.id) {
+            this.$set(this.dept_list[i], 'checked', false)
+          }
+        }
+      }
+    },
+    select_employee (item) {
+      if (this.selectedQuitEmployee) {
+        if (this.employee_not_select.indexOf(item.id) >= 0 || item.status > 1) {
+          return false
+        }
+      } else {
+        if (this.employee_not_select.indexOf(item.id) >= 0) {
+          return false
+        }
+      }
+
+      if (item.checked) {
+        item.checked = false
+        this.employee_cancel(item)
+      } else {
+        if (!this.multi) {
+          this.employee_selected = []
+          this.employee_selected_list = []
+          for (let i in this.list) {
+            this.$set(this.list[i], 'checked', false)
+          }
+        }
+        if (this.max > 0 && this.employee_selected.length == this.max && this.multi) {
+          this.$toast('最多只能选择' + this.max + '人')
+          return false
+        }
+        this.employee_selected.push(item.id)
+        this.employee_selected_list.push({ id: item.id, name: item.name, img_url: item.img_url })
+        item.checked = true
+      }
+    },
+    select_dept (item) {
+      if (!this.can_select_dept) {
+        this.show_child(item)
+        return false
+      }
+      if (item.checked) {
+        item.checked = false
+        this.dept_cancel(item)
+      } else {
+        if (!this.dept_multi) {
+          this.dept_selected = []
+          this.dept_selected_list = []
+          for (let i in this.dept_list) {
+            this.$set(this.dept_list[i], 'checked', false)
+          }
+        }
+        this.dept_selected.push(item.id)
+        this.dept_selected_list.push({ dept_id: item.id, dept_name: item.name, avatar: 'static/images/e66f.jpg' })
+        item.checked = true
+      }
+    },
+    close () {
+      this.$emit('update:visible', false)
+      this.$emit('cancel')
+      if (this.close_clear_data) {
+        this.employee_selected = []
+        this.employee_selected_list = []
+        this.dept_selected = []
+        this.dept_selected_list = []
+        for (let i in this.list) {
+          this.$set(this.list[i], 'checked', false)
+        }
+        for (let i in this.dept_list) {
+          this.$set(this.dept_list[i], 'checked', false)
+        }
+      }
+    },
+    confirm () {
+      this.$emit('confirm', {
+        employee: this.employee_selected_list,
+        dept: this.dept_selected_list
+      })
+      this.close()
+    },
+    // 获取部门数据
+    get_dept_list () {
+      // 当只显示管理者列表或者 use_employee_list为True
+      if (this.use_employee_list || this.show_manager_only) {
+        return
+      }
+      this.dept_map = {}
+      request('get', '/api/department/index', { pid: this.pid, keyword: this.keyword }).then((res) => {
+        var userList = res.data.data.list || []
+        for (let i in userList) {
+          userList[i]['checked'] = false
+          if (this.dept_selected.indexOf(userList[i].id) >= 0) {
+            userList[i]['checked'] = true
+          }
+          for (let k in userList) {
+            if (!userList[i]['child']) {
+              userList[i]['child'] = []
+            }
+            if (userList[k].pid == i) {
+              userList[i]['child'].push(userList[k])
+            }
+          }
+        }
+        this.dept_list = userList
+        this.owner_id = res.data.data.owner_id
+        this.company_info = res.data.data.company_info
+        if (res.data.data.dept_info == null) {
+          this.dept_name = JSON.parse(JSON.stringify(res.data.data.company_info.name))
+          this.dept_id = 0
+        } else {
+          this.dept_name = JSON.parse(JSON.stringify(res.data.data.dept_info.name))
+          this.dept_id = res.data.data.dept_info.id
+        }
+        this.$toast.clear()
+      }).catch((e) => {
+        this.$toast.clear()
+      })
+    },
+    // 选择部门来筛选人,默认选择中的人勾上
+    parse_list (data) {
+      this.list = []
+      let _list = []
+      for (let i in data) {
+        data[i]['checked'] = false
+        if (this.employee_selected.indexOf(data[i].id) >= 0) {
+          data[i]['checked'] = true
+        }
+        if (data[i].img_url == '') {
+          data[i].img_url = ''
+        }
+        // 过滤创始人
+        if (this.is_filtration_creator) {
+          if (data[i].is_creator == 1) {
+            data.splice(i, 1)
+          }
+        }
+      }
+      this.list = data
+      this.$nextTick(() => {
+        if (this.visible && this.can_select_employee) {
+          this.$refs['scroller_com'].createPageIndex()
+        }
+      })
+    },
+
+    
+    // get_user_list (done) {
+    //   console.log('this.use_employee_list')
+    //   console.log(this.use_employee_list)
+    //   let employeeMap = window.plus ? JSON.parse(plus.storage.getItem('SET_EMPLOYEE_MAP')) : JSON.parse(localStorage.getItem('SET_EMPLOYEE_MAP'))
+    //   // 当有指定显示列表时
+      
+    //   this.$toast.loading({
+    //     mask: true,
+    //     message: '加载中...'
+    //   });
+    //   request('get', '/api/employee/index', { dept_id: this.pid, keywords: this.keyword, page: 0, page_size: 2000, is_official: 1 }).then((res) => {
+    //     let offlist = res.data.data.list
+
+    //     if (this.use_employee_list) {
+    //       let employee_list = this.employee_list
+    //       var userData = [];
+    //       offlist.map(item => {
+    //         // 列表数据是否是自己的管理范围
+    //         employee_list.map(item2 => {
+    //           if (item.id == item2.id) {
+    //             userData.push(item);
+    //           }
+    //         });
+    //       });
+
+    //       let list = userData
+    //       for (let i in list) {
+    //         list[i]['letter_index'] = '#'
+    //         if (employeeMap[list[i].id]) {
+    //           list[i]['letter_index'] = employeeMap[list[i].id].letter_index
+    //           if (employeeMap[list[i].id].img_url == '') {
+    //             list[i]['img_url'] = ''
+    //           } else {
+    //             list[i]['img_url'] = employeeMap[list[i].id].img_url
+    //           }
+    //           list[i]['status'] = employeeMap[list[i].id].status
+    //         }
+    //         list[i]['checked'] = false
+    //         if (this.employee_selected.indexOf(list[i].id) >= 0) {
+    //           list[i]['checked'] = true
+    //         }
+    //       }
+          
+    //       this.list = list.sort((a, b) => {
+    //         return a.letter_index.charCodeAt(0) - b.letter_index.charCodeAt(0)
+    //       })
+    //       done()
+    //       this.$nextTick(() => {
+    //         if (this.visible && this.can_select_employee) {
+    //           this.$refs['scroller_com'].createPageIndex()
+    //         }
+    //       })
+
+    //       this.removeSelf(list)
+    //       this.dept_list = []
+    //       return false
+    //     }
+    //     // 当点击选择部门时,传入部门ID过去出符合人员
+    //     if (this.cache_list[this.pid]) {
+    //       this.parse_list(this.cache_list[this.pid])
+    //       done()
+    //     }
+    //     // 避免多次请求
+    //     if (this.loadingUserList) { return }
+    //     this.loadingUserList = true
+
+        
+    //     let _list = []
+    //     // 把管理者过滤掉
+    //     if (this.show_manager_only) {
+    //       for (let i in offlist) {
+    //         let is_manager = false
+    //         for (let j in offlist[i].role_list) {
+    //           if (offlist[i].role_list[j].name == 'creator' || offlist[i].role_list[j].name == 'point_manager' || offlist[i].role_list[j].name == 'dept_manager' || offlist[i].role_list[j].name == 'admin') {
+    //             is_manager = true
+    //           }
+    //         }
+    //         if (is_manager) {
+    //           _list.push(offlist[i])
+    //         }
+    //       }
+    //     } else {
+    //       _list = offlist
+    //     }
+    //     // 正常进行
+    //     const list = _list
+    //     this.cache_list[this.pid] = this.removeSelf(list)
+    //     this.parse_list(list)
+    //     done()
+    //     this.$toast.clear()
+
+    //   }).catch((e) => {
+    //     done()
+    //     this.$toast.clear()
+    //   }).finally(() => {
+    //     this.loadingUserList = false
+    //     this.$toast.clear();
+    //   })
+    // },
+    // 获取人员数据
+    get_user_list (done) {
+      console.log('this.use_employee_list')
+      console.log(this.use_employee_list)
+      let employeeMap = window.plus ? JSON.parse(plus.storage.getItem('SET_EMPLOYEE_MAP')) : JSON.parse(localStorage.getItem('SET_EMPLOYEE_MAP'))
+      // 当有指定显示列表时
+      if (this.use_employee_list) {
+        let list = this.employee_list
+        for (let i in list) {
+          list[i]['letter_index'] = '#'
+          if (employeeMap[list[i].id]) {
+            list[i]['letter_index'] = employeeMap[list[i].id].letter_index
+            if (employeeMap[list[i].id].img_url == '') {
+              list[i]['img_url'] = ''
+            } else {
+              list[i]['img_url'] = employeeMap[list[i].id].img_url
+            }
+            list[i]['status'] = employeeMap[list[i].id].status
+          }
+          list[i]['checked'] = false
+          if (this.employee_selected.indexOf(list[i].id) >= 0) {
+            list[i]['checked'] = true
+          }
+        }
+        this.list = list.sort((a, b) => {
+          return a.letter_index.charCodeAt(0) - b.letter_index.charCodeAt(0)
+        })
+        done()
+        this.$nextTick(() => {
+          if (this.visible && this.can_select_employee) {
+            this.$refs['scroller_com'].createPageIndex()
+          }
+        })
+
+        this.removeSelf(list)
+        this.dept_list = []
+        return false
+      }
+      // 当点击选择部门时,传入部门ID过去出符合人员
+      if (this.cache_list[this.pid]) {
+        this.parse_list(this.cache_list[this.pid])
+        done()
+      }
+      // 避免多次请求
+      if (this.loadingUserList) { return }
+      this.loadingUserList = true
+
+      request('get', '/api/employee/index', { dept_id: this.pid, keywords: this.keyword, page: 0, page_size: 2000, is_official: 1 }).then((res) => {
+        let _list = []
+        // 把管理者过滤掉
+        console.log(this.show_manager_only)
+        if (this.show_manager_only) {
+          console.log(res.data.data.list)
+          for (let i in res.data.data.list) {
+            let is_manager = false
+            for (let j in res.data.data.list[i].role_list) {
+              if (res.data.data.list[i].role_list[j].name == 'creator' || res.data.data.list[i].role_list[j].name == 'point_manager' || res.data.data.list[i].role_list[j].name == 'dept_manager' || res.data.data.list[i].role_list[j].name == 'admin') {
+                is_manager = true
+              }
+            }
+            if (is_manager) {
+              _list.push(res.data.data.list[i])
+            }
+          }
+        } else {
+          _list = res.data.data.list
+        }
+        
+        console.log(_list)
+        // 正常进行
+        const list = _list
+        this.cache_list[this.pid] = this.removeSelf(list)
+        this.parse_list(list)
+        done()
+        this.$toast.clear()
+      }).catch((e) => {
+        done()
+        this.$toast.clear()
+      }).finally(() => this.loadingUserList = false)
+    },
+    // 删除自己
+    removeSelf (list) {
+      if (!this.include_self) {
+        const currUserId = this.$store.getters.user_info.id
+        const index = list.findIndex(o => o.id === currUserId)
+        if (index > -1) {
+          list.splice(index, 1)
+        }
+      }
+      return list
+    }
+  },
+  created () {
+    if (document.documentElement.style.height) {
+      this.com_height = document.documentElement.style.height
+    }
+    if (window.plus) {
+	  this.isIos = window.plus.storage.getItem('iPhone')
+    }
+    this.pid = this.$route.query.pid || 0
+  },
+  // 组件生命周期销毁时调用
+  beforeDestroy () {
+    if (this.append_body) {
+      document.body.removeChild(this.$el)
+    }
+    this.close()
+  }
+}
+</script>
+
+<style scoped>
+.body_com {
+  /* height: calc(100% - 3.2rem); */
+  height: calc(100% - 1.2rem);
+  position: relative;
+}
+.isIos{
+   padding-bottom: 0.4rem !important;
+}
+.body_com.show_dept_path {
+  height: calc(100% - 3.48rem);
+}
+.bottom_menu {
+  text-align: center;
+  position: fixed;
+  padding:0.1rem 0.16rem;
+  min-height: 0.9rem;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background-color: #fff;
+}
+.bottom_menu:before {
+  content: ' ';
+  height: 1px; /*no*/
+  background-color: #eee;
+  width: 100%;
+  top: 0;
+  left: 0;
+  position: absolute;
+}
+.bottom_menu a {
+  color: #1989fa;
+  font-size: 0.32rem;
+}
+
+.employee_cell_head_img {
+  width: 0.8rem;
+  height: 0.8rem;
+  margin-left: 0.16rem;
+  -webkit-border-radius: 0.1rem;
+  -moz-border-radius: 0.1rem;
+  border-radius: 0.1rem;
+  margin-right: 0.15rem;
+}
+
+.employee_cell {
+  padding: 0.16rem 0.32rem;
+}
+.employee_cell .van-checkbox {
+  overflow: visible;
+}
+.employee_cell .van-cell__title {
+  line-height: 0.8rem;
+}
+.employee_cell .van-cell__right-icon {
+  margin-top: 0.2rem;
+}
+.employee_cell .van-icon {
+  color: #999;
+  margin-top: 0.2rem;
+}
+
+.employee_selector_popup {
+  height: 100%;
+  width: 100%;
+}
+.child_btn {
+  color: #1989fa;
+  display: block;
+  height: 1.14rem;
+  position: absolute;
+  right: 0.32rem;
+  top: 0;
+  padding: 0 0.16rem;
+  line-height: 1.1rem;
+  font-size: 0.28rem;
+}
+.child_btn:active {
+  color: #323233;
+}
+.selected_box,
+.selected_btn {
+  vertical-align: top;
+}
+.selected_btn {
+  text-align: center;
+}
+.selected_box{
+    overflow-x: scroll;
+    margin-right: 0.16rem;
+}
+.ul .li {
+  width:0.9rem;
+  height:0.9rem;
+  margin-right: 0.1rem;
+}
+.ul .li img {
+  width: 0.8rem;
+  vertical-align: top;
+  height: 0.8rem;
+  padding: 0.05rem;
+  -webkit-border-radius: 0.1rem;
+  -moz-border-radius: 0.1rem;
+  border-radius: 0.1rem;
+}
+.ul .fb {
+  width:0.9rem;
+  height:0.9rem;
+  margin-right: 0.1rem;
+  position: relative;
+}
+.ul .fb img {
+  width: 0.8rem;
+  vertical-align: top;
+  height: 0.8rem;
+  padding: 0.05rem;
+  -webkit-border-radius: 0.1rem;
+  -moz-border-radius: 0.1rem;
+  border-radius: 0.1rem;
+}
+.name_mini {
+  font-size: 0.2rem;
+  position: absolute;
+  bottom: 0rem;
+  left: 0rem;
+  right: 0rem;
+  padding: 0.02rem 0;
+  text-align: center;
+  background-color: rgba(0, 0, 0, 0.4);
+  height: 0.2rem;
+  color: #fff;
+  line-height: 0.2rem;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.dept_path a {
+  color: #238dfa;
+  font-size: 0.28rem;
+}
+.dept_path a:nth-last-child(1) {
+  color: #999;
+}
+.dept_path a * {
+  vertical-align: middle;
+}
+.dept_path {
+  min-height: 0.6rem;
+  position: relative;
+  font-size: 0.32rem;
+  line-height: 0.4rem;
+  overflow-x: scroll;
+  padding: 0 0.32rem;
+}
+.dept_path:after {
+  content: ' ';
+  bottom: 0;
+  left: 0;
+  right: 0;
+  background-color: #efefef;
+  height: 1px;
+  position: absolute;
+  transform: scaleY(0.5);
+}
+.pageIndexBtn {
+  width: 100%;
+  text-align: left;
+  padding: 0.1rem 0.4rem 0.05rem;
+  color: #909399;
+  background: rgb(245, 245, 245);
+  font-size: 0.24rem;
+}
+.employee_cell .van-tag{
+  display: inline-table;
+  margin-top: 0.16rem;
+}
+</style>

+ 262 - 283
src/components/common/EmployeeSelector.vue

@@ -1,53 +1,39 @@
 <template>
-  <van-popup
-    :duration="0.2"
-    :overlay="false"
-    class="employee_selector_popup"
-    v-model="visible_"
-    :position="position"
-    :style="'height:'+com_height"
-  >
+  <van-popup @open="openPopup" :duration="0.2" :overlay="false" class="employee_selector_popup" v-model="visible_" :position="position" :style="'height:' + com_height">
     <slot name="nav"></slot>
     <van-nav-bar v-if="!$slots.nav" :title="title" left-text="取消" @click-left="close"></van-nav-bar>
-    <!-- <van-search v-model="keyword" v-if="can_select_employee" placeholder="请输入姓名搜索" />
-    <van-search v-model="keyword" v-else placeholder="请输入部门名称搜索" /> -->
-    <van-search v-model="keyword" style="margin-top: .2rem;" v-if="!can_select_employee" placeholder="请输入部门名称搜索" />
-    <div class="dept_path" v-show="pid_list_arr.length > 0">
-      <a href="javascript:void(0);" @click="back_by_index(0)">全公司</a>
-      <a
-        v-for="(item, index) in pid_list_arr"
-        :key="index"
-        href="javascript:void(0);"
-        @click="back_by_index(index + 1)"
-      >
-        <van-icon name="arrow" />
-        <Wxopendata type="departmentName" :openid="item.name"></Wxopendata>
-      </a>
-    </div>
-    <div class="body_com" :class="{show_dept_path:pid_list_arr.length > 0}">
-      <scroller :on-refresh="get_user_list" ref="scroller_com">
+    <van-search v-model="keyword" v-if="can_select_employee" placeholder="请输入姓名搜索" />
+    <van-search v-model="keyword" v-else placeholder="请输入部门名称搜索" />
+    <template v-if="isShowDeptsAll">
+      <div @click="isShowDeptSelect()" class="sax">部门筛选 <van-icon style="position: relative;top: 2px;" :name="!isShowDept? 'arrow-down':'arrow-up'" color="#909399" /></div>
+      <div class="dept_path" v-show="pid_list_arr.length > 0&&isShowDept">
+        <a href="javascript:void(0);" @click="back_by_index(0)">全公司</a>
+        <a v-for="(item, index) in pid_list_arr" :key="index" href="javascript:void(0);" @click="back_by_index(index+1,item)">
+          <van-icon name="arrow"/>
+          <Wxopendata type="departmentName" :openid="item.name"></Wxopendata>
+        </a>
+      </div>
+    </template>
+    <div class="body_com" :class="{ show_dept_path: pid_list_arr.length > 0 }">
+     <scroller ref="scroller_com">
+      <!-- <scroller :on-refresh="get_user_list" ref="scroller_com"> -->
         <!-- can_select_dept  选择部门传值 -->
-        <van-cell
-          :is-link="!can_select_dept"
-          v-for="(item,index) in dept_list"
-          :key="index"
-          :title="item.name"
-          v-show="item.pid == pid && item.name.indexOf(keyword) >= 0 && dept_not_select.indexOf(item.id) < 0"
-          class="employee_cell"
-          @click="select_dept(item)"
-        >
+        <van-cell :is-link="!can_select_dept"
+        v-for="(item, index) in dept_list" :key="index" :title="item.name"
+         v-show="isShowDept && dept_not_select.indexOf(item.id) < 0"
+        class="employee_cell"
+        @click="select_dept(item)">
           <template slot="icon">
             <van-checkbox v-if="can_select_dept" v-model="item.checked"></van-checkbox>
             <img v-if="can_select_dept" src="static/images/e66f.jpg" class="employee_cell_head_img" />
-            <!-- <userImage :id="item.id" width="0.8rem" height="0.8rem" ></userImage> -->
           </template>
           <template slot="title">
             <Wxopendata type="departmentName" :openid="item.name"></Wxopendata>
           </template>
-          <template slot="right-icon" v-if="(can_select_dept && item.child.length > 0) || (!can_select_dept && can_select_employee && item.count > 0)">
+          <template slot="right-icon" v-if="item.children.length>0">
             <a href="javascript:void(0);" class="child_btn" @click.stop="show_child(item)">| 下级</a>
           </template>
-        </van-cell>
+       </van-cell>
 
         <div style="height: .4rem; background: rgb(245, 245, 245);" v-show="selected_all"></div>
         <van-cell v-show="selected_all">
@@ -55,65 +41,42 @@
             <van-checkbox v-model="checked_btn" @change="checked_change">全选</van-checkbox>
           </template>
         </van-cell>
-        <div v-for="(item,index) in list" :key="index" v-if="can_select_employee" v-show="item.name.indexOf(keyword) >= 0">
-          <div
-            v-if="index == 0"
-            :data-pageindex="item.letter_index"
-            class="pageIndexBtn"
-          >{{item.letter_index}}</div>
-          <div
-            v-if="index > 0 && list[index-1].letter_index != item.letter_index"
-            :data-pageindex="item.letter_index"
-            class="pageIndexBtn"
-          >{{item.letter_index}}</div>
+        <div v-for="(item, index) in list" :key="index" v-if="can_select_employee">
+          <!-- <div v-if="index == 0" :data-pageindex="item.letter_index" class="pageIndexBtn">{{ item.letter_index }}</div>
+          <div v-if="index > 0 && list[index - 1].letter_index != item.letter_index" :data-pageindex="item.letter_index" class="pageIndexBtn">{{ item.letter_index }}</div> -->
           <van-cell
-            :class="{'letter-first': index == 0 || (index > 0 && list[index-1].letter_index != item.letter_index)}"
+            :class="{ 'letter-first': index == 0 || (index > 0 && list[index - 1].letter_index != item.letter_index) }"
             v-if="can_select_employee"
-            :title="item.name+(item.identification?'(直属上级)':'')"
+            :title="item.name + (item.identification ? '(直属上级)' : '')"
             class="employee_cell"
             @click="select_employee(item)"
           >
             <template slot="icon">
-              <van-checkbox
-                v-if="selectedQuitEmployee"
-                :style="item.status > 1 || employee_not_select.indexOf(item.id) >= 0?'opacity: 0':'opacity: 1'"
-                v-model="item.checked"
-              ></van-checkbox>
-              <van-checkbox
-                v-if="!selectedQuitEmployee"
-                :style="employee_not_select.indexOf(item.id) > 0?'opacity: 0':'opacity: 1'"
-                v-model="item.checked"
-              ></van-checkbox>
-
-              <!-- {opacity: item.status < 2 || employee_not_select.indexOf(item.id) < 0 ? 1 :0} -->
-              <userImage
-                class="employee_cell_head_img"
-                :img_url ="item.img_url"
-                :user_name="item.name"
-                width="0.8rem"
-                height="0.8rem"
-                fontSize="0.2"
-              ></userImage>
-              <!-- <img :src="item.img_url"class="employee_cell_head_img"/> -->
+              <van-checkbox v-if="selectedQuitEmployee"  :style="item.status > 1 || employee_not_select.indexOf(item.id) >= 0 ? 'opacity: 0' : 'opacity: 1'" v-model="item.checked"></van-checkbox>
+              <van-checkbox v-if="!selectedQuitEmployee" :style="employee_not_select.indexOf(item.id) > 0 ? 'opacity: 0' : 'opacity: 1'" v-model="item.checked"></van-checkbox>
+              <userImage class="employee_cell_head_img" :img_url="item.img_url" :user_name="item.name" width="0.8rem" height="0.8rem" fontSize="0.2"></userImage>
             </template>
             <template slot="title">
               <Wxopendata type="userName" :openid="item.name"></Wxopendata>{{item.identification?'(直属上级)':''}}
             </template>
-            <template slot="right-icon" v-if="typeof(item.status) != 'undefined'">
-              <van-tag plain v-show="item.status == 0 || item.status == 2">{{item.status == 0 ?'未加入':'离职'}}</van-tag>
+            <template slot="right-icon" v-if="typeof item.status != 'undefined'">
+              <van-tag plain v-show="item.status == 0 || item.status == 2">{{ item.status == 0 ? '未加入' : '离职' }}</van-tag>
             </template>
           </van-cell>
+
         </div>
+        <van-empty v-if="list.length==0" description="暂无数据..."/>
+        <div style="height: 1rem;"></div>
       </scroller>
     </div>
     <slot name="footer"></slot>
-    <div class="bottom_menu flex-box flex-v-ce" :class="{isIos:isIos}">
+    <div class="bottom_menu flex-box flex-v-ce" :class="{ isIos: isIos }">
       <div class="selected_box flex-1">
-        <div class="flex-box flex-v-ce ul" :style="'width:'+selected_box_width">
-          <div v-for="(item,index) in employee_selected_list" :key="index" @click="employee_cancel(item)" class="li">
-            <userImage :img_url ="item.img_url" :user_name="item.name" width="0.9rem" height="0.9rem"  fontSize="0.2"></userImage>
+        <div class="flex-box flex-v-ce ul" :style="'width:' + selected_box_width">
+          <div v-for="(item, index) in employee_selected_list" :key="index" @click="employee_cancel(item)" class="li">
+            <userImage :img_url="item.img_url" :user_name="item.name" width="0.9rem" height="0.9rem" fontSize="0.2"></userImage>
           </div>
-          <div v-for="(item,index) in dept_selected_list" :key="index" @click="dept_cancel(item)" class="fb">
+          <div v-for="(item, index) in dept_selected_list" :key="index" @click="dept_cancel(item)" class="fb">
             <img src="static/images/e66f.jpg" />
             <div class="name_mini"><Wxopendata type="departmentName" :openid="item.dept_name"></Wxopendata></div>
           </div>
@@ -121,8 +84,11 @@
       </div>
       <div class="selected_btn" ref="selected_btn">
         <van-button ref="selected_button" style="height: 0.7rem; line-height: 0.7rem;" type="info" @click="confirm">
-          确定<template v-if="multi && max*1 > 0">({{employee_selected_list.length}}/{{max}})</template>
-         </van-button>
+          确定
+          <template v-if="multi && max * 1 > 0">
+            ({{ employee_selected_list.length }}/{{ max }})
+          </template>
+        </van-button>
       </div>
     </div>
   </van-popup>
@@ -140,53 +106,68 @@ Vue.use(ActionSheet)
 Vue.use(Search)
 export default {
   props: {
-    position: {// 弹窗从哪里出来
+    position: {
+      // 弹窗从哪里出来
       type: String,
       default: 'bottom'
     },
-    append_body: {// 销毁组件时清空标题的作用
+    append_body: {
+      // 销毁组件时清空标题的作用
       type: Boolean,
       default: false
     },
-    visible: { // 是否显示组件
+    visible: {
+      // 是否显示组件
       type: Boolean,
       default: false
     },
-    can_select_dept: { // 指定是否能选择部门
+    can_select_dept: {
+      // 指定是否能选择部门
       type: Boolean,
       default: true
     },
-    can_select_employee: { // 指定是否能选择员工
+    can_select_employee: {
+      // 指定是否能选择员工
       type: Boolean,
       default: true
     },
-    employee_not_select: { // 排除员工的ID,包含ID时不出现在选择列表中
+    employee_not_select: {
+      // 排除员工的ID,包含ID时不出现在选择列表中
       type: Array,
-      default: () => { return [] }
+      default: () => {
+        return []
+      }
     },
-    dept_not_select: { // dept_not_select
+    dept_not_select: {// 不选择的部门
       type: Array,
-      default: () => { return [] }
+      default: () => {
+        return []
+      }
     },
-    selected: { // 已经选择的员工和部门
+    selected: {
+      // 已经选择的员工和部门
       type: Object,
       default: () => {
         return { employee: [], dept: [] }
       }
     },
-    multi: { // 指定员工是否能多选
+    multi: {
+      // 指定员工是否能多选
       type: Boolean,
       default: true
     },
-    dept_multi: { // dept_multi
+    dept_multi: {// 部门能否多选
       type: Boolean,
       default: true
     },
-    employee_list: { // 指定显示的员工列表,注意:传值后组件的员工数据将不是统一向服务器获取的,而是指定的员工列表,格式是:[{id: 1, name: “张三”, img_url: “”}]
+    employee_list: {
+      // 指定显示的员工列表,注意:传值后组件的员工数据将不是统一向服务器获取的,而是指定的员工列表,格式是:[{id: 1, name: “张三”, img_url: “”}]
       type: Array,
-      default: null
+      default: () => {
+        return []
+      }
     },
-    use_employee_list: { // 为true时,employee_list才生效
+    use_employee_list: {// 为true时,employee_list才生效
       type: Boolean,
       default: false
     },
@@ -194,33 +175,51 @@ export default {
       type: Boolean,
       default: true
     },
-    max: { // 当multi为true时,用来限制选择人数,0不生效
+    max: {
+      // 当multi为true时,用来限制选择人数,0不生效
       type: Number,
       default: 0
     },
-    include_self: { // 是否显示当前登录的员工信息
+    include_self: {// 是否显示当前登录的员工信息
       type: Boolean,
       default: true
     },
-    show_manager_only: { // 是否只显示管理者列表
+    show_manager_only: {
+      // 是否只显示管理者列表
       type: Boolean,
       default: false
     },
-    title: { // cell的显示名称
+    title: {// cell的显示名称
       type: String,
       default: ''
     },
-    selected_all: { // 是否选择全部
+    selected_all: {
+      // 是否选择全部
       type: Boolean,
       default: false
     },
-    selectedQuitEmployee: {//
+    selectedQuitEmployee: {
+      //
       type: Boolean,
       default: true
     },
-    is_filtration_creator: {// 是否过滤掉创始人
+    is_filtration_creator: {
+      // 是否过滤掉创始人
+      type: Boolean,
+      default: false
+    },
+    isShowDepts: {
+      // 默认是否显示部门
       type: Boolean,
       default: false
+    },
+    deptId: {// 指定显示某部门的人员,(这是部门ID)
+      type: Number,
+      default: 0
+    },
+    isShowDeptsAll: {// 是否不可看部门选择
+      type: Boolean,
+      default: true
     }
   },
   name: 'EmployeeSelector',
@@ -233,42 +232,25 @@ export default {
       employee_selected: [],
       dept_selected: [],
       com_height: '100%',
-      company_info: {},
-      actions_show: false,
-      dept_name: '',
-      dept_id: 0,
-      list: [],
-      dept_list: [],
-      keyword: '',
-      owner_id: 0,
-      user_info: this.$store.getters.user_info,
+      dept_name: '', // 公司名称
+      dept_id: 0, // 公司ID
+      list: [], // 人员列表
+      dept_list: [], // 部门列表
+      dept_list_all: [], // 备用
+      keyword: '', // 关键字
       pid: 0,
-      pid_list: [],
       selected_box_width: '0',
-      pid_list_arr: [],
-      visible_: false,
+      pid_list_arr: [], // 选择的公司,顶部显示
+      visible_: false, // 是否显示组件
       cache_list: [],
       checked_btn: false,
-	  isIos: false // 是否需要兼容IOS X以上
+      isIos: false, // 是否需要兼容IOS X以上
+      isShowDept: false// 控制显示部门选择
     }
   },
   watch: {
-    max (val) {
-      this.set_button_width()
-    },
     selected (val) {
-      let selected = JSON.parse(JSON.stringify(val))
-      this.employee_selected = []
-      this.dept_selected = []
-      this.employee_selected_list = selected.employee
-      this.dept_selected_list = selected.dept
-      for (let i in selected.employee) {
-        this.employee_selected.push(selected.employee[i].id)
-      }
-      for (let i in selected.dept) {
-        this.dept_selected.push(selected.dept[i].dept_id)
-      }
-      this.set_button_width()
+      this.setSelected(val)
     },
     // 显示组件并调用初始化数据接口
     visible (val) {
@@ -278,33 +260,53 @@ export default {
           if (this.$route.query.pid) {
             this.pid = this.$route.query.pid
           }
+          if (this.deptId != 0) {
+            this.pid = this.deptId
+          }
           this.get_user_list(function () {})
           this.get_dept_list()
         }, 200)
       }
-      this.set_button_width()
     },
     employee_selected_list () {
       let l = this.employee_selected_list.length + this.dept_selected_list.length
       let width = 1 * l
       this.selected_box_width = width + 'rem'
-      this.set_button_width()
     },
     dept_selected_list () {
       let l = this.employee_selected_list.length + this.dept_selected_list.length
       let width = 1 * l
       this.selected_box_width = width + 'rem'
-      this.set_button_width()
-    },
-    keyword () {
-      this.get_user_list(function () {})
     }
+    // keyword () {
+    //   this.get_user_list(function () {})
+    // }
   },
   mounted () {
-    // console.log(this.is_filtration_creator)
-    // console.log(this.employee_list)
+    this.isShowDept = this.isShowDepts
   },
   methods: {
+    setSelected (val) {
+      let selected = JSON.parse(JSON.stringify(val))
+      this.employee_selected = []
+      this.dept_selected = []
+      this.employee_selected_list = selected.employee
+      this.dept_selected_list = selected.dept
+      for (let i in selected.employee) {
+        this.employee_selected.push(selected.employee[i].id)
+      }
+      for (let i in selected.dept) {
+        this.dept_selected.push(selected.dept[i].dept_id)
+      }
+    },
+    // 打开时触发
+    openPopup () {
+      this.setSelected(this.selected)
+    },
+    // 控制部门显示隐藏
+    isShowDeptSelect () {
+      this.isShowDept = !this.isShowDept
+    },
     checked_change (val) {
       if (val) {
         for (let i in this.list) {
@@ -317,11 +319,13 @@ export default {
             employeeSelectedIds.push(element.id)
           })
           for (const i in this.list) {
-            this.$set(this.list[i], 'checked', true)
-            if (employeeSelectedIds.includes(this.list[i].id)) {
-              total += 1
-            } else {
-              this.employee_selected_list.push(this.list[i])
+            if (this.employee_not_select.indexOf(this.list[i].id) < 0) {
+              this.$set(this.list[i], 'checked', true)
+              if (employeeSelectedIds.includes(this.list[i].id)) {
+                total += 1
+              } else {
+                this.employee_selected_list.push(this.list[i])
+              }
             }
           }
         })
@@ -331,39 +335,31 @@ export default {
         for (let i in this.list) {
           this.$set(this.list[i], 'checked', false)
         }
-        // this.clear_data()
       }
     },
-    set_button_width () {
-      this.$nextTick(() => {})
-    },
-    back () {
-      this.pid = this.pid_list[this.pid_list.length - 1]
-      this.pid_list.splice(this.pid_list.length - 1)
-      this.pid_list_arr.splice(this.pid_list_arr.length - 1)
-      this.get_user_list(function () {
-
-      })
-    },
-    back_by_index (index) {
-      if (index == this.pid_list.length) {
-        return false
-      }
-      this.pid = this.pid_list[index]
-      this.pid_list.splice(index, 100)
+    back_by_index (index, item) {
       this.pid_list_arr.splice(index, 100)
-      this.get_user_list(function () {
-
-      })
+      if (index == 0) { // 点击全部
+        this.dept_list = this.dept_list_all
+        this.pid_list_arr = []
+        this.pid = 0
+      }
+      if (item) {
+        if (item.children) {
+          this.dept_list = item.children
+          this.pid = item.id
+        }
+      }
+      this.get_user_list(function () {})
     },
     show_child (item) {
-      this.pid_list.push(this.pid)
+      if (item.children) {
+        this.dept_list = item.children
+      }
       this.pid_list_arr.push(item)
       this.pid = item.id
       this.list = []
-      this.get_user_list(function () {
-
-      })
+      this.get_user_list(function () {})
     },
     employee_cancel (item) {
       this.employee_selected.splice(this.employee_selected.indexOf(item.id), 1)
@@ -409,7 +405,6 @@ export default {
           return false
         }
       }
-
       if (item.checked) {
         item.checked = false
         this.employee_cancel(item)
@@ -476,46 +471,24 @@ export default {
     },
     // 获取部门数据
     get_dept_list () {
-      // 当只显示管理者列表或者 use_employee_list为True
-      if (this.use_employee_list || this.show_manager_only) {
-        return
-      }
       this.dept_map = {}
-      request('get', '/api/department/index', { pid: this.pid, keyword: this.keyword }).then((res) => {
+      request('get', '/api/department/tree', '').then(res => {
         var userList = res.data.data.list || []
         for (let i in userList) {
           userList[i]['checked'] = false
           if (this.dept_selected.indexOf(userList[i].id) >= 0) {
             userList[i]['checked'] = true
           }
-          for (let k in userList) {
-            if (!userList[i]['child']) {
-              userList[i]['child'] = []
-            }
-            if (userList[k].pid == i) {
-              userList[i]['child'].push(userList[k])
-            }
-          }
         }
         this.dept_list = userList
-        this.owner_id = res.data.data.owner_id
-        this.company_info = res.data.data.company_info
-        if (res.data.data.dept_info == null) {
-          this.dept_name = JSON.parse(JSON.stringify(res.data.data.company_info.name))
-          this.dept_id = 0
-        } else {
-          this.dept_name = JSON.parse(JSON.stringify(res.data.data.dept_info.name))
-          this.dept_id = res.data.data.dept_info.id
-        }
-        this.$toast.clear()
-      }).catch((e) => {
+        this.dept_list_all = userList
+      }).finally(() => {
         this.$toast.clear()
       })
     },
     // 选择部门来筛选人,默认选择中的人勾上
     parse_list (data) {
       this.list = []
-      let _list = []
       for (let i in data) {
         data[i]['checked'] = false
         if (this.employee_selected.indexOf(data[i].id) >= 0) {
@@ -524,12 +497,6 @@ export default {
         if (data[i].img_url == '') {
           data[i].img_url = ''
         }
-        // 过滤创始人
-        if (this.is_filtration_creator) {
-          if (data[i].is_creator == 1) {
-            data.splice(i, 1)
-          }
-        }
       }
       this.list = data
       this.$nextTick(() => {
@@ -540,85 +507,87 @@ export default {
     },
     // 获取人员数据
     get_user_list (done) {
-      let employeeMap = window.plus ? JSON.parse(plus.storage.getItem('SET_EMPLOYEE_MAP')) : JSON.parse(localStorage.getItem('SET_EMPLOYEE_MAP'))
-      // 当有指定显示列表时
-      if (this.use_employee_list) {
-        let list = this.employee_list
-        for (let i in list) {
-          list[i]['letter_index'] = '#'
-          if (employeeMap[list[i].id]) {
-            list[i]['letter_index'] = employeeMap[list[i].id].letter_index
-            if (employeeMap[list[i].id].img_url == '') {
-              list[i]['img_url'] = ''
-            } else {
-              list[i]['img_url'] = employeeMap[list[i].id].img_url
-            }
-            list[i]['status'] = employeeMap[list[i].id].status
-          }
-          list[i]['checked'] = false
-          if (this.employee_selected.indexOf(list[i].id) >= 0) {
-            list[i]['checked'] = true
-          }
+      if (this.loadingUserList) { return }
+      this.loadingUserList = true
+      request('get', '/api/employee/index', { dept_id: this.pid, keywords: this.keyword, page: 0, page_size: 2000, is_official: 1 }).then(res => {
+        var list = this.filtration(res.data.data.list)// 过滤各种条件
+        // 当有指定显示列表时
+        console.log(this.use_employee_list)
+        console.log(this.employee_list)
+        console.log(list)
+        if (this.use_employee_list) {
+          var employeeList = this.employee_list
+          var userData = []
+          list.map((item) => { // 列表数据是否是自己的管理范围
+            employeeList.map((item2) => {
+              if (item.id == item2.id) {
+                userData.push(item)
+              }
+            })
+          })
+          console.log(userData)
+          this.parse_list(userData)
+        } else { // 没有指定人员列表
+          this.cache_list[this.pid] = list
+          this.parse_list(list)
         }
-        this.list = list.sort((a, b) => {
-          return a.letter_index.charCodeAt(0) - b.letter_index.charCodeAt(0)
-        })
+      }).finally(() => {
         done()
-        this.$nextTick(() => {
-          if (this.visible && this.can_select_employee) {
-            this.$refs['scroller_com'].createPageIndex()
-          }
-        })
+        this.$toast.clear()
+        this.loadingUserList = false
+      })
 
-        this.removeSelf(list)
-        this.dept_list = []
-        return false
-      }
       // 当点击选择部门时,传入部门ID过去出符合人员
       if (this.cache_list[this.pid]) {
         this.parse_list(this.cache_list[this.pid])
         done()
       }
-      // 避免多次请求
-      if (this.loadingUserList) { return }
-      this.loadingUserList = true
-
-      request('get', '/api/employee/list', { dept_id: this.pid, keywords: this.keyword, page: 0, page_size: 2000 }).then((res) => {
-        let _list = []
-        // 把管理者过滤掉
-        if (this.show_manager_only) {
-          for (let i in res.data.data.list) {
-            let is_manager = false
-            for (let j in res.data.data.list[i].role_list) {
-              if (res.data.data.list[i].role_list[j].name == 'creator' || res.data.data.list[i].role_list[j].name == 'point_manager' || res.data.data.list[i].role_list[j].name == 'dept_manager' || res.data.data.list[i].role_list[j].name == 'admin') {
-                is_manager = true
-              }
-            }
-            if (is_manager) {
-              _list.push(res.data.data.list[i])
+    },
+    // 过滤各种条件:如:自己,创始人,只显示管理者等。。。
+    filtration (data) {
+      var list = data
+      // 去除已经离职的人
+      for (let i = 0; i < list.length; i++) {
+        if (list[i].status == 2) {
+          list.splice(i, 1)
+          i--
+        }
+      }
+      var managerList = [] // 管理者列表
+      // 只显示管理者
+      if (this.show_manager_only) {
+        var isManager
+        list.map(item => {
+          isManager = false
+          item.employee_detail.role_list.map(item2 => {
+            if (item2.name == 'creator' || item2.name == 'point_manager' || item2.name == 'dept_manager' || item2.name == 'admin') {
+              isManager = true
             }
+          })
+          if (isManager) {
+            managerList.push(item)
           }
-        } else {
-          _list = res.data.data.list
-        }
-        // 正常进行
-        const list = _list
-        this.cache_list[this.pid] = this.removeSelf(list)
-        this.parse_list(list)
-        done()
-        this.$toast.clear()
-      }).catch((e) => {
-        done()
-        this.$toast.clear()
-      }).finally(() => this.loadingUserList = false)
-    },
-    // 删除自己
-    removeSelf (list) {
+        })
+        list = managerList
+      }
+
+      // 过滤自己
       if (!this.include_self) {
-        const currUserId = this.$store.getters.user_info.id
-        const index = list.findIndex(o => o.id === currUserId)
-        if (index > -1) {
-          list.splice(index, 1)
+        const currUserId = this.$userInfo().id
+        for (let i = 0; i < list.length; i++) {
+          if (list[i].id == currUserId) {
+            list.splice(i, 1)
+            i--
+          }
+        }
+      }
+      // 过滤创始人
+      if (this.is_filtration_creator) {
+        for (let i = 0; i < list.length; i++) {
+          if (list[i].is_creator == 1) {
+            list.splice(i, 1)
+            i--
+          }
         }
       }
       return list
@@ -629,14 +598,17 @@ export default {
       this.com_height = document.documentElement.style.height
     }
     if (window.plus) {
-	  this.isIos = window.plus.storage.getItem('iPhone')
+      this.isIos =(plus.storage.getItem('iPhone')=='false')? false:true;
     }
-    this.pid = this.$route.query.pid || 0
   },
   // 组件生命周期销毁时调用
   beforeDestroy () {
     if (this.append_body) {
-      document.body.removeChild(this.$el)
+      this.$nextTick(()=>{
+        if(document.body.contains(this.$el)){//判断有无在body中
+          document.body.removeChild(this.$el)
+        }
+      })
     }
     this.close()
   }
@@ -644,12 +616,18 @@ export default {
 </script>
 
 <style scoped>
+ .sax{
+   text-align: center;
+   font-size: 0.32rem;
+   padding-bottom: 0.2rem;
+   border-bottom: 1px solid #f1f1f1;
+ }
 .body_com {
   height: calc(100% - 3.2rem);
   position: relative;
 }
-.isIos{
-   padding-bottom: 0.4rem !important;
+.isIos {
+  padding-bottom: 0.4rem !important;
 }
 .body_com.show_dept_path {
   height: calc(100% - 3.48rem);
@@ -657,7 +635,7 @@ export default {
 .bottom_menu {
   text-align: center;
   position: fixed;
-  padding:0.1rem 0.16rem;
+  padding: 0.1rem 0.16rem;
   min-height: 0.9rem;
   left: 0;
   right: 0;
@@ -686,6 +664,7 @@ export default {
   -moz-border-radius: 0.1rem;
   border-radius: 0.1rem;
   margin-right: 0.15rem;
+  transition: all 1s;
 }
 
 .employee_cell {
@@ -730,13 +709,13 @@ export default {
 .selected_btn {
   text-align: center;
 }
-.selected_box{
-    overflow-x: scroll;
-    margin-right: 0.16rem;
+.selected_box {
+  overflow-x: scroll;
+  margin-right: 0.16rem;
 }
 .ul .li {
-  width:0.9rem;
-  height:0.9rem;
+  width: 0.9rem;
+  height: 0.9rem;
   margin-right: 0.1rem;
 }
 .ul .li img {
@@ -749,8 +728,8 @@ export default {
   border-radius: 0.1rem;
 }
 .ul .fb {
-  width:0.9rem;
-  height:0.9rem;
+  width: 0.9rem;
+  height: 0.9rem;
   margin-right: 0.1rem;
   position: relative;
 }
@@ -793,7 +772,7 @@ export default {
   height: 0.6rem;
   position: relative;
   font-size: 0.32rem;
-  line-height: 0.4rem;
+  line-height: 0.5rem;
   overflow-x: scroll;
   padding: 0 0.32rem;
 }
@@ -815,7 +794,7 @@ export default {
   background: rgb(245, 245, 245);
   font-size: 0.24rem;
 }
-.employee_cell .van-tag{
+.employee_cell .van-tag {
   display: inline-table;
   margin-top: 0.16rem;
 }

+ 5 - 5
src/components/common/RuleCategorySelector1.vue

@@ -32,8 +32,8 @@
         <van-cell-group style="margin-top:0;">
         <van-cell  v-if="can_select_rule" v-for="(item,index) in list" :key="index" :title="item.remark" class="employee_cell rule_list_item" @click="select_employee(item)" v-show="rule_not_select.indexOf(item.id) < 0  && item.remark.indexOf(keyword) >= 0">
           <template slot="label">
-            <span class="record color_green" v-if="item.min_point <= 0">{{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}</span>
-            <span class="record color_red" v-if="item.min_point > 0">+ {{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}</span>
+            <span class="record color_red" v-if="item.min_point <= 0">{{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}</span>
+            <span class="record color_green" v-if="item.min_point > 0">+ {{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}</span>
             <span class="type">{{types_list[item.pt_id]}}</span>
           </template>
           <template slot="icon">
@@ -179,9 +179,9 @@ export default {
         for (let i in this.category_list) {
           if (this.category_list[i].id == val) {
             item = this.category_list[i]
-            if (this.category_list[i].child.length > 0) {
-              item = this.category_list[i].child[0]
-            }
+            // if (this.category_list[i].child.length > 0) {
+            //   item = this.category_list[i].child[0]
+            // }
           }
         }
         this.show_child(item)

+ 2 - 1
src/components/common/TabsList.vue

@@ -96,7 +96,8 @@ export default {
     selectedTabIndex: { type: Number, default: -1 },
     tabsOption: { type: Array, default: null },
     isSameContent: { type: Boolean, default: false },
-    cancel_buttons: { type: String}//传入一个参数,判断等于这个参数的时候隐藏按钮,不影响其他组件
+    cancel_buttons: { type: String},//传入一个参数,判断等于这个参数的时候隐藏按钮,不影响其他组件
+    list: { type: Array},//传入一个参数,判断等于这个参数的时候隐藏按钮,不影响其他组件
   },
   data() {
     let activeTab = null;

+ 0 - 329
src/components/common/coreDialog.vue

@@ -1,329 +0,0 @@
-<template>
-  <van-dialog
-    class="no_radius"
-    v-model="show"
-    get-container="body"
-    :beforeClose="colseButton"
-    :showConfirmButton="false"
-    :close-on-click-overlay="true"
-  >
-    <div>
-
-      <div ref="sharebox">
-      <van-icon v-show="close_show" name="cross" style=" position: absolute; right: 0; top: 0; padding: 0.25rem;" @click="colseButton"/>
-      <div class="title">
-        <div style="margin-right: 0.24rem;">
-          <van-image :width="'1.02rem'" :heigth="'1.02rem'" :src="logo" fit="contain"/>
-        </div>
-        <div style=" overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 100%;">
-          <div style="font-size: 20px;color: #303133;">{{company_info.name}}</div>
-          <div style="font-size: 14px;color: #000000;">扫一扫,快速加入我们</div>
-        </div>
-      </div>
-
-      <div style="text-align: center;">
-        <div style="text-align: center;">
-
-          <qrcode-vue v-show="false" class="qrcode_box" :value="url" :size="252" level="H"></qrcode-vue>
-          <div class="qrcode_box">
-            <img style="width:4.5rem;" v-if="qr!=''" :src="qr" />
-          </div>
-
-          <div style="font-size: 12px;color:#D2691E;text-align: center;font-size:0.24rem;">使用【功道云APP】,扫描上方二维码快速加入企业</div>
-        </div>
-        <div style="height: 0.32rem;"></div>
-      </div>
-      </div>
-        <div style="text-align: center;">
-        <div class="getDonload">
-          <div @click="download_img" style="float: left;">
-            <icon name="download_qrcode" class="download_qrcode"></icon>
-            <div>下载二维码</div>
-          </div>
-          <div style="float: right;" @click="share_img()">
-            <icon name="share_qrcode" class="share_qrcode"></icon>
-            <div>分享二维码</div>
-          </div>
-        </div>
-      </div>
-
-    </div>
-  </van-dialog>
-</template>
-
-<script>
-import QrcodeVue from 'qrcode.vue'
-import request from '@/utils/request'
-export default {
-  props: {
-    show: { // 控制弹窗
-      type: Boolean,
-      default: false
-    },
-    logo: {
-      type: String,
-      default: 'static/images/default_company_logo.png'
-    }
-  },
-  name: 'share',
-  data () {
-    return {
-      close_show: true,
-      qr: '',
-      company_info: JSON.parse(JSON.stringify(this.$store.getters.user_info.company_info)),
-      user_info: this.$store.getters.user_info, // 保存个人用户信息
-      shares: [],
-      iShare: false,
-      isApple: true,
-      newshow: false,
-      url: '',
-      logo_url: '',
-      no_radius: false
-    }
-  },
-  components: {
-    QrcodeVue
-  },
-  watch: {
-    show (newValue) {
-      this.newshow = newValue
-    }
-  },
-  created () {
-    let self = this
-    // self.getImage(this.company_info.logo_url)
-    if (window.plus) {
-      window.plus.share.getServices(function (s) {
-        self.shares = s
-      }, function (e) {
-        alert('获取分享服务列表失败:' + e.message)
-      })
-    }
-    self.$nextTick(() => {
-      self.get_shares_url()
-      self.create_img_com()
-    })
-  },
-  methods: {
-    create_img_com () {
-      let cas = document.querySelectorAll('.qrcode_box canvas').item(0)
-      if (cas != null) {
-        this.qr = cas.toDataURL('image/png', 1)
-        return
-      }
-      setTimeout(() => {
-        this.create_img_com()
-      }, 100)
-    },
-    // 获取url
-    get_shares_url () {
-      this.url = process.env.WEB_LINK + '/#/invite_reg?site_id=' + this.user_info.site_id + '&employee_id=' + this.user_info.id + '&company_name=' + this.company_info.name + '&employee_name=' + this.user_info.name + '&company_logo_url=' + this.company_info.logo_url
-    },
-    createObjectURL (object) {
-      return (window.URL) ? window.URL.createObjectURL(object) : window.webkitURL.createObjectURL(object)
-    },
-    getImage: function (url) {
-      if (!url) { return false }
-      let self = this
-      request('get', url, {responseType: 'blob'}).then(res => {
-        self.logo_url = self.createObjectURL(res.data)
-      })
-    },
-    share_img () {
-      let self = this
-      self.create_img(self.$refs['sharebox'], function (img) {
-        self.query_share(self.shares, img)
-      })
-    },
-    download_img () {
-      let self = this
-      setTimeout(() => {
-        self.create_img(self.$refs['sharebox'], function (img) {
-          if (window.plus) {
-            window.plus.gallery.save(img, function () {
-              self.$toast({
-                message: '图片已保存到相册',
-                icon: 'certificate'
-              })
-            }, function (e) {
-              self.$toast.fail('图片保存失败')
-            })
-          }
-        })
-      }, 200)
-    },
-
-    create_img (element, callback) {
-      if (window.plus.os.name == 'Android') {
-        this.create_img_android(element, callback)
-      } else {
-        this.create_img_ios(element, callback)
-      }
-    },
-
-    create_img_ios (element, callback) {
-      // 获取可视区域的位置
-      let self = this
-      self.close_show = false
-      self.$nextTick(() => {
-        setTimeout(() => {
-          var pos = element.getBoundingClientRect()
-          var size = {height: element.offsetHeight, width: element.offsetWidth}
-          var ws = plus.webview.currentWebview()
-          var bitmap = new plus.nativeObj.Bitmap('qrcode')
-          // 将webview内容绘制到Bitmap对象中
-          ws.draw(bitmap, function () {
-            var dataUrl = bitmap.toBase64Data()
-            var b = new plus.nativeObj.Bitmap('bitblmap')
-            var fileName = '_doc/canvas_share.jpg'
-            b.loadBase64Data(dataUrl, function () {
-              /* 这里一定要是_doc目录 */
-              b.save(fileName, {overwrite: true}, function (object) {
-                self.close_show = true
-                callback(fileName)
-              }, function () {
-                self.close_show = true
-                self.$toast('图片保存失败')
-              })
-            }, function () {
-              self.close_show = true
-              self.$toast('图片保存失败')
-            })
-          }, function (e) {
-            self.close_show = true
-            console.log('截屏绘制图片失败:' + JSON.stringify(e))
-          }, {clip: {top: (pos.top + 0) + 'px', left: (pos.left + 0) + 'px', height: size.height + 'px', width: size.width + 'px'}})
-        }, 200)
-      })
-    },
-    create_img_android (element, callback) {
-      // 获取可视区域的位置
-      document.body.style.width = '100%'
-      let self = this
-      self.close_show = false
-      self.$nextTick(() => {
-        setTimeout(() => {
-          var pos = element.getBoundingClientRect()
-          var size = {height: element.offsetHeight, width: element.offsetWidth}
-          var window_height = window.innerHeight
-          var window_width = window.innerWidth
-          var top = (Math.ceil((pos.top / window_height) * 100)) + '%'
-          var left = (Math.ceil((pos.left / window_width) * 100)) + '%'
-          var width = (Math.floor((size.width / window_width) * 100) - 1) + '%'
-          var height = (Math.floor((size.height / window_height) * 100) - 1) + '%'
-          var ws = plus.webview.currentWebview()
-          var bitmap = new plus.nativeObj.Bitmap('qrcode')
-          // 将webview内容绘制到Bitmap对象中
-          ws.draw(bitmap, function () {
-            var fileName = '_doc/canvas_share.jpg'
-            bitmap.save(fileName, {clip: {top: top, left: left, width: width, height: height}, overwrite: true}, function (object) {
-              callback(object.target)
-              self.close_show = true
-            }, function (e) {
-              self.close_show = true
-              self.$toast('图片保存失败')
-            })
-          }, function (e) {
-            console.log('截屏绘制图片失败:' + JSON.stringify(e))
-          })
-        }, 200)
-      })
-    },
-
-    query_share (s, pic) {
-      let pictures = pic
-      if (window.plus.os.name == 'Android') {
-        // 安卓需要全路径
-        pictures = window.plus.io.convertLocalFileSystemURL(pictures)
-      }
-      s[0].send({
-        pictures: [pictures], // pictures是一个字符串数组
-        type: 'image',
-        extra: {scene: 'WXSceneSession'}// "WXSceneSession"分享到微信的“我的好友”; "WXSceneTimeline"分享到微信的“朋友圈”中;
-      }, function () {
-        self.$toast({
-          message: '已分享',
-          icon: 'certificate'
-        })
-      }, function (e) {
-        alert('分享失败:' + e.message)
-      })
-    },
-    colseButton () {
-      this.closeDialog()
-    },
-    closeDialog () {
-      this.newshow = false
-      this.$emit('changeShow') // 改变父组件中show的值
-    }
-  }
-}
-</script>
-
-<style scoped>
-  .no_radius{border-radius: 0 !important;}
-  .title {
-      display: flex;
-      flex-direction: unset;
-      align-items: center;
-      color:#303133;
-      padding:0.52rem 0.3rem 0 0.4rem;
-    }
-    .title /deep/ img.van-image__img{
-      width: 1.02rem;
-      height: 1.02rem;
-      color: #fff;
-      background: #26A2FF;
-      padding:0;
-      border-radius: 0.1rem;
-      display: inline-block;
-      vertical-align: middle;
-    }
-    .getDonload {
-        width: 5rem;
-        margin: 0 auto;
-        font-size:0.24rem;
-        overflow: auto;
-        margin-top:0.45rem;
-        padding-bottom: 0.2rem;
-        color: #303133;
-        /* display: flex;
-        flex-direction: row;
-        justify-content: center; */
-    }
-    .getDonload .download_qrcode{
-      width:0.48rem;
-      color:#26A2FF;
-      margin-bottom:0.12rem;
-    }
-    .getDonload .share_qrcode{
-      width:0.48rem;
-      color:#26A2FF;
-      margin-bottom:0.12rem;
-    }
-    /* /deep/ .van-icon{
-      font-size: 0.22rem !important;
-    } */
-    /deep/ .qrcode_box{
-      margin:0.2rem 0;
-    }
-    /deep/ .qrcode_box canvas{
-      margin:0.2rem 0 0;
-      padding:0.15rem;
-      background:none;
-      border:0.06rem solid #f7f7f7;
-      border-radius:0.2rem;
-      box-shadow:0 0.02rem 0.2rem rgba(191,191,191,0.2);
-      /*transform: scale(0.9);*/
-    }
-
-  .qrcode_box img{
-    margin: 0.2rem 0 0;
-    padding: 0.15rem;
-    background: none;
-    border: 0.06rem solid #f7f7f7;
-    border-radius: 0.2rem;
-    -webkit-box-shadow: 0 0.02rem 0.2rem rgba(191,191,191,0.2);
-    box-shadow: 0 0.02rem 0.2rem rgba(191,191,191,0.2);
-  /* transform: scale(0.9); */}
-</style>

+ 3 - 1
src/components/common/integralApplyItem.vue

@@ -14,7 +14,9 @@
 
       <van-cell center title="指定规则">
         <template #right-icon>
-          <van-switch v-model="show_rule" size="24" />
+          <div>
+            <van-switch v-model="show_rule" inactive-color="#9a9a9a" size="24" />
+          </div>
         </template>
       </van-cell>
 

+ 9 - 2
src/components/common/user_image.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <van-image v-if="info.img_url" :src="info.img_url" :width="width" :height="height" round type="contain" />
+    <van-image v-if="info.img_url" :src="info.img_url == defaultImg() ? replaceImg() : info.img_url" :width="width" :height="height" round type="contain" />
     <span class="img_round" v-else>
       <div class="user_name_div" :style="{width: width, height: height,lineHeight: height, fontSize: fontSize + 'rem'}"><Wxopendata type="userName" :openid="user_name"></Wxopendata></div>
       <div class="user_img_bg" :style="{width: width, height: height}" ></div>
@@ -96,7 +96,14 @@
           }
 
         }
-      }
+      },
+      defaultImg(){
+        return "https://rescdn.qqmail.com/node/wwmng/wwmng/style/images/independent/DefaultAvatar$73ba92b5.png"
+      },
+      replaceImg(){
+        // return 'static/images/gttx'+ Math.round(Math.random()*5) +'.jpg'
+        return 'static/images/default5.png'
+      },
     },
     // 组件挂载完成
     mounted() {

+ 0 - 1
src/components/create_company.vue

@@ -42,7 +42,6 @@
 import Vue from 'vue'
 import {setToken} from '@/utils/auth'
 import request from '@/utils/request'
-import request_user from '@/utils/request-user'
 import {Picker} from 'vant'
 
 Vue.use(Picker)

+ 0 - 199
src/components/data_mange/bulletin_welfare.vue

@@ -1,199 +0,0 @@
-<template>
-  <div class="bw-container">
-    <van-nav-bar title="公告与福利" left-text="返回" @click-left="$route_back" left-arrow>
-      <template slot="right" v-if="this.getRole_noe">
-        <span @click="publishHandle"><icon name="plus" width="0.36rem" height="0.36rem"/></span>
-      </template>
-    </van-nav-bar>
-    <div class="bw-list__content">
-      <scroller ref="scroller" :on-refresh="onRefresh">
-        <div class="message-box">
-          <div class="message-item" v-show="data.length > 0" v-for="(item, i) in data" @click="viewDetail(item)" :key="item.id">
-            <van-cell class="message-item-source">
-              <icon :name="(item.tag[0] == '福利') ? 'welfare1' : 'messageNotice' " width="0.72rem" height="0.72rem"/>
-              {{item.tag[0]}}
-              <template slot="right-icon">
-                <span class="datetime">{{item.create_time}}</span>
-              </template>
-            </van-cell>
-            <van-cell class="message-item-title" :border="false">{{ item.name }}</van-cell>
-            <van-cell class="message-item-content">
-              {{ item.desc }}
-            </van-cell>
-            <van-cell is-link>
-              <span>查看详情</span>
-            </van-cell>
-          </div>
-        </div>
-        <van-empty description="暂无内容" v-show="data != null && data.length == 0" />
-      </scroller>
-    </div>
-  </div>
-</template>
-
-<script>
-  import Vue from 'vue'
-  import {Image} from 'vant'
-  import request from '@/utils/request'
-  import {getRole_noe} from '@/utils/auth'
-  import moment from 'moment'
-  Vue.use(Image)
-
-  export default {
-    name: 'bulletin_welfare',
-    data () {
-      return {
-		getRole_noe: '',// 权限判断
-        data: null,
-        show: false
-      }
-    },
-	created() {
-		this.getRole_noe = getRole_noe()
-	},
-    filters:{
-      msg_time(time){
-        let now = moment().valueOf() / 1000
-        let sub = now - time
-        let ret = ''
-        if(sub < 3*24*3600){
-          ret = moment(time*1000).format('YYYY-MM-DD')
-        }else if(sub < 24*3600){
-          ret = moment(time*1000).format('HH:MM')
-        }else if(sub < 3600){
-          ret = '1小时前'
-        }else if(sub < 1800){
-          ret = '刚刚'
-        }
-        return ret
-      }
-    },
-    methods: {
-      dateFormat (timestamp) {
-        const date = new Date(parseInt(timestamp))
-        return `${date.getMonth() + 1}.${date.getDate()}`
-      },
-      publishHandle () {
-        this.$router.push({
-          name: 'publish_bulletin_welfare',
-          params: {refreshCallback: this.refreshData}
-        })
-      },
-      viewDetail (item) {
-        this.$router.push({
-          name: 'bulletin_welfare_detail',
-          query: {id: item.id}
-        })
-      },
-      onRefresh (done) {
-        this.getData(done)
-      },
-      getData (callback=function(){}) {
-        request('get','/api/information/list').then(res => {
-		  	callback()
-          if (res.data.code === 1) {
-            this.data = res.data.data.list
-            if(this.data.length != 0){
-              this.show = true
-            }
-          }
-        })
-      },
-      refreshData () {
-        this.$toast.loading({message: '正在加载'})
-        this.getData(() => this.$toast.clear())
-      }
-    },
-    keep_alive_update: {
-      update_notice_list: function (vm, data) {
-        vm.getData(function(){})
-      }
-    }
-  }
-</script>
-
-<style scoped lang="less">
-  .bw-container {
-    position: relative;
-    font-size: 0.32rem;
-    color: #323233;
-
-    & /deep/ .van-nav-bar {
-      background-color: #26a2ff;
-    }
-
-    & .bw-list__content {
-      position: relative;
-      height: calc(100% - 0.92rem);
-    }
-
-    & .bw-list__item {
-      position: relative;
-      margin: .24rem 0.32rem;
-      padding: .32rem .24rem;
-      border-radius: .04rem;
-      background-color: #fff;
-      overflow: hidden;
-
-      & .bw-item__title {
-        font-weight: 600;
-        display: -webkit-box;
-        text-overflow: ellipsis;
-        overflow : hidden;
-        -webkit-line-clamp: 2;
-        -webkit-box-orient: vertical;
-      }
-
-      & .bw-item__icon {
-        position: absolute;
-        top: 0;
-        right: 0;
-        display: inline-block;
-        width: 0.72rem;
-        height: 0.72rem;
-      }
-
-      & .bw-item__desc {
-        position: relative;
-        margin: 0.24rem 0;
-        display: -webkit-box;
-        text-overflow: ellipsis;
-        overflow: hidden;
-        -webkit-line-clamp: 2;
-        -webkit-box-orient: vertical;
-      }
-
-      & .bw-item__footer {
-        display: flex;
-        font-size: .24rem;
-        font-weight: 400;
-        color: #909399;
-        align-items: center;
-
-        & .bw-publisher__name {
-          position: relative;
-          margin: 0 0.24rem;
-        }
-      }
-    }
-
-    & .icon-clock {
-      position: relative;
-      margin-right: 0.08rem;
-      border-radius: 50%;
-    }
-  }
-  .message-box{padding:0.32rem;}
-  /deep/ .message-item-content{color:#909399; font-size:0.28rem; padding-top:0.1rem;}
-  /deep/ .message-item-content .van-cell__value--alone{color:#909399; }
-  /deep/ .message-item-title .van-cell__value{
-    font-weight: bold;}
-  .message-item-title{padding-bottom:0rem;}
-  .message-item{ margin-bottom:0.32rem;}
-  /deep/ .message-item .van-icon.van-icon-volume-o{line-height: 0.5rem; text-align: center; border-radius: 0.5rem; background-color: #26A2FF; color:#fff; width:0.5rem; height:0.5rem; margin-right:0.16rem;}
-  .message-item-source{background-color: #FAFAFA;}
-  .message-item-source:after{border:none;}
-  .message-item /deep/ .datetime{color:#909399; font-size:0.28rem;}
-  /deep/ .datetime{color:#909399;}
-  /deep/ .message-box .svg-icon{width:0.4rem; height:0.4rem; vertical-align: top !important; margin-top:0.02rem;}
-</style>

+ 0 - 196
src/components/data_mange/bulletin_welfare_detail.vue

@@ -1,196 +0,0 @@
-<template>
-  <div class="bw-detail__container">
-    <van-nav-bar title="公告与福利" left-text="返回" @click-left="$route_back" left-arrow>
-      <template slot="right" v-if="this.getRole_noe">
-        <span class="right-button" @click="showActionSheet = true">编辑</span>
-      </template>
-    </van-nav-bar>
-    <div class="bw-detail__content">
-      <scroller>
-        <div class="bw-item__title"><span>{{ item.name }}</span></div>
-        <div class="bw-item__publisher">
-          <span><Wxopendata type="userName" :openid="item.employee_name"></Wxopendata></span>
-          <span>{{item.create_time}}</span>
-        </div>
-        <div class="bw-item__content">{{ item.content && item.content.content }}</div>
-        <div class="bw-item__upload-file" v-show="file_list">
-          <van-image @click="open_img(i)" v-for="(src, i) in file_list" radius="0.08rem" :key="i" width="1.6rem" height="1.6rem" :src="src" fit="cover"/>
-        </div>
-      </scroller>
-    </div>
-    <van-action-sheet v-model="showActionSheet" :round="false" :actions="actions" cancel-text="取消"
-                      @cancel="showActionSheet = false" @select="onSelect"/>
-  </div>
-</template>
-
-<script>
-import Vue from 'vue'
-import {ActionSheet, Uploader, Image, ImagePreview} from 'vant'
-import request from '@/utils/request'
-import {getRole_noe} from '@/utils/auth'
-Vue.use(ActionSheet).use(Uploader).use(Image).use(ImagePreview)
-
-export default {
-  name: 'bulletin_welfare_detail',
-  data () {
-    return {
-		  getRole_noe: '', // 权限判断
-      item: {},
-      file_list: [],
-      actions: [
-        {name: '删除', value: 1},
-        {name: '修改', value: 2}
-      ],
-      showActionSheet: false
-    }
-  },
-  methods: {
-    // 打开图片
-    open_img (index) {
-      ImagePreview({
-        images: this.file_list,
-        startPosition: index,
-        closeable: true
-      })
-    },
-    onSelect (item) {
-      this.showActionSheet = false
-      this.$nextTick(() => {
-        item.value === 1 ? this.handleDelete() : this.editItem()
-      })
-    },
-    handleDelete () {
-      this.$dialog.confirm({
-        title: '提示',
-        message: '确定要删除吗?',
-        beforeClose: (action, done) => {
-          action === 'confirm' ? this.deleteItem(done) : done()
-        }
-      })
-    },
-    editItem () {
-      this.$router.replace({
-        name: 'edit_bulletin_welfare',
-        query: {id: this.$route.query.id},
-        params: this.$route.params
-      })
-    },
-    deleteItem (done) {
-      const data = {id: this.$route.query.id}
-      request('post', '/api/information/delete', data).then(res => {
-        if (res.data.code === 1) {
-          this.$keep_alive_update('update_notice_list', true)
-          this.$route_back()
-        } else {
-          this.$toast.fail(res.data.msg)
-        }
-        done()
-      })
-    },
-    dateFormat (timestamp) {
-      if (timestamp) {
-        const date = new Date(parseInt(timestamp))
-        return `${date.getMonth() + 1}.${date.getDate()}`
-      }
-    },
-    getDataById () {
-      this.$toast.loading({message: '正在加载'})
-      const params = {id: this.$route.query.id}
-      request('get', '/api/information/info', params).then(res => {
-        if (res.data.code === 1) {
-          if (res.data.data.create_time == 100) {
-          	this.$dialog.alert({
-              title: '标题',
-              message: '该信息已被删除'
-            }).then(() => {
-              this.$route_back()
-            })
-          }
-          this.item = res.data.data
-          if (res.data.data.file_list) {
-            this.file_list = res.data.data.file_list.split(',')
-          }
-        }
-      }).finally(() => this.$toast.clear())
-    }
-  },
-  created () {
-    this.getRole_noe = getRole_noe()
-  },
-  mounted () {
-    this.getDataById()
-  },
-  keep_alive_update: {
-    update_notice_list: function (vm, data) {
-      vm.getDataById(function () {})
-    }
-  }
-}
-</script>
-
-<style scoped lang="less">
-  .bw-detail__container {
-    position: relative;
-    background: #fff;
-
-    & /deep/ .van-nav-bar {
-      background-color: #26a2ff;
-    }
-
-    & .right-button {
-      color: #fff;
-    }
-
-    & .bw-detail__content {
-      position: relative;
-      height: calc(100% - 0.92rem);
-
-      & .bw-item__title {
-        position: relative;
-        padding: 0.24rem 0.32rem;
-        font-size: .36rem;
-        font-weight: 700;
-        color: #303133;
-      }
-
-      & .bw-item__publisher {
-        position: relative;
-        padding: 0 0.32rem 0.24rem 0.32rem;
-        font-size: .24rem;
-        font-weight: 400;
-        color: #909399;
-
-        &:after {
-          position: absolute;
-          box-sizing: border-box;
-          content: ' ';
-          pointer-events: none;
-          right: 0;
-          bottom: 0;
-          left: 0rem;
-          border-bottom: 1px solid #ebedf0;
-          -webkit-transform: scaleY(0.5);
-          transform: scaleY(0.5);
-        }
-      }
-
-      & .bw-item__content {
-        padding: 0.24rem 0.32rem;
-        text-indent: 0.65rem;
-        font-size: .32rem;
-        font-weight: 400;
-        color: #303133;
-      }
-
-      & .bw-item__upload-file {
-        display: flex;
-        position: relative;
-        padding: 0 0.32rem;
-
-        & /deep/ .van-image {
-          margin: 0 0.16rem 0.16rem 0;
-        }
-      }
-    }
-  }
-</style>

+ 0 - 170
src/components/data_mange/publish_bulletin_welfare.vue

@@ -1,170 +0,0 @@
-<template>
-  <div class="publish-bw__container">
-    <van-nav-bar :title="isEdit ? '编辑': '发布'" left-text="返回" @click-left="back" left-arrow/>
-    <div class="publish-bw__content">
-      <scroller>
-        <van-cell-group>
-
-          <van-cell title="类型" class="cell-right-4rem">
-            <van-radio-group v-model="tagName" direction="horizontal" class="radio_button" slot="right-icon">
-              <van-radio class="list" name="公告">公告</van-radio>
-              <van-radio class="list" name="福利">福利</van-radio>
-            </van-radio-group>
-          </van-cell>
-        </van-cell-group>
-        <van-cell-group>
-
-          <van-cell class="title-box-cell" title="标题" required>
-            <template slot="label">
-              <Mtextarea v-model="title" :text_max="20" :images="false" placeholder="请输入标题"/>
-            </template>
-          </van-cell>
-
-        </van-cell-group>
-        <van-cell-group class="publish-bw">
-          <van-cell title="内容" required>
-            <template slot="label">
-              <Mtextarea v-model="content" :text_max="200" :imgs_max="3" images :imgs.sync="uploadFiles"
-                         placeholder="请输入内容"/>
-            </template>
-          </van-cell>
-
-        </van-cell-group>
-        <div class="form-toolbar">
-          <van-button :loading="loading" block type="info" @click="onSubmit">提交</van-button>
-        </div>
-        <van-action-sheet v-model="showActionSheet" :round="false" :actions="actions" cancel-text="取消"
-                          @cancel="showActionSheet = false" close-on-click-action @select="onSelect"/>
-      </scroller>
-    </div>
-  </div>
-</template>
-
-<script>
-import Vue from 'vue'
-import request from '@/utils/request'
-import {ActionSheet, CellGroup, Field, Form} from 'vant'
-import Mtextarea from '@/components/common/Mtextarea.vue'
-
-Vue.use(ActionSheet).use(CellGroup).use(Field).use(Form)
-
-export default {
-  name: 'publish_bulletin_welfare',
-  data () {
-    return {
-      tagName: null,
-      type: null,
-      title: '',
-      content: '',
-      uploadFiles: [],
-      isEdit: false,
-      loading: false,
-      actions: [
-        {name: '公告', value: '公告'},
-        {name: '福利', value: '福利'}
-      ],
-      showActionSheet: false
-    }
-  },
-  components: {Mtextarea},
-  methods: {
-    back () {
-      !this.loading && this.$route_back()
-    },
-    onSelect (item) {
-      this.type = item.value
-      this.tagName = item.name
-    },
-    validator () {
-      if (this.type === null) {
-        this.$notify({type: 'danger', message: '类型为必选项'})
-        return false
-      } else if (!this.title) {
-        this.$notify({type: 'danger', message: '标题为必填项'})
-        return false
-      } else if (!this.content) {
-        this.$notify({type: 'danger', message: '内容为必填项'})
-        return false
-      } else {
-        return true
-      }
-    },
-    onSubmit () {
-      if (this.validator()) {
-        this.loading = true
-        const data = this.getFormData()
-        const url = this.isEdit ? '/api/information/update' : '/api/information/create'
-        request('post',url,data).then(res => {
-          if (res.data.code === 1) {
-            this.$toast.success(`${this.isEdit ? '编辑' : '发布'}成功`)
-            this.$keep_alive_update('update_notice_list', true)
-            this.$route_back()
-          } else {
-            this.$toast.fail(`${this.isEdit ? '编辑' : '发布'}失败,请稍后再试.`)
-          }
-        }).finally(() => this.loading = false)
-      }
-    },
-    getFormData () {
-      const data = {name: this.title, content: this.content, tag: [this.tagName], file_list: this.uploadFiles}
-      if (this.isEdit) {
-        data.id = this.$route.query.id
-      }
-      return data
-    },
-    getDataById () {
-      this.$toast.loading({message: '正在加载'})
-      const params = {id: this.$route.query.id}
-      request('get','/api/information/info',params).then(res => {
-        if (res.data.code === 1) {
-          const item = res.data.data
-          this.title = item.name
-          this.type = item.tag[0]
-          this.tagName = item.tag[0]
-          this.content = item.content ? item.content.content : ''
-          this.uploadFiles = item.file_list ? item.file_list.split(',') : []
-        }
-      }).finally(() => this.$toast.clear())
-    }
-  },
-  mounted () {
-    this.isEdit = !!this.$route.query.id
-    this.isEdit && this.getDataById()
-    if (!this.isEdit) {
-      this.type = '公告'
-      this.tagName = '公告'
-    }
-  }
-}
-</script>
-
-<style scoped lang="less">
-  .publish-bw__container {
-    & /deep/ .van-nav-bar {
-      background-color: #26a2ff;
-    }
-
-    & .form-toolbar {
-      padding: 0.32rem;
-    }
-
-    .publish-bw__content {
-      position: relative;
-      height: calc(100% - 0.92rem);
-    }
-
-    & .publish-bw {
-      & /deep/ .text-max-tip {
-        margin-right: 0.32rem;
-        margin-bottom: 0.2rem;
-      }
-
-      & /deep/ .images_btn {
-        position: relative;
-        top: -0.1rem;
-        margin-right: 0.32rem;
-      }
-    }
-  }
-  /deep/ .title-box-cell .diy_text_box{min-height: 0.5rem !important;}
-</style>

+ 0 - 142
src/components/demo/form.vue

@@ -1,142 +0,0 @@
-<template>
-  <div>
-    <van-nav-bar title="页面标题" left-text="返回" @click-left="$route_back" left-arrow></van-nav-bar>
-    <div class="body_com has_header">
-      <scroller>
-        <EventSelector></EventSelector>
-        <YearMonthPicker v-model="data.date_text"></YearMonthPicker>
-        <van-cell-group>
-          <van-cell><Mtextarea v-model="data.text" placeholder="输入长文本" :text_max="200" :imgs_max="1" images speech :imgs.sync="data.imgs"></Mtextarea></van-cell>
-        </van-cell-group>
-        <van-cell-group><EmployeeSelectorCell :show_manager_only="true" title="选择员工" v-model="data.employee_list" :max="6"></EmployeeSelectorCell></van-cell-group>
-        <van-cell-group><RuleCategorySelectorCell title="选择分类和规则" v-model="data.rule_list" :max="2"></RuleCategorySelectorCell></van-cell-group>
-        <van-cell-group><CategorySelectorCell title="选择分类" v-model="data.rule_cate" :max="2"></CategorySelectorCell></van-cell-group>
-        <van-cell-group><DateCell title="选择日期" v-model="data.date"></DateCell></van-cell-group>
-        <van-cell-group>
-          <van-field v-model="data.name" name="用户名" placeholder="请输入用户名" v-validate="'required'" required />
-          <van-field name="密码" v-model="data.pwd" v-validate="'required|min:6'" placeholder="请输入密码" />
-        </van-cell-group>
-        <van-cell-group><NumberInput v-model="data.num" title="积分" :max="500" :min="-200"></NumberInput></van-cell-group>
-
-        <team_item v-model="data.teams"></team_item>
-
-        <div style="padding:0.32rem;"><van-button size="large" @click="data_verify" type="info">提交</van-button></div>
-      </scroller>
-    </div>
-  </div>
-</template>
-<script>
-import request from '@/utils/request'
-import Mtextarea from '@/components/common/Mtextarea'
-import EmployeeSelectorCell from '@/components/common/EmployeeSelectorCell'
-import RuleCategorySelectorCell from '@/components/common/RuleCategorySelectorCell1'
-import CategorySelectorCell from '@/components/common/CategorySelectorCell'
-import DateCell from '@/components/common/DateCell'
-import YearMonthPicker from '@/components/common/YearMonthPicker'
-import EventSelector from '@/components/common/EventSelector'
-import NumberInput from '@/components/common/NumberInput'
-import team_item from '@/components/pk/team_item'
-import moment from 'moment'
-export default {
-  name: 'form_demo',
-  components: {
-    DateCell,
-    EventSelector,
-    Mtextarea,
-    EmployeeSelectorCell,
-    RuleCategorySelectorCell,
-    CategorySelectorCell,
-    YearMonthPicker,
-    NumberInput,
-    team_item
-  },
-  data () {
-    return {
-      data: {
-        date_text: '',
-        name: '',
-        pwd: '',
-        num: 0,
-        text: '',
-        imgs: [],
-        teams: [
-          {
-            name: '测试队',
-            member: [],
-            leader: 0
-          }
-        ],
-        employee_list: [],
-        rule_list: [],
-        rule_cate: [],
-        date: ''
-      },
-      show_dept_selector: false,
-      send_loading: false
-    }
-  },
-  methods: {
-    confirm (data) {
-    },
-    show_rule_selector () {
-      this.show_dept_selector = true
-    },
-    data_verify () {
-      let self = this
-      self.$validator.validateAll().then(result => {
-        if (!result) {
-          self.$notify({ type: 'danger', message: self.$validator.errors.items[0].msg })
-        } else {
-			return
-          self.send()
-        }
-      })
-    },
-    send () {
-      let self = this
-      self.send_loading = true
-      self.$toast.loading({
-        message: '正在处理'
-      })
-      request({
-        url: '',
-        method: 'post',
-        data: self.data
-      })
-        .then(res => {
-          self.send_loading = false
-          self.$toast.clear()
-        })
-        .catch(e => {
-          self.send_loading = false
-          self.$toast.clear()
-        })
-    },
-
-    // 缓存test
-    localStorageSetFun () {
-      let data = { date: moment().format(), text: 'test' }
-      let name = 'test'
-      let expire = moment()
-        .add(Math.floor(Math.random() * (120 - 60 + 1)) + 60, 'second')
-        .format('YYYY-MM-DD HH:mm:ss')
-      let obj = { data, expire }
-      localStorage.setItem(name, JSON.stringify(obj))
-    }
-  },
-  created () {
-    this.data.date_text = '2022-10'
-    this.localStorageSetFun()
-    this.$nextTick(() => {
-      let user_info = JSON.parse(localStorage.getItem('test'))
-      let nowDate = moment().format('YYYY-MM-DD HH:mm:ss')
-    })
-  }
-}
-</script>
-<style scoped>
-.body_com {
-  height: calc(100% - 0.92rem);
-  position: relative;
-}
-</style>

+ 0 - 148
src/components/demo/message_detail.vue

@@ -1,148 +0,0 @@
-<template>
-
-<div class="message_detail_box">
-
-  <van-nav-bar class="headerbar no-down-icon" left-text="返回" @click-left="$route_back" left-arrow :title="'A分通知'"></van-nav-bar>
-  <div class="work_body_com">
-     <scroller :on-refresh="chat_msg_session_list">
-       <div class="message_list_box">
-
-         <van-cell-group class="list_box">
-            <van-cell class="list_head" :title="'积分奖扣'" title-class="head_title" :value="'昨天'" value-class="head_time">
-              <template slot="icon">
-                <icon name="notice" class="notice_icon"></icon>
-              </template>
-            </van-cell>
-            <van-cell class="list_content" :title="'谁的积分奖扣需要您审批'" title-class="content_title" :value="'+50'" value-class="content_time">
-              <template slot="label">
-                <span class="des">标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标最多2行…</span>
-              </template>
-            </van-cell>
-            <van-cell class="list_status" :title="'待审批'" title-class="status_ready" is-link></van-cell>
-         </van-cell-group>
-
-         <van-cell-group class="list_box">
-            <van-cell class="list_head" :title="'积分奖扣'" title-class="head_title" :value="'昨天'" value-class="head_time">
-              <template slot="icon">
-                <icon name="notice" class="notice_icon"></icon>
-              </template>
-            </van-cell>
-            <van-cell class="list_content" :title="'谁的积分奖扣需要您审批'" title-class="content_title" :value="'+50'" value-class="content_time">
-              <template slot="label">
-                <span class="des">标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标最多2行…</span>
-              </template>
-            </van-cell>
-            <van-cell class="list_status" :title="'通过'" title-class="status_pass" is-link></van-cell>
-         </van-cell-group>
-
-         <van-cell-group class="list_box">
-            <van-cell class="list_head" :title="'积分奖扣'" title-class="head_title" :value="'昨天'" value-class="head_time">
-              <template slot="icon">
-                <icon name="notice" class="notice_icon"></icon>
-              </template>
-            </van-cell>
-            <van-cell class="list_content" :title="'谁的积分奖扣需要您审批'" title-class="content_title" :value="'+50'" value-class="content_time">
-              <template slot="label">
-                <span class="des">标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标最多2行…</span>
-              </template>
-            </van-cell>
-            <van-cell class="list_status" :title="'驳回'" title-class="status_turndown" is-link></van-cell>
-         </van-cell-group>
-
-       </div>
-     </scroller>
-  </div>
-</div>
-</template>
-<script>
-import Vue from 'vue'
-export default {
-    name: 'message_detail',
-    data () {
-      return {
-      }
-    },
-}
-</script>
-
-<style scoped lang="less">
-.message_detail_box{
-  background:#F5F7FA;
-  .work_body_com {
-      height: calc(100% - 0.92rem);
-      position: relative;
-  }
-  .message_list_box{
-    width:calc(100vw - 0.64rem);
-    margin:0 0.32rem;
-  }
-  .message_list_box .list_box{
-    background:#fff;
-  }
-  .message_list_box .list_box .list_head{
-    background:#efefefb8;
-    border-radius: 0.08rem 0.08rem 0 0;
-  }
-  .message_list_box .list_box .list_head .notice_icon{
-    width:0.2rem;
-    height:0.2rem;
-    margin-right:0.2rem;
-    padding:0.1rem;
-    background:#238dfa;
-    border-radius: 0.4rem;
-  }
-  .message_list_box .list_box .list_head .notice_icon /deep/ path{
-    color:#FFF;
-  }
-  .message_list_box .list_box .list_head .head_title{
-    font-size:0.32rem;
-    font-weight:bold;
-  }
-  .message_list_box .list_box .list_head .head_time{
-    font-size:0.28rem;
-  }
-  .message_list_box .list_box .list_content .content_title span{
-    font-size:0.38rem;
-    font-weight:bold;
-    flex:none;
-  }
-  .message_list_box .list_box .list_content .content_time{
-    font-size:0.38rem;
-    font-weight:bold;
-    color:#FF2D55;
-    flex:none;
-  }
-  .message_list_box .list_box .list_content .des{
-    height: 0.5rem;
-    font-size: 0.32rem !important;
-    font-weight: normal !important;
-    color: #909399;
-    padding: 0.16rem 0 0.2rem;
-    display: -webkit-box;
-    -webkit-box-orient: vertical;
-    -webkit-line-clamp: 2;
-    overflow: hidden;
-  }
-  .message_list_box .list_box .list_status{
-    border-radius: 0 0 0.08rem 0.08rem;
-  }
-   .message_list_box .list_box .list_status .status_ready span{
-    color:#FF9600;
-    padding: 0 0.1rem;
-    background:#ff96001a;
-    border-radius: 0.08rem;
-   }
-   .message_list_box .list_box .list_status .status_pass span{
-    color:#4BD964;
-    padding: 0 0.1rem;
-    background:#4bd96424;
-    border-radius: 0.08rem;
-   }
-   .message_list_box .list_box .list_status .status_turndown span{
-    color:#F56C6C;
-    padding: 0 0.1rem;
-    background:#f56c6c1c;
-    border-radius: 0.08rem;
-   }
-}
-</style>

+ 0 - 294
src/components/ems/company_list.vue

@@ -1,294 +0,0 @@
-<template>
-  <div class="company-container">
-    <van-nav-bar title="企业" left-text="返回" @click-left="$route_back" left-arrow>
-      <template slot="right">
-        <a class="van-nav-bar__text" href="javascript:void(0);" @click="manageHandle">
-          {{ isEditing ? '完成': '管理' }}
-        </a>
-      </template>
-    </van-nav-bar>
-    <div class="company-list__wrap">
-      <scroller ref="scroller" :on-refresh="getCompanyData">
-        <div class="company-content" v-show="!isEditing">
-          <div class="company-header__title"><span>切换企业</span></div>
-          <div class="company-list__item" v-for="(item, i) in data" :key="i" @click.stop="onChangeCompany(item)" v-if="data.length>0">
-            <icon name="default_company_logo" width="0.9rem" height="0.9rem"/>
-            <div class="company-name" v-if="item.site">{{ item.site.name }}</div>
-            <div class="selected-item__wrap" v-if="currentCompanyId === item.site.id">
-              <van-icon name="success" color="#26A2FF"/>
-            </div>
-          </div>
-          <van-cell-group>
-            <van-cell @click.stop="createCompany">
-              <template #icon>
-                <icon class="cell-item__icon" name="create_company"/>
-                <span class="cell-item__title">创建企业</span>
-              </template>
-            </van-cell>
-          </van-cell-group>
-        </div>
-        <div class="company-content" v-if="isEditing">
-          <van-cell-group v-for="(item, i) in data" :key="i" v-if="data.length>0">
-            <div class="company-manage__item">
-              <icon name="default_company_logo" width="0.9rem" height="0.9rem"/>
-              <div class="company-name" v-if="item.site">{{ item.site.name }}</div>
-            </div>
-            <div class="company-tool_bar">
-              <div class="disband-button" v-if="userinfo.account_id == item.site.account_id"
-                   @click.stop="disbandCompany(item, i)">
-                <span>解散企业</span>
-              </div>
-              <div class="disband-button" v-if="userinfo.account_id != item.site.account_id"
-                   @click.stop="exitCompany(item, i)">
-                <span>退出企业</span>
-              </div>
-            </div>
-          </van-cell-group>
-        </div>
-      </scroller>
-    </div>
-  </div>
-</template>
-<script>
-import Vue from 'vue'
-import request_user from '@/utils/request-user'
-import {Cell, CellGroup, Image} from 'vant'
-import {getToken, removeToken, setToken} from '@/utils/auth'
-import store from '@/store'
-
-Vue.use(Cell).use(CellGroup).use(Image)
-
-export default {
-  name: 'company_list',
-  data () {
-    return {
-      data: null,
-      isEditing: false,
-      userinfo: this.$store.getters.user_info
-    }
-  },
-  computed: {
-    currentCompanyId () {
-      return this.$store.getters.user_info && this.$store.getters.user_info.site_id
-    }
-  },
-  methods: {
-    manageHandle () {
-      this.isEditing = !this.isEditing
-    },
-    createCompany () {
-      this.$router.push({name: 'create_company', params: {onsuccess: this.getCompanyData.bind(this)}})
-    },
-    exitCompany (item, index) {
-      this.$dialog.confirm({
-        title: '退出企业',
-        message: '退出企业后,您的积分数据将不可恢复,确认要退出吗?',
-        confirmButtonText: '退出',
-        beforeClose: (action, done) => {
-          if (action === 'confirm') {
-            request_user('post', '/api/account/quit/site', {id: item.site.id}).then(res => {
-              if (res.data.code === 1) {
-                this.onSuccessRemoveCompany(item, index)
-              }
-            }).finally(done)
-          } else {
-            done()
-          }
-        }
-      })
-    },
-    disbandCompany (item, index) {
-      this.$dialog.confirm({
-        title: '解散企业',
-        message: '该企业相关的内容和数据永久删除',
-        confirmButtonText: '解散',
-        beforeClose: (action, done) => {
-          if (action === 'confirm') {
-            request_user('post', '/api/account/dis/site', {id: item.site.id}).then((res) => {
-              if (res.data.code === 1) {
-                this.onSuccessRemoveCompany(item, index)
-              }
-            }).finally(done)
-          } else {
-            done()
-          }
-        }
-      })
-    },
-	// 接散企业
-    onSuccessRemoveCompany (item, index) {
-      this.data.splice(index, 1)
-      if (this.currentCompanyId === item.site.id) {
-        if (window.plus) {
-          plus.storage.removeItem('SET_EMPLOYEE_MAP')
-          plus.storage.removeItem('message_cate_list')
-          plus.storage.removeItem('SET_POINT_TYPES')
-          plus.storage.removeItem('Admin-Token')
-        } else {
-          localStorage.removeItem('SET_EMPLOYEE_MAP')
-          localStorage.removeItem('message_cate_list')
-          localStorage.removeItem('SET_POINT_TYPES')
-          localStorage.removeItem('Admin-Token')
-        }
-        this.data.length > 0 && this.$router.replace({name: 'login_company_list'})
-      }
-      if (this.data.length === 0) {
-        this.$store.dispatch('setBuyPopup', false);
-        this.$store.dispatch('clear_cache')
-        this.$router.replace({name: 'login'})
-        // this.$router.replace({name: 'registration_experience'})
-      }
-    },
-    onChangeCompany (item) {
-      if (this.currentCompanyId === item.site.id) {
-        return
-      }
-      this.$dialog.confirm({title: '注意', message: '确定要切换企业吗?'}).then(() => {
-        this.$toast.loading({mask: false, message: '正在登录'})
-        request_user('post', '/api/employee-login', {site_id: item.site.id}).then(res => {
-          if (res.data.code === 1) {
-            setToken(res.data.data.token)// 保存token
-            if (window.plus) {
-              plus.storage.removeItem('message_list_' + this.$store.getters.user_info.id)
-            } else {
-              localStorage.removeItem('message_list_' + this.$store.getters.user_info.id)
-            }
-            this.$store.dispatch('clear_cache')
-            this.$keep_alive_update('update_message_list', {}) // 列新消息列表的数据
-            window.sessionStorage.setItem('__VCKEEPALIVE__', JSON.stringify(['/']))
-            window.sessionStorage.setItem('routers', '/')
-            window.location.href = window.location.href.split('#')[0]
-          } else {
-            this.$toast(res.data.msg)
-          }
-        }).finally(() => this.$toast.clear())
-      })
-    },
-    getCompanyData (done) {
-      this.$toast.loading({mask: true, message: '正在加载'})
-      request_user('get', '/api/account/site').then(res => {
-        if (res.data.code === 1) {
-          this.data = res.data.data
-        }
-      }).finally(() => {
-        this.$toast.clear()
-        done && done()
-      })
-    }
-  },
-  mounted () {
-    // this.getCompanyData()
-  },
-  activated () {
-    this.isEditing = false
-  }
-}
-</script>
-<style scoped lang="less">
-  .company-container {
-    & /deep/ .van-nav-bar {
-      background-color: #26a2ff;
-    }
-
-    & .company-list__wrap {
-      position: relative;
-      height: calc(100% - 0.92rem);
-    }
-
-    & .company-content {
-      position: relative;
-      margin-top: 0.24rem;
-
-      & .company-header__title {
-        position: relative;
-        padding-left: 0.32rem;
-        padding-bottom: 0.08rem;
-        font-size: 0.28rem;
-        color: #909399;
-      }
-
-      & .company-list__item {
-        position: relative;
-        display: flex;
-        padding: 0.24rem 0.32rem;
-        align-items: center;
-        background: #fff;
-        flex-direction: row;
-        touch-action: none;
-
-        &:not(:last-child)::after {
-          position: absolute;
-          box-sizing: border-box;
-          content: ' ';
-          pointer-events: none;
-          right: 0;
-          bottom: 0;
-          left: 1.52rem;
-          border-bottom: 1px solid #ebedf0;
-          -webkit-transform: scaleY(0.5);
-          transform: scaleY(0.5);
-        }
-
-        & .selected-item__wrap {
-          position: relative;
-          display: flex;
-          padding-right: 0.1rem;
-          width: 1.1rem;
-          align-items: center;
-          justify-content: flex-end;
-        }
-      }
-    }
-
-    & .company-name {
-      width: calc(100% - 2.62rem);
-      padding-left: 0.24rem;
-      font-size: 0.32rem;
-      color: #303133;
-      font-weight: 500;
-      white-space: nowrap;
-      overflow: hidden;
-      text-overflow: ellipsis;
-    }
-
-    & .company-manage__item {
-      position: relative;
-      display: flex;
-      padding: 0.24rem 0.32rem;
-      align-items: center;
-      background: #fff;
-      flex-direction: row;
-    }
-
-    .company-tool_bar {
-      display: flex;
-      padding-right: 0.32rem;
-      padding-bottom: 0.32rem;
-      justify-content: flex-end;
-    }
-
-    & .disband-button {
-      display: flex;
-      width: 1.6rem;
-      height: 0.56rem;
-      font-size: 0.28rem;
-      color: #fff;
-      background: #26A2FF;
-      border-radius: 0.06rem;
-      align-items: center;
-      justify-content: center;
-      align-self: flex-end;
-    }
-
-    & .cell-item__icon {
-      width: 0.56rem;
-      height: 0.56rem;
-    }
-
-    & .cell-item__title {
-      display: inline-block;
-      padding-left: 0.12rem;
-      vertical-align: middle;
-    }
-  }
-</style>

+ 0 - 176
src/components/ems/invite_newbusiness.vue

@@ -1,176 +0,0 @@
-<template>
-  <div class="login-box-parent">
-
-    <van-nav-bar title="" right-text="关闭" @click-right="close"></van-nav-bar>
-
-    <div class="login-box">
-
-      <div class="login-box-border">
-        <!--<scroller>-->
-
-        <div class="text_box" v-if="data.site">
-          <span class="title" v-if="false">HI ,</span>
-          <span>{{data.site.name}}</span>
-          <span>邀请你加入</span>
-        </div>
-
-        <div class="img_box">
-          <img src="static/images/join_company.png">
-        </div>
-
-        <!--</scroller>-->
-
-        <div class="footer_button">
-          <van-button class="agree" round type="info" @click="send(1)">同意加入</van-button>
-          <van-button class="refuse" round type="info" @click="send(2)">拒绝加入</van-button>
-        </div>
-
-      </div>
-
-    </div>
-
-  </div>
-</template>
-
-<script>
-  import Vue from 'vue';
-  import {setToken} from '@/utils/auth'
-  import {Button} from 'vant';
-  import request_user from '@/utils/request-user'
-  Vue.use(Button);
-  export default {
-    props: {
-      data: {
-        type: Object,
-        default: () => {
-          return {}
-        }
-      }
-    },
-    name: "invite_newbusiness",
-    data() {
-      return {}
-    },
-    methods: {
-      close(){
-        this.$emit('close')
-      },
-      send(type){
-        let self = this
-        if (type == 2) {
-          self.close()
-        }else{
-          self.$toast.loading({
-            mask: true,
-            forbidClick: true,
-            message: '正在登录...'
-          })
-          request_user('post','/api/invite/bind',{sn: self.data.sn, type: type}).then(res => {
-            if(res.data.code == 1){
-              self.login(self.data.site.id)
-            }else{
-              self.$toast(res.data.msg)
-            }
-          })
-        }
-      },
-      login(site_id){
-        let self = this
-        request_user('post','/api/employee-login',{site_id: site_id}).then(res => {
-          if(res.data.code == 1){
-            setToken(res.data.data.token)
-            self.$router.push({name: 'home'})
-            //得到员工的token,把token存好,然后就登录了
-          }else{
-            self.$toast(res.data.msg)
-          }
-        })
-      }
-    }
-
-  }
-</script>
-
-<style scoped>
-  .van-nav-bar {
-    background: none !important;
-  }
-
-  .login-box {
-    height: calc(100% - 2rem);
-    position: relative;
-  }
-
-  .login-box-border {
-    position: fixed;
-    display: block;
-    text-align: center;
-    top: 0;
-    left: 0;
-    right: 0;
-    bottom: 0;
-    background: linear-gradient(120deg, #1ea0f3, #3b73eb);
-  }
-
-  .login-box-border .text_box {
-    position: relative;
-    text-align: left;
-    margin-top: 1.5rem;
-    margin-left: 0.55rem;
-  }
-
-  .login-box-border .text_box .title {
-    display: block;
-    color: #FFF;
-    font-size: 0.4rem;
-    padding-bottom: 0.05rem;
-    line-height: 0.56rem;
-    letter-spacing: 0.005rem;
-  }
-
-  .login-box-border .text_box span {
-    display: block;
-    color: #FFF;
-    font-size: 0.48rem;
-    line-height: 0.64rem;
-    letter-spacing: 0.01rem;
-    text-shadow: 0.02rem 0.02rem 0.1rem #1578b7;
-  }
-
-  .login-box-border .img_box {
-    width: 6rem;
-    margin: 1rem auto 0.15rem;
-  }
-
-  .login-box-border .img_box img {
-    width: 100%;
-  }
-
-  .login-box-border .footer_button {
-    position: fixed;
-    bottom: 0.15rem;
-  }
-
-  .login-box-border .agree {
-    margin: 0.1rem auto;
-    font-size: 0.28rem;
-    font-weight: bold;
-    letter-spacing: 0.005rem;
-    color: #446CE4;
-    width: 4.28rem;
-    background: #FFF;
-    border-radius: 0.44rem;
-  }
-
-  .login-box-border .refuse {
-    margin: 0.1rem auto;
-    font-size: 0.28rem;
-    font-weight: bold;
-    letter-spacing: 0.005rem;
-    color: #fff;
-    width: 4.28rem;
-    background: transparent;
-    border: none;
-    border-radius: 0.44rem;
-  }
-</style>

+ 0 - 102
src/components/ems/login_company_list.vue

@@ -1,102 +0,0 @@
-<template>
-  <div>
-    <van-nav-bar title="我的组织" left-text="返回" @click-left="$route_back" left-arrow>
-    </van-nav-bar>
-    <div class="body_com has_header">
-      <scroller>
-        <div v-for="(item,index) in list" :key="index" style="padding-top:0.2rem; padding-left:0.2rem; padding-right:0.2rem;">
-          <van-panel :title="item.site.name" style="box-shadow: 0 2px 4px rgba(140,140,140,0.1);border-radius:0.12rem;" class="company_name">
-            <div style="padding:0.16rem 0.32rem; font-size:0.28rem; color:#666;">
-              <p v-if="item.account_id == item.site.account_id">创建时间:{{item.create_time | datetime}}</p>
-              <p v-else>加入时间:{{item.create_time | datetime}}</p>
-            </div>
-            <div slot="footer" style="text-align: right;">
-              <van-button size="small" @click="login(item.site.id)" :loading="item.pass_loading" type="info">进入企业
-              </van-button>
-            </div>
-          </van-panel>
-        </div>
-      </scroller>
-    </div>
-  </div>
-</template>
-
-<script>
-import {getToken, setToken} from '@/utils/auth'
-import Vue from 'vue'
-import moment from 'moment'
-import {Panel} from 'vant'
-import request_user from '@/utils/request-user'
-
-Vue.use(Panel)
-
-export default {
-  name: 'company_list',
-  data () {
-    return {
-      page: 0,
-      list: [],
-      userinfo: this.$store.getters.user_info
-    }
-  },
-  filters: {
-    datetime (time) {
-      return moment(time * 1000).format('YYYY-MM-DD HH:mm:ss')
-    }
-  },
-  created () {
-    this.get_site_list()
-  },
-  methods: {
-    get_site_list () {
-      this.$toast.loading({
-        mask: false,
-        message: '获取企业信息'
-      })
-      request_user('get','/api/account/site','','token').then(res => {
-        this.$toast.clear()
-        if (res.data.code === 1) {
-          this.list = res.data.data
-          if (this.list.length === 1) {
-            this.login(this.list[0].site.id)
-          }
-        } else {
-          this.$toast('获取企业失败')
-        }
-      })
-    },
-    login (id) {
-      this.$toast.loading({
-        mask: false,
-        message: '正在登录,请稍候'
-      })
-      request_user('post','/api/employee-login',{site_id: id}).then(res => {
-        if (res.data.code === 1) {
-          const item = res.data.data
-          setToken(item.token)
-          this.$store.commit('SET_USERINFO', res.data.data)// 设置员工信息
-          window.sessionStorage.setItem('__VCKEEPALIVE__', JSON.stringify(['/']))
-          window.sessionStorage.setItem('routers', '/')
-          window.location.href = window.location.href.split('#')[0] // 进入到首页
-        } else {
-          this.$toast(res.data.msg)
-        }
-      }).finally(() => {
-		   this.$toast.clear()
-	  })
-    }
-  }
-}
-</script>
-
-<style scoped>
-  .body_com {
-    height: calc(100% - 1rem);
-    position: relative;
-    background-color: #f5f5f5;
-  }
-  .company_name /deep/ .van-cell__title span{
-    color:#1c1c1c;
-    font-weight:bold;
-  }
-</style>

+ 0 - 437
src/components/ems/registration_experience.vue

@@ -1,437 +0,0 @@
-<template>
-  <div class="login-box-parent" style="background-color:#fff;">
-    <van-popup style="width:5rem;border-radius: 0.08rem;" v-model="invite_list_show" :close-on-click-overlay="false">
-      <van-cell-group style="margin-top:0;">
-        <van-cell is-link @click="go_invite(item)" v-for="(item, index) in invite_list" :key="index" :title="item.site.name" label="邀请你加入"/>
-      </van-cell-group>
-      <van-button @click="invite_close" size="large">关闭</van-button>
-    </van-popup>
-
-    <invite_newbusiness v-show="invite_show" @close="invite_close" :data.sync="invite_data"></invite_newbusiness>
-    <van-nav-bar title="选择行业身份" v-show="normal_show" left-text="返回" @click-left="login_out" left-arrow></van-nav-bar>
-
-    <div class="login-box" v-show="normal_show">
-        <div style="height:0.32rem"></div>
-<!--        <div class="site_box">
-          <h4>选择行业</h4>
-          <van-radio-group v-model="role_two" direction="horizontal">
-            <van-radio :name="item.id" v-for="(item, index) in site_list" :key="index">
-              <img :src="item.logo_url" v-if="item.logo_url"/>
-              <span v-else style="width: 2rem;height: 1.2rem;display: block;border-radius: 0.08rem;"></span>
-              <span class="radio_text">{{item.name}}</span></van-radio>
-          </van-radio-group>
-        </div> -->
-        <div class="role_box">
-          <h4>选择身份</h4>
-          <van-radio-group v-model="role" direction="horizontal">
-            <van-radio :name="item.name" v-for="(item, index) in role_list" :key="index" v-if="item.name == 'creator'" style="border:1px #efefef solid;">
-              <img src="static/images/boss.jpg"/>
-              <span style="padding-top: 8px;padding-left: 52px;background:none;color:#333;text-shadow:none;" class="radio_text">创始人</span>
-            </van-radio>
-
-            <van-radio :name="item.name" v-for="(item, index) in role_list" :key="index"
-                       v-if="item.name == 'dept_manager'">
-              <img src="static/images/manager.jpg"/>
-              <span style="padding-top: 8px;padding-left: 62px;background:none;color:#333;text-shadow:none;" class="radio_text">主管</span>
-            </van-radio>
-            <van-radio :name="'employee'">
-              <img src="static/images/Staff.jpg"/>
-              <span style="padding-top: 8px;padding-left: 62px;background:none;color:#333;text-shadow:none;" class="radio_text">员工</span>
-            </van-radio>
-          </van-radio-group>
-        </div>
-        <div style="padding:0.32rem;" class="confirm_box">
-          <div style="height: 0.32rem; font-size:0.28rem;color:#909399;margin-bottom:0.4rem;text-align:center;">选择不同身份,获得不同数据体验</div>
-          <van-button class="login_button" @click="login" size="large" style="letter-spacing: 0.05rem;"
-                      type="info">立即体验
-          </van-button>
-          <van-button @click="$router.push({name: 'create_company'})" class="login_button" style="margin-top:0.16rem;border:0.02rem #bfbfbf solid;color:#bfbfbf;"
-                      plain size="large"
-                      type="info">创建新企业
-          </van-button>
-        </div>
-    </div>
-  </div>
-</template>
-
-<script>
-import {setToken} from '@/utils/auth'
-import Vue from 'vue'
-import invite_newbusiness from '@/components/ems/invite_newbusiness'
-import {RadioGroup, Radio, Popup} from 'vant'
-import request_user from '@/utils/request-user'
-import Cookies from 'js-cookie'
-
-Vue.use(Radio)
-Vue.use(RadioGroup)
-Vue.use(Popup)
-
-export default {
-  components: {invite_newbusiness},
-  data () {
-    return {
-      role: 0,
-      role_two: 0,
-      invite_show: false,
-      normal_show: false,
-      invite_list: [],
-      invite_list_show: false,
-      invite_data: {},
-      role_list: [],
-      site_list: []
-    }
-  },
-  activated () {
-    if (this.$route.query.invite) {
-      this.get_invite()
-    } else {
-      this.normal_show = true
-    }
-    this.get_try_list()
-  },
-  methods: {
-    go_invite (data) {
-      this.invite_data = data
-      this.invite_list_show = false
-      this.normal_show = false
-      this.invite_show = true
-      if (window.plus) {
-        plus.navigator.setStatusBarStyle('light')
-        document.documentElement.style.backgroundColor = '#fff'
-      }
-    },
-    set_invite_show () {
-      if (this.invite_list.length == 1) {
-        this.invite_show = true
-        this.normal_show = false
-        this.invite_data = this.invite_list[0]
-        if (window.plus) {
-          plus.navigator.setStatusBarStyle('light')
-        }
-      } else if (this.invite_list.length > 1) {
-        this.invite_show = false
-        this.normal_show = true
-        this.invite_list_show = true
-        if (window.plus) {
-          plus.navigator.setStatusBarStyle('dark')
-        }
-      }
-    },
-    invite_close () {
-      request_user('post', '/api/invite/bind', {sn: this.invite_list[0].sn, type: 2}).then(res => {
-        // 当不是体验账号时,进入选择公司页面
-        if (this.$route.query.iscompany) {
-          this.$router.push({name: 'login_company_list'})
-        } else {
-          // 当是体验时,直接接入体验公司数据
-          // this.invite_show = false
-          // this.normal_show = true
-          // this.invite_list_show = false
-          // if (window.plus) {
-          //   plus.navigator.setStatusBarStyle('dark')
-          // }
-
-          this.registrationExperience()
-        }
-      })
-    },
-
-    get_try_list () {
-      let self = this
-      self.$toast.loading({
-        mask: false,
-        message: '正在加载'
-      })
-      request_user('get', '/api/try/index').then(res => {
-        self.$toast.clear()
-        if (res.data.code == 1) {
-          var site = res.data.data.site_list
-          // site.push({
-          //   'id': 0,
-          //   'name': '其他',
-          //   'industry': '',
-          //   'logo_url': ''
-          // })
-          self.site_list = site
-          self.role_list = res.data.data.role_list
-          for (let i in res.data.data.role_list) {
-            if (res.data.data.role_list[i].name == 'creator') {
-              self.role = res.data.data.role_list[i].name
-            }
-          }
-          for (let i in res.data.data.site_list) {
-            if (i == 0) {
-              self.role_two = res.data.data.site_list[i].id
-            }
-          }
-        } else {
-          self.$toast(res.data.msg)
-        }
-      })
-    },
-    // 直接进入,跳过选择行业与公司,体验账户专用
-    registrationExperience () {
-      let self = this
-      request_user('get', '/api/try/employees', {site_id: self.site_list[0].id}).then(res => {
-        if (res.data.code == 1) {
-          let login_index = ''
-          for (let i in res.data.data) {
-            let role_list = res.data.data[i].role_list
-            for (let j in role_list) {
-              if (role_list[j].name == 'creator') {
-                login_index = i
-              }
-            }
-          }
-          if (login_index != '') {
-            setToken(res.data.data[login_index].token)
-            if (window.plus) {
-              plus.storage.removeItem('user_info')
-            } else {
-              localStorage.removeItem('user_info')
-            }
-            setTimeout(() => {
-              window.location.href = window.location.href.split('#')[0]
-            }, 100)
-            window.sessionStorage.setItem('__VCKEEPALIVE__', JSON.stringify(['/']))
-            window.sessionStorage.setItem('routers', '/')
-            self.$router.push({name: 'home'})
-          } else {
-            self.$toast('体验登录失败')
-          }
-          // 得到员工的token,把token存好,然后就登录了
-        } else {
-          self.$toast(res.data.msg)
-        }
-      })
-    },
-
-    // 获取邀请详情
-    get_invite () {
-      let self = this
-      self.$toast.loading({
-        mask: false,
-        message: '正在加载'
-      })
-      request_user('get', '/api/invite/waiting').then(res => {
-        self.$toast.clear()
-        if (res.data.code == 1) {
-          self.invite_list = res.data.data
-          self.set_invite_show()
-        } else {
-          self.$toast(res.data.msg)
-        }
-      })
-    },
-    login () {
-      let self = this
-      var num = self.role_two == 0 ? 113 : self.role_two
-      request_user('get', '/api/try/employees', {site_id: num}).then(res => {
-        if (res.data.code == 1) {
-          let login_index = ''
-          for (let i in res.data.data) {
-            let role_list = res.data.data[i].role_list
-            for (let j in role_list) {
-              if (self.role == role_list[j].name) {
-                login_index = i
-              }
-            }
-          }
-          if (login_index != '') {
-            setToken(res.data.data[login_index].token)
-            if (window.plus) {
-              plus.storage.removeItem('user_info')
-            } else {
-              localStorage.removeItem('user_info')
-            }
-            // setTimeout(() => {
-            //   window.location.href = window.location.href.split('#')[0]
-            // },100)
-            window.sessionStorage.setItem('__VCKEEPALIVE__', JSON.stringify(['/']))
-            window.sessionStorage.setItem('routers', '/')
-            self.$router.push({name: 'home'})
-          } else {
-            self.$toast('体验登录失败')
-          }
-          // 得到员工的token,把token存好,然后就登录了
-        } else {
-          self.$toast(res.data.msg)
-        }
-      })
-    },
-    login_out () {
-      let self = this
-      request_user('post', '/api/logout').then((res) => {
-        if (res.data.code == 1) {
-          if (window.plus) {
-            plus.storage.clear()
-	          Cookies.remove('Admin-Token')
-          } else {
-            localStorage.clear()
-	          Cookies.remove('Admin-Token')
-          }
-          self.$router.replace({name: 'login'})
-        } else {
-          self.$toast(res.data.msg)
-        }
-      })
-    }
-  }
-}
-</script>
-
-<style scoped lang="less">
-  .login-box-parent {
-
-  }
-
-  .login-box {
-    height: calc(100% - 0.92rem);
-    position: relative;
-  }
-
-  .login-box .identity {
-    display: block;
-    text-align: left;
-    position: relative;
-    top: 0.12rem;
-    padding: 0 0.32rem;
-  }
-
-  .login-box .identity .title {
-    display: block;
-    text-align: left;
-    color: #606266;
-    font-size: 0.36rem;
-    line-height: 0.5rem;
-    padding: 0 0 0.16rem 0;
-    letter-spacing: 0.01rem;
-  }
-
-  .login-box .identity .imgbox {
-    display: inline-block;
-    vertical-align: top;
-    width: calc(96% / 3);
-    margin-bottom: 0.24rem;
-    height: 1.5rem;
-  }
-
-  .login-box .identity span {
-    display: inline-block;
-    padding: 0.16rem;
-    width: 100%;
-    color: #FFF;
-    font-size: 0.36rem;
-    font-weight: bold;
-  }
-
-  .imgbox span {
-    text-shadow: 2px 2px 1px #333;
-  }
-
-  .login-box .identity .van-icon {
-    display: block;
-    text-align: right;
-    width: 0.32rem;
-    height: 0.32rem;
-    font-size: 0.32rem;
-    line-height: 0.32rem;
-  }
-
-  .login-box .identity .van-radio {
-    display: inline-block;
-    text-align: right;
-    margin-top: 0.26rem;
-    margin-right: 0.16rem;
-    float: right;
-  }
-
-  .login-box .industry {
-    display: block;
-    text-align: left;
-    position: relative;
-    top: 0rem;
-    margin-top: 0.2rem;
-    padding: 0 0.32rem;
-  }
-
-  .login-box .industry .title {
-    display: block;
-    text-align: left;
-    color: #606266;
-    font-size: 0.36rem;
-    line-height: 0.5rem;
-    padding: 0 0 0.16rem 0;
-    letter-spacing: 0.01rem;
-  }
-
-  .login-box .industry .imgbox {
-    display: inline-block;
-    vertical-align: top;
-    width: calc(96% / 3);
-    margin-bottom: 0.24rem;
-    height: 1.5rem;
-  }
-
-  .login-box .industry span {
-    display: inline-block;
-    padding: 0.16rem;
-    width: 100%;
-    color: #FFF;
-    font-size: 0.36rem;
-    font-weight: bold;
-  }
-
-  .login-box .industry .van-icon {
-    display: block;
-    text-align: right;
-    width: 0.32rem;
-    height: 0.32rem;
-    font-size: 0.32rem;
-    line-height: 0.32rem;
-  }
-
-  .login-box .industry .van-radio {
-    display: inline-block;
-    text-align: right;
-    margin-top: 0.26rem;
-    margin-right: 0.16rem;
-    float: right;
-  }
-
-  .role_box {
-    padding: 0 0.32rem;
-  }
-
-  .site_box {
-    padding: 0 0.32rem;
-  }
-
-  .site_box h4, .role_box h4 {
-    margin-top: 0.16rem;
-  }
-
-  .role_box .van-radio--horizontal {
-    margin-bottom: 0.32rem;
-    margin-right: 0.5rem;
-  }
-
-  .site_box .van-radio--horizontal {
-    margin-bottom: 0.32rem;
-    margin-right: 0.5rem;
-  }
-  .radio_text{position: absolute; top:0rem; left:0rem; bottom:0; right:0; background-color: rgba(0,0,0,0.3); line-height: 1.5; padding:0.14rem 0 0 0.14rem;text-shadow:0 0.1rem 0.1rem rgba(51,51,51,0.8)}
-  /deep/ .van-radio__label{margin:0; position: relative; color:#fff; font-size: 0.32rem;border-radius: 0.08rem;}
-  /deep/ .van-radio__label img{width:2rem; vertical-align: top;border-radius:0.08rem;}
-  /deep/ .van-radio__icon--round{position: absolute;z-index: 1;bottom: 0rem;opacity: 0;right: 0rem;width: 2rem;height:1.2rem;background:transparent;border-radius: 0.08rem;}
-  /deep/ .van-radio__icon--round.van-radio__icon--checked{opacity: 1;box-shadow: 1px 1px 4px 1px rgba(25,137,250,0.4);}
-  /deep/ .site_box .van-radio--horizontal,.role_box .van-radio--horizontal{margin-right:0.32rem; position: relative;border-radius: 0.08rem;overflow: visible;}
-  /deep/ .van-radio-group--horizontal{margin-right:-0.5rem;}
-  /deep/ .login-box h4{margin-bottom:0.32rem;font-size:0.32rem;}
-  .login-box-parent /deep/ .van-nav-bar{background:#fff;}
-  .login-box-parent /deep/ .van-nav-bar .van-nav-bar__left .van-icon{color:#323232;}
-  .login-box-parent /deep/ .van-nav-bar .van-nav-bar__title{font-size: 0.4rem;font-weight:bold;color:#323232;}
-  .login-box-parent /deep/ .van-radio__icon--round .van-icon{border-radius: 0;position:absolute;margin-top:0.23rem;right: 0;bottom:0;background:none;border:none;border-bottom: 0.6rem solid #1989fa;border-right: 0rem solid transparent;border-left: 0.6rem solid transparent;}
-  .login-box-parent /deep/ .van-icon-success::before{position:absolute;top:0.2rem;right:0;}
-  .login-box-parent .confirm_box{position:absolute;bottom:0;width:90vw;}
-</style>

+ 0 - 1
src/components/help.vue

@@ -47,7 +47,6 @@
   Vue.use(Collapse);
   Vue.use(CollapseItem);
   Vue.use(Lazyload)
-  import request_user from '@/utils/request-user'
   import request from '@/utils/request'
 
   export default {

+ 7 - 3
src/components/integral/application_popup/integral.vue

@@ -6,7 +6,9 @@
         <van-cell-group>
           <van-cell title="指定规则" v-if="can_edit_rule">
             <template slot="right-icon">
-              <van-switch v-model="select_cate" size="24" />
+              <div>
+                <van-switch v-model="select_cate" inactive-color="#9a9a9a" size="24" />
+              </div>
             </template>
           </van-cell>
 
@@ -120,11 +122,13 @@
           <div class="tip" slot="title">奖票多用于优秀表现和重要事项的表彰</div>
           <van-cell center title="发放奖票">
             <template #right-icon>
-              <van-switch v-model="ticket_count" size="24" />
+              <div>
+                <van-switch v-model="ticket_count" inactive-color="#9a9a9a" size="24" />
+              </div>
             </template>
           </van-cell>
         </van-cell-group>
-        <van-cell-group v-if="!isCreator"><EmployeeSelectorCell title="递交审批" v-model="reviewer" :multi="false" :is_filtration_creator="true" :employee_list="superior_list" :use_employee_list="true"></EmployeeSelectorCell></van-cell-group>
+        <van-cell-group v-if="!isCreator"><EmployeeSelectorCell title="递交审批" v-model="reviewer" :multi="false" :employee_list="superior_list" :use_employee_list="true"></EmployeeSelectorCell></van-cell-group>
         <van-cell-group>
           <van-cell><Mtextarea v-model="data.remark" placeholder="填写意见(选填)"></Mtextarea></van-cell>
         </van-cell-group>

+ 8 - 2
src/components/integral/approval_detail.vue

@@ -31,8 +31,8 @@
           <userImage class="about-me__avatar" :user_name="detail_info.employee_info.name" :img_url="detail_info.employee_info.img_url" width="1.12rem" height="1.12rem"></userImage>
           <span class="event-employee__name"><Wxopendata type="userName" :openid="detail_info.employee_info.name"></Wxopendata></span>
           <template v-if="detail_info.status == 1">
-            <span class="event-info__value" v-if="detail_info.review_point >= 0">+{{ detail_info.review_point }} {{ types_list[detail_info.pt_id] }}</span>
-            <span class="event-info__value color_green" v-else>{{ detail_info.review_point }}{{ types_list[detail_info.pt_id] }}</span>
+            <span class="event-info__value color_green" v-if="detail_info.review_point >= 0">+{{ detail_info.review_point }} {{ types_list[detail_info.pt_id] }}</span>
+            <span class="event-info__value color_red" v-else>{{ detail_info.review_point }}{{ types_list[detail_info.pt_id] }}</span>
           </template>
           <span class="event-info__status">{{ detail_info.review_status_mark }}</span>
         </div>
@@ -581,4 +581,10 @@ export default {
     flex-wrap: wrap;
   }
 }
+.color_red{
+  color: #F56C6C;
+}
+.color_green{
+  color: #4BD964;
+}
 </style>

+ 5 - 5
src/components/integral/approval_list.vue

@@ -11,6 +11,7 @@
       @onRefresh="onRefresh"
       @onInfinite="onInfinite"
       @onTabChange="onTabChange"
+      :list="list"
       :cancel_buttons="'block'"
       :isSameContent="true"
     >
@@ -52,12 +53,12 @@
                 <span class="title" v-show="item.source_type == 4">{{item.employee_name}}的绩效工作</span> -->
                 <span class="title">
                   <Wxopendata type="userName" :openid="item.employee_name"></Wxopendata>
-                  {{item.source_type == 1?'的积分任务':item.source_type == 2?'的积分申请':item.source_type == 3?'的积分奖扣':item.source_type == 4?'的绩效工作':''}}
+                  {{item.source_type == 1?'的积分任务':item.source_type == 2?'的积分申请':item.source_type == 3?'的积分奖扣':item.source_type == 4?'':''}}
                 </span>
                 <!-- <span class="title" v-show="item.source_type == 4">{{item.employee_name}}提交的绩效工作包</span> -->
                 <span v-if="filter.type === 'reviewed' && item.status !== 0 &&   item.status !== 2 ">
-                  <span class="task-item__point" v-if="item.review_point >= 0">+{{ item.review_point }}</span>
-                  <span class="task-item__point green" v-else>{{ item.review_point }}</span>
+                  <span class="task-item__point green" v-if="item.review_point >= 0">+{{ item.review_point }} {{$isPt_id(item.pt_id)}}</span>
+                  <span class="task-item__point" v-else>{{ item.review_point }} {{$isPt_id(item.pt_id)}}</span>
                 </span>
               </div>
             </div>
@@ -162,7 +163,6 @@ export default {
             {name: '积分申请', id: '2'},
             {name: '积分奖扣', id: '3'},
             {name: '积分任务', id: '1'},
-            {name: '绩效工作', id: '4'}
           ]
         }
       ]
@@ -365,7 +365,7 @@ export default {
 
   .task_list {
     position: relative;
-    padding: 0.24rem 0.32rem;
+    padding: 0.24rem 0.32rem 0;
 
     &:not(:last-child)::after {
       position: absolute;

+ 15 - 7
src/components/integral/batchList.vue

@@ -10,14 +10,14 @@
                 <div class="flex-1">可直接打分审批(默认)</div>
                 <div v-if="activeIndex == 1"><i class="van-icon van-icon-success"></i></div>
               </div>
-              <div style="font-size: 0.28rem;" class="color_ccc">绩效工作不参与批量审批</div>
+              <!-- <div style="font-size: 0.28rem;" class="color_ccc">绩效工作不参与批量审批</div> -->
             </div>
             <div class="sx-item" @click="activeItem(2)">
               <div class="flex-box">
                 <div class="flex-1">全部</div>
                 <div v-if="activeIndex == 2"><i class="van-icon van-icon-success"></i></div>
               </div>
-              <div style="font-size: 0.28rem;" class="color_ccc">绩效工作不参与批量审批</div>
+              <!-- <div style="font-size: 0.28rem;" class="color_ccc">绩效工作不参与批量审批</div> -->
             </div>
           </van-dropdown-item>
         </van-dropdown-menu>
@@ -83,7 +83,9 @@
 
                <van-cell center title="发放奖票">
                  <template #right-icon>
-                   <van-switch v-model="item.ticket_count" size="24" />
+                   <div>
+                    <van-switch v-model="item.ticket_count" inactive-color="#9a9a9a" size="24" />
+                   </div>
                  </template>
                </van-cell>
 
@@ -129,7 +131,9 @@
                 </div>
                 <van-cell center title="发放奖票">
                   <template #right-icon>
-                    <van-switch v-model="item.ticket_count" size="24" />
+                    <div>
+                      <van-switch v-model="item.ticket_count" inactive-color="#9a9a9a" size="24" />
+                    </div>
                   </template>
                 </van-cell>
               </template>
@@ -138,7 +142,9 @@
               <template v-else>
                 <van-cell title="打分参考已有的积分规则制度">
                   <template slot="right-icon">
-                    <van-switch v-model="item.diy2" size="24" />
+                   <div>
+                    <van-switch v-model="item.diy2" inactive-color="#9a9a9a" size="24" />
+                   </div>
                   </template>
                 </van-cell>
                  <!-- 规则 -->
@@ -209,7 +215,9 @@
 
                  <van-cell center title="发放奖票">
                    <template #right-icon>
-                     <van-switch v-model="item.ticket_count" size="24" />
+                     <div>
+                      <van-switch v-model="item.ticket_count" inactive-color="#9a9a9a" size="24" />
+                     </div>
                    </template>
                  </van-cell>
               </template>
@@ -704,7 +712,7 @@ export default {
   border: 0 solid #fff;
 }
 .sx-item {
-  padding: 0.2rem;
+  padding: 0.3rem;
   font-size: 0.3rem;
   border-bottom: 1px solid #ebedf0;
   line-height: 0.4rem;

+ 7 - 7
src/components/integral/callback.vue

@@ -53,7 +53,7 @@
 
      </div>
 
-     <van-cell class="bottom_button" @click="$route_back" title="回到首页"></van-cell>
+     <van-cell class="bottom_button" @click="$router.replace('/home')" title="返回"></van-cell>
 
     </scroller>
    </div>
@@ -107,12 +107,12 @@
             image:'static/images/A.png',
             url: '/integral_entry_n?type=1'
           },
-          {
-            value: '4',
-            text: '发布绩效',
-            image:'static/images/E.png',
-            url: '/efficiency_create'
-          },
+          // {
+          //   value: '4',
+          //   text: '发布绩效',
+          //   image:'static/images/E.png',
+          //   url: '/efficiency_create'
+          // },
           {
             value: '5',
             text: '临时任务',

+ 1 - 1
src/components/integral/callback_new.vue

@@ -38,7 +38,7 @@
         <div class="buttom_btn one" @click="go">+ 继续添加</div>
       </van-col>
       <van-col span="12">
-        <div class="buttom_btn color_blue" @click="$router.replace('/')">> 回到首页</div>
+        <div class="buttom_btn color_blue" @click="$router.replace('/home')">> 回</div>
       </van-col>
     </van-row>
   </div>

+ 42 - 3
src/components/integral/event_detail.vue

@@ -8,8 +8,8 @@
           <div class="flex-box-v flex-center-center event-info__header">
                 <userImage class="about-me__avatar" :id="eventInfo.employee_id" :img_url="eventInfo.img_url" :user_name="eventInfo.employee_name" width="1.12rem" height="1.12rem"></userImage>
                 <span class="event-employee__name"><Wxopendata type="userName" :openid="eventInfo.employee_name"></Wxopendata></span>
-                <span class="event-info__value" v-if="eventInfo.point >= 0">+{{ eventInfo.point}} {{types_list[eventInfo.pt_id]}}</span>
-                <span class="event-info__value green" v-else>{{ eventInfo.point}} {{types_list[eventInfo.pt_id]}}</span>
+                <span class="event-info__value green" v-if="eventInfo.point >= 0">+{{ eventInfo.point}} {{types_list[eventInfo.pt_id]}}</span>
+                <span class="event-info__value" v-else>{{ eventInfo.point}} {{types_list[eventInfo.pt_id]}}</span>
           </div>
           <div class="event-task__wrap">
             <div class="event-task__item" v-if="eventInfo.remark !== null && eventInfo.remark.customize">
@@ -90,7 +90,13 @@
             </div>
           </div>
         </van-skeleton>
+        <div style="height: 1.5rem;"></div>
       </scroller>
+      <!-- 奖扣者 ||  -->
+      <footer class="flex-box flex-v-ce footer" v-if="eventInfo.process.length == 1 && (eventInfo.event_type == 3 || eventInfo.event_type == 4)">
+        <div class="flex-2">撤销后数据将不可恢复</div>
+        <van-button type="info" @click="revocation()" class="flex-1">撤销</van-button>
+      </footer>
     </div>
   </div>
 </template>
@@ -99,12 +105,13 @@
 import request from '@/utils/request'
 import userImage from '@/components/common/user_image'
 import Vue from 'vue'
-import { Panel, Skeleton, Image, ImagePreview } from 'vant'
+import { Panel, Skeleton, Image, ImagePreview, Dialog } from 'vant'
 
 Vue.use(Panel)
   .use(Skeleton)
   .use(Image)
   .use(ImagePreview)
+  .use(Dialog)
 export default {
   name: 'event_detail_info',
   components: {userImage},
@@ -124,6 +131,25 @@ export default {
     }
   },
   methods: {
+    // 撤销奖扣
+    revocation () {
+      var that = this
+      Dialog.confirm({
+        title: '提示',
+        message: '您确定要撤销此项吗?'
+      }).then(() => {
+        let data = { target_id: this.$route.query.id, type: 1}
+        request('post', '/api/integral/review/prize/destroy', data).then(res => {
+          if (res.data.code == 1) {
+            that.$toast('已撤销')
+            that.$keep_alive_update('update_list_pk', this.$route.query.id)
+            that.$route_back()
+          }
+        })
+      }).catch(() => {
+        // on cancel
+      })
+    },
     show_imgae (index, files) {
       ImagePreview({
         images: files,
@@ -370,4 +396,17 @@ export default {
   }
 
 }
+.footer {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  background: #fff;
+  padding: 0.16rem 0.3rem;
+  border-top: 1px solid #f1f1f1;
+}
+.footer .flex-2 {
+  font-size: 0.28rem;
+  color: #909399;
+}
 </style>

+ 2 - 2
src/components/integral/event_list.vue

@@ -28,8 +28,8 @@
                 <userImage class="about-me__avatar" :img_url="item.employee_img_url" :user_name="item.employee_name" fontSize="0.24rem" width="0.72rem" height="0.72rem"></userImage>
               </span>
               <span class="event-item__name"><Wxopendata type="userName" :openid="item.employee_name"></Wxopendata></span>
-              <span class="event-item__value" v-if="item.point >= 0">+{{ item.point }}{{ types_list[item.pt_id]}}</span>
-              <span class="event-item__value green" v-else>{{ item.point }}{{ types_list[item.pt_id] }}</span>
+              <span class="event-item__value green" v-if="item.point >= 0">+{{ item.point }}{{ types_list[item.pt_id]}}</span>
+              <span class="event-item__value" v-else>{{ item.point }}{{ types_list[item.pt_id] }}</span>
 
             </div>
             <div class="event-content__text">

+ 2 - 2
src/components/integral/integral_application_list.vue

@@ -24,9 +24,9 @@
               <span class="title" style="padding-right: 0.2rem;">{{item.remark.customize || item.remark.rule}}</span>
             </template>
             <template slot="right-icon">
-              <span class="point_text" v-show="item.status != 2" :class="{color_green: item.status == 1,color_red:item.status == 0}">
+              <span class="point_text" v-show="item.status != 2" :class="item.review_point > 0 ? 'color_green':'color_red'">
                 <span v-show="item.review_point > 0">+</span>
-                {{item.review_point}}
+                {{item.review_point}} {{$isPt_id(item.pt_id)}}
               </span>
             </template>
             <template slot="label">

+ 12 - 3
src/components/integral/integral_entry_b.vue

@@ -5,7 +5,7 @@
       <scroller>
 
         <van-cell-group>
-          <EmployeeSelectorCell required title="录入对象" :employee_list="manage_scope" v-model="employee_list" :multi="true"
+          <EmployeeSelectorCell required title="录入对象" use_employee_list :employee_list="manage_scope" v-model="employee_list" :multi="true"
                                 :max="10"></EmployeeSelectorCell>
         </van-cell-group>
         <van-cell-group>
@@ -28,7 +28,7 @@
           </van-cell>
           <van-field v-model="item.point" label="分值" placeholder="请输入分值" required/>
           <DateCell required title="选择日期" v-model="item.event_time"></DateCell>
-          <EmployeeSelectorCell title="审批人" v-model="item.reviewer_list" :multi="false" :max="1"></EmployeeSelectorCell>
+          <EmployeeSelectorCell title="审批人" use_employee_list v-model="item.reviewer_list" :multi="false" :max="1"></EmployeeSelectorCell>
         </van-cell-group>
 
 
@@ -45,7 +45,7 @@
           <CategorySelectorCell title="选择分类" v-model="item.rule_cate" :max="1" :multi="false" required></CategorySelectorCell>
           <van-field v-model="item.point" label="分值" placeholder="请输入分值" required/>
           <DateCell required title="选择日期" v-model="item.event_time"></DateCell>
-          <EmployeeSelectorCell title="审批人" v-model="item.reviewer_list" :multi="false" :max="1"></EmployeeSelectorCell>
+          <EmployeeSelectorCell title="审批人" use_employee_list :employee_list="employee_list" v-model="item.reviewer_list" :multi="false" :max="1"></EmployeeSelectorCell>
         </van-cell-group>
 
         <van-cell-group v-if="entry_type==2">
@@ -186,6 +186,15 @@
         employee_list: []
       }
     },
+    mounted(){
+      //刷新当前角色下级上级
+      request('get', '/api/employee/detail')
+        .then(res => {
+          let list = res.data.data.user
+          this.manage_scope = list.employee_detail.manage_scope
+          this.employee_list = list.employee_detail.superior_list
+        })
+    },
     methods: {
       init_diy_item() {
         let date = moment().format('YYYY-MM-DD')

+ 4 - 2
src/components/integral/integral_entry_list.vue

@@ -17,7 +17,7 @@
               <!-- <span class="re-item__name">{{employee_name(item.employee_id) || item.employee_name}}</span> -->
               <span class="re-item__name"><Wxopendata type="userName" :openid="employee_name(item.employee_id) || item.employee_name"></Wxopendata></span>
               <span class="re-item__value"
-                :class="{color_red:(item.event_type == 2 || item.event_type == 4 || item.event_type == 6 || item.event_type == 8 || item.event_type == 10), color_green: (item.event_type == 1 || item.event_type == 3 || item.event_type == 5 || item.event_type == 7 || item.event_type == 9)}"><span v-show="item.event_type == 1 || item.event_type == 3 || item.event_type == 5 || item.event_type == 7 || item.event_type == 9">+</span>{{item.point}}</span>
+                :class="{color_red:(item.event_type == 2 || item.event_type == 4 || item.event_type == 6 || item.event_type == 8 || item.event_type == 10), color_green: (item.event_type == 1 || item.event_type == 3 || item.event_type == 5 || item.event_type == 7 || item.event_type == 9)}"><span v-show="item.event_type == 1 || item.event_type == 3 || item.event_type == 5 || item.event_type == 7 || item.event_type == 9">+</span>{{item.point}} {{$isPt_id(item.pt_id)}}</span>
               <!-- <span class="re-item__value color_green"><span v-show="item.event_type == 1 || item.event_type == 3 || item.event_type == 5 || item.event_type == 7 || item.event_type == 9">+</span>{{item.point}}</span> -->
             </div>
             <div style="padding-left: 0.72rem; margin-left: 0.2rem; font-size: 0.32rem">
@@ -189,7 +189,9 @@ export default {
     // 运用缓存更新方法来完成返回后的更新
     update_list_pk: function (vm, data) {
       for (let i in vm.list) {
-        if (vm.list[i].id == data.pk_id) {
+        if (vm.list[i].id == data) {
+          console.log(data)
+          vm.list.splice(i, 1)
         }
       }
     }

+ 27 - 2
src/components/integral/integral_entry_n.vue

@@ -29,7 +29,10 @@
             </div>
             <van-cell title="指定规则">
               <template slot="right-icon">
-                <van-switch v-model="item.diy" size="24"/>
+                <!-- <div class="switchall" :class="{scitchBlue:!item.diy}"> -->
+                <div>
+                  <van-switch v-model="item.diy" inactive-color="#9a9a9a" size="24"/>
+                </div>
               </template>
             </van-cell>
             <RuleCategorySelectorCell
@@ -590,6 +593,28 @@ export default {
     for (let i in this.types_list_array) {
       this.types_list_map[this.types_list_array[i].id] = this.types_list_array[i]
     }
+    //刷新当前角色下级上级
+    request('get', '/api/employee/detail')
+      .then(res => {
+        let list = res.data.data.user
+        this.manage_scope = list.employee_detail.manage_scope
+        // let manageList = list.employee_detail.manage_scope
+        
+        // request('get', '/api/employee/index', { page: 0, page_size: 2000, is_official: 1 }).then((res) => {
+        //   let arr = res.data.data.list
+        //   let scopeList = []
+        //   arr.map(item => {
+        //     // 列表数据是否是自己的管理范围
+        //     manageList.map(item2 => {
+        //       if (item.id == item2.id) {
+        //         scopeList.push(item);
+        //       }
+        //     });
+        //   });
+        //   this.manage_scope = scopeList
+        // })
+        this.reviewed_score = list.employee_detail.superior_list
+      })
   },
   activated () {
     this.type = this.$route.query.type
@@ -609,7 +634,7 @@ export default {
   }
 }
 </script>
-<style scoped>
+<style scoped lang="less">
   .body_com {
     height: calc(100% - 0.92rem);
     position: relative;

+ 2 - 1
src/components/integral/integral_rank.vue

@@ -127,7 +127,8 @@ export default {
   components: { DeptSelectorDropdown, userImage, RuleCategorySelDropdown },
   computed: {
     hasData () {
-      return this.loading || (Array.isArray(this.data) && this.data.length > 0)
+      // return this.loading || (Array.isArray(this.data) && this.data.length > 0)
+      return (Array.isArray(this.data) && this.data.length > 0)
     }
   },
   watch: {

+ 1 - 1
src/components/integral/rankB.vue

@@ -57,7 +57,7 @@ export default {
   // 数据
   data () {
     return {
-      title: '累计分排名',
+      title: '累计B分排名',
       list: [],
       filter: {
         page: 1,

+ 6 - 7
src/components/integral/rule_category.vue

@@ -26,7 +26,7 @@
     </div>
     <div class="body_com" :class="{show_dept_path:pid_list_arr.length > 0}">
 
-      <scroller :on-refresh="get_department_list">
+      <scroller ref="scroller" :on-refresh="get_department_list">
 
         <van-cell-group v-if="pid > 0 && keyword == ''">
         <van-cell :title="pid_list_arr[pid_list_arr.length - 1].name" class="employee_cell" @click="edit_cate">
@@ -44,18 +44,15 @@
         <van-cell :is-link="!select_mode" v-for="(item,index) in rule_category_list" v-if="pid == item.pid" v-show="item.name.indexOf(keyword) >= 0" :key="index" :title="item.name" class="employee_cell" @click="dept_click(item)">
           <template slot="icon">
             <van-checkbox v-model="item.checked" v-if="select_mode"></van-checkbox>
-
           </template>
         </van-cell>
         </van-cell-group>
-
           <van-cell-group v-for="(item,index) in list" :key="index" v-show="item.remark.indexOf(keyword) >= 0">
-
             <van-cell :title="item.remark" class="employee_cell rule_list_item" @click="employee_click(item)" >
               <template slot="label">
                 <div v-show="item.cycle_type == 2"><van-tag size="medium" plain>自动规则</van-tag></div>
-                <span class="record color_green" v-if="item.min_point < 0">{{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}</span>
-                <span class="record color_red" v-if="item.min_point >= 0">+ {{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}</span>
+                <span class="record color_red" v-if="item.min_point < 0">{{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}</span>
+                <span class="record color_green" v-if="item.min_point >= 0">+ {{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}</span>
                 <span class="type">{{types_list[item.pt_id]}}</span>
                 <span class="fr">{{get_cate_name(item.rule_id)}}</span>
               </template>
@@ -76,7 +73,6 @@
     <van-row class="bottom_menu" v-if="!select_mode && pid == 0">
       <van-col span="24"><a href="javascript:void(0);" @click="show_add_dept">添加分类</a></van-col>
     </van-row>
-
     <div class="bottom_menu1" v-if="select_mode">
       <div class="selected_box">
         <ul :style="'width:'+selected_box_width">
@@ -404,6 +400,9 @@ export default {
       this.dept_pid = item1.pid
     },
     dept_click (item) {
+      //scroller回到顶部
+      this.$refs.scroller.scrollTo(0,0)
+
       if (this.select_mode) {
         // 选择
         this.select_dept(item)

+ 1 - 1
src/components/integral/statistics_personal.vue

@@ -150,7 +150,7 @@ export default {
       month: this.$route.query.month || moment(now).format('YYYY-MM'),
       newMonth: this.$route.query.month || now.getMonth() + 1,
       monthlyPointItems: [
-        { label: `${now.getMonth() + 1}月绩效分`, value: 0, to: 'my_statistics_personal' },
+        // { label: `${now.getMonth() + 1}月绩效分`, value: 0, to: 'my_statistics_personal' },
         { label: '本月A分', value: 0, to: 'statistics_personal_a' },
         { label: '本月B分', value: 0, to: 'statistics_personal_b' }
       ],

+ 9 - 4
src/components/integral/team_data.vue

@@ -7,7 +7,9 @@
       <van-dropdown-menu>
         <van-dropdown-item :title="deptTitle" ref="deptDropdownItem">
           <template slot="title">
-            <Wxopendata type="departmentName" :openid="deptTitle"></Wxopendata>
+            <div class="deptTit font-flex-word">
+              <Wxopendata type="departmentName" :openid="deptTitle"></Wxopendata>
+            </div>
           </template>
           <DeptSelectorDropdown @onConfirm="onConfirmDept" content-height="3.5rem"/>
         </van-dropdown-item>
@@ -17,9 +19,9 @@
         <div class="dropdown-menu__item" @click.stop="pointSort(3,4)">
           <span :class="{asc: sortType === 3,desc: sortType === 4}">B分</span>
         </div>
-        <div class="dropdown-menu__item" @click.stop="pointSort(5,6)">
+        <!-- <div class="dropdown-menu__item" @click.stop="pointSort(5,6)">
           <span :class="{asc: sortType === 5,desc: sortType === 6}">绩效分</span>
-        </div>
+        </div> -->
       </van-dropdown-menu>
     </div>
     <div class="team-list__content">
@@ -31,7 +33,7 @@
           </div>
           <div class="team-item__text"><span>{{ item.a }}</span></div>
           <div class="team-item__text"><span>{{ item.b }}</span></div>
-          <div class="team-item__text"><span>{{ item.performance }}</span></div>
+          <!-- <div class="team-item__text"><span>{{ item.performance }}</span></div> -->
         </div>
 
         <van-empty v-if="data == null || (data != null && data.length == 0)" description="暂无数据..."/>
@@ -293,4 +295,7 @@ export default {
       }
     }
   }
+  .deptTit{
+    max-width: 2rem;
+  }
 </style>

+ 0 - 412
src/components/message_detail.vue

@@ -1,412 +0,0 @@
-<template>
-  <div>
-    <van-nav-bar :title="title" left-text="返回" @click-left="routerBak()" left-arrow></van-nav-bar>
-    <div class="body_com has_header">
-      <scroller ref="scroller" :on-refresh="onRefresh" :on-infinite="onInfinite">
-        <div class="message-box">
-          <div @click="detail(item)" class="message-item" v-for="(item, index) in list" :key="index">
-            <van-cell class="message-item-source">
-              <icon v-show="item.source_type == 'integral_apply'" class="cell-item__icon" name="messageApplication" />
-              <icon v-show="item.source_type == 'information'" class="cell-item__icon" name="messageNotice" />
-              <icon v-show="item.source_type == 'integral_input'" class="cell-item__icon" name="messageBF" />
-              <icon v-show="item.source_type == 'attendance'" class="cell-item__icon" name="messageAttendance" />
-              <icon v-show="item.source_type == 'task'" class="cell-item__icon" name="messageTask" />
-              <icon v-show="item.source_type == 'report_statistics'" class="cell-item__icon" name="messageData" />
-              <icon v-show="item.source_type == 'performance'" class="cell-item__icon" name="messageJX1" />
-              <span>{{ get_source(item.tpl) }}</span>
-              <template slot="right-icon">
-                <span class="datetime">{{ (item.create_time || item.update_time) | testMsgTime }}</span>
-              </template>
-            </van-cell>
-            <van-cell class="message-item-title" :border="false">
-              {{ get_title(item.tpl) }}
-              <template slot="right-icon">
-                <span class="colorFF2D55" v-show="get_point(item.tpl) > 0">+{{ get_point(item.tpl) }}</span>
-                <span class="color4BD964" v-show="get_point(item.tpl) < 0">{{ get_point(item.tpl) }}</span>
-              </template>
-            </van-cell>
-            <van-cell class="message-item-content">{{ get_content(item.tpl) }}</van-cell>
-            <van-cell is-link v-show="get_feedback(item.tpl) != ''">
-              <!--<span class="labelFF9600" v-show="get_feedback(item.tpl) == '待审批'">{{get_feedback(item.tpl)}}</span>
-              <span class="label4bd964" v-show="get_feedback(item.tpl) == '通过'">{{get_feedback(item.tpl)}}</span>
-              <span class="labelf56c6c" v-show="get_feedback(item.tpl) == '驳回'">{{get_feedback(item.tpl)}}</span>-->
-              <span v-if="item.cancel != 1">查看详情</span>
-              <span class="labelf56c6c" v-show="item.cancel == 1">{{ item.cancel_text }}</span>
-            </van-cell>
-          </div>
-        </div>
-        <noData style="margin-top: 2rem;" v-if="cate == 'information'" src="static/images/Notice.png" :list="list" detail_text="没有公告" />
-        <noData style="margin-top: 2rem;" v-if="cate != 'information'" src="static/images/noconfirm.png" :list="list" detail_text="没有通知" />
-      </scroller>
-    </div>
-  </div>
-</template>
-
-<script>
-import request from '@/utils/request'
-import Vue from 'vue'
-import { Panel } from 'vant'
-import moment from 'moment'
-import { DB } from '@/utils/local_data'
-Vue.use(Panel)
-export default {
-  name: 'message_detail',
-  data () {
-    return {
-      list: null,
-      cate: '',
-      db: null,
-      list_map: '',
-      testTime: '',
-      title: '',
-      page: 1
-    }
-  },
-  filters: {
-    msgTime (time) {
-      return moment(parseInt(time) * 1000).format('YYYY-MM-DD HH:mm')
-    },
-    testMsgTime (time) {
-      return moment(parseInt(time) * 1000).calendar(null, {
-        sameDay: '[今天] HH:mm',
-        lastDay: '[昨天] HH:mm',
-        lastWeek: 'MM-DD HH:mm',
-        sameElse: function () {
-          if (moment(moment().format('YYYY-MM-DD HH:mm')).diff(moment(parseInt(time) * 1000).format('YYYY-MM-DD HH:mm'), 'years')) {
-            return 'YYYY-MM-DD HH:mm'
-          } else {
-            return 'MM-DD HH:mm'
-          }
-        }
-      })
-    }
-  },
-  created () {
-    console.log(this.$route.query.cate)
-    console.log(this.$route.query.title)
-    console.log('2222222222222')
-    this.cate = this.$route.query.cate
-    this.title = this.$route.query.title
-  },
-  methods: {
-    get_title (tpl) {
-      let title = tpl.find(o => {
-        return o.type == 'title'
-      })
-      if (title) {
-        return title.value
-      }
-      return ''
-    },
-    get_source (tpl) {
-      let source = tpl.find(o => {
-        return o.type == 'source'
-      })
-      if (source) {
-        return source.value
-      }
-      return ''
-    },
-    get_content (tpl) {
-      let content = tpl.find(o => {
-        return o.type == 'content'
-      })
-      if (content) {
-        return content.value
-      }
-      return ''
-    },
-    get_point (tpl) {
-      for (let i in tpl) {
-        if (tpl[i].type == 'point') {
-          return tpl[i].value
-        }
-      }
-      return 0
-    },
-    get_feedback (tpl) {
-      for (let i in tpl) {
-        if (tpl[i].type == 'feedback') {
-          return tpl[i].value
-        }
-      }
-      return ''
-    },
-    create_params (p) {
-      let ret = []
-      for (let i in p) {
-        ret.push(i + '=' + p[i])
-      }
-      return '?' + ret.join('&')
-    },
-    detail (item) {
-      if (item.mini_program.index != '') {
-        if (item.mini_program.path.indexOf('.zip') >= 0) {
-          let url = item.mini_program.index + this.create_params(item.mini_program.params)
-          this.get_app_and_open(item.mini_program.path, url)
-        } else {
-          console.log(item.mini_program.index)
-          this.$router.push({
-            path: item.mini_program.index,
-            query: item.mini_program.params
-          })
-        }
-        // 写入当前被点击的记录ID
-        localStorage.setItem('read_msg', item.id)
-      }
-    },
-
-    open_app (url) {
-      if (window.plus) {
-        let webview = plus.webview.create(url, url)
-        let StatusBarStyle = plus.navigator.getStatusBarStyle()
-        plus.nativeUI.showWaiting('加载中....')
-        webview.show(
-          'pop-in',
-          300,
-          function () {
-            // 窗口显示动画完成
-          },
-          { acceleration: 'capture' }
-        )
-        webview.onloaded = function () {
-          plus.nativeUI.closeWaiting()
-        }
-        webview.onclose = function () {
-          plus.navigator.setStatusBarStyle(StatusBarStyle)
-        }
-      }
-    },
-    download_app (app_url, url) {
-      if (window.plus) {
-        let self = this
-        plus.nativeUI.showWaiting('加载中....')
-        plus.downloader
-          .createDownload(app_url, { filename: '_doc/update/' }, function (d, status) {
-            if (status == 200) {
-              plus.zip.decompress(
-                d.filename,
-                '_doc/dir/',
-                function () {
-                  plus.nativeUI.closeWaiting()
-                  plus.storage.setItem(url.split('#')[0], app_url)
-                  self.open_app(url)
-                },
-                function (error) {
-                  console.log(error)
-                }
-              )
-            } else {
-              plus.nativeUI.alert('下载失败!')
-            }
-            plus.nativeUI.closeWaiting()
-          })
-          .start()
-      }
-    },
-    get_app_and_open (app_url, _url) {
-      let self = this
-      let url = '_doc/dir/' + _url
-      // 因为考勤通知的数据带的下载地址有误所以去常用菜单里拿
-      if (window.plus) {
-        plus.io.getFileInfo({
-          success: function (ret) {
-            // console.log(ret + '成功')
-            // console.log(plus.storage.getItem(url.split('#')[0]))
-            if (plus.storage.getItem(url.split('#')[0])) {
-              self.open_app(url)
-            } else {
-              var downloadUrl = ''
-              self.$store.dispatch('getMenu').then(res => {
-                if (res) {
-                  var menu = window.plus ? JSON.parse(plus.storage.getItem('menu')) : JSON.parse(localStorage.getItem('menu'))
-                  menu.forEach(item => {
-                    if (item.download_url) {
-                      downloadUrl = item.download_url
-                    }
-                  })
-                  self.download_app(downloadUrl, url)
-                }
-              })
-            }
-            // if (plus.storage.getItem(url.split('#')[0]) == app_url) {
-            //   self.open_app(url)
-            // } else {
-            //   self.download_app(downloadUrl, url)
-            // }
-          },
-          filePath: url.split('#')[0],
-          fail: function (ret) {
-            // console.log(ret + '失败')
-            // 打开失败,如果是文件不存在,则需要从服务器上下载压缩包
-            var downloadUrl = ''
-            self.$store.dispatch('getMenu').then(res => {
-              if (res) {
-                var menu = window.plus ? JSON.parse(plus.storage.getItem('menu')) : JSON.parse(localStorage.getItem('menu'))
-                menu.forEach(item => {
-                  if (item.download_url) {
-                    downloadUrl = item.download_url
-                  }
-                })
-                self.download_app(downloadUrl, url)
-              }
-            })
-            // self.download_app(app_url, url)
-          }
-        })
-      }
-    },
-    // 返回上一页
-    routerBak () {
-      this.$keep_alive_update('update_message_list', {})
-      this.$route_back()
-    },
-
-    // 获取未读信息
-    get_list (done) {
-      // var ids = []
-      request('get', '/api/notice/list', { cate: this.cate, page: this.page, page_size: 20, type: 1 })
-        .then(res => {
-          if (res.data.code === 1) {
-            const { list } = res.data.data
-            if (this.page === 1) {
-              this.list = list
-            } else {
-              this.list = this.list.concat(list)
-            }
-            // for (var i in list) {
-            //   if (list[i].read == 0) {
-            //     ids.push(list[i].id)
-            //   }
-            // }
-            this.$refs.scroller.finishInfinite(res.data.data.list.length != 20) // 停止上滚加载下一页,由于服务器端没有统一空数据和正常数据的格式,所以通过total字段来判定数据是否存在下一页
-          } else {
-            this.$refs.scroller.finishInfinite(true)
-          }
-          // if (ids.length > 0) { this.read(ids) }
-        })
-        .finally(() => {
-          done()
-        })
-    },
-    onRefresh (done) {
-      let self = this
-      this.page = 1
-      this.get_list(done)
-    },
-    onInfinite (done) {
-      this.page++
-      this.get_list(done)
-    },
-    // 设置已读
-    read (ids) {
-      request('post', '/api/notice/read', { id: ids })
-    },
-    refresh (done) {
-      let self = this
-      setTimeout(() => {
-        this.filter.page = 1
-        this.get_list(function () {
-          self.list = []
-          done()
-        })
-      }, 100)
-    }
-  },
-  keep_alive_update: {
-    cancel_msg (vm, data) {
-      vm.db.cancel(data.id * 1, data.cancel_text)
-    }
-  }
-}
-</script>
-
-<style scoped>
-.body_com {
-  height: calc(100% - 0.92rem);
-  position: relative;
-}
-/deep/ .body_com .van-hairline--top-bottom:after {
-  border: none;
-}
-/deep/ .body_com .van-hairline-unset--top-bottom:after {
-  border: none;
-}
-.message-box {
-  padding: 0.32rem;
-}
-/deep/ .message-item-content {
-  color: #909399;
-  font-size: 0.28rem;
-  padding-top: 0.1rem;
-}
-/deep/ .message-item-content .van-cell__value--alone {
-  color: #909399;
-}
-/deep/ .message-item-title .van-cell__value {
-  font-weight: bold;
-}
-.message-item-title {
-  padding-bottom: 0rem;
-}
-.message-item {
-  margin-bottom: 0.32rem;
-}
-/deep/ .message-item .van-icon.van-icon-volume-o {
-  line-height: 0.5rem;
-  text-align: center;
-  border-radius: 0.5rem;
-  background-color: #26a2ff;
-  color: #fff;
-  width: 0.5rem;
-  height: 0.5rem;
-  margin-right: 0.16rem;
-}
-.message-item-source {
-  background-color: #fafafa;
-}
-.message-item-source:after {
-  border: none;
-}
-.message-item /deep/ .datetime {
-  color: #909399;
-  font-size: 0.28rem;
-}
-.labelFF9600 {
-  color: #ff9600;
-  background-color: rgba(255, 150, 0, 0.3);
-  border-radius: 0.08rem;
-  padding: 0.06rem;
-}
-.label4bd964 {
-  font-size: 0.28rem;
-  background-color: #ddf7e1;
-  border-radius: 0.06rem;
-  padding: 0.06rem;
-  color: #4bd964;
-}
-.labelf56c6c {
-  font-size: 0.28rem;
-  background-color: #fbe7e7;
-  border-radius: 0.06rem;
-  padding: 0.06rem;
-  color: #f56c6c;
-}
-.colorFF2D55 {
-  color: #ff2d55;
-  font-weight: bold;
-  font-size: 0.4rem;
-}
-.color4BD964 {
-  color: #4bd964;
-  font-weight: bold;
-  font-size: 0.4rem;
-}
-/deep/ .datetime {
-  color: #909399;
-}
-.cell-item__icon {
-  width: 0.4rem;
-  height: 0.4rem;
-}
-</style>

+ 1 - 1
src/components/pk/pk_ranking.vue

@@ -40,8 +40,8 @@
           </van-cell>
         </van-cell-group>
         <noData :list='list.ranking_employee' />
+        <div style="padding-bottom: 1.5rem;"></div>
       </scroller>
-    </div>
   </div>
 </template>
 <script>

+ 9 - 8
src/components/power/edit_user_power.vue

@@ -14,7 +14,7 @@
 
         <van-cell-group class="manager_box">
           <div title="什么是管理范围,请提供文案"></div>
-          <EmployeeSelectorCell title="管理范围" v-model="getscope" :employee_not_select="employee_not_select" :can_select_employee="true"></EmployeeSelectorCell>
+          <EmployeeSelectorCell title="管理范围" v-model="getscope" :selected_all="true" :employee_not_select="employee_not_select" :can_select_employee="true"></EmployeeSelectorCell>
         </van-cell-group>
 
         <van-cell-group class="manager_box">
@@ -341,14 +341,15 @@ export default {
           } else if (self.limit_list.reward_task_monthly[0].point === '') {
             self.$notify({type: 'danger', message: '月奖分任务不能为空'})
             return false
-          } else if (parseInt(self.limit_list.entry_limit) > 0 && (self.setting2_show || self.setting1_show)) {
-            for (let i = 0; i < self.limit_list.point_limit.length; i++) {
-              if (self.limit_list.point_limit[i].point > self.limit_list.entry_limit) {
-                self.$notify({type: 'danger', message: '月奖分上限不能低于AB分'})
-                return false
-              }
-            }
           }
+          // else if (parseInt(self.limit_list.entry_limit) > 0 && (self.setting2_show || self.setting1_show)) {
+          //   for (let i = 0; i < self.limit_list.point_limit.length; i++) {
+          //     if (Number(self.limit_list.point_limit[i].point) > self.limit_list.entry_limit) {
+          //       self.$notify({type: 'danger', message: '月奖分上限不能低于AB分'})
+          //       return false
+          //     }
+          //   }
+          // }
           self.showLoading()
           self.limit_list['employee_id'] = self.$route.query.id
           let data = JSON.parse(JSON.stringify(self.limit_list))

+ 3 - 3
src/components/task/compile_temp_task.vue

@@ -39,18 +39,18 @@
             </template>
           </van-cell>
 
-          <van-cell class="depts_cell" icon="eye-o" v-if="show_task_super_satisfied" title="可见范围" @click="show_task_super_satisfied_popup = true">
+          <van-cell class="depts_cell" icon="eye-o" v-if="show_task_super_satisfied" title="可见范围"  @click="show_task_super_satisfied_popup = true">
             <template slot="right-icon">
               <van-icon name="close" @click.stop="del_task_super_satisfied" />
             </template>
 
             <template slot="label">
               <div style="display: inline;" class="employee_cell_value" v-if="depts.length <= 2">
-                <span v-for="(item, index) in depts" :key="index"><em v-show="index > 0">,</em>{{item.dept_name}}</span>
+                <span v-for="(item, index) in depts" :key="index"><em v-show="index > 0">,</em><Wxopendata type="departmentName" :openid="item.dept_name"></Wxopendata></span>
               </div>
 
               <div style="display: inline;" class="employee_cell_value" v-if="depts.length > 2">
-                <span v-for="(item, index) in depts" v-if="index < 2" :key="index"><em v-show="index > 0">,</em>{{item.dept_name}}</span>
+                <span v-for="(item, index) in depts" v-if="index < 2" :key="index"><em v-show="index > 0">,</em><Wxopendata type="departmentName" :openid="item.dept_name"></Wxopendata></span>
                 等{{depts.length}}个
               </div>
             </template>

+ 3 - 3
src/components/task/my_publish.vue

@@ -27,7 +27,7 @@
           <div class="clear title">
             <userImage class="fl" :user_name="item.employee_name" :id="item.employee_id" width="0.72rem" height="0.72rem"  style="margin-right: 0.2rem"></userImage>
             <span><Wxopendata type="userName" :openid="item.employee_name"></Wxopendata>的{{item.pt_name}}任务</span>
-            <span v-if="item.point_config !== undefined && item.point_config.base_point !== undefined" class="fr" :class="{color_red:item.status == 4 && item.point_config.base_point > 0,color_green:item.status == 4 && item.point_config.base_point < 0}"><span v-show="item.point_config.base_point > 0">+</span>{{item.point_config.base_point}}</span>
+            <span v-if="item.point_config !== undefined && item.point_config.base_point !== undefined" class="fr" :class="{color_red:item.status == 4 && item.point_config.base_point > 0,color_green:item.status == 4 && item.point_config.base_point < 0}"><span v-show="item.point_config.base_point > 0">+</span>{{item.point_config.base_point}} {{$isPt_id(item.pt_id)}}</span>
           </div>
           <div style="padding-left: 0.72rem; margin-left: 0.2rem; font-size: 0.32rem">
             <div style="font-size: 0.32rem;color:#666 !important;">{{item.task_name}}</div>
@@ -49,7 +49,7 @@
             <userImage v-show="item.receiver_id == 0" class="fl" :img_url="item.owner_img_url" :user_name="item.owner_name" width="0.72rem" height="0.72rem"  style="margin-right: 0.2rem"></userImage>
             <span v-show="item.status == 2 || item.status == 3 || item.receiver_id !=0 && item.status == 4"><Wxopendata type="userName" :openid="item.receiver_name"></Wxopendata>的{{item.pt_name}}任务</span>
             <span v-show="item.status == 1 || item.status == -1 || item.receiver_id ==0 &&item.status == 4">我发布的{{item.pt_name}}任务</span>
-            <span class="fr" v-show="item.base_point !== undefined && item.status != 4" :class="{color_green:item.status == 3 && item.base_point*1 > 0,color_red:item.status == 3 && item.base_point*1 < 0}"><span v-show="item.base_point*1 > 0">+</span>{{item.base_point}}</span>
+            <span class="fr" v-show="item.base_point !== undefined && item.status != 4" :class="{color_green:item.status == 3 && item.base_point*1 > 0,color_red:item.status == 3 && item.base_point*1 < 0}"><span v-show="item.base_point*1 > 0">+</span>{{item.base_point}} {{$isPt_id(item.pt_id)}}</span>
           </div>
           <div style="padding-left: 0.72rem; margin-left: 0.2rem; font-size: 0.32rem">
             <div style="font-size: 0.28rem;color:#666;">{{item.task_name}}</div>
@@ -258,7 +258,7 @@ export default {
           self.screen_list[2].show = true
           self.screen_list[1].show = true
           self.screen_list[0].list = [{name: '全部', id: '0'}]
-          self.screen_list[0].list.push(...this.$store.getters.point_types)
+          self.screen_list[0].list.push(...this.$store.getters.point_types.filter(item => item.code != 'JX'))
           self.filter = {
             page: 1,
             status: 'all',

+ 3 - 3
src/components/task/my_task.vue

@@ -29,7 +29,7 @@
             <van-cell-group v-for="(item,index) in toList " :key="index" @click="detail(item)">
               <van-cell v-if="date == item.expire_time.slice(0,10)" class="task_list" :title="item.task_name">
                 <template slot="default">
-                  <span class="point">{{item.point_config.base_point}}</span>
+                  <span class="point">{{item.point_config.base_point}} {{$isPt_id(item.pt_id)}}</span>
                 </template>
                 <template slot="label">
                   <div class="clear" style="margin-top: 0.3rem">
@@ -55,7 +55,7 @@
             <van-cell-group v-for="(item,index) in laList " :key="index" @click="detail(item)">
               <van-cell v-if="date != item.expire_time.slice(0,10)" class="task_list" :title="item.task_name">
                 <template slot="default">
-                  <span class="point">{{item.point_config.base_point}}</span>
+                  <span class="point">{{item.point_config.base_point}} {{$isPt_id(item.pt_id)}}</span>
                 </template>
                 <template slot="label">
                   <div class="clear" style="margin-top: 0.3rem">
@@ -78,7 +78,7 @@
         <van-cell-group v-if="filter.status != 'running'">
           <van-cell v-for="(item,index) in list " :key="index" @click="detail(item)" class="task_list" :title="item.task_name">
             <template slot="default">
-              <span class="point">{{item.point_config.base_point}}</span>
+              <span class="point">{{item.point_config.base_point}} {{$isPt_id(item.pt_id)}}</span>
             </template>
             <template slot="label">
               <div class="clear" style="margin-top: 0.3rem">

+ 1 - 1
src/components/task/task_detail.vue

@@ -55,7 +55,7 @@
           <van-cell v-if="info.department_info.length > 0" title="可见范围" title-class="title color_ccc task_delayrecord" value-class="text-left">
             <template  slot="default">
                <span v-for="(items,index) in info.department_info" :key="index">
-                  {{items.name}}
+                 <Wxopendata type="departmentName" :openid="items.name"></Wxopendata>
                 </span>
             </template>
           </van-cell>

+ 2 - 2
src/components/task/task_hall.vue

@@ -15,7 +15,7 @@
                 <span class="title_one">{{item.task_name}}</span>
               </template>
               <template slot="right-icon">
-                <span style="font-size: 0.36rem; font-weight: bold;">{{item.base_point}}</span>
+                <span style="font-size: 0.36rem; font-weight: bold;">{{item.base_point}} {{$isPt_id(item.pt_id)}}</span>
               </template>
               <template slot="label">
                 <div class="clear" style="padding-top: 0.28rem;">
@@ -41,7 +41,7 @@
                 <div style="font-size: 0.36rem; font-weight: 400;"><Wxopendata type="userName" :openid="item.receiver_name"></Wxopendata>领取{{item.pt_name}}任务</div>
               </template>
               <template slot="right-icon">
-                <span style="font-size: 0.36rem; font-weight: bold;">{{item.base_point}}</span>
+                <span style="font-size: 0.36rem; font-weight: bold;">{{item.base_point}} {{$isPt_id(item.pt_id)}}</span>
               </template>
               <template slot="label">
                 <div class="clear" style="padding-top: 0.12rem;">

+ 2 - 2
src/components/task/temp_task.vue

@@ -63,11 +63,11 @@
 
             <template slot="label">
               <div style="display: inline;" class="employee_cell_value" v-if="depts.length <= 2">
-                <span v-for="(item, index) in depts" :key="index"><em v-show="index > 0">,</em>{{item.dept_name}}</span>
+                <span v-for="(item, index) in depts" :key="index"><em v-show="index > 0">,</em><Wxopendata type="departmentName" :openid="item.dept_name"></Wxopendata></span>
               </div>
 
               <div style="display: inline;" class="employee_cell_value" v-if="depts.length > 2">
-                <span v-for="(item, index) in depts" v-if="index < 2" :key="index"><em v-show="index > 0">,</em>{{item.dept_name}}</span>
+                <span v-for="(item, index) in depts" v-if="index < 2" :key="index"><em v-show="index > 0">,</em><Wxopendata type="departmentName" :openid="item.dept_name"></Wxopendata></span>
                 等{{depts.length}}个
               </div>
             </template>

+ 2 - 2
src/components/task/temp_task_edit.vue

@@ -63,11 +63,11 @@
 
             <template slot="label">
               <div style="display: inline;" class="employee_cell_value" v-if="depts.length <= 2">
-                <span v-for="(item, index) in depts" :key="index"><em v-show="index > 0">,</em>{{item.dept_name}}</span>
+                <span v-for="(item, index) in depts" :key="index"><em v-show="index > 0">,</em><Wxopendata type="departmentName" :openid="item.dept_name"></Wxopendata></span>
               </div>
 
               <div style="display: inline;" class="employee_cell_value" v-if="depts.length > 2">
-                <span v-for="(item, index) in depts" v-if="index < 2" :key="index"><em v-show="index > 0">,</em>{{item.dept_name}}</span>
+                <span v-for="(item, index) in depts" v-if="index < 2" :key="index"><em v-show="index > 0">,</em><Wxopendata type="departmentName" :openid="item.dept_name"></Wxopendata></span>
                 等{{depts.length}}个
               </div>
             </template>

+ 0 - 176
src/components/user/account.vue

@@ -1,176 +0,0 @@
-<template>
-  <div class="per-info__container">
-    <van-nav-bar title="个人信息" left-text="返回" @click-left="$route_back" left-arrow/>
-    <van-cell-group>
-      <van-cell title="头像" is-link>
-        <template solt="value">
-          <!-- <img @click.stop="onChangeAvatar" class="needsclick per-info__avatar" :src="user_info.img_url"/> -->
-          <vue-img-cropper
-            ref="cropper"
-            :height="400"
-            :width="400"
-            :maxScale="6"
-            :compressionRatio="0.5"
-            @cutImg="showCutImg"
-            @showLoading="showLoading"
-            @hideLoading="hideLoading"
-          >
-            <userImage  :img_url="account_info.img_url" width="0.5rem" height="0.5rem" :user_name="account_info.name" fontSize="0.2" ></userImage>
-          </vue-img-cropper>
-
-        </template>
-      </van-cell>
-      <van-cell title="姓名" :value="account_info.name" to="username_edit" is-link>
-        <template slot="value">
-          <span class="per-info__tel">{{ account_info.name }}</span>
-        </template>
-      </van-cell>
-      <van-cell title="手机号" is-link to="user_mobile">
-        <template slot="default">
-          <span class="per-info__tel">{{ account_info.tel | mobile }}</span>
-        </template>
-      </van-cell>
-    </van-cell-group>
-    <van-cell-group>
-      <van-cell title="修改密码"  to="change_pwd" is-link/>
-    </van-cell-group>
-    <van-cell-group>
-      <van-cell title="清理缓存" @click="clearCacheHandle"/>
-    </van-cell-group>
-    <van-cell-group>
-      <div class="login-out__button" @click="logoutHandle"><span>退出登录</span></div>
-    </van-cell-group>
-
-  </div>
-</template>
-
-<script>
-import Vue from 'vue'
-import {Cell, CellGroup, Image} from 'vant'
-import {removeToken} from '@/utils/auth'
-import request_user from '@/utils/request-user'
-import VueImgCropper from '@/components/common/vue-img-cropper'
-import userImage from '@/components/common/user_image'
-
-Vue.use(Cell).use(CellGroup).use(Image)
-
-export default {
-  name: 'personal_information',
-  filters: {
-    mobile (tel) {
-      if (tel) {
-        return tel == '' ? tel : tel.replace(tel.substring(3, 7), '****')
-      }
-      return ''
-    }
-  },
-  data () {
-    return {
-      account_info: this.$store.getters.account_info
-    }
-  },
-  components: {VueImgCropper, userImage},
-  computed: {
-    user_info () {
-      return this.$store.getters.user_info || {}
-    }
-  },
-  methods: {
-    showCutImg (d) {
-      this.sendAvatarRequest(d.url)
-    },
-    showLoading () {
-      this.$toast.loading({mask: true, message: '正在处理'})
-    },
-    hideLoading () {
-      this.$toast.clear()
-    },
-    onChangeAvatar () {
-      this.$refs.cropper.getImg()
-    },
-    sendAvatarRequest (url) {
-      const data = {name: this.$store.getters.user_info.name, img_url: url}
-      request_user('post', '/api/account/edit', data).then(response => {
-        if (response.status === 200 && response.data.code == 1) {
-          this.$store.getters.account_info.img_url = url
-          this.$toast.clear()
-          this.$toast('保存成功')
-        } else {
-        }
-      })
-    },
-    clearCacheHandle () {
-      this.$dialog.confirm({title: '清除缓存', message: '您确定要清除缓存吗?'}).then(() => {
-        this.$store.dispatch('clear_cache')
-        this.$toast('清除成功')
-      }).catch(() => null)
-    },
-    logoutHandle () {
-      this.$dialog.confirm({title: '退出登录', message: '您确定要退出吗?'}).then(() => {
-        this.$toast.loading({mask: true, message: '正在处理'})
-        request_user('post', '/api/logout', {type: 'app'}).then(res => {
-          this.$store.dispatch('setBuyPopup', false)
-          if (window.plus) {
-            plus.storage.removeItem('Admin-Token')
-            plus.storage.removeItem('a-token-temp')
-            plus.storage.removeItem('message_list_' + this.$store.getters.user_info.id)
-          } else {
-            localStorage.removeItem('a-token-temp')
-            localStorage.removeItem('Admin-Token')
-            localStorage.removeItem('message_list_' + this.$store.getters.user_info.id)
-          }
-		  localStorage.removeItem('refreshTime')
-          this.$store.dispatch('clear_cache')
-          this.$router.replace({name: 'login'})
-          this.$toast.clear()
-        })
-      }).catch(() => null)
-    }
-  }
-}
-</script>
-
-<style scoped lang="less">
-  .per-info__container {
-    /deep/ .van-nav-bar {
-      background-color: #26a2ff;
-    }
-
-    & /deep/ .van-icon-arrow {
-      font-size: 0.3rem;
-      color: #E4E7ED;
-    }
-
-    & .per-info__avatar {
-      position: absolute;
-      right: 0;
-      margin-top: -0.08rem;
-      width: 0.64rem;
-      height: 0.64rem;
-      object-fit: cover;
-      border-radius: 50%;
-      overflow: hidden;
-    }
-
-    & .per-info__tel {
-      color: #303133;
-      font-size: 0.32rem;
-    }
-
-    & .login-out__button {
-      position: relative;
-      display: flex;
-      box-sizing: border-box;
-      width: 100%;
-      padding: 0.2rem 0.32rem;
-      font-size: 0.32rem;
-      overflow: hidden;
-      color: #323233;
-      font-weight: 500;
-      line-height: 0.48rem;
-      background-color: #fff;
-      justify-content: center;
-      touch-action: none;
-    }
-  }
-</style>

+ 40 - 5
src/components/user/add_common_menu.vue

@@ -9,12 +9,13 @@
           </div>
           <van-cell @click="select(app)" :title="app.code" v-for="(app, app_index) in item.child" :key="app_index">
             <template slot="icon">
-              <van-checkbox v-model="app.checked"></van-checkbox>
+              <van-checkbox v-model="app.checked" :inserted="app.checked" :disabled="disabled9 && !app.checked" ></van-checkbox>
               <img class="app-icon" :src="app.icon"/>
             </template>
             <template slot="label">{{app.remark}}</template>
           </van-cell>
         </van-cell-group>
+        <div style="padding-bottom: .5rem;"></div>
       </scroller>
     </div>
   </div>
@@ -26,11 +27,14 @@ import request from '@/utils/request'
 
 Vue.use(Checkbox)
 Vue.use(CheckboxGroup)
+let num = 0;
 export default {
   name: 'add_common_menu',
   data () {
     return {
-      app_list: []
+      app_list: [],
+      num: 0,
+      disabled9: false,
     }
   },
   methods: {
@@ -44,13 +48,39 @@ export default {
       })
       return isTrue
     },
+    is_checked(){
+      num = 0
+      this.app_list.forEach((item)=>{
+        item.child.some(arr =>{
+          if(arr.checked){
+            num++
+            if(num > 10) return true
+          }
+        })
+      })
+      console.log(num)
+      if(num >= 9){
+        this.disabled9 = true
+      }else{
+        this.disabled9 = false
+      }
+    },
     select (item) {
+      console.log(item)
       if (item.checked) {
         item.checked = false
       } else {
-        item.checked = true
+        if(num < 9){
+          item.checked = true
+        }else{
+          this.$toast('常用应用最多9个')
+          return
+        }
+      }
+      this.is_checked()
+      if(num < 9){
+        this.$forceUpdate()
       }
-      this.$forceUpdate()
     },
     save () {
       let ret = [], item = []
@@ -62,6 +92,10 @@ export default {
           }
         }
       }
+      if(item.length > 9){
+        this.$toast('常用应用最多9个')
+        return
+      }
       var data = {id: this.$store.getters.user_info.id, menu_common: ret}
       request('POST', '/api/employee/menu', data).then((res) => {
         if (res.data.code == 1) {
@@ -74,7 +108,7 @@ export default {
           this.$route_back()
         }
       })
-    }
+    },
   },
   mounted () {
     var menu = window.plus ? JSON.parse(plus.storage.getItem('menu')) : JSON.parse(localStorage.getItem('menu'))
@@ -86,6 +120,7 @@ export default {
       }
     })
     this.app_list = menu
+    this.is_checked()
   }
 }
 </script>

+ 0 - 285
src/components/user/bind_weixin.vue

@@ -1,285 +0,0 @@
-<template>
-
-  <div class="login-box-parent">
-
-
-    <van-nav-bar title="绑定用户" left-text="返回" @click-left="$route_back" left-arrow>
-
-    </van-nav-bar>
-
-    <div class="login-box" style="background-color: #f5f5f5;">
-      <scroller>
-        <div style="height: 0.2rem;"></div>
-        <div class="login-form-box" style="background-color: #fff;">
-
-          <div class="setp1">
-
-
-            <van-cell-group>
-
-
-              <van-field
-                v-model="formData.mobile"
-                placeholder="请输入手机号"
-              />
-
-
-              <van-field
-                v-model="formData.code"
-                center
-                clearable
-                placeholder="请输入短信验证码"
-                :error-message="code_error"
-              >
-                <van-button
-                  style="border:none;font-size:0.28rem;color:#26A2FF!important;" :loading="sendMsgLoading" slot="button" size="small" plain  type="primary" @click="sendMsg"
-                  :disabled="sended">
-                  {{sendMsgText}}
-                </van-button>
-              </van-field>
-
-
-
-            </van-cell-group>
-
-
-          </div>
-
-
-          <div style="padding:0 0.32rem;">
-            <van-button :loading="reg_loading" size="large" @click="sendReg" type="info">确 定
-            </van-button>
-          </div>
-
-
-        </div>
-      </scroller>
-    </div>
-
-  </div>
-</template>
-
-<script>
-  import request from '@/utils/request'
-
-  export default {
-    name: 'bind_weixin',
-    filters: {
-      mobile (tel) {
-        return tel==''?tel:tel.replace(tel.substring(3, 7), '****')
-      }
-    },
-    data () {
-      return {
-        next_loading: false,
-        reg_loading: false,
-        username_error: '',
-        code_error: '',
-        mobile_error: '',
-        mobile_success: '',
-        complite_btn_enable: false,
-        login_error: false,
-        login_error_msg: '',
-        next_btn_enable: false,
-        userinfo: this.$store.getters.user_info,
-        setp: 1,
-        countdown: 90,
-        sended: false,
-        sendMsgText: '获取验证码',
-        sendMsgLoading: false,
-        formData: {
-          username: '',
-          password: '',
-          password_check: '',
-          code: '',
-          aff_code: '',
-          user_name: '',
-          mobile: ''
-        }
-      }
-    },
-    created () {
-      this.formData.aff_code = this.$route.query.aff_code
-    },
-    watch: {
-      'formData': {
-        handler (val, oldVal) {
-          let self = this
-          if (val.username != '' && val.code != '') {
-            self.next_btn_enable = true
-          } else {
-            self.next_btn_enable = false
-          }
-
-          if (!self.checkMobile(val.username)) {
-            self.mobile_error = '手机号格式错误'
-            self.mobile_success = ''
-          } else {
-            self.mobile_error = ''
-            self.mobile_success = 'success'
-          }
-
-          if (val.password != '' && val.password_check != '') {
-            self.complite_btn_enable = true
-          } else {
-            self.complite_btn_enable = false
-          }
-        },
-        deep: true
-      }
-    },
-    methods: {
-      show_error (msg) {
-        let self = this
-        self.login_error = true
-        setTimeout(function () {
-          self.login_error = false
-        }, 3000)
-        self.login_error_msg = msg
-      },
-      nextReg () {
-        let self = this
-        self.next_loading = true
-        this.$store.dispatch('check_code', {mobile: self.formData.username, captcha: self.formData.code}).then(res => {
-          self.next_loading = false
-          if (res.code == 1) {
-            self.setp++
-            self.sendReg()
-          } else {
-            //self.code_error = res.msg
-            //self.show_error(res.msg)
-            self.$notify({
-              message: res.msg,
-              duration: 1000,
-              background: '#f44'
-            })
-          }
-        })
-      },
-      countDownInit () {
-        let self = this
-        self.sendMsgText = '已发送(' + self.countdown + ')'
-        if (self.countdown == 0) {
-          self.countdown = 90
-          self.sendMsgText = '重新发送'
-          self.sended = false
-          return false
-        } else {
-          setTimeout(function () {
-            self.countdown--
-            self.countDownInit()
-          }, 1000)
-        }
-      },
-
-      sendLogin () {
-        let self = this
-        self.$toast.loading({
-          mask: true,
-          message: '正在登录...'
-        })
-        this.$store.dispatch('login', {account: self.formData.username, password: self.formData.password}).then(res => {
-          self.$toast.clear()
-          if (res.code == 0) {
-            self.$notify({
-              message: res.msg,
-              duration: 1000,
-              background: '#f44'
-            })
-          } else {
-            self.$router.push({name: 'home'})
-          }
-        })
-      },
-      sendReg () {
-        let self = this
-        if(!this.checkMobile(self.formData.mobile)){
-          self.$toast('请输入正确的手机号')
-          return false;
-        }
-        if(self.formData.code == ''){
-          self.$toast('请输入验证码!')
-          return false
-        }
-
-        self.reg_loading = true
-        let bind_token = localStorage.getItem('bind_token_weixin')
-        request( 'post','/api/login/sms',{bind_token: bind_token, tel: self.formData.mobile, verify: self.formData.code, type: 4}).then((res) => {
-          self.reg_loading = false
-          if (res.data.code == 1) {
-            self.$toast(res.data.msg)//登录成功了
-            localStorage.setItem('a-token-temp', res.data.data.token)
-            if(res.data.data.account_site.length > 0){
-              self.$router.push({name: 'login_company_list'})
-            }else{
-              //选择公司
-              self.$router.push({name: 'create_company'})
-            }
-          } else {
-            self.$toast(res.data.msg)
-          }
-        })
-      },
-
-      checkMobile (sMobile) {
-        if (!(/^1\d{10}$/.test(sMobile))) {
-          return false
-        } else {
-          return true
-        }
-      },
-
-      sendMsg () {
-        let self = this
-        if(!this.checkMobile(self.formData.mobile)){
-          self.$toast('请输入正确的手机号')
-          return false;
-        }
-        self.sendMsgLoading = true
-        request( 'post','/api/send/login_sms',{ mobile: self.formData.mobile,}).then((res) => {
-          if (res.data.code == 1) {
-            self.sended = true
-            self.sendMsgLoading = false
-            self.countDownInit()
-            self.$toast('已经发送,请注意查收!')
-          } else {
-            self.sendMsgLoading = false
-            self.$toast(res.data.msg)
-
-          }
-        })
-      }
-    }
-  }
-</script>
-
-<style rel="stylesheet/scss" lang="scss" scoped>
-
-  .login-box {
-    height: calc(100% - 0.92rem);
-    position: relative;
-  }
-
-  .login-box-parent .van-field__icon .van-icon {
-    color: #4b0;
-
-  }
-
-  .login-logo {
-    width: 6.52rem;
-    margin: 0 auto;
-    display: block !important;
-    height: 3.5rem;
-  }
-
-  .setp1, .setp2 {
-    padding-bottom: 0.36rem;
-  }
-
-  .login-box-parent .mint-cell.cell-last:before {
-
-    bottom: 0;
-
-  }
-
-</style>

+ 0 - 303
src/components/user/change_phone.vue

@@ -1,303 +0,0 @@
-<template>
-  <div class="login-box-parent">
-    <van-nav-bar title="修改手机号" left-text="返回" @click-left="$route_back" left-arrow></van-nav-bar>
-
-    <div class="login-box" style="background-color: #f5f5f5;">
-      <scroller>
-        <div class="login-form-box" style="background-color: #fff;">
-          <div class="setp1">
-            <van-cell-group>
-              <van-cell title="手机号" v-show="account_info.tel != '' && setp == 1">{{ account_info.tel | mobile }}</van-cell>
-              <van-field v-show="setp == 1" v-model="formData.origin_verify" center clearable label="验证码" placeholder="请输入短信验证码" :error-message="code_error">
-                <van-button style="border:none;font-size:0.28rem;" :loading="sendMsgLoading" slot="button" size="small" plain type="info" @click="sendMsg" :disabled="sended">
-                  {{ sendMsgText }}
-                </van-button>
-              </van-field>
-
-              <van-field v-show="setp == 2" v-model="formData.tel" label="新手机号" type="digit" :maxlength="13" placeholder="请输入手机号" />
-              <van-field
-                class="message_code"
-                v-show="setp == 2"
-                v-model="formData.verify"
-                center
-                clearable
-                label="验证码"
-                :maxlength="6"
-                placeholder="请输入短信验证码"
-                :error-message="code_error"
-              >
-                <van-button :loading="sendMsgLoading" slot="button" size="small" type="info" @click="sendMsg" :disabled="sended">{{ sendMsgText }}</van-button>
-              </van-field>
-            </van-cell-group>
-          </div>
-
-          <div style="padding:0 0.32rem 0.2rem;">
-            <van-button v-show="setp == 1" :loading="reg_loading" size="large" @click="nextReg" type="info">下一步</van-button>
-
-            <van-button v-show="setp == 2" :loading="reg_loading" size="large" @click="sendReg" type="info">确定更换</van-button>
-          </div>
-        </div>
-      </scroller>
-    </div>
-  </div>
-</template>
-
-<script>
-import request_user from '@/utils/request-user'
-
-export default {
-  name: 'change_pwd',
-  filters: {
-    mobile (tel) {
-      if (tel) {
-        return tel == '' ? tel : tel.replace(tel.substring(3, 7), '****')
-      }
-      return ''
-    }
-  },
-  data () {
-    return {
-      countdownSet: null,
-      next_loading: false,
-      reg_loading: false,
-      username_error: '',
-      code_error: '',
-      mobile_error: '',
-      mobile_success: '',
-      complite_btn_enable: false,
-      login_error: false,
-      login_error_msg: '',
-      next_btn_enable: false,
-      userinfo: this.$store.getters.user_info,
-      account_info: this.$store.getters.account_info,
-      setp: 1,
-      countdown: 90,
-      sended: false,
-      sendMsgText: '获取验证码',
-      sendMsgLoading: false,
-      formData: {
-        verify: '',
-        origin_verify: '',
-        tel: ''
-      }
-    }
-  },
-  created () {
-    this.formData.aff_code = this.$route.query.aff_code
-  },
-  watch: {
-    formData: {
-      handler (val, oldVal) {
-        let self = this
-        if (val.username != '' && val.code != '') {
-          self.next_btn_enable = true
-        } else {
-          self.next_btn_enable = false
-        }
-
-        if (!self.checkMobile(val.username)) {
-          self.mobile_error = '手机号格式错误'
-          self.mobile_success = ''
-        } else {
-          self.mobile_error = ''
-          self.mobile_success = 'success'
-        }
-
-        if (val.password != '' && val.password_check != '') {
-          self.complite_btn_enable = true
-        } else {
-          self.complite_btn_enable = false
-        }
-      },
-      deep: true
-    }
-  },
-  methods: {
-    show_error (msg) {
-      let self = this
-      self.login_error = true
-      setTimeout(function () {
-        self.login_error = false
-      }, 3000)
-      self.login_error_msg = msg
-    },
-    nextReg () {
-      let self = this
-      self.next_loading = true
-
-      request_user('post', '/api/verify/check', { type: 3, tel: this.account_info.tel, verify: self.formData.origin_verify }).then(res => {
-        self.next_loading = false
-        if (res.data.code == 1) {
-          self.countdown = 0
-          clearTimeout(self.countdownSet)
-          setTimeout(() => {
-            self.sendMsgText = '获取验证码'
-            self.sended = false
-            self.countdown = 90
-          }, 1000)
-          self.setp++
-        } else {
-          self.$notify({
-            message: res.data.msg,
-            duration: 1000,
-            background: '#f44'
-          })
-        }
-      })
-    },
-    countDownInit () {
-      let self = this
-      self.sendMsgText = '已发送(' + self.countdown + ')'
-      if (self.countdown == 0) {
-        self.countdown = 90
-        self.sendMsgText = '重新发送'
-        self.sended = false
-        return false
-      } else {
-        self.countdownSet = setTimeout(function () {
-          self.countdown--
-          self.countDownInit()
-        }, 1000)
-      }
-    },
-
-    sendLogin () {
-      let self = this
-      self.$toast.loading({
-        mask: true,
-        message: '正在登录...'
-      })
-      this.$store.dispatch('login', { account: self.formData.username, password: self.formData.password }).then(res => {
-        self.$toast.clear()
-        if (res.code == 0) {
-          self.$notify({
-            message: res.msg,
-            duration: 1000,
-            background: '#f44'
-          })
-        } else {
-          self.$router.push({ name: 'home' })
-        }
-      })
-    },
-
-    sendReg () {
-      let self = this
-      if (self.formData.code == '') {
-        self.$toast('请输入验证码!')
-        return false
-      }
-      let url = ''
-      let data = null
-
-      url = '/api/account/replace'
-      data = {
-        type: 'mobile',
-        tel: self.formData.tel,
-        verify: self.formData.verify,
-        origin_verify: self.formData.origin_verify
-      }
-      if (!this.checkMobile(self.formData.tel)) {
-        self.$toast('请输入正确的手机号')
-        return false
-      }
-
-      self.reg_loading = true
-      request_user('post', url, data).then(res => {
-        self.reg_loading = false
-        if (res.data.code == 1) {
-          self.$toast(res.data.msg)
-          if (window.plus) {
-            plus.storage.removeItem('account_info')
-          } else {
-            localStorage.removeItem('account_info')
-          }
-
-          if (window.plus) {
-            let all_view = plus.webview.all()
-            for (let i = 0; i < all_view.length; i++) {
-              all_view[i].evalJS('window.VueObj.$store.dispatch("get_account_info").then(function(){window.VueObj.$forceUpdate();});')
-            }
-          } else {
-            self.$store.dispatch('get_account_info')
-          }
-          self.$route_back()
-        } else {
-          self.$toast(res.data.msg)
-        }
-      })
-    },
-
-    checkMobile (sMobile) {
-      if (!/^1[0123456789]\d{9}$/.test(sMobile)) {
-        return false
-      } else {
-        return true
-      }
-    },
-
-    sendMsg () {
-      let self = this
-      self.sendMsgLoading = true
-      let data = null
-      if (self.setp == 1) {
-        data = { mobile: self.account_info.tel, type: 3 }
-      } else {
-        data = { mobile: self.formData.tel, type: 1 }
-      }
-      if (!this.verifyPhoneNo(data.mobile)) {
-        self.$notify({
-          message: '请输入正确手机号码',
-          duration: 1000,
-          background: '#f44'
-        })
-        self.sendMsgLoading = false
-        return false
-      }
-      request_user('post', '/api/send-sms', data).then(res => {
-        if (res.data.code == 1) {
-          self.sended = true
-          self.countDownInit()
-          self.$toast('已经发送,请注意查收!')
-        } else {
-          self.$toast(res.data.msg)
-        }
-      }).finally(() => {
-        self.sendMsgLoading = false
-      })
-    },
-    verifyPhoneNo (value) {
-      return /^1[123456789]\d{9}$/.test(value)
-    }
-  }
-}
-</script>
-
-<style rel="stylesheet/scss" lang="scss" scoped>
-.login-box {
-  height: calc(100% - 0.92rem);
-  position: relative;
-}
-.login-box-parent .van-field__icon .van-icon {
-  color: #4b0;
-}
-.login-logo {
-  width: 6.52rem;
-  margin: 0 auto;
-  display: block !important;
-  height: 3.5rem;
-}
-.setp1,
-.setp2 {
-  padding-bottom: 0.36rem;
-}
-.login-box-parent .mint-cell.cell-last:before {
-  bottom: 0;
-}
-.login-box-parent /deep/ .login-form-box {
-  background: transparent !important;
-}
-.login-box-parent .message_code /deep/ .van-field__button {
-  border: none;
-}
-</style>

+ 0 - 289
src/components/user/change_pwd.vue

@@ -1,289 +0,0 @@
-<template>
-  <div class="login-box-parent">
-    <van-nav-bar title="修改密码" left-text="返回" @click-left="$route_back" left-arrow></van-nav-bar>
-
-    <div class="login-box" style="background-color: #f5f5f5;">
-      <scroller>
-        <div class="login-form-box" style="background-color: #fff;">
-          <div class="setp1">
-            <van-cell-group>
-              <van-field
-                v-model="formData.old_password"
-                label="旧密码"
-                placeholder="输入旧密码"
-                maxlength="20"
-                name="旧密码"
-                required
-                v-validate="'required|min:6'"
-                type="password"
-              ></van-field>
-              <van-field
-                label="新密码"
-                name="新密码"
-                type="password"
-                v-model="formData.password"
-                maxlength="20"
-                required
-                v-validate="'required|min:6'"
-                placeholder="请输入新密码(6至20位字符)"
-              ></van-field>
-              <van-field
-                label="确认密码"
-                type="password"
-                v-model="formData.password_confirmation"
-                placeholder="请再次输入新密码"
-                maxlength="20"
-                required
-              ></van-field>
-            </van-cell-group>
-          </div>
-
-          <van-button
-            class="confirm_button"
-            :loading="reg_loading"
-            size="large"
-            @click="edit_password"
-            type="info"
-          >确 定</van-button>
-        </div>
-      </scroller>
-    </div>
-  </div>
-</template>
-
-<script>
-import request_user from "@/utils/request-user";
-import { removeToken } from '@/utils/auth'
-export default {
-  name: "change_pwd",
-  filters: {
-    mobile(tel) {
-      if (tel) {
-        return tel == "" ? tel : tel.replace(tel.substring(3, 7), "****");
-      }
-      return "";
-    }
-  },
-  data() {
-    return {
-      next_loading: false,
-      reg_loading: false,
-      username_error: "",
-      code_error: "",
-      mobile_error: "",
-      mobile_success: "",
-      complite_btn_enable: false,
-      login_error: false,
-      login_error_msg: "",
-      next_btn_enable: false,
-      userinfo: this.$store.getters.user_info,
-      setp: 1,
-      countdown: 90,
-      sended: false,
-      sendMsgText: "获取验证码",
-      sendMsgLoading: false,
-      formData: {
-        old_password: "",
-        password: "",
-        password_confirmation: ""
-      }
-    };
-  },
-  created() {
-    this.formData.aff_code = this.$route.query.aff_code;
-  },
-  watch: {
-    formData: {
-      handler(val, oldVal) {
-        let self = this;
-        if (val.username != "" && val.code != "") {
-          self.next_btn_enable = true;
-        } else {
-          self.next_btn_enable = false;
-        }
-
-        if (!self.checkMobile(val.username)) {
-          self.mobile_error = "手机号格式错误";
-          self.mobile_success = "";
-        } else {
-          self.mobile_error = "";
-          self.mobile_success = "success";
-        }
-
-        if (val.password != "" && val.password_check != "") {
-          self.complite_btn_enable = true;
-        } else {
-          self.complite_btn_enable = false;
-        }
-      },
-      deep: true
-    }
-  },
-  methods: {
-    show_error(msg) {
-      let self = this;
-      self.login_error = true;
-      setTimeout(function() {
-        self.login_error = false;
-      }, 3000);
-      self.login_error_msg = msg;
-    },
-    nextReg() {
-      let self = this;
-      self.next_loading = true;
-      this.$store
-        .dispatch("check_code", {
-          mobile: self.formData.username,
-          captcha: self.formData.code
-        })
-        .then(res => {
-          self.next_loading = false;
-          if (res.code == 1) {
-            self.setp++;
-            self.sendReg();
-          } else {
-            self.$notify({
-              message: res.msg,
-              duration: 1000,
-              background: "#f44"
-            });
-          }
-        });
-    },
-    countDownInit() {
-      let self = this;
-      self.sendMsgText = "已发送(" + self.countdown + ")";
-      if (self.countdown == 0) {
-        self.countdown = 90;
-        self.sendMsgText = "重新发送";
-        self.sended = false;
-        return false;
-      } else {
-        setTimeout(function() {
-          self.countdown--;
-          self.countDownInit();
-        }, 1000);
-      }
-    },
-
-    sendLogin() {
-      let self = this;
-      self.$toast.loading({
-        mask: true,
-        message: "正在登录..."
-      });
-      this.$store
-        .dispatch("login", {
-          account: self.formData.username,
-          password: self.formData.password
-        })
-        .then(res => {
-          self.$toast.clear();
-          if (res.code == 0) {
-            self.$notify({
-              message: res.msg,
-              duration: 1000,
-              background: "#f44"
-            });
-          } else {
-            self.$router.push({ name: "home" });
-          }
-        });
-    },
-
-    sendReg() {
-      let self = this;
-      self.reg_loading = true;
-      request_user("post","/api/account/reset",self.formData).then(res => {
-        self.reg_loading = false;
-        if (res.data.code == 1) {
-          self.$toast(res.data.msg);
-          setTimeout(() => {
-            if (window.plus) {
-              plus.storage.removeItem('user_info')
-            } else {
-              localStorage.removeItem('user_info')
-            }
-            self.$store.dispatch('clear_cache')
-            removeToken()
-            self.$router.push({name: 'login'})
-          }, 500);
-        } else {
-          self.$toast(res.data.msg);
-        }
-      });
-    },
-
-    edit_password(){
-      let self = this
-      self.$validator.validate().then(result => {
-        if (!result) {
-          self.$notify({ type: 'danger', message: self.$validator.errors.items[0].msg });
-        } else if(self.formData.password != self.formData.password_confirmation){
-          self.$notify({ type: 'danger', message: "两次输入的密码不一致!" });
-        }else{
-          self.sendReg()
-        }
-      })
-    },
-
-
-    checkMobile(sMobile) {
-      if (!/^1\d{10}$/.test(sMobile)) {
-        return false;
-      } else {
-        return true;
-      }
-    },
-
-    sendMsg() {
-      let self = this;
-      self.sendMsgLoading = true;
-      request_user('get',"/api/sms/send",{mobile: self.userinfo.mobile,event: "resetpwd"}).then(res => {
-          if (res.data.code == 0) {
-            self.sendMsgLoading = false;
-
-            self.$toast(res.data.msg);
-          } else {
-            self.sended = true;
-            self.sendMsgLoading = false;
-            self.countDownInit();
-            self.$toast("已经发送,请注意查收!");
-          }
-        });
-    }
-  }
-};
-</script>
-
-<style rel="stylesheet/scss" lang="scss" scoped>
-.login-box {
-  height: calc(100% - 0.92rem);
-  position: relative;
-}
-.login-box-parent .van-field__icon .van-icon {
-  color: #4b0;
-}
-.login-logo {
-  width: 6.52rem;
-  margin: 0 auto;
-  display: block !important;
-  height: 3.5rem;
-}
-.setp1,
-.setp2 {
-  padding-bottom: 0.36rem;
-}
-.login-box-parent .mint-cell.cell-last:before {
-  bottom: 0;
-}
-.login-box-parent /deep/ .login-form-box {
-  background: transparent !important;
-}
-.login-box-parent .confirm_button {
-  position: relative;
-  left: 0.32rem;
-  width: calc(100vw - 0.64rem);
-  margin: 0 auto;
-}
-</style>

+ 0 - 377
src/components/user/change_role.vue

@@ -1,377 +0,0 @@
-<template>
-  <div class="login-box-parent" style="background-color:#fff;">
-    <van-popup style="width:5rem;border-radius: 0.08rem;" v-model="invite_list_show" :close-on-click-overlay="false">
-      <van-cell-group style="margin-top:0;">
-        <van-cell is-link @click="go_invite(item)" v-for="(item, index) in invite_list" :key="index"
-                  :title="item.site.name" label="邀请你加入"/>
-      </van-cell-group>
-
-      <van-button @click="invite_close" size="large">关闭</van-button>
-    </van-popup>
-    <invite_newbusiness v-show="invite_show" @close="invite_close" :data.sync="invite_data"></invite_newbusiness>
-
-    <van-nav-bar title="体验功道云" v-show="normal_show" left-text="返回" @click-left="$route_back" left-arrow></van-nav-bar>
-    <!--  right-text="邀请" @click-right="set_invite_show" -->
-    <div class="login-box" v-show="normal_show">
-      <scroller>
-<!--        <div style="height:0.32rem"></div>
-        <div class="site_box">
-          <h4>选择行业</h4>
-          <van-radio-group v-model="role_two" direction="horizontal">
-            <van-radio :name="item.id" v-for="(item, index) in site_list" :key="index">
-              <img :src="item.logo_url" v-if="item.logo_url"/>
-              <span v-else style="width: 2rem;height: 1.2rem;display: block;border-radius: 0.08rem;"></span>
-              <span class="radio_text">{{item.name}}</span></van-radio>
-          </van-radio-group>
-        </div> -->
-        <div class="role_box">
-          <h4>选择身份</h4>
-          <van-radio-group v-model="role" direction="horizontal">
-            <van-radio :name="item.name" v-for="(item, index) in role_list" :key="index" v-if="item.name == 'creator'">
-              <img src="static/images/boss.jpg"/>
-              <span style="padding-top: 8px;padding-left: 52px;background:none;color:#333;text-shadow:none;" class="radio_text">创始人</span>
-            </van-radio>
-
-            <van-radio :name="item.name" v-for="(item, index) in role_list" :key="index"   v-if="item.name == 'dept_manager'">
-              <img src="static/images/manager.jpg"/>
-              <span style="padding-top: 8px;padding-left: 62px;background:none;color:#333;text-shadow:none;" class="radio_text">主管</span>
-            </van-radio>
-
-            <van-radio :name="'employee'">
-              <img src="static/images/Staff.jpg"/>
-              <span style="padding-top: 8px;padding-left: 62px;background:none;color:#333;text-shadow:none;" class="radio_text">员工</span>
-            </van-radio>
-          </van-radio-group>
-        </div>
-<!--        <div class="role_box">
-          <h4>【使用前必读】三分钟了解“功道云”</h4>
-          <div @click="$router.push({name:'guide', query: {init:false}})">
-            <img style="width: 100%;height: 100%;" src="static/images/san.jpg">
-          </div>
-        </div> -->
-
-        <div style="padding:0.32rem;" class="confirm_box">
-          <div style="height: 0.32rem;font-size: 0.28rem;color: rgb(191, 191, 191);margin-bottom:0rem;text-align: center;">体验账号将会定期清理数据,请勿上传重要文件!</div>
-          <div style="padding:0.32rem;">
-            <van-button class="login_button" @click="login" size="large"
-                        type="info">确认切换
-            </van-button>
-          </div>
-        </div>
-
-      </scroller>
-
-    </div>
-
-  </div>
-
-</template>
-
-<script>
-import {setToken} from '@/utils/auth'
-import Vue from 'vue'
-import invite_newbusiness from '@/components/ems/invite_newbusiness'
-import {RadioGroup, Radio, Popup} from 'vant'
-import request_user from '@/utils/request-user'
-
-Vue.use(Radio)
-Vue.use(RadioGroup)
-Vue.use(Popup)
-
-export default {
-  components: {invite_newbusiness},
-  data () {
-    return {
-      role: 1,
-      role_two: 0,
-      invite_show: false,
-      normal_show: false,
-      invite_list: [],
-      invite_list_show: false,
-      invite_data: {},
-      role_list: [],
-      site_list: []
-    }
-  },
-  created () {
-    if (this.$route.query.invite) {
-      this.get_invite()
-    } else {
-      this.normal_show = true
-    }
-    this.get_try_list()
-  },
-  methods: {
-    go_invite (data) {
-      this.invite_data = data
-      this.invite_list_show = false
-      this.normal_show = false
-      this.invite_show = true
-      plus.navigator.setStatusBarStyle('light')
-      document.documentElement.style.backgroundColor = '#fff'
-    },
-    set_invite_show () {
-      if (this.invite_list.length == 1) {
-        this.invite_show = true
-        this.normal_show = false
-        this.invite_data = this.invite_list[0]
-        plus.navigator.setStatusBarStyle('light')
-      } else if (this.invite_list.length > 1) {
-        this.invite_show = false
-        this.normal_show = true
-        this.invite_list_show = true
-        plus.navigator.setStatusBarStyle('dark')
-      }
-    },
-    invite_close () {
-      this.invite_show = false
-      this.normal_show = true
-      this.invite_list_show = false
-      plus.navigator.setStatusBarStyle('dark')
-    },
-
-    get_try_list () {
-      let self = this
-      self.$toast.loading({
-        mask: false,
-        message: '正在加载'
-      })
-      request_user('get', '/api/try/index').then(res => {
-        self.$toast.clear()
-        if (res.data.code == 1) {
-          var site = res.data.data.site_list
-          // site.push({
-          //   'id': 0,
-          //   'name': '其他',
-          //   'industry': '',
-          //   'logo_url': ''
-          // })
-          self.site_list = site
-          self.role_list = res.data.data.role_list
-          for (let i in res.data.data.role_list) {
-            if (res.data.data.role_list[i].name == this.$store.getters.user_info.employee_detail.role_list[0].name) {
-              self.role = res.data.data.role_list[i].name
-            }
-          }
-          for (let i in res.data.data.site_list) {
-            if (i == 0) {
-              self.role_two = res.data.data.site_list[i].id
-            }
-          }
-        } else {
-          self.$toast(res.data.msg)
-        }
-      })
-    },
-
-    // 获取邀请详情
-    get_invite () {
-      let self = this
-      self.$toast.loading({
-        mask: false,
-        message: '正在加载'
-      })
-      request_user('get', '/api/invite/waiting').then(res => {
-        self.$toast.clear()
-        if (res.data.code == 1) {
-          self.invite_list = res.data.data
-          self.set_invite_show()
-        } else {
-          self.$toast(res.data.msg)
-        }
-      })
-    },
-    login () {
-      let self = this
-      var num = self.role_two == 0 ? 113 : self.role_two
-
-      request_user('get', '/api/try/employees', {site_id: num}).then(res => {
-        if (res.data.code == 1) {
-          let login_index = ''
-          for (let i in res.data.data) {
-            let role_list = res.data.data[i].role_list
-            for (let j in role_list) {
-              if (self.role == role_list[j].name) {
-                login_index = i
-              }
-            }
-          }
-          if (login_index != '') {
-            setToken(res.data.data[login_index].token)
-            if (window.plus) {
-              plus.storage.removeItem('user_info')
-            } else {
-              localStorage.removeItem('user_info')
-            }
-            setTimeout(() => { window.location.href = window.location.href.split('#')[0] }, 100)
-            self.$router.push({name: 'home'})
-          } else {
-            self.$toast('体验登录失败')
-          }
-          // 得到员工的token,把token存好,然后就登录了
-        } else {
-          self.$toast(res.data.msg)
-        }
-      })
-    }
-  }
-}
-</script>
-
-<style scoped lang="less">
-  .login-box-parent {
-
-  }
-  .login-box-parent .login-box /deep/ ._v-container ._v-content{
-    height:100% !important;
-  }
-  .login-box {
-    height: calc(100% - 0.92rem);
-    position: relative;
-  }
-
-  .login-box .identity {
-    display: block;
-    text-align: left;
-    position: relative;
-    top: 0.12rem;
-    padding: 0 0.32rem;
-  }
-
-  .login-box .identity .title {
-    display: block;
-    text-align: left;
-    color: #606266;
-    font-size: 0.36rem;
-    line-height: 0.5rem;
-    padding: 0 0 0.16rem 0;
-    letter-spacing: 0.01rem;
-  }
-
-  .login-box .identity .imgbox {
-    display: inline-block;
-    vertical-align: top;
-    width: calc(96% / 3);
-    margin-bottom: 0.24rem;
-    height: 1.5rem;
-  }
-
-  .login-box .identity span {
-    display: inline-block;
-    padding: 0.16rem;
-    width: 100%;
-    color: #FFF;
-    font-size: 0.36rem;
-    font-weight: bold;
-  }
-
-  .imgbox span {
-    text-shadow: 2px 2px 1px #333;
-  }
-
-  .login-box .identity .van-icon {
-    display: block;
-    text-align: right;
-    width: 0.32rem;
-    height: 0.32rem;
-    font-size: 0.32rem;
-    line-height: 0.32rem;
-  }
-
-  .login-box .identity .van-radio {
-    display: inline-block;
-    text-align: right;
-    margin-top: 0.26rem;
-    margin-right: 0.16rem;
-    float: right;
-  }
-
-  .login-box .industry {
-    display: block;
-    text-align: left;
-    position: relative;
-    top: 0rem;
-    margin-top: 0.2rem;
-    padding: 0 0.32rem;
-  }
-
-  .login-box .industry .title {
-    display: block;
-    text-align: left;
-    color: #606266;
-    font-size: 0.36rem;
-    line-height: 0.5rem;
-    padding: 0 0 0.16rem 0;
-    letter-spacing: 0.01rem;
-  }
-
-  .login-box .industry .imgbox {
-    display: inline-block;
-    vertical-align: top;
-    width: calc(96% / 3);
-    margin-bottom: 0.24rem;
-    height: 1.5rem;
-  }
-
-  .login-box .industry span {
-    display: inline-block;
-    padding: 0.16rem;
-    width: 100%;
-    color: #FFF;
-    font-size: 0.36rem;
-    font-weight: bold;
-  }
-
-  .login-box .industry .van-icon {
-    display: block;
-    text-align: right;
-    width: 0.32rem;
-    height: 0.32rem;
-    font-size: 0.32rem;
-    line-height: 0.32rem;
-  }
-
-  .login-box .industry .van-radio {
-    display: inline-block;
-    text-align: right;
-    margin-top: 0.26rem;
-    margin-right: 0.16rem;
-    float: right;
-  }
-
-  .role_box {
-    padding: 0 0.32rem;
-  }
-
-  .site_box {
-    padding: 0 0.32rem;
-  }
-
-  .site_box h4, .role_box h4 {
-    margin-top: 0.16rem;
-  }
-
-  .role_box .van-radio--horizontal {
-    margin-bottom: 0.32rem;
-    margin-right: 0.5rem;
-  }
-
-  .site_box .van-radio--horizontal {
-    margin-bottom: 0.32rem;
-    margin-right: 0.5rem;
-  }
-  .radio_text{position: absolute; top:0rem; left:0rem; bottom:0; right:0; background-color: rgba(0,0,0,0.3); line-height: 1.5; padding:0.14rem 0 0 0.14rem;text-shadow:0 0.1rem 0.1rem rgba(51,51,51,0.8)}
-  /deep/ .van-radio__label{margin:0; position: relative; color:#fff; font-size: 0.32rem;}
-  /deep/ .van-radio__label img{width:2rem; vertical-align: top;border-radius:0.08rem;}
-  /deep/ .van-radio__icon--round{position: absolute;z-index: 1;bottom: 0rem;opacity: 0;right: 0rem;width: 2rem;height:1.2rem;background:transparent;}
-  /deep/ .van-radio__icon--round.van-radio__icon--checked{opacity: 1;box-shadow: 1px 1px 4px 1px rgba(25,137,250,0.4);}
-  /deep/ .site_box .van-radio--horizontal,.role_box .van-radio--horizontal{margin-right:0.32rem; position: relative;border-radius: 0.08rem;overflow: visible;}
-  /deep/ .van-radio-group--horizontal{margin-right:-0.5rem;}
-  /deep/ .login-box h4{margin-bottom:0.32rem;font-size:0.32rem;}
-  .login-box-parent /deep/ .van-nav-bar{background:#fff;}
-  .login-box-parent /deep/ .van-nav-bar .van-nav-bar__left .van-icon{color:#323232;}
-  .login-box-parent /deep/ .van-nav-bar .van-nav-bar__title{font-size: 0.4rem;font-weight:bold;color:#323232;}
-  .login-box-parent /deep/ .van-radio__icon--round .van-icon{border-radius: 0;position:absolute;margin-top:0.23rem;right: 0;bottom:0;background:none;border:none;border-bottom: 0.6rem solid #1989fa;border-right: 0rem solid transparent;border-left: 0.6rem solid transparent;}
-  .login-box-parent /deep/ .van-icon-success::before{position:absolute;top:0.2rem;right:0;}
-  .login-box-parent .confirm_box{position:absolute;bottom:0;width:90vw;}
-</style>

+ 0 - 109
src/components/user/comment.vue

@@ -1,109 +0,0 @@
-<template>
-  <div style="background-color: #f1f1f1;">
-    <van-nav-bar title="建议反馈" left-text="返回" @click-left="$route_back" left-arrow>
-
-    </van-nav-bar>
-
-    <div class="body_com has_header">
-      <scroller>
-        <van-cell-group>
-          <van-field label-class="hidden"
-                     label="" v-model="form_data.content" type="textarea" :autosize="true" placeholder="请填写您的建议和反馈内容"/>
-          <van-cell>
-            <Uploader
-              v-model="form_data.imgs"
-              :multiple="true"
-              :max-count="3"
-            />
-          </van-cell>
-          <van-field label-class="hidden"
-                     label="" v-model="form_data.tel" type="text" placeholder="填写电话,方便我们联系您"/>
-        </van-cell-group>
-        <div class="submit_btn_box">
-          <van-button type="info" size="large" @click="submit">提 交</van-button>
-        </div>
-
-      </scroller>
-    </div>
-
-
-  </div>
-</template>
-
-<script>
-  import moment from 'moment'
-  import Uploader from '@/components/common/OssUploader'
-  import request_user from '@/utils/request-user'
-  import request from '@/utils/request'
-
-  export default {
-    components: {
-      Uploader
-    },
-    name: 'comment',
-    data () {
-      return {
-        fileList: [],
-        check_remark: this.$route.query.check_remark + '(' + moment(this.$route.query.timestamp * 1000).locale('zh-cn').format('YYYY-MM-DD dddd') + ')',
-        form_data: {
-          title: '',
-          imgs: [],
-          content: '',
-          tel: '',
-        }
-      }
-    },
-    created () {
-
-    },
-    methods: {
-      image_del (file, i) {
-        let self = this
-        self.form_data.images.splice(i.index, 1)
-        return true
-      },
-
-      afterRead (file) {
-        // 此时可以自行将文件上传至服务器
-      },
-      submit () {
-        let self = this
-        self.submit_loading = true
-        self.$toast.loading({
-          mask: true,
-          message: '正在提交'
-        })
-        self.form_data.title = self.form_data.content
-        request('post','/api/feedback/create',self.form_data).then((res) => {
-          self.submit_loading = false
-          self.$toast.clear()
-          if (res.data.code == 1) {
-            self.$toast.clear()
-            self.form_data = {
-              images: [],
-              content: '',
-              mobile: '',
-            }
-            self.fileList = []
-            self.$toast(res.data.msg)
-          } else {
-            self.$toast(res.data.msg)
-          }
-        }).catch((e) => {
-          self.$toast(e)
-        })
-      }
-    }
-  }
-</script>
-
-<style scoped>
-  .submit_btn_box {
-    padding: 0.32rem;
-  }
-
-  .body_com {
-    height: calc(100vh - 1rem);
-    position: relative;
-  }
-</style>

+ 0 - 452
src/components/user/forget_pwd.vue

@@ -1,452 +0,0 @@
-<template>
-
-  <div class="login-box-parent" style="background-color:#fff;">
-
-    <van-nav-bar title="找回密码" left-text="返回" @click-left="$route_back" left-arrow>
-
-    </van-nav-bar>
-
-    <div class="login-box" :class="{'input_focus': input_focus}">
-      <scroller>
-        <div style="height: 0.2rem;"></div>
-        <div class="login-form-box" style="background-color: #fff;">
-          <!-- App背景 -->
-          <div class="login-form-box-bg">
-            <icon name="login_logo_bg" class="login_logo_bg"></icon>
-          </div>
-          <div class="login_logo">
-            <icon name="logo" class="app_logn"></icon>
-          </div>
-          <div class="setp1">
-
-            <van-cell-group>
-
-              <van-field class="tel" v-show="setp == 1"
-                clearable
-                v-model="formData.mobile"
-                placeholder="请输入手机号"
-                style="color:#515151;caret-color:#26A2FF;"
-                type="Number"
-              >
-              <template slot="left-icon">
-                <icon name="tel" class="login_tel"></icon>
-              </template>
-              </van-field>
-
-              <van-field class="message" v-show="setp == 1"
-                clearable
-                v-model="formData.code"
-                center
-                style="color:#515151;caret-color:#26A2FF;"
-                type="Number"
-                placeholder="请输入短信验证码"
-              >
-                <template slot="left-icon">
-                  <icon name="message" class="login_message"></icon>
-                </template>
-                <van-button class="code_border" :loading="sendMsgLoading" slot="button" size="small" type="info" @click="sendMsg"
-                            :disabled="sended" >
-                  {{sendMsgText}}
-                </van-button>
-              </van-field>
-
-              <van-field v-show="setp == 2" class="psw" clearable type="password" v-model="formData.password" name="密码" v-validate="'required|alpha_dash|min:6'" placeholder="请输入新密码" style="color:#515151;caret-color:#238cf9;">
-                <template slot="left-icon">
-                  <icon name="pwd" class="login_pwd"></icon>
-                </template>
-              </van-field>
-
-            </van-cell-group>
-
-          </div>
-
-          <div style="padding:0 0.32rem;">
-            <van-button v-show="setp == 1" class="login_button" :loading="reg_loading" size="large" @click="nextReg"
-                        type="info">下一步
-            </van-button>
-            <van-button v-show="setp == 2" class="login_button" :loading="reg_loading" size="large" @click="sendReg"
-                        type="info">确 定
-            </van-button>
-          </div>
-
-        </div>
-      </scroller>
-    </div>
-
-  </div>
-</template>
-
-<script>
-import request from '@/utils/request'
-
-export default {
-  name: 'change_pwd',
-  filters: {
-    mobile (tel) {
-      return tel == '' ? tel : tel.replace(tel.substring(3, 7), '****')
-    }
-  },
-  data () {
-    return {
-      next_loading: false,
-      reg_loading: false,
-      username_error: '',
-      code_error: '',
-      mobile_error: '',
-      mobile_success: '',
-      complite_btn_enable: false,
-      login_error: false,
-      login_error_msg: '',
-      next_btn_enable: false,
-      userinfo: this.$store.getters.user_info,
-      setp: 1,
-      countdown: 90,
-      sended: false,
-      sendMsgText: '获取验证码',
-      sendMsgLoading: false,
-      formData: {
-        username: '',
-        password: '',
-        password_check: '',
-        code: '',
-        aff_code: '',
-        user_name: '',
-        mobile: ''
-      },
-      input_focus: ''
-    }
-  },
-  created () {
-    var self = this
-    this.formData.aff_code = this.$route.query.aff_code
-    document.body.addEventListener('blur', function (e) {
-      setTimeout(() => {
-        e.target.parentNode.parentNode.parentNode.classList.remove('field-focus')
-        self.input_focus = false
-      }, 100)
-    }, true)
-    document.body.addEventListener('focus', function (e) {
-      e.target.parentNode.parentNode.parentNode.classList.add('field-focus')
-      setTimeout(() => {
-        self.input_focus = true
-      }, 100)
-    }, true)
-  },
-  watch: {
-    'formData': {
-      handler (val, oldVal) {
-        let self = this
-        if (val.username != '' && val.code != '') {
-          self.next_btn_enable = true
-        } else {
-          self.next_btn_enable = false
-        }
-
-        if (!self.checkMobile(val.username)) {
-          self.mobile_error = '手机号格式错误'
-          self.mobile_success = ''
-        } else {
-          self.mobile_error = ''
-          self.mobile_success = 'success'
-        }
-
-        if (val.password != '' && val.password_check != '') {
-          self.complite_btn_enable = true
-        } else {
-          self.complite_btn_enable = false
-        }
-      },
-      deep: true
-    }
-  },
-  methods: {
-    show_error (msg) {
-      let self = this
-      self.login_error = true
-      setTimeout(function () {
-        self.login_error = false
-      }, 3000)
-      self.login_error_msg = msg
-    },
-    nextReg () {
-      let self = this
-      self.$validator.validate('one.*').then(result => {
-        if (!result) {
-          self.$notify({ type: 'danger', message: self.$validator.errors.items[0].msg })
-        } else {
-          self.next_loading = true
-          request('post','/api/verify/check',{type: 2, tel: self.formData.mobile, verify: self.formData.code}).then((res) => {
-            self.next_loading = false
-            if (res.data.code == 1) {
-              self.setp++
-            } else {
-              self.$notify({
-                message: res.data.msg,
-                duration: 1000,
-                background: '#f44'
-              })
-            }
-          })
-        }
-      })
-    },
-    countDownInit () {
-      let self = this
-      self.sendMsgText = '已发送(' + self.countdown + ')'
-      if (self.countdown == 0) {
-        self.countdown = 90
-        self.sendMsgText = '重新发送'
-        self.sended = false
-        return false
-      } else {
-        setTimeout(function () {
-          self.countdown--
-          self.countDownInit()
-        }, 1000)
-      }
-    },
-
-    sendLogin () {
-      let self = this
-      self.$toast.loading({
-        mask: true,
-        message: '正在登录...'
-      })
-      this.$store.dispatch('login', {account: self.formData.username, password: self.formData.password}).then(res => {
-        self.$toast.clear()
-        if (res.code == 0) {
-          self.$notify({
-            message: res.msg,
-            duration: 1000,
-            background: '#f44'
-          })
-        } else {
-          self.$router.push({name: 'home'})
-        }
-      })
-    },
-
-    sendReg () {
-      let self = this
-      self.$validator.validate('two.*').then(result => {
-        if (!result) {
-          self.$notify({ type: 'danger', message: self.$validator.errors.items[0].msg })
-        } else {
-          self.next_loading = true
-          request('post','/api/account/forget',{tel: self.formData.mobile, password: self.formData.password, password_confirmation: self.formData.password, verify: self.formData.code}).then((res) => {
-            self.reg_loading = false
-            if (res.data.code == 1) {
-              self.$toast(res.data.msg)
-              setTimeout(() => {
-                self.$route_back()
-              }, 500)
-            } else {
-              self.$toast(res.data.msg)
-            }
-          })
-        }
-      })
-    },
-
-    checkMobile (sMobile) {
-      if (!(/^1\d{10}$/.test(sMobile))) {
-        return false
-      } else {
-        return true
-      }
-    },
-
-    sendMsg () {
-      let self = this
-      if (!this.checkMobile(self.formData.mobile)) {
-        self.$toast('请输入正确的手机号')
-        return false
-      }
-      self.sendMsgLoading = true
-      request('post','/api/send-sms',{mobile: self.formData.mobile,type: 2}).then((res) => {
-        if (res.data.code == 1) {
-          self.sended = true
-          self.sendMsgLoading = false
-          self.countDownInit()
-          self.$toast('已经发送,请注意查收!')
-        } else {
-          self.sendMsgLoading = false
-          self.$toast(res.data.msg)
-        }
-      })
-    }
-  }
-}
-</script>
-
-<style rel="stylesheet/scss" lang="scss" scoped>
-
-  .input_focus.login-box {
-    height: calc(100% - 0rem);
-  }
-  .login-box {
-    height: calc(100% - 1rem);
-    position: relative;
-  }
-  .login-box-parent .van-field__icon .van-icon {
-    color: #4b0;
-  }
-  .login-form-box-bg{
-    position: absolute;
-    top:-1rem;
-    left:0;
-    width:100%;
-    height:3.4rem;
-    color:#26A2FF;
-  }
-  .login_logo {
-    position: relative;
-    display: block;
-    margin: -1.05rem auto;
-    width: 3.6rem;
-    color: #FFF;
-    margin-bottom: 0rem;
-    z-index: 1;
-  }
-  .setp1,
-  .setp2 {
-    padding-bottom: 0.5rem;
-  }
-  .login-box-parent .mint-cell.cell-last:before {
-    bottom: 0;
-  }
-  .login-box .van-cell[data-v-1a0d0fb5]:not(:last-child)::after{
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-  .login-box .login-form-box .tel {
-    font-size:0.32rem;
-    margin-bottom: 0.16rem;
-    padding:0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-  .login-box .login-form-box .tel .login_tel {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.06rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-  .login-box .field-focus .login_tel{
-    color:#26A2FF !important;
-  }
-  .login-box .login-form-box .message {
-    font-size:0.32rem;
-    margin-top:-0.1rem;
-    margin-bottom: 0.16rem;
-    padding:0.1rem 0.32rem 0.2rem;
-    line-height: 0.5rem;
-  }
-  .login-box .login-form-box .message .code_border{
-    font-size:0.28rem;
-    letter-spacing: 0.005rem;
-    color:#1989fa;
-    border:none;
-    background:none;
-  }
-  .login-box .login-form-box .message .login_message {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.05rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-  .login-box .field-focus .login_message{
-    color:#26A2FF !important;
-  }
-  .login-box .login-form-box .psw {
-    font-size:0.32rem;
-    margin-top:-0.1rem;
-    margin-bottom: 0.16rem;
-    padding:0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-  .login-box .login-form-box .psw .login_pwd {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.05rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-  .login-box .field-focus .login_pwd{
-    color:#26A2FF !important;
-  }
-  /deep/ .login-box input{
-    font-size:0.40rem !important;
-    color:#1c1c1c;
-    letter-spacing: 0.005rem;
-  }
-  .login-box ::-webkit-input-placeholder{
-     font-size:0.32rem;
-     color:#b8b8b8 !important;
-     letter-spacing: 0.005rem;
-   }
-  .login-box input:-ms-input-placeholder{
-    font-size:0.32rem;
-    color:#b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-  .login-box ::-moz-input-placeholder {
-    font-size:0.32rem;
-    color:#b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-  .login-box .field-focus ::-webkit-input-placeholder{
-    color:#26A2FF !important;
-  }
-  .login-box input:-ms-input-placeholder {
-    color:#26A2FF !important;
-  }
-  .login-box .field-focus ::-moz-input-placeholder {
-    color:#26A2FF !important;
-  }
-  .login-box .van-hairline--top-bottom:after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-  .login-box .van-hairline-unset--top-bottom:after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-  /deep/ .login-box .field-focus:after {
-    border-bottom: 0.02rem #26A2FF solid !important;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-  .login-box .login_button{
-    height: 1rem;
-    line-height: 0.8rem;
-    border-radius:0.04rem;
-  }
-  .footer {
-    font-size: 0.24rem;
-    line-height: 1rem;
-    text-align: center;
-    color: #999;
-    letter-spacing: 0.005rem;
-  }
-  .footer a {
-    color: #1989fa;
-  }
-</style>

+ 35 - 28
src/components/user/index.vue

@@ -5,10 +5,10 @@
 	   <!-- <div class="height100p" v-if="active_index == 1" :class="{ hidden_right: active_index != 1 }"><work @url_jump="app_open"></work></div> -->
 	   <!-- <div class="height100p" v-if="active_index == 2" :class="{ hidden_right: active_index != 2 }"><statistics_personal /></div> -->
 
-      <div class="height100p"  :class="{ hidden_right: active_index != 0 }"><statistics/></div>
-      <div class="height100p" v-show="active_index == 1" :class="{ hidden_right: active_index != 1 }"><management ref="management"></management></div>
-      <div class="height100p" v-if="active_index == 2" :class="{ hidden_right: active_index != 2 }"><message_list @shwoCunt="shwoCunt"></message_list></div>
-      <div class="height100p" v-if="active_index == 3" :class="{ hidden_right: active_index != 3 }"><user_center></user_center></div>
+      <div class="height100p"  :class="{ hidden_right: active_index != 0 }"><statistics ref="management" @active2="active2" /></div>
+      <div class="height100p" v-show="active_index == 1" :class="{ hidden_right: active_index != 1 }"><work></work></div>
+      <!-- <div class="height100p" v-if="active_index == 2" :class="{ hidden_right: active_index != 2 }"><message_list @shwoCunt="shwoCunt"></message_list></div> -->
+      <div class="height100p" v-if="active_index == 2" :class="{ hidden_right: active_index != 2 }"><user_center></user_center></div>
       <!-- 导航 -->
       <van-tabbar v-model="active_index" :class="isIos? 'padding-m':''" :fixed="false">
         <van-tabbar-item>
@@ -19,9 +19,9 @@
         <van-tabbar-item>
           <icon name="footer_nav_work" v-if="tabs != 1" class="footer_nav_work"></icon>
           <icon name="footer_nav_work_press" v-if="tabs == 1" class="footer_nav_work_press active"></icon>
-          <span>管理中心</span>
+          <span>工作台</span>
         </van-tabbar-item>
-        <van-tabbar-item>
+        <!-- <van-tabbar-item>
           <icon name="footer_nav_message" v-if="tabs != 2" class="footer_nav_message"></icon>
           <icon name="footer_nav_message_press" v-if="tabs == 2" class="footer_nav_message_press active"></icon>
           <span>通知</span>
@@ -32,10 +32,10 @@
           <template v-else>
               <em class="cunt2" v-if="cuntNum.notice==1"></em>
           </template>
-        </van-tabbar-item>
+        </van-tabbar-item> -->
         <van-tabbar-item>
-          <icon name="footer_nav_me" v-if="tabs != 3" class="footer_nav_me"></icon>
-          <icon name="footer_nav_me_press" v-if="tabs == 3" class="footer_nav_me_press active"></icon>
+          <icon name="footer_nav_me" v-if="tabs != 2" class="footer_nav_me"></icon>
+          <icon name="footer_nav_me_press" v-if="tabs == 2" class="footer_nav_me_press active"></icon>
           <span>我的</span>
         </van-tabbar-item>
       </van-tabbar>
@@ -72,13 +72,12 @@
 </template>
 
 <script>
-import request_user from '@/utils/request-user'
 import request from '@/utils/request'
 import management from '@/components/body/management'
 import user_center from '@/components/body/user_center'
 import message_list from '@/components/body/message_list'
 import statistics from '@/components/body/statistics'
-// import work from '@/components/body/work'
+import work from '@/components/body/work'
 // import department from '@/components/body/department'
 // import common_menu from '@/components/user/common_menu'
 // import statistics_personal from '@/components/integral/statistics_personal'
@@ -88,7 +87,7 @@ import { Overlay, Image as VanImage } from 'vant'
 Vue.use(Overlay).use(VanImage)
 
 export default {
-  components: { management, user_center, message_list, statistics},
+  components: { management, user_center, message_list, statistics, work},
   sockets: {
     new_msg (data) {
       let self = this
@@ -122,25 +121,30 @@ export default {
   },
   watch: {
     active_index: function (val, old) {
-      if (val == 1) {
-        this.$store.dispatch('getMenu').then(res => {
-          this.$refs.management.getMenu(res)
-          this.$refs.management.getKqList()
-        })
-        if (!this.$refs.management.isShowImg) {
-          this.$refs.management.get_notice_list()
-        }
-      }
-      window.document.title =
-      val == 0 ? '首页':
-      val == 1 ? '管理中心':
-      val == 2 ? '通知':
-      val == 3 ? '我的':
-      '功道云'
+      // if (val == 0) {
+        // this.$store.dispatch('getMenu').then(res => {
+          // this.$refs.management.getMenu(res)
+          // this.$refs.management.getKqList()
+        // })
+        // if (!this.$refs.management.isShowImg) {
+        //   this.$refs.management.get_notice_list()
+        // }
+      // }
+      this.docuTitle(val)
       this.tabs = val
     }
   },
   methods: {
+    active2(data){
+      this.active_index = data
+    },
+    docuTitle(val){
+      window.document.title =
+      val == 0 ? '首页':
+      val == 1 ? '工作台':
+      val == 2 ? '我的':
+      '功道云'
+    },
     shwoCunt (data) {
       request('get', '/api/notice/number').then(res => {
         this.cuntNum = res.data.data
@@ -219,6 +223,9 @@ export default {
       localStorage.setItem('home_active_index', this.active_index)
     }
   },
+  activated (){
+    this.docuTitle(this.active_index)
+  },
   created () {
     document.documentElement.style.backgroundColor = '#26A2FF'
     if (window.plus) { // 下边横杠兼容
@@ -234,7 +241,7 @@ export default {
         }
       }
     }
-    this.shwoCunt()
+    // this.shwoCunt()
   },
   mounted () {
     let index = localStorage.getItem('home_active_index')

+ 0 - 574
src/components/user/invite_reg.vue

@@ -1,574 +0,0 @@
-<template>
-
-  <div class="login-box-parent" style="background:#fff;">
-    <van-nav-bar title="邀请加入企业" left-text="返回" v-if="isapp"
-                 @click-left="$route_back" left-arrow>
-
-    </van-nav-bar>
-    <div v-if="isapp">
-      <div class="invite_header" style="padding: 2rem 0;">
-        <van-row>
-          <van-col span="8" offset="8">
-            <van-image
-              width="100%"
-              height="100%"
-              fit="contain"
-              radius="5"
-              :src="company_logo_url"
-              style="border: 1px #f1f1f1 solid;"
-            />
-          </van-col>
-        </van-row>
-        <h4 class="text_center">{{company_name}}</h4>
-        <p class="text_center" style="padding-top: 0.32rem">{{employee_name}}邀请你加入</p>
-      </div>
-      <div style="padding: 0.32rem;margin-top: 0.5rem;">
-        <van-button class="login_button" :loading="reg_loading" size="large" @click="sendJoin" type="info">加入团队</van-button>
-      </div>
-    </div>
-    <div class="login-box" :class="{'input_focus': input_focus}" v-if="!isapp">
-      <scroller>
-        <div class="login-form-box" style="background-color: #fff;">
-          <!-- App背景 -->
-          <div class="login-form-box-bg">
-            <icon name="login_logo_bg" class="login_logo_bg"></icon>
-          </div>
-          <div style="height: 0.2rem;"></div>
-          <div class="login_logo">
-            <icon name="logo" class="app_logn"></icon>
-          </div>
-          <div class="login-form-box" style="background-color: #fff;">
-
-            <div class="invite_header" v-show="setp == 1">
-              <h4>{{company_name}}</h4>
-              <p>{{employee_name}}邀请你加入</p>
-            </div>
-            <div class="invite_header" v-show="setp == 2">
-              <h4>完善信息</h4>
-              <p>完善姓名和登录密码</p>
-            </div>
-            <div class="setp1" v-show="setp == 1">
-              <van-cell-group>
-                <van-field class="mobile"
-                           clearable
-                           v-model="formData.tel"
-                           placeholder="请输入手机号"
-                           :error-message="mobile_error"
-                           :icon="mobile_success"
-                >
-                  <template slot="left-icon">
-                    <icon name="tel" class="login_mobile"></icon>
-                  </template>
-                </van-field>
-                <van-field class="message"
-                           clearable
-                           v-model="formData.verify"
-                           center
-                           placeholder="请输入短信验证码"
-                           :error-message="verify_error"
-                >
-                  <template slot="left-icon">
-                    <icon name="message" class="login_message"></icon>
-                  </template>
-                  <van-button class="message_code" :loading="sendMsgLoading" slot="button" size="small" type="info"
-                              @click="sendMsg"
-                              :disabled="sended">
-                    {{sendMsgText}}
-                  </van-button>
-                </van-field>
-                <van-field class="message" v-show="false"
-                           clearable
-                           v-model="formData.verify"
-                           center
-                           placeholder="请输入短信验证码"
-                           :error-message="verify_error"
-                >
-                  <template slot="left-icon">
-                    <icon name="message" class="login_message"></icon>
-                  </template>
-                  <van-button class="message_code" :loading="sendMsgLoading" slot="button" size="small" type="info"
-                              @click="sendMsg"
-                              :disabled="sended">
-                    {{sendMsgText}}
-                  </van-button>
-                </van-field>
-                <van-field class="rec_code" v-if="false" type="text" v-model="formData.aff_verify" clearable placeholder="推荐码(选填)"></van-field>
-              </van-cell-group>
-            </div>
-            <div v-show="setp == 2">
-              <van-cell-group>
-                <van-field class="set_pwd" type="text" v-model="formData.name" clearable placeholder="您的姓名">
-                  <template slot="left-icon">
-                    <icon name="user" class="login_user"></icon>
-                  </template>
-                </van-field>
-                <van-field class="comfim_pwd" type="password" v-model="formData.password" clearable placeholder="设置密码">
-                  <template slot="left-icon">
-                    <icon name="pwd" class="login_pwd"></icon>
-                  </template>
-                </van-field>
-              </van-cell-group>
-            </div>
-            <div style="padding:0 0.32rem;" v-show="setp == 1">
-              <van-button class="login_button" :loading="reg_loading" size="large" :disabled="!complite_btn_enable1"
-                @click="nextReg" type="info">下一步
-              </van-button>
-            </div>
-            <div style="padding:0 0.32rem;margin-top:0.5rem" v-show="setp == 2">
-              <van-button class="login_button" :loading="reg_loading" size="large" :disabled="!complite_btn_enable"
-                  @click="sendReg" type="info">加入团队
-              </van-button>
-            </div>
-          </div>
-        </div>
-      </scroller>
-    </div>
-    <!-- <div @click="go_login" style="padding:0 0.32rem; text-align: center; color:#1989fa; font-size:0.32rem;">已有账号?去登录</div> -->
-  </div>
-</template>
-
-<script>
-import request_user from '@/utils/request-user'
-import Vue from 'vue'
-import {Image} from 'vant'
-Vue.use(Image)
-
-export default {
-  name: 'invite_reg',
-  data () {
-    return {
-      isapp: window.plus,
-      employee_name: '',
-      company_name: '',
-      employee_id: 0,
-      site_id: 0,
-      complite_btn_enable1: false,
-      input_focus: false,
-      next_loading: false,
-      reg_loading: false,
-      tel_error: '',
-      verify_error: '',
-      mobile_error: '',
-      mobile_success: '',
-      complite_btn_enable: false,
-      login_error: false,
-      login_error_msg: '',
-      next_btn_enable: false,
-      setp: 1,
-      countdown: 90,
-      sended: false,
-      sendMsgText: '免费获取验证码',
-      sendMsgLoading: false,
-      formData: {
-        tel: '',
-        name: '',
-        password: '',
-        password_confirmation: '',
-        verify: '',
-        aff_verify: ''
-      }
-    }
-  },
-  created () {
-    let self = this
-
-    this.employee_name = this.$route.query.employee_name
-    this.site_id = this.$route.query.site_id
-    this.company_name = this.$route.query.company_name
-    this.employee_id = this.$route.query.employee_id
-    this.company_logo_url = this.$route.query.company_logo_url
-    document.body.addEventListener('blur', function (e) {
-      setTimeout(() => {
-        e.target.parentNode.parentNode.parentNode.classList.remove('field-focus')
-        self.input_focus = false
-      }, 100)
-    }, true)
-    document.body.addEventListener('focus', function (e) {
-      setTimeout(() => {
-        e.target.parentNode.parentNode.parentNode.classList.add('field-focus')
-        self.input_focus = true
-      }, 100)
-    }, true)
-  },
-  watch: {
-    'formData': {
-      handler (val, oldVal) {
-        let self = this
-        if (val.tel != '' && val.verify != '') {
-          self.complite_btn_enable1 = true
-          self.next_btn_enable = true
-        } else {
-          self.complite_btn_enable1 = false
-          self.next_btn_enable = false
-        }
-
-        if (val.password != '') {
-          self.complite_btn_enable = true
-        } else {
-          self.complite_btn_enable = false
-        }
-      },
-      deep: true
-    }
-  },
-  methods: {
-    go_login () {
-      this.$router.push({name: 'login', query: {employee_id: this.employee_id, site_id: this.site_id}})
-    },
-    show_error (msg) {
-      let self = this
-      self.login_error = true
-      setTimeout(function () {
-        self.login_error = false
-      }, 3000)
-      self.login_error_msg = msg
-    },
-    nextReg () {
-      let self = this
-      self.next_loading = true
-      request_user('post','/api/verify/check',{type: 1, tel: self.formData.tel, verify: self.formData.verify}).then((res) => {
-        self.next_loading = false
-        if (res.data.code == 1) {
-          self.setp++
-        } else {
-          self.$notify({
-            message: res.data.msg,
-            duration: 1000,
-            background: '#f44'
-          })
-        }
-      })
-    },
-    countDownInit () {
-      let self = this
-      self.sendMsgText = '已发送(' + self.countdown + ')'
-      if (self.countdown == 0) {
-        self.countdown = 90
-        self.sendMsgText = '重新发送'
-        self.sended = false
-        return false
-      } else {
-        setTimeout(function () {
-          self.countdown--
-          self.countDownInit()
-        }, 1000)
-      }
-    },
-    // 登录成功以后,提交一个申请
-    sendJoin () {
-      let self = this
-      self.$toast.loading({
-        mask: true,
-        message: '正在处理...'
-      })
-      request_user('post','/api/join/submit', {employee_id: this.employee_id, site_id: this.site_id}).then(res => {
-        self.$toast.clear()
-        if (res.data.code == 1) {
-          if (window.plus) {
-            // APP环境下让他去登录
-            self.$toast(res.data.msg)
-            setTimeout(() => {
-              self.$route_back()
-            }, 500)
-          } else {
-            // 不是APP,让用户去下载APP
-            window.location.href = process.env.APP_DOWNDOAD_URL
-          }
-        } else {
-          self.$notify({
-            message: res.data.msg,
-            duration: 1000,
-            background: '#f44'
-          })
-        }
-      })
-    },
-    sendLogin () {
-      let self = this
-      self.$toast.loading({
-        mask: true,
-        message: '正在登录...'
-      })
-      this.$store.dispatch('login', {tel: self.formData.tel, password: self.formData.password}).then(res => {
-        self.$toast.clear()
-        if (res.code == 1) {
-          localStorage.setItem('a-token-temp', res.data.token)
-          self.sendJoin();
-        } else {
-          self.$notify({
-            message: res.msg,
-            duration: 1000,
-            background: '#f44'
-          })
-        }
-      })
-    },
-
-    sendReg () {
-      let self = this
-      self.reg_loading = true
-      self.formData.password_confirmation = self.formData.password
-      this.$store.dispatch('reg', self.formData).then(res => {
-        self.reg_loading = false
-        if (res.code == 1) {
-          self.$toast(res.msg)
-          self.sendLogin()
-        } else {
-          self.$toast(res.msg)
-        }
-      })
-    },
-
-    checkMobile (sMobile) {
-      if (!(/^1\d{10}$/.test(sMobile))) {
-        return false
-      } else {
-        return true
-      }
-    },
-
-    sendMsg () {
-      let self = this
-      if (!self.checkMobile(self.formData.tel)) {
-        self.$notify({
-          message: '手机号码错误',
-          duration: 1000,
-          background: '#f44'
-        })
-        return false
-      }
-      self.sendMsgLoading = true
-      self.$store.dispatch('sendMsg', self.formData.tel).then((res) => {
-        if (res.code == 1) {
-          self.sended = true
-          self.sendMsgLoading = false
-          self.countDownInit()
-          self.$toast('已经发送,请注意查收!')
-        } else {
-          self.sendMsgLoading = false
-          self.$toast(res.msg)
-        }
-      })
-    }
-  }
-}
-</script>
-
-<style rel="stylesheet/scss" lang="scss" scoped>
-  .invite_header{padding:0 0.32rem;}
-  .invite_header h4{margin:0;}
-  .invite_header p{margin:0; color:#b8b8b8; font-size:0.32rem;}
-  .login-form-box-bg{
-    position: absolute;
-    top:-1rem;
-    left:0;
-    width:100%;
-    height:3.4rem;
-    color:#26A2FF;
-  }
-
-  .login-box {
-    height: calc(100% - 1rem);
-    position: relative;
-  }
-
-  .login-box-parent .van-field__icon .van-icon {
-    color: #4b0;
-
-  }
-
-  .login_logo {
-    position: relative;
-    display: block;
-    margin: -1.05rem auto;
-    width: 3.6rem;
-    color: #FFF;
-    margin-bottom: 0rem;
-    z-index: 1;
-  }
-
-  .setp1, .setp2 {
-    padding-bottom: 0.5rem;
-  }
-
-  .login-box .login-form-box .mobile {
-    font-size: 0.32rem;
-    margin-bottom: 0.16rem;
-    padding: 0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-
-  .login-box .login-form-box .mobile .login_mobile {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.06rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-
-  .login-box .field-focus .login_mobile {
-    color: #26A2FF !important;
-  }
-
-  .login-box .login-form-box .message {
-    font-size: 0.32rem;
-    margin-bottom: 0.16rem;
-    padding: 0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-
-  .login-box .login-form-box .message .message_code {
-    font-size: 0.28rem;
-    letter-spacing: 0.005rem;
-    color: #1989fa;
-    border: none;
-    background: none;
-  }
-
-  .login-box .login-form-box .message .login_message {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.06rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-
-  .login-box .field-focus .login_message {
-    color: #26A2FF !important;
-  }
-
-  .login-box .login-form-box .set_pwd {
-    font-size: 0.32rem;
-    margin-bottom: 0.16rem;
-    padding: 0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-
-  .login-box .login-form-box .set_pwd .login_user {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.06rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-
-  .login-box .field-focus .login_user {
-    color: #26A2FF !important;
-  }
-
-  .login-box .login-form-box .comfim_pwd {
-    font-size: 0.32rem;
-    margin-bottom: 0.16rem;
-    padding: 0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-
-  .login-box .login-form-box .comfim_pwd .login_pwd {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.06rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-
-  .login-box .field-focus .login_pwd {
-    color: #26A2FF !important;
-  }
-
-  /deep/ .login-box input {
-    font-size: 0.40rem !important;
-    color: #1c1c1c;
-    letter-spacing: 0.005rem;
-  }
-
-  .login-box ::-webkit-input-placeholder {
-    font-size: 0.32rem;
-    color: #b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-
-  .login-box input:-ms-input-placeholder {
-    font-size: 0.32rem;
-    color: #b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-
-  .login-box ::-moz-input-placeholder {
-    font-size: 0.32rem;
-    color: #b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-
-  .login-box .field-focus ::-webkit-input-placeholder {
-    color: #26A2FF !important;
-  }
-
-  .login-box input:-ms-input-placeholder {
-    color: #26A2FF !important;
-  }
-
-  .login-box .field-focus ::-moz-input-placeholder {
-    color: #26A2FF !important;
-  }
-
-  .login-box .van-hairline--top-bottom:after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-
-  .login-box .van-hairline-unset--top-bottom:after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-
-  .login-box .van-cell:not(:last-child):after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-
-  /deep/ .login-box .field-focus:after {
-    border-bottom: 0.02rem #26A2FF solid !important;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-
-  .login-box .login_button {
-    height: 1rem;
-    line-height: 0.8rem;
-    border-radius: 0.04rem;
-  }
-
-  .login-box-parent .mint-cell.cell-last:before {
-    bottom: 0;
-  }
-
-  .footer {
-    font-size: 0.24rem;
-    line-height: 1rem;
-    text-align: center;
-    color: #999;
-    letter-spacing: 0.005rem;
-  }
-
-  .footer a {
-    color: #1989fa;
-  }
-</style>

+ 0 - 424
src/components/user/join.vue

@@ -1,424 +0,0 @@
-<template>
-
-  <div class="login-box-parent" style="background:#fff;">
-
-    <div class="login-box" :class="{'input_focus': input_focus}">
-      <scroller>
-
-        <div class="login-form-box" style="background-color:#FFF">
-          <div class="login-form-box-bg">
-            <!-- App背景 -->
-            <icon name="login_logo_bg" class="login_logo_bg"></icon>
-          </div>
-          <div style="height: 1rem;"></div>
-          <div class="login_logo">
-            <icon name="logo" class="app_logn"></icon>
-          </div>
-          <div class="setp1">
-
-            <van-cell-group style="margin-top:0.3rem;">
-              <van-field class="tel"
-                left-icon="logo"
-                label-class="hidden"
-                label=""
-                type="Number"
-                v-model="formData.username"
-                placeholder="手机号"
-                clearable
-                style="color:#515151;caret-color:#26A2FF;"
-                name="手机号码"
-                v-validate="'required|phone'"
-              >
-              <template slot="left-icon">
-                <icon name="tel" class="login_tel"></icon>
-              </template>
-              </van-field>
-
-              <van-field class="psw" label-class="hidden" left-icon="logo" clearable
-                         label="" type="password" v-model="formData.password" placeholder="密码" name="密码" v-validate="'required|alpha_dash|min:6'" style="color:#515151;caret-color:#26A2FF;">
-              >
-              <template slot="left-icon">
-                <icon name="pwd" class="login_pwd"></icon>
-              </template>
-              </van-field>
-              <van-field class="psw" label-class="hidden" left-icon="logo"  v-show="false"
-                         label="" type="password" v-model="formData.password" placeholder="密码" name="密码" v-validate="'required|alpha_dash|min:6'" style="color:#515151;caret-color:#26A2FF;">
-                >
-                <template slot="left-icon">
-                  <icon name="pwd" class="login_pwd"></icon>
-                </template>
-              </van-field>
-
-            </van-cell-group>
-          </div>
-
-          <div style="padding:0 0.32rem">
-            <van-button class="login_button" color="#228bf8" :loading="reg_loading" size="large" :disabled="!next_btn_enable" @click="sendLogin"
-                        type="info">登录
-            </van-button>
-          </div>
-          <div style="padding:0.2rem 0.32rem 0.2rem;" class="reg_link_box">
-
-            <van-row>
-              <van-col span="12">
-                <div @click="$router.push({name: 'forget_pwd'})">忘记密码</div>
-              </van-col>
-              <van-col span="12" style="text-align: right;">
-                <div @click="$router.push({name: 'reg'})">注册免费试用</div>
-              </van-col>
-
-            </van-row>
-          </div>
-
-          <div style="text-align: center; padding:0 0.32rem;letter-spacing: 0.01rem" v-if="auths.length > 0 && cur_date > 1592582400">
-            <van-divider>快捷登录</van-divider>
-            <div style="display: inline-block;" @click="doWeixinLogin" v-show="aweixin != null">
-              <icon name="weixindenglu" style="width:1.2rem;"></icon>
-            </div>
-          </div>
-
-
-        </div>
-      </scroller>
-    </div>
-
-    <div class="footer">登录即代表同意
-      <span style="color:#28a2f1" @click="$router.push({name: 'user_agreement'})">《用户服务协议》</span>
-      与
-      <span style="color:#28a2f1" @click="$router.push({name: 'privacy_agreement'})">《隐私协议》</span>
-    </div>
-  </div>
-</template>
-
-<script>
-  import Vue from 'vue';
-  import { Divider } from 'vant';
-  import request_user from '@/utils/request-user'
-  Vue.use(Divider);
-  export default {
-    name: 'login',
-    data () {
-      return {
-        input_focus: false,
-        complite_btn_enable: false,
-        login_error: false,
-        reg_loading: false,
-        login_error_msg: '',
-        next_btn_enable: false,
-        setp: 1,
-        formData: {
-          username: '',
-          password: '',
-        },
-        aweixin: null,
-        auths: [],
-        cur_date: Math.round(new Date() / 1000),
-      }
-    },
-    created () {
-      let self = this
-      self.site_id = self.$route.query.site_id
-      self.employee_id = self.$route.query.employee_id
-      self.$store.commit('SET_USERINFO', {})
-      self.$store.commit('SET_USERID', 0)
-      self.getServiceOauth()
-      document.body.addEventListener('blur', function (e) {
-        setTimeout(() => {
-          e.target.parentNode.parentNode.parentNode.classList.remove('field-focus')
-          self.input_focus = false
-        }, 100)
-      }, true)
-      document.body.addEventListener('focus', function (e) {
-        e.target.parentNode.parentNode.parentNode.classList.add('field-focus')
-        setTimeout(() => {
-          self.input_focus = true
-        }, 100)
-      }, true)
-    },
-    watch: {
-      'formData': {
-        handler (val, oldVal) {
-          let self = this
-          if (val.username != '' && val.password != '') {
-            self.next_btn_enable = true
-          } else {
-            self.next_btn_enable = false
-          }
-        },
-        deep: true
-      }
-    },
-    methods: {
-      sendJoin(){
-        let self = this
-        self.$toast.loading({
-          mask: true,
-          message: '正在处理...'
-        })
-        request_user('post','/api/join/submit',{employee_id: this.employee_id, site_id: this.site_id}).then(res => {
-          self.$toast.clear()
-        })
-      },
-      show_error (msg) {
-        let self = this
-        self.login_error = true
-        setTimeout(function () {
-          self.login_error = false
-        }, 3000)
-        self.login_error_msg = msg
-      },
-      getServiceOauth () {
-        let self = this
-        if (window.plus) {
-          plus.oauth.getServices(function (services) {
-            self.auths = services
-            for (let i in services) {
-              if (services[i].id == 'weixin') {
-                self.aweixin = services[i]
-              }
-            }
-          }, function (e) {
-            console.log(e)
-          })
-        }
-      },
-      doWeixinLogin () {
-        let self = this
-        if (null == self.aweixin) {
-          plus.nativeUI.alert('当前环境不支持微信登录')
-          return
-        }
-        self.aweixin.authorize(function (e) {
-          self.WeixinLogin(e.code)
-        }, function (e) {
-          plus.nativeUI.alert('授权失败:' + JSON.stringify(e))
-        }, {scope: 'snsapi_userinfo', state: 'authorize test', appid: 'wx78513a709dbea762'})
-
-      },
-      sendLogin () {
-        let self = this
-        self.$validator.validate().then(result => {
-          if (!result) {
-            self.$notify({ type: 'danger', message: self.$validator.errors.items[0].msg });
-          }else{
-            self.$toast.loading({
-              mask: true,
-              message: '正在登录...'
-            })
-            this.$store.dispatch('login', {tel: self.formData.username, password: self.formData.password}).then(res => {
-              self.$toast.clear()
-              if(self.site_id > 0 && self.employee_id > 0){
-                self.sendJoin()
-              }
-              if (res.code == 1) {
-                localStorage.setItem('a-token-temp', res.data.token)
-                var timestamp = parseInt((new Date()).valueOf()/1000)
-                self.$toast.clear()
-                if(res.data.account_site.length > 0){
-                  if (res.data.invitation_wait_count > 0) {
-                    self.$router.push({name: 'registration_experience', query: {invite: 1,iscompany: 1}})
-                  }else{
-                    self.$router.push({name: 'login_company_list'})
-                  }
-                }else{
-                  if (res.data.invitation_wait_count > 0) {
-                    self.$router.push({name: 'registration_experience', query: {invite: 1}})
-                  }else{
-                    self.$router.push({name: 'registration_experience'})
-                  }
-                }
-              } else {
-                self.$toast.fail({
-                  message: res.msg,
-                  duration: 1000
-                })
-              }
-            })
-          }
-        })
-      },
-      WeixinLogin (code) {
-        let self = this
-        self.$toast.loading({
-          mask: true,
-          message: '正在登录...'
-        })
-        this.$store.dispatch('weixin_login', {code: code, platform: 'wechat'}).then(res => {
-          self.$toast.clear()
-          if (res.code == 1) {
-            localStorage.setItem('a-token-temp', res.data.token)
-            if(res.data.account_site.length > 0){
-              self.$router.push({name: 'login_company_list'})
-            }else{
-              //选择公司
-              self.$router.push({name: 'create_company'})
-            }
-            self.$toast.clear()
-          } else if(res.code == 1001){
-            //self.$toast('')
-            self.$router.push({name: 'bind_weixin'})
-          }else{
-            self.$notify({
-              message: res.msg,
-              duration: 1000,
-              background: '#f44'
-            })
-          }
-        })
-      },
-    }
-  }
-</script>
-
-<style rel="stylesheet/scss" lang="scss" scoped>
-
-  .input_focus.login-box {
-     height: calc(100% - 0rem);
-   }
-  .login-box {
-    height: calc(100% - 1rem);
-    position: relative;
-  }
-  .login-box-parent .van-field__icon .van-icon {
-    color: #4b0;
-  }
-  .login-form-box-bg{
-    position: absolute;
-    top:-0.4rem;
-    left:0;
-    width:100%;
-    height:3.4rem;
-    color:#26A2FF;
-  }
-  .login_logo {
-    position: relative;
-    display: block;
-    margin: -1.45rem auto;
-    width: 3.6rem;
-    color: #FFF;
-    margin-bottom: 0rem;
-    z-index: 1;
-  }
-  .setp1,
-  .setp2 {
-    padding-bottom: 0.5rem;
-  }
-  .login-box-parent .mint-cell.cell-last:before {
-    bottom: 0;
-  }
-  .login-box .van-cell[data-v-1a0d0fb5]:not(:last-child)::after{
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-  .login-box .login-form-box .tel {
-    font-size:0.32rem;
-    margin-bottom: 0.16rem;
-    padding:0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-  .login-box .login-form-box .tel .login_tel {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.06rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-  .login-box .login-form-box .psw {
-    font-size:0.32rem;
-    margin-bottom: 0.16rem;
-    padding:0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-  .login-box .login-form-box .psw .login_pwd {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.05rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-  /deep/ .login-box input{
-    font-size:0.40rem !important;
-    color:#1c1c1c;
-    letter-spacing: 0.005rem;
-  }
-  .login-box ::-webkit-input-placeholder{
-    font-size:0.32rem;
-    color:#b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-  .login-box input:-ms-input-placeholder{
-    font-size:0.32rem;
-    color:#b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-  .login-box ::-moz-input-placeholder {
-    font-size:0.32rem;
-    color:#b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-  // .login-box .field-focus ::-webkit-input-placeholder{
-  //   color:#238cf9 !important;
-  // }
-  // .login-box input:-ms-input-placeholder {
-  //    color:#238cf9 !important;
-  //  }
-  // .login-box .field-focus ::-moz-input-placeholder {
-  //   color:#238cf9 !important;
-  // }
-  // .login-box .field-focus .login_tel{
-  //   color:#238cf9 !important;
-  // }
-  // .login-box .field-focus .login_pwd {
-  //   color:#238cf9 !important;
-  // }
-  .login-box .van-hairline--top-bottom:after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-  .login-box .van-hairline-unset--top-bottom:after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-  // /deep/ .login-box .field-focus:after {
-  //   border-bottom: 0.02rem #238cf9 solid !important;
-  // }
-  .login-box .van-row{
-    margin-top: 0.08rem;
-    font-size:0.28rem;
-  }
-  .login-box .van-row .van-col:not(:last-child){
-    color:#9e9da3;
-  }
-  .login-box .van-row .van-col{
-    color:#28a2f1;
-    letter-spacing: 0.005rem;
-  }
-  .login-box .login_button{
-    height: 1rem;
-    line-height: 0.8rem;
-    border-radius:0.04rem;
-  }
-  .footer {
-    font-size: 0.24rem;
-    line-height: 1rem;
-    text-align: center;
-    color: #999;
-    letter-spacing: 0.005rem;
-  }
-  .footer a {
-    color: #1989fa;
-  }
-</style>

+ 0 - 575
src/components/user/login.vue

@@ -1,575 +0,0 @@
-<template>
-  <div class="login-box-parent" style="background:#fff;">
-    <div class="login-box" :class="{'input_focus': input_focus}">
-      <scroller>
-
-        <div class="login-form-box" style="background-color:#FFF">
-          <div class="login-form-box-bg">
-            <!-- App背景 -->
-            <icon name="login_logo_bg" class="login_logo_bg"></icon>
-          </div>
-          <div style="height: 1rem;"></div>
-          <div class="login_logo">
-            <icon name="logo" class="app_logn"></icon>
-          </div>
-          <div class="setp1">
-
-            <van-cell-group style="margin-top:0.3rem;">
-              <van-field class="tel"
-                left-icon="logo"
-                label-class="hidden"
-                label=""
-                type="Number"
-                v-model="formData.username"
-                placeholder="手机号"
-                clearable
-                style="color:#515151;caret-color:#26A2FF;"
-                name="手机号码"
-                v-validate="'required|phone'"
-              >
-              <template slot="left-icon">
-                <icon name="tel" class="login_tel"></icon>
-              </template>
-              </van-field>
-
-              <van-field class="psw" label-class="hidden" left-icon="logo" clearable
-                         label="" type="password" v-model="formData.password" placeholder="密码" name="密码" v-validate="'required|alpha_dash|min:6'" style="color:#515151;caret-color:#26A2FF;">
-              >
-              <template slot="left-icon">
-                <icon name="pwd" class="login_pwd"></icon>
-              </template>
-              </van-field>
-              <van-field class="psw" label-class="hidden" left-icon="logo"  v-show="false"
-                         label="" type="password" v-model="formData.password" placeholder="密码" name="密码" v-validate="'required|alpha_dash|min:6'" style="color:#515151;caret-color:#26A2FF;">
-                >
-                <template slot="left-icon">
-                  <icon name="pwd" class="login_pwd"></icon>
-                </template>
-              </van-field>
-
-            </van-cell-group>
-          </div>
-
-          <div style="padding:0 0.32rem">
-            <van-button class="login_button" color="#228bf8" :loading="reg_loading" size="large" :disabled="!next_btn_enable" @click="sendLogin"
-                        type="info">登录
-            </van-button>
-          </div>
-          <div style="padding:0.2rem 0.32rem 0.2rem;" class="reg_link_box">
-
-            <van-row>
-              <van-col span="12">
-                <div @click="$router.push({name: 'forget_pwd'})">忘记密码</div>
-              </van-col>
-              <van-col span="12" style="text-align: right;">
-                <div @click="$router.push({name: 'reg'})">注册免费试用</div>
-              </van-col>
-
-            </van-row>
-          </div>
-          <!--
-          <div style="text-align: center; padding:0 0.32rem;letter-spacing: 0.01rem" v-if="auths.length > 0 && cur_date > 1599753600">
-            <van-divider>快捷登录</van-divider>
-            <div style="display: inline-block;" @click="doWeixinLogin" v-show="aweixin != null">
-              <icon name="weixindenglu" style="width:1.2rem;"></icon>
-            </div>
-          </div>
-           -->
-        </div>
-        <div class="footer">
-          <span @click="openDj()">登录即代表同意</span>
-          <span style="color:#28a2f1" @click="$router.push({name: 'user_agreement'})">《用户服务协议》</span>
-          与
-          <span style="color:#28a2f1" @click="$router.push({name: 'privacy_agreement'})">《隐私协议》</span>
-        </div>
-      </scroller>
-    </div>
-    <!-- <div style="text-align: center;" class="color_ccc">v7.6.1</div> -->
-    <div class="body_com"  v-if="isShowGuide" :style="{top:hei+'px'}">
-      <!-- <scroller> -->
-        <div class="imgLsit"><img :src="item" v-for="(item, index) in imgLsit" :key="index" /></div>
-        <div style="padding:0.32rem">
-          <van-button class="login_button" color="#228bf8" size="large" @click="openHome()" type="info">立即体验</van-button>
-        </div>
-      <!-- </scroller> -->
-    </div>
-  </div>
-</template>
-
-<script>
-
-import Vue from 'vue'
-import { Divider } from 'vant'
-import request_user from '@/utils/request-user'
-import {setToken} from '@/utils/auth'
-Vue.use(Divider)
-export default {
-  name: 'login',
-  data () {
-    return {
-      input_focus: false,
-      complite_btn_enable: false,
-      login_error: false,
-      reg_loading: false,
-      login_error_msg: '',
-      next_btn_enable: false,
-      setp: 1,
-      formData: {
-        username: '',
-        password: ''
-      },
-      aweixin: null,
-      auths: [],
-      cur_date: Math.round(new Date() / 1000),
-      site: {},
-      isShowGuide: false,
-      imgLsit: ['static/images/init1.jpg', 'static/images/init2.jpg', 'static/images/init3.jpg', 'static/images/init4.jpg', 'static/images/init5.jpg'],
-      hei: '',
-      index: 0
-    }
-  },
-  created () {
-    document.body.addEventListener('blur', function (e) {
-      setTimeout(() => {
-        e.target.parentNode.parentNode.parentNode.classList.remove('field-focus')
-        self.input_focus = false
-      }, 100)
-    }, true)
-    document.body.addEventListener('focus', function (e) {
-      e.target.parentNode.parentNode.parentNode.classList.add('field-focus')
-      setTimeout(() => {
-        self.input_focus = true
-      }, 100)
-    }, true)
-
-    let self = this
-    self.$store.commit('SET_USERINFO', {})// 清空人员信息
-    self.$store.commit('SET_USERID', 0)
-    self.getServiceOauth()
-    if (window.plus) {
-      this.hei = plus.navigator.getStatusbarHeight()
-    }
-  },
-  watch: {
-    'formData': {
-      handler (val, oldVal) {
-        let self = this
-        if (val.username != '' && val.password != '') {
-          self.next_btn_enable = true
-        } else {
-          self.next_btn_enable = false
-        }
-      },
-      deep: true
-    }
-  },
-  methods: {
-    installWgt (path) {
-      if (!window.plus) {
-        return false
-      }
-      this.$toast.clear()
-      plus.runtime.install(path, {force: true }, function () {
-        plus.runtime.restart()
-      }, function (e) {
-        plus.runtime.restart()
-      })
-    },
-    downWgt (wgtUrl) {
-      let self = this
-      if (!window.plus) {
-        return false
-      }
-      plus.downloader.createDownload(wgtUrl, {filename: '_doc/update/'}, function (d, status) {
-        if (status == 200) {
-          self.installWgt(d.filename)
-        } else {
-          self.$toast.clear()
-        }
-      }).start()
-    },
-    // 检查更新
-    get_ver () {
-      let self = this
-      if (!window.plus) {
-        return false
-      }
-      plus.runtime.getProperty(plus.runtime.appid, function (inf) {
-        wgtVer = inf.version
-        if (!localStorage.getItem('a-token-temp')) {
-          return false
-        }
-        if (plus.webview.currentWebview().id != plus.runtime.appid) {
-          return false
-        }
-        request_user('post', '/api/version/check', { version: wgtVer.toString() }).then(res => {
-          self.info = res.data.data
-          // console.log(JSON.stringify(res.data.data))
-          if (res.data.code == 1) {
-            if (!res.data.data.status) {
-              self.$dialog.confirm({
-                title: '发现新版本' + res.data.data.new_version.version,
-                message: '确定要更新吗?(更新完成将自动重启)'
-              }).then(() => {
-                self.$toast.loading({
-                  mask: true,
-                  type: 'loading',
-                  message: '更新中...'
-                })
-                self.downWgt(res.data.data.new_version.app_path)
-              })
-            }
-          }
-        })
-      })
-    },
-    openDj () {
-      this.index++
-      if (this.index == 2) {
-        this.get_ver()
-        this.index = 0
-      }
-    },
-    openHome () {
-      setTimeout(() => {
-        window.location.href = window.location.href.split('#')[0]
-      }, 100)
-    },
-    sendJoin () {
-      let self = this
-      self.$toast.loading({
-        mask: true,
-        message: '正在处理...'
-      })
-      request_user('post', '/api/join/submit', {employee_id: this.employee_id, site_id: this.site_id}).then(res => {
-        self.$toast.clear()
-      })
-    },
-    show_error (msg) {
-      let self = this
-      self.login_error = true
-      setTimeout(function () {
-        self.login_error = false
-      }, 3000)
-      self.login_error_msg = msg
-    },
-    // 判断是否获取微信登录认证
-    getServiceOauth () {
-      var self = this
-      if (window.plus) {
-        plus.oauth.getServices(function (services) {
-          self.auths = services
-          for (let i in services) {
-            if (services[i].id == 'weixin') {
-              self.aweixin = services[i]
-            }
-          }
-        })
-      }
-    },
-    doWeixinLogin () {
-      let self = this
-      if (window.plus) {
-        if (self.aweixin == null) {
-          plus.nativeUI.alert('当前环境不支持微信登录')
-          return
-        }
-        self.aweixin.authorize(function (e) {
-          self.WeixinLogin(e.code)
-        }, function (e) {
-          plus.nativeUI.alert('授权失败:' + JSON.stringify(e))
-        }, {scope: 'snsapi_userinfo', state: 'authorize test', appid: 'wx78513a709dbea762'})
-      }
-    },
-    sendLogin () {
-      let self = this
-      self.$validator.validate().then(result => {
-        if (!result) {
-          self.$notify({ type: 'danger', message: self.$validator.errors.items[0].msg })
-        } else {
-          self.$toast.loading({
-            mask: true,
-            message: '正在登录...'
-          })
-          this.$store.dispatch('login', {tel: self.formData.username, password: self.formData.password}).then(res => {
-            if (self.site_id > 0 && self.site_id !== undefined && self.employee_id > 0 && self.employee_id !== undefined) {
-              self.sendJoin()
-            }
-            if (res.code == 1) {
-              localStorage.setItem('a-token-temp', res.data.token)// 保存平台账号登录的token
-              if (res.data.account_site.length > 0) { // 公司数量
-                if (res.data.invitation_wait_count > 0) {
-                  self.$router.push({name: 'registration_experience', query: {invite: 1, iscompany: 1}})// 选择行业
-                } else {
-                  self.$router.push({name: 'login_company_list'})// 选择企业
-                }
-              } else {
-                if (res.data.invitation_wait_count > 0) { // 待邀请数量
-                  self.$router.push({name: 'registration_experience', query: {invite: 1}})// 选择行业
-                } else {
-                  // self.get_try_list(function () {
-                  self.registrationExperience()
-                  // })
-                  // self.$router.push({name: 'registration_experience'})// 选择企业
-                }
-              }
-            } else {
-              self.$toast.fail({
-                message: res.msg,
-                duration: 1000
-              })
-            }
-          }).finally(() => {
-            self.$toast.clear()
-          })
-        }
-      })
-    },
-    get_try_list (func) {
-      let self = this
-      request_user('get', '/api/try/index').then(res => {
-        if (res.data.code == 1) {
-          this.site = res.data.data.site_list[0]
-          func()
-        } else {
-          self.$toast(res.data.msg)
-        }
-      })
-    },
-    // 直接进入,跳过选择行业与公司,体验账户专用
-    registrationExperience () {
-      let self = this
-      request_user('get', '/api/try/employees', {site_id: 888}).then(res => {
-        if (res.data.code == 1) {
-          let login_index = ''
-          for (let i in res.data.data) {
-            let role_list = res.data.data[i].role_list
-            for (let j in role_list) {
-              if (role_list[j].name == 'creator') {
-                login_index = i
-              }
-            }
-          }
-          if (login_index != '') {
-            setToken(res.data.data[login_index].token)
-            if (window.plus) {
-              plus.storage.removeItem('user_info')
-            } else {
-              localStorage.removeItem('user_info')
-            }
-            window.sessionStorage.setItem('__VCKEEPALIVE__', JSON.stringify(['/']))
-            window.sessionStorage.setItem('routers', '/')
-            // this.isShowGuide=true;
-            this.openHome()
-          } else {
-            self.$toast('体验登录失败')
-          }
-        } else {
-          self.$toast(res.data.msg)
-        }
-      })
-    },
-
-    WeixinLogin (code) {
-      let self = this
-      self.$toast.loading({
-        mask: true,
-        message: '正在登录...'
-      })
-      this.$store.dispatch('weixin_login', {code: code, platform: 'wechat'}).then(res => {
-        self.$toast.clear()
-        if (res.code == 1) {
-          localStorage.setItem('a-token-temp', res.data.token)// 保存平台账号登录的token
-          if (res.data.account_site.length > 0) {
-            self.$router.push({name: 'login_company_list'})
-          } else {
-            // 选择公司
-            self.$router.push({name: 'create_company'})
-          }
-        } else if (res.code == 1001) {
-          self.$router.push({name: 'bind_weixin'})
-        } else {
-          self.$notify({
-            message: res.msg,
-            duration: 1000,
-            background: '#f44'
-          })
-        }
-      })
-    }
-  }
-}
-</script>
-
-<style rel="stylesheet/scss" lang="scss" scoped>
-  .body_com{
-    background-color: #fff;
-    position: fixed;
-    top: 1rem;
-    left: 0;
-    right: 0;
-    bottom: 0;
-    overflow: auto;
-    z-index: 2;
-  }
-  .login_button {
-    height: 1rem;
-    line-height: 0.8rem;
-    border-radius: 0.15rem;
-  }
-  .imgLsit img {
-    height: 100%;
-    width: 100%;
-    vertical-align: bottom;
-  }
-  .input_focus.login-box {
-     height: calc(100% - 0rem);
-   }
-  .login-box {
-    height: calc(100%);
-    position: relative;
-  }
-  .login-box-parent .van-field__icon .van-icon {
-    color: #4b0;
-  }
-  .login-form-box-bg{
-    position: absolute;
-    top:-0.4rem;
-    left:0;
-    width:100%;
-    height:3.4rem;
-    color:#26A2FF;
-  }
-  .login_logo {
-    position: relative;
-    display: block;
-    margin: -1.45rem auto;
-    width: 3.6rem;
-    color: #FFF;
-    margin-bottom: 0rem;
-    z-index: 1;
-  }
-  .setp1,
-  .setp2 {
-    padding-bottom: 0.5rem;
-  }
-  .login-box-parent .mint-cell.cell-last:before {
-    bottom: 0;
-  }
-  .login-box .van-cell[data-v-1a0d0fb5]:not(:last-child)::after{
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-  .login-box .login-form-box .tel {
-    font-size:0.32rem;
-    margin-bottom: 0.16rem;
-    padding:0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-  .login-box .login-form-box .tel .login_tel {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.06rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-  .login-box .login-form-box .psw {
-    font-size:0.32rem;
-    margin-bottom: 0.16rem;
-    padding:0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-  .login-box .login-form-box .psw .login_pwd {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.05rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-  /deep/ .login-box input{
-    font-size:0.40rem !important;
-    color:#1c1c1c;
-    letter-spacing: 0.005rem;
-  }
-  .login-box ::-webkit-input-placeholder{
-    font-size:0.32rem;
-    color:#b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-  .login-box input:-ms-input-placeholder{
-    font-size:0.32rem;
-    color:#b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-  .login-box ::-moz-input-placeholder {
-    font-size:0.32rem;
-    color:#b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-  // .login-box .field-focus ::-webkit-input-placeholder{
-  //   color:#238cf9 !important;
-  // }
-  // .login-box input:-ms-input-placeholder {
-  //    color:#238cf9 !important;
-  //  }
-  // .login-box .field-focus ::-moz-input-placeholder {
-  //   color:#238cf9 !important;
-  // }
-  // .login-box .field-focus .login_tel{
-  //   color:#238cf9 !important;
-  // }
-  // .login-box .field-focus .login_pwd {
-  //   color:#238cf9 !important;
-  // }
-  .login-box .van-hairline--top-bottom:after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-  .login-box .van-hairline-unset--top-bottom:after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-  // /deep/ .login-box .field-focus:after {
-  //   border-bottom: 0.02rem #238cf9 solid !important;
-  // }
-  .login-box .van-row{
-    margin-top: 0.08rem;
-    font-size:0.28rem;
-  }
-  .login-box .van-row .van-col:not(:last-child){
-    color:#9e9da3;
-  }
-  .login-box .van-row .van-col{
-    color:#28a2f1;
-    letter-spacing: 0.005rem;
-  }
-  .login-box .login_button{
-    height: 1rem;
-    line-height: 0.8rem;
-    border-radius:0.04rem;
-  }
-  .footer {
-    font-size: 0.24rem;
-    line-height: 1rem;
-    text-align: center;
-    color: #999;
-    letter-spacing: 0.005rem;
-    margin-top: 50%;
-  }
-  .footer a {
-    color: #1989fa;
-  }
-</style>

+ 0 - 1
src/components/user/login1.vue

@@ -34,7 +34,6 @@
 <script>
 import Vue from "vue";
 import { Divider } from "vant";
-import request_user from "@/utils/request-user";
 import Cookies from 'js-cookie'
 
 import request from '@/utils/request'

+ 0 - 1
src/components/user/login2.vue

@@ -35,7 +35,6 @@
 <script>
 import Vue from "vue";
 import { Divider } from "vant";
-import request_user from "@/utils/request-user";
 import Cookies from 'js-cookie'
 
 import { getToken, setToken } from "@/utils/auth";

+ 16 - 8
src/components/user/login3.vue

@@ -34,7 +34,6 @@
 <script>
 import Vue from "vue";
 import { Divider } from "vant";
-import request_user from "@/utils/request-user";
 import Cookies from 'js-cookie'
 
 import request from '@/utils/request'
@@ -56,7 +55,7 @@ export default {
     console.log('进入登录页')
     if(cookGetToken()){
       setToken(cookGetToken());
-      this.detailAxiox()
+      this.detailAxiox(1)
     }else{
       console.log('无Token')
       window.location.href = process.env.BASE_API;//重新授权
@@ -66,15 +65,24 @@ export default {
   },
   watch: {},
   methods: {
-    detailAxiox(){
+    detailAxiox(add){
       request('get',process.env.BASE_API+'/api/employee/detail')
       .then(res => {
         if(res.data.code == 1){
-          this.$store.commit("SET_USERINFO", res.data.data.user); // 设置员工信息
-          window.sessionStorage.setItem('__VCKEEPALIVE__', JSON.stringify(['/']))
-          window.sessionStorage.setItem('routers', '/')
-          console.log(getToken());
-          wxAuth(true);
+          if(res.data.data.user.is_official == 0){
+            this.$router.push({
+              path: '/noAccess',
+              query: {
+                msg: '当前用户未授权进入系统,请联系管理员为您【启用积分管理】,<br/>如需咨询客服,请到您企业专属的功道云服务群咨询'
+              }
+            })
+          }else if(add == 1){
+            this.$store.commit("SET_USERINFO", res.data.data.user); // 设置员工信息
+            window.sessionStorage.setItem('__VCKEEPALIVE__', JSON.stringify(['/']))
+            window.sessionStorage.setItem('routers', '/')
+            console.log(getToken());
+            wxAuth(true);
+          }
         }
       })
     },

+ 0 - 562
src/components/user/reg.vue

@@ -1,562 +0,0 @@
-<template>
-
-  <div class="login-box-parent" style="background:#fff;">
-
-    <van-nav-bar title="用户注册" left-text="返回" @click-left="$route_back" left-arrow>
-      <div slot="right" @click="$router.push({name: 'login'})" style="display:none;">登录</div>
-
-    </van-nav-bar>
-
-    <div class="login-box" :class="{'input_focus': input_focus}">
-      <scroller>
-        <div class="login-form-box" style="background-color: #fff;">
-          <!-- App背景 -->
-          <div class="login-form-box-bg">
-            <icon name="login_logo_bg" class="login_logo_bg"></icon>
-          </div>
-          <div style="height: 0.2rem;"></div>
-          <div class="login_logo">
-            <icon name="logo" class="app_logn"></icon>
-          </div>
-          <div class="login-form-box" style="background-color: #fff;">
-
-            <div class="setp1" v-show="setp == 1">
-
-              <van-cell-group>
-
-                <van-field class="mobile"
-                           clearable
-                           v-model="formData.tel"
-                           placeholder="请输入手机号"
-                           :error-message="mobile_error"
-                           :icon="mobile_success"
-                           type="Number"
-                >
-                  <template slot="left-icon">
-                    <icon name="tel" class="login_mobile"></icon>
-                  </template>
-                </van-field>
-
-                <van-field class="message"
-                           clearable
-                           v-model="formData.verify"
-                           center
-                           type="Number"
-                           placeholder="请输入短信验证码"
-                           :error-message="verify_error"
-                >
-                  <template slot="left-icon">
-                    <icon name="message" class="login_message"></icon>
-                  </template>
-                  <van-button class="message_code" :loading="sendMsgLoading" slot="button" size="small" type="info"
-                              @click="sendMsg"
-                              :disabled="sended">
-                    {{sendMsgText}}
-                  </van-button>
-                </van-field>
-
-                <van-field class="message" v-show="false"
-                           clearable
-                           v-model="formData.verify"
-                           center
-                           type="Number"
-                           placeholder="请输入短信验证码"
-                           :error-message="verify_error"
-                >
-                  <template slot="left-icon">
-                    <icon name="message" class="login_message"></icon>
-                  </template>
-                  <van-button class="message_code" :loading="sendMsgLoading" slot="button" size="small" type="info"
-                              @click="sendMsg"
-                              :disabled="sended">
-                    {{sendMsgText}}
-                  </van-button>
-                </van-field>
-
-                <van-field class="rec_code" v-if="false" type="text" v-model="formData.aff_verify" clearable
-                           placeholder="推荐码(选填)"></van-field>
-
-              </van-cell-group>
-
-            </div>
-
-            <div v-show="setp == 2">
-              <van-cell-group>
-                <van-field class="set_pwd" type="text" v-model="formData.name" clearable placeholder="您的姓名">
-                  <template slot="left-icon">
-                    <icon name="user" class="login_user"></icon>
-                  </template>
-                </van-field>
-
-                <van-field class="comfim_pwd" type="password" v-model="formData.password" clearable placeholder="设置密码(6-16位数字和字母结合)">
-                  <template slot="left-icon">
-                    <icon name="pwd" class="login_pwd"></icon>
-                  </template>
-                </van-field>
-              </van-cell-group>
-            </div>
-
-            <div style="padding:0 0.32rem;" v-show="setp == 1">
-              <van-button class="login_button" :loading="reg_loading" size="large" :disabled="!complite_btn_enable1"
-                          @click="nextReg"
-                          type="info">下一步
-              </van-button>
-            </div>
-            <div style="padding:0 0.32rem;margin-top:0.5rem" v-show="setp == 2">
-              <van-button class="login_button" :loading="reg_loading" size="large" :disabled="!complite_btn_enable"
-                          @click="sendReg"
-                          type="info">完成注册
-              </van-button>
-            </div>
-
-          </div>
-        </div>
-      </scroller>
-    </div>
-
-    <div class="footer">登录即代表同意
-      <span style="color:#28a2f1" @click="$router.push({name: 'user_agreement'})">《用户服务协议》</span>
-      与
-      <span style="color:#28a2f1" @click="$router.push({name: 'privacy_agreement'})">《隐私协议》</span>
-    </div>
-  </div>
-</template>
-
-<script>
-import request_user from '@/utils/request-user'
-
-export default {
-  name: 'reg',
-  data () {
-    return {
-      complite_btn_enable1: false,
-      input_focus: false,
-      next_loading: false,
-      reg_loading: false,
-      tel_error: '',
-      verify_error: '',
-      mobile_error: '',
-      mobile_success: '',
-      complite_btn_enable: false,
-      login_error: false,
-      login_error_msg: '',
-      next_btn_enable: false,
-      setp: 1,
-      countdown: 90,
-      sended: false,
-      sendMsgText: '免费获取验证码',
-      sendMsgLoading: false,
-      formData: {
-        tel: '',
-        name: '',
-        password: '',
-        password_confirmation: '',
-        verify: '',
-        aff_verify: ''
-      }
-    }
-  },
-  created () {
-    let self = this
-    this.formData.aff_verify = this.$route.query.aff_verify
-    document.body.addEventListener('blur', function (e) {
-      setTimeout(() => {
-        e.target.parentNode.parentNode.parentNode.classList.remove('field-focus')
-        self.input_focus = false
-      }, 100)
-    }, true)
-    document.body.addEventListener('focus', function (e) {
-      setTimeout(() => {
-        e.target.parentNode.parentNode.parentNode.classList.add('field-focus')
-        self.input_focus = true
-      }, 100)
-    }, true)
-  },
-  watch: {
-    'formData': {
-      handler (val, oldVal) {
-        let self = this
-        if (val.tel != '' && val.verify != '') {
-          self.complite_btn_enable1 = true
-          self.next_btn_enable = true
-        } else {
-          self.complite_btn_enable1 = false
-          self.next_btn_enable = false
-        }
-
-        if (val.password != '') {
-          self.complite_btn_enable = true
-        } else {
-          self.complite_btn_enable = false
-        }
-      },
-      deep: true
-    }
-  },
-  methods: {
-    show_error (msg) {
-      let self = this
-      self.login_error = true
-      setTimeout(function () {
-        self.login_error = false
-      }, 3000)
-      self.login_error_msg = msg
-    },
-    nextReg () {
-      let self = this
-      self.next_loading = true
-      request_user('post', '/api/verify/check', {type: 1, tel: self.formData.tel, verify: self.formData.verify}).then((res) => {
-        if (res.data.code == 1) {
-          self.setp++
-        } else {
-          self.$notify({
-            message: res.data.msg,
-            duration: 1000,
-            background: '#f44'
-          })
-        }
-      }).finally(() => {
-        self.next_loading = false
-      })
-    },
-    countDownInit () {
-      let self = this
-      self.sendMsgText = '已发送(' + self.countdown + ')'
-      if (self.countdown == 0) {
-        self.countdown = 90
-        self.sendMsgText = '重新发送'
-        self.sended = false
-        return false
-      } else {
-        setTimeout(function () {
-          self.countdown--
-          self.countDownInit()
-        }, 1000)
-      }
-    },
-
-    sendLogin () {
-      let self = this
-      self.$toast.loading({
-        mask: true,
-        message: '正在登录...'
-      })
-      this.$store.dispatch('login', {tel: self.formData.tel, password: self.formData.password}).then(res => {
-        self.$toast.clear()
-        if (res.code == 1) {
-          const inviteNum = res.data.invitation_wait_count
-          localStorage.setItem('a-token-temp', res.data.token)
-          if (res.data.account_site.length > 0) {
-            self.$router.push({name: 'login_company_list'})
-          } else {
-            // 选择公司
-            if (inviteNum) {
-              self.$router.push({name: 'registration_experience', query: {invite: inviteNum}})
-            } else {
-              self.$router.push({name: 'registration_experience'})
-            }
-          }
-        } else {
-          self.$notify({
-            message: res.msg,
-            duration: 1000,
-            background: '#f44'
-          })
-        }
-      })
-    },
-
-    // 点击完成
-    sendReg () {
-      let self = this
-      if (!self.Pass_Word(self.formData.password)) {
-        self.$notify({
-          message: '密码格式错误',
-          duration: 1000,
-          background: '#f44'
-        })
-        return false
-      }
-      self.reg_loading = true
-      self.formData.password_confirmation = self.formData.password
-      this.$store.dispatch('reg', self.formData).then(res => {
-        self.reg_loading = false
-        if (res.code == 1) {
-          self.$toast(res.msg)
-          self.sendLogin()
-        } else {
-          self.$toast(res.msg)
-        }
-      }).catch(e => {
-        self.reg_loading = false
-      })
-    },
-
-    // 密码正则 6-16位数字和字母
-    Pass_Word (My_PassWord) {
-      if (!(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/.test(My_PassWord))) {
-        return false
-      } else {
-        return true
-      }
-    },
-
-    // 手机号正则
-    checkMobile (sMobile) {
-      if (!(/^1\d{10}$/.test(sMobile))) {
-        return false
-      } else {
-        return true
-      }
-    },
-
-    // 点击下一步
-    sendMsg () {
-      let self = this
-      if (!self.checkMobile(self.formData.tel)) {
-        self.$notify({
-          message: '手机号码错误',
-          duration: 1000,
-          background: '#f44'
-        })
-        return false
-      }
-      self.sendMsgLoading = true
-      self.$store.dispatch('sendMsg', self.formData.tel).then((res) => {
-        if (res.code == 0) {
-          self.$toast(res.msg)
-        } else if (res.code == 999) {
-          self.$toast(res.msg)
-        } else {
-          self.sended = true
-          self.countDownInit()
-          self.$toast('已经发送,请注意查收!')
-        }
-      }).finally(() => {
-        self.sendMsgLoading = false
-      })
-    }
-  }
-}
-</script>
-
-<style rel="stylesheet/scss" lang="scss" scoped>
-
-  .login-form-box-bg{
-    position: absolute;
-    top:-1rem;
-    left:0;
-    width:100%;
-    height:3.4rem;
-    color:#26A2FF;
-  }
-
-  .input_focus.login-box {
-    height: calc(100% - 0rem);
-  }
-
-  .login-box {
-    height: calc(100% - 2rem);
-    position: relative;
-  }
-
-  .login-box-parent .van-field__icon .van-icon {
-    color: #4b0;
-
-  }
-
-  .login_logo {
-    position: relative;
-    display: block;
-    margin: -1.05rem auto;
-    width: 3.6rem;
-    color: #FFF;
-    margin-bottom: 0rem;
-    z-index: 1;
-  }
-
-  .setp1, .setp2 {
-    padding-bottom: 0.5rem;
-  }
-
-  .login-box .login-form-box .mobile {
-    font-size: 0.32rem;
-    margin-bottom: 0.16rem;
-    padding: 0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-
-  .login-box .login-form-box .mobile .login_mobile {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.06rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-
-  // .login-box .field-focus .login_mobile {
-  //   color: #238cf9 !important;
-  // }
-
-  .login-box .login-form-box .message {
-    font-size: 0.32rem;
-    margin-bottom: 0.16rem;
-    padding: 0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-
-  .login-box .login-form-box .message .message_code {
-    font-size: 0.28rem;
-    letter-spacing: 0.005rem;
-    color: #1989fa;
-    border: none;
-    background: none;
-  }
-
-  .login-box .login-form-box .message .login_message {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.06rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-
-  // .login-box .field-focus .login_message {
-  //   color: #238cf9 !important;
-  // }
-
-  .login-box .login-form-box .set_pwd {
-    font-size: 0.32rem;
-    margin-bottom: 0.16rem;
-    padding: 0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-
-  .login-box .login-form-box .set_pwd .login_user {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.06rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-
-  // .login-box .field-focus .login_user {
-  //   color: #238cf9 !important;
-  // }
-
-  .login-box .login-form-box .comfim_pwd {
-    font-size: 0.32rem;
-    margin-bottom: 0.16rem;
-    padding: 0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-
-  .login-box .login-form-box .comfim_pwd .login_pwd {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.06rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-
-  // .login-box .field-focus .login_pwd {
-  //   color: #238cf9 !important;
-  // }
-
-  /deep/ .login-box input {
-    font-size: 0.40rem !important;
-    color: #1c1c1c;
-    letter-spacing: 0.005rem;
-  }
-
-  .login-box ::-webkit-input-placeholder {
-    font-size: 0.32rem;
-    color: #b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-
-  .login-box input:-ms-input-placeholder {
-    font-size: 0.32rem;
-    color: #b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-
-  .login-box ::-moz-input-placeholder {
-    font-size: 0.32rem;
-    color: #b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-
-  // .login-box .field-focus ::-webkit-input-placeholder {
-  //   color: #238cf9 !important;
-  // }
-
-  .login-box input:-ms-input-placeholder {
-    color: #26A2FF !important;
-  }
-
-  // .login-box .field-focus ::-moz-input-placeholder {
-  //   color: #238cf9 !important;
-  // }
-
-  .login-box .van-hairline--top-bottom:after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-
-  .login-box .van-hairline-unset--top-bottom:after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-
-  .login-box .van-cell:not(:last-child):after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-
-  // /deep/ .login-box .field-focus:after {
-  //   border-bottom: 0.02rem #238cf9 solid !important;
-  //   transform: scaleY(.5);
-  //   left: 0.32rem;
-  //   right: 0.32rem;
-  // }
-
-  .login-box .login_button {
-    height: 1rem;
-    line-height: 0.8rem;
-    border-radius: 0.04rem;
-  }
-
-  .login-box-parent .mint-cell.cell-last:before {
-    bottom: 0;
-  }
-
-  .footer {
-    font-size: 0.24rem;
-    line-height: 1rem;
-    text-align: center;
-    color: #999;
-    letter-spacing: 0.005rem;
-  }
-
-  .footer a {
-    color: #1989fa;
-  }
-</style>

+ 0 - 278
src/components/user/user_reg.vue

@@ -1,278 +0,0 @@
-<template>
-
-  <div class="login-box-parent">
-
-
-    <van-nav-bar title="帮助注册" left-text="返回" @click-left="$router.back(-1)" left-arrow>
-
-
-    </van-nav-bar>
-
-    <div class="login-box" style="background-color: #f5f5f5;">
-
-      <div style="height: 0.2rem;"></div>
-      <div class="login-form-box" style="background-color: #fff;">
-
-        <div class="setp1" v-show="setp == 1">
-
-
-          <van-cell-group>
-
-            <van-field
-              v-model="formData.user_name"
-              label="姓名"
-              placeholder="请输入姓名"
-              :error-message="username_error"
-            />
-
-            <van-field
-              v-model="formData.username"
-              label="手机号"
-              placeholder="请输入手机号"
-              :error-message="mobile_error"
-              :icon="mobile_success"
-            />
-
-
-            <van-field
-              v-model="formData.code"
-              center
-              clearable
-              label="验证码"
-              placeholder="请输入短信验证码"
-              :error-message="code_error"
-            >
-              <van-button :loading="sendMsgLoading" slot="button" size="small" type="primary" @click="sendMsg"
-                          :disabled="sended">
-                {{sendMsgText}}
-              </van-button>
-            </van-field>
-            <van-field label="设置密码" type="password" v-model="formData.password" placeholder="设置密码"></van-field>
-            <van-field label="确认密码" type="password" v-model="formData.password_check" placeholder="确认密码"></van-field>
-            <van-field :error-message="weixin_error" label="微信号" type="text" v-model="formData.weixin" placeholder="微信号"></van-field>
-            <van-field label="推荐码" type="text" v-model="formData.aff_code" placeholder="推荐码(选填)"></van-field>
-
-          </van-cell-group>
-
-
-        </div>
-
-
-        <div style="padding:0 0.32rem;">
-          <van-button :loading="reg_loading" size="large" :disabled="!complite_btn_enable" @click="sendReg"
-                      type="primary">注册
-          </van-button>
-        </div>
-
-
-
-      </div>
-
-    </div>
-
-  </div>
-</template>
-
-<script>
-  export default {
-    name: 'reg',
-    data () {
-      return {
-        next_loading: false,
-        reg_loading: false,
-        username_error: '',
-        code_error: '',
-        weixin_error:'',
-        mobile_error: '',
-        mobile_success: '',
-        complite_btn_enable: false,
-        login_error: false,
-        login_error_msg: '',
-        next_btn_enable: false,
-        setp: 1,
-        countdown: 90,
-        sended: false,
-        sendMsgText: '免费获取验证码',
-        sendMsgLoading: false,
-        formData: {
-          username: '',
-          password: '',
-          password_check: '',
-          weixin:'',
-          code: '',
-          aff_code:'',
-          user_name:''
-        }
-      }
-    },
-    created(){
-      this.formData.aff_code = this.$route.query.aff_code
-    },
-    watch: {
-      'formData': {
-        handler (val, oldVal) {
-          let self = this
-          if (val.username != '' && val.code != '') {
-            self.next_btn_enable = true
-          } else {
-            self.next_btn_enable = false
-          }
-
-          if(val.user_name == ''){
-            self.username_error = '请输入姓名'
-          }else{
-            self.username_error = ''
-          }
-
-          if(val.weixin == ''){
-            self.weixin_error = '请输入微信号'
-          }else{
-            self.weixin_error = ''
-          }
-
-
-          if (!self.checkMobile(val.username)) {
-            self.mobile_error = '手机号格式错误'
-            self.mobile_success = ''
-          } else {
-            self.mobile_error = ''
-            self.mobile_success = 'success'
-          }
-
-          if (val.password != '' && val.password_check != '') {
-            self.complite_btn_enable = true
-          } else {
-            self.complite_btn_enable = false
-          }
-        },
-        deep: true
-      }
-    },
-    methods: {
-      show_error (msg) {
-        let self = this
-        self.login_error = true
-        setTimeout(function () {
-          self.login_error = false
-        }, 3000)
-        self.login_error_msg = msg
-      },
-      nextReg () {
-        let self = this
-        self.next_loading = true
-        this.$store.dispatch('check_code', self.formData).then(res => {
-          self.next_loading = false
-          if (res.code == 1) {
-            self.setp++
-          } else {
-            self.$notify({
-              message: res.msg,
-              duration: 1000,
-              background: '#f44'
-            })
-          }
-        })
-      },
-      countDownInit () {
-        let self = this
-        self.sendMsgText = '已发送(' + self.countdown + ')'
-        if (self.countdown == 0) {
-          self.countdown = 90
-          self.sendMsgText = '重新发送'
-          self.sended = false
-          return false
-        } else {
-          setTimeout(function () {
-            self.countdown--
-            self.countDownInit()
-          }, 1000)
-        }
-      },
-
-      sendLogin () {
-        let self = this
-        self.$toast.loading({
-          mask: true,
-          message: '正在登录...'
-        })
-        this.$store.dispatch('login', self.formData).then(res => {
-          self.$toast.clear()
-          if (res.code == 0) {
-            self.$notify({
-              message: res.msg,
-              duration: 1000,
-              background: '#f44'
-            })
-          } else {
-            self.$router.push({name: 'home'})
-          }
-        })
-      },
-
-      sendReg () {
-        let self = this
-        self.reg_loading = true
-        this.$store.dispatch('reg', self.formData).then(res => {
-          self.reg_loading = false
-          if (res.code == 1) {
-            self.$toast(res.msg)
-            //self.sendLogin()
-            window.history.go(-1)
-          } else {
-            self.$toast(res.msg)
-          }
-
-        })
-      },
-
-      checkMobile (sMobile) {
-        if (!(/^1\d{10}$/.test(sMobile))) {
-          return false
-        } else {
-          return true
-        }
-      },
-
-      sendMsg () {
-        let self = this
-        self.sendMsgLoading = true
-        self.$store.dispatch('sendMsg', self.formData.username).then((res) => {
-          if (res.data.code == 1) {
-            self.sended = true
-            self.sendMsgLoading = false
-            self.countDownInit()
-            self.$toast('已经发送,请注意查收!')
-          } else {
-            self.sendMsgLoading = false
-            self.$toast(res.data.msg)
-          }
-        })
-      }
-    }
-  }
-</script>
-
-<style rel="stylesheet/scss" lang="scss">
-
-  .login-box-parent .van-field__icon .van-icon {
-    color: #4b0;
-  }
-
-  .login-logo {
-    width: 6.52rem;
-    margin: 0 auto;
-    display: block !important;
-    height: 3.5rem;
-  }
-
-  .setp1, .setp2 {
-    padding-bottom: 0.36rem;
-  }
-
-  .login-box-parent .mint-cell.cell-last:before {
-
-    bottom: 0;
-
-  }
-
-</style>

+ 0 - 95
src/components/user/username_edit.vue

@@ -1,95 +0,0 @@
-<template>
-  <div>
-    <van-nav-bar right-text="保存" title="修改资料" left-text="返回" @click-left="$route_back" @click-right="employee_update" left-arrow>
-
-    </van-nav-bar>
-    <div class="body_com" style="background-color: #f1f1f1;">
-      <scroller>
-        <van-cell-group>
-          <van-field required ref="nickname_input" label="姓名" v-model="account_info.name" placeholder="输入您的姓名"   maxlength="6"/>
-        </van-cell-group>
-      </scroller>
-    </div>
-  </div>
-</template>
-
-<script>
-import Vue from 'vue'
-import { DatetimePicker } from 'vant'
-import moment from 'moment'
-import request_user from '@/utils/request-user'
-Vue.use(DatetimePicker)
-export default {
-  name: 'employee_edit',
-  data () {
-    return {
-      submit_loading: false,
-      userinfo: this.$store.getters.user_info,
-      account_info: this.$store.getters.account_info
-    }
-  },
-  created () {
-    this.$nextTick(() => {
-      this.$refs['nickname_input'].focus()
-    })
-  },
-  methods: {
-    employee_update () {
-      let self = this
-      if (self.userinfo.nickname == '') {
-        self.$toast('姓名不能为空!')
-        return false
-      }
-      self.submit_loading = true
-      self.$toast.loading({
-        mask: true,
-        message: '正在处理'
-      })
-      request_user('post', '/api/account/edit', {name: self.account_info.name, img_url: self.account_info.img_url}).then((res) => {
-        self.submit_loading = false
-        if (res.data.code == 1) {
-          self.$toast(res.data.msg)
-          if (window.plus) {
-            plus.storage.removeItem('account_info')
-          } else {
-            localStorage.removeItem('account_info')
-          }
-          if (window.plus) {
-            let all_view = plus.webview.all()
-            for (let i = 0; i < all_view.length; i++) {
-              all_view[i].evalJS('window.VueObj.$store.dispatch("get_account_info").then(function(res){window.VueObj.$forceUpdate();});')
-            }
-          } else {
-            self.$store.dispatch('get_account_info')
-          }
-          self.$toast.clear()
-          setTimeout(() => {
-            self.$route_back()
-          }, 500)
-        } else {
-          self.$toast(res.data.msg)
-        }
-      }).catch((e) => {
-        self.$toast(e)
-      })
-    }
-  }
-}
-</script>
-
-<style scoped>
-  /deep/ .van-cell--required::before{left: 0.2rem;}
-  /deep/ .van-field__label{padding-left: 0.05rem;}
-  /deep/ .van-field__control{text-align: left;}
-  .submit_btn_box{padding:0.32rem;}
-  .body_com{height: calc(100% - 0.92rem); position: relative;}
-  .sex-cell .van-cell__title{width:1.8rem; display: block;-webkit-box-flex: none;
-    -webkit-flex: none;
-    flex: none;}
-  .sex-cell .van-radio{float:left; margin-right:0.5rem;}
-  .hiredate-cell .van-cell__title{width:1.8rem; display: block;-webkit-box-flex: none;
-    -webkit-flex: none;
-    flex: none;}
-  .hiredate-cell .van-cell__value{
-    text-align: left;}
-</style>

+ 2 - 1
src/main.js

@@ -30,10 +30,11 @@ import Icon1 from 'vue2-svg-icon/Icon'
 import VueScroller from '@/components/common/scroller/src'
 import noData from '@/components/common/noData'
 
-import {getTypes, getUserData } from '@/utils/auth'
+import {getTypes, getUserData, isPt_id } from '@/utils/auth'
 
 Vue.prototype.$userInfo=getUserData;
 Vue.prototype.$getTypes = getTypes()
+Vue.prototype.$isPt_id = isPt_id
 
 // wx通讯录
 import wwOpenDAtas from '@/view/wxOpendata'

+ 22 - 30
src/permission.js

@@ -5,6 +5,7 @@ import store from './store'
 import request from '@/utils/request'
 import {getToken, setToken, cookGetToken} from '@/utils/auth'
 const whiteList = ['/login', '/reg', '/pwdforget'] // no redirect whitelist
+const stopPath = ['/login', '/noAccess', '/']
 import { wxAuth } from "@/utils/wx-auth-two.js";
 router.beforeEach((to, from, next) => {
   if (Vue.$httpRequestList.length > 0) { //强行中断时才向下执行
@@ -12,19 +13,24 @@ router.beforeEach((to, from, next) => {
       item('interrupt'); //给个标志,中断请求
     })
   }
-  if (cookGetToken()){//Cook中A-Token
-    setToken(cookGetToken())
-    detailAxiox()//员工详细信息
-    // Cookies.remove('Admin-Token')
-    Cookies.remove('Admin-Token')
-    thens(to, from, next)
-  } else if (getToken()) {//local中A-Token
-    console.log('无cook,走localStorage')
-    thens(to, from, next)
-  } else {
+  //首页按返回到登录 或 初始化时--直接退出
+  if(from.path == '/home' && ( to.path == '/login'  || to.path == '/init' || to.path == '/') || from.path == '/noAccess'){
+    wx.closeWindow();//关闭当前网页窗口
+    return false
+  }
+  if(stopPath.indexOf(to.path) !== -1){
+    next()
+  }else{
+    if (cookGetToken()){//Cook中A-Token
+      setToken(cookGetToken())
+      detailAxiox()//员工详细信息
+      Cookies.remove('Admin-Token')
+      thens(to, from, next)
+    } else if (getToken()) {//local中A-Token
+      thens(to, from, next)
+    } else {
       if (!window.$routes_map[to.name].need_login) { // 在免登录白名单,直接进入
         if(to.name=='init'&&localStorage.getItem('init')){
-          window.document.title = '用户登录'
           next('/login')
         }else{
           if (typeof(window.$routes_map[to.name]) != 'undefined') {
@@ -33,34 +39,21 @@ router.beforeEach((to, from, next) => {
           next()
         }
       } else {
-        window.document.title = '用户登录'
-        next('/login')
+        window.location.href = process.env.BASE_API//直接重新授权
+        // next('/')
       }
+    }
   }
 })
 
 function thens(to, from, next){
-  // if (to.path == '/login'||to.name == 'init') { // 在免登录白名单,直接进入
-  //   next({ name: 'home'})
-  //   return false
-  // }
-  if (typeof(window.$routes_map[to.name]) != 'undefined') {
-    window.document.title = window.$routes_map[to.name].label
-  } else {
-    window.document.title = '管理中心'
-  }
-  console.log(window.$routes_map)
-  
   console.log('跳转后的path:')
   console.log(to.path)
   console.log('跳转前的path:')
   console.log(from.path)
-  //首页按返回到登录 或 初始化时--直接退出
-  if(to.path == '/login' && from.path == '/home' || to.path == '/init' && from.path == '/home' || to.path == '/' && from.path == '/home'){
-    wx.closeWindow();//关闭当前网页窗口
-    return false
+  if(to.name !== 'home'){
+    window.document.title = window.$routes_map[to.name].label
   }
-  
   if (to.path == '/login' || to.name == 'init') { // 在免登录白名单,直接进入
     next({ name: 'home'})
   }
@@ -74,7 +67,6 @@ function thens(to, from, next){
 }
 
 function init(to) {
-
   store.dispatch('get_user_info', getToken()).then((res) => { //获取用户信息
     if (router.history.current.name == 'login' && to.name != 'home') {
       router.push({

+ 114 - 0
src/permissionbf.js

@@ -0,0 +1,114 @@
+import Vue from 'vue'
+import Cookies from 'js-cookie'
+import router from './router'
+import store from './store'
+import request from '@/utils/request'
+import {getToken, setToken, cookGetToken} from '@/utils/auth'
+const whiteList = ['/login', '/reg', '/pwdforget'] // no redirect whitelist
+import { wxAuth } from "@/utils/wx-auth-two.js";
+router.beforeEach((to, from, next) => {
+  if (Vue.$httpRequestList.length > 0) { //强行中断时才向下执行
+    Vue.$httpRequestList.forEach(item => {
+      item('interrupt'); //给个标志,中断请求
+    })
+  }
+  if(to.path == '/noAccess' || to.path == '/login' || to.path == '/'){ 
+    next()
+    return
+ }
+
+  if (cookGetToken()){//Cook中A-Token
+    setToken(cookGetToken())
+    detailAxiox()//员工详细信息
+    // Cookies.remove('Admin-Token')
+    Cookies.remove('Admin-Token')
+    thens(to, from, next)
+  } else if (getToken()) {//local中A-Token
+    console.log('无cook,走localStorage')
+    thens(to, from, next)
+  } else {
+      if (!window.$routes_map[to.name].need_login) { // 在免登录白名单,直接进入
+        if(to.name=='init'&&localStorage.getItem('init')){
+          // window.document.title = '用户登录'
+          next('/login')
+        }else{
+          if (typeof(window.$routes_map[to.name]) != 'undefined') {
+            window.document.title = window.$routes_map[to.name].label
+          }
+          next()
+        }
+      } else {
+        // window.document.title = '用户登录'
+        next('/login')
+      }
+  }
+})
+
+function thens(to, from, next){
+  // if (to.path == '/login'||to.name == 'init') { // 在免登录白名单,直接进入
+  //   next({ name: 'home'})
+  //   return false
+  // }
+  if (typeof(window.$routes_map[to.name]) != 'undefined') {
+    window.document.title = window.$routes_map[to.name].label
+  } else {
+    // window.document.title = '工作台'
+  }
+  console.log(window.$routes_map)
+  
+  console.log('跳转后的path:')
+  console.log(to.path)
+  console.log('跳转前的path:')
+  console.log(from.path)
+  //首页按返回到登录 或 初始化时--直接退出
+  if(to.path == '/login' && from.path == '/home' || to.path == '/init' && from.path == '/home' || to.path == '/' && from.path == '/home'){
+    wx.closeWindow();//关闭当前网页窗口
+    return false
+  }
+  
+  if (to.path == '/login' || to.name == 'init') { // 在免登录白名单,直接进入
+    next({ name: 'home'})
+  }
+  // 初始一些数据
+  init(to);
+  // next();
+  console.log('wxAuth12121221121221888')
+  console.log(router.history.current.name)
+  wxAuth(false,next,to)
+
+}
+
+function init(to) {
+  store.dispatch('get_user_info', getToken()).then((res) => { //获取用户信息
+    if (router.history.current.name == 'login' && to.name != 'home') {
+      router.push({
+        name: 'home'
+      })
+      return false
+    }
+    if (store.getters.user_info.try_user == 1) { //判断是否试用账号
+      store.dispatch("setBuyPopup",true);
+    }else{
+       store.dispatch("setBuyPopup",false);
+    }
+  });
+  store.dispatch('get_point_types').then(res => {}); //获取积分类型
+  // 数据更新,每两分钟更新一次
+  store.dispatch('get_employee_map').then((res) => {}); //获取人员列表
+  // store.dispatch('get_account_info').then((res) => {}); //获取公司信息
+
+}
+
+function detailAxiox(){
+  request('get',process.env.BASE_API+'/api/employee/detail')
+  .then(res => {
+    if(res.data.code == 1){
+      store.commit("SET_USERINFO", res.data.data.user); // 设置员工信息
+      window.sessionStorage.setItem('__VCKEEPALIVE__', JSON.stringify(['/']))
+      window.sessionStorage.setItem('routers', '/')
+      console.log(getToken());
+      console.log(JSON.parse(localStorage.getItem('user_info')))
+      console.log(store.getters.user_info)
+    }
+  })
+}

+ 5 - 26
src/router/index.js

@@ -10,13 +10,6 @@ let routes = [
     label: '初始化',
     need_login: false
   },
-  {
-    path: '/guide',
-    name: 'guide',
-    component: () => import('@/view/guide'),
-    label: '指南',
-    need_login: false
-  },
   {
     path: '/home',
     name: 'home',
@@ -45,13 +38,6 @@ let routes = [
     label: '用户登录',
     need_login: false
   },
-  {
-    path: '/reg',
-    name: 'reg',
-    component: () => import('@/components/user/reg'),
-    label: '用户注册',
-    need_login: false
-  },
   {
     path: '/invite_reg',
     name: 'invite_reg',
@@ -155,7 +141,7 @@ let routes = [
     path: '/add_common_menu',
     name: 'add_common_menu',
     component: () => import('@/components/user/add_common_menu'),
-    label: '添加常用菜单',
+    label: '添加常用应用',
     need_login: true
   },
   {
@@ -265,13 +251,6 @@ let routes = [
     label: '我的组织',
     need_login: true
   },
-  {
-    path: '/registration_experience',
-    name: 'registration_experience',
-    component: () => import('@/components/ems/registration_experience'),
-    label: '注册体验',
-    need_login: false
-  },
   {
     path: '/login_company_list',
     name: 'login_company_list',
@@ -618,7 +597,7 @@ let routes = [
     path: '/taskFile',
     name: 'taskFile',
     component: () => import('@/components/integral/taskFile'),
-    label: '绩效工作',
+    label: '工作详情',
     need_login: true
   },
   {
@@ -773,7 +752,7 @@ let routes = [
     path: '/ranking_detail',
     name: 'ranking_detail',
     component: () => import('@/components/integral/ranking_detail'),
-    label: '绩效统计',
+    label: '自定义排名',
     need_login: true
   },
   {
@@ -822,14 +801,14 @@ let routes = [
     path: '/integral_rank',
     name: 'integral_rank',
     component: () => import('@/components/integral/integral_rank'),
-    label: '积分排名',
+    label: '阶段排名',
     need_login: true
   },
   {
     path: '/rankB',
     name: 'rankB',
     component: () => import('@/components/integral/rankB'),
-    label: '累计B分排',
+    label: '累计B分排',
     need_login: true
   },
   {

+ 11 - 111
src/store/modules/user.js

@@ -1,7 +1,7 @@
-import {reg, sendMsg, sendcheckcode} from '@/api/reg'
-import {login, get_info, forgetSendMsg, pwd_reset, weixin_login, get_account_info, get_point_types, get_employee_map,getMenu} from '@/api/login'
+import {get_info, get_point_types, get_employee_map,getMenu} from '@/api/login'
 import {setToken, setUserId, getToken} from '@/utils/auth'
 import moment from 'moment'
+import router from '@/router'
 
 const user = {
   state: {
@@ -134,16 +134,6 @@ const user = {
             })
         })
     },
-    // 用户注册
-    reg({commit}, userInfo) {
-      return new Promise((resolve, reject) => {
-        reg(userInfo).then(response => {
-          resolve(response.data)
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
     clear_cache({dispatch,commit}){
        commit('SET_USERINFO','');
       if(window.plus){
@@ -209,52 +199,6 @@ const user = {
       }
       dispatch('get_employee_map')
     },
-    update_account_info({dispatch}){
-      if(window.plus){
-        plus.storage.removeItem('account_info')
-      }else{
-        localStorage.removeItem('account_info')
-      }
-      dispatch('get_account_info')
-    },
-    pwd_reset({commit}, userInfo) {
-      return new Promise((resolve, reject) => {
-        pwd_reset(userInfo).then(response => {
-          resolve(response.data)
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
-    get_account_info({commit}){
-      return new Promise((resolve, reject) => {
-        let account_info = null
-        if (window.plus) {
-          account_info = JSON.parse(plus.storage.getItem('account_info'))
-        } else {
-          account_info = JSON.parse(localStorage.getItem('account_info'))
-        }
-        let nowDate = moment().format("YYYY-MM-DD HH:mm:ss");
-        if(account_info && moment(nowDate).isBefore(account_info.data.localStorageExpire)){
-          commit('SET_ACCOUNTINFO', account_info.data)
-          resolve(account_info)
-        }else{
-          get_account_info().then(response => {
-            response.data.data.localStorageExpire = moment().add(Math.floor(Math.random() * (120 - 60 + 1)) + 60, "second").format("YYYY-MM-DD HH:mm:ss")
-            commit('SET_ACCOUNTINFO', response.data.data)
-            if (window.plus) {
-              plus.storage.setItem('account_info', JSON.stringify({data:response.data.data}))
-            } else {
-              localStorage.setItem('account_info', JSON.stringify({data:response.data.data}))
-            }
-            resolve(response.data)
-          }).catch(error => {
-            reject(error)
-          })
-        }
-
-      })
-    },
 
     get_employee_map({commit},is){
       return new Promise((resolve, reject) => {
@@ -375,6 +319,15 @@ const user = {
         let nowDate = moment().format("YYYY-MM-DD HH:mm:ss");
         if(token=='isShow'){
             get_info(getToken()).then(response => {
+              if(response.data.data.user.is_official == 0){
+                router.push({
+                  path: '/noAccess',
+                  query: {
+                    msg: '当前用户未授权进入系统,请联系管理员为您【启用积分管理】,<br/>如需咨询客服,请到您企业专属的功道云服务群咨询'
+                  }
+                })
+                return
+              }
               response.data.data.user.localStorageExpire = moment().add(Math.floor(Math.random() * (120 - 60 + 1)) + 60, "second").format("YYYY-MM-DD HH:mm:ss")
               commit('SET_USERINFO', response.data.data.user)
               if (window.plus) {
@@ -393,7 +346,6 @@ const user = {
         } else {
           user_info = JSON.parse(localStorage.getItem('user_info'))
         }
-        // console.log(user_info)
         if (user_info && user_info.data.id && moment(nowDate).isBefore(user_info.data.localStorageExpire)) {
           commit('SET_USERINFO', user_info.data)
           resolve({code: 1, msg: '', data: {user: user_info}})
@@ -415,58 +367,6 @@ const user = {
 
       })
     },
-
-    check_code({commit}, userInfo) {
-      return new Promise((resolve, reject) => {
-        sendcheckcode(userInfo).then(response => {
-          resolve(response.data)
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
-
-    login({commit}, userInfo) {
-      return new Promise((resolve, reject) => {
-        login(userInfo).then(response => {
-          resolve(response.data)
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
-
-    weixin_login({commit}, data) {
-      return new Promise((resolve, reject) => {
-        weixin_login(data).then(response => {
-          if(response.data.code == 1001){
-            //用户没有绑定,缓存bind_token
-            localStorage.setItem('bind_token_weixin', response.data.data.bind_token)
-          }
-          resolve(response.data)
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
-    sendMsg({commit}, mobile) {
-      return new Promise((resolve, reject) => {
-        sendMsg(mobile).then(response => {
-          resolve(response.data)
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
-    forgetSendMsg({commit}, mobile) {
-      return new Promise((resolve, reject) => {
-        forgetSendMsg(mobile).then(response => {
-          resolve(response.data)
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
   }
 }
 

+ 13 - 0
src/utils/auth.js

@@ -215,3 +215,16 @@ export function _throttle(fn, interval=500) {
     }
   }
 }
+export function isPt_id(item){
+  switch (item){
+    case 1:
+      return '绩效分'
+      break;
+    case 2:
+      return 'A分'
+      break;
+    case 3:
+      return 'B分'
+      break;
+  }
+}

+ 46 - 23
src/utils/request.js

@@ -66,22 +66,30 @@ service.interceptors.response.use(
       }
       return response
     } else if (response.data.code === 401) {
-      Dialog.alert({
-        message: '当前登录授权时间已经过期,请重新授权登录',
-      }).then(() => {
-        Cookies.remove('Admin-Token')
+      // Dialog.alert({
+      //   message: '当前登录授权时间已经过期,请重新授权登录',
+      // }).then(() => {
+      //   Cookies.remove('Admin-Token')
+      //   if (window.plus) {
+      //     plus.storage.clear()
+      //   } else {
+      //     window.localStorage.clear()
+      //   }
+        // router.replace({
+        //   name: 'login'
+        // });
+        
         if (window.plus) {
           plus.storage.clear()
         } else {
-          window.localStorage.clear()
+          localStorage.clear()
         }
+        Cookies.remove('Admin-Token')
+        window.location.href = process.env.BASE_API//直接重新授权
         // router.replace({
-        //   name: 'login'
+        //   name: 'init'
         // });
-        router.push({
-          name: 'login'
-        });
-      });
+      // });
     } 
     // else if (response.data.code === 4444) {
     //   Dialog.alert({
@@ -126,20 +134,35 @@ service.interceptors.response.use(
       });
       return Promise.reject('error')
     } else if (response.data.code === 4444) { //系统过期
-      Dialog.alert({
-        title: '系统已到期',
-        message: "请在功道云积分服务群中联系客服顾问或电话咨询:<span class='color-blue'>400-6877-880</span>",
-        theme: 'round-button',
-      }).then(() => {
-        if (window.plus) {
-          Cookies.remove('Admin-Token')
-          plus.storage.clear()
-        } else {
-          Cookies.remove('Admin-Token')
-          window.localStorage.clear()
+      console.log(response)
+      if (window.plus) {
+        plus.storage.clear()
+      } else {
+        localStorage.clear()
+      }
+      console.log('requser:4444')
+      console.log(response.data.msg)
+      router.push({
+        path: '/noAccess',
+        query: {
+          msg: response.data.msg
         }
-        router.replace({name: 'login'});
-      });
+      })
+      return Promise.reject('error')
+      // Dialog.alert({
+      //   title: '系统已到期',
+      //   message: "请在功道云积分服务群中联系客服顾问或电话咨询:<span class='color-blue'>400-6877-880</span>",
+      //   theme: 'round-button',
+      // }).then(() => {
+      //   if (window.plus) {
+      //     Cookies.remove('Admin-Token')
+      //     plus.storage.clear()
+      //   } else {
+      //     Cookies.remove('Admin-Token')
+      //     window.localStorage.clear()
+      //   }
+      //   router.replace({name: 'login'});
+      // });
     } else {
       return response
     }

+ 3 - 0
src/utils/wx-auth-two.js

@@ -26,7 +26,10 @@ export const wxAuth = async (ifHome, next, to) => {
       } else {
         console.log('走next()')
         if (next) {
+          console.log(to)
+          console.log(next)
           next()
+          console.log('111')
         }
       }
     }

+ 0 - 113
src/view/android.vue

@@ -1,113 +0,0 @@
-<template>
-  <div>
-    <div class="android_body">
-      <div class="content" ref="content" >
-        <div class="logo">
-          <img src="static/images/downloadPageLogo.png" alt="logo"  style="width: 1.6rem;" />
-        </div>
-        <div class="title">功道云7.0</div>
-        <div class="describe">管理执行难就用功道云</div>
-        <img src="static/images/downloadPagePhone.png" alt="phone" style="width: 90vw;" />
-        <van-row>
-          <van-col span="10" offset="7" >
-            <van-button class="downloadBtn" type="info" block @click="downloadBtn" >立 即 下 载</van-button>
-          </van-col>
-        </van-row>
-      </div>
-    </div>
-    <van-overlay :show="showOverlay" class-name="WeChatOverlay">
-      <div class="upIconDiv">
-        <img src="static/images/WeChatUpIcon.png" style="width: .5rem; height: .5rem" alt="upIcon">
-      </div>
-      <div style="text-align: center; color: #fff; margin-top: 1rem">
-        <p><h3>温馨提示:</h3></p>
-        <p>1、点击右上角菜单。</p>
-        <p>2、选择【浏览器】打开,再下载。</p>
-        <van-row>
-          <van-col span="8" offset="8" >
-            <van-button type="default" plain hairline block @click="showOverlay = false">关 闭</van-button>
-          </van-col>
-        </van-row>
-      </div>
-    </van-overlay>
-  </div>
-</template>
-
-<script>
-import Vue from 'vue'
-import { Overlay, Button } from 'vant'
-import moment from 'moment'
-Vue.use(Overlay).use(Button)
-export default {
-  name: 'android_download',
-  data () {
-    return {
-      showOverlay: false,
-      contentHeight: ''
-    }
-  },
-  created () {
-  },
-  methods: {
-    downloadBtn () {
-      let type = navigator.userAgent
-      // let name = navigator.userAgent.toLowerCase()
-      var startTime = moment().format('YYYYMMDDhhmmss')
-      if (type.indexOf('Android') > -1 || type.indexOf('Linux') > -1) {
-        window.open('https://gdyapp.oss-cn-shenzhen.aliyuncs.com/app70/apk/gongdaoyun.apk?v=' + startTime, '_blank')
-      } else if (type.indexOf('iPhone') > -1 || type.indexOf('iOS') > -1) {
-        window.open('https://apps.apple.com/cn/app/%e5%8a%9f%e9%81%93%e4%ba%91%e7%bb%a9%e6%95%88%e8%80%83%e6%a0%b8/id1517932085', '_blank')
-      }
-    }
-  },
-  mounted () {
-    let name = navigator.userAgent.toLowerCase()
-    if (name.match(/MicroMessenger/i) == 'micromessenger') {
-      this.showOverlay = true
-    }
-  }
-}
-</script>
-
-<style scoped rel="stylesheet/scss" lang="scss" >
-  .android_body{
-    height: 100vh;
-    width: 100vw;
-    background-color: #26A2FF;
-    color: #fff;
-    .title{
-      font-size: .64rem;
-      font-weight: bold;
-    }
-    .describe{
-      font-size: .4rem;
-      padding: 0.1rem 0 0.4rem;
-    }
-    .downloadBtn{
-      background-color: #fff;
-      color: #26A2FF;
-      border-radius: 5px;
-    }
-  }
-  .WeChatOverlay{
-    width: 100vw;
-    height: 100vh;
-  }
-  .upIconDiv{
-    position:absolute;
-    right: 15px;
-    top: 0;
-    transform: rotate(45deg);
-  }
-  .content{
-    position: absolute;
-    top: 0;
-    left: 0;
-    bottom: 0;
-    right: 0;
-    margin: auto;
-    text-align: center;
-    height: 90vh;
-  }
-
-</style>

+ 0 - 55
src/view/guide.vue

@@ -1,55 +0,0 @@
-<template>
-  <div>
-    <van-nav-bar  title="三分钟了解“功道云”" left-text="返回" @click-left="$route_back" left-arrow></van-nav-bar>
-    <div class="body_com" :style="{ height: !$route.query.init ? 'calc(100% - 0.92rem)' : 'calc(100%)' }">
-      <!-- <scroller> -->
-        <div class="imgLsit"><img :src="item" v-for="(item, index) in imgLsit" :key="index" /></div>
-<!--        <div v-if="$route.query.init" style="padding:0.32rem">
-          <van-button class="login_button" color="#228bf8" size="large" @click="openHome()" type="info">立即体验</van-button>
-        </div> -->
-      <!-- </scroller> -->
-    </div>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'guide',
-  data () {
-    return {
-      imgLsit: []
-    }
-  },
-  mounted() {
-    console.log(this.$route.query.init)
-    this.$nextTick(function () {
-      this.imgLsit = ['static/images/init1.jpg', 'static/images/init2.jpg', 'static/images/init3.jpg', 'static/images/init4.jpg', 'static/images/init5.jpg']
-    })
-  },
-  methods: {
-    openHome () {
-      setTimeout(() => {
-        window.location.href = window.location.href.split('#')[0]
-      }, 100)
-    }
-  }
-}
-</script>
-
-<style rel="stylesheet/scss" lang="scss" scoped>
-.body_com {
-  height: 100%;
-  position: relative;
-  overflow: auto;
-}
-.login_button {
-  height: 1rem;
-  line-height: 0.8rem;
-  border-radius: 0.15rem;
-}
-.imgLsit img {
-  height: 100%;
-  width: 100%;
-  vertical-align: bottom;
-}
-</style>

+ 0 - 80
src/view/index.vue

@@ -1,80 +0,0 @@
-<template>
-  <div>
-    <scroller>
-      <input type="text" v-model="filter.keywords" placeholder=""/>
-      <ul>
-        <li v-for="(item,index) in list" :key="index">{{item.category_path}}
-        <p>{{item.remark}}</p>
-        </li>
-      </ul>
-       <mt-butto @click="menushow=true">open</mt-button>
-       <div v-if="menushow">145as4d5f4asd54f5d4f5dsfa</div>
-    </scroller>
-  </div>
-</template>
-
-<script>
-import request from '@/utils/request'
-import SideMenu from '@/components/common/SideMenu'
-
-export default {
-  components: {SideMenu},
-  name: 'index',
-  data () {
-    return {
-      list: [],
-      menushow: false,
-      filter: {
-        page: 1,
-        keywords: '',
-        point_type: 0,
-        dept_id: 0,
-        time_range: '',
-        employee_id: 1526
-      }
-    }
-  },
-  watch: {
-    'filter.keywords': function (new_val, old_val) {
-      this.init()
-    }
-  },
-  created () {
-    this.init()
-  },
-  methods: {
-    init () {
-      let self = this
-      self.$indicator.open()
-      request('get','/integral.php/ajax_request_common/get_integral_events',self.filter).then((res) => {
-        self.list = res.data.list_data
-        self.$indicator.close()
-      })
-    },
-
-    run () {
-      let self = this
-      self.t = setTimeout(function () {
-        self.pos.x = self.pos.x + 1
-        self.pos.y = self.pos.y + 1
-        self.run()
-      }, self.speed)
-    },
-    stop () {
-      if (this.t != null) {
-        clearTimeout(this.t)
-      }
-    },
-    reset () {
-      this.stop()
-      this.pos = {x: 0, y: 30}
-    }
-  }
-}
-</script>
-
-<style scoped>
-  .desk {
-    position: absolute;
-  }
-</style>

+ 3 - 37
src/view/init.vue

@@ -1,59 +1,25 @@
 <template>
-  <!-- <van-swipe class="my-swipe" indicator-color="#228dfa" :loop="false">
-    <van-swipe-item>
-        <img src="static/images/init1.jpg"/>
-    </van-swipe-item>
-    <van-swipe-item>
-        <img src="static/images/init2.jpg"/>
-    </van-swipe-item>
-    <van-swipe-item>
-        <img src="static/images/init3.jpg"/>
-    </van-swipe-item>
-    <van-swipe-item>
-        <img src="static/images/init4.jpg"/>
-    </van-swipe-item>
-    <van-swipe-item>
-        <img src="static/images/init5.jpg" @click="openIndex()"/>
-    </van-swipe-item>
-  </van-swipe> -->
   <div>
 
   </div>
 </template>
 
 <script>
-// import Vue from 'vue'
-// import { Swipe, SwipeItem } from 'vant'
-// Vue.use(Swipe).use(SwipeItem)
 export default {
   name: 'init',
   data () {
     return {}
   },
   created() {
+    // this.$router.replace({name: 'login'})
+  },
+  activated(){
     this.$router.replace({name: 'login'})
   },
   methods: {
-    // openIndex () {
-    //   localStorage.setItem('init', true)
-    //   this.$router.replace({name: 'home'})
-    // }
   }
 }
 </script>
 
 <style scoped="scoped" rel="stylesheet/less">
-    /* .my-swipe .van-swipe-item {
-      width: 100%;
-      height: 100%;
-      text-align: center;
-      background-color: #39a9ed;
-    }
-    .my-swipe img {
-      width: 100%;
-      height: 100%;
-    }
-   /deep/ .van-swipe__indicator{
-      background-color: #AAAAAA;
-    } */
 </style>

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff