Commit fd12b9a3 by liuliufashi

updatye

parent 74dd8590
VUE_APP_MODE = 'dev' VUE_APP_MODE = 'dev'
NODE_ENV = 'development' NODE_ENV = 'development'
VUE_APP_BASE_URL = '' VUE_APP_BASE_URL = 'http://47.102.211.197:8092'
VUE_APP_TEXT = '测试环境' VUE_APP_TEXT = '测试环境'
\ No newline at end of file
VUE_APP_MODE = 'prod' VUE_APP_MODE = 'prod'
NODE_ENV = 'production' NODE_ENV = 'production'
VUE_APP_BASE_URL = '' VUE_APP_BASE_URL = 'http://47.102.211.197:8092'
VUE_APP_TEXT = '生产环境' VUE_APP_TEXT = '生产环境'
\ No newline at end of file
...@@ -2,6 +2,8 @@ import axios from "axios"; ...@@ -2,6 +2,8 @@ import axios from "axios";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { getToken } from "./token"; import { getToken } from "./token";
// 创建axios实例 // 创建axios实例
console.log(process.env.VUE_APP_BASE_URL,'process.env');
const instance = axios.create({ const instance = axios.create({
baseURL: "http://192.168.3.131:8080/", baseURL: "http://192.168.3.131:8080/",
// 设置相应的时间 // 设置相应的时间
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
</div> </div>
</div> </div>
<div class="goods-list" v-if="!isShowGoods"> <div class="goods-list" v-if="!isShowGoods">
<a-table :columns="columns" :data-source="data"> <a-table :columns="columns" :data-source="data">
<template #headerCell="{ column }"> <template #headerCell="{ column }">
<template v-if="column.key === 'name'"> <template v-if="column.key === 'name'">
...@@ -69,13 +70,20 @@ ...@@ -69,13 +70,20 @@
</a-table> </a-table>
</div> </div>
<div v-if="isShowGoods"> <div v-if="isShowGoods">
<GoodsBags :props="{ propsData }" @onBack="onBack"></GoodsBags> <div style="display: flex; align-items: center; justify-content: space-between" v-if="isShowGoods">
<a-button class="small left" @click="onBack">
<template #icon>
<LeftOutlined />
</template>
</a-button>
</div>
<GoodsBags :props="{ propsData }" ></GoodsBags>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, reactive, defineExpose } from "vue"; import { ref, reactive, defineExpose } from "vue";
import { SmileOutlined, DownOutlined } from "@ant-design/icons-vue"; import { SmileOutlined, DownOutlined,LeftOutlined } from "@ant-design/icons-vue";
import GoodsBags from "./components/index.vue"; import GoodsBags from "./components/index.vue";
const columns = [ const columns = [
{ {
...@@ -177,5 +185,20 @@ defineExpose({ ...@@ -177,5 +185,20 @@ defineExpose({
.goods-list { .goods-list {
margin-top: 10px; margin-top: 10px;
} }
.small {
border: none;
height: 30px;
width: 50px;
}
.left {
border-left: 1px solid rgb(236, 236, 236);
border-top: 1px solid rgb(236, 236, 236);
border-bottom: 1px solid rgb(236, 236, 236);
border-right-width: 80%;
border-right: 1px solid rgb(236, 236, 236);
border-bottom-left-radius: 25px;
border-top-left-radius: 25px;
}
} }
</style> </style>
<template> <template>
<div class="bind-page"> <div class="bind-page">
<div style="display: flex; align-items: center; justify-content: space-between"> <div
style="display: flex; align-items: center; justify-content: space-between"
>
<div> <div>
<a-button class="small left" @click="onSetShowTable"> <a-button class="small left" @click="onSetBackShowTable">
<template #icon> <template #icon>
<LeftOutlined /> <LeftOutlined />
</template> </template>
...@@ -15,80 +17,177 @@ ...@@ -15,80 +17,177 @@
</div> </div>
<div> <div>
<a-button type="primary" block @click="onSetShowTable" v-if="query && query.isShow">新建支付通道</a-button> <a-button
type="primary"
block
@click="showModal"
v-if="query && query.isShow"
>新建支付通道</a-button
>
</div> </div>
</div> </div>
<div style="margin-top: 10px;"> <div style="margin-top: 10px">
<a-table :columns="columns" :data-source="data" :pagination="false" v-if="isShowTable"> <a-table
:columns="columns"
:data-source="list"
:pagination="false"
v-if="isShowTable"
>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'"> <template v-if="column.key === 'name'">
<a> <a>
{{ record.name }} {{ record.name || "~" }}
</a> </a>
</template> </template>
<template v-if="column.key === 'wx'">
<div v-if="record.paytype == '1'">
<CheckCircleFilled style="font-size:25px; color:rgb(12, 191, 33);"></CheckCircleFilled>
</div>
<div v-else>
<CloseCircleFilled style="font-size:25px;color: rgb(250, 116, 116);"></CloseCircleFilled>
</div>
</template>
<template v-else-if="column.key === 'zfb'">
<div v-if="record.paytype == '2'">
<CheckCircleFilled style="font-size:25px;color:rgb(12, 191, 33);"></CheckCircleFilled>
</div>
<div v-else>
<CloseCircleFilled style="font-size:25px;color: rgb(250, 116, 116);"></CloseCircleFilled>
</div>
</template>
<template v-else-if="column.key === 'tags'"> <template v-else-if="column.key === 'tags'">
<span> <span>
<a-tag v-for="tag in record.tags" :key="tag" :color=" <a-tag
tag === 'loser' v-for="tag in record.tags"
? 'volcano' :key="tag"
: tag.length > 5 :color="
tag === 'loser'
? 'volcano'
: tag.length > 5
? 'geekblue' ? 'geekblue'
: 'green' : 'green'
"> "
>
{{ tag.toUpperCase() }} {{ tag.toUpperCase() }}
</a-tag> </a-tag>
</span> </span>
</template> </template>
<template v-else-if="column.key === 'action'"> <template v-else-if="column.key === 'status'">
<span> <div v-if="record.status === 0">
<a>Invite 一 {{ record.name }}</a> <span class="ml20" style="color: rgba(12, 191, 33, 1)">良好</span>
<a-divider type="vertical" /> </div>
<a>Delete</a> <div v-else-if="record.status === 1">
<a-divider type="vertical" /> <span class="ml20" style="color: rgb(250, 116, 116)">预警</span>
<a class="ant-dropdown-link"> </div>
More actions </template>
<down-outlined /> <template v-else-if="column.key === 'weight'">
</a> <a-input-number
</span> id="inputNumber"
v-model:value="record.weight"
:min="1"
:max="10"
@blur="onChangeWeight(record)"
/>
<span>1-10</span>
</template> </template>
<template v-else-if="column.key === 'ref'"> <template v-else-if="column.key === 'ref'">
<span> <span>
<a-button danger @click="onSetShowTable">编辑</a-button> <a-button danger @click="onSetShowTable" >配置</a-button>
</span> </span>
<span> <span>
<a-button danger>禁用</a-button> <a-button danger style="margin-left: 10px" @click="onDis(record)">禁用</a-button>
</span> </span>
</template> </template>
</template> </template>
</a-table> </a-table>
<div v-else> <div v-else>
<a-form :label-col="{ span: 2 }" :wrapper-col="{ span: 12 }"> <a-form :label-col="{ span: 2 }" :wrapper-col="{ span: 12 }">
<a-form-item label="通道名称" has-feedback labelAlign="left" v-bind="validateInfos.name"> <a-form-item
<a-input v-model:value="modelRef.name" placeholder="请输入通道名称" /> label="通道名称"
has-feedback
labelAlign="left"
v-bind="validateInfos.name"
>
<a-input
v-model:value="modelRef.name"
placeholder="请输入通道名称"
/>
</a-form-item> </a-form-item>
<a-form-item label="uid:" has-feedback labelAlign="left" v-bind="validateInfos.uid" > <a-form-item
label="uid:"
has-feedback
labelAlign="left"
v-bind="validateInfos.uid"
>
<a-input v-model:value="modelRef.uid" placeholder="请输入uid" /> <a-input v-model:value="modelRef.uid" placeholder="请输入uid" />
</a-form-item> </a-form-item>
<a-form-item label="appid:" has-feedback labelAlign="left" v-bind="validateInfos.appid"> <a-form-item
label="appid:"
has-feedback
labelAlign="left"
v-bind="validateInfos.appid"
>
<a-input v-model:value="modelRef.appid" placeholder="请输入appid" /> <a-input v-model:value="modelRef.appid" placeholder="请输入appid" />
</a-form-item> </a-form-item>
<a-form-item label="Appkey:" has-feedback labelAlign="left" v-bind="validateInfos.Appkey"> <a-form-item
<a-input v-model:value="modelRef.Appkey" placeholder="请输入Appkey" /> label="privatekey:"
has-feedback
labelAlign="left"
v-bind="validateInfos.privatekey"
>
<a-input
v-model:value="modelRef.privatekey"
placeholder="请输入privatekey"
/>
</a-form-item>
<a-form-item
label="alipaypublickey:"
has-feedback
labelAlign="left"
v-bind="validateInfos.alipaypublickey"
>
<a-input
v-model:value="modelRef.alipaypublickey"
placeholder="请输入alipaypublickey"
/>
</a-form-item> </a-form-item>
<a-form-item label="Secretkey:" has-feedback labelAlign="left" v-bind="validateInfos.Secretkey"> <a-form-item
<a-input v-model:value="modelRef.Secretkey" placeholder="请输入Secretkey" /> label="域名配置:"
has-feedback
labelAlign="left"
v-bind="validateInfos.serveUrl"
>
<a-input
v-model:value="modelRef.server_url"
placeholder="请输入域名配置"
/>
</a-form-item> </a-form-item>
<a-form-item > <a-form-item>
<a-button type="primary" @click="onSubmit">保存</a-button> <a-button type="primary" @click="onSubmit">保存</a-button>
</a-form-item> </a-form-item>
</a-form> </a-form>
</div> </div>
</div> </div>
<a-modal v-model:visible="visible" title="支付通道名称" @ok="handleOk" :footer="null"> <a-modal
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" v-model:visible="visible"
@finish="onFinish" @finishFailed="onFinishFailed"> title="支付通道名称"
<a-form-item label="支付通道名称" name="username" @ok="handleOk"
:rules="[{ required: true, message: 'Please input your username!' }]"> :footer="null"
>
<a-form
:model="formState"
name="basic"
:label-col="{ span: 8 }"
:wrapper-col="{ span: 16 }"
autocomplete="off"
@finish="onFinish"
@finishFailed="onFinishFailed"
>
<a-form-item
label="支付通道名称"
name="username"
:rules="[{ required: true, message: 'Please input your username!' }]"
>
<a-input v-model:value="formState.username" /> <a-input v-model:value="formState.username" />
</a-form-item> </a-form-item>
<p class="title">建议用该微信商户号主体名称作为通道名称</p> <p class="title">建议用该微信商户号主体名称作为通道名称</p>
...@@ -100,25 +199,27 @@ ...@@ -100,25 +199,27 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { defineExpose, ref, reactive, computed,toRaw } from "vue"; import { defineExpose, ref, reactive, computed, toRaw, onMounted } from "vue";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { Form } from 'ant-design-vue'; import { Form } from "ant-design-vue";
import { import {
LeftOutlined, LeftOutlined,
MenuUnfoldOutlined, MenuUnfoldOutlined,
DownOutlined, CheckCircleFilled,
CloseCircleFilled,
} from "@ant-design/icons-vue"; } from "@ant-design/icons-vue";
import {onZfbPay,onWxPay,onTest} from '@/api/index' import { onZfbPay, onWxPay, payConfigGetSearch } from "@/api/index";
import { message } from 'ant-design-vue'; import { message } from "ant-design-vue";
interface FormState { interface FormState {
username: string; username: String;
} }
interface AppFormState { interface AppFormState {
uid: string; uid: String;
appid: string; appid: String;
Appkey: string; privatekey: String;
Secretkey: string; alipaypublickey: String;
name: string; name: String;
server_url: String;
} }
const useForm = Form.useForm; const useForm = Form.useForm;
const columns = [ const columns = [
...@@ -129,22 +230,22 @@ const columns = [ ...@@ -129,22 +230,22 @@ const columns = [
}, },
{ {
title: "微信", title: "微信",
dataIndex: "age", dataIndex: "wx",
key: "age", key: "wx",
}, },
{ {
title: "支付宝", title: "支付宝",
dataIndex: "address", dataIndex: "zfb",
key: "address", key: "zfb",
}, },
{ {
title: "状态", title: "状态",
key: "tags", key: "status",
dataIndex: "tags", dataIndex: "status",
}, },
{ {
title: "权重", title: "权重",
key: "action", key: "weight",
}, },
{ {
title: "操作", title: "操作",
...@@ -152,81 +253,69 @@ const columns = [ ...@@ -152,81 +253,69 @@ const columns = [
}, },
]; ];
const data = [ const list = ref([]);
{ const route = useRoute();
key: "1",
name: "John Brown",
age: 32,
address: "New York No. 1 Lake Park",
tags: ["nice", "developer"],
},
{
key: "2",
name: "Jim Green",
age: 42,
address: "London No. 1 Lake Park",
tags: ["loser"],
},
{
key: "3",
name: "Joe Black",
age: 32,
address: "Sidney No. 1 Lake Park",
tags: ["cool", "teacher"],
},
];
const route = useRoute()
const query = computed({ const query = computed({
get: () => { get: () => {
return route.query return route.query;
}, },
set: () => { set: () => {
return route.query return route.query;
} },
}) });
const modelRef = reactive<AppFormState>({ const modelRef = reactive<AppFormState>({
Secretkey: "", alipaypublickey: "",
Appkey: "", privatekey: "",
uid: "", uid: "",
appid: "", appid: "",
name: "", name: "",
server_url: "",
}); });
const onChangeWeight = (record:any)=>{
console.log(record,'e');
}
const rulesRef = reactive({ const rulesRef = reactive({
Secretkey: [ alipaypublickey: [
{ {
required: true, required: true,
message: '请输入Secretkey', message: "请输入Secretkey",
}, },
], ],
Appkey: [ privatekey: [
{ {
required: true, required: true,
message: '请输入Appkey', message: "请输入Appkey",
}, },
], ],
name: [ name: [
{ {
required: true, required: true,
message: '请输入通道名称', message: "请输入通道名称",
}, },
], ],
uid: [ uid: [
{ {
required: true, required: true,
message: '请输入uid', message: "请输入uid",
}, },
], ],
appid: [ appid: [
{ {
required: true, required: true,
message: '请输入appid', message: "请输入appid",
},
],
serveUrl: [
{
required: true,
message: "请输入server_url",
}, },
], ],
}); });
const { resetFields, validate, validateInfos } = useForm(modelRef, rulesRef); const { resetFields, validate, validateInfos } = useForm(modelRef, rulesRef);
const onSubmit =async () => { const onSubmit = async () => {
// const data ={ // const data ={
// a:'a', // a:'a',
// b:{ // b:{
...@@ -236,22 +325,26 @@ const onSubmit =async () => { ...@@ -236,22 +325,26 @@ const onSubmit =async () => {
// } // }
// await onTest(JSON.stringify(data)) // await onTest(JSON.stringify(data))
validate() validate()
.then(async() => { .then(async () => {
let data = { let data = {};
} const prarms = {
if(query.value.mode === 'zfb'){ paytype: query.value.paytype,
data = await onZfbPay(toRaw(modelRef)) ...toRaw(modelRef),
}else if(query.value.mode === 'wx'){ };
data = await onWxPay(toRaw(modelRef)) console.log(query.value.paytype);
if (query.value.paytype == "1") {
data = await onWxPay(prarms);
} else if (query.value.paytype == "2") {
data = await onZfbPay(prarms);
} }
if(data.state === 1){ if (data.state === 1) {
message.success(data.message, 10,); message.success(data.message, 10);
}else{ } else {
message.warning(data.message, 10,); message.warning(data.message, 10);
} }
}) })
.catch(err => { .catch((err) => {
console.log('error', err); console.log("error", err);
}); });
}; };
const visible = ref<boolean>(false); const visible = ref<boolean>(false);
...@@ -275,15 +368,24 @@ const onFinishFailed = (errorInfo: any) => { ...@@ -275,15 +368,24 @@ const onFinishFailed = (errorInfo: any) => {
console.log("Failed:", errorInfo); console.log("Failed:", errorInfo);
}; };
const onSetShowTable = () => { const onSetShowTable = () => {
isShowTable.value = !isShowTable.value; isShowTable.value = false;
}; };
const onCreatPay=async(data:Object) =>{ const onSetBackShowTable = () => {
if(query.value.mode === 'zfb'){ isShowTable.value = true;
await onZfbPay(data) };
} const onDis = (data:any)=>{
console.log(data,'data');
} }
onMounted(async () => {
const data: any = await payConfigGetSearch(1);
list.value = data.data.alipay;
console.log(list, "list");
return list;
});
defineExpose({ defineExpose({
data, list,
columns, columns,
visible, visible,
showModal, showModal,
...@@ -298,7 +400,8 @@ defineExpose({ ...@@ -298,7 +400,8 @@ defineExpose({
modelRef, modelRef,
onSubmit, onSubmit,
query, query,
onCreatPay onChangeWeight,
onDis
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
...@@ -92,7 +92,7 @@ const onOpenInfo = (record:any, index:any, column:any) => { ...@@ -92,7 +92,7 @@ const onOpenInfo = (record:any, index:any, column:any) => {
path:'/home/paybind', path:'/home/paybind',
query:{ query:{
isShow:1, isShow:1,
mode:record.mode paytype:record.paytype
} }
}) })
}; };
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<ContentHeaders v-if="ShowIcon.HeaderIcon" :list="list" ></ContentHeaders> <ContentHeaders v-if="ShowIcon.HeaderIcon" :list="list" ></ContentHeaders>
</div> </div>
</a-layout-content> </a-layout-content>
<a-layout-content class="body-content"> <!-- <a-layout-content class="body-content">
<div> <div>
<div class="header-title"> <div class="header-title">
<span>域名配置</span <span>域名配置</span
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</div> </div>
<ContentFooters v-if="ShowIcon.FooterIcon"></ContentFooters> <ContentFooters v-if="ShowIcon.FooterIcon"></ContentFooters>
</div> </div>
</a-layout-footer> </a-layout-footer> -->
</a-layout> </a-layout>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -52,7 +52,7 @@ import { DownOutlined, UpOutlined } from "@ant-design/icons-vue"; ...@@ -52,7 +52,7 @@ import { DownOutlined, UpOutlined } from "@ant-design/icons-vue";
BodyIcon: Boolean; BodyIcon: Boolean;
FooterIcon: Boolean; FooterIcon: Boolean;
} }
let list = ref<Object>([{name:'1',num:2,status:'0',mode:'zfb'},{name:'2',num:2,status:'1',mode:'wx'},{name:'3',num:2,status:'0',mode:'jd'},{name:'4',num:2,status:'0',mode:'hb'},{name:'5',num:2,status:'0',mode:'yl'}]) let list = ref<Object>([{name:'1',num:2,status:'0',paytype:'2'},{name:'2',num:2,status:'1',paytype:'1'},{name:'3',num:2,status:'0',paytype:'3'},{name:'4',num:2,status:'0',paytype:'4'},{name:'5',num:2,status:'0',paytype:'5'}])
const ShowIcon = reactive<ShowIcon>({ const ShowIcon = reactive<ShowIcon>({
HeaderIcon: true, HeaderIcon: true,
BodyIcon: true, BodyIcon: true,
......
<template> <template>
<div>支付链接</div> <div>
<div style="display: flex;align-items: center;justify-content: space-between;">
<div>
<a-space direction="vertical">
<a-select v-model:value="value1" :size="size" style="width: 200px" :options="options"></a-select>
</a-space>
<a-input-search v-model:value="value" placeholder="input search text" style="width: 200px"
@search="onSearch" />
<a-space direction="vertical">
<a-select v-model:value="value1" :size="size" style="width: 200px" :options="options"></a-select>
</a-space>
</div>
<div>
<a-button type="primary" block>新建支付项</a-button>
</div>
</div>
<div style="margin-top: 10px;">
<a-table :dataSource="dataSource" :columns="columns" />
</div>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type { SelectProps } from 'ant-design-vue';
import { ref, defineExpose } from 'vue';
const popupScroll = () => {
console.log('popupScroll');
};
const value = ref<string>('');
const onSearch = (searchValue: string) => {
console.log('use value', searchValue);
console.log('or use this.value', value.value);
};
const options = [...Array(25)].map((_, i) => ({ value: (i + 10).toString(36) + (i + 1) }))
const dataSource = [
{
key: '1',
name: '胡彦斌',
age: 32,
address: '西湖区湖底公园1号',
},
{
key: '2',
name: '胡彦祖',
age: 42,
address: '西湖区湖底公园1号',
},
]
const columns = [
{
title: '姓名',
dataIndex: 'name',
key: 'name',
},
{
title: '年龄',
dataIndex: 'age',
key: 'age',
},
{
title: '住址',
dataIndex: 'address',
key: 'address',
},
]
defineExpose({
size: ref<SelectProps['size']>('middle'),
value1: ref('a1'),
options,
value,
onSearch,
dataSource,
columns
})
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
</style> </style>
\ No newline at end of file
...@@ -28,7 +28,7 @@ module.exports = { ...@@ -28,7 +28,7 @@ module.exports = {
devServer: { devServer: {
proxy: { proxy: {
'/api': { '/api': {
target: 'http://47.102.211.197:8092', //请求对象 target:process.env.VUE_APP_BASE_URL,
ws: true,//代理websocked ws: true,//代理websocked
changeOrigin: true, changeOrigin: true,
secure: false, //target是否为https接口 secure: false, //target是否为https接口
......
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