fix: load request

This commit is contained in:
reza karimi
2024-06-17 16:04:56 +03:30
parent d2292a711b
commit 0ce13c4919
2 changed files with 28 additions and 13 deletions
+1 -1
View File
@@ -19,4 +19,4 @@ export const AppFile = addr => {
return `${serve}/${addr}` return `${serve}/${addr}`
} }
export const AppProduction = 'https://mipstockholder.iran.liara.run/api/' export const AppProduction = 'https://mehriranianco.ir/api/'
+27 -12
View File
@@ -17,16 +17,19 @@ import moment from 'moment-jalaali'
const StockSalesContainer = () => { const StockSalesContainer = () => {
const [userName, setUserName] = useState() const [userName, setUserName] = useState()
const [codeMeli, setCodeMeli] = useState() const [national_code, setNational_code] = useState()
const [mobileNumber, setMobileNumber] = useState() const [mobileNumber, setMobileNumber] = useState()
const [numberStock, setNumberStock] = useState('') const [numberStock, setNumberStock] = useState('')
const [stockType, setStockType] = useState(null) const [stockType, setStockType] = useState(null)
const [InvestmentType, setInvestmentType] = useState('1') const [InvestmentType, setInvestmentType] = useState('1')
const [code, setCode] = useState('1')
const [InvestmentPrice, setInvestmentPrice] = useState('0') const [InvestmentPrice, setInvestmentPrice] = useState('0')
const [Loading, setLoading] = useState(false) const [Loading, setLoading] = useState(false)
const [showSuccessSubmitForm, setShowSuccessSubmitForm] = useState(false) const [showSuccessSubmitForm, setShowSuccessSubmitForm] = useState(false)
const [textareaValue, setTextareaValue] = useState('');
const { const {
register, register,
@@ -40,13 +43,15 @@ const StockSalesContainer = () => {
toast.loading('در حال ثبت درخواست شما') toast.loading('در حال ثبت درخواست شما')
axios axios
.post(`${AppProduction}public/website/request`, { .post(`${AppProduction}public/website/request`, {
userName: userName, name: userName,
codeMeli: codeMeli, national_code: national_code,
numberStock: numberStock, stock_count: numberStock,
stockType: stockType,
investment_price: InvestmentPrice, investment_price: InvestmentPrice,
investment_type: InvestmentType investment_type: InvestmentType,
type: "buy-stock",
stock_type: stockType,
description: textareaValue,
mobile_number: mobileNumber
// name: name, // name: name,
// mobile_number: mobileNumber, // mobile_number: mobileNumber,
}) })
@@ -55,7 +60,8 @@ const StockSalesContainer = () => {
setShowSuccessSubmitForm(true) setShowSuccessSubmitForm(true)
toast.remove() toast.remove()
toast.success('درخواست شما ثبت شد به زودی کار شناسان ما به شما تماس می گیرند') toast.success('درخواست شما ثبت شد به زودی کار شناسان ما به شما تماس می گیرند')
await console.log('res', res) console.log('res', res.data.request)
setCode(res.data.request.rrn)
}) })
.catch(async err => { .catch(async err => {
setLoading(false) setLoading(false)
@@ -146,12 +152,12 @@ const StockSalesContainer = () => {
</div> </div>
<div className='mt-9'> <div className='mt-9'>
<label className='text-[#3c3c3c] text-base md:text-lg font-medium hover:text-[#57C5C6] ' for='codeMeli'> <label className='text-[#3c3c3c] text-base md:text-lg font-medium hover:text-[#57C5C6] ' for='national_code'>
کد ملی کد ملی
</label> </label>
<div className='text-end'> <div className='text-end'>
<input <input
onChange={e => setCodeMeli(e.target.value)} onChange={e => setNational_code(e.target.value)}
className='outline-0 bg-transparent w-11/12 text-end pt-3 className='outline-0 bg-transparent w-11/12 text-end pt-3
border-b border-solid border-[#65656540] border-r-0 border-l-0 border-t-0 hover:border-[#57C5C6] ' border-b border-solid border-[#65656540] border-r-0 border-l-0 border-t-0 hover:border-[#57C5C6] '
id='name' id='name'
@@ -161,7 +167,7 @@ const StockSalesContainer = () => {
</div> </div>
</div> </div>
<div className='mt-9'> <div className='mt-9'>
<label className='text-[#3c3c3c] text-base md:text-lg font-medium hover:text-[#57C5C6] ' for='codeMeli'> <label className='text-[#3c3c3c] text-base md:text-lg font-medium hover:text-[#57C5C6] ' for='national_code'>
شماره موبایل شماره موبایل
</label> </label>
<div className='text-end'> <div className='text-end'>
@@ -254,7 +260,13 @@ const StockSalesContainer = () => {
<div className='mt-2'> <div className='mt-2'>
{InvestmentType === 4 && ( {InvestmentType === 4 && (
<Textarea style={{ textAlign: 'right' }} placeholder='....شرح مال مورد معوض' size='sm' /> <Textarea
value={textareaValue}
onChange={(e) => {
setTextareaValue(e.target.value)
}}
style={{ textAlign: 'right' }} placeholder='....شرح مال مورد معوض' size='sm' />
)} )}
</div> </div>
@@ -293,6 +305,9 @@ const StockSalesContainer = () => {
) : ( ) : (
<div className='my-44 flex justify-center flex-col items-center'> <div className='my-44 flex justify-center flex-col items-center'>
<h3 className='text-green-600'>درخواست شما ثبت شد به زودی کار شناسان ما به شما تماس می گیرند</h3> <h3 className='text-green-600'>درخواست شما ثبت شد به زودی کار شناسان ما به شما تماس می گیرند</h3>
<br />
کد پیگیری درخواست شما :
{code}
<div className='mt-[6rem] mb-2'> <div className='mt-[6rem] mb-2'>
<Link href={'/stock-unit'}> <Link href={'/stock-unit'}>
<button className='py-[1rem] outline-0 border-0 px-[2rem] bg-[#014258] rounded-[10px] text-white text-[20px] font-bold '> <button className='py-[1rem] outline-0 border-0 px-[2rem] bg-[#014258] rounded-[10px] text-white text-[20px] font-bold '>