diff --git a/src/pages/business/CRM/marketActivity/chooseCus.vue b/src/pages/business/CRM/marketActivity/chooseCus.vue index 6372957..56bb92a 100644 --- a/src/pages/business/CRM/marketActivity/chooseCus.vue +++ b/src/pages/business/CRM/marketActivity/chooseCus.vue @@ -22,13 +22,13 @@ cancelButton="none" bgColor="#6FA2F8" textColor="#ffffff" v-model="searchValue" @clear="searchValue=''" /> - + - @@ -80,9 +80,9 @@ let cssFlag=ref(false);//控制样式 const upOption = ref({ page: { num: 0, size: 10 }, noMoreSize: 5, - empty: { - tip: '~ 空空如也 ~', - icon: "../../static/images/mescroll-empty.png" + empty: { + tip: '~ 空空如也 ~', + icon: "../../static/images/mescroll-empty.png" }, textLoading: '加载中...', textNoMore: '已经到底了' @@ -109,9 +109,9 @@ onLoad((options)=>{ instance = getCurrentInstance().proxy; const eventChannel = instance.getOpenerEventChannel(); eventChannel.on('requestCusList', async (res) => { - let {cusName} = res.data; - // console.log(cusName, "客户选择页读取到参数"); - searchValue.value = cusName; + let {cusName} = res.data; + // console.log(cusName, "客户选择页读取到参数"); + searchValue.value = cusName; }) }) @@ -121,8 +121,8 @@ watch(searchValue, (newValue, oldValue) => { // console.log(`新值: ${newValue}, 旧值: ${oldValue}`); if(timerId) clearTimeout(timerId); timerId = setTimeout(async ()=>{ - handleSearch(); - clearTimeout(timerId); + handleSearch(); + clearTimeout(timerId); timerId = null; }, 500); }); @@ -172,24 +172,25 @@ let handleSearch = async () => { } // 获取数据列表 const getList = async (pageIndex, pageSize) => { - let param = { - pageNum: pageIndex, - pageSize, - cusName: searchValue.value - } + let param = { + pageNum: pageIndex, + pageSize, + cusName: searchValue.value + } let { rows, total } = await getCustomerList(param) return {list: rows, total}; } // 选中项的索引号 const selectIndex = ref(null); const radioChange = (e) => { - let {value} = e.detail; // index - // console.log(value); - const eventChannel = instance.getOpenerEventChannel(); - eventChannel.emit('onCustomerSelected', list.value[value]); + const selectedIndex = e.detail.value; + //发送全局事件 + uni.$emit('onCustomerSelected',list.value[selectedIndex]) uni.navigateBack() } + + \ No newline at end of file +