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
}
// #ifdef MP-ALIPAY
// 引入消息模板方法   
// const { requestSubscribeMessage } = requirePlugin("subscribeMsg");
function SubscribeMsgAli(ids, cb) {//支付宝小程序订阅消息
	requestSubscribeMessage({ // 触发消息订阅弹框
		entityIds: ids, // 模板消息id，
		callback(res) {
			cb()
		}
	})
}
// #endif

export default {
	calcContentHeight,
	SystemInfo,
	getRect,
	getretailer,
	// #ifdef MP-ALIPAY
	SubscribeMsgAli
	// #endif
}