people.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view>
  3. <scroll-view scroll-y class="page">
  4. <!-- 头部logo-->
  5. <view class="UCenter-bg">
  6. <u-avatar :src="photo" size="160">
  7. </u-avatar>
  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"
  11. :style="[{animationDelay: '0.2s'}]">
  12. <view class="text-xl text-orange">{{user.name}}</view>
  13. <view class="margin-top-sm"><text class="cuIcon-people"></text> 用户</view>
  14. </view>
  15. <view class="flex flex-sub flex-direction animation-slide-top" :style="[{animationDelay: '0.2s'}]">
  16. <view class="text-xl text-green">{{user.orgName || '客户'}}</view>
  17. <view class="margin-top-sm"><text class="cuIcon-news"></text> 职务</view>
  18. </view>
  19. </view>
  20. <!-- 列表list-->
  21. <view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius">
  22. <navigator class="cu-item arrow animation-slide-bottom" url="/pages/wallet/wallet"
  23. :style="[{animationDelay: '0.6s'}]">
  24. <view class="content">
  25. <text class="cuIcon-redpacket_fill text-red"></text>
  26. <text class="text-grey">我的钱包</text>
  27. </view>
  28. </navigator>
  29. <!--
  30. <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.3s'}]" @tap="scan">
  31. <view class="content">
  32. <text class="cuIcon-scan text-red"></text>
  33. <text class="text-grey">扫码</text>
  34. </view>
  35. </view>
  36. <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
  37. <view class="content" >
  38. <text class="cuIcon-favorfill text-yellow"></text>
  39. <text class="text-grey">收藏</text>
  40. </view>
  41. </view>
  42. <navigator class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.4s'}]" url="/pages/user/location" hover-class="none">
  43. <view class="content" >
  44. <text class="cuIcon-location text-cyan"></text>
  45. <text class="text-grey">定位</text>
  46. </view>
  47. </navigator>
  48. -->
  49. <navigator class="cu-item arrow animation-slide-bottom" url="/pages/user/userdetail"
  50. :style="[{animationDelay: '0.6s'}]">
  51. <view class="content">
  52. <text class="cuIcon-settingsfill text-cyan"></text>
  53. <text class="text-grey">个人信息</text>
  54. </view>
  55. </navigator>
  56. <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.7s'}]" @click="getQuit">
  57. <view class="content">
  58. <text class="cuIcon-exit text-cyan"></text>
  59. <text class="text-grey">退出</text>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="cu-tabbar-height"></view>
  64. </scroll-view>
  65. </view>
  66. </template>
  67. <script>
  68. import {
  69. ACCESS_TOKEN,
  70. USER_NAME,
  71. USER_INFO
  72. } from "@/common/util/constants"
  73. import api from '@/api/api'
  74. import http from '@/common/service/http.js'
  75. export default {
  76. name: "people",
  77. data() {
  78. return {
  79. user: {
  80. name: '',
  81. orgName: ''
  82. },
  83. id: '',
  84. photo: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b7c7f970-517d-11eb-97b7-0dc4655d6e68.jpg'
  85. };
  86. },
  87. created() {
  88. let user = uni.getStorageSync(USER_INFO).employee;
  89. this.id = user.id
  90. this.loadinfo()
  91. },
  92. methods: {
  93. loadinfo() {
  94. let token = uni.getStorageSync(ACCESS_TOKEN)
  95. this.$http.get('ibps/platform/v3/employee/load', {
  96. params: {
  97. employeeId: this.id
  98. }
  99. }).then(res => {
  100. if (res.data.state == '200') {
  101. let result = res.data.data
  102. this.user = result
  103. if (result.photo != '') {
  104. this.photo = http.apiHosp + 'ibps/platform/v3' + this.user.photo +
  105. '&access_token=' +
  106. token + '&tenantId='
  107. }
  108. }
  109. }).catch(e => {})
  110. },
  111. //退出逻辑
  112. getQuit() {
  113. uni.showModal({
  114. title: '提示',
  115. content: '是否退出登录?',
  116. success: function(res) {
  117. if (res.confirm) {
  118. let loginMessage2 = uni.getStorageSync('login-message')
  119. let para = {
  120. access_token: uni.getStorageSync(ACCESS_TOKEN)
  121. }
  122. uni.clearStorageSync()
  123. //ibps/oauth2/v3/user/logout?access_token=
  124. uni.setStorageSync('login-message', loginMessage2)
  125. uni.navigateTo({
  126. url: '/pages/login/login'
  127. })
  128. // let url = "/ibps/oauth2/v3/user/logout?access_token=" + uni.getStorageSync(
  129. // ACCESS_TOKEN)
  130. // api.logout(url, para).then(res => {
  131. // uni.clearStorageSync()
  132. // //ibps/oauth2/v3/user/logout?access_token=
  133. // uni.setStorageSync('login-message', loginMessage2)
  134. // uni.navigateTo({
  135. // url: '/pages/login/login'
  136. // })
  137. // })
  138. } else if (res.cancel) {
  139. }
  140. }
  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,
  184. .mapBox {
  185. left: 0;
  186. z-index: 99;
  187. mix-blend-mode: screen;
  188. height: 100rpx;
  189. }
  190. map,
  191. .mapBox {
  192. width: 750rpx;
  193. height: 300rpx;
  194. }
  195. </style>
  196. <style scoped>
  197. .title-message {
  198. display: inline-block;
  199. white-space: nowrap;
  200. overflow: hidden;
  201. text-overflow: ellipsis;
  202. width: 340rpx;
  203. }
  204. </style>