This commit is contained in:
@jyuhsin
2025-05-06 17:44:32 +08:00
parent 693c9ccef7
commit a4b25fda54
14 changed files with 620 additions and 25 deletions
@@ -0,0 +1,56 @@
<template>
<view class="container">
<h3 class="container-title">{{ viewData?.title }}</h3>
<view class="container-sub-title">
<span>阅读 {{ viewData?.readCount }}</span>
<span style="margin-left: 30px">{{ moment(viewData?.publishTime).format('YYYY年MM月DD日 HH:mm') }}</span>
</view>
<view v-html="viewData?.content"></view>
</view>
</template>
<script setup>
import {ref, reactive, onMounted, computed, h} from 'vue';
import {onLoad} from "@dcloudio/uni-app";
import {Toast} from "tdesign-mobile-vue";
import {useRequest} from "@/utils/request";
import moment from "moment";
const request = useRequest()
const momentId = ref(null);
const viewData = ref(null);
function getWonderfulMoment() {
request.post('/platform/activity/wonderfulMoment/getWonderfulMomentById/' + momentId.value).then(res=>{
if(res.code === 0){
viewData.value = res.data
}else{
Toast({message: res.msg, theme: 'error'});
}
})
}
onLoad((option) => {
if (option.id) {
momentId.value = Number(option.id);
getWonderfulMoment()
}
});
onMounted(() => {
});
</script>
<style scoped lang="less">
.container {
padding: 10px;
background-color: white !important;
min-height: 100%;
}
.container-sub-title {
margin-top: 20px;
color: #C9C9C9;
margin-bottom: 20px;
}
</style>