赠送钻石水晶-提取公共方法
This commit is contained in:
@@ -308,25 +308,21 @@ export default {
|
||||
'ernos': erBanNos,
|
||||
'type': type,
|
||||
'num': num,
|
||||
'actualAmount': actualAmount,
|
||||
'remark': remark,
|
||||
'busType': busType
|
||||
};
|
||||
if (type == 'CLEAR_USER_GOLD') {
|
||||
clearUserGold(data);
|
||||
} else {
|
||||
give(data);
|
||||
}
|
||||
operate(data);
|
||||
});
|
||||
|
||||
function give (data) {
|
||||
function operate (data) {
|
||||
isGiveBol = true;
|
||||
if (confirm('确认吗?')) {
|
||||
$("#tipMsg").text("处理中,请稍后...");
|
||||
$("#tipModal").modal('show');
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/goldcoin/give",
|
||||
url: "/admin/goldcoin/operate",
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
@@ -388,32 +384,7 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
function clearUserGold (data) {
|
||||
isGiveBol = true;
|
||||
if (confirm('确认吗?')) {
|
||||
$("#tipMsg").text("处理中,请稍后...");
|
||||
$("#tipModal").modal('show');
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/goldcoin/clearUserGold",
|
||||
data: { erBanNos: data.ernos, num: data.num },
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#tipMsg").text("处理成功");
|
||||
$('#btnScan').click();
|
||||
} else {
|
||||
$("#tipMsg").text("处理出错,errorCode: " + json.message);
|
||||
}
|
||||
isGiveBol = false;
|
||||
},
|
||||
error: function (json) {
|
||||
$("#tipMsg").text("处理出错,网络出错");
|
||||
isGiveBol = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function trimTextArea (str) {
|
||||
return str.split('\n').map((line) => line.trim())
|
||||
|
Reference in New Issue
Block a user