绑定手机号

This commit is contained in:
lyp 2025-04-18 14:41:01 +08:00
parent 95e4ad9c4c
commit 1ae1f7b1f6
14 changed files with 836 additions and 283 deletions

View File

@ -75,6 +75,13 @@ export default function AiShopDetail(props: any) {
reloadUser(messageApi, globalDispatchContext).then(() => {
messageApi.success('扣款成功');
});
setTimeout(() => {
setBuyTipsModal(false)
props.closeModal()
props.upData()
}, 1000)
// props.closeModal()
// props.upData()
} catch (error: any) {
if (error.response) {
@ -329,7 +336,7 @@ export default function AiShopDetail(props: any) {
// alert(props.orderId)
if (props.orderId) {
confirmPaymentFun(props.orderId)
} else {
createOrderFun(goodsId)

View File

@ -70,6 +70,7 @@ export default function OrderDetailModal(props: any) {
idcardType: '',//证件类型
idcard: '',//证件号码
})
// const [waitCorrectionCount, setWaitCorrectionCount] = useState(0) //待补充资料
// tab栏 标题数组
const tapTitleArray = [
{
@ -98,7 +99,13 @@ export default function OrderDetailModal(props: any) {
}
: {}
),
// (waitCorrectionCount > 0?
// {
// key: 'file',
// title: '资料补充',
// className: activeKey == 'file'? 'orderDetailTop-title tapActive borderRight' : 'orderDetailTop-title borderRight'
// }:{}
// )
{
key: 'file',
title: '资料补充',
@ -110,6 +117,7 @@ export default function OrderDetailModal(props: any) {
// className: activeKey == 'result' ? 'orderDetailTop-title tapActive borderRight' : 'orderDetailTop-title borderRight'
// },
]
const getOrderDetail = async () => {
try {
setLoading(true)
@ -128,7 +136,7 @@ export default function OrderDetailModal(props: any) {
setAuthorizeInfo({
...res.buyUserDTO
})
// setWaitCorrectionCount(res.waitCorrectionCount)
} catch (error: any) {
@ -151,8 +159,10 @@ export default function OrderDetailModal(props: any) {
<Spin tip="正在加载..." size="small" spinning={loading}>
<div style={{ width: 1200, maxHeight: `${height}px`, minHeight: "680px" }}>
{messageContext}
<div className='orderDetailTop'>
{tapTitleArray.map((item:any,index) => {
<div className='orderDetailTop'
>
{tapTitleArray.map((item: any, index) => {
return (
<div key={index} className={item.className} onClick={() => {
setActiveKey(item.key)

View File

@ -32,6 +32,7 @@ export default function File(props: any) {
} else if (props.user == 'buy') {
getBuySupplementList()
}
props.upData()
messageApi.open({
type: 'success',
content: '已提交',
@ -252,6 +253,8 @@ export default function File(props: any) {
setCorrectionId(record.correctionId)
getSupplementDetail(record.correctionId)
setIsModalVisible(true)
// 清空表单
form.resetFields();
// setCorrectionType(record.correctionType)
}}></span>

View File

@ -1,6 +1,7 @@
.orderDetailTop {
margin-top: 21px;
display: flex;
/* width: 100%; */
/* background-color: red; */
height: 45px;
border-bottom: 1px solid #EFE8E2;
@ -14,6 +15,7 @@
color: #888888;
border-left: 1px solid #EFE8E2;
border-top: 1px solid #EFE8E2;
/* border-right: 1px solid #EFE8E2; */
cursor: pointer;
}

View File

@ -288,6 +288,8 @@ export default function InvoiceList() {
} else {
console.error(error)
}
}finally {
setLoading(false);
}

View File

@ -153,7 +153,7 @@ export default function Head() {
console.log(res);
} catch (error: any) {
setPhoneLoading(false)
if (error.response) {
const data = error.response.data;
messageApi.open({
@ -165,16 +165,17 @@ export default function Head() {
}
}
}
const [phoneloading, setPhoneLoading] = useState(false)
const onFinish = async (values: any) => {
console.log('Success:', values);
// console.log('Success:', values);
try {
const res = await checkPhone(values.phone)
// console.log(res);
if (res.data == 'SUCCESS') {
setPhoneLoading(true)
submit(values.phone, values.smsCode)
setPhoneLoading(false)
} else {
messageApi.open({
type: 'error',
content: '手机号已被绑定,请更换手机号',
@ -922,7 +923,7 @@ export default function Head() {
// console.log('嘎嘎嘎哈哈', data);
setUserId(data.userId)
if (data.isUpdateWxUsernamePhone == 1) {
// if (data.isUpdateWxUsernamePhone != 1) {
// if (data.isUpdateWxUsernamePhone != 1) {
setIsUpdateWxUsernamePhone(true);
dispath({
type: 'changePhoneModal',
@ -1854,6 +1855,7 @@ export default function Head() {
</div>
</Modal> */}
{/* 绑定手机号 */}
<div style={{
display: isUpdateWxUsernamePhone ? 'block' : 'none',
position: 'fixed', // 固定定位
@ -1865,6 +1867,7 @@ export default function Head() {
zIndex: 100, // 确保在其他元素之上
}}>
<div style={{
width: '100%',
height: '100%',
@ -1873,163 +1876,166 @@ export default function Head() {
justifyContent: 'center',
alignItems: 'center',
}}>
<div className='phoneMaskBox'>
<div className='phoneBoxLeft'>
<div
style={{
marginTop: 79,
marginLeft: 43
}}
>
<img src={title} alt="" width={79} height={27} />
</div>
<div
style={{
marginTop: 16,
marginLeft: 43
}}
>
<img src={titleB} alt="" width={109} height={17} />
</div>
<div
style={{
marginTop: 10,
marginLeft: 38,
}}
>
<img src={line} alt="" width={180} height={19} />
</div>
</div>
<div className='phoneBoxRight'>
<div style={{
width: '100%',
fontSize: 20,
display: 'flex',
justifyContent: 'flex-end',
// height: 21,
// background: 'pink'
}}>
<div style={{ cursor: 'pointer' }} onClick={() => {
setIsUpdateWxUsernamePhone(false);
dispath({
type: 'changePhoneModal',
val: false
})
getUserData()
}}>
<CloseOutlined />
<Spin tip="正在绑定..." spinning={phoneloading} >
<div className='phoneMaskBox'>
<div className='phoneBoxLeft'>
<div
style={{
marginTop: 79,
marginLeft: 43
}}
>
<img src={title} alt="" width={79} height={27} />
</div>
<div
style={{
marginTop: 16,
marginLeft: 43
}}
>
<img src={titleB} alt="" width={109} height={17} />
</div>
<div
style={{
marginTop: 10,
marginLeft: 38,
}}
>
<img src={line} alt="" width={180} height={19} />
</div>
</div>
<div style={{
// background:'pink',
width: '100%',
height: '100%',
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center'
}}>
<div className='phoneTitle'></div>
<div className='phoneTitleB'></div>
<div className='phoneBoxRight'>
<div style={{
marginTop: 30
width: '100%',
fontSize: 20,
display: 'flex',
justifyContent: 'flex-end',
// height: 21,
// background: 'pink'
}}>
<Form name="Form"
form={form}
onFinish={onFinish}
initialValues={{ softWare: '' }}
// style={{ maxWidth: 600 }}
>
<div className='phoneBoxInput'>
<div style={{ cursor: 'pointer' }} onClick={() => {
setIsUpdateWxUsernamePhone(false);
dispath({
type: 'changePhoneModal',
val: false
})
getUserData()
}}>
<CloseOutlined />
</div>
<Form.Item name="phone" label="" rules={[{ required: true, message: '请输入手机号' },
{
pattern: /^1[3-9]\d{9}$/,
message: '请输入有效的手机号'
}
]}>
<Input style={{
width: '300px',
height: '42px',
fontSize: 16,
background: '#F7F7F7',
}} placeholder="请输入手机号" />
</Form.Item>
</div>
<div className='phoneBoxInput' style={{
}}>
<Form.Item name="smsCode" label="" rules={[{ required: true, message: '请输入验证码' }]}>
<Input style={{
width: '200px',
height: '42px',
fontSize: 16,
background: '#F7F7F7',
}} placeholder="请输入验证码" />
</Form.Item>
{countdown === 0 ? (
<div
className='sendCode'
// style={{
// width: '90px',
// height: '42px',
// justifyContent: 'center',
// alignItems: 'center',
// display: 'flex',
// cursor: 'pointer',
// color: '#929292',
// paddingRight: 10,
// }}
onClick={sendCode}
>
</div>
) : (
<div
className='sendCode'
style={{
cursor: 'unset',
}}
>
{countdown}
</div>
)}
</div>
<div>
<Form.Item>
<Button style={{
width: 300,
height: 42,
background: '#3B2C0D',
color: '#fff',
fontSize: 16,
borderRadius: 10,
marginTop: 20,
}}
type="primary" htmlType="submit"
>
</Button>
</Form.Item>
</div>
</Form>
</div>
<div className='closeTitle' onClick={() => {
setIsUpdateWxUsernamePhone(false);
dispath({
type: 'changePhoneModal',
val: false
})
getUserData()
}}></div>
<div style={{
// background:'pink',
width: '100%',
height: '100%',
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center'
}}>
<div className='phoneTitle'></div>
<div className='phoneTitleB'></div>
<div style={{
marginTop: 30
}}>
<Form name="Form"
form={form}
onFinish={onFinish}
initialValues={{ softWare: '' }}
// style={{ maxWidth: 600 }}
>
<div className='phoneBoxInput'>
<Form.Item name="phone" label="" rules={[{ required: true, message: '请输入手机号' },
{
pattern: /^1[3-9]\d{9}$/,
message: '请输入有效的手机号'
}
]}>
<Input style={{
width: '300px',
height: '42px',
fontSize: 16,
background: '#F7F7F7',
}} placeholder="请输入手机号" />
</Form.Item>
</div>
<div className='phoneBoxInput' style={{
}}>
<Form.Item name="smsCode" label="" rules={[{ required: true, message: '请输入验证码' }]}>
<Input style={{
width: '200px',
height: '42px',
fontSize: 16,
background: '#F7F7F7',
}} placeholder="请输入验证码" />
</Form.Item>
{countdown === 0 ? (
<div
className='sendCode'
// style={{
// width: '90px',
// height: '42px',
// justifyContent: 'center',
// alignItems: 'center',
// display: 'flex',
// cursor: 'pointer',
// color: '#929292',
// paddingRight: 10,
// }}
onClick={sendCode}
>
</div>
) : (
<div
className='sendCode'
style={{
cursor: 'unset',
}}
>
{countdown}
</div>
)}
</div>
<div>
<Form.Item>
<Button style={{
width: 300,
height: 42,
background: '#3B2C0D',
color: '#fff',
fontSize: 16,
borderRadius: 10,
marginTop: 20,
}}
type="primary" htmlType="submit"
disabled={phoneloading}
>
{phoneloading? '正在绑定...' : '绑定'}
</Button>
</Form.Item>
</div>
</Form>
</div>
<div className='closeTitle' onClick={() => {
setIsUpdateWxUsernamePhone(false);
dispath({
type: 'changePhoneModal',
val: false
})
getUserData()
}}></div>
</div>
</div>
</div>
</div>
</Spin>
</div>
</div>

View File

@ -30,6 +30,7 @@ export const cancelInvoice = (invoiceRechargeId: string) => request.put(`/operat
export const getInvoiceInfoByinvoiceRechargeId = (invoiceRechargeId: string) => request.get(`/operator-plugin/api/invoicerecharge/get/${invoiceRechargeId}`)
// 修改开票信息
export const updateInvoiceInfoByinvoiceRechargeId = (invoiceRechargeId: string, params: any) => request.put(`/operator-plugin/api/invoicerecharge/update/${invoiceRechargeId}`, params)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@ -92,6 +93,10 @@ export const confirmPayment = (orderId: string) => aiShopRequest.put(`/aishop/ap
export const getFileTypeByIds = (params:any) => aiShopRequest.get(`/aishop/api/file/list`, { params })
// 补充资料
export const supplementData = (params:any) => aiShopRequest.post(`/aishop/api/correction/save`, params)
// 取消订单
export const cancelOrder = (orderId: string) => aiShopRequest.put(`/aishop/api/order/save-cancel/${orderId}`)
// 填写过户人信息
export const fillInputInfo = (orderId: string, params:any) => aiShopRequest.post(`/aishop/api/order/save-input/${orderId}`, params)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -26,8 +26,9 @@ request.interceptors.request.use(
const token = sessionStorage.getItem('token')
config.headers = config.headers || {}
config.headers['Auth'] = token ? `Bearer ${token}` : '';
config.headers['Content-Type'] = 'application/json';
// config.headers['Content-Type'] = 'application/json';
// config.data = { unused: 0 }
if (config.method === 'get' ) {
if (!config.data) {
config.data = { unused: 0 }
@ -75,7 +76,7 @@ aiShopRequest.interceptors.request.use(
config.headers = config.headers || {}
config.headers['Auth'] = token ? `Bearer ${token}` : '';
config.headers['Content-Type'] = 'application/json';
// config.headers['Content-Type'] = 'application/json';
// config.data = { unused: 0 }
if (config.method === 'get' ) {
if (!config.data) {
@ -122,7 +123,7 @@ phoneRequest.interceptors.request.use(
const token = sessionStorage.getItem('token')
config.headers = config.headers || {}
config.headers['Auth'] = token ? `Bearer ${token}` : '';
config.headers['Content-Type'] = 'application/json';
// config.headers['Content-Type'] = 'application/json';
// config.data = { unused: 0 }
if (config.method === 'get' ) {
if (!config.data) {

View File

@ -16,9 +16,11 @@ import {
import AiShopDetail from '../../components/AiShopDetail/AiShopDetail'
import { useLocation } from 'react-router-dom';
import dayjs, { } from 'dayjs';
import { buyGoodsList,
import {
buyGoodsList,
// goodsDetail,
createOrder, confirmPayment } from '../../request/api'
// createOrder, confirmPayment
} from '../../request/api'
// import type { InputNumberProps } from 'antd';
// import type { TableColumnsType } from 'antd';
// import { SearchOutlined, ClearOutlined } from '@ant-design/icons';
@ -33,7 +35,7 @@ export default function CopyrightGgoods() {
const height = window.innerHeight - 180;
const [goodsId, setGoodsId] = useState<any>() //商品ID
const [goodsDetailModal, setGoodsDetailModal] = useState(false) //订单详情
const [buyTipsModal, setBuyTipsModal] = useState(false) //卖提示框
// const [buyTipsModal, setBuyTipsModal] = useState(false) //卖提示框
// const [messageApi, contextHolder] = message.useMessage();
// const dateFormat = 'YYYY-MM-DD';
@ -59,46 +61,46 @@ export default function CopyrightGgoods() {
const [data, setData] = useState([]); // 表格数据
// 确认支付
const confirmPaymentFun = async (orderId: string) => {
try {
// setLoading(true)
const res: any = await confirmPayment(orderId)
console.log(res);
// setLoading(false)
} catch (error: any) {
// const confirmPaymentFun = async (orderId: string) => {
// try {
// // setLoading(true)
// const res: any = await confirmPayment(orderId)
// console.log(res);
// // setLoading(false)
// } 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)
}
}
}
// 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)
// const createOrderFun = async (goodsId: string) => {
// try {
// // setPayLoading(true)
// const res: any = await createOrder(goodsId)
// // console.log(res);
// confirmPaymentFun(res.data)
} catch (error: any) {
// } 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)
}
}
}
// 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 getBuyGoodsList = async (page: number) => {
try {
@ -176,7 +178,7 @@ export default function CopyrightGgoods() {
}, [state])
useEffect(() => {
getBuyGoodsList(page)
},[page])
}, [page])
return (
@ -207,7 +209,7 @@ export default function CopyrightGgoods() {
<Column
width={70}
title="序号" render={(_text, _record, index: number) => (
index + 1
(page - 1) * 10 + index + 1
)} align="center" />
<Column
title="软著名称"
@ -456,11 +458,15 @@ export default function CopyrightGgoods() {
</Spin> */}
<AiShopDetail goodsId={goodsId} closeModal={() => {
setGoodsDetailModal(false)
}}></AiShopDetail>
}}
upData={() => {
getBuyGoodsList(page)
}}
></AiShopDetail>
</Modal>
<Modal
{/* <Modal
title="提示"
okText="确认"
cancelText="取消"
@ -477,7 +483,7 @@ export default function CopyrightGgoods() {
centered
>
</Modal>
</Modal> */}
</div>

View File

@ -24,6 +24,8 @@ import { useLocation } from 'react-router-dom';
import React, { useState, useEffect } from 'react';
import dayjs, { } from 'dayjs';
export default function ProductRelease() {
const [reasonModalOpen, setReasonModalOpen] = useState(false) // 未通过原因弹窗
const [goodsCheckRemark, setGoodsCheckRemark] = useState('') // 未通过原因
const [messageApi, messageContext] = useMessage();
const { state } = useLocation()
// const dateFormat = 'YYYY年MM月DD日';
@ -42,7 +44,7 @@ export default function ProductRelease() {
// if (sellDate) {
// console.log('sellDate', dayjs(sellDate).year());
// }
setPage(1)
getGoodsDate(1)
}, [state])
@ -61,7 +63,7 @@ export default function ProductRelease() {
const [offModalOpen, setOffModalOpen] = useState(false) // 控制下架弹窗
const [id, setId] = useState<any>('') // 编辑id
const [loading, setLoading] = useState(false) // 加载
const [data, setData] = useState<any>([])
// 点击编辑
@ -73,12 +75,12 @@ export default function ProductRelease() {
// 删除id
const [delId, setDelId] = useState('')
// 删除商品名字
const [delName, setDelName] = useState('')
// const [delName, setDelName] = useState('')
// 点击删除
const del = (item: any) => {
// console.log(item.order);
setDelId(item.goodsId)
setDelName(item.goodsName)
// setDelName(item.goodsName)
setDelModalOpen(true)
};
// 点击确定删除
@ -243,7 +245,7 @@ export default function ProductRelease() {
}
}
const getGoodsDate = async (page: number) => {
try {
@ -399,14 +401,14 @@ export default function ProductRelease() {
</td>
</tr>
<tr style={{ textAlign: 'center', height: 110, maxWidth: 110 }}>
<td>{index + 1}</td>
<td>{(page - 1) * 10 + index + 1}</td>
<td className='product-release-table-img-td'>
<div className='product-release-table-img'>
<Image src={showImage(item.goodsPhoto, false)} height={90} preview={{
mask: '查看', // 设置点击放大时显示的文字
}}
style={{ maxWidth: '100%' }}
style={{ maxWidth: '100%' }}
></Image>
</div>
</td>
@ -434,7 +436,22 @@ export default function ProductRelease() {
fontWeight: 'bold',
}}>
{item.goodsCheckStatus == '0' ?
<span style={{ color: 'red' }}> </span>
<div>
<div style={{
color: 'red',
cursor: 'pointer',
}}
title='点击查看未通过原因'
onClick={() => {
setGoodsCheckRemark(item.goodsCheckRemark)
setReasonModalOpen(true)
}}
> </div>
<div style={{
fontSize: 12
}}>()</div>
</div>
: item.goodsCheckStatus == '1' ?
<span style={{ color: 'skyBlue' }}> </span>
: item.goodsCheckStatus == '2' ?
@ -444,9 +461,13 @@ export default function ProductRelease() {
width: 250,
}}>
<div>
<span className='product-release-table-btn' onClick={() => {
edit(item)
}}></span>
<span className='product-release-table-btn'
style={{
display: item.goodsStatus == '1' ? 'none' : 'unset'
}}
onClick={() => {
edit(item)
}}></span>
<span className='product-release-table-btn product-btn' style={{
display: item.goodsCheckStatus == '1' || item.goodsCheckStatus == '2' ? 'none' : 'unset'
}} onClick={() => submit(item)}></span>
@ -460,9 +481,14 @@ export default function ProductRelease() {
}} onClick={() => sell(item)}></span>
<span className='product-release-table-btn product-btn '
style={{
display: item.goodsStatus == '0' ? 'none' : 'unset'
display: item.goodsStatus == '0' || item.goodsOrderStatus == '1' ? 'none' : 'unset'
}}
onClick={() => off(item)}></span>
<span style={{
display: item.goodsOrderStatus == '1'? 'unset' : 'none',
}}>
...
</span>
</div>
</td>
</tr>
@ -539,7 +565,9 @@ export default function ProductRelease() {
width: 700,
marginTop: 20
}}>
{delName}
{/* {delName} */}
</div>
</Modal>
{/* 出售弹窗 */}
@ -622,6 +650,35 @@ export default function ProductRelease() {
{submitName}?
</div>
</Modal>
<Modal title="未通过原因"
okText="确认"
cancelText="取消"
destroyOnClose={true}
open={reasonModalOpen}
onOk={() => {
// submitAuditOk()
}}
footer={null}
onCancel={() => {
setReasonModalOpen(false)
}}
// okButtonProps={{ style: { background: 'red', color: 'white' } }}
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
height: `${height}px`,
}}>
<div style={{
width: 700,
// marginTop: 20
padding: '20px 0px',
}}>
{goodsCheckRemark}
</div>
</Modal>
</div>
)
}

View File

@ -871,6 +871,8 @@ export default function EditModal(props: any) {
onClick={() => {
logoImgArray.splice(0);
setLogoImgArray([...logoImgArray]);
// 将表单imageUrl值清空
form.setFieldsValue({ imageUrl: '' });
}}
>
@ -1339,11 +1341,11 @@ export default function EditModal(props: any) {
htmlType="submit"
// style={{ width: '262px', height: '58px', fontSize: '16px', color: '#FDFDF2', backgroundColor: 'var(--color-primary)' }}
size='large'
onClick={() => {
console.log(form.getFieldValue('imageUrl'));
console.log(logoImgArray);
// onClick={() => {
// console.log(form.getFieldValue('imageUrl'));
// console.log(logoImgArray);
}}
// }}
>
{/* {props.id?'保存':'提交'} */}

View File

@ -5,22 +5,121 @@ import {
// message,
Pagination,
Modal,
Spin
Spin,
Form,
Col, Row,
Select,
Input,
Cascader,
// Flex,
Button
} from 'antd';
import AiShopDetail from '../../components/AiShopDetail/AiShopDetail'
import { GlobalDispatchContext, reloadUser } from "../../context/GlobalContext.ts";
// import type { TableColumnsType } from 'antd';
// 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 { useState, useEffect } from 'react';
import { getBuyOrderList, getProvinceList, getCityList, getCertificateTypeList, cancelOrder, fillInputInfo } from '../../request/api'
import { useState, useEffect, useContext } 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';
interface Option {
value?: string | number | null;
label: React.ReactNode;
children?: Option[];
isLeaf?: boolean;
// id: string;
// pId: string;
}
export default function TradingGoods() {
const globalDispatchContext = useContext(GlobalDispatchContext);
const [areaArray, setAreaArray] = useState<Option[]>([]);
const getProvinceListDate = async () => {
try {
const res: any = await getProvinceList()
// console.log('省', res);
const provinces = res.map((province: any) => ({
value: province.areaId,
label: province.areaName,
isLeaf: false,
// id: province.areaId,
children: [], // 初始化 children 属性为空数组
}));
setAreaArray(provinces);
} 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)
}
}
}
// 加载城市列表
const loadCityList = async (selectedOptions: Option[]) => {
const targetOption = selectedOptions[selectedOptions.length - 1];
// console.log('targetOption', targetOption.children);
try {
const res: any = await getCityList(targetOption.value as string);
// console.log('城市列表', res);
const cities = res.map((city: any) => ({
value: city.areaId,
label: city.areaName,
}));
targetOption.children = cities;
// 更新 areaArray 状态
setAreaArray([...areaArray]);
} 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)
}
}
};
const [certificateTypeList, setCertificateTypeList] = useState<any>([]) // 证书类型列表
const getCertificateTypeListDate = async () => {
try {
const res: any = await getCertificateTypeList()
setCertificateTypeList(res.map((item: any) => {
return {
value: item.dataId,
label: item.dataName,
}
}))
} 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)
}
}
}
const [form] = Form.useForm();
const height = window.innerHeight - 180;
const [messageApi, contextHolder] = useMessage();
const dateFormat = 'YYYY-MM-DD';
@ -38,6 +137,7 @@ export default function TradingGoods() {
const [loading, setLoading] = useState(false) // 加载中
const [fileModal, setFileModal] = useState(false) //补充资料弹窗
const [data, setData] = useState<any[]>([]); // 表格数据
const [buyInfoModal, setBuyInfoModal] = useState(false) // 填写购买人信息弹窗
const getDataList = async (page: number) => {
try {
@ -113,7 +213,10 @@ export default function TradingGoods() {
// 获取数据
}, [page])
useEffect(() => {
getProvinceListDate()
getCertificateTypeListDate()
}, [])
return (
<div className='trading-goods' style={{ height: `${height}px`, overflow: 'hidden' }}>
@ -140,7 +243,7 @@ export default function TradingGoods() {
fixed="left"
width={70}
render={(_text, _record, index: number) => (
index + 1
(page - 1) * 10 + index + 1
)} align="center" />
<Column
@ -155,7 +258,7 @@ export default function TradingGoods() {
/>
<Column title="订单价格" dataIndex="payMoney" align="center"
width={110}
// fixed="left"
// fixed="left"
render={(text) => (
<span style={{ color: '#FF5D15', fontSize: '24px', fontWeight: '700' }}>{text}</span>
)} />
@ -175,7 +278,7 @@ export default function TradingGoods() {
}}>
<span style={{ display: text == '0' ? 'unset' : 'none' }}></span>
<span style={{ display: text == '1' ? 'unset' : 'none' }}></span>
<span style={{ display: text == '2' ? 'unset' : 'none' ,color:'red'}}></span>
<span style={{ display: text == '2' ? 'unset' : 'none', color: 'red' }}></span>
<span style={{ display: text == '3' ? 'unset' : 'none' }}></span>
<span style={{ display: text == '4' ? 'unset' : 'none' }}></span>
<span style={{ display: text == '5' ? 'unset' : 'none' }}></span>
@ -183,33 +286,65 @@ export default function TradingGoods() {
</div>
)} />
<Column title="下单时间" dataIndex="createTime" align="center" width={160} />
<Column title="付款时间" dataIndex="payTime" align="center" width={160} />
<Column title="付款时间" dataIndex="payTime" align="center" width={160}
render={(text) => (
<>{text ? text : '未付款'}</>
)}
/>
{/* <Column title="实名认证状态" dataIndex="address" key="key" /> */}
<Column
align="center"
title="操作"
fixed="right"
width={400}
width={350}
// maxWidth={350}
render={(_text, record: any) => (
<div style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center'
alignItems: 'center',
// maxWidth: '400px',
// textWrap: 'nowrap',
// background:'pink'
}}>
<span className='trading-goods-table-btn' onClick={() => {
// console.log(record.orderId);
setOrderId(record.orderId)
setFileModal(true)
}}></span>
<span className='trading-goods-table-btn' onClick={() => {
<div className='trading-goods-table-btn'
style={{
// background: 'pink',
display: record.waitCorrectionCount > 0 ? 'unset' : 'none',
position: 'relative',
// color: 'black'
}}
onClick={() => {
// console.log(record.orderId);
setOrderId(record.orderId)
setFileModal(true)
}}>
<div style={{
position: 'absolute',
top: '-10px',
right: '-10px',
// fontSize:'16px',
background: 'red',
color: '#fff',
fontWeight: '700',
width: '20px',
height: '20px',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}>
{record.waitCorrectionCount}
</div>
</div>
<div className='trading-goods-table-btn' onClick={() => {
// console.log(record.orderId);
setOrderId(record.orderId)
setOrderDetailModal(true)
}}>
</span>
<span className='trading-goods-table-btn' onClick={() => {
</div>
<div className='trading-goods-table-btn' onClick={() => {
// confirmPaymentFun(record.orderId)
// alert(record.goodsId)
@ -222,9 +357,10 @@ export default function TradingGoods() {
}}
>
</span>
<span className='trading-goods-table-btn' onClick={() => {
</div>
<div className='trading-goods-table-btn' onClick={() => {
setBuyInfoModal(true)
setOrderId(record.orderId)
}}
style={{
@ -232,17 +368,48 @@ export default function TradingGoods() {
}}
>
</span>
<span className='trading-goods-table-btn' onClick={() => {
</div>
<div className='trading-goods-table-btn' onClick={() => {
// 取消订单提示弹窗
Modal.confirm({
title: '取消订单',
content: '是否确认取消订单?',
okText: '确定',
cancelText: '取消',
centered: true,
onOk: async () => {
try {
await cancelOrder(record.orderId)
// messageApi.open({
// type: 'success',
// content: '取消订单成功',
// })
reloadUser(messageApi, globalDispatchContext).then(() => {
messageApi.success('取消订单成功');
});
getDataList(page)
} 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)
}
}
}
})
}}
style={{
display: record.orderStatus == '1' || record.orderStatus == '2' ? 'unset' : 'none'
}}
>
</span>
</div>
</div>
)}
/>
@ -300,29 +467,269 @@ export default function TradingGoods() {
width={1150}
centered
>
<File user={'buy'} orderId={orderId}></File>
<File
// closeModal={() => {
// setFileModal(false)
// }}
upData={() => {
getDataList(page)
}}
user={'buy'} orderId={orderId}></File>
</Modal>
<Modal
title="著作权商品信息"
okText="确认"
cancelText="取消"
destroyOnClose={true}
footer={null}
open={aiShopDetailModal}
// onOk={() => {
// setOrderDetailModal(false)
<Modal
title="著作权商品信息"
okText="确认"
cancelText="取消"
destroyOnClose={true}
footer={null}
open={aiShopDetailModal}
// onOk={() => {
// setOrderDetailModal(false)
// }}
onCancel={() => {
setAiShopDetailModal(false)
}}
width={1200}
centered
>
<AiShopDetail goodsId={goodsId} orderId={orderId} closeModal={() => {
setAiShopDetailModal(false)
}}
upData={() => {
getDataList(page)
}}
></AiShopDetail>
</Modal>
<Modal
title="填写受让人信息"
okText="确认"
cancelText="取消"
destroyOnClose={true}
footer={null}
open={buyInfoModal}
// onOk={() => {
// setOrderDetailModal(false)
// }}
onCancel={() => {
setBuyInfoModal(false)
}}
width={700}
centered
>
<Form
name="basic"
form={form}
layout="vertical"
labelCol={{ span: 8 }}
wrapperCol={{ span: 24 }}
onFinish={async (values) => {
try {
await fillInputInfo(orderId, {
buyCity: values.buyCity.join(','),
buyIdcard: values.buyIdcard,
buyIdcardType: values.buyIdcardType,
buyName: values.buyName,
buyPhone: values.buyPhone,
buyType: values.buyType,
})
messageApi.open({
type: 'success',
content: '填写信息成功',
})
setTimeout(() => {
setBuyInfoModal(false)
getDataList(page)
}, 500);
} 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)
}
}
// console.log('Success:', values);
}}
onFinishFailed={() => {
messageApi.open({
type: 'error',
content: '请完善信息',
})
}}
>
<Row gutter={15}>
<Col span={12}>
<Form.Item
label="类别"
name="buyType"
rules={[{ required: true, message: '请选择类别' }]}
>
<Select
allowClear
// defaultValue="lucy"
placeholder='请选择类别'
style={{ height: 40 }}
options={[
{ value: '1', label: '自然人' },
{ value: '2', label: '法人' },
{ value: '3', label: '非法人组织或其他' },
]}
/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="姓名或名称"
name="buyName"
rules={[{ required: true, message: '请输入姓名或名称' }]}
>
<Input
allowClear
style={{ height: '40px', }} placeholder="请输入姓名或名称"
/>
</Form.Item>
</Col>
</Row>
<Row gutter={15}>
<Col span={12}>
<div style={{
display: 'flex',
}}>
<Form.Item
label="省市"
name="buyCity"
rules={[{ required: true, message: '请选择省市' }]}
>
<Cascader options={areaArray}
allowClear
style={{ height: '40px', width: 318 }}
// loadData={(selectedOptions: Option[]) => {
// const targetOption = selectedOptions[selectedOptions.length - 1];
// // console.log('111', targetOption);
// listArea(targetOption.id).then(data => {
// targetOption.children = data.map(item => {
// return {
// value: item.name,
// label: item.name,
// isLeaf: true, //二级判断这个 以前不是 以前是 !item.isParent
// id: item.id,
// pId: item.pId
// }
// });
// setAreaArray([
// ...areaArray
// ])
// });
// }}
loadData={loadCityList}
placeholder="请选择省市"
changeOnSelect
/>
</Form.Item>
</div>
</Col>
<Col span={12}>
<Form.Item
label="联系电话"
name="buyPhone"
rules={[{ required: true, message: '请输入联系电话' }]}
>
<Input
allowClear
style={{ height: '40px', }} placeholder="请输入联系电话"
/>
</Form.Item>
</Col>
</Row>
<Row gutter={15}>
<Col span={12}>
<Form.Item
label="证件类型"
name="buyIdcardType"
rules={[{ required: true, message: '请选择证件类型' }]}
>
<Select
allowClear
// defaultValue="lucy"
placeholder='请选择证件类型'
style={{ height: 40 }}
options={certificateTypeList}
/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="证件号"
name="buyIdcard"
rules={[{ required: true, message: '请输入证件号' }]}
>
<Input
allowClear
style={{ height: '40px', }} placeholder="请输入证件号"
/>
</Form.Item>
</Col>
</Row>
<div style={{
display: 'flex',
justifyContent: 'flex-end',
alignItems: 'center',
gap: '10px'
}}>
<Form.Item wrapperCol={{ span: 24 }}>
{/* <Flex align="center" justify="center" gap="large"> */}
<Button type="default" htmlType="button"
// style={{ width: '262px', height: '58px', fontSize: '16px', color: '#4B4B4B', background: '#EEEEEE' }}
// size='large'
style={{
marginRight: '10px'
}}
onClick={() => {
// props.closeModal()
}}>
</Button>
<Button type="primary"
htmlType="submit"
// style={{ width: '262px', height: '58px', fontSize: '16px', color: '#FDFDF2', backgroundColor: 'var(--color-primary)' }}
// size='large'
// onClick={() => {
// console.log(form.getFieldValue('imageUrl'));
// console.log(logoImgArray);
// }}
onCancel={() => {
setAiShopDetailModal(false)
}}
width={1200}
centered
>
<AiShopDetail goodsId={goodsId} orderId={orderId} closeModal={() => {
setAiShopDetailModal(false)
}}></AiShopDetail>
</Modal>
>
{/* {props.id?'保存':'提交'} */}
</Button>
{/* </Flex> */}
</Form.Item>
</div>
</Form>
</Modal>
</div>
)
}

View File

@ -4,7 +4,8 @@ import {
// Select, DatePicker, Button,
Table,
// message,
Space, Pagination, Modal,
// Space,
Pagination, Modal,
Spin
} from 'antd';
import dayjs, { } from 'dayjs';
@ -19,6 +20,7 @@ import { useLocation } from 'react-router-dom';
const { Column } = Table;
import useMessage from "antd/es/message/useMessage";
import OrderDetail from '../../components/OrderDetailModal/OrderDetailModal'
// import { styleText } from 'util';
export default function TransactionOrder() {
const [messageApi, messageContext] = useMessage();
const height = window.innerHeight - 180;
@ -131,7 +133,7 @@ export default function TransactionOrder() {
fixed="left"
width={70}
render={(_text, _record, index: number) => (
index + 1
(page - 1) * 10 + index + 1
)} align="center" />
<Column
title="订单编号"
@ -171,7 +173,11 @@ export default function TransactionOrder() {
</div>
)} />
<Column title="下单时间" dataIndex="createTime" align="center" width={160} />
<Column title="付款时间" dataIndex="payTime" align="center" width={160} />
<Column title="付款时间" dataIndex="payTime" align="center" width={160}
render={(text) => (
<>{text?text:'未付款'}</>
)}
/>
{/* <Column title="实名认证状态" dataIndex="address" key="key" /> */}
<Column
align="center"
@ -180,20 +186,51 @@ export default function TransactionOrder() {
width={200}
render={(_text, record: any) => (
<Space size="middle">
<span className='transaction-order-table-btn' onClick={() => {
// console.log(record.orderId);
setOrderId(record.orderId)
setFileModal(true)
}}></span>
<span className='trading-goods-table-btn' onClick={() => {
<div style={{
display: 'flex',
justifyContent: 'center',
// alignItems: 'center',
// height: '100%',
}}>
<div className='transaction-order-table-btn'
style={{
// background: 'pink',
display: record.waitCorrectionCount > 0 ? 'unset' : 'none',
position: 'relative',
// color: 'black'
}}
onClick={() => {
// console.log(record.orderId);
setOrderId(record.orderId)
setFileModal(true)
}}>
<div style={{
position: 'absolute',
top: '-10px',
right: '-10px',
// fontSize:'16px',
background: 'red',
color: '#fff',
fontWeight: '700',
width: '20px',
height: '20px',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}>
{record.waitCorrectionCount}
</div>
</div>
<div className='trading-goods-table-btn' onClick={() => {
// console.log(record.orderId);
setOrderId(record.orderId)
setOrderDetailModal(true)
}}>
</span>
</Space>
</div>
</div>
)}
/>
</Table>
@ -255,7 +292,14 @@ export default function TransactionOrder() {
width={1150}
centered
>
<File user={'sell'} orderId={orderId}></File>
<File user={'sell'}
// closeModal={()=>{
// setFileModal(false)
// }}
upData={() => {
getDataList(page)
}}
orderId={orderId}></File>
</Modal>
</div>
)

View File

@ -8,8 +8,9 @@ export const baseUrl = `http://${host}`;
export const copyBaseUrl = `${baseUrl}:7025`;
export const operatorBaseUrl = `${baseUrl}:8091`
export const operatorPluginBaseUrl = `${baseUrl}:8099`;
export const aiShopBaseUrl = `http://192.168.0.115:8099`;
export const aiShopBaseUrl = `http://192.168.0.115:8081`;
export const WebSocketBaseUrl: string = `ws://${host}:7025/copyright`;
// ---- prod
// export const baseUrl = `https://www.aimzhu.com`;
// export const copyBaseUrl = `${baseUrl}`;