|
@@ -15,7 +15,7 @@
|
|
|
<view class="inp-con">
|
|
|
<u-input v-model="rechargeCode" placeholder="请输入充值码" :maxlength="8" input-align="center" />
|
|
|
</view>
|
|
|
- <u-button class="recharge-btn" shape="circle" :custom-style="customBtnStyle" hover-class="none" @click="messagePop=true">立即充值</u-button>
|
|
|
+ <u-button class="recharge-btn" shape="circle" :custom-style="customBtnStyle" hover-class="none" @click="goRecharge">立即充值</u-button>
|
|
|
</view>
|
|
|
<image class="module-footer-bg" src="/static/giftcard/module-footer-bg.png"></image>
|
|
|
</view>
|
|
@@ -58,6 +58,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import { giftCardUseCard } from '@/api/coupon'
|
|
|
export default{
|
|
|
data(){
|
|
|
return{
|
|
@@ -71,7 +72,26 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ // 立即充值
|
|
|
+ goRecharge(){
|
|
|
+ if(!this.rechargeCode){
|
|
|
+ uni.showToast({
|
|
|
+ title:"请输入充值码",
|
|
|
+ icon:"none"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ uni.showLoading({
|
|
|
+ mask: true,
|
|
|
+ title: "正在充值..."
|
|
|
+ })
|
|
|
+ giftCardUseCard({ sequence: this.rechargeCode }).then(res => {
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.status == 200){
|
|
|
+ this.messagePop = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|