新增微信支付、Native支付

This commit is contained in:
gxwebsoft
2024-05-11 23:06:25 +08:00
parent 31d6517314
commit ec629c4540
18 changed files with 1121 additions and 63 deletions

View File

@@ -110,7 +110,10 @@
v-model:value="form.totalPrice"
/>
</a-form-item>
<a-form-item label="减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格" name="reducePrice">
<a-form-item
label="减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格"
name="reducePrice"
>
<a-input
allow-clear
placeholder="请输入减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格"
@@ -159,7 +162,10 @@
v-model:value="form.coachId"
/>
</a-form-item>
<a-form-item label="1微信支付2积分3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡" name="payType">
<a-form-item
label="1微信支付2积分3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡"
name="payType"
>
<a-input
allow-clear
placeholder="请输入1微信支付2积分3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡"
@@ -173,21 +179,30 @@
v-model:value="form.payStatus"
/>
</a-form-item>
<a-form-item label="1已完成2未使用3已取消4退款申请中5退款被拒绝6退款成功7客户端申请退款" name="orderStatus">
<a-form-item
label="1已完成2未使用3已取消4退款申请中5退款被拒绝6退款成功7客户端申请退款"
name="orderStatus"
>
<a-input
allow-clear
placeholder="请输入1已完成2未使用3已取消4退款申请中5退款被拒绝6退款成功7客户端申请退款"
v-model:value="form.orderStatus"
/>
</a-form-item>
<a-form-item label="优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡" name="type">
<a-form-item
label="优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡"
name="type"
>
<a-input
allow-clear
placeholder="请输入优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡"
v-model:value="form.type"
/>
</a-form-item>
<a-form-item label="二维码地址,保存订单号,支付成功后才生成" name="qrcode">
<a-form-item
label="二维码地址,保存订单号,支付成功后才生成"
name="qrcode"
>
<a-input
allow-clear
placeholder="请输入二维码地址,保存订单号,支付成功后才生成"
@@ -222,7 +237,10 @@
v-model:value="form.startTime"
/>
</a-form-item>
<a-form-item label="是否已开具发票1已开发票2未开发票3不能开具发票" name="isInvoice">
<a-form-item
label="是否已开具发票1已开发票2未开发票3不能开具发票"
name="isInvoice"
>
<a-input
allow-clear
placeholder="请输入是否已开具发票1已开发票2未开发票3不能开具发票"
@@ -257,7 +275,10 @@
v-model:value="form.refundApplyTime"
/>
</a-form-item>
<a-form-item label="对账情况1=已对账2=未对账3=已对账金额对不上4=未查询到该订单" name="checkBill">
<a-form-item
label="对账情况1=已对账2=未对账3=已对账金额对不上4=未查询到该订单"
name="checkBill"
>
<a-input
allow-clear
placeholder="请输入对账情况1=已对账2=未对账3=已对账金额对不上4=未查询到该订单"
@@ -361,14 +382,9 @@
refundTime: undefined,
refundApplyTime: undefined,
checkBill: undefined,
comments: undefined,
deleted: undefined,
tenantId: undefined,
orderId: undefined,
orderName: '',
status: 0,
comments: '',
sortNumber: 100
comments: ''
});
/* 更新visible */
@@ -439,12 +455,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -8,13 +8,29 @@
@search="search"
@pressEnter="search"
/>
<a-button @click="getCode">生成支付二维码</a-button>
</a-space>
<ele-modal
:width="500"
:visible="showQrcode"
:maskClosable="false"
title="使用微信扫一扫完成支付"
:body-style="{ paddingBottom: '28px' }"
@cancel="closeQrcode"
@ok="closeQrcode"
>
<div class="qrcode">
<ele-qr-code-svg v-if="text" :value="text" :size="200" />
<div class="ele-text-secondary">使用微信扫一扫完成支付</div>
</div>
</ele-modal>
</template>
<script lang="ts" setup>
import { watch } from 'vue';
import { ref, watch } from 'vue';
import useSearch from '@/utils/use-search';
import { OrderParam } from '@/api/shop/order/model';
import { getNativeCode } from '@/api/system/payment';
const props = withDefaults(
defineProps<{
@@ -41,8 +57,33 @@
emit('search', where);
};
// 二维码内容
const text = ref('');
const showQrcode = ref(false);
const closeQrcode = () => {
showQrcode.value = !showQrcode.value;
};
const getCode = () => {
getNativeCode({}).then((data) => {
text.value = String(data);
showQrcode.value = true;
});
};
watch(
() => props.selection,
() => {}
);
</script>
<style lang="less" scoped>
.qrcode {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
padding: 40px 0;
}
</style>

View File

@@ -1,7 +1,7 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:width="1000"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
@@ -59,6 +59,25 @@
@done="chooseShopType"
/>
</a-form-item>
<a-form-item label="营业时间" name="businessTime">
<!-- <a-time-picker-->
<!-- v-model:value="form.timePeriod1"-->
<!-- format="HH:mm"-->
<!-- valueFormat="HH:mm"-->
<!-- />-->
<!-- - -->
<!-- <a-time-picker-->
<!-- v-model:value="form.timePeriod2"-->
<!-- format="HH:mm"-->
<!-- valueFormat="HH:mm"-->
<!-- />-->
<a-input
allow-clear
:maxlength="100"
placeholder="请选择营业时间"
v-model:value="form.businessTime"
/>
</a-form-item>
<a-form-item label="所属行业" name="category">
<industry-select
v-model:value="form.category"
@@ -93,17 +112,28 @@
v-model:value="form.address"
/>
</a-form-item>
<a-form-item label="手续费(%)" name="commission">
<a-form-item label="每小时价格" name="price">
<a-input-number
:step="1"
:max="100"
:max="1000000"
:min="0.0"
:precision="2"
class="ele-fluid"
placeholder="请输入手续费"
v-model:value="form.commission"
placeholder="请输入每小时价格"
v-model:value="form.price"
/>
</a-form-item>
<!-- <a-form-item label="手续费(%)" name="commission">-->
<!-- <a-input-number-->
<!-- :step="1"-->
<!-- :max="100"-->
<!-- :min="0.0"-->
<!-- :precision="2"-->
<!-- class="ele-fluid"-->
<!-- placeholder="请输入手续费"-->
<!-- v-model:value="form.commission"-->
<!-- />-->
<!-- </a-form-item>-->
<a-form-item label="关键字" name="keywords">
<a-select
v-model:value="form.keywords"
@@ -111,7 +141,7 @@
placeholder="输入关键词后回车"
/>
</a-form-item>
<a-form-item label="资质图片" name="files">
<a-form-item label="场馆图片" name="files">
<SelectFile
:placeholder="`请选择图片`"
:limit="9"
@@ -120,6 +150,17 @@
@del="onDeleteFiles"
/>
</a-form-item>
<a-form-item label="场馆介绍" name="content">
<!-- 编辑器 -->
<tinymce-editor
ref="editorRef"
class="content"
v-model:value="content"
:disabled="disabled"
:init="config"
placeholder="请输入场馆介绍内容"
/>
</a-form-item>
<a-form-item label="是否自营" name="ownStore">
<a-switch
checked-children=""
@@ -195,6 +236,8 @@
import { MerchantType } from '@/api/shop/merchantType/model';
import { CenterPoint } from 'ele-admin-pro/es/ele-map-picker/types';
import { listRoles } from '@/api/system/role';
import TinymceEditor from '@/components/TinymceEditor/index.vue';
import { uploadOss } from '@/api/system/file';
// 是否是修改
const isUpdate = ref(false);
@@ -223,6 +266,9 @@
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
const files = ref<ItemType[]>([]);
const disabled = ref(false);
// 编辑器内容,双向绑定
const content = ref<any>('');
// 是否显示地图选择弹窗
const showMap = ref(false);
@@ -240,9 +286,14 @@
region: '',
address: '',
lngAndLat: '',
price: 0,
commission: 0,
keywords: undefined,
files: undefined,
businessTime: undefined,
content: '',
timePeriod1: undefined,
timePeriod2: undefined,
ownStore: undefined,
recommend: undefined,
goodsReview: 1,
@@ -286,6 +337,14 @@
trigger: 'blur'
}
],
businessTime: [
{
required: true,
type: 'string',
message: '请填营业时间',
trigger: 'blur'
}
],
realName: [
{
required: true,
@@ -377,6 +436,69 @@
form.category = item[0] + '/' + item[1];
};
const editorRef = ref<InstanceType<typeof TinymceEditor> | null>(null);
const config = ref({
height: 450,
images_upload_handler: (blobInfo, success, error) => {
const file = blobInfo.blob();
const formData = new FormData();
formData.append('file', file, file.name);
uploadOss(file)
.then((res) => {
success(res.path);
})
.catch((msg) => {
error(msg);
});
},
// 自定义文件上传(这里使用把选择的文件转成 blob 演示)
file_picker_callback: (callback: any, _value: any, meta: any) => {
const input = document.createElement('input');
input.setAttribute('type', 'file');
// 设定文件可选类型
if (meta.filetype === 'image') {
input.setAttribute('accept', 'image/*');
} else if (meta.filetype === 'media') {
input.setAttribute('accept', 'video/*,.pdf');
}
input.onchange = () => {
const file = input.files?.[0];
if (!file) {
return;
}
if (meta.filetype === 'media') {
if (file.size / 1024 / 1024 > 200) {
editorRef.value?.alert({ content: '大小不能超过 200MB' });
return;
}
if (file.type.startsWith('application/pdf')) {
uploadOss(file).then((res) => {
const addPath = `<a href="${res.downloadUrl}" target="_blank">${res.name}</a>`;
content.value = content.value + addPath;
});
return;
}
if (!file.type.startsWith('video/')) {
editorRef.value?.alert({ content: '只能选择视频文件' });
return;
}
uploadOss(file).then((res) => {
callback(res.path);
});
}
// const reader = new FileReader();
// reader.onload = (e) => {
// if (e.target?.result != null) {
// const blob = new Blob([e.target.result], { type: file.type });
// callback(URL.createObjectURL(blob));
// }
// };
// reader.readAsArrayBuffer(file);
};
input.click();
}
});
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
@@ -391,6 +513,7 @@
loading.value = true;
const formData = {
...form,
content: content.value,
keywords: JSON.stringify(form.keywords),
files: JSON.stringify(files.value)
};
@@ -416,9 +539,13 @@
if (visible) {
images.value = [];
files.value = [];
content.value = '';
if (props.data) {
isUpdate.value = true;
assignObject(form, props.data);
if (form.content) {
content.value = form.content;
}
if (props.data.image) {
images.value.push({
uid: uuid(),
@@ -449,6 +576,7 @@
form.tenantId = Number(localStorage.getItem('TenantId'));
});
} else {
content.value = '';
resetFields();
}
},