1、注册接收指令
// unicom 是组件内部订阅消息设置的
unicom: {
setSelectTicket (sender, seat, index) {
this.$nextTick(() => {
this.tickets[index].ticketArr.forEach(t => {
if(t.cabinInfoKey == seat.CabinInfoKey){
t.active = true;
this.chooseSeat({ index, seat: t, type: "F", isFirst: true });
}else{
t.active = false;
}
});
});
},
// onetrainbooking下一步弹框--免登录
unicom_handleNextDialogMdl(){
this.handleNextDialogMdl();
},
// onetrainbooking下一步弹框--免核验
unicom_handleNextDialogMhy(){
this.handleNextDialogMhy();
}
},
2、组件内发送指令
{
methods:{
method1 () {
// 发送 instruct1 指令,参数为 1, 2,3
this.$unicom('setSelectTicket ', 1, 2, 3)
}
}
}