Преглед изворни кода

fix: 优化领取优惠券流程,移除不必要的结果检查

laiqi пре 1 година
родитељ
комит
3c6bda0df7
1 измењених фајлова са 6 додато и 13 уклоњено
  1. 6 13
      src/pages/form/formStep3.vue

+ 6 - 13
src/pages/form/formStep3.vue

@@ -214,24 +214,17 @@ async function handleSubmit() {
 
   try {
     // 调用领取优惠券API
-    const result = await couponStore.receiveCoupon({
+    await couponStore.receiveCoupon({
       couponid: selectedCoupon.couponid,
       coupon2phone: phone.value,
       coupon2productids: productsid.value,
     })
 
-    if (result && result.Success) {
-      message.alert({
-        msg: '优惠券领取成功,请注意查收短信',
-        title: '提示',
-      })
-      phoneDialogVisible.value = false // 关闭弹窗
-    } else {
-      message.alert({
-        msg: result?.Message || '领取失败,请稍后再试',
-        title: '提示',
-      })
-    }
+    message.alert({
+      msg: '优惠券领取成功,请注意查收短信',
+      title: '提示',
+    })
+    phoneDialogVisible.value = false // 关闭弹窗
 
     submitLoading.value = false
   } catch (error) {