Merge branch 'dev' of http://git.sinoecare.com/sinoecare/digital_village_cp/dv_cp_wechat_app into dev
This commit is contained in:
		@@ -46,7 +46,8 @@
 | 
			
		||||
      <div class="leftInput" @click="showBottomInput = true">我来说两句...</div>
 | 
			
		||||
 | 
			
		||||
      <div class="righticon">
 | 
			
		||||
        <u-icon name="thumb-up"></u-icon>
 | 
			
		||||
        <u-icon name="thumb-up" @click="praise"></u-icon>
 | 
			
		||||
 | 
			
		||||
        <span class="icontext">赞</span>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
@@ -69,6 +70,8 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { mapState } from 'vuex'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'Detail',
 | 
			
		||||
  props: {},
 | 
			
		||||
@@ -79,15 +82,19 @@ export default {
 | 
			
		||||
      timestamp: '',
 | 
			
		||||
      showBottomInput: false,
 | 
			
		||||
      content: '',
 | 
			
		||||
      flag: false,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    ...mapState(['user']),
 | 
			
		||||
 | 
			
		||||
    commentCount() {
 | 
			
		||||
      return this.data.messages?.length || 0
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  watch: {},
 | 
			
		||||
  onLoad(o) {
 | 
			
		||||
    console.log(this.user)
 | 
			
		||||
    this.id = o.id
 | 
			
		||||
    this.getDetail()
 | 
			
		||||
    this.$dict.load('discussStatus')
 | 
			
		||||
@@ -115,7 +122,43 @@ export default {
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    publish() {},
 | 
			
		||||
    publish() {
 | 
			
		||||
      if (this.flag) return
 | 
			
		||||
      if (!this.content) {
 | 
			
		||||
        return this.$u.toast('请输入你的想法')
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      this.$http
 | 
			
		||||
        .post(`/app/appvillagediscussmessage/addOrUpdate`, {
 | 
			
		||||
          content: this.content,
 | 
			
		||||
          avatar: this.user.avatar,
 | 
			
		||||
          createUserId: this.user.id,
 | 
			
		||||
          createUserName: this.user.name,
 | 
			
		||||
          discussId: this.id,
 | 
			
		||||
        })
 | 
			
		||||
        .then((res) => {
 | 
			
		||||
          if (res?.code == 0) {
 | 
			
		||||
            this.$u.toast('留言成功')
 | 
			
		||||
            this.flag = true
 | 
			
		||||
            this.showBottomInput = false
 | 
			
		||||
            this.getDetail()
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    praise() {
 | 
			
		||||
      console.log('点赞')
 | 
			
		||||
      this.$http.post(`/app/appvillagediscussmessage/suport?id=${this.id}&userId=${this.user.id}`).then((res) => {
 | 
			
		||||
        if (res?.code == 0) {
 | 
			
		||||
          this.$u.toast('点赞成功!')
 | 
			
		||||
          this.getDetail()
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    a() {
 | 
			
		||||
      console.log(aa)
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    previewImage(images, img) {
 | 
			
		||||
      uni.previewImage({
 | 
			
		||||
@@ -322,6 +365,9 @@ export default {
 | 
			
		||||
            .uni-textarea-placeholder {
 | 
			
		||||
              padding: 16px 0 0 16px;
 | 
			
		||||
            }
 | 
			
		||||
            .uni-textarea-textarea {
 | 
			
		||||
              padding: 16px 0 0 16px;
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
          .words {
 | 
			
		||||
            background: #f7f7f7;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user