index.vue 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div id="container">
  3. <!-- banner模块-->
  4. <banner></banner>
  5. <!-- 未登录 登录窗口模块-->
  6. <div class="login_card" v-if="!is_login">
  7. <!-- 登录窗口-->
  8. <login_container v-if="status == 'login'" @changeStatus="change_status"
  9. @to_scan="change_status"></login_container>
  10. <!-- 扫码窗口-->
  11. <scan_container v-if="status == 'scan'" @changeStatus='change_status'></scan_container>
  12. <!-- 注册窗口-->
  13. <regist_container v-if="status == 'regist'" @changeStatus='change_status'
  14. @change_login_status="change_login_status"
  15. ></regist_container>
  16. </div>
  17. <!-- 登陆后 的个人首页-->
  18. <div class="personal_card" v-if="is_login">
  19. <personal_container></personal_container>
  20. <device_container></device_container>
  21. </div>
  22. <div class="service">
  23. <div class="head">
  24. <div>
  25. <div class="line"></div>
  26. <div class="title">功能服务</div>
  27. </div>
  28. </div>
  29. <div class="content">
  30. <img src="https://img.shuimuai.com/chongzhizhongxin.png" @click="to_recharge"></img>
  31. <img src="https://img.shuimuai.com/shebeiguanli.png"></img>
  32. <img src="https://img.shuimuai.com/chongzhizhongxin.png"></img>
  33. <img src="https://img.shuimuai.com/shebeiguanli.png"></img>
  34. </div>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. import banner from '@/components/banner'
  40. import login_container from '@/components/index/login'
  41. import scan_container from '@/components/index/scan'
  42. import regist_container from '@/components/index/regist'
  43. import personal_container from "@/components/index/personal";
  44. import device_container from "@/components/device/device";
  45. export default {
  46. name: "index_container",
  47. components: {
  48. banner, login_container, scan_container, regist_container, personal_container, device_container
  49. },
  50. data() {
  51. return {
  52. // 三种状态 扫码scan 注册regist 登录login
  53. status: "regist",
  54. is_login: false
  55. }
  56. },
  57. methods: {
  58. get_init_data() {
  59. },
  60. //切换到扫码
  61. change_status($status) {
  62. this.status = $status
  63. },
  64. //跳转充值中心
  65. to_recharge() {
  66. mpvue.navigateTo({
  67. url: "/pages/user_center/recharge/main"
  68. })
  69. },
  70. //修改登录状态
  71. change_login_status() {
  72. this.is_login = this.$store.getters.get_login_status
  73. }
  74. },
  75. mounted() {
  76. },
  77. onLoad($option) {
  78. // 判断存储是否登录
  79. let $token = wx.getStorageSync('token')
  80. if ($token) {
  81. this.$store.commit('set_token', $token);
  82. this.is_login = this.$store.getters.get_login_status
  83. }
  84. }
  85. }
  86. </script>
  87. <style scoped>
  88. @import "index.css";
  89. </style>