弹框确认优化

This commit is contained in:
bb_pan 2025-09-03 18:45:44 +08:00
parent 5605d5a703
commit c6e8299ccd
5 changed files with 82 additions and 10 deletions

View File

@ -27,7 +27,9 @@
<uni-easyinput type="textarea" v-model="remark" placeholder="请输入备注..." autoHeight />
<view class="popup-btns">
<button type="default" @click="closePopup"> </button>
<button type="primary" @click="confirmRemark"> </button>
<button type="primary" @click="confirmRemark">
{{ countdown > 0 ? '(' + countdown + ')' : '' }}
</button>
</view>
</view>
</uni-popup>
@ -44,6 +46,8 @@ const total = ref(0)
const remark = ref('')
const popup = ref()
const loading = ref(false)
const countdown = ref(0)
const timer = ref(null)
const finish = computed(() => {
if (total.value === tableList.value.length) return true
@ -77,12 +81,27 @@ const handleDetails = (item) => {
}
const penPopup = () => {
popup.value.open()
if (timer.value) {
clearInterval(timer.value)
timer.value = null
}
countdown.value = 3
timer.value = setInterval(() => {
if (countdown.value > 0) {
countdown.value--
} else {
clearInterval(timer.value)
timer.value = null
countdown.value = 0
}
}, 1000)
}
const closePopup = () => {
popup.value.close()
}
const confirmRemark = () => {
console.log('opts:', opts.value)
if (countdown.value > 0) return
const params = {
id: opts.value.id,
leaseSignId: opts.value.leaseSignId,

View File

@ -101,7 +101,7 @@
</view>
<view class="handle-box">
<view class="handle-box-btn" style="background: #CCC;color: #FFF;" @click="closePopup">取消</view>
<view class="handle-box-btn" style="background: #3784fb;color: #FFF;" @click="confirmNumInBound">确定</view>
<view class="handle-box-btn" style="background: #3784fb;color: #FFF;" @click="confirmNumInBound">确定{{ countdown > 0 ? '(' + countdown + ')' : '' }}</view>
</view>
</view>
</uni-popup>
@ -124,7 +124,7 @@
</view>
<view class="handle-box">
<view class="handle-box-btn" style="background: #CCC;color: #FFF;" @click="closePopup2">取消</view>
<view class="handle-box-btn" style="background: #3784fb;color: #FFF;" @click="rejectNumInBound">确定</view>
<view class="handle-box-btn" style="background: #3784fb;color: #FFF;" @click="rejectNumInBound">确定{{ countdown > 0 ? '(' + countdown + ')' : '' }}</view>
</view>
</view>
</uni-popup>
@ -147,6 +147,9 @@ const rejectNumPopup = ref(null);
const inBoundNum = ref(0)
const rejectBoundNum = ref(0)
const rejectReason = ref('')
const countdown = ref(0)
const timer = ref(null)
//
const getDetailsData = async () => {
let param = {
@ -192,6 +195,20 @@ const onClick=async (e,item)=> {
}
}
if (item.manageType == 1) {//
if (timer.value) {
clearInterval(timer.value)
timer.value = null
}
countdown.value = 3
timer.value = setInterval(() => {
if (countdown.value > 0) {
countdown.value--
} else {
clearInterval(timer.value)
timer.value = null
countdown.value = 0
}
}, 1000)
if(e.index==0){
// console.log(item)
if(item.status==0){//
@ -215,6 +232,7 @@ const onClick=async (e,item)=> {
const confirmNumInBound = async () => {
console.log(inBoundNum.value)
if (countdown.value > 0) return
if(inBoundNum.value==0){
uni.showToast({ title: '入库数量需大于0',icon: 'none'})
}else{
@ -238,6 +256,7 @@ const closePopup = () => {
const rejectNumInBound = async () => {
console.log(rejectBoundNum.value)
if (countdown.value > 0) return
try {
uni.showLoading({ title: '操作中...', mask: true })
if(rejectBoundNum.value==0){

View File

@ -165,7 +165,7 @@ const onClick=(e,item, itemIndex)=> {
}
}
})
}, 300)
}, 500)
}else{//
console.log(item)
setTimeout(() => {
@ -174,8 +174,8 @@ const onClick=(e,item, itemIndex)=> {
content: '是否确认驳回移交?',
confirmText: '确定',
cancelText: '取消',
success: async (res) => {
if (res.confirm) {
success: async (resp) => {
if (resp.confirm) {
let param = {
boxId:item.boxId
}
@ -195,7 +195,7 @@ const onClick=(e,item, itemIndex)=> {
}
}
})
}, 300)
}, 500)
}
}
swipeRef.value[itemIndex].closeAll()

View File

@ -73,7 +73,7 @@
<view class="keeper-popup">
<view class="handle-box">
<view class="handle-box-btn" style="background: #CCC;color: #FFF;" @click="closePopup">取消</view>
<view class="handle-box-btn" style="background: #3784fb;color: #FFF;" @click="confirmTransfer">确定</view>
<view class="handle-box-btn" style="background: #3784fb;color: #FFF;" @click="confirmTransfer">确定{{ countdown > 0 ? '(' + countdown + ')' : '' }}</view>
</view>
<scroll-view scroll-y style="padding-bottom: 85rpx" class="keeper-box" v-if="keeperList.length>0">
<view class="table-list-item" v-for="item in keeperList" :key="item.id">
@ -176,6 +176,8 @@ const focusTimeout = ref(null)
const systemInfo = ref(null)
const screenHeight = ref(null)
const screenWidth = ref(null)
const countdown = ref(0)
const timer = ref(null)
const getCodeList = () => {
console.log(boxInfo.value)
@ -822,11 +824,26 @@ const onChangeChecked = (item) => {
}
const transfer = () => {
keeperPopup.value.open('bottom');
if (timer.value) {
clearInterval(timer.value)
timer.value = null
}
countdown.value = 3
timer.value = setInterval(() => {
if (countdown.value > 0) {
countdown.value--
} else {
clearInterval(timer.value)
timer.value = null
countdown.value = 0
}
}, 1000)
}
const closePopup = () => {
keeperPopup.value.close();
}
const confirmTransfer = () => {
if (countdown.value > 0) return
if(transferUser.value!=""){
let param = {
"boxId":boxInfo.value.boxId,

View File

@ -94,7 +94,7 @@
<view class="keeper-popup">
<view class="handle-box">
<view class="handle-box-btn" style="background: #CCC;color: #FFF;" @click="closePopup">取消</view>
<view class="handle-box-btn" style="background: #3784fb;color: #FFF;" @click="confirmTransfer">确定</view>
<view class="handle-box-btn" style="background: #3784fb;color: #FFF;" @click="confirmTransfer">确定{{ countdown > 0 ? '(' + countdown + ')' : '' }}</view>
</view>
<scroll-view scroll-y style="padding-bottom: 85rpx" class="keeper-box" v-if="keeperList.length>0">
<view class="table-list-item" v-for="item in keeperList" :key="item.id">
@ -142,6 +142,8 @@ const keeperPopup = ref(null);
const transferItem = ref({});
const keeperList = ref([])
const transferUser = ref("")
const countdown = ref(0)
const timer = ref(null)
//
const queryParams = ref({
startTime: dateArray.value[0] || '',
@ -305,6 +307,20 @@ const getKeeperList = (item) => {
console.log(keeperList)
}
keeperPopup.value.open('bottom');
if (timer.value) {
clearInterval(timer.value)
timer.value = null
}
countdown.value = 3
timer.value = setInterval(() => {
if (countdown.value > 0) {
countdown.value--
} else {
clearInterval(timer.value)
timer.value = null
countdown.value = 0
}
}, 1000)
}).catch(error => {
console.log(error)
})
@ -331,6 +347,7 @@ const onChangeChecked = (item) => {
}
const confirmTransfer = () => {
if (countdown.value > 0) return
if(transferUser.value!=""){
let param = {
@ -674,7 +691,7 @@ const finish = computed(() => {
display: flex;
align-items: center;justify-content: space-between;
.handle-box-btn{
width: 60px;
min-width: 60px;
height: 32px;line-height: 32px;
text-align: center;
border-radius: 5px;