|
@@ -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} />
|