提交 8cf215d5 编写于 作者: guangjun.yang's avatar guangjun.yang

请输入激活码

上级 3df7efc5
<template>
<van-popup v-model="show"
closeable
close-icon-position="top-right"
position="bottom"
>
<section class="bind-cart-wrapper">
<article class="title">兑换详情</article>
<article class="tip">
<div class="left">
<img src="../../images/cme/phrase2/info.png" />
<span>激活码用于兑换课程,您可以从订单详情或已购买到实体卡查看激活码密码。激活码一旦兑换,不可退回。</span>
</div>
</article>
<article class="code">
<van-field v-model="value"
clearable
label="激活码"
placeholder="请输入激活码"
error-message="请输入正确的激活码"
/>
</article>
<article class="bottom"> <van-button size="large" round color="#449284">确认兑换</van-button></article>
<section class="change-card-wrapper">
<van-popup
v-show="isShow"
@click-overlay="cancle"
close-icon-position="top-right"
position="bottom"
>
<section class="bind-cart-wrapper">
<article class="title">兑换详情</article>
<article class="tip">
<div class="left">
<img src="../../images/cme/phrase2/info.png" />
<span>激活码用于兑换课程,您可以从订单详情或已购买到实体卡查看激活码密码。激活码一旦兑换,不可退回。</span>
</div>
</article>
<article class="code">
<van-field
v-model="activationCode"
clearable
label="激活码"
placeholder="请输入激活码"
error-message="请输入正确的激活码"
/>
</article>
<article class="bottom">
<van-button @click="confirm" size="large" round color="#449284">确认兑换</van-button>
</article>
</section>
</van-popup>
</section>
</van-popup>
</template>
<script>
export default {
props: {
cardInfo: {
type: Object,
default: () => {}
},
show: {
isShow: {
type: Boolean,
default: false,
default: false
}
},
// computed: {
// cardShow() {
// return this.isShow;
// }
// },
data() {
return {
activationCode: '',
activationCode: ""
};
},
methods: {
cancle() {
console.log('cancle');
this.$emit("cancle");
},
confirm() {
// 时行校验
console.log('confirm');
this.$emit("confirm", this.activationCode);
}
}
};
</script>
......@@ -55,26 +68,26 @@ export default {
display: flex;
line-height: 1;
padding: px2rem(10px) px2rem(15px);
display: flex;
flex-direction: column;
display: flex;
flex-direction: column;
background: rgba(255, 255, 255, 1);
box-shadow: 0px -2px 10px 0px rgba(0, 0, 0, 0.1);
.title{
.title {
display: flex;
flex-direction: row;
font-size : 18px;
font-size: 18px;
align-items: center;
justify-content: center;
width: 100%;
margin-top: px2rem(20px);
}
.tip{
.tip {
display: flex;
margin-top: px2rem(40px);
.left{
.left {
display: flex;
line-height: 1.2;
font-size: px2rem(12px);
font-size: px2rem(12px);
img {
width: px2rem(12px);
height: px2rem(12px);
......@@ -84,13 +97,12 @@ export default {
color: #979899;
}
}
.code{
.code {
display: flex;
}
.bottom{
.bottom {
display: flex;
margin-bottom: px2rem(4px);
margin-bottom: px2rem(40px);
}
}
</style>
\ No newline at end of file
......@@ -62,7 +62,7 @@ Vue.mixin({
// import { buriedURL } from './apiConfig';
let domain = '';
if (process.env.BUILD_ENV === 'prod') {
if (process.env.BUILD_ENV === 'pro') {
domain = 'https://sc.yunqueyi.com';
} else if (process.env.BUILD_ENV === 'test') {
domain = 'https://test1-sc.yunqueyi.com';
......
......@@ -139,7 +139,7 @@
></BindCardButton>
<!--去兑换-->
<ChangeCard :show="show" :cardInfo="cardInfo" ></ChangeCard>
<ChangeCard :isShow="showChangeCard" @cancle="cancleChangeCard" @confirm="changeCardAction"></ChangeCard>
<!-- <CardPopup :cardInfo="cardInfo" :isShow="isShowPopup" @clickOverlay="clickOverlay" @cancle="jumpToCardList()" @confirm="confirm"></CardPopup> -->
<Loading v-show="showLoading" />
<div>
......@@ -274,7 +274,7 @@ export default {
id: 0
},
advertInfoList: [],
show: false,//是否展示兑换弹框
showChangeCard: true,//是否展示兑换弹框
};
},
components: {
......@@ -327,9 +327,9 @@ export default {
// let param = {};
// __getUserInfo64Comp(param);
// }
if (__isWeb) {
_this.getProjectParticularsV2();
}
// if (__isWeb) {
// _this.getProjectParticularsV2();
// }
window.__refresh = function() {
_this.getUserInfo();
};
......@@ -359,6 +359,28 @@ export default {
methods: {
...mapActions(["setUserInfo"]),
cancleChangeCard() {
this.showChangeCard = false;
},
// 兑换 返回值:0绑定失败,1绑定成功
changeCardAction(cardKey) {
console.log('in changeCard');
this.showChangeCard = false;
let _this = this;
let param = {
cardKey: cardKey,
cardType: 2,
portalProjectId: this.projectId
}
// param.setEntry = true;
this.POST("cme/projectCard/bind", param).then(res => {
if (res.code == "000000") {
_this.getProjectParticularsV2();
}
});
},
// 复制卡密
copyLink() {
console.log('in copyLink');
......@@ -502,7 +524,7 @@ export default {
if (res.code == "000000") {
this.getCardInfoByProvinceId(res.data);
}
});
});
},
// 根据省ID,获取学习卡信息
......@@ -709,15 +731,17 @@ export default {
}
});
},
//去兑换
changeClick(msg){
console.log(msg)
this.show = !this.show;
},
//去兑换
changeClick(msg){
this.showChangeCard = true;
},
// 弹框按钮事件
handlerAction(data) {
this.isShowDialog = false;
},
scrollFun() {
let scrollTop =
document.body.scrollTop || document.documentElement.scrollTop;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册