newuser.vue 5.3 KB

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