shenwu 8 місяців тому
батько
коміт
d521221dbd
1 змінених файлів з 34 додано та 5 видалено
  1. 34 5
      src/pages/launchSystemNew/account/components/qqAuto.tsx

+ 34 - 5
src/pages/launchSystemNew/account/components/qqAuto.tsx

@@ -14,11 +14,12 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
     let [loading, setLoading] = useState(false)
     let [codeUrl, setCodeUrl] = useState('')
     let [err, setErr] = useState({})
-    let [outTime,setOutTime]=useState(0)
+    let [outTime, setOutTime] = useState(0)
     let [data, setData] = useState({
         userId: localStorage.getItem('userId'),
         adAppType,
         users: [],
+        adUnitType:"",
         callbackPage: 'http%3A%2F%2Ferp.zanxiangnet.com%2FadCode',
         authorization: `Bearer ${sessionStorage.getItem('Admin-Token')}`,
         smType: smType ? "WX" : "QQ",
@@ -29,12 +30,20 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
         console.log("checkedValue===>", v)
         setData({ ...data, adAppType: v })
     }, [data])
+    let adUnitTypeChange = useCallback((adUnitType) => {
+        let v = adUnitType.target.value
+        console.log("checkedValue===>", v)
+        setData({ ...data, adUnitType: v })
+    }, [data])
     let submit = useCallback(() => {
         if (data.users.some(user => isNaN(user))) {
             message.error('账号请使用数字!!!!!!')
             return
         }
-        console.log(data)
+        if(!data.adUnitType){
+            message.error("请选择业务类型")
+            return
+        }
         setLoading(true)
         fetch(api + '/qq/auth', {
             method: 'POST',
@@ -49,7 +58,7 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
                 let n = 0
                 let overTime = data.smType === 'QQ' ? 60 : 240
                 time = setInterval(() => {
-                    if ( n < overTime) {
+                    if (n < overTime) {
                         n += 1
                         fetch(`${api}/qq/isOk?userId=${localStorage.getItem('userId')}&smType=${data.smType}`, {
                             method: 'GET'
@@ -68,7 +77,7 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
                         clearInterval(time)
                         setLoading(false)
                     }
-                    setOutTime(overTime-n)
+                    setOutTime(overTime - n)
                 }, 1000)
             } else {
                 message.success('已经开始授权,稍后自行查看结果!如遇到问题请点击清除账号状态按钮重试!')
@@ -132,6 +141,26 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
                         </Col>
                     </Row>
                 </Col>
+                <Col span='24'>
+                    <Row>
+                        <Col span={3}><h3>业务类型:</h3></Col>
+                        <Col span={20}>
+                            <Radio.Group style={{ width: '100%' }} onChange={adUnitTypeChange} defaultValue={data.adUnitType}>
+                                {adAppType === 0 ?
+                                    <>
+                                        <Radio value={"NOVEL"}>小说</Radio>
+                                        <Radio value={"NOVEL_IAA"}>小说IAA</Radio>
+                                        <Radio value={"SHOP"}>电商</Radio>
+                                    </> :
+                                    <>
+                                        <Radio value={"GAME"}>游戏</Radio>
+                                        <Radio value={"GAME_IAA"}>游戏IAA</Radio>
+                                    </>
+                                }
+                            </Radio.Group>
+                        </Col>
+                    </Row>
+                </Col>
                 <Col span='24'>
                     <Row>
                         <Col span={3}><h3>账号ID:</h3></Col>
@@ -169,7 +198,7 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
                 maskClosable={false}
                 title={<>{data?.smType === 'QQ' ? "QQ扫码" : "微信扫码"}</>}
             >
-                <div style={{ display: 'flex', justifyItems: "center", alignItems: 'center',flexFlow:'column' }}>
+                <div style={{ display: 'flex', justifyItems: "center", alignItems: 'center', flexFlow: 'column' }}>
                     <Image
                         style={{ width: 150 }}
                         src={codeUrl} />