mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-09 10:43:44 +08:00
redeem code function is ready
This commit is contained in:
@@ -8,13 +8,9 @@
|
||||
:title="title"
|
||||
>
|
||||
<div class="form" id="bind-mobile-form">
|
||||
<el-alert v-if="mobile !== ''" type="info" show-icon :closable="false" style="margin-bottom: 20px;">
|
||||
<p>请输入您参与众筹的 <strong style="color:#F56C6C">微信支付转账单号</strong> 兑换相应的对话次数。</p>
|
||||
</el-alert>
|
||||
|
||||
<el-form :model="form">
|
||||
<el-form-item label="转账单号">
|
||||
<el-input v-model="form.tx_id"/>
|
||||
<el-form-item label="兑换码">
|
||||
<el-input v-model="form.code"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -22,7 +18,7 @@
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button type="primary" @click="save">
|
||||
确认核销
|
||||
立即兑换
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
@@ -33,36 +29,33 @@
|
||||
import {computed, ref} from "vue";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {httpPost} from "@/utils/http";
|
||||
import {showMessageError, showMessageOK} from "@/utils/dialog";
|
||||
|
||||
const props = defineProps({
|
||||
show: Boolean,
|
||||
mobile: String
|
||||
});
|
||||
|
||||
const showDialog = computed(() => {
|
||||
return props.show
|
||||
})
|
||||
|
||||
const title = ref('众筹码核销')
|
||||
const title = ref('兑换码核销')
|
||||
const form = ref({
|
||||
tx_id: '',
|
||||
code: '',
|
||||
})
|
||||
|
||||
const emits = defineEmits(['hide']);
|
||||
|
||||
const save = () => {
|
||||
if (form.value.tx_id === '') {
|
||||
return ElMessage.error({message: "请输入微信支付转账单号"});
|
||||
if (form.value.code === '') {
|
||||
return ElMessage.error({message: "请输入兑换码"});
|
||||
}
|
||||
|
||||
httpPost('/api/reward/verify', form.value).then(() => {
|
||||
ElMessage.success({
|
||||
message: '核销成功',
|
||||
duration: 1000,
|
||||
onClose: () => location.reload()
|
||||
})
|
||||
httpPost('/api/redeem/verify', form.value).then(() => {
|
||||
showMessageOK("兑换成功!")
|
||||
emits('hide', true)
|
||||
}).catch(e => {
|
||||
ElMessage.error({message: "核销失败:" + e.message});
|
||||
showMessageError("兑换失败:" + e.message)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="member custom-scroll">
|
||||
<div class="inner">
|
||||
<div class="user-profile">
|
||||
<user-profile/>
|
||||
<user-profile :key="profileKey"/>
|
||||
|
||||
<el-row class="user-opt" :gutter="20">
|
||||
<el-col :span="12">
|
||||
@@ -12,11 +12,8 @@
|
||||
<el-col :span="12">
|
||||
<el-button type="primary" @click="showBindMobileDialog = true">更改账号</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button type="primary" v-if="enableReward" @click="showRewardDialog = true">加入众筹</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button type="primary" v-if="enableReward" @click="showRewardVerifyDialog = true">众筹核销
|
||||
<el-col :span="24">
|
||||
<el-button type="success" v-if="enableReward" @click="showRedeemVerifyDialog = true">兑换码核销
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
||||
@@ -99,24 +96,7 @@
|
||||
<bind-mobile v-if="isLogin" :show="showBindMobileDialog" :username="user.username"
|
||||
@hide="showBindMobileDialog = false"/>
|
||||
|
||||
<reward-verify v-if="isLogin" :show="showRewardVerifyDialog" @hide="showRewardVerifyDialog = false"/>
|
||||
|
||||
<el-dialog
|
||||
v-model="showRewardDialog"
|
||||
:show-close="true"
|
||||
width="400px"
|
||||
title="参与众筹"
|
||||
>
|
||||
<el-alert type="info" :closable="false">
|
||||
<div style="font-size: 14px">您好,目前每单位算力众筹价格为 <strong style="color: #f56c6c">{{ powerPrice }}
|
||||
</strong>元。
|
||||
由于本人没有开通微信支付,付款后请凭借转账单号,点击【众筹核销】按钮手动核销。
|
||||
</div>
|
||||
</el-alert>
|
||||
<div style="text-align: center;padding-top: 10px;">
|
||||
<el-image v-if="enableReward" :src="rewardImg"/>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<redeem-verify v-if="isLogin" :show="showRedeemVerifyDialog" @hide="redeemCallback"/>
|
||||
|
||||
<el-dialog
|
||||
v-model="showPayDialog"
|
||||
@@ -164,7 +144,7 @@ import {checkSession, getSystemInfo} from "@/store/cache";
|
||||
import UserProfile from "@/components/UserProfile.vue";
|
||||
import PasswordDialog from "@/components/PasswordDialog.vue";
|
||||
import BindMobile from "@/components/ResetAccount.vue";
|
||||
import RewardVerify from "@/components/RewardVerify.vue";
|
||||
import RedeemVerify from "@/components/RedeemVerify.vue";
|
||||
import {useRouter} from "vue-router";
|
||||
import {removeUserToken} from "@/store/session";
|
||||
import UserOrder from "@/components/UserOrder.vue";
|
||||
@@ -179,8 +159,7 @@ const rewardImg = ref('/images/reward.png')
|
||||
const qrcode = ref("")
|
||||
const showPasswordDialog = ref(false);
|
||||
const showBindMobileDialog = ref(false);
|
||||
const showRewardDialog = ref(false);
|
||||
const showRewardVerifyDialog = ref(false);
|
||||
const showRedeemVerifyDialog = ref(false);
|
||||
const text = ref("")
|
||||
const user = ref(null)
|
||||
const isLogin = ref(false)
|
||||
@@ -200,6 +179,7 @@ const payName = ref("支付宝")
|
||||
const curPay = ref("alipay") // 当前支付方式
|
||||
const vipInfoText = ref("")
|
||||
const store = useSharedStore()
|
||||
const profileKey = ref(0)
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
@@ -368,8 +348,11 @@ const closeOrder = () => {
|
||||
activeOrderNo.value = ''
|
||||
}
|
||||
|
||||
const loginSuccess = () => {
|
||||
location.reload()
|
||||
const redeemCallback = (success) => {
|
||||
showRedeemVerifyDialog.value = false
|
||||
if (success) {
|
||||
profileKey.value += 1
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<textarea v-model="value"/>
|
||||
{{data}}
|
||||
</div>
|
||||
<svg ref="svgRef"/>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -10,34 +9,16 @@ import {ref, onMounted, onUpdated} from 'vue';
|
||||
import {Markmap} from 'markmap-view';
|
||||
import {loadJS, loadCSS} from 'markmap-common';
|
||||
import {Transformer} from 'markmap-lib';
|
||||
import {httpPost} from "@/utils/http";
|
||||
|
||||
const transformer = new Transformer();
|
||||
const {scripts, styles} = transformer.getAssets();
|
||||
loadCSS(styles);
|
||||
loadJS(scripts);
|
||||
|
||||
const initValue = `# markmap
|
||||
|
||||
- beautiful
|
||||
- useful
|
||||
- easy
|
||||
- interactive
|
||||
`;
|
||||
|
||||
const value = ref(initValue);
|
||||
const svgRef = ref(null);
|
||||
let mm;
|
||||
|
||||
const update = () => {
|
||||
const {root} = transformer.transform(value.value);
|
||||
mm.setData(root);
|
||||
mm.fit();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
mm = Markmap.create(svgRef.value);
|
||||
update();
|
||||
});
|
||||
|
||||
onUpdated(update);
|
||||
const data=ref("")
|
||||
httpPost("/api/test/sse",{
|
||||
"message":"你是什么模型",
|
||||
"user_id":123
|
||||
}).then(res=>{
|
||||
// const source = new EventSource("http://localhost:5678/api/test/sse");
|
||||
// source.onmessage = function(event) {
|
||||
// console.log(event.data)
|
||||
// };
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
<el-row>
|
||||
<el-table :data="items" :row-key="row => row.id">
|
||||
<el-table-column prop="name" label="名称"/>
|
||||
<el-table-column prop="code" label="兑换码">
|
||||
<template #default="scope">
|
||||
<span>{{ substr(scope.row.code, 24) }}</span>
|
||||
@@ -26,11 +27,10 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="兑换人">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row['username'] !== ''">{{ dateFormat(scope.row['username']) }}</span>
|
||||
<span v-if="scope.row['username'] !== ''">{{ scope.row['username'] }}</span>
|
||||
<el-tag v-else>未兑换</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="user_id" label="兑换人ID"/>
|
||||
<el-table-column prop="power" label="算力"/>
|
||||
|
||||
<el-table-column label="生成时间">
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
<el-table-column prop="enabled" label="启用状态">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row['enabled']" @change="set('enabled',scope.row)"/>
|
||||
<el-switch v-model="scope.row['enabled']" @change="set('enabled',scope.row)" :disabled="scope.row['redeemed_at']>0"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user