bind.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="content">
  3. <view class="row b-b flex">
  4. <text class="tit">上级UID</text>
  5. <input class="input" v-model="uid" type="number" placeholder-class="placeholder" placeholder="请输入上级UID" />
  6. </view>
  7. <view class="submit-box flex">
  8. <view class="submit" @click="bind">绑定上级</view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import {
  14. spread
  15. } from '@/api/user.js';
  16. export default {
  17. data() {
  18. return {
  19. uid: ''
  20. }
  21. },
  22. onLoad(opt) {
  23. },
  24. onShow() {
  25. },
  26. onReachBottom() {
  27. },
  28. onReady() {
  29. },
  30. methods: {
  31. bind() {
  32. if(this.uid == '') {
  33. return this.$api.msg('请输入上级UID')
  34. }
  35. spread({
  36. puid: this.uid
  37. }).then(res => {
  38. uni.showToast({
  39. title:'绑定成功',
  40. duration:2000
  41. });
  42. setTimeout(()=> {
  43. uni.navigateBack()
  44. },1500)
  45. })
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss">
  51. .row {
  52. background: #fff;
  53. padding: 42rpx 25rpx;
  54. font-size: 30rpx;
  55. color: #333333;
  56. image {
  57. width: 80rpx;
  58. height: 80rpx;
  59. border-radius: 50%;
  60. }
  61. .input {
  62. text-align: right;
  63. color: #333333;
  64. }
  65. }
  66. .submit-box {
  67. display: flex;
  68. flex-direction: column;
  69. padding-top: 157rpx;
  70. .submit {
  71. margin: 40rpx auto;
  72. width: 560rpx;
  73. background-color: #F75022;
  74. color: #FFFFFF;
  75. text-align: center;
  76. padding: 26rpx 0rpx;
  77. border-radius: 50rpx;
  78. }
  79. .dl {
  80. background-color: #FFFFFF;
  81. color: #F75022;
  82. }
  83. }
  84. </style>