小程序
小游戏
企业微信
微信支付
扫描小程序码分享
使用
picker-view
picker-view-column
做省市区级联,只能向下滑动(滚动), 向上滑动(滚动)就会触发
enablePullDownRefresh
我
设置是需要一些刷新
我以前不知道是自己没测出来还是就有这个问题
6 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
已复现,确实有点问题。感谢反馈,我们这边会尽快修复。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
请问 官方大佬,有没有修复此问题了?
我也出现了这个问题 一个页面 设置了enablePullDownRefresh = true 又实用了pick-view 向下滑动 会两个都会触发 请解决下 谢谢!!!!!
代码片段
wechatide://minicode/6o4kZNmb712G
我也出现了这个问题,在同时用到picker-view和enablePullDownRefresh时,往下滑动的操作时很难触发picker-view,或者2个都被触发。
我用的是官方的demo
<
view
>
style
=
"width:100%;height:100vh;background:#333;color:#fff;"
catchtouchmove
'preventTouchMove'
>{{year}}年{{month}}月{{day}}日</
indicator-style
"height: 50px;"
"width: 100%; height: 300px;position:fixed;bottom:0;left:0;background:#fff;"
value
"{{value}}"
bindchange
"bindChange"
wx:for
"{{years}}"
"line-height: 50px"
>{{item}}年</
</
"{{months}}"
>{{item}}月</
"{{days}}"
>{{item}}日</
const date =
new
Date()
const years = []
const months = []
const days = []
for
(let i = 1990; i <= date.getFullYear(); i++) {
years.push(i)
}
(let i = 1; i <= 12; i++) {
months.push(i)
(let i = 1; i <= 31; i++) {
days.push(i)
Page({
data: {
years: years,
year: date.getFullYear(),
months: months,
month: 2,
days: days,
day: 2,
value: [9999, 1, 1],
},
bindChange:
function
(e) {
const val = e.detail.value
this
.setData({
year:
.data.years[val[0]],
month:
.data.months[val[1]],
day:
.data.days[val[2]]
})
preventTouchMove(e){}
{
"enablePullDownRefresh"
:
true
请提供出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
调试基础库 2.0.9 机型: 中兴, 小米mix2s 微信版本: 6.7.2
刷新
enablePullDownRefresh: true
enablePullDownRefresh:
HTML 结构
class
"picker_box"
indicator-class
"selected"
"{{cityValue}}"
"cityChange"
"{{provices}}"
wx:key
'*this'
>{{item.label}}</
"{{urban}}"
"{{area}}"
</picker-view>
pick-view的处理 主要是在原始数据添加全部选项
cityChange(e) {
let val = e.detail.value
var
t =
.cityValue
// 城市数据坐标 0 0 0
const allCity =
.allCity
if
(val[0] !== t[0]) {
let urban = []
// 市处理
val[val[0], 0, 0]
allCity[val[0]].children.forEach((val, index) => {
urban.push({
'value'
: val.value,
'label'
: val.label
const addAll = [{
value:
''
,
label:
'全部'
}]
.urban = [...addAll, ...urban]
.cityValue = [e.detail.value[0], 0, 0]
// 区处理
let area = []
const allArea = [{
.area = [...allArea, ...area]
.$apply()
(val[1] !== t[1]) {
val[val[0], val[1], 0]
allCity[val[0]].children[val[1] - 1].children.forEach((val, index) => {
area.push({
.area = [...addAll, ...area]
.cityValue = [e.detail.value[0], e.detail.value[1], 0]
(val[2] !== t[2]) {
.cityValue = e.detail.value
数据
效果
感谢~~~~
麻烦按正确格式提供代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
已复现,确实有点问题。感谢反馈,我们这边会尽快修复。
请问 官方大佬,有没有修复此问题了?
我也出现了这个问题 一个页面 设置了enablePullDownRefresh = true 又实用了pick-view 向下滑动 会两个都会触发 请解决下 谢谢!!!!!
代码片段
wechatide://minicode/6o4kZNmb712G
我也出现了这个问题,在同时用到picker-view和enablePullDownRefresh时,往下滑动的操作时很难触发picker-view,或者2个都被触发。
我用的是官方的demo
<view><viewstyle="width:100%;height:100vh;background:#333;color:#fff;"catchtouchmove='preventTouchMove'>{{year}}年{{month}}月{{day}}日</view><picker-viewindicator-style="height: 50px;"style="width: 100%; height: 300px;position:fixed;bottom:0;left:0;background:#fff;"value="{{value}}"bindchange="bindChange"catchtouchmove='preventTouchMove'><picker-view-column><viewwx:for="{{years}}"style="line-height: 50px">{{item}}年</view></picker-view-column><picker-view-column><viewwx:for="{{months}}"style="line-height: 50px">{{item}}月</view></picker-view-column><picker-view-column><viewwx:for="{{days}}"style="line-height: 50px">{{item}}日</view></picker-view-column></picker-view></view>const date =newDate()const years = []const months = []const days = []for(let i = 1990; i <= date.getFullYear(); i++) {years.push(i)}for(let i = 1; i <= 12; i++) {months.push(i)}for(let i = 1; i <= 31; i++) {days.push(i)}Page({data: {years: years,year: date.getFullYear(),months: months,month: 2,days: days,day: 2,value: [9999, 1, 1],},bindChange:function(e) {const val = e.detail.valuethis.setData({year:this.data.years[val[0]],month:this.data.months[val[1]],day:this.data.days[val[2]]})},preventTouchMove(e){}}){"enablePullDownRefresh":true}请提供出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
调试基础库 2.0.9 机型: 中兴, 小米mix2s 微信版本: 6.7.2
刷新
enablePullDownRefresh:trueHTML 结构<picker-viewclass="picker_box"indicator-class="selected"value="{{cityValue}}"bindchange="cityChange"><picker-view-column><viewwx:for="{{provices}}"wx:key='*this'>{{item.label}}</view></picker-view-column><picker-view-column><viewwx:for="{{urban}}"wx:key='*this'>{{item.label}}</view></picker-view-column><picker-view-column><viewwx:for="{{area}}"wx:key='*this'>{{item.label}}</view></picker-view-column></picker-view>pick-view的处理 主要是在原始数据添加全部选项
cityChange(e) {let val = e.detail.valuevart =this.cityValue// 城市数据坐标 0 0 0const allCity =this.allCityif(val[0] !== t[0]) {let urban = []// 市处理val[val[0], 0, 0]allCity[val[0]].children.forEach((val, index) => {urban.push({'value': val.value,'label': val.label})})const addAll = [{value:'',label:'全部'}]this.urban = [...addAll, ...urban]this.cityValue = [e.detail.value[0], 0, 0]// 区处理let area = []const allArea = [{value:'',label:'全部'}]this.area = [...allArea, ...area]this.cityValue = [e.detail.value[0], 0, 0]this.$apply()}if(val[1] !== t[1]) {let area = []const addAll = [{value:'',label:'全部'}]val[val[0], val[1], 0]allCity[val[0]].children[val[1] - 1].children.forEach((val, index) => {area.push({'value': val.value,'label': val.label})})this.area = [...addAll, ...area]this.cityValue = [e.detail.value[0], e.detail.value[1], 0]this.$apply()}if(val[2] !== t[2]) {this.cityValue = e.detail.value}},数据
效果
感谢~~~~
麻烦按正确格式提供代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
代码片段
wechatide://minicode/6o4kZNmb712G