瀏覽代碼

支付

dev
chutingting 1 年之前
父節點
當前提交
e5c1449d5f
共有 2 個檔案被更改,包括 14 行新增37 行删除
  1. +1
    -15
      src/types/components.d.ts
  2. +13
    -22
      src/views/myStore/index.vue

+ 1
- 15
src/types/components.d.ts 查看文件

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

+ 13
- 22
src/views/myStore/index.vue 查看文件

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


Loading…
取消
儲存