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

请输入激活码

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