weex-eros-template

1.0.1 • Public • Published

weex-eros

目前仅支 MAC 开发

首次安装

首先下载 本木前端脚手架 BMFE_scaffold

    sudo cnpm install BMFE_scaffold -g
  • ios:

    • appStore 中搜索 Xcode 并下载。
  • android:

生成目录

1. 通过脚手架自动生成weex-eros目录。

    sudo BM init -f weex-eros-template

依次填写:

  • 项目名称;
  • 初始版本号;
  • 文件生成方式选择:
    • 2 ( weex-eros )

2. cd 进入到前端开发目录 fe 下

    cd 上面填写的项目名称/fe/

3. 通过 init 来选择更新和加载相应平台的依赖,目前仅支持 ios,有且仅当 ios/WeexEros/Benmu-iOS-Library 本木依赖本版本更新的时候,您可以选择性的执行下面指令来更新,首次启动必须执行。

    bm eros init ios

当执行完此指令后,如果您已经安装完 Xcode ,自动会为你打开,这时候您在点击左上方选择对应 iphone 模拟器,点击 build 箭头按钮便开始编译和打包您的 app

首次打开我们已经为您内置了由一些 weex 的官方 demo 和我们二次封装的一些组件 demo 打包而成的内置包。所以您可以看到相关的页面,下面我们来说下开发时候的步骤。

开发阶段

开始本地调试

首先配置 fe 目录下的 platform.json 文件。

// platform.json
{
    // app 
    "appName": "WeexEros",
    // 
    "page": {
        "homePage": "/pages/home/index.js",                     //  js 
        "mediatorPage": "/service/bus/index.js",                //  
        "navBarColor": "#3385ff"                                // 
        //   $nav 
        // bmRouter: {
        //    viewWillAppear() {
        //         this.$nav.setNavigationInfo({
        //              hideNavbar: true
        //              ... 
        //         }, () => {
        //              // 
        //        })
        //    }
        // }
 
    },
    // 路径相关
    "url"{
        // 
        "request": "http://test4.benmu-health.com",
        // 
        "local": "http://fe.benmu-health.com",
        //  
        "image": "https://lev-inf.benmu-health.com",
        //  js  request        
        "checkJsVersionApi": "/mobile/app/version/checkJSUpdate"
    },
    // 个推相关
    "getui"{
        "enabled": "ture",
        "appId": "oqoYepdVOmAls6b36biSV2",
        "appKey": "DB8n1tT8XpAgzjMfMyBGvA",
        "appSecret": "epeqetV7Q46zWoZkdaWZE9"
    },
    // 友盟统计和分享相关
    "umeng"{
        "enabled": "ture",
        "iOSAppKey": "59264dee04e205bbe200182e",
        "androidAppKey": "value"
    },
    // 微信支付相关
    "wechat"{
        "enabled": "false",
        "appId": "",
        "appSecret": ""
    },
    // 高德地图相关
    "amap"{
        "enabled": "false",
        "appKey": ""
    }
}

如果您已经下载了类似 Charles 的抓包工具,直接看步骤二。

  1. 下载安装 MacCharles ,并破解(下载和破解地址),然后开启 Charles
  2. 本地配置资源文件名 hosts
    127.0.0.1       fe.benmu-health.com 

默认是 fe.benmu-health.com ,如果需要更改,请对应更改 platform.json 中的 url.local

  1. platform.json, zip 包等信息传入 /fe/config.js 中配置的对应平台的地址
    // fe/config.js
    {
        ...
        'iosZipFolder': '/ios/WeexEros/WeexEros', // ios 文件存放地址
        'androidZipFolder': '/android/WeexFrameworkWrapper/app/src/main/assets', // android 文件存放地址
        ...
    }

fe 目录下 命令行中执行如下指令

    sudo bm eros min
  1. 通过脚手架起本地服务
    sudo bm server

Readme

Keywords

Package Sidebar

Install

npm i weex-eros-template

Weekly Downloads

1

Version

1.0.1

License

ISC

Last publish

Collaborators

  • karynsong