Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uni-data-picker选不到直辖市的第二层 #506

Open
LnksW opened this issue May 7, 2022 · 3 comments
Open

uni-data-picker选不到直辖市的第二层 #506

LnksW opened this issue May 7, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@LnksW
Copy link

LnksW commented May 7, 2022

displayName": "uni-data-picker 数据驱动的picker选择器
version": "1.0.1
问题描述:在地区选择模式下第一次点到直辖市时没有第二层内容,但是可以点击,点选到第三层时第二层又出现
【gif录屏】
111
使用:

<uni-data-picker   :localdata="address" v-model="data.areaCode" :value="data.areaCode" @change="dataPickerChange($event, 'areaCode')" v-slot:default="{data, error, options}">
{{ data.length != 0 ? dataPicker(data) : '请选择' }}
</uni-data-picker>

json文件
https://github.com/Wdam/JSON/tree/main
补充
{@J 0G5%)RAUKMLWK@ A4

@mehaotian mehaotian added the bug Something isn't working label Jun 6, 2022
@dcloudhdx
Copy link
Contributor

请提供完整代码,看看map是如何映射的

@LnksW
Copy link
Author

LnksW commented Jun 7, 2022

<uni-data-picker   
    :localdata="address" 
    v-model="data.areaCode" 
    :value="data.areaCode" 
    @change="dataPickerChange($event, 'areaCode')" 
    v-slot:default="{data, error, options}">
    {{ data.length != 0 ? dataPicker(data) : '请选择' }}
</uni-data-picker>

/////////////////////////////////////////
data.areaCode = data.storeObject.areaCode // [110000,110100,110101]
//////////////////////////////////////////
	const dataPickerChange = async (e, name) => {
		data[name] = []
		let cityInfo = []
		e.detail.value.forEach(item => {
			data[name].push(item.value) // 地址码赋值
			cityInfo.push(item.text);
		})
		let mapKey = await getMapKey()
		await gaodeMap(cityInfo.join(),mapKey,2)
		
	}
//////////////////////////////////////////
	const dataPicker = (data) => {
		
		let result = ''
		data.forEach(item => result += (item.text + '/'))
		result = result.substr(0, result.length -1 ) // 截取掉最后一个斜杠
		pickerdata.value = result
	
		return result
	}

@dcloudhdx

@1575411352
Copy link

1575411352 commented Jan 16, 2023

问题我解决了,具体原因不是很清楚 可能是2个原因:

1.ios webview循环机制和web循环机制有出入,所以同名不做渲染,故不显示

2.组件本身的监听机制在ios webview上可能有问题

解决方案:
image

@Wdam @dcloudhdx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants