Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coderyi/hello-weex
hello-weex包括一个Weex App(GitHub第三方App),和自己扩展的WeexiOSKit(iOS上的常用组件与模块)。
https://github.com/coderyi/hello-weex
android cross-platform github ios javascript react-native weex
Last synced: 15 days ago
JSON representation
hello-weex包括一个Weex App(GitHub第三方App),和自己扩展的WeexiOSKit(iOS上的常用组件与模块)。
- Host: GitHub
- URL: https://github.com/coderyi/hello-weex
- Owner: coderyi
- Created: 2016-10-23T13:17:59.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-05-06T02:03:38.000Z (over 4 years ago)
- Last Synced: 2024-08-04T11:02:23.194Z (3 months ago)
- Topics: android, cross-platform, github, ios, javascript, react-native, weex
- Language: Java
- Homepage:
- Size: 7.02 MB
- Stars: 191
- Watchers: 13
- Forks: 40
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hello Weex
### 简介
hello-weex包括一个Weex App,和自己扩展的WeexiOSKit。
weex version为
[v0.7.0 - 10月16日](https://github.com/alibaba/weex/tree/cb65b3cb892b2ddd36528b2c971303a529d68bd3)的版本Weex App 的代码位于 [examples](https://github.com/coderyi/hello-weex/tree/master/examples)目录下
WeexiOSKit的代码位于 [ios/playground/WeexDemo/WeexiOSKit](https://github.com/coderyi/hello-weex/tree/master/ios/playground/WeexDemo/WeexiOSKit)目录下
### 运行
0. 环境
0. 安装 [Node.js](http://nodejs.org/) 4.0+
0. 在根目录下
0. `npm install`, 安装工程
0. `./start` 到这里web版已经运行起来,浏览器输入`http://localhost:12580/` 就能看到了。
0. Install [iOS Environment](https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppStoreDistributionTutorial/Setup/Setup.html)
0. Install [CocoaPods](https://guides.cocoapods.org/using/getting-started.html)
0. 运行 iOS playground
0. `cd ios/playground`
0. `pod install`
0. 在 Xcode里打开 `WeexDemo.xcworkspace`
0. 点击Xcode的 (`Run` 按钮) 或者用快捷键 `cmd + r`
0. 如果你想在真机上运行. 在 `DemoDefine.h`, 修改 `CURRENT_IP` 为你自己的IP### Weex App: Monkey for GitHub
Monkey主要是用来展示GitHub上的开发者的排名,以及仓库的排名。
### WeexiOSKit
WeexiOSKit主要是扩展了一些iOS的Component和Module,这样在weex端就可以很好的使用了。
Component 包括segmented-control(UISegmentedControl),stepper(UIStepper),seek-bar(UISeekBar),search-bar(UISearchBar),date-picker(UIDatePicker)。
Module主要包括actionSheet(UIActionSheet),MBProgressHUD(MBProgressHUD,loading视图),geolocation(CLLocationManager坐标),vibration(震动)。
#### Component
#### Module
### WeexiOSKit使用
#### Component
segmented-control:支持iOS & web
属性:items(segmented-control里的项目,以分号隔开),momentary(是否设置选中状态),tint-color(颜色)
event:`onchange````
```
stepper
属性: value(当前的值),step-value(默认为1),minimum-value(最小值),maximum-value="100(最大值),tint-color(颜色)
event:`onchange````
```
seek-bar
属性: value(当前的值),minimum-value(最小值),maximum-value="100(最大值),minimum-track-tint-color,maximum-track-tint-color, thumb-tint-color, minimum-track-image-src,maximum-track-image-src,thumb-image-src
event:`onchange````
```
search-bar
属性: tint-color(颜色)
event:`onclick ````
```
date-picker
属性: tint-color(颜色)
event:`onchange ````
```
#### Module
MBProgressHUD为loading模块
函数:showHUD(显示HUD,参数为title,detail,mode[枚举值indicator/text],cancelTitle,contentColor),hideHUD隐藏HUD()```
toast: function() {
var MBProgressHUD = require('@weex-module/MBProgressHUD');
MBProgressHUD.showHUD({title:"loading",contentColor:"red",mode:"indicator"});
setTimeout(function () {
MBProgressHUD.hideHUD();
}, 2000)
}
```actionSheet
函数:actionSheetShow(参数为cancelButtonTitle,destructiveButtonTitle,otherButtonTitles(数组),以及一个回调)```
actionSheet: function() {
var me= this;
var actionSheet = require('@weex-module/actionSheet');
actionSheet.actionSheetShow({
'cancelButtonTitle': 'cancel',
'destructiveButtonTitle': 'destructive',
'otherButtonTitles': me.buttons
}, function(result) {
});
}
```geolocation 定位模块
函数getCurrentPosition(参数accuracy,distanceFilter)
```
geolocationAction: function() {
var me= this;
var geolocation = require('@weex-module/geolocation');
geolocation.getCurrentPosition({
'accuracy': '1000',
'distanceFilter': '10'
}, function(result) {
me.geolocationValue = JSON.stringify(result);
}, function(result) {
});
}
```vibration
函数:vibrate(真机震动)```
vibrate: function() {
var vibration = require('@weex-module/vibration');
vibration.vibrate()
}
```### weex-web-kit
weex-web-kit代码位于[html5/browser/weex-web-kit](https://github.com/coderyi/hello-weex/tree/master/html5/browser/weex-web-kit)目录下
```
```
#### Licenses
All source code is licensed under the [MIT License](https://opensource.org/licenses/MIT).