liujq il y a 3 ans
Parent
commit
e374cc8ff1

+ 1 - 2
src/components/footer/index.js

@@ -36,11 +36,10 @@ export default class Footer extends Component {
         nickname: appUserInfo.nickName,
       }).then(res => {
         Taro.removeStorageSync('APP_needUsername')
-        console.log('更新成功~')
       })
     }
     Taro.api.other.notifycount().then(res => {
-      const notify = res.notify || ''
+      const notify = res.count || ''
       const { getNotify } = this.props
       if (getNotify) getNotify(notify)
       if (notify) {

BIN
src/pagesQa/msg/img/icon_sys.png


+ 30 - 1
src/pagesQa/msg/index.jsx

@@ -18,6 +18,7 @@ class Index extends Component {
       dataList: [],
       isRuleShow: false,
       curObj: {},
+      countObj: {},
     }
   }
 
@@ -28,6 +29,12 @@ class Index extends Component {
   componentWillMount () {
     Taro.$AHU(this)
     this.getDataList()
+    Taro.api.other.notifycount().then(res => {
+      const countObj = res || {}
+      this.setState({
+        countObj
+      })
+    })
   }
 
   componentDidShow () { }
@@ -82,6 +89,8 @@ class Index extends Component {
   }
 
   renderList () {
+    const { countObj } = this.state
+    const iconSys = require('./img/icon_sys.png')
     const { dataList, isListEnd, isListLoading, isListEmpty } = this.state
     const itemList = dataList.map((item, index) => {
       return (
@@ -93,7 +102,11 @@ class Index extends Component {
             <View className="sl-right">
               <View className="sl-p1">{item.nickname}</View>
               <View className="sl-p2">{item.message_content}</View>
-              <View className="sl-p3">{item.num}条消息未读</View>
+              {
+                item.num > 0
+                &&
+                <View className="sl-p3">{item.num}条消息未读</View>
+              }
               <View className="sl-r1">{item.format_update_at}</View>
             </View>
           </Navigator>
@@ -110,6 +123,22 @@ class Index extends Component {
         onScrollToLower={this.onScrollToLower.bind(this)}
       >
         <View className="scoped-list">
+          <View className="sl-item">
+            <Navigator url={`/pagesQa/msg/message`} className="sl-wrap">
+              <View className="sl-img">
+                <Image className="img" src={iconSys}></Image>
+              </View>
+              <View className="sl-right">
+                <View className="sl-p1">系统通知</View>
+                <View className="sl-p2">评论问答消息通知</View>
+                {
+                  countObj.notify_count > 0
+                  &&
+                  <View className="sl-p3">{countObj.notify_count}条消息未读</View>
+                }
+              </View>
+            </Navigator>
+          </View>
           {itemList}
         </View>
         <ListMore isListEnd={isListEnd} isListLoading={isListLoading} isListEmpty={isListEmpty} />

+ 4 - 0
src/pagesQa/msg/index.scss

@@ -13,9 +13,13 @@
   .sl-img {
     width: 120px;
     height: 120px;
+    border-radius: 50%;
+    overflow: hidden;
     .img {
       width: 120px;
       height: 120px;
+      border-radius: 50%;
+      overflow: hidden;
     }
   }
   .sl-right {