zoukankan      html  css  js  c++  java
  • 特别关心

    /*
          *特别关心
          */ 
          handleislike() {
            if(this.isCare) {
              //取消关注
              const h = this.$createElement;
              this.$msgbox({
                title: '消息',
                message: h('div', {
                  style:'text-align:center'
                }, [
                h('img', { 
                    attrs: {src: '../../static/images/animal.png'},
                    style:' 60px;height:52px;margin:0 auto;'
                  },null),
                  h('p', null, '确定取消关心吗?'),
                ]),
                showCancelButton: true,
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                customClass: 'careMsgBox',
                cancelButtonClass: 'cancelButtonStyle',
                confirmButtonClass: 'confirmButtonStyle',
                beforeClose: (action, instance, done) => {
                  done();
                  this.patientInfo.GzTag = ''
                  // this.list(1)
                }
              }).then(action => {
                //取消关注
                API.common.updateGz({
                  'adminId': this.userId, //医生ID
                  'patientId': this.patientId,//患者的id (必填)
                  'operateType': 0,//(操作类型 1:关注 0:取消关注) (必填)
                  'operateTag':'' //关注的标签
                }).then((res)=>{
                  if(res.code == 0) {
                    this.isCare = false
                  }
                }).catch((error)=>{
                  console.log(error)
                })
              }).catch(()=>{
    
              });
            }else {
              //增加关注
              this.$prompt('标签', '添加', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                inputPlaceholder: '请输入标签',
                customClass: 'careMsgBoxAdd',
                cancelButtonClass: 'cancelButtonStyle',
                confirmButtonClass: 'confirmButtonStyle',
              }).then(({ value }) => {
                if(!value) {
                  this.$message.error('标签不能为空!');
                }else if(value.toString().length<6){
                  this.addTag = value
                  API.common.updateGz({
                    'adminId': this.userId, //医生ID
                    'patientId': this.patientId,//患者的id (必填)
                    'operateType': 1,//(操作类型 1:关注 0:取消关注) (必填)
                    'operateTag': value //关注的标签
                  }).then((res)=>{
                    if(res.code == 0) {
                      this.isCare = true
                      this.$message({
                        type: 'success',
                        message: '关注成功!'
                      });
                      this.patientInfo.GzTag = value
                    }
                  }).catch((error)=>{
                    console.log(error)
                  })
                }else{
                  this.$message.error('标签长度不能大于5!')
                }
              }).catch(() => {
                this.$message({
                  type: 'info',
                  message: '取消输入'
                });       
              });
            }
          },
  • 相关阅读:
    JVM入门(一)
    2017目标
    2016目标
    C语言--第0次作业
    Hibernate ORM框架——续第一章:对象在Hibernate中的状态
    Hibernate ORM框架——续第一章:Java增删改查与Hibernate的增删改查的对比
    Hibernate ORM框架——续第一章:Hibernate的增删改查(第一个hibernate代码的优化)
    Hibernate ORM框架——第一章:Hibernate简介与操作基础
    改善SQL语句
    SQL Server的聚集索引和非聚集索引
  • 原文地址:https://www.cnblogs.com/xuyan1/p/8321078.html
Copyright © 2011-2022 走看看