{"id":18925040,"url":"https://github.com/hero-node/hero-js","last_synced_at":"2025-08-11T21:05:49.465Z","repository":{"id":101948349,"uuid":"75376347","full_name":"hero-node/hero-js","owner":"hero-node","description":"a hero imp on web","archived":false,"fork":false,"pushed_at":"2024-08-27T20:05:55.000Z","size":41913,"stargazers_count":14,"open_issues_count":4,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-15T14:55:20.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hero-node.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-12-02T08:28:33.000Z","updated_at":"2024-11-04T23:24:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"9243cc47-3315-4e3c-a207-13d980ff4f0d","html_url":"https://github.com/hero-node/hero-js","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hero-node/hero-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hero-node%2Fhero-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hero-node%2Fhero-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hero-node%2Fhero-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hero-node%2Fhero-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hero-node","download_url":"https://codeload.github.com/hero-node/hero-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hero-node%2Fhero-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269956296,"owners_count":24503138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T11:09:01.649Z","updated_at":"2025-08-11T21:05:49.449Z","avatar_url":"https://github.com/hero-node.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Usage**\n\n- [HeroNode FE API](#heronode-api-for-10x)\n  - [Getting Started](#getting-started)\n    - [Install Hero.js](#install-herojs)\n  - [Hero Components](#hero-components)\n      - [hero-alert](#herov-alert)\n        - [JSON](#json)\n      - [hero-button](#hero-button)\n        - [JSON](#json-1)\n      - [hero-chat-msg-view](#hero-chat-msg-view)\n        - [JSON](#json-2)\n      - [hero-confirm](#hero-confirm)\n        - [JSON](#json-3)\n        - [EVENT](#event)\n      - [hero-contact-view](#hero-contact-view)\n        - [JSON](#json-4)\n      - [hero-dialog](#hero-dialog)\n        - [JSON](#json-5)\n        - [EVENT](#event-1)\n      - [hero-image-view](#hero-image-view)\n        - [JSON](#json-6)\n      - [hero-label](#hero-label)\n        - [JSON](#json-7)\n      - [hero-loading](#hero-loading)\n        - [JSON](#json-8)\n      - [hero-location-view](#hero-location-view)\n        - [JSON](#json-9)\n      - [hero-ocr-view](#hero-ocr-view)\n        - [JSON](#json-10)\n      - [hero-switch](#hero-switch)\n        - [JSON](#json-11)\n      - [hero-table-view](#hero-table-view)\n        - [hero-table-cell](#hero-table-cell)\n          - [JSON](#json-12)\n        - [hero-table-section](#hero-table-section)\n          - [JSON](#json-13)\n          - [EVENT](#event-2)\n      - [hero-text-filed](#hero-text-filed)\n        - [JSON](#json-14)\n        - [EVENT](#event-3)\n      - [hero-toast](#hero-toast)\n        - [JSON](#json-15)\n      - [hero-toolbar-item](#hero-toolbar-item)\n        - [JSON](#json-16)\n - [Script for the project](#script-for-the-project)\n      - [Compiler.js](#compilerjs)\n        - [Introduce](#introduce)\n        - [Usage](#usage)\n        - [Step](#step)\n      - [Deploy.js](#deployjs)\n        - [Introduce](#introduce-1)\n        - [Usage](#usage-1)\n        - [Step](#step-1)\n      - [Go.js](#gojs)\n        - [Introduce](#introduce-2)\n        - [Usage](#usage-2)\n        - [Step](#step-2)\n - [How to use it in a project](#how-to-use-it-in-a-project)\n    - [The UI](#the-ui)\n    - [The Life Cycle](#the-life-cycle)\n    \n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n # HeroNode API for 1.0.x\n **Introduce: Hero was a framework to develop crossplatform app. Now it is a framework to develop Dapp**\n ## Getting Started\n * [Install the Hero.js](#install-herojs)\n ### Install Hero.js\n First you need to get hero.js into your project. This can be done using the following methods:\n - `git clone https://github.com/hero-node/hero-js.git`\n\n - `cd hero-js`\n\n - `npm install`\n\nThen you need to run the projects:\n - `npm start`\n\n After that you can open the service at http://127.0.0.1:3000/projects/\n\u003c!-- The components' introduce --\u003e\n## Hero Components\n ***\n #### hero-alert\n ##### JSON\n `text` - The alert text\n ***\n \n #### hero-button\n ##### JSON\n `title` - The button title\n\n `disabled` - The button isDisabled\n \n `backgroundDisabledColor` - The button backgroundDisabledColor\n \n `titleColor` - The button titleColor\n \n `backgroundColor` - The button backgroundColor\n \n `size` - The button fontSize\n \n `cornerRadius` - The button borderRadius\n \n `image` - The button image\n\n ***\n \n #### hero-chat-msg-view\n ##### JSON\n `text` - The chat-msg-view text\n\n ***\n \n #### hero-confirm\n ##### JSON\n `text` - The confirm text\n \n ##### EVENT\n `open()` - The confirm window opened\n \n `close()` - The confirm window closed\n \n `tapOk()` - User clicked confirm(ok)\n \n `tapCancel()` - User clicked cancel\n\n ***\n \n #### hero-contact-view\n ##### JSON\n `show` - The contact-view isShow(*only mobile*)\n\n ***\n \n #### hero-dialog\n ##### JSON\n `text` - The dialog text\n \n ##### EVENT\n `open()` - The dialog window opened\n \n `close()` - The dialog window closed\n\n ***\n \n #### hero-image-view\n ##### JSON\n `json` - The image-view imageFile(path/base64)\n\n ***\n \n #### hero-label\n ##### JSON\n `text` - The label text\n \n `size` - The label fontSize\n \n `alignment` - The label textAlign\n \n `textColor` - The label textColor\n \n `weight` - The label fontWeight\n\n ***\n \n #### hero-loading\n ##### JSON\n `true` - show\n \n `false` -hide\n\n ***\n \n #### hero-location-view\n ##### JSON\n `fetch_coordinate` - The location-view fetch_coordinate\n\n ***\n \n #### hero-ocr-view\n ##### JSON\n `type` - The ocr-view type\n\n ***\n \n #### hero-switch\n ##### JSON\n `value` - The switch isChecked\n \n `click` - The switch click\n\n ***\n \n #### hero-table-view\n ##### hero-table-cell\n ###### JSON\n `height` - The cell height\n \n `textValue` - The cell textValue\n \n `detail` - The cell detail\n \n `title` - The cell title\n \n `bottomLine` - The cell bottomLine\n \n `size` - The cell size\n \n `color` - The cell color\n \n `image` - The cell image\n \n `accessoryType` - The cell rightButton\n \n `indentationWidth` - The cell titleXoffset\n \n  ##### hero-table-section\n  ###### JSON\n `sectionTitle` - The cell sectionTitle\n \n `rows` - The cell style\n \n ##### EVENT\n `textChange` - The textView change event\n\n ***\n \n #### hero-text-filed\n ##### JSON\n `size` - The text-filed size\n \n `textColor` - The text-filed textColor\n \n `clear` - Clear the text-filed\n \n `text` - The text-filed text\n \n `placeHolder` - The text-filed placeHolder\n \n `secure` - The text-filed secure\n \n `type` - The text-filed type\n \n `focus` - The text-filed focus\n \n `blur` - The text-filed blur\n \n ##### EVENT\n `textChange` - The text change event\n\n ***\n \n #### hero-toast\n ##### JSON\n `position` - The toast position\n \n `text` - The toast text\n\n ***\n \n #### hero-toolbar-item\n ##### JSON\n `title` - The toolbar title\n \n `image` - The toolbar image\n\n ***\n \n \n \n # Script for the project\n \n ### Compiler.js\n \n#### Introduce\n`This script is used to compile solidity.`\n\n***\n\n#### Usage\n\n```\na.install -- web3 solc fs path\nb.compile -- node compiler.js\n```\n\n#### Step \n\n```\na. Find in the project if a file in the '.sol' format exists.\n\nb. If so, run this script\n\nc. Generate the corresponding '.abi', '.js', '.json' files\n```\n\n***\n    \n### Deploy.js\n\n#### Introduce\n`This script is used to deploy solidity.`\n\n***\n\n#### Usage\n\n```\na.install -- web3 fs path ethereumjs-tx\nb.deploy -- node deploy.js\n```\n\n#### Step \n\n```\na. Find in the project if a file in the '.abi', '.json' format exists.\nb. Sign with the private key\nc. Deploy the contract by sending a transaction\nd. Through the web3.eth.getTransactionReceipt() to return the contract deployment of address\nd. Generates a contract address file and writes the contract address\n```\n\n***\n\n### Go.js\n\n#### Introduce\n`Publish the project to geth and ipfs nodes.`\n\n***\n\n#### Usage\n\n```\na.install -- shelljs/global http-proxy-middleware\nb.publish -- node go.js\n```\n\n#### Step \n\n```\na. Whether to open ipfs nodes.\nb. If not, run 'ipfs daemon'.\nc. Whether to open Geth.\nd. If not, run 'geth'.\nd. Forward ports to '8080' and '8545'\n```\n\n***\n\n# How to use it in a project\n\n### The UI\n\n```\nHero.ui = {\n    version: -1,\n    tintColor: 'bd3a53', //The font color\n    // The navigation items' UI and Style\n    nav: {\n        title: \"区块链-集五福\", // nav title (string)\n        titleColor: 'ffffff', // title color(omit '#')\n        navigationBarHidden: false,// Whether the nav bar is displayed(bool)\n        leftItems: [{title:'back'},{image:'fu'}]// Upper left item button (eg. Return to previous page)\n    },\n    // Hero UI item\n    views: [\n        eg. A button to submit the form\n        {\n            class:'HeroButton', // Use the Corresponding Hero Component\n            ripple: true, //  Whether the effects of clicks is displayed(bool)\n            title:'查看奖池',// button content (string)\n            titleColor:'999999',// button content text color\n            size:12, // fontSize\n            // postion: {'w': width, 'h': height, 'l': left, 'r': right, 'b': bottom, 'y': top;} 'x': 100%('0.5x': 50%)\n            frame:{r:'10',w:'80',y:'0.5x+32',h:'30'}, \n            // event: This can be handled here or Hero.on = function (data){if (data.click === 'submit'){\n            //}}\n            // click: {click: 'submit'}\n            click:{command:'goto:'+path+'dalao.html'}\n        }\n    ]\n}\n```\n\n\n### The Life Cycle\n\n```\nHero.on() = function (data) {\n    \u003c!-- eg. --\u003e\n     if (data.click === 'submit') { \n        \u003c!-- The event --\u003e\n    }\n}\n```\n\n```\nHero.viewWillAppear() = function () {\n    \u003c!-- The 'viewWillAppear' event --\u003e\n}\n```\n\n```\nHero.viewWillDisAppear() = function () {\n    \u003c!-- The 'viewWillDisAppear' event --\u003e\n}\n```\n\n```\nHero.viewDidload() = function () {\n    \u003c!-- The 'viewDidload' event --\u003e\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhero-node%2Fhero-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhero-node%2Fhero-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhero-node%2Fhero-js/lists"}