diff --git a/src/apis/myStore.js b/src/apis/myStore.js index becad14..62820fa 100644 --- a/src/apis/myStore.js +++ b/src/apis/myStore.js @@ -13,7 +13,6 @@ export function packageInfoApi() { }) } - /** * @description 订单详情 * @params @@ -21,7 +20,7 @@ export function packageInfoApi() { */ export function orderDetailApi(id) { return request({ - url: `/api/productOrder/findByNumber?id=${id}`, + url: `/api/productOrder/findByNumber?orderNumber=${id}`, method: 'get' }) } diff --git a/src/assets/img/alipay.png b/src/assets/img/alipay.png new file mode 100644 index 0000000..1754381 Binary files /dev/null and b/src/assets/img/alipay.png differ diff --git a/src/assets/img/weChat.png b/src/assets/img/weChat.png new file mode 100644 index 0000000..00ee190 Binary files /dev/null and b/src/assets/img/weChat.png differ diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index e5c7bdb..9ea2d5d 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -2,7 +2,6 @@ export {} declare global { const EffectScope: typeof import('vue')['EffectScope'] - const ElForm: typeof import('element-plus/es')['ElForm'] const ElMessage: typeof import('element-plus/es')['ElMessage'] const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] @@ -271,7 +270,6 @@ import { UnwrapRef } from 'vue' declare module 'vue' { interface ComponentCustomProperties { readonly EffectScope: UnwrapRef - readonly ElForm: UnwrapRef readonly ElMessage: UnwrapRef readonly ElMessageBox: UnwrapRef readonly asyncComputed: UnwrapRef diff --git a/src/types/components.d.ts b/src/types/components.d.ts index c5f876f..a09e2f0 100644 --- a/src/types/components.d.ts +++ b/src/types/components.d.ts @@ -29,6 +29,10 @@ declare module '@vue/runtime-core' { ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup'] ElOption: typeof import('element-plus/es')['ElOption'] ElPagination: typeof import('element-plus/es')['ElPagination'] + ElRadio: typeof import('element-plus/es')['ElRadio'] + ElRadioButto: typeof import('element-plus/es')['ElRadioButto'] + ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] + ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElSelect: typeof import('element-plus/es')['ElSelect'] ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] ElSwitch: typeof import('element-plus/es')['ElSwitch'] diff --git a/src/views/myStore/index copy.vue b/src/views/myStore/index copy.vue new file mode 100644 index 0000000..b85dccb --- /dev/null +++ b/src/views/myStore/index copy.vue @@ -0,0 +1,1152 @@ + + + + + diff --git a/src/views/myStore/index.vue b/src/views/myStore/index.vue index a3ca55f..748d594 100644 --- a/src/views/myStore/index.vue +++ b/src/views/myStore/index.vue @@ -2,12 +2,7 @@
- - - -
+
@@ -27,120 +22,19 @@ 币值{{ item.glod }}
-
- 方案选择 -
-
- - - - -
-
- +
{{ lanChange == "zh-cn" ? "所有权限" : "All Pro Benefits" }} @@ -183,129 +76,20 @@
-
+ --> - +
-
- -
{{ $t(presentItme.value.typeDesc) }}
-
- {{ - lanChange == "zh-cn" - ? presentItme.value.rmb + "¥" - : presentItme.value.dollar + "$" - }}/{{ presentItme.value.validityDuration }}{{ $t("shop.day") }} -
-
- {{ presentItme.value.credit }}{{ $t("shop.score") }} -
- -
-
- {{ $t("shop.InviteGetscore") }}: - - {{ presentItme.value.inviteUserCredit }}{{ $t("shop.score") }} -
-
- {{ $t("shop.createVideoPrice") }}:{{ presentItme.value.videoPrice }}{{ $t("shop.score") }} -
-
- {{ $t("shop.AIGeneratesPhotoPrices") }}:{{ presentItme.value.photoPrice }}{{ $t("shop.score") }} -
-
- {{ $t("shop.UnitChargeDuration") }}:{{ presentItme.value.chargeTime }}{{ $t("shop.second") }} -
- -
- {{ $t("shop.Language") }}:{{ - presentItme.value.userPackageDetails[0].languageDesc - }} -
-
- {{ $t("shop.sound") }}:{{ - presentItme.value.userPackageDetails[0].soundDesc - }} -
-
- {{ $t("shop.IndividualVideoDuration") }}:{{ presentItme.value.userPackageDetails[0].videoTime }}{{ $t("shop.second") }} -
-
- {{ $t("shop.Watermark") }}:{{ - presentItme.value.userPackageDetails[0].aiPortrait == 0 - ? $t("shop.yes") - : $t("shop.no") - }} -
-
- {{ $t("shop.AIGeneratedPortrait") }}:{{ - presentItme.value.userPackageDetails[0].aiPortrait == 0 - ? $t("shop.no") - : $t("shop.yes") - }} -
-
- {{ $t("shop.PhotoSinging") }}:{{ - presentItme.value.userPackageDetails[0].photoSing == 0 - ? $t("shop.no") - : $t("shop.yes") - }} -
-
- {{ $t("shop.AIGeneratedText") }}:{{ - presentItme.value.userPackageDetails[0].aiCreateTime - }} -
-
- {{ $t("shop.VideoResolution") }}:{{ - presentItme.value.userPackageDetails[0].resolutionRatioDesc - }} -
-
-
-
-
- {{ $t("shop.WeChatPay") }} -
-
- {{ $t("shop.Alipay") }} -
-
- Paypal -
-
+ + + 支付宝 + + + 微信 + +
-
+
+
@@ -363,7 +155,8 @@ import { useI18n } from "vue-i18n"; import talkUs from "@/components/talkUs.vue"; import { useRoute, useRouter } from "vue-router"; import { createOrderApi, createPayApi, getOrderStatusApi } from "@/apis/pay"; -import { orderDetailApi } from '@/apis/myStore.js' +import { orderDetailApi, findStatusApi } from '@/apis/myStore.js' +import vueQr from 'vue-qr/src/packages/vue-qr.vue'; const route = useRoute(); const router = useRouter(); @@ -373,204 +166,6 @@ const lanChange = ref(locale); const AccessToken = localStorage.getItem("AccessToken"); // 判断有没有登录 //#endregion ------------------------------------ -//#region 各个套餐的逻辑 -// const packageList = ref([ -// { -// id: 1, -// type: 1, -// typeDesc: "基础版", -// englishName: "Trial", -// dollar: "0.00", -// rmb: "0.00", -// credit: 100, -// validityDuration: 30, -// inviteUserCredit: 10, -// videoPrice: 10, -// photoPrice: 10, -// talkPrice: 20, -// chargeTime: 60, -// createDate: 1686814258000, -// updateDate: 1686814258000, -// isDel: 0, -// color: "#f3af00", -// userPackageDetails: [ -// { -// id: 1, -// detailType: 1, -// detailTypeDesc: "照片说话", -// packageId: 1, -// watermark: 1, -// watermarkDesc: "是", -// language: 1, -// languageDesc: "50+", -// sound: 1, -// soundDesc: "400+", -// videoTime: 60, -// aiPortrait: 0, -// aiPortraitDesc: "否", -// photoSing: 0, -// photoSingDesc: "否", -// aiCreateTime: 0, -// resolutionRatio: 1, -// resolutionRatioDesc: "720p", -// createDate: 1686882177000, -// updateDate: 1686882177000, -// isDel: 0, -// }, -// { -// id: 4, -// detailType: 2, -// detailTypeDesc: "口播", -// packageId: 1, -// watermark: 1, -// watermarkDesc: "是", -// language: 1, -// languageDesc: "50+", -// sound: 1, -// soundDesc: "400+", -// videoTime: 60, -// aiCreateTime: 0, -// resolutionRatio: 1, -// resolutionRatioDesc: "720p", -// humanTemplate: 1, -// humanTemplateDesc: "免费", -// createDate: 1686882177000, -// updateDate: 1686882177000, -// isDel: 0, -// }, -// ], -// }, -// { -// id: 2, -// type: 2, -// typeDesc: "专业版", -// englishName: "Pro", -// dollar: "7.99", -// rmb: "49.99", -// credit: 200, -// validityDuration: 30, -// inviteUserCredit: 10, -// videoPrice: 6, -// photoPrice: 6, -// talkPrice: 16, -// chargeTime: 60, -// createDate: 1686814258000, -// updateDate: 1686814258000, -// isDel: 0, -// color: "#c971ff", -// userPackageDetails: [ -// { -// id: 2, -// detailType: 1, -// detailTypeDesc: "照片说话", -// packageId: 2, -// watermark: 0, -// watermarkDesc: "否", -// language: 1, -// languageDesc: "50+", -// sound: 1, -// soundDesc: "400+", -// videoTime: 300, -// aiPortrait: 1, -// aiPortraitDesc: "是", -// photoSing: 1, -// photoSingDesc: "是", -// aiCreateTime: 30, -// resolutionRatio: 2, -// resolutionRatioDesc: "1080p", -// createDate: 1686882177000, -// updateDate: 1686882177000, -// isDel: 0, -// }, -// { -// id: 5, -// detailType: 2, -// detailTypeDesc: "口播", -// packageId: 2, -// watermark: 0, -// watermarkDesc: "否", -// language: 1, -// languageDesc: "50+", -// sound: 1, -// soundDesc: "400+", -// videoTime: 300, -// aiCreateTime: 100, -// resolutionRatio: 2, -// resolutionRatioDesc: "1080p", -// humanTemplate: 2, -// humanTemplateDesc: "VIP", -// createDate: 1686882177000, -// updateDate: 1686882177000, -// isDel: 0, -// }, -// ], -// }, -// { -// id: 3, -// type: 3, -// typeDesc: "加强版", -// englishName: "Advanced", -// dollar: "39.99", -// rmb: "279.99", -// credit: 1200, -// validityDuration: 30, -// inviteUserCredit: 10, -// videoPrice: 5, -// photoPrice: 5, -// talkPrice: 15, -// chargeTime: 60, -// createDate: 1686814258000, -// updateDate: 1686814258000, -// isDel: 0, -// color: "#7b61ff", -// userPackageDetails: [ -// { -// id: 3, -// detailType: 1, -// detailTypeDesc: "照片说话", -// packageId: 3, -// watermark: 0, -// watermarkDesc: "否", -// language: 1, -// languageDesc: "50+", -// sound: 1, -// soundDesc: "400+", -// videoTime: 300, -// aiPortrait: 1, -// aiPortraitDesc: "是", -// photoSing: 1, -// photoSingDesc: "是", -// aiCreateTime: 200, -// resolutionRatio: 2, -// resolutionRatioDesc: "1080p", -// createDate: 1686882177000, -// updateDate: 1686882177000, -// isDel: 0, -// }, -// { -// id: 6, -// detailType: 2, -// detailTypeDesc: "口播", -// packageId: 3, -// watermark: 0, -// watermarkDesc: "否", -// language: 1, -// languageDesc: "50+", -// sound: 1, -// soundDesc: "400+", -// videoTime: 300, -// aiCreateTime: 200, -// resolutionRatio: 2, -// resolutionRatioDesc: "1080p", -// humanTemplate: 2, -// humanTemplateDesc: "VIP", -// createDate: 1686882177000, -// updateDate: 1686882177000, -// isDel: 0, -// }, -// ], -// }, -// ]); const packageList = ref([]); async function getPackageList() { const res = await packageInfoApi(); @@ -597,17 +192,6 @@ const orderCodeDialogShow = ref(false); const orderCodeUrl = ref(null); //#endregion ------------------------------------ -//#region $t在script中的使用 -// const { -// appContext: { -// config: { globalProperties }, -// }, -// } = getCurrentInstance(); - -// const string = "createVideo.typeScript"; -// const t = globalProperties.$t(string); -//#endregion ------------------------------------ - //#region 页面滚动 const scrollContainerRef = ref(null); function handleWheel(event) { @@ -676,7 +260,7 @@ const iframeDom = ref(null); async function createPayFunc(orderNumber) { const data = { orderNumber, - payVendor: myPayVendor.value, + payVendor: payVendor.value, }; try { const res = await createPayApi(data); @@ -685,11 +269,13 @@ async function createPayFunc(orderNumber) { if (res.data.body) { iframeBody.value = res.data.body; iframeDom.value = document.getElementById("myIframe"); - iframeDom.value.srcdoc = iframeBody.value; + // iframeDom.value.srcdoc = iframeBody.value; } // 直接获取二维码 if (res.data.codeUrl) { payCodeUrl.value = res.data.codeUrl; + // showOrderCode(payVendor.value) + orderCodeDialogShow.value = true; } await getStatusOfOrderFunc(orderNumber); } else { @@ -760,16 +346,46 @@ function RefreshQR() { //#region //#endregion ------------------------------------ - - +const payVendor = ref('4') +const orderNumber = ref('') +// 创建订单 +function createOrder(item) { + createOrderApi({productId: item.id}).then(res => { + orderNumber.value = res.data + }) +} +// 创建支付 +function payConfirm() { + createPayFunc(orderNumber.value); +} // 获取订单详情 function getOrderDetail(item) { orderDetailApi(item.id).then(res => { }) } - +//每隔一分钟运行一次保存方法 +// const timer = setInterval(()=>{ +// findStatus() +// },1000) +function findStatus() { + let data = { + orderNumber: '', + payVendor: '' + } + findStatusApi(data).then(res => { + if (res.data !== 2) { // 如果是2就不停的调,直到返回1、3、4 + clearInterval(timer); + } + }) +} + +