code: function device() {
      let ua = navigator.userAgent.toLowerCase(),
          width = window.innerWidth,
          height = window.innerHeight,
          platform = 'browser';
  
      // 判断平台信息
      if (ua.indexOf('micromessenger') > -1) {
          platform = 'wechat';
      } else if (ua.indexOf('android') > -1) {
          platform = 'android';
      } else if (/(iphone|ipad|ipod|ios)/.test(ua)) {
          platform = width === 375 && height === 812 ? 'iosx' : 'ios';
      }
  
      // 返回结果
      return {
          width,
          height,
          platform
      };
  }
docs: ****************************************
  获取设备信息
  ****************************************