FANGLH 6 lat temu
rodzic
commit
dfc3ba5e6e

+ 8 - 5
frontend/wechat-web/src/configs/api.config.js

@@ -8,7 +8,10 @@ import store from './../redux/store/store'
  * Desc: 项目接口
  */
 // export const _host = 'https://school-api.ubtob.com'
-export const _host = 'http://10.1.80.180:9520'
+export const _host = 'http://10.1.80.47:9520' //顾群
+// export const _host = 'http://10.1.80.180:9520' //赵耀
+// export const _host = 'http://10.1.80.36:9520'  //陈伟
+
 export const _baseURL = _host + '/api/school'
 // export const _baseURL = _host
 
@@ -177,13 +180,13 @@ export const API = {
     //创建通知公告
     NOTIFY_CREATE: _baseURL + '/notice/savePublish',
     //通知公告列表家长端
-    NOTIFY_LIST_PARENT: _baseURL + '/wxSchool/notify/notifyListByStu',
+    NOTIFY_LIST_PARENT: _baseURL + '/wxSchool/notify/notifyList',
     //通知公告列表教师端
-    NOTIFY_LIST_TEACHER: _baseURL + '/wxSchool/notify/notifyListByTeacher',
+    NOTIFY_LIST_TEACHER: _baseURL + '/wxSchool/notify/notifyList',
     //通知公告详情家长端
-    NOTIFY_DETAIL_PARENT: _baseURL + '/wxSchool/notify/getNotifyDetails',
+    NOTIFY_DETAIL_PARENT: _baseURL + '/wxSchool/notify/getNotify',
     //通知公告详情教师端
-    NOTIFY_DETAIL_TEACHER: _baseURL + '/wxSchool/notify/getNotifyDetailsByTeacher',
+    NOTIFY_DETAIL_TEACHER: _baseURL + '/wxSchool/notify/getNotify',
 
 
     //获取所有老师手机号

+ 4 - 4
frontend/wechat-web/src/modules/announce/AnnounceRelease.jsx

@@ -9,7 +9,7 @@ import 'css/announce.css'
 import {Toast} from 'antd-mobile'
 import TargetSelect from 'components/TargetSelect'
 import UploadEnclosure from 'components/UploadEnclosure'
-import {fetchGet, fetchPost} from "../../utils/fetchRequest";
+import {fetchGet, fetchPost,fetchPost2} from "../../utils/fetchRequest";
 import {_baseURL, API} from "../../configs/api.config";
 import {getIntValue, getStrValue, isObjEmpty} from "../../utils/common";
 import {connect} from 'react-redux'
@@ -240,9 +240,9 @@ class AnnounceRelease extends Component {
 
         this.isRequesting = true
         Toast.loading('正在发布...', 0)
-        fetchPost(API.NOTIFY_CREATE, {
-            jsonNotify: JSON.stringify(paramObj)
-        }).then(response => {
+        fetchPost2(API.NOTIFY_CREATE,
+            JSON.stringify(paramObj),
+            {"Content-Type": 'application/json;charset=UTF-8'}).then(response => {
             Toast.hide()
             Toast.success('发布成功', 1)
             clearListState()()

+ 14 - 4
frontend/wechat-web/src/modules/hiPages/approvel-detail/ApprovelDetail.js

@@ -22,6 +22,7 @@ class ApprovelDetail extends Component{
     constructor(){
         super();
         this.state = {
+            applyHeader:'',
             approveOpinion:'',
             showButton:false,
             AMvisible: false,
@@ -80,7 +81,7 @@ class ApprovelDetail extends Component{
         return(
             <div ref={node => this.node = node}>
                 <div className="headerDiv">
-                    <img className="headerImg" src={hi1_img} alt=""/>
+                    <img className="headerImg" src={this.state.applyHeader} alt=""/>
                     <div style={{marginTop:10}}>
                         <div style={{color:"#333333",fontSize:18}}>{this.state.docModel.proposer.value}</div>
                         <div style={{color:"#666666",fontSize:12,marginTop:10}}>{this.state.docModel.oaApprove.creatDate}</div>
@@ -239,9 +240,6 @@ class ApprovelDetail extends Component{
             isMyApply:this.props.match.params.isMyApply
         },function () {
 
-            if(this.state.isMyApply == true){
-                hi1_img = this.props.userInfo.userAvatar.length > 0 ? this.props.userInfo.userAvatar : hi1_img
-            }
             if(this.state.approveId == null || this.state.approveId == ''){
                 return
             }else {
@@ -274,6 +272,18 @@ class ApprovelDetail extends Component{
                             pictureList:pictureList
                         },function () {
                             console.log('pictureList',this.state.pictureList)
+                            if(this.state.isMyApply == true){
+                                let  applyHeader = this.props.userInfo.userAvatar.length > 0 ? this.props.userInfo.userAvatar : hi1_img
+                                this.setState({applyHeader})
+                            }else {
+                                let applyHeader
+                                if(response.data.proposer && response.data.proposer.photo){
+                                    applyHeader = response.data.proposer.photo
+                                }else {
+                                    applyHeader = hi1_img
+                                }
+                                this.setState({applyHeader})
+                            }
                         })
                         // console.log('showbutton',showbutton)
                         // console.log('approveStatus',approveStatus)

+ 17 - 30
frontend/wechat-web/src/modules/notificationCenter/NotifyBoardDetail.jsx

@@ -107,13 +107,13 @@ class NotifyBoardDetail extends Component {
                         {/*<div className='notify-detail-modal-time'>{notifyDetail.noTime}</div>*/}
                         <div className='gray-line'></div>
                         <div className='common-flex-row-10 common-font-family'>
-                            <span style={{color: '#363636',fontSize:14}}>接收人</span>
-                                {/*<span style={{fontSize: '12px', color: '#CD1D1D'}}>未读:{notifyDetail.unRead}</span>*/}
-                                <span style={{
-                                    fontSize: '12px',
-                                    color: '#666666',
-                                    marginLeft: '10px'
-                                }}>{getIntValue(notifyDetail.readed, 'length')}/{notifyDetail.allCount}</span>
+                            <span style={{color: '#363636', fontSize: 14}}>接收人</span>
+                            {/*<span style={{fontSize: '12px', color: '#CD1D1D'}}>未读:{notifyDetail.unRead}</span>*/}
+                            <span style={{
+                                fontSize: '12px',
+                                color: '#666666',
+                                marginLeft: '10px'
+                            }}>{getIntValue(notifyDetail.readed, 'length')}/{notifyDetail.allCount}</span>
                         </div>
                         <div>
                             {receiveItems}
@@ -126,32 +126,19 @@ class NotifyBoardDetail extends Component {
 
     obtainDetail = () => {
         let url = '', params = {}
-        if (this.role === 'teacher') {
-            url = API.NOTIFY_DETAIL_TEACHER
-            let id = this.props.userInfo.user.userFunId
-            if (this.searchParams && this.searchParams.teacherId) {
-                id = this.searchParams.teacherId
-            }
-            params = {
-                notifyId: this.notifyId,
-                teacherId: id
-            }
-        } else if (this.role === 'parent') {
-            url = API.NOTIFY_DETAIL_PARENT
-            let id = this.props.userInfo.user.student.stuId
-            if (this.searchParams && this.searchParams.stuId) {
-                id = this.searchParams.stuId
-            }
-            params = {
-                notifyId: this.notifyId,
-                stuId: id
-            }
-        } else {
-            return
+        url = API.NOTIFY_DETAIL_TEACHER
+        let id = this.props.userInfo.user.userFunId
+        if (this.searchParams && this.searchParams.teacherId) {
+            id = this.searchParams.personId
+        }
+        params = {
+            notifyId: this.notifyId,
+            personId: id,
+            type:this.role=='parent' ? 0 :1
         }
 
         Toast.loading('', 0)
-        fetchPost(url, params).then(response => {
+        fetchGet(url, params).then(response => {
             Toast.hide()
             if (response && response.data) {
                 let notifyBoBean = new NotifyBoBean()

+ 4 - 3
frontend/wechat-web/src/modules/notificationCenter/NotifyBoardParent.jsx

@@ -250,11 +250,12 @@ class NotifyBoardParent extends Component {
             notifyList.length = 0
         }
 
-        fetchPost(API.NOTIFY_LIST_PARENT, {
-            stuId: this.props.userInfo.user.student.stuId,
+        fetchGet(API.NOTIFY_LIST_PARENT, {
+            personId: this.props.userInfo.user.student.stuId,
             notifyStatus: 1,
             pageIndex: mPageIndex,
-            pageSize: mPageSize
+            pageSize: mPageSize,
+            type:0
         }).then(response => {
             Toast.hide()
             if (response && response.data) {

+ 8 - 6
frontend/wechat-web/src/modules/notificationCenter/NotifyBoardTeacher.jsx

@@ -383,11 +383,12 @@ class NotifyBoardTeacher extends Component {
             releaseList.length = 0
         }
 
-        fetchPost(API.NOTIFY_LIST_TEACHER, {
-            teacherId: this.props.userInfo.user.userFunId,
+        fetchGet(API.NOTIFY_LIST_TEACHER, {
+            personId: this.props.userInfo.user.userFunId,
             notifyStatus: 1,
             pageIndex: mReleaseIndex,
-            pageSize: mPageSize
+            pageSize: mPageSize,
+            type:1
         }).then(response => {
             if (response && response.data && response.data.create.length > 0) {
                 response.data.create.forEach((item, index) => {
@@ -454,11 +455,12 @@ class NotifyBoardTeacher extends Component {
             receiveList.length = 0
         }
 
-        fetchPost(API.NOTIFY_LIST_TEACHER, {
-            teacherId: this.props.userInfo.user.userFunId,
+        fetchGet(API.NOTIFY_LIST_TEACHER, {
+            personId: this.props.userInfo.user.userFunId,
             notifyStatus: 1,
             pageIndex: mReceiveIndex,
-            pageSize: mPageSize
+            pageSize: mPageSize,
+            type:1
         }).then(response => {
             if (response && response.data && response.data.notify.length > 0) {
                 response.data.notify.forEach((item, index) => {

+ 25 - 1
frontend/wechat-web/src/utils/fetchRequest.js

@@ -19,7 +19,6 @@ export function fetchPost(url, params, header) {
             // }
         }
     }
-
     const request = fetch(url, {
         method: 'POST',
         body: formData,
@@ -36,6 +35,31 @@ export function fetchPost(url, params, header) {
     return fetchResult(request)
 }
 
+export function fetchPost2(url, params, header){
+    if (window.navigator.onLine == false) {
+        return Promise.reject('网络连接失败,请检查网络连接')
+    }
+
+    if (isObjNull(header)) {
+        header = {}
+    }
+
+    const request = fetch(url, {
+        method: 'POST',
+        body: params,
+        mode: 'cors',
+        // credentials: 'include',
+        // cache: "force-cache",
+        headers: new Headers({
+            'Accept': 'application/json',
+            // "Content-Type": "application/x-www-form-urlencoded; charset=utf-8",
+            ...header
+        })
+    })
+
+    return fetchResult(request)
+}
+
 export function fetchGet(url, params, header) {
     if (window.navigator.onLine == false) {
         return Promise.reject('网络连接失败,请检查网络连接')