|
@@ -1,7 +1,7 @@
|
|
|
import React, { useEffect, useRef, useState } from "react";
|
|
|
import "./index.less";
|
|
|
import { SearchBarRef } from 'antd-mobile/es/components/search-bar'
|
|
|
-
|
|
|
+import { Picker, Button, Space, Toast } from 'antd-mobile'
|
|
|
import { SearchOutline } from 'antd-mobile-icons'
|
|
|
import api from "~/api";
|
|
|
export const ExamRoadVideo: React.FC = (props: any) => {
|
|
@@ -14,6 +14,11 @@ export const ExamRoadVideo: React.FC = (props: any) => {
|
|
|
provinceName: "province",
|
|
|
province: "35"
|
|
|
})
|
|
|
+ const [provinceVisible, setProvinceVisible] = useState(true)
|
|
|
+ const [provinceList, setProvinceList] = useState<{
|
|
|
+ province:string,
|
|
|
+ provinceId:string
|
|
|
+ }[]>([])
|
|
|
const [examList, setExamList] = useState<{
|
|
|
"id": number,
|
|
|
"name": string,
|
|
@@ -22,8 +27,8 @@ export const ExamRoadVideo: React.FC = (props: any) => {
|
|
|
"province": string,
|
|
|
"cityId": string,
|
|
|
"city": string,
|
|
|
- "countyId":string,
|
|
|
- "county":string,
|
|
|
+ "countyId": string,
|
|
|
+ "county": string,
|
|
|
"price": number,
|
|
|
"videoCount": number,
|
|
|
"expirationTime": null,
|
|
@@ -31,15 +36,17 @@ export const ExamRoadVideo: React.FC = (props: any) => {
|
|
|
"sign": null
|
|
|
}[]>([])
|
|
|
useEffect(() => {
|
|
|
+ //定位
|
|
|
api.studentExamInfoIp().then(res => {
|
|
|
setCity({
|
|
|
- cityName:res.data.cityName,
|
|
|
- city:res.data.city
|
|
|
+ cityName: res.data.cityName,
|
|
|
+ city: res.data.city
|
|
|
})
|
|
|
setProvince({
|
|
|
- province:res.data.province,
|
|
|
- provinceName:res.data.provinceName
|
|
|
+ province: res.data.province,
|
|
|
+ provinceName: res.data.provinceName
|
|
|
})
|
|
|
+
|
|
|
console.log(res)
|
|
|
})
|
|
|
api.studentExamInfoList({}).then(res => {
|
|
@@ -47,6 +54,10 @@ export const ExamRoadVideo: React.FC = (props: any) => {
|
|
|
setExamList(res.data.rows)
|
|
|
|
|
|
})
|
|
|
+ api.studentExamInfoGetProvice().then(res => {
|
|
|
+ setProvinceList(res.data.data)
|
|
|
+
|
|
|
+ })
|
|
|
|
|
|
}, [])
|
|
|
return (
|
|
@@ -55,7 +66,7 @@ export const ExamRoadVideo: React.FC = (props: any) => {
|
|
|
<div className="rect">
|
|
|
<div className="search">
|
|
|
<SearchOutline className="icon1" color="#8A9099" fontSize={18} />
|
|
|
- <input placeholder="输入系列课标题" className="bar" type="search"></input>
|
|
|
+ <input placeholder="输入系列课标题" className="bar" type="search"></input>
|
|
|
</div>
|
|
|
<div
|
|
|
className="select"
|
|
@@ -63,9 +74,8 @@ export const ExamRoadVideo: React.FC = (props: any) => {
|
|
|
>
|
|
|
<input
|
|
|
|
|
|
- disabled
|
|
|
- v-model="province.province"
|
|
|
-
|
|
|
+ readOnly
|
|
|
+ onClick={()=>{setProvinceVisible(true)}}
|
|
|
placeholder="省份"
|
|
|
className="header-province"
|
|
|
type="text"
|
|
@@ -91,6 +101,14 @@ export const ExamRoadVideo: React.FC = (props: any) => {
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <Picker onCancel={()=>{setProvinceVisible(false)}} visible={provinceVisible} columns={(values)=>{
|
|
|
+ let columns = provinceList.map(item=>{
|
|
|
+ return [{label:item.province,value:item.provinceId}]
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ return columns
|
|
|
+ }}></Picker>
|
|
|
|
|
|
</div>
|
|
|
<div className="content">
|