diff --git a/Telephony/eTSMessage/README_zh.md b/Telephony/eTSMessage/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..10d69108bd8fd4146f552aa18fe675e5a2ca6830 --- /dev/null +++ b/Telephony/eTSMessage/README_zh.md @@ -0,0 +1,17 @@ +# 短信服务 + +### 简介 + +本示例可以通过新建联系人,选择联系人,选择SIM卡来编写信息并发送。 + +### 使用说明 + +1.首页输入姓名,电话号码,点保存新建联系人,在新建联系人列表点箭头发送短信。 + +2.底部标签栏选SIM卡,选择卡槽1或卡槽2来发送信息。 + +3.选择联系人跳至编辑短信页面,编辑短信并发送。 + +### 约束与限制 + +本示例仅支持在标准系统上运行。 \ No newline at end of file diff --git a/Telephony/eTSMessage/build.gradle b/Telephony/eTSMessage/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..41a8bbd52c42f0a81590ba7e2a99064c033abd64 --- /dev/null +++ b/Telephony/eTSMessage/build.gradle @@ -0,0 +1,44 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + signingConfigs { + release { + storeFile file('D:\\key\\app.p12') + storePassword '0000001AAA71FB66D91A159298FE424B0420024D2A921129E59C784E36809A45EE37CF9E2352AB011888' + keyAlias = 'app' + keyPassword '0000001AF0061869E080ACA639A9252CA876F9C381E7E5FAD346CB3A3944E012ED060C9F95F43D4AE19D' + profile file('D:\\key\\app.p7b') + certpath file('D:\\key\\app.cer') + } + } + compileSdkVersion 8 + supportSystem "standard" +} + +buildscript { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } + dependencies { + classpath 'com.huawei.ohos:hap:3.0.3.4' + classpath 'com.huawei.ohos:decctest:1.2.6.0' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } +} diff --git a/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/app.js b/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/app.js new file mode 100644 index 0000000000000000000000000000000000000000..a21123316a68af4f83875ef5229edcbb77d7b94d --- /dev/null +++ b/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/app.js @@ -0,0 +1,24 @@ +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it uses a non-standard name for the exports (exports). +(() => { +var exports = __webpack_exports__; +/*!***********************************************************************************************!*\ + !*** ../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/app.ets?entry ***! + \***********************************************************************************************/ + +Object.defineProperty(exports, "__esModule", ({ value: true })); +globalThis.exports.default = { + onCreate() { + console.info('Application onCreate'); + }, + onDestroy() { + console.info('Application onDestroy'); + }, +}; + +})(); + +/******/ })() +; \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/commons.js b/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/commons.js new file mode 100644 index 0000000000000000000000000000000000000000..232fabc998fe8b6619b9d2c6457c1716fa0e571a --- /dev/null +++ b/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/commons.js @@ -0,0 +1,85 @@ +"use strict"; +(globalThis["webpackChunkcompilier"] = globalThis["webpackChunkcompilier"] || []).push([["commons"],{ + +/***/ "../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/model/interface.ets": +/*!*****************************************************************************************************!*\ + !*** ../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/model/interface.ets ***! + \*****************************************************************************************************/ +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.interFace = void 0; +var sms = globalThis.requireNapi('telephony.sms') || (isSystemplugin('telephony.sms', 'ohos') ? globalThis.ohosplugin.telephony.sms : isSystemplugin('telephony.sms', 'system') ? globalThis.systemplugin.telephony.sms : undefined); +var sim = globalThis.requireNapi('telephony.sim') || (isSystemplugin('telephony.sim', 'ohos') ? globalThis.ohosplugin.telephony.sim : isSystemplugin('telephony.sim', 'system') ? globalThis.systemplugin.telephony.sim : undefined); +const TAG = `[shortMessage]`; +class interFace { + getSimSpn(slotId, getSpn) { + sim.getSimSpn(slotId, (err, data) => { + console.log(`${TAG} getSimSpnCallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); + console.log(`${TAG} getSimSpnCallback1: err->${JSON.stringify(err)}, data->${data}`); + getSpn(data); + }); + } + create() { + const specification = '3gpp'; + const pdu = [0x08, 0x91]; + sms.createMessage(pdu, specification, (err, data) => { + console.log(`${TAG} createMessageCallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); + console.log(`${TAG} createMessageCallback1: err->${JSON.stringify(err)}, data->${data}`); + }); + } + send(slotId, content, destinationHost, serviceCenter, destinationPort) { + let sendCallback = function (err, data) { + console.log(`${TAG} sendCallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); + console.log(`${TAG} sendCallback1: err->${JSON.stringify(err)}, data->${data}`); + }; + let deliveryCallback = function (err, data) { + console.log(`${TAG} deliveryCallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); + console.log(`${TAG} deliveryCallback1: err->${JSON.stringify(err)}, data->${data}`); + }; + let options = { + slotId, + content, + destinationHost, + serviceCenter, + destinationPort, + sendCallback, + deliveryCallback + }; + sms.sendMessage(options); + console.log(`${TAG} send success`); + } + getSlotld(getSlotId) { + sms.getDefaultSmsSlotId((err, data) => { + console.log(`${TAG} getSlotldcallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); + console.log(`${TAG} getSlotldcallback1: err->${JSON.stringify(err)}, data->${data}`); + getSlotId(data); + }); + } + setAddr(slotId, smscAddr) { + sms.setSmscAddr(slotId, smscAddr, (err, data) => { + console.log(`${TAG} setAddrcallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); + console.log(`${TAG} setAddrcallback1: err->${JSON.stringify(err)}, data->${data}`); + }); + } + getAddr(slotId, getAddr) { + sms.getSmscAddr(slotId, (err, data) => { + console.log(`${TAG} getAddrcallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); + console.log(`${TAG} getAddrcallback1: err->${JSON.stringify(err)}, data->${data}`); + getAddr(data); + }); + } +} +exports.interFace = interFace; + + +/***/ }) + +}]); +globalThis["__common_module_cache__"] = globalThis["__common_module_cache__"] || {}; +globalThis["webpackChunkcompilier"].forEach((item)=> { + Object.keys(item[1]).forEach((element) => { + globalThis["__common_module_cache__"][element] = null; + }) +}); \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/manifest.json b/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..146123fc2ad38f8c5887db0415665040f7575b24 --- /dev/null +++ b/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/manifest.json @@ -0,0 +1,22 @@ +{ + "appID": "ohos.samples.etsmessage", + "appName": "$string:eTSMessage", + "versionName": "1.0.0", + "versionCode": 1000000, + "minPlatformVersion": 7, + "pages": [ + "pages/index", + "pages/second" + ], + "deviceType": [ + "phone" + ], + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "window": { + "autoDesignWidth": false, + "designWidth": 720 + } +} \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/pages/index.js b/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/pages/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f34d43056056b8c87db60374e42f680b957a8689 --- /dev/null +++ b/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/pages/index.js @@ -0,0 +1,799 @@ +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/common/sim.ets": +/*!************************************************************************************************!*\ + !*** ../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/common/sim.ets ***! + \************************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Sim = void 0; +const interface_1 = __webpack_require__(/*! ../model/interface */ "../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/model/interface.ets"); +class Sim extends View { + constructor(compilerAssignedUniqueChildId, parent, params) { + super(compilerAssignedUniqueChildId, parent); + this.__isOn = new ObservedPropertySimple(false, this, "isOn"); + this.__opacity = new ObservedPropertySimple(1, this, "opacity"); + this.__slotId = new ObservedPropertySimple(0, this, "slotId"); + this.__simSpn = new ObservedPropertySimple('', this, "simSpn"); + this.mInterFace = new interface_1.interFace(); + this.__text = new ObservedPropertySimple('', this, "text"); + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.isOn !== undefined) { + this.isOn = params.isOn; + } + if (params.opacity !== undefined) { + this.opacity = params.opacity; + } + if (params.slotId !== undefined) { + this.slotId = params.slotId; + } + if (params.simSpn !== undefined) { + this.simSpn = params.simSpn; + } + if (params.mInterFace !== undefined) { + this.mInterFace = params.mInterFace; + } + if (params.text !== undefined) { + this.text = params.text; + } + } + aboutToBeDeleted() { + this.__isOn.aboutToBeDeleted(); + this.__opacity.aboutToBeDeleted(); + this.__slotId.aboutToBeDeleted(); + this.__simSpn.aboutToBeDeleted(); + this.__text.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get isOn() { + return this.__isOn.get(); + } + set isOn(newValue) { + this.__isOn.set(newValue); + } + get opacity() { + return this.__opacity.get(); + } + set opacity(newValue) { + this.__opacity.set(newValue); + } + get slotId() { + return this.__slotId.get(); + } + set slotId(newValue) { + this.__slotId.set(newValue); + } + get simSpn() { + return this.__simSpn.get(); + } + set simSpn(newValue) { + this.__simSpn.set(newValue); + } + get text() { + return this.__text.get(); + } + set text(newValue) { + this.__text.set(newValue); + } + getSlotld(data) { + this.slotId = Number(data); + } + getSpn(data) { + this.simSpn = data; + } + render() { + Row.create(); + Row.debugLine("common/sim.ets(33:5)"); + Row.opacity(this.isOn ? this.opacity : 0.4); + Row.margin({ bottom: 10 }); + Row.height('17%'); + Row.width('90%'); + Row.backgroundColor('white'); + Row.borderRadius(20); + Image.create({ "id": 16777237, "type": 20000, params: [] }); + Image.debugLine("common/sim.ets(34:7)"); + Image.width('24%'); + Image.objectFit(ImageFit.Contain); + Image.margin({ left: 10 }); + Column.create(); + Column.debugLine("common/sim.ets(38:7)"); + Text.create({ "id": 16777228, "type": 10003, params: [] }); + Text.debugLine("common/sim.ets(39:9)"); + Text.textAlign(TextAlign.Start); + Text.margin({ left: 10 }); + Text.width('40%'); + Text.height('30%'); + Text.fontSize(20); + Text.pop(); + Text.create(this.simSpn); + Text.debugLine("common/sim.ets(45:9)"); + Text.textAlign(TextAlign.Start); + Text.margin({ left: 10 }); + Text.width('40%'); + Text.height('30%'); + Text.fontSize(20); + Text.pop(); + Text.create({ "id": 16777223, "type": 10003, params: [] }); + Text.debugLine("common/sim.ets(51:9)"); + Text.textAlign(TextAlign.Start); + Text.margin({ left: 10 }); + Text.width('49%'); + Text.height('30%'); + Text.fontSize(20); + Text.pop(); + Column.pop(); + Toggle.create({ type: ToggleType.Switch, isOn: this.isOn }); + Toggle.debugLine("common/sim.ets(59:7)"); + Toggle.selectedColor(0x39a2db); + Toggle.switchPointColor(0xe5ffffff); + Toggle.onChange((isOn) => { + this.isOn = !this.isOn; + if (this.isOn) { + this.mInterFace.getSlotld(this.getSlotld); + this.mInterFace.setAddr(this.slotId, '+8613800290500'); + this.mInterFace.getSimSpn(this.slotId, this.getSpn); + } + console.info('Component status:' + isOn); + }); + Toggle.pop(); + Row.pop(); + } +} +exports.Sim = Sim; + + +/***/ }), + +/***/ "../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/common/text.ets": +/*!*************************************************************************************************!*\ + !*** ../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/common/text.ets ***! + \*************************************************************************************************/ +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Txt = void 0; +class Txt extends View { + constructor(compilerAssignedUniqueChildId, parent, params) { + super(compilerAssignedUniqueChildId, parent); + this.__text = new ObservedPropertySimple('', this, "text"); + this.__bgColor = new ObservedPropertySimple('', this, "bgColor"); + this.__fontColor = new ObservedPropertySimple('', this, "fontColor"); + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.text !== undefined) { + this.text = params.text; + } + if (params.bgColor !== undefined) { + this.bgColor = params.bgColor; + } + if (params.fontColor !== undefined) { + this.fontColor = params.fontColor; + } + } + aboutToBeDeleted() { + this.__text.aboutToBeDeleted(); + this.__bgColor.aboutToBeDeleted(); + this.__fontColor.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get text() { + return this.__text.get(); + } + set text(newValue) { + this.__text.set(newValue); + } + get bgColor() { + return this.__bgColor.get(); + } + set bgColor(newValue) { + this.__bgColor.set(newValue); + } + get fontColor() { + return this.__fontColor.get(); + } + set fontColor(newValue) { + this.__fontColor.set(newValue); + } + render() { + Text.create(this.text); + Text.debugLine("common/text.ets(22:5)"); + Text.textAlign(TextAlign.Center); + Text.width('100%'); + Text.height('9%'); + Text.backgroundColor('' + this.bgColor); + Text.fontSize(25); + Text.fontColor('' + this.fontColor); + Text.fontWeight(FontWeight.Bold); + Text.pop(); + } +} +exports.Txt = Txt; + + +/***/ }), + +/***/ "../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/pages/index.ets?entry": +/*!*******************************************************************************************************!*\ + !*** ../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/pages/index.ets?entry ***! + \*******************************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +var router = globalThis.requireNativeModule('system.router'); +const sim_1 = __webpack_require__(/*! ../common/sim */ "../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/common/sim.ets"); +const text_1 = __webpack_require__(/*! ../common/text */ "../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/common/text.ets"); +class Index extends View { + constructor(compilerAssignedUniqueChildId, parent, params) { + super(compilerAssignedUniqueChildId, parent); + this.__fontColor = new ObservedPropertySimple('rgba(0, 0, 0, 0.4)', this, "fontColor"); + this.__selectedFontColor = new ObservedPropertySimple('rgba(10, 30, 255, 1)', this, "selectedFontColor"); + this.__currentIndex = new ObservedPropertySimple(0, this, "currentIndex"); + this.controller = new TabsController(); + this.__isOn = new ObservedPropertySimple(false, this, "isOn"); + this.__opacity = new ObservedPropertySimple(1, this, "opacity"); + this.__name = new ObservedPropertySimple('zhansan', this, "name"); + this.__destinationHost = new ObservedPropertySimple(123, this, "destinationHost"); + this.arrInfo = []; + this.__editFlag = new ObservedPropertySimple(false, this, "editFlag"); + this.scroller = new Scroller(); + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.fontColor !== undefined) { + this.fontColor = params.fontColor; + } + if (params.selectedFontColor !== undefined) { + this.selectedFontColor = params.selectedFontColor; + } + if (params.currentIndex !== undefined) { + this.currentIndex = params.currentIndex; + } + if (params.controller !== undefined) { + this.controller = params.controller; + } + if (params.isOn !== undefined) { + this.isOn = params.isOn; + } + if (params.opacity !== undefined) { + this.opacity = params.opacity; + } + if (params.name !== undefined) { + this.name = params.name; + } + if (params.destinationHost !== undefined) { + this.destinationHost = params.destinationHost; + } + if (params.arrInfo !== undefined) { + this.arrInfo = params.arrInfo; + } + if (params.editFlag !== undefined) { + this.editFlag = params.editFlag; + } + if (params.scroller !== undefined) { + this.scroller = params.scroller; + } + } + aboutToBeDeleted() { + this.__fontColor.aboutToBeDeleted(); + this.__selectedFontColor.aboutToBeDeleted(); + this.__currentIndex.aboutToBeDeleted(); + this.__isOn.aboutToBeDeleted(); + this.__opacity.aboutToBeDeleted(); + this.__name.aboutToBeDeleted(); + this.__destinationHost.aboutToBeDeleted(); + this.__editFlag.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get fontColor() { + return this.__fontColor.get(); + } + set fontColor(newValue) { + this.__fontColor.set(newValue); + } + get selectedFontColor() { + return this.__selectedFontColor.get(); + } + set selectedFontColor(newValue) { + this.__selectedFontColor.set(newValue); + } + get currentIndex() { + return this.__currentIndex.get(); + } + set currentIndex(newValue) { + this.__currentIndex.set(newValue); + } + get isOn() { + return this.__isOn.get(); + } + set isOn(newValue) { + this.__isOn.set(newValue); + } + get opacity() { + return this.__opacity.get(); + } + set opacity(newValue) { + this.__opacity.set(newValue); + } + get name() { + return this.__name.get(); + } + set name(newValue) { + this.__name.set(newValue); + } + get destinationHost() { + return this.__destinationHost.get(); + } + set destinationHost(newValue) { + this.__destinationHost.set(newValue); + } + get editFlag() { + return this.__editFlag.get(); + } + set editFlag(newValue) { + this.__editFlag.set(newValue); + } + Tab1Builder() { + Column.create(); + Column.debugLine("pages/index.ets(36:5)"); + Text.create({ "id": 16777216, "type": 10003, params: [] }); + Text.debugLine("pages/index.ets(37:7)"); + Text.fontColor(this.currentIndex === 0 ? this.selectedFontColor : this.fontColor); + Text.fontSize(20); + Text.margin({ top: 2 }); + Text.pop(); + Column.pop(); + } + Tab2Builder() { + Column.create(); + Column.debugLine("pages/index.ets(45:5)"); + Text.create({ "id": 16777227, "type": 10003, params: [] }); + Text.debugLine("pages/index.ets(46:7)"); + Text.fontColor(this.currentIndex === 1 ? this.selectedFontColor : this.fontColor); + Text.fontSize(20); + Text.margin({ top: 2 }); + Text.pop(); + Column.pop(); + } + render() { + Flex.create({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }); + Flex.debugLine("pages/index.ets(55:5)"); + Flex.width('100%'); + Flex.height('100%'); + Tabs.create({ barPosition: BarPosition.End, index: 0, controller: this.controller }); + Tabs.debugLine("pages/index.ets(56:7)"); + Tabs.vertical(false); + Tabs.barWidth(300); + Tabs.barHeight(56); + Tabs.onChange((index) => { + this.currentIndex = index; + }); + Tabs.height('100%'); + Tabs.width('100%'); + TabContent.create(); + TabContent.debugLine("pages/index.ets(57:9)"); + TabContent.tabBar({ builder: this.Tab1Builder.bind(this) }); + Scroll.create(this.scroller); + Scroll.debugLine("pages/index.ets(58:11)"); + Scroll.scrollBarColor(Color.Gray); + Scroll.scrollBarWidth(10); + Column.create(); + Column.debugLine("pages/index.ets(59:13)"); + let earlierCreatedChild_2 = this.findChildById("2"); + if (earlierCreatedChild_2 == undefined) { + View.create(new text_1.Txt("2", this, { text: { "id": 16777220, "type": 10003, params: [] }, bgColor: '#0D9FFB', fontColor: '#FFFFFF' })); + } + else { + earlierCreatedChild_2.updateWithValueParams({ + text: { "id": 16777220, "type": 10003, params: [] }, bgColor: '#0D9FFB', fontColor: '#FFFFFF' + }); + View.create(earlierCreatedChild_2); + } + let earlierCreatedChild_3 = this.findChildById("3"); + if (earlierCreatedChild_3 == undefined) { + View.create(new text_1.Txt("3", this, { text: { "id": 16777224, "type": 10003, params: [] }, bgColor: '#FFFFFF', fontColor: '#16CA55' })); + } + else { + earlierCreatedChild_3.updateWithValueParams({ + text: { "id": 16777224, "type": 10003, params: [] }, bgColor: '#FFFFFF', fontColor: '#16CA55' + }); + View.create(earlierCreatedChild_3); + } + Row.create(); + Row.debugLine("pages/index.ets(62:15)"); + Row.height('9.5%'); + Row.margin({ bottom: 4, top: 4 }); + Row.padding({ left: 10 }); + Text.create({ "id": 16777225, "type": 10003, params: [] }); + Text.debugLine("pages/index.ets(63:17)"); + Text.textAlign(TextAlign.Center); + Text.width('30%'); + Text.fontSize(20); + Text.pop(); + TextInput.create({ placeholder: { "id": 16777225, "type": 10003, params: [] } }); + TextInput.debugLine("pages/index.ets(67:17)"); + TextInput.width('60%'); + TextInput.fontSize(20); + TextInput.maxLength(20); + TextInput.fontWeight(FontWeight.Bold); + TextInput.placeholderFont({ size: 16, weight: FontWeight.Normal }); + TextInput.onChange((value) => { + this.name = value; + }); + Row.pop(); + Row.create(); + Row.debugLine("pages/index.ets(81:15)"); + Row.height('9.5%'); + Row.margin({ bottom: 4 }); + Row.padding({ left: 10 }); + Text.create({ "id": 16777230, "type": 10003, params: [] }); + Text.debugLine("pages/index.ets(82:17)"); + Text.textAlign(TextAlign.Center); + Text.width('30%'); + Text.fontSize(20); + Text.pop(); + TextInput.create({ placeholder: { "id": 16777230, "type": 10003, params: [] } }); + TextInput.debugLine("pages/index.ets(86:17)"); + TextInput.width('60%'); + TextInput.fontSize(20); + TextInput.maxLength(20); + TextInput.type(InputType.Number); + TextInput.fontWeight(FontWeight.Bold); + TextInput.placeholderFont({ size: 16, weight: FontWeight.Normal }); + TextInput.onChange((value) => { + this.destinationHost = Number(value); + }); + Row.pop(); + Flex.create({ + direction: FlexDirection.Row, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.SpaceAround + }); + Flex.debugLine("pages/index.ets(101:15)"); + Button.createWithChild(); + Button.debugLine("pages/index.ets(106:17)"); + Button.height(30); + Button.type(ButtonType.Capsule); + Button.backgroundColor(0x317aff); + Button.onClick(() => { + this.editFlag = !this.editFlag; + this.arrInfo.unshift({ name: this.name, destinationHost: this.destinationHost }); + this.editFlag = !this.editFlag; + console.log(JSON.stringify(this.arrInfo)); + }); + Text.create({ "id": 16777226, "type": 10003, params: [] }); + Text.debugLine("pages/index.ets(107:19)"); + Text.fontColor(Color.White); + Text.fontSize(16); + Text.width('30%'); + Text.textAlign(TextAlign.Center); + Text.pop(); + Button.pop(); + Flex.pop(); + let earlierCreatedChild_4 = this.findChildById("4"); + if (earlierCreatedChild_4 == undefined) { + View.create(new text_1.Txt("4", this, { text: { "id": 16777216, "type": 10003, params: [] }, bgColor: '#FFFFFF', fontColor: '#16CA55' })); + } + else { + earlierCreatedChild_4.updateWithValueParams({ + text: { "id": 16777216, "type": 10003, params: [] }, bgColor: '#FFFFFF', fontColor: '#16CA55' + }); + View.create(earlierCreatedChild_4); + } + Stack.create({ alignContent: Alignment.TopStart }); + Stack.debugLine("pages/index.ets(125:15)"); + Stack.width('100%'); + Stack.height('50%'); + Stack.backgroundColor(0xDCDCDC); + Stack.padding({ top: 5 }); + Column.create(); + Column.debugLine("pages/index.ets(126:17)"); + List.create({ space: 20, initialIndex: 0 }); + List.debugLine("pages/index.ets(127:19)"); + List.divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }); + List.editMode(this.editFlag); + List.onItemDelete((index) => { + this.arrInfo.splice((index - 1), 1); + console.info(JSON.stringify(this.arrInfo)); + this.editFlag = false; + return true; + }); + List.width('100%'); + ListItem.create(); + ListItem.debugLine("pages/index.ets(128:21)"); + Flex.create({ + direction: FlexDirection.Row, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.SpaceAround + }); + Flex.debugLine("pages/index.ets(129:23)"); + Button.createWithChild(); + Button.debugLine("pages/index.ets(134:25)"); + Button.height(30); + Button.type(ButtonType.Capsule); + Button.backgroundColor(0x317aff); + Button.onClick(() => { + this.editFlag = !this.editFlag; + }); + Text.create({ "id": 16777219, "type": 10003, params: [] }); + Text.debugLine("pages/index.ets(135:27)"); + Text.fontColor(Color.White); + Text.fontSize(16); + Text.width('30%'); + Text.textAlign(TextAlign.Center); + Text.pop(); + Button.pop(); + Flex.pop(); + ListItem.pop(); + ForEach.create("5", this, ObservedObject.GetRawObject(this.arrInfo), (item) => { + ListItem.create(); + ListItem.debugLine("pages/index.ets(151:23)"); + ListItem.onClick(() => { + console.log(JSON.stringify(item)); + }); + ListItem.editable(true); + ListItem.height('15%'); + Row.create(); + Row.debugLine("pages/index.ets(152:25)"); + Column.create(); + Column.debugLine("pages/index.ets(153:27)"); + Row.create(); + Row.debugLine("pages/index.ets(154:29)"); + Row.height('51%'); + Text.create({ "id": 16777222, "type": 10003, params: [] }); + Text.debugLine("pages/index.ets(155:31)"); + Text.textAlign(TextAlign.End); + Text.width('45%'); + Text.fontSize(20); + Text.padding({ right: 20 }); + Text.pop(); + Text.create('' + item.name); + Text.debugLine("pages/index.ets(160:31)"); + Text.textAlign(TextAlign.Start); + Text.width('36%'); + Text.fontSize(20); + Text.pop(); + Row.pop(); + Row.create(); + Row.debugLine("pages/index.ets(167:29)"); + Row.height('51%'); + Text.create({ "id": 16777231, "type": 10003, params: [] }); + Text.debugLine("pages/index.ets(168:31)"); + Text.textAlign(TextAlign.End); + Text.width('45%'); + Text.fontSize(20); + Text.padding({ right: 20 }); + Text.pop(); + Text.create('' + item.destinationHost); + Text.debugLine("pages/index.ets(173:31)"); + Text.textAlign(TextAlign.Start); + Text.width('36%'); + Text.fontSize(20); + Text.pop(); + Row.pop(); + Column.pop(); + Image.create({ "id": 16777233, "type": 20000, params: [] }); + Image.debugLine("pages/index.ets(181:27)"); + Image.width('9%'); + Image.objectFit(ImageFit.Contain); + Image.margin({ left: 10 }); + Image.onClick(() => { + router.push({ + uri: 'pages/second', + params: { + name: item.name, + destinationHost: item.destinationHost, + } + }); + }); + Row.pop(); + ListItem.pop(); + }); + ForEach.pop(); + List.pop(); + Column.pop(); + Stack.pop(); + Column.pop(); + Scroll.pop(); + TabContent.pop(); + TabContent.create(); + TabContent.debugLine("pages/index.ets(218:9)"); + TabContent.tabBar({ builder: this.Tab2Builder.bind(this) }); + TabContent.backgroundColor('#DFE3EF'); + Flex.create({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Start + }); + Flex.debugLine("pages/index.ets(219:11)"); + let earlierCreatedChild_6 = this.findChildById("6"); + if (earlierCreatedChild_6 == undefined) { + View.create(new text_1.Txt("6", this, { text: { "id": 16777220, "type": 10003, params: [] }, bgColor: '#0D9FFB', fontColor: '#FFFFFF' })); + } + else { + earlierCreatedChild_6.updateWithValueParams({ + text: { "id": 16777220, "type": 10003, params: [] }, bgColor: '#0D9FFB', fontColor: '#FFFFFF' + }); + View.create(earlierCreatedChild_6); + } + Text.create({ "id": 16777227, "type": 10003, params: [] }); + Text.debugLine("pages/index.ets(226:13)"); + Text.textAlign(TextAlign.Start); + Text.margin({ left: 40 }); + Text.width('100%'); + Text.height('9.5%'); + Text.fontSize(25); + Text.pop(); + let earlierCreatedChild_7 = this.findChildById("7"); + if (earlierCreatedChild_7 == undefined) { + View.create(new sim_1.Sim("7", this, { slotId: 0 })); + } + else { + earlierCreatedChild_7.updateWithValueParams({ + slotId: 0 + }); + View.create(earlierCreatedChild_7); + } + let earlierCreatedChild_8 = this.findChildById("8"); + if (earlierCreatedChild_8 == undefined) { + View.create(new sim_1.Sim("8", this, { slotId: 1 })); + } + else { + earlierCreatedChild_8.updateWithValueParams({ + slotId: 1 + }); + View.create(earlierCreatedChild_8); + } + Flex.pop(); + TabContent.pop(); + Tabs.pop(); + Flex.pop(); + } +} +loadDocument(new Index("1", undefined, {})); + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ var commonCachedModule = globalThis["__common_module_cache__"] ? globalThis["__common_module_cache__"][moduleId]: null; +/******/ if (commonCachedModule) { return commonCachedModule.exports; } +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ if (globalThis["__common_module_cache__"] && moduleId.indexOf("?name=") < 0 && Object.keys(globalThis["__common_module_cache__"]).indexOf(moduleId) >= 0) { +/******/ globalThis["__common_module_cache__"][moduleId] = module; +/******/ } +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/chunk loaded */ +/******/ (() => { +/******/ var deferred = []; +/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { +/******/ if(chunkIds) { +/******/ priority = priority || 0; +/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; +/******/ deferred[i] = [chunkIds, fn, priority]; +/******/ return; +/******/ } +/******/ var notFulfilled = Infinity; +/******/ for (var i = 0; i < deferred.length; i++) { +/******/ var [chunkIds, fn, priority] = deferred[i]; +/******/ var fulfilled = true; +/******/ for (var j = 0; j < chunkIds.length; j++) { +/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { +/******/ chunkIds.splice(j--, 1); +/******/ } else { +/******/ fulfilled = false; +/******/ if(priority < notFulfilled) notFulfilled = priority; +/******/ } +/******/ } +/******/ if(fulfilled) { +/******/ deferred.splice(i--, 1) +/******/ var r = fn(); +/******/ if (r !== undefined) result = r; +/******/ } +/******/ } +/******/ return result; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ "./pages/index": 0 +/******/ }; +/******/ +/******/ // no chunk on demand loading +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add "moreModules" to the modules object, +/******/ // then flag all "chunkIds" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkIds[i]] = 0; +/******/ } +/******/ return __webpack_require__.O(result); +/******/ } +/******/ +/******/ var chunkLoadingGlobal = globalThis["webpackChunkcompilier"] = globalThis["webpackChunkcompilier"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module depends on other loaded chunks and execution need to be delayed +/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["commons"], () => (__webpack_require__("../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/pages/index.ets?entry"))) +/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); +/******/ +/******/ })() +; \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/pages/second.js b/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/pages/second.js new file mode 100644 index 0000000000000000000000000000000000000000..02aedefea9a75586a2a11d71942d98d494e5a07b --- /dev/null +++ b/Telephony/eTSMessage/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/pages/second.js @@ -0,0 +1,338 @@ +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/pages/second.ets?entry": +/*!********************************************************************************************************!*\ + !*** ../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/pages/second.ets?entry ***! + \********************************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +var router = globalThis.requireNativeModule('system.router'); +const interface_1 = __webpack_require__(/*! ../model/interface */ "../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/model/interface.ets"); +class Second extends View { + constructor(compilerAssignedUniqueChildId, parent, params) { + super(compilerAssignedUniqueChildId, parent); + this.__content = new ObservedPropertySimple('222', this, "content"); + this.__serviceCenter = new ObservedPropertySimple(15289355171, this, "serviceCenter"); + this.__slotId = new ObservedPropertySimple(0, this, "slotId"); + this.name = router.getParams().name; + this.destinationHost = router.getParams().destinationHost; + this.mInterFace = new interface_1.interFace(); + this.__destinationPort = new ObservedPropertySimple(1000, this, "destinationPort"); + this.__opacity = new ObservedPropertySimple(0, this, "opacity"); + this.scroller = new Scroller(); + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.content !== undefined) { + this.content = params.content; + } + if (params.serviceCenter !== undefined) { + this.serviceCenter = params.serviceCenter; + } + if (params.slotId !== undefined) { + this.slotId = params.slotId; + } + if (params.name !== undefined) { + this.name = params.name; + } + if (params.destinationHost !== undefined) { + this.destinationHost = params.destinationHost; + } + if (params.mInterFace !== undefined) { + this.mInterFace = params.mInterFace; + } + if (params.destinationPort !== undefined) { + this.destinationPort = params.destinationPort; + } + if (params.opacity !== undefined) { + this.opacity = params.opacity; + } + if (params.scroller !== undefined) { + this.scroller = params.scroller; + } + } + aboutToBeDeleted() { + this.__content.aboutToBeDeleted(); + this.__serviceCenter.aboutToBeDeleted(); + this.__slotId.aboutToBeDeleted(); + this.__destinationPort.aboutToBeDeleted(); + this.__opacity.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get content() { + return this.__content.get(); + } + set content(newValue) { + this.__content.set(newValue); + } + get serviceCenter() { + return this.__serviceCenter.get(); + } + set serviceCenter(newValue) { + this.__serviceCenter.set(newValue); + } + get slotId() { + return this.__slotId.get(); + } + set slotId(newValue) { + this.__slotId.set(newValue); + } + get destinationPort() { + return this.__destinationPort.get(); + } + set destinationPort(newValue) { + this.__destinationPort.set(newValue); + } + get opacity() { + return this.__opacity.get(); + } + set opacity(newValue) { + this.__opacity.set(newValue); + } + getSlotld(data) { + this.slotId = Number(data); + } + getAddr(data) { + this.serviceCenter = Number(data); + } + render() { + Flex.create({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }); + Flex.debugLine("pages/second.ets(41:5)"); + Flex.width('100%'); + Flex.height('100%'); + Text.create({ "id": 16777220, "type": 10003, params: [] }); + Text.debugLine("pages/second.ets(42:7)"); + Text.textAlign(TextAlign.Center); + Text.width('100%'); + Text.height('8%'); + Text.backgroundColor("#0D9FFB"); + Text.fontSize(25); + Text.fontColor(Color.White); + Text.fontWeight(FontWeight.Bold); + Text.pop(); + Text.create({ "id": 16777224, "type": 10003, params: [] }); + Text.debugLine("pages/second.ets(51:7)"); + Text.textAlign(TextAlign.Center); + Text.width('100%'); + Text.height('8%'); + Text.fontSize(25); + Text.pop(); + Row.create(); + Row.debugLine("pages/second.ets(56:7)"); + Text.create(this.name); + Text.debugLine("pages/second.ets(57:9)"); + Text.textAlign(TextAlign.Center); + Text.width('34%'); + Text.height('8%'); + Text.fontSize(25); + Text.fontColor('#13C027'); + Text.pop(); + Text.create(`${this.destinationHost}`); + Text.debugLine("pages/second.ets(64:9)"); + Text.textAlign(TextAlign.Center); + Text.width('50%'); + Text.height('8%'); + Text.fontSize(25); + Text.pop(); + Row.pop(); + Row.create(); + Row.debugLine("pages/second.ets(71:7)"); + Row.opacity(this.opacity); + Row.margin({ bottom: 10 }); + Row.height('17%'); + Row.width('90%'); + Row.backgroundColor('#DFE3EF'); + Row.borderRadius(20); + Scroll.create(this.scroller); + Scroll.debugLine("pages/second.ets(72:9)"); + Scroll.scrollBar(BarState.Off); + Column.create(); + Column.debugLine("pages/second.ets(73:11)"); + Text.create(`${this.content}`); + Text.debugLine("pages/second.ets(74:13)"); + Text.textAlign(TextAlign.Start); + Text.width('90%'); + Text.fontSize(25); + Text.padding({ left: 30 }); + Text.textOverflow({ overflow: TextOverflow.Clip }); + Text.pop(); + Column.pop(); + Scroll.pop(); + Row.pop(); + Row.create(); + Row.debugLine("pages/second.ets(91:7)"); + Row.position({ x: 0, y: '44%' }); + TextArea.create({ placeholder: { "id": 16777221, "type": 10003, params: [] } }); + TextArea.debugLine("pages/second.ets(92:9)"); + TextArea.placeholderColor("#92958C"); + TextArea.placeholderFont({ size: 26, weight: 100, family: 'cursive', style: FontStyle.Normal }); + TextArea.textAlign(TextAlign.Start); + TextArea.width('88%'); + TextArea.height(50); + TextArea.fontSize(30); + TextArea.fontWeight(FontWeight.Bold); + TextArea.fontFamily("sans-serif"); + TextArea.onChange((value) => { + this.content = value; + }); + Image.create({ "id": 16777232, "type": 20000, params: [] }); + Image.debugLine("pages/second.ets(104:9)"); + Image.width('10%'); + Image.objectFit(ImageFit.Contain); + Image.onClick(() => { + if (this.content !== '') { + this.opacity = 1; + } + this.mInterFace.getSlotld(this.getSlotld); + this.mInterFace.getAddr(this.slotId, this.getAddr); + this.mInterFace.send(this.slotId, this.content, this.destinationHost, this.serviceCenter, this.destinationPort); + this.mInterFace.create(); + console.log('success'); + }); + Row.pop(); + Flex.pop(); + } +} +loadDocument(new Second("1", undefined, {})); + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ var commonCachedModule = globalThis["__common_module_cache__"] ? globalThis["__common_module_cache__"][moduleId]: null; +/******/ if (commonCachedModule) { return commonCachedModule.exports; } +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ if (globalThis["__common_module_cache__"] && moduleId.indexOf("?name=") < 0 && Object.keys(globalThis["__common_module_cache__"]).indexOf(moduleId) >= 0) { +/******/ globalThis["__common_module_cache__"][moduleId] = module; +/******/ } +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/chunk loaded */ +/******/ (() => { +/******/ var deferred = []; +/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { +/******/ if(chunkIds) { +/******/ priority = priority || 0; +/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; +/******/ deferred[i] = [chunkIds, fn, priority]; +/******/ return; +/******/ } +/******/ var notFulfilled = Infinity; +/******/ for (var i = 0; i < deferred.length; i++) { +/******/ var [chunkIds, fn, priority] = deferred[i]; +/******/ var fulfilled = true; +/******/ for (var j = 0; j < chunkIds.length; j++) { +/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { +/******/ chunkIds.splice(j--, 1); +/******/ } else { +/******/ fulfilled = false; +/******/ if(priority < notFulfilled) notFulfilled = priority; +/******/ } +/******/ } +/******/ if(fulfilled) { +/******/ deferred.splice(i--, 1) +/******/ var r = fn(); +/******/ if (r !== undefined) result = r; +/******/ } +/******/ } +/******/ return result; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ "./pages/second": 0 +/******/ }; +/******/ +/******/ // no chunk on demand loading +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add "moreModules" to the modules object, +/******/ // then flag all "chunkIds" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkIds[i]] = 0; +/******/ } +/******/ return __webpack_require__.O(result); +/******/ } +/******/ +/******/ var chunkLoadingGlobal = globalThis["webpackChunkcompilier"] = globalThis["webpackChunkcompilier"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module depends on other loaded chunks and execution need to be delayed +/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["commons"], () => (__webpack_require__("../../../../../workPackage/code/eTSMessage/entry/src/main/ets/MainAbility/pages/second.ets?entry"))) +/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); +/******/ +/******/ })() +; \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/.preview/jsManifest/MainAbility/manifest.json b/Telephony/eTSMessage/entry/.preview/jsManifest/MainAbility/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..146123fc2ad38f8c5887db0415665040f7575b24 --- /dev/null +++ b/Telephony/eTSMessage/entry/.preview/jsManifest/MainAbility/manifest.json @@ -0,0 +1,22 @@ +{ + "appID": "ohos.samples.etsmessage", + "appName": "$string:eTSMessage", + "versionName": "1.0.0", + "versionCode": 1000000, + "minPlatformVersion": 7, + "pages": [ + "pages/index", + "pages/second" + ], + "deviceType": [ + "phone" + ], + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "window": { + "autoDesignWidth": false, + "designWidth": 720 + } +} \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/build.gradle b/Telephony/eTSMessage/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..e7ab61a295250d4e5c32d2096a53451cf045bbf3 --- /dev/null +++ b/Telephony/eTSMessage/entry/build.gradle @@ -0,0 +1,16 @@ +apply plugin: 'com.huawei.ohos.hap' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 8 + defaultConfig { + compatibleSdkVersion 7 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} diff --git a/Telephony/eTSMessage/entry/src/main/config.json b/Telephony/eTSMessage/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..6951dcffd8a10d9ea7dd326869a50f396aec9e9d --- /dev/null +++ b/Telephony/eTSMessage/entry/src/main/config.json @@ -0,0 +1,72 @@ +{ + "app": { + "bundleName": "ohos.samples.etsmessage", + "vendor": "samples", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.samples.etsmessage", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:eTSMessage", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.GET_TELEPHONY_STATE" + } + ] + } +} \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/src/main/ets/MainAbility/app.ets b/Telephony/eTSMessage/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 0000000000000000000000000000000000000000..bf28e58b36cf11db491d3f00768ef2c9e41d05cf --- /dev/null +++ b/Telephony/eTSMessage/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/src/main/ets/MainAbility/common/sim.ets b/Telephony/eTSMessage/entry/src/main/ets/MainAbility/common/sim.ets new file mode 100644 index 0000000000000000000000000000000000000000..d7dfe4318a5213086fb70e8704c4078b676a5adc --- /dev/null +++ b/Telephony/eTSMessage/entry/src/main/ets/MainAbility/common/sim.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { interFace } from '../model/interface' + +@Component +export struct Sim { + @State isOn: boolean= false + @State opacity: number= 1 + @State slotId: number= 0 + @State simSpn: string='' + private mInterFace= new interFace() + @State text: string= '' + + getSlotld(data) { + this.slotId = Number(data) + } + getSpn(data){ + this.simSpn=data + } + build() { + Row() { + Image($r('app.media.sim')) + .width('24%') + .objectFit(ImageFit.Contain) + .margin({ left: 10 }) + Column() { + Text($r("app.string.sim1")) + .textAlign(TextAlign.Start) + .margin({ left: 10 }) + .width('40%') + .height('30%') + .fontSize(20) + Text(this.simSpn) + .textAlign(TextAlign.Start) + .margin({ left: 10 }) + .width('40%') + .height('30%') + .fontSize(20) + Text($r("app.string.network")) + .textAlign(TextAlign.Start) + .margin({ left: 10 }) + .width('49%') + .height('30%') + .fontSize(20) + } + + Toggle({ type: ToggleType.Switch, isOn: this.isOn }) + .selectedColor(0x39a2db) + .switchPointColor(0xe5ffffff) + .onChange((isOn: boolean) => { + this.isOn = !this.isOn + if (this.isOn) { + this.mInterFace.getSlotld(this.getSlotld) + this.mInterFace.setAddr(this.slotId, '+8613800290500') + this.mInterFace.getSimSpn(this.slotId,this.getSpn) + } + console.info('Component status:' + isOn) + }) + } + .opacity(this.isOn ? this.opacity : 0.4) + .margin({ bottom: 10 }) + .height('17%') + .width('90%') + .backgroundColor('white') + .borderRadius(20) + } +} \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/src/main/ets/MainAbility/common/text.ets b/Telephony/eTSMessage/entry/src/main/ets/MainAbility/common/text.ets new file mode 100644 index 0000000000000000000000000000000000000000..230f35e7df6ce9183e80f865245e390acdc834c5 --- /dev/null +++ b/Telephony/eTSMessage/entry/src/main/ets/MainAbility/common/text.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Component +export struct Txt { + @State text: string= '' + @State bgColor: string= '' + @State fontColor: string= '' + + build() { + Text(this.text) + .textAlign(TextAlign.Center) + .width('100%') + .height('9%') + .backgroundColor('' + this.bgColor) + .fontSize(25) + .fontColor('' + this.fontColor) + .fontWeight(FontWeight.Bold) + } +} diff --git a/Telephony/eTSMessage/entry/src/main/ets/MainAbility/model/interface.ets b/Telephony/eTSMessage/entry/src/main/ets/MainAbility/model/interface.ets new file mode 100644 index 0000000000000000000000000000000000000000..2961067a7b2fd48489df9e8b0b060acd765f7b2c --- /dev/null +++ b/Telephony/eTSMessage/entry/src/main/ets/MainAbility/model/interface.ets @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +import sms from '@ohos.telephony.sms'; +import sim from '@ohos.telephony.sim'; + +const TAG = `[shortMessage]` + +export class interFace { + + getSimSpn(slotId,getSpn){ + sim.getSimSpn(slotId, (err, data) => { + console.log(`${TAG} getSimSpnCallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`) + console.log(`${TAG} getSimSpnCallback1: err->${JSON.stringify(err)}, data->${data}`) + getSpn(data) + }); + + } + + create() { + const specification = '3gpp' + const pdu = [0x08, 0x91] + sms.createMessage(pdu, specification, (err, data) => { + console.log(`${TAG} createMessageCallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`) + console.log(`${TAG} createMessageCallback1: err->${JSON.stringify(err)}, data->${data}`) + }); + } + + send(slotId, content, destinationHost, serviceCenter, destinationPort) { + let sendCallback = function (err, data) { + console.log(`${TAG} sendCallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`) + console.log(`${TAG} sendCallback1: err->${JSON.stringify(err)}, data->${data}`) + } + let deliveryCallback = function (err, data) { + console.log(`${TAG} deliveryCallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`) + console.log(`${TAG} deliveryCallback1: err->${JSON.stringify(err)}, data->${data}`) + } + + let options = { + slotId, + content, + destinationHost, + serviceCenter, + destinationPort, + sendCallback, + deliveryCallback + } + sms.sendMessage(options) + console.log(`${TAG} send success`) + } + + getSlotld(getSlotId) { + sms.getDefaultSmsSlotId((err, data) => { + console.log(`${TAG} getSlotldcallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`) + console.log(`${TAG} getSlotldcallback1: err->${JSON.stringify(err)}, data->${data}`) + getSlotId(data) + }) + } + + setAddr(slotId, smscAddr) { + sms.setSmscAddr(slotId, smscAddr, (err, data) => { + console.log(`${TAG} setAddrcallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`) + console.log(`${TAG} setAddrcallback1: err->${JSON.stringify(err)}, data->${data}`) + }) + } + + getAddr(slotId, getAddr) { + sms.getSmscAddr(slotId, (err, data) => { + console.log(`${TAG} getAddrcallback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`) + console.log(`${TAG} getAddrcallback1: err->${JSON.stringify(err)}, data->${data}`) + getAddr(data) + }) + } +} + + diff --git a/Telephony/eTSMessage/entry/src/main/ets/MainAbility/pages/index.ets b/Telephony/eTSMessage/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..387e9ff79b24003e5ce4c59ee63fc3e00c7b5449 --- /dev/null +++ b/Telephony/eTSMessage/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,250 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router' +import { Sim } from '../common/sim' +import { Txt } from '../common/text' + +@Entry +@Component +struct Index { + @State fontColor: string = 'rgba(0, 0, 0, 0.4)' + @State selectedFontColor: string = 'rgba(10, 30, 255, 1)' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @State isOn: boolean= false + @State opacity: number= 1 + @State name: string = 'zhansan' + @State destinationHost: number= 123 + private arrInfo= [] + @State editFlag: boolean = false + scroller: Scroller = new Scroller() + + @Builder Tab1Builder() { + Column() { + Text($r('app.string.contacts')) + .fontColor(this.currentIndex === 0 ? this.selectedFontColor : this.fontColor) + .fontSize(20) + .margin({ top: 2 }) + } + } + + @Builder Tab2Builder() { + Column() { + Text($r('app.string.sim')) + .fontColor(this.currentIndex === 1 ? this.selectedFontColor : this.fontColor) + .fontSize(20) + .margin({ top: 2 }) + } + } + + build() { + + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) { + Tabs({ barPosition: BarPosition.End, index: 0, controller: this.controller }) { + TabContent() { + Scroll(this.scroller) { + Column() { + Txt({ text: $r('app.string.information_service'), bgColor: '#0D9FFB', fontColor: '#FFFFFF' }) + Txt({ text: $r('app.string.new_information'), bgColor: '#FFFFFF', fontColor: '#16CA55' }) + Row() { + Text($r('app.string.new_name')) + .textAlign(TextAlign.Center) + .width('30%') + .fontSize(20) + TextInput({ placeholder: $r('app.string.new_name') }) + .width('60%') + .fontSize(20) + .maxLength(20) + .fontWeight(FontWeight.Bold) + .placeholderFont({ size: 16, weight: FontWeight.Normal }) + .onChange((value: string) => { + this.name = value + }) + } + .height('9.5%') + .margin({ bottom: 4, top: 4 }) + .padding({ left: 10 }) + + Row() { + Text($r('app.string.telephone')) + .textAlign(TextAlign.Center) + .width('30%') + .fontSize(20) + TextInput({ placeholder: $r('app.string.telephone') }) + .width('60%') + .fontSize(20) + .maxLength(20) + .type(InputType.Number) + .fontWeight(FontWeight.Bold) + .placeholderFont({ size: 16, weight: FontWeight.Normal }) + .onChange((value: string) => { + this.destinationHost = Number(value) + }) + } + .height('9.5%') + .margin({ bottom: 4 }) + .padding({ left: 10 }) + + Flex({ + direction: FlexDirection.Row, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.SpaceAround + }) { + Button() { + Text($r('app.string.preserve')) + .fontColor(Color.White) + .fontSize(16) + .width('30%') + .textAlign(TextAlign.Center) + } + .height(30) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .onClick(() => { + this.editFlag = !this.editFlag + this.arrInfo.unshift({ name: this.name, destinationHost: this.destinationHost }) + this.editFlag = !this.editFlag + console.log(JSON.stringify(this.arrInfo)) + }) + } + + Txt({ text: $r('app.string.contacts'), bgColor: '#FFFFFF', fontColor: '#16CA55' }) + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ListItem() { + Flex({ + direction: FlexDirection.Row, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.SpaceAround + }) { + Button() { + Text($r('app.string.edit')) + .fontColor(Color.White) + .fontSize(16) + .width('30%') + .textAlign(TextAlign.Center) + } + .height(30) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .onClick(() => { + this.editFlag = !this.editFlag + }) + } + } + + ForEach(this.arrInfo, (item) => { + ListItem() { + Row() { + Column() { + Row() { + Text($r('app.string.name_edit')) + .textAlign(TextAlign.End) + .width('45%') + .fontSize(20) + .padding({ right: 20 }) + Text('' + item.name) + .textAlign(TextAlign.Start) + .width('36%') + .fontSize(20) + } + .height('51%') + + Row() { + Text($r('app.string.telephone_edit')) + .textAlign(TextAlign.End) + .width('45%') + .fontSize(20) + .padding({ right: 20 }) + Text('' + item.destinationHost) + .textAlign(TextAlign.Start) + .width('36%') + .fontSize(20) + } + .height('51%') + } + + Image($r('app.media.choose')).width('9%').objectFit(ImageFit.Contain).margin({ left: 10 }) + .onClick(() => { + router.push({ + uri: 'pages/second', + params: { + name: item.name, + destinationHost: item.destinationHost, + } + }) + }) + } + } + .onClick(() => { + console.log(JSON.stringify(item)) + }) + .editable(true) + .height('15%') + }) + } + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .editMode(this.editFlag) + .onItemDelete((index: number) => { + this.arrInfo.splice((index - 1), 1) + console.info(JSON.stringify(this.arrInfo)) + this.editFlag = false + return true + }).width('100%') + } + }.width('100%') + .height('50%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } + }.scrollBarColor(Color.Gray).scrollBarWidth(10) + + }.tabBar(this.Tab1Builder) + + TabContent() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Start + }) { + Txt({ text: $r('app.string.information_service'), bgColor: '#0D9FFB', fontColor: '#FFFFFF' }) + + Text($r('app.string.sim')) + .textAlign(TextAlign.Start) + .margin({ left: 40 }) + .width('100%') + .height('9.5%') + .fontSize(25) + Sim({ slotId: 0 }) + Sim({ slotId: 1 }) + } + }.tabBar(this.Tab2Builder).backgroundColor('#DFE3EF') + } + .vertical(false) + .barWidth(300) + .barHeight(56) + .onChange((index: number) => { + this.currentIndex = index + }) + .height('100%') + .width('100%') + } + .width('100%') + .height('100%') + + } +} \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/src/main/ets/MainAbility/pages/second.ets b/Telephony/eTSMessage/entry/src/main/ets/MainAbility/pages/second.ets new file mode 100644 index 0000000000000000000000000000000000000000..a830875a8af89817f09deebb6eab713f527ca1ea --- /dev/null +++ b/Telephony/eTSMessage/entry/src/main/ets/MainAbility/pages/second.ets @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import { interFace } from '../model/interface' + +@Entry +@Component +struct Second { + @State content: string= '222' + @State serviceCenter: number= 15289355171 + @State slotId: number= 0 + private name: string= router.getParams().name + private destinationHost: number= router.getParams().destinationHost + private mInterFace = new interFace() + @State destinationPort: number= 1000 + @State opacity: number= 0 + scroller: Scroller = new Scroller() + + getSlotld(data) { + this.slotId = Number(data) + } + + getAddr(data) { + this.serviceCenter = Number(data) + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { + Text($r('app.string.information_service')) + .textAlign(TextAlign.Center) + .width('100%') + .height('8%') + .backgroundColor("#0D9FFB") + .fontSize(25) + .fontColor(Color.White) + .fontWeight(FontWeight.Bold) + + Text($r('app.string.new_information')) + .textAlign(TextAlign.Center) + .width('100%') + .height('8%') + .fontSize(25) + Row() { + Text(this.name) + .textAlign(TextAlign.Center) + .width('34%') + .height('8%') + .fontSize(25) + .fontColor('#13C027') + + Text(`${this.destinationHost}`) + .textAlign(TextAlign.Center) + .width('50%') + .height('8%') + .fontSize(25) + } + + Row() { + Scroll(this.scroller) { + Column() { + Text(`${this.content}`) + .textAlign(TextAlign.Start) + .width('90%') + .fontSize(25) + .padding({ left: 30 }) + .textOverflow({ overflow: TextOverflow.Clip }) + } + } + .scrollBar(BarState.Off) + } + .opacity(this.opacity) + .margin({ bottom: 10 }) + .height('17%') + .width('90%') + .backgroundColor('#DFE3EF') + .borderRadius(20) + + Row() { + TextArea({ placeholder: $r('app.string.message') }) + .placeholderColor("#92958C") + .placeholderFont({ size: 26, weight: 100, family: 'cursive', style: FontStyle.Normal }) + .textAlign(TextAlign.Start) + .width('88%') + .height(50) + .fontSize(30) + .fontWeight(FontWeight.Bold) + .fontFamily("sans-serif") + .onChange((value: string) => { + this.content = value + }) + Image($r('app.media.arrow')) + .width('10%') + .objectFit(ImageFit.Contain) + .onClick(() => { + if (this.content !== '') { + this.opacity = 1 + } + this.mInterFace.getSlotld(this.getSlotld) + this.mInterFace.getAddr(this.slotId, this.getAddr) + this.mInterFace.send(this.slotId, this.content, this.destinationHost, this.serviceCenter, this.destinationPort) + this.mInterFace.create() + console.log('success') + }) + } + .position({ x: 0, y: '44%' }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/src/main/resources/base/element/string.json b/Telephony/eTSMessage/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..760302e57790607752fa9c4040c214f7ad2b8eb4 --- /dev/null +++ b/Telephony/eTSMessage/entry/src/main/resources/base/element/string.json @@ -0,0 +1,68 @@ +{ + "string": [ + { + "name": "eTSMessage", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + }, + { + "name": "contacts", + "value": "contacts" + }, + { + "name": "sim", + "value": "SIM card" + }, + { + "name": "new_name", + "value": "name" + }, + { + "name": "telephone", + "value": "telephone" + }, + { + "name": "preserve", + "value": "preserve" + }, + { + "name": "edit", + "value": "edit" + }, + { + "name": "name_edit", + "value": "name:" + }, + { + "name": "telephone_edit", + "value": "telephone:" + }, + { + "name": "information_service", + "value": "information service" + }, + { + "name": "new_information", + "value": "new information" + }, + { + "name": "message", + "value": "message" + }, + { + "name": "sim1", + "value": "SIM1" + }, + { + "name": "sim2", + "value": "SIM2" + }, + { + "name": "network", + "value": "2G/3G/4G" + } + ] +} \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/src/main/resources/base/media/arrow.png b/Telephony/eTSMessage/entry/src/main/resources/base/media/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..203480bdcdb1e9b645d6e368ec24557e766310ab Binary files /dev/null and b/Telephony/eTSMessage/entry/src/main/resources/base/media/arrow.png differ diff --git a/Telephony/eTSMessage/entry/src/main/resources/base/media/choose.png b/Telephony/eTSMessage/entry/src/main/resources/base/media/choose.png new file mode 100644 index 0000000000000000000000000000000000000000..bebe808d95cd4254e4c95851b220ddfdc47e653d Binary files /dev/null and b/Telephony/eTSMessage/entry/src/main/resources/base/media/choose.png differ diff --git a/Telephony/eTSMessage/entry/src/main/resources/base/media/icon.png b/Telephony/eTSMessage/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/Telephony/eTSMessage/entry/src/main/resources/base/media/icon.png differ diff --git a/Telephony/eTSMessage/entry/src/main/resources/base/media/index.svg b/Telephony/eTSMessage/entry/src/main/resources/base/media/index.svg new file mode 100644 index 0000000000000000000000000000000000000000..313826efd0c42516538e0ffb13eb55bfe4b3e898 --- /dev/null +++ b/Telephony/eTSMessage/entry/src/main/resources/base/media/index.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/src/main/resources/base/media/index2.svg b/Telephony/eTSMessage/entry/src/main/resources/base/media/index2.svg new file mode 100644 index 0000000000000000000000000000000000000000..72197d9e31d483e1dc410e03c54330e77c7ac37f --- /dev/null +++ b/Telephony/eTSMessage/entry/src/main/resources/base/media/index2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/src/main/resources/base/media/sim.png b/Telephony/eTSMessage/entry/src/main/resources/base/media/sim.png new file mode 100644 index 0000000000000000000000000000000000000000..2e2d03a1eaf1159639b8c79b763a123661c229a0 Binary files /dev/null and b/Telephony/eTSMessage/entry/src/main/resources/base/media/sim.png differ diff --git a/Telephony/eTSMessage/entry/src/main/resources/en/element/string.json b/Telephony/eTSMessage/entry/src/main/resources/en/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..760302e57790607752fa9c4040c214f7ad2b8eb4 --- /dev/null +++ b/Telephony/eTSMessage/entry/src/main/resources/en/element/string.json @@ -0,0 +1,68 @@ +{ + "string": [ + { + "name": "eTSMessage", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + }, + { + "name": "contacts", + "value": "contacts" + }, + { + "name": "sim", + "value": "SIM card" + }, + { + "name": "new_name", + "value": "name" + }, + { + "name": "telephone", + "value": "telephone" + }, + { + "name": "preserve", + "value": "preserve" + }, + { + "name": "edit", + "value": "edit" + }, + { + "name": "name_edit", + "value": "name:" + }, + { + "name": "telephone_edit", + "value": "telephone:" + }, + { + "name": "information_service", + "value": "information service" + }, + { + "name": "new_information", + "value": "new information" + }, + { + "name": "message", + "value": "message" + }, + { + "name": "sim1", + "value": "SIM1" + }, + { + "name": "sim2", + "value": "SIM2" + }, + { + "name": "network", + "value": "2G/3G/4G" + } + ] +} \ No newline at end of file diff --git a/Telephony/eTSMessage/entry/src/main/resources/zh/element/string.json b/Telephony/eTSMessage/entry/src/main/resources/zh/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1e6e0255cd8f7396b99f6ea9684835fef1b07cfd --- /dev/null +++ b/Telephony/eTSMessage/entry/src/main/resources/zh/element/string.json @@ -0,0 +1,68 @@ +{ + "string": [ + { + "name": "eTSMessage", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + }, + { + "name": "contacts", + "value": "联系人" + }, + { + "name": "sim", + "value": "SIM卡" + }, + { + "name": "new_name", + "value": "姓名" + }, + { + "name": "telephone", + "value": "电话号码" + }, + { + "name": "preserve", + "value": "保存" + }, + { + "name": "edit", + "value": "编辑" + }, + { + "name": "name_edit", + "value": "姓名:" + }, + { + "name": "telephone_edit", + "value": "电话号码:" + }, + { + "name": "information_service", + "value": "信息服务" + }, + { + "name": "new_information", + "value": "新信息" + }, + { + "name": "message", + "value": "短信" + }, + { + "name": "sim1", + "value": "SIM卡1" + }, + { + "name": "sim2", + "value": "SIM卡2" + }, + { + "name": "network", + "value": "2G/3G/4G" + } + ] +} \ No newline at end of file diff --git a/Telephony/eTSMessage/screenshots/device/main1.png b/Telephony/eTSMessage/screenshots/device/main1.png new file mode 100644 index 0000000000000000000000000000000000000000..2a1fc2735e0d203516f69b77069718ffc14fc499 Binary files /dev/null and b/Telephony/eTSMessage/screenshots/device/main1.png differ diff --git a/Telephony/eTSMessage/screenshots/device/main2.png b/Telephony/eTSMessage/screenshots/device/main2.png new file mode 100644 index 0000000000000000000000000000000000000000..ad22dba4e0b58826f7d38320958bdefda3b9c37e Binary files /dev/null and b/Telephony/eTSMessage/screenshots/device/main2.png differ diff --git a/Telephony/eTSMessage/screenshots/device/main3.png b/Telephony/eTSMessage/screenshots/device/main3.png new file mode 100644 index 0000000000000000000000000000000000000000..9440a9c7659d5e8715f25c9fe349e98178234a84 Binary files /dev/null and b/Telephony/eTSMessage/screenshots/device/main3.png differ diff --git a/Telephony/eTSMessage/settings.gradle b/Telephony/eTSMessage/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4773db73233a570c2d0c01a22e75321acfbf7a07 --- /dev/null +++ b/Telephony/eTSMessage/settings.gradle @@ -0,0 +1 @@ +include ':entry' diff --git a/data/eTSAppAccountManager/README_zh.md b/data/eTSAppAccountManager/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..c6207d70f55560d5f42223f689c3c1d5e1ff15cf --- /dev/null +++ b/data/eTSAppAccountManager/README_zh.md @@ -0,0 +1,23 @@ +# 应用账号管理 + +### 简介 + +本示例可以设置用户对某个应用的禁用,启用功能,设置凭据,额外信息,密钥,并获取相关信息。 + +### 使用说明 + +1.在首页输入用户名和密码,点击**注册**按钮,跳转至后台管理页面并进行编辑。 + +2.在文本框中输入应用名,点击**启用或禁用**按钮,可控制应用的禁用启用。 + +3.在文本框中输入额外信息,并点击**提交**按钮。 + +4.在文本框中输入凭据类型和凭据,点击**设置凭据**按钮,进行设置。 + +5.在文本框中输入密钥的键和密钥,点击**设置密钥**按钮,进行设置。 + +6.设置完成后,点击**设置完成**按钮,本页会弹出面板,点击凭证,额外信息,关联数据,账号信息,可获得后台设置的相关数据。 + +### 约束与限制 + +本示例仅支持在标准系统上运行。 \ No newline at end of file diff --git a/data/eTSAppAccountManager/build.gradle b/data/eTSAppAccountManager/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..c2c8bbaed13747b913f19cef893f515bc32d02a7 --- /dev/null +++ b/data/eTSAppAccountManager/build.gradle @@ -0,0 +1,34 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 7 + supportSystem "standard" +} + +buildscript { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } + dependencies { + classpath 'com.huawei.ohos:hap:3.0.3.4' + classpath 'com.huawei.ohos:decctest:1.2.6.0' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } +} diff --git a/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/app.js b/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/app.js new file mode 100644 index 0000000000000000000000000000000000000000..36541e13e720cfb607fa08bf6aa4bdec047e4e4d --- /dev/null +++ b/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/app.js @@ -0,0 +1,24 @@ +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it uses a non-standard name for the exports (exports). +(() => { +var exports = __webpack_exports__; +/*!*********************************************************************************************************!*\ + !*** ../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/app.ets?entry ***! + \*********************************************************************************************************/ + +Object.defineProperty(exports, "__esModule", ({ value: true })); +globalThis.exports.default = { + onCreate() { + console.info('Application onCreate'); + }, + onDestroy() { + console.info('Application onDestroy'); + }, +}; + +})(); + +/******/ })() +; \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/commons.js b/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/commons.js new file mode 100644 index 0000000000000000000000000000000000000000..0243d8857df9931b8cf46f02c0a73432aff3da83 --- /dev/null +++ b/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/commons.js @@ -0,0 +1,128 @@ +"use strict"; +(globalThis["webpackChunkcompilier"] = globalThis["webpackChunkcompilier"] || []).push([["commons"],{ + +/***/ "../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/model/interface.ets": +/*!***************************************************************************************************************!*\ + !*** ../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/model/interface.ets ***! + \***************************************************************************************************************/ +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.interFace = void 0; +var account_appAccount = globalThis.requireNapi('account.appAccount') || (isSystemplugin('account.appAccount', 'ohos') ? globalThis.ohosplugin.account.appAccount : isSystemplugin('account.appAccount', 'system') ? globalThis.systemplugin.account.appAccount : undefined); +const TAG = '[appAccount]'; +class interFace { + constructor() { + this.appAccountManager = null; + this.appAccountManager = account_appAccount.createAppAccountManager(); + } + addAccount(username, password) { + this.appAccountManager.addAccount(username, password).then(() => { + console.log(`${TAG}addAccount Success`); + }).catch((err) => { + console.log("addAccount err: " + JSON.stringify(err)); + }); + } + deleteAccount(account) { + this.appAccountManager.deleteAccount(account).then(() => { + }).catch((err) => { + console.log("deleteAccount err: " + JSON.stringify(err)); + }); + } + disableAppAccess(username, application) { + this.appAccountManager.disableAppAccess(username, application).then(() => { + }).catch((err) => { + console.log("disableAppAccess err: " + JSON.stringify(err)); + }); + } + enableAppAccess(username, application) { + this.appAccountManager.enableAppAccess(username, application, (err) => { + console.log(`${TAG} enableAppAccess username=${username},application=${application}, err=${JSON.stringify(err)}`); + }); + } + checkAppAccountSyncEnable() { + this.appAccountManager.checkAppAccountSyncEnable("ZhangSan").then((data) => { + console.log('checkAppAccountSyncEnable, result: ' + data); + }).catch((err) => { + console.log("checkAppAccountSyncEnable err: " + JSON.stringify(err)); + }); + } + setAccountCredential(username, credentialType, credential) { + this.appAccountManager.setAccountCredential(username, credentialType, credential, (err) => { + console.log(`${TAG} setAccountCredential username=${username},credentialType=${credentialType},credential=${credential},err:+ ${JSON.stringify(err)}`); + }); + } + setAccountExtraInfo(name, extraInfo) { + this.appAccountManager.setAccountExtraInfo(name, extraInfo, (err) => { + console.log(`${TAG} setAccountExtraInfo name=${name},extraInfo=${extraInfo},err: ${JSON.stringify(err)}`); + }); + } + setAppAccountSyncEnable() { + this.appAccountManager.setAppAccountSyncEnable("ZhangSan", true).then(() => { + console.log('setAppAccountSyncEnable Success'); + }).catch((err) => { + console.log("setAppAccountSyncEnable err: " + JSON.stringify(err)); + }); + } + setAssociatedData(name, key, value) { + this.appAccountManager.setAssociatedData(name, key, value, (err) => { + console.log(`${TAG} setAssociatedData name=${name},key=${key},value=${value},err: ${JSON.stringify(err)}`); + }); + } + getAccountCredential(name, credentialType, credentialResult) { + this.appAccountManager.getAccountCredential(name, credentialType, (err, result) => { + console.log(`${TAG} getAccountCredential name=${name},credentialType=${credentialType},err: + ${JSON.stringify(err)}+result: {JSON.stringify(result)}`); + credentialResult(result); + }); + } + getAccountExtraInfo(name, extraInfoResult) { + this.appAccountManager.getAccountExtraInfo(name, (err, result) => { + console.log(`${TAG} getAccountExtraInfo name=${name},err: + ${JSON.stringify(err)}+result:${JSON.stringify(result)}`); + extraInfoResult(result); + }); + } + getAssociatedData(name, key, associatedData) { + this.appAccountManager.getAssociatedData(name, key, (err, result) => { + console.log(`${TAG} getAssociatedData name=${name},key=${key},err: + ${JSON.stringify(err)} result: ${JSON.stringify(result)}`); + associatedData(result); + }); + } + getAllAccessibleAccounts() { + this.appAccountManager.getAllAccessibleAccounts().then((data) => { + console.log(`getAllAccessibleAccounts: +${data.toString()}`); + return data; + }).catch((err) => { + console.log("getAllAccessibleAccounts err: " + JSON.stringify(err)); + }); + } + getAllAccounts(selfBundle, allAccountResult) { + this.appAccountManager.getAllAccounts(selfBundle, (err, data) => { + console.log(`${TAG} getAllAccounts selfBundle=${selfBundle},err: + ${JSON.stringify(err)} result:+${JSON.stringify(data)}`); + allAccountResult(data); + }); + } + onChange() { + function changeOnCallback(data) { + console.debug("receive change data:" + JSON.stringify(data)); + } + try { + this.appAccountManager.on('change', ["com.example.actsaccounttest"], changeOnCallback); + } + catch (err) { + console.error("on accountOnOffDemo err:" + JSON.stringify(err)); + } + } +} +exports.interFace = interFace; + + +/***/ }) + +}]); +globalThis["__common_module_cache__"] = globalThis["__common_module_cache__"] || {}; +globalThis["webpackChunkcompilier"].forEach((item)=> { + Object.keys(item[1]).forEach((element) => { + globalThis["__common_module_cache__"][element] = null; + }) +}); \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/manifest.json b/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..5399ee823114cd4f92f1add0268c8f74c3a62216 --- /dev/null +++ b/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/manifest.json @@ -0,0 +1,22 @@ +{ + "appID": "ohos.account.appaccountmanager", + "appName": "$string:eTSAppAccountManager", + "versionName": "1.0.0", + "versionCode": 1000000, + "minPlatformVersion": 7, + "pages": [ + "pages/index", + "pages/second" + ], + "deviceType": [ + "phone" + ], + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "window": { + "autoDesignWidth": true, + "designWidth": 720 + } +} \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/pages/index.js b/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/pages/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3b4ec5936b119d21d380b64002303e45420cc55a --- /dev/null +++ b/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/pages/index.js @@ -0,0 +1,281 @@ +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/pages/index.ets?entry": +/*!*****************************************************************************************************************!*\ + !*** ../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/pages/index.ets?entry ***! + \*****************************************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +var router = globalThis.requireNativeModule('system.router'); +const interface_1 = __webpack_require__(/*! ../model/interface */ "../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/model/interface.ets"); +class Index extends View { + constructor(compilerAssignedUniqueChildId, parent, params) { + super(compilerAssignedUniqueChildId, parent); + this.__userName = new ObservedPropertySimple('', this, "userName"); + this.__password = new ObservedPropertySimple('', this, "password"); + this.userArr = [{ name: { "id": 16777251, "type": 10003, params: [] }, name_input: { "id": 16777236, "type": 10003, params: [] } }, + { name: { "id": 16777240, "type": 10003, params: [] }, name_input: { "id": 16777235, "type": 10003, params: [] } }]; + this.scroller = new Scroller(); + this.mInterFace = new interface_1.interFace(); + this.__show = new ObservedPropertySimple(false, this, "show"); + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.userName !== undefined) { + this.userName = params.userName; + } + if (params.password !== undefined) { + this.password = params.password; + } + if (params.userArr !== undefined) { + this.userArr = params.userArr; + } + if (params.scroller !== undefined) { + this.scroller = params.scroller; + } + if (params.mInterFace !== undefined) { + this.mInterFace = params.mInterFace; + } + if (params.show !== undefined) { + this.show = params.show; + } + } + aboutToBeDeleted() { + this.__userName.aboutToBeDeleted(); + this.__password.aboutToBeDeleted(); + this.__show.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get userName() { + return this.__userName.get(); + } + set userName(newValue) { + this.__userName.set(newValue); + } + get password() { + return this.__password.get(); + } + set password(newValue) { + this.__password.set(newValue); + } + get show() { + return this.__show.get(); + } + set show(newValue) { + this.__show.set(newValue); + } + render() { + Flex.create({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }); + Flex.debugLine("pages/index.ets(31:5)"); + Flex.width('100%'); + Flex.height('100%'); + Scroll.create(this.scroller); + Scroll.debugLine("pages/index.ets(32:7)"); + Column.create(); + Column.debugLine("pages/index.ets(33:9)"); + Text.create({ "id": 16777218, "type": 10003, params: [] }); + Text.debugLine("pages/index.ets(34:11)"); + Text.textAlign(TextAlign.Center); + Text.width('100%'); + Text.height('8%'); + Text.backgroundColor("#0D9FFB"); + Text.fontSize(25); + Text.fontColor(Color.White); + Text.fontWeight(FontWeight.Bold); + Text.pop(); + ForEach.create("2", this, ObservedObject.GetRawObject(this.userArr), (item) => { + Row.create(); + Row.debugLine("pages/index.ets(44:13)"); + Row.height('8.5%'); + Row.margin({ bottom: 4, top: 4 }); + Row.padding({ left: 10 }); + Text.create(item.name); + Text.debugLine("pages/index.ets(45:15)"); + Text.textAlign(TextAlign.Center); + Text.width('20%'); + Text.fontSize(20); + Text.pop(); + TextInput.create({ placeholder: item.name_input }); + TextInput.debugLine("pages/index.ets(49:15)"); + TextInput.width('70%'); + TextInput.fontSize(20); + TextInput.maxLength(20); + TextInput.fontWeight(FontWeight.Bold); + TextInput.placeholderFont({ size: 16, weight: FontWeight.Normal }); + TextInput.onChange((value) => { + this.userName = value; + }); + Row.pop(); + }); + ForEach.pop(); + Button.createWithChild(); + Button.debugLine("pages/index.ets(64:11)"); + Button.type(ButtonType.Capsule); + Button.margin({ bottom: 10 }); + Button.backgroundColor(0x317aff); + Button.onClick(() => { + this.mInterFace.addAccount(this.userName, this.password); + router.push({ + uri: 'pages/second', + params: { + username: this.userName, + password: this.password + } + }); + }); + Text.create({ "id": 16777241, "type": 10003, params: [] }); + Text.debugLine("pages/index.ets(65:13)"); + Text.fontColor(Color.White); + Text.fontSize(16); + Text.width('30%'); + Text.textAlign(TextAlign.Center); + Text.pop(); + Button.pop(); + Column.pop(); + Scroll.pop(); + Flex.pop(); + } +} +loadDocument(new Index("1", undefined, {})); + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ var commonCachedModule = globalThis["__common_module_cache__"] ? globalThis["__common_module_cache__"][moduleId]: null; +/******/ if (commonCachedModule) { return commonCachedModule.exports; } +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ if (globalThis["__common_module_cache__"] && moduleId.indexOf("?name=") < 0 && Object.keys(globalThis["__common_module_cache__"]).indexOf(moduleId) >= 0) { +/******/ globalThis["__common_module_cache__"][moduleId] = module; +/******/ } +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/chunk loaded */ +/******/ (() => { +/******/ var deferred = []; +/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { +/******/ if(chunkIds) { +/******/ priority = priority || 0; +/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; +/******/ deferred[i] = [chunkIds, fn, priority]; +/******/ return; +/******/ } +/******/ var notFulfilled = Infinity; +/******/ for (var i = 0; i < deferred.length; i++) { +/******/ var [chunkIds, fn, priority] = deferred[i]; +/******/ var fulfilled = true; +/******/ for (var j = 0; j < chunkIds.length; j++) { +/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { +/******/ chunkIds.splice(j--, 1); +/******/ } else { +/******/ fulfilled = false; +/******/ if(priority < notFulfilled) notFulfilled = priority; +/******/ } +/******/ } +/******/ if(fulfilled) { +/******/ deferred.splice(i--, 1) +/******/ var r = fn(); +/******/ if (r !== undefined) result = r; +/******/ } +/******/ } +/******/ return result; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ "./pages/index": 0 +/******/ }; +/******/ +/******/ // no chunk on demand loading +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add "moreModules" to the modules object, +/******/ // then flag all "chunkIds" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkIds[i]] = 0; +/******/ } +/******/ return __webpack_require__.O(result); +/******/ } +/******/ +/******/ var chunkLoadingGlobal = globalThis["webpackChunkcompilier"] = globalThis["webpackChunkcompilier"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module depends on other loaded chunks and execution need to be delayed +/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["commons"], () => (__webpack_require__("../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/pages/index.ets?entry"))) +/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); +/******/ +/******/ })() +; \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/pages/second.js b/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/pages/second.js new file mode 100644 index 0000000000000000000000000000000000000000..9d4b41ffed5aa2c06df20979e293efb146136bf1 --- /dev/null +++ b/data/eTSAppAccountManager/entry/.preview/intermediates/res/debug/rich/assets/js/MainAbility/pages/second.js @@ -0,0 +1,991 @@ +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/button.ets": +/*!*************************************************************************************************************!*\ + !*** ../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/button.ets ***! + \*************************************************************************************************************/ +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SpeedButton = void 0; +class SpeedButton extends View { + constructor(compilerAssignedUniqueChildId, parent, params) { + super(compilerAssignedUniqueChildId, parent); + this.__text = new ObservedPropertySimple('', this, "text"); + this.__message = new ObservedPropertySimple('', this, "message"); + this.callback = null; + this.dialog = null; + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.text !== undefined) { + this.text = params.text; + } + if (params.message !== undefined) { + this.message = params.message; + } + if (params.callback !== undefined) { + this.callback = params.callback; + } + if (params.dialog !== undefined) { + this.dialog = params.dialog; + } + } + aboutToBeDeleted() { + this.__text.aboutToBeDeleted(); + this.__message.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get text() { + return this.__text.get(); + } + set text(newValue) { + this.__text.set(newValue); + } + get message() { + return this.__message.get(); + } + set message(newValue) { + this.__message.set(newValue); + } + render() { + Column.create(); + Column.debugLine("common/button.ets(24:5)"); + Button.createWithChild(); + Button.debugLine("common/button.ets(25:7)"); + Button.height(28); + Button.type(ButtonType.Capsule); + Button.backgroundColor(0x317aff); + Button.onClick(() => { + if (this.callback != null) { + this.callback(); + this.dialog(this.message); + } + }); + Text.create(this.text); + Text.debugLine("common/button.ets(26:9)"); + Text.fontColor(Color.White); + Text.fontSize(16); + Text.width('30%'); + Text.textAlign(TextAlign.Center); + Text.pop(); + Button.pop(); + Column.pop(); + } +} +exports.SpeedButton = SpeedButton; + + +/***/ }), + +/***/ "../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/input.ets": +/*!************************************************************************************************************!*\ + !*** ../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/input.ets ***! + \************************************************************************************************************/ +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Input = void 0; +class Input extends View { + constructor(compilerAssignedUniqueChildId, parent, params) { + super(compilerAssignedUniqueChildId, parent); + this.__text = new ObservedPropertySimple('', this, "text"); + this.__textInput = new ObservedPropertySimple('', this, "textInput"); + this.callback = null; + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.text !== undefined) { + this.text = params.text; + } + if (params.textInput !== undefined) { + this.textInput = params.textInput; + } + if (params.callback !== undefined) { + this.callback = params.callback; + } + } + aboutToBeDeleted() { + this.__text.aboutToBeDeleted(); + this.__textInput.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get text() { + return this.__text.get(); + } + set text(newValue) { + this.__text.set(newValue); + } + get textInput() { + return this.__textInput.get(); + } + set textInput(newValue) { + this.__textInput.set(newValue); + } + render() { + Row.create(); + Row.debugLine("common/input.ets(23:5)"); + Row.height(60); + Row.margin({ bottom: 4 }); + Row.padding({ left: 10 }); + Text.create(this.text); + Text.debugLine("common/input.ets(24:7)"); + Text.textAlign(TextAlign.Center); + Text.width('45%'); + Text.fontSize(20); + Text.pop(); + TextInput.create({ placeholder: this.textInput }); + TextInput.debugLine("common/input.ets(28:7)"); + TextInput.width('45%'); + TextInput.fontSize(20); + TextInput.maxLength(20); + TextInput.fontWeight(FontWeight.Bold); + TextInput.placeholderFont({ size: 16, weight: FontWeight.Normal }); + TextInput.onChange(this.callback); + Row.pop(); + } +} +exports.Input = Input; + + +/***/ }), + +/***/ "../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/tab.ets": +/*!**********************************************************************************************************!*\ + !*** ../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/tab.ets ***! + \**********************************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Tab = void 0; +const interface_1 = __webpack_require__(/*! ../model/interface */ "../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/model/interface.ets"); +class Tab extends View { + constructor(compilerAssignedUniqueChildId, parent, params) { + super(compilerAssignedUniqueChildId, parent); + this.__returnAllAccount = new ObservedPropertyObject({}, this, "returnAllAccount"); + this.__returnAssociate = new ObservedPropertySimple('', this, "returnAssociate"); + this.__returnCrediential = new ObservedPropertySimple('', this, "returnCrediential"); + this.__returnExtra = new ObservedPropertySimple('', this, "returnExtra"); + this.controller = new TabsController(); + this.getName = undefined; + this.getType = undefined; + this.getKey = undefined; + this.getBundle = undefined; + this.mInterFace = new interface_1.interFace(); + this.show = undefined; + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.returnAllAccount !== undefined) { + this.returnAllAccount = params.returnAllAccount; + } + if (params.returnAssociate !== undefined) { + this.returnAssociate = params.returnAssociate; + } + if (params.returnCrediential !== undefined) { + this.returnCrediential = params.returnCrediential; + } + if (params.returnExtra !== undefined) { + this.returnExtra = params.returnExtra; + } + if (params.controller !== undefined) { + this.controller = params.controller; + } + if (params.getName !== undefined) { + this.getName = params.getName; + } + if (params.getType !== undefined) { + this.getType = params.getType; + } + if (params.getKey !== undefined) { + this.getKey = params.getKey; + } + if (params.getBundle !== undefined) { + this.getBundle = params.getBundle; + } + if (params.mInterFace !== undefined) { + this.mInterFace = params.mInterFace; + } + if (params.show !== undefined) { + this.show = params.show; + } + } + aboutToBeDeleted() { + this.__returnAllAccount.aboutToBeDeleted(); + this.__returnAssociate.aboutToBeDeleted(); + this.__returnCrediential.aboutToBeDeleted(); + this.__returnExtra.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get returnAllAccount() { + return this.__returnAllAccount.get(); + } + set returnAllAccount(newValue) { + this.__returnAllAccount.set(newValue); + } + get returnAssociate() { + return this.__returnAssociate.get(); + } + set returnAssociate(newValue) { + this.__returnAssociate.set(newValue); + } + get returnCrediential() { + return this.__returnCrediential.get(); + } + set returnCrediential(newValue) { + this.__returnCrediential.set(newValue); + } + get returnExtra() { + return this.__returnExtra.get(); + } + set returnExtra(newValue) { + this.__returnExtra.set(newValue); + } + render() { + Column.create(); + Column.debugLine("common/tab.ets(33:5)"); + Column.width('100%'); + Column.height('40%'); + Column.margin({ top: 5 }); + Panel.create(this.show); + Panel.debugLine("common/tab.ets(34:7)"); + Panel.type(PanelType.Foldable); + Panel.mode(PanelMode.Full); + Panel.dragBar(true); + Panel.halfHeight(800); + Panel.onChange((value) => { + this.show = !this.show; + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`); + }); + Column.create(); + Column.debugLine("common/tab.ets(35:9)"); + Tabs.create({ barPosition: BarPosition.Start, index: 1, controller: this.controller }); + Tabs.debugLine("common/tab.ets(36:11)"); + Tabs.margin('auto'); + Tabs.vertical(false); + Tabs.scrollable(true); + Tabs.barMode(BarMode.Fixed); + Tabs.barWidth(320); + Tabs.barHeight(80); + Tabs.animationDuration(400); + Tabs.onChange((index) => { + switch (index) { + case 0: + let credentialResult = (result) => { + this.returnCrediential = result; + console.log(`Target credentialResult${JSON.stringify(this.returnCrediential)}`); + }; + this.mInterFace.getAccountCredential(this.getName, this.getType, credentialResult); + console.log(`Target 返回的凭证${JSON.stringify(this.returnCrediential)}`); + break; + case 1: + let extraInfoResult = (result) => { + this.returnExtra = result; + console.log(`Target extraInfoResult${JSON.stringify(this.returnExtra)}`); + }; + this.mInterFace.getAccountExtraInfo(this.getName, extraInfoResult); + console.log(`Target 返回的额外信息${JSON.stringify(this.returnExtra)}`); + break; + case 2: + let associatedDataResult = (result) => { + this.returnAssociate = result; + console.log(`Target associatedDataResult${JSON.stringify(this.returnAssociate)}`); + }; + console.log(`${this.getName + this.getKey}`); + this.mInterFace.getAssociatedData(this.getName, this.getKey, associatedDataResult); + console.log(`Target 返回的关联信息${JSON.stringify(this.returnAssociate)}`); + break; + case 3: + let allAccountResult = (result) => { + let returnAllAccount = result; + console.log(`TargetreturnAllAccount${JSON.stringify(returnAllAccount)}`); + }; + console.log(`Target${this.getBundle}`); + this.mInterFace.getAllAccounts(this.getBundle, allAccountResult); + break; + } + }); + Tabs.width('90%'); + Tabs.backgroundColor(0xF5F5F5); + TabContent.create(); + TabContent.debugLine("common/tab.ets(37:13)"); + TabContent.tabBar({ "id": 16777223, "type": 10003, params: [] }); + Column.create(); + Column.debugLine("common/tab.ets(38:15)"); + Column.width('100%'); + Column.height('100%'); + Column.backgroundColor(Color.Pink); + Text.create(`${this.returnCrediential}`); + Text.debugLine("common/tab.ets(39:17)"); + Text.width('100%'); + Text.height('100%'); + Text.textAlign(TextAlign.Center); + Text.fontSize('20'); + Text.backgroundColor("#0D9FFB"); + Text.pop(); + Column.pop(); + TabContent.pop(); + TabContent.create(); + TabContent.debugLine("common/tab.ets(53:13)"); + TabContent.tabBar({ "id": 16777237, "type": 10003, params: [] }); + Column.create(); + Column.debugLine("common/tab.ets(54:15)"); + Column.width('100%'); + Column.height('100%'); + Column.backgroundColor(Color.Yellow); + Text.create(`${this.returnExtra}`); + Text.debugLine("common/tab.ets(55:17)"); + Text.width('100%'); + Text.height('100%'); + Text.textAlign(TextAlign.Center); + Text.fontSize('20'); + Text.backgroundColor("#0D9FFB"); + Text.fontSize('20'); + Text.pop(); + Column.pop(); + TabContent.pop(); + TabContent.create(); + TabContent.debugLine("common/tab.ets(69:13)"); + TabContent.tabBar({ "id": 16777216, "type": 10003, params: [] }); + Column.create(); + Column.debugLine("common/tab.ets(70:15)"); + Column.width('100%'); + Column.height('100%'); + Column.backgroundColor(Color.Blue); + Text.create(`${this.returnAssociate}`); + Text.debugLine("common/tab.ets(71:17)"); + Text.width('100%'); + Text.height('100%'); + Text.textAlign(TextAlign.Center); + Text.fontSize('20'); + Text.backgroundColor("#0D9FFB"); + Text.fontSize('20'); + Text.pop(); + Column.pop(); + TabContent.pop(); + TabContent.create(); + TabContent.debugLine("common/tab.ets(85:13)"); + TabContent.tabBar({ "id": 16777217, "type": 10003, params: [] }); + Column.create(); + Column.debugLine("common/tab.ets(86:15)"); + Column.width('100%'); + Column.height('100%'); + Column.backgroundColor(Color.Green); + Text.create({ "id": 16777219, "type": 10003, params: [] }); + Text.debugLine("common/tab.ets(87:17)"); + Text.width('100%'); + Text.height('100%'); + Text.textAlign(TextAlign.Center); + Text.fontSize('20'); + Text.backgroundColor("#0D9FFB"); + Text.fontSize('20'); + Text.pop(); + Column.pop(); + TabContent.pop(); + Tabs.pop(); + Column.pop(); + Panel.pop(); + Column.pop(); + } +} +exports.Tab = Tab; + + +/***/ }), + +/***/ "../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/pages/second.ets?entry": +/*!******************************************************************************************************************!*\ + !*** ../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/pages/second.ets?entry ***! + \******************************************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +var router = globalThis.requireNativeModule('system.router'); +const interface_1 = __webpack_require__(/*! ../model/interface */ "../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/model/interface.ets"); +const input_1 = __webpack_require__(/*! ../common/input */ "../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/input.ets"); +const button_1 = __webpack_require__(/*! ../common/button */ "../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/button.ets"); +const tab_1 = __webpack_require__(/*! ../common/tab */ "../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/tab.ets"); +class Second extends View { + constructor(compilerAssignedUniqueChildId, parent, params) { + super(compilerAssignedUniqueChildId, parent); + this.__application = new ObservedPropertySimple('', this, "application"); + this.__credentialType = new ObservedPropertySimple('', this, "credentialType"); + this.__credential = new ObservedPropertySimple('', this, "credential"); + this.__extraInfo = new ObservedPropertySimple('', this, "extraInfo"); + this.__key = new ObservedPropertySimple('', this, "key"); + this.__keyValue = new ObservedPropertySimple('', this, "keyValue"); + this.__editFlag = new ObservedPropertySimple(false, this, "editFlag"); + this.mInterFace = new interface_1.interFace(); + this.getUserName = router.getParams().username; + this.getPassword = router.getParams().password; + this.userArr = [{ name: { "id": 16777251, "type": 10003, params: [] }, name_input: this.getUserName }]; + this.credentialArr = [{ + name: { "id": 16777232, "type": 10003, params: [] }, + placeholder: { "id": 16777232, "type": 10003, params: [] }, + change: this.credentialType + }, + { + name: { "id": 16777231, "type": 10003, params: [] }, + placeholder: { "id": 16777231, "type": 10003, params: [] }, + change: this.credential + }]; + this.keyArr = [{ name: { "id": 16777245, "type": 10003, params: [] }, placeholder: { "id": 16777245, "type": 10003, params: [] }, change: this.key }, + { name: { "id": 16777234, "type": 10003, params: [] }, placeholder: { "id": 16777234, "type": 10003, params: [] }, change: this.keyValue }]; + this.scroller = new Scroller(); + this.__show = new ObservedPropertySimple(false, this, "show"); + this.updateWithValueParams(params); + } + updateWithValueParams(params) { + if (params.application !== undefined) { + this.application = params.application; + } + if (params.credentialType !== undefined) { + this.credentialType = params.credentialType; + } + if (params.credential !== undefined) { + this.credential = params.credential; + } + if (params.extraInfo !== undefined) { + this.extraInfo = params.extraInfo; + } + if (params.key !== undefined) { + this.key = params.key; + } + if (params.keyValue !== undefined) { + this.keyValue = params.keyValue; + } + if (params.editFlag !== undefined) { + this.editFlag = params.editFlag; + } + if (params.mInterFace !== undefined) { + this.mInterFace = params.mInterFace; + } + if (params.getUserName !== undefined) { + this.getUserName = params.getUserName; + } + if (params.getPassword !== undefined) { + this.getPassword = params.getPassword; + } + if (params.userArr !== undefined) { + this.userArr = params.userArr; + } + if (params.credentialArr !== undefined) { + this.credentialArr = params.credentialArr; + } + if (params.keyArr !== undefined) { + this.keyArr = params.keyArr; + } + if (params.scroller !== undefined) { + this.scroller = params.scroller; + } + if (params.show !== undefined) { + this.show = params.show; + } + } + aboutToBeDeleted() { + this.__application.aboutToBeDeleted(); + this.__credentialType.aboutToBeDeleted(); + this.__credential.aboutToBeDeleted(); + this.__extraInfo.aboutToBeDeleted(); + this.__key.aboutToBeDeleted(); + this.__keyValue.aboutToBeDeleted(); + this.__editFlag.aboutToBeDeleted(); + this.__show.aboutToBeDeleted(); + SubscriberManager.Get().delete(this.id()); + } + get application() { + return this.__application.get(); + } + set application(newValue) { + this.__application.set(newValue); + } + get credentialType() { + return this.__credentialType.get(); + } + set credentialType(newValue) { + this.__credentialType.set(newValue); + } + get credential() { + return this.__credential.get(); + } + set credential(newValue) { + this.__credential.set(newValue); + } + get extraInfo() { + return this.__extraInfo.get(); + } + set extraInfo(newValue) { + this.__extraInfo.set(newValue); + } + get key() { + return this.__key.get(); + } + set key(newValue) { + this.__key.set(newValue); + } + get keyValue() { + return this.__keyValue.get(); + } + set keyValue(newValue) { + this.__keyValue.set(newValue); + } + get editFlag() { + return this.__editFlag.get(); + } + set editFlag(newValue) { + this.__editFlag.set(newValue); + } + get show() { + return this.__show.get(); + } + set show(newValue) { + this.__show.set(newValue); + } + dialog(message) { + console.log('1'); + AlertDialog.show({ + title: '通知', + message: message, + confirm: { + value: '确定', + action: () => { + } + }, + cancel: () => { + } + }); + } + enable() { + this.mInterFace.enableAppAccess(this.getUserName, this.application); + } + disable() { + this.mInterFace.disableAppAccess(this.getUserName, this.application); + } + submit() { + this.mInterFace.setAccountExtraInfo(this.getUserName, this.extraInfo); + console.info('guojin '); + } + setCredential() { + this.mInterFace.setAccountCredential(this.getUserName, this.credentialType, this.credential); + this.dialog('设置凭证成功'); + } + setKey() { + this.mInterFace.setAssociatedData(this.getUserName, this.key, this.keyValue); + } + setComplete() { + this.show = !this.show; + } + apply(value) { + this.application = value; + } + extra(value) { + this.extraInfo = value; + } + render() { + Flex.create({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }); + Flex.debugLine("pages/second.ets(103:5)"); + Flex.width('100%'); + Flex.height('100%'); + Scroll.create(this.scroller); + Scroll.debugLine("pages/second.ets(104:7)"); + Column.create(); + Column.debugLine("pages/second.ets(105:9)"); + Text.create({ "id": 16777218, "type": 10003, params: [] }); + Text.debugLine("pages/second.ets(106:11)"); + Text.textAlign(TextAlign.Center); + Text.padding({ top: 10 }); + Text.width('100%'); + Text.height(60); + Text.backgroundColor("#0D9FFB"); + Text.fontSize(25); + Text.fontColor(Color.White); + Text.fontWeight(FontWeight.Bold); + Text.pop(); + Flex.create({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Start + }); + Flex.debugLine("pages/second.ets(116:11)"); + Flex.height('100%'); + Flex.padding({ left: 10 }); + Row.create(); + Row.debugLine("pages/second.ets(121:13)"); + Row.margin({ top: 10 }); + Row.height(60); + Text.create({ "id": 16777251, "type": 10003, params: [] }); + Text.debugLine("pages/second.ets(122:15)"); + Text.textAlign(TextAlign.Center); + Text.width('40%'); + Text.fontSize(20); + Text.pop(); + Text.create(this.getUserName); + Text.debugLine("pages/second.ets(126:15)"); + Text.textAlign(TextAlign.Center); + Text.width('40%'); + Text.fontSize(20); + Text.pop(); + Row.pop(); + let earlierCreatedChild_2 = this.findChildById("2"); + if (earlierCreatedChild_2 == undefined) { + View.create(new input_1.Input("2", this, { + text: { "id": 16777230, "type": 10003, params: [] }, + textInput: { "id": 16777230, "type": 10003, params: [] }, + callback: this.apply + })); + } + else { + earlierCreatedChild_2.updateWithValueParams({ + text: { "id": 16777230, "type": 10003, params: [] }, + textInput: { "id": 16777230, "type": 10003, params: [] }, + callback: this.apply + }); + View.create(earlierCreatedChild_2); + } + Row.create({ space: 16 }); + Row.debugLine("pages/second.ets(140:13)"); + let earlierCreatedChild_3 = this.findChildById("3"); + if (earlierCreatedChild_3 == undefined) { + View.create(new button_1.SpeedButton("3", this, { + text: { "id": 16777229, "type": 10003, params: [] }, + callback: this.enable.bind(this), + dialog: this.dialog, + message: `${this.getUserName}用户此应用已启用` + })); + } + else { + earlierCreatedChild_3.updateWithValueParams({ + text: { "id": 16777229, "type": 10003, params: [] }, + callback: this.enable.bind(this), + dialog: this.dialog, + message: `${this.getUserName}用户此应用已启用` + }); + View.create(earlierCreatedChild_3); + } + let earlierCreatedChild_4 = this.findChildById("4"); + if (earlierCreatedChild_4 == undefined) { + View.create(new button_1.SpeedButton("4", this, { + text: { "id": 16777226, "type": 10003, params: [] }, + callback: this.disable.bind(this), + dialog: this.dialog, + message: `${this.getUserName}用户此应用已禁用` + })); + } + else { + earlierCreatedChild_4.updateWithValueParams({ + text: { "id": 16777226, "type": 10003, params: [] }, + callback: this.disable.bind(this), + dialog: this.dialog, + message: `${this.getUserName}用户此应用已禁用` + }); + View.create(earlierCreatedChild_4); + } + Row.pop(); + let earlierCreatedChild_5 = this.findChildById("5"); + if (earlierCreatedChild_5 == undefined) { + View.create(new input_1.Input("5", this, { + text: { "id": 16777233, "type": 10003, params: [] }, + textInput: { "id": 16777233, "type": 10003, params: [] }, + callback: this.extra + })); + } + else { + earlierCreatedChild_5.updateWithValueParams({ + text: { "id": 16777233, "type": 10003, params: [] }, + textInput: { "id": 16777233, "type": 10003, params: [] }, + callback: this.extra + }); + View.create(earlierCreatedChild_5); + } + let earlierCreatedChild_6 = this.findChildById("6"); + if (earlierCreatedChild_6 == undefined) { + View.create(new button_1.SpeedButton("6", this, { + text: { "id": 16777247, "type": 10003, params: [] }, + callback: this.submit.bind(this), + dialog: this.dialog, + message: { "id": 16777248, "type": 10003, params: [] } + })); + } + else { + earlierCreatedChild_6.updateWithValueParams({ + text: { "id": 16777247, "type": 10003, params: [] }, + callback: this.submit.bind(this), + dialog: this.dialog, + message: { "id": 16777248, "type": 10003, params: [] } + }); + View.create(earlierCreatedChild_6); + } + ForEach.create("7", this, ObservedObject.GetRawObject(this.credentialArr), (item) => { + Row.create(); + Row.debugLine("pages/second.ets(167:15)"); + Row.height(120); + Row.margin({ bottom: 4 }); + Row.padding({ left: 10 }); + Text.create(item.name); + Text.debugLine("pages/second.ets(168:17)"); + Text.textAlign(TextAlign.Center); + Text.width('45%'); + Text.fontSize(20); + Text.pop(); + TextInput.create({ placeholder: item.placeholder }); + TextInput.debugLine("pages/second.ets(172:17)"); + TextInput.width('45%'); + TextInput.fontSize(20); + TextInput.maxLength(20); + TextInput.fontWeight(FontWeight.Bold); + TextInput.placeholderFont({ size: 16, weight: FontWeight.Normal }); + TextInput.onChange((value) => { + item.change = value; + }); + Row.pop(); + }, item => item.toString()); + ForEach.pop(); + let earlierCreatedChild_8 = this.findChildById("8"); + if (earlierCreatedChild_8 == undefined) { + View.create(new button_1.SpeedButton("8", this, { + text: { "id": 16777243, "type": 10003, params: [] }, + callback: this.setCredential.bind(this), + dialog: this.dialog, + message: { "id": 16777244, "type": 10003, params: [] } + })); + } + else { + earlierCreatedChild_8.updateWithValueParams({ + text: { "id": 16777243, "type": 10003, params: [] }, + callback: this.setCredential.bind(this), + dialog: this.dialog, + message: { "id": 16777244, "type": 10003, params: [] } + }); + View.create(earlierCreatedChild_8); + } + ForEach.create("9", this, ObservedObject.GetRawObject(this.keyArr), (item) => { + Row.create(); + Row.debugLine("pages/second.ets(194:15)"); + Row.height(80); + Row.margin({ bottom: 4 }); + Row.padding({ left: 10 }); + Text.create(item.name); + Text.debugLine("pages/second.ets(195:17)"); + Text.textAlign(TextAlign.Center); + Text.width('45%'); + Text.fontSize(20); + Text.pop(); + TextInput.create({ placeholder: item.placeholder }); + TextInput.debugLine("pages/second.ets(199:17)"); + TextInput.width('45%'); + TextInput.fontSize(20); + TextInput.maxLength(20); + TextInput.fontWeight(FontWeight.Bold); + TextInput.placeholderFont({ size: 16, weight: FontWeight.Normal }); + TextInput.onChange((value) => { + item.change = value; + }); + Row.pop(); + }); + ForEach.pop(); + Column.create({ space: 5 }); + Column.debugLine("pages/second.ets(213:13)"); + let earlierCreatedChild_10 = this.findChildById("10"); + if (earlierCreatedChild_10 == undefined) { + View.create(new button_1.SpeedButton("10", this, { + text: { "id": 16777238, "type": 10003, params: [] }, + callback: this.setKey.bind(this), + dialog: this.dialog, + message: { "id": 16777246, "type": 10003, params: [] } + })); + } + else { + earlierCreatedChild_10.updateWithValueParams({ + text: { "id": 16777238, "type": 10003, params: [] }, + callback: this.setKey.bind(this), + dialog: this.dialog, + message: { "id": 16777246, "type": 10003, params: [] } + }); + View.create(earlierCreatedChild_10); + } + let earlierCreatedChild_11 = this.findChildById("11"); + if (earlierCreatedChild_11 == undefined) { + View.create(new button_1.SpeedButton("11", this, { + text: { "id": 16777242, "type": 10003, params: [] }, + callback: this.setComplete.bind(this), + })); + } + else { + earlierCreatedChild_11.updateWithValueParams({ + text: { "id": 16777242, "type": 10003, params: [] }, + callback: this.setComplete.bind(this) + }); + View.create(earlierCreatedChild_11); + } + Column.pop(); + let earlierCreatedChild_12 = this.findChildById("12"); + if (earlierCreatedChild_12 == undefined) { + View.create(new tab_1.Tab("12", this, { + getName: this.getUserName, + getType: this.credentialType, + getKey: this.key, + getBundle: this.application, + show: this.show + })); + } + else { + earlierCreatedChild_12.updateWithValueParams({ + getName: this.getUserName, + getType: this.credentialType, + getKey: this.key, + getBundle: this.application, + show: this.show + }); + View.create(earlierCreatedChild_12); + } + Flex.pop(); + Column.pop(); + Scroll.pop(); + Flex.pop(); + } +} +loadDocument(new Second("1", undefined, {})); + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ var commonCachedModule = globalThis["__common_module_cache__"] ? globalThis["__common_module_cache__"][moduleId]: null; +/******/ if (commonCachedModule) { return commonCachedModule.exports; } +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ if (globalThis["__common_module_cache__"] && moduleId.indexOf("?name=") < 0 && Object.keys(globalThis["__common_module_cache__"]).indexOf(moduleId) >= 0) { +/******/ globalThis["__common_module_cache__"][moduleId] = module; +/******/ } +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/chunk loaded */ +/******/ (() => { +/******/ var deferred = []; +/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { +/******/ if(chunkIds) { +/******/ priority = priority || 0; +/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; +/******/ deferred[i] = [chunkIds, fn, priority]; +/******/ return; +/******/ } +/******/ var notFulfilled = Infinity; +/******/ for (var i = 0; i < deferred.length; i++) { +/******/ var [chunkIds, fn, priority] = deferred[i]; +/******/ var fulfilled = true; +/******/ for (var j = 0; j < chunkIds.length; j++) { +/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { +/******/ chunkIds.splice(j--, 1); +/******/ } else { +/******/ fulfilled = false; +/******/ if(priority < notFulfilled) notFulfilled = priority; +/******/ } +/******/ } +/******/ if(fulfilled) { +/******/ deferred.splice(i--, 1) +/******/ var r = fn(); +/******/ if (r !== undefined) result = r; +/******/ } +/******/ } +/******/ return result; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ "./pages/second": 0 +/******/ }; +/******/ +/******/ // no chunk on demand loading +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add "moreModules" to the modules object, +/******/ // then flag all "chunkIds" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkIds[i]] = 0; +/******/ } +/******/ return __webpack_require__.O(result); +/******/ } +/******/ +/******/ var chunkLoadingGlobal = globalThis["webpackChunkcompilier"] = globalThis["webpackChunkcompilier"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module depends on other loaded chunks and execution need to be delayed +/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["commons"], () => (__webpack_require__("../../../../../workPackage/code/eTSAppAccountManager/entry/src/main/ets/MainAbility/pages/second.ets?entry"))) +/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); +/******/ +/******/ })() +; \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/.preview/jsManifest/MainAbility/manifest.json b/data/eTSAppAccountManager/entry/.preview/jsManifest/MainAbility/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..5399ee823114cd4f92f1add0268c8f74c3a62216 --- /dev/null +++ b/data/eTSAppAccountManager/entry/.preview/jsManifest/MainAbility/manifest.json @@ -0,0 +1,22 @@ +{ + "appID": "ohos.account.appaccountmanager", + "appName": "$string:eTSAppAccountManager", + "versionName": "1.0.0", + "versionCode": 1000000, + "minPlatformVersion": 7, + "pages": [ + "pages/index", + "pages/second" + ], + "deviceType": [ + "phone" + ], + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "window": { + "autoDesignWidth": true, + "designWidth": 720 + } +} \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/build.gradle b/data/eTSAppAccountManager/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..933d8c267f08ffca87af5637eaa440c544ce1dd4 --- /dev/null +++ b/data/eTSAppAccountManager/entry/build.gradle @@ -0,0 +1,17 @@ +apply plugin: 'com.huawei.ohos.hap' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 8 + defaultConfig { + compatibleSdkVersion 7 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + diff --git a/data/eTSAppAccountManager/entry/src/main/config.json b/data/eTSAppAccountManager/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..200b0f71666731505b20a8d9043c27de312f96ac --- /dev/null +++ b/data/eTSAppAccountManager/entry/src/main/config.json @@ -0,0 +1,71 @@ +{ + "app": { + "bundleName": "ohos.account.appaccountmanager", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "ohos.account.appaccountmanager", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:eTSAppAccountManager", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.GET_ACCOUNTS_PRIVILEGED" + } + ] + } +} \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/app.ets b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 0000000000000000000000000000000000000000..5c326ea7c484400721d4a4902d23df79f693fe1f --- /dev/null +++ b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +export default { + onCreate() { + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/button.ets b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/button.ets new file mode 100644 index 0000000000000000000000000000000000000000..8cd725781e87d48cb9e60ac726e92cf0021aa862 --- /dev/null +++ b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/button.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Component +export struct SpeedButton { + @State text: string= '' + @State message: string= '' + private callback = null + private dialog = null + + build() { + Column() { + Button() { + Text(this.text) + .fontColor(Color.White) + .fontSize(16) + .width('30%') + .textAlign(TextAlign.Center) + } + .height(28) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .onClick(() => { + if (this.callback != null) { + this.callback() + this.dialog(this.message) + } + }) + } + } +} \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/input.ets b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/input.ets new file mode 100644 index 0000000000000000000000000000000000000000..676343efa7b72f7879ddc3a9e258d51087918d14 --- /dev/null +++ b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/input.ets @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Component +export struct Input { + @State text: string= '' + @State textInput: string= '' + private callback= null + + build() { + Row() { + Text(this.text) + .textAlign(TextAlign.Center) + .width('45%') + .fontSize(20) + TextInput({ placeholder: this.textInput }) + .width('45%') + .fontSize(20) + .maxLength(20) + .fontWeight(FontWeight.Bold) + .placeholderFont({ size: 16, weight: FontWeight.Normal }) + .onChange(this.callback) + } + .height(60) + .margin({ bottom: 4 }) + .padding({ left: 10 }) + } +} diff --git a/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/tab.ets b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/tab.ets new file mode 100644 index 0000000000000000000000000000000000000000..bed0ded82f315c380e856007d9c69f4f1a7952a1 --- /dev/null +++ b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/common/tab.ets @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { interFace } from '../model/interface' + +@Component +export struct Tab { + @State returnAllAccount: object= {} + @State returnAssociate: string= '' + @State returnCrediential: string= '' + @State returnExtra: string= '' + private controller: TabsController = new TabsController() + private getName: string + private getType: string + private getKey: string + private getBundle: string + private mInterFace = new interFace() + private show: boolean + + build() { + Column() { + Panel(this.show) { + Column() { + Tabs({ barPosition: BarPosition.Start, index: 1, controller: this.controller }) { + TabContent() { + Column() { + Text(`${this.returnCrediential}`) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + .fontSize('20') + .backgroundColor("#0D9FFB") + } + .width('100%') + .height('100%') + .backgroundColor(Color.Pink) + } + .tabBar($r('app.string.credential')) + + + TabContent() { + Column() { + Text(`${this.returnExtra}`) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + .fontSize('20') + .backgroundColor("#0D9FFB") + .fontSize('20') + } + .width('100%') + .height('100%') + .backgroundColor(Color.Yellow) + } + .tabBar($r('app.string.extra')) + + TabContent() { + Column() { + Text(`${this.returnAssociate}`) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + .fontSize('20') + .backgroundColor("#0D9FFB") + .fontSize('20') + } + .width('100%') + .height('100%') + .backgroundColor(Color.Blue) + } + .tabBar($r('app.string.Associated_data')) + + TabContent() { + Column() { + Text($r('app.string.click_get_account')) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + .fontSize('20') + .backgroundColor("#0D9FFB") + .fontSize('20') + } + .width('100%') + .height('100%') + .backgroundColor(Color.Green) + } + .tabBar($r('app.string.account_data')) + } + .margin('auto') + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(320) + .barHeight(80) + .animationDuration(400) + .onChange((index: number) => { + switch (index) { + case 0: + let credentialResult = (result) => { + this.returnCrediential = result + console.log(`Target credentialResult${JSON.stringify(this.returnCrediential)}`) + } + this.mInterFace.getAccountCredential(this.getName, this.getType, credentialResult) + console.log(`Target 返回的凭证${JSON.stringify(this.returnCrediential)}`) + break + case 1: + let extraInfoResult = (result) => { + this.returnExtra = result + console.log(`Target extraInfoResult${JSON.stringify(this.returnExtra)}`) + } + this.mInterFace.getAccountExtraInfo(this.getName, extraInfoResult) + console.log(`Target 返回的额外信息${JSON.stringify(this.returnExtra)}`) + break + case 2: + let associatedDataResult = (result) => { + this.returnAssociate = result + console.log(`Target associatedDataResult${JSON.stringify(this.returnAssociate)}`) + } + console.log(`${this.getName + this.getKey}`) + this.mInterFace.getAssociatedData(this.getName, this.getKey, associatedDataResult) + console.log(`Target 返回的关联信息${JSON.stringify(this.returnAssociate)}`) + break + case 3: + let allAccountResult = (result) => { + let returnAllAccount = result + console.log(`TargetreturnAllAccount${JSON.stringify(returnAllAccount)}`) + } + console.log(`Target${this.getBundle}`) + this.mInterFace.getAllAccounts(this.getBundle, allAccountResult) + break + } + }) + .width('90%') + .backgroundColor(0xF5F5F5) + } + } + .type(PanelType.Foldable) + .mode(PanelMode.Full) + .dragBar(true) + .halfHeight(800) + .onChange((value: any) => { + this.show = !this.show + console.info(`width:${value.width},height:${value.height},mode:${value.mode}`) + }) + } + .width('100%') + .height('40%') + .margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/model/interface.ets b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/model/interface.ets new file mode 100644 index 0000000000000000000000000000000000000000..43b2c061f567033a54d52817f22f200217adbda2 --- /dev/null +++ b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/model/interface.ets @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import account_appAccount from '@ohos.account.appAccount'; + +const TAG = '[appAccount]' + +export class interFace { + private appAccountManager = null + + constructor() { + this.appAccountManager = account_appAccount.createAppAccountManager() + } + + addAccount(username, password) { + this.appAccountManager.addAccount(username, password).then(() => { + console.log(`${TAG}addAccount Success`); + }).catch((err) => { + console.log("addAccount err: " + JSON.stringify(err)); + }); + } + + deleteAccount(account) { + this.appAccountManager.deleteAccount(account).then(() => { + }).catch((err) => { + console.log("deleteAccount err: " + JSON.stringify(err)); + }); + } + + disableAppAccess(username, application) { + this.appAccountManager.disableAppAccess(username, application).then(() => { + }).catch((err) => { + console.log("disableAppAccess err: " + JSON.stringify(err)); + }); + } + + enableAppAccess(username, application) { + this.appAccountManager.enableAppAccess(username, application, (err) => { + console.log(`${TAG} enableAppAccess username=${username},application=${application}, err=${JSON.stringify(err)}`) + }) + } + + checkAppAccountSyncEnable() { + this.appAccountManager.checkAppAccountSyncEnable("ZhangSan").then((data) => { + console.log('checkAppAccountSyncEnable, result: ' + data); + }).catch((err) => { + console.log("checkAppAccountSyncEnable err: " + JSON.stringify(err)); + }); + } + + setAccountCredential(username, credentialType, credential) { + this.appAccountManager.setAccountCredential(username, credentialType, credential, (err) => { + console.log(`${TAG} setAccountCredential username=${username},credentialType=${credentialType},credential=${credential},err:+ ${JSON.stringify(err)}`) + }) + } + + setAccountExtraInfo(name, extraInfo) { + this.appAccountManager.setAccountExtraInfo(name, extraInfo, (err) => { + console.log(`${TAG} setAccountExtraInfo name=${name},extraInfo=${extraInfo},err: ${JSON.stringify(err)}`) + }) + } + + setAppAccountSyncEnable() { + this.appAccountManager.setAppAccountSyncEnable("ZhangSan", true).then(() => { + console.log('setAppAccountSyncEnable Success'); + }).catch((err) => { + console.log("setAppAccountSyncEnable err: " + JSON.stringify(err)); + }); + } + + setAssociatedData(name, key, value) { + this.appAccountManager.setAssociatedData(name, key, value, (err) => { + console.log(`${TAG} setAssociatedData name=${name},key=${key},value=${value},err: ${JSON.stringify(err)}`); + }) + } + + getAccountCredential(name, credentialType, credentialResult) { + this.appAccountManager.getAccountCredential(name, credentialType, (err, result) => { + console.log(`${TAG} getAccountCredential name=${name},credentialType=${credentialType},err: + ${JSON.stringify(err)}+result: {JSON.stringify(result)}`); + credentialResult(result) + }) + } + + getAccountExtraInfo(name, extraInfoResult) { + this.appAccountManager.getAccountExtraInfo(name, (err, result) => { + console.log(`${TAG} getAccountExtraInfo name=${name},err: + ${JSON.stringify(err)}+result:${JSON.stringify(result)}`) + extraInfoResult(result) + }) + } + + getAssociatedData(name, key, associatedData) { + this.appAccountManager.getAssociatedData(name, key, (err, result) => { + console.log(`${TAG} getAssociatedData name=${name},key=${key},err: + ${JSON.stringify(err)} result: ${JSON.stringify(result)}`) + associatedData(result) + }) + } + + getAllAccessibleAccounts() { + this.appAccountManager.getAllAccessibleAccounts().then((data) => { + console.log(`getAllAccessibleAccounts: +${data.toString()}`); + return data + }).catch((err) => { + console.log("getAllAccessibleAccounts err: " + JSON.stringify(err)); + }); + } + + getAllAccounts(selfBundle, allAccountResult) { + this.appAccountManager.getAllAccounts(selfBundle, (err, data) => { + console.log(`${TAG} getAllAccounts selfBundle=${selfBundle},err: + ${JSON.stringify(err)} result:+${JSON.stringify(data)}`) + allAccountResult(data) + }) + } + + onChange() { + function changeOnCallback(data) { + console.debug("receive change data:" + JSON.stringify(data)); + } + + try { + this.appAccountManager.on('change', ["com.example.actsaccounttest"], changeOnCallback); + } + catch (err) { + console.error("on accountOnOffDemo err:" + JSON.stringify(err)); + } + } +} diff --git a/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/pages/index.ets b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..eac0c87d847b6fb760d386bb42fa4542d22f3c91 --- /dev/null +++ b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router' +import { interFace } from '../model/interface' + +@Entry +@Component +struct Index { + @State userName: string= '' + @State password: string= '' + private userArr= [{ name: $r('app.string.username'), name_input: $r('app.string.enter_username') }, + { name: $r('app.string.password'), name_input: $r('app.string.enter_password') }] + scroller: Scroller = new Scroller() + private mInterFace = new interFace() + @State show: boolean = false + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center }) { + Scroll(this.scroller) { + Column() { + Text($r('app.string.app_account_manager')) + .textAlign(TextAlign.Center) + .width('100%') + .height('8%') + .backgroundColor("#0D9FFB") + .fontSize(25) + .fontColor(Color.White) + .fontWeight(FontWeight.Bold) + + ForEach(this.userArr, (item) => { + Row() { + Text(item.name) + .textAlign(TextAlign.Center) + .width('20%') + .fontSize(20) + TextInput({ placeholder: item.name_input }) + .width('70%') + .fontSize(20) + .maxLength(20) + .fontWeight(FontWeight.Bold) + .placeholderFont({ size: 16, weight: FontWeight.Normal }) + .onChange((value: string) => { + this.userName = value + }) + } + .height('8.5%') + .margin({ bottom: 4, top: 4 }) + .padding({ left: 10 }) + }) + + Button() { + Text($r('app.string.register')) + .fontColor(Color.White) + .fontSize(16) + .width('30%') + .textAlign(TextAlign.Center) + } + .type(ButtonType.Capsule) + .margin({ bottom: 10 }) + .backgroundColor(0x317aff) + .onClick(() => { + this.mInterFace.addAccount(this.userName, this.password) + router.push({ + uri: 'pages/second', + params: { + username: this.userName, + password: this.password + } + }) + }) + } + } + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/pages/second.ets b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/pages/second.ets new file mode 100644 index 0000000000000000000000000000000000000000..50ebeaee3103c966249507cbef19db1d3a68da1a --- /dev/null +++ b/data/eTSAppAccountManager/entry/src/main/ets/MainAbility/pages/second.ets @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router' +import { interFace } from '../model/interface' +import { Input } from '../common/input' +import { SpeedButton } from '../common/button' +import { Tab } from '../common/tab' + +@Entry +@Component +struct Second { + @State application: string= '' + @State credentialType: string= '' + @State credential: string= '' + @State extraInfo: string= '' + @State key: string= '' + @State keyValue: string= '' + @State editFlag: boolean = false + private mInterFace= new interFace() + private getUserName: string= router.getParams().username + private getPassword: string= router.getParams().password + private userArr= [{ name: $r('app.string.username'), name_input: this.getUserName }] + private credentialArr= [{ + name: $r('app.string.enter_credential_type'), + placeholder: $r('app.string.enter_credential_type'), + change: this.credentialType + }, + { + name: $r('app.string.enter_credential'), + placeholder: $r('app.string.enter_credential'), + change: this.credential + }] + private keyArr= [{ name: $r('app.string.set_key'), placeholder: $r('app.string.set_key'), change: this.key }, + { name: $r('app.string.enter_key'), placeholder: $r('app.string.enter_key'), change: this.keyValue }] + scroller: Scroller = new Scroller() + @State show: boolean = false + + dialog(message) { + console.log('1') + AlertDialog.show( + { + title: '通知', + message: message, + confirm: { + value: '确定', + action: () => { + } + }, + cancel: () => { + } + } + ) + } + + enable() { + this.mInterFace.enableAppAccess(this.getUserName, this.application) + } + + disable() { + this.mInterFace.disableAppAccess(this.getUserName, this.application) + } + + submit() { + this.mInterFace.setAccountExtraInfo(this.getUserName, this.extraInfo) + console.info('guojin ') + } + + setCredential() { + this.mInterFace.setAccountCredential(this.getUserName, this.credentialType, this.credential) + this.dialog('设置凭证成功') + } + + setKey() { + this.mInterFace.setAssociatedData(this.getUserName, this.key, this.keyValue) + } + + setComplete() { + this.show = !this.show + } + + apply(value: string) { + this.application = value + } + + extra(value: string) { + this.extraInfo = value + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Scroll(this.scroller) { + Column() { + Text($r('app.string.app_account_manager')) + .textAlign(TextAlign.Center) + .padding({ top: 10 }) + .width('100%') + .height(60) + .backgroundColor("#0D9FFB") + .fontSize(25) + .fontColor(Color.White) + .fontWeight(FontWeight.Bold) + + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Start + }) { + Row() { + Text($r('app.string.username')) + .textAlign(TextAlign.Center) + .width('40%') + .fontSize(20) + Text(this.getUserName) + .textAlign(TextAlign.Center) + .width('40%') + .fontSize(20) + } + .margin({ top: 10 }) + .height(60) + + Input({ + text: $r('app.string.enter_application'), + textInput: $r('app.string.enter_application'), + callback: this.apply + }) + + Row({ space: 16 }) { + SpeedButton({ + text: $r('app.string.enable'), + callback: this.enable.bind(this), + dialog: this.dialog, + message: `${this.getUserName}用户此应用已启用` + }) + SpeedButton({ + text: $r('app.string.disable'), + callback: this.disable.bind(this), + dialog: this.dialog, + message: `${this.getUserName}用户此应用已禁用` + }) + } + + Input({ + text: $r('app.string.enter_extra_information'), + textInput: $r('app.string.enter_extra_information'), + callback: this.extra + }) + SpeedButton({ + text: $r('app.string.submit'), + callback: this.submit.bind(this), + dialog: this.dialog, + message: $r('app.string.submit_extra_success') + }) + ForEach(this.credentialArr, (item) => { + Row() { + Text(item.name) + .textAlign(TextAlign.Center) + .width('45%') + .fontSize(20) + TextInput({ placeholder: item.placeholder }) + .width('45%') + .fontSize(20) + .maxLength(20) + .fontWeight(FontWeight.Bold) + .placeholderFont({ size: 16, weight: FontWeight.Normal }) + .onChange((value: string) => { + item.change = value + }) + } + .height(120) + .margin({ bottom: 4 }) + .padding({ left: 10 }) + }, item => item.toString()) + SpeedButton({ + text: $r('app.string.set_credential'), + callback: this.setCredential.bind(this), + dialog: this.dialog, + message: $r('app.string.set_credential_success') + }) + + ForEach(this.keyArr, (item) => { + Row() { + Text(item.name) + .textAlign(TextAlign.Center) + .width('45%') + .fontSize(20) + TextInput({ placeholder: item.placeholder }) + .width('45%') + .fontSize(20) + .maxLength(20) + .fontWeight(FontWeight.Bold) + .placeholderFont({ size: 16, weight: FontWeight.Normal }) + .onChange((value: string) => { + item.change = value + }) + } + .height(80) + .margin({ bottom: 4 }) + .padding({ left: 10 }) + }) + Column({ space: 5 }) { + SpeedButton({ + text: $r('app.string.key_set'), + callback: this.setKey.bind(this), + dialog: this.dialog, + message: $r('app.string.set_key_success') + }) + SpeedButton({ + text: $r('app.string.set_complete'), + callback: this.setComplete.bind(this), + }) + } + + Tab({ + getName: this.getUserName, + getType: this.credentialType, + getKey: this.key, + getBundle: this.application, + show: this.show + }) + } + .height('100%') + .padding({ left: 10 }) + } + } + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/src/main/resources/base/element/string.json b/data/eTSAppAccountManager/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..4f112d87a7f2ffef80a338b00f9f66a23f1b2a52 --- /dev/null +++ b/data/eTSAppAccountManager/entry/src/main/resources/base/element/string.json @@ -0,0 +1,148 @@ +{ + "string": [ + { + "name": "eTSAppAccountManager", + "value": "eTSUtilScope" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + }, + { + "name": "app_account_manager", + "value": "Application account management" + }, + { + "name": "username", + "value": "username:" + }, + { + "name": "enter_username", + "value": "Please enter your user name" + }, + { + "name": "password", + "value": "password:" + }, + { + "name": "enter_password", + "value": "Please enter your password" + }, + { + "name": "register", + "value": "register" + }, + { + "name": "update", + "value": "update" + }, + { + "name": "edit", + "value": "edit" + }, + { + "name": "enter_application", + "value": "Please enter application" + }, + { + "name": "disable", + "value": "disable" + }, + { + "name": "enable", + "value": "enable" + }, + { + "name": "enter_credential_type", + "value": "Please enter credential type:" + }, + { + "name": "enter_credential", + "value": "Please enter credential:" + }, + { + "name": "set_credential", + "value": "set credential" + }, + { + "name": "enter_extra_information", + "value": "Please enter extra information:" + }, + { + "name": "submit", + "value": "Submit" + }, + { + "name": "set_key", + "value": "enter key for key:" + }, + { + "name": "enter_key", + "value": "Please enter key:" + }, + { + "name": "key_set", + "value": "Set key" + }, + { + "name": "set_complete", + "value": "After setting, return to the home page to obtain account application information" + }, + { + "name": "set_credential_success", + "value": "Set credential successfully" + }, + { + "name": "submit_extra_success", + "value": "extra information submitted successfully" + }, + { + "name": "set_key_success", + "value": "Set key successfully" + }, + { + "name": "notice", + "value": "notice" + }, + { + "name": "determine", + "value": "determine" + }, + { + "name": "click_get_credential", + "value": "Click here to get the voucher" + }, + { + "name": "credential", + "value": "credential" + }, + { + "name": "click_get_extra", + "value": "Click here for additional information" + }, + { + "name": "extra", + "value": "Additional information" + }, + { + "name": "click_get_associate", + "value": "Click here to get associated data" + }, + { + "name": "Associated_data", + "value": "Associated data" + }, + { + "name": "click_get_account", + "value": "Click here to get account information" + }, + { + "name": "account_data", + "value": "account information" + }, + { + "name": "upper", + "value": "37" + } + ] +} \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/src/main/resources/base/media/icon.png b/data/eTSAppAccountManager/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/data/eTSAppAccountManager/entry/src/main/resources/base/media/icon.png differ diff --git a/data/eTSAppAccountManager/entry/src/main/resources/en/element/string.json b/data/eTSAppAccountManager/entry/src/main/resources/en/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..4f112d87a7f2ffef80a338b00f9f66a23f1b2a52 --- /dev/null +++ b/data/eTSAppAccountManager/entry/src/main/resources/en/element/string.json @@ -0,0 +1,148 @@ +{ + "string": [ + { + "name": "eTSAppAccountManager", + "value": "eTSUtilScope" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + }, + { + "name": "app_account_manager", + "value": "Application account management" + }, + { + "name": "username", + "value": "username:" + }, + { + "name": "enter_username", + "value": "Please enter your user name" + }, + { + "name": "password", + "value": "password:" + }, + { + "name": "enter_password", + "value": "Please enter your password" + }, + { + "name": "register", + "value": "register" + }, + { + "name": "update", + "value": "update" + }, + { + "name": "edit", + "value": "edit" + }, + { + "name": "enter_application", + "value": "Please enter application" + }, + { + "name": "disable", + "value": "disable" + }, + { + "name": "enable", + "value": "enable" + }, + { + "name": "enter_credential_type", + "value": "Please enter credential type:" + }, + { + "name": "enter_credential", + "value": "Please enter credential:" + }, + { + "name": "set_credential", + "value": "set credential" + }, + { + "name": "enter_extra_information", + "value": "Please enter extra information:" + }, + { + "name": "submit", + "value": "Submit" + }, + { + "name": "set_key", + "value": "enter key for key:" + }, + { + "name": "enter_key", + "value": "Please enter key:" + }, + { + "name": "key_set", + "value": "Set key" + }, + { + "name": "set_complete", + "value": "After setting, return to the home page to obtain account application information" + }, + { + "name": "set_credential_success", + "value": "Set credential successfully" + }, + { + "name": "submit_extra_success", + "value": "extra information submitted successfully" + }, + { + "name": "set_key_success", + "value": "Set key successfully" + }, + { + "name": "notice", + "value": "notice" + }, + { + "name": "determine", + "value": "determine" + }, + { + "name": "click_get_credential", + "value": "Click here to get the voucher" + }, + { + "name": "credential", + "value": "credential" + }, + { + "name": "click_get_extra", + "value": "Click here for additional information" + }, + { + "name": "extra", + "value": "Additional information" + }, + { + "name": "click_get_associate", + "value": "Click here to get associated data" + }, + { + "name": "Associated_data", + "value": "Associated data" + }, + { + "name": "click_get_account", + "value": "Click here to get account information" + }, + { + "name": "account_data", + "value": "account information" + }, + { + "name": "upper", + "value": "37" + } + ] +} \ No newline at end of file diff --git a/data/eTSAppAccountManager/entry/src/main/resources/zh/element/string.json b/data/eTSAppAccountManager/entry/src/main/resources/zh/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..7dea7e2d20a83d769f8748824e1e428a5bf1c402 --- /dev/null +++ b/data/eTSAppAccountManager/entry/src/main/resources/zh/element/string.json @@ -0,0 +1,148 @@ +{ + "string": [ + { + "name": "eTSAppAccountManager", + "value": "eTSUtilScope" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + }, + { + "name": "app_account_manager", + "value": "应用账号管理" + }, + { + "name": "username", + "value": "用户名:" + }, + { + "name": "enter_username", + "value": "请输入您的用户名" + }, + { + "name": "password", + "value": "密码:" + }, + { + "name": "enter_password", + "value": "请输入您的密码" + }, + { + "name": "register", + "value": "注册" + }, + { + "name": "update", + "value": "更新" + }, + { + "name": "edit", + "value": "编辑" + }, + { + "name": "enter_application", + "value": "请输入应用名:" + }, + { + "name": "disable", + "value": "禁用" + }, + { + "name": "enable", + "value": "启用" + }, + { + "name": "enter_credential_type", + "value": "请输入凭据类型:" + }, + { + "name": "enter_credential", + "value": "请输入凭据:" + }, + { + "name": "set_credential", + "value": "设置凭据" + }, + { + "name": "enter_extra_information", + "value": "请输入额外信息:" + }, + { + "name": "submit", + "value": "提交" + }, + { + "name": "set_key", + "value": "请输入密钥的键:" + }, + { + "name": "enter_key", + "value": "请输入密钥:" + }, + { + "name": "key_set", + "value": "设置密钥" + }, + { + "name": "set_complete", + "value": "设置完成" + }, + { + "name": "set_credential_success", + "value": "设置凭证成功" + }, + { + "name": "submit_extra_success", + "value": "额外信息提交成功" + }, + { + "name": "set_key_success", + "value": "设置密钥成功" + }, + { + "name": "notice", + "value": "通知" + }, + { + "name": "determine", + "value": "确定" + }, + { + "name": "click_get_credential", + "value": "点击此处获取凭证" + }, + { + "name": "credential", + "value": "凭证" + }, + { + "name": "click_get_extra", + "value": "点击此处获取额外信息" + }, + { + "name": "extra", + "value": "额外信息" + }, + { + "name": "click_get_associate", + "value": "点击此处获取关联数据" + }, + { + "name": "Associated_data", + "value": "关联数据" + }, + { + "name": "click_get_account", + "value": "点击此处获取账号信息" + }, + { + "name": "account_data", + "value": "账号信息" + }, + { + "name": "upper", + "value": "37" + } + ] +} \ No newline at end of file diff --git a/data/eTSAppAccountManager/screenshots/device/index.png b/data/eTSAppAccountManager/screenshots/device/index.png new file mode 100644 index 0000000000000000000000000000000000000000..776946323035f714823bc30322bd39ce477889ea Binary files /dev/null and b/data/eTSAppAccountManager/screenshots/device/index.png differ diff --git a/data/eTSAppAccountManager/screenshots/device/second.png b/data/eTSAppAccountManager/screenshots/device/second.png new file mode 100644 index 0000000000000000000000000000000000000000..9444fbfc6c1000d5f997b4d8a988fe7e64b6dca9 Binary files /dev/null and b/data/eTSAppAccountManager/screenshots/device/second.png differ diff --git a/data/eTSAppAccountManager/settings.gradle b/data/eTSAppAccountManager/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4773db73233a570c2d0c01a22e75321acfbf7a07 --- /dev/null +++ b/data/eTSAppAccountManager/settings.gradle @@ -0,0 +1 @@ +include ':entry'