user.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view class="app">
  3. <!-- 个人信息 -->
  4. <view class="user-wrapper">
  5. <image class="user-background" src="/static/backgroud/user.jpg"></image>
  6. <view class="user">
  7. <!-- 头像 -->
  8. <image class="avatar" :src="userInfo.avatar || '/static/icon/default-avatar.png'" @click="navTo('/pages/set/userInfo', {login: true})"></image>
  9. <!-- 已登陆,展示昵称 -->
  10. <view class="cen column" v-if="hasLogin">
  11. <text class="username f-m">{{ userInfo.nickname }}</text>
  12. <text class="group">普通会员</text>
  13. </view>
  14. <!-- 未登陆,引导登陆 -->
  15. <view class="login-box" v-else @click="navTo('/pages/auth/login')">
  16. <text>点击注册/登录</text>
  17. </view>
  18. </view>
  19. <!-- 下面的圆弧 -->
  20. <image class="user-background-arc-line" src="/static/icon/arc.png" mode="aspectFill"></image>
  21. </view>
  22. <!-- 订单信息 -->
  23. <view class="order-wrap">
  24. <view class="order-header row" @click="navTo('/pages/order/list?current=0', {login: true})">
  25. <text class="title">我的订单</text>
  26. <text class="more">查看全部</text>
  27. <text class="mix-icon icon-you"></text>
  28. </view>
  29. <view class="order-list">
  30. <view class="item center" @click="navTo('/pages/order/list?current=1', {login: true})" hover-class="hover-gray" :hover-stay-time="50">
  31. <text class="mix-icon icon-daifukuan"></text>
  32. <text>待付款</text>
  33. <text v-if="orderCount.c0 > 0" class="number">{{ orderCount.c0 }}</text>
  34. </view>
  35. <view class="item center" @click="navTo('/pages/order/list?current=2', {login: true})" hover-class="hover-gray" :hover-stay-time="50">
  36. <text class="mix-icon icon-daifahuo"></text>
  37. <text>待发货</text>
  38. <text v-if="orderCount.c1 > 0" class="number">{{ orderCount.c1 }}</text>
  39. </view>
  40. <view class="item center" @click="navTo('/pages/order/list?current=3', {login: true})" hover-class="hover-gray" :hover-stay-time="50">
  41. <text class="mix-icon icon-yishouhuo"></text>
  42. <text>待收货</text>
  43. <text v-if="orderCount.c2 > 0" class="number">{{ orderCount.c2 }}</text>
  44. </view>
  45. <view class="item center" @click="navTo('/pages/order/list?current=4', {login: true})" hover-class="hover-gray" :hover-stay-time="50">
  46. <text class="mix-icon icon-daipingjia"></text>
  47. <text>待评价</text>
  48. <text v-if="orderCount.c3 > 0" class="number">{{ orderCount.c3 }}</text>
  49. </view>
  50. </view>
  51. </view>
  52. <!-- 功能入口 -->
  53. <view class="option-wrap">
  54. <!-- <mix-list-cell icon="icon-iconfontweixin" iconColor="#fa436a" title="我的钱包" @onClick="navTo('/pages/wallet/index', {login: true})"></mix-list-cell> -->
  55. <!-- <mix-list-cell icon="icon-dizhi" iconColor="#5fcda2" title="地址管理" @onClick="navTo('/pages/address/list', {login: true})"></mix-list-cell> -->
  56. <!-- <mix-list-cell icon="icon-share" iconColor="#9789f7" title="分享" tips="呼朋唤友赢好礼"></mix-list-cell> -->
  57. <!-- <mix-list-cell icon="icon-shoucang_xuanzhongzhuangtai" iconColor="#54b4ef" title="我的收藏" @onClick="navTo('/pages/favorite/favorite', {login: true})"></mix-list-cell> -->
  58. <!-- <mix-list-cell icon="icon-pinglun-copy" iconColor="#ee883b" title="意见反馈" @onClick="navTo('/pages/feedback/feedback', {login: true})"></mix-list-cell> -->
  59. <!-- <mix-list-cell icon="icon-shezhi1" iconColor="#37b0fb" title="设置" border="" @onClick="navTo('/pages/set/set', {login: true})"></mix-list-cell> -->
  60. <mix-list-cell icon="icon-bianji" iconColor="#5fcda2" title="个人信息" border="" @onClick="navTo('/pages/set/userInfo', {login: true})"></mix-list-cell>
  61. <mix-list-cell icon="icon-shezhi1" iconColor="#37b0fb" title="账号安全" border="" @onClick="navTo('/pages/set/set', {login: true})"></mix-list-cell>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. data() {
  68. return {
  69. userInfo: { // TODO 芋艿:读取
  70. nickname: '芋艿'
  71. },
  72. hasLogin: true, // TODO 芋艿:读取
  73. orderCount: { // TODO 芋艿:读取
  74. c0: 1,
  75. c1: 2,
  76. c2: 3,
  77. c3: 4
  78. }
  79. };
  80. },
  81. onShow() {
  82. // TODO 芋艿:加载用户信息
  83. // TODO 芋艿:获得订单数量
  84. }
  85. }
  86. </script>
  87. <style lang="scss">
  88. .app {
  89. padding-bottom: 20rpx;
  90. }
  91. .user-wrapper {
  92. position: relative;
  93. overflow: hidden;
  94. padding-top: calc(var(--status-bar-height) + 52rpx);
  95. padding-bottom: 6rpx;
  96. .user {
  97. display: flex;
  98. flex-direction: column;
  99. flex-direction: row;
  100. align-items: center;
  101. position: relative;
  102. z-index: 5;
  103. padding: 20rpx 30rpx 60rpx;
  104. .avatar {
  105. flex-shrink: 0;
  106. width: 130rpx;
  107. height: 130rpx;
  108. border-radius: 100px;
  109. margin-right: 24rpx;
  110. border: 4rpx solid #fff;
  111. background-color: #fff;
  112. }
  113. .username {
  114. font-size: 34rpx;
  115. color: #fff;
  116. }
  117. .group {
  118. align-self: flex-start;
  119. padding: 10rpx 14rpx;
  120. margin: 16rpx 10rpx; // 10rpx 避免距离昵称太近
  121. font-size: 20rpx;
  122. color: #fff;
  123. background-color: rgba(255, 255, 255,.3);
  124. border-radius: 100rpx;
  125. }
  126. .login-box {
  127. font-size: 36rpx;
  128. color: #fff;
  129. }
  130. }
  131. .user-background {
  132. position: absolute;
  133. left: 0;
  134. top: 0;
  135. width: 100%;
  136. height: 330rpx;
  137. }
  138. .user-background-arc-line {
  139. position: absolute;
  140. left: 0;
  141. bottom: 0;
  142. z-index: 9;
  143. width: 100%;
  144. height: 32rpx;
  145. }
  146. }
  147. .order-wrap {
  148. width: 700rpx;
  149. margin: 20rpx auto 0;
  150. background: #fff;
  151. border-radius: 10rpx;
  152. .order-header {
  153. padding: 28rpx 20rpx 6rpx 26rpx;
  154. .title {
  155. flex: 1;
  156. font-size: 32rpx;
  157. color: #333;
  158. font-weight: 700;
  159. }
  160. .more {
  161. font-size: 24rpx;
  162. color: #999;
  163. }
  164. .icon-you {
  165. margin-left: 4rpx;
  166. font-size: 20rpx;
  167. color: #999;
  168. }
  169. }
  170. .order-list {
  171. display:flex;
  172. justify-content: space-around;
  173. padding: 20rpx 0;
  174. .item{
  175. flex-direction: column;
  176. width: 130rpx;
  177. height: 130rpx;
  178. border-radius: 8rpx;
  179. font-size: 24rpx;
  180. color: #606266;
  181. position: relative;
  182. .mix-icon {
  183. font-size: 50rpx;
  184. margin-bottom: 20rpx;
  185. color: #fa436a;
  186. }
  187. .icon-shouhoutuikuan {
  188. font-size: 44rpx;
  189. }
  190. .number {
  191. position: absolute;
  192. right: 22rpx;
  193. top: 6rpx;
  194. min-width: 34rpx;
  195. height: 34rpx;
  196. line-height: 30rpx;
  197. text-align: center;
  198. padding: 0 8rpx;
  199. font-size: 18rpx;
  200. color: #fff;
  201. border: 2rpx solid #fff;
  202. background-color: $base-color;
  203. border-radius: 100rpx;
  204. }
  205. }
  206. }
  207. }
  208. .option-wrap {
  209. width: 700rpx;
  210. margin: 20rpx auto 0;
  211. margin-top: 20rpx;
  212. background: #fff;
  213. border-radius: 10rpx;
  214. }
  215. </style>