wxuser.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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="/static/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="/static/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="/static/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="showLogout()">退出登录</view>
  41. </view>
  42. </view>
  43. <tabbar :actindex="1"></tabbar>
  44. </view>
  45. </template>
  46. <script>
  47. import tabbar from '@/components/tabbar/tabbar.vue'
  48. import { getCompanyUser } from '@/api/user.js'
  49. export default {
  50. components: {
  51. tabbar
  52. },
  53. data() {
  54. return {
  55. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  56. user:[]
  57. }
  58. },
  59. onShow() {
  60. this.getCompanyUsers()
  61. },
  62. methods: {
  63. showLogout(){
  64. },
  65. navTo(url){
  66. if(uni.getStorageSync('companyUserInfo')){
  67. uni.switchTab({
  68. url:'/pages/index/index'
  69. })
  70. }else{
  71. uni.navigateTo({
  72. url:'/pages/auth/login'
  73. })
  74. }
  75. },
  76. getCompanyUsers(){
  77. var data = {
  78. };
  79. getCompanyUser(data).then(res => {
  80. if(res.code==200){
  81. this.user=res.user;
  82. }else{
  83. }
  84. });
  85. },
  86. }
  87. }
  88. </script>
  89. <style scoped lang="scss">
  90. .top-content {
  91. width: 100%;
  92. z-index: 10;
  93. position: fixed;
  94. top: 0;
  95. left: 0;
  96. background-color: #FFFFFF;
  97. .top-title {
  98. height: 88rpx;
  99. line-height: 88rpx;
  100. font-size: 42rpx;
  101. font-family: Source Han Sans CN;
  102. font-weight: bold;
  103. color: #222222;
  104. padding-left: 41rpx;
  105. background-color: #FFFFFF;
  106. }
  107. }
  108. .menu-box{
  109. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  110. width: 100%;
  111. margin-top: 30rpx;
  112. padding: 30rpx;
  113. background-color: #fff;
  114. border-radius: 15rpx;
  115. .title-box{
  116. display: flex;
  117. align-items: center;
  118. justify-content: flex-start;
  119. .icon{
  120. width: 40rpx;
  121. height:40rpx;
  122. }
  123. .title{
  124. margin-left: 10rpx;
  125. font-size: 28rpx;
  126. font-family: PingFang SC;
  127. color: #111;
  128. }
  129. }
  130. .line{
  131. margin-top: 15rpx;
  132. height: 0.5rpx;
  133. width: 100%;
  134. background-color: #efefef;
  135. }
  136. .menus{
  137. margin-top: 30rpx;
  138. display: flex;
  139. align-items: center;
  140. justify-content: flex-start;
  141. flex-wrap: wrap;
  142. }
  143. .menu-item{
  144. display: flex;
  145. flex-direction: column;
  146. align-items: center;
  147. justify-content: center;
  148. width: 25%;
  149. margin-bottom: 20rpx;
  150. image{
  151. width:60rpx;
  152. height:60rpx;
  153. }
  154. .m-name{
  155. margin-top: 10rpx;
  156. font-size: 24rpx;
  157. font-family: PingFang SC;
  158. color: #111;
  159. }
  160. }
  161. }
  162. .user-cont{
  163. // box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  164. background: linear-gradient(to bottom, #dae9ff, #e1e1fd);
  165. border-radius: 0px 0px 30px 30px;
  166. padding: 30rpx;
  167. // background-color: #fff;
  168. border-radius: 15rpx;
  169. .user-box{
  170. width: 100%;
  171. display: flex;
  172. align-items: center;
  173. justify-content: flex-start;
  174. .left{
  175. flex:1;
  176. display: flex;
  177. align-items: center;
  178. justify-content: flex-start;
  179. image{
  180. border-radius: 50%;
  181. width:120rpx;
  182. height:120rpx;
  183. }
  184. .user{
  185. margin-left: 20rpx;
  186. width: calc(100% - 140rpx);
  187. display: flex;
  188. flex-direction: column;
  189. align-items: flex-start;
  190. justify-content: flex-start;
  191. .username{
  192. font-size: 38rpx;
  193. font-family: PingFang SC;
  194. color: #111;
  195. font-weight: bold;
  196. }
  197. .account{
  198. padding: 5rpx 0rpx;
  199. border-radius: 30rpx;
  200. margin-top: 20rpx;
  201. font-size: 24rpx;
  202. font-family: PingFang SC;
  203. color: #515151;
  204. }
  205. }
  206. }
  207. }
  208. .company{
  209. margin-top: 30rpx;
  210. display: flex;
  211. align-items: center;
  212. justify-content: flex-start;
  213. image{
  214. width:40rpx;
  215. height:40rpx;
  216. }
  217. .name{
  218. margin-left: 15rpx;
  219. font-size: 28rpx;
  220. color: #111;
  221. }
  222. }
  223. }
  224. .btn-box{
  225. margin: 30rpx 0rpx 30rpx;
  226. display: flex;
  227. align-items: center;
  228. justify-content: center;
  229. .sub-btn{
  230. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  231. border: 1rpx solid #f8f8f8;
  232. background: #FFFFFF;
  233. width: 100%;
  234. border-radius: 10rpx;
  235. height: 88upx;
  236. line-height: 88upx;
  237. text-align: center;
  238. font-size: 30upx;
  239. font-family: PingFang SC;
  240. color: #2979ff;
  241. }
  242. }
  243. </style>