Files
aida_front/src/component/HomePage/renew.vue

243 lines
5.4 KiB
Vue
Raw Normal View History

2024-12-11 16:26:36 +08:00
<template>
<div class="renew" ref="renew"></div>
<a-modal
class="generalModel"
:get-container="() => $refs.renew"
v-model:visible="renewModel"
:footer="null"
:width="pageWidth"
height="auto"
:maskClosable="false"
:centered="true"
:closable="false"
:mask="renewModelMask"
:keyboard="false"
:destroyOnClose="true"
:zIndex="1000"
>
<div class="generalModel_btn">
<div class="generalModel_closeIcon" @click.stop="cancelDsign()">
<!-- <i class="fi fi-rr-cross-small"></i> -->
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
2025-01-07 17:15:28 +08:00
<circle cx="23" cy="23" r="23" fill="white" fill-opacity="0.3"/>
<rect x="32.5063" y="12" width="3" height="29" rx="1.5" transform="rotate(45 32.5063 12)" fill="white"/>
<rect x="34.6274" y="32.5059" width="3" height="29" rx="1.5" transform="rotate(135 34.6274 32.5059)" fill="white"/>
</svg>
2024-12-11 16:26:36 +08:00
</div>
</div>
<div class="renewContent">
<div class="generalModelTitle">
2024-12-23 16:23:18 +08:00
{{ $t('Renew.title') }}
2024-12-11 16:26:36 +08:00
</div>
<div class="renew_detail">
<div class="name generalModelTitle">{{ current.title }}</div>
<div class="price_box">
<div class="price">
<sub>$</sub>
{{ current.price[current.type] }} <span>{{ current.unit[current.type] }}</span>
</div>
<div class="type" v-if="current.typeList.length > 1">
<label>
<input name="pric" type="radio" value="monthly" v-model="current.type" @change="setPricType('monthly')">
2024-12-23 16:23:18 +08:00
{{ $t('Renew.Monthly') }}
2024-12-11 16:26:36 +08:00
</label>
<label>
<input name="pric" type="radio" value="year" v-model="current.type" @change="setPricType('year')">
2024-12-23 16:23:18 +08:00
{{ $t('Renew.Yearly') }}
2024-12-11 16:26:36 +08:00
</label>
</div>
<div class="info">{{ current.info }}</div>
</div>
2024-12-23 16:23:18 +08:00
<div class="gallery_btn gallery_btn_radius" @click="payment">{{ $t('Renew.SubscribeNow') }}</div>
2024-12-11 16:26:36 +08:00
</div>
<div
class="login_footer_item_text"
@click="turnToWindow(
'https://code-create.com.hk/aida-terms-and-conditions/'
)"
>
Terms&Conditions
</div>
<div
class="login_footer_item_text"
@click="turnToWindow(
'https://code-create.com.hk/aida-subscription-agreement/'
)"
>
Privacy Policy
</div>
</div>
</a-modal>
2024-12-27 14:38:21 +08:00
<payMethod ref="payMethod" @completePayment="cancelDsign" type="renew"></payMethod>
2024-12-11 16:26:36 +08:00
</template>
<script lang="ts">
import { defineComponent,ref,reactive,toRefs ,onMounted} from "vue";
import { message } from "ant-design-vue";
import payMethod from "@/component/Pay/payMethod.vue";
import { useStore } from "vuex";
2024-12-23 16:23:18 +08:00
import { useI18n } from "vue-i18n";
2024-12-11 16:26:36 +08:00
const md5 = require("md5");
export default defineComponent({
components: {
payMethod,
},
setup(){
const store = useStore();
2024-12-23 16:23:18 +08:00
const {t} = useI18n()
2024-12-11 16:26:36 +08:00
let renew = reactive({
renewModel:false,
renewModelMask:true,
pageWidth:'50%'
})
let renewData = reactive({
personage:{
2024-12-23 16:23:18 +08:00
title:t('Renew.PersonalVersion'),
2024-12-11 16:26:36 +08:00
price:{
monthly:'500',
year:'5,000',
},
unit:{
2024-12-23 16:23:18 +08:00
monthly:t('Renew.HKDMonth'),
year:t('Renew.HKDYear'),
2024-12-11 16:26:36 +08:00
},
type:'monthly',
typeList:['monthly','year'],
info:'Tax, VAT not included.',
},
firm:{
title:'Education Edition',
price:{
year:'500',
},
unit:{
year:'HKD / Year',
},
type:'year',
typeList:['year'],
info:'Customised plan',
},
education:{
title:'Enterprise Edition',
price:{
year:'500',
},
unit:{
year:'HKD / Year',
},
type:'year',
typeList:['year'],
info:'Customised plan',
},
current:{
} as any,
payMethod:null as any,
})
const init = ()=>{
renew.renewModel = true
renewData.current = renewData.personage
}
const cancelDsign = () => {
renew.renewModel = false
}
const setPricType=(str:any)=>{
renewData.current.type = str
}
const payment = ()=>{
let subscribeType = 'Year'
if(renewData.current.type == 'monthly')subscribeType= 'Month'
let data = {
autoRenewal:true,//one_time为不自动续费
productName:'Subscription',
subscribeType,//yearly为年费monthly为月费
}
renewData.payMethod.init(data)
}
return{
store,
...toRefs(renew),
...toRefs(renewData),
init,
cancelDsign,
setPricType,
payment,
}
},
data() {
return {
};
},
methods: {
turnToWindow(url:any) {
window.open(url);
},
},
});
</script>
<style lang="less" scoped>
.renew {
.renewContent{
display: flex;
flex-direction: column;
align-items: center;
.generalModelTitle{
text-align: center;
}
.renew_detail{
width: 58rem;
height: 53rem;
border-radius: 3rem;
margin-bottom: 5rem;
border: 2px solid #000;
padding: 6rem 3rem 5rem;
display: flex;
flex-direction: column;
.price_box{
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
justify-content: space-between;
margin-bottom: 3rem;
}
.price{
font-size: 6rem;
sub{
font-size: 2rem;
top: -3rem;
}
span{
font-size: 2rem;
}
}
.type{
display: flex;
label{
display: flex;
align-items: center;
margin-right: 3rem;
input{
margin-right: 1rem;
}
}
label:last-child{
margin-right: 0rem;
}
}
}
.login_footer_item_text{
text-align: center;
margin-bottom: 1.5rem;
text-decoration: underline;
}
.login_footer_item_text:last-child{
margin-bottom: 0rem;
}
}
}
</style>