grant.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view>
  3. <view class="uni-form-item uni-column">
  4. <view class="title" style="font-size: 40rpx;">卡号</view>
  5. <input v-model="n" class="uni-input" :disabled="true" />
  6. </view>
  7. <view class="uni-form-item uni-column">
  8. <view class="title" style="font-size: 40rpx;">激活码</view>
  9. <input v-model="p" class="uni-input" focus placeholder="激活码" />
  10. </view>
  11. <view>
  12. <view style="padding: 30rpx;">
  13. <button @click="submit" type="primary">激活</button>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. n: uni.getStorageSync("rfiCard"),
  23. p: ''
  24. }
  25. },
  26. methods: {
  27. async submit() {
  28. const {
  29. data: res
  30. } = await this.$httpRequest({
  31. url: '/app/activationRFI?n=' + this.n + "&p=" + this.p,
  32. method: 'get',
  33. urlType: this.$getUrlType()
  34. });
  35. if (res.code === 200) {
  36. uni.showModal({
  37. content: '激活成功',
  38. title: '提示',
  39. showCancel: false,
  40. success() {
  41. uni.navigateBack()
  42. }
  43. })
  44. } else {
  45. uni.showToast({
  46. duration: 2500,
  47. title: res.msg,
  48. icon: 'error',
  49. });
  50. }
  51. }
  52. }
  53. }
  54. </script>
  55. <style>
  56. </style>