From d1745a16f16ceb175c7357dd88c560de39ac6baa Mon Sep 17 00:00:00 2001 From: Haiyi <1021441632@qq.com> Date: Thu, 23 Feb 2023 18:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(=E7=AB=8B=E5=8D=B3=E8=B4=AD?= =?UTF-8?q?=E4=B9=B0=E5=85=AC=E5=8F=B8=E6=A0=A1=E9=AA=8C):=E7=AB=8B?= =?UTF-8?q?=E5=8D=B3=E8=B4=AD=E4=B9=B0=E5=85=AC=E5=8F=B8=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../details/components/orderCount/index.tsx | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/src/pages/details/components/orderCount/index.tsx b/src/pages/details/components/orderCount/index.tsx index 8742b3e..e81be22 100644 --- a/src/pages/details/components/orderCount/index.tsx +++ b/src/pages/details/components/orderCount/index.tsx @@ -20,7 +20,10 @@ import LabAndImg from '@/components/LabAndImg' import useCommonData from '@/use/useCommonData' import LabAndImgShow from '@/components/LabAndImgShow' import IconFont from '@/components/iconfont/iconfont' -import { goLink } from '@/common/common' +import { alert, goLink, retrieval } from '@/common/common' +import OrganizationNameModal from '@/components/organizationNameModal' +import useLogin from '@/use/useLogin' +import { companyDetailApi, companyUpdateApi } from '@/api/company' interface param { show?: true | false @@ -195,6 +198,18 @@ const OrderCount = ({ show = false, onClose, title = '', productId = 0, is_first }) } } + const [showModal, setShowModal] = useState(false) + + const userInfo = useSelector(state => state.userInfo) + + const handleClose = () => { + setShowModal(false) + } + + const handleShowChange = (val: boolean) => { + setShowModal(val) + } + const handShopBuy = async() => { try { await getSelfUserInfo() @@ -213,12 +228,36 @@ const OrderCount = ({ show = false, onClose, title = '', productId = 0, is_first }) return false } + // 检测是否修改过组织昵称 + if (userInfo.adminUserInfo.first_change_name) { + setShowModal(true) + return + } Taro.navigateTo({ url: `/pages/order/speedComfirm?sale_mode=${Number(selectIndex)}&buyList=${JSON.stringify(selectCount.color_list)}`, }) console.log(selectIndex, ':selectIndex', selectCount.color_list, ':selectCount.color_list', recommendStatus, ':recommendStatus') } + const { getAdminUserInfo } = useLogin() + const { fetchData: saveFetch } = companyUpdateApi() + const { fetchData: getCompanyFetch } = companyDetailApi() + const handleOrganizationNameModalConfirm = async(text: string) => { + const params = await getCompanyFetch() + const result = await saveFetch({ + ...params.data, + company_name: text, + }) + if (result.success) { + getAdminUserInfo() + handleClose() + alert.success('保存成功') + } + else { + alert.none(result.msg) + } + } + // 筛选数据 const searchInput = useCallback((e) => { condition.current.code_or_name = e @@ -460,6 +499,8 @@ const OrderCount = ({ show = false, onClose, title = '', productId = 0, is_first + + ) }