Forráskód Böngészése

短视频分页管理

DESKTOP-6ESHLVF\admin 4 éve%!(EXTRA string=óta)
szülő
commit
c110e300dc

+ 26 - 8
UI/src/pages/vedioManage/vedioList.js

@@ -192,7 +192,8 @@ class VedioList extends React.Component{
             currentDoctorPage: 1,      //当前医生页码
             currentDepartmentPage: 1,
             singleAssociateDortor: false, // 单个视频关联医生
-            loadingAliVideo:false
+            loadingAliVideo:false,
+            searchVideoPage: 1
         }
     }
 
@@ -208,11 +209,20 @@ class VedioList extends React.Component{
         request({
             url: ymallAPI + '/ymall/video/queryVideos',
             method: 'post',
-            data: { filters: this.state.filters }
+            data: {
+                pageSize: 10,
+                pageIndex: this.state.searchVideoPage,
+                filters: this.state.filters 
+            }
         }).then(res => {
             console.log('视频列表', res)
             this.setState({
-                data: res.items
+                data: this.state.data.concat(res.items),
+                searchVideoPage: this.state.searchVideoPage +1
+            }, () => {
+                if(this.state.data.length < res.totalCount ) {
+                    this.searchDataList()
+                }
             })
         })
     }
@@ -387,7 +397,8 @@ class VedioList extends React.Component{
         }
         this.setState({
             filters: list,
-            currentVideoPage: 1
+            currentVideoPage: 1,
+            searchVideoPage: 1
         }, () => {
             this.searchDataList()
         })
@@ -451,9 +462,11 @@ class VedioList extends React.Component{
                 console.log(res)
                 message.success(res.message)
                 this.setState({
-                    doctorModal: false
+                    doctorModal: false,
+                    searchVideoPage: 1
+                }, () => {
+                    this.searchDataList()  
                 })
-                this.searchDataList()  
             })
         } else {
             //单个视频关联医生
@@ -612,7 +625,11 @@ class VedioList extends React.Component{
         }).then(res => {
             console.log(res)
             message.success(res.message)
-            this.searchDataList()
+            this.setState({
+                searchVideoPage: 1
+            }, () => {
+                this.searchDataList()
+            })
         })
     }
 
@@ -677,7 +694,8 @@ class VedioList extends React.Component{
                 selectedAliId: [],
                 aliVedioModal: false,
                 searchAliVedioName: '',
-                selectedAliVedioList: []
+                selectedAliVedioList: [],
+                searchVideoPage: 1
             })
             this.searchDataList()
         }

+ 11 - 3
UI/src/pages/ymall/accountDetails.js

@@ -16,6 +16,8 @@ class AccountDetails extends React.Component {
     constructor(props) {
         super(props)
         this.state = {
+            pageIndex: 1,
+            dataList: [],
             id: '',                         //账户id
             userRoleName: '',               //用户名
             idPhone: '',                    //用户手机
@@ -196,14 +198,19 @@ class AccountDetails extends React.Component {
             method: 'post',
             data: {
                 pageSize: 10,
-                pageIndex: 1,
+                pageIndex: this.state.pageIndex,
                 filters: this.state.filters.concat([{ field:"id", operate: "equal",value: this.state.id }])
             }
         }).then(res => {
             console.log(res)
             if(!!res.success) {
                 this.setState({
-                    dataList: res.items
+                    dataList: this.state.dataList.concat(res.items),
+                    pageIndex: this.state.pageIndex++
+                }, () => {
+                    if(this.state.dataList.length < res.totalCount) {
+                        this.loadDataList()
+                    }
                 })
             }
         })
@@ -221,7 +228,8 @@ class AccountDetails extends React.Component {
         console.log(filters)
         
         this.setState({ 
-            filters
+            filters,
+            pageIndex: 1
         }, () => { this.loadDataList() })
     }