仪表换新列表优化
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="page_container checkouthouse_box">
|
||||
<view class="page_container checkouthouse_box flex flex-col">
|
||||
<view class="search_box">
|
||||
<view
|
||||
@click="handleClick"
|
||||
@@ -18,13 +18,8 @@
|
||||
v-else
|
||||
/>
|
||||
</view>
|
||||
<view class="search_list">
|
||||
<scroll-view
|
||||
style="height: 100%"
|
||||
lower-threshold="160"
|
||||
scroll-y="true"
|
||||
@scrolltolower="scrolltolower"
|
||||
>
|
||||
<view class="search_list flex-1 flex">
|
||||
<scroll-view lower-threshold="160" scroll-y="true" @scrolltolower="scrolltolower">
|
||||
<radio-group @change="radioChange">
|
||||
<label v-for="(item, index) in searchlist" :key="index">
|
||||
<view
|
||||
@@ -46,11 +41,15 @@
|
||||
</radio-group>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view class="action_btn" @tap="handleSelecthouse">
|
||||
<text>确 认</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 滚动 高度如何计算? -->
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
<script setup>
|
||||
import { ref, getCurrentInstance, onMounted } from 'vue'
|
||||
const Searching = ref(true)
|
||||
const queryParmas = ref({
|
||||
value: '',
|
||||
@@ -82,13 +81,16 @@ const searchlist = ref()
|
||||
|
||||
function getlist() {
|
||||
const allnum = queryParmas.value.pageNum * queryParmas.value.pageSize
|
||||
searchlist.value = Array.from({ length: allnum }).map((_, index) => {
|
||||
return {
|
||||
address: 'A栋3单元301',
|
||||
username: '里番',
|
||||
id: index + 1
|
||||
}
|
||||
})
|
||||
|
||||
if (allnum < 50) {
|
||||
searchlist.value = Array.from({ length: allnum }).map((_, index) => {
|
||||
return {
|
||||
address: 'A栋3单元301',
|
||||
username: '里番',
|
||||
id: index + 1
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
getlist()
|
||||
|
||||
@@ -96,21 +98,39 @@ function scrolltolower() {
|
||||
queryParmas.value.pageNum += 1
|
||||
getlist()
|
||||
}
|
||||
|
||||
let eventChannel = null
|
||||
// 必须在 onMounted 里获取
|
||||
onMounted(() => {
|
||||
const instance = getCurrentInstance().proxy
|
||||
if (instance && instance.getOpenerEventChannel) {
|
||||
eventChannel = instance.getOpenerEventChannel()
|
||||
}
|
||||
})
|
||||
|
||||
function handleSelecthouse() {
|
||||
// 2. 发送数据 (触发 A 页面定义的 'backData' 事件)
|
||||
console.log(eventChannel)
|
||||
eventChannel.emit('backData', {
|
||||
Houseid: checkoutHouseid.value,
|
||||
HouseName: 'A栋3单元301'
|
||||
})
|
||||
// 3. 返回上一页
|
||||
uni.navigateBack()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.checkouthouse_box {
|
||||
background: #f9f9f9;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
|
||||
.search_box {
|
||||
height: 80rpx;
|
||||
.search_view {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
background: #f3f3f3;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border-radius: 8rpx;
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
@@ -121,9 +141,10 @@ function scrolltolower() {
|
||||
}
|
||||
|
||||
.search_list {
|
||||
height: calc(100% - 140rpx);
|
||||
background-color: #4d5dfa;
|
||||
height: 100%;
|
||||
margin-top: 20rpx;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
.search_item {
|
||||
height: 116rpx;
|
||||
margin-bottom: 20rpx;
|
||||
@@ -157,5 +178,18 @@ function scrolltolower() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.action_btn {
|
||||
width: 670rpx;
|
||||
height: 80rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
background: #4d5dfa;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user