ishop-ai-assistant
v1.1.25
Published
Ishop specific AI assistant (under development...)
Downloads
21
Maintainers
Readme
ishop-ai-assistant 组件库
快速开始
1. 安装
npm install ishop-ai-assistant --save
2. 引入
import Vue from "vue";
import ishopAiAssistant from "ishop-ai-assistant";
import "ishop-ai-assistant/ishop-ai-assistant.css";
Vue.use(ishopAiAssistant.install);
3. 使用
<template>
<div>
<ishop-ai-assistant v-if="aiAssistantVisible"
:env="env"
@close="closeAiAssistant"
@goBuy="goBuy"></ishop-ai-assistant>
</div>
</template>
<script>
export default {
data() {
env: 'dev',
aiAssistantVisible: false,
},
methods: {
// 关闭AI人工智能助手弹窗
closeAiAssistant() {
this.aiAssistantVisible = false
},
// AI人工智能助手购买续费
async goBuy() {
const userTel = JSON.parse(sessionStorage.getItem('userInfo')).TenantMobile
const uri = await getIshopUri(userTel)
const devUri = window.location.origin + '/#/'
const routerMode = process.env.NODE_ENV === 'development' ? devUri : uri
this.openLink(`${routerMode}buyAndRenewal?userTel=${userTel}`)
},
},
}
</script>