Przeglądaj źródła

Merge branch 'ChronicMag' of http://192.168.2.236:10080/zhouna/newICSS into ChronicMag

liucf 6 lat temu
rodzic
commit
d121b63193

+ 4 - 3
src/components/TreatDesc/DrugInfo/index.jsx

@@ -53,11 +53,12 @@ class DrugInfo extends Component {
     render() {
         const { drugInfo, hideDrugInfo, drugInfoList,hideDrugInfoMore } = this.props
         const { currentIndex } = this.state
+        {console.log('drugInfodrugInfo', drugInfo)}
         return (<div className={style['drug-info-wrapper']} id="drugWrapper">
                 <img src={close} onClick={hideDrugInfo} className={style['close-drug-desc']}/>
-                <h3 onMouseDown={this.setDragBox} id="drugTitle" className={style['drug-title']}>{drugInfo.title}说明书  </h3>
+                <h3 onMouseDown={this.setDragBox} id="drugTitle" className={style['drug-title']}>{drugInfo.tagType == 8 ? drugInfo.title+'说明书' : drugInfo.tagType == 10 ? drugInfo.title+ '说明': ''}</h3>
                 { drugInfo && drugInfo.drugDesc.length > 0 && <div className={style['drug-desc-wrapper']} id='drugDesc' onScroll={this.handleScrollModal.bind(this,  drugInfo.drugDesc)}>
-                    <div className={style['drug-title1']} >{drugInfo.title}说明书</div>
+                    <div className={style['drug-title1']} >{drugInfo.tagType == 8 ? drugInfo.title+'说明书' : drugInfo.tagType == 10 ? drugInfo.title+ '说明': ''}</div>
                     {drugInfo.drugDesc.map((item, index) =>{
                         return <div className={style['drug-desc-item']} id={item.title.trim()}>
                             <div className={style['drug-desc-title']} >{item.title.trim()}</div> 
@@ -83,7 +84,7 @@ class DrugInfo extends Component {
                 </div> }
                 { !drugInfo || (drugInfo && drugInfo.drugDesc.length === 0) && <div className={style['drug-desc-wrapper']}>
                     <div>
-                        该药品暂无说明
+                        {drugInfo.tagType == 8 ? '该药品暂无说明' : drugInfo.tagType == 10 ?'该不良反应暂无说明': ''}
                     </div>
                 </div> }
         </div>)

+ 3 - 2
src/store/actions/treat.js

@@ -58,10 +58,11 @@ export const setOtherDrug = (state, action) => {
 //药品说明
 export const setDrugInfo = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
-    const instroduce = action.instroduce;
+    const {instroduce, name, tagType} = action;
     res.drugInfo = {};
-    res.drugInfo.title = action.name;
+    res.drugInfo.title = name;
     res.drugInfo.drugDesc = instroduce;
+    res.drugInfo.tagType = tagType
     return res
 }
 

+ 4 - 2
src/store/async-actions/treat.js

@@ -318,13 +318,15 @@ export const getInstroduce = (item, type, position)=>{
                     dispatch({
                         type: SET_DRUG_INFO,
                         instroduce: data.data.data.introduceDetailList,
-                        name: type ==8 ?item.medicitionName : type == 10 ? item.tagName : ''
+                        name: type ==8 ?item.medicitionName : type == 10 ? item.tagName : '',
+                        tagType: type
                     })
                 } else {
                     dispatch({
                         type: SET_DRUG_INFO,
                         instroduce: [],
-                        name: item.medicitionName
+                        name: type ==8 ?item.medicitionName : type == 10 ? item.tagName : '',
+                        tagType: type
                     })
                 }