对接 投诉详情 投诉列表 选择处理人员 api
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<view
|
||||
@click="handleClick"
|
||||
class="search_view flex-center"
|
||||
v-if="!queryParmas.value.trim() && Searching"
|
||||
v-if="!queryParmas.keyword.trim() && Searching"
|
||||
>
|
||||
<uni-icons type="search" size="34rpx" color="rgba(0,0,0,0.26)"></uni-icons>
|
||||
<text>请输入关键字进行搜索</text>
|
||||
@@ -14,7 +14,7 @@
|
||||
@change="handleSearch"
|
||||
:focus="true"
|
||||
ref="inputRef"
|
||||
v-model="queryParmas.value"
|
||||
v-model="queryParmas.keyword"
|
||||
v-else
|
||||
/>
|
||||
</view>
|
||||
@@ -25,17 +25,17 @@
|
||||
<view
|
||||
class="search_item flex flex-between"
|
||||
:class="{
|
||||
active: checkoutHouseid === item.id
|
||||
active: checkoutHouseid === item.houseId
|
||||
}"
|
||||
>
|
||||
<view class="flex items-center flex-1">
|
||||
<!-- checkout -->
|
||||
<radio color="#4d5dfa" :value="item.id" />
|
||||
<radio color="#4d5dfa" :value="item.houseId" />
|
||||
<!-- housename -->
|
||||
<text class="address">{{ item.address }}</text>
|
||||
<text class="address">{{ item.addressCn ?? item.addressHyphen }}</text>
|
||||
</view>
|
||||
<!-- username -->
|
||||
<view class="username">{{ item.username }}</view>
|
||||
<view class="username">{{ item.residentName }}</view>
|
||||
</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
@@ -50,9 +50,11 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, getCurrentInstance, onMounted } from 'vue'
|
||||
import { getVillageHouseList_keyword } from '@/api/common.js'
|
||||
|
||||
const Searching = ref(true)
|
||||
const queryParmas = ref({
|
||||
value: '',
|
||||
keyword: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
})
|
||||
@@ -62,18 +64,17 @@ function handleClick() {
|
||||
}
|
||||
/** 判断 失去焦点时 切换回 view */
|
||||
function handleInput() {
|
||||
if (queryParmas.value.value.trim()) {
|
||||
if (queryParmas.value.keyword.trim()) {
|
||||
Searching.value = true
|
||||
}
|
||||
}
|
||||
function handleSearch() {}
|
||||
|
||||
const checkoutHouseid = ref(null)
|
||||
const checkoutHouseInfo = ref(null)
|
||||
/** 选择房屋,返回id*/
|
||||
function radioChange(res) {
|
||||
checkoutHouseid.value = Number(res.detail.value)
|
||||
const find = searchlist.value.find(item => item.id === Number(res.detail.value))
|
||||
checkoutHouseid.value = res.detail.value
|
||||
const find = searchlist.value.find(item => item.houseId === res.detail.value)
|
||||
if (find) {
|
||||
checkoutHouseInfo.value = find
|
||||
}
|
||||
@@ -83,7 +84,7 @@ function radioChange(res) {
|
||||
const searchlist = ref([])
|
||||
const isLoading = ref(false) // 加载锁
|
||||
const hasMore = ref(true) // 是否还有更多数据
|
||||
const total = ref(21)
|
||||
const total = ref(0)
|
||||
function scrolltolower() {
|
||||
// 必须加这两个判断!
|
||||
if (isLoading.value || !hasMore.value) {
|
||||
@@ -101,26 +102,21 @@ function getlist() {
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
const { pageNum, pageSize } = queryParmas.value
|
||||
|
||||
const startId = (pageNum - 1) * pageSize + 1
|
||||
const arr = Array.from({ length: pageSize }).map((_, index) => {
|
||||
const realId = startId + index // ✅ 修复 ID 错误
|
||||
return {
|
||||
id: realId,
|
||||
username: '李赫',
|
||||
address: 'A栋3单元3' + realId
|
||||
}
|
||||
})
|
||||
|
||||
// 追加数据(正确方式)
|
||||
searchlist.value = [...searchlist.value, ...arr]
|
||||
// 判断是否还有更多
|
||||
hasMore.value = searchlist.value.length < total.value
|
||||
isLoading.value = false
|
||||
uni.hideLoading()
|
||||
getVillageHouseList_keyword(queryParmas.value, queryParmas.value.keyword)
|
||||
.then(res => {
|
||||
// 追加数据(正确方式)
|
||||
searchlist.value = [...searchlist.value, ...res.rows]
|
||||
// 判断是否还有更多
|
||||
hasMore.value = searchlist.value.length < total.value
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
getlist()
|
||||
|
||||
// 重置list
|
||||
function resetList() {
|
||||
searchlist.value = []
|
||||
queryParmas.value.pageNum = 1
|
||||
@@ -128,7 +124,15 @@ function resetList() {
|
||||
getlist()
|
||||
}
|
||||
|
||||
// -0---------------------------------------
|
||||
// Search
|
||||
function handleSearch() {
|
||||
queryParmas.value.pageNum = 1
|
||||
queryParmas.value.pageSize = 10
|
||||
searchlist.value = []
|
||||
getlist()
|
||||
}
|
||||
|
||||
// ----------------------------------------
|
||||
let eventChannel = null
|
||||
// 必须在 onMounted 里获取
|
||||
onMounted(() => {
|
||||
@@ -139,11 +143,10 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
function handleSelecthouse() {
|
||||
console.log(checkoutHouseInfo.value)
|
||||
if (!eventChannel) return
|
||||
eventChannel.emit('backData', {
|
||||
Houseid: checkoutHouseid.value,
|
||||
HouseName: checkoutHouseInfo.value.address
|
||||
HouseName: checkoutHouseInfo.value.addressCn ?? checkoutHouseInfo.value.addressHyphen
|
||||
})
|
||||
// 3. 返回上一页
|
||||
uni.navigateBack()
|
||||
|
||||
Reference in New Issue
Block a user