SellerBase.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="div seller-base">
  3. <view class="status-holder"></view>
  4. <view class="content">
  5. <slot></slot>
  6. </view>
  7. <view v-if="show" class='div common-footer-wrap'>
  8. <view class="common-footer">
  9. <view class='item-wrap' :class="{'active':page.route=='pages/seller/goods/Goodsonline'}">
  10. <navigator url="/pages/seller/goods/Goodsonline" class='item'>
  11. <image mode="aspectFit" src="@/static/image/seller/icon_home_seller_pre.png" class="image"
  12. v-if="page.route=='pages/seller/goods/Goodsonline'">
  13. <image mode="aspectFit" v-else src="@/static/image/seller/icon_home_seller_nor.png" class="image" />
  14. <text class='span text'>商品管理</text>
  15. </navigator>
  16. </view>
  17. <view class='item-wrap' :class="{'active':page.route=='pages/seller/order/OrderList'}" id='seller_order'>
  18. <navigator url="/pages/seller/order/OrderList" class='item'>
  19. <image mode="aspectFit" src="@/static/image/seller/icon_list_seller_pre.png" class="image"
  20. v-if="page.route=='pages/seller/order/OrderList'">
  21. <image mode="aspectFit" v-else src="@/static/image/seller/icon_list_seller_nor.png" class="image" />
  22. <text class='span text'>订单管理</text>
  23. </navigator>
  24. </view>
  25. <view class='item-wrap' :class="{'active':page.route=='pages/seller/index/Index'}" id='seller_index'>
  26. <navigator url="/pages/seller/index/Index" class='item'>
  27. <image mode="aspectFit" src="@/static/image/seller/icon_mine_seller_pre.png" class="image"
  28. v-if="page.route=='pages/seller/index/Index'">
  29. <image mode="aspectFit" v-else src="@/static/image/seller/icon_mine_seller_nor.png" class="image" />
  30. <text class='span text'>店铺中心</text>
  31. </navigator>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import {
  39. mapState
  40. } from 'vuex'
  41. export default {
  42. name: 'SellerBase',
  43. data() {
  44. return {
  45. page: '',
  46. }
  47. },
  48. props: {
  49. show: {
  50. type: Boolean,
  51. default: true
  52. }
  53. },
  54. computed: {
  55. ...mapState({
  56. user: state => state.seller.info
  57. }),
  58. },
  59. mounted: function() {
  60. var pages = getCurrentPages()
  61. var page = pages[pages.length - 1]
  62. this.page = {
  63. route: page.route,
  64. options: page.options
  65. }
  66. if (!this.user) {
  67. uni.redirectTo({
  68. url: '/pages/home/sellerlogin/Login?clear=1'
  69. })
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .status-holder {
  76. background-color: #fff;
  77. }
  78. .seller-base {
  79. /* #ifndef APP-PLUS-NVUE */
  80. display: flex;
  81. /* #endif */
  82. flex-direction: column;
  83. }
  84. .content {
  85. flex: 1
  86. }
  87. .item-wrap {
  88. position: relative
  89. }
  90. .image {
  91. width: 1rem;
  92. height: 1rem;
  93. /* #ifndef APP-PLUS-NVUE */
  94. display: block;
  95. margin-left: auto;
  96. margin-right: auto;
  97. /* #endif */
  98. margin-top: .2rem;
  99. margin-bottom: .2rem;
  100. }
  101. .icon {
  102. position: absolute;
  103. right: 0.8rem;
  104. top: 0.2rem;
  105. font-size: $h6;
  106. line-height: 0.7rem;
  107. width: 0.9rem;
  108. height: 0.7rem;
  109. background: #ef3338;
  110. border-radius: 1rem;
  111. text-align: center;
  112. color: #ffffff;
  113. }
  114. </style>