people.vue 5.8 KB

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