Commit 69dc9e2f authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

refactor: 修改src下剩余publicApi引入方式

parent 62dcf837
......@@ -10,10 +10,10 @@ import 'antd/dist/antd.less'
import { isDev } from '@/constants'
import { setup } from '@formily/antd-components';
import { getRouters, getAuth, asyncRouter, setAuth, setRouters, removeAuth, removeRouters } from './utils/auth';
import { PublicApi } from './services/api';
// 全局注册虚拟组件
import '@/components/NiceForm/public'
import LRU from '@/utils/lru';
import { getMemberLoginReget } from './services/MemberV2Api';
const recent = new LRU(6);
recent.init();
......@@ -66,7 +66,7 @@ export function patchRoutes({ routes }: IRoutes) {
}
const authInfo = getAuth()
if (authInfo) {
PublicApi.getMemberLoginReget({}, { useCache: true, ttl: 1000 }).then(res => {
getMemberLoginReget({}, { useCache: true, ttl: 1000 }).then(res => {
const { data, code } = res
if (code === 1000) {
asyncRouter(data.urls, routes)
......@@ -91,7 +91,7 @@ export function render(oldRender: Function) {
}
const authInfo = getAuth()
if (authInfo) {
PublicApi.getMemberLoginReget({}, { useCache: true, ttl: 1000 }).then(res => {
getMemberLoginReget({}, { useCache: true, ttl: 1000 }).then(res => {
const { data, code } = res
if (code === 1000) {
setAuth(data as any)
......
......@@ -8,11 +8,10 @@
import React, { useState, useEffect, useMemo, useRef } from 'react';
import { Radio, Button, Modal, message, RadioChangeEvent } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api';
import { GetLogisticsShipperAddressGetResponse, GetLogisticsReceiverAddressGetResponse } from '@/services/LogisticsApi';
import { IRequestSuccess } from '@/index';
import AddressSelectContext from '@/components/AddressSelect/context';
import styles from './index.less';
import { getLogisticsReceiverAddressGet, GetLogisticsReceiverAddressGetResponse, getLogisticsSelectListReceiverAddress, getLogisticsSelectListShipperAddress, getLogisticsShipperAddressGet, GetLogisticsShipperAddressGetResponse, postLogisticsReceiverAddressDelete, postLogisticsReceiverAddressUpdate, postLogisticsShipperAddressDelete, postLogisticsShipperAddressUpdate } from '@/services/LogisticsV2Api';
const { confirm } = Modal;
......@@ -100,7 +99,7 @@ const AddressRadioGroup: React.FC<IProps> = (props) => {
if (context) {
return;
}
const fetchAction = addressType === 2 ? PublicApi.getLogisticsSelectListShipperAddress() : PublicApi.getLogisticsSelectListReceiverAddress();
const fetchAction = addressType === 2 ? getLogisticsSelectListShipperAddress() : getLogisticsSelectListReceiverAddress();
fetchAction.then((res: IRequestSuccess<AddressItemType[]>) => {
if (res.code === 1000) {
......@@ -211,8 +210,8 @@ const AddressRadioGroup: React.FC<IProps> = (props) => {
onOk() {
return (
addressType === 2
? PublicApi.postLogisticsShipperAddressDelete({ id })
: PublicApi.postLogisticsReceiverAddressDelete({ id })
? postLogisticsShipperAddressDelete({ id })
: postLogisticsReceiverAddressDelete({ id })
).then((res) => {
if (res.code === 1000) {
refresh();
......@@ -232,14 +231,14 @@ const AddressRadioGroup: React.FC<IProps> = (props) => {
});
try {
const res = addressType === 2 ? await PublicApi.getLogisticsShipperAddressGet({ id: `${id}`}) : await PublicApi.getLogisticsReceiverAddressGet({ id: `${id}`});
const res = addressType === 2 ? await getLogisticsShipperAddressGet({ id: `${id}`}) : await getLogisticsReceiverAddressGet({ id: `${id}`});
if (res.code === 1000) {
const updateRes = addressType === 2
? await PublicApi.postLogisticsShipperAddressUpdate({
? await postLogisticsShipperAddressUpdate({
...(res.data as GetLogisticsShipperAddressGetResponse),
isDefault: 1,
})
: await PublicApi.postLogisticsReceiverAddressUpdate({
: await postLogisticsReceiverAddressUpdate({
...(res.data as GetLogisticsReceiverAddressGetResponse),
isDefault: 1,
});
......
......@@ -8,9 +8,9 @@
import React, { useState, useEffect } from 'react';
import { Modal, Input, Spin, Space, Button, message } from 'antd';
import classNames from 'classnames';
import { PublicApi } from '@/services/api';
import { encryptedByAES } from '@/utils/cryptoAes';
import styles from './index.less';
import { getPayAssetAccountGetUserBalance } from '@/services/PayV2Api';
interface BalancePayModalProps {
/**
......@@ -70,7 +70,7 @@ const BalancePayModal: React.FC<BalancePayModalProps> = (props: BalancePayModalP
return;
}
setLoading(true);
PublicApi.getPayAssetAccountGetUserBalance({
getPayAssetAccountGetUserBalance({
parentMemberId: `${parentMemberId}`,
parentMemberRoleId: `${parentMemberRoleId}`,
payType: `${2}`, // 会员支付
......
......@@ -4,7 +4,7 @@ import { PlusOutlined, MinusOutlined } from '@ant-design/icons'
import cx from 'classnames'
import style from './index.less';
import { isEmpty } from '@formily/antd/esm/shared'
import { PublicApi } from '@/services/api';
import { getProductPlatformGetCategoryTree } from '@/services/ProductV2Api';
const { Option } = Select;
......@@ -64,7 +64,7 @@ const CategoryCascader: React.FC<CategorySelectPropsType> = (props) => {
}
const fetchCategoryList = () => {
PublicApi.getProductPlatformGetCategoryTree().then(res => {
getProductPlatformGetCategoryTree().then(res => {
initCategoryData(res.data)
})
}
......
import React, { memo, useState, Fragment, forwardRef, useEffect } from 'react'
import { Select } from 'antd'
import { PlusOutlined, MinusOutlined } from '@ant-design/icons'
import { PublicApi } from '@/services/api'
import cx from 'classnames'
import styles from './index.less'
import { isEmpty } from '@formily/antd/esm/shared'
import { getManageAreaAll } from '@/services/ManageV2Api'
interface CitySelectPropsType {
selectData: Array<{
......@@ -55,7 +55,7 @@ const CityCascader: React.FC<CitySelectPropsType> = (props) => {
const fetchAreaList = () => {
PublicApi.getManageAreaAll().then(res => {
getManageAreaAll().then(res => {
initProvinceAndCityData(res.data)
})
}
......
import { ISchema } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getProductInvoicesTypeAll, getProductSelectGetSelectBrand, getProductSelectGetSelectCategory, getProductSelectGetSelectCustomerCategory } from '@/services/ProductV2Api';
import { getMemberManageRoleAll } from '@/services/MemberV2Api';
export const productModalByMemberSchema: ISchema = {
type: 'object',
......@@ -38,7 +39,7 @@ export const productModalByMemberSchema: ISchema = {
// let merber = sessionStorage.getItem('memberInfo');
// let meberInfo = JSON.parse(merber)
// return new Promise(resolve => {
// PublicApi.getProductSelectGetMemberCategory({ name: '', ...meberInfo}).then(res => {
// getProductSelectGetMemberCategory({ name: '', ...meberInfo}).then(res => {
// console.log(res.data, 10086)
// resolve(res)
// })
......@@ -58,7 +59,7 @@ export const productModalByMemberSchema: ISchema = {
// let merber = sessionStorage.getItem('memberInfo');
// let meberInfo = JSON.parse(merber)
// return new Promise(resolve => {
// PublicApi.getProductSelectGetMemberBrand({ name: '', ...meberInfo}).then(res => {
// getProductSelectGetMemberBrand({ name: '', ...meberInfo}).then(res => {
// console.log(res.data, 10086)
// resolve(res)
// })
......@@ -115,7 +116,7 @@ export const productModalSchema: ISchema = {
"x-component-props": {
placeholder: '请选择品类',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCategory,
fetchSearch: getProductSelectGetSelectCategory,
style: {
width: 160
}
......@@ -126,7 +127,7 @@ export const productModalSchema: ISchema = {
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品牌',
fetchSearch: PublicApi.getProductSelectGetSelectBrand,
fetchSearch: getProductSelectGetSelectBrand,
style: {
width: 160
}
......@@ -208,7 +209,7 @@ export const addOrderModalSchema: ISchema = {
// "x-component": 'SearchSelect',
// "x-component-props": {
// placeholder: '请选择品牌',
// fetchSearch: PublicApi.getProductSelectGetMemberBrand,
// fetchSearch: getProductSelectGetMemberBrand,
// style: {
// width: 160
// },
......@@ -329,7 +330,7 @@ export const goodsModalSchema: ISchema = {
"x-component": 'SearchSelect',
'x-component-props': {
placeholder: '品类',
fetchSearch: PublicApi.getProductSelectGetSelectCustomerCategory,
fetchSearch: getProductSelectGetSelectCustomerCategory,
style: {
width: 160
}
......@@ -340,7 +341,7 @@ export const goodsModalSchema: ISchema = {
"x-component": 'SearchSelect',
'x-component-props': {
placeholder: '品牌',
fetchSearch: PublicApi.getProductSelectGetSelectBrand,
fetchSearch: getProductSelectGetSelectBrand,
style: {
width: 160
}
......@@ -415,7 +416,7 @@ export const inquirySchema: ISchema = {
// "x-component-props": {
// placeholder: '报价会员(全部)',
// className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
// fetchSearch: PublicApi.getProductSelectGetSelectCategory,
// fetchSearch: getProductSelectGetSelectCategory,
// style: {
// width: 160
// }
......@@ -507,7 +508,7 @@ export const enquirySchema: ISchema = {
"x-component-props": {
placeholder: '需求会员(全部)',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCategory,
fetchSearch: getProductSelectGetSelectCategory,
style: {
width: 160
}
......@@ -568,7 +569,7 @@ export const demandSchema: ISchema = {
// "x-component-props": {
// placeholder: '报价会员(全部)',
// className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
// fetchSearch: PublicApi.getProductSelectGetSelectCategory,
// fetchSearch: getProductSelectGetSelectCategory,
// style: {
// width: 160
// }
......@@ -655,7 +656,7 @@ export const mergeOrderSchema: ISchema = {
"x-component-props": {
placeholder: '供应会员(全部)',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCategory,
fetchSearch: getProductSelectGetSelectCategory,
style: {
width: 160
}
......@@ -792,7 +793,7 @@ export const logisticsDeliverySearchSchema: ISchema = {
"x-component": 'SearchSelect',
'x-component-props': {
placeholder: '单据类型',
fetchSearch: PublicApi.getProductInvoicesTypeAll,
fetchSearch: getProductInvoicesTypeAll,
style: {
width: 160
}
......@@ -977,7 +978,7 @@ export const SelectLogisticsService: ISchema = {
placeholder: '选择会员角色',
fetchSearch: () => {
return new Promise(resolve => {
PublicApi.getMemberManageRoleAll().then(res => {
getMemberManageRoleAll().then(res => {
res.data.forEach((item:any) => {
item.id = item.roleId;
item.name = item.roleName;
......
import React, { useEffect, useState, useRef } from 'react'
import { Row, Col, Select, Form } from 'antd';
import styled from 'styled-components'
import { PublicApi } from '@/services/api';
import { getManageAreaAll, getManageAreaByPcodeAll } from '@/services/ManageV2Api';
/**
* 自定义省市区/县三级联动 地址选择
......@@ -87,7 +87,7 @@ const MultAddress = (props) => {
const getAllAreaData = () => {
return new Promise(resolve => {
PublicApi.getManageAreaAll().then(res => {
getManageAreaAll().then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......@@ -120,7 +120,7 @@ const MultAddress = (props) => {
const renderProvice = async (result, val, idx) => {
await province.forEach(item => {
if (item.code === val) {
PublicApi.getManageAreaByPcodeAll({ pcode: val }).then((res: any) => {
getManageAreaByPcodeAll({ pcode: val }).then((res: any) => {
if (res.code === 1000) {
result[idx].provinceCode = val;
result[idx].province = item.name;
......@@ -146,7 +146,7 @@ const MultAddress = (props) => {
await city.forEach(item => {
item.citydata.forEach(items => {
if (items.code === val) {
PublicApi.getManageAreaByPcodeAll({ pcode: val }).then((res: any) => {
getManageAreaByPcodeAll({ pcode: val }).then((res: any) => {
if(res.code === 1000) {
result[idx].cityCode = val;
result[idx].city = items.name;
......
import React, { useEffect, useRef, useState } from 'react'
import { Row, Col, Select, Form, Button, message } from 'antd';
import styled from 'styled-components'
import { PublicApi } from '@/services/api';
import { MinusOutlined, PlusOutlined } from '@ant-design/icons';
import { getManageAreaAll, getManageAreaByPcodeAll } from '@/services/ManageV2Api';
/**
* 自定义 省市多项选择
......@@ -63,7 +63,7 @@ const MultAddress = (props) => {
const flag = useRef<boolean>(true)
useEffect(() => {
PublicApi.getManageAreaAll().then(res => {
getManageAreaAll().then(res => {
if (res.code === 1000) {
setprovince(res.data)
}
......@@ -121,7 +121,7 @@ const MultAddress = (props) => {
// console.log(result, val, idx, result[idx])
await province.forEach(item => {
if (item.code === val) {
PublicApi.getManageAreaByPcodeAll({ pcode: val }).then((res: any) => {
getManageAreaByPcodeAll({ pcode: val }).then((res: any) => {
if (res.code === 1000) {
result[idx].provinceCode = val;
result[idx].province = item.name;
......
import React, { useEffect, useRef, useState } from 'react'
import { Row, Input, Col, Button, Result, message, Modal } from 'antd';
import useCountDown from '@/utils/hooks';
import { PublicApi } from '@/services/api';
import godEvent from '@/utils/event'
import { RiskCheck } from 'god';
import { decryptedByAES, encryptedByAES } from '@/utils/cryptoAes';
import { getMemberCaptcha, getMemberRegisterPhoneCheck, postMemberRegisterPswSms, postMemberRegisterSms } from '@/services/MemberV2Api';
// 滑块尺寸
const FLAG_SIZE = 60
......@@ -61,7 +61,7 @@ const Phone = (props) => {
useEffect(() => {
if (isShowValidate && !isActive) {
PublicApi.getMemberCaptcha({
getMemberCaptcha({
width: IMG_WIDTH.toString(),
height: IMG_HEIGHT.toString(),
size: FLAG_SIZE.toString()
......@@ -88,7 +88,7 @@ const Phone = (props) => {
resolve(true)
return ;
}
const { code } = await PublicApi.getMemberRegisterPhoneCheck({
const { code } = await getMemberRegisterPhoneCheck({
countryCode: prefixCode,
phone: form.getFieldValue('phone')
}, { ctlType: 'none', useCache: true, ttl: 60 * 1000 })
......@@ -145,7 +145,7 @@ const Phone = (props) => {
form.setFieldState('phone', state => {
state.smsLoading = instanceRef.current.canIUseSms
})
PublicApi.postMemberRegisterSms({
postMemberRegisterSms({
countryCode: '+86',
width: remoteImg.x,
imgId: remoteImg.imgId,
......@@ -159,7 +159,7 @@ const Phone = (props) => {
form.setFieldState('account', state => {
state.smsLoading = instanceRef.current.canIUseSms
})
PublicApi.postMemberRegisterPswSms({
postMemberRegisterPswSms({
countryCode: '+86',
width: remoteImg.x,
imgId: remoteImg.imgId,
......
import { ISchema } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getProductSelectGetSelectBrand, getProductSelectGetSelectCategory, getProductSelectGetSelectCustomerCategory } from '@/services/ProductV2Api';
export const productModalByMemberSchema: ISchema = {
type: 'object',
......@@ -34,7 +34,7 @@ export const productModalByMemberSchema: ISchema = {
"x-component-props": {
placeholder: '请选择品类',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCustomerCategory,
fetchSearch: getProductSelectGetSelectCustomerCategory,
style: {
width: 160
}
......@@ -45,7 +45,7 @@ export const productModalByMemberSchema: ISchema = {
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品牌',
fetchSearch: PublicApi.getProductSelectGetSelectBrand,
fetchSearch: getProductSelectGetSelectBrand,
style: {
width: 160
}
......@@ -97,7 +97,7 @@ export const productModalSchema: ISchema = {
"x-component-props": {
placeholder: '请选择品类',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCategory,
fetchSearch: getProductSelectGetSelectCategory,
style: {
width: 160
}
......@@ -108,7 +108,7 @@ export const productModalSchema: ISchema = {
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品牌',
fetchSearch: PublicApi.getProductSelectGetSelectBrand,
fetchSearch: getProductSelectGetSelectBrand,
style: {
width: 160
}
......@@ -173,7 +173,7 @@ export const inquirySchema: ISchema = {
"x-component-props": {
placeholder: '报价会员(全部)',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCategory,
fetchSearch: getProductSelectGetSelectCategory,
style: {
width: 160
}
......@@ -202,8 +202,8 @@ export const inquirySchema: ISchema = {
/**
* @description: 新增报价单 需求单查询
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export const enquirySchema: ISchema = {
type: 'object',
......@@ -238,7 +238,7 @@ export const enquirySchema: ISchema = {
"x-component-props": {
placeholder: '需求会员(全部)',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCategory,
fetchSearch: getProductSelectGetSelectCategory,
style: {
width: 160
}
......@@ -298,7 +298,7 @@ export const demandSchema: ISchema = {
"x-component-props": {
placeholder: '报价会员(全部)',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCategory,
fetchSearch: getProductSelectGetSelectCategory,
style: {
width: 160
}
......@@ -358,7 +358,7 @@ export const mergeOrderSchema: ISchema = {
"x-component-props": {
placeholder: '供应会员(全部)',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCategory,
fetchSearch: getProductSelectGetSelectCategory,
style: {
width: 160
}
......@@ -383,4 +383,4 @@ export const mergeOrderSchema: ISchema = {
}
}
}
}
\ No newline at end of file
}
import React, { useState, useEffect } from 'react';
import { Modal, Result, Progress, Upload, Button } from 'antd';
import { Modal, Result, Progress, Button } from 'antd';
import { FileExcelOutlined } from '@ant-design/icons';
import styles from './index.less';
import { PublicApi } from '@/services/api';
interface Uploader {
visibleModal: boolean;
......
......@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import { Dropdown, Space, Menu, message } from 'antd';
import { CaretDownOutlined } from '@ant-design/icons';
import { getAuth, setAuth, setRouters } from '@/utils/auth';
import { PublicApi } from '@/services/api';
import { postMemberLoginSwitchrole } from '@/services/MemberV2Api';
interface MemberRole {
memberRoleId: number;
......@@ -37,7 +37,7 @@ const Roles: React.FC = () => {
duration: 0,
});
PublicApi.postMemberLoginSwitchrole({
postMemberLoginSwitchrole({
memberRoleId,
}).then(res => {
if (res.code !== 1000) {
......
......@@ -43,7 +43,7 @@ const SelectLang: React.FC = () => {
// useEffect(() => {
// function getLang() {
// PublicApi.getLange
// getLange
// }
// }, [])
......
......@@ -43,7 +43,7 @@ export const searchCustomerCategoryOptionEffect = (
memberId,
memberRoleId,
}).then(res => {
// PublicApi.getProductPlatformGetCategoryTree().then(res => {
// getProductPlatformGetCategoryTree().then(res => {
context.setFieldState(fieldName, state => {
const result = res.data || []
state.props['x-component-props'].dataoption = result.map(item => {
......
......@@ -6,7 +6,6 @@ import { StandardTable } from 'god';
import { ColumnsType } from 'antd/es/table';
import { createFormActions } from '@formily/antd';
import NiceForm from '@/components/NiceForm';
import { PublicApi } from '@/services/api';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import memberSchema from './schema';
......
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Input, Select, Table } from 'antd';
import { PublicApi } from '@/services/api';
import { ColumnsType } from 'antd/es/table';
import { useDebounceFn } from '@umijs/hooks';
const AllQuery = () => {
......
import React from 'react';
import { Modal, Radio } from 'antd'
import {
SchemaForm, SchemaMarkupField as Field,
createFormActions,
FormEffectHooks
} from '@formily/antd'
import { Input, Select } from '@formily/antd-components'
import usePayTypeEnum from './usePayTypeEnum';
export interface Params {
id?: any,
mode: number,
type?: number | string,
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
initialValues?: any;
dontReceive?: boolean; //默认展示
}
const actions = createFormActions()
const { onFieldChange$ } = FormEffectHooks
const comfirmDialog: React.FC<Params> = (props) => {
const { payTypeEnum } = usePayTypeEnum()
const handletOk = (values: any) => {
let value = { ...values }
payTypeEnum.forEach(v => {
if(v.value === value.code) {
value.name = v.label
}
})
console.log(value, 100086)
if (props.type) {
value.type = props.type
}
props.onOK(value)
}
const useFormEffects = () => {
const { setFieldState } = createFormActions()
}
return (
<>
<Modal
title={props.mode === 0 ? '新增参数配置' : '编辑参数配置'}
width={800}
visible={props.dialogVisible}
onOk={() => actions.submit()}
onCancel={() => props.onCancel()}
destroyOnClose
afterClose={() => actions.reset()}
okText={`确定`}
cancelText='取消'
>
<SchemaForm
labelCol={3}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea,
Select
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={
props.initialValues
}
>
<Field
name='payWayCodeTypeEnum'
title='参数代码'
required
x-component-props={{
placeholder: '',
}}
enum={payTypeEnum}
x-component="Select"
/>
<>
<Field
title='参数值'
name="value"
x-component="Input"
required
x-component-props={{
placeholder: '',
// addonBefore: ' '
}}
x-rules={{
message: ''
}}
/>
{/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */}
<Field
title='参数描述'
name="describe"
x-component="TextArea"
x-component-props={{
placeholder: '最长128个字符'
}}
x-rules={{
max: 128,
// maximum:10,//最大数值
// message: '参数描述最多128个汉字'
}}
/>
</>
</SchemaForm>
</Modal>
</>
)
}
comfirmDialog.defaultProps = {
dontReceive: true,
type: 1 //1.支付宝 2.支付宝转账到银行卡参数配置 3.微信
}
export default comfirmDialog
import { PublicApi } from '@/services/api';
import React, { useState, useEffect, useRef } from 'react';
const usePayTypeEnum = () => {
const [payTypeEnum, setPayTypeEnum] = useState<any>([])
const ref = useRef(payTypeEnum);
useEffect(() => {
const getPayWayType = async () => {
await PublicApi.getPayGetPayWayCodeTypeEnum().then(res => {
if(res.code === 1000) {
const { data } = res;
const payWay: any[] = []
data.forEach(v => {
payWay.push({
label: v.name,
value: v.type
})
})
ref.current = payWay
setPayTypeEnum(ref.current)
}
})
}
getPayWayType();
},[])
return { payTypeEnum };
}
export default usePayTypeEnum;
......@@ -14,7 +14,7 @@ import unionpay from '@/assets/icons/unionpay_icon.png';
import balance from '@/assets/icons/balance_icon.png';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import NumberInput from './components/number';
import { postOrderMemberPaymentParameterCreate } from '@/services/OrderNewV2Api';
import { getOrderMemberPaymentParameterFind, postOrderMemberPaymentParameterCreate } from '@/services/OrderNewV2Api';
const PIC_MAP = {
1: alipay,
......@@ -115,7 +115,7 @@ const PaySettingLayout = () => {
]
useEffect(() => {
PublicApi.getOrderMemberPaymentParameterFind().then(res => {
getOrderMemberPaymentParameterFind().then(res => {
if (res.code !== 1000) {
setEmpty(true)
return
......
......@@ -10,9 +10,11 @@ import { LAYOUT_TYPE } from '@/constants'
import { topBarConfig, headerConfig, mainNavConfig, horizontalWrap, channelCategoryConfig, bannerWrap, bannerAdvertConfig, interactAdvertConfig, channelQuickNavConfig, mallLayoutConfig, serviceAdvertConfig, CommonTitle2Config, CompanyInfoConfig, AlbumConfig, HonroPicConfig, InformationConfig, FooterConfig } from '../../editor/channelEdit/defaultData'
import Loading from '../../editor/components/Loading'
import { menuData } from '../../editor/channelEdit/defaultMenu'
import { PublicApi } from '@/services/api'
import { getAuth } from '@/utils/auth'
import styles from './index.less'
import { getTemplateAdornWebChannelFindAdvertsByType, getTemplateAdornWebChannelFindAllFirstCategory, getTemplateAdornWebChannelMemberCategoryAdorn, getTemplateWebMemberChannelWebFindCurrMemberChannel } from '@/services/TemplateV2Api';
import { getManageContentInformationFindAllByRecommendLabel } from '@/services/ManageV2Api';
import { getSearchShopChannelGetCustomerCategoryTree } from '@/services/SearchV2Api';
interface ChannelPreviewPropsType {
location: {
......@@ -57,7 +59,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
memberId: userInfo.memberId
}
PublicApi.getTemplateAdornWebChannelFindAdvertsByType(params).then(res => {
getTemplateAdornWebChannelFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
} else {
......@@ -78,7 +80,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const headers: any = {
shopId
}
PublicApi.getTemplateAdornWebChannelFindAllFirstCategory(params).then(res => {
getTemplateAdornWebChannelFindAllFirstCategory(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......@@ -98,7 +100,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
roleId: userInfo.memberRoleId,
}
PublicApi.getTemplateAdornWebChannelMemberCategoryAdorn(param).then(res => {
getTemplateAdornWebChannelMemberCategoryAdorn(param).then(res => {
resolve(res.data)
})
})
......@@ -113,7 +115,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const params: any = {
memberId: userInfo.memberId
}
PublicApi.getTemplateWebMemberChannelWebFindCurrMemberChannel(params).then(res => {
getTemplateWebMemberChannelWebFindCurrMemberChannel(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......@@ -129,7 +131,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const param: any = {
recommendLabel: 1
}
PublicApi.getManageContentInformationFindAllByRecommendLabel(param).then(res => {
getManageContentInformationFindAllByRecommendLabel(param).then(res => {
if (res.code === 1000) {
const leadNewsList: any = res.data || []
if (leadNewsList.length >= 2) {
......@@ -153,7 +155,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const fetchNewByLabel = (label: string) => {
// 1-头条文章 2-轮播新闻 3-图片新闻 4-推荐阅读
return new Promise((resolve, reject) => {
PublicApi.getManageContentInformationFindAllByRecommendLabel({ recommendLabel: label }).then((res: { code: number; data: unknown }) => {
getManageContentInformationFindAllByRecommendLabel({ recommendLabel: label }).then((res: { code: number; data: unknown }) => {
if (res.code === 1000) {
resolve(res.data)
} else {
......@@ -230,7 +232,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
break
}
PublicApi.getSearchShopChannelGetCustomerCategoryTree(param, { headers }).then(res => {
getSearchShopChannelGetCustomerCategoryTree(param, { headers }).then(res => {
if (res.code === 1000) {
resolve(initCategoryData(res.data))
}
......
......@@ -9,10 +9,10 @@ import { LAYOUT_TYPE } from '@/constants'
import { topBarConfig, topAdvertConfig, headerConfig, mainNavConfig, bannerAdvertConfig, mallLayoutConfig, serviceAdvertConfig, CompanyInfoConfig, AlbumConfig, HonroPicConfig, FooterConfig } from '../../editor/shopEdit/defaultData'
import { menuData } from '../../editor/shopEdit/defaultMenu'
import Loading from '../../editor/components/Loading'
import { PublicApi } from '@/services/api'
import { GlobalConfig } from '@/global/config'
import { getAuth } from '@/utils/auth'
import styles from './index.less'
import { getTemplateAdornWebStoreFindAdvertsByType, getTemplateAdornWebStoreFindAllFirstCategory, getTemplateAdornWebStoreMemberCategoryAdorn, getTemplateWebMemberShopWebMemberShopMain } from '@/services/TemplateV2Api'
interface ShopEditPropsType {
location: {
......@@ -57,7 +57,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
roleId: memberRoleId
}
PublicApi.getTemplateAdornWebStoreFindAdvertsByType(params).then(res => {
getTemplateAdornWebStoreFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
} else {
......@@ -76,7 +76,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
roleId: memberRoleId
}
PublicApi.getTemplateAdornWebStoreFindAdvertsByType(params).then(res => {
getTemplateAdornWebStoreFindAdvertsByType(params).then(res => {
if (res.code === 1000) {
resolve(res.data)
} else {
......@@ -99,7 +99,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
const headers: any = {
shopId
}
PublicApi.getTemplateAdornWebStoreFindAllFirstCategory(param, { headers }).then(res => {
getTemplateAdornWebStoreFindAllFirstCategory(param, { headers }).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......@@ -119,7 +119,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
roleId: memberRoleId
}
PublicApi.getTemplateAdornWebStoreMemberCategoryAdorn(param).then(res => {
getTemplateAdornWebStoreMemberCategoryAdorn(param).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......@@ -137,7 +137,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
roleId: memberRoleId,
shopId,
}
PublicApi.getTemplateWebMemberShopWebMemberShopMain(param).then(res => {
getTemplateWebMemberShopWebMemberShopMain(param).then(res => {
if (res.code === 1000) {
if (res.code === 1000) {
resolve(res.data)
......
declare namespace API {
export interface ResponseModel {
}
}
\ No newline at end of file
import * as LogisticsV2Api from './LogisticsV2Api'
import * as PayV2Api from './PayV2Api'
import * as SearchV2Api from './SearchV2Api'
import * as PurchaseV2Api from './PurchaseV2Api';
import * as SettleV2Api from './SettleV2Api';
import * as TransactionV2Api from './TransactionV2Api';
import * as ContractV2Api from './ContractV2Api';
import * as OrderNewV2Api from './OrderNewV2Api';
import * as ProductV2Api from './ProductV2Api';
import * as TemplateV2Api from './TemplateV2Api';
import * as MemberV2Api from './MemberV2Api';
import * as ReportV2Api from './ReportV2Api';
import * as EnhanceV2Api from './EnhanceV2Api';
import * as MessageV2Api from './MessageV2Api';
import * as LogiticsV2Api from './LogiticsV2Api';
import * as MarketingV2Api from './MarketingV2Api';
import * as AfterServiceV2Api from './AfterServiceV2Api';
import * as ManageV2Api from './ManageV2Api';
/**
* 可在这里写入自定义的接口
*/
export const CustomApi = {
}
// 公共的接口,从yapi拉下
export const PublicApi = {
...LogisticsV2Api,
...PayV2Api,
...SearchV2Api,
...PurchaseV2Api,
...SettleV2Api,
...TransactionV2Api,
...ContractV2Api,
...OrderNewV2Api,
...ProductV2Api,
...TemplateV2Api,
...MemberV2Api,
...ReportV2Api,
...EnhanceV2Api,
...MarketingV2Api,
...AfterServiceV2Api,
...ManageV2Api,
...MessageV2Api,
...LogiticsV2Api,
}
import { action, observable, runInAction } from 'mobx'
import { LAYOUT_TYPE } from '@/constants'
import { PublicApi } from '@/services/api'
import { getSearchShopEnterpriseGetCategoryTree, getSearchShopStoreGetCustomerCategoryTree } from '@/services/SearchV2Api';
class CategoryStore {
......@@ -27,7 +27,7 @@ class CategoryStore {
*/
@action.bound
public async fetchEnterpriseCategoryList() {
const res = await PublicApi.getSearchShopEnterpriseGetCategoryTree()
const res = await getSearchShopEnterpriseGetCategoryTree()
runInAction(() => {
this.enterpriseCategoryList = res.data || []
})
......@@ -39,7 +39,7 @@ class CategoryStore {
*/
@action.bound
public async fetchStoreCategoryList(param) {
const res = await PublicApi.getSearchShopStoreGetCustomerCategoryTree(param)
const res = await getSearchShopStoreGetCustomerCategoryTree(param)
runInAction(() => {
this.storeCategoryList = res.data || []
......
import { action, observable, runInAction } from 'mobx'
import { PublicApi } from '@/services/api'
import { FILTER_TYPE } from '@/constants'
import { getSearchShopOftenSelectGetOftenSelect, getSearchShopOftenSelectGetOftenSelectList, postSearchShopOftenSelectDeleteOftenSelect, postSearchShopOftenSelectSaveOrUpdateOftenSelect } from '@/services/SearchV2Api';
interface FilterValueType {
key: any;
......@@ -278,7 +278,7 @@ class FilterStore {
break
}
}
PublicApi.postSearchShopOftenSelectSaveOrUpdateOftenSelect(tempFilterParam).then(res => {
postSearchShopOftenSelectSaveOrUpdateOftenSelect(tempFilterParam).then(res => {
if (res.code === 1000) {
this.getCommonlyUsedFilterList()
resolve(true)
......@@ -298,7 +298,7 @@ class FilterStore {
current: 1,
pageSize: 50,
}
const res = await PublicApi.getSearchShopOftenSelectGetOftenSelectList(param)
const res = await getSearchShopOftenSelectGetOftenSelectList(param)
runInAction(() => {
if (res.code === 1000) {
this.commonlyUseFilter = res.data.data || []
......@@ -312,7 +312,7 @@ class FilterStore {
@action.bound
public async deleteCommonlyUsedFilterItem(id: number) {
return new Promise((resolve, reject) => {
PublicApi.postSearchShopOftenSelectDeleteOftenSelect({ id }).then(res => {
postSearchShopOftenSelectDeleteOftenSelect({ id }).then(res => {
if (res.code === 1000) {
this.getCommonlyUsedFilterList()
resolve(true)
......@@ -336,7 +336,7 @@ class FilterStore {
const param: any = {
id
}
const res = await PublicApi.getSearchShopOftenSelectGetOftenSelect(param)
const res = await getSearchShopOftenSelectGetOftenSelect(param)
runInAction(() => {
if (res.code === 1000) {
const data = res.data
......
import { action, computed, observable, runInAction } from 'mobx'
import { PublicApi } from '@/services/api'
class OrderStore {
@observable orderInfo = null
@observable orderMode = []
@action.bound
public updateOrderMode = (orderModes) => {
return new Promise((resolve) => {
this.orderMode = orderModes
resolve()
})
}
@action.bound
public getOrderMode = () => {
return new Promise((resolve) => {
PublicApi.getOrderRuleConfigurationAll({}, {useCache: true, ttl: 30 * 1000}).then(({code, data}) => {
if (code === 1000) {
this.orderMode = data
resolve(this.orderMode)
} else {
resolve(this.orderMode)
}
})
})
}
@action.bound
public updateOrderInfo = (orderInfo, sessionKey) => {
return new Promise((resolve) => {
this.orderInfo = orderInfo
sessionStorage.setItem(sessionKey, JSON.stringify(this.orderInfo))
resolve()
})
}
@action.bound
public getOrderInfo = (sessionKey) => {
return new Promise((resolve) => {
const sessionOrderInfo = sessionStorage.getItem(sessionKey)
resolve(JSON.parse(sessionOrderInfo))
})
}
@action.bound
public clearOrderInfo = (sessionKey) => {
this.orderInfo = null
sessionStorage.removeItem(sessionKey)
}
}
export default OrderStore
\ No newline at end of file
import { action, computed, observable, runInAction } from 'mobx'
class OrderStore {
@observable orderInfo = null
@action.bound
public getOrderInfo = (sessionKey) => {
return new Promise((resolve) => {
const sessionOrderInfo = sessionStorage.getItem(sessionKey)
resolve(JSON.parse(sessionOrderInfo))
})
}
@action.bound
public clearOrderInfo = (sessionKey) => {
this.orderInfo = null
sessionStorage.removeItem(sessionKey)
}
}
export default OrderStore
......@@ -2,7 +2,7 @@ import { action, computed, observable, runInAction } from 'mobx'
import { ISiteModule } from '@/module/siteModule'
import { GlobalConfig } from '@/global/config'
import { LAYOUT_TYPE } from '@/constants'
import { PublicApi } from '@/services/api'
import { getTemplateWebPageTemplateWebFindEnterpriseTemplate, getTemplateWebPageTemplateWebFindGoodsDescribeTemplate } from '@/services/TemplateV2Api'
type CurrentLayoutType = {
layoutType: string,
......@@ -38,7 +38,7 @@ class SiteStore implements ISiteModule {
siteId: this.siteId
}
const res = await PublicApi.getTemplateWebPageTemplateWebFindEnterpriseTemplate(param)
const res = await getTemplateWebPageTemplateWebFindEnterpriseTemplate(param)
runInAction(() => {
this.mallTemplateInfo = res.data || {}
this.mallTemplateId = this.mallTemplateInfo.id
......@@ -67,7 +67,7 @@ class SiteStore implements ISiteModule {
const param: any = {
siteId: this.siteId
}
const res = await PublicApi.getTemplateWebPageTemplateWebFindGoodsDescribeTemplate(param)
const res = await getTemplateWebPageTemplateWebFindGoodsDescribeTemplate(param)
runInAction(() => {
if(res.code === 1000) {
this.commodityTemplateInfo = res.data
......
......@@ -2,9 +2,9 @@ import React from 'react';
import { Button, notification, message, Typography } from 'antd';
import { GlobalConfig } from '@/global/config'
import { PublicApi } from '@/services/api';
import { REQUEST_HEADER, TOP_DOMAIN, ENTERPRISE_CENTER_URL, CHANNEL_CENTER_URL, ICHANNEL_CENTER_URL } from '@/constants';
import { getAuth } from '@/utils/auth';
import { getMessageImHistorySession } from '@/services/MessageV2Api';
const DOMAIN = `.${TOP_DOMAIN}`;//document.domain
const CHATROOM_URL = `${REQUEST_HEADER}im${DOMAIN}/chatRoom`;
......@@ -26,7 +26,7 @@ export const toChatRoom = (memberId: string = '', shopType: number = 1) => {
const _params: any = {
memberId
}
PublicApi.getMessageImHistorySession(_params).then(res => {
getMessageImHistorySession(_params).then(res => {
if (res.code === 1000) {
let _userId = '';
const _list = res.data;
......
import { GlobalConfig } from '@/global/config';
import { PublicApi } from '@/services/api';
import { postManageWebShopWebAll } from '@/services/ManageV2Api';
export function isString(str: any):str is string {
return typeof str === 'string'
......@@ -42,6 +42,6 @@ interface getShopListsParmasProps {
* @param params 接口参数
*/
export const fectchShopListsSource = async (params?: getShopListsParmasProps) => {
const { data } = await PublicApi.postManageWebShopWebAll({ ...params, siteId: GlobalConfig.global.siteInfo.id }, { ctlType: 'none' })
const { data } = await postManageWebShopWebAll({ ...params, siteId: GlobalConfig.global.siteInfo.id }, { ctlType: 'none' })
return data
}
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