center.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="container">
  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. },
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .order-list {
  70. padding: 0 25rpx;
  71. background-color: #fff;
  72. .order-item {
  73. position: relative;
  74. padding: 26rpx 16rpx;
  75. border-bottom: 1rpx solid #eee;
  76. display: flex;
  77. justify-content: flex-start;
  78. align-items: center;
  79. font-size: 30rpx;
  80. &:last-child {
  81. border-bottom: none;
  82. }
  83. }
  84. .order-item-icon {
  85. font-size: 34rpx;
  86. margin-right: 18rpx;
  87. }
  88. .icon-arrow {
  89. position: absolute;
  90. top: 26rpx;
  91. right: 6rpx;
  92. }
  93. }
  94. // 底部操作栏
  95. .footer {
  96. position: fixed;
  97. bottom: var(--window-bottom);
  98. left: 0;
  99. right: 0;
  100. z-index: 11;
  101. box-shadow: 0 -4rpx 40rpx 0 rgba(151, 151, 151, 0.24);
  102. background: #fff;
  103. // 设置ios刘海屏底部横线安全区域
  104. padding-bottom: constant(safe-area-inset-bottom);
  105. padding-bottom: env(safe-area-inset-bottom);
  106. .btn-item {
  107. font-size: 30rpx;
  108. height: 90rpx;
  109. border-radius: 50rpx;
  110. display: flex;
  111. justify-content: center;
  112. align-items: center;
  113. }
  114. .btn-item-icon {
  115. font-size: 34rpx;
  116. margin-right: 18rpx;
  117. }
  118. }
  119. </style>