Commit 48d485893a86e9490cc70c2c7320863badb1fcd6

Authored by vking
1 parent 7a1fc25d

chatbot

... ... @@ -13,6 +13,7 @@
"pages/reserve/index_yy",
"pages/me/index",
"pages/me/concat",
"pages/me/chat",
"pages/me/setting",
"pages/me/list",
"pages/reserve/search",
... ... @@ -156,6 +157,10 @@
"vktool": {
"version": "2.1.9",
"provider": "wxd3dc4206c76f14fc"
},
"chatbot": {
"version": "1.2.8",
"provider": "wx8c631f7e9f2465e1"
}
},
"navigateToMiniProgramAppIdList": [
... ...
// components/userinfo/chatbot.js
var plugin = requirePlugin("chatbot");
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
userinfo(e){
let wechat=e.detail
wechat.openid=wechat.openid||getApp().openid
console.log('userinfo',wechat)
plugin.init({
appid: "sjAZRgrwD86PlVtpMnW16LR1TYy9hi",
openid: wechat.openid, // 小程序的openid,必填项
success: () => {
wx.navigateTo({
url: '/pages/me/chat'
});
},
fail: (error) => {},
guideList: [],
textToSpeech: false, //默认为ture打开状态
background: "rgba(247,251,252,1)",
guideCardHeight: 40,
operateCardHeight: 60,
history: true,
navHeight: 0,
//robotHeader: "http://tulue-images.vking.wang/logo.png",
userHeader: wechat.avatarUrl,
userName: wechat.nickName,
hideMovableButton: false,
});
}
}
})
... ...
{
"component": true,
"usingComponents": {
"userinfo": "/components/userinfo/userinfo"
}
}
\ No newline at end of file
... ...
<!--components/userinfo/chatbot.wxml-->
<userinfo binduserinfo="userinfo">
<slot></slot>
</userinfo>
... ...
/* components/userinfo/chatbot.wxss */
\ No newline at end of file
... ...
... ... @@ -7,6 +7,7 @@
"userinfo": "/components/userinfo/userinfo",
"manager": "/components/manager/manager",
"nav":"/components/nav/nav",
"chatbot":"/components/userinfo/chatbot",
"card":"/components/seller-card/seller-card",
"formids":"/components/formids/formids",
"sb-tr":"/components/reserve/seller-box-transverse/seller-box",
... ...
... ... @@ -87,8 +87,16 @@
<view class="icon">
<icon type="warn" size="47" color="#999999"/>
</view>
<view class="title Medium" style="font-size: 36rpx;">抱歉!</view>
<view class="info Medium" style="font-size: 36rpx;color: #353535;">{{detail.cancel.desc=='订单长时间未处理,已过时段'?'餐厅生意繁忙,不能及时处理您的订单':'您相中的餐厅包间已经订满'}}</view>
<view class="title Medium" style="font-size: 36rpx;margin-bottom: 42rpx;">包间已订满</view>
<view class="info" style="font-size: 30rpx;color: #353535; width: 100% ; text-align: left;height: auto;margin-bottom: 40rpx;">
<view>1、包间状态会实时更新,周到安排可帮忙抢订;</view>
<view>2、周到安排拥有全市包间资源,可为您推荐更多优质餐厅。</view>
</view>
<view class="flex-lr share-view-cookbook">
<chatbot class="share-but-view">
<view class="share-but flex-cc Medium">帮我<view class="qing"></view>订</view>
</chatbot>
</view>
</block>
</block>
</view>
... ...
... ... @@ -335,4 +335,12 @@
text-align: center;
margin-top: 60rpx;
}
.qing{
background-image: url("http://nosqn.colorcun.com/qiang2.png");
background-size: 100% 100%;
width: 48rpx;
height: 48rpx;
margin-right: 6rpx;
margin-left: 6rpx;
}
\ No newline at end of file
... ...
// miniprogram/pages/me/chat.js
var plugin = requirePlugin("chatbot");
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var chat = plugin.getChatComponent();
chat.setTextToSpeech(false);
//chat.editFoucs(true);
return;
chat.send('人工服务')
setTimeout(()=>{
chat.send('maomao de mao')
},300)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
})
\ No newline at end of file
... ...
{
"usingComponents": {
"chat": "plugin://chatbot/chat",
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
... ...
<!--miniprogram/pages/me/chat.wxml-->
<view style="height: 100vh;">
<nav hasHome>周到安排</nav>
<chat></chat>
</view>
... ...
/* miniprogram/pages/me/chat.wxss */
\ No newline at end of file
... ...
... ... @@ -621,7 +621,7 @@
"id": 71,
"name": "pages/reserve/detail",
"pathName": "pages/reserve/detail",
"query": "id=1&_activeTab=reserve&_date=2020-02-16&_pnum=6",
"query": "id=1&activeTab=reserve&_date=2020-02-16&_pnum=6",
"scene": null
},
{
... ...