|
|
@@ -68,7 +68,7 @@ export function getRandomNum(minNum, maxNum) {
|
|
|
// 节流
|
|
|
export function debounce(fn, time) {
|
|
|
let handle
|
|
|
- return function(e) {
|
|
|
+ return function (e) {
|
|
|
// 取消之前的延时调用
|
|
|
clearTimeout(handle)
|
|
|
handle = setTimeout(() => {
|
|
|
@@ -123,7 +123,7 @@ export function getFormatDate(time, fmt, status) {
|
|
|
* 时间格式化
|
|
|
*/
|
|
|
// eslint-disable-next-line no-extend-native
|
|
|
-Date.prototype.Format = function(fmt = 'yyyy-MM-dd hh:mm:ss') {
|
|
|
+Date.prototype.Format = function (fmt = 'yyyy-MM-dd hh:mm:ss') {
|
|
|
const o = {
|
|
|
'M+': this.getMonth() + 1, // 月份
|
|
|
'd+': this.getDate(), // 日
|
|
|
@@ -197,11 +197,13 @@ export function isWxBrowser() {
|
|
|
/** *
|
|
|
* 是否是微信小程序
|
|
|
*/
|
|
|
-export async function isWxMiniapp() {
|
|
|
+export function isWxMiniapp() {
|
|
|
+
|
|
|
let status = false
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
- status = true
|
|
|
- // #endif
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ status = true
|
|
|
+ // #endif
|
|
|
+
|
|
|
// const ua = navigator.userAgent.toLowerCase()
|
|
|
// // ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
|
|
|
// // eslint-disable-next-line
|
|
|
@@ -218,6 +220,7 @@ export async function isWxMiniapp() {
|
|
|
// // 走不在小程序的逻辑
|
|
|
// status = false
|
|
|
// }
|
|
|
+
|
|
|
return status
|
|
|
}
|
|
|
|
|
|
@@ -430,10 +433,10 @@ export function weixinBase64src(base64data) {
|
|
|
filePath,
|
|
|
data: buffer,
|
|
|
encoding: 'binary',
|
|
|
- success: function(res) {
|
|
|
+ success: function (res) {
|
|
|
resolve(filePath)
|
|
|
},
|
|
|
- fail: function(err) {
|
|
|
+ fail: function (err) {
|
|
|
reject()
|
|
|
console.log(err)
|
|
|
}
|
|
|
@@ -476,7 +479,7 @@ export function copyText(str) {
|
|
|
|
|
|
uni.setClipboardData({
|
|
|
data: str,
|
|
|
- success: function() {
|
|
|
+ success: function () {
|
|
|
that.$msg('复制成功')
|
|
|
}
|
|
|
})
|