people.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view>
  3. <scroll-view scroll-y class="page">
  4. <!-- 头部logo-->
  5. <view class="UCenter-bg">
  6. <image :src="personalList.avatar" class="png round animation-slide-right margin-bottom-sm" mode="scaleToFill" :style="[{animationDelay: '0.1s'}]"></image>
  7. <image src="https://static.jeecg.com/upload/test/wave_1595818053612.gif" mode="scaleToFill" class="gif-wave"></image>
  8. </view>
  9. <view class="padding flex text-center text-grey bg-white shadow-warp">
  10. <view class="flex flex-sub flex-direction solid-right animation-slide-top" :style="[{animationDelay: '0.2s'}]">
  11. <view class="text-xl text-orange">{{personalList.username}}</view>
  12. <view class="margin-top-sm"><text class="cuIcon-people"></text> 用户</view>
  13. </view>
  14. <view class="flex flex-sub flex-direction animation-slide-top" :style="[{animationDelay: '0.2s'}]">
  15. <view class="text-xl text-green">{{personalList.post?personalList.post:'员工'}}</view>
  16. <view class="margin-top-sm"><text class="cuIcon-news"></text> 职务</view>
  17. </view>
  18. </view>
  19. <!-- 列表list-->
  20. <view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius">
  21. <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
  22. <view class="content" >
  23. <text class="cuIcon-favorfill text-yellow"></text>
  24. <text class="text-grey">收藏</text>
  25. </view>
  26. </view>
  27. <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.2s'}]">
  28. <view class="content">
  29. <text class="cuIcon-redpacket_fill text-red"></text>
  30. <text class="text-grey">红包</text>
  31. </view>
  32. </view>
  33. <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.3s'}]" @tap="scan">
  34. <view class="content">
  35. <text class="cuIcon-scan text-red"></text>
  36. <text class="text-grey">扫码</text>
  37. </view>
  38. </view>
  39. <navigator class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.4s'}]" url="/pages/user/location" hover-class="none">
  40. <view class="content" >
  41. <text class="cuIcon-location text-cyan"></text>
  42. <text class="text-grey">定位</text>
  43. </view>
  44. </navigator>
  45. <navigator class="cu-item arrow animation-slide-bottom" url="/pages/user/userdetail" :style="[{animationDelay: '0.6s'}]">
  46. <view class="content">
  47. <text class="cuIcon-settingsfill text-cyan"></text>
  48. <text class="text-grey">设置</text>
  49. </view>
  50. </navigator>
  51. <navigator class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.7s'}]" url="/pages/user/userexit" hover-class="none">
  52. <view class="content" >
  53. <text class="cuIcon-exit text-cyan"></text>
  54. <text class="text-grey">退出</text>
  55. </view>
  56. </navigator>
  57. </view>
  58. <view class="cu-tabbar-height"></view>
  59. </scroll-view>
  60. </view>
  61. </template>
  62. <script>
  63. import api from '@/api/api'
  64. export default {
  65. name: "people",
  66. data() {
  67. return {
  68. personalList:{
  69. avatar:'',
  70. realname:'',
  71. username:'',
  72. post:''
  73. },
  74. positionUrl:'/sys/position/list',
  75. departUrl:'/sys/user/userDepartList',
  76. userUrl:'/sys/user/queryById',
  77. postUrl:'/sys/position/queryByCode',
  78. userId:'',
  79. id:''
  80. };
  81. },
  82. watch: {
  83. cur: {
  84. immediate: true,
  85. handler() {
  86. console.log('watch',this.cur)
  87. this.userId=this.$store.getters.userid;
  88. this.load()
  89. },
  90. },
  91. },
  92. methods: {
  93. scan(){
  94. console.log("进来了")
  95. // #ifndef H5
  96. uni.scanCode({
  97. success: function (res) {
  98. console.log('条码res:' + res);
  99. console.log('条码类型:' + res.scanType);
  100. console.log('条码内容:' + res.result);
  101. }
  102. });
  103. // #endif
  104. // #ifdef H5
  105. this.$tip.alert("暂不支持")
  106. // #endif
  107. },
  108. load(){
  109. if(!this.userId){
  110. return;
  111. }
  112. this.$http.get(this.userUrl,{params:{id:this.userId}}).then(res=>{
  113. console.log("res",res)
  114. if (res.data.success) {
  115. let perArr = res.data.result
  116. let avatar=(perArr.avatar && perArr.avatar.length > 0)? api.getFileAccessHttpUrl(perArr.avatar):'/static/avatar_boy.png'
  117. this.personalList.avatar =avatar
  118. this.personalList.realname = perArr.realname
  119. this.personalList.username = perArr.username
  120. this.personalList.depart = perArr.departIds
  121. this.getpost(perArr.post)
  122. }
  123. }).catch(err => {
  124. console.log(err);
  125. });
  126. },
  127. getpost(code){
  128. if(!code||code.length==0){
  129. this.personalList.post='员工'
  130. return false;
  131. }
  132. this.$http.get(this.postUrl,{params:{code:code}}).then(res=>{
  133. console.log("postUrl",res)
  134. if (res.data.success) {
  135. this.personalList.post=res.data.result.name
  136. }
  137. }).catch(err => {
  138. console.log(err);
  139. });
  140. }
  141. }
  142. }
  143. </script>
  144. <style>
  145. .UCenter-bg {
  146. /* #ifdef MP-WEIXIN */
  147. background-image: url('https://static.jeecg.com/upload/test/blue_1595818030310.png');
  148. /* #endif */
  149. /* #ifndef MP-WEIXIN */
  150. background-image: url('/static/blue.png');
  151. /* #endif */
  152. background-size: cover;
  153. height: 400rpx;
  154. display: flex;
  155. justify-content: center;
  156. padding-top: 40rpx;
  157. overflow: hidden;
  158. position: relative;
  159. flex-direction: column;
  160. align-items: center;
  161. color: #fff;
  162. font-weight: 300;
  163. text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
  164. }
  165. .UCenter-bg text {
  166. opacity: 0.8;
  167. }
  168. .UCenter-bg image {
  169. width: 200rpx;
  170. height: 200rpx;
  171. }
  172. .UCenter-bg .gif-wave{
  173. position: absolute;
  174. width: 100%;
  175. bottom: 0;
  176. left: 0;
  177. z-index: 99;
  178. mix-blend-mode: screen;
  179. height: 100rpx;
  180. }
  181. map,.mapBox{
  182. left: 0;
  183. z-index: 99;
  184. mix-blend-mode: screen;
  185. height: 100rpx;
  186. }
  187. map,.mapBox{
  188. width: 750rpx;
  189. height: 300rpx;
  190. }
  191. </style>