gift-navigation.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view class="safe-area-inset-bottom u-bottom-fixed">
  3. <view class="page-width gift-navigation dir-left-nowrap cross-center">
  4. <view @click="routeGo(`/plugins/gift/index/index`)" class="nav main-center cross-center">
  5. <view :class="['icon', 'gift-icon','background-image', `${tab_route === `plugins/gift/index/index` ? theme+'-background' : `default-background`}`]"></view>
  6. <text :class="[`text`, `${tab_route === `plugins/gift/index/index` ? theme + '-color' : `default-text`}`]">送礼</text>
  7. </view>
  8. <view class="line"></view>
  9. <view @click="routeGo(`/plugins/gift/order/order`)" class="nav main-center cross-center">
  10. <view :class="['icon', 'my-icon','background-image',`${tab_route === `plugins/gift/order/order` ? theme+'-background' : `default-background`}`]"></view>
  11. <text :class="[`text`, `${tab_route === `plugins/gift/order/order` ? theme + '-color' : `default-text`}`]">我的</text>
  12. </view>
  13. </view>
  14. <view :style="{width: `100%`, height: `${botHeight}rpx`}" v-if="navBool"></view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. name: 'gift-navigation',
  20. props: [`theme`, `botHeight`, `navBool`],
  21. data() {
  22. return {
  23. tab_route: '',
  24. load_success: false,
  25. }
  26. },
  27. created() {
  28. let page = getCurrentPages();
  29. this.tab_route = page[page.length - 1].route;
  30. },
  31. methods: {
  32. routeGo(data) {
  33. uni.redirectTo({
  34. url: data
  35. })
  36. }
  37. }
  38. }
  39. </script>
  40. <style scoped lang="scss">
  41. @import "../../css/gift.scss";
  42. .u-bottom-fixed {
  43. position: fixed;
  44. bottom: 0;
  45. left: 0;
  46. width: 100%;
  47. z-index: 1500;
  48. background-color: #ffffff;
  49. }
  50. /*导航*/
  51. .gift-navigation {
  52. height: #{96upx};
  53. border-top: #{1upx} solid #e2e2e2;
  54. background-color: #ffffff;
  55. .nav {
  56. width: 49.8%;
  57. height: 100%;
  58. .icon {
  59. width: #{34upx};
  60. height: #{34upx};
  61. margin-right: #{8upx};
  62. }
  63. .my-icon {
  64. background-image: url("../../image/my.png");
  65. }
  66. .gift-icon {
  67. background-image: url("../../image/gift-giving.png");
  68. }
  69. .text {
  70. font-size: #{32upx};
  71. margin-left: #{8upx};
  72. }
  73. .default-text {
  74. color: #999999;
  75. }
  76. .default-background {
  77. background-color: #999999;
  78. }
  79. }
  80. .line {
  81. width: .4%;
  82. height: #{48upx};
  83. background-color: #e2e2e2;
  84. }
  85. }
  86. </style>