408249787@qq.com hai 1 día
pai
achega
a4a6c4f475
Modificáronse 2 ficheiros con 18 adicións e 9 borrados
  1. 10 4
      pages/index/components/exchange.uvue
  2. 8 5
      pages/index/home.uvue

+ 10 - 4
pages/index/components/exchange.uvue

@@ -4,7 +4,9 @@ import { exchangeCode } from '@/services/user'
 import { dict } from '@/.cool/store'
 import { user } from '@/.cool'
 
+import { useUi } from "@/uni_modules/cool-ui";
 
+const ui = useUi();
 const code = ref<string>('')
 
 async function handleExchange() {
@@ -21,10 +23,14 @@ async function handleExchange() {
       subjectId: dict.getValueByLabelMapByType('index_subject_id')['物理'],
     })
     await user.get()
-    uni.showToast({
-      title: '兑换成功',
-      icon: 'success'
-    })
+    ui.showConfirm({
+      title: "提示",
+      message: "兑换成功",
+      showCancel: false,
+      callback(action) {
+        console.log("用户已确认:", action);
+      },
+    });
   } catch (err: any) {
     uni.showToast({
       title: err.message,

+ 8 - 5
pages/index/home.uvue

@@ -126,11 +126,14 @@ async function handleExchange() {
 			subjectId: dict.getValueByLabelMapByType('index_subject_id')['物理'],
 		})
 		await user.get()
-		uni.showToast({
-			title: '兑换成功',
-			icon: 'success'
-		})
-		visible3.value = false
+		ui.showConfirm({
+			title: "提示",
+			message: "兑换成功",
+			showCancel: false,
+			callback(action) {
+				visible3.value = false
+			},
+		});
 	} catch (err: any) {
 		uni.showToast({
 			title: err.message,