3 changed files with 96 additions and 0 deletions
@ -0,0 +1,55 @@ |
|||
<template> |
|||
<view> |
|||
<view class="message-list"> |
|||
<view class="message-item" v-for="(item, i) in messageList" :key="i" @click="navClickHandler(item)"> |
|||
<image src="/static/images/hpic.jpg" class="message-img"></image> |
|||
<text>{{item.title}}</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
messageList:[] |
|||
}; |
|||
}, |
|||
onLoad() { |
|||
this.getMessageList(); |
|||
}, |
|||
methods:{ |
|||
async getMessageList() { |
|||
|
|||
const { |
|||
data: res |
|||
} = await uni.$http.post('/small/project/message/listAll') |
|||
if (!res.success) return uni.$showMsg() |
|||
|
|||
this.messageList = res.data |
|||
|
|||
}, |
|||
navClickHandler(item) { |
|||
uni.navigateTo({ |
|||
url: '/subpkg/messageInfo/messageInfo?content='+item.content |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.message-list { |
|||
margin: 12px 0; |
|||
|
|||
.message-img { |
|||
width: 99%; |
|||
height: 140rpx; |
|||
margin-bottom: 10rpx; |
|||
border-radius: 10px; |
|||
} |
|||
} |
|||
|
|||
|
|||
</style> |
|||
@ -0,0 +1,25 @@ |
|||
<template> |
|||
<view> |
|||
<view v-html="content"></view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
content:"" |
|||
}; |
|||
}, |
|||
onLoad(options) { |
|||
this.content = options.content; |
|||
}, |
|||
methods:{ |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
|
|||
</style> |
|||
Loading…
Reference in new issue