leader.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view class="center">
  3. <view class="info">
  4. <view class="avatar"></view>
  5. <view class="name">城攻闪拓</view>
  6. </view>
  7. <view class="bottom" @click="bd()">绑定店铺</view>
  8. </view>
  9. </template>
  10. <script>
  11. import { mapState, mapMutations } from 'vuex';
  12. import { interceptor } from '@/utils/loginUtils';
  13. import { setLeader } from '@/api/coupon.js';
  14. export default {
  15. data() {
  16. return {
  17. id: ''
  18. };
  19. },
  20. computed: {
  21. ...mapState(['userInfo', 'orderInfo', 'hasLogin'])
  22. },
  23. onLoad(option) {
  24. if (!this.hasLogin) {
  25. interceptor();
  26. } else {
  27. this.id = option.scene;
  28. this.loadData();
  29. }
  30. },
  31. methods: {
  32. bd() {
  33. setLeader(
  34. {
  35. fuck: this.userInfo.uid,
  36. fuck_name: 'setLeader'
  37. },
  38. this.id
  39. ).then(e => {
  40. this.$api.msg('加入成功');
  41. setTimeout(function() {
  42. uni.switchTab({
  43. url: '/pages/index/index'
  44. });
  45. }, 1000);
  46. });
  47. }
  48. }
  49. };
  50. </script>
  51. <style lang="scss">
  52. .avatar {
  53. margin: 20rpx auto 0;
  54. width: 120rpx;
  55. height: 120rpx;
  56. border-radius: 50%;
  57. image {
  58. width: 100%;
  59. height: 100%;
  60. border-radius: 50%;
  61. }
  62. }
  63. .name {
  64. margin-top: 10rpx;
  65. text-align: center;
  66. font-size: 30rpx;
  67. font-family: PingFang SC;
  68. font-weight: 500;
  69. }
  70. .bottom {
  71. position: absolute;
  72. left: 0;
  73. right: 0;
  74. bottom: 100rpx;
  75. margin: 0 auto;
  76. width: 560rpx;
  77. background: linear-gradient(90deg, #fe6f61 0%, #ff4343 100%);
  78. color: #ffffff;
  79. text-align: center;
  80. padding: 26rpx 0rpx;
  81. border-radius: 50rpx;
  82. }
  83. </style>