fix: issues
This commit is contained in:
@@ -44,9 +44,10 @@ export default defineComponent({
|
|||||||
const day = date.getUTCDate();
|
const day = date.getUTCDate();
|
||||||
const hour = date.getUTCHours();
|
const hour = date.getUTCHours();
|
||||||
const minute = date.getUTCMinutes();
|
const minute = date.getUTCMinutes();
|
||||||
|
const second = date.getUTCSeconds();
|
||||||
|
|
||||||
// 按照要求格式输出
|
// 按照要求格式输出
|
||||||
const formattedTime = `${year}年${month}月${day}日 ${hour}时${minute}分`;
|
const formattedTime = `${year}年${month}月${day}日 ${hour}时${minute}分${second}秒`;
|
||||||
return formattedTime;
|
return formattedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
<charge-code v-if="user.is_admin === true" />
|
<charge-code v-if="user.is_admin === true" />
|
||||||
|
|
||||||
<balance-history />
|
<balance-history ref="balanceHistory" />
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
@@ -24,9 +24,11 @@ import BalanceHistory from "@/components/BalanceHistory.vue";
|
|||||||
import ChargeCode from "@/components/ChargeCode.vue";
|
import ChargeCode from "@/components/ChargeCode.vue";
|
||||||
import ChargeNoticeBar from "@/components/ChargeNoticeBar.vue";
|
import ChargeNoticeBar from "@/components/ChargeNoticeBar.vue";
|
||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
const user = ref({});
|
const user = ref({});
|
||||||
const chargeCode = ref("")
|
const chargeCode = ref("")
|
||||||
|
const balanceHistory = ref(null);
|
||||||
|
|
||||||
const loadUserInfo = () => {
|
const loadUserInfo = () => {
|
||||||
request.get("/users/info").then((res) => {
|
request.get("/users/info").then((res) => {
|
||||||
@@ -55,6 +57,8 @@ const confirmCharge = () => {
|
|||||||
.patch(`/users/charge/${chargeCode.value}`)
|
.patch(`/users/charge/${chargeCode.value}`)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
loadUserInfo();
|
loadUserInfo();
|
||||||
|
chargeCode.value = "";
|
||||||
|
balanceHistory.value.loadHistories(); // Refresh BalanceHistory
|
||||||
showSuccessToast('充值成功');
|
showSuccessToast('充值成功');
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user