This commit is contained in:
Paidax
2024-12-27 10:32:31 +08:00
parent a45b3d638a
commit d2caf57a55
4 changed files with 28 additions and 20 deletions
@@ -647,13 +647,15 @@ layout("/mobile/platform.html"){
})
if (code === 0) {
this.getUserSelection(this.projectId)
this.$modal.msgSuccess(msg)
this.$modal.msgSuccess("您已完成本次福利选择。")
} else {
this.$modal.msgError(msg)
}
this.confirmPopup = false
await this.getProjectInfo()
window.location.reload()
setTimeout(() => {
window.location.reload()
}, 1000)
},
//查看详情
@@ -246,6 +246,7 @@ layout("/layouts/platform.html"){
<el-input-number :disabled="isView"
:max="option.maxNum"
:min="0"
@keydown.native="onKeydown"
@change="numChange(option.selectNum,option,oidx)"
style="width: 150px;position: absolute;right: 0;bottom: 0;"
v-model="option.selectNum"></el-input-number>
@@ -485,6 +486,11 @@ layout("/layouts/platform.html"){
},
},
methods: {
onKeydown(event) {
if (event.key !== "ArrowUp" && event.key !== "ArrowDown") {
event.preventDefault();
}
},
confirmButtonInfo(row) {
const {choiceTimeEnd, choiceTimeStart, overdueChoiceTimeEnd, isChoose, selectTime} = row
const now = moment().valueOf()
@@ -562,14 +568,12 @@ layout("/layouts/platform.html"){
},
//数量更改
numChange(value, option, optionIndex) {
this.$nextTick(() => {
// 查找+1按钮
const plusButton = document.querySelector('.el-input-number__increase');
// 添加点击事件监听器
plusButton.addEventListener('click', this.handlePlusButtonClick(value, option, optionIndex));
})
},
handlePlusButtonClick(value, option, optionIndex) {
const {
@@ -590,7 +594,7 @@ layout("/layouts/platform.html"){
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
if (sum > multiSelectNum) {
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], 'selectNum', value - 1)
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], 'selectNum', multiSelectNum)
this.$message.warning('此次福利最多只能选择' + multiSelectNum + '份');
}
@@ -680,10 +684,7 @@ layout("/layouts/platform.html"){
projectId: this.projectInfo.id
})
if (code === 0) {
this.$message({
message: msg,
type: 'success'
});
this.$message.success('您已完成本次福利选择。')
} else {
this.$message({
message: msg,
@@ -755,9 +756,13 @@ layout("/layouts/platform.html"){
r.name = "收货地址:" + r.province + r.city + r.county + r.addressDetail + ",收件人:" + r.userName + ",联系方式:" + r.tel
})
this.addressOptions = resp.data
this.formData.addressId = this.addressOptions.find(v=> v.isDefault).id
this.$nextTick(() => {
const address = this.addressOptions.find(v=> v.isDefault)
if (address) {
this.$set(this.formData, "addressId", address.id)
this.$set(this.formData, "receiveAddress", address.name)
}
})
},
},
async created() {