✨ feat(立即购买公司校验):立即购买公司校验
This commit is contained in:
parent
da4b445da0
commit
d1745a16f1
@ -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
|
||||
<View>
|
||||
<LabAndImgShow value={labImageValue} show={showLabImage} onClose={closeLabImgShow} />
|
||||
</View>
|
||||
<OrganizationNameModal showModal={showModal} onClose={handleClose} onShowModalChange={handleShowChange} onConfirm={handleOrganizationNameModalConfirm} />
|
||||
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user