From 3c2ed94a95b75379231b67cb06181af1003c8d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98=E2=80=98?= Date: Wed, 26 Apr 2023 09:26:20 +0800 Subject: [PATCH] =?UTF-8?q?feature-tiktok-1.0:=E6=96=B0=E5=A2=9E=E5=85=91?= =?UTF-8?q?=E6=8D=A2AI=E7=BB=98=E7=94=BB=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/userInfo/userInfo.vue | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/pages/userInfo/userInfo.vue b/pages/userInfo/userInfo.vue index a5c26c1..d86e8ff 100644 --- a/pages/userInfo/userInfo.vue +++ b/pages/userInfo/userInfo.vue @@ -73,7 +73,6 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons return { userInfo: {}, noClick:true, //防止重复提交, - cdk: undefined, primaryColor: "#1a94bc", menus: [ { @@ -222,16 +221,36 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons title:'提示', editable: true, placeholderText:'请输入兑换cdk', - success() { + success(response) { + console.log('response',response); //调用使用cdk方法 const data = { - cdk: that.cdk, + cdk: response.content, userId: that.userInfo.id, - source: '1' + source: '1', + appType: '0' } useCdk(data).then(res =>{ console.log('res',res); + if(res.data.code != 200){ + uni.showToast({ + title: res.data.msg, + icon: 'none' + }) + }else{ + uni.showToast({ + title: '兑换成功!', + icon: 'none' + }) + } }) + }, + fail(res) { + uni.showToast({ + title: '兑换失败!', + icon: 'none' + }) + console.log('res',res); } }) },