├── .babelrc ├── .eslintrc.json ├── .gitignore ├── README.md ├── android.config.json ├── config.xml ├── dist ├── components │ ├── article-list-item.js │ ├── article-list-item.weex.js │ ├── article.js │ ├── article.weex.js │ ├── card-item.js │ ├── card-item.weex.js │ ├── video-list.js │ ├── video-list.weex.js │ ├── video.js │ └── video.weex.js ├── home.js ├── home.weex.js ├── index.js ├── index.weex.js ├── pages │ ├── article.js │ ├── article.weex.js │ ├── map.js │ ├── map.weex.js │ ├── search.js │ └── search.weex.js ├── profile.js ├── profile.weex.js ├── shop.js ├── shop.weex.js ├── video.js └── video.weex.js ├── hooks └── README.md ├── ios.config.json ├── package.json ├── plugins ├── README.md ├── fetch.json └── weex-amap │ ├── LICENSE │ ├── README.md │ ├── RELEASENOTES.md │ ├── android │ ├── .gitignore │ ├── apply_android_dev.sh │ ├── patch │ │ └── dev_amap.patch │ └── plugin │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── alibaba │ │ │ └── weex │ │ │ └── amap │ │ │ ├── component │ │ │ ├── WXMapMarkerComponent.java │ │ │ └── WXMapViewComponent.java │ │ │ ├── module │ │ │ └── WXMapModule.java │ │ │ └── util │ │ │ ├── Constant.java │ │ │ ├── GifDecoder.java │ │ │ └── Utils.java │ │ └── res │ │ └── values │ │ └── strings.xml │ ├── demos │ ├── include │ │ ├── example-list-item.we │ │ ├── example-list.we │ │ ├── navbar.we │ │ └── page.style.css │ ├── index.we │ ├── pages │ │ ├── center.we │ │ ├── geolocation.we │ │ ├── init.we │ │ ├── marker.we │ │ ├── search.we │ │ └── zoom.we │ └── vue │ │ ├── include │ │ ├── example-list-item.vue │ │ ├── example-list.vue │ │ ├── navbar.vue │ │ └── panel.vue │ │ ├── index.vue │ │ ├── input.vue │ │ └── pages │ │ ├── center.vue │ │ ├── geolocation.vue │ │ ├── init.vue │ │ ├── marker.vue │ │ ├── search.vue │ │ └── zoom.vue │ ├── doc │ ├── es │ │ ├── README.md │ │ └── index.md │ └── zh │ │ ├── README.md │ │ └── index.md │ ├── ios │ ├── .gitignore │ ├── LICENSE │ ├── Podfile │ ├── README.md │ ├── WeexDemo.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── WeexDemo.xcscheme │ │ │ └── WeexUITestDemo.xcscheme │ ├── WeexDemo │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── Icon-29.png │ │ │ │ ├── Icon-29@2x-1.png │ │ │ │ ├── Icon-29@2x.png │ │ │ │ ├── Icon-29@3x.png │ │ │ │ ├── Icon-40.png │ │ │ │ ├── Icon-40@2x-1.png │ │ │ │ ├── Icon-40@2x.png │ │ │ │ ├── Icon-40@3x.png │ │ │ │ ├── Icon-60@2x.png │ │ │ │ ├── Icon-60@3x.png │ │ │ │ ├── Icon-76.png │ │ │ │ ├── Icon-76@2x.png │ │ │ │ └── Icon-83.5@2x.png │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.launchimage │ │ │ │ ├── Contents.json │ │ │ │ ├── Default-4.7@2x.png │ │ │ │ ├── Default-568h@2x-1.png │ │ │ │ ├── Default-568h@2x.png │ │ │ │ ├── Default.png │ │ │ │ ├── Default@2x-1.png │ │ │ │ ├── Default@2x.png │ │ │ │ ├── Default@3x-1.png │ │ │ │ └── Default@3x.png │ │ │ ├── back.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── back.png │ │ │ │ ├── back@2x.png │ │ │ │ └── back@3x.png │ │ │ ├── reload.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── reload.png │ │ │ │ ├── reload@2x.png │ │ │ │ └── reload@3x.png │ │ │ └── scan.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── scan.png │ │ │ │ ├── scan@2x.png │ │ │ │ └── scan@3x.png │ │ ├── DemoDefine.h │ │ ├── Images.xcassets │ │ │ └── Brand Assets.launchimage │ │ │ │ └── Contents.json │ │ ├── WeexConfig │ │ │ ├── WeexBundleUrlLoder.h │ │ │ ├── WeexBundleUrlLoder.m │ │ │ ├── WeexConfigParser.h │ │ │ ├── WeexConfigParser.m │ │ │ ├── WeexSDKManager.h │ │ │ └── WeexSDKManager.m │ │ ├── WeexDemo-Info.plist │ │ ├── WeexScanner │ │ │ ├── UIViewController+WXDemoNaviBar.h │ │ │ ├── UIViewController+WXDemoNaviBar.m │ │ │ ├── WXDemoViewController.h │ │ │ ├── WXDemoViewController.m │ │ │ ├── WXScannerVC.h │ │ │ └── WXScannerVC.m │ │ ├── config.xml │ │ ├── main.m │ │ └── weex-icon.png │ ├── WeexDemoTests │ │ ├── Info.plist │ │ └── WeexDemoTests.m │ ├── WeexUITestDemo-Info.plist │ ├── WeexUITestDemoUITests │ │ ├── Info.plist │ │ └── WeexUITestDemoUITests.m │ ├── Weexplugin │ │ ├── Podfile │ │ ├── Weexplugin.podspec │ │ ├── Weexplugin.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ ├── Weexplugin │ │ │ ├── Plugins │ │ │ │ ├── weex-adapter-image │ │ │ │ │ ├── WXImgLoaderImpl.h │ │ │ │ │ └── WXImgLoaderImpl.m │ │ │ │ └── weex-plugin-amap │ │ │ │ │ ├── WXMapViewComponent.h │ │ │ │ │ ├── WXMapViewComponent.m │ │ │ │ │ ├── WXMapViewMarkerComponent.h │ │ │ │ │ ├── WXMapViewMarkerComponent.m │ │ │ │ │ ├── WXMapViewModule.h │ │ │ │ │ └── WXMapViewModule.m │ │ │ ├── Resources │ │ │ │ └── WeexpluginConfig.xml │ │ │ ├── Source │ │ │ │ └── WeexPlugin │ │ │ │ │ ├── WeexPluginConfigParser.h │ │ │ │ │ ├── WeexPluginConfigParser.m │ │ │ │ │ ├── WeexPluginLoader.h │ │ │ │ │ ├── WeexPluginLoader.m │ │ │ │ │ ├── WeexPluginManager.h │ │ │ │ │ └── WeexPluginManager.m │ │ │ ├── Weexplugin-Info.plist │ │ │ └── Weexplugin.h │ │ ├── WeexpluginTests │ │ │ ├── Info.plist │ │ │ └── WeexpluginTests.m │ │ ├── frameworks.json │ │ ├── ios.json │ │ └── pods.json │ ├── bundlejs │ │ └── index.js │ ├── weex.png │ └── weex@2x.png │ ├── js │ ├── demo.vue │ ├── package.json │ └── weex-amap.vue │ ├── karma.conf.js │ ├── package.json │ ├── plugin.xml │ └── web │ ├── components │ ├── amap-marker.js │ └── amap.js │ ├── index.js │ ├── module │ └── amap.js │ ├── package.json │ ├── service │ ├── map-loader.js │ ├── map-manager.js │ ├── marker.js │ └── vendor.js │ └── vue-amap │ ├── components │ ├── amap-marker.vue │ └── amap.vue │ ├── index.js │ ├── managers │ └── amap-manager.js │ ├── mixins │ ├── editor-component.js │ └── register-component.js │ ├── module │ └── amap.js │ ├── polyfills.js │ ├── services │ ├── injected-amap-api-instance.js │ └── lazy-amap-api-loader.js │ └── utils │ ├── constant.js │ ├── convert-helper.js │ ├── event-helper.js │ ├── guid.js │ └── uppercamelcase.js ├── shots ├── .DS_Store └── shot1.png ├── src ├── .DS_Store ├── components │ ├── article-list-item.vue │ ├── article.vue │ ├── card-item.vue │ ├── video-list.vue │ └── video.vue ├── include │ ├── .DS_Store │ ├── example-list-item.vue │ ├── example-list.vue │ ├── footer.vue │ ├── h3.vue │ ├── icon.vue │ ├── loading-list-item.vue │ ├── navbar.vue │ ├── page.style.css │ ├── progress-bar.vue │ ├── search-bar.vue │ └── tab-bar.vue ├── index.vue ├── lib │ └── helper.js ├── pages │ ├── article.vue │ ├── map.vue │ └── search.vue ├── profile.vue ├── shop.vue └── video.vue ├── start ├── start.bat ├── tools └── webpack.config.plugin.js ├── web ├── .DS_Store ├── assets │ ├── .DS_Store │ ├── phantom-limb.js │ ├── qrcode.js │ ├── style.css │ └── weex-init.js ├── index.html ├── plugin.js └── weex.html ├── webpack.config.js └── webpack.dev.js /.babelrc: -------------------------------------------------------------------------------- 1 | { "presets": ["es2015"] } -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "airbnb-base", 3 | "plugins": [ 4 | "import" 5 | ], 6 | "globals":{ 7 | "weex": 1 8 | }, 9 | "env": { 10 | "browser": 1 11 | }, 12 | "rules": { 13 | "func-names": 0, 14 | "comma-dangle": 0, 15 | "object-shorthand": 0, 16 | "no-underscore-dangle": 0, 17 | "no-plusplus": 0, 18 | "consistent-return": 0, 19 | "prefer-template": 0 20 | } 21 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # https://git-scm.com/docs/gitignore 2 | # https://help.github.com/articles/ignoring-files 3 | # Example .gitignore files: https://github.com/github/gitignore 4 | /bower_components/ 5 | node_modules 6 | .DS_Store 7 | temp -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # weex-app-seed 2 | 3 | []() 4 |  5 | 6 | weex-app-seed是一款用于快速创建weex vue项目的模版。 7 | 8 | 9 | 10 | [Demos](https://weex-plugins.github.io/weex-app-start-kit/weex.html?page=home.js) 11 | 12 | 13 | ### 特性 14 | 15 | 相对于原始weexpack初始化的项目,它具有下面新的特性: 16 | 17 | * 初始化应用的基本布局,这里你可以看到一个更为复杂的weex 应用, 覆盖了搜索,视频,个人信息,动态流等。 18 | 19 | * 提供weex 新的API使用参考,应用覆盖了大多数weex的属性,你可以参考实现。 20 | 21 | * 提供一些基本定义的组件实现包括,icon,navbar, tabbar等。 22 | 23 | * 基于webpack2构建, 使用webpack dev server 支持live reload。 24 | 25 | * 集成weex-amap插件,可以直接使用地图插件。 26 | 27 | 28 | ### 如何使用 29 | 30 | 首先确保你安装了weexpack,如过没有安装可以执行: 31 | ``` bash 32 | npm install weexpack -g 33 | ``` 34 | [weexpack文档](https://github.com/weexteam/weex-pack) 35 | 36 | 37 | ``` bash 38 | git clone https://github.com/weex-plugins/weex-app-start-kit.git first_weex_app 39 | 40 | cd first_weex_app && npm install // 进入目录执行完依赖安装 41 | ``` 42 | 43 | 这样你的weexpack 创建的项目环境就OK了,你可以执行任何weexpack命令了。 44 | 45 | 这个时候执行weexpack run web/ios/android 就可以预览你的文件了. 46 | 47 | 48 | ### Thanks 49 | 50 | + [Icons Designed by linea.io](http://linea.io/) 51 | 52 | + [Instagram UI Mockup](https://www.behance.net/gallery/38441555/Free-Mockup-PSD-New-Interface-Instagram-2016) -------------------------------------------------------------------------------- /android.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "AppName":"WeexApp", 3 | "AppId":"com.alibaba.weex", 4 | "SplashText":"Hello\nWeex", 5 | "WeexBundle":"index.js" 6 | } 7 | -------------------------------------------------------------------------------- /config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | MyApp1 4 | 5 | A sample Apache Cordova application that responds to the deviceready event. 6 | 7 | 8 | Apache Cordova Team 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /dist/components/article-list-item.js: -------------------------------------------------------------------------------- 1 | // { "framework": "Vue"} 2 | 3 | !function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=50)}({26:function(e,t,r){"use strict";var n=weex.requireModule("navigator");e.exports={props:{imgsrc:{type:String},keyword:{type:String},desc:{type:String},url:{type:String}},methods:{redirect:function(){n.push({url:this.url})}}}},37:function(e,t){e.exports={item:{height:460,margin:40,marginTop:20,backgroundColor:"#ffffff",borderWidth:1,borderBottomWidth:2,borderColor:"rgba(0,0,0,0.2)"},"item-bannar":{height:300,borderWidth:10,borderColor:"#ffffff"},"item-desc":{flex:1,flexDirection:"row",paddingTop:15,fontSize:36,color:"#555555",textAlign:"center"},inner:{flex:.7,flexDirection:"column",paddingLeft:10,alignItems:"flex-start"},keyword:{fontSize:40,color:"#1995f9"},details:{fontSize:24,color:"#333333"},"btn-wrap":{flex:.4,justifyContent:"center",alignSelf:"right"},btn:{alignSelf:"center",marginLeft:10,display:"inline-block",backgroundColor:"#1995f9",color:"#ffffff",padding:20,paddingTop:10,paddingBottom:10,borderRadius:30,fontSize:24}}},45:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:["item"],on:{click:e.redirect}},[r("image",{staticClass:["item-bannar"],attrs:{src:e.imgsrc}}),r("div",{staticClass:["item-desc"]},[r("div",{staticClass:["inner"]},[r("text",{staticClass:["keyword"]},[e._v(e._s(e.keyword))]),r("text",{staticClass:["details"]},[e._v(e._s(e.desc))])]),e._m(0)])])},staticRenderFns:[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:["btn-wrap"]},[r("text",{staticClass:["btn"]},[e._v("查看详情")])])}]},e.exports.render._withStripped=!0},50:function(e,t,r){var n,i,o=[];o.push(r(37)),n=r(26);var s=r(45);i=n=n||{},"object"!=typeof n.default&&"function"!=typeof n.default||(Object.keys(n).some(function(e){return"default"!==e&&"__esModule"!==e})&&console.error("named exports are not supported in *.vue files."),i=n=n.default),"function"==typeof i&&(i=i.options),i.__file="/Users/ali-130257n/www/weex-app-start-kit/src/components/article-list-item.vue",i.render=s.render,i.staticRenderFns=s.staticRenderFns,i.style=i.style||{},o.forEach(function(e){for(var t in e)i.style[t]=e[t]}),e.exports=n,e.exports.el="true",new Vue(e.exports)}}); -------------------------------------------------------------------------------- /dist/components/article-list-item.weex.js: -------------------------------------------------------------------------------- 1 | // { "framework": "Vue" } 2 | 3 | !function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=50)}({26:function(e,t,r){"use strict";var n=weex.requireModule("navigator");e.exports={props:{imgsrc:{type:String},keyword:{type:String},desc:{type:String},url:{type:String}},methods:{redirect:function(){n.push({url:this.url})}}}},37:function(e,t){e.exports={item:{height:460,margin:40,marginTop:20,backgroundColor:"#ffffff",borderWidth:1,borderBottomWidth:2,borderColor:"rgba(0,0,0,0.2)"},"item-bannar":{height:300,borderWidth:10,borderColor:"#ffffff"},"item-desc":{flex:1,flexDirection:"row",paddingTop:15,fontSize:36,color:"#555555",textAlign:"center"},inner:{flex:.7,flexDirection:"column",paddingLeft:10,alignItems:"flex-start"},keyword:{fontSize:40,color:"#1995f9"},details:{fontSize:24,color:"#333333"},"btn-wrap":{flex:.4,justifyContent:"center",alignSelf:"right"},btn:{alignSelf:"center",marginLeft:10,display:"inline-block",backgroundColor:"#1995f9",color:"#ffffff",padding:20,paddingTop:10,paddingBottom:10,borderRadius:30,fontSize:24}}},45:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:["item"],on:{click:e.redirect}},[r("image",{staticClass:["item-bannar"],attrs:{src:e.imgsrc}}),r("div",{staticClass:["item-desc"]},[r("div",{staticClass:["inner"]},[r("text",{staticClass:["keyword"]},[e._v(e._s(e.keyword))]),r("text",{staticClass:["details"]},[e._v(e._s(e.desc))])]),e._m(0)])])},staticRenderFns:[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:["btn-wrap"]},[r("text",{staticClass:["btn"]},[e._v("查看详情")])])}]},e.exports.render._withStripped=!0},50:function(e,t,r){var n,i,o=[];o.push(r(37)),n=r(26);var s=r(45);i=n=n||{},"object"!=typeof n.default&&"function"!=typeof n.default||(Object.keys(n).some(function(e){return"default"!==e&&"__esModule"!==e})&&console.error("named exports are not supported in *.vue files."),i=n=n.default),"function"==typeof i&&(i=i.options),i.__file="/Users/ali-130257n/www/weex-app-start-kit/src/components/article-list-item.vue",i.render=s.render,i.staticRenderFns=s.staticRenderFns,i.style=i.style||{},o.forEach(function(e){for(var t in e)i.style[t]=e[t]}),e.exports=n,e.exports.el="true",new Vue(e.exports)}}); -------------------------------------------------------------------------------- /dist/components/card-item.js: -------------------------------------------------------------------------------- 1 | // { "framework": "Vue"} 2 | 3 | !function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=53)}({12:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{name:{default:""},shareCount:{default:""}}}},16:function(e,t){e.exports={card:{flex:.5,padding:10,margin:10,border:"1px solid #ddd",borderBottom:"2px solid rgba(0,0,0,.3)",minWidth:240,minHeight:120,backgroundColor:"#ffffff"},"card-cover":{height:200,marginBottom:20,border:"2px solid #eee"},"card-detail":{flexDirection:"row"},"card-name":{flex:1,fontSize:30,color:"#555555",fontWeight:"bold"},"share-contents":{flex:1,flexDirection:"row",justifyContent:"flex-end",alignItems:"center"},"icon-share":{width:36,height:36},"share-count":{marginLeft:10,fontSize:24,color:"#999999"}}},19:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:["card"]},[r("image",{staticClass:["card-cover"],attrs:{src:"http://img1.vued.vanthink.cn/vuedf9246c2edc2e4f1fc7caabf6cc84f719.png"}}),r("div",{staticClass:["card-detail"]},[r("text",{staticClass:["card-name"]},[e._v(e._s(e.name))]),r("div",{staticClass:["share-contents"]},[r("image",{staticClass:["icon-share"],attrs:{src:"http://img1.vued.vanthink.cn/vued823de5c04e0cc944dede20370bee354d.png"}}),r("text",{staticClass:["share-count"]},[e._v(e._s(e.shareCount))])])])])},staticRenderFns:[]},e.exports.render._withStripped=!0},53:function(e,t,r){var n,o,s=[];s.push(r(16)),n=r(12);var a=r(19);o=n=n||{},"object"!=typeof n.default&&"function"!=typeof n.default||(Object.keys(n).some(function(e){return"default"!==e&&"__esModule"!==e})&&console.error("named exports are not supported in *.vue files."),o=n=n.default),"function"==typeof o&&(o=o.options),o.__file="/Users/ali-130257n/www/weex-app-start-kit/src/components/card-item.vue",o.render=a.render,o.staticRenderFns=a.staticRenderFns,o.style=o.style||{},s.forEach(function(e){for(var t in e)o.style[t]=e[t]}),e.exports=n,e.exports.el="true",new Vue(e.exports)}}); -------------------------------------------------------------------------------- /dist/components/card-item.weex.js: -------------------------------------------------------------------------------- 1 | // { "framework": "Vue" } 2 | 3 | !function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=53)}({12:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{name:{default:""},shareCount:{default:""}}}},16:function(e,t){e.exports={card:{flex:.5,padding:10,margin:10,border:"1px solid #ddd",borderBottom:"2px solid rgba(0,0,0,.3)",minWidth:240,minHeight:120,backgroundColor:"#ffffff"},"card-cover":{height:200,marginBottom:20,border:"2px solid #eee"},"card-detail":{flexDirection:"row"},"card-name":{flex:1,fontSize:30,color:"#555555",fontWeight:"bold"},"share-contents":{flex:1,flexDirection:"row",justifyContent:"flex-end",alignItems:"center"},"icon-share":{width:36,height:36},"share-count":{marginLeft:10,fontSize:24,color:"#999999"}}},19:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:["card"]},[r("image",{staticClass:["card-cover"],attrs:{src:"http://img1.vued.vanthink.cn/vuedf9246c2edc2e4f1fc7caabf6cc84f719.png"}}),r("div",{staticClass:["card-detail"]},[r("text",{staticClass:["card-name"]},[e._v(e._s(e.name))]),r("div",{staticClass:["share-contents"]},[r("image",{staticClass:["icon-share"],attrs:{src:"http://img1.vued.vanthink.cn/vued823de5c04e0cc944dede20370bee354d.png"}}),r("text",{staticClass:["share-count"]},[e._v(e._s(e.shareCount))])])])])},staticRenderFns:[]},e.exports.render._withStripped=!0},53:function(e,t,r){var n,o,s=[];s.push(r(16)),n=r(12);var a=r(19);o=n=n||{},"object"!=typeof n.default&&"function"!=typeof n.default||(Object.keys(n).some(function(e){return"default"!==e&&"__esModule"!==e})&&console.error("named exports are not supported in *.vue files."),o=n=n.default),"function"==typeof o&&(o=o.options),o.__file="/Users/ali-130257n/www/weex-app-start-kit/src/components/card-item.vue",o.render=a.render,o.staticRenderFns=a.staticRenderFns,o.style=o.style||{},s.forEach(function(e){for(var t in e)o.style[t]=e[t]}),e.exports=n,e.exports.el="true",new Vue(e.exports)}}); -------------------------------------------------------------------------------- /dist/components/video-list.js: -------------------------------------------------------------------------------- 1 | // { "framework": "Vue"} 2 | 3 | !function(e){function t(o){if(i[o])return i[o].exports;var r=i[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var i={};t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,i,o){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=55)}({13:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{items:{default:[]}}}},17:function(e,t){e.exports={"video-list":{position:"relative",borderTop:"1px solid rgba(0,0,0,.2)"},"video-list-item":{padding:20,borderBottom:"1px solid rgba(0,0,0,.3)"},"video-item-main":{flexDirection:"row"},"video-item-cover":{width:220,height:120},"video-item-desc":{flexDirection:"column",marginLeft:40},"video-upload-info":{marginTop:20,flexDirection:"row"},"icon-upload":{width:36,height:36},"video-upload-date":{marginLeft:20,fontSize:24,color:"#777777"},"video-item-ft":{flexDirection:"row",marginTop:20},"video-item-producer":{flex:.6,flexDirection:"row"},"producer-avatar":{width:36,height:36},"producer-name":{marginLeft:20,fontSize:24,color:"#888888"},"video-item-social":{flex:.4,flexDirection:"row",alignItems:"center"},"social-number":{color:"#444444",fontSize:24},"scial-label":{marginLeft:5,color:"#999999",fontSize:20}}},20:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:["video-list"]},e._l(e.items,function(t){return i("div",{staticClass:["video-list-item"]},[i("div",{staticClass:["video-item-main"]},[i("image",{staticClass:["video-item-cover"],attrs:{src:t.cover}}),i("div",{staticClass:["video-item-desc"]},[i("text",{staticClass:["video-name"]},[e._v(e._s(t.title))]),i("div",{staticClass:["video-upload-info"]},[i("image",{staticClass:["icon-upload"],attrs:{src:"http://img1.vued.vanthink.cn/vued5f365239dd87f0d91e314ab96d40e669.png"}}),i("text",{staticClass:["video-upload-date"]},[e._v(e._s(t.upload_date))])])])]),i("div",{staticClass:["video-item-ft"]},[i("div",{staticClass:["video-item-producer"]},[i("image",{staticClass:["producer-avatar"],attrs:{src:t.producer.avatar}}),i("text",{staticClass:["producer-name"]},[e._v(e._s(t.producer.username))])]),i("div",{staticClass:["video-item-social"]},[i("text",{staticClass:["social-number"]},[e._v(e._s(t.views))]),i("text",{staticClass:["scial-label"]},[e._v("Views")]),i("text",{staticClass:["social-number"],staticStyle:{marginLeft:"10px"}},[e._v(e._s(t.comments))]),i("text",{staticClass:["scial-label"]},[e._v("Comments")])])])])}))},staticRenderFns:[]},e.exports.render._withStripped=!0},55:function(e,t,i){var o,r,s=[];s.push(i(17)),o=i(13);var a=i(20);r=o=o||{},"object"!=typeof o.default&&"function"!=typeof o.default||(Object.keys(o).some(function(e){return"default"!==e&&"__esModule"!==e})&&console.error("named exports are not supported in *.vue files."),r=o=o.default),"function"==typeof r&&(r=r.options),r.__file="/Users/ali-130257n/www/weex-app-start-kit/src/components/video-list.vue",r.render=a.render,r.staticRenderFns=a.staticRenderFns,r.style=r.style||{},s.forEach(function(e){for(var t in e)r.style[t]=e[t]}),e.exports=o,e.exports.el="true",new Vue(e.exports)}}); -------------------------------------------------------------------------------- /dist/home.js: -------------------------------------------------------------------------------- 1 | !function(n){function r(e){if(t[e])return t[e].exports;var o=t[e]={i:e,l:!1,exports:{}};return n[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var t={};return r.m=n,r.c=t,r.i=function(n){return n},r.d=function(n,t,e){r.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:e})},r.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(t,"a",t),t},r.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},r.p="",r(r.s=0)}([function(n,r,t){"use strict";console.log(90)}]); -------------------------------------------------------------------------------- /hooks/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/hooks/README.md -------------------------------------------------------------------------------- /ios.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "AppName":"WeexApp", 3 | "Version":"0.1", 4 | "BuildVersion":"0.1.0", 5 | "AppId":"", 6 | "CodeSign":"", 7 | "Profile":"", 8 | "WeexBundle":"index.js" 9 | } 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "weex-app-seed", 3 | "version": "0.0.2", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "build": "webpack --color", 9 | "build_plugin": "webpack --config ./tools/webpack.config.plugin.js --color", 10 | "dev": "webpack --watch", 11 | "serve": "webpack-dev-server --config webpack.dev.js -p --open" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git+https://github.com/weex-plugins/weex-app-start-kit.git" 16 | }, 17 | "author": "", 18 | "license": "ISC", 19 | "bugs": { 20 | "url": "https://github.com/weex-plugins/weex-app-start-kit/issues" 21 | }, 22 | "homepage": "https://github.com/weex-plugins/weex-app-start-kit#readme", 23 | "dependencies": { 24 | "vue": "^2.2.1", 25 | "vue-router": "^2.3.0", 26 | "vuex": "^2.2.1", 27 | "vuex-router-sync": "^4.1.2", 28 | "weex-vue-render": "^0.11.5" 29 | }, 30 | "devDependencies": { 31 | "babel-eslint": "^7.1.1", 32 | "banner-webpack-plugin": "^0.2.3", 33 | "chalk": "^1.1.3", 34 | "css-loader": "^0.26.2", 35 | "eslint": "^3.14.0", 36 | "eslint-config-airbnb": "^14.0.0", 37 | "eslint-config-airbnb-base": "^11.0.1", 38 | "eslint-config-standard": "^6.2.1", 39 | "eslint-plugin-html": "^1.7.0", 40 | "eslint-plugin-import": "^2.2.0", 41 | "eslint-plugin-jsx-a11y": "^3.0.2", 42 | "eslint-plugin-promise": "^3.4.0", 43 | "eslint-plugin-react": "^6.9.0", 44 | "eslint-plugin-standard": "^2.0.1", 45 | "fs-extra": "^2.0.0", 46 | "ip": "^1.1.4", 47 | "jasmine": "^2.5.3", 48 | "karma": "^1.4.0", 49 | "karma-chrome-launcher": "^2.0.0", 50 | "karma-jasmine": "^1.1.0", 51 | "serve": "^4.0.1", 52 | "vue-loader": "^11.1.3", 53 | "vue-template-compiler": "^2.2.1", 54 | "webpack": "^2.3.3", 55 | "webpack-dev-middleware": "^1.10.1", 56 | "webpack-dev-server": "^2.4.1", 57 | "weex-devtool": "^0.2.78", 58 | "weex-loader": "^0.4.4", 59 | "weex-vue-loader": "^0.2.11" 60 | }, 61 | "engines": { 62 | "node": ">=7.0.0", 63 | "npm": "~3.3.6" 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /plugins/README.md: -------------------------------------------------------------------------------- 1 | # use weexpack add plugin 2 | 3 | #### add a plugin 4 | 5 | ``` bash 6 | weexpack plugin add plugin_name 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /plugins/fetch.json: -------------------------------------------------------------------------------- 1 | { 2 | "weex-amap": { 3 | "source": { 4 | "type": "local", 5 | "path": "../weex-amap" 6 | }, 7 | "is_top_level": true, 8 | "variables": {} 9 | } 10 | } -------------------------------------------------------------------------------- /plugins/weex-amap/RELEASENOTES.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/RELEASENOTES.md -------------------------------------------------------------------------------- /plugins/weex-amap/android/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .DS_Store 3 | build/ 4 | -------------------------------------------------------------------------------- /plugins/weex-amap/android/apply_android_dev.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | cd dev 3 | git apply ../patch/dev_amap.patch -------------------------------------------------------------------------------- /plugins/weex-amap/android/patch/dev_amap.patch: -------------------------------------------------------------------------------- 1 | diff --git a/app/build.gradle b/app/build.gradle 2 | index f9fe6ed..19a7b0e 100755 3 | --- a/app/build.gradle 4 | +++ b/app/build.gradle 5 | @@ -85,7 +85,7 @@ dependencies { 6 | compile 'com.taobao.android:weex_sdk:0.9.4' 7 | compile project(':appframework') 8 | compile project(':weexplugin') 9 | -// compile project(':plugin') 10 | + compile project(':plugin') 11 | compile 'com.google.code.findbugs:jsr305:2.0.1' 12 | compile 'com.squareup.okhttp:okhttp:2.3.0' 13 | compile 'com.squareup.okhttp:okhttp-ws:2.3.0' 14 | diff --git a/settings.gradle b/settings.gradle 15 | index 827f265..d91d926 100755 16 | --- a/settings.gradle 17 | +++ b/settings.gradle 18 | @@ -1,8 +1,8 @@ 19 | include ':app' 20 | include ':weexplugin' 21 | include ":appframework" 22 | -//include ":plugin" 23 | -//project(":plugin").projectDir=new File("../plugin") 24 | +include ":plugin" 25 | +project(":plugin").projectDir=new File("../plugin") 26 | 27 | //include ":inspector" 28 | //project(":inspector").projectDir=new File("../inspector") 29 | diff --git a/weexplugin/src/main/res/xml/config.xml b/weexplugin/src/main/res/xml/config.xml 30 | index df0560c..4c8cd86 100644 31 | --- a/weexplugin/src/main/res/xml/config.xml 32 | +++ b/weexplugin/src/main/res/xml/config.xml 33 | @@ -39,4 +39,19 @@ 34 | 35 | 36 | 37 | + 38 | + 39 | + 40 | + 41 | + 42 | + 43 | + 44 | + 45 | + 46 | + 47 | + 48 | + 49 | + 50 | + 51 | + 52 | 53 | -------------------------------------------------------------------------------- /plugins/weex-amap/android/plugin/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | build 3 | .idea/ -------------------------------------------------------------------------------- /plugins/weex-amap/android/plugin/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | maven { url "http://mvnrepo.alibaba-inc.com/mvn/repository" } 4 | maven { url "http://mvnrepo.alibaba-inc.com/mvn/snapshots" } 5 | mavenCentral() 6 | jcenter() 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:2.1.2' 10 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0' 11 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | maven { url "http://mvnrepo.alibaba-inc.com/mvn/repository" } 18 | maven { url "http://mvnrepo.alibaba-inc.com/mvn/snapshots" } 19 | mavenCentral() 20 | jcenter() 21 | } 22 | } 23 | 24 | apply plugin: 'com.android.library' 25 | apply plugin: 'com.jfrog.bintray' 26 | apply plugin: 'com.github.dcendents.android-maven' 27 | 28 | android { 29 | compileSdkVersion 23 30 | buildToolsVersion "23.0.2" 31 | 32 | defaultConfig { 33 | minSdkVersion 14 34 | targetSdkVersion 23 35 | versionCode 1 36 | versionName "1.0" 37 | 38 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 39 | 40 | } 41 | buildTypes { 42 | release { 43 | minifyEnabled false 44 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 45 | } 46 | } 47 | compileOptions { 48 | sourceCompatibility JavaVersion.VERSION_1_7 49 | targetCompatibility JavaVersion.VERSION_1_7 50 | } 51 | } 52 | 53 | dependencies { 54 | compile fileTree(include: ['*.jar'], dir: 'libs') 55 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 56 | exclude group: 'com.android.support', module: 'support-annotations' 57 | }) 58 | compile 'com.android.support:appcompat-v7:23.1.1' 59 | compile 'com.taobao.android:weex_sdk:0.9.4' 60 | compile 'com.amap.api:map3d-native:latest.integration' 61 | compile 'com.amap.api:map3d:latest.integration' 62 | compile 'com.amap.api:location:latest.integration' 63 | } 64 | -------------------------------------------------------------------------------- /plugins/weex-amap/android/plugin/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/aoxiao/Develop/android-sdk-macosx/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /plugins/weex-amap/android/plugin/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /plugins/weex-amap/android/plugin/src/main/java/com/alibaba/weex/amap/module/WXMapModule.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.amap.module; 2 | 3 | import android.support.annotation.Nullable; 4 | 5 | import com.amap.api.location.AMapLocation; 6 | import com.amap.api.location.AMapLocationClient; 7 | import com.amap.api.location.AMapLocationClientOption; 8 | import com.amap.api.location.AMapLocationListener; 9 | import com.taobao.weex.WXEnvironment; 10 | import com.taobao.weex.bridge.JSCallback; 11 | import com.taobao.weex.common.WXModule; 12 | import com.taobao.weex.common.WXModuleAnno; 13 | import com.taobao.weex.utils.WXLogUtils; 14 | 15 | import java.util.ArrayList; 16 | import java.util.HashMap; 17 | 18 | /** 19 | * Created by budao on 2017/1/24. 20 | */ 21 | 22 | public class WXMapModule extends WXModule { 23 | private static final String RESULT = "result"; 24 | private static final String DATA = "data"; 25 | 26 | private static final String RESULT_OK = "success"; 27 | private static final String RESULT_FAILED = "failed"; 28 | 29 | 30 | /** 31 | * get user location. 32 | */ 33 | @WXModuleAnno 34 | public void getUserLocation(String id, @Nullable final JSCallback callback) { 35 | final AMapLocationClient client = new AMapLocationClient( 36 | WXEnvironment.getApplication().getApplicationContext()); 37 | final AMapLocationClientOption clientOption = new AMapLocationClientOption(); 38 | //设置定位监听 39 | client.setLocationListener(new AMapLocationListener() { 40 | public void onLocationChanged(AMapLocation aMapLocation) { 41 | if (aMapLocation != null && aMapLocation.getErrorCode() == 0) { 42 | HashMap map = new HashMap(2); 43 | if (callback != null) { 44 | HashMap data = new HashMap(1); 45 | ArrayList position = new ArrayList(); 46 | position.add(aMapLocation.getLongitude()); 47 | position.add(aMapLocation.getLatitude()); 48 | data.put("position", position); 49 | map.put(DATA, data); 50 | map.put(RESULT, aMapLocation.getLongitude() > 0 && aMapLocation.getLatitude() > 0 ? RESULT_OK : RESULT_FAILED); 51 | callback.invoke(map); 52 | } 53 | } else { 54 | String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo(); 55 | WXLogUtils.e("WXMapModule", errText); 56 | } 57 | if (client != null) { 58 | client.stopLocation(); 59 | client.onDestroy(); 60 | } 61 | } 62 | }); 63 | //设置为高精度定位模式 64 | clientOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy); 65 | clientOption.setOnceLocation(true); 66 | //设置定位参数 67 | client.setLocationOption(clientOption); 68 | // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗, 69 | // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求 70 | // 在定位结束后,在合适的生命周期调用onDestroy()方法 71 | // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除 72 | client.startLocation(); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /plugins/weex-amap/android/plugin/src/main/java/com/alibaba/weex/amap/util/Constant.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.amap.util; 2 | 3 | /** 4 | * Created by aoxiao on 2017/1/4. 5 | */ 6 | 7 | public class Constant { 8 | 9 | public static interface Value { 10 | int SCROLLGESTURE = 0x1; 11 | int ZOOMGESTURE = 0x1 << 1; 12 | int TILTGESTURE = 0x1 << 2; 13 | int ROTATEGESTURE = 0x1 << 3; 14 | } 15 | 16 | public static interface Name { 17 | 18 | // mapview 19 | String SCALECONTROL = "scale"; 20 | String ZOOM_ENABLE = "zoomEnable"; 21 | String ZOOM = "zoom"; 22 | String COMPASS = "compass"; 23 | String GEOLOCATION = "geolocation"; 24 | String GESTURE = "gesture"; 25 | String INDOORSWITCH = "indoorswitch"; 26 | String CENTER = "center"; 27 | String KEYS = "sdkKey"; 28 | 29 | // marker 30 | String MARKER = "marker"; 31 | String POSITION = "position"; 32 | String ICON = "icon"; 33 | String TITLE = "title"; 34 | } 35 | 36 | public static interface EVENT { 37 | String ZOOM_CHANGE = "zoomchange"; 38 | String DRAG_CHANGE = "dragend"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /plugins/weex-amap/android/plugin/src/main/java/com/alibaba/weex/amap/util/Utils.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.weex.amap.util; 2 | 3 | import java.io.FileInputStream; 4 | import java.io.IOException; 5 | 6 | /** 7 | * Created by budao on 2017/2/10. 8 | */ 9 | 10 | public class Utils { 11 | public static boolean isGif(String file) { 12 | FileInputStream imgFile = null; 13 | try { 14 | imgFile = new FileInputStream(file); 15 | byte[] header = new byte[3]; 16 | int length = imgFile.read(header); 17 | return length == 3 && header[0] == (byte) 'G' && header[1] == (byte) 'I' && header[2] == (byte) 'F'; 18 | } catch (Exception e) { 19 | // ignore 20 | } finally { 21 | if (imgFile != null) { 22 | try { 23 | imgFile.close(); 24 | } catch (IOException e) { 25 | e.printStackTrace(); 26 | } 27 | } 28 | } 29 | 30 | return false; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /plugins/weex-amap/android/plugin/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | amap_weex_plugin 3 | 4 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/include/example-list-item.we: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{keyword}} 7 | {{desc}} 8 | 9 | 10 | 查看详情 11 | 12 | 13 | 14 | 15 | 16 | 17 | 73 | 74 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/include/example-list.we: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 79 | 80 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/include/navbar.we: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 返回 6 | 7 | {{title}} 8 | 9 | 10 | 46 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/include/page.style.css: -------------------------------------------------------------------------------- 1 | .container{ 2 | position: relative; 3 | flex:1; 4 | background-color: #fff; 5 | } 6 | .map{ 7 | flex: 1; 8 | position: relative; 9 | background-color: #fff; 10 | min-height: 800; 11 | border-bottom-width: 10; 12 | border-bottom-color: #fff; 13 | } 14 | .map-control{ 15 | padding-top: 20; 16 | min-height: 600; 17 | } 18 | .title{ 19 | margin-left: 20; 20 | padding-left: 20; 21 | padding-top: 10; 22 | padding-bottom: 10; 23 | font-size: 36px; 24 | border-left-width: 6; 25 | border-left-color: #0f89f5; 26 | color: #222; 27 | text-align: left; 28 | } 29 | .tips{ 30 | margin: 20; 31 | padding: 10; 32 | color:#666; 33 | font-size: 20px; 34 | } 35 | .btn{ 36 | margin: 20; 37 | padding: 20; 38 | background-color: #1ba1e2; 39 | border-radius: 5; 40 | color: #fff; 41 | text-align:center; 42 | cursor: pointer; 43 | font-size: 28px; 44 | } -------------------------------------------------------------------------------- /plugins/weex-amap/demos/index.we: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | WEEX-AMAP DEMOS 9 | 10 | 11 | 12 | 13 | 14 | 51 | 52 | 104 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/pages/center.we: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Props: center 8 | center属性表示地图中心点坐标值,你可以设置它来改变地图的位置,比如洁面显示的[116.487, 40.00003]为中心的地图 9 | Set Center 10 | 11 | 12 | 13 | 14 | 60 | 61 | 88 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/pages/geolocation.we: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Methods: getUserLocation 8 | getUserLocation 你可以通过调用该方法来进行用户当前位置的定位 9 | 定位到当前位置 10 | 用户的当前坐标为: {{pos}} 11 | 12 | 13 | 14 | 15 | 61 | 62 | 94 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/pages/init.we: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Props: weex-amap 8 | center属性表示地图中心点坐标值,你可以设置它来改变地图的位置,比如洁面显示的[116.487, 40.00003]为中心的地图 9 | Set Center 10 | 11 | 12 | 13 | 14 | 60 | 61 | 88 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/pages/zoom.we: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Props: zoom 8 | zoom 表示地图显示的缩放级别;zoomchange可以绑定缩放完后的事件;zoom-enable表示地图是否允许缩放 9 | 10 | 放大 11 | 缩小 12 | 13 | 14 | 15 | 16 | 17 | 77 | 78 | 117 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/vue/include/example-list-item.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{keyword}} 7 | {{desc}} 8 | 9 | 10 | 查看详情 11 | 12 | 13 | 14 | 15 | 16 | 72 | 73 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/vue/include/example-list.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 72 | 73 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/vue/include/navbar.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 返回 6 | 7 | {{title}} 8 | 9 | 10 | 47 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/vue/include/panel.vue: -------------------------------------------------------------------------------- 1 | 2 | 5 | {{title}} 13 | 21 | 22 | 23 | 24 | 25 | 26 | 38 | 39 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/vue/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | WEEX-AMAP DEMOS 9 | 10 | 11 | 12 | 13 | 14 | 51 | 52 | 109 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/vue/input.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | oninput: {{txtInput}} 13 | onchange: {{txtChange}} 14 | 15 | 16 | 17 | 18 | 25 | 26 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/vue/pages/center.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Props: center 8 | center属性表示地图中心点坐标值,你可以设置它来改变地图的位置,比如洁面显示的[116.487, 40.00003]为中心的地图 9 | Set Center 10 | 11 | 12 | 13 | 14 | 61 | 62 | 93 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/vue/pages/geolocation.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Methods: getUserLocation 8 | getUserLocation 你可以通过调用该方法来进行用户当前位置的定位 9 | 定位到当前位置 10 | 用户的当前坐标为: {{pos}} 11 | 12 | 13 | 14 | 15 | 61 | 62 | 103 | -------------------------------------------------------------------------------- /plugins/weex-amap/demos/vue/pages/init.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Props: weex-amap 8 | center属性表示地图中心点坐标值,你可以设置它来改变地图的位置,比如洁面显示的[116.487, 40.00003]为中心的地图 9 | Set Center 10 | 11 | 12 | 13 | 14 | 61 | 62 | 92 | -------------------------------------------------------------------------------- /plugins/weex-amap/doc/es/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/doc/es/README.md -------------------------------------------------------------------------------- /plugins/weex-amap/doc/es/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/doc/es/index.md -------------------------------------------------------------------------------- /plugins/weex-amap/doc/zh/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/doc/zh/README.md -------------------------------------------------------------------------------- /plugins/weex-amap/doc/zh/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/doc/zh/index.md -------------------------------------------------------------------------------- /plugins/weex-amap/ios/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/objective-c 2 | 3 | ### Objective-C ### 4 | # Xcode 5 | # 6 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 7 | 8 | ## Build generated 9 | build/ 10 | _demo/ 11 | DerivedData 12 | 13 | ## Various settings 14 | *.pbxuser 15 | !default.pbxuser 16 | *.mode1v3 17 | !default.mode1v3 18 | *.mode2v3 19 | !default.mode2v3 20 | *.perspectivev3 21 | !default.perspectivev3 22 | xcuserdata 23 | 24 | ## Other 25 | *.xccheckout 26 | *.moved-aside 27 | *.xcuserstate 28 | *.xcscmblueprint 29 | 30 | ## Obj-C/Swift specific 31 | *.hmap 32 | *.ipa 33 | 34 | # CocoaPods 35 | # 36 | # We recommend against adding the Pods directory to your .gitignore. However 37 | # you should judge for yourself, the pros and cons are mentioned at: 38 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 39 | # 40 | Pods/ 41 | Podfile.lock 42 | 43 | # Carthage 44 | # 45 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 46 | # Carthage/Checkouts 47 | 48 | Carthage/Build 49 | 50 | # fastlane 51 | # 52 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 53 | # screenshots whenever they are needed. 54 | # For more information about the recommended setup visit: 55 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 56 | 57 | fastlane/report.xml 58 | fastlane/screenshots 59 | 60 | ### Objective-C Patch ### 61 | *.xcscmblueprint 62 | 63 | 64 | # Created by https://www.gitignore.io/api/node 65 | 66 | *.gcno 67 | 68 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Podfile: -------------------------------------------------------------------------------- 1 | source 'git@github.com/CocoaPods/Specs.git' 2 | platform :ios, '7.0' 3 | #inhibit_all_warnings! 4 | 5 | def common 6 | pod 'WeexSDK' 7 | pod 'Weexplugin', :path=>'./Weexplugin/' 8 | pod 'WXDevtool' 9 | pod 'SDWebImage', '3.7.5' 10 | pod 'SocketRocket', '0.4.2' 11 | pod 'ATSDK-Weex', '0.0.1' 12 | end 13 | 14 | target 'WeexDemo' do 15 | common 16 | end 17 | 18 | target 'WeexUITestDemo' do 19 | common 20 | end 21 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/README.md -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | @property (strong, nonatomic) NSString *latestVer; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "size" : "29x29", 15 | "idiom" : "iphone", 16 | "filename" : "Icon-29@2x.png", 17 | "scale" : "2x" 18 | }, 19 | { 20 | "size" : "29x29", 21 | "idiom" : "iphone", 22 | "filename" : "Icon-29@3x.png", 23 | "scale" : "3x" 24 | }, 25 | { 26 | "size" : "40x40", 27 | "idiom" : "iphone", 28 | "filename" : "Icon-40@2x-1.png", 29 | "scale" : "2x" 30 | }, 31 | { 32 | "size" : "40x40", 33 | "idiom" : "iphone", 34 | "filename" : "Icon-40@3x.png", 35 | "scale" : "3x" 36 | }, 37 | { 38 | "size" : "60x60", 39 | "idiom" : "iphone", 40 | "filename" : "Icon-60@2x.png", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "size" : "60x60", 45 | "idiom" : "iphone", 46 | "filename" : "Icon-60@3x.png", 47 | "scale" : "3x" 48 | }, 49 | { 50 | "idiom" : "ipad", 51 | "size" : "20x20", 52 | "scale" : "1x" 53 | }, 54 | { 55 | "idiom" : "ipad", 56 | "size" : "20x20", 57 | "scale" : "2x" 58 | }, 59 | { 60 | "size" : "29x29", 61 | "idiom" : "ipad", 62 | "filename" : "Icon-29.png", 63 | "scale" : "1x" 64 | }, 65 | { 66 | "size" : "29x29", 67 | "idiom" : "ipad", 68 | "filename" : "Icon-29@2x-1.png", 69 | "scale" : "2x" 70 | }, 71 | { 72 | "size" : "40x40", 73 | "idiom" : "ipad", 74 | "filename" : "Icon-40.png", 75 | "scale" : "1x" 76 | }, 77 | { 78 | "size" : "40x40", 79 | "idiom" : "ipad", 80 | "filename" : "Icon-40@2x.png", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "size" : "76x76", 85 | "idiom" : "ipad", 86 | "filename" : "Icon-76.png", 87 | "scale" : "1x" 88 | }, 89 | { 90 | "size" : "76x76", 91 | "idiom" : "ipad", 92 | "filename" : "Icon-76@2x.png", 93 | "scale" : "2x" 94 | }, 95 | { 96 | "size" : "83.5x83.5", 97 | "idiom" : "ipad", 98 | "filename" : "Icon-83.5@2x.png", 99 | "scale" : "2x" 100 | } 101 | ], 102 | "info" : { 103 | "version" : 1, 104 | "author" : "xcode" 105 | } 106 | } -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29@2x-1.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@2x-1.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default-4.7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default-4.7@2x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x-1.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@2x-1.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@3x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@3x-1.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/LaunchImage.launchimage/Default@3x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/back.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "back.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "back@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "back@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/back.imageset/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/back.imageset/back.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/back.imageset/back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/back.imageset/back@2x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/back.imageset/back@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/back.imageset/back@3x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/reload.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "reload.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "reload@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "reload@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/reload.imageset/reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/reload.imageset/reload.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/reload.imageset/reload@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/reload.imageset/reload@2x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/reload.imageset/reload@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/reload.imageset/reload@3x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/scan.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "scan.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "scan@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "scan@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/scan.imageset/scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/scan.imageset/scan.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/scan.imageset/scan@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/scan.imageset/scan@2x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Assets.xcassets/scan.imageset/scan@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/Assets.xcassets/scan.imageset/scan@3x.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/DemoDefine.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | 11 | #define CURRENT_IP @"your computer device ip" 12 | 13 | #if TARGET_IPHONE_SIMULATOR 14 | #define DEMO_HOST @"127.0.0.1" 15 | #else 16 | #define DEMO_HOST CURRENT_IP 17 | #endif 18 | 19 | #define DEMO_URL(path) [NSString stringWithFormat:@"http://%@:12580/%s", DEMO_HOST, #path] 20 | 21 | #define HOME_URL [NSString stringWithFormat:@"http://%@:8080/dist/index.js", DEMO_HOST] 22 | 23 | #define BUNDLE_URL [NSString stringWithFormat:@"file://%@/bundlejs/index.js",[NSBundle mainBundle].bundlePath] 24 | 25 | #define UITEST_HOME_URL @"http://test?_wx_tpl=http://localhost:12580/test/build/TC__Home.js" 26 | 27 | #define QRSCAN @"com.taobao.WeexDemo.scan" 28 | #define WEEX_COLOR [UIColor colorWithRed:0.27 green:0.71 blue:0.94 alpha:1] 29 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/Images.xcassets/Brand Assets.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "minimum-system-version" : "7.0", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "orientation" : "portrait", 11 | "idiom" : "iphone", 12 | "minimum-system-version" : "7.0", 13 | "subtype" : "retina4", 14 | "scale" : "2x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/WeexConfig/WeexBundleUrlLoder.h: -------------------------------------------------------------------------------- 1 | // 2 | // WeexPlugin.h 3 | // WeexDemo 4 | // 5 | // Created by yangshengtao on 16/11/15. 6 | // Copyright © 2016年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WeexBundleUrlLoder : NSObject 12 | 13 | @property (nonatomic, readonly, copy) NSString* configFile; 14 | 15 | 16 | - (NSURL *)jsBundleURL; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/WeexConfig/WeexConfigParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // WeexConfigParser.h 3 | // WeexDemo 4 | // 5 | // Created by yangshengtao on 16/11/15. 6 | // Copyright © 2016年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WeexConfigParser : NSObject 12 | { 13 | NSString* featureName; 14 | } 15 | 16 | @property (nonatomic, readonly, strong) NSMutableDictionary* pluginsDict; 17 | @property (nonatomic, readonly, strong) NSMutableDictionary* settings; 18 | @property (nonatomic, readonly, strong) NSMutableArray* pluginNames; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/WeexConfig/WeexConfigParser.m: -------------------------------------------------------------------------------- 1 | // 2 | // WeexConfigParser.m 3 | // WeexDemo 4 | // 5 | // Created by yangshengtao on 16/11/15. 6 | // Copyright © 2016年 taobao. All rights reserved. 7 | // 8 | 9 | #import "WeexConfigParser.h" 10 | @interface WeexConfigParser () 11 | 12 | @property (nonatomic, readwrite, strong) NSMutableDictionary* pluginsDict; 13 | @property (nonatomic, readwrite, strong) NSMutableDictionary* settings; 14 | @property (nonatomic, readwrite, strong) NSMutableArray* pluginNames; 15 | 16 | @end 17 | 18 | @implementation WeexConfigParser 19 | 20 | @synthesize pluginsDict, settings, pluginNames; 21 | - (id)init 22 | { 23 | self = [super init]; 24 | if (self != nil) { 25 | self.pluginsDict = [[NSMutableDictionary alloc] initWithCapacity:30]; 26 | self.settings = [[NSMutableDictionary alloc] initWithCapacity:30]; 27 | self.pluginNames = [[NSMutableArray alloc] initWithCapacity:8]; 28 | featureName = nil; 29 | } 30 | return self; 31 | } 32 | 33 | - (void)parser:(NSXMLParser*)parser didStartElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName attributes:(NSDictionary*)attributeDict 34 | { 35 | if ([elementName isEqualToString:@"preference"]) { 36 | settings[[attributeDict[@"name"] lowercaseString]] = attributeDict[@"value"]; 37 | } else if ([elementName isEqualToString:@"feature"]) { // store feature name to use with correct parameter set 38 | featureName = [attributeDict[@"name"] lowercaseString]; 39 | pluginsDict[@"name"] = featureName; 40 | } else if ((featureName != nil) && [elementName isEqualToString:@"param"]) { 41 | NSString* paramName = [attributeDict[@"name"] lowercaseString]; 42 | id value = attributeDict[@"value"]; 43 | pluginsDict[paramName] = value; 44 | } 45 | } 46 | 47 | - (void)parser:(NSXMLParser*)parser didEndElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName 48 | { 49 | if ([elementName isEqualToString:@"feature"]) { // no longer handling a feature so release 50 | NSDictionary *dic = [NSDictionary dictionaryWithDictionary:pluginsDict]; 51 | [self.pluginNames addObject:dic]; 52 | featureName = nil; 53 | [pluginsDict removeAllObjects]; 54 | } 55 | } 56 | 57 | - (void)parser:(NSXMLParser*)parser parseErrorOccurred:(NSError*)parseError 58 | { 59 | NSAssert(NO, @"config.xml parse error line %ld col %ld", (long)[parser lineNumber], (long)[parser columnNumber]); 60 | } 61 | 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/WeexConfig/WeexSDKManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // WeexSDKManager.h 3 | // WeexDemo 4 | // 5 | // Created by yangshengtao on 16/11/14. 6 | // Copyright © 2016年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WeexSDKManager : NSObject 12 | 13 | + (void)setup; 14 | 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/WeexConfig/WeexSDKManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // WeexSDKManager.m 3 | // WeexDemo 4 | // 5 | // Created by yangshengtao on 16/11/14. 6 | // Copyright © 2016年 taobao. All rights reserved. 7 | // 8 | 9 | #import "WeexSDKManager.h" 10 | #import "DemoDefine.h" 11 | #import "WeexBundleUrlLoder.h" 12 | #import 13 | #import "WXDemoViewController.h" 14 | #import "WeexPluginManager.h" 15 | 16 | @implementation WeexSDKManager 17 | 18 | + (void)setup; 19 | { 20 | NSURL *url = nil; 21 | WeexBundleUrlLoder *loader = [WeexBundleUrlLoder new]; 22 | #if DEBUG 23 | //If you are debugging in device , please change the host to current IP of your computer. 24 | url = [loader jsBundleURL]; 25 | if (!url) { 26 | url = [NSURL URLWithString:BUNDLE_URL]; 27 | } 28 | #else 29 | url = [NSURL URLWithString:BUNDLE_URL]; 30 | #endif 31 | 32 | #ifdef UITEST 33 | url = [NSURL URLWithString:UITEST_HOME_URL]; 34 | #endif 35 | 36 | [self initWeexSDK]; 37 | [WeexPluginManager registerWeexPlugin]; 38 | [self loadCustomContainWithScannerWithUrl:url]; 39 | } 40 | 41 | + (void)initWeexSDK 42 | { 43 | [WXAppConfiguration setAppGroup:@"AliApp"]; 44 | [WXAppConfiguration setAppName:@"WeexDemo"]; 45 | [WXAppConfiguration setAppVersion:@"1.8.3"]; 46 | [WXAppConfiguration setExternalUserAgent:@"ExternalUA"]; 47 | 48 | [WXSDKEngine initSDKEnvironment]; 49 | 50 | #ifdef DEBUG 51 | [WXLog setLogLevel:WXLogLevelLog]; 52 | #endif 53 | } 54 | 55 | + (void)loadCustomContainWithScannerWithUrl:(NSURL *)url 56 | { 57 | UIViewController *demo = [[WXDemoViewController alloc] init]; 58 | ((WXDemoViewController *)demo).url = url; 59 | [[UIApplication sharedApplication] delegate].window.rootViewController = [[WXRootViewController alloc] initWithRootViewController:demo]; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/WeexDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | WeexApp 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | com.taobao.yangtao 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 0.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 0.1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | 32 | UIApplicationShortcutItems 33 | 34 | 35 | UIApplicationShortcutItemIconFile 36 | scan 37 | UIApplicationShortcutItemSubtitle 38 | scan your QR code 39 | UIApplicationShortcutItemTitle 40 | Scan QR 41 | UIApplicationShortcutItemType 42 | com.taobao.WeexDemo.scan 43 | 44 | 45 | UIRequiredDeviceCapabilities 46 | 47 | armv7 48 | 49 | UIStatusBarStyle 50 | UIStatusBarStyleLightContent 51 | UISupportedInterfaceOrientations 52 | 53 | UIInterfaceOrientationPortrait 54 | 55 | UISupportedInterfaceOrientations~ipad 56 | 57 | UIInterfaceOrientationPortrait 58 | UIInterfaceOrientationPortraitUpsideDown 59 | UIInterfaceOrientationLandscapeLeft 60 | UIInterfaceOrientationLandscapeRight 61 | 62 | UIViewControllerBasedStatusBarAppearance 63 | 64 | NSCameraUsageDescription 65 | 66 | NSPhotoLibraryUsageDescription 67 | 68 | NSLocationWhenInUseUsageDescription 69 | 70 | 71 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/WeexScanner/UIViewController+WXDemoNaviBar.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import "DemoDefine.h" 11 | 12 | @interface UIViewController (WXDemoNaviBar) 13 | 14 | /** 15 | * back button click action 16 | * @param sender responder 17 | */ 18 | - (void)backButtonClicked:(id)sender; 19 | 20 | - (void)setupNaviBar; 21 | 22 | @end 23 | 24 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/WeexScanner/WXDemoViewController.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import 11 | 12 | @interface WXDemoViewController : UIViewController 13 | 14 | @property (nonatomic, strong) NSString *script; 15 | @property (nonatomic, strong) NSURL *url; 16 | 17 | @property (nonatomic, strong) SRWebSocket *hotReloadSocket; 18 | @property (nonatomic, strong) NSString *source; 19 | 20 | @end 21 | 22 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/WeexScanner/WXScannerVC.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import 11 | 12 | @interface WXScannerVC : UIViewController 13 | 14 | @end -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | WeexDemo 4 | 5 | A sample Weex application that responds to the deviceready event. 6 | 7 | 8 | Weex Team 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemo/weex-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/WeexDemo/weex-icon.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexDemoTests/WeexDemoTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | 11 | @interface WeexDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation WeexDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexUITestDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UIStatusBarStyle 37 | UIStatusBarStyleLightContent 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UIViewControllerBasedStatusBarAppearance 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexUITestDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/WeexUITestDemoUITests/WeexUITestDemoUITests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Weex. 3 | * Copyright (c) 2016, Alibaba, Inc. All rights reserved. 4 | * 5 | * This source code is licensed under the Apache Licence 2.0. 6 | * For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | #import 10 | 11 | @interface WeexUITestDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation WeexUITestDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Podfile: -------------------------------------------------------------------------------- 1 | source 'git@github.com/CocoaPods/Specs.git' 2 | platform :ios, '7.0' 3 | # inhibit_all_warnings! 4 | def common 5 | pod 'WeexSDK' 6 | pod 'AMap3DMap' 7 | end 8 | target 'Weexplugin' do 9 | common 10 | end 11 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin.podspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | Pod::Spec.new do |s| 4 | s.name = "Weexplugin" 5 | s.version = "0.0.1" 6 | s.summary = "Weex plugin container" 7 | 8 | s.description = <<-DESC 9 | Weexplugin Source Description 10 | DESC 11 | 12 | s.homepage = "https://github.com/weexteam/weex-pack.git" 13 | s.license = { 14 | :type => 'Copyright', 15 | :text => <<-LICENSE 16 | Alibaba-INC copyright 17 | LICENSE 18 | } 19 | s.authors = { 20 | "yangshengtao" =>"yangshengtao1314@163.com" 21 | } 22 | s.platform = :ios 23 | s.ios.deployment_target = "7.0" 24 | 25 | s.source = { :path => '.' } 26 | s.source_files = "Weexplugin/**/*.{h,m,mm}" 27 | # s.exclude_files = "Classes/Exclude" 28 | s.resources = "Weexplugin/Resources/*" 29 | 30 | 31 | s.requires_arc = true 32 | 33 | #s.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(SDKROOT)/TRemoteDebugger" } 34 | s.dependency "WeexSDK" 35 | s.dependency 'AMap3DMap' 36 | #${weexpackPlaceHolder} 37 | 38 | # s.vendored_frameworks = 'Weexplugin.framework' 39 | 40 | # s.user_target_xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => "'$(PODS_ROOT)/Weexplugin'" } 41 | 42 | end 43 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Plugins/weex-adapter-image/WXImgLoaderImpl.h: -------------------------------------------------------------------------------- 1 | // Created by yangshengtao on 2017/1/23. 2 | // Copyright © 2016年 taobao. All rights reserved. 3 | 4 | #import 5 | #import 6 | 7 | @interface WXImgLoaderImpl : NSObject 8 | @end 9 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Plugins/weex-adapter-image/WXImgLoaderImpl.m: -------------------------------------------------------------------------------- 1 | // Created by yangshengtao on 2017/1/23. 2 | // Copyright © 2016年 taobao. All rights reserved. 3 | 4 | #import "WXImgLoaderImpl.h" 5 | #import 6 | 7 | @implementation WXImgLoaderImpl 8 | 9 | #pragma mark - 10 | #pragma mark WXImgLoaderProtocol 11 | 12 | - (id)downloadImageWithURL:(NSString *)url imageFrame:(CGRect)imageFrame userInfo:(NSDictionary *)userInfo completed:(void(^)(UIImage *image, NSError *error, BOOL finished))completedBlock 13 | { 14 | if ([url hasPrefix:@"//"]) { 15 | url = [@"http:" stringByAppendingString:url]; 16 | } 17 | return (id)[[SDWebImageManager sharedManager] downloadImageWithURL:[NSURL URLWithString:url] options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize) { 18 | 19 | } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 20 | if (completedBlock) { 21 | completedBlock(image, error, finished); 22 | } 23 | }]; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Plugins/weex-plugin-amap/WXMapViewComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXMapViewComponent.h 3 | // WeexDemo 4 | // 5 | // Created by yangshengtao on 2017/1/20. 6 | // Copyright © 2016年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "WXMapViewMarkerComponent.h" 11 | #import 12 | #import 13 | 14 | @interface WXMapViewComponent : WXComponent 15 | 16 | - (NSDictionary *)getUserLocation; 17 | 18 | - (void)addMarker:(WXMapViewMarkerComponent *)marker; 19 | 20 | - (void)updateTitleMarker:(WXMapViewMarkerComponent *)marker; 21 | 22 | - (void)updateIconMarker:(WXMapViewMarkerComponent *)marker; 23 | 24 | - (void)updateLocationMarker:(WXMapViewMarkerComponent *)marker; 25 | 26 | - (void)removeMarker:(WXMapViewMarkerComponent *)marker; 27 | 28 | 29 | @end 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Plugins/weex-plugin-amap/WXMapViewMarkerComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXMapViewMarkerComponent.h 3 | // Pods 4 | // 5 | // Created by yangshengtao on 17/2/6. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface WXMapViewMarkerComponent : WXComponent 12 | 13 | @property (nonatomic, copy) NSString *icon; 14 | @property (nonatomic, copy) NSString *title; 15 | @property (nonatomic, strong) NSArray *location; 16 | 17 | @property (nonatomic, copy) NSString *clickEvent; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Plugins/weex-plugin-amap/WXMapViewMarkerComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // WXMapViewMarkerComponent.m 3 | // Pods 4 | // 5 | // Created by yangshengtao on 17/2/6. 6 | // 7 | // 8 | 9 | #import "WXMapViewMarkerComponent.h" 10 | #import "WXMapViewComponent.h" 11 | 12 | @implementation WXMapViewMarkerComponent 13 | { 14 | @private BOOL _viewLoaded; 15 | } 16 | 17 | @synthesize clickEvent = _clickEvent; 18 | @synthesize icon = _icon; 19 | @synthesize title = _title; 20 | @synthesize location = _location; 21 | 22 | 23 | - (instancetype)initWithRef:(NSString *)ref 24 | type:(NSString*)type 25 | styles:(nullable NSDictionary *)styles 26 | attributes:(nullable NSDictionary *)attributes 27 | events:(nullable NSArray *)events 28 | weexInstance:(WXSDKInstance *)weexInstance 29 | { 30 | self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]; 31 | if (self) { 32 | if ([events containsObject:@"click"]) { 33 | _clickEvent = @"click"; 34 | } 35 | _location = attributes[@"position"]; 36 | _title = attributes[@"title"]; 37 | _icon = attributes[@"icon"]; 38 | } 39 | _viewLoaded = NO; 40 | return self; 41 | } 42 | 43 | - (UIView *) loadView 44 | { 45 | return nil; 46 | } 47 | 48 | - (void)viewDidLoad 49 | { 50 | if (!_viewLoaded) { 51 | [(WXMapViewComponent *)self.supercomponent addMarker:self]; 52 | _viewLoaded = YES; 53 | } 54 | } 55 | - (void)updateAttributes:(NSDictionary *)attributes 56 | { 57 | WXMapViewComponent *mapComponent = (WXMapViewComponent *)self.supercomponent; 58 | if (attributes[@"title"]) { 59 | _title = attributes[@"title"]; 60 | [mapComponent updateTitleMarker:self]; 61 | } 62 | 63 | if (attributes[@"icon"]) { 64 | _icon = attributes[@"icon"]; 65 | [mapComponent updateIconMarker:self]; 66 | } 67 | 68 | if (attributes[@"position"]) { 69 | _location = attributes[@"position"]; 70 | [mapComponent updateLocationMarker:self]; 71 | 72 | } 73 | 74 | } 75 | 76 | - (void)removeFromSuperview; 77 | { 78 | [super removeFromSuperview]; 79 | [(WXMapViewComponent *)self.supercomponent removeMarker:self]; 80 | } 81 | 82 | - (void)dealloc 83 | { 84 | 85 | } 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Plugins/weex-plugin-amap/WXMapViewModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXMapViewModule.h 3 | // Pods 4 | // 5 | // Created by yangshengtao on 17/1/23. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | @interface WXMapViewModule : NSObject 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Plugins/weex-plugin-amap/WXMapViewModule.m: -------------------------------------------------------------------------------- 1 | // 2 | // WXMapViewModule.m 3 | // Pods 4 | // 5 | // Created by yangshengtao on 17/1/23. 6 | // 7 | // 8 | 9 | #import "WXMapViewModule.h" 10 | #import "WXMapViewComponent.h" 11 | 12 | @implementation WXMapViewModule 13 | 14 | @synthesize weexInstance; 15 | 16 | WX_EXPORT_METHOD(@selector(getUserLocation:callback:)) 17 | 18 | - (void)getUserLocation:(NSString *)elemRef callback:(WXModuleCallback)callback 19 | { 20 | [self performBlockWithMapView:elemRef block:^(WXMapViewComponent *mapView) { 21 | callback([mapView getUserLocation] ? : nil); 22 | }]; 23 | } 24 | 25 | - (void)performBlockWithMapView:(NSString *)elemRef block:(void (^)(WXMapViewComponent *))block { 26 | if (!elemRef) { 27 | return; 28 | } 29 | 30 | __weak typeof(self) weakSelf = self; 31 | 32 | WXPerformBlockOnComponentThread(^{ 33 | WXMapViewComponent *mapView = (WXMapViewComponent *)[weakSelf.weexInstance componentForRef:elemRef]; 34 | if (!mapView) { 35 | return; 36 | } 37 | 38 | [weakSelf performSelectorOnMainThread:@selector(doBlock:) withObject:^() { 39 | block(mapView); 40 | } waitUntilDone:NO]; 41 | }); 42 | } 43 | 44 | - (void)doBlock:(void (^)())block { 45 | block(); 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Resources/WeexpluginConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | WeexDemo 4 | 5 | A sample Weex application that responds to the deviceready event. 6 | 7 | 8 | Weex Team 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Source/WeexPlugin/WeexPluginConfigParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // WeexConfigParser.h 3 | // WeexDemo 4 | // 5 | // Created by yangshengtao on 16/11/15. 6 | // Copyright © 2016年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WeexPluginConfigParser : NSObject 12 | { 13 | NSString* featureName; 14 | } 15 | 16 | @property (nonatomic, readonly, strong) NSMutableDictionary* pluginsDict; 17 | @property (nonatomic, readonly, strong) NSMutableDictionary* settings; 18 | @property (nonatomic, readonly, strong) NSMutableArray* pluginNames; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Source/WeexPlugin/WeexPluginConfigParser.m: -------------------------------------------------------------------------------- 1 | // 2 | // WeexConfigParser.m 3 | // WeexDemo 4 | // 5 | // Created by yangshengtao on 16/11/15. 6 | // Copyright © 2016年 taobao. All rights reserved. 7 | // 8 | 9 | #import "WeexPluginConfigParser.h" 10 | @interface WeexPluginConfigParser () 11 | 12 | @property (nonatomic, readwrite, strong) NSMutableDictionary* pluginsDict; 13 | @property (nonatomic, readwrite, strong) NSMutableDictionary* settings; 14 | @property (nonatomic, readwrite, strong) NSMutableArray* pluginNames; 15 | 16 | @end 17 | 18 | @implementation WeexPluginConfigParser 19 | 20 | @synthesize pluginsDict, settings, pluginNames; 21 | - (id)init 22 | { 23 | self = [super init]; 24 | if (self != nil) { 25 | self.pluginsDict = [[NSMutableDictionary alloc] initWithCapacity:30]; 26 | self.settings = [[NSMutableDictionary alloc] initWithCapacity:30]; 27 | self.pluginNames = [[NSMutableArray alloc] initWithCapacity:8]; 28 | featureName = nil; 29 | } 30 | return self; 31 | } 32 | 33 | - (void)parser:(NSXMLParser*)parser didStartElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName attributes:(NSDictionary*)attributeDict 34 | { 35 | if ([elementName isEqualToString:@"preference"]) { 36 | settings[[attributeDict[@"name"] lowercaseString]] = attributeDict[@"value"]; 37 | } else if ([elementName isEqualToString:@"feature"]) { // store feature name to use with correct parameter set 38 | featureName = [attributeDict[@"name"] lowercaseString]; 39 | pluginsDict[@"name"] = featureName; 40 | } else if ((featureName != nil) && [elementName isEqualToString:@"param"]) { 41 | NSString* paramName = [attributeDict[@"name"] lowercaseString]; 42 | id value = attributeDict[@"value"]; 43 | pluginsDict[paramName] = value; 44 | } 45 | } 46 | 47 | - (void)parser:(NSXMLParser*)parser didEndElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName 48 | { 49 | if ([elementName isEqualToString:@"feature"]) { // no longer handling a feature so release 50 | NSDictionary *dic = [NSDictionary dictionaryWithDictionary:pluginsDict]; 51 | [self.pluginNames addObject:dic]; 52 | featureName = nil; 53 | [pluginsDict removeAllObjects]; 54 | } 55 | } 56 | 57 | - (void)parser:(NSXMLParser*)parser parseErrorOccurred:(NSError*)parseError 58 | { 59 | NSAssert(NO, @"config.xml parse error line %ld col %ld", (long)[parser lineNumber], (long)[parser columnNumber]); 60 | } 61 | 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Source/WeexPlugin/WeexPluginLoader.h: -------------------------------------------------------------------------------- 1 | // 2 | // WeexPlugin.h 3 | // WeexDemo 4 | // 5 | // Created by yangshengtao on 16/11/15. 6 | // Copyright © 2016年 taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WeexPluginLoader : NSObject 12 | 13 | + (NSArray *)getPlugins; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Source/WeexPlugin/WeexPluginLoader.m: -------------------------------------------------------------------------------- 1 | // 2 | // WeexPlugin.m 3 | // WeexDemo 4 | // 5 | // Created by yangshengtao on 16/11/15. 6 | // Copyright © 2016年 taobao. All rights reserved. 7 | // 8 | 9 | #import "WeexPluginLoader.h" 10 | #import "WeexPluginConfigParser.h" 11 | @interface WeexPluginLoader () 12 | 13 | @property (nonatomic, readwrite, strong) NSXMLParser* configParser; 14 | @property (nonatomic, readwrite, strong) NSArray *pluginNames; 15 | @property (nonatomic, readwrite, strong) NSDictionary* settings; 16 | 17 | @end 18 | 19 | @implementation WeexPluginLoader 20 | 21 | @synthesize configParser; 22 | 23 | + (NSArray *)getPlugins 24 | { 25 | WeexPluginConfigParser *delegate = [[WeexPluginConfigParser alloc] init]; 26 | [self parseSettingsWithParser:delegate]; 27 | return [NSArray arrayWithArray:delegate.pluginNames] ?: nil; 28 | } 29 | 30 | + (void)parseSettingsWithParser:(NSObject *)delegate 31 | { 32 | // read from config.xml in the app bundle 33 | NSString* path = [self configFilePath:@"WeexpluginConfig.xml"]; 34 | 35 | NSURL* url = [NSURL fileURLWithPath:path]; 36 | 37 | NSXMLParser *configParser = [[NSXMLParser alloc] initWithContentsOfURL:url]; 38 | if (configParser == nil) { 39 | NSLog(@"Failed to initialize XML parser."); 40 | return; 41 | } 42 | [configParser setDelegate:((id < NSXMLParserDelegate >)delegate)]; 43 | [configParser parse]; 44 | } 45 | 46 | +(NSString*)configFilePath:(NSString *)configPath 47 | { 48 | NSString* path = configPath ?: @"config.xml"; 49 | 50 | // if path is relative, resolve it against the main bundle 51 | if(![path isAbsolutePath]){ 52 | NSString* absolutePath = [[NSBundle mainBundle] pathForResource:path ofType:nil]; 53 | if(!absolutePath){ 54 | NSAssert(NO, @"ERROR: %@ not found in the main bundle!", path); 55 | } 56 | path = absolutePath; 57 | } 58 | 59 | // Assert file exists 60 | if (![[NSFileManager defaultManager] fileExistsAtPath:path]) { 61 | NSAssert(NO, @"ERROR: %@ does not exist. Please run weexpack-ios/bin/weexpack_plist_to_config_xml path/to/project.", path); 62 | return nil; 63 | } 64 | 65 | return path; 66 | } 67 | @end 68 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Source/WeexPlugin/WeexPluginManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // WeexPluginManager.h 3 | // Weexplugin 4 | // 5 | // Created by yangshengtao on 16/12/26. 6 | // Copyright © 2016年 Taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WeexPluginManager : NSObject 12 | 13 | + (void)registerWeexPlugin; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Source/WeexPlugin/WeexPluginManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // WeexPluginManager.m 3 | // Weexplugin 4 | // 5 | // Created by yangshengtao on 16/12/26. 6 | // Copyright © 2016年 Taobao. All rights reserved. 7 | // 8 | 9 | #import "WeexPluginManager.h" 10 | #import "WeexPluginLoader.h" 11 | #import 12 | 13 | @implementation WeexPluginManager 14 | 15 | + (void)registerWeexPlugin 16 | { 17 | NSArray *pluginNames = [NSArray arrayWithArray:[WeexPluginLoader getPlugins]]; 18 | if (!pluginNames) { 19 | return; 20 | } 21 | [pluginNames enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 22 | NSDictionary *pluginInfo = (NSDictionary *)obj; 23 | if ([pluginInfo[@"category"] isEqualToString:@"handler"] && pluginInfo[@"protocol"]) { 24 | 25 | [WXSDKEngine registerHandler:[NSClassFromString(pluginInfo[@"ios-package"]) new] 26 | withProtocol:NSProtocolFromString(pluginInfo[@"protocol"])]; 27 | }else if ([pluginInfo[@"category"] isEqualToString:@"component"] && pluginInfo[@"ios-package"]) { 28 | [WXSDKEngine registerComponent:pluginInfo[@"api"] withClass:NSClassFromString(pluginInfo[@"ios-package"])]; 29 | }else if ([pluginInfo[@"category"] isEqualToString:@"module"] && pluginInfo[@"ios-package"]) { 30 | [WXSDKEngine registerModule:pluginInfo[@"api"] withClass:NSClassFromString(pluginInfo[@"ios-package"])]; 31 | } 32 | }]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Weexplugin-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/Weexplugin/Weexplugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // Weexplugin.h 3 | // Weexplugin 4 | // 5 | // Created by yangshengtao on 16/12/26. 6 | // Copyright © 2016年 Taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Weexplugin. 12 | FOUNDATION_EXPORT double WeexpluginVersionNumber; 13 | 14 | //! Project version string for Weexplugin. 15 | FOUNDATION_EXPORT const unsigned char WeexpluginVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | #import 19 | 20 | 21 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/WeexpluginTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/WeexpluginTests/WeexpluginTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // WeexpluginTests.m 3 | // WeexpluginTests 4 | // 5 | // Created by yangshengtao on 16/12/26. 6 | // Copyright © 2016年 Taobao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WeexpluginTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation WeexpluginTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/frameworks.json: -------------------------------------------------------------------------------- 1 | { 2 | "ImageIO.framework": 2, 3 | "CoreLocation.framework": 2, 4 | "AVFoundation.framework": 2 5 | } -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/ios.json: -------------------------------------------------------------------------------- 1 | { 2 | "prepare_queue": { 3 | "installed": [], 4 | "uninstalled": [] 5 | }, 6 | "config_munge": { 7 | "files": { 8 | "WeexpluginConfig.xml": { 9 | "parents": { 10 | "/*": [ 11 | { 12 | "xml": "", 13 | "count": 1 14 | }, 15 | { 16 | "xml": "", 17 | "count": 1 18 | }, 19 | { 20 | "xml": "", 21 | "count": 1 22 | }, 23 | { 24 | "xml": "", 25 | "count": 1 26 | } 27 | ] 28 | } 29 | }, 30 | "*-Info.plist": { 31 | "parents": { 32 | "NSCameraUsageDescription": [ 33 | { 34 | "xml": " ", 35 | "count": 1 36 | } 37 | ], 38 | "NSPhotoLibraryUsageDescription": [ 39 | { 40 | "xml": " ", 41 | "count": 1 42 | } 43 | ], 44 | "NSLocationWhenInUseUsageDescription": [ 45 | { 46 | "xml": "", 47 | "count": 1 48 | } 49 | ] 50 | } 51 | } 52 | } 53 | }, 54 | "installed_plugins": { 55 | "weex-adapter-image": { 56 | "PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)" 57 | }, 58 | "weex-plugin-amap": { 59 | "CAMERA_USAGE_DESCRIPTION": " ", 60 | "PHOTOLIBRARY_USAGE_DESCRIPTION": " ", 61 | "PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)" 62 | } 63 | }, 64 | "dependent_plugins": {}, 65 | "modules": [], 66 | "plugin_metadata": { 67 | "weex-adapter-image": "1.0.1", 68 | "weex-plugin-amap": "1.0.0" 69 | } 70 | } -------------------------------------------------------------------------------- /plugins/weex-amap/ios/Weexplugin/pods.json: -------------------------------------------------------------------------------- 1 | { 2 | "AMap3DMap": { 3 | "name": "AMap3DMap", 4 | "type": "podspec", 5 | "spec": "", 6 | "count": 1 7 | } 8 | } -------------------------------------------------------------------------------- /plugins/weex-amap/ios/weex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/weex.png -------------------------------------------------------------------------------- /plugins/weex-amap/ios/weex@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/plugins/weex-amap/ios/weex@2x.png -------------------------------------------------------------------------------- /plugins/weex-amap/js/demo.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | add points 9 | 10 | 11 | 12 | 34 | 35 | 75 | -------------------------------------------------------------------------------- /plugins/weex-amap/js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "weex-plugin-amap", 3 | "version": "1.0.0", 4 | "platform": [ 5 | "web" 6 | ], 7 | "main": "weex-amap.we", 8 | "description": "weex amap component", 9 | "keywords": [ 10 | "weex", 11 | "amap", 12 | "mapview" 13 | ], 14 | "license": "Apache 2.0", 15 | "dependencies": { 16 | "vue-amap": "^0.1.4" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /plugins/weex-amap/js/weex-amap.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 68 | -------------------------------------------------------------------------------- /plugins/weex-amap/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration 2 | // Generated on Mon Jan 23 2017 17:26:28 GMT+0800 (CST) 3 | 4 | module.exports = function(config) { 5 | config.set({ 6 | 7 | // base path that will be used to resolve all patterns (eg. files, exclude) 8 | basePath: '', 9 | 10 | 11 | // frameworks to use 12 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 13 | frameworks: ['jasmine'], 14 | 15 | 16 | // list of files / patterns to load in the browser 17 | files: [ 18 | './tests/*.test.js' 19 | ], 20 | 21 | 22 | // list of files to exclude 23 | exclude: [ 24 | ], 25 | 26 | 27 | // preprocess matching files before serving them to the browser 28 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 29 | preprocessors: { 30 | }, 31 | 32 | 33 | // test results reporter to use 34 | // possible values: 'dots', 'progress' 35 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter 36 | reporters: ['progress'], 37 | 38 | 39 | // web server port 40 | port: 9876, 41 | 42 | 43 | // enable / disable colors in the output (reporters and logs) 44 | colors: true, 45 | 46 | 47 | // level of logging 48 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 49 | logLevel: config.LOG_INFO, 50 | 51 | 52 | // enable / disable watching file and executing tests whenever any file changes 53 | autoWatch: true, 54 | 55 | 56 | // start these browsers 57 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 58 | browsers: ['Chrome'], 59 | 60 | 61 | // Continuous Integration mode 62 | // if true, Karma captures browsers, runs the tests and exits 63 | singleRun: false, 64 | 65 | // Concurrency level 66 | // how many browser should be started simultaneous 67 | concurrency: Infinity 68 | }) 69 | } 70 | -------------------------------------------------------------------------------- /plugins/weex-amap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "weex-plugin--weex-plugin-amap", 3 | "version": "1.0.0", 4 | "platform": [ 5 | "ios" 6 | ], 7 | "main": "./js/index.we", 8 | "description": "weex amap component", 9 | "keywords": [ 10 | "weex", 11 | "amap", 12 | "mapview" 13 | ], 14 | "scripts": { 15 | "eslint": "eslint" 16 | }, 17 | "license": "Apache 2.0", 18 | "devDependencies": { 19 | "babel-eslint": "^7.1.1", 20 | "eslint": "^3.14.0", 21 | "eslint-config-airbnb": "^14.0.0", 22 | "eslint-config-airbnb-base": "^11.0.1", 23 | "eslint-config-standard": "^6.2.1", 24 | "eslint-plugin-html": "^1.7.0", 25 | "eslint-plugin-import": "^2.2.0", 26 | "eslint-plugin-jsx-a11y": "^3.0.2", 27 | "eslint-plugin-promise": "^3.4.0", 28 | "eslint-plugin-react": "^6.9.0", 29 | "eslint-plugin-standard": "^2.0.1", 30 | "jasmine": "^2.5.3", 31 | "karma": "^1.4.0", 32 | "karma-chrome-launcher": "^2.0.0", 33 | "karma-jasmine": "^1.1.0", 34 | "uppercamelcase": "^1.1.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/components/amap-marker.js: -------------------------------------------------------------------------------- 1 | import markerManager from '../service/marker'; 2 | 3 | const params = { 4 | poistion: [], 5 | title: '', 6 | icon: '' 7 | }; 8 | 9 | // prototype methods. 10 | const proto = { 11 | create() { 12 | const node = document.createElement('div'); 13 | const data = this.data.attr; 14 | markerManager.addMarker({ 15 | position: data.position, 16 | icon: data.icon, 17 | title: data.title, 18 | ref: this.data.ref, 19 | events: { 20 | click: () => { 21 | this.dispatchEvent('click'); 22 | } 23 | }, 24 | map: window.Amap 25 | }); 26 | return node; 27 | }, 28 | updateAttrs(attrs) { 29 | const keys = Object.keys(attrs); 30 | const data = { 31 | ref: this.data.ref 32 | }; 33 | keys.forEach((k) => { 34 | markerManager.updateMarker(data, k, attrs[k]); 35 | }); 36 | } 37 | }; 38 | 39 | const attr = { 40 | position(val) { 41 | console.log(val); 42 | console.log(this); 43 | if (Array.isArray(val) && val.length === 2) { 44 | params.position = val; 45 | } 46 | }, 47 | icon(val) { 48 | params.icon = val; 49 | }, 50 | title(val) { 51 | params.title = val; 52 | } 53 | }; 54 | 55 | const event = { 56 | click: { 57 | extra() { 58 | return { isSuccess: true }; 59 | } 60 | } 61 | }; 62 | 63 | function init(Weex) { 64 | const Component = Weex.Component; 65 | const extend = Weex.utils.extend; 66 | 67 | function AmapMaker(data) { 68 | Component.call(this, data); 69 | } 70 | AmapMaker.prototype = Object.create(Component.prototype); 71 | extend(AmapMaker.prototype, proto); 72 | extend(AmapMaker.prototype, { attr }); 73 | extend(AmapMaker.prototype, { event }); 74 | Weex.registerComponent('weex-amap-marker', AmapMaker); 75 | } 76 | 77 | export default { init }; 78 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/index.js: -------------------------------------------------------------------------------- 1 | import amapModuleReg from './module/amap'; 2 | import Amap from './components/amap'; 3 | import AmapMarker from './components/amap-marker'; 4 | // import VueAmap from './vue-amap/index'; 5 | const components = [ 6 | Amap, 7 | AmapMarker 8 | ]; 9 | 10 | function init(Weex) { 11 | components.forEach((comp) => { 12 | comp.init(Weex); 13 | }); 14 | amapModuleReg(Weex); 15 | } 16 | module.exports = { 17 | init 18 | }; 19 | 20 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/module/amap.js: -------------------------------------------------------------------------------- 1 | // AMap module 2 | const mapManager = require('../service/map-manager'); 3 | 4 | const amap = { 5 | /** get user loaction by browser and IP 6 | * @param {function} callback 7 | * @param {function} errorCallback 8 | **/ 9 | getUserLocation(mapRef, callback) { 10 | const self = this; 11 | const geo = new AMap.Geolocation({ 12 | enableHighAccuracy: true, 13 | timeout: 10000 14 | }); 15 | geo.getCurrentPosition((status, res) => { 16 | if (status !== 'error') { 17 | self.sender.performCallback(callback, { 18 | data: { 19 | position: [res.position.getLng(), res.position.getLat()] 20 | }, 21 | result: 'success' 22 | }); 23 | } else { 24 | console.warn(res.message); 25 | } 26 | }); 27 | }, 28 | /** 29 | * search place 30 | * @param {string} mapref 31 | * @param {function} callback 32 | **/ 33 | search(q, callback, mapRef) { 34 | const map = mapManager.getMap(); 35 | map.placeSearch.search(q, (status, res) => { 36 | this.sender.performCallback(callback, { 37 | data: res, 38 | result: status === 'complete' ? 'success' : 'error' 39 | }); 40 | }); 41 | }, 42 | /** 43 | * search nearby 44 | * @param {string} q query keyword 45 | * @param {array} location example:[123.123, 12.123123] 46 | * @param {number} distance example: 1000 47 | **/ 48 | searchNearBy(q, location, distance, callback, mapRef) { 49 | const map = mapManager.getMap(); 50 | map.placeSearch.search(q, location, distance, (status, res) => { 51 | this.sender.performCallback(callback, { 52 | data: res, 53 | result: status === 'complete' ? 'success' : 'error' 54 | }); 55 | }); 56 | } 57 | }; 58 | 59 | const meta = { 60 | amap: [{ 61 | name: 'getUserLocation', 62 | args: ['string', 'function'] 63 | }, { 64 | name: 'searchNearBy', 65 | args: ['string', 'function', 'string'] 66 | }, { 67 | name: 'search', 68 | args: ['string', 'array', 'number', 'function', 'string'] 69 | }] 70 | }; 71 | 72 | module.exports = function (Weex) { 73 | Weex.registerApiModule('amap', amap, meta); 74 | }; 75 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "weex-plugin--weex-plugin-amap", 3 | "version": "1.0.0", 4 | "platform": [ 5 | "web" 6 | ], 7 | "main": "./vue-amap/index.js", 8 | "description": "weex amap component", 9 | "keywords": [ 10 | "weex", 11 | "amap", 12 | "mapview" 13 | ], 14 | "license": "Apache 2.0" 15 | } -------------------------------------------------------------------------------- /plugins/weex-amap/web/service/map-loader.js: -------------------------------------------------------------------------------- 1 | const DEFAULT_CONFIG = { 2 | key: '', 3 | v: '1.3', 4 | url: 'https://webapi.amap.com/maps' 5 | }; 6 | 7 | const gengerateScriptUrl = function(obj) { 8 | let paramArr = []; 9 | for(let key in obj) { 10 | if(key !== 'url') { 11 | paramArr.push(encodeURI(key + '=' + obj[key])); 12 | } 13 | } 14 | return obj.url += '?' + paramArr.join('&'); 15 | }; 16 | 17 | module.exports = { 18 | 19 | load(config,container,callback) { 20 | let newConfig = Object.assign({},DEFAULT_CONFIG,config); 21 | let lib = document.createElement('script'); 22 | lib.src = gengerateScriptUrl(newConfig); 23 | console.log(lib.src); 24 | let self = this; 25 | lib.addEventListener('load',function() { 26 | window.maploaded = true; 27 | callback(); 28 | }); 29 | document.head.appendChild(lib); 30 | this.loadTimeout(container); 31 | }, 32 | 33 | loadTimeout(wrap) { 34 | setTimeout(() => { 35 | if(!window.Amap) { 36 | let el = document.createElement('button'); 37 | el.appendChild(document.createTextNode('重新加载')); 38 | el.addEventListener('click', function () { 39 | location.reload(); 40 | }); 41 | wrap.childNodes[0].remove(); 42 | wrap.appendChild(el); 43 | } 44 | }, 10000); 45 | } 46 | 47 | }; -------------------------------------------------------------------------------- /plugins/weex-amap/web/service/map-manager.js: -------------------------------------------------------------------------------- 1 | /** map instance manager 2 | * 20170204 3 | **/ 4 | let callbackStack = []; 5 | module.exports = { 6 | initMap(id, map) { 7 | if (!this.__maps) { 8 | this.__maps = {}; 9 | } 10 | this.__maps[id] = map; 11 | callbackStack.forEach((cb) => { 12 | cb(map); 13 | }); 14 | callbackStack = []; 15 | }, 16 | getMap(id) { 17 | if (!this.__maps) { 18 | return null; 19 | } 20 | if (!id) { 21 | id = Object.keys(this.__maps)[0]; 22 | } 23 | return this.__maps[id]; 24 | }, 25 | addReadyCallback(callback) { 26 | callbackStack.push(callback); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/service/marker.js: -------------------------------------------------------------------------------- 1 | // a lib to manage all marker 2 | import amapManager from './map-manager'; 3 | import vendor from './vendor'; 4 | 5 | const markers = {}; 6 | module.exports = { 7 | changeMarker(arr, map) { 8 | for (let i = 0; i < arr.length; i++) { 9 | const data = arr[i]; 10 | const marker = this.findMarker(data); 11 | if (!marker) { 12 | this.addMarker(data, map); 13 | } else { 14 | this.removeMarker(data); 15 | } 16 | } 17 | }, 18 | addMarker(data) { 19 | const map = amapManager.getMap(); 20 | if (!map) { 21 | return amapManager.addReadyCallback((mapIns) => { 22 | this.setMarker(data, mapIns); 23 | }); 24 | } 25 | return this.setMarker(data, map); 26 | }, 27 | setMarker(data, map) { 28 | let icon = null; 29 | if (data.icon) { 30 | icon = new AMap.Icon({ 31 | image: data.icon, 32 | size: new AMap.Size(64, 64) 33 | }); 34 | } 35 | const marker = new AMap.Marker({ 36 | position: data.position, 37 | title: data.title, 38 | icon: icon, 39 | map: map, 40 | }); 41 | markers[this.__getMid(data)] = marker; 42 | this.registerEvents(data.events, marker); 43 | }, 44 | removeMaker(data) { 45 | const marker = this.findMarker(data); 46 | marker.setMap(null); 47 | }, 48 | updateMarker(data, attr, val) { 49 | const marker = this.findMarker(data); 50 | if (!marker) { 51 | return false; 52 | } 53 | const method = vendor.setFirstLetterToUppercase(attr); 54 | marker['set' + method](val); 55 | }, 56 | registerEvents(events, marker) { 57 | if (typeof events === 'object') { 58 | for (const key in events) { 59 | AMap.event.addListener(marker, key, events[key]); 60 | } 61 | } 62 | }, 63 | removeMarker(data) { 64 | let marker = this.findMarker(data); 65 | if (marker) { 66 | marker.visible = true; 67 | marker = null; 68 | } 69 | }, 70 | findMarker(data) { 71 | const mid = this.__getMid(data); 72 | return markers[mid]; 73 | }, 74 | __getMid(data) { 75 | return 'mid-' + data.ref || data.position.join('-'); 76 | }, 77 | __isMaker(obj) { 78 | return typeof obj === 'object' && obj.CLASS_NAME === 'AMap.Marker'; 79 | } 80 | }; 81 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/service/vendor.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | gengerateRandomId(prefix) { 3 | return prefix + ((new Date()).getTime().toString().substring(9, 3)) + parseInt(Math.random() * 10000, 10); 4 | }, 5 | setFirstLetterToUppercase(str) { 6 | return str.substr(0, 1).toUpperCase() + str.substring(1); 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/vue-amap/components/amap-marker.vue: -------------------------------------------------------------------------------- 1 | 2 | 69 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/vue-amap/index.js: -------------------------------------------------------------------------------- 1 | // polyfills 2 | import './polyfills'; 3 | // 组建导入 4 | import AMap from './components/amap.vue'; 5 | import AMapMarker from './components/amap-marker.vue'; 6 | 7 | require('./module/amap'); 8 | 9 | const components = [ 10 | AMap, 11 | AMapMarker 12 | ]; 13 | const VueAmap = {}; 14 | VueAmap.install = function (Vue) { 15 | components.map((_component) => { 16 | return Vue.component('weex-' + _component.name, _component); 17 | }); 18 | }; 19 | export default VueAmap; 20 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/vue-amap/managers/amap-manager.js: -------------------------------------------------------------------------------- 1 | export default class AMapManager { 2 | constructor() { 3 | this._componentMap = new Map(); 4 | } 5 | setMap(map) { 6 | this._map = map; 7 | } 8 | getMap() { 9 | return this._map; 10 | } 11 | setComponent(id, component) { 12 | this._componentMap.set(id, component); 13 | } 14 | getComponent(id) { 15 | return this._componentMap.get(id); 16 | } 17 | getChildInstance(id) { 18 | return this.getComponent(id); 19 | } 20 | removeComponent(id) { 21 | this._componentMap.delete(id); 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/vue-amap/mixins/editor-component.js: -------------------------------------------------------------------------------- 1 | import eventHelper from '../utils/event-helper'; 2 | export default { 3 | methods: { 4 | setEditorEvents() { 5 | if (!this.events) return; 6 | let filters = ['addnode', 'adjust', 'removenode', 'end', 'move']; 7 | let filterSet = {}; 8 | Object.keys(this.events).forEach(key => { 9 | if (filters.indexOf(key)) filterSet[key] = this.events[key]; 10 | }); 11 | Object.keys(filterSet).forEach(key => { 12 | eventHelper.addListener(this.$amapComponent.editor, key, filterSet[key]); 13 | // this.$amapComponent.editor.on(key, filterSet[key]); 14 | }); 15 | } 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/vue-amap/module/amap.js: -------------------------------------------------------------------------------- 1 | // AMap module 2 | import mapManager from '../managers/amap-manager'; 3 | import { initAMapApiLoader } from '../services/injected-amap-api-instance'; 4 | 5 | const amap = { 6 | /** set sdk jey and load sdk 7 | * @param {object} sdk key {h5:'xxxx'} 8 | **/ 9 | setSDKKey(keys) { 10 | initAMapApiLoader({ key: keys.h5 }); 11 | }, 12 | /** get user loaction by browser and IP 13 | * @param {function} callback 14 | * @param {function} errorCallback 15 | **/ 16 | getUserLocation(mapRef, callback) { 17 | const self = this; 18 | const geo = new AMap.Geolocation({ 19 | enableHighAccuracy: true, 20 | timeout: 10000 21 | }); 22 | geo.getCurrentPosition((status, res) => { 23 | if (status !== 'error') { 24 | self.sender.performCallback(callback, { 25 | data: { 26 | position: [res.position.getLng(), res.position.getLat()] 27 | }, 28 | result: 'success' 29 | }); 30 | } else { 31 | console.warn(res.message); 32 | } 33 | }); 34 | }, 35 | /** 36 | * search place 37 | * @param {string} mapref 38 | * @param {function} callback 39 | **/ 40 | search(q, callback) { 41 | const map = mapManager.getMap(); 42 | map.placeSearch.search(q, (status, res) => { 43 | this.sender.performCallback(callback, { 44 | data: res, 45 | result: status === 'complete' ? 'success' : 'error' 46 | }); 47 | }); 48 | }, 49 | /** 50 | * search nearby 51 | * @param {string} q query keyword 52 | * @param {array} location example:[123.123, 12.123123] 53 | * @param {number} distance example: 1000 54 | **/ 55 | searchNearBy(q, location, distance, callback) { 56 | const map = mapManager.getMap(); 57 | map.placeSearch.search(q, location, distance, (status, res) => { 58 | this.sender.performCallback(callback, { 59 | data: res, 60 | result: status === 'complete' ? 'success' : 'error' 61 | }); 62 | }); 63 | } 64 | }; 65 | 66 | if (window.weex) { 67 | window.weex.registerModule('amap', amap); 68 | } 69 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/vue-amap/polyfills.js: -------------------------------------------------------------------------------- 1 | import 'core-js/es6/map'; 2 | import 'core-js/es6/promise'; 3 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/vue-amap/services/injected-amap-api-instance.js: -------------------------------------------------------------------------------- 1 | let lazyAMapApiLoaderInstance = null; 2 | import AMapAPILoader from './lazy-amap-api-loader'; 3 | export const initAMapApiLoader = (config) => { 4 | console.log(config); 5 | if (lazyAMapApiLoaderInstance) throw new Error('You has already initial your lazyAMapApiLoaderInstance, just import it'); 6 | lazyAMapApiLoaderInstance = new AMapAPILoader(config); 7 | lazyAMapApiLoaderInstance.load(); 8 | }; 9 | export { lazyAMapApiLoaderInstance }; 10 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/vue-amap/services/lazy-amap-api-loader.js: -------------------------------------------------------------------------------- 1 | const DEFAULT_AMP_CONFIG = { 2 | key: null, 3 | v: 1.3, 4 | protocol: 'https', 5 | hostAndPath: 'webapi.amap.com/maps', 6 | plugin: [], 7 | callback: 'amapInitComponent' 8 | }; 9 | /** 10 | * 11 | */ 12 | 13 | export default class AMapAPILoader { 14 | /** 15 | * @param config required 初始化参数 16 | */ 17 | constructor(config) { 18 | this._config = Object.assign({}, DEFAULT_AMP_CONFIG, config); 19 | this._document = document; 20 | this._window = window; 21 | this._scriptLoaded = false; 22 | this._queueEvents = []; 23 | } 24 | 25 | load() { 26 | if (this._window.AMap) { 27 | return Promise.resolve(); 28 | } 29 | 30 | if (this._scriptLoadingPromise) return this._scriptLoadingPromise; 31 | const script = this._document.createElement('script'); 32 | script.type = 'text/javascript'; 33 | script.async = true; 34 | script.defer = true; 35 | script.src = this._getScriptSrc(); 36 | 37 | this._scriptLoadingPromise = new Promise((resolve, reject) => { 38 | this._window['amapInitComponent'] = () => { 39 | this._queueEvents.forEach(event => event()); 40 | while (this._queueEvents.length) { 41 | this._queueEvents.pop().apply(); 42 | } 43 | return resolve(); 44 | }; 45 | script.onerror = error => reject(error); 46 | }); 47 | this._document.head.appendChild(script); 48 | return this._scriptLoadingPromise; 49 | } 50 | 51 | _getScriptSrc() { 52 | // amap plugin prefix reg 53 | const amap_prefix_reg = /^AMap./; 54 | 55 | const config = this._config; 56 | const paramKeys = ['v', 'key', 'plugin', 'callback']; 57 | 58 | // check 'AMap.' prefix 59 | if (config.plugin && config.plugin.length > 0) { 60 | // push default types 61 | config.plugin.push('Autocomplete', 'PlaceSearch', 'PolyEditor', 'CircleEditor'); 62 | 63 | config.plugin = config.plugin.map(item => { 64 | return (amap_prefix_reg.test(item)) ? item : 'AMap.' + item; 65 | }); 66 | } 67 | 68 | const params = Object.keys(config) 69 | .filter(k => paramKeys.indexOf(k) !== -1) 70 | .filter(k => config[k] != null) 71 | .filter(k => { 72 | return !Array.isArray(config[k]) || 73 | (Array.isArray(config[k]) && config[k].length > 0); 74 | }) 75 | .map(k => { 76 | let v = config[k]; 77 | if (Array.isArray(v)) return { key: k, value: v.join(',')}; 78 | return {key: k, value: v}; 79 | }) 80 | .map(entry => `${entry.key}=${entry.value}`) 81 | .join('&'); 82 | return `${this._config.protocol}://${this._config.hostAndPath}?${params}`; 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/vue-amap/utils/constant.js: -------------------------------------------------------------------------------- 1 | const AMAP_READY_EVENT = 'AMAP_READY_EVENT'; 2 | 3 | const MAP_EVENTS = [ 4 | 'zoomchange', 5 | 'dragend' 6 | ]; 7 | 8 | const MAEKER_EVENTS = ['click']; 9 | 10 | export default { 11 | AMAP_READY_EVENT, 12 | MAP_EVENTS, 13 | MAEKER_EVENTS 14 | }; 15 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/vue-amap/utils/convert-helper.js: -------------------------------------------------------------------------------- 1 | export function toPixel(arr) { 2 | return new AMap.Pixel(arr[0], arr[1]); 3 | } 4 | 5 | export function toLngLat(arr) { 6 | return new AMap.LngLat(arr[0], arr[1]); 7 | } 8 | 9 | /** 10 | * @param arrs 二重数组 southWest, northEast 11 | */ 12 | export function toBounds(arrs) { 13 | return new AMap.Bounds(toLngLat(arrs[0]), toLngLat(arrs[1])); 14 | } 15 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/vue-amap/utils/event-helper.js: -------------------------------------------------------------------------------- 1 | let eventHelper; 2 | class EventHelper { 3 | constructor() { 4 | /** 5 | * listener has表 6 | * { 7 | * instance: { 8 | * eventName: [...handlers] 9 | * } 10 | * } 11 | */ 12 | this._listener = new Map(); 13 | } 14 | 15 | addListener(instance, eventName, handler, context) { 16 | if (!AMap.event) throw new Error('please wait for Map API load'); 17 | let listener = AMap.event.addListener(instance, eventName, handler, context); 18 | if (!this._listener.get(instance)) this._listener.set(instance, {}); 19 | let listenerMap = this._listener.get(instance); 20 | if (!listenerMap[eventName]) listenerMap[eventName] = []; 21 | listenerMap[eventName].push(listener); 22 | 23 | } 24 | 25 | removeListener(instance, eventName, handler) { 26 | if (!AMap.event) throw new Error('please wait for Map API load'); 27 | if (!this._listener.get(instance) || !this._listener.get(instance)[eventName]) return; 28 | let listenerArr = this._listener.get(instance)[eventName]; 29 | if (handler) { 30 | let l_index = listenerArr.indexOf(handler); 31 | AMap.event.removeListener(listenerArr[l_index]); 32 | listenerArr.splice(l_index, 1); 33 | } else { 34 | listenerArr.forEach(listener => { 35 | AMap.event.removeListener(listener); 36 | }); 37 | this._listener.get(instance)[eventName] = []; 38 | } 39 | } 40 | addListenerOnce(instance, eventName, handler, context) { 41 | return AMap.event.addListenerOnce(instance, eventName, handler, context); 42 | } 43 | trigger(instance, eventName, args) { 44 | return AMap.event.trigger(instance, eventName, args); 45 | } 46 | 47 | clearListeners(instance) { 48 | let listeners = this._listener.get(instance); 49 | if (!listeners) return; 50 | Object.keys(listeners).map(eventName => { 51 | this.removeListener(instance, eventName); 52 | }); 53 | } 54 | }; 55 | 56 | eventHelper = eventHelper || new EventHelper(); 57 | 58 | export default eventHelper; 59 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/vue-amap/utils/guid.js: -------------------------------------------------------------------------------- 1 | export default function guid() { 2 | let s = []; 3 | let hexDigits = '0123456789abcdef'; 4 | for (var i = 0; i < 36; i++) { 5 | s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); 6 | } 7 | s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010 8 | s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01 9 | s[8] = s[13] = s[18] = s[23] = '-'; 10 | 11 | var uuid = s.join(''); 12 | return uuid; 13 | } 14 | -------------------------------------------------------------------------------- /plugins/weex-amap/web/vue-amap/utils/uppercamelcase.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = function () { 3 | var str = [].map.call(arguments, function (str) { 4 | return str.trim(); 5 | }).filter(function (str) { 6 | return str.length; 7 | }).join('-'); 8 | 9 | if (!str.length) { 10 | return ''; 11 | } 12 | 13 | if (str.length === 1 || !(/[_.\- ]+/).test(str) ) { 14 | if (str[0] === str[0].toLowerCase() && str.slice(1) !== str.slice(1).toLowerCase()) { 15 | return str; 16 | } 17 | 18 | return str.toLowerCase(); 19 | } 20 | 21 | return str 22 | .replace(/^[_.\- ]+/, '') 23 | .toLowerCase() 24 | .replace(/[_.\- ]+(\w|$)/g, function (m, p1) { 25 | return p1.toUpperCase(); 26 | }); 27 | }; 28 | -------------------------------------------------------------------------------- /shots/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/shots/.DS_Store -------------------------------------------------------------------------------- /shots/shot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/shots/shot1.png -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/src/.DS_Store -------------------------------------------------------------------------------- /src/components/article-list-item.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{keyword}} 7 | {{desc}} 8 | 9 | 10 | 查看详情 11 | 12 | 13 | 14 | 15 | 16 | 72 | 73 | -------------------------------------------------------------------------------- /src/components/card-item.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{name}} 6 | 7 | 8 | {{shareCount}} 9 | 10 | 11 | 12 | 13 | 14 | 55 | 56 | -------------------------------------------------------------------------------- /src/components/video-list.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{item.title}} 8 | 9 | 10 | {{item.upload_date}} 11 | 12 | 13 | 14 | 15 | 16 | 17 | {{item.producer.username}} 18 | 19 | 20 | {{item.views}} 21 | Views 22 | {{item.comments}} 23 | Comments 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 97 | 98 | -------------------------------------------------------------------------------- /src/include/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/src/include/.DS_Store -------------------------------------------------------------------------------- /src/include/example-list-item.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{keyword}} 7 | {{desc}} 8 | 9 | 10 | 查看详情 11 | 12 | 13 | 14 | 15 | 16 | 72 | 73 | -------------------------------------------------------------------------------- /src/include/example-list.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 72 | 73 | -------------------------------------------------------------------------------- /src/include/footer.vue: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 44 | 45 | -------------------------------------------------------------------------------- /src/include/h3.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{contents}} 4 | 5 | 6 | 7 | 17 | 18 | -------------------------------------------------------------------------------- /src/include/icon.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /src/include/loading-list-item.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 21 | 22 | 43 | -------------------------------------------------------------------------------- /src/include/navbar.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{leftCorner.text}} 6 | 7 | 8 | 9 | 返回 10 | 11 | 12 | 13 | {{rightCorner.text}} 14 | 15 | {{title}} 16 | 17 | 18 | 60 | -------------------------------------------------------------------------------- /src/include/page.style.css: -------------------------------------------------------------------------------- 1 | .container{ 2 | position: relative; 3 | flex:1; 4 | background-color: #fff; 5 | } 6 | .map{ 7 | flex: 1; 8 | position: relative; 9 | background-color: #fff; 10 | min-height: 800; 11 | border-bottom-width: 10; 12 | border-bottom-color: #fff; 13 | } 14 | .map-control{ 15 | padding-top: 20; 16 | min-height: 600; 17 | } 18 | .title{ 19 | margin-left: 20; 20 | padding-left: 20; 21 | padding-top: 10; 22 | padding-bottom: 10; 23 | font-size: 36px; 24 | border-left-width: 6; 25 | border-left-color: #0f89f5; 26 | color: #222; 27 | text-align: left; 28 | } 29 | .tips{ 30 | margin: 20; 31 | padding: 10; 32 | color:#666; 33 | font-size: 20px; 34 | } 35 | .btn{ 36 | margin: 20; 37 | padding: 20; 38 | background-color: #1ba1e2; 39 | border-radius: 5; 40 | color: #fff; 41 | text-align:center; 42 | cursor: pointer; 43 | font-size: 28px; 44 | } -------------------------------------------------------------------------------- /src/include/progress-bar.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/include/search-bar.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 返回 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 68 | -------------------------------------------------------------------------------- /src/include/tab-bar.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{item.name}} 5 | {{item.name}} 6 | 7 | 8 | 9 | 25 | -------------------------------------------------------------------------------- /src/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 29 | 30 | 89 | -------------------------------------------------------------------------------- /src/lib/helper.js: -------------------------------------------------------------------------------- 1 | // helper.js 2016 2 | export default { 3 | 4 | setBundleUrl(jsFile, weex) { 5 | const bundleUrl = weex.config.bundleUrl; 6 | let host = ''; 7 | let path = ''; 8 | let nativeBase; 9 | const isAndroidAssets = bundleUrl.indexOf('your_current_IP') >= 0 || bundleUrl.indexOf('file://assets/') >= 0; 10 | const isiOSAssets = bundleUrl.indexOf('file:///') >= 0 && bundleUrl.indexOf('WeexDemo.app') > 0; 11 | if (isAndroidAssets) { 12 | nativeBase = 'file://assets/'; 13 | } else if (isiOSAssets) { 14 | // file:///var/mobile/Containers/Bundle/Application/{id}/WeexDemo.app/ 15 | // file:///Users/{user}/Library/Developer/CoreSimulator/Devices/{id}/data/Containers/Bundle/Application/{id}/WeexDemo.app/ 16 | nativeBase = bundleUrl.substring(0, bundleUrl.lastIndexOf('/') + 1); 17 | } else { 18 | const matches = /\/\/([^\/]+?)\//.exec(bundleUrl); 19 | const matchFirstPath = /\/\/.+\/([^\/]+?)\//.exec(bundleUrl); 20 | if (matches && matches.length >= 2) { 21 | host = matches[1]; 22 | } 23 | if (matchFirstPath && matchFirstPath.length >= 2) { 24 | path = matchFirstPath[1]; 25 | } 26 | nativeBase = 'http://' + host + '/'; 27 | } 28 | const h5Base = './weex.html?page='; 29 | // in Native 30 | let base = nativeBase; 31 | if (typeof navigator !== 'undefined' && (navigator.appCodeName === 'Mozilla' || navigator.product === 'Gecko')) { 32 | // check if in weexpack project 33 | console.log(path); 34 | if (path === 'web' || path === 'dist') { 35 | base = h5Base + '/dist/'; 36 | } else { 37 | base = h5Base + '/'; 38 | } 39 | } else { 40 | base = nativeBase + path + '/'; 41 | } 42 | 43 | const newUrl = base + jsFile; 44 | return newUrl; 45 | }, 46 | }; 47 | -------------------------------------------------------------------------------- /src/pages/article.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 23 | 24 | 34 | -------------------------------------------------------------------------------- /src/pages/map.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 26 | 27 | 57 | -------------------------------------------------------------------------------- /src/pages/search.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 24 | 25 | 41 | -------------------------------------------------------------------------------- /src/shop.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 30 | 31 | 78 | -------------------------------------------------------------------------------- /start: -------------------------------------------------------------------------------- 1 | echo "*****************************************************************************" 2 | echo "* Welcome to Weex *" 3 | echo "* *" 4 | echo "* A framework for building Mobile cross-platform UI. *" 5 | echo "* *" 6 | echo "* https://github.com/alibaba/weex *" 7 | echo "*****************************************************************************" 8 | 9 | 10 | THIS_DIR=$(dirname "$0") 11 | pushd "$THIS_DIR" 12 | npm run serve 13 | popd 14 | 15 | -------------------------------------------------------------------------------- /start.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo "*****************************************************************************" 3 | echo "* Welcome to Weex *" 4 | echo "* *" 5 | echo "* A framework for building Mobile cross-platform UI. *" 6 | echo "* *" 7 | echo "* https://github.com/alibaba/weex *" 8 | echo "*****************************************************************************" 9 | 10 | pushd %~dp0 11 | npm run serve 12 | popd 13 | -------------------------------------------------------------------------------- /tools/webpack.config.plugin.js: -------------------------------------------------------------------------------- 1 | // only build plugin module 2 | require('webpack') 3 | require('weex-loader') 4 | 5 | var path = require('path'); 6 | var fs=require('fs'); 7 | 8 | let root = process.cwd(); 9 | 10 | module.exports = { 11 | entry: { 12 | plugins: [path.join(root,'plugins/plugin_bundle.js')], 13 | }, 14 | output: { 15 | path: path.join(root,'web'), 16 | filename: 'plugin.js' 17 | }, 18 | devtool:'inline-source-map', 19 | module: { 20 | loaders: [ 21 | { 22 | test: /\.js(\?[^?]+)?$/, 23 | exclude: /node_modules/, 24 | loader: 'babel-loader?presets[]=es2015', 25 | }, 26 | { 27 | test: /\.we(\?[^?]+)?$/, 28 | loader: 'weex-loader', 29 | }, 30 | { 31 | test: /\.vue(\?[^?]+)?$/, 32 | loader: 'vue', 33 | } 34 | ] 35 | }, 36 | 37 | /*plugins: [ 38 | new webpack.optimize.UglifyJsPlugin( { 39 | minimize : true, 40 | sourceMap : true, 41 | mangle: true, 42 | compress: { 43 | warnings: false 44 | } 45 | } ) 46 | ]*/ 47 | 48 | } -------------------------------------------------------------------------------- /web/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/web/.DS_Store -------------------------------------------------------------------------------- /web/assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weex-plugins/app-seed-for-apache-weex/fb66a0cbcc57103d5370d056af09064756e6e421/web/assets/.DS_Store -------------------------------------------------------------------------------- /web/assets/style.css: -------------------------------------------------------------------------------- 1 | h1 { text-align: center; } 2 | #app { display: flex; justify-content: center; } 3 | #preview { width: 750px; height: 1245px; transform: scale(0.354); transform-origin: top left; } 4 | .mock-phone { position: relative; width: 297px; min-width: 297px; height: 591px; border: 2px solid #0088fb; border-radius: 30px; } 5 | .mock-phone .inner { position: absolute; top: 60px; z-index: 26; left: 12px; width: 267px; height: 441px; border: 1px solid #0088fb; overflow: hidden; } 6 | .mock-phone .inner iframe { width: 100%; height: 100%; margin: 0; } 7 | .mock-phone .camera { position: absolute; width: 14px; height: 14px; border-radius: 14px; background: #afddff; border: 1px solid #0088fb; top: 23px; left: 94px; } 8 | .mock-phone .earpiece { position: absolute; width: 70px; height: 8px; border-radius: 8px; background: #afddff; border: 1px solid #0088fb; top: 26px; left: 124px; } 9 | .mock-phone .home-btn { position: absolute; width: 56px; height: 56px; border-radius: 56px; background: #afddff; border: 1px solid #0088fb; bottom: 14px; left: 50%; margin-left: -28px; } 10 | #qrcode { align-self: center; margin-left: 50px; } 11 | #qrcode .bundle-url { width: 480px; line-height: 1.5; word-break: break-all; } 12 | -------------------------------------------------------------------------------- /web/assets/weex-init.js: -------------------------------------------------------------------------------- 1 | // weex h5 laod pages 2 | (function () { 3 | function getUrlParam(key, searchStr) { 4 | var reg = new RegExp('[?|&]' + key + '=([^&]+)'); 5 | searchStr = searchStr || location.search; 6 | var match = searchStr.match(reg); 7 | return match && match[1]; 8 | } 9 | var page = '/dist/index.js'; 10 | if (getUrlParam('name')) { 11 | page = getUrlParam('name'); 12 | } else { 13 | if (window.top && getUrlParam('page', top.location.search)) { 14 | page = getUrlParam('page', top.location.search); 15 | } 16 | } 17 | 18 | if (window.weex && window.weex.init ) { 19 | window.weex.init({ 20 | appId: location.href, 21 | source: page, 22 | loader: 'xhr', 23 | rootId: 'weex' 24 | }); 25 | } else { 26 | var bundle = document.createElement('script'); 27 | bundle.src = page; 28 | document.body.appendChild(bundle); 29 | } 30 | })(); 31 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | weex-vue-demo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /web/plugin.js: -------------------------------------------------------------------------------- 1 | import amap from "/Users/ali-130257n/www/weex-app-start-kit/plugins/weex-amap/web"; 2 | Vue.use(amap); -------------------------------------------------------------------------------- /web/weex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | weex-vue-demo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /webpack.dev.js: -------------------------------------------------------------------------------- 1 | const configs = require('./webpack.config.js'); 2 | const webpack = require('webpack'); 3 | const ip = require('ip').address(); 4 | const pathTo = require('path'); 5 | const chalk = require('chalk'); 6 | let config = Array.isArray(configs) ? configs[0] : configs; 7 | config.devServer = { 8 | contentBase: pathTo.join(__dirname, ''), 9 | compress: true, 10 | // hot: true, 11 | host: '0.0.0.0', 12 | public: ip + ':8080/web', 13 | publicPath: '', 14 | }; 15 | config.plugins.push(new webpack.HotModuleReplacementPlugin()); 16 | console.log('server is running! Please open ' + chalk.green('http://' + ip + ':8080/web/index.html')); 17 | module.exports = config; 18 | --------------------------------------------------------------------------------