弹窗显示问题
This commit is contained in:
parent
ab5b4d5443
commit
df1198f13a
@ -80,7 +80,7 @@ const App: React.FC = () => {
|
||||
// console.log('Success:', values);
|
||||
try {
|
||||
const res = await checkPhone(values.phone)
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
if(res.data == 'SUCCESS'){
|
||||
submit(values.phone,values.smsCode)
|
||||
}else{
|
||||
@ -150,7 +150,7 @@ const App: React.FC = () => {
|
||||
messageApi,
|
||||
url: '/api/user-info/get-user-self',
|
||||
onSuccess({ data }: any) {
|
||||
console.log('嘻嘻嘻', data);
|
||||
// console.log('嘻嘻嘻', data);
|
||||
// setIsUpdateWxUsernamePhone(data.isUpdateWxUsernamePhone);
|
||||
// if (data.isUpdateWxUsernamePhone == 1) {
|
||||
if (data.isUpdateWxUsernamePhone == 1) {
|
||||
|
@ -152,9 +152,9 @@ export default function OrderDetailModal(props: any) {
|
||||
<div style={{ width: 1200, maxHeight: `${height}px`, minHeight: "680px" }}>
|
||||
{messageContext}
|
||||
<div className='orderDetailTop'>
|
||||
{tapTitleArray.map((item:any) => {
|
||||
{tapTitleArray.map((item:any,index) => {
|
||||
return (
|
||||
<div key={item.key} className={item.className} onClick={() => {
|
||||
<div key={index} className={item.className} onClick={() => {
|
||||
setActiveKey(item.key)
|
||||
}}>
|
||||
{item.title}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Table, Space, Modal } from "antd"
|
||||
import { Table, Space, Modal,Input } from "antd"
|
||||
import { sellSupplementList, buySupplementList, supplementDetail } from '../../../../request/api'
|
||||
const { Column } = Table;
|
||||
import useMessage from "antd/es/message/useMessage";
|
||||
@ -65,10 +65,13 @@ export default function File(props: any) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 补充资料详情
|
||||
const[detailData, setDetailData] = useState<any>({})
|
||||
const getSupplementDetail = async (id: string) => {
|
||||
try {
|
||||
const res: any = await supplementDetail(id)
|
||||
console.log(res);
|
||||
setDetailData(res)
|
||||
|
||||
} catch (error: any) {
|
||||
|
||||
@ -193,6 +196,18 @@ export default function File(props: any) {
|
||||
>
|
||||
<div>
|
||||
{correctionId}
|
||||
<div className='editModal-title'>
|
||||
<div className='editModal-title-box'></div>
|
||||
<div className='editModal-title-name'>平台需要您补充的内容说明</div>
|
||||
</div>
|
||||
<div>
|
||||
<div>主题</div>
|
||||
<Input value={detailData.correctionTitle}></Input>
|
||||
</div>
|
||||
<div className='editModal-title' style={{ marginTop: 30 }}>
|
||||
<div className='editModal-title-box'></div>
|
||||
<div className='editModal-title-name'>在下面填写您补充的内容</div>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
|
@ -813,9 +813,13 @@ export default function Head() {
|
||||
useEffect(() => {
|
||||
// getLength()
|
||||
reloadUser(messageApi, globalDispatchContext).then((data) => {
|
||||
if (!data.hasUserInfo) {
|
||||
// console.log('嘎嘎嘎哈哈',data);
|
||||
if(!data.hasUserInfo && data.isUpdateWxUsernamePhone != 1) {
|
||||
setIsSelfModalOpen(true);
|
||||
}
|
||||
// if (!data.hasUserInfo) {
|
||||
// setIsSelfModalOpen(true);
|
||||
// }
|
||||
});
|
||||
}, [globalContext.user]);
|
||||
// 刷新用户信息
|
||||
|
@ -78,7 +78,12 @@ export const buySupplementList = (params: any) => request.get(`/aishop/api/corre
|
||||
export const supplementDetail = (correctionId: string) => request.get(`/aishop/api/correction/get/${correctionId}`)
|
||||
// 获取可以买的商品列表
|
||||
export const buyGoodsList = (params: any) => request.get(`/aishop/api/goodsonline/listpage`, { params })
|
||||
|
||||
// 获取上架商品详情
|
||||
export const goodsDetail = (goodsId: string) => request.get(`/aishop/api/goodsonline/get/${goodsId}`)
|
||||
// 创建订单
|
||||
export const createOrder = (goodsId: string) => request.post(`/aishop/api/order/save/${goodsId}`)
|
||||
// 确认付款
|
||||
export const confirmPayment = (orderId: string) => request.put(`/aishop/api/order/confirm-pay/${orderId}`)
|
||||
|
||||
|
||||
// 绑定手机号接口
|
||||
|
@ -1,8 +1,8 @@
|
||||
import axios from "axios";
|
||||
// const baseURL = 'http://192.168.0.115:8099'; // 开票功能baseUrl
|
||||
// const baseURL = 'http://192.168.0.115:8081'; //买卖功能baseUrl
|
||||
const baseURL = 'http://192.168.0.115:8081'; //买卖功能baseUrl
|
||||
|
||||
const baseURL = 'http://192.168.0.15:8091'; //绑定手机号baseUrl
|
||||
// const baseURL = 'http://192.168.0.15:8091'; //绑定手机号baseUrl
|
||||
|
||||
// const baseURL = 'https://www.aimzhu.com';
|
||||
|
||||
|
@ -8,11 +8,14 @@ import {
|
||||
// InputNumber
|
||||
Spin,
|
||||
Modal,
|
||||
Image
|
||||
Image,
|
||||
Button,
|
||||
Input
|
||||
} from 'antd';
|
||||
import { showImage } from '../../request/request'
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import dayjs, { } from 'dayjs';
|
||||
import { buyGoodsList } from '../../request/api'
|
||||
import { buyGoodsList, goodsDetail, createOrder, confirmPayment } from '../../request/api'
|
||||
// import type { InputNumberProps } from 'antd';
|
||||
// import type { TableColumnsType } from 'antd';
|
||||
// import { SearchOutlined, ClearOutlined } from '@ant-design/icons';
|
||||
@ -21,11 +24,13 @@ import { buyGoodsList } from '../../request/api'
|
||||
import { useState, useEffect } from 'react';
|
||||
import useMessage from "antd/es/message/useMessage";
|
||||
const { Column } = Table;
|
||||
const { TextArea } = Input;
|
||||
export default function CopyrightGgoods() {
|
||||
const [messageApi, messageContext] = useMessage();
|
||||
const height = window.innerHeight - 180;
|
||||
const [goodsId, setGoodsId] = useState<any>() //商品ID
|
||||
const [goodsDetailModal, setGoodsDetailModal] = useState(false) //订单详情
|
||||
const [buyTipsModal, setBuyTipsModal] = useState(false) //卖提示框
|
||||
|
||||
// const [messageApi, contextHolder] = message.useMessage();
|
||||
// const dateFormat = 'YYYY-MM-DD';
|
||||
@ -38,6 +43,7 @@ export default function CopyrightGgoods() {
|
||||
const [page, setPage] = useState(1) //页
|
||||
const [total, setTotal] = useState(0) //总条数
|
||||
const [loading, setLoading] = useState(false) //加载中
|
||||
// const [payLoading, setPayLoading] = useState(false) //正在付款
|
||||
const { state } = useLocation()
|
||||
const copyrightKeywords = state ? state.copyrightKeywords : ''; // 版权关键字
|
||||
const minPrice = state ? state.minPrice : ''; // 最低价格
|
||||
@ -49,27 +55,33 @@ export default function CopyrightGgoods() {
|
||||
|
||||
|
||||
const [data, setData] = useState([]); // 表格数据
|
||||
const getBuyGoodsList = async (page: number) => {
|
||||
// 确认支付
|
||||
const confirmPaymentFun = async (orderId: string) => {
|
||||
try {
|
||||
setLoading(true)
|
||||
const res: any = await buyGoodsList({
|
||||
page: page,
|
||||
rows: 10,
|
||||
keywords: copyrightKeywords ? copyrightKeywords : '', // 版权关键字
|
||||
priceRangeStart: minPrice ? minPrice : '', // 最低价格
|
||||
priceRangeEnd: maxPrice ? maxPrice : '', // 最高价格
|
||||
priceOrder: sort ? sort : '', // 排序
|
||||
goodsGetTime: copyrightDate ? dayjs(copyrightDate).year() : '', // 版权日期
|
||||
goodsDevelop: copyrightLanguage ? copyrightLanguage : '', // 开发语言
|
||||
goodsType: copyrightType ? copyrightType.join(',') : '', // 软著类型
|
||||
})
|
||||
// setLoading(true)
|
||||
const res: any = await confirmPayment(orderId)
|
||||
console.log(res);
|
||||
// setLoading(false)
|
||||
} catch (error: any) {
|
||||
|
||||
setLoading(false)
|
||||
setPage(res.page)
|
||||
setData(res.rows)
|
||||
setTotal(res.total)
|
||||
setLoading(false)
|
||||
if (error.response) {
|
||||
const data = error.response.data;
|
||||
messageApi.open({
|
||||
type: 'error',
|
||||
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||
});
|
||||
} else {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 创建订单
|
||||
const createOrderFun = async (goodsId: string) => {
|
||||
try {
|
||||
// setPayLoading(true)
|
||||
const res: any = await createOrder(goodsId)
|
||||
// console.log(res);
|
||||
confirmPaymentFun(res.data)
|
||||
|
||||
} catch (error: any) {
|
||||
|
||||
@ -85,23 +97,83 @@ export default function CopyrightGgoods() {
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
console.log('copyrightKeywords', copyrightKeywords);
|
||||
console.log('minPrice', minPrice);
|
||||
console.log('maxPrice', maxPrice);
|
||||
console.log('sort', sort);
|
||||
console.log('copyrightDate', copyrightDate);
|
||||
console.log('copyrightLanguage', copyrightLanguage);
|
||||
console.log('copyrightType', copyrightType);
|
||||
const getBuyGoodsList = async (page: number) => {
|
||||
try {
|
||||
setLoading(true)
|
||||
const res: any = await buyGoodsList({
|
||||
page: page,
|
||||
rows: 10,
|
||||
keywords: copyrightKeywords ? copyrightKeywords : '', // 版权关键字
|
||||
priceRangeStart: minPrice ? minPrice : '', // 最低价格
|
||||
priceRangeEnd: maxPrice ? maxPrice : '', // 最高价格
|
||||
priceOrder: sort ? sort : '', // 排序
|
||||
goodsGetTime: copyrightDate ? dayjs(copyrightDate).year() : '', // 版权日期
|
||||
goodsDevelop: copyrightLanguage ? copyrightLanguage : '', // 开发语言
|
||||
goodsType: copyrightType ? copyrightType.join(',') : '', // 软著类型
|
||||
})
|
||||
// console.log(res);
|
||||
|
||||
if (copyrightDate) {
|
||||
console.log('sellDate', dayjs(copyrightDate).year());
|
||||
setLoading(false)
|
||||
setPage(res.page)
|
||||
setData(res.rows)
|
||||
setTotal(res.total)
|
||||
setLoading(false)
|
||||
|
||||
} catch (error: any) {
|
||||
// setLoading(false)
|
||||
if (error.response) {
|
||||
const data = error.response.data;
|
||||
messageApi.open({
|
||||
type: 'error',
|
||||
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||
});
|
||||
} else {
|
||||
console.error(error)
|
||||
}
|
||||
}finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}
|
||||
const [goodsDetailData, setGoodsDetailData] = useState<any>({}) // 商品详情数据
|
||||
const getGoodsDetail = async (goodsId: string) => {
|
||||
try {
|
||||
setLoading(true)
|
||||
const res: any = await goodsDetail(goodsId)
|
||||
// console.log(res);
|
||||
setGoodsId(res.goodsId)
|
||||
setGoodsDetailData(res)
|
||||
setLoading(false)
|
||||
} catch (error: any) {
|
||||
// setLoading(false)
|
||||
if (error.response) {
|
||||
const data = error.response.data;
|
||||
messageApi.open({
|
||||
type: 'error',
|
||||
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||
});
|
||||
}
|
||||
}finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}
|
||||
useEffect(() => {
|
||||
// console.log('copyrightKeywords', copyrightKeywords);
|
||||
// console.log('minPrice', minPrice);
|
||||
// console.log('maxPrice', maxPrice);
|
||||
// console.log('sort', sort);
|
||||
// console.log('copyrightDate', copyrightDate);
|
||||
// console.log('copyrightLanguage', copyrightLanguage);
|
||||
// console.log('copyrightType', copyrightType);
|
||||
|
||||
// if (copyrightDate) {
|
||||
// console.log('sellDate', dayjs(copyrightDate).year());
|
||||
// }
|
||||
setPage(1)
|
||||
getBuyGoodsList(1)
|
||||
}, [state])
|
||||
|
||||
return (
|
||||
|
||||
<div className='copyrightG-goods' style={{ height: `${height}px`, overflow: 'auto' }}>
|
||||
{messageContext}
|
||||
{/* {contextHolder} */}
|
||||
@ -164,9 +236,10 @@ export default function CopyrightGgoods() {
|
||||
render={(_text, record: any) => (
|
||||
<Space size="middle">
|
||||
<span className='copyrightG-goods-table-btn' onClick={() => {
|
||||
// console.log(record.goodsId);
|
||||
setGoodsId(record.goodsId)
|
||||
// console.log(record);
|
||||
|
||||
setGoodsDetailModal(true)
|
||||
getGoodsDetail(record.goodsId)
|
||||
}}>查看详情</span>
|
||||
</Space>
|
||||
)}
|
||||
@ -199,22 +272,203 @@ export default function CopyrightGgoods() {
|
||||
onCancel={() => {
|
||||
setGoodsDetailModal(false)
|
||||
}}
|
||||
width={1250}
|
||||
width={1200}
|
||||
centered
|
||||
|
||||
>
|
||||
商品详情{goodsId}
|
||||
<div className='goodsDetail'>
|
||||
<div className='goodsDetailImg'>
|
||||
<Image></Image>
|
||||
</div>
|
||||
<div className='goodsDetailInputBox'>
|
||||
<Spin tip="正在加载..." size="small" spinning={loading}>
|
||||
<div className='goodsDetail'>
|
||||
<div className='goodsDetailImg' style={{
|
||||
position: 'relative',
|
||||
}}>
|
||||
<Image src={showImage(goodsDetailData.goodsPhoto, false)} preview={{
|
||||
mask: '查看', // 设置点击放大时显示的文字
|
||||
}}
|
||||
height={'100%'}
|
||||
style={{ maxWidth: '100%' }}
|
||||
></Image>
|
||||
<div style={{
|
||||
position: 'absolute',
|
||||
bottom: '3px',
|
||||
left: '265px',
|
||||
color: 'rgb(160, 160, 160)',
|
||||
// backgroundColor: 'rgba(0, 0, 0, 0.5)', // 半透明背景色
|
||||
}}>点击查看</div>
|
||||
</div>
|
||||
<div className='goodsDetailInputBox'>
|
||||
<div className='detailBox'>
|
||||
<div className='detailBoxTitle'>软著名称</div>
|
||||
<Input value={goodsDetailData.goodsName} style={{
|
||||
// height: '40px',
|
||||
color: 'black',
|
||||
|
||||
}} disabled></Input>
|
||||
</div>
|
||||
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
}}>
|
||||
<div className='detailBox'>
|
||||
<div className='detailBoxTitle'>软著简称</div>
|
||||
<Input value={goodsDetailData.goodsSubName} style={{
|
||||
// height: '40px',
|
||||
color: 'black',
|
||||
|
||||
}} disabled></Input>
|
||||
</div>
|
||||
<div className='detailBox detailBoxRight'>
|
||||
<div className='detailBoxTitle'>软著证号</div>
|
||||
<Input value={goodsDetailData.goodsNumber} style={{
|
||||
// height: '40px',
|
||||
color: 'black',
|
||||
|
||||
}} disabled></Input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
}}>
|
||||
<div className='detailBox'>
|
||||
<div className='detailBoxTitle'>软著版本</div>
|
||||
<Input value={goodsDetailData.goodsVersion} style={{
|
||||
// height: '40px',
|
||||
color: 'black',
|
||||
|
||||
}} disabled></Input>
|
||||
</div>
|
||||
<div className='detailBox'>
|
||||
<div className='detailBoxTitle detailBoxRight'>取得时间</div>
|
||||
<Input value={goodsDetailData.goodsGetTime} style={{
|
||||
// height: '40px',
|
||||
color: 'black',
|
||||
|
||||
}} disabled></Input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
}}>
|
||||
<div className='detailBox'>
|
||||
<div className='detailBoxTitle'>开发语言</div>
|
||||
<Input value={goodsDetailData.goodsDevelop} style={{
|
||||
// height: '40px',
|
||||
color: 'black',
|
||||
|
||||
}} disabled></Input>
|
||||
</div>
|
||||
<div className='detailBox'>
|
||||
<div className='detailBoxTitle detailBoxRight'>取得方式</div>
|
||||
<Input value={goodsDetailData.goodsGetType} style={{
|
||||
// height: '40px',
|
||||
color: 'black',
|
||||
|
||||
}} disabled></Input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
}}>
|
||||
<div className='detailBox'>
|
||||
<div className='detailBoxTitle'>售卖价格</div>
|
||||
<Input value={goodsDetailData.goodsOpenPrice} style={{
|
||||
// height: '40px',
|
||||
color: 'black',
|
||||
|
||||
}} disabled></Input>
|
||||
</div>
|
||||
<div className='detailBox'>
|
||||
<div className='detailBoxTitle detailBoxRight'>上架时间</div>
|
||||
<Input value={goodsDetailData.goodsStatusTime} style={{
|
||||
// height: '40px',
|
||||
color: 'black',
|
||||
|
||||
}} disabled></Input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className='detailBoxText'>
|
||||
<div className='detailBoxTitle'>软著详情</div>
|
||||
<TextArea
|
||||
disabled
|
||||
style={{
|
||||
width: '100%',
|
||||
// width: 1100,
|
||||
height: 150,
|
||||
fontSize: 16,
|
||||
color: "#5C5C5C",
|
||||
resize: 'none',
|
||||
background: '#F5F5F9'
|
||||
}} value={goodsDetailData.goodsDescription}></TextArea>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
marginTop: 20
|
||||
}}>
|
||||
<Button style={{
|
||||
marginRight: 20,
|
||||
fontSize: 16,
|
||||
color: '#7C7C7C ',
|
||||
background: '#E9E9E9',
|
||||
fontWeight: '700',
|
||||
height: 40,
|
||||
width: 100,
|
||||
|
||||
}}
|
||||
onClick={() => {
|
||||
setGoodsDetailModal(false)
|
||||
}}
|
||||
|
||||
>返回</Button>
|
||||
<Button style={{
|
||||
fontSize: 16,
|
||||
// color: '#FFFFFF',
|
||||
// background: '#FFA800',
|
||||
fontWeight: '700',
|
||||
height: 40,
|
||||
width: 100,
|
||||
|
||||
}}
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
setBuyTipsModal(true)
|
||||
}}
|
||||
>购买</Button>
|
||||
</div>
|
||||
</Spin>
|
||||
</Modal>
|
||||
|
||||
|
||||
<Modal
|
||||
title="提示"
|
||||
okText="确认"
|
||||
cancelText="取消"
|
||||
destroyOnClose={true}
|
||||
open={buyTipsModal}
|
||||
onCancel={() => {
|
||||
setBuyTipsModal(false)
|
||||
}}
|
||||
onOk={() => {
|
||||
// alert(goodsId)
|
||||
createOrderFun(goodsId)
|
||||
}}
|
||||
// width={1200}
|
||||
centered
|
||||
>
|
||||
确定购买该商品吗?
|
||||
</Modal>
|
||||
|
||||
|
||||
</div>
|
||||
)
|
||||
|
@ -17,4 +17,47 @@
|
||||
}
|
||||
.copyrightG-goods-search .css-dev-only-do-not-override-1ae8k9u.ant-input-number .ant-input-number-input{
|
||||
height: 33px;
|
||||
}
|
||||
.goodsDetail{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.goodsDetailImg{
|
||||
width: 49%;
|
||||
height: 500px;
|
||||
background-color: #F5F5F5;
|
||||
padding: 30px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
/* flex-direction: column; */
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.goodsDetailInputBox{
|
||||
/* background-color: rgb(212, 212, 212); */
|
||||
width: 49%;
|
||||
height: 500px;
|
||||
padding: 30px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
}
|
||||
.detailBox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* background-color: rgb(0, 0, 0); */
|
||||
}
|
||||
.detailBoxTitle{
|
||||
font-size: 16px;
|
||||
/* background-color: pink; */
|
||||
text-wrap: nowrap;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.detailBoxRight{
|
||||
margin-left: 10px;
|
||||
}
|
||||
.detailBoxText{
|
||||
display:flex;
|
||||
}
|
@ -284,6 +284,8 @@ export default function ProductRelease() {
|
||||
} else {
|
||||
console.error(error)
|
||||
}
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
|
||||
}
|
||||
@ -402,7 +404,9 @@ export default function ProductRelease() {
|
||||
<Image src={showImage(item.goodsPhoto, false)} height={90} preview={{
|
||||
mask: '查看', // 设置点击放大时显示的文字
|
||||
|
||||
}}></Image>
|
||||
}}
|
||||
style={{ maxWidth: '100%' }}
|
||||
></Image>
|
||||
</div>
|
||||
</td>
|
||||
<td className='product-release-table-name-td'>
|
||||
|
@ -1040,9 +1040,10 @@ export default function EditModal(props: any) {
|
||||
placeholder='请选择取得方式'
|
||||
style={{ width: 498, height: 50 }}
|
||||
options={[
|
||||
{ value: '1', label: '平台申请' },
|
||||
{ value: '2', label: '原始取得' },
|
||||
{ value: '3', label: '继受取得' },
|
||||
{ value: '1', label: '原始取得' },
|
||||
{ value: '2', label: '继受取得(受让)' },
|
||||
{ value: '3', label: '继受取得(继承)' },
|
||||
{ value: '4', label: '继受取得(承受)' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
@ -3,7 +3,7 @@ import {
|
||||
// Select, DatePicker, Button,
|
||||
Table,
|
||||
// message,
|
||||
Space, Pagination,
|
||||
Pagination,
|
||||
Modal,
|
||||
Spin
|
||||
} from 'antd';
|
||||
@ -11,16 +11,17 @@ import {
|
||||
// import { SearchOutlined, ClearOutlined } from '@ant-design/icons';
|
||||
// import type { DatePickerProps } from 'antd';
|
||||
// import locale from 'antd/es/date-picker/locale/zh_CN';
|
||||
import { getBuyOrderList } from '../../request/api'
|
||||
import { getBuyOrderList, confirmPayment } from '../../request/api'
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import File from '../../components/OrderDetailModal/components/File/File'
|
||||
const { Column } = Table;
|
||||
import OrderDetail from '../../components/OrderDetailModal/OrderDetailModal'
|
||||
import useMessage from "antd/es/message/useMessage";
|
||||
import dayjs, { } from 'dayjs';
|
||||
export default function TradingGoods() {
|
||||
const height = window.innerHeight - 180;
|
||||
// const [messageApi, contextHolder] = message.useMessage();
|
||||
const [messageApi, contextHolder] = useMessage();
|
||||
const dateFormat = 'YYYY-MM-DD';
|
||||
const [page, setPage] = useState(1) //分页
|
||||
const [total, setTotal] = useState(0) // 总条数
|
||||
@ -36,30 +37,70 @@ export default function TradingGoods() {
|
||||
const [data, setData] = useState<any[]>([]); // 表格数据
|
||||
|
||||
const getDataList = async (page: number) => {
|
||||
setLoading(true)
|
||||
const res: any = await getBuyOrderList({
|
||||
page: page,
|
||||
rows: 10,
|
||||
try {
|
||||
setLoading(true)
|
||||
const res: any = await getBuyOrderList({
|
||||
page: page,
|
||||
rows: 10,
|
||||
keywords: tradingKeywords ? tradingKeywords : '', // 关键字
|
||||
startTime: tradingStartTime ? dayjs(tradingStartTime).format(dateFormat) : '', // 开始时间
|
||||
endTime: tradingEndTime ? dayjs(tradingEndTime).format(dateFormat) : '', // 结束时间
|
||||
orderStatus: tradingStatus ? tradingStatus : '' // 订单状态
|
||||
|
||||
})
|
||||
setLoading(false)
|
||||
// console.log(res.rows);
|
||||
setData(res.rows)
|
||||
// console.log(res.rows[0].goodsDTO.goodsName)
|
||||
setPage(res.page)
|
||||
setTotal(res.total)
|
||||
} catch (error: any) {
|
||||
// setLoading(false)
|
||||
if (error.response) {
|
||||
const data = error.response.data;
|
||||
messageApi.open({
|
||||
type: 'error',
|
||||
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||
});
|
||||
} else {
|
||||
console.error(error)
|
||||
}
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
|
||||
})
|
||||
setLoading(false)
|
||||
// console.log(res.rows);
|
||||
setData(res.rows)
|
||||
// console.log(res.rows[0].goodsDTO.goodsName)
|
||||
setPage(res.page)
|
||||
setTotal(res.total)
|
||||
|
||||
}
|
||||
useEffect(() => {
|
||||
console.log('tradingKeywords', tradingKeywords);
|
||||
console.log('tradingStartTime', tradingStartTime);
|
||||
console.log('tradingEndTime', tradingEndTime);
|
||||
console.log('tradingStatus', tradingStatus);
|
||||
// 确认支付
|
||||
const confirmPaymentFun = async (orderId: string) => {
|
||||
try {
|
||||
|
||||
const res: any = await confirmPayment(orderId)
|
||||
console.log(res);
|
||||
|
||||
if (tradingStartTime) {
|
||||
console.log('tradingStartTime', dayjs(tradingStartTime).format(dateFormat));
|
||||
} catch (error: any) {
|
||||
|
||||
if (error.response) {
|
||||
const data = error.response.data;
|
||||
messageApi.open({
|
||||
type: 'error',
|
||||
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||
});
|
||||
} else {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
useEffect(() => {
|
||||
// console.log('tradingKeywords', tradingKeywords);
|
||||
// console.log('tradingStartTime', tradingStartTime);
|
||||
// console.log('tradingEndTime', tradingEndTime);
|
||||
// console.log('tradingStatus', tradingStatus);
|
||||
|
||||
|
||||
// if (tradingStartTime) {
|
||||
// console.log('tradingStartTime', dayjs(tradingStartTime).format(dateFormat));
|
||||
// }
|
||||
getDataList(1)
|
||||
setPage(1)
|
||||
}, [state])
|
||||
@ -73,7 +114,7 @@ export default function TradingGoods() {
|
||||
|
||||
return (
|
||||
<div className='trading-goods' style={{ height: `${height}px`, overflow: 'hidden' }}>
|
||||
{/* {contextHolder} */}
|
||||
{contextHolder}
|
||||
|
||||
<div className='trading-goods-table'>
|
||||
|
||||
@ -98,28 +139,31 @@ export default function TradingGoods() {
|
||||
render={(_text, _record, index: number) => (
|
||||
index + 1
|
||||
)} align="center" />
|
||||
<Column
|
||||
title="订单编号"
|
||||
dataIndex="orderNumber"
|
||||
align="center"
|
||||
width={210}
|
||||
fixed="left"
|
||||
/>
|
||||
|
||||
<Column
|
||||
title="软著名称"
|
||||
dataIndex="goodsDTO"
|
||||
fixed="left"
|
||||
align="center"
|
||||
width={200}
|
||||
width={300}
|
||||
render={(text) => (
|
||||
<div style={{ color: '#1B8BD2', fontSize: '16px', fontWeight: '700', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }} title={text.goodsName}>{text.goodsName}</div>
|
||||
)}
|
||||
/>
|
||||
<Column title="订单价格" dataIndex="payMoney" align="center"
|
||||
width={110}
|
||||
fixed="left"
|
||||
render={(text) => (
|
||||
<span style={{ color: '#FF5D15', fontSize: '24px', fontWeight: '700' }}>{text}</span>
|
||||
)} />
|
||||
<Column
|
||||
title="订单编号"
|
||||
dataIndex="orderNumber"
|
||||
align="center"
|
||||
width={210}
|
||||
|
||||
/>
|
||||
|
||||
<Column title="订单状态" dataIndex="orderStatus" align="center"
|
||||
width={120}
|
||||
render={(text) => (
|
||||
@ -142,11 +186,15 @@ export default function TradingGoods() {
|
||||
align="center"
|
||||
title="操作"
|
||||
fixed="right"
|
||||
width={200}
|
||||
width={400}
|
||||
|
||||
render={(_text, record: any) => (
|
||||
<Space size="middle">
|
||||
<span className='transaction-order-table-btn' onClick={() => {
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center'
|
||||
}}>
|
||||
<span className='trading-goods-table-btn' onClick={() => {
|
||||
// console.log(record.orderId);
|
||||
setOrderId(record.orderId)
|
||||
setFileModal(true)
|
||||
@ -158,7 +206,37 @@ export default function TradingGoods() {
|
||||
}}>
|
||||
订单详情
|
||||
</span>
|
||||
</Space>
|
||||
<span className='trading-goods-table-btn' onClick={() => {
|
||||
|
||||
confirmPaymentFun(record.orderId)
|
||||
}}
|
||||
style={{
|
||||
display: record.orderStatus == '1' ? 'unset' : 'none'
|
||||
}}
|
||||
>
|
||||
付款
|
||||
</span>
|
||||
<span className='trading-goods-table-btn' onClick={() => {
|
||||
|
||||
|
||||
}}
|
||||
style={{
|
||||
display: record.orderStatus == '2' ? 'unset' : 'none'
|
||||
}}
|
||||
>
|
||||
填写受让人信息
|
||||
</span>
|
||||
<span className='trading-goods-table-btn' onClick={() => {
|
||||
|
||||
|
||||
}}
|
||||
style={{
|
||||
display: record.orderStatus == '0' || record.orderStatus == '1' || record.orderStatus == '2' ? 'unset' : 'none'
|
||||
}}
|
||||
>
|
||||
取消订单
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
/>
|
||||
</Table>
|
||||
|
@ -11,4 +11,5 @@
|
||||
.trading-goods-table-btn{
|
||||
color:#888888;
|
||||
cursor: pointer;
|
||||
margin-left: 10px;
|
||||
}
|
@ -17,8 +17,10 @@ import File from '../../components/OrderDetailModal/components/File/File'
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
const { Column } = Table;
|
||||
import useMessage from "antd/es/message/useMessage";
|
||||
import OrderDetail from '../../components/OrderDetailModal/OrderDetailModal'
|
||||
export default function TransactionOrder() {
|
||||
const [messageApi, messageContext] = useMessage();
|
||||
const height = window.innerHeight - 180;
|
||||
// const [messageApi, contextHolder] = message.useMessage();
|
||||
const dateFormat = 'YYYY-MM-DD';
|
||||
@ -58,21 +60,37 @@ export default function TransactionOrder() {
|
||||
|
||||
const [data, setData] = useState<DataType[]>([]); // 表格数据
|
||||
const getDataList = async (page: number) => {
|
||||
setLoading(true)
|
||||
const res: any = await getSellOrderList({
|
||||
page: page,
|
||||
rows: 10,
|
||||
keywords: sellOrderKeywords ? sellOrderKeywords : '', // 关键字
|
||||
startTime: sellStatrtTime ? dayjs(sellStatrtTime).format(dateFormat) : '', // 开始时间
|
||||
endTime: sellEndTime ? dayjs(sellEndTime).format(dateFormat) : '', // 结束时间
|
||||
orderStatus: sellOrderStatus ? sellOrderStatus : '' // 订单状态
|
||||
})
|
||||
setLoading(false)
|
||||
// console.log(res.rows);
|
||||
setData(res.rows)
|
||||
// console.log(res.rows[0].goodsDTO.goodsName)
|
||||
setPage(res.page)
|
||||
setTotal(res.total)
|
||||
try {
|
||||
setLoading(true)
|
||||
const res: any = await getSellOrderList({
|
||||
page: page,
|
||||
rows: 10,
|
||||
keywords: sellOrderKeywords ? sellOrderKeywords : '', // 关键字
|
||||
startTime: sellStatrtTime ? dayjs(sellStatrtTime).format(dateFormat) : '', // 开始时间
|
||||
endTime: sellEndTime ? dayjs(sellEndTime).format(dateFormat) : '', // 结束时间
|
||||
orderStatus: sellOrderStatus ? sellOrderStatus : '' // 订单状态
|
||||
})
|
||||
setLoading(false)
|
||||
// console.log(res.rows);
|
||||
setData(res.rows)
|
||||
// console.log(res.rows[0].goodsDTO.goodsName)
|
||||
setPage(res.page)
|
||||
setTotal(res.total)
|
||||
} catch (error: any) {
|
||||
|
||||
if (error.response) {
|
||||
const data = error.response.data;
|
||||
messageApi.open({
|
||||
type: 'error',
|
||||
content: data.msg ? data.msg : `${data.path}(${data.status})`,
|
||||
});
|
||||
} else {
|
||||
console.error(error)
|
||||
}
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
useEffect(() => {
|
||||
@ -83,7 +101,7 @@ export default function TransactionOrder() {
|
||||
return (
|
||||
<div className='transaction-order' style={{ height: `${height}px`, overflow: 'hidden' }}>
|
||||
{/* {contextHolder} */}
|
||||
|
||||
{messageContext}
|
||||
<div className='transaction-order-table'>
|
||||
{/* 表格 */}
|
||||
{/* {data.length <= 0 ? (<div className='nodata' style={{ height: `${height - 93}px` }}>
|
||||
|
@ -16,6 +16,7 @@ export const WebSocketBaseUrl: string = 'ws://192.168.0.15:7025/copyright';
|
||||
// export const WebSocketBaseUrl: string = '/copyright';
|
||||
|
||||
export const DevUserId: string = '80d3365e-0597-4988-979e-18ef1c3ec671'; // 18634604067
|
||||
// export const DevUserId: string = 'a2ab4e3a-fd92-4723-9217-f9955ee92911';
|
||||
// export const DevUserId: string = '6fb8e783-243c-4eec-8d98-c9b1c8aeaa00'; // 15042810561 密码123456
|
||||
// export const DevUserId: string = 'c2438eb8-2685-49a9-bf02-5111a5192d96'; // 18647109157
|
||||
// export const DevUserId: string = '';
|
||||
|
Loading…
Reference in New Issue
Block a user