MrShi
12 小时以前 ec9047869bd2642821d1dfc5bbd339313d910d66
bicycle/utils/utils.js
@@ -9,10 +9,13 @@
      Math.cos(
         rad2) * Math.pow(
         Math.sin(b / 2), 2)));
   s = s * 6378.137;
   s = Math.round(s * 10000) / 10000;
   s = s.toString();
   s = s.substring(0, s.indexOf('.') + 2);
   s = s * 6378.137 * 1000;
   s = (Math.round(s * 10000) / 10000).toFixed(2);
   console.log(s)
   // s = s.toString();
   // s = s.substring(0, s.indexOf('.') + 2);
   return s
}
@@ -36,4 +39,14 @@
      });
   })
   return promise;
}
}
// 手机号掩码,隐藏中间四位
export function maskPhone(phone) {
   const value = phone === null || phone === undefined ? '' : String(phone).trim()
   if (!value) {
      return ''
   }
   return value.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
}