index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <div class="wrapper">
  3. <img class="cover-1" src="./image/cover1@2x.png" alt="">
  4. <img class="cover-2" src="./image/cover2@2x.png" alt="">
  5. <div class="footer">
  6. <a class="btn-apply" href="javascript:;" @click="funJumpJoin">在线申请</a>
  7. </div>
  8. </div>
  9. </template>
  10. <script>
  11. import { getMyPartnerOrder } from './api'
  12. import { Toast } from 'vant'
  13. export default {
  14. name: 'explain',
  15. props: {
  16. inviteCode: {
  17. type: String,
  18. default: ''
  19. }
  20. },
  21. data () {
  22. return {
  23. myPartnerOrdeId: ''
  24. }
  25. },
  26. async mounted () {
  27. await this.$nextTick()
  28. this.$refreshTitle('成为合伙人')
  29. },
  30. methods: {
  31. funInit () {
  32. getMyPartnerOrder().then(res => {
  33. if (res.status) {
  34. const { id } = res.data
  35. if (id) {
  36. this.myPartnerOrdeId = id
  37. }
  38. }
  39. }).catch(err => {
  40. Toast(err)
  41. })
  42. },
  43. funJumpJoin () {
  44. if (this.myPartnerOrdeId) {
  45. this.$router.push({ path: `/partner/detail/${this.myPartnerOrdeId}` })
  46. return
  47. }
  48. this.$router.push({ path: '/partner/join?inviteCode=' + this.inviteCode })
  49. }
  50. },
  51. beforeRouteEnter (to, from, next) {
  52. next(vm => {
  53. vm.funInit()
  54. })
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .wrapper {
  60. width: 100%;
  61. min-height: 100vh;
  62. padding-bottom: 91px;
  63. background: #fff;
  64. }
  65. .cover-1 {
  66. display: block;
  67. width: 100%;
  68. min-height: 200px;
  69. }
  70. .cover-2 {
  71. display: block;
  72. width: 336px;
  73. margin: 43px auto 0;
  74. }
  75. .footer {
  76. position: fixed;
  77. left: 0;
  78. right: 0;
  79. bottom: 0;
  80. z-index: 99;
  81. display: flex;
  82. justify-content: center;
  83. align-items: center;
  84. width: 100%;
  85. // padding-bottom: constant(safe-area-inset-bottom);
  86. // padding-bottom: env(safe-area-inset-bottom);
  87. padding: 23px 0;
  88. }
  89. .btn-contact,
  90. .btn-apply {
  91. display: flex;
  92. justify-content: center;
  93. align-items: center;
  94. width: 327px;
  95. height: 45px;
  96. border-radius: 4px;
  97. background: linear-gradient(90deg, #DBC3A9 0%, #C7AB8A 100%);
  98. box-shadow: 0 14px 9px -10px rgba(219, 208, 194, 1);
  99. }
  100. .btn-contact {
  101. img {
  102. width: 29px;
  103. height: 29px;
  104. }
  105. span {
  106. margin-left: 3px;
  107. font-size: 14px;
  108. font-weight: 500;
  109. color: #fff;
  110. }
  111. }
  112. .btn-apply {
  113. font-size: 14px;
  114. font-weight: 500;
  115. color: #fff;
  116. }
  117. </style>