main.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view class="sign-page">
  3. <view class="page-inner">
  4. <view class="page-bg">
  5. <image class="inner-img" src="/static/app/page1/home_bg.png" mode="widthFix"></image>
  6. </view>
  7. <view class="page-head">
  8. <image class="inner-img" src="/static/app/page1/head_top.png" mode="widthFix"></image>
  9. </view>
  10. <button class="page-btn u-reset-button" type="default" @click="navToSubscribe">
  11. <view class="inner">
  12. <image class="inner-img" src="/static/app/page1/btn.png" mode="aspectFill"></image>
  13. <view class="circle-round border-1"></view>
  14. <view class="circle-round border-2"></view>
  15. </view>
  16. </button>
  17. <!-- 手机号 -->
  18. <c-pop-phone ref="modelPhone"></c-pop-phone>
  19. <!-- 默认loading -->
  20. <u-toast ref="uToast"></u-toast>
  21. <!-- 授权 -->
  22. <c-pop-auth id="test" ref="modelAuth"></c-pop-auth>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import store from "@/store/index.js";
  28. export default {
  29. components: {},
  30. data() {
  31. return {
  32. };
  33. },
  34. methods: {
  35. navToSubscribe(){
  36. this.$nextTick(() => {
  37. console.log(this)
  38. if(this.$refs.modelAuth){
  39. this.$refs.modelAuth.$confirm({}).then(res => {
  40. if(res == 1){
  41. this.$u.route({
  42. url: '/pages/signs/subscribe/subscribe',
  43. type: "navigateTo",
  44. })
  45. }
  46. })
  47. }else {
  48. this.$u.route({
  49. url: '/pages/signs/subscribe/subscribe',
  50. type: "navigateTo",
  51. })
  52. }
  53. })
  54. },
  55. test() {
  56. this.$nextTick(() => {
  57. console.log(this)
  58. const com = this.selectComponent('#test')
  59. console.log(com)
  60. console.log(com.$vm)
  61. com.$vm.$confirm({}).then(res => {
  62. if(res == 1){
  63. this.$u.route({
  64. url: '/pages/signs/subscribe/subscribe',
  65. type: "navigateTo",
  66. })
  67. }
  68. })
  69. })
  70. }
  71. },
  72. created() {
  73. },
  74. onLoad() {
  75. console.log('---------',this)
  76. },
  77. onShow() {
  78. console.log('---------',this)
  79. },
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. @import "./index.scss";
  84. </style>