const typeConst = {
	'wx':1
};

export default {

	const:typeConst,

	confirm:function (data,type=typeConst.wx) {

		if (typeof data !== 'object') data={title};

		if (data.confirmColor === undefined) {
			data.confirmColor = '#8DD4BD';
		}

		if (data.cancelColor === undefined) {
			data.cancelColor = '#999';
		}

		data.success = function (res) {
			if (res.confirm) {
				this.confirm && this.confirm();
			} else {
				this.cancel && this.cancel();
			}
		}.bind(data);

		return this[type] && this[type](data);
	},

	[typeConst.wx]:function (data) {
		return uni.showModal(data);
	},

}
