people.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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" :style="[{animationDelay: '0.2s'}]">
  11. <view class="text-xl text-orange">{{user.name}}</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">{{user.orgName || '客户'}}</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. <navigator class="cu-item arrow animation-slide-bottom" url="/pages/wallet/wallet" :style="[{animationDelay: '0.6s'}]">
  22. <view class="content">
  23. <text class="cuIcon-redpacket_fill text-red"></text>
  24. <text class="text-grey">我的钱包</text>
  25. </view>
  26. </navigator>
  27. <navigator class="cu-item arrow animation-slide-bottom" url="/pages/user/userdetail" :style="[{animationDelay: '0.6s'}]">
  28. <view class="content">
  29. <text class="cuIcon-settingsfill text-cyan"></text>
  30. <text class="text-grey">个人信息</text>
  31. </view>
  32. </navigator>
  33. <!-- <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.7s'}]" @click="saoma">
  34. <view class="content">
  35. <text class="cuIcon-exit text-cyan"></text>
  36. <text class="text-grey">扫码</text>
  37. </view>
  38. </view> -->
  39. <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.7s'}]" @click="getQuit">
  40. <view class="content">
  41. <text class="cuIcon-exit text-cyan"></text>
  42. <text class="text-grey">退出</text>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="cu-tabbar-height"></view>
  47. </scroll-view>
  48. </view>
  49. </template>
  50. <script>
  51. import {
  52. ACCESS_TOKEN,
  53. USER_NAME,
  54. USER_INFO
  55. } from "@/common/util/constants"
  56. import api from '@/api/api'
  57. import http from '@/common/service/http.js'
  58. export default {
  59. name: "people",
  60. data() {
  61. return {
  62. user: {
  63. name: '',
  64. orgName: ''
  65. },
  66. id: '',
  67. photo: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b7c7f970-517d-11eb-97b7-0dc4655d6e68.jpg'
  68. };
  69. },
  70. created() {
  71. let user = uni.getStorageSync(USER_INFO).employee;
  72. this.id = user.id
  73. this.loadinfo()
  74. },
  75. methods: {
  76. loadinfo() {
  77. let token = uni.getStorageSync(ACCESS_TOKEN)
  78. this.$http.get('ibps/platform/v3/employee/load', {
  79. params: {
  80. employeeId: this.id
  81. }
  82. }).then(res => {
  83. if (res.data.state == '200') {
  84. let result = res.data.data
  85. this.user = result
  86. if (result.photo != '') {
  87. this.photo = http.apiHosp + 'ibps/platform/v3' + this.user.photo +
  88. '&access_token=' +
  89. token + '&tenantId='
  90. }
  91. }
  92. }).catch(e => {})
  93. },
  94. saoma() {
  95. uni.scanCode({
  96. success: function(res) {
  97. uni.showToast({
  98. title: res.result
  99. })
  100. }
  101. })
  102. },
  103. //退出逻辑
  104. getQuit() {
  105. uni.showModal({
  106. title: '提示',
  107. content: '是否退出登录?',
  108. success: function(res) {
  109. if (res.confirm) {
  110. let loginMessage2 = uni.getStorageSync('login-message')
  111. let para = {
  112. access_token: uni.getStorageSync(ACCESS_TOKEN)
  113. }
  114. uni.clearStorageSync()
  115. //ibps/oauth2/v3/user/logout?access_token=
  116. uni.setStorageSync('login-message', loginMessage2)
  117. uni.navigateTo({
  118. url: '/pages/login/login'
  119. })
  120. // let url = "/ibps/oauth2/v3/user/logout?access_token=" + uni.getStorageSync(
  121. // ACCESS_TOKEN)
  122. // api.logout(url, para).then(res => {
  123. // uni.clearStorageSync()
  124. // //ibps/oauth2/v3/user/logout?access_token=
  125. // uni.setStorageSync('login-message', loginMessage2)
  126. // uni.navigateTo({
  127. // url: '/pages/login/login'
  128. // })
  129. // })
  130. } else if (res.cancel) {
  131. }
  132. }
  133. });
  134. }
  135. }
  136. }
  137. </script>
  138. <style>
  139. .UCenter-bg {
  140. /* #ifdef MP-WEIXIN */
  141. background-image: url('https://static.jeecg.com/upload/test/blue_1595818030310.png');
  142. /* #endif */
  143. /* #ifndef MP-WEIXIN */
  144. background-image: url('../../static/blue.png');
  145. /* #endif */
  146. background-size: cover;
  147. height: 400rpx;
  148. display: flex;
  149. justify-content: center;
  150. padding-top: 40rpx;
  151. overflow: hidden;
  152. position: relative;
  153. flex-direction: column;
  154. align-items: center;
  155. color: #fff;
  156. font-weight: 300;
  157. text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
  158. }
  159. .UCenter-bg text {
  160. opacity: 0.8;
  161. }
  162. .UCenter-bg image {
  163. width: 200rpx;
  164. height: 200rpx;
  165. }
  166. .UCenter-bg .gif-wave {
  167. position: absolute;
  168. width: 100%;
  169. bottom: 0;
  170. left: 0;
  171. z-index: 99;
  172. mix-blend-mode: screen;
  173. height: 100rpx;
  174. }
  175. map,
  176. .mapBox {
  177. left: 0;
  178. z-index: 99;
  179. mix-blend-mode: screen;
  180. height: 100rpx;
  181. }
  182. map,
  183. .mapBox {
  184. width: 750rpx;
  185. height: 300rpx;
  186. }
  187. </style>
  188. <style scoped>
  189. .title-message {
  190. display: inline-block;
  191. white-space: nowrap;
  192. overflow: hidden;
  193. text-overflow: ellipsis;
  194. width: 340rpx;
  195. }
  196. </style>