people.vue 7.4 KB

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