user.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view class="container">
  3. <view class="user-header">
  4. <view class="user-info" @click="handleUserInfoClick">
  5. <u-avatar size="80" :src="avatar"></u-avatar>
  6. <text class="nick-name">{{nickName}}</text>
  7. </view>
  8. </view>
  9. <u-gap height="10" bgColor="#f6f6f6"></u-gap>
  10. <view>
  11. <view class="order-header">
  12. <text class="order-title">我的订单</text>
  13. <view class="see-all">
  14. <text>查看全部</text>
  15. <u-icon name="arrow-right"></u-icon>
  16. </view>
  17. </view>
  18. <view class="mt-40-r mb-40-r">
  19. <u-grid :border="false" :col="orderStatusList.length"><u-grid-item v-for="(item,index) in orderStatusList" :key="index">
  20. <u-icon :name="item.icon" :size="32"></u-icon>
  21. <text class="grid-title">{{item.title}}</text>
  22. </u-grid-item>
  23. </u-grid>
  24. </view>
  25. </view>
  26. <u-gap height="10" bgColor="#f6f6f6"></u-gap>
  27. <view class="mt-20-r mb-20-r">
  28. <u-grid :border="false" col="3"><u-grid-item v-for="(item,index) in statisticsList" :key="index">
  29. <text class="grid-value">{{item.value}}</text>
  30. <text class="grid-title">{{item.title}}</text>
  31. </u-grid-item>
  32. </u-grid>
  33. </view>
  34. <u-gap height="10" bgColor="#f6f6f6"></u-gap>
  35. <u-cell-group class="fun-list">
  36. <u-cell class="fun-item" :border="false" icon="gift" title="分销中心" isLink></u-cell>
  37. <u-cell class="fun-item" :border="false" icon="tags" title="领券中心" isLink></u-cell>
  38. <u-cell class="fun-item" :border="false" icon="coupon" title="我的优惠券" isLink></u-cell>
  39. <u-cell class="fun-item" :border="false" icon="map" title="收获地址" isLink></u-cell>
  40. </u-cell-group>
  41. <u-button class="logout-btn" type="error" color="#ea322b" text="确定"></u-button>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. data() {
  47. return {
  48. avatar:'',
  49. nickName:'点击登录',
  50. orderStatusList: [{icon: 'rmb-circle', title: '待支付'}, {icon: 'car', title: '代发货'}, {icon: 'order', title: '待收货'}, {icon: 'integral', title: '已完成'}],
  51. statisticsList: [{value: '2', title: '我的收藏'}, {value: '3', title: '我的消息'}, {value: '3', title: '我的足迹'}]
  52. }
  53. },
  54. onLoad() {
  55. },
  56. methods: {
  57. handleUserInfoClick(){
  58. if (!uni.getStorageSync('token')) {
  59. uni.$u.route('/pages/login/login');
  60. } else {
  61. uni.$u.route('/pages/profile/profile');
  62. }
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. .user-header {
  69. height: 280rpx;
  70. display: flex;
  71. align-items: center;
  72. justify-content: center;
  73. .user-info {
  74. display: flex;
  75. flex-direction: column;
  76. align-items: center;
  77. justify-content: center;
  78. .nick-name {
  79. margin-top: 20rpx;
  80. font-size: 32rpx;
  81. font-weight: 700;
  82. }
  83. }
  84. }
  85. .order-header {
  86. display: flex;
  87. flex-direction: row;
  88. align-items: center;
  89. justify-content: space-between;
  90. padding: 20rpx 30rpx;
  91. border-bottom: 1rpx solid #f3f3f3;
  92. .order-title {
  93. color: #333333;
  94. font-size: 34rpx;
  95. }
  96. .see-all {
  97. height: 40rpx;
  98. display: flex;
  99. flex-direction: row;
  100. align-items: center;
  101. justify-content: right;
  102. color: #666666;
  103. font-size: 26rpx;
  104. }
  105. }
  106. .grid-title {
  107. line-height: 50rpx;
  108. font-size: 26rpx;
  109. }
  110. .grid-value {
  111. line-height: 50rpx;
  112. font-size: 36rpx;
  113. font-weight: 700;
  114. color: #2b85e4;
  115. }
  116. .fun-list {
  117. .fun-item {
  118. padding-top: 10rpx;
  119. padding-bottom: 10rpx;
  120. border-bottom: 1rpx solid #f3f3f3;
  121. }
  122. }
  123. .logout-btn {
  124. margin-top: 60rpx;
  125. width: 300rpx;
  126. }
  127. </style>