export default {
	//金额分转换为元
	delMoney(money) {
		let newMoney = '';
		if (money) {
			if (typeof(money) == Number) {
				newMoney = (money / 100).toFixed(2)
			} else {
				newMoney = ((Number(money) / 100)).toFixed(2)
			}
		} else {
			newMoney = 0
		}
		return newMoney
	},

	//支付方式反显
	getPayType(type) {
		let value = '微信支付'
		switch (type) {
			case 3:
				value = '微信支付'
				break;
			case 2:
				value = '支付宝支付'
				break;
			case 10:
				value = '取货'
				break;
			case 11:
				value = '会员卡'
				break;
			default:
				break;
		}
		return value
	},
	testPrice(val) {
		let reg = /^\d+(\.([0-9]|\d[0-9]))?$/
		return reg.test(val)
	}
}