@ -1,18 +1,18 @@
< template >
< view class = "container" v-if ="userInfo.user_id" >
< view class = "account-panel dis-flex flex-y-center" >
<!-- < view class = "account-panel dis-flex flex-y-center" >
< view class = "panel-lable" >
< text > 账户余额 < / text >
< / view >
< view class = "panel-balance flex-box" >
< text > ¥ { { userInfo . balance } } < / text >
< / view >
< / view >
< / view > -- >
< view class = "recharge-panel" >
< view class = "recharge-label" >
< text > 充值 卡兑换< / text >
< text > 礼品 卡兑换< / text >
< / view >
< view class = "recharge-plan clearfix" >
<!-- < view class = "recharge-plan clearfix" >
< block v-for ="(item, index) in planList" :key ="index" >
< view class = "recharge-plan_item" : class = "{ active: selectedPlanId == item.plan_id }" @click ="onSelectPlan(item.plan_id)" >
< view class = "plan_money" >
@ -23,10 +23,14 @@
< / view >
< / view >
< / block >
< / view >
< / view > -- >
< view class = "btnContainer" >
< view : class = "activeIndex==index?'btnItem active':'btnItem'" @click ="getPrizeItem(item)" v-for ="(item,index) in btnList" :key ="index" > {{ item.name }} < / view >
< / view >
<!-- 手动充值输入框 -- >
< view class = "recharge-input" >
< input type = "text" placeholder = "请输入充值卡CDKEY" v -model = " inputValue " @input ="onChangeMoney" / >
< input type = "text" placeholder = "请输入礼品 卡CDKEY" v -model = " inputValue " @input ="onChangeMoney" / >
< / view >
<!-- 确认按钮 -- >
< view class = "recharge-submit btn-submit" >
@ -38,7 +42,7 @@
<!-- 充值描述 -- >
< view class = "recharge-describe" >
< view class = "recharge-label" >
< text > 充值 卡说明< / text >
< text > 礼品 卡说明< / text >
< / view >
< view class = "content" >
<!-- < text space = "ensp" > { { setting . describe } } < / text > -- >
@ -52,6 +56,7 @@
< text space = "ensp" > 3 、 CDKEY区分大小写 , 请严格输入 < / text >
< / view >
< / view >
< u -toast ref = "uToast" / >
< / view >
< / template >
@ -80,6 +85,12 @@
selectedPlanId : 0 ,
/ / 自 定 义 金 额
inputValue : '' ,
remark : '牛肉' ,
btnList : [
{ name : '牦牛肉礼盒' , value : 0 } ,
{ name : '藏羊肉礼盒' , value : 1 } ,
] ,
activeIndex : 0
}
} ,
@ -127,13 +138,26 @@
/ / 按 钮 禁 用
app . disabled = true
/ / 提 交 到 后 端
cdkeyApi . submit ( { cdkey : app . inputValue } )
cdkeyApi . submit ( { cdkey : app . inputValue , remark : app . remark } )
. then ( result => {
app . $toast ( result . message ) ,
console . log ( result )
/ / a p p . $ t o a s t ( ' 兑 换 成 功 ' )
/ / a p p . $ t o a s t ( r e s u l t . m e s s a g e ) ,
app . getPageData ( )
} )
. finally ( ( ) => app . disabled = false )
app . $refs . uToast . show ( {
title : '兑换成功'
} )
} ) . finally ( ( ) => app . disabled = false )
} ,
getPrizeItem ( item ) {
this . activeIndex = item . value ;
if ( item . value == 0 ) {
this . remark = '牛肉'
} else {
this . remark = '羊肉'
}
}
}
}
@ -179,7 +203,7 @@
}
. recharge - panel {
margin - top : 6 0rpx ;
padding - top : 10 0rpx ;
padding : 0 60 rpx ;
}
@ -265,4 +289,24 @@
color : # 888 ;
}
}
. btnContainer {
display : flex ;
align - items : center ;
. btnItem {
flex : 1 ;
border : 1 px solid # eaeaea ;
background - color : # ffffff ;
color : # 000000 ;
font - size : 28 rpx ;
border - radius : 10 rpx ;
padding : 20 rpx 0 ;
text - align : center ;
margin : 0 10 rpx ;
}
. active {
background - color : # 17 C161 ;
border : 1 px solid # 17 C161 ;
color : # ffffff ;
}
}
< / style >