瀏覽代碼

更新细节

wyling007 3 年之前
父節點
當前提交
0e8163431b
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/views/cashOut/components/cashout.vue

+ 3 - 2
src/views/cashOut/components/cashout.vue

@@ -7,7 +7,7 @@
 						<Field v-model="amount" label="提现金额(分)" type="number" placeholder="请输入提现金额" />
 					</CellGroup>
 					<div class="submit-box">
-						<Button :loading="loading" type="primary" hairline native-type="submit" loading-text="结算中..."> 提现 </Button>
+						<Button :loading="loading" :disabled="!amount" type="primary" hairline native-type="submit" loading-text="结算中..."> 提现 </Button>
 						<Button type="default" hairline @click="props.unmount"> 取消 </Button>
 					</div>
 				</Form>
@@ -21,9 +21,10 @@
 	import { CashOutModel } from "@/dataModel/cashOut";
 	const cashOutModel = new CashOutModel();
 	const useCashout = () => {
-		const amount = ref<number | null>(null);
+		const amount = ref<number>();
 		const loading = ref(false);
 		const cashout = async () => {
+			if (!amount.value) return Toast.fail("请输入金额");
 			loading.value = true;
 			const data = await cashOutModel.cashout(amount.value);
 			loading.value = false;