mine.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view class="page-mine" :style="{'backgroundImage': 'url('+bg+')'}">
  3. <view class="status_bar"></view>
  4. <view class="user-info">
  5. <view class="title">个人中心</view>
  6. <div class="user">
  7. <image class="head"
  8. :src="user.userPhoto?user.userPhoto:userPhoto"
  9. @error="user.userPhoto=userPhoto"
  10. alt="" />
  11. <text class="name">{{user.userName}}</text>
  12. </div>
  13. </view>
  14. <div class="form">
  15. <div class="item">
  16. <div class="item-title">
  17. <image class="icon" src="/static/icon/location.png" mode="widthFix"></image>
  18. <div class="namme">行政区划</div>
  19. </div>
  20. <div class="cont">{{user.ocName}}</div>
  21. </div>
  22. <div class="item">
  23. <div class="item-title">
  24. <image class="icon" src="/static/icon/user-group.png" mode="widthFix"></image>
  25. <div class="namme">所属部门</div>
  26. </div>
  27. <div class="cont">{{user.groupName}}</div>
  28. </div>
  29. <div class="item" @click="linkTo">
  30. <div class="item-title">
  31. <image class="icon" src="/static/icon/unlock.png" mode="widthFix"></image>
  32. <div class="name">修改密码</div>
  33. </div>
  34. <div class="cont"><image class="rt-icon" src="/static/icon/rt_icon.png" mode="widthFix"></image></div>
  35. </div>
  36. </div>
  37. <button type="default" class="btn-submit" @click="logout">退出登陆</button>
  38. </view>
  39. </template>
  40. <script>
  41. import {logout} from '@/api/user.js'
  42. export default {
  43. data() {
  44. return {
  45. user:{
  46. userName:"--",
  47. userRealName:"--",
  48. groupName:"--",
  49. ocName:"--",
  50. userPhoto:require('./image/head.png')
  51. },
  52. userPhoto:require('./image/head.png'),
  53. bg:require('./image/bg.png')
  54. }
  55. },
  56. onShow() {
  57. this.init()
  58. },
  59. methods: {
  60. init(){
  61. let accountInfo=uni.getStorageSync('accountInfo')
  62. if(accountInfo){
  63. this.user=accountInfo
  64. }
  65. },
  66. linkTo(){
  67. uni.navigateTo({
  68. url:'/pages/mine/password/password'
  69. })
  70. },
  71. logout(){
  72. uni.showModal({
  73. title:'提示!',
  74. content:"是否要退出登录",
  75. success(res) {
  76. if (res.confirm) {
  77. logout().then(()=>{
  78. uni.clearStorageSync()
  79. uni.navigateTo({
  80. url:'/pages/login/login'
  81. })
  82. })
  83. }
  84. }
  85. })
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .page-mine{
  92. background-size: 100% 504rpx;
  93. background-repeat: no-repeat;
  94. background-color: #fff;
  95. height: 100vh;
  96. /* #ifdef H5 */
  97. height: calc(100vh - 50px);
  98. /* #endif */
  99. box-sizing: border-box;
  100. position: relative;
  101. .user-info{
  102. padding-left:30upx;
  103. .user{
  104. display: flex;
  105. align-items: center;
  106. padding:106upx 0 140upx;
  107. .head{
  108. display: block;
  109. width: 112upx;
  110. height: 112upx;
  111. border-radius: 50%;
  112. }
  113. .name{
  114. font-family: 'Abhaya Libre';
  115. font-style: normal;
  116. font-weight: 700;
  117. font-size: 38rpx;
  118. line-height: 54upx;
  119. color: #151515;
  120. padding-left: 30upx;
  121. }
  122. }
  123. }
  124. .form{
  125. padding: 0 48upx 0 36upx;
  126. background-color: #fff;
  127. .item{
  128. height: 120upx;
  129. display: flex;
  130. justify-content: space-between;
  131. align-items: center;
  132. .item-title{
  133. display: flex;
  134. align-items: center;
  135. .icon{
  136. display: block;
  137. width: 48upx;
  138. height: 48upx;
  139. }
  140. .name{
  141. font-family: 'Abhaya Libre';
  142. font-style: normal;
  143. font-weight: 400;
  144. font-size: 32upx;
  145. line-height:48upx;
  146. text-align: center;
  147. color: #151515;
  148. margin-left: 10upx;
  149. }
  150. }
  151. .cont{
  152. font-family: 'Abhaya Libre';
  153. font-style: normal;
  154. font-weight: 400;
  155. font-size: 32upx;
  156. line-height:48upx;
  157. text-align: center;
  158. color: #151515;
  159. margin-left: 10upx;
  160. .rt-icon{
  161. display: block;
  162. width: 15upx;
  163. height: 15upx;
  164. }
  165. }
  166. }
  167. }
  168. .title{
  169. font-family: 'Abhaya Libre';
  170. font-style: normal;
  171. font-weight: 700;
  172. font-size: 34upx;
  173. line-height: 40upx;
  174. color: #151515;
  175. }
  176. .btn-submit{
  177. width: 654upx;
  178. height: 88upx;
  179. font-family: 'Abhaya Libre';
  180. font-style: normal;
  181. font-weight: 400;
  182. font-size: 32upx;
  183. line-height: 88upx;
  184. text-align: center;
  185. color: #fff;
  186. background: #3d62ea;
  187. border-radius: 4px;
  188. text-align: center;
  189. position: absolute;
  190. bottom: 150upx;
  191. margin-left: 50%;
  192. transform: translateX(-50%);
  193. .disable{
  194. background: #F2F2F2;
  195. color: #999999;
  196. }
  197. }
  198. }
  199. </style>