This commit is contained in:
TxZgX 2021-12-23 15:44:54 +08:00
parent 204ea47edf
commit e0703136c1
18 changed files with 195 additions and 24 deletions

View File

@ -0,0 +1,3 @@
C
java:S1185"(Remove this method to simply inherit it.(Þ×Ίÿÿÿÿÿ

View File

@ -1,8 +1,8 @@
wjavascript:S3776""TRefactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.(ªù÷Ò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: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‡¾ÕÞÝ/ ˆjavascript:S41652"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ˆ¾ÕÞÝ/ Ejavascript:S1656S""'this.best' is assigned to itself.(íæ<C3AD>è8ˆúì­Þ/
Jjavascript:S1125Y"'Remove the unnecessary boolean literal.(ƒª¶Î8‰¾ÕÞÝ/ Jjavascript:S1125Z"'Remove the unnecessary boolean literal.(ƒª¶Î8ˆúì­Þ/
Ojavascript:S1125o"'Remove the unnecessary boolean literal.(¥Àµûýÿÿÿÿ8Š¾ÕÞÝ/ Jjavascript:S1125p"'Remove the unnecessary boolean literal.(Œ‹àâ8‰úì­Þ/
Ojavascript:S1125o"'Remove the unnecessary boolean literal.(¥Àµûýÿÿÿÿ8¾ÕÞÝ/ Jjavascript:S1125p"'Remove the unnecessary boolean literal.(Œ‹àâ8‰úì­Þ/

View File

@ -0,0 +1,3 @@
C
java:S1185 "(Remove this method to simply inherit it.(<28>º£”úÿÿÿÿ

View File

@ -0,0 +1,3 @@
Kjavascript:S1186"#Unexpected empty method 'onCreate'.(ÇŽ½¸üÿÿÿÿ8à“¡¬Þ/
Ljavascript:S1186"$Unexpected empty method 'onDestroy'.(–ßÙ©øÿÿÿÿ8çü¡¬Þ/

View File

@ -1,13 +1,23 @@
P
entry/src/main/js/default/app.js,b\4\b4c4e536f4084a0b6a45f8b0d2725567135b92e6
Y Y
)entry/src/main/js/default/i18n/en-US.json,5\3\53c2f15f1da3e1de172f90feee9cf4143c3029f0 )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.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/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 J
entry/src/main/config.json,1\0\10f965cf51fe14a5ef0ca2ebefb1bd7e4607eeb2 entry/src/main/config.json,1\0\10f965cf51fe14a5ef0ca2ebefb1bd7e4607eeb2

6
MyApplication2/.idea/vcs.xml generated Normal file
View 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>

View File

@ -13,9 +13,9 @@ ohos {
certpath file('C:\\Users\\honor\\.ohos\\config\\auto_debug_myapplication_56657123.cer') certpath file('C:\\Users\\honor\\.ohos\\config\\auto_debug_myapplication_56657123.cer')
} }
} }
compileSdkVersion 5 compileSdkVersion 7
defaultConfig { defaultConfig {
compatibleSdkVersion 4 compatibleSdkVersion 6
} }
buildTypes { buildTypes {
release { release {

View File

@ -1,10 +1,13 @@
{ {
"app": { "app": {
"apiVersion": {
"compatible": 3
},
"bundleName": "com.xcl20481.myapplication", "bundleName": "com.xcl20481.myapplication",
"vendor": "xcl20481", "vendor": "xcl20481",
"version": { "version": {
"code": 1000000, "code": 1000000,
"name": "1.0.1" "name": "1.0.2"
} }
}, },
"deviceConfig": { "deviceConfig": {
@ -16,6 +19,11 @@
"package": "com.xcl20481.myapplication", "package": "com.xcl20481.myapplication",
"name": ".MyApplication", "name": ".MyApplication",
"mainAbility": "com.xcl20481.myapplication.MainAbility", "mainAbility": "com.xcl20481.myapplication.MainAbility",
"reqPermissions": [
{
"name": "ohos.permission.VIBRATE"
}
],
"deviceType": [ "deviceType": [
"phone", "phone",
"tablet", "tablet",
@ -52,6 +60,7 @@
"js": [ "js": [
{ {
"pages": [ "pages": [
"pages/page0/page0",
"pages/index/index" "pages/index/index"
], ],
"name": "default", "name": "default",

View File

@ -1,8 +1,6 @@
package com.xcl20481.myapplication; package com.xcl20481.myapplication;
import ohos.ace.ability.AceAbility; import ohos.ace.ability.AceAbility;
import ohos.aafwk.content.Intent; import ohos.aafwk.content.Intent;
public class MainAbility extends AceAbility { public class MainAbility extends AceAbility {
@Override @Override
public void onStart(Intent intent) { public void onStart(Intent intent) {

View File

@ -1,8 +1,7 @@
export default { export default {
onCreate() { onCreate() {
console.info('AceApplication onCreate');
}, },
onDestroy() { onDestroy() {
console.info('AceApplication onDestroy');
} }
}; };

View File

@ -10,17 +10,19 @@
width: 70px; width: 70px;
height: 17px; height: 17px;
letter-spacing: 0px; letter-spacing: 0px;
font-size: 11px; font-size: 11.5px;
margin-top: 1.8px; margin-top: 1px;
margin-bottom:3px; margin-bottom:3px;
color: #eb0bc7f6;
} }
.best{ .best{
text-align: center; text-align: center;
width: 60px; width: 60px;
height: 17px; height: 17px;
font-size: 12px; font-size: 12.5px;
letter-spacing: 0px; letter-spacing: 0px;
margin-top: 8.5px; margin-top: 8.3px;
color: #64f6f3;
} }
.tile-wrap{ .tile-wrap{
width: 150px; width: 150px;
@ -57,9 +59,9 @@
height: 150px; height: 150px;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background-color: transparent; background-color: black;
} }
.gameover{ .gameover{
font-size: 20px; font-size: 30px;
color: #FF7500; color: #FF7500;
} }

View File

@ -1,4 +1,5 @@
import brightness from '@system.brightness'; import brightness from '@system.brightness';
import vibrator from '@system.vibrator';
let numbers,newNumbers; let numbers,newNumbers;
export default{ export default{
data:{ data:{
@ -108,7 +109,22 @@ export default{
numbers=newNumbers; numbers=newNumbers;
}, },
isGameOver(){ 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(){ isGridsFull(){
if(numbers.indexOf(0)==-1){return true;} if(numbers.indexOf(0)==-1){return true;}

View File

@ -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;
}

View File

@ -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>

View File

@ -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();
},
}