word.js 3.9 KB
const ATT_TYPE = {
  TEXT: 1,
  IMAGE: 2,
  VEDIO: 3,
  URL: 4,
  MINIPROGRAM: 5,
  FILE: 6,
  ACTIVITY: 7,
  MATERIAL: 10
}
export default {
  data() {
    return {
      btnList: [
        {
          name: '表情',
          funcName: '',
          type: 'expression',
          limitSize: 10
        },
        {
          name: '图片',
          funcName: '',
          type: 'img',
          // limitPx: 1555200,
          // togetherItem: [ATT_TYPE.TEXT], //只允许文本和图片
          // limitSize: 10,    //限制图片大小
          // limitNum: 2,      //限制图片数量
          // limitWidth: 10000, //限制单张图片宽度
          // limitHeight: 10000,//限制单张图片高度
          // Isdraggable: true, //图片拖拽
          uploadApi: this.$apis.common.pictureUpload
        },
        // {
        //   name: '视频',
        //   funcName: '',
        //   type: 'video',
        //   limitSize: 10, //限制视频大小
        //   togetherItem: [ATT_TYPE.TEXT], //只允许文本和图片
        //   isReplace: 1, //限制视频数量
        //   limitWidth: 1280, //限制视频宽度
        //   limitHeight: 720, //限制视频高度
        //   limitTime: 30, //限制视频时长
        //   uploadApi: this.$apis.common.pictureUpload
        // },
        {
          name: '昵称',
          type: 'nickname',
          funName: 'nickname'
        },
        {
          name: '活动',
          type: 'activity',
          funName: 'activity',
          funParams: [
            {
              itemName: '权益卡试用',
              itemValue: 3,
              itemType: 'card',
              getInterfaceApi: this.$apis.welcomeword.getCard,
              params: {
                tryAble: 1,
                merchantId: this.$globalState.session.merchantId
              }
            },
            {
              itemName: '权益套餐',
              itemValue: 4,
              itemType: 'package',
              getInterfaceApi: this.$apis.welcomeword.getPackage,
              params: {}
            },
            {
              itemName: '商城券',
              itemValue: 2,
              itemType: 'coupon',
              getInterfaceApi: this.$apis.welcomeword.getMerchant,
              params: {
                discountTypes: [2, 3, 4],
                directionalFlag: 1, // 1所有人可用2定向礼包专用3关联优惠券
                validType: 'valid'
              }
            },
            {
              itemName: '秒杀活动',
              itemValue: 5,
              itemType: 'activity',
              getInterfaceApi: this.$apis.welcomeword.getActivity,
              params: {
                activityStatus: 2,
                currentPage: 1
              }
            },
            {
              itemName: '无忧服务',
              itemValue: 6,
              itemType: 'merchant',
              getInterfaceApi: this.$apis.welcomeword.merchant,
              merchantOpen: {
                merchantOpenApi: this.$apis.welcomeword.merchantOpen,
                params: {
                  merchantId: this.$globalState.session.merchantId
                }
              },
              params: {
                merchantId: this.$globalState.session.merchantId
              }
            }
          ]
        },
        {
          name: '素材',
          type: 'material',
          funName: 'material',
          groupListApi: this.$apis.welcomeword.getGroupListApi,
          materialListApi: this.$apis.welcomeword.getMaterialListApi,
          params: { createdType: 2 }
          // fileType: 1
          // videoNo: true,
          // pdfNo: true
        }
        // {
        //   name: '插入推荐频道',
        //   type: 'channelLink',
        //   funName: 'channelLink',
        //   getMerchantList: this.$apis.welcomeword.getMerchantList,
        //   channelPreview: this.$apis.welcomeword.channelPreview
        // }
      ]
    }
  }
}