// 引入Vue
import Vue from 'vue';
Vue.mixin({
    methods:{
		back(delta = 1) {
			const canNavBack = getCurrentPages()
			delta = Number(delta);
			 //判断是否刷新了浏览器，刷新了浏览器，页面栈只有当前一个
			 if (canNavBack && canNavBack.length > delta) {
				 uni.navigateBack({
					 delta: delta
				 })
			 } else {
				history.go(-delta)
			 }
		},
        URLSearchParams(par){
			
			let npar = []
			for (let [key,value] of Object.entries(par)) {
				npar.push(key + '=' + value)
			}
			return npar.join('&')
		}
    }
})