charactersDialog.vue 4.69 KB
<template>
  <GLDialog :mode="mode" title="#3.文字喜报 预览配置显示字段" :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/characters.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="2000" :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">仅推送太阳膜品类的产品,驻店新建下单或扫码下单,客户支付成功后产生有效订单时自动推送, 订单金额低于1元时四舍五入为0元产值订单进行推送,测试订单不推送</p>
        </div>
      </div>
    </div>
  </GLDialog>
</template>

<script>
import dialog from './dialog'
export default {
  mixins: [dialog],
  data() {
    return {
      mode: 'big',
      wordType: {
        switchType: 701,
        switchText: ''
      },
      btnList: [
        {
          type: 1,
          name: '表情'
        },
        {
          type: 2,
          name: '销售顾问'
        },
        {
          type: 2,
          name: '客户姓名'
        },
        {
          type: 2,
          name: '车型'
        },
        {
          type: 2,
          name: '订单总金额'
        },
        {
          type: 2,
          name: '阳光激励费'
        },
        {
          type: 2,
          name: '商品名称'
        }
      ],
      params: ['wordType'],
      mapList: {
        销售顾问: '${employeeName}',
        客户姓名: '${customerName}',
        车型: '${carType}',
        订单总金额: '${totalPrice}',
        阳光激励费: '${sunshineInspiration}',
        商品名称: '${goodsNames}'
      }
    }
  },

  methods: {
    initData() {
      this.switchList.wordReport.forEach(i => {
        this.params.find(data => {
          if (this[data].switchType == i.switchType) {
            this[data] = this.$common.utils.deepClone(i)
          }
        })
      })
      this.$nextTick(() => {
        this.$refs.verbalRef && this.$refs.verbalRef.update(this.wordType.switchText)
      })
    },
    handlebattleConfirm() {
      this.isDialogVisible = false
      let switchList = []
      this.params.forEach(data => {
        if (data == 'wordType') this[data].switchText = this.$refs.verbalRef.getTextValue()
        switchList.push(this[data])
      })
      this.$emit('handlePreview', { key: 'wordReport', data: switchList })
    }
  }
}
</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>