app-foot-box.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view class="app-foot-list main-center">
  3. <view @click="toNext(item.name)" class="app-foot-item main-center" v-for="(item, key) in foot_bar" :key="key">
  4. <image :src="item.icon_url"></image>
  5. <view class="app-foot-info">
  6. <view class="app-foot-num" v-if="key == 0">{{userInfo.favorite ? userInfo.favorite : 0}}</view>
  7. <view class="app-foot-num" v-if="key == 1 ">{{userInfo.footprint ? userInfo.footprint : 0}}</view>
  8. <view>{{item.name}}</view>
  9. </view>
  10. </view>
  11. <view class="app-foot-line"></view>
  12. </view>
  13. </template>
  14. <script>
  15. import { mapState, mapGetters } from 'vuex';
  16. export default {
  17. name: 'app-foot-box',
  18. data() {
  19. return {
  20. }
  21. },
  22. computed: {
  23. ...mapState({
  24. theme: state => state.mallConfig.theme,
  25. userInfo: state => state.user.info,
  26. }),
  27. ...mapGetters('userCenter', {
  28. foot_bar: 'foot_bar'
  29. })
  30. },
  31. created() {
  32. let that = this;
  33. console.log(this.foot_bar);
  34. },
  35. methods: {
  36. toNext(name) {
  37. if(name == '我的收藏') {
  38. uni.navigateTo({
  39. url: `/pages/favorite/favorite`,
  40. });
  41. }else {
  42. uni.navigateTo({
  43. url: `/pages/foot/index/index`,
  44. });
  45. }
  46. }
  47. },
  48. }
  49. </script>
  50. <style scoped lang="scss">
  51. .app-foot-list {
  52. height: #{104rpx};
  53. position: relative;
  54. .app-foot-item {
  55. font-size: #{26rpx};
  56. color: #666666;
  57. padding-top: #{14rpx};
  58. width: 50%;
  59. image {
  60. margin-top: #{44rpx};
  61. width: #{40rpx};
  62. height: #{40rpx};
  63. margin-right: #{17rpx};
  64. }
  65. .app-foot-info {
  66. text-align: center;
  67. .app-foot-num {
  68. font-size: #{32rpx};
  69. margin-bottom: #{10rpx};
  70. }
  71. }
  72. }
  73. .app-foot-line {
  74. height: #{40rpx};
  75. width: #{2rpx};
  76. background-color: #666666;
  77. position: absolute;
  78. top: #{45rpx};
  79. left: 50%;
  80. margin-left: #{-2rpx};
  81. }
  82. }
  83. </style>