chutingting 1 ano atrás
pai
commit
93903fef14
4 arquivos alterados com 51 adições e 22 exclusões
  1. +2
    -0
      src/types/auto-imports.d.ts
  2. +3
    -3
      src/views/my/coindeduc.vue
  3. +1
    -1
      src/views/my/recharge.vue
  4. +45
    -18
      src/views/myStore/index.vue

+ 2
- 0
src/types/auto-imports.d.ts Ver arquivo

@@ -2,6 +2,7 @@
export {} export {}
declare global { declare global {
const EffectScope: typeof import('vue')['EffectScope'] const EffectScope: typeof import('vue')['EffectScope']
const ElForm: typeof import('element-plus/es')['ElForm']
const ElMessage: typeof import('element-plus/es')['ElMessage'] const ElMessage: typeof import('element-plus/es')['ElMessage']
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
@@ -270,6 +271,7 @@ import { UnwrapRef } from 'vue'
declare module 'vue' { declare module 'vue' {
interface ComponentCustomProperties { interface ComponentCustomProperties {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']> readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly ElForm: UnwrapRef<typeof import('element-plus/es')['ElForm']>
readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']> readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']> readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']> readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>


+ 3
- 3
src/views/my/coindeduc.vue Ver arquivo

@@ -25,7 +25,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
fixed="right" fixed="right"
:label="$t('keyMangage.operations')"
label="操作"
width="400" width="400"
align="center" align="center"
> >
@@ -58,7 +58,7 @@
<!-- videoType==1为竖,==2为横 --> <!-- videoType==1为竖,==2为横 -->
<script setup> <script setup>
//#region 导入 //#region 导入
import { rechargeListApi, getDetailApi, getUserPoinsApi, coindedApi } from '@/apis/my.js'
import { coindedApi, getDetailApi, getUserPoinsApi } from '@/apis/my.js'
import dayjs from "dayjs"; import dayjs from "dayjs";
import detail from './detail.vue' import detail from './detail.vue'


@@ -89,7 +89,7 @@ const getListData = async (PageNum, PageSize) => {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
} }
const res = await rechargeListApi(data);
const res = await coindedApi(data);
tableData.value = res.data.list; tableData.value = res.data.list;
total.value = res.data.total * 1; total.value = res.data.total * 1;
} catch (error) { } catch (error) {


+ 1
- 1
src/views/my/recharge.vue Ver arquivo

@@ -25,7 +25,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
fixed="right" fixed="right"
:label="$t('keyMangage.operations')"
label="操作"
width="400" width="400"
align="center" align="center"
> >


+ 45
- 18
src/views/myStore/index.vue Ver arquivo

@@ -79,7 +79,7 @@
</div> --> </div> -->
</div> </div>
<!-- 对话框 v-if="false"--> <!-- 对话框 v-if="false"-->
<el-dialog v-model="showPayDialog"
<el-dialog v-model="showPayDialog" v-if="showPayDialog"
title="选择支付方式" width="300px"> title="选择支付方式" width="300px">
<div class="payDialog"> <div class="payDialog">
<el-radio-group v-model="payVendor"> <el-radio-group v-model="payVendor">
@@ -91,6 +91,13 @@
</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"
@@ -177,6 +184,7 @@ const presentItme = reactive({}); //点击的套餐项
// const presentItme = ref({}); //点击的套餐项 // const presentItme = ref({}); //点击的套餐项
function clickPayDialog(item) { function clickPayDialog(item) {
presentItme.value = item; presentItme.value = item;
createOrder(item)
showPayDialog.value = true; showPayDialog.value = true;
} }


@@ -267,9 +275,12 @@ async function createPayFunc(orderNumber) {
if (res.code == 200) { if (res.code == 200) {
// 支付宝获取iframe内容 // 支付宝获取iframe内容
if (res.data.body) { if (res.data.body) {
iframeBody.value = res.data.body;
iframeDom.value = document.getElementById("myIframe");
// iframeDom.value.srcdoc = iframeBody.value;
orderCodeDialogShow.value = true;
setTimeout(() => {
iframeBody.value = res.data.body;
iframeDom.value = document.getElementById("myIframe");
iframeDom.value.srcdoc = iframeBody.value;
}, 1000)
} }
// 直接获取二维码 // 直接获取二维码
if (res.data.codeUrl) { if (res.data.codeUrl) {
@@ -277,6 +288,7 @@ async function createPayFunc(orderNumber) {
// showOrderCode(payVendor.value) // showOrderCode(payVendor.value)
orderCodeDialogShow.value = true; orderCodeDialogShow.value = true;
} }
// findStatus()
await getStatusOfOrderFunc(orderNumber); await getStatusOfOrderFunc(orderNumber);
} else { } else {
payErrorHandle(); payErrorHandle();
@@ -287,28 +299,43 @@ async function createPayFunc(orderNumber) {
} }
// 获取订单支付状态 payStatus 查询支付状态 0:待支付,2:支付中,3:已支付 // 获取订单支付状态 payStatus 查询支付状态 0:待支付,2:支付中,3:已支付
async function getStatusOfOrderFunc(orderNumber) { async function getStatusOfOrderFunc(orderNumber) {
if (
route.path != "/myStore" ||
orderCodeDialogShow.value == false ||
orderNumber != myOrderNumber.value
) {
return;
}
// if (
// route.path != "/myStore" ||
// orderCodeDialogShow.value == false ||
// orderNumber != payVendor.value
// ) {
// return;
// }
try { try {
let payVendor = myPayVendor.value;
const res = await getOrderStatusApi(orderNumber, payVendor);
// let payVendor = payVendor.value;
let data = {
orderNumber,
payVendor: payVendor.value
}
const res = await findStatusApi(data);
if (res.code == 200) { if (res.code == 200) {
if (res.data.orderStatus == 3) {
if (res.data.orderStatus == 2) {
setTimeout(() => {
getStatusOfOrderFunc(orderNumber);
}, 3000);
} else {
orderCodeDialogShow.value = false; orderCodeDialogShow.value = false;
ElMessage.success( ElMessage.success(
lanChange.value == "zh-cn" ? `支付成功!` : `Payment is successful!` lanChange.value == "zh-cn" ? `支付成功!` : `Payment is successful!`
); );
return; return;
} else {
setTimeout(() => {
getStatusOfOrderFunc(orderNumber);
}, 3000);
} }
// 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);


Carregando…
Cancelar
Salvar