-
@@ -696,6 +696,16 @@ export default {
giftId: null,
giftType: 2,
subGiftType: 0,
+ baseGiftId: null,
+ unlockNum: 0,
+ sendDressType: '',
+ sendDressId: null,
+ sendDressTime: 0,
+ receiveDressType: '',
+ receiveDressId: null,
+ receiveDressTime: 0,
+ dressBanner: '',
+ bannerSkipUrl: '',
},
};
},
@@ -742,7 +752,9 @@ export default {
methods: {
changeDressType(type) {
let options = [];
- let dressType = $('#' + type + 'DressType').val();
+ console.log(type);
+ let dressType = this.gift[type + 'DressType'];
+ console.log(dressType);
if (dressType == 'NAMEPLATE') {
$.ajax({
type: "get",
@@ -822,23 +834,27 @@ export default {
}
let $dressId = $('#' + type + 'DressId');
let dressId = $('#' + type + 'DressIdBak').val();
+ console.log(dressId);
$dressId.children().remove();
console.log(options);
- if (options.length > 0) {
- for (let j = 0; j < options.length; j++) {
- var option = options[j];
- var $option = $('
');
- $option.attr('value', option.value);
- $option.attr('data-id', option.value);
- $option.attr('data-name', option.text);
- if (dressId && dressId == option.value) {
- $option.attr('selected', true);
+ setTimeout(() => {
+ if (options.length > 0) {
+ for (let j = 0; j < options.length; j++) {
+ var option = options[j];
+ var $option = $('
');
+ $option.attr('value', option.value);
+ $option.attr('data-id', option.value);
+ $option.attr('data-name', option.text);
+ if (dressId && dressId == option.value) {
+ $option.attr('selected', true);
+ }
+ $option.html(option.text);
+ $dressId.append($option);
}
- $option.html(option.text);
- $dressId.append($option);
+ ComboboxHelper.build(options, '#' + type + 'DressId', dressId);
}
- ComboboxHelper.build(options, '#' + type + 'DressId', dressId);
- }
+ }, 1000);
+
},
giftUnlockList() {
getGiftUnlockList().then(res => {
@@ -849,7 +865,7 @@ export default {
value: e.giftId,
};
});
- ComboboxHelper.setDef(lockGifts, '#baseGiftId', null);
+ ComboboxHelper.build(lockGifts, '#baseGiftId', null);
});
},
levelList() {
@@ -1134,6 +1150,8 @@ export default {
$this.gift.giftId = null;
$this.gift.giftType = 2;
$this.gift.subGiftType = 0;
+ $this.gift.sendDressType = '';
+ $this.gift.receiveDressType = '';
$("#giftForm")[0].reset();
$('#picUrl').val('');
$('#picImage').attr("src", '');
@@ -1428,6 +1446,7 @@ export default {
url: "/admin/gift/get.action",
data: { id: id },
dataType: "json",
+ async: false,
success: function (json) {
let entity = json.entity;
if (json.roomFreeGiftConfig) {
@@ -1438,6 +1457,18 @@ export default {
$("#resetTimeCron").val(json.roomFreeGiftConfig.resetTimeCron);
}
if (json.entity) {
+ $this.gift.giftId = entity.giftId;
+ $this.gift.giftType = entity.giftType;
+ $this.gift.subGiftType = entity.subGiftType;
+ $this.gift.baseGiftId = entity.baseGiftId;
+ $this.gift.sendDressType = entity.sendDressType;
+ $this.gift.sendDressId = entity.sendDressId;
+ $this.gift.sendDressTime = entity.sendDressTime;
+ $this.gift.receiveDressType = entity.receiveDressType;
+ $this.gift.receiveDressId = entity.receiveDressId;
+ $this.gift.receiveDressTime = entity.receiveDressTime;
+ $this.gift.dressBanner = entity.dressBanner;
+ $this.gift.bannerSkipUrl = entity.bannerSkipUrl;
$("#giftId").val(json.entity.giftId);
$("#giftName").val(json.entity.giftName);
$("#goldPrice").val(json.entity.goldPrice);
@@ -1532,15 +1563,12 @@ export default {
$('#subGiftType').val(entity.subGiftType);
$('#baseGiftId').val(entity.baseGiftId);
$('#unlockNum').val(entity.unlockNum);
- $this.gift.giftId = entity.giftId;
- $this.gift.giftType = entity.giftType;
- $this.gift.subGiftType = entity.subGiftType;
$('#sendDressType').val(entity.sendDressType);
$('#sendDressId').val(entity.sendDressId);
$('#sendDressTime').val(entity.sendDressTime);
$('#receiveDressType').val(entity.receiveDressType);
$('#receiveDressId').val(entity.receiveDressId);
- $('#receiveDressTime').val(entity.receiveDressTime);
+ $('#receiveDressTime').val(entity.receiveDressTime);
$("#dressBannerFile").val('');
$('#dressBanner').val(entity.dressBanner);
$('#dressBannerImage').attr("src", entity.dressBanner);
@@ -1549,9 +1577,19 @@ export default {
} else {
$("#dressBannerUploadInfo").html('未上传');
}
+ $("#giftTagFile").val('');
+ $('#giftTag').val(entity.giftTag);
+ $('#giftTagImage').attr("src", entity.giftTag);
+ if (entity.giftTag != null && entity.giftTag != 'undefined' && entity.giftTag != '') {
+ $("#giftTagUploadInfo").html('已上传');
+ } else {
+ $("#giftTagUploadInfo").html('未上传');
+ }
$('#bannerSkipUrl').val(entity.bannerSkipUrl);
$('#sendDressIdBak').val(entity.sendDressId);
$('#receiveDressIdBak').val(entity.receiveDressId);
+ // 打开编辑弹窗
+ $("#giftModal").modal('show');
if (entity.giftType == 16) {
$('#giftType').attr('disabled', 'disabled');
$('#subGiftType').attr('disabled', 'disabled');
@@ -1561,8 +1599,6 @@ export default {
$this.changeDressType('send');
$this.changeDressType('receive');
}
- // 打开编辑弹窗
- $("#giftModal").modal('show');
} else {
$("#tipMsg").text("获取菜单信息出错");
$("#tipModal").modal('show');