|
@@ -14,8 +14,8 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="inputBox">
|
|
|
- <input type="text" v-model="vipQuery.activationCode" placeholder="请输入激活码"
|
|
|
- placeholder-class="activationIpt" />
|
|
|
+ <input type="text" v-model="vipQuery.activationCode" @input="handleInput" @paste="handlePaste"
|
|
|
+ placeholder="请输入激活码" placeholder-class="activationIpt" />
|
|
|
<u-button type="error " :loading="redeemload" loadingSize="20" shape="circle" text="立即兑换"
|
|
|
@click="confirmActivation"></u-button>
|
|
|
</view>
|
|
@@ -84,6 +84,16 @@
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ // 修复android粘贴出现回车问题
|
|
|
+ handleInput() {
|
|
|
+ this.vipQuery.activationCode = this.vipQuery.activationCode.replace(/\s/g, '');
|
|
|
+ },
|
|
|
+ handlePaste(event) {
|
|
|
+ let pasteData = event.clipboardData.getData('text');
|
|
|
+ pasteData = pasteData.replace(/\r?\n|\r/g, '');
|
|
|
+ this.vipQuery.activationCode = this.vipQuery.activationCode + pasteData;
|
|
|
+ },
|
|
|
+
|
|
|
// 用户信息
|
|
|
get_userinfo() {
|
|
|
refreshVip().then(res => {
|
|
@@ -107,10 +117,10 @@
|
|
|
|
|
|
// 二次确认
|
|
|
confirmActivation() {
|
|
|
- if(this.vipQuery.activationCode=='') {
|
|
|
+ if (this.vipQuery.activationCode == '') {
|
|
|
uni.showToast({
|
|
|
- title:'请输入激活码',
|
|
|
- icon:'none'
|
|
|
+ title: '请输入激活码',
|
|
|
+ icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
@@ -137,9 +147,9 @@
|
|
|
});
|
|
|
this.vipQuery.activationCode = ''
|
|
|
this.get_activationList()
|
|
|
- } else{
|
|
|
+ } else {
|
|
|
this.$refs.uToast.show({
|
|
|
- message:res.content
|
|
|
+ message: res.content
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -220,8 +230,8 @@
|
|
|
margin-top: 20rpx;
|
|
|
|
|
|
&>input {
|
|
|
- margin-left: 8rpx;
|
|
|
- width: 1800rpx;
|
|
|
+ margin-left: 16rpx;
|
|
|
+ width: 1600rpx;
|
|
|
}
|
|
|
|
|
|
.activationIpt {
|