修改礼物名称返回问题
This commit is contained in:
@@ -627,9 +627,14 @@ export default {
|
|||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
//console.log(res);
|
//console.log(res);
|
||||||
for (var i = 0; i < res.data.length; i++) {
|
for (var i = 0; i < res.data.length; i++) {
|
||||||
|
let item = res.data[i];
|
||||||
|
let giftName = item.giftName;
|
||||||
|
if (giftName.startsWith('{') && giftName.endsWith('}')) {
|
||||||
|
item.giftName = JSON.parse(giftName).zh;
|
||||||
|
}
|
||||||
// id对象存储
|
// id对象存储
|
||||||
var id = '' + res.data[i].giftId;
|
var id = '' + item.giftId;
|
||||||
giftMap[id] = res.data[i];
|
giftMap[id] = item;
|
||||||
}
|
}
|
||||||
renderAwardOption()
|
renderAwardOption()
|
||||||
}
|
}
|
||||||
|
@@ -124,7 +124,13 @@ export default {
|
|||||||
var arr = [];
|
var arr = [];
|
||||||
arr = res.data;
|
arr = res.data;
|
||||||
arr.unshift({ giftId: null, giftName: "全部" });
|
arr.unshift({ giftId: null, giftName: "全部" });
|
||||||
this.inquire.gifts = arr;
|
this.inquire.gifts = arr.map(v => {
|
||||||
|
let giftName = v.giftName;
|
||||||
|
if (giftName.startsWith('{') && giftName.endsWith('}')) {
|
||||||
|
v.giftName = JSON.parse(giftName).zh;
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
});
|
||||||
this.inquire.giftId = arr[0].giftId;
|
this.inquire.giftId = arr[0].giftId;
|
||||||
});
|
});
|
||||||
this.getData();
|
this.getData();
|
||||||
|
@@ -310,6 +310,10 @@ export default {
|
|||||||
"#giftId",
|
"#giftId",
|
||||||
data[0].giftId,
|
data[0].giftId,
|
||||||
data.map((v) => {
|
data.map((v) => {
|
||||||
|
let giftName = v.giftName;
|
||||||
|
if (giftName.startsWith('{') && giftName.endsWith('}')) {
|
||||||
|
v.giftName = JSON.parse(giftName).zh;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
value: v.giftId,
|
value: v.giftId,
|
||||||
text: v.giftName,
|
text: v.giftName,
|
||||||
|
@@ -336,7 +336,13 @@ export default {
|
|||||||
type: "warning",
|
type: "warning",
|
||||||
});
|
});
|
||||||
getAll({ giftType: 2 }).then((res) => {
|
getAll({ giftType: 2 }).then((res) => {
|
||||||
this.dialog.gifts2 = res.data;
|
this.dialog.gifts2 = res.data.map(v => {
|
||||||
|
let giftName = v.giftName;
|
||||||
|
if (giftName.startsWith('{') && giftName.endsWith('}')) {
|
||||||
|
v.giftName = JSON.parse(giftName).zh;
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
});
|
||||||
ElMessage({
|
ElMessage({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: "加载完成",
|
message: "加载完成",
|
||||||
|
@@ -590,9 +590,14 @@ export default {
|
|||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
//console.log(res);
|
//console.log(res);
|
||||||
for (var i = 0; i < res.data.length; i++) {
|
for (var i = 0; i < res.data.length; i++) {
|
||||||
|
let item = res.data[i];
|
||||||
|
let giftName = item.giftName;
|
||||||
|
if (giftName.startsWith('{') && giftName.endsWith('}')) {
|
||||||
|
item.giftName = JSON.parse(giftName).zh;
|
||||||
|
}
|
||||||
// id对象存储
|
// id对象存储
|
||||||
var id = '' + res.data[i].giftId;
|
var id = '' + item.giftId;
|
||||||
giftMap[id] = res.data[i];
|
giftMap[id] = item;
|
||||||
}
|
}
|
||||||
renderAwardOption()
|
renderAwardOption()
|
||||||
}
|
}
|
||||||
|
@@ -1081,7 +1081,11 @@ export default {
|
|||||||
$("#modal_defaultGift").val('');
|
$("#modal_defaultGift").val('');
|
||||||
$('#addLuckyBagPoolModal').find('input').val('');
|
$('#addLuckyBagPoolModal').find('input').val('');
|
||||||
$('#addLuckyBagPoolModal').find('textarea').val('');
|
$('#addLuckyBagPoolModal').find('textarea').val('');
|
||||||
$('#modal_giftName').val(luckyBag.giftName);
|
let giftName = luckyBag.giftName;
|
||||||
|
if (giftName.startsWith('{') && giftName.endsWith('}')) {
|
||||||
|
giftName = JSON.parse(giftName).zh;
|
||||||
|
}
|
||||||
|
$('#modal_giftName').val(giftName);
|
||||||
$('#addLuckyBagPoolModal').modal('show');
|
$('#addLuckyBagPoolModal').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -113,7 +113,13 @@ function setSelectOption() {
|
|||||||
success: function (res) {
|
success: function (res) {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
var data = res.data;
|
var data = res.data;
|
||||||
makeOption(data);
|
makeOption(data.map(v => {
|
||||||
|
let giftName = v.giftName;
|
||||||
|
if (giftName.startsWith('{') && giftName.endsWith('}')) {
|
||||||
|
v.giftName = JSON.parse(giftName).zh;
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@@ -409,7 +409,13 @@ export default {
|
|||||||
giftType: 2,
|
giftType: 2,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.giftOptions = res.data;
|
this.giftOptions = res.data.map(v => {
|
||||||
|
let giftName = v.giftName;
|
||||||
|
if (giftName.startsWith('{') && giftName.endsWith('}')) {
|
||||||
|
v.giftName = JSON.parse(giftName).zh;
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
Reference in New Issue
Block a user