index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view>
  3. <view class="content">
  4. <view class="id">
  5. <label>充值卡号</label>
  6. <view><input placeholder="输入充值卡卡号" placeholder-class="placeholder" type="number" @input="getcardId" /></view>
  7. </view>
  8. <view class="pas">
  9. <label>充值卡密码</label>
  10. <view><input placeholder="输入充值卡密码" placeholder-class="placeholder" @input="getPassword" password type="number" /></view>
  11. </view>
  12. </view>
  13. <view class="chongzhi" @tap="remainder">确认激活</view>
  14. </view>
  15. </template>
  16. <script>
  17. const req = require('../../utils/request');
  18. const app = getApp();
  19. export default {
  20. data() {
  21. return {};
  22. },
  23. methods: {
  24. getcardId(e) {
  25. console.log(e.detail.value)
  26. this.setData({
  27. id: e.detail.value
  28. })
  29. },
  30. getPassword(e) {
  31. console.log(e.detail.value)
  32. this.setData({
  33. password: e.detail.value
  34. })
  35. },
  36. remainder() {
  37. if (!this.id) {
  38. return req.msg('请输入充值卡号')
  39. }
  40. if (!this.password) {
  41. return req.msg('请输入充值卡密码')
  42. }
  43. req.postRequest('/api/rrLogs/activationCard', {
  44. cardId: this.id,
  45. cardPW: this.password
  46. }, res => {
  47. if (res == 0) {
  48. uni.showToast({
  49. title: '充值成功!',
  50. icon: 'success',
  51. success: function () {
  52. setTimeout(function () {
  53. uni.navigateBack({
  54. delta: 1
  55. });
  56. }, 1500);
  57. }
  58. })
  59. // app.globalData.navigateTo('wallet/rechargeSuccess/index')
  60. } else {
  61. }
  62. })
  63. }
  64. }
  65. }
  66. </script>
  67. <style>
  68. @import "./index.css";
  69. </style>