export default class VrCardManager {
    constructor(page) {
        this._page = page
        this._page.vrCardClickEvent = function (e) {
          const { vrlink, house } = e.currentTarget.dataset
          if (vrlink) {
            wx.navigateTo({
              url: `/pages/web/web?house_id=${house}&vr_link=${vrlink}&is_auto=1`,
            })
          } else {
            wx.navigateTo({
              url: `/pages/detail/detail?house_id=${house}`,
            })
          }
          
        }
    }

    async sendOneMsg({content, type}) {
      const { itemIndex } = await this._page.UI.showItemForMoment(this._page.imOperator.createNormalChatItem({
          type,
          content
      }));
     await this._page.sendMsg({
          content: this._page.imOperator.createChatItemContent({type, content}),
          itemIndex
      });
  }
  showMsg({msg}) {
    //UI类是用于管理UI展示的类。
    msg = Object.assign(msg, JSON.parse(msg.content))
    this._page.UI.updateViewWhenReceive(msg);
}
}