index.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view>
  3. <!-- 首页 -->
  4. <HomePage v-if="showpage==0"></HomePage>
  5. <!-- 衣柜 -->
  6. <MardPage ref="yigui" v-if="showpage==1" @fatherMethod="initBtn"></MardPage>
  7. <!-- 搭配 -->
  8. <DapeiPage ref="chuanda" v-if="showpage==2" @fatherMethod="initshow"></DapeiPage>
  9. <!-- 商城 -->
  10. <ShopPage v-if="showpage==3"></ShopPage>
  11. <!-- 我的 -->
  12. <UserPage v-if="showpage==4"></UserPage>
  13. <!-- 底部 -->
  14. <view>
  15. <tm-bottomnavigation :auto-selected="false" :activeIndex="showpage" @change="changepage" style="height:50px" :list="list_1"></tm-bottomnavigation>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import HomePage from "@/pages/shouye/index"
  21. import MardPage from "@/pages/wardrobe/index"
  22. import DapeiPage from "@/pages/dapei/index"
  23. import ShopPage from "@/pages/shop/index"
  24. import UserPage from "@/pages/user/index"
  25. export default {
  26. components:{
  27. HomePage,
  28. MardPage,
  29. DapeiPage,
  30. ShopPage,
  31. UserPage
  32. },
  33. data() {
  34. return {
  35. list_1: [
  36. {iconSize: 60,showDot:false,icon: '/static/img/31.png',noIcon:'/static/img/31.png', value: '首页' },
  37. {iconSize: 60,showDot:false,icon: '/static/img/32.png',noIcon:'/static/img/32.png', value: '衣橱' },
  38. {iconSize: 60,showDot:false, icon: '/static/img/103.png',noIcon:'/static/img/103.png', value: '穿搭' },
  39. {iconSize: 60,showDot:false, icon: '/static/img/34.png',noIcon:'/static/img/34.png', value: '商城' },
  40. {iconSize: 60,showDot:false, icon: '/static/img/35.png',noIcon:'/static/img/35.png', value: '我的' }
  41. ],
  42. showpage:0
  43. };
  44. },
  45. onLoad(index) {
  46. this.$tm.theme.setBlack(true);
  47. if(index.index==1){
  48. this.showpage=1;
  49. this.initBtn()
  50. }else if(index.index==2){
  51. console.log(222)
  52. this.showpage=2;
  53. this.initshow()
  54. }else{
  55. this.showpage=0;
  56. }
  57. },
  58. created() {
  59. uni.onPushMessage((res) => {
  60. console.log("收到推送消息:",res) //监听推送消息
  61. })
  62. },
  63. methods: {
  64. initBtn(){
  65. this.$refs.yigui.qingkong();
  66. this.$refs.yigui.getQiu();
  67. },
  68. initshow(){
  69. this.$refs.chuanda.shuaxin()
  70. },
  71. changepage(info){
  72. this.showpage=info.index
  73. }
  74. }
  75. };
  76. </script>