This commit is contained in:
X1627315083
2024-02-29 17:16:51 +08:00
parent 7af7bde3f3
commit aa5f2e4208
12 changed files with 1016 additions and 468 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -37,12 +37,13 @@
class="trialApproval button_second credits hideChecked"
>
Credits :
<span :title="presentAssignment">
<!-- <div>{{ String(presentAssignment[presentAssignment.legnth-1]) }}</div> -->
<div class="credits_item" v-for="item in String(presentAssignment)" :style="{'transform': 'translateY('+item*-100+'%)'}">
<span :title="credits">
<!-- <div>{{ String(credits.value[credits.value.legnth-1]) }}</div> -->
<div class="credits_item" v-for="item in String(credits)" :style="{'transform': 'translateY('+item*-100+'%)'}">
<div v-for="numItem in 10">{{ numItem-1 }}</div>
</div>
</span>
<i @click="getCredits" class="fi fi-br-refresh" :class="[activeCredits?'active':'']"></i>
<i @click="Assignment" class="fi fi-rr-gift" title="Assignment"></i>
<i @click="UpgradePlan" title="Purchase" class="fi fi-rr-shop"></i>
</div>
@@ -103,6 +104,11 @@
<span class="icon iconfont icon-yuyan"></span>
<span class="select_item_des">{{$t('Header.language')}}</span>
</div>
<div class="select_item" @click="orderForm()">
<i class="fi fi-rs-notebook"></i>
<span class="select_item_des">View Orders</span>
</div>
<div class="select_item" @click="logout()">
<span class="icon iconfont icon-tuichu"></span
><span class="select_item_des">{{$t('Header.logOff')}}</span>
@@ -179,13 +185,15 @@
<!-- 绑定邮箱第一步 end -->
</div>
</a-modal>
<payOrder ref="payOrder"></payOrder>
<UpgradePlan ref="UpgradePlan"></UpgradePlan>
</div>
</template>
<script >
import { defineComponent, createVNode, ref } from "vue";
import { defineComponent, createVNode, ref, computed } from "vue";
import { isEmail } from "@/tool/util";
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
import payOrder from "@/component/Pay/payOrder.vue";
import VerificationCodeInput from "@/component/LoginPage/verificationCodeInput.vue";
import Habit from "@/component/Detail/habit.vue";
import UpgradePlan from "@/component/HomePage/UpgradePlan.vue";
@@ -200,6 +208,7 @@ export default defineComponent({
VerificationCodeInput,
Habit,
UpgradePlan,
payOrder,
},
setup(){
const store = useStore();
@@ -207,12 +216,18 @@ export default defineComponent({
const {locale} = useI18n()
let isTest = ref()
let isMurmur = ref()
let credits = computed(()=>{
return store.state.UserHabit.credits.value
})
let activeCredits = ref(false)
return {
store,
t,
locale,
isTest,
isMurmur,
credits,
activeCredits,
}
},
data() {
@@ -243,11 +258,10 @@ export default defineComponent({
// {name:'Tiếng Việt',value:'VIETNAMESE'},
// {name:'Italiano',value:'ITALIAN'},
],
presentAssignment:String(0),
};
},
watch: {
// presentAssignment(newVal,oldVal){
// credits.value(newVal,oldVal){
// console.log(String(newVal).length);
// }
},
@@ -283,7 +297,16 @@ export default defineComponent({
UpgradePlan.init()
},
Assignment(){//任务
this.presentAssignment = Number(this.presentAssignment) + 123
let num = 123+this.credits
this.store.commit('setCredits',num)
},
getCredits(){//刷新当前积分
let num = 123+this.credits
this.activeCredits = true
setTimeout(()=>{
this.activeCredits = false
},300)
this.store.commit('setCredits',num)
},
//点击下拉图标出现操作
changeShowOperateContent() {
@@ -364,7 +387,11 @@ export default defineComponent({
clearInterval(this.timer);
}
},
//查看订单
orderForm(){
let payOrder = this.$refs.payOrder
payOrder.init()
},
//登出
async logout() {
let data = {
@@ -654,6 +681,7 @@ export default defineComponent({
display: inline-block;
overflow: hidden;
display: flex;
margin-right: .9rem;
.credits_item{
transition: .3s all;
div{
@@ -670,6 +698,15 @@ export default defineComponent({
font-size: 1.8rem;
cursor: pointer;
}
.fi-br-refresh{
margin-left: 0;
border-left: none;
padding-left: 0;
&.active{
transition: all .3s;
transform: rotate(360deg);
}
}
}
.trialApproval{
margin-left: 2rem;

View File

@@ -1,8 +1,9 @@
<template>
<!-- 如果需要套餐就78 -->
<a-modal class="modal_component UpgradePlan_modal"
v-model:visible="showUpgradePlan"
:footer="null"
width="78%"
width="35%"
:maskClosable="false"
:centered="true"
:closable="false"
@@ -13,15 +14,15 @@
<i class="fi fi-rr-cross-small" @click.stop="cancelDsign()"></i>
</div>
<div class="UpgradePlan_content">
<div>Upgrade your Account Subscription Plan</div>
<div>Buy credlts</div>
</div>
<div v-show="stepNum == 0" class="UpgradePlan_nav">
<!-- <div v-show="stepNum == 0" class="UpgradePlan_nav">
<div class="UpgradePlan_nav_content">
<div :class="[planNum == 0 ? 'active':'']" @click="setPlan(0)">Monthly</div>
<div :class="[planNum == 1 ? 'active':'']" @click="setPlan(1)">Annual(save 20%)</div>
<div :class="[planNum == 2 ? 'active':'']" @click="setPlan(2)">Buy Credits</div>
</div>
</div>
</div> -->
<div v-show="stepNum == 0" class="UpgradePlan_payList">
<div v-show="planNum == 0" class="UpgradePlan_payList0">
<div class="UpgradePlan_payList-item" v-for="item in productList">
@@ -49,6 +50,7 @@
</li>
</ul>
<div class="UpgradePlan_payList-item-upgrade subitOkPreviewBtn" @click="upgrade(item.id)">UPGRADE NOW</div>
</div>
</div>
<div v-show="planNum == 2" class="UpgradePlan_payList2">
@@ -57,14 +59,14 @@
<img src="https://code-create.com.hk/wp-content/uploads/2022/11/aida_premium_thumb-300x300.jpg" alt="">
</div>
<div class="UpgradePlan_payList2_name">{{ price.credits * price.num }} credits</div>
<div class="UpgradePlan_payList2_unitPrice">${{ price.price * price.num }} <span @click="setUnit">USD</span></div>
<div class="UpgradePlan_payList2_unitPrice">${{ price.price * price.num }} <span @click="setUnit">HKD</span></div>
<div class="UpgradePlan_payList2_input">
<div class="UpgradePlan_payList2_input_remo" @click="removePriceNum">-</div>
<input type="number" v-model="price.num">
<div class="UpgradePlan_payList2_input_add" @click="addPriceNum">+</div>
</div>
<div class="UpgradePlan_payList2_describe">All credits are shared within the {{ }} name organization</div>
<div class="UpgradePlan_payList-item-upgrade subitOkPreviewBtn" @click="upgrade">UPGRADE NOW</div>
<div class="UpgradePlan_payList-item-upgrade subitOkPreviewBtn" @click="upgrade(1)">Continue</div>
</div>
</div>
</div>
@@ -72,19 +74,19 @@
<div class="UpgradePlan_payAffirm_title">Select payment method</div>
<div class="UpgradePlan_payAffirm_content">
<label>
<input name="payAffirm" type="radio" value="alipay" v-model="modeOfPayment">
<input name="payAffirm" type="radio" value="paypal" v-model="modeOfPayment">
<img src="https://ecmb.bdimg.com/tam-ogel/-1860672422_-148079605_900_900.png" alt="">
PayPal
</label>
<div class="UpgradePlan_payAffirm_content_btn" :class="[modeOfPayment == 'alipay'?'active':'']">
<div class="UpgradePlan_payAffirm_content_btn" :class="[modeOfPayment == 'paypal'?'active':'']">
</div>
<label>
<input name="payAffirm" type="radio" value="paypal" v-model="modeOfPayment">
<input name="payAffirm" type="radio" value="alipay" v-model="modeOfPayment">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAEXRFWHRTb2Z0d2FyZQBTbmlwYXN0ZV0Xzt0AAANmSURBVEiJvZZdaFxFFMd/M/cj926yu02MWWObEm3quoHGYBJBC4aCqbRRKoE+aLH6JhUFBT9Aij4oiooSfKn4oiA+FKlIkfbBj3TZYkGDDVWs1M1aaKgkJqEJazab+zE+3Gziunu3qwmep7kz95zfzH/OmRmhlFL8D6aXGl9ecjl2dpncnIe/QbQmIdmm8dwei/6OACGUUiqTc3nqxBKbvTgp4NjBRu7u1JEAo+nlTYcA+Ao+OFcEVqWbnPXqcoxZgvdGGtEljE95jJ4pXNcnN+evg+rdkyZTcOc2DYA//vTr8inF1sN+MDXQpCjrs4z1b10KbEP80w3XVzhVBAoFvf5AhL1JI3Sm93TqfP1krKL/xIUV3hmrlDQU9MLJAi+Kcof2qODUE1EAvvjZ4ZXTS6ETqRvkK8XANp2bYnKtrzmyLtXOVsnhgYYyn29/c8jOVt+7UBBAe1zS1SrL+j76rrjWbm0U9G7V6d0aJMhDOTc0Vk3QyZ9Wag0D8OEjTQBcnvfJzYWXSVVQS0QylNRJtmlYusDxFNN5RXbWZ2LKZSYfyNPZoq2l++c/1p5UBWgoafDq/giWDtN5haVB3BaUMl0p+GXG46tLDqmEhgCuFRTHz/8LUGeL5I3hCO+fK/LJeJGCE1RbxBR0JzQGu3T2pUxSCY1UQlvzuzzvs71Z4+J0+B4JpZTqeWsBgGcHLYQQvFvjaNGlYKTH4Oheu2Ls6oLPWNblm18dfphy8XyI25LM09HyFW1v1vjsQm0JpAjkBSi6iquLiltagsy8OS451GdyqM9kcVmRybmMXwlWWQaayfsMdulkck5VyI1NgjcfjNDfoeP5QVGfyTrcu0Pnsbss+jvW5YxZguFug+FuoxL06USR449HWfHg4++L/L4YZNcNjZKRHpNH+0222IJ8UXH0VIGxbDCh9KRLejJPKqFxeKCB+2830MvLr3yPAPbsNHhtn03UCgI6HmyxBWI168aveLx8eompa+Gnd1uT4OG+Bg7eYRKzRHVQadn7Uya72iUxW1BYgdy8TzrrcHG6vrsLwDYEB3YZvHSfHYB6317Y8DshzKSAiefjwVV+a6t2vf//s+1YjS0BjuwO6mezTQjBM4NW0C696zI5l9H0MpOzG39uSRGodGS3xdBtf3tubSxsffYXznw1EQcnMd4AAAAASUVORK5CYII=" alt="">
支付宝
</label>
<div class="UpgradePlan_payAffirm_content_btn" :class="[modeOfPayment == 'paypal'?'active':'']">
<div class="UpgradePlan_payAffirm_content_btn" :class="[modeOfPayment == 'alipay'?'active':'']">
</div>
</div>
@@ -100,11 +102,7 @@
</div>
</div>
<div class="mark_loading" v-show="isShowMark">
<div>Has it been paid?</div>
<div>
<div @click="getTradeQuery">Yes</div>
<div @click="getTradeQuery">No</div>
</div>
<div class="mark_loading_title" @click="getTradeQuery">Paid completed</div>
</div>
</a-modal>
</template>
@@ -128,20 +126,23 @@ export default defineComponent({
props: ["msg",'sketchCatecoryList'],
setup() {
// console.log(prop.msg);
const store = useStore();
let showUpgradePlan = ref(false)
let planNum = ref(0)
let planNum = ref(2)
let stepNum = ref(0)
let price = ref({
num:1,
price:15,
credits:115,
})
let modeOfPayment = ref('alipay')
let modeOfPayment = ref('paypal')
let clause = ref(false)//同意条款
let productList = ref([])
let payIndex = ref(0)
let isShowMark = ref(false)
let newWindow:any = ref()
return {
store,
showUpgradePlan,
planNum,
stepNum,
@@ -151,6 +152,7 @@ export default defineComponent({
productList,
payIndex,
isShowMark,
newWindow,
};
},
data(prop) {
@@ -162,17 +164,12 @@ export default defineComponent({
this.getProductList()
},
watch:{
// driver__:{
// newWindowState:{
// handler(newVal,oldVal){
// if(this.type_.type2 == 'Printboard'){
// if(newVal.index >= 14 && newVal.index < 15){
// this.setKeyword(newVal.index-14)
// }else{
// }
// }else if(this.type_.type2 == 'Sketchboard'){
// console.log(newVal);
// if(newVal){
// this.newWindow?.close();
// }
// }
// },
@@ -205,32 +202,54 @@ export default defineComponent({
}
},
payment(){//付款
console.log(this.modeOfPayment,'alipay','paypal');
// console.log(this.modeOfPayment,'alipay','paypal');
let url = window.location.href
// url = url.replace(/\/[^/]+$/, '') + '/home';
url = url.replace(/\/[^/]+$/, '') + '/paySucceed';
if(!this.clause){
return
}
let url = window.location.href
url = url.replace(/\/[^/]+$/, '') + '/paySucceed';
Https.axiosPost(Https.httpUrls.pagePay+`/${this.payIndex}?returnUrl=${url}`, {returnUrl:url}).then(
(rv: any) => {
// var newWindow:any = window.open();
// newWindow.document.write(rv);
document.write(rv);
let httpsUrl = Https.httpUrls.payAlipay
if(this.modeOfPayment == 'paypal'){
httpsUrl = Https.httpUrls.payPaypal
}
Https.axiosPost(httpsUrl+`/${this.payIndex}?returnUrl=${url}`, {returnUrl:url}).then(
(rv: any) => {
console.log(rv);
var width = 800;
var height = 600;
var left = (screen.width - width) / 2;
var top = (screen.height - height) / 2;
this.newWindow = window.open("", "_blank", "width=" + width + ", height=" + height + ", left=" + left + ", top=" + top);
if(this.modeOfPayment == 'paypal'){
// 在新窗口中写入内容
// newWindow.document.write(rv.approve);
this.newWindow.location.href = rv.approve;
}else{
this.newWindow.document.write(rv);
}
this.isShowMark = true
// this.isShowMark = true
}
).catch(res=>{
});
}
).catch(res=>{
});
},
//查询是否支付
// getTradeQuery(){
// let params = 1
// Https.axiosGet(Https.httpUrls.tradeQuery,{params:{enumName:params}}).then((rv) => {
// if (rv) {
// console.log(rv);
// }
// })
// },
getTradeQuery(){
this.isShowMark = false
this.newWindow.close();
let num = this.store.state.UserHabit.credits.value+111
this.store.commit('setCredits',num)
// let params = 1
// Https.axiosGet(Https.httpUrls.tradeQuery,{params:{enumName:params}}).then((rv) => {
// if (rv) {
// console.log(rv);
// }
// })
},
cancel(){//取消
this.stepNum = 0
this.modeOfPayment = 'alipay'
@@ -256,6 +275,9 @@ export default defineComponent({
flex-direction: column;
border-right: 1px solid #e5e5e5;
position: relative;
.mark_loading{
position: absolute;
}
.UpgradePlan_content{
font-size: var(--aida-fsize2);
font-weight: 900;
@@ -350,7 +372,7 @@ export default defineComponent({
}
.UpgradePlan_payList2_name,.UpgradePlan_payList2_unitPrice{
font-size: 1.8rem;
font-weight: 600;
font-weight: 900;
}
.UpgradePlan_payList2_name{
font-weight: 900;
@@ -361,7 +383,7 @@ export default defineComponent({
justify-content: center;
div{
font-size: 4rem;
font-weight: 600;
font-weight: 800;
cursor: pointer;
}
input{
@@ -385,12 +407,12 @@ export default defineComponent({
.UpgradePlan_payList2_describe{
background: #f2f2f4;
padding: 1rem 3rem;
border-radius: 2rem;
border-radius: 1.2rem;
}
.UpgradePlan_payList-item-upgrade{
position: initial;
transform: translate(0,0);
padding: 1rem 2rem;
// padding: 1rem 2rem;
}
}
@@ -497,8 +519,8 @@ export default defineComponent({
display: flex;
flex-direction: column;
padding: calc(5rem*1.2) calc(5rem*1.2) !important;
// height: calc(65vh - 6.4rem);
height: calc(65rem*1.2);
height: calc(55rem*1.2);
// height: calc(65rem*1.2);
}
//进度完成字体颜色
.ant-progress-circle.ant-progress-status-success .ant-progress-text{