cashier_app/pageMarket/utils/couponUtils.js

67 lines
983 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 优惠券通用的一些方法
export const emunList = {
couponTypes: [{
label: '满减券',
value: 1,
},
{
label: '商品兑换券',
value: 2,
},
{
label: '折扣券',
value: 3,
},
{
label: '第二件半价券',
value: 4,
},
{
label: '消费送券',
value: 5,
},
{
label: '买一送一券',
value: 6,
},
{
label: '固定价格券',
value: 7,
},
{
label: '免配送费券',
value: 8,
}
],
getType: [{
label: '不可自行领取',
value: 'no'
},
{
label: '可领取',
value: 'yes'
}
],
validType: [{
label: '领券后有效期内可用',
value: 'fixed'
},
{
label: '固定有效期范围内可用',
value: 'custom'
}
]
}
/**
* key对应上面emunList属性名value对应属性value
*/
export const getEmunListLabel = (key, value) => {
let obj = emunList[key].find(item => item.value == value)
if (obj) {
return obj.label
} else {
return value
}
}