Browse Source

支付

dev
chutingting 1 year ago
parent
commit
e5c1449d5f
2 changed files with 14 additions and 37 deletions
  1. +1
    -15
      src/types/components.d.ts
  2. +13
    -22
      src/views/myStore/index.vue

+ 1
- 15
src/types/components.d.ts View File

@@ -23,40 +23,26 @@ declare module '@vue/runtime-core' {
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
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']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElText: typeof import('element-plus/es')['ElText']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElUpload: typeof import('element-plus/es')['ElUpload']
GithubCorner: typeof import('./../components/GithubCorner/index.vue')['default']
Hamburger: typeof import('./../components/Hamburger/index.vue')['default']
IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
IEpCloseBold: typeof import('~icons/ep/close-bold')['default']
IEpDelete: typeof import('~icons/ep/delete')['default']
IEpDocumentAdd: typeof import('~icons/ep/document-add')['default']
IEpDownload: typeof import('~icons/ep/download')['default']
IEpEdit: typeof import('~icons/ep/edit')['default']
IEpGoods: typeof import('~icons/ep/goods')['default']
IEpLoading: typeof import('~icons/ep/loading')['default']
IEpLock: typeof import('~icons/ep/lock')['default']
IEpMenu: typeof import('~icons/ep/menu')['default']
IEpPhone: typeof import('~icons/ep/phone')['default']
IEpSearch: typeof import('~icons/ep/search')['default']
IEpUser: typeof import('~icons/ep/user')['default']
IEpVideoPlay: typeof import('~icons/ep/video-play')['default']
LangSelect: typeof import('./../components/LangSelect/index.vue')['default']
MultiUpload: typeof import('./../components/Upload/MultiUpload.vue')['default']
MyLoading: typeof import('./../components/myLoading.vue')['default']
@@ -72,6 +58,6 @@ declare module '@vue/runtime-core' {
WangEditor: typeof import('./../components/WangEditor/index.vue')['default']
}
export interface ComponentCustomProperties {
vInfiniteScroll: typeof import('element-plus/es')['ElInfiniteScroll']
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
}

+ 13
- 22
src/views/myStore/index.vue View File

@@ -91,13 +91,6 @@
</el-radio>
</el-radio-group>
</div>
<!-- <iframe
v-show="iframeBody"
id="myIframe"
width="305px"
height="305px"
frameborder="0"
></iframe> -->
<!-- 二维码弹出框 -->
<el-dialog
v-model="orderCodeDialogShow"
@@ -107,7 +100,8 @@
@closed="clearCode"
:close-on-click-modal="false"
>
<div class="orderCodeDialog">
<div class="orderCodeDialog" v-loading="loading"
element-loading-text="支付中...">
<div class="codeImg">
<my-Loading-Icon2
v-if="!payCodeUrl && !iframeBody"
@@ -265,6 +259,7 @@ async function createOrderFunc() {
// 获取订单详情
let iframeBody = ref(null);
const iframeDom = ref(null);
const loading = ref(false)
async function createPayFunc(orderNumber) {
const data = {
orderNumber,
@@ -314,28 +309,24 @@ async function getStatusOfOrderFunc(orderNumber) {
}
const res = await findStatusApi(data);
if (res.code == 200) {
if (res.data.orderStatus == 2) {
if (res.data.orderStatus == 1) { // 页面就不动,继续定时请求
setTimeout(() => {
getStatusOfOrderFunc(orderNumber);
}, 3000);
} else if (res.data.orderStatus == 2) { // 页面就不动, loading....的效果盖在二维码之前,继续定时请求
loading.value = true
setTimeout(() => {
getStatusOfOrderFunc(orderNumber);
}, 3000);
} else {
} else if (res.data.orderStatus == 3) { // 提示支付成功,关闭当前页
orderCodeDialogShow.value = false;
showPayDialog.value = false
ElMessage.success(
lanChange.value == "zh-cn" ? `支付成功!` : `Payment is successful!`
);
return;
} else { // 提示支付失败,关闭当前页
ElMessage.success('支付失败');
}
// if (res.data.orderStatus == 3) {
// orderCodeDialogShow.value = false;
// ElMessage.success(
// lanChange.value == "zh-cn" ? `支付成功!` : `Payment is successful!`
// );
// return;
// } else {
// setTimeout(() => {
// getStatusOfOrderFunc(orderNumber);
// }, 3000);
// }
} else {
setTimeout(() => {
getStatusOfOrderFunc(orderNumber);


Loading…
Cancel
Save