pc端微信打开订阅消息之事件对象e

用户在pc端微信中的订阅消息中打开评价消息,发现无法选中星级,

 

 点击下面的评价五角星,没有反应

 

 经查发现:

 mousedown(e) {
      console.log(e, 'mousedown====');
      // #ifdef H5
      if (!this.IsPC()) return;
      if (this.readonly || this.disabled) return;
      const { clientX } = e;
      let offsetLeft;
      if (e.currentTarget && e.currentTarget.offsetLeft) { // 模版消息打开的评价没有e.clientX
        offsetLeft = e.currentTarget.offsetLeft;
      }
      this.userLastRate = this.valueSync;
      this._getRateCount(clientX, offsetLeft);
      this.userRated = true;
      // #endif
    },

  

 const { clientX } = e;中并没有clientX, 而是这样的

 

 而此处的clienX需要使用  e.currentTarget.offsetLeft

 

 

posted @ 2021-12-15 11:51  time_knows  阅读(58)  评论(0编辑  收藏  举报