修正完了error
This commit is contained in:
@@ -159,17 +159,17 @@ export default defineComponent({
|
||||
const videoid=ref(useRoute().query.id)
|
||||
const ifshow=ref(false)
|
||||
onMounted(async () => {
|
||||
reviewlist.value=await getcommentlist({type:2,id:videoid.value})
|
||||
reviewlist.value=await getcommentlist({type: 2,id: videoid.value})
|
||||
})
|
||||
|
||||
async function refresh(e?:any){
|
||||
async function refresh(e?: any){
|
||||
console.log("rekload")
|
||||
reviewlist.value=await getcommentlist({type:2,id:videoid.value})
|
||||
replylist.value=await getcommentlist({type:3,id:e})
|
||||
reviewlist.value=await getcommentlist({type: 2,id: videoid.value})
|
||||
replylist.value=await getcommentlist({type: 3,id: e})
|
||||
}
|
||||
const stars=ref<Array<number>>([])
|
||||
console.log(prop.score)
|
||||
let score1=ref<any>(prop.score)
|
||||
const score1=ref<any>(prop.score)
|
||||
// console.log(score1)
|
||||
if(score1.value==5){
|
||||
for(let i=0;i < score1.value ; i++){
|
||||
@@ -187,13 +187,13 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function reply(e?:string){
|
||||
function reply(e?: string){
|
||||
console.log(155)
|
||||
context.emit("replying",{name:e,replyid:prop.replyid,score:prop.score})
|
||||
context.emit("replying",{name: e,replyid: prop.replyid,score: prop.score})
|
||||
}
|
||||
async function findall(e :number){
|
||||
async function findall(e: number){
|
||||
console.log("all")
|
||||
replylist.value =await getcommentlist({type:3,id:e})
|
||||
replylist.value =await getcommentlist({type: 3,id: e})
|
||||
ifshow.value=ifshow.value==false?true:false
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -102,39 +102,39 @@ import store from '@/store';
|
||||
import { defineComponent, ref } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
props:{
|
||||
photo:{
|
||||
type:String
|
||||
props: {
|
||||
photo: {
|
||||
type: String
|
||||
},
|
||||
username:{
|
||||
type:String
|
||||
username: {
|
||||
type: String
|
||||
},
|
||||
score:{
|
||||
type:Number,
|
||||
score: {
|
||||
type: Number,
|
||||
},
|
||||
content:{
|
||||
type:String
|
||||
content: {
|
||||
type: String
|
||||
},
|
||||
date:{
|
||||
type:String
|
||||
date: {
|
||||
type: String
|
||||
},
|
||||
memberid:{
|
||||
type:Number
|
||||
memberid: {
|
||||
type: Number
|
||||
},
|
||||
replyid:{
|
||||
type:Number
|
||||
replyid: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
setup(prop,context){
|
||||
const myid=ref<number>(store.state.userinfo.memberid)
|
||||
function reply(e?:string){
|
||||
function reply(e?: string){
|
||||
console.log(155)
|
||||
context.emit("replying",{name:e,replyid:prop.replyid,score:prop.score})
|
||||
context.emit("replying",{name: e,replyid: prop.replyid,score: prop.score})
|
||||
}
|
||||
console.log(1)
|
||||
async function del(e?: number){
|
||||
console.log(e)
|
||||
let res=await delreply(e)
|
||||
const res=await delreply(e)
|
||||
if(res.code==0){
|
||||
context.emit("reload",prop.replyid)
|
||||
}
|
||||
|
||||
@@ -98,13 +98,13 @@ import { useRoute } from 'vue-router';
|
||||
import ReviewItem from "./ReviewItem.vue"
|
||||
|
||||
export default defineComponent({
|
||||
components:{
|
||||
components: {
|
||||
ReviewItem
|
||||
|
||||
},
|
||||
props:{
|
||||
videoid:{
|
||||
type:Number
|
||||
props: {
|
||||
videoid: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
setup(prop,context){
|
||||
@@ -114,16 +114,16 @@ export default defineComponent({
|
||||
const replylist =ref({})
|
||||
const videoid=ref(useRoute().query.id)
|
||||
onMounted(async () => {
|
||||
reviewlist.value=await getcommentlist({type:2,id:videoid.value})
|
||||
reviewlist.value=await getcommentlist({type: 2,id: videoid.value})
|
||||
})
|
||||
console.log(useRoute().query)
|
||||
console.log(store.state.userinfo.memberid,"userifno")
|
||||
interface SendData{
|
||||
type?:number,
|
||||
cid?:number,
|
||||
teacherid?:number,
|
||||
score?:number,
|
||||
content?:string
|
||||
type?: number;
|
||||
cid?: number;
|
||||
teacherid?: number;
|
||||
score?: number;
|
||||
content?: string;
|
||||
}
|
||||
function send(){
|
||||
const data = ref<SendData>({})
|
||||
@@ -136,10 +136,10 @@ export default defineComponent({
|
||||
addcomment(toRaw(data.value))
|
||||
|
||||
}
|
||||
async function refresh(e?:any){
|
||||
async function refresh(e?: any){
|
||||
console.log("rekload")
|
||||
reviewlist.value=await getcommentlist({type:2,id:videoid.value})
|
||||
replylist.value=await getcommentlist({type:3,id:e})
|
||||
reviewlist.value=await getcommentlist({type: 2,id: videoid.value})
|
||||
replylist.value=await getcommentlist({type: 3,id: e})
|
||||
}
|
||||
const reply: (val: number) => void = (val: number) => {
|
||||
console.log("收到子组件事件", val)
|
||||
@@ -148,7 +148,7 @@ export default defineComponent({
|
||||
const haslist=ref([])
|
||||
const findreply: (e: any) => void = async (e: any) => {
|
||||
console.log("收到子组件事件", e)
|
||||
replylist.value=await getcommentlist({type:3,id:e})
|
||||
replylist.value=await getcommentlist({type: 3,id: e})
|
||||
}
|
||||
console.log(1)
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user