StaffAdd.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <div class="seek" @click="showChooseSex === false">
  3. <div class="com-mobile-header mobile-center-header">
  4. <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
  5. <p>新增账户</p>
  6. <p class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>
  7. </div>
  8. <div class="mobile-fix-content mobile-centerfix-content" id="mobile-staff-center">
  9. <div class="staff-head">
  10. <span class="inline-block" :class="{'active': switchType === 'addNoRegister'}" @click="setSwitchType('addNoRegister')">添加未注册用户</span>
  11. <span class="inline-block" :class="{'active': switchType === 'addRegister'}" @click="setSwitchType('addRegister')">添加已注册用户</span>
  12. </div>
  13. <div class="staff-record" v-if="switchType == 'addNoRegister'" >
  14. <div class="list-content">
  15. <ul class="staff-adds">
  16. <li><span>姓名:</span><input type="text" v-model="newUserName" placeholder="请输入用户名"></li>
  17. <li style="overflow: visible;"><span>性别:</span>
  18. <div class="sex-filter">
  19. <div class="select-wrap" @click="openChoose">{{sex === 'M' ? '男' : '女'}}<i class="iconfont icon-arrow-down"></i></div>
  20. <ul class="select-list" v-if="showChooseSex">
  21. <li v-show="sex != 'M'" @click="chooseSex('M')">男</li>
  22. <li v-show="sex != 'F'" @click="chooseSex('F')">女</li>
  23. </ul>
  24. </div>
  25. </li>
  26. <li><span>手机号:</span><input type="text" v-model="newUserPhone" placeholder="请输入手机号"></li>
  27. <li><span>邮箱:</span><input type="text" v-model="newUserEmail" placeholder="请输入邮箱"></li>
  28. </ul>
  29. <div class="staff-footer">
  30. <div class="cancel handle">取消</div>
  31. <div class="agree handle" @click="addNewUser">确定</div>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="staff-record" v-if="switchType == 'addRegister'">
  36. <div class="search-content">
  37. <input type="text" placeholder="请输入UU号、手机号或邮箱">
  38. <span><i class="iconfont icon-sousuo"></i></span>
  39. </div>
  40. <div class="list-content">
  41. <div class="staff-list">
  42. <div class="list-item"><span>UU账号:</span><span>100000721</span></div>
  43. <div class="list-item"><span>姓名:</span><span>张洪别</span></div>
  44. <div class="list-item"><span>性别:</span><span>男</span></div>
  45. <div class="list-item"><span>手机号:</span><span>12345678901</span></div>
  46. <div class="list-item"><span>邮箱:</span><span>12345678901</span></div>
  47. </div>
  48. <div class="staff-footer">
  49. <div class="cancel handle">取消</div>
  50. <div class="agree handle">确定绑定</div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </template>
  57. <script>
  58. import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
  59. export default {
  60. data () {
  61. return {
  62. switchType: 'addNoRegister',
  63. newUserName: '',
  64. newUserPhone: '',
  65. newUserEmail: '',
  66. showChooseSex: false,
  67. sex: 'M'
  68. }
  69. },
  70. components: {
  71. RemindBox,
  72. PullUp,
  73. EmptyStatus
  74. },
  75. computed: {
  76. },
  77. methods: {
  78. setSwitchType (type) {
  79. this.switchType = type
  80. },
  81. openChoose () {
  82. this.showChooseSex = true
  83. },
  84. chooseSex (info) {
  85. this.sex = info
  86. this.showChooseSex = false
  87. },
  88. addNewUser () {
  89. this.$http.post('/basic/user', {userEmail: this.newUserEmail, userName: this.newUserName, userSex: this.sex, userTel: this.newUserPhone})
  90. .then(response => {
  91. console.log(response)
  92. })
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. $base-color: #3f84f6;
  99. #mobile-staff-center {
  100. .staff-head {
  101. height: .82rem;
  102. line-height: .82rem;
  103. text-align: center;
  104. background: #fff;
  105. span {
  106. font-size: .29rem;
  107. &:first-child {
  108. margin-right: 2.6rem;
  109. }
  110. &.active {
  111. color: $base-color;
  112. border-bottom: 1px solid $base-color;
  113. }
  114. }
  115. }
  116. .staff-record {
  117. .search-content {
  118. overflow: hidden;
  119. padding: .25rem 0;
  120. text-align: center;
  121. input {
  122. width: 6.9rem;
  123. border: 1px solid #376ff3;
  124. }
  125. }
  126. .list-content{
  127. margin: 0 auto;
  128. padding: 0 .20rem;
  129. .staff-adds {
  130. margin: 0.25rem auto 0;
  131. padding: 0 .24rem;
  132. width: 6.64rem;
  133. background-color: #ffffff;
  134. border-radius: .05rem;
  135. li{
  136. overflow: hidden;
  137. height: 1.18rem;
  138. line-height: 1.18rem;
  139. border-bottom: 1px solid #d9d9d9;
  140. list-style: none;
  141. span {
  142. display: inline-block;
  143. float: left;
  144. width: 1rem;
  145. font-size: .28rem;
  146. color: #3f84f6;
  147. }
  148. input{
  149. float: left;
  150. width: 4.85rem;
  151. border: none;
  152. outline: none;
  153. }
  154. div.sex-filter {
  155. float: left;
  156. position: relative;
  157. margin-top: .3rem;
  158. width: .73rem;
  159. height: .58rem;
  160. line-height: .58rem;
  161. border-radius: .05rem;
  162. border: solid 1px #b4b4b4;
  163. .select-wrap {
  164. width: .73rem;
  165. height: .58rem;
  166. text-align: center;
  167. i{
  168. font-size: .1rem;
  169. font-weight: bold;
  170. color: $base-color;
  171. }
  172. }
  173. ul.select-list{
  174. width: .73rem;
  175. position: absolute;
  176. left: -0.02rem;
  177. top: .59rem;
  178. border: solid 1px #b4b4b4;
  179. border-top: none;
  180. -webkit-box-shadow: 0 1px 5px 0 #aaa;
  181. box-shadow: 0 1px 5px 0 #aaa;
  182. border-radius: .04rem;
  183. li{
  184. background: #fff;
  185. text-align: center;
  186. padding: 0 .13rem;
  187. font-size: .28rem;
  188. height: .53rem;
  189. line-height: .53rem;
  190. }
  191. }
  192. }
  193. &:last-child {
  194. border-bottom: none;
  195. }
  196. }
  197. }
  198. .staff-footer{
  199. overflow: hidden;
  200. margin-top: .6rem;
  201. div.handle{
  202. float: left;
  203. width: 3.24rem;
  204. height: .77rem;
  205. line-height: .77rem;
  206. font-size: .32rem;
  207. color: #fff;
  208. text-align: center;
  209. border-radius: .08rem;
  210. &:first-child{
  211. margin: 0 .28rem 0 .2rem;
  212. background-color: #acaaab;
  213. }
  214. &:last-child{
  215. background-color: #3f84f6 ;
  216. }
  217. }
  218. }
  219. .staff-list {
  220. margin: 0 auto;
  221. padding: .35rem .24rem .15rem;
  222. width: 6.64rem;
  223. background-color: #ffffff;
  224. border-radius: .05rem;
  225. .list-item {
  226. overflow: hidden;
  227. span{
  228. float: left;
  229. font-size: .28rem;
  230. color: #3f84f6;
  231. &:first-child{
  232. width: 1.3rem;
  233. }
  234. &:last-child{
  235. width: 4.8rem;
  236. color: #666;
  237. }
  238. }
  239. }
  240. }
  241. }
  242. }
  243. }
  244. </style>