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

940 lines
26 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"
2025-06-30 10:53:25 +08:00
width="110rem"
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"
>
<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>
</div>
</div>
<div class="renewContent">
<div class="left">
2025-06-30 10:53:25 +08:00
<div class="video">
<video autoplay loop muted playsinline src="@/assets/images/icon/paymentVideo.mp4"></video>
<div class="mask"></div>
</div>
<div class="title">{{ $t("Renew.Strengths") }}</div>
<div class="content">
<div class="benefitsItem">
<div class="describe">
<div class="icon">
2025-06-30 10:53:25 +08:00
<img src="@/assets/images/icon/paymentIntroduce1.png" alt="">
</div>
<div class="text">
2025-06-30 10:53:25 +08:00
<p class="title">{{ $t("Renew.StrengthsTitle1") }}<br>{{ $t("Renew.StrengthsTitle1_1") }}</p>
<p class="info">
2025-06-30 10:53:25 +08:00
{{ $t("Renew.StrengthsInfo1") }}<br>{{ $t("Renew.StrengthsInfo1_1") }}
</p>
</div>
</div>
</div>
<div class="benefitsItem">
<div class="describe">
<div class="icon">
2025-06-30 10:53:25 +08:00
<img src="@/assets/images/icon/paymentIntroduce2.png" alt="">
</div>
<div class="text">
2025-06-30 10:53:25 +08:00
<p class="title">{{ $t("Renew.StrengthsTitle2") }}<br>{{ $t("Renew.StrengthsTitle2_1") }}</p>
<p class="info">
2025-06-30 10:53:25 +08:00
{{ $t("Renew.StrengthsInfo2") }}<br>{{ $t("Renew.StrengthsInfo2_1") }}
</p>
</div>
</div>
</div>
<div class="benefitsItem">
<div class="describe">
<div class="icon">
2025-06-30 10:53:25 +08:00
<img src="@/assets/images/icon/paymentIntroduce3.png" alt="">
</div>
<div class="text">
2025-06-30 10:53:25 +08:00
<p class="title"></p>
<p class="title">{{ $t("Renew.StrengthsTitle3") }}<br>{{ $t("Renew.StrengthsTitle3_1") }}</p>
<p class="info">
2025-06-30 10:53:25 +08:00
{{ $t("Renew.StrengthsInfo3") }}<br>{{ $t("Renew.StrengthsInfo3_1") }}<br>{{ $t("Renew.StrengthsInfo3_2") }}
</p>
</div>
</div>
</div>
<div class="benefitsItem">
<div class="describe">
<div class="icon">
2025-06-30 10:53:25 +08:00
<img src="@/assets/images/icon/paymentIntroduce4.png" alt="">
</div>
<div class="text">
2025-06-30 10:53:25 +08:00
<p class="title">{{ $t("Renew.StrengthsTitle4") }}<br>{{ $t("Renew.StrengthsTitle4_1") }}</p>
<p class="info">
2025-06-30 10:53:25 +08:00
{{ $t("Renew.StrengthsInfo4") }}<br>{{ $t("Renew.StrengthsInfo4_1") }}
</p>
</div>
</div>
</div>
</div>
</div>
<div class="right">
<div class="title">
{{ $t("Renew.title") }}
</div>
2025-06-30 10:53:25 +08:00
<!-- <div class="info">{{ $t("Renew.unlimited") }}</div> -->
<div class="content">
<div
class="productItem"
:class="{
active: item.price == current.price,
sellWell: item.sellWell,
}"
v-for="item in personage"
:key="item.price"
@click="setPromotionData(item)"
>
<div class="popular" v-show="item.sellWell">MOST POPULAR</div>
<div class="priceBox">
<div class="left">
<p class="productType">1 {{ item.type.label }}</p>
<p class="price">${{ item.price }}</p>
</div>
<div class="right">
<div class="promotion">
<div
class="succeed"
v-show="item.promotionData.error == 'true'"
>
{{ item.promotionData.code }}
<i
class="fi fi-sr-times-hexagon"
@click="clearPromotionCode"
></i>
</div>
<div
class="input"
@click.stop
v-show="
!item.promotionData.error ||
item.promotionData.error == 'false'
"
>
<input
type="text"
:placeholder="$t('Renew.promotionCode')"
v-model="item.promotionData.code"
/>
<div style="cursor: pointer" @click="examine(item)">
{{ $t("Renew.use") }}
</div>
</div>
<div
class="error"
v-show="item.promotionData.error == 'false'"
>
{{ item.promotionData.str }}
</div>
</div>
<p
class="discountsPrice"
v-show="item.promotionData.price"
style="text-align: center"
>
${{ item.promotionData.price }}
</p>
</div>
</div>
</div>
</div>
<div class="payment">
<div class="allocation">
<div class="selectType">
<div class="text">{{ $t("Renew.Payment") }}:</div>
<label>
<input
name="payment"
type="radio"
value="CreditCard"
v-model="current.PaymentType"
@change="setPaymentType('CreditCard')"
/>
{{ $t("Renew.CreditCard") }}
</label>
<label>
<input
name="payment"
type="radio"
value="Alipay"
v-model="current.PaymentType"
@change="setPaymentType('Alipay')"
/>
{{ $t("Renew.Alipay") }}
</label>
</div>
</div>
<div class="gallery_btn gallery_btn_radius" @click="payment">
2025-07-19 14:04:48 +08:00
{{ $t("upgradePlan.Continue") }}
</div>
<div class="payMethod_payAffirm_clause" ref="labelDisclaimer">
<label>
2025-06-30 10:53:25 +08:00
<!-- <input type="checkbox" v-model="clause" /> -->
<span class="generalModelDescription"
2025-06-30 10:53:25 +08:00
>{{ $t("upgradePlan.policy")}}
2025-07-19 14:04:48 +08:00
<a
href="https://code-create.com.hk/aida-terms-and-conditions/"
2025-07-19 14:04:48 +08:00
target="_blank">
{{ $t("upgradePlan.policy1") }}
</a>
&
2025-06-30 10:53:25 +08:00
<a
href="https://code-create.com.hk/aida-subscription-agreement/"
2025-07-19 14:04:48 +08:00
target="_blank">
{{ $t("upgradePlan.policy2") }}
</a>
2025-06-30 10:53:25 +08:00
<!-- . * -->
</span
>
</label>
2025-06-30 10:53:25 +08:00
<label class="secure">
<span><i class="fi fi-rr-shield-check"></i>Pay safe & secure</span>
</label>
<label class="payIcon">
<img class="stripe" src="@/assets/images/icon/stripe.svg" alt="">
<img class="alipay" src="@/assets/images/icon/alipay.svg" alt="">
2025-07-19 14:04:48 +08:00
<img class="alipay" src="@/assets/images/icon/jcbPay.svg" alt="">
<img class="alipay" src="@/assets/images/icon/mastercardPay.svg" alt="">
<img class="alipay" src="@/assets/images/icon/yinlianPay.svg" alt="">
<img class="alipay" src="@/assets/images/icon/visaPay.svg" alt="">
2025-06-30 10:53:25 +08:00
</label>
</div>
<!-- <div class="paySecure">
2025-05-08 14:09:12 +08:00
<svg data-v-4715f595="" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 17" class="shield-icon"><path fill="#4AA181" stroke="#4AA181" stroke-width=".395" d="M7.44.957 1.914 3.398a1.38 1.38 0 0 0-.822 1.256v3.69c0 1.648.443 3.257 1.218 4.667 1.577 2.154 3.835 3.222 5.986 3.222 2.152 0 4.206-1.069 5.387-3.21a9.7 9.7 0 0 0 1.225-4.679v-3.69a1.38 1.38 0 0 0-.822-1.256L8.56.957zm0 0h.001m-.001 0h.001m0 0c.351-.158.758-.159 1.119 0z"></path><g clip-path="url(#a)"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.184" d="M10.634 6.563 7.016 10.18 5.37 8.536"></path></g><defs><clipPath id="a"><path fill="#fff" d="M4.055 4.586h7.895v7.895H4.055z"></path></clipPath></defs></svg>
<span>Pay safe & secure </span>
</div> -->
</div>
</div>
</div>
<div class="mark_loading" v-show="isShowMark_">
<a-spin size="large" />
</div>
<div class="mark_loading" v-show="isShowMark" state="true">
<div class="mark_loading_title">{{ $t("upgradePlan.completed") }}</div>
<div class="mark_loading_intro">{{ $t("upgradePlan.hint") }}</div>
<div class="mark_loading_title_box">
<div class="mark_loading_btn mark_loading_btn2" @click="setPaidBack">
{{ $t("upgradePlan.Back") }}
</div>
<div class="mark_loading_btn" @click="completePayment">OK</div>
</div>
</div>
</a-modal>
<payMethod
ref="payMethod"
@completePayment="cancelDsign"
type="renew"
></payMethod>
2024-12-11 16:26:36 +08:00
</template>
<script lang="ts">
import { defineComponent, computed, reactive, toRefs, onMounted } from "vue";
2024-12-11 16:26:36 +08:00
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";
2025-02-20 09:26:11 +08:00
import { Https } from "@/tool/https";
import md5 from "md5";
2024-12-11 16:26:36 +08:00
export default defineComponent({
components: {
payMethod,
},
setup() {
const store = useStore();
const { t } = useI18n();
let renew = reactive({
renewModel: false,
renewModelMask: true,
pageWidth: "50%",
});
let payMethodData = reactive({
clause: false,
labelDisclaimer: null as any,
newWindow: null as any,
isShowMark: false,
isShowMark_: false,
});
let renewData = reactive({
personage: [
{
price: "500",
sellWell: true,
activity: false, //活动打折
type: {
value: "Month",
2025-06-30 10:53:25 +08:00
label: "Monthly",
},
2025-07-19 14:04:48 +08:00
PaymentType: "CreditCard",
promotionData: {
code: "",
error: "",
str: "",
price: "",
},
},
{
price: "5,000",
sellWell: false,
activity: false, //活动打折
typeValue: "year",
type: {
value: "Year",
2025-06-30 10:53:25 +08:00
label: "Yearly",
},
PaymentType: "",
promotionData: {
code: "",
error: "",
str: "",
price: "",
},
},
],
// personage:computed(()=>{
// return {
// title:t('Renew.PersonalVersion'),
// price:{
// monthly:'500',
// year:'5,000',
// },
// unit:{
// monthly:t('Renew.HKDMonth'),
// year:t('Renew.HKDYear'),
// },
// type:'monthly',
// PaymentType:'',
// typeList:['monthly','year'],
// info:'Tax, VAT not included.',
// }
// }),
firm: computed(() => {
2024-12-11 16:26:36 +08:00
return {
title: "Education Edition",
price: {
year: "500",
},
unit: {
year: "HKD / Year",
},
type: "year",
autoRenewal: {
text: t("Renew.automatically"),
value: true,
},
typeList: ["year"],
info: "Customised plan",
2024-12-11 16:26:36 +08:00
};
}),
education: computed(() => {
return {
title: "Enterprise Edition",
price: {
year: "500",
},
unit: {
year: "HKD / Year",
},
type: "year",
autoRenewal: {
text: t("Renew.automatically"),
value: true,
},
typeList: ["year"],
info: "Customised plan",
};
}),
current: {} as any,
payMethod: null as any,
});
const init = () => {
renew.renewModel = true;
renewData.current = renewData.personage[0];
};
const cancelDsign = () => {
renew.renewModel = false;
};
const setPaymentType = (str: any) => {
renewData.current.PaymentType = str;
};
const payment = () => {
2025-06-30 10:53:25 +08:00
// if (!payMethodData.clause) {
// let labelDisclaimer: any = payMethodData.labelDisclaimer;
// if (!labelDisclaimer.classList.contains("animation")) {
// labelDisclaimer.classList.add("animation");
// setTimeout(() => {
// labelDisclaimer.classList.remove("animation");
// }, 1000);
// }
// return;
// }
if (!renewData.current.PaymentType)
return message.info(t("Renew.PleaseSelectPayment"));
let url = window.location.origin + "/paySucceed";
let data = {
autoRenewal: renewData.current.PaymentType != "Alipay", //false为不自动续费
productName: "Subscription",
quantity: 1,
returnUrl: url,
subscribeType: renewData.current.type.value, //yearly为年费monthly为月费
wallet: "ALIPAYHK",
promotionCode: renewData.current.promotionData.code,
};
let httpsUrl = Https.httpUrls.payStripe;
payMethodData.isShowMark_ = true;
Https.axiosPost(httpsUrl, data)
.then((rv: any) => {
var width = 800;
var height = 600;
var left = (screen.width - width) / 2;
var top = (screen.height - height) / 2;
payMethodData.newWindow = window.open(
"",
"_blank",
"width=" +
width +
", height=" +
height +
", left=" +
left +
", top=" +
top
);
let herf = rv;
if (payMethodData.newWindow) {
payMethodData.newWindow.location.href = herf;
} else {
// window.open(herf, '_blank');
window.location.href = herf;
}
payMethodData.newWindow = null;
payMethodData.isShowMark = true;
payMethodData.isShowMark_ = false;
})
.catch((res) => {
payMethodData.isShowMark_ = false;
});
// renewData.payMethod.init(data)
};
const setPaidBack = () => {
payMethod.payMethodModel = false;
payMethodData.isShowMark = false;
payMethodData.clause = false;
};
const completePayment = () => {
renew.renewModel = false;
setPaidBack();
};
const examine = (item: any) => {
// renewData.promotionData.error
let price = item?.price;
const normalNumber = Number(price.replace(/,/g, ""));
if (!item.promotionData.code) {
return;
}
let data = {
promotionCode: item.promotionData.code,
price: normalNumber,
};
Https.axiosGet(Https.httpUrls.checkCoupon, { params: data }).then(
(rv: any) => {
if (rv) {
renewData.personage.forEach((personageItem: any) => {
if (personageItem.price == item.price) {
if (rv.status == "valid") {
item.promotionData.error = "true";
item.promotionData.price = Number(
rv.discountedPrice
).toLocaleString();
} else {
item.promotionData.error = "false";
item.promotionData.str = rv.message;
}
}
});
} else {
}
}
);
};
const clearPromotionCode = () => {
renewData.current.promotionData.error = "";
renewData.current.promotionData.code = "";
renewData.current.promotionData.price = "";
};
const setPromotionData = (item: any) => {
renewData.current = item;
};
return {
store,
...toRefs(renew),
...toRefs(renewData),
...toRefs(payMethodData),
init,
cancelDsign,
setPaymentType,
payment,
setPaidBack,
completePayment,
examine,
clearPromotionCode,
setPromotionData,
};
},
data() {
return {};
},
methods: {
turnToWindow(url: any) {
window.open(url);
2024-12-11 16:26:36 +08:00
},
},
2024-12-11 16:26:36 +08:00
});
</script>
<style lang="less" scoped>
.renew {
:deep(.ant-modal-body) {
padding: 0;
}
.renewContent {
display: flex;
border-radius: 3rem;
overflow: hidden;
> .left,
> .right {
> .title {
text-align: center;
font-size: 3.2rem;
font-weight: 600;
line-height: 4rem;
2025-06-30 10:53:25 +08:00
position: relative;
}
> .info {
text-align: center;
opacity: 0.6;
font-weight: 400;
margin-top: 0.8rem;
font-size: 1.6rem;
2025-06-30 10:53:25 +08:00
position: relative;
}
> .content {
margin-top: 2rem;
display: flex;
flex-direction: column;
2025-06-30 10:53:25 +08:00
position: relative;
}
}
> .left {
2025-06-30 10:53:25 +08:00
width: 50%;
background: #0f0f0f;
color: #fff;
padding: 4rem 3.2rem;
2025-06-30 10:53:25 +08:00
position: relative;
> .video{
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
> video{
width: 100%;
height: 100%;
object-fit: cover;
}
> .mask{
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background: rgba(0,0,0,.5);
}
}
> .title {
2025-06-30 10:53:25 +08:00
opacity: 1;
// color: #fff;
}
> .content {
2025-06-30 10:53:25 +08:00
flex-wrap: wrap;
flex-direction: row;
> .benefitsItem {
display: flex;
2025-06-30 10:53:25 +08:00
width: 50%;
}
2025-06-30 10:53:25 +08:00
> .benefitsItem {
border-radius: 2.4rem;
margin-bottom: 1.6rem;
padding: 1.6rem;
2025-06-30 10:53:25 +08:00
justify-content: center;
> .describe {
display: flex;
align-items: center;
2025-06-30 10:53:25 +08:00
flex-direction: column;
> .icon {
2025-06-30 10:53:25 +08:00
// border: 1px solid #27272a;
// background: linear-gradient(#1d1d1d, #000);
// border-radius: 1.4rem;
// margin-right: 1.6rem;
// padding: 1.4rem;
> img {
2025-06-30 10:53:25 +08:00
width: 12rem;
height: 12rem;
}
}
> .text {
2025-06-30 10:53:25 +08:00
text-align: center;
> p {
margin: 0;
}
> .title {
2025-06-30 10:53:25 +08:00
font-size: 2.1rem;
font-weight: 600;
2025-06-30 10:53:25 +08:00
line-height: 1;
}
> .info {
2025-06-30 10:53:25 +08:00
font-weight: 600;
margin-top: 0.4rem;
2025-06-30 10:53:25 +08:00
font-size: 1.2rem;
// opacity: 0.5;
}
}
}
}
}
}
> .right {
2025-06-30 10:53:25 +08:00
width: 50%;
flex-direction: column;
align-items: center;
padding: 4rem 3.2rem;
> .content {
margin-top: 2rem;
> .productItem {
margin-bottom: 1rem;
border-radius: 1rem;
overflow: hidden;
border: 2px solid #eaecf0;
2025-02-20 09:26:11 +08:00
> .popular {
background: #2d9f75;
font-weight: 600;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
padding: 0.8rem 1.2rem;
}
> .priceBox {
height: 11rem;
padding: 1rem 1.2rem;
display: flex;
justify-content: space-between;
align-items: center;
> .left,
> .right {
p {
margin: 0;
}
> .discountsPrice,
> .price {
font-size: 1.8rem;
margin-top: 0.4rem;
opacity: 0.4;
font-weight: 500;
}
}
> .left {
> p:nth-child(1) {
font-size: 2rem;
opacity: 0.7;
font-weight: 700;
}
}
> .right {
> .promotion {
display: flex;
align-items: center;
flex-direction: column;
> .text {
font-size: 1.4rem;
font-weight: 600;
margin-right: 2rem;
}
> .succeed {
padding: 1rem;
display: flex;
align-items: center;
border-radius: 1rem;
background: #eee;
// color: #fff;
// font-weight: 600;
> 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;
width: 10rem;
font-size: 1.2rem;
background: rgba(0, 0, 0, 0);
}
}
> .error {
color: red;
text-align: center;
font-size: 1.2rem;
}
}
> .discountsPrice {
font-weight: 600;
color: red;
}
}
}
&.active {
background: #0ea98233;
border: 2px solid #0ea982;
> .priceBox {
> .left {
> p:nth-child(1) {
opacity: 1;
}
}
> .right {
> .discountsPrice {
opacity: 1;
}
}
}
}
&.sellWell {
border: 2px solid #0ea982;
}
}
> .productItem:last-child {
margin-bottom: 2rem;
}
}
> .payment {
margin-top: auto;
> .allocation {
// border-radius: 1rem;
// border: 2px solid #eaecf0;
// padding: 1rem 1.2rem;
> .selectType {
display: flex;
> .text {
font-size: 1.4rem;
font-weight: 600;
margin-right: 2rem;
}
label {
margin-right: 1rem;
display: flex;
cursor: pointer;
input {
margin-right: 0.5rem;
}
}
}
}
2024-12-11 16:26:36 +08:00
> .gallery_btn {
width: 100%;
margin: 2rem 0;
2025-06-30 10:53:25 +08:00
margin-bottom: .5rem;
margin-top: 1rem;
}
> .payMethod_payAffirm_clause {
2025-06-30 10:53:25 +08:00
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
label {
input {
margin-right: 1rem;
cursor: pointer;
vertical-align: middle;
}
span {
vertical-align: top;
font-size: 1.4rem;
a {
color: #000;
text-decoration: underline;
}
}
}
2025-06-30 10:53:25 +08:00
> .secure{
border: 1px solid #ededed;
background: #f1fbf9;
color: #1cb36c;
padding: .4rem .8rem;
border-radius: .5rem;
margin-top: 4rem;
> span{
display: flex;
align-items: center;
}
i{
display: flex;
margin-right: .5rem;
}
}
> .payIcon{
height: 2rem;
margin-top: 1rem;
img{
margin: 0 .3rem;
height: 100%;
}
}
&.animation {
animation: shake 0.3s linear;
@keyframes shake {
0% {
transform: translateX(0px);
}
25% {
transform: translateX(-10px);
}
50% {
transform: translateX(10px);
}
75% {
transform: translateX(-10px);
}
100% {
transform: translateX(0px);
}
}
}
}
// > .paySecure{
// display: flex;
// margin-top: 1rem;
// > svg{
// width: 1.6rem;
// height: 1.6rem;
// }
// > span{
// font-weight: 600;
// font-size: 1.4rem;
// }
// }
}
}
// .login_footer_item_text{
// text-align: center;
// margin-bottom: 1.5rem;
// text-decoration: underline;
// }
// .login_footer_item_text:last-child{
// margin-bottom: 0rem;
// }
}
.mark_loading {
position: absolute;
z-index: 2;
background: #fff;
border-radius: 3rem;
.mark_loading_title {
font-size: 3rem;
// text-decoration: underline;
font-weight: 600;
margin-bottom: 2rem;
overflow: hidden;
// color: #fff;
}
.mark_loading_intro {
color: rgba(0, 0, 0, 0.6);
font-size: 1.4rem;
margin-bottom: 2rem;
text-align: center;
width: 80%;
}
.mark_loading_title_box {
display: flex;
}
.mark_loading_btn,
.mark_loading_btn2 {
// border: #000;
// color: #fff;
display: flex;
margin-top: 10px;
text-align: center;
border: 2px solid;
padding: 0 20px;
border-radius: 10px;
cursor: pointer;
padding: 0.3rem 4rem;
2025-07-19 14:04:48 +08:00
background: #000;
color: #fff;
border: none;
margin: 0 2rem;
align-items: center;
}
.mark_loading_btn2 {
border: 2px solid #000;
color: #000;
background: rgba(0, 0, 0, 0);
}
}
}
</style>