bug分页修复

This commit is contained in:
hongchao 2025-05-15 13:41:01 +08:00
parent bdbce8c4ed
commit 008a19695f
13 changed files with 252 additions and 95 deletions

52
package-lock.json generated
View File

@ -24,9 +24,7 @@
"@dcloudio/uni-mp-xhs": "3.0.0-4020920240930001", "@dcloudio/uni-mp-xhs": "3.0.0-4020920240930001",
"@dcloudio/uni-quickapp-webview": "3.0.0-4020920240930001", "@dcloudio/uni-quickapp-webview": "3.0.0-4020920240930001",
"@dcloudio/uni-ui": "^1.5.7", "@dcloudio/uni-ui": "^1.5.7",
"@zxing/library": "^0.21.3", "default-passive-events": "^2.0.0",
"html5-qrcode": "^2.3.8",
"jsqrcode": "^0.0.7",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"pinia": "^2.2.2", "pinia": "^2.2.2",
"pinia-plugin-persistedstate": "^3.2.3", "pinia-plugin-persistedstate": "^3.2.3",
@ -5733,28 +5731,6 @@
"integrity": "sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==", "integrity": "sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@zxing/library": {
"version": "0.21.3",
"resolved": "https://registry.npmmirror.com/@zxing/library/-/library-0.21.3.tgz",
"integrity": "sha512-hZHqFe2JyH/ZxviJZosZjV+2s6EDSY0O24R+FQmlWZBZXP9IqMo7S3nb3+2LBWxodJQkSurdQGnqE7KXqrYgow==",
"license": "MIT",
"dependencies": {
"ts-custom-error": "^3.2.1"
},
"engines": {
"node": ">= 10.4.0"
},
"optionalDependencies": {
"@zxing/text-encoding": "~0.9.0"
}
},
"node_modules/@zxing/text-encoding": {
"version": "0.9.0",
"resolved": "https://registry.npmmirror.com/@zxing/text-encoding/-/text-encoding-0.9.0.tgz",
"integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==",
"license": "(Unlicense OR Apache-2.0)",
"optional": true
},
"node_modules/abab": { "node_modules/abab": {
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmmirror.com/abab/-/abab-2.0.6.tgz", "resolved": "https://registry.npmmirror.com/abab/-/abab-2.0.6.tgz",
@ -6993,6 +6969,12 @@
"node": ">= 10" "node": ">= 10"
} }
}, },
"node_modules/default-passive-events": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/default-passive-events/-/default-passive-events-2.0.0.tgz",
"integrity": "sha512-eMtt76GpDVngZQ3ocgvRcNCklUMwID1PaNbCNxfpDXuiOXttSh0HzBbda1HU9SIUsDc02vb7g9+3I5tlqe/qMQ==",
"license": "MIT"
},
"node_modules/delayed-stream": { "node_modules/delayed-stream": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
@ -8293,12 +8275,6 @@
"license": "MIT", "license": "MIT",
"peer": true "peer": true
}, },
"node_modules/html5-qrcode": {
"version": "2.3.8",
"resolved": "https://registry.npmmirror.com/html5-qrcode/-/html5-qrcode-2.3.8.tgz",
"integrity": "sha512-jsr4vafJhwoLVEDW3n1KvPnCCXWaQfRng0/EEYk1vNcQGcG/htAdhJX0be8YyqMoSz7+hZvOZSTAepsabiuhiQ==",
"license": "Apache-2.0"
},
"node_modules/http-errors": { "node_modules/http-errors": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.0.tgz", "resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.0.tgz",
@ -9636,11 +9612,6 @@
"graceful-fs": "^4.1.6" "graceful-fs": "^4.1.6"
} }
}, },
"node_modules/jsqrcode": {
"version": "0.0.7",
"resolved": "https://registry.npmmirror.com/jsqrcode/-/jsqrcode-0.0.7.tgz",
"integrity": "sha512-hwLJgcjIEPUdnyyxaWen0b0cs/pdJx+T4c9PBFVtVif2ERZOk/ZjblmXvX7CBrcuaUhsm3S8t+ONe8p0Q7ezqQ=="
},
"node_modules/keyv": { "node_modules/keyv": {
"version": "4.5.4", "version": "4.5.4",
"resolved": "https://registry.npmmirror.com/keyv/-/keyv-4.5.4.tgz", "resolved": "https://registry.npmmirror.com/keyv/-/keyv-4.5.4.tgz",
@ -12228,15 +12199,6 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/ts-custom-error": {
"version": "3.3.1",
"resolved": "https://registry.npmmirror.com/ts-custom-error/-/ts-custom-error-3.3.1.tgz",
"integrity": "sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A==",
"license": "MIT",
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/type-check": { "node_modules/type-check": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz", "resolved": "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz",

View File

@ -58,6 +58,7 @@
"@dcloudio/uni-mp-xhs": "3.0.0-4020920240930001", "@dcloudio/uni-mp-xhs": "3.0.0-4020920240930001",
"@dcloudio/uni-quickapp-webview": "3.0.0-4020920240930001", "@dcloudio/uni-quickapp-webview": "3.0.0-4020920240930001",
"@dcloudio/uni-ui": "^1.5.7", "@dcloudio/uni-ui": "^1.5.7",
"default-passive-events": "^2.0.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"pinia": "^2.2.2", "pinia": "^2.2.2",
"pinia-plugin-persistedstate": "^3.2.3", "pinia-plugin-persistedstate": "^3.2.3",

View File

@ -4,7 +4,7 @@ import pinia from './stores/index'
import '@/styles/reset.css' import '@/styles/reset.css'
import '@/styles/common.scss' import '@/styles/common.scss'
import "default-passive-events";
export function createApp() { export function createApp() {
const app = createSSRApp(App) const app = createSSRApp(App)

View File

@ -328,7 +328,7 @@ const warningStyle = {
<style lang="scss" scoped> <style lang="scss" scoped>
.page-container { .page-container {
display: flex; display: flex;
height: 100%; height: 100vh;
flex-direction: column; flex-direction: column;
background-color: #f7f8fa; background-color: #f7f8fa;
padding: 24rpx; padding: 24rpx;

View File

@ -13,7 +13,7 @@ const scanQrCode = () => {
console.log("扫一扫"); console.log("扫一扫");
console.log("window对象", window); console.log("window对象", window);
document.addEventListener("deviceready", onDeviceReady.bind(this), false); // document.addEventListener("deviceready", onDeviceReady.bind(this), false);
function onDeviceReady() { function onDeviceReady() {
// Cordova is now initialized. Have fun! // Cordova is now initialized. Have fun!

View File

@ -175,7 +175,7 @@ onShow((options) => {
<style lang="scss" scoped> <style lang="scss" scoped>
.accept { .accept {
height: 100%; height: 100vh;
word-break: break-all; word-break: break-all;
background-color: #f7f8fa; background-color: #f7f8fa;
padding: 24rpx; padding: 24rpx;

View File

@ -246,7 +246,7 @@ onShow(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.page-container { .page-container {
display: flex; display: flex;
height: 100%; height: 100vh;
flex-direction: column; flex-direction: column;
background-color: #f7f8fa; background-color: #f7f8fa;
padding: 24rpx; padding: 24rpx;

View File

@ -179,7 +179,7 @@ const maskClick = () => {}
<style lang="scss" scoped> <style lang="scss" scoped>
.page-container { .page-container {
display: flex; display: flex;
height: 100%; height: 100vh;
flex-direction: column; flex-direction: column;
background-color: #f7f8fa; background-color: #f7f8fa;
padding: 24rpx; padding: 24rpx;

View File

@ -144,7 +144,7 @@ onUnmounted(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.page-container { .page-container {
display: flex; display: flex;
height: 100%; height: 100vh;
flex-direction: column; flex-direction: column;
background-color: #f7f8fa; background-color: #f7f8fa;
padding: 24rpx; padding: 24rpx;

View File

@ -252,7 +252,7 @@ const finish = computed(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.page-container { .page-container {
display: flex; display: flex;
height: 100%; height: 100vh;
flex-direction: column; flex-direction: column;
background-color: #f7f8fa; background-color: #f7f8fa;
padding: 24rpx; padding: 24rpx;

View File

@ -44,7 +44,7 @@
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
<ScanQrCode ref="scanQrCodeRef" @scanSuccess="handleScanSuccess" @scanError="handleScanError" />
<view class="table-list-item"> <view class="table-list-item">
<uni-row :gutter="24" style="display: flex; align-items: center"> <uni-row :gutter="24" style="display: flex; align-items: center">
<uni-col :span="6"> <uni-col :span="6">
@ -63,7 +63,7 @@
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
<scroll-view scroll-y @scrolltolower="onScrollTolower" style="padding-bottom: 90rpx"> <scroll-view scroll-y @scrolltolower="onScrollTolower" style="padding-bottom: 90rpx;height: 70vh;">
<view class="table-list-item" v-for="item in codeDeviceList" :key="item.maId"> <view class="table-list-item" v-for="item in codeDeviceList" :key="item.maId">
<uni-row :gutter="24"> <uni-row :gutter="24">
<uni-col :span="6">物资类型</uni-col> <uni-col :span="6">物资类型</uni-col>
@ -126,8 +126,10 @@ import { onLoad, onShow, } from '@dcloudio/uni-app'
import { getCodeDetailAPI, getCodeDeviceListAPI, setOutboundNumAPI, getCodeScanAPI } from '@/services/picking/outbound.js' import { getCodeDetailAPI, getCodeDeviceListAPI, setOutboundNumAPI, getCodeScanAPI } from '@/services/picking/outbound.js'
import { getBoxBindByCode } from '@/services/standard.js' import { getBoxBindByCode } from '@/services/standard.js'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue'
// const query = defineProps() // // const query = defineProps() //
// const queryParams = JSON.parse(query.queryParams) // const queryParams = JSON.parse(query.queryParams)
const scanQrCodeRef = ref(null)
const queryParams = ref({}) const queryParams = ref({})
const formData = ref({}) const formData = ref({})
const codeDeviceList = ref([]) const codeDeviceList = ref([])
@ -404,37 +406,56 @@ const scanStart = () => {
icon: 'none', icon: 'none',
}) })
}else{ }else{
var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module") // var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
mpaasScanModule.mpaasScan({ // mpaasScanModule.mpaasScan({
// qrCodebarCode // // qrCodebarCode
'scanType': ['qrCode','barCode'], // 'scanType': ['qrCode','barCode'],
// false // // false
'hideAlbum': false, // 'hideAlbum': false,
//ios zh-Hansen // //ios zh-Hansen
'language' : 'en', // 'language' : 'en',
//(ios) // //(ios)
'failedMsg': '未识别到二维码,请重试', // 'failedMsg': '',
//Android // //Android
'screenType': 'full' // 'screenType': 'full'
},(ret) => { // },(ret) => {
if(ret.resp_code==10){ // if(ret.resp_code==10){
uni.showToast({ title: '用户取消', icon: 'none' }) // uni.showToast({ title: '', icon: 'none' })
// }
// if(ret.resp_code==11){
// uni.showToast({ title: '', icon: 'none' })
// }
// if(ret.resp_code==1000){
// // uni.showToast({ title: '', icon: 'none' })
// console.log('444444444444444',ret)
// qrCodeScan.value = ret.resp_result
// if (qrCodeScan.value=="") {
// uni.showToast({ title: '', icon: 'none'})
// }else{
// getMaInfoScan()
// }
// }
// })
if (scanQrCodeRef.value) {
scanQrCodeRef.value.scanQrCode()
} }
if(ret.resp_code==11){
uni.showToast({ title: '扫码失败', icon: 'none' })
} }
if(ret.resp_code==1000){ }
// uni.showToast({ title: '', icon: 'none' })
console.log('444444444444444',ret) //
qrCodeScan.value = ret.resp_result const handleScanSuccess = (result) => {
if (qrCodeScan.value=="") { qrCodeScan.value = result
if (qrCodeScan.value === "") {
uni.showToast({ title: '扫码识别失败', icon: 'none' }) uni.showToast({ title: '扫码识别失败', icon: 'none' })
} else { } else {
getMaInfoScan() getMaInfoScan()
} }
} }
})
} //
const handleScanError = (error) => {
console.error('扫描出错:', error.message)
uni.showToast({ title: error.message, icon: 'none' })
} }
// //
const getMaInfoScan = async () => { const getMaInfoScan = async () => {

View File

@ -234,6 +234,7 @@ const handleItem = (item) => {
// //
const finish = computed(() => { const finish = computed(() => {
console.log("xxxxxxxxxxxx",total.value,tableList.value.length)
if (total.value === tableList.value.length) return true if (total.value === tableList.value.length) return true
}) })
@ -251,7 +252,7 @@ const successStyle = {
<style lang="scss" scoped> <style lang="scss" scoped>
.page-container { .page-container {
display: flex; display: flex;
height: 100%; height: 100vh;
flex-direction: column; flex-direction: column;
background-color: #f7f8fa; background-color: #f7f8fa;
padding: 24rpx; padding: 24rpx;
@ -499,6 +500,86 @@ const successStyle = {
} }
} }
} }
.scroll-container {
padding: 0 2rpx;
.table-list-item {
margin: 24rpx 0;
padding: 32rpx;
background-color: #fff;
min-height: 300rpx;
border-radius: 20rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
transition: all 0.3s ease;
&:active {
transform: scale(0.985);
background-color: #fafbfc;
}
.title {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
.title-left {
.code {
font-size: 32rpx;
font-weight: 600;
color: #3784fb;
letter-spacing: 1rpx;
}
}
span.status {
padding: 8rpx 28rpx;
border-radius: 8rpx;
font-size: 26rpx;
font-weight: 600;
&.completed {
background-color: rgba(82, 196, 26, 0.1);
color: #52c41a;
}
&.pending {
background-color: rgba(250, 140, 22, 0.1);
color: #fa8c16;
}
}
}
.line {
margin: 24rpx 0;
height: 2rpx;
background: linear-gradient(90deg,
rgba(232, 232, 232, 0) 0%,
rgba(232, 232, 232, 1) 50%,
rgba(232, 232, 232, 0) 100%
);
}
:deep(.uni-row) {
margin-bottom: 20rpx;
.uni-col-6 {
color: #8c8c8c;
font-size: 28rpx;
font-weight: 500;
}
}
.cont {
display: flex;
justify-content: flex-end;
line-height: 1.8;
color: #262626;
font-size: 28rpx;
font-weight: 500;
}
}
} }
// //
@ -509,6 +590,8 @@ const successStyle = {
padding: 32rpx 0; padding: 32rpx 0;
letter-spacing: 1rpx; letter-spacing: 1rpx;
} }
}
// //
:deep(.uni-swipe_action) { :deep(.uni-swipe_action) {

View File

@ -288,7 +288,7 @@ const successStyle = {
<style lang="scss" scoped> <style lang="scss" scoped>
.page-container { .page-container {
display: flex; display: flex;
height: 100%; height: 100vh;
flex-direction: column; flex-direction: column;
background-color: #f7f8fa; background-color: #f7f8fa;
padding: 24rpx; padding: 24rpx;
@ -536,6 +536,96 @@ const successStyle = {
} }
} }
} }
.scroll-container {
padding: 0 2rpx;
.table-list-item {
margin: 24rpx 0;
padding: 32rpx;
background-color: #fff;
min-height: 300rpx;
border-radius: 20rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
transition: all 0.3s ease;
&:active {
transform: scale(0.985);
background-color: #fafbfc;
}
.title {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
.title-left {
.code {
font-size: 32rpx;
font-weight: 600;
color: #3784fb;
letter-spacing: 1rpx;
}
}
span.status {
padding: 8rpx 28rpx;
border-radius: 8rpx;
font-size: 26rpx;
font-weight: 600;
&.completed {
background-color: rgba(82, 196, 26, 0.1);
color: #52c41a;
}
&.pending {
background-color: rgba(250, 140, 22, 0.1);
color: #fa8c16;
}
}
}
.line {
margin: 24rpx 0;
height: 2rpx;
background: linear-gradient(90deg,
rgba(232, 232, 232, 0) 0%,
rgba(232, 232, 232, 1) 50%,
rgba(232, 232, 232, 0) 100%
);
}
:deep(.uni-row) {
margin-bottom: 20rpx;
.uni-col-6 {
color: #8c8c8c;
font-size: 28rpx;
font-weight: 500;
}
}
.cont {
display: flex;
justify-content: flex-end;
line-height: 1.8;
color: #262626;
font-size: 28rpx;
font-weight: 500;
}
}
}
//
.loading-text {
text-align: center;
font-size: 26rpx;
color: #8c8c8c;
padding: 32rpx 0;
letter-spacing: 1rpx;
}
} }
// //