app-menu.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view>
  3. <!--空格区域-->
  4. <view class="safe-area-inset-bottom">
  5. <view class="u-bottom-height"></view>
  6. </view>
  7. <!--底部按钮-->
  8. <view class="safe-area-inset-bottom u-bottom-fixed">
  9. <view class="app-menu main-between">
  10. <view v-show="activity_loading" @click="toActivity" class="menu-btn dir-top-nowrap main-center cross-center">
  11. <image @load="activityLoad" :style="{'background-color': theme.background}" v-if="active === 'activity'" src="./../image/activity-active.png"></image>
  12. <image @load="activityLoad" v-else src="./../image/activity.png"></image>
  13. <view :style="{'color': active === 'activity' ? theme.color : ''}">活动</view>
  14. </view>
  15. <view v-show="order_loading" @click="toOrder" class="menu-btn dir-top-nowrap main-center cross-center">
  16. <image @load="orderLoad" :style="{'background-color': theme.background}" v-if="active === 'order'" src="./../image/order-active.png"></image>
  17. <image @load="orderLoad" v-else src="./../image/order.png"></image>
  18. <view :style="{'color': active === 'order' ? theme.color : ''}">订单</view>
  19. </view>
  20. <view v-show="me_loading" @click="toMe" class="menu-btn dir-top-nowrap main-center cross-center">
  21. <image @load="meLoad" :style="{'background-color': theme.background}" v-if="active === 'me'" src="./../image/me-active.png"></image>
  22. <image @load="meLoad" v-else src="./../image/me.png"></image>
  23. <view :style="{'color': active === 'me' ? theme.color : ''}">我的</view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. name: 'app-index',
  32. props: {
  33. active: {
  34. type: String
  35. },
  36. theme: Object
  37. },
  38. data() {
  39. return {
  40. activity_loading: false,
  41. order_loading: false,
  42. me_loading: false,
  43. };
  44. },
  45. methods: {
  46. activityLoad() {
  47. this.activity_loading = true;
  48. },
  49. orderLoad() {
  50. this.order_loading = true;
  51. },
  52. meLoad() {
  53. this.me_loading = true;
  54. },
  55. toActivity() {
  56. if (this.active === 'activity') {
  57. return false;
  58. }
  59. uni.redirectTo({
  60. url: '/plugins/community/index/index'
  61. });
  62. },
  63. toOrder() {
  64. if (this.active === 'order') {
  65. return false;
  66. }
  67. uni.redirectTo({
  68. url: '/plugins/community/order/order'
  69. });
  70. },
  71. toMe() {
  72. if(this.active === 'me') {
  73. return false;
  74. }
  75. uni.redirectTo({
  76. url: '/plugins/community/me/me'
  77. });
  78. },
  79. }
  80. }
  81. </script>
  82. <style scoped lang="scss">
  83. .u-bottom-fixed {
  84. position: fixed;
  85. bottom: 0;
  86. left: 0;
  87. width: 100%;
  88. z-index: 1500;
  89. background-color: #ffffff;
  90. }
  91. .u-bottom-height {
  92. height: 90upx;
  93. }
  94. .app-menu {
  95. height: #{90rpx};
  96. width: 100%;
  97. background-color: #fff;
  98. font-size: #{22rpx};
  99. border-top: #{2rpx} solid #e2e2e2;
  100. .menu-btn {
  101. width: #{200rpx};
  102. color: #666;
  103. text-align: center;
  104. height: #{90rpx};
  105. image {
  106. width: #{40rpx};
  107. height: #{40rpx};
  108. margin-bottom: #{3rpx};
  109. }
  110. }
  111. }
  112. </style>