<template>
	<view>
		<view class="uni-form-item uni-column">
			<view class="title" style="font-size: 40rpx;">卡号</view>
			<input v-model="n" class="uni-input" :disabled="true" />
		</view>
		<view class="uni-form-item uni-column">
			<view class="title" style="font-size: 40rpx;">激活码</view>
			<input v-model="p" class="uni-input" focus placeholder="激活码" />
		</view>
		<view>
			<view style="padding: 30rpx;">
				<button @click="submit" type="primary">激活</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				n: uni.getStorageSync("rfiCard"),
				p: ''
			}
		},
		methods: {
			async submit() {
				const {
					data: res
				} = await this.$httpRequest({
					url: '/app/activationRFI?n=' + this.n + "&p=" + this.p,
					method: 'get',
					urlType: this.$getUrlType()
				});
				if (res.code === 200) {
					uni.showModal({
						content: '激活成功',
						title: '提示',
						showCancel: false,
						success() {
							uni.navigateBack()
						}
					})
				} else {
					uni.showToast({
						duration: 2500,
						title: res.msg,
						icon: 'error',
					});
				}
			}
		}
	}
</script>

<style>

</style>
