Commit 3f1d9c59 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent da038380
......@@ -49,7 +49,7 @@
methods: {
handleShow() {
this.$refs.adPop.open('center');
this.startCountdown()
// this.startCountdown()
},
startCountdown() {
let that = this;
......
......@@ -199,10 +199,10 @@
this.handlePay();
},
handlePay() {
// if (this.os == 'ios') {
// message.notify('暂不支持ios支付');
// return
// }
if (this.os == 'ios') {
message.notify('暂不支持ios支付');
return
}
let that = this;
let vipBean = this.vipList[this.selectedIndex];
......
......@@ -111,7 +111,7 @@
<view class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</view>
<view class="item arrow" @click="handleFind">
如何找到我
兑换会员
<view class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</view>
<view class="item arrow" @click="handlePhone">
......@@ -153,7 +153,6 @@
},
methods: {
show() {
// loadData() {
this.post({
url: '/user/baseMsg',
showLoading: false,
......@@ -171,11 +170,9 @@
navigateTo(`/pagesA/task/task`)
},
handleDotRecord() {
// 看点记录
navigateTo(`/pagesD/dotRecord/dotRecord`)
},
handleUseDotRecord() {
// 看点消费记录
navigateTo(`/pagesD/useDotRecord/useDotRecord`)
},
handleWatchRecord() {
......@@ -191,16 +188,13 @@
navigateTo(`/pagesA/vipPay/vipPay`)
},
handleFind() {
this.showMask = true
navigateTo(`/pagesD/cdkey/cdkey`)
},
handlePhone() {
this.showKefuPop = true
},
paySuccess(largeType) {
// largeType=vip 开通vip
// largeType=point 购买看点
message.notify('支付成功');
this.post({
url: '/user/baseMsg',
showLoading: false,
......@@ -210,11 +204,6 @@
this.userBean = data;
}
});
},
getPhoneNumber(e) {
console.log(e.detail.code) // 动态令牌
console.log(e.detail.errMsg) // 回调信息(成功失败都会返回)
console.log(e.detail.errno) // 错误码(失败时返回)
}
}
};
......
......@@ -28,7 +28,7 @@
},
data() {
return {
imId: "58428734699"
test: ""
};
},
methods: {
......
......@@ -117,6 +117,14 @@
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
},{
"path": "cdkey/cdkey",
"style": {
"navigationStyle": "default",
"navigationBarTitleText": "兑换会员",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
}]
}
],
......
......@@ -263,10 +263,11 @@
// this.$refs.alertDialog.open();
},
handlePay() {
// if (this.os == 'ios') {
// message.notify('暂不支持ios支付');
// return
// }
if (this.os == 'ios') {
message.notify('暂不支持ios支付');
return
}
let that = this;
let vipBean = this.pointList[this.selectedIndex];
if (this.selectedIndex == -1) {
......
<template>
<view class="body">
<view class="search-head">
<view class="search-bar">
<input class="inputkeyword" type="text" placeholder="请输入兑换码" @input="showChangePrompt"
:value="keyword" />
<image v-if="keyword!=''" @click="clearWord" style="width: 36rpx; height: 36rpx"
src="@/static/video/close.png"></image>
</view>
<text class="searchbutton" @click="addByCDK">去兑换</text>
</view>
</view>
</template>
<script>
import common from '@/mixins/common';
import {
navigateBack,
message,
alert,
} from '@/utils/fun.js';
import {
openUrl
} from '@/utils/app+.js';
const app = getApp();
export default {
name: 'index',
mixins: [common],
data() {
return {
keyword: '',
};
},
methods: {
showChangePrompt(e) {
this.keyword = e.detail.value
},
addByCDK() {
if (this.keyword == '') {
message.notify('请输入兑换码')
return
}
this.post({
url: '/vip/addByCDK',
showLoading: false,
data: {
cdk: this.keyword
},
success: ({
data
}) => {
message.notify('恭喜您,成功兑换会员!')
setTimeout(() => {
navigateBack()
}, 1000)
}
});
}
}
};
</script>
<style lang="scss">
@import '@/scss/uni.scss';
.body {
background-color: whitesmoke;
}
.search-head {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 8%;
}
.search-bar {
border-radius: 60rpx;
margin: 10rpx 15rpx;
padding: 15rpx 30rpx;
width: 80%;
background-color: white;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between
}
.inputkeyword {
flex: 1;
margin-left: 30rpx;
}
.searchbutton {
text-align: center;
color: #000000;
font-size: 30rpx;
width: 20%;
margin-right: 10rpx;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment