处理冲突
This commit is contained in:
@@ -22,13 +22,13 @@
|
|||||||
cancelButton="none" bgColor="#6FA2F8" textColor="#ffffff"
|
cancelButton="none" bgColor="#6FA2F8" textColor="#ffffff"
|
||||||
v-model="searchValue" @clear="searchValue=''"
|
v-model="searchValue" @clear="searchValue=''"
|
||||||
/>
|
/>
|
||||||
<!-- <button type="default" @click="searchValue=''" size="mini" class="btn-search">清空</button>-->
|
<!-- <button type="default" @click="searchValue=''" size="mini" class="btn-search">清空</button>-->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 分页部分 -->
|
<!-- 分页部分 -->
|
||||||
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
|
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
|
||||||
:up="upOption" :down="downOption" :fixed="false" textColor="#ffffff" bgColor="#ffffff"
|
:up="upOption" :down="downOption" :fixed="false" textColor="#ffffff" bgColor="#ffffff"
|
||||||
class="scroll-h" :class="{'loading-scroll':cssFlag}"
|
class="scroll-h" :class="{'loading-scroll':cssFlag}"
|
||||||
><!-- @down="downCallback"-->
|
><!-- @down="downCallback"-->
|
||||||
<radio-group class="block" @change="radioChange">
|
<radio-group class="block" @change="radioChange">
|
||||||
<view class="white-bg" v-for="(item, index) in list" :key="index" @click="handleDetail(item)">
|
<view class="white-bg" v-for="(item, index) in list" :key="index" @click="handleDetail(item)">
|
||||||
@@ -81,8 +81,8 @@ const upOption = ref({
|
|||||||
page: { num: 0, size: 10 },
|
page: { num: 0, size: 10 },
|
||||||
noMoreSize: 5,
|
noMoreSize: 5,
|
||||||
empty: {
|
empty: {
|
||||||
tip: '~ 空空如也 ~',
|
tip: '~ 空空如也 ~',
|
||||||
icon: "../../static/images/mescroll-empty.png"
|
icon: "../../static/images/mescroll-empty.png"
|
||||||
},
|
},
|
||||||
textLoading: '加载中...',
|
textLoading: '加载中...',
|
||||||
textNoMore: '已经到底了'
|
textNoMore: '已经到底了'
|
||||||
@@ -109,9 +109,9 @@ onLoad((options)=>{
|
|||||||
instance = getCurrentInstance().proxy;
|
instance = getCurrentInstance().proxy;
|
||||||
const eventChannel = instance.getOpenerEventChannel();
|
const eventChannel = instance.getOpenerEventChannel();
|
||||||
eventChannel.on('requestCusList', async (res) => {
|
eventChannel.on('requestCusList', async (res) => {
|
||||||
let {cusName} = res.data;
|
let {cusName} = res.data;
|
||||||
// console.log(cusName, "客户选择页读取到参数");
|
// console.log(cusName, "客户选择页读取到参数");
|
||||||
searchValue.value = cusName;
|
searchValue.value = cusName;
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -121,8 +121,8 @@ watch(searchValue, (newValue, oldValue) => {
|
|||||||
// console.log(`新值: ${newValue}, 旧值: ${oldValue}`);
|
// console.log(`新值: ${newValue}, 旧值: ${oldValue}`);
|
||||||
if(timerId) clearTimeout(timerId);
|
if(timerId) clearTimeout(timerId);
|
||||||
timerId = setTimeout(async ()=>{
|
timerId = setTimeout(async ()=>{
|
||||||
handleSearch();
|
handleSearch();
|
||||||
clearTimeout(timerId);
|
clearTimeout(timerId);
|
||||||
timerId = null;
|
timerId = null;
|
||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
@@ -172,24 +172,25 @@ let handleSearch = async () => {
|
|||||||
}
|
}
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
const getList = async (pageIndex, pageSize) => {
|
const getList = async (pageIndex, pageSize) => {
|
||||||
let param = {
|
let param = {
|
||||||
pageNum: pageIndex,
|
pageNum: pageIndex,
|
||||||
pageSize,
|
pageSize,
|
||||||
cusName: searchValue.value
|
cusName: searchValue.value
|
||||||
}
|
}
|
||||||
let { rows, total } = await getCustomerList(param)
|
let { rows, total } = await getCustomerList(param)
|
||||||
return {list: rows, total};
|
return {list: rows, total};
|
||||||
}
|
}
|
||||||
// 选中项的索引号
|
// 选中项的索引号
|
||||||
const selectIndex = ref(null);
|
const selectIndex = ref(null);
|
||||||
const radioChange = (e) => {
|
const radioChange = (e) => {
|
||||||
let {value} = e.detail; // index
|
const selectedIndex = e.detail.value;
|
||||||
// console.log(value);
|
//发送全局事件
|
||||||
const eventChannel = instance.getOpenerEventChannel();
|
uni.$emit('onCustomerSelected',list.value[selectedIndex])
|
||||||
eventChannel.emit('onCustomerSelected', list.value[value]);
|
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user