|
@@ -1,19 +1,135 @@
|
|
-
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import * as $merchantApi from "@/api/merchant";
|
|
import * as $merchantApi from "@/api/merchant";
|
|
import Edit from "@/views/paytest/modules/edit.vue";
|
|
import Edit from "@/views/paytest/modules/edit.vue";
|
|
-import {ref} from "vue";
|
|
|
|
|
|
+import {onMounted, reactive, ref} from "vue";
|
|
|
|
+import {message} from "@/utils/message";
|
|
|
|
+import * as $api from "@/api/order";
|
|
|
|
|
|
const editRef = ref();
|
|
const editRef = ref();
|
|
|
|
+const formRef = ref();
|
|
const payTest = () => {
|
|
const payTest = () => {
|
|
- editRef.value!.open();
|
|
|
|
|
|
+ $api.test(pageData.formData).then((res: any) => {
|
|
|
|
+ editRef.value!.open( res.result.result.imageBase64);
|
|
|
|
+ })
|
|
|
|
+ genbizOrderNoeNo();
|
|
|
|
+};
|
|
|
|
+// 结算台下部分内容
|
|
|
|
+const payMoneyList = ref([
|
|
|
|
+ // 支付金额列表
|
|
|
|
+ {label: '0.01', value: 0.01},
|
|
|
|
+ {label: '0.02', value: 0.02},
|
|
|
|
+ {label: '0.03', value: 0.03},
|
|
|
|
+ {label: '0.1', value: 0.1},
|
|
|
|
+ {label: '1.00', value: 1.0},
|
|
|
|
+ {label: '自定义', value: null},
|
|
|
|
+])
|
|
|
|
+// 初始化数据
|
|
|
|
+const initData = {
|
|
|
|
+ bizOrderNo: undefined,
|
|
|
|
+ title: undefined,
|
|
|
|
+ totalMoney: undefined
|
|
};
|
|
};
|
|
|
|
+// 页面数据
|
|
|
|
+const pageData: any = reactive({
|
|
|
|
+ dialogVisible: false,
|
|
|
|
+ title: "",
|
|
|
|
+ formLoading: false,
|
|
|
|
+ mode: "add",
|
|
|
|
+ isUpdate: false,
|
|
|
|
+ // 表单数据
|
|
|
|
+ formData: initData
|
|
|
|
+});
|
|
|
|
+const payMoneyValue = ref(0.01);
|
|
|
|
+const payMoneyShow = ref(false);
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 生成业务号
|
|
|
|
+ */
|
|
|
|
+function genbizOrderNoeNo() {
|
|
|
|
+ pageData.formData.bizOrderNo = 'P' + new Date().getTime();
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 支付金额变动
|
|
|
|
+ */
|
|
|
|
+function payMoneyValueChange() {
|
|
|
|
+ pageData.formData.totalMoney = null;
|
|
|
|
+ if (payMoneyValue.value == null) {
|
|
|
|
+ payMoneyShow.value = true;
|
|
|
|
+ } else {
|
|
|
|
+ pageData.formData.totalMoney = payMoneyValue.value;
|
|
|
|
+ payMoneyShow.value = false;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ genbizOrderNoeNo();
|
|
|
|
+ pageData.formData.title = "测试支付";
|
|
|
|
+ pageData.formData.totalMoney=0.01;
|
|
|
|
+
|
|
|
|
+});
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <el-card style="width: 480px; border-radius: 8px" shadow="hover" @click="payTest">
|
|
|
|
- 支付测试
|
|
|
|
- </el-card>
|
|
|
|
- <edit ref="editRef" />
|
|
|
|
|
|
+ <el-card style="width: 700px; border-radius: 8px" shadow="hover">
|
|
|
|
+ <template #header>
|
|
|
|
+ <el-text class="mx-1" type="primary" size="large">支付信息</el-text>
|
|
|
|
+ </template>
|
|
|
|
+ <div class="el-dialog-content">
|
|
|
|
+ <el-form
|
|
|
|
+ ref="formRef"
|
|
|
|
+ :model="pageData.formData"
|
|
|
|
+ style="width: 90%; margin: 20px auto 0"
|
|
|
|
+ label-width="auto"
|
|
|
|
+ >
|
|
|
|
+ <el-form-item label="业务单号">
|
|
|
|
+ <el-input style="width: 200px"
|
|
|
|
+ v-model="pageData.formData.bizOrderNo"
|
|
|
|
+ clearable
|
|
|
|
+ placeholder="请输入业务单号"
|
|
|
|
+ size="small"
|
|
|
|
+ />
|
|
|
|
+ <el-button type="primary" style="height: 25px" @click="genbizOrderNoeNo">生成</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="支付标题">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="pageData.formData.title"
|
|
|
|
+ clearable
|
|
|
|
+ placeholder="请输入支付标题"
|
|
|
|
+ size="small"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="支付金额(元):">
|
|
|
|
+ <el-radio-group v-model="payMoneyValue" @change="payMoneyValueChange">
|
|
|
|
+ <el-radio :value="item.value" v-for="(item, index) in payMoneyList" :key="index">
|
|
|
|
+ {{ item.label }}
|
|
|
|
+ </el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ <el-input-number v-if="payMoneyShow"
|
|
|
|
+ style="width: 120px !important"
|
|
|
|
+ :max="100"
|
|
|
|
+ :min="0.01"
|
|
|
|
+ :precision="2"
|
|
|
|
+ v-model="pageData.formData.totalMoney"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <div style="text-align: right">
|
|
|
|
+ <span
|
|
|
|
+ v-if="pageData.formData.totalMoney"
|
|
|
|
+ style="color: #fd482c; font-size: 18px; padding-right: 10px"
|
|
|
|
+ >{{ "¥ " + pageData.formData.totalMoney }}</span>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ :disabled="!pageData.formData.totalMoney"
|
|
|
|
+ @click="payTest"
|
|
|
|
+ >立即支付
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ </el-card>
|
|
|
|
+ <edit ref="editRef"/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|