Selaa lähdekoodia

测试支付调整

liu_lake 5 kuukautta sitten
vanhempi
sitoutus
12adaf21b1

+ 1 - 1
admin-ui/src/views/agent/modules/edit.vue

@@ -138,7 +138,7 @@ defineExpose({open});
               :readonly="pageData.formData.id != null"
           />
         </el-form-item>
-        <el-form-item label="密码" prop="password">
+        <el-form-item label="密码">
           <el-input
               v-model="pageData.formData.password"
               type="password"

+ 1 - 1
agent-ui/src/api/merchant/index.ts

@@ -34,7 +34,7 @@ export function save<T>(data: any): Promise<Result<T>> {
  * @returns  .
  */
 export function update<T>(id: string, data: any): Promise<Result<T>> {
-  return put(`/agent/pay/merchant/update/${id}`, {}, data);
+  return put(`/agent/pay/merchant/update`, {}, data);
 }
 
 /**

+ 3 - 3
agent-ui/src/views/merchant/modules/edit.vue

@@ -138,15 +138,15 @@ defineExpose({ open });
           />
         </el-form-item>
         <el-form-item label="费率" prop="rate">
-          <el-input-number style="width: 355px"
+          <el-input-number
             v-model="pageData.formData.rate"
             clearable
             placeholder="请输入费率"
             size="small"
             :readonly="isDetail"
-          />
+          />
         </el-form-item>
-        <el-form-item label="密码" prop="password">
+        <el-form-item label="密码">
           <el-input
             v-model="pageData.formData.password"
             type="password"

+ 8 - 3
agent-ui/src/views/merchant/modules/list.vue

@@ -114,10 +114,15 @@ const pageData: any = reactive({
         prop: "userName",
         slot: "userName"
       },
+      // {
+      //   label: "余额",
+      //   prop: "amount",
+      //   slot: "amount"
+      // },
       {
-        label: "余额",
-        prop: "amount",
-        slot: "amount"
+        label: "费率(‰)",
+        prop: "rate",
+        slot: "rate"
       },
       {
         label: "谷歌校验器",

+ 2 - 2
merchant-ui/src/api/order/index.ts

@@ -56,8 +56,8 @@ export function queryPayStatus<T>(id: string): Promise<Result<T>> {
   return get(`/merchant/pay/order/status/${id}`,{});
 }
 
-export function test<T>(): Promise<Result<T>> {
-  return get(`/merchant/pay/order/test`, {});
+export function test<T>(data: any): Promise<Result<T>> {
+  return post(`/merchant/pay/order/test`, data);
 }
 
 

+ 123 - 7
merchant-ui/src/views/paytest/index.vue

@@ -1,19 +1,135 @@
-
 <script setup lang="ts">
 import * as $merchantApi from "@/api/merchant";
 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 formRef = ref();
 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>
 <template>
   <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>
 </template>

+ 4 - 4
merchant-ui/src/views/paytest/modules/edit.vue

@@ -35,17 +35,17 @@ const emits = defineEmits(["ok", "close"]);
 const src = ref();
 // 打开弹窗
 const open = (data: any, dataSource: any, mode: string) => {
-  $api.test().then((res: any) => {
-    src.value = res.result.result.imageBase64;
-  })
+    src.value = data;
+
   pageData.dialogVisible = true;
 };
 defineExpose({ open });
 </script>
 
 <template>
-  <el-dialog v-model="pageData.dialogVisible" destroy-on-close :width="500">
+  <el-dialog v-model="pageData.dialogVisible" title="扫码支付" destroy-on-close :width="500">
 
     <img :src="src" />
+    <el-text>请使用支付宝"扫一扫"进行支付</el-text>
   </el-dialog>
 </template>