Commit e1795ae9 by 李伟康

commit 提交

1 parent c684bdb2
...@@ -138,7 +138,7 @@ export default { ...@@ -138,7 +138,7 @@ export default {
const carList = uni.getStorageSync(`${e.id}_${e.brandId}_carlist`) const carList = uni.getStorageSync(`${e.id}_${e.brandId}_carlist`)
if (carList) { if (carList) {
this.carlist = carList this.carlist = carList
if (auto && carList.length) this.handleSelect(res[0]) if (auto && carList.length) this.handleSelect(carList[0])
else this.$refs.carBoxVisible.open() else this.$refs.carBoxVisible.open()
} }
}) })
......
...@@ -98,6 +98,7 @@ export default { ...@@ -98,6 +98,7 @@ export default {
return { return {
drawStatus: false, drawStatus: false,
startX: null, startX: null,
startY: null,
screenWidth: null screenWidth: null
}; };
}, },
...@@ -162,7 +163,10 @@ export default { ...@@ -162,7 +163,10 @@ export default {
if (this.type != 'preview') this.drawStatus = !this.drawStatus if (this.type != 'preview') this.drawStatus = !this.drawStatus
}, },
touchStart (e) { touchStart (e) {
if (!this.drawStatus && e.changedTouches?.length) this.startX = e.changedTouches[0].pageX if (!this.drawStatus && e.changedTouches?.length) {
this.startX = e.changedTouches[0].pageX
this.startY = e.changedTouches[0].pageY
}
}, },
touchEnd (e) { touchEnd (e) {
try { try {
...@@ -172,9 +176,10 @@ export default { ...@@ -172,9 +176,10 @@ export default {
touch = e.changedTouches[0], touch = e.changedTouches[0],
isDistanceSignificant = Math.abs(touch.pageX - startX) > screenWidth / 3, isDistanceSignificant = Math.abs(touch.pageX - startX) > screenWidth / 3,
index = toolList.findIndex(item => item.id == id) index = toolList.findIndex(item => item.id == id)
if(Math.abs(this.startY - touch.pageY) > 100) return
if (isDistanceSignificant && index != -1) { if (isDistanceSignificant && index != -1) {
const nextId = this.getNextId(index, toolList, startX, halfScreenWidth) const nextId = this.getNextId(index, toolList, startX, halfScreenWidth)
// this.$emit('update:id', nextId) this.$emit('update:id', nextId)
} }
} catch (error) { } catch (error) {
console.log(error) console.log(error)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!