app-menu.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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" :class="theme + '-m-back ' + theme" v-if="active === 'activity'" src="./../image/activity-active.png"></image>
  12. <image @load="activityLoad" v-else src="./../image/activity.png"></image>
  13. <view :class="[active === 'activity' ? activeClass: '']">活动</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" :class="theme + '-m-back ' + theme" v-if="active === 'order'" src="./../image/order-active.png"></image>
  17. <image @load="orderLoad" v-else src="./../image/order.png"></image>
  18. <view :class="[active === 'order' ? activeClass: '']">订单</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" :class="theme + '-m-back ' + theme" v-if="active === 'me'" src="./../image/me-active.png"></image>
  22. <image @load="meLoad" v-else src="./../image/me.png"></image>
  23. <view :class="[active === 'me' ? activeClass: '']">我的</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: String
  37. },
  38. data() {
  39. return {
  40. activeClass: '',
  41. activity_loading: false,
  42. order_loading: false,
  43. me_loading: false,
  44. };
  45. },
  46. methods: {
  47. activityLoad() {
  48. this.activity_loading = true;
  49. },
  50. orderLoad() {
  51. this.order_loading = true;
  52. },
  53. meLoad() {
  54. this.me_loading = true;
  55. },
  56. toActivity() {
  57. if (this.active === 'activity') {
  58. return false;
  59. }
  60. uni.redirectTo({
  61. url: '/plugins/community/index/index'
  62. });
  63. },
  64. toOrder() {
  65. if (this.active === 'order') {
  66. return false;
  67. }
  68. uni.redirectTo({
  69. url: '/plugins/community/order/order'
  70. });
  71. },
  72. toMe() {
  73. if(this.active === 'me') {
  74. return false;
  75. }
  76. uni.redirectTo({
  77. url: '/plugins/community/me/me'
  78. });
  79. },
  80. },
  81. created() {
  82. this.activeClass = this.theme + '-m-text ' + this.theme;
  83. }
  84. }
  85. </script>
  86. <style scoped lang="scss">
  87. .u-bottom-fixed {
  88. position: fixed;
  89. bottom: 0;
  90. left: 0;
  91. width: 100%;
  92. z-index: 1500;
  93. background-color: #ffffff;
  94. }
  95. .u-bottom-height {
  96. height: 90upx;
  97. }
  98. .app-menu {
  99. height: #{90rpx};
  100. width: 100%;
  101. background-color: #fff;
  102. font-size: #{22rpx};
  103. border-top: #{2rpx} solid #e2e2e2;
  104. .menu-btn {
  105. width: #{200rpx};
  106. color: #666;
  107. text-align: center;
  108. height: #{90rpx};
  109. image {
  110. width: #{40rpx};
  111. height: #{40rpx};
  112. margin-bottom: #{3rpx};
  113. }
  114. }
  115. }
  116. </style>