bindCompanyUser.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view class="content">
  3. <view class="bindbox">
  4. <image :src="baseUrl + '/images/bindComUser.png'" mode="aspectFill"></image>
  5. <view>立即绑定,享受更多权益</view>
  6. </view>
  7. <button class="bind-btn" :loading="btnLodaing" :disabled="btnLodaing" @click="handleBind">立即绑定</button>
  8. </view>
  9. </template>
  10. <script>
  11. import { bindCompanyFsUser } from '@/api/companyUser.js'
  12. export default {
  13. data() {
  14. return {
  15. baseUrl:uni.getStorageSync('requestPath'),
  16. btnLodaing: false,
  17. companyUserId: '',
  18. }
  19. },
  20. onLoad(option) {
  21. let q = {}
  22. if(option.q) {
  23. q = decodeURIComponent(option.q) // 获取到二维码原始链接内容
  24. }
  25. this.companyUserId = q.companyUserId || option.companyUserId
  26. },
  27. methods: {
  28. handleBind() {
  29. this.btnLodaing = true
  30. uni.showLoading({
  31. title: '绑定中...'
  32. })
  33. bindCompanyFsUser(this.companyUserId).then(res=>{
  34. this.btnLodaing = false
  35. uni.hideLoading()
  36. uni.showToast({
  37. title: res.msg,
  38. icon: 'none'
  39. })
  40. }).catch(()=>{
  41. this.btnLodaing = false
  42. uni.hideLoading()
  43. })
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. .bindbox {
  50. display: flex;
  51. flex-direction: column;
  52. align-items: center;
  53. justify-content: center;
  54. padding-top: 20vh;
  55. font-family: PingFang SC, PingFang SC;
  56. font-weight: 400;
  57. font-size: 32rpx;
  58. color: #757575;
  59. image {
  60. height: 150rpx;
  61. width: 150rpx;
  62. margin-bottom: 50rpx;
  63. }
  64. }
  65. .content {
  66. width: 100%;
  67. display: flex;
  68. flex-direction: column;
  69. align-items: center;
  70. padding-bottom: calc(var(--window-bottom) + 150rpx);
  71. }
  72. .bind-btn {
  73. margin: 20vh auto 20px auto;
  74. width: 300px;
  75. height: 44px;
  76. line-height: 44px;
  77. text-align: center;
  78. background: #FF5C03 !important;
  79. color: #fff !important;
  80. font-size: 16px;
  81. font-weight: 500;
  82. border-radius: 22px;
  83. display: block;
  84. &:after {
  85. border: none;
  86. }
  87. }
  88. </style>