center.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. import { filterModules } from '@/core/app'
  33. // 订单页数据
  34. const orderList = filterModules([{
  35. name: '商城订单',
  36. icon: 'icon-qpdingdan',
  37. color: 'rgb(253 65 0)',
  38. path: 'pages/order/index'
  39. },
  40. {
  41. name: '充值订单',
  42. icon: 'icon-jifen',
  43. color: 'rgb(191, 150, 7)',
  44. path: 'pages/wallet/recharge/order',
  45. moduleKey: 'market-recharge'
  46. }
  47. ])
  48. export default {
  49. data() {
  50. return {
  51. orderList
  52. }
  53. },
  54. /**
  55. * 生命周期函数--监听页面加载
  56. */
  57. onLoad(options) {
  58. // 获取当前用户信息
  59. this.getUserInfo()
  60. },
  61. methods: {
  62. // 获取当前用户信息(验证是否登录)
  63. getUserInfo() {
  64. const app = this
  65. UserApi.info()
  66. },
  67. }
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .order-list {
  72. padding: 0 25rpx;
  73. background-color: #fff;
  74. .order-item {
  75. position: relative;
  76. padding: 26rpx 16rpx;
  77. border-bottom: 1rpx solid #eee;
  78. display: flex;
  79. justify-content: flex-start;
  80. align-items: center;
  81. font-size: 30rpx;
  82. &:last-child {
  83. border-bottom: none;
  84. }
  85. }
  86. .order-item-icon {
  87. font-size: 34rpx;
  88. margin-right: 18rpx;
  89. }
  90. .icon-arrow {
  91. position: absolute;
  92. top: 26rpx;
  93. right: 6rpx;
  94. }
  95. }
  96. // 底部操作栏
  97. .footer {
  98. position: fixed;
  99. bottom: var(--window-bottom);
  100. left: 0;
  101. right: 0;
  102. z-index: 11;
  103. box-shadow: 0 -4rpx 40rpx 0 rgba(151, 151, 151, 0.24);
  104. background: #fff;
  105. // 设置ios刘海屏底部横线安全区域
  106. padding-bottom: constant(safe-area-inset-bottom);
  107. padding-bottom: env(safe-area-inset-bottom);
  108. .btn-item {
  109. font-size: 30rpx;
  110. height: 90rpx;
  111. border-radius: 50rpx;
  112. display: flex;
  113. justify-content: center;
  114. align-items: center;
  115. }
  116. .btn-item-icon {
  117. font-size: 34rpx;
  118. margin-right: 18rpx;
  119. }
  120. }
  121. </style>