121212
This commit is contained in:
51
Web/src/pages/business/cdk.vue
Normal file
51
Web/src/pages/business/cdk.vue
Normal file
@@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<div class="module-title">
|
||||
CDK兑换
|
||||
</div>
|
||||
<div class="module-content tips" style="font-size:14px;">
|
||||
亲爱的航海家,CDK码可以在这里兑换奖励哦!
|
||||
</div>
|
||||
<div class="module-content">
|
||||
<div class="input">
|
||||
CDK码:<input name="cdk" placeholder="请输入CDK" class="ipt" type="text" v-model="no">
|
||||
</div>
|
||||
<div class="input" style="margin-top: 10px;">
|
||||
<input type="button" value="立即兑换" class="btn btn-danger" @click="exchange" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
|
||||
const no = ref('');
|
||||
onMounted(async () => {
|
||||
try {
|
||||
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const exchange = async () => {
|
||||
if (no.value == '') {
|
||||
MessageExtend.ShowToast("CDK不能为空!");
|
||||
return;
|
||||
}
|
||||
MessageExtend.LoadingToast("兑换中...");
|
||||
let result = await CdkService.Exchange(no.value);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
no.value = '';
|
||||
MessageExtend.Notify(result.msg, "success", 5000);
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user