|
@@ -0,0 +1,96 @@
|
|
|
+<script setup lang='ts'>
|
|
|
+import { appInfo, setCallback } from '@/api'
|
|
|
+import { message } from 'ant-design-vue';
|
|
|
+import { onMounted, reactive, ref, UnwrapRef } from 'vue'
|
|
|
+interface Application {
|
|
|
+ id?: number,
|
|
|
+ sandbox: number,
|
|
|
+ appId: string,
|
|
|
+ appSecret: string,
|
|
|
+ storeStatusNotifyUrl: string,
|
|
|
+ orderStatusNotifyUrl: string
|
|
|
+
|
|
|
+}
|
|
|
+let applicationInfo = reactive<Application>({
|
|
|
+ sandbox: 0,
|
|
|
+ appId: '',
|
|
|
+ appSecret: '',
|
|
|
+ storeStatusNotifyUrl: '',
|
|
|
+ orderStatusNotifyUrl: ''
|
|
|
+})
|
|
|
+onMounted(() => {
|
|
|
+
|
|
|
+})
|
|
|
+const getAppInfo = () => {
|
|
|
+ appInfo().then((res: any) => {
|
|
|
+ console.log('app信息:', res);
|
|
|
+ if (res.code === 0) {
|
|
|
+ // applicationInfo = reactive<Application>(res.data[0])
|
|
|
+ Object.assign(applicationInfo, res.data[0])
|
|
|
+ } else {
|
|
|
+ message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+getAppInfo()
|
|
|
+const submit = () => {
|
|
|
+ setCallback({ id: applicationInfo.id, storeStatusNotifyUrl: applicationInfo.storeStatusNotifyUrl, orderStatusNotifyUrl: applicationInfo.orderStatusNotifyUrl }).then((res: any) => {
|
|
|
+ console.log('res:', res);
|
|
|
+ })
|
|
|
+}
|
|
|
+</script>
|
|
|
+<template>
|
|
|
+ <div class="px-30px py-30px w-full h-full rounded-10px bg-white">
|
|
|
+ <div class="text-20px text-[#222222] font-bold">应用信息</div>
|
|
|
+ <div v-if="applicationInfo.sandbox" class="mt-30px ml-30px">
|
|
|
+ <div class="relative text-16px font-500 text-[#333333] leading-19px line-title">正式环境</div>
|
|
|
+ <div class="text-14px text-[#666666] font-500 ml-30px">
|
|
|
+ <div class="flex items-center mt-20px">
|
|
|
+ <p class="w-100px text-right mr-10px">App Key:</p>
|
|
|
+ <p>{{ applicationInfo.appId }}</p>
|
|
|
+ </div>
|
|
|
+ <div class="flex items-center mt-20px">
|
|
|
+ <p class="w-100px text-right mr-10px">App Secret:</p>
|
|
|
+ <p>{{ applicationInfo.appSecret }}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else class="mt-30px ml-30px">
|
|
|
+ <div class="relative text-16px font-500 text-[#333333] leading-19px line-title">测试环境</div>
|
|
|
+ <div class="text-14px text-[#666666] font-500 ml-30px">
|
|
|
+ <div class="flex items-center mt-20px">
|
|
|
+ <p class="w-100px text-right mr-10px">App Key:</p>
|
|
|
+ <p>{{ applicationInfo.appId }}</p>
|
|
|
+ </div>
|
|
|
+ <div class="flex items-center mt-20px">
|
|
|
+ <p class="w-100px text-right mr-10px">App Secret:</p>
|
|
|
+ <p>{{ applicationInfo.appSecret }}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="text-20px text-[#222222] font-bold mt-100px">联调商户</div>
|
|
|
+ <div class="text-20px text-[#222222] font-bold mt-100px">回调地址</div>
|
|
|
+ <a-form :model="applicationInfo" class="w-400px mt-30px ml-70px">
|
|
|
+ <a-form-item label="门店URL地址:" name="storeStatusNotifyUrl">
|
|
|
+ <a-input v-model:value="applicationInfo.storeStatusNotifyUrl" placeholder="请输入门店URL地址" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="订单URL地址:" name="orderStatusNotifyUrl">
|
|
|
+ <a-input v-model:value="applicationInfo.orderStatusNotifyUrl" placeholder="请输入订单URL地址" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item :wrapper-col="{ offset: 8, span: 16 }">
|
|
|
+ <a-button @click="submit" type="primary" html-type="submit">提交</a-button>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<style lang='scss' scoped>
|
|
|
+.line-title::before {
|
|
|
+ content: '';
|
|
|
+ position: absolute;
|
|
|
+ left: -7px;
|
|
|
+ top: 4px;
|
|
|
+ height: 12px;
|
|
|
+ width: 2px;
|
|
|
+ background: linear-gradient(141deg, #50A7FF 0%, #1B8DFF 100%);
|
|
|
+}
|
|
|
+</style>
|