setintegral.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="container">
  3. <view class="row b-b">
  4. <text class="tit">积分数</text>
  5. <input class="input" v-model="account" type="text" placeholder="请填写要转积分数" placeholder-class="placeholder" />
  6. </view>
  7. <view class="row b-b">
  8. <text class="tit">用户ID</text>
  9. <input class="input" v-model="ID" type="text" placeholder="请填写对应用户ID" placeholder-class="placeholder" />
  10. </view>
  11. <button class="add-btn" :class="{'bg-gray':loding}" @click="loding?'':confirm()">提交</button>
  12. </view>
  13. </template>
  14. <script>
  15. import { verify } from '@/api/login.js';
  16. import { setUserMoney } from '@/api/new.js';
  17. export default {
  18. data() {
  19. return {
  20. account: '', //积分数
  21. ID: '', //用户id
  22. };
  23. },
  24. methods: {
  25. confirm(e) {
  26. this.loding = true;
  27. uni.showLoading({
  28. title: '转账中',
  29. mask: true
  30. });
  31. setUserMoney({
  32. num: this.account,
  33. uid: this.ID
  34. })
  35. .then(({ data }) => {
  36. uni.hideLoading()
  37. this.loding = false;
  38. this.$api.msg('转账成功');
  39. this.account = '';
  40. this.ID = '';
  41. })
  42. .catch(err => {
  43. uni.hideLoading()
  44. this.loding = false;
  45. console.log(err);
  46. });
  47. }
  48. }
  49. };
  50. </script>
  51. <style lang="scss">
  52. page {
  53. background: $page-color-base;
  54. }
  55. .container {
  56. padding-top: 30rpx;
  57. }
  58. .row {
  59. display: flex;
  60. align-items: center;
  61. position: relative;
  62. padding: 0 30rpx;
  63. height: 110rpx;
  64. background: #fff;
  65. .tit {
  66. flex-shrink: 0;
  67. width: 120rpx;
  68. font-size: 30rpx;
  69. color: $font-color-dark;
  70. }
  71. .input {
  72. flex: 1;
  73. font-size: 30rpx;
  74. color: $font-color-dark;
  75. }
  76. .iconlocation {
  77. font-size: 36rpx;
  78. color: $font-color-light;
  79. }
  80. }
  81. .add-btn {
  82. display: flex;
  83. align-items: center;
  84. justify-content: center;
  85. width: 690rpx;
  86. height: 80rpx;
  87. margin: 60rpx auto;
  88. font-size: $font-lg;
  89. color: #fff;
  90. background-color: $base-color;
  91. border-radius: 10rpx;
  92. // box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  93. }
  94. .bg-gray{
  95. background-color: $color-gray;
  96. }
  97. .code {
  98. color: #5dbc7c;
  99. font-size: 23rpx;
  100. border-left: 1px solid #eeeeee;
  101. width: 150rpx;
  102. flex-shrink: 0;
  103. text-align: center;
  104. }
  105. </style>