userdetail.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <view>
  3. <scroll-view scroll-y class="page">
  4. <cu-custom bgColor="bg-gradual-pink" :isBack="true">
  5. <block slot="backText">返回</block>
  6. <block slot="content">用户详情</block>
  7. <!-- <view slot="right" @tap="rightClick">编辑</view> -->
  8. </cu-custom>
  9. <!-- list列表 -->
  10. <view class="cu-list menu">
  11. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
  12. <view class="content">
  13. <text class="text-grey">头像</text>
  14. </view>
  15. <view class="action">
  16. <view class="cu-avatar round sm" :style="{backgroundImage: 'url(' + personalMsg.avatar + ')'}"></view>
  17. </view>
  18. </view>
  19. <!-- <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.2s'}]">
  20. <view class="content">
  21. <text class="text-grey">账号</text>
  22. </view>
  23. <view class="action">
  24. <text class="text-grey">{{personalMsg.username}}</text>
  25. </view>
  26. </view> -->
  27. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.3s'}]">
  28. <view class="content">
  29. <text class="text-grey">工号</text>
  30. </view>
  31. <view class="action">
  32. <text class="text-grey">{{personalMsg.workNo}}</text>
  33. </view>
  34. </view>
  35. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.4s'}]">
  36. <view class="content">
  37. <text class="text-grey">姓名</text>
  38. </view>
  39. <view class="action">
  40. <text class="text-grey">{{personalMsg.realname}}</text>
  41. </view>
  42. </view>
  43. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.5s'}]">
  44. <view class="content">
  45. <text class="text-grey">性别</text>
  46. </view>
  47. <view class="action">
  48. <text class="text-grey">{{personalMsg.sex}}</text>
  49. </view>
  50. </view>
  51. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.6s'}]">
  52. <view class="content">
  53. <text class="text-grey">英文名</text>
  54. </view>
  55. <view class="action">
  56. <text class="text-grey">{{personalMsg.egName}}</text>
  57. </view>
  58. </view>
  59. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.7s'}]">
  60. <view class="content">
  61. <text class="text-grey">职位</text>
  62. </view>
  63. <view class="action">
  64. <text class="text-grey">{{personalMsg.post}}</text>
  65. </view>
  66. </view>
  67. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.8s'}]">
  68. <view class="content">
  69. <text class="text-grey">部门</text>
  70. </view>
  71. <view class="action">
  72. <text class="text-grey">{{personalMsg.orgCodeTxt}}</text>
  73. </view>
  74. </view>
  75. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.9s'}]">
  76. <view class="content">
  77. <text class="text-grey">邮箱</text>
  78. </view>
  79. <view class="action">
  80. <text class="text-grey">{{personalMsg.email}}</text>
  81. </view>
  82. </view>
  83. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1s'}]">
  84. <view class="content">
  85. <text class="text-grey">手机号码</text>
  86. </view>
  87. <view class="action">
  88. <text class="text-grey">{{personalMsg.phone}}</text>
  89. </view>
  90. </view>
  91. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1.1s'}]">
  92. <view class="content">
  93. <text class="text-grey">出生日期</text>
  94. </view>
  95. <view class="action">
  96. <text class="text-grey">{{personalMsg.birthday}}</text>
  97. </view>
  98. </view>
  99. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1.2s'}]">
  100. <view class="content">
  101. <text class="text-grey">入职日期</text>
  102. </view>
  103. <view class="action">
  104. <text class="text-grey">{{personalMsg.entryDate}}</text>
  105. </view>
  106. </view>
  107. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1.3s'}]">
  108. <view class="content">
  109. <text class="text-grey">紧急联系人</text>
  110. </view>
  111. <view class="action">
  112. <text class="text-grey">{{personalMsg.urgentName}}</text>
  113. </view>
  114. </view>
  115. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1.4s'}]">
  116. <view class="content">
  117. <text class="text-grey">联系人电话</text>
  118. </view>
  119. <view class="action">
  120. <text class="text-grey">{{personalMsg.urgentPhone}}</text>
  121. </view>
  122. </view>
  123. </view>
  124. </scroll-view>
  125. </view>
  126. </template>
  127. <script>
  128. import api from '@/api/api.js'
  129. export default {
  130. data() {
  131. return {
  132. personalMsg:{
  133. avatar:'',
  134. realname:'',
  135. username:'',
  136. post:'',
  137. depart:'',
  138. phone:'',
  139. workNo:'',
  140. birthday:'',
  141. email:'',
  142. sex:'',
  143. egName:'',
  144. birthDate:'',
  145. entryDate:'',
  146. urgentName:'',
  147. urgentPhone:'',
  148. availableDay:'',
  149. orgCodeTxt:'',
  150. leaveDate:'',
  151. sum:''
  152. },
  153. userUrl:'/sys/user/queryById',
  154. positionUrl:'/sys/position/list',
  155. departUrl:'/sys/user/userDepartList'
  156. };
  157. },
  158. onLoad() {
  159. this.loadinfo()
  160. /* this.tt() */
  161. },
  162. methods: {
  163. /* tt(){
  164. var str="今天上海市有暴雨请带好防护装备";
  165. var url= "http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=6&text="+str;
  166. new Audio(url).play();
  167. }, */
  168. sign(){
  169. this.$Router.push({name:'usersign'})
  170. },
  171. getSubStringText(text,len){
  172. if(!text || text.length==0){
  173. return ''
  174. }
  175. if(text.length<len){
  176. return text;
  177. }
  178. return text.substr(0,len)+"..."
  179. },
  180. rightClick(){
  181. this.$Router.push({name:'useredit', params:this.personalMsg})
  182. /* uni.navigateTo({
  183. url: '/pages/user/useredit?item='+item
  184. }); */
  185. },
  186. loadinfo(){
  187. this.$http.get(this.userUrl,{params:{id:this.$store.getters.userid}}).then(res=> {
  188. console.log("用户",res)
  189. if (res.statusCode==200) {
  190. let result = res.data.data
  191. let avatar=(result.avatar && result.avatar.length > 0)? api.getFileAccessHttpUrl(result.avatar):'/static/avatar_boy.png'
  192. this.personalMsg.avatar = avatar
  193. this.personalMsg.realname = result.realname
  194. this.personalMsg.username = result.username
  195. this.personalMsg.post = result.post
  196. this.personalMsg.depart = result.departIds
  197. this.personalMsg.phone=result.phone
  198. this.personalMsg.workNo=result.workNo
  199. this.personalMsg.birthday=result.birthday
  200. this.personalMsg.email=result.email
  201. if(result.sex==1){
  202. this.personalMsg.sex='男';
  203. }else{
  204. this.personalMsg.sex='女';
  205. }
  206. this.personalMsg.egName=result.egName
  207. this.personalMsg.birthDate=result.birthDate
  208. this.personalMsg.entryDate=result.entryDate
  209. this.personalMsg.urgentName=result.urgentName
  210. this.personalMsg.urgentPhone=result.urgentPhone
  211. if(res.data.sign!="" &&res.data.sign!=undefined){
  212. this.personalMsg.availableDay=res.data.sign.availableDay
  213. this.personalMsg.leaveDate=res.data.sign.leaveDate
  214. }
  215. this.personalMsg.orgCodeTxt=result.orgCodeTxt
  216. this.personalMsg.sum=res.data.sum
  217. }
  218. }).catch(e=>{
  219. console.log("请求错误",e)
  220. })
  221. /* this.$http.get(this.departUrl,{params:{userId:this.$store.getters.userid}}).then(res=> {
  222. if (res.success) {
  223. for (let item of res.result){
  224. this.personalMsg.orgCode = item.title
  225. this.personalMsg.departIds = item.title
  226. }
  227. }
  228. }).catch(e=>{
  229. console.log("请求错误",e)
  230. })
  231. this.$http.get(this.positionUrl).then(res=> {
  232. if (res.success) {
  233. let postArr = res.result.records
  234. for (let item of postArr ){
  235. if (this.personalMsg.post == item.code){
  236. this.personalMsg.post = item.name
  237. }
  238. }
  239. }
  240. }).catch(e=>{
  241. console.log("请求错误",e)
  242. }) */
  243. },
  244. }
  245. }
  246. </script>
  247. <style>
  248. .page {
  249. height: 100Vh;
  250. width: 100vw;
  251. }
  252. .page.show {
  253. overflow: hidden;
  254. }
  255. .switch-sex::after {
  256. content: "\e716";
  257. }
  258. .switch-sex::before {
  259. content: "\e7a9";
  260. }
  261. .switch-music::after {
  262. content: "\e66a";
  263. }
  264. .switch-music::before {
  265. content: "\e6db";
  266. }
  267. </style>