center.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <view class="container" :style="appThemeStyle">
  3. <!-- 订单页列表 -->
  4. <view class="order-list">
  5. <view class="order-item" v-for="(item, index) in orderList" :key="index" @click="$navTo(item.path)">
  6. <view class="order-item-icon" :style="{ color: item.color }">
  7. <text class="iconfont" :class="item.icon"></text>
  8. </view>
  9. <view class="order-item-name">{{ item.name }}</view>
  10. <view class="icon-arrow">
  11. <text class="iconfont icon-arrow-right"></text>
  12. </view>
  13. </view>
  14. </view>
  15. <!-- 操作按钮 -->
  16. <view class="footer">
  17. <view class="btn-wrapper">
  18. <view class="btn-item btn-item-main" @click="$navTo('pages/index/index')">
  19. <view class="btn-item-icon">
  20. <text class="iconfont icon-shouye2"></text>
  21. </view>
  22. <view class="btn-item-name">
  23. <text>返回首页</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import * as UserApi from '@/api/user'
  32. // 订单页数据
  33. const orderList = [{
  34. name: '商城订单',
  35. icon: 'icon-qpdingdan',
  36. color: 'rgb(253 65 0)',
  37. path: 'pages/order/index'
  38. },
  39. {
  40. name: '充值订单',
  41. icon: 'icon-jifen',
  42. color: 'rgb(191, 150, 7)',
  43. path: 'pages/wallet/recharge/order'
  44. }
  45. ]
  46. export default {
  47. data() {
  48. return {
  49. orderList
  50. }
  51. },
  52. /**
  53. * 生命周期函数--监听页面加载
  54. */
  55. onLoad(options) {
  56. // 获取当前用户信息
  57. this.getUserInfo()
  58. },
  59. methods: {
  60. // 获取当前用户信息
  61. getUserInfo() {
  62. const app = this
  63. UserApi.info()
  64. .then(result => {
  65. const userInfo = result.data.userInfo
  66. app.avatarUrl = userInfo.avatar_url
  67. app.form.avatarId = userInfo.avatar_id
  68. app.form.nickName = userInfo.nick_name
  69. })
  70. },
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .order-list {
  76. padding: 0 25rpx;
  77. background-color: #fff;
  78. .order-item {
  79. position: relative;
  80. padding: 26rpx 16rpx;
  81. border-bottom: 1rpx solid #eee;
  82. display: flex;
  83. justify-content: flex-start;
  84. align-items: center;
  85. font-size: 30rpx;
  86. &:last-child {
  87. border-bottom: none;
  88. }
  89. }
  90. .order-item-icon {
  91. font-size: 34rpx;
  92. margin-right: 18rpx;
  93. }
  94. .icon-arrow {
  95. position: absolute;
  96. top: 26rpx;
  97. right: 6rpx;
  98. }
  99. }
  100. // 底部操作栏
  101. .footer {
  102. position: fixed;
  103. bottom: var(--window-bottom);
  104. left: 0;
  105. right: 0;
  106. z-index: 11;
  107. box-shadow: 0 -4rpx 40rpx 0 rgba(151, 151, 151, 0.24);
  108. background: #fff;
  109. // 设置ios刘海屏底部横线安全区域
  110. padding-bottom: constant(safe-area-inset-bottom);
  111. padding-bottom: env(safe-area-inset-bottom);
  112. .btn-item {
  113. font-size: 30rpx;
  114. height: 90rpx;
  115. border-radius: 50rpx;
  116. display: flex;
  117. justify-content: center;
  118. align-items: center;
  119. }
  120. .btn-item-icon {
  121. font-size: 34rpx;
  122. margin-right: 18rpx;
  123. }
  124. }
  125. </style>