wxuser.vue 5.5 KB

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