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: '取消输入'
                });       
              });
            }
          },
  • 相关阅读:
    20165212第八周学习总结
    20165212第八周课上测试补做
    20165212实验二面向对象程序设计
    Titanic生存预测
    聚类算法数据生成器make_blobs
    k-means
    监督学习、无监督学习与半监督学习
    在线Latex公式编辑器
    西瓜书课后习题——第四章
    ML经典数据集
  • 原文地址:https://www.cnblogs.com/xuyan1/p/8321078.html
Copyright © 2011-2022 走看看