3d添加印花 等
This commit is contained in:
@@ -47,6 +47,18 @@
|
||||
{{ $t('Renew.Yearly') }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="type promotion">
|
||||
<div class="text">{{ $t('Renew.promotionCode') }}:</div>
|
||||
<div class="succeed" v-show="promotionData.error == 'true'">
|
||||
{{promotionData.code}}
|
||||
<i class="fi fi-sr-times-hexagon" @click="clearPromotionCode"></i>
|
||||
</div>
|
||||
<div class="input" v-show="!promotionData.error || promotionData.error == 'false'">
|
||||
<input type="text" v-model="promotionData.code">
|
||||
<div style="cursor: pointer;" @click="examine">{{ $t('Renew.use') }}</div>
|
||||
</div>
|
||||
<div class="error" v-show="promotionData.error == 'false'">{{promotionData.str}}</div>
|
||||
</div>
|
||||
<div class="type payment">
|
||||
<div class="text">{{ $t('Renew.Payment') }}:</div>
|
||||
<label>
|
||||
@@ -134,6 +146,12 @@ export default defineComponent({
|
||||
isShowMark_:false,
|
||||
})
|
||||
let renewData = reactive({
|
||||
promotionData:{
|
||||
code:'',
|
||||
error:'',
|
||||
str:'',
|
||||
oldPrice:'',
|
||||
},
|
||||
personage:computed(()=>{
|
||||
return {
|
||||
title:t('Renew.PersonalVersion'),
|
||||
@@ -233,6 +251,7 @@ export default defineComponent({
|
||||
returnUrl:url,
|
||||
subscribeType:subscribeType,//yearly为年费,monthly为月费
|
||||
wallet:'ALIPAYHK',
|
||||
promotionCode:renewData.promotionData.code,
|
||||
}
|
||||
let httpsUrl = Https.httpUrls.payStripe
|
||||
payMethodData.isShowMark_ = true
|
||||
@@ -269,6 +288,38 @@ export default defineComponent({
|
||||
renew.renewModel = false
|
||||
setPaidBack()
|
||||
}
|
||||
const examine = ()=>{
|
||||
// renewData.promotionData.error
|
||||
let price = renewData.current?.price[renewData.current?.type]
|
||||
const normalNumber = Number(price.replace(/,/g, ''));
|
||||
if(!renewData.promotionData.code){
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
promotionCode:renewData.promotionData.code,
|
||||
price:normalNumber,
|
||||
}
|
||||
Https.axiosGet(Https.httpUrls.checkCoupon,{params:data}).then((rv:any)=>{
|
||||
if(rv){
|
||||
if(rv.status == "valid"){
|
||||
renewData.promotionData.error = 'true'
|
||||
renewData.promotionData.oldPrice = renewData.current?.price[renewData.current?.type]
|
||||
renewData.current.price[renewData.current.type] = (Number(rv.discountedPrice)).toLocaleString()
|
||||
|
||||
}else{
|
||||
renewData.promotionData.error = 'false'
|
||||
renewData.promotionData.str = rv.message
|
||||
}
|
||||
}else{
|
||||
}
|
||||
})
|
||||
}
|
||||
const clearPromotionCode = ()=>{
|
||||
renewData.promotionData.error = '';
|
||||
renewData.promotionData.code = ''
|
||||
renewData.current.price[renewData.current.type] = renewData.promotionData.oldPrice
|
||||
renewData.promotionData.oldPrice = ''
|
||||
}
|
||||
return{
|
||||
store,
|
||||
...toRefs(renew),
|
||||
@@ -281,6 +332,8 @@ export default defineComponent({
|
||||
payment,
|
||||
setPaidBack,
|
||||
completePayment,
|
||||
examine,
|
||||
clearPromotionCode,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -334,6 +387,41 @@ export default defineComponent({
|
||||
}
|
||||
.type{
|
||||
display: flex;
|
||||
&.promotion{
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
> .succeed{
|
||||
padding: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 1rem;
|
||||
background: #eee;
|
||||
> i{
|
||||
display: flex;
|
||||
margin-left: 1rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
> .input{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 2rem;
|
||||
border: 2px solid #000;
|
||||
overflow: hidden;
|
||||
padding: 0 1rem;
|
||||
input{
|
||||
border: none;
|
||||
height: 3rem;
|
||||
}
|
||||
}
|
||||
> .error{
|
||||
color: red;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
> .text{
|
||||
margin-right: 2rem;
|
||||
// font-weight: 600;
|
||||
|
||||
Reference in New Issue
Block a user