增加禁用方法

This commit is contained in:
lixue 2021-12-14 09:42:40 +08:00
parent 6049c8a88e
commit 38174fdf7b
6 changed files with 9309 additions and 27 deletions

24
.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
.DS_Store
node_modules/
unpackage/
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.project
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
.gradle

66
dist/flip.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

9224
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,9 @@
"babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1", "babel-preset-es2015": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"css-loader": "^0.28.7", "css-loader": "^0.28.7",
"es6-promise": "^4.1.1", "es6-promise": "^4.1.1",
"node-sass": "^4.11.0", "node-sass": "^4.11.0",

View File

@ -437,7 +437,8 @@ export default {
showLastCoverPage: false, showLastCoverPage: false,
touchTimeline: [], touchTimeline: [],
styles: [{}, {}, {}, {}, {}, {}], styles: [{}, {}, {}, {}, {}, {}],
isStart: false isStart: false,
isDisable:false
}; };
}, },
mounted() { mounted() {
@ -483,7 +484,16 @@ export default {
this.$refs.turn.removeEventListener("touchend", this.handleManualTouchEnd, false); this.$refs.turn.removeEventListener("touchend", this.handleManualTouchEnd, false);
} }
}, },
enable(){
this.isDisable = false
},
disable(){
this.isDisable = true
},
handleManualTouchStart(e) { handleManualTouchStart(e) {
if(this.isDisable){
return
}
this.isStart = true; this.isStart = true;
let x = ""; let x = "";
let y = ""; let y = "";
@ -525,6 +535,9 @@ export default {
this.readyTurn(); this.readyTurn();
}, },
handleManualTouchMove(e) { handleManualTouchMove(e) {
if(this.isDisable){
return
}
let x = ""; let x = "";
let y = ""; let y = "";
if (this.isStart) { if (this.isStart) {
@ -553,6 +566,9 @@ export default {
}, },
handleManualTouchEnd() { handleManualTouchEnd() {
if(this.isDisable){
return
}
this.isStart = false; this.isStart = false;
const action = this.action; const action = this.action;