26495
This commit is contained in:
		@@ -32,7 +32,7 @@
 | 
			
		||||
        <div flex class="header">
 | 
			
		||||
          <u-avatar :src="op.avatar" size="48" />
 | 
			
		||||
          <b class="fill" v-text="op.createUserName" />
 | 
			
		||||
          <u-icon name="thumb-up" :label="op.suport" />
 | 
			
		||||
          <u-icon name="thumb-up" :label="op.suport" :color="op.isSuport ? 'red' : '#ccc'"  @click="like(op.id)" />
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="content" v-text="op.content" />
 | 
			
		||||
        <div class="content color-999" v-text="op.createTime" />
 | 
			
		||||
@@ -108,9 +108,14 @@ export default {
 | 
			
		||||
          this.data = {
 | 
			
		||||
            ...res.data,
 | 
			
		||||
            avatar: res.data.createUserName?.substr(0, 2) || '游客',
 | 
			
		||||
            messages: res.data.messages || [],
 | 
			
		||||
            messages: res.data.messages.map(v => {
 | 
			
		||||
              return {
 | 
			
		||||
                ...v,
 | 
			
		||||
                isSuport: v.suportUser ? v.suportUser.indexOf(this.user.id) > -1 : false
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
          this.data.images = JSON.parse(res.data.images) || []
 | 
			
		||||
          this.data.images = JSON.parse(res.data.images)
 | 
			
		||||
          this.isAnnouncer = this.user.id === res.data.createUserId
 | 
			
		||||
 | 
			
		||||
          var discussTime = (new Date(res.data.discussDeadline).getTime() * 1) / 1000
 | 
			
		||||
@@ -122,6 +127,26 @@ export default {
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    like (id) {
 | 
			
		||||
      this.$loading()
 | 
			
		||||
      this.$http.post(`/app/appvillagediscussmessage/suport?id=${id}&userId=${this.user.id}`).then(res => {
 | 
			
		||||
        this.$hideLoading()
 | 
			
		||||
        if (res.code === 0) {
 | 
			
		||||
          this.$u.toast('点赞成功')
 | 
			
		||||
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.getDetail()
 | 
			
		||||
          })
 | 
			
		||||
        } else {
 | 
			
		||||
          this.$u.toast(res.msg)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      }).catch((e) => {
 | 
			
		||||
        this.$hideLoading()
 | 
			
		||||
        this.$u.toast(e)
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    publish() {
 | 
			
		||||
      if (this.flag) return
 | 
			
		||||
      if (!this.content) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user