Files
files_second/components/side.vue
2026-04-18 15:20:24 +08:00

98 lines
1.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="begin">
<view class="title">
<view>{{this.value[3]}}</view>
<view>{{this.value[4]}}</view>
</view>
<view class="content" v-html="this.value[5]">
</view>
<view class="who">
<view>
<image src="/static/组 341.png"></image><text>发帖人XXX</text>
</view>
<view>
评论数{{this.value[2]}}
</view>
</view>
<view class="comment">
<input type="text" placeholder="可评论" v-model="value_add" />
<text v-show="write_if">{{this.value_add_else}}</text>
</view>
<view class="add_comment">
<button @click="add()">添加评论</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
value: null,
value_add: null,
write_if:false,
value_add_else:null
}
},
methods: {
add() {
this.write_if=true
this.value_add_else=this.value_add
this.value_add=""
uni.showToast({
title: '发布成功',
icon:"success"
});
}
},
onLoad(option) {
const id = option.id
this.value = JSON.parse(decodeURIComponent(option.data))
console.log('id:', id)
console.log('完整数据:', this.value)
}
}
</script>
<style>
.begin {
margin: 10px;
}
.title {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
}
.content {
font-size: 0.8rem;
text-indent: 2em;
}
.who {
display: flex;
justify-content: space-between;
}
.who view {
display: flex;
align-items: center;
}
.who view image {
height: 30px;
width: 30px;
}
.comment {
margin: 10px;
}
.comment text{
}
</style>