Commit 13c91000 by liuliufashi

update

parent ceb0a970
......@@ -124,6 +124,12 @@ export const onfindAli = async(uid:any)=>{
method:'post',
});
}
export const onfindAli1 = async(uid:any)=>{
return await request({
url: `/pay/findAli1?uid=${uid}`,
method:'post',
});
}
export const onfindWX = async(uid:any)=>{
return await request({
......@@ -131,6 +137,13 @@ export const onfindWX = async(uid:any)=>{
method:'post',
});
}
export const onfindWX1 = async(uid:any)=>{
return await request({
url: `/pay/findWX1?uid=${uid}`,
method:'post',
});
}
export const onSelectGoods = async(data:any)=>{
return await request({
url: `/goods/select?uid=${data.uid}&page=${data.page}&size=${data.size}&strtus=${data.strtus}`,
......@@ -196,4 +209,26 @@ export const onFindPayOrderid = async(data:any)=>{
method:'post',
});
}
// /orders/findall
\ No newline at end of file
export const onLogOut = async()=>{
return await request({
url: `/pub/logout`,
method:'get',
});
}
export const onDisableAli = async(data:any)=>{
return await request({
url: `/pay/DisableAli`,
method:'post',
data
});
}
export const onDisableWx = async(data:any)=>{
return await request({
url: `/pay/DisableWx`,
method:'post',
data
});
}
// /pay/DisableAli
\ No newline at end of file
......@@ -69,14 +69,15 @@ import {
DashOutlined,
} from "@ant-design/icons-vue";
import type { MenuProps } from 'ant-design-vue';
import one from '@/assets/img/1.png'
import two from '@/assets/img/2.png'
import three from '@/assets/img/3.png'
import four from '@/assets/img/4.png'
import five from '@/assets/img/5.png'
import six from '@/assets/img/6.png'
import seven from '@/assets/img/7.png'
import eight from '@/assets/img/8.png'
import {onLogOut} from '@/api/index';
import one from '@/assets/img/1.png';
import two from '@/assets/img/2.png';
import three from '@/assets/img/3.png';
import four from '@/assets/img/4.png';
import five from '@/assets/img/5.png';
import six from '@/assets/img/6.png';
import seven from '@/assets/img/7.png';
import eight from '@/assets/img/8.png';
interface FormUser {
name: String;
password: String;
......@@ -98,9 +99,10 @@ const goNewPage = (e: any,index:any) => {
});
};
const handleMenuClick: MenuProps['onClick'] = e => {
const handleMenuClick: MenuProps['onClick'] = async(e) => {
console.log('click', e);
if(e.key == '1'){
const data = await onLogOut()
router.replace({
path:'/login'
})
......
......@@ -124,10 +124,12 @@ import {
import {
onZfbPay,
onWxPay,
onfindAli,
onfindWX,
onfindWX1,
onfindAli1,
onUpdate,
onUpdateWX,
onDisableAli,
onDisableWx,
} from "@/api/index";
import { message } from "ant-design-vue";
import { getUid } from "@/utils/userInfo";
......@@ -229,21 +231,39 @@ const onSubmit = async () => {
...toRaw(modelRef),
};
if (status.value === 1) {
dataFrom.value = {
amount: dataFrom.value.amount,
id: dataFrom.value.id,
paystate: dataFrom.value.paystate,
paytype: dataFrom.value.paytype,
status: dataFrom.value.status,
weight: dataFrom.value.weight,
mchid: toRaw(modelRef).mchid,
mchkey: toRaw(modelRef).mchkey,
...toRaw(modelRef),
};
let prarms:any = {
}
if(query.value.paytype == "1"){
prarms = {
amount: dataFrom.value.amount,
id: dataFrom.value.id,
paystate: dataFrom.value.paystate,
paytype: dataFrom.value.paytype,
status: dataFrom.value.status,
weight: dataFrom.value.weight,
mchid: toRaw(modelRef).privatekey,
mchkey: toRaw(modelRef).alipaypublickey,
...toRaw(modelRef),
};
}else{
prarms = {
amount: dataFrom.value.amount,
id: dataFrom.value.id,
paystate: dataFrom.value.paystate,
paytype: dataFrom.value.paytype,
status: dataFrom.value.status,
weight: dataFrom.value.weight,
mchid: toRaw(modelRef).mchid,
mchkey: toRaw(modelRef).mchkey,
...toRaw(modelRef),
};
}
if (query.value.paytype == "1") {
data = await onUpdateWX(JSON.stringify(dataFrom.value));
data = await onUpdateWX(JSON.stringify(prarms));
} else if (query.value.paytype == "2") {
data = await onUpdate(JSON.stringify(dataFrom.value));
data = await onUpdate(JSON.stringify(prarms));
}
if (data.state === 1) {
isShowTable.value = true;
......@@ -291,15 +311,13 @@ const onFinishFailed = (errorInfo: any) => {
console.log("Failed:", errorInfo);
};
const onSetShowTable = async (data: any) => {
console.log(data, "data");
status.value = 1;
isShowTable.value = false;
if (query.value.paytype == 1) {
const { mchid, mchkey, appid, name } = data;
const { appid, name} = data;
const uid: any = getUid();
modelRef.privatekey = mchid;
modelRef.alipaypublickey = '';
modelRef.privatekey = modelRef.privatekey;
modelRef.alipaypublickey = modelRef.alipaypublickey;
modelRef.appid = appid;
modelRef.name = name;
// modelRef.server_url =server_url
......@@ -310,11 +328,10 @@ const onSetShowTable = async (data: any) => {
modelRef.alipaypublickey = '';
modelRef.privatekey = privatekey;
modelRef.appid = appid;
modelRef.name = payname;
modelRef.name = name;
// modelRef.server_url =server_url
modelRef.uid = uid;
}
dataFrom.value = data;
};
const onCreated = () => {
......@@ -323,8 +340,32 @@ const onCreated = () => {
const onSetBackShowTable = () => {
router.go(-1);
};
const onDis = (data: any) => {
console.log(data, "data");
const onDis = async(e: any) => {
let prarms:any = {
payid:e.id,
uid:e.userid,
}
let newData:any ={
}
if(query.value.paytype == 1){
newData = await onDisableWx(prarms)
}else{
newData = await onDisableAli(prarms)
}
if(newData.state === 1){
message.success('禁用成功')
}
let data:any={
}
const uid: any = getUid();
if(query.value.paytype == 1) {
data = await onfindWX1(uid);
} else if (query.value.paytype == 2) {
data = await onfindAli1(uid);
}
list.value = data.data;
};
const onCreate = () => {
modelRef.name = formState.name;
......@@ -335,9 +376,9 @@ const init = async () => {
const uid: any = getUid();
let data: any = {};
if (query.value.paytype == 1) {
data = await onfindWX(uid);
data = await onfindWX1(uid);
} else if (query.value.paytype == 2) {
data = await onfindAli(uid);
data = await onfindAli1(uid);
}
list.value = data.data;
return list;
......
......@@ -161,12 +161,6 @@ const rulesRef = reactive({
message: '请输入商品名称!',
},
],
shortname: [
{
required: true,
message: '请输入商品简介!',
},
],
});
const { validate } = useForm(formState, rulesRef);
const onSelect = (value: any, option: any) => {
......
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