|
|
|
|
@ -9,8 +9,10 @@ Page({
|
|
|
|
|
list:[
|
|
|
|
|
{
|
|
|
|
|
id:-1,
|
|
|
|
|
type:'text'
|
|
|
|
|
}
|
|
|
|
|
type:'text',
|
|
|
|
|
isUp:false,
|
|
|
|
|
isDown:false,
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
@ -73,16 +75,67 @@ Page({
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleEvent(e){
|
|
|
|
|
console.log('handleEvent',e);
|
|
|
|
|
let that = this;
|
|
|
|
|
that.animate();
|
|
|
|
|
that.setData({
|
|
|
|
|
eventType:e.currentTarget.dataset.type == 'input' ? 'voice':'input'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleUp(e){
|
|
|
|
|
let that = this;
|
|
|
|
|
that.animate();
|
|
|
|
|
const list = [...that.data.list];
|
|
|
|
|
const index = e.currentTarget.dataset.index;
|
|
|
|
|
list[index].isUp = !list[index].isUp;
|
|
|
|
|
that.setData({
|
|
|
|
|
list: list
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleDown(e){
|
|
|
|
|
let that = this;
|
|
|
|
|
that.animate();
|
|
|
|
|
const list = [...that.data.list];
|
|
|
|
|
const index = e.currentTarget.dataset.index;
|
|
|
|
|
list[index].isDown = !list[index].isDown;
|
|
|
|
|
that.setData({
|
|
|
|
|
list: list
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleCopy(e){
|
|
|
|
|
let that = this;
|
|
|
|
|
that.animate();
|
|
|
|
|
const index = e.currentTarget.dataset.index;
|
|
|
|
|
let content = that.data.list[index].content; // 获取要复制的内容
|
|
|
|
|
if(index == 0){
|
|
|
|
|
content = "Hi,我是大鹏,你的智能工作助理。以后找工作不用跟老板谈了,直接来跟大鹏谈。来说说你的要求,我们开始吧…"
|
|
|
|
|
}
|
|
|
|
|
wx.setClipboardData({
|
|
|
|
|
data: content,
|
|
|
|
|
success: function (res) {
|
|
|
|
|
wx.showToast({
|
|
|
|
|
title: '复制成功',
|
|
|
|
|
icon: 'success',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
fail: function (res) {
|
|
|
|
|
wx.showToast({
|
|
|
|
|
title: '复制失败',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleShare(){
|
|
|
|
|
let that = this;
|
|
|
|
|
that.animate();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
animate($type='light') {
|
|
|
|
|
wx.vibrateShort({
|
|
|
|
|
type:$type
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
})
|