people.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view>
  3. <scroll-view scroll-y class="page">
  4. <!-- 头部logo-->
  5. <view class="UCenter-bg" >
  6. <div class="tx">
  7. <image @tap="ChooseImage" :src="personalList.avatar" round class="png animation-slide-right margin-bottom-sm" mode="widthFix" :style="[{animationDelay: '0.1s'}]"></image>
  8. <!-- <text class='cuIcon-cameraadd'style="position: absolute;margin-top: 70px;margin-left: -10px;"></text> -->
  9. <image src="../../static/vip.png" style="position: absolute;margin-top: 75px;margin-left: -30px;width: 20px;height: 20px;"></image>
  10. </div>
  11. <image src="/static/wave.gif" mode="scaleToFill" class="gif-wave"></image>
  12. </view>
  13. <!-- 个人信息卡片-->
  14. <!-- <view class="cu-list menu-avatar">
  15. <view class="cu-item">
  16. <view class="cu-avatar round lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg);"></view>
  17. <view class="content flex-sub">
  18. <view class="text-grey">{{personalList.avatar}}</view>
  19. <view class="text-gray text-sm flex justify-between">
  20. 经理
  21. </view>
  22. </view>
  23. </view>
  24. </view> -->
  25. <view class="padding flex text-center text-grey bg-white shadow-warp">
  26. <view class="flex flex-sub flex-direction solid-right animation-slide-top" :style="[{animationDelay: '0.2s'}]">
  27. <view class="text-xl text-orange">{{personalList.username}}</view>
  28. <view class="margin-top-sm"><text class="cuIcon-people"></text> 用户</view>
  29. </view>
  30. <view class="flex flex-sub flex-direction animation-slide-top" :style="[{animationDelay: '0.2s'}]">
  31. <view class="text-xl text-green">{{personalList.post?personalList.post:'员工'}}</view>
  32. <view class="margin-top-sm"><text class="cuIcon-news"></text> 职务</view>
  33. </view>
  34. </view>
  35. <!-- 列表list-->
  36. <view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius">
  37. <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
  38. <navigator class="content" url="/pages/user/userdetail" hover-class="none">
  39. <text class="cuIcon-expressman text-cyan"></text>
  40. <text class="text-grey">个人信息</text>
  41. </navigator>
  42. </view>
  43. <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.3s'}]">
  44. <navigator class="content" url="/pages/user/userpwd" hover-class="none">
  45. <text class="cuIcon-edit text-cyan"></text>
  46. <text class="text-grey">修改密码</text>
  47. </navigator>
  48. </view>
  49. <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.5s'}]">
  50. <navigator class="content" hover-class="none" @click="dt()">
  51. <text class="cuIcon-forward text-cyan"></text>
  52. <text class="text-grey">位置</text>
  53. </navigator>
  54. </view>
  55. <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.7s'}]">
  56. <navigator class="content" url="/pages/user/userexit" hover-class="none">
  57. <text class="cuIcon-exit text-cyan"></text>
  58. <text class="text-grey">退出</text>
  59. </navigator>
  60. </view>
  61. </view>
  62. <view class="cu-tabbar-height"></view>
  63. </scroll-view>
  64. </view>
  65. </template>
  66. <script>
  67. import api from '@/api/api'
  68. export default {
  69. name: "people",
  70. data() {
  71. return {
  72. personalList:{
  73. avatar:'',
  74. realname:'',
  75. username:'',
  76. post:''
  77. },
  78. positionUrl:'/sys/position/list',
  79. departUrl:'/sys/user/userDepartList',
  80. userUrl:'/sys/user/queryById',
  81. userId:'',
  82. id:'',
  83. Url:'/sys/user/editUser',
  84. uploadUrl:"/sys/common/upload",
  85. };
  86. },
  87. watch: {
  88. cur: {
  89. immediate: true,
  90. handler() {
  91. console.log('watch',this.cur)
  92. this.load()
  93. },
  94. },
  95. },
  96. methods: {
  97. zf(){
  98. this.$Router.push({name:'appzf'})
  99. /* this.$http.post(this.ul,{params:{}}).then(res=>{
  100. console.log(res)
  101. this.showModal=true;
  102. this.initQrCode(res.data.qrCode)
  103. }).catch(err => {
  104. console.log(err);
  105. }); */
  106. },
  107. dt(){
  108. /* uni.getLocation({
  109. type: 'wgs84',
  110. success: function (res) {
  111. console.log('当前位置的经度:' + res.longitude);
  112. console.log('当前位置的纬度:' + res.latitude);
  113. }
  114. }); */
  115. /* http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=6&text= */
  116. uni.chooseLocation({
  117. success: function (res) {
  118. console.log('位置名称:' + res.name);
  119. console.log('详细地址:' + res.address);
  120. console.log('纬度:' + res.latitude);
  121. console.log('经度:' + res.longitude);
  122. this.latitude=res.latitude;
  123. this.longitude=res.longitude;
  124. }
  125. });
  126. },
  127. /* remove(){
  128. uni.removeStorageSync('Access-Token')
  129. }, */
  130. ChooseImage() {
  131. var that=this;
  132. uni.chooseImage({
  133. count: 4, //默认9
  134. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  135. sourceType: ['album'], //从相册选择
  136. success: (res) => {
  137. /* alert(res.tempFilePaths) */
  138. that.$http.upload(that.$config.apiUrl+that.uploadUrl, {
  139. filePath: res.tempFilePaths[0],
  140. name: 'file'
  141. })
  142. .then(res => {
  143. console.log(res)
  144. if(res.statusCode==200){
  145. this.$http.get(this.Url,{params:{id:this.$store.getters.userid,avatar:res.data.message}}).then(res=>{
  146. if(res.data.code==200){
  147. this.load();
  148. this.$tip.success('更换成功!')
  149. }
  150. }).catch(err => {
  151. console.log(err);
  152. });
  153. }
  154. })
  155. .catch(err => {
  156. that.$tip.error(err.data.message)
  157. });
  158. }
  159. });
  160. },
  161. load(){
  162. console.log("id"+this.$store.getters.userid)
  163. this.$http.get(this.userUrl,{params:{id:this.$store.getters.userid}}).then(res=>{
  164. console.log("res",res)
  165. if (res.statusCode==200) {
  166. let perArr = res.data.data
  167. let avatar=(perArr.avatar && perArr.avatar.length > 0)? api.getFileAccessHttpUrl(perArr.avatar):'/static/avatar_boy.png'
  168. this.personalList.avatar =avatar
  169. this.personalList.realname = perArr.realname
  170. this.personalList.username = perArr.username
  171. this.personalList.post = perArr.post
  172. this.personalList.depart = perArr.departIds
  173. }
  174. }).catch(err => {
  175. console.log(err);
  176. });
  177. }
  178. }
  179. }
  180. </script>
  181. <style>
  182. .tx{
  183. width:90px;
  184. height:90px;
  185. border-radius:50%;
  186. overflow:hidden;
  187. }
  188. .UCenter-bg {
  189. background-image: url(../../static/bj8.jpeg);
  190. /* background-image: url(../../static/bj001.jpeg); */
  191. /* background-image: url(https://image.weilanwl.com/color2.0/index.jpg); */
  192. background-size: cover;
  193. height: 400rpx;
  194. display: flex;
  195. justify-content: center;
  196. padding-top: 40rpx;
  197. overflow: hidden;
  198. position: relative;
  199. flex-direction: column;
  200. align-items: center;
  201. color: #fff;
  202. font-weight: 300;
  203. text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
  204. }
  205. .UCenter-bg text {
  206. opacity: 0.8;
  207. }
  208. .UCenter-bg image {
  209. width: 200rpx;
  210. height: 200rpx;
  211. }
  212. .UCenter-bg .gif-wave{
  213. position: absolute;
  214. width: 100%;
  215. bottom: 0;
  216. left: 0;
  217. z-index: 99;
  218. mix-blend-mode: screen;
  219. height: 100rpx;
  220. }
  221. map,.mapBox{
  222. left: 0;
  223. z-index: 99;
  224. mix-blend-mode: screen;
  225. height: 100rpx;
  226. }
  227. map,.mapBox{
  228. width: 750rpx;
  229. height: 300rpx;
  230. }
  231. </style>