clewWordDialog.vue 4.25 KB
<template>
  <GLDialog :mode="mode" title="线索喜报配置" :before-close="handlebattleClose" :visible.sync="isDialogVisible" @onOk="handlebattleConfirm" @onCancel="handlebattleClose">
    <div class="popup-wrap">
      <div class="left-wrap">
        <div class="img-wrap">
          <img src="@/assets/buttetin/clew.png" />
        </div>
        <p class="color-3 txt-center text-14">图示效果</p>
      </div>
      <div class="right-wrap">
        <el-form ref="form" :model="form" label-width="154px">
          <div class="item-line">
            <el-form-item label="编辑文本:" class="verbal-wrap">
              <verbal :btnList="btnList" :maxNum="200" :mapList="mapList" ref="verbalRef"></verbal>
            </el-form-item>
          </div>
        </el-form>
        <div class="explain">
          <div class="color6 weight-6 font-14">
            <i class="el-icon-warning"></i>
            推送机制说明
          </div>
          <p class="mrp">
            主要推送以下2个场景:
            <br />
            1.当客户在C端小程序商城浏览某个商品或活动超过10秒;
            <br />
            2.客户发起订单支付但最终未支付。
          </p>
        </div>
      </div>
    </div>
  </GLDialog>
</template>

<script>
export default {
  props: {
    content: {
      type: String,
      default: ''
    },
    isDialogVisible: Boolean
  },
  data() {
    return {
      mode: 'big',
      btnList: [
        {
          type: 1,
          name: '表情'
        },
        {
          type: 2,
          name: '客户姓名'
        },
        {
          type: 2,
          name: '手机号'
        },
        {
          type: 2,
          name: '线索来源'
        },
        {
          type: 2,
          name: '具体线索'
        },
        {
          type: 2,
          name: '浏览时长'
        },{
          type:2,
          name:'线索归属'
        }
      ],
      mapList: {
        客户姓名: '${customerName}',
        手机号: '${phone}',
        线索来源: '${source}',
        具体线索: '${clue}',
        浏览时长: '${browseTime}',
        线索归属: '${staff}'
      }
    }
  },
  created() {
    this.$nextTick(() => {
        this.$refs.verbalRef && this.$refs.verbalRef.update(this.content)
      })
  },
  methods: {
    handlebattleConfirm() {
      this.isDialogVisible = false
      let content = this.$refs.verbalRef.getTextValue()

      this.$emit('handlePreview', { data: content })
    },
    handlebattleClose() {
      this.$emit('handleClose')
    }
  }
}
</script>

<style lang="scss" scoped>
.popup-wrap {
  display: flex;
  padding: 0 72px;
  .img-wrap {
    width: 250px;
    height: 560px;
    margin-bottom: 14px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .right-wrap {
    margin-top: 12px;
    /deep/.el-form-item {
      margin-bottom: 0px;
    }
    .item-line {
      margin-bottom: 20px;
    }
    .switchStyle /deep/ .el-switch__label {
      position: absolute;
      display: none;
      color: #fff;
      font-size: 12px !important;
      line-height: 20px;
    }
    .el-switch__core {
      background-color: rgba(166, 166, 166, 1);
    }
    .switchStyle /deep/.el-switch__label--left {
      z-index: 9;
      left: 20px;
    }
    .switchStyle /deep/ .el-switch__label--right {
      z-index: 9;
      left: 4px;
    }
    .switchStyle /deep/ .el-switch__label.is-active {
      display: block;
    }
    .switchStyle /deep/ .el-switch__core {
      width: 56px !important;
    }
    .switchStyle /deep/ .el-switch__label {
      width: 56px !important;
    }
    .explain {
      width: 486px;
      background: #f4f6fc;
      padding: 16px;
      margin-left: 70px;
      box-sizing: border-box;
      position: absolute;
      bottom: 85px;
      .el-icon-warning {
        width: 16px;
        height: 16px;
        margin-right: 4px;
      }
      .mrp {
        margin: 8px 0 0 20px;
        line-height: 22px;
      }
    }
  }
  .warn {
    font-size: 12px;
    color: #999999;
    margin-left: 154px;
  }
  .verbal-wrap {
    /deep/ .el-form-item__content {
      width: 448px;
    }
    /deep/ .btn-group-panel .btn-group {
      flex-wrap: wrap;
      justify-content: none;
      .add-btn {
        margin-bottom: 5px;
      }
    }
  }
}
</style>