wxuser.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <view>
  3. <view class="top-content ">
  4. <view class="status_bar" :style="{height: statusBarHeight+'px'}"></view>
  5. <!-- 这里是状态栏 -->
  6. <view class="top-title">我的</view>
  7. </view>
  8. <view class="user-cont" :style="{marginTop: `calc(${statusBarHeight}px + 88rpx)`}">
  9. <view class="user-box" v-if="user!=null">
  10. <view class="left">
  11. <u-avatar :src="user.avatar" size="50"></u-avatar>
  12. <view class="user" >
  13. <view class="username">{{user.nickName}}</view>
  14. <view class="account">{{user.email}}</view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="company" v-if="user!=null">
  19. <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com:443/app/images/icon_comp.png"></image>
  20. <view class="name">{{user.createBy||'暂无数据'}}</view>
  21. </view>
  22. </view>
  23. <view class="p20">
  24. <view class="menu-box" style="margin-top: -40rpx;">
  25. <view class="title-box">
  26. <image class="icon" src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com:443/app/manergevip/chang.png"></image>
  27. <view class="title">常用功能</view>
  28. </view>
  29. <view class="line"></view>
  30. <view class="menus">
  31. <view class="menu-item" @click="navTo()">
  32. <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com:443/app/images/menu_info.png"></image>
  33. <view class="m-name">销售管理</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="p20">
  39. <view class="btn-box" >
  40. <view class="sub-btn" @click="this.show=!this.show">退出登录</view>
  41. </view>
  42. </view>
  43. <u-modal :show="show" @confirm="showLogout" :title="title" :content='content' :showCancelButton="true"
  44. @cancel='this.show=!this.show'></u-modal>
  45. <tabbar :actindex="1"></tabbar>
  46. </view>
  47. </template>
  48. <script>
  49. import tabbar from '@/components/tabbar/tabbar.vue'
  50. import { getwxuser } from '@/api/user.js'
  51. export default {
  52. components: {
  53. tabbar
  54. },
  55. data() {
  56. return {
  57. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  58. user:[],
  59. show:false,
  60. title:'提示',
  61. content:'确认退出吗?'
  62. }
  63. },
  64. onShow() {
  65. this.getCompanyUsers()
  66. },
  67. methods: {
  68. showLogout(){
  69. uni.removeStorageSync('UserToken')
  70. uni.removeStorageSync('userInfo')
  71. uni.navigateTo({
  72. url:'/pages/auth/wxlogin'
  73. })
  74. },
  75. navTo(url){
  76. if(uni.getStorageSync('AppToken')){
  77. uni.switchTab({
  78. url:'/pages/index/index'
  79. })
  80. }else{
  81. uni.navigateTo({
  82. url:'/pages/auth/login'
  83. })
  84. }
  85. },
  86. getCompanyUsers(){
  87. var data = {
  88. };
  89. getwxuser(data).then(res => {
  90. if(res.code==200){
  91. this.user=res.user;
  92. }else{
  93. }
  94. });
  95. },
  96. }
  97. }
  98. </script>
  99. <style scoped lang="scss">
  100. .top-content {
  101. width: 100%;
  102. z-index: 10;
  103. position: fixed;
  104. top: 0;
  105. left: 0;
  106. background-color: #FFFFFF;
  107. .top-title {
  108. height: 88rpx;
  109. line-height: 88rpx;
  110. font-size: 42rpx;
  111. font-family: Source Han Sans CN;
  112. font-weight: bold;
  113. color: #222222;
  114. padding-left: 41rpx;
  115. background-color: #FFFFFF;
  116. }
  117. }
  118. .menu-box{
  119. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  120. width: 100%;
  121. margin-top: 30rpx;
  122. padding: 30rpx;
  123. background-color: #fff;
  124. border-radius: 15rpx;
  125. .title-box{
  126. display: flex;
  127. align-items: center;
  128. justify-content: flex-start;
  129. .icon{
  130. width: 40rpx;
  131. height:40rpx;
  132. }
  133. .title{
  134. margin-left: 10rpx;
  135. font-size: 28rpx;
  136. font-family: PingFang SC;
  137. color: #111;
  138. }
  139. }
  140. .line{
  141. margin-top: 15rpx;
  142. height: 0.5rpx;
  143. width: 100%;
  144. background-color: #efefef;
  145. }
  146. .menus{
  147. margin-top: 30rpx;
  148. display: flex;
  149. align-items: center;
  150. justify-content: flex-start;
  151. flex-wrap: wrap;
  152. }
  153. .menu-item{
  154. display: flex;
  155. flex-direction: column;
  156. align-items: center;
  157. justify-content: center;
  158. width: 25%;
  159. margin-bottom: 20rpx;
  160. image{
  161. width:60rpx;
  162. height:60rpx;
  163. }
  164. .m-name{
  165. margin-top: 10rpx;
  166. font-size: 24rpx;
  167. font-family: PingFang SC;
  168. color: #111;
  169. }
  170. }
  171. }
  172. .user-cont{
  173. // box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  174. background: linear-gradient(to bottom, #dae9ff, #e1e1fd);
  175. border-radius: 0px 0px 30px 30px;
  176. padding: 30rpx;
  177. // background-color: #fff;
  178. border-radius: 15rpx;
  179. .user-box{
  180. width: 100%;
  181. display: flex;
  182. align-items: center;
  183. justify-content: flex-start;
  184. .left{
  185. flex:1;
  186. display: flex;
  187. align-items: center;
  188. justify-content: flex-start;
  189. image{
  190. border-radius: 50%;
  191. width:120rpx;
  192. height:120rpx;
  193. }
  194. .user{
  195. margin-left: 20rpx;
  196. width: calc(100% - 140rpx);
  197. display: flex;
  198. flex-direction: column;
  199. align-items: flex-start;
  200. justify-content: flex-start;
  201. .username{
  202. font-size: 38rpx;
  203. font-family: PingFang SC;
  204. color: #111;
  205. font-weight: bold;
  206. }
  207. .account{
  208. padding: 5rpx 0rpx;
  209. border-radius: 30rpx;
  210. margin-top: 20rpx;
  211. font-size: 24rpx;
  212. font-family: PingFang SC;
  213. color: #515151;
  214. }
  215. }
  216. }
  217. }
  218. .company{
  219. margin-top: 30rpx;
  220. display: flex;
  221. align-items: center;
  222. justify-content: flex-start;
  223. image{
  224. width:40rpx;
  225. height:40rpx;
  226. }
  227. .name{
  228. margin-left: 15rpx;
  229. font-size: 28rpx;
  230. color: #111;
  231. }
  232. }
  233. }
  234. .btn-box{
  235. margin: 30rpx 0rpx 30rpx;
  236. display: flex;
  237. align-items: center;
  238. justify-content: center;
  239. .sub-btn{
  240. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  241. border: 1rpx solid #f8f8f8;
  242. background: #FFFFFF;
  243. width: 100%;
  244. border-radius: 10rpx;
  245. height: 88upx;
  246. line-height: 88upx;
  247. text-align: center;
  248. font-size: 30upx;
  249. font-family: PingFang SC;
  250. color: #2979ff;
  251. }
  252. }
  253. </style>