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); } }) },