+
@@ -833,12 +833,18 @@ export default {
}
});
}
- let $dressId = $('#' + type + 'DressId');
let dressId = $('#' + type + 'DressIdBak').val();
console.log(dressId);
- $dressId.children().remove();
+ $('#' + type + 'DressDiv .combobox-container').remove();
+ $('#' + type + 'DressId').remove();
console.log(options);
setTimeout(() => {
+ let $div = $('#' + type + 'DressDiv');
+ let $select = $('
');
+ $select.attr('name', type + 'DressId');
+ $select.attr('id', type + 'DressId');
+ $select.attr('data-btn-class', 'btn-warning');
+ $select.attr('class', 'form-control');
if (options.length > 0) {
for (let j = 0; j < options.length; j++) {
var option = options[j];
@@ -850,8 +856,9 @@ export default {
$option.attr('selected', true);
}
$option.html(option.text);
- $dressId.append($option);
+ $select.append($option);
}
+ $div.append($select);
ComboboxHelper.build(options, '#' + type + 'DressId', dressId);
}
}, 1000);
@@ -867,7 +874,7 @@ export default {
};
});
setTimeout(() => {
- ComboboxHelper.build(options, '#baseGiftId', this.gift.baseGiftId);
+ ComboboxHelper.build([{text:'无', value: ''}].concat(options), '#baseGiftId', this.gift.baseGiftId);
}, 500);
});
},
@@ -1197,10 +1204,10 @@ export default {
$('#giftTagImage').attr("src", '');
$("#giftTagUploadInfo").html('');
$("#giftTagFile").val('');
- $('#giftType').removeAttr('readonly');
- $('#subGiftType').removeAttr('readonly');
- $('#baseGiftId').removeAttr('readonly');
- $('#unlockNum').removeAttr('readonly');
+ $('#giftType').removeAttr('disabled');
+ $('#subGiftType').removeAttr('disabled');
+ $('#baseGiftId').removeAttr('disabled');
+ $('#unlockNum').removeAttr('disabled');
$('#sendDressType').val('');
$('#sendDressId').val('');
$('#sendDressTime').val('');
@@ -1603,10 +1610,15 @@ export default {
}
setTimeout(() => {
if (entity.giftType == 16) {
- $('#giftType').attr('readonly', 'readonly');
- $('#subGiftType').attr('readonly', 'readonly');
- $('#baseGiftId').attr('readonly', 'readonly');
- $('#unlockNum').attr('readonly', 'readonly');
+ $('#giftType').attr('disabled', 'disabled');
+ $('#subGiftType').attr('disabled', 'disabled');
+ $('#baseGiftId').attr('disabled', 'disabled');
+ $('#unlockNum').attr('disabled', 'disabled');
+ } else {
+ $('#giftType').removeAttr('disabled');
+ $('#subGiftType').removeAttr('disabled');
+ $('#baseGiftId').removeAttr('disabled');
+ $('#unlockNum').removeAttr('disabled');
}
}, 1000);
$this.giftUnlockList();
@@ -1644,7 +1656,9 @@ export default {
});
}
} else if (subGiftType == 1) {
- let baseGiftId = $this.gift.baseGiftId;
+ let baseGiftId = ComboboxHelper.getSelected('#baseGiftId');
+ $('#baseGiftId').val(baseGiftId);
+ $this.gift.baseGiftId = baseGiftId;
let unlockNum = $this.gift.unlockNum;
if (!baseGiftId || baseGiftId == 0) {
$("#tipMsg").text("基础解锁礼物不能为空");
@@ -1660,8 +1674,26 @@ export default {
return;
}
}
+ } else if (giftType == 17) {
+ let sendDressTime = $('#sendDressTime').val();
+ let receiveDressTime = $('#receiveDressTime').val();
+ let sendDressId = ComboboxHelper.getSelected('#sendDressId');
+ let receiveDressId = ComboboxHelper.getSelected('#receiveDressId');
+ $this.gift.sendDressId = sendDressId;
+ $this.gift.receiveDressId = receiveDressId;
+ $('#sendDressId').val(sendDressId);
+ $('#receiveDressid').val(receiveDressId);
+ if ((sendDressTime && sendDressTime < 5) || (receiveDressTime && receiveDressTime < 5)) {
+ $("#tipMsg").text("装扮时长不能小于5分钟");
+ $("#tipModal").modal('show');
+ return;
+ }
}
if ($("#giftForm").validationEngine('validate')) {
+ $('#giftType').removeAttr('disabled');
+ $('#subGiftType').removeAttr('disabled');
+ $('#baseGiftId').removeAttr('disabled');
+ $('#unlockNum').removeAttr('disabled');
$("#consumeType").removeAttr("disabled");
$.ajax({
type: "post",