index.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view>
  3. <view class="content"><u-button @click="jumpBank">前往题库</u-button></view>
  4. </view>
  5. </template>
  6. <script>
  7. import { mapGetters } from 'vuex';
  8. export default {
  9. components: {},
  10. data() {
  11. return {};
  12. },
  13. onPullDownRefresh() {},
  14. onLoad(option) {},
  15. onShow() {
  16. /* if(this.current === 2 && this.$method.isLogin()){
  17. this.$refs.refMy.init();
  18. } */
  19. },
  20. onShareAppMessage(res) {
  21. var self = this;
  22. return {
  23. title: '中正',
  24. path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
  25. };
  26. },
  27. methods: {
  28. jumpBank() {
  29. this.$navTo.togo('/pages2/bank/question_record');
  30. },
  31. getDict() {
  32. },
  33. updateHomePlan() {
  34. this.$refs.home.init();
  35. },
  36. beforeSwitch(index) {
  37. let that = this;
  38. if (index == 1) {
  39. this.isClick1 = true;
  40. }
  41. if (index == this.current) {
  42. return false;
  43. }
  44. if (!this.$method.isLogin()) {
  45. if (index == 0 || index == 1) {
  46. return true;
  47. } else {
  48. this.$navTo.togo('/pages/login/login');
  49. return false;
  50. }
  51. } else {
  52. if (index == 2) {
  53. this.$refs.refMy.init();
  54. }
  55. return true;
  56. }
  57. }
  58. },
  59. onReachBottom() {},
  60. // computed: { ...mapGetters(['userInfo']) }
  61. };
  62. </script>
  63. <style scoped>
  64. .content {
  65. height: 80vh;
  66. display: flex;
  67. align-items: center;
  68. justify-content: center;
  69. }
  70. </style>