function calcContentHeight(chaliang) {
    let contentHeight = 0
    uni.getSystemInfo({
        success(res) {
            contentHeight = res.windowHeight - 40 - chaliang
        }
    })
    return contentHeight
}
function SystemInfo(){//获取屏幕宽高
	let SystemInfo = {}
	uni.getSystemInfo({
		success(res) {
			SystemInfo.windowWidth = res.windowWidth
			SystemInfo.windowHeight = res.windowHeight
		}
	})
	return SystemInfo
}
function getRect(selector){//获取元素的信息
		return new Promise((resolve) => {
			let view = uni.createSelectorQuery().select(selector);
			view.fields({
				size: true,
				rect: true,
				scrollOffset:true
			}, (res) => {
				resolve(res);
			}).exec();
		})
	}
function getretailer(){//判断是否是分销商
	let isdistributor  = false
	let mall_UserInfo = uni.getStorageSync("mall_UserInfo")?uni.getStorageSync("mall_UserInfo"):{};
	if(mall_UserInfo.IsDistrbutorUser && mall_UserInfo.IsDistrbutorUser ==1){
		isdistributor = true
	}
	return isdistributor
}

export default {
    calcContentHeight,
	SystemInfo,
	getRect,
	getretailer
}