user-center.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <app-layout>
  3. <app-user-center-top
  4. :top-style="userCenter.top_style"
  5. :top-pic-url="userCenter.top_pic_url"
  6. :member-pic-url="userCenter.member_pic_url"
  7. :is_icon_super_vip="setting.is_icon_super_vip"
  8. ></app-user-center-top>
  9. <app-foot-box
  10. v-if="userCenter.is_foot_bar_status == 1"
  11. ></app-foot-box>
  12. <app-vip-card></app-vip-card>
  13. <app-account-balance
  14. v-if="userCenter.account_bar.status == 1"
  15. :margin="true"
  16. :round="true"
  17. :input-user-center="userCenter"
  18. ></app-account-balance>
  19. <app-my-order
  20. v-if="userCenter.is_order_bar_status == 1"
  21. :margin="true"
  22. :round="true"
  23. :order_bar="userCenter.order_bar"
  24. ></app-my-order>
  25. <app-my-service
  26. v-if="userCenter.is_menu_status == 1"
  27. :title="userCenter.menu_title"
  28. :menu_style="userCenter.menu_style"
  29. :menus="userCenter.menus"
  30. :margin="true"
  31. :round="true"
  32. ></app-my-service>
  33. <app-copyright
  34. v-if="copyright && copyright.status == '1'"
  35. background-color="transparent"
  36. :link="copyrightLink"
  37. :pic-url="copyright.pic_url"
  38. :text="copyright.description"
  39. ></app-copyright>
  40. </app-layout>
  41. </template>
  42. <script>
  43. import { mapState } from 'vuex';
  44. import AppUserCenterTop from '../../components/page-component/app-user-center-top/app-user-center-top.vue';
  45. import AppAccountBalance from '../../components/page-component/app-account-balance/app-account-balance.vue';
  46. import AppMyOrder from '../../components/page-component/app-my-order/app-my-order.vue';
  47. import AppMyService from '../../components/page-component/app-my-service/app-my-service.vue';
  48. import AppCopyright from '../../components/page-component/app-copyright/app-copyright';
  49. import AppVipCard from '../../components/page-component/app-vip-card/app-vip-card';
  50. import AppFootBox from '../../components/page-component/app-foot-box/app-foot-box';
  51. export default {
  52. name: 'user-center',
  53. components: {
  54. AppCopyright,
  55. AppUserCenterTop,
  56. AppAccountBalance,
  57. AppMyOrder,
  58. AppMyService,
  59. AppVipCard,
  60. AppFootBox
  61. },
  62. computed: {
  63. ...mapState({
  64. copyright: state => state.mallConfig.copyright,
  65. setting: state => state.mallConfig.mall.setting,
  66. userCenter: state => state.userCenter.data,
  67. }),
  68. copyrightLink() {
  69. if (!this.copyright) return {};
  70. let { open_type, new_link_url, params } = this.copyright.link;
  71. return {
  72. openType: open_type,
  73. url: new_link_url,
  74. params: params ? params : []
  75. };
  76. }
  77. },
  78. onShow() {
  79. this.$event.on(this.$const.EVENT_USER_LOGIN).then(() => {
  80. uni.redirectTo({
  81. url: `/pages/user-center/user-center`
  82. });
  83. });
  84. if (this.$user.isLogin()) {
  85. this.$store.dispatch('user/refreshInfo');
  86. }
  87. this.$store.dispatch('userCenter/data');
  88. }
  89. }
  90. </script>