12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <template>
- <view>
- <uni-list v-for="(item,index) in list" :key="index">
- <!-- 头像显示圆点 -->
- <uni-list-chat clickable="true" :avatarCircle="true" :title="item.msgTitle" avatar="https://web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png" :note="item.msgContent" :time="item.datetime" :badge-positon="item.position" badge-text="dot" @click="gotoDetail(item)"></uni-list-chat>
- </uni-list>
- </view>
- </template>
- <script>
- import badgeMix from '@/mixins/tabbar-badge.js'
- export default {
- mixins: [badgeMix],
- data() {
- return {
- list: {}
- };
- },
- created() {
- this.getMsgList()
- },
- onShow() {
- this.getMsgList()
- },
- methods: {
- async getMsgList() {
- const {data: result} = await uni.$http.get('/education/mp-inner-msg/queryMsg')
- console.log(result)
- this.list = result.data.list
- },
- gotoDetail(item) {
- console.log("hh")
- uni.navigateTo({
- url: '/subpkg/message_detail/message_detail?item='+encodeURIComponent(JSON.stringify(item))
- })
- }
- }
- }
- </script>
- <style lang="scss">
- </style>
|