diff --git a/README.OPENSOURCE b/README.OPENSOURCE index 6d0c105fa94691295dd29e46e0a5730e5c5d64e0..70b3951039f11e05c1178681dcb2928d5ace4d13 100644 --- a/README.OPENSOURCE +++ b/README.OPENSOURCE @@ -3,7 +3,7 @@ "Name":"ColorTextView", "License":"Apache License, Version 2.0", "License File":"LICENSE", - "Version Number":"release", + "Version Number":"master", "Upstream URL":"https://gitee.com/maosizouguo/ColorTextView", "Description":"mark some phrase with colors", } diff --git a/README.md b/README.md index d04d1bbdf18591f24389e46b34c386a1f0bc31e2..58f16547dfd3e5bee2b5d28f3f6747aead1245d0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - 功能:给指定文字设置指定颜色 - 项目移植状态:100%:已完成 - 调用差异:JS方式 -- 基线版本:release +- 基线版本:master - 开发版本:sdk5,DevEco Studio2.1 Release ## 使用说明 @@ -42,7 +42,7 @@ ``` ## 效果展示 - + ## 测试信息 CodeCheck代码测试无异常 diff --git a/entry/build.gradle b/entry/build.gradle index 27cc16bab8960efe639fc1b05b2201f703a178c9..2b23a857051050a033db405463b5bca172d3f2d5 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -1,17 +1,6 @@ apply plugin: 'com.huawei.ohos.hap' apply plugin: 'com.huawei.ohos.decctest' ohos { - signingConfigs { - debug { - storeFile file('D:\\cer\\hmp12.p12') - storePassword '0000001916815B1C6504B41C4345387B3321B31CC194E4A44035AF4F568801F649522187983C0D044A' - keyAlias = 'qazwsx' - keyPassword '00000019C7812DB1C0A6EACAA4BB15B2E8360AC5BEEE35AD7CBCB2AF43AC08E4732341DDC63FC166B1' - signAlg = 'SHA256withECDSA' - profile file('D:\\cer\\colortextDebug.p7b') - certpath file('D:\\cer\\hmcer.cer') - } - } compileSdkVersion 5 defaultConfig { compatibleSdkVersion 5 diff --git a/entry/src/main/java/com/zhw/cmcm/FeatureAbility.java b/entry/src/main/java/com/zhw/cmcm/FeatureAbility.java index 2862bcccd817d06e5404a00655f5243dbb74a469..1f3c9011860999002bee5dbcd3222f1ca0475dc2 100644 --- a/entry/src/main/java/com/zhw/cmcm/FeatureAbility.java +++ b/entry/src/main/java/com/zhw/cmcm/FeatureAbility.java @@ -23,7 +23,6 @@ import ohos.ace.ability.AceAbility; /** * FeatureAbility * - * @author:username * @since 2021-05-31 */ public class FeatureAbility extends AceAbility { diff --git a/entry/src/main/java/com/zhw/cmcm/MyApplication.java b/entry/src/main/java/com/zhw/cmcm/MyApplication.java index 65b449d33131817d834a0011d1ff6ed5730e1d49..0f83e1e13443998706d2864a7cf40b25b658d97d 100644 --- a/entry/src/main/java/com/zhw/cmcm/MyApplication.java +++ b/entry/src/main/java/com/zhw/cmcm/MyApplication.java @@ -22,7 +22,6 @@ import ohos.aafwk.ability.AbilityPackage; /** * MyApplication * - * @author:username * @since 2021-05-31 */ public class MyApplication extends AbilityPackage { diff --git a/entry/src/main/js/default/common/comp/colorText.js b/entry/src/main/js/default/common/comp/colorText.js index 8baf30b2f60147ed6a11a07f0ac40764dea011cc..7f0d70b7232569a74d717d9b34e4c7ee2775921b 100644 --- a/entry/src/main/js/default/common/comp/colorText.js +++ b/entry/src/main/js/default/common/comp/colorText.js @@ -3,7 +3,6 @@ export default { content: { default: 'You can get 500 credits after connect and share the WIFI' }, - colorList: [] }, data: { strList: [], @@ -11,11 +10,6 @@ export default { onInit() { this.getStrList(); }, - onReady() { - this.colorList.forEach(item => { - this.findAndSetStrColor(item.txt, item.color); - }) - }, /** * 截取单词,汉字,数字转成数组 */ @@ -35,6 +29,7 @@ export default { * @return */ findAndSetStrColor(str, color) { + console.error('----'+ str) this.strList.forEach((item, index) => { const el = this.$element(`title${index}`) let content = el.attr.value diff --git a/entry/src/main/js/default/pages/index/index.hml b/entry/src/main/js/default/pages/index/index.hml index 2be66817d4edf73eabf2aca9e589bb99f97335a2..3b1e5953876508ac1a526273fd8af3e636e8e48b 100644 --- a/entry/src/main/js/default/pages/index/index.hml +++ b/entry/src/main/js/default/pages/index/index.hml @@ -1,5 +1,5 @@
{{ $t('strings.app_name') }} - +
diff --git a/entry/src/main/js/default/pages/index/index.js b/entry/src/main/js/default/pages/index/index.js index eefbb65a068a6eff4933394ca0e5b472e25b4d43..9a7958cfb01dc138b50259cf77bf32fe8c0966ce 100644 --- a/entry/src/main/js/default/pages/index/index.js +++ b/entry/src/main/js/default/pages/index/index.js @@ -1,16 +1,14 @@ +// @ts-nocheck export default { data: { /*展示文本*/ content: `You can get 500 credits after connect and share the WIFI`, - - /*保存需要设置的文字和颜色*/ - colorList:[], - }, - onInit() { - //给指定文字设置指定颜色 - this.colorList.push({txt:'You',color:'#ff8000'}) - this.colorList.push({txt:'can',color:'#008888'}) - this.colorList.push({txt:'500',color:'#98FB98'}) - this.colorList.push({txt:'WIFI',color:'#FF0000'}) }, + onShow(){ + /*调用子组件设置颜色方法*/ + this.$child("colorText").findAndSetStrColor('You','#ff8000') + this.$child("colorText").findAndSetStrColor('can','#008888') + this.$child("colorText").findAndSetStrColor('500','#98FB98') + this.$child("colorText").findAndSetStrColor('WIFI','#FF0000') + } } diff --git a/gif/colorText.gif b/gif/colorText.gif new file mode 100644 index 0000000000000000000000000000000000000000..26a0bc1b69f11a5da296f1d1a2dfec6834694f34 Binary files /dev/null and b/gif/colorText.gif differ diff --git a/img/colorText.png b/img/colorText.png deleted file mode 100644 index 4a2f9e654699a4ca554a806fb209c81611404198..0000000000000000000000000000000000000000 Binary files a/img/colorText.png and /dev/null differ