Browse Source

---

featrue/v4.5
DESKTOP-A1SENDA\HUzy 4 years ago
parent
commit
23635a1e88
1 changed files with 24 additions and 19 deletions
  1. 43
      components/city-change/index.js

43
components/city-change/index.js

@ -220,42 +220,47 @@ Component({
// }
//开始触摸事件
touchStart: function (e) {
console.log('开始')
this.data.touchEndy = e.touches[0].pageY-this.data.topHeight;
},
touchMove: function (e) {
this.data.touchEndy = e.touches[0].pageY-this.data.topHeight;
var lindex = parseInt(this.data.touchEndy / this.data.rightheight * 26);//根据前面分析获取手指触摸位置在letters中的index值
var value = this.data.letter[lindex];
console.log(value)
this.setData({
cityListId: value
});
if(value){
this.setData({
cityListId: value
});
}
this.titleDialog(value)
},
touchEnd: function (e) {
console.log('结束')
var lindex = parseInt(this.data.touchEndy / this.data.rightheight * 26);//根据前面分析获取手指触摸位置在letters中的index值
var value = this.data.letter[lindex];
this.setData({
cityListId: value
});
console.log(value)
if(value){
this.setData({
cityListId: value
});
}
this.titleDialog(value)
},
titleDialog: function (value) {
this.setData({
dialongValue:value,
dialogIsShow:true
})
setTimeout(() => {
if(value){
this.setData({
dialongValue:null,
dialogIsShow:false
dialongValue:value,
dialogIsShow:true
})
}, 1500);
setTimeout(() => {
this.setData({
dialongValue:null,
dialogIsShow:false
})
}, 1500);
}
},
},
ready() {

Loading…
Cancel
Save