You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zhishifufei_uniapp/pages/my/noticeDetail.vue

99 lines
1.9 KiB

9 months ago
<template>
<BaseContainer>
<NavBar :title="info.message_types.name" />
9 months ago
<view class="info">
<view class="info-box flex flex-center-x">
<image :src="info.message_types.pic" mode="aspectFill"></image>
9 months ago
<view class="box-content">
<view>{{ info.message_types.name }}</view>
<view>{{ info.message_types.update_time }}</view>
9 months ago
</view>
</view>
<mp-html
v-if="!!info.content"
class="swiper-conter"
container-style="padding: 30rpx;background: #ffffff;"
:content="info.content"
></mp-html>
</view>
</BaseContainer>
</template>
<script>
9 months ago
import { setReaded } from '@/api/user';
9 months ago
import mpHtml from "mp-html/dist/uni-app/components/mp-html/mp-html.vue";
export default {
components: {
mpHtml,
},
data() {
return {
info: {},
};
},
onLoad(options) {
console.log(options);
this.info = options.info ? JSON.parse(options.info) : {};
console.log(this.info);
9 months ago
this.setReaded();
9 months ago
},
methods: {
9 months ago
async setReaded() {
if (this.info.is_read === 1) {
return;
}
try{
await setReaded({ id: this.info.id});
9 months ago
}catch(e){
//TODO handle the exception
}
},
9 months ago
},
};
</script>
<style scoped lang="scss">
::v-deep {
._root {
width: 690rpx;
margin: 20rpx auto 0;
padding: 60rpx 40rpx!important;
}
}
.info {
width: 690rpx;
margin: 10rpx auto 0;
background: #FFFFFF;
border-radius: 10rpx;
.info-box {
padding: 45rpx 0 15rpx;
border-bottom: 1rpx solid #E6E6E6;
image {
width: 83rpx;
height: 83rpx;
flex-shrink: 0;
margin-right: 20rpx;
}
.box-content {
flex: 1;
view {
color: #999999;
font-size: 20rpx;
line-height: 20rpx;
&:first-child {
color: #333;
font-size: 30rpx;
line-height: 30rpx;
margin-bottom: 20rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
}
</style>