对接 投诉详情 投诉列表 选择处理人员 api
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
<view class="">
|
||||
<view class="info">
|
||||
<text>姓名:</text>
|
||||
<text>{{ item.name }}</text>
|
||||
<text>{{ item.nickName }}</text>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text>角色:</text>
|
||||
@@ -46,10 +46,10 @@
|
||||
</view>
|
||||
<view class="info">
|
||||
<text>手机号码:</text>
|
||||
<text>{{ item.phone }}</text>
|
||||
<text>{{ item.phonenumber }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<radio color="#4d5dfa" :value="item.id" />
|
||||
<radio color="#4d5dfa" :value="item.userId" />
|
||||
</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
@@ -63,10 +63,17 @@
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script setup key="Details">
|
||||
import { ref, onMounted, getCurrentInstance } from 'vue'
|
||||
import { getSystemUsers_employee } from '@/api/common.js'
|
||||
import navBar from '@/components/navbar/navbar.vue'
|
||||
|
||||
let eventChannel = null
|
||||
onMounted(() => {
|
||||
const instance = getCurrentInstance().proxy
|
||||
eventChannel = instance.getOpenerEventChannel()
|
||||
})
|
||||
|
||||
const Searching = ref(true)
|
||||
/** 点击时切换到input,并聚焦 */
|
||||
function handleClick() {
|
||||
@@ -100,70 +107,52 @@ function scrolltolower() {
|
||||
getlist()
|
||||
}
|
||||
function getlist() {
|
||||
// 1. 如果正在加载或没有更多数据,直接返回
|
||||
if (isLoading.value || !hasMore.value) return
|
||||
// 2. 开启锁
|
||||
if (isLoading.value) {
|
||||
return
|
||||
}
|
||||
isLoading.value = true
|
||||
uni.showLoading({
|
||||
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
|
||||
const randomStatus = Math.floor(Math.random() * 3)
|
||||
return {
|
||||
name: '张三' + realId,
|
||||
roleName: '维修人员',
|
||||
phone: '19578012123',
|
||||
id: realId
|
||||
}
|
||||
})
|
||||
// 追加数据(正确方式)
|
||||
searchlist.value = [...searchlist.value, ...arr]
|
||||
// 判断是否还有更多
|
||||
hasMore.value = searchlist.value.length < total.value
|
||||
isLoading.value = false
|
||||
uni.hideLoading()
|
||||
getSystemUsers_employee('complainUser', queryParmas.value.value)
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
searchlist.value = res.data
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
getlist()
|
||||
function resetList() {
|
||||
reportRecords.value = []
|
||||
queryParmas.value.pageNum = 1
|
||||
hasMore.value = true
|
||||
getlist()
|
||||
}
|
||||
|
||||
//=======================
|
||||
// 选中的人员id
|
||||
const checkoutUserid = ref(null)
|
||||
// 选中的人员信息
|
||||
const checkoutUserInfo = ref(null)
|
||||
|
||||
function radioChange(val) {
|
||||
checkoutUserid.value = Number(val.detail.value)
|
||||
const find = searchlist.value.find(item => item.id === Number(val.detail.value))
|
||||
checkoutUserid.value = val.detail.value
|
||||
const find = searchlist.value.find(item => item.userId === val.detail.value)
|
||||
if (find) {
|
||||
checkoutUserInfo.value = find
|
||||
}
|
||||
}
|
||||
|
||||
let eventChannel = null
|
||||
// 必须在 onMounted 里获取
|
||||
onMounted(() => {
|
||||
const instance = getCurrentInstance().proxy
|
||||
if (instance && instance.getOpenerEventChannel) {
|
||||
eventChannel = instance.getOpenerEventChannel()
|
||||
}
|
||||
})
|
||||
|
||||
function handleSelecthouse() {
|
||||
if (eventChannel) {
|
||||
eventChannel.emit('backData', {
|
||||
userid: checkoutUserid.value,
|
||||
username: checkoutUserInfo.value.name
|
||||
})
|
||||
// 3. 返回上一页
|
||||
uni.navigateBack()
|
||||
// 携带你要传递的参数
|
||||
const params = {
|
||||
userId: checkoutUserid.value,
|
||||
userName: checkoutUserInfo.value.nickName
|
||||
}
|
||||
eventChannel.emit('backData', {
|
||||
userId: params.userId,
|
||||
userName: encodeURIComponent(params.userName)
|
||||
})
|
||||
uni.navigateBack()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user