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