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