bindCompanyUser.vue 2.0 KB

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