1
This commit is contained in:
parent
204ea47edf
commit
e0703136c1
3
MyApplication2/.idea/sonarlint/issuestore/1/5/15c2c2374b51ddda965f123d7721b78051be2c9f
generated
Normal file
3
MyApplication2/.idea/sonarlint/issuestore/1/5/15c2c2374b51ddda965f123d7721b78051be2c9f
generated
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
C
|
||||
java:S1185"(Remove this method to simply inherit it.(Þ×Ίÿÿÿÿÿ
|
@ -1,8 +1,8 @@
|
||||
|
||||
wjavascript:S3776""TRefactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.(ªù÷Ò8†¾ÕÞÝ/
|
||||
ˆjavascript:S4165'"eReview this redundant assignment: "start" already holds the assigned value along all execution paths.(ÑÉþÔ8†¾ÕÞÝ/
|
||||
ˆjavascript:S41651"eReview this redundant assignment: "start" already holds the assigned value along all execution paths.(ÑÉþÔ8‡¾ÕÞÝ/
|
||||
Ejavascript:S1656R""'this.best' is assigned to itself.(íæ<C3AD>è8ˆ¾ÕÞÝ/
|
||||
Jjavascript:S1125Y"'Remove the unnecessary boolean literal.(ƒª¶Î8‰¾ÕÞÝ/
|
||||
Ojavascript:S1125o"'Remove the unnecessary boolean literal.(¥Àµûýÿÿÿÿ8Š¾ÕÞÝ/
|
||||
Ojavascript:S1125o"'Remove the unnecessary boolean literal.(¥Àµûýÿÿÿÿ8‹¾ÕÞÝ/
|
||||
wjavascript:S3776#"TRefactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.(ªù÷Ò8†úìÞ/
|
||||
ˆjavascript:S4165("eReview this redundant assignment: "start" already holds the assigned value along all execution paths.(ÑÉþÔ8‡úìÞ/
|
||||
ˆjavascript:S41652"eReview this redundant assignment: "start" already holds the assigned value along all execution paths.(ÑÉþÔ8‡úìÞ/
|
||||
Ejavascript:S1656S""'this.best' is assigned to itself.(íæ<C3AD>è8ˆúìÞ/
|
||||
Jjavascript:S1125Z"'Remove the unnecessary boolean literal.(ƒª¶Î8ˆúìÞ/
|
||||
Jjavascript:S1125p"'Remove the unnecessary boolean literal.(Œ‹àâ8‰úìÞ/
|
||||
Jjavascript:S1125p"'Remove the unnecessary boolean literal.(Œ‹àâ8‰úìÞ/
|
0
MyApplication2/.idea/sonarlint/issuestore/3/b/3bb84a6effd773d95ed647597ffe3ad387fdfbcf
generated
Normal file
0
MyApplication2/.idea/sonarlint/issuestore/3/b/3bb84a6effd773d95ed647597ffe3ad387fdfbcf
generated
Normal file
3
MyApplication2/.idea/sonarlint/issuestore/4/3/432f7b86a9ef0116a552dc8dd8867c619cd9f198
generated
Normal file
3
MyApplication2/.idea/sonarlint/issuestore/4/3/432f7b86a9ef0116a552dc8dd8867c619cd9f198
generated
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
C
|
||||
java:S1185"(Remove this method to simply inherit it.(<28>º£”úÿÿÿÿ
|
0
MyApplication2/.idea/sonarlint/issuestore/6/2/6288971498872deb62c5e285d192d813e22b1c1c
generated
Normal file
0
MyApplication2/.idea/sonarlint/issuestore/6/2/6288971498872deb62c5e285d192d813e22b1c1c
generated
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
Kjavascript:S1186"#Unexpected empty method 'onCreate'.(ÇŽ½¸üÿÿÿÿ8à“¡¬Þ/
|
||||
Ljavascript:S1186"$Unexpected empty method 'onDestroy'.(–ßÙ©øÿÿÿÿ8çü¡¬Þ/
|
0
MyApplication2/.idea/sonarlint/issuestore/e/7/e76da2df200fc79b254b005f068d568bf8c2b7ec
generated
Normal file
0
MyApplication2/.idea/sonarlint/issuestore/e/7/e76da2df200fc79b254b005f068d568bf8c2b7ec
generated
Normal file
16
MyApplication2/.idea/sonarlint/issuestore/index.pb
generated
16
MyApplication2/.idea/sonarlint/issuestore/index.pb
generated
@ -1,13 +1,23 @@
|
||||
|
||||
P
|
||||
entry/src/main/js/default/app.js,b\4\b4c4e536f4084a0b6a45f8b0d2725567135b92e6
|
||||
Y
|
||||
)entry/src/main/js/default/i18n/en-US.json,5\3\53c2f15f1da3e1de172f90feee9cf4143c3029f0
|
||||
o
|
||||
?entry/src/main/java/com/xcl20481/myapplication/MainAbility.java,4\3\432f7b86a9ef0116a552dc8dd8867c619cd9f198
|
||||
q
|
||||
Aentry/src/main/java/com/xcl20481/myapplication/MyApplication.java,1\5\15c2c2374b51ddda965f123d7721b78051be2c9f
|
||||
P
|
||||
entry/src/main/js/default/app.js,b\4\b4c4e536f4084a0b6a45f8b0d2725567135b92e6
|
||||
_
|
||||
/entry/src/main/js/default/pages/index/index.hml,e\b\eb4272ef57a8e412e241acf56c46fd3c2ccd3848
|
||||
_
|
||||
/entry/src/main/js/default/pages/index/index.css,b\d\bded84c8d7c3dc43c805144b684b7e76d317f963
|
||||
_
|
||||
/entry/src/main/js/default/pages/index/index.hml,e\b\eb4272ef57a8e412e241acf56c46fd3c2ccd3848
|
||||
/entry/src/main/js/default/pages/page0/page0.hml,6\2\6288971498872deb62c5e285d192d813e22b1c1c
|
||||
^
|
||||
.entry/src/main/js/default/pages/index/index.js,3\6\36d48c2c0aa8cb6b91428b9d2d791dcae782d636
|
||||
_
|
||||
/entry/src/main/js/default/pages/page0/page0.css,3\b\3bb84a6effd773d95ed647597ffe3ad387fdfbcf
|
||||
^
|
||||
.entry/src/main/js/default/pages/page0/page0.js,e\7\e76da2df200fc79b254b005f068d568bf8c2b7ec
|
||||
J
|
||||
entry/src/main/config.json,1\0\10f965cf51fe14a5ef0ca2ebefb1bd7e4607eeb2
|
6
MyApplication2/.idea/vcs.xml
generated
Normal file
6
MyApplication2/.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -13,9 +13,9 @@ ohos {
|
||||
certpath file('C:\\Users\\honor\\.ohos\\config\\auto_debug_myapplication_56657123.cer')
|
||||
}
|
||||
}
|
||||
compileSdkVersion 5
|
||||
compileSdkVersion 7
|
||||
defaultConfig {
|
||||
compatibleSdkVersion 4
|
||||
compatibleSdkVersion 6
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
@ -1,10 +1,13 @@
|
||||
{
|
||||
"app": {
|
||||
"apiVersion": {
|
||||
"compatible": 3
|
||||
},
|
||||
"bundleName": "com.xcl20481.myapplication",
|
||||
"vendor": "xcl20481",
|
||||
"version": {
|
||||
"code": 1000000,
|
||||
"name": "1.0.1"
|
||||
"name": "1.0.2"
|
||||
}
|
||||
},
|
||||
"deviceConfig": {
|
||||
@ -16,6 +19,11 @@
|
||||
"package": "com.xcl20481.myapplication",
|
||||
"name": ".MyApplication",
|
||||
"mainAbility": "com.xcl20481.myapplication.MainAbility",
|
||||
"reqPermissions": [
|
||||
{
|
||||
"name": "ohos.permission.VIBRATE"
|
||||
}
|
||||
],
|
||||
"deviceType": [
|
||||
"phone",
|
||||
"tablet",
|
||||
@ -52,6 +60,7 @@
|
||||
"js": [
|
||||
{
|
||||
"pages": [
|
||||
"pages/page0/page0",
|
||||
"pages/index/index"
|
||||
],
|
||||
"name": "default",
|
||||
|
@ -1,8 +1,6 @@
|
||||
package com.xcl20481.myapplication;
|
||||
|
||||
import ohos.ace.ability.AceAbility;
|
||||
import ohos.aafwk.content.Intent;
|
||||
|
||||
public class MainAbility extends AceAbility {
|
||||
@Override
|
||||
public void onStart(Intent intent) {
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
export default {
|
||||
onCreate() {
|
||||
console.info('AceApplication onCreate');
|
||||
},
|
||||
onDestroy() {
|
||||
console.info('AceApplication onDestroy');
|
||||
}
|
||||
};
|
||||
|
@ -10,17 +10,19 @@
|
||||
width: 70px;
|
||||
height: 17px;
|
||||
letter-spacing: 0px;
|
||||
font-size: 11px;
|
||||
margin-top: 1.8px;
|
||||
font-size: 11.5px;
|
||||
margin-top: 1px;
|
||||
margin-bottom:3px;
|
||||
color: #eb0bc7f6;
|
||||
}
|
||||
.best{
|
||||
text-align: center;
|
||||
width: 60px;
|
||||
height: 17px;
|
||||
font-size: 12px;
|
||||
font-size: 12.5px;
|
||||
letter-spacing: 0px;
|
||||
margin-top: 8.5px;
|
||||
margin-top: 8.3px;
|
||||
color: #64f6f3;
|
||||
}
|
||||
.tile-wrap{
|
||||
width: 150px;
|
||||
@ -57,9 +59,9 @@
|
||||
height: 150px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: transparent;
|
||||
background-color: black;
|
||||
}
|
||||
.gameover{
|
||||
font-size: 20px;
|
||||
font-size: 30px;
|
||||
color: #FF7500;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import brightness from '@system.brightness';
|
||||
import vibrator from '@system.vibrator';
|
||||
let numbers,newNumbers;
|
||||
export default{
|
||||
data:{
|
||||
@ -108,7 +109,22 @@ export default{
|
||||
numbers=newNumbers;
|
||||
},
|
||||
isGameOver(){
|
||||
if(this.isGridsFull()==true && this.isGridsNotMergeable()==true) return true;
|
||||
if(this.isGridsFull()==true && this.isGridsNotMergeable()==true){
|
||||
vibrator.vibrate({
|
||||
mode: 'long',
|
||||
success: function(ret) {
|
||||
console.log('vibrate is successful');
|
||||
},
|
||||
fail: function(ret) {
|
||||
console.log('vibrate is failed');
|
||||
},
|
||||
complete: function(ret) {
|
||||
console.log('vibrate is completed');
|
||||
}
|
||||
});
|
||||
console.info('游戏结束');
|
||||
return true;
|
||||
}
|
||||
},
|
||||
isGridsFull(){
|
||||
if(numbers.indexOf(0)==-1){return true;}
|
||||
|
@ -0,0 +1,42 @@
|
||||
.container{
|
||||
width: 227px;
|
||||
height: 227px;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.title {
|
||||
text-align: center;
|
||||
width: 140px;
|
||||
height: 62px;
|
||||
letter-spacing: 0px;
|
||||
font-size: 19px;
|
||||
margin-top: 40px;
|
||||
margin-bottom:3px;
|
||||
color: #eb0750cb;
|
||||
}
|
||||
.title1 {
|
||||
text-align: center;
|
||||
width: 180px;
|
||||
height: 150px;
|
||||
font-size: 15.5px;
|
||||
margin-top: 5px;
|
||||
margin-bottom:5px;
|
||||
color: #eb0597bb;
|
||||
}
|
||||
.btn{
|
||||
width: 65.5px;
|
||||
height: 35.5px;
|
||||
background-color: #155ddc;
|
||||
margin-top: 5px;
|
||||
font-size: 13px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.btn1{
|
||||
width: 65.5px;
|
||||
height: 35.5px;
|
||||
background-color: #155ddc;
|
||||
margin-top: 5px;
|
||||
font-size: 13px;
|
||||
margin-bottom: 5px;
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<div class="container">
|
||||
<text class="title">
|
||||
《2048小游戏》
|
||||
</text>
|
||||
<text class="title1">
|
||||
开始游戏即默认同意我的隐私声明:www.xuegao-tzx.top/g2048h.html
|
||||
</text>
|
||||
<input class="btn" type="button" value="开始" onclick="ToStart"></input>
|
||||
<input class="btn1" type="button" value="退出" onclick="ToClose"></input>
|
||||
</div>
|
@ -0,0 +1,70 @@
|
||||
import router from '@system.router'
|
||||
import app from '@system.app'
|
||||
import brightness from '@system.brightness';
|
||||
import vibrator from '@system.vibrator';
|
||||
import prompt from '@system.prompt';
|
||||
export default {
|
||||
onInit() {
|
||||
brightness.setKeepScreenOn({keepScreenOn: true,});
|
||||
brightness.setMode({mode: 1,});
|
||||
},
|
||||
onSwipe(e) {
|
||||
switch (e.direction) {
|
||||
case 'left':
|
||||
break;
|
||||
case 'right':
|
||||
break;
|
||||
case 'up':
|
||||
break;
|
||||
case 'down':
|
||||
break;
|
||||
}
|
||||
},
|
||||
onlongpress(){
|
||||
console.log('tzx 11');
|
||||
prompt.showToast({
|
||||
message: 'Message Info',
|
||||
duration: 2000,
|
||||
});
|
||||
},
|
||||
ToStart(){
|
||||
vibrator.vibrate({
|
||||
mode: 'short',
|
||||
success: function(ret) {
|
||||
console.log('tzx vibrate is successful');
|
||||
},
|
||||
fail: function(ret) {
|
||||
console.log('tzx vibrate is failed');
|
||||
},
|
||||
complete: function(ret) {
|
||||
console.log('tzx vibrate is completed');
|
||||
}
|
||||
});
|
||||
prompt.showToast({
|
||||
message: '开始成功,By Xcl!',
|
||||
duration: 3000,
|
||||
});
|
||||
router.replace({
|
||||
uri: "pages/index/index",
|
||||
});
|
||||
},
|
||||
ToClose(){
|
||||
prompt.showToast({
|
||||
message: '退出成功!',
|
||||
duration: 3500,
|
||||
});
|
||||
vibrator.vibrate({
|
||||
mode: 'short',
|
||||
success: function(ret) {
|
||||
console.log('tzx vibrate is successful');
|
||||
},
|
||||
fail: function(ret) {
|
||||
console.log('tzx vibrate is failed');
|
||||
},
|
||||
complete: function(ret) {
|
||||
console.log('tzx vibrate is completed');
|
||||
}
|
||||
});
|
||||
app.terminate();
|
||||
},
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user