保利威文档中心

幫助中心

PushCard 卡片推送

更新時間:2022-08-16 14:47:23

引入元件

import PushCard from '@polyv/interactions-launch-sdk-ui-default/lib/PushCard';

程式碼範例

<template>
    <!-- 建议弹窗宽度为 720px,弹窗内容高度为 500px -->
  <el-dialog
    v-if="checkInCore"
    :custom-class="'c-interactions-dialog c-interactions-dialog__h500'"
    width="720px"
    title="卡片推送"
    :visible.sync="visible"
    :close-on-click-modal="false"
  >
    <PushCard
      :lang="lang"
      :core="pushCardCore"
      :right="{
        sendResult: true,
        showHistoryEntry: false,
        download: false,
      }"
    />
  </el-dialog>
</template>

<script>
import PushCard from '@polyv/interactions-launch-sdk-ui-default/lib/PushCard';
import * as InteractionsLaunchSDK from '@polyv/interactions-launch-sdk';
// 弹窗组件可以选择其他 UI 库组件或自行开发,这里没有限制。
import { Dialog } from 'element-ui';

export default {
  components: {
    ElDialog: Dialog,
    PushCard,
  },
  data() {
    return {
      // 中英文设置 'zh_CN'/'en'
      lang: 'zh_CN',
      pushCardCore: null,
      visible: false,
    };
  },
  mounted() {
    // TODO: 关于初始化 InteractionsLaunchSDK 的其他设置
    this.PushCardCore = new InteractionsLaunchSDK.PushCard();
  }
};
</script>

Attributes

屬性名 類型 預設值 含義
core object null 卡片推送 SDK 實例
lang string 'zh_CN' 語言套件類型。取值範圍:
'zh_CN' 中文
'en' 英文
canStart boolean true 當前是否可以發起互動。
cantStartTips string '當前不可以發起互動' 如果當前不可以發起互動,點擊發起按鈕時的提示文案。
联系客服,在线咨询