center.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="container">
  3. <view class="head" :style="{height: `${headHeight}rpx`}">
  4. <u-navbar :is-fixed="false" :border-bottom="false" :is-back="false" title="个人中心" :background="{ background: 'transprent' }" title-color="#FFFFFF">
  5. <view @click="$u.func.route('/pages/system/setting')" slot="right">
  6. <image src="/static/images/user/setting.png" class="set-icon" mode="widthFix"></image>
  7. </view>
  8. </u-navbar>
  9. <image src="/static/images/user/bg.png" class="head-bg" :style="{height: `${headHeight}rpx`}" />
  10. <!-- 用户信息 -->
  11. <view class="user-box">
  12. <view class="left">
  13. <image :src="userInfo.avatar" class="avatar" mode=""></image>
  14. <view class="user-name">{{ userInfo.nick_name }}</view>
  15. <view class="tag">{{ userInfo.tenant_id }}</view>
  16. </view>
  17. <view @click="$u.func.route('/pages/user/profile')" class="edit-btn">编辑资料</view>
  18. </view>
  19. <!-- 操作按钮 -->
  20. <view class="nav">
  21. <navigator url="" hover-class="none" class="nav-item">
  22. <image src="/static/images/user/n1.png" class="icon" mode=""></image>
  23. <view class="name">我的消息</view>
  24. </navigator>
  25. <navigator url="" hover-class="none" class="nav-item">
  26. <image src="/static/images/user/n2.png" class="icon" mode=""></image>
  27. <view class="name">我的待办</view>
  28. </navigator>
  29. <navigator url="" hover-class="none" class="nav-item">
  30. <image src="/static/images/user/n3.png" class="icon" mode=""></image>
  31. <view class="name">我的地址</view>
  32. </navigator>
  33. <navigator url="" hover-class="none" class="nav-item">
  34. <image src="/static/images/user/n4.png" class="icon" mode=""></image>
  35. <view class="name">我的收藏</view>
  36. </navigator>
  37. </view>
  38. </view>
  39. <!-- 功能列表 -->
  40. <view class="cell-box">
  41. <u-cell-group :border="false">
  42. <u-cell-item title="我的评价">
  43. <image slot="icon" src="/static/images/user/c1.png" class="icon" mode=""></image>
  44. </u-cell-item>
  45. <u-cell-item title="常见问题">
  46. <image slot="icon" src="/static/images/user/c2.png" class="icon" mode=""></image>
  47. </u-cell-item>
  48. <u-cell-item title="客服中心" :border-bottom="false">
  49. <image slot="icon" src="/static/images/user/c3.png" class="icon" mode=""></image>
  50. </u-cell-item>
  51. </u-cell-group>
  52. </view>
  53. <view class="cell-box">
  54. <u-cell-group :border="false">
  55. <u-cell-item title="推荐">
  56. <image slot="icon" src="/static/images/user/c4.png" class="icon" mode=""></image>
  57. </u-cell-item>
  58. <u-cell-item title="评分">
  59. <image slot="icon" src="/static/images/user/c5.png" class="icon" mode=""></image>
  60. </u-cell-item>
  61. <u-cell-item title="反馈">
  62. <image slot="icon" src="/static/images/user/c6.png" class="icon" mode=""></image>
  63. </u-cell-item>
  64. <u-cell-item title="关于" :border-bottom="false">
  65. <image slot="icon" src="/static/images/user/c7.png" class="icon" mode=""></image>
  66. </u-cell-item>
  67. </u-cell-group>
  68. </view>
  69. <view class="cell-box">
  70. <u-cell-group :border="false">
  71. <u-cell-item title="设置" :border-bottom="false" @click="$u.func.route('/pages/system/setting')">
  72. <image slot="icon" src="/static/images/user/c8.png" class="icon" mode=""></image>
  73. </u-cell-item>
  74. </u-cell-group>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. export default {
  80. data() {
  81. return {
  82. headHeight: 582
  83. };
  84. },
  85. mounted() {
  86. this.setHeadHeight()
  87. },
  88. methods: {
  89. setHeadHeight() {
  90. const that = this
  91. // #ifndef H5
  92. uni.getSystemInfo({
  93. success: function(res) {
  94. that.headHeight = Number(res.statusBarHeight) + Number(res.platform == 'ios' ? 44 : 48) + 582
  95. }
  96. });
  97. // #endif
  98. },
  99. }
  100. };
  101. </script>
  102. <style lang="scss">
  103. .container {
  104. background-color: #f7f7f7;
  105. min-height: 100vh;
  106. overflow: hidden;
  107. }
  108. .head {
  109. position: relative;
  110. top: 0;
  111. left: 0;
  112. z-index: 1;
  113. min-height: 582rpx;
  114. overflow: hidden;
  115. background: #55A2F9;
  116. .set-icon {
  117. vertical-align: middle;
  118. width: 41rpx;
  119. height: auto;
  120. margin-right: 35rpx;
  121. }
  122. .head-bg {
  123. position: absolute;
  124. left: 0px;
  125. top: 0px;
  126. z-index: -1;
  127. width: 750rpx;
  128. height: 582rpx;
  129. background: #55A2F9;
  130. }
  131. }
  132. .user-box {
  133. display: flex;
  134. justify-content: space-between;
  135. padding: 0 20rpx 0 64rpx;
  136. margin-top: 36rpx;
  137. .left {
  138. display: flex;
  139. flex-direction: column;
  140. align-items: center;
  141. .avatar {
  142. width: 128rpx;
  143. height: 128rpx;
  144. background: #ffffff;
  145. border-radius: 50%;
  146. }
  147. .user-name {
  148. margin-top: 20rpx;
  149. font-size: 36rpx;
  150. font-family: Source Han Sans CN;
  151. font-weight: 500;
  152. color: #ffffff;
  153. }
  154. .tag {
  155. margin-top: 20rpx;
  156. display: flex;
  157. justify-content: center;
  158. align-items: center;
  159. padding: 5rpx 16rpx;
  160. border: 1px solid #f5f5f5;
  161. border-radius: 7rpx;
  162. font-size: 19rpx;
  163. font-family: Source Han Sans CN;
  164. font-weight: 300;
  165. color: #ffffff;
  166. }
  167. }
  168. .edit-btn {
  169. margin-top: 20rpx;
  170. flex-shrink: 0;
  171. display: flex;
  172. justify-content: center;
  173. align-items: center;
  174. width: 165rpx;
  175. height: 54rpx;
  176. border: 2rpx solid #f5f5f5;
  177. border-radius: 11rpx;
  178. font-size: 27rpx;
  179. font-family: Source Han Sans CN;
  180. font-weight: 400;
  181. color: #ffffff;
  182. }
  183. }
  184. .nav {
  185. display: flex;
  186. //border-top: 2rpx solid #7dcdd6;
  187. margin: 36rpx 38rpx 0;
  188. padding: 36rpx 0 42rpx;
  189. .nav-item {
  190. width: calc(100% / 4);
  191. display: flex;
  192. flex-direction: column;
  193. align-items: center;
  194. justify-content: space-between;
  195. font-size: 25rpx;
  196. font-family: Source Han Sans CN;
  197. font-weight: 400;
  198. color: #ffffff;
  199. &:not(:last-of-type) {
  200. position: relative;
  201. &::after {
  202. position: absolute;
  203. right: 0;
  204. top: 50%;
  205. transform: translateY(-50%);
  206. content: '';
  207. display: block;
  208. width: 2rpx;
  209. background-color: #fff;
  210. height: 30rpx;
  211. }
  212. }
  213. .icon {
  214. width: 48rpx;
  215. height: 48rpx;
  216. margin-bottom: 6rpx;
  217. }
  218. }
  219. }
  220. .cell-box {
  221. background: #ffffff;
  222. margin: 18rpx;
  223. .icon {
  224. width: 32rpx;
  225. height: 32rpx;
  226. margin-right: 22rpx;
  227. }
  228. }
  229. </style>