lixin-web
Version:
vue and bootstrap
361 lines (339 loc) • 6.97 kB
JavaScript
import {format,locale} from '_Will'
var formatAmount = function(amount) {
if (amount < 1) {
return amount.toFixed(5);
}
if (amount < 100) {
return amount.toFixed(3);
}
return amount.toFixed(3);
}
var formatAccountType = function(code) {
if (code == 1) {
return '彩票账户';
}
if (code == 2) {
return '百家乐账户';
}
}
var greeting = function() {
return format(new Date,'aa[好]',{locale})
}
var formatUserType = function(type) {
if(type == 0) {
return '玩家';
}
if(type == 1) {
return '代理';
}
}
var formatUserVipLevel = function(level) {
if(level == 0) {
return '普通会员';
}
if(level == 1) {
return '青铜 VIP';
}
if(level == 2) {
return '紫晶 VIP';
}
if(level == 3) {
return '白金 VIP';
}
if(level == 4) {
return '黄金 VIP';
}
if(level == 5) {
return '钻石 VIP';
}
if(level == 6) {
return '至尊 VIP';
}
}
var formatLevelUsers = function(thisUser, list) {
$.each(list, function(i, val) {
thisUser += ' > ' + val;
});
return thisUser;
}
var formatUserOnlineStatus = function(status) {
if(status == 0) {
return '离线';
}
if(status == 1) {
return '在线';
}
}
var formatUserPlanLevel = function(level) {
if(level == 0) {
return '菜鸟';
}
if(level == 1) {
return '学徒';
}
if(level == 2) {
return '出师';
}
if(level == 3) {
return '操盘';
}
if(level == 4) {
return '大师';
}
if(level == 5) {
return '宗师';
}
if(level == 6) {
return '大神';
}
}
var formatUserCardStatus = function(status) {
if(status == 0) {
return '正常';
}
if(status == -1) {
return '资料无效';
}
if(status == -2) {
return '已锁定';
}
}
var formatUserRechargeType = function(type) {
if(type == 1) {
return '网银充值';
}
if(type == 2) {
return '转账汇款';
}
if(type == 0) {
return '系统充值';
}
}
var formatUserWithdrawalsStatus = function(status) {
if(status == 0) {
return '待处理';
}
if(status == 1) {
return '已完成';
}
if(status == -1) {
return '已拒绝';
}
}
var formatUserTransferStatus = function(type) {
if(type == 0) {
return '处理中';
}
if(type == 1) {
return '成功';
}
if(type == 2) {
return '失败';
}
}
var formatUserBetsModel = function(model) {
if(model == 'yuan') {
return '元';
}
if(model == 'jiao') {
return '角';
}
if(model == 'fen') {
return '分';
}
if(model == 'li') {
return '厘';
}
}
var formatUserBetsStatus = function(status) {
if(status == 0) {
return '未开奖';
}
if(status == 1) {
return '未中奖';
}
if(status == 2) {
return '已中奖';
}
if(status == -1) {
return '已撤单';
}
}
var formatUserChaseStatus = function(status) {
if (status == 0) {
return '未开始';
}
if (status == 1) {
return '进行中';
}
if (status == 2) {
return '已完成';
}
if (status == -1) {
return '已撤单';
}
}
var formatUserBillType = function(code) {
if (code == 1000) {
return '存款';
}
if (code == 1001) {
return '取款';
}
if (code == 1002) {
return '取款退回';
}
if (code == 1100) {
return '转入';
}
if (code == 1101) {
return '转出'
}
if (code == 1102) {
return '上下级转账';
}
if (code == 1200) {
return '优惠活动';
}
if (code == 1300) {
return '消费';
}
if (code == 1301) {
return '派奖';
}
if (code == 1302) {
return '消费返点';
}
if (code == 1303) {
return '取消订单';
}
if (code == 1304) {
return '修正奖金';
}
if (code == 1400) {
return '代理返点';
}
if (code == 1500) {
return '分红';
}
if (code == 1600) {
return '管理员增';
}
if (code == 1601) {
return '管理员减';
}
if (code == 1700) {
return '积分兑换';
}
if (code == 1800) {
return '支付佣金';
}
if (code == 1801) {
return '获得佣金';
}
if (code == 1900) {
return '会员返水';
}
}
var formatUserMessageType = function(type) {
if(type == 0) {
return '建议反馈';
}
if(type == 1) {
return '已收消息';
}
if(type == 2) {
return '已发消息';
}
}
var formatUserMessageStatus = function(status, type) {
if(status == 0) {
return '正常';
}
if(status == 1) {
return '已读';
}
if(status == -1) {
return '已删除';
}
}
var formatUserSysMessageType = function(type) {
if(type == 0) {
return '系统通知';
}
if(type == 1) {
return '到账通知';
}
if(type == 2) {
return '提现通知';
}
if(type == 5) {
return 'VIP活动通知';
}
}
var formatLotteryPaymentThridType = function(type) {
if(type == 'ips') {
return '环讯支付';
}
if(type == 'baofoo') {
return '宝付支付';
}
if(type == 'newpay') {
return '新生支付';
}
if(type == 'ecpss') {
return '汇潮支付';
}
if(type == 'yeepay') {
return '易宝支付';
}
if(type == 'mobao') {
return '摩宝支付';
}
if(type == 'gopay') {
return '国付宝支付';
}
if(type == 'pay41') {
return '通汇支付';
}
}
const DataFormat = {
formatAmount: formatAmount,
formatAccountType: formatAccountType,
greeting: greeting,
// 用户类型
formatUserType: formatUserType,
// 用户 VIP等级
formatUserVipLevel: formatUserVipLevel,
// 用户层级关系
formatLevelUsers: formatLevelUsers,
// 用户在线状态
formatUserOnlineStatus: formatUserOnlineStatus,
// 计划等级
formatUserPlanLevel: formatUserPlanLevel,
// 用户银行卡状态
formatUserCardStatus: formatUserCardStatus,
// 充值类型
formatUserRechargeType: formatUserRechargeType,
// 取款状态
formatUserWithdrawalsStatus: formatUserWithdrawalsStatus,
// 账户转账状态
formatUserTransferStatus: formatUserTransferStatus,
// 投注模式
formatUserBetsModel: formatUserBetsModel,
// 订单状态
formatUserBetsStatus: formatUserBetsStatus,
// 账单类别
formatUserBillType: formatUserBillType,
// 消息类型
formatUserMessageType: formatUserMessageType,
// 消息状态
formatUserMessageStatus: formatUserMessageStatus,
// 系统消息类型
formatUserSysMessageType: formatUserSysMessageType,
// 第三方支付类别
formatLotteryPaymentThridType: formatLotteryPaymentThridType,
formatUserChaseStatus: formatUserChaseStatus
}
export default DataFormat
window.DataFormat = DataFormat