mirror of
https://gitee.com/TSpecific/tuniao-ui.git
synced 2026-06-08 20:43:17 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c001636b3a | |||
| b503f3610f | |||
| f3471b2646 |
@@ -300,7 +300,9 @@
|
||||
},
|
||||
timer: null,
|
||||
dragging: false,
|
||||
show:true
|
||||
show:true,
|
||||
h5LongPress:false,
|
||||
h5StarDragging:false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -329,7 +331,11 @@
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.updateDragInfo()
|
||||
})
|
||||
});
|
||||
// #ifdef H5
|
||||
const userAgent = navigator.userAgent.toLowerCase();
|
||||
this.h5LongPress = /ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(userAgent);
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
// 清除列表
|
||||
@@ -738,6 +744,11 @@
|
||||
// #endif
|
||||
},
|
||||
movableLongPress(item) {
|
||||
// #ifdef H5
|
||||
//h5必须长按后才允许拖拽
|
||||
this.h5StarDragging = true;
|
||||
this.movableStart(item);
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
uni.vibrateShort()
|
||||
// console.log("LongPress--------------------------------------------------------------");
|
||||
@@ -804,7 +815,10 @@
|
||||
}
|
||||
},
|
||||
movableStart (item) {
|
||||
// console.log("movableStart");
|
||||
if (this.h5LongPress && !this.h5StarDragging){
|
||||
return
|
||||
}
|
||||
//console.log("movableStart");
|
||||
this.lists.forEach(item => {
|
||||
item.zIndex = 1
|
||||
// #ifdef H5
|
||||
@@ -825,8 +839,9 @@
|
||||
// #endif
|
||||
},
|
||||
movableEnd (item) {
|
||||
this.h5StarDragging = false;
|
||||
if (!this.dragging) return
|
||||
// console.log("movableEnd");
|
||||
//console.log("movableEnd");
|
||||
const index = this.lists.findIndex(obj => {
|
||||
return obj.id === item.id
|
||||
})
|
||||
@@ -892,6 +907,9 @@
|
||||
|
||||
.tn-image-upload {
|
||||
position: relative;
|
||||
/* #ifdef H5 */
|
||||
-webkit-touch-callout:none;
|
||||
/* #endif */
|
||||
|
||||
&__movable-area {
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user