Commit 92cca37b authored by daniel's avatar daniel

feat(deposit): 押金模块优化

parent 64a8f5ee
...@@ -171,6 +171,13 @@ ...@@ -171,6 +171,13 @@
<n-data-table v-if="!isConfigTab" v-model:checked-row-keys="checkedRowKeys" :columns="orderColumns" :loading="loading" :row-key="rowKey" :data="orders" :pagination="pagination" <n-data-table v-if="!isConfigTab" v-model:checked-row-keys="checkedRowKeys" :columns="orderColumns" :loading="loading" :row-key="rowKey" :data="orders" :pagination="pagination"
:bordered="false" :bordered="false"
:remote="true" @update:checked-row-keys="handleCheck"/> :remote="true" @update:checked-row-keys="handleCheck"/>
<!-- 只允许上传png -->
<n-card title="小程序二维码" v-show="isConfigTab" :bordered="false">
<n-image
width="300"
:src="qrImage"
/>
</n-card>
<n-card v-show="isConfigTab" title="押金详情" :bordered="false" > <n-card v-show="isConfigTab" title="押金详情" :bordered="false" >
<n-form <n-form
ref="depositFormRef" ref="depositFormRef"
...@@ -205,7 +212,6 @@ ...@@ -205,7 +212,6 @@
<n-form-item label="内容" > <n-form-item label="内容" >
<div class="w-full" id="rich-text-container" ></div> <div class="w-full" id="rich-text-container" ></div>
</n-form-item> </n-form-item>
</n-form> </n-form>
<template #header-extra> <template #header-extra>
<n-button class="flex-1" <n-button class="flex-1"
...@@ -214,6 +220,7 @@ ...@@ -214,6 +220,7 @@
</n-button> </n-button>
</template> </template>
</n-card> </n-card>
<n-modal :mask-closable="false" :loading="loading" style="width: 300px" title="修改订单" <n-modal :mask-closable="false" :loading="loading" style="width: 300px" title="修改订单"
preset="card" preset="card"
draggable v-model:show="showEditModal" > draggable v-model:show="showEditModal" >
...@@ -471,6 +478,8 @@ ...@@ -471,6 +478,8 @@
const ORDER_REFUND_ALL_URL = BASE_ECC_URL + "/api-refund/v1/refund-all" const ORDER_REFUND_ALL_URL = BASE_ECC_URL + "/api-refund/v1/refund-all"
// 编辑订单 // 编辑订单
const EDIT_ORDER_URL = BASE_ECC_URL + "/api-order/v1/edit" const EDIT_ORDER_URL = BASE_ECC_URL + "/api-order/v1/edit"
// qr二维码
const qrCodeUrl = window.location.origin + '/gk/wechatMini/wxQrCode'
// 一键退款 // 一键退款
// 获取赛事信息 // 获取赛事信息
const GET_CMPT_URL = "https://timerbackend.geexek.com/getCmpt.do?cmptId=" + getCId() const GET_CMPT_URL = "https://timerbackend.geexek.com/getCmpt.do?cmptId=" + getCId()
...@@ -771,6 +780,7 @@ ...@@ -771,6 +780,7 @@
markNo: undefined, markNo: undefined,
tradeStatus: undefined, tradeStatus: undefined,
}) })
const qrImage = ref('')
// 删除自助选号 // 删除自助选号
const showEditModal = ref(false) const showEditModal = ref(false)
// 退款订单的modal // 退款订单的modal
...@@ -890,6 +900,33 @@ ...@@ -890,6 +900,33 @@
} }
} }
// 文件下载
const generateQrCode = () => {
const cmptId = getCId()
const params = {
path: "/pages/race/gpsCashPledge?raceId=" + cmptId,
width: 1280,
page: '',
query: '',
cmptId,
}
if (!cmptId) {
return
}
loading.value = true
qrImage.value = qrCodeUrl + '?' + new URLSearchParams(params)
// 判断图片是否存在
const img = new Image()
img.src = qrImage.value
img.onload = function () {
loading.value = false
}
img.onerror = function () {
message.error('小程序二维码加载失败')
loading.value = false
}
}
// 获取统计 用fetch改造 // 获取统计 用fetch改造
const getOrderStats = async () => { const getOrderStats = async () => {
loading.value = true loading.value = true
...@@ -1134,6 +1171,7 @@ ...@@ -1134,6 +1171,7 @@
depositForm.value.roadIds = res.data.roadIds.split(',').map(v => Number(v)) depositForm.value.roadIds = res.data.roadIds.split(',').map(v => Number(v))
refundOrderValue.refundAmount = res.data.amount refundOrderValue.refundAmount = res.data.amount
editor.setContent(res.data.content) editor.setContent(res.data.content)
generateQrCode()
} }
} else { } else {
message.error(res.message) message.error(res.message)
...@@ -1221,6 +1259,7 @@ ...@@ -1221,6 +1259,7 @@
depositRules, depositRules,
roadOptions, roadOptions,
depositFormRef, depositFormRef,
qrImage,
saveDeposit, saveDeposit,
getDeposit, getDeposit,
batchRefund, batchRefund,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment