|
@@ -167,6 +167,8 @@ export default defineComponent({
|
|
|
init();
|
|
|
},600)
|
|
|
}else {
|
|
|
+ // isPlaying.value = false
|
|
|
+ count.value = 0;
|
|
|
init();
|
|
|
}
|
|
|
|
|
@@ -209,11 +211,19 @@ export default defineComponent({
|
|
|
second.value = Math.floor(count.value % 60);
|
|
|
};
|
|
|
|
|
|
- const updateMin = () => {
|
|
|
-
|
|
|
- console.log(mine.value, count.value);
|
|
|
+ const updateMin = (e:any) => {
|
|
|
+ let targetCount =parseInt(e.target.value);
|
|
|
+ if(Number.isNaN(targetCount) ){
|
|
|
+ targetCount = 0
|
|
|
+ }
|
|
|
+ if(targetCount > 59){
|
|
|
+ targetCount = 59
|
|
|
+ }
|
|
|
+ mine.value = targetCount
|
|
|
const lastStr = getSecond(count.value);
|
|
|
+ console.log( mine.value);
|
|
|
count.value = mine.value * 60 + second.value;
|
|
|
+
|
|
|
const str = getSecond(count.value);
|
|
|
console.log(str, lastStr);
|
|
|
for (let i = 0; i < flipObjs.value.length; i++) {
|
|
@@ -223,8 +233,15 @@ export default defineComponent({
|
|
|
flipObjs.value[i].value.flipUp(lastStr[i], str[i]);
|
|
|
}
|
|
|
};
|
|
|
- const updateSecond = () => {
|
|
|
- console.log(mine.value);
|
|
|
+ const updateSecond = (e:any) => {
|
|
|
+ let targetCount =parseInt(e.target.value);
|
|
|
+ if(Number.isNaN(targetCount) ){
|
|
|
+ targetCount = 0
|
|
|
+ }
|
|
|
+ if(targetCount > 59){
|
|
|
+ targetCount = 59
|
|
|
+ }
|
|
|
+ second.value = targetCount
|
|
|
const lastStr = getSecond(count.value);
|
|
|
count.value = mine.value * 60 + second.value;
|
|
|
const str = getSecond(count.value);
|
|
@@ -353,7 +370,7 @@ export default defineComponent({
|
|
|
<NButton
|
|
|
round
|
|
|
type="primary"
|
|
|
- disabled={count.value === 0}
|
|
|
+ disabled={count.value == 0}
|
|
|
icon-placement="right"
|
|
|
onClick={() => startTimer()}
|
|
|
v-slots={{
|