Commit 033d616d authored by hewenhao's avatar hewenhao

Merge branch 'feature/2021_03_12_bonus' of dev.jiuaoedu.com:wykolor/mall-webview…

Merge branch 'feature/2021_03_12_bonus' of dev.jiuaoedu.com:wykolor/mall-webview into feature/2021_03_12_bonus
parents 570b6d03 08dea97c
...@@ -174,9 +174,14 @@ ...@@ -174,9 +174,14 @@
> >
<div class="dialog-handle-btns"> <div class="dialog-handle-btns">
<van-button type="default" round @click="showBindWx = false">取消</van-button <van-button type="default" round @click="showBindWx = false">取消</van-button
><van-button type="primary" round @click="bindWeiChatModal" :disabled="binding" ><van-button
><van-loading v-if="binding" size="20px" color="#ccc">绑定中...</van-loading type="primary"
><span v-else>绑定微信</span></van-button round
@click="bindWeiChatModal"
:disabled="binding"
:loading="binding"
loading-text="绑定中..."
>绑定微信</van-button
> >
</div> </div>
</van-dialog> </van-dialog>
...@@ -308,17 +313,17 @@ const Bonus = defineComponent({ ...@@ -308,17 +313,17 @@ const Bonus = defineComponent({
const bindWeiChatModal = async () => { const bindWeiChatModal = async () => {
state.binding = true; state.binding = true;
try {
const params = await bindWeChat(); const params = await bindWeChat();
bindWeiChat(params) await bindWeiChat(params);
.then(() => {
Toast("绑定成功"); Toast("绑定成功");
state.showBindWx = false; state.showBindWx = false;
state.binding = false;
getBonusAccount(); getBonusAccount();
}) } catch (err) {
.catch(() => {
Toast("绑定失败"); Toast("绑定失败");
}); } finally {
state.binding = false;
}
}; };
// 绑定或者换邦 // 绑定或者换邦
const bindWeiChatOrUnbind = async () => { const bindWeiChatOrUnbind = async () => {
...@@ -327,15 +332,14 @@ const Bonus = defineComponent({ ...@@ -327,15 +332,14 @@ const Bonus = defineComponent({
state.showBindWx = true; state.showBindWx = true;
return false; return false;
} }
try {
const params = await bindWeChat(); const params = await bindWeChat();
bindWeiChat(params) await bindWeiChat(params);
.then(() => {
getBonusAccount(); getBonusAccount();
Toast("绑定成功"); Toast("绑定成功");
}) } catch {
.catch(() => {
Toast("绑定失败"); Toast("绑定失败");
}); }
}; };
return { return {
...toRefs(state), ...toRefs(state),
......
...@@ -79,7 +79,16 @@ ...@@ -79,7 +79,16 @@
</li> </li>
</ul> </ul>
<div class="handle-btns"> <div class="handle-btns">
<van-button round type="primary" size="large" block color="#027AFF;" @click="withdrawReal" <van-button
:loading="withdrawing"
:disabled="withdrawing"
loading-text="提现中..."
round
type="primary"
size="large"
block
color="#027AFF;"
@click="withdrawReal"
>确定</van-button >确定</van-button
> >
<van-button <van-button
...@@ -176,7 +185,8 @@ const Withdraw = defineComponent({ ...@@ -176,7 +185,8 @@ const Withdraw = defineComponent({
mobileTip: "", mobileTip: "",
withdrawAccount: "", withdrawAccount: "",
withdrawResponse: {}, withdrawResponse: {},
studentDailyWithdrawLimit: 0 // 学生单日提现上限 studentDailyWithdrawLimit: 0, // 学生单日提现上限
withdrawing: false
}); });
const { withdrawableTotal, withdrawAccount } = route.params; const { withdrawableTotal, withdrawAccount } = route.params;
state.withdrawableTotal = Number(withdrawableTotal); state.withdrawableTotal = Number(withdrawableTotal);
...@@ -229,6 +239,7 @@ const Withdraw = defineComponent({ ...@@ -229,6 +239,7 @@ const Withdraw = defineComponent({
Toast("请输入验证码"); Toast("请输入验证码");
return; return;
} }
state.withdrawing = true;
try { try {
const params = { const params = {
studentId: bonusStoreState.value.studentId, studentId: bonusStoreState.value.studentId,
...@@ -240,6 +251,8 @@ const Withdraw = defineComponent({ ...@@ -240,6 +251,8 @@ const Withdraw = defineComponent({
state.showWithdrawSuccess = true; state.showWithdrawSuccess = true;
} catch (err) { } catch (err) {
Toast(err); Toast(err);
} finally {
state.withdrawing = false;
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment