diff --git a/odf-uniapp/pages/rack-detail/index.vue b/odf-uniapp/pages/rack-detail/index.vue
index da2e372..5fda85f 100644
--- a/odf-uniapp/pages/rack-detail/index.vue
+++ b/odf-uniapp/pages/rack-detail/index.vue
@@ -44,28 +44,30 @@
{{ frame.name }}
-
-
- {{ row.name }}
-
-
-
+
+
+
+
+ {{ row.name }}
+
- {{ port.tips }}
+
+ {{ port.tips }}
+
+ {{ port.name }}
- {{ port.name }}
-
-
+
+
@@ -267,6 +269,16 @@ onLoad((options) => {
margin-bottom: 16rpx;
}
+.port-scroll {
+ width: 100%;
+ white-space: nowrap;
+}
+
+.port-rows-wrapper {
+ display: inline-block;
+ min-width: 100%;
+}
+
.port-row {
margin-bottom: 20rpx;
}
@@ -277,11 +289,6 @@ onLoad((options) => {
margin-bottom: 12rpx;
}
-.port-scroll {
- width: 100%;
- white-space: nowrap;
-}
-
.port-list {
display: flex;
flex-direction: row;
diff --git a/odf-uniapp/pages/rack/index.vue b/odf-uniapp/pages/rack/index.vue
index c5a4f5b..b6761f7 100644
--- a/odf-uniapp/pages/rack/index.vue
+++ b/odf-uniapp/pages/rack/index.vue
@@ -19,6 +19,12 @@
+
+
+
+ 请输入要搜索的备注内容
+
+
{
font-size: 26rpx;
}
+.search-bar {
+ display: flex;
+ align-items: center;
+ margin: 16rpx 24rpx;
+ padding: 0 24rpx;
+ height: 72rpx;
+ background-color: rgba(255, 255, 255, 0.9);
+ border-radius: 36rpx;
+}
+
+.search-icon {
+ width: 32rpx;
+ height: 32rpx;
+ margin-right: 16rpx;
+}
+
+.search-placeholder {
+ font-size: 26rpx;
+ color: #999;
+}
+
.nav-title {
font-size: 34rpx;
font-weight: 600;
diff --git a/odf-uniapp/pages/search/index.vue b/odf-uniapp/pages/search/index.vue
index b05a5c1..0210275 100644
--- a/odf-uniapp/pages/search/index.vue
+++ b/odf-uniapp/pages/search/index.vue
@@ -12,7 +12,7 @@
mode="aspectFit"
@click="goBack"
/>
- 搜索
+ {{ roomIdRef ? '机房搜索' : '搜索' }}
@@ -33,8 +33,8 @@
-
-
+
+
机房
import { ref } from 'vue'
-import { onReachBottom } from '@dcloudio/uni-app'
+import { onLoad, onReachBottom } from '@dcloudio/uni-app'
import { searchPorts } from '@/services/search'
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 0
@@ -123,6 +123,7 @@ const pageNum = ref(1)
const pageSize = 20
const totalPage = ref(0)
const loading = ref(false)
+const roomIdRef = ref('')
async function doSearch() {
const key = keyword.value.trim()
@@ -130,7 +131,7 @@ async function doSearch() {
pageNum.value = 1
loading.value = true
try {
- const res = await searchPorts(key, 1, pageSize)
+ const res = await searchPorts(key, 1, pageSize, roomIdRef.value || undefined)
if (res.code === 200 && res.data) {
rooms.value = res.data.rooms || []
const portsData = res.data.ports || {}
@@ -149,7 +150,7 @@ async function loadMore() {
loading.value = true
pageNum.value++
try {
- const res = await searchPorts(keyword.value.trim(), pageNum.value, pageSize)
+ const res = await searchPorts(keyword.value.trim(), pageNum.value, pageSize, roomIdRef.value || undefined)
if (res.code === 200 && res.data) {
const portsData = res.data.ports || {}
ports.value = [...ports.value, ...(portsData.result || [])]
@@ -179,6 +180,12 @@ function goPortDetail(item) {
onReachBottom(() => {
loadMore()
})
+
+onLoad((options) => {
+ if (options.roomId) {
+ roomIdRef.value = options.roomId
+ }
+})