问题修改

This commit is contained in:
hayu 2025-06-17 18:12:48 +08:00
parent 9ce111f221
commit 625852aadd
2 changed files with 118 additions and 53 deletions

View File

@ -73,7 +73,8 @@ const bmFileInfos = ref([])//请求图片参数
const getCodeList = () => { const getCodeList = () => {
console.log(boxInfo.value) console.log(boxInfo.value)
let param = { let param = {
"boxId":boxInfo.value.boxId "boxId":boxInfo.value.boxId,
"keyWord":searchValue.value
} }
getAppBoxDetailListApi(param).then(res => { getAppBoxDetailListApi(param).then(res => {
console.log(res) console.log(res)

View File

@ -1,19 +1,30 @@
<template> <template>
<view style="padding-top: 4vh;background-color: rgb(220, 244, 255);"> <view>
<uni-nav-bar left-icon="left" @clickLeft="leftClick" right-icon="scan" @clickRight="rightClick" title="标准箱管理" title-style="font-weight: bolder;" backgroundColor="rgb(220, 244, 255)" :border="false" /> <!-- 自定义导航栏 -->
</view> <view class="custom-navbar" :style="{ paddingTop: statusBarHeight + 'px' }">
<!-- 新购入库 --> <view class="nav-content">
<view class="page-container"> <view class="left-icon" @click="leftClick">
<view class="complete-btn"> <uni-icons type="left" size="24"></uni-icons>
<view class="btn" @click="changeTab(1)">
<span>未录入</span>
<div v-if="active == 1" class="bt-line"></div>
</view>
<view class="btn" style="margin-left: 120rpx" @click="changeTab(2)">
<span>已完成</span>
<div v-if="active == 2" class="bt-line"></div>
</view>
</view> </view>
<view class="title">标准箱管理</view>
<view class="right-icon" @click="rightClick">
<uni-icons type="scan" size="24"></uni-icons>
</view>
</view>
</view>
<!-- 页面内容 -->
<view class="page-container">
<view class="complete-btn">
<view class="btn" @click="changeTab(1)">
<span>未录入</span>
<div v-if="active == 1" class="bt-line"></div>
</view>
<view class="btn" style="margin-left: 120rpx" @click="changeTab(2)">
<span>已完成</span>
<div v-if="active == 2" class="bt-line"></div>
</view>
</view>
<uni-row :gutter="24" class="search-form"> <uni-row :gutter="24" class="search-form">
<uni-col :span="24"> <uni-col :span="24">
<view> <view>
@ -85,20 +96,20 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</view>
</template> </template>
<script setup> <script setup>
import { ref,computed } from 'vue' import { ref,computed } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app' import { onLoad, onShow } from '@dcloudio/uni-app'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
import { getPurchaseList } from '@/services/purchase.js'
import { getQrCodeBoxListApi } from '@/services/standard.js' import { getQrCodeBoxListApi } from '@/services/standard.js'
const total = ref(0) // const total = ref(0) //
const active = ref(1) // tap const active = ref(1) // tap
const tableList = ref([]) // const tableList = ref([]) //
const dateArray = ref([]) // const dateArray = ref([]) //
const statusBarHeight = ref(0)
// //
const queryParams = ref({ const queryParams = ref({
startTime: '', // startTime: '', //
@ -109,6 +120,27 @@ const queryParams = ref({
pageSize: 5, pageSize: 5,
}) })
//
const initStatusBarHeight = () => {
uni.getSystemInfo({
success: (res) => {
statusBarHeight.value = res.statusBarHeight
// CSS
document.documentElement.style.setProperty('--status-bar-height', `${res.statusBarHeight}px`)
}
})
}
onLoad(() => {
initStatusBarHeight()
getTableList(true)
})
onShow(() => {
tableList.value = []
getTableList(true)
})
// change // change
const onChangeDate = (val) => { const onChangeDate = (val) => {
const [val_1, val_2] = val const [val_1, val_2] = val
@ -231,16 +263,6 @@ const rightClick = () => {
uni.navigateTo({ url: `/pages/standardBox/addBox` }) uni.navigateTo({ url: `/pages/standardBox/addBox` })
} }
// //
// onLoad(() => {
// getTableList()
// })
onShow(() => {
tableList.value = []
getTableList(true)
})
// //
const finish = computed(() => { const finish = computed(() => {
console.log('total.value',total.value) console.log('total.value',total.value)
@ -250,16 +272,72 @@ const finish = computed(() => {
</script> </script>
<style lang="scss" scoped> <style lang="scss">
/* 自定义导航栏样式 */
.custom-navbar {
width: 100%;
background-color: rgb(220, 244, 255);
position: fixed;
top: 0;
left: 0;
z-index: 999;
height: calc(44px + var(--status-bar-height, 0px));
box-sizing: content-box;
}
.nav-content {
height: 44px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
padding: 0 15px;
}
.left-icon, .right-icon {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
}
.left-icon {
left: 15px;
}
.right-icon {
right: 15px;
}
.title {
font-weight: bold;
font-size: 16px;
color: #000000;
text-align: center;
width: 60%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* 页面内容容器 */
.page-container {
margin-top: calc(44px + var(--status-bar-height, 0px));
height: calc(100vh - 44px - var(--status-bar-height, 0px));
overflow: auto;
background-color: #f7f8fa;
padding: 24rpx;
box-sizing: border-box;
}
:deep(.uni-navbar__header-container-inner){ :deep(.uni-navbar__header-container-inner){
font-weight: 600; font-weight: 600;
} }
.page-container {
display: flex;
height: 90vh;
flex-direction: column;
background-color: #f7f8fa;
padding: 24rpx;
.complete-btn { .complete-btn {
display: flex; display: flex;
padding: 28rpx 24rpx; padding: 28rpx 24rpx;
@ -277,20 +355,11 @@ const finish = computed(() => {
position: relative; position: relative;
transition: all 0.3s ease; transition: all 0.3s ease;
span { span {
font-size: 32rpx; font-size: 32rpx;
color: #8c8c8c; color: #8c8c8c;
font-weight: 500; font-weight: 500;
}
&.active {
color: #3784fb;
font-weight: 600;
.second-active & {
color: #fa8c16;
}
}
}
.bt-line { .bt-line {
width: 32rpx; width: 32rpx;
@ -299,10 +368,6 @@ const finish = computed(() => {
margin-top: 12rpx; margin-top: 12rpx;
border-radius: 6rpx; border-radius: 6rpx;
transition: all 0.3s ease; transition: all 0.3s ease;
.second-active & {
background: #fa8c16;
}
} }
} }
} }
@ -541,7 +606,6 @@ const finish = computed(() => {
} }
} }
} }
}
// //
.loading-text { .loading-text {