center.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <template>
  2. <view class="container">
  3. <view class="head">
  4. <u-navbar :is-fixed="false" :border-bottom="false" :is-back="false" title="个人中心"
  5. :background="{ background: 'transprent' }" title-color="#FFFFFF">
  6. <!-- <view @click="$u.func.route('/pages/system/setting')" slot="right">
  7. <image src="/static/images/user/setting.png" class="set-icon" mode="widthFix"></image>
  8. </view> -->
  9. </u-navbar>
  10. <!-- <image src="/static/images/user/bg.png" class="head-bg" />
  11. -->
  12. <!-- 用户信息 -->
  13. <view class="user-box">
  14. <view class="left" style="width: 60%;">
  15. <view style="display: flex;flex-direction: row;width: 100%;">
  16. <view style="display: flex;flex-direction: column;justify-content: center;">
  17. <image :src="userInfo.avatar" class="avatar" mode=""></image>
  18. <view class="user-name">{{ userInfo.nick_name }}</view>
  19. </view>
  20. </view>
  21. <view style="display: flex;flex-direction: row;width: 100%;color: #F0F0F0;">
  22. {{roleName}}/{{deptName}}
  23. <!-- <view class="tag">{{ userInfo.tenant_id }}</view> -->
  24. </view>
  25. </view>
  26. <view style="display: flex;flex-direction: column;justify-content: flex-end;">
  27. <!-- <image :src="userInfo.avatar" class="avatar" mode=""></image> -->
  28. <!-- <view class="user-name">{{ userInfo.nick_name }}</view> -->
  29. <!-- <view class="tag" style="display: none;">{{ userInfo.tenant_id }}</view> -->
  30. <view @click="$u.func.route('/pages/user/profile')" class="edit-btn">编辑资料</view>
  31. </view>
  32. </view>
  33. <!-- 操作按钮 -->
  34. <!-- <view class="nav">
  35. <navigator url="" hover-class="none" class="nav-item">
  36. <image src="/static/images/user/n1.png" class="icon" mode=""></image>
  37. <view class="name">我的消息</view>
  38. </navigator>
  39. <navigator url="" hover-class="none" class="nav-item">
  40. <image src="/static/images/user/n2.png" class="icon" mode=""></image>
  41. <view class="name">我的待办</view>
  42. </navigator>
  43. <navigator url="" hover-class="none" class="nav-item">
  44. <image src="/static/images/user/n3.png" class="icon" mode=""></image>
  45. <view class="name">我的地址</view>
  46. </navigator>
  47. <navigator url="" hover-class="none" class="nav-item">
  48. <image src="/static/images/user/n4.png" class="icon" mode=""></image>
  49. <view class="name">我的收藏</view>
  50. </navigator>
  51. </view> -->
  52. </view>
  53. <!-- 功能列表 -->
  54. <view class="cell-box">
  55. <u-cell-group :border="false">
  56. <u-cell-item title="修改密码" :border-bottom="false" @click="$u.func.route('/pages/user/modify-password')">
  57. <image slot="icon" src="/static/images/user/c8.png" class="icon" mode=""></image>
  58. </u-cell-item>
  59. </u-cell-group>
  60. </view>
  61. <!-- <view class="cell-box">
  62. <u-cell-group :border="false">
  63. <u-cell-item title="显示字体" :border-bottom="false" @click="$u.func.route('/pages/user/font-setting')">
  64. <image slot="icon" src="/static/images/user/c1.png" class="icon" mode=""></image>
  65. </u-cell-item>
  66. </u-cell-group>
  67. </view> -->
  68. <!--
  69. <view class="cell-box">
  70. <u-cell-group :border="false">
  71. <u-cell-item title="我的评价">
  72. <image slot="icon" src="/static/images/user/c1.png" class="icon" mode=""></image>
  73. </u-cell-item>
  74. <u-cell-item title="常见问题">
  75. <image slot="icon" src="/static/images/user/c2.png" class="icon" mode=""></image>
  76. </u-cell-item>
  77. <u-cell-item title="客服中心" :border-bottom="false">
  78. <image slot="icon" src="/static/images/user/c3.png" class="icon" mode=""></image>
  79. </u-cell-item>
  80. </u-cell-group>
  81. </view> -->
  82. <view class="cell-box">
  83. <u-cell-group :border="false">
  84. <!-- <u-cell-item title="推荐">
  85. <image slot="icon" src="/static/images/user/c4.png" class="icon" mode=""></image>
  86. </u-cell-item>
  87. <u-cell-item title="评分">
  88. <image slot="icon" src="/static/images/user/c5.png" class="icon" mode=""></image>
  89. </u-cell-item> -->
  90. <!-- <u-cell-item title="联系系统管理员" @click="$u.func.route('/pages/system/setting')">
  91. <image slot="icon" src="/static/images/user/c3.png" class="icon" mode=""></image>
  92. </u-cell-item> -->
  93. </u-cell-group>
  94. </view>
  95. <view class="cell-box">
  96. <u-cell-group :border="false">
  97. <!-- <u-cell-item title="推荐">
  98. <image slot="icon" src="/static/images/user/c4.png" class="icon" mode=""></image>
  99. </u-cell-item>
  100. <u-cell-item title="评分">
  101. <image slot="icon" src="/static/images/user/c5.png" class="icon" mode=""></image>
  102. </u-cell-item> -->
  103. <u-cell-item title="关于" :border-bottom="false" @click="$u.func.route('/pages/user/about')">
  104. <image slot="icon" src="/static/images/user/c7.png" class="icon" mode=""></image>
  105. </u-cell-item>
  106. </u-cell-group>
  107. </view>
  108. <u-gap height="50"></u-gap>
  109. <view class="cell-box">
  110. <u-cell-group :border="false">
  111. <button type="warn" @click="logout()">退出登录</button>
  112. </u-cell-group>
  113. </view>
  114. </view>
  115. </template>
  116. <script>
  117. import http from '@/http/api.js'
  118. export default {
  119. onLoad() {
  120. console.log(this.userInfo.nick_name)
  121. const that = this;
  122. http.request({
  123. url: '/galaxy-system/dept/detail?id=' + this.userInfo.dept_id,
  124. method: 'GET'
  125. }).then(res => {
  126. console.log(JSON.stringify(res.data))
  127. that.deptName = res.data.deptName;
  128. }).catch(err => {
  129. console.log(err)
  130. })
  131. http.request({
  132. url: '/galaxy-system/role/select?roleId=' + this.userInfo.role_id,
  133. method: 'GET'
  134. }).then(res => {
  135. console.log(JSON.stringify(res.data))
  136. var name = "";
  137. res.data.forEach(info => {
  138. name += name.length > 0 ? ":" : "";
  139. name += info.roleName;
  140. })
  141. that.roleName = name;
  142. }).catch(err => {
  143. console.log(err)
  144. })
  145. },
  146. data() {
  147. return {
  148. roleName: 'ff',
  149. deptName: '111'
  150. };
  151. },
  152. methods: {
  153. logout() {
  154. this.$u.func.logout();
  155. },
  156. }
  157. };
  158. </script>
  159. <style lang="scss">
  160. .container {
  161. background-color: #f7f7f7;
  162. min-height: 100vh;
  163. overflow: hidden;
  164. }
  165. .head {
  166. position: relative;
  167. top: 0;
  168. left: 0;
  169. z-index: 1;
  170. // min-height: 582rpx;
  171. min-height: 400rpx;
  172. overflow: hidden;
  173. background: #3F9EFF;
  174. .set-icon {
  175. vertical-align: middle;
  176. width: 41rpx;
  177. height: auto;
  178. margin-right: 35rpx;
  179. }
  180. .head-bg {
  181. position: absolute;
  182. left: 0px;
  183. top: 0px;
  184. z-index: -1;
  185. width: 750rpx;
  186. height: 582rpx;
  187. background: #0bb9c8;
  188. }
  189. }
  190. .user-box {
  191. display: flex;
  192. justify-content: space-between;
  193. padding: 0 20rpx 0 64rpx;
  194. margin-top: 36rpx;
  195. .left {
  196. display: flex;
  197. flex-direction: column;
  198. align-items: center;
  199. .avatar {
  200. width: 128rpx;
  201. height: 128rpx;
  202. background: #ffffff;
  203. border-radius: 50%;
  204. }
  205. .user-name {
  206. margin-top: 20rpx;
  207. font-size: 36rpx;
  208. font-family: Source Han Sans CN;
  209. font-weight: 500;
  210. color: #ffffff;
  211. }
  212. .tag {
  213. margin-top: 20rpx;
  214. display: flex;
  215. justify-content: center;
  216. align-items: center;
  217. padding: 5rpx 16rpx;
  218. border: 1px solid #f5f5f5;
  219. border-radius: 7rpx;
  220. font-size: 19rpx;
  221. font-family: Source Han Sans CN;
  222. font-weight: 300;
  223. color: #ffffff;
  224. }
  225. }
  226. .edit-btn {
  227. margin-top: 20rpx;
  228. flex-shrink: 0;
  229. display: flex;
  230. justify-content: center;
  231. align-items: center;
  232. width: 165rpx;
  233. height: 54rpx;
  234. border: 2rpx solid #f5f5f5;
  235. border-radius: 11rpx;
  236. font-size: 27rpx;
  237. font-family: Source Han Sans CN;
  238. font-weight: 400;
  239. color: #ffffff;
  240. }
  241. }
  242. .nav {
  243. display: flex;
  244. //border-top: 2rpx solid #7dcdd6;
  245. margin: 36rpx 38rpx 0;
  246. padding: 36rpx 0 42rpx;
  247. .nav-item {
  248. width: calc(100% / 4);
  249. display: flex;
  250. flex-direction: column;
  251. align-items: center;
  252. justify-content: space-between;
  253. font-size: 25rpx;
  254. font-family: Source Han Sans CN;
  255. font-weight: 400;
  256. color: #ffffff;
  257. &:not(:last-of-type) {
  258. position: relative;
  259. &::after {
  260. position: absolute;
  261. right: 0;
  262. top: 50%;
  263. transform: translateY(-50%);
  264. content: '';
  265. display: block;
  266. width: 2rpx;
  267. background-color: #3ac4d1;
  268. height: 30rpx;
  269. }
  270. }
  271. .icon {
  272. width: 48rpx;
  273. height: 48rpx;
  274. margin-bottom: 6rpx;
  275. }
  276. }
  277. }
  278. .cell-box {
  279. background: #ffffff;
  280. margin: 18rpx;
  281. .icon {
  282. width: 32rpx;
  283. height: 32rpx;
  284. margin-right: 22rpx;
  285. }
  286. }
  287. </style>