Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/qingduTicketing
| | |
| | | export default { |
| | | dev: { |
| | | // SERVER_URL: 'https://jiashikang.cn/manage', |
| | | SERVER_URL: 'http://192.168.110.111:9918', |
| | | IMAGE_URL: 'http://192.168.110.111:11223/images/', // 图片地址 |
| | | SERVER_URL: 'http://221.182.45.100:9919', |
| | | IMAGE_URL: 'http://221.182.45.100:11224/images/', // 图片地址 |
| | | }, |
| | | test: { |
| | | SERVER_URL: 'http://221.182.45.100:8686', |
| | |
| | | import { PageContainer, ProForm, ProFormText } from '@ant-design/pro-components'; |
| | | import { Button, Card, Form, message, Upload } from 'antd'; |
| | | import { useEffect, useState } from 'react'; |
| | | import { getList, updateBatch } from './service'; |
| | | import { getBaseInfo, updateBaseInfo } from './service'; |
| | | |
| | | const IntegralExchange = () => { |
| | | const [form] = Form.useForm(); |
| | |
| | | const [mapImageUrl, setMapImageUrl] = useState(''); |
| | | |
| | | const getConfigList = async () => { |
| | | const res = await getList(); |
| | | if (res.code === 200) { |
| | | res.data?.forEach((item) => { |
| | | // 景区导览地图 |
| | | if (item.configType === 7) { |
| | | setMapImageUrl(getFileAccessUrl(item.content)); |
| | | form.setFieldsValue({ mapImage: item.content || '' }); |
| | | } |
| | | // 开票客服手机号 |
| | | if (item.configType === 8) { |
| | | form.setFieldsValue({ servicePhone: item.content || '' }); |
| | | } |
| | | const res = await getBaseInfo(); |
| | | if (res.code === 200 && res.data) { |
| | | const { mapImg, phone } = res.data; |
| | | if (mapImg) { |
| | | setMapImageUrl(getFileAccessUrl(mapImg)); |
| | | } else { |
| | | setMapImageUrl(''); |
| | | } |
| | | form.setFieldsValue({ |
| | | mapImage: mapImg || '', |
| | | servicePhone: phone || '', |
| | | }); |
| | | } |
| | | }; |
| | |
| | | } |
| | | |
| | | const params = { |
| | | htmlConfigs: [ |
| | | { |
| | | configType: 7, |
| | | content: values.mapImage, |
| | | }, |
| | | { |
| | | configType: 8, |
| | | content: values.servicePhone || '', |
| | | }, |
| | | ], |
| | | id: 1, |
| | | mapImg: values.mapImage, |
| | | phone: values.servicePhone || '', |
| | | }; |
| | | let success = false; |
| | | setLoading(true); |
| | | success = await sendRequest(updateBatch, params); |
| | | success = await sendRequest(updateBaseInfo, params); |
| | | if (success) { |
| | | getConfigList(); |
| | | setLoading(false); |
| | |
| | | import { request } from '@umijs/max'; |
| | | |
| | | // 更新批量 |
| | | export const updateBatch = async (params) => { |
| | | return request(`/t-html-config/updateBatch`, { |
| | | // 更新基础信息 |
| | | export const updateBaseInfo = async (params) => { |
| | | return request(`/t-html-config/updateBaseInfo`, { |
| | | method: 'POST', |
| | | data: params, |
| | | }); |
| | | }; |
| | | |
| | | // 获取列表 |
| | | export async function getList() { |
| | | return request(`/t-html-config/list`, { |
| | | // 获取基础信息 |
| | | export async function getBaseInfo() { |
| | | return request(`/t-html-config/baseInfo`, { |
| | | method: 'GET', |
| | | }); |
| | | } |
| | |
| | | import type { RequestOptions } from '@@/plugin-request/request'; |
| | | import type { RequestOptions } from '@@/plugin-request/request'; |
| | | import type { RequestConfig } from '@umijs/max'; |
| | | import { message, notification } from 'antd'; |
| | | import { history } from '@umijs/max'; |