修复bug

This commit is contained in:
liaozetao
2024-01-31 19:06:44 +08:00
parent 19b9e9cd27
commit a08c4d2895

View File

@@ -212,7 +212,7 @@
<label for="baseGiftId" class="col-sm-3 control-label">需要的基础解锁礼物</label>
<div class="col-sm-8">
<select name="baseGiftId" id="baseGiftId" data-btn-class="btn-warning" class="form-control">
<option v-for="(gift, index) in unlockList" :key="gift" :data-index="index" :value="gift.value">{{ gift.text }}</option>
</select>
</div>
</div>
@@ -692,6 +692,7 @@ export default {
name: "GiftManageView",
data() {
return {
unlockList: [],
giftLevel: [],
gift: {
giftId: null,
@@ -866,6 +867,7 @@ export default {
},
giftUnlockList() {
getGiftUnlockList().then(res => {
this.unlockList = [];
let data = res.data;
let options = data.map(e => {
return {
@@ -873,6 +875,7 @@ export default {
value: e.giftId,
};
});
this.unlockList = options;
setTimeout(() => {
ComboboxHelper.build([{text:'无', value: ''}].concat(options), '#baseGiftId', this.gift.baseGiftId);
}, 500);
@@ -1621,7 +1624,6 @@ export default {
$('#unlockNum').removeAttr('disabled');
}
}, 1000);
$this.giftUnlockList();
// 打开编辑弹窗
$("#giftModal").modal('show');
} else {
@@ -1631,30 +1633,36 @@ export default {
}
});
});
$("#save").click(function () {
$("#save").click(async function () {
let giftId = $('#giftId').val();
let giftName = $('#giftName').val();
let giftStatus = $('#giftStatus').val();
let giftStatus = $("input:radio[name='giftStatus']:checked").val();
let giftType = $('#giftType').val();
$('#giftType').removeAttr('disabled');
$('#subGiftType').removeAttr('disabled');
$('#baseGiftId').removeAttr('disabled');
$('#unlockNum').removeAttr('disabled');
console.log(giftType);
if (giftType == 16) {
let subGiftType = $this.gift.subGiftType;
if (subGiftType == 0) {
if (!giftId && !confirm('基础解锁礼物保存后礼物类型无法更改,确认保存吗?')) {
return;
}
console.log(giftStatus);
if (giftStatus == 2) {
getLockGiftList(giftId).then(res => {
let res = await getLockGiftList(giftId);
let data = res.data;
if (data) {
let targetGiftName = data.map(e => {
let targetGiftName = '';
if (data && data.length > 0) {
targetGiftName = data.map(e => {
return e.giftName;
}).join(',');
}
if (!confirm('该礼物为' + giftName + '' + giftName + '的基础解锁礼物,设置该礼物为无效会导致[' + targetGiftName + ']一并设置为无效,确认设置无效')) {
return;
}
}
});
}
} else if (subGiftType == 1) {
let baseGiftId = ComboboxHelper.getSelected('#baseGiftId');
$('#baseGiftId').val(baseGiftId);
@@ -1681,19 +1689,20 @@ export default {
let receiveDressId = ComboboxHelper.getSelected('#receiveDressId');
$this.gift.sendDressId = sendDressId;
$this.gift.receiveDressId = receiveDressId;
if ((!sendDressId && !receiveDressId) || (!sendDressTime && !receiveDressTime)) {
$("#tipMsg").text("送礼者和收礼者装扮内容不能同时为空");
$("#tipModal").modal('show');
return;
}
$('#sendDressId').val(sendDressId);
$('#receiveDressid').val(receiveDressId);
if ((sendDressTime && sendDressTime < 5) || (receiveDressTime && receiveDressTime < 5)) {
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",