wxuser.vue 4.4 KB

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