• Stars
    star
    191
  • Rank 202,846 (Top 4 %)
  • Language
    Java
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

hello-weex包括一个Weex App(GitHub第三方App),和自己扩展的WeexiOSKit(iOS上的常用组件与模块)。

Hello Weex

简介

hello-weex包括一个Weex App,和自己扩展的WeexiOSKit。

weex version为 v0.7.0 - 10月16日的版本

Weex App 的代码位于 examples目录下

WeexiOSKit的代码位于 ios/playground/WeexDemo/WeexiOSKit目录下

运行

  1. 环境 0. 安装 Node.js 4.0+ 0. 在根目录下 0. npm install, 安装工程 0. ./start 到这里web版已经运行起来,浏览器输入http://localhost:12580/ 就能看到了。 0. Install iOS Environment 0. Install CocoaPods
  2. 运行 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

<segmented-control 
	style="width: 240;height: 120;margin-top:20" 
	items="hello;world" 
	momentary= "false" 
	tint-color= "red" 
	onchange="onSCChangeAction">
</segmented-control>

stepper
属性: value(当前的值),step-value(默认为1),minimum-value(最小值),maximum-value="100(最大值),tint-color(颜色)

event:onchange

<stepper 
	style="width: 240;height: 120;margin-top:20" 
	value="20" 
	step-value= "10" 
	minimum-value="0" 
	maximum-value="100" 
	tint-color= "red" 
	onchange="onChangeAction">
</stepper>

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

<seek-bar 
	style=" width: 400;height: 70;margin-top:20;margin-left:20" 
	minimum-value="0" 
	maximum-value="100" 
	value="50" 
	onchange="seekBarChange" 
	minimum-track-tint-color="blue" 
	maximum-track-tint-color="blue" 
	thumb-tint-color="red" > 
</seek-bar>

<seek-bar 
	style=" width: 160;height: 140;margin-top:20;margin-left:220" 
	minimum-value="0" 
	maximum-value="100" 
	value="50" 
	thumb-image-src="https://raw.githubusercontent.com/jainsourabh2/SayIt/master/iOS/SayIt/SayIt/rating1.png" 
	maximum-track-image-src="http://pic002.cnblogs.com/images/2012/348285/2012042611243397.png" 
	minimum-track-image-src="http://pic002.cnblogs.com/images/2012/348285/2012042611244465.png" 	
	onchange="imageSeekBarChange"> 
</seek-bar>

search-bar
属性: tint-color(颜色)

event:onclick

<search-bar 
	style="width: 300;height: 120;margin-top:20"  
	tint-color= "red" 
	onclick="onclicksearch">
</search-bar>

date-picker
属性: tint-color(颜色)

event:onchange

<date-picker 
	style="width: 640;height: 400;margin-top:20"  
	tint-color= "red" 
	onchange="onclickdatepicker" >
</date-picker>

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目录下

<segmented-control 
	style="width: 240;height: 120;margin-top:20" 
	items="hello;world" 
	momentary= "false" 
	tint-color= "red" 
	onchange="onChangeAction">
</segmented-control>

Licenses

All source code is licensed under the MIT License.

More Repositories

1

Monkey

Monkey is an unofficial GitHub client for iOS,to show the rank of coders and repositories.
Objective-C
1,784
star
2

NetworkEye

a iOS network debug library, monitor HTTP requests
Objective-C
1,382
star
3

MVVMDemo

MVVM应用在iOS的Demo,主要通过经典的TableView来演示
Objective-C
329
star
4

YiRefresh

a simple way to use pull-to-refresh.下拉刷新,大道至简,最简单的网络刷新控件
Objective-C
252
star
5

DecouplingKit

decoupling between modules in your iOS Project. iOS模块化过程中模块间解耦方案
Objective-C
139
star
6

YiVideoEditor

YiVideoEditor is a library for rotating, cropping, adding layers (watermark) and as well as adding audio (music) to the videos.
Swift
104
star
7

YiSlideMenu

SlideMenu,简洁的侧边菜单,清爽风格.
Objective-C
94
star
8

MonkeyForMac

Monkey is a unofficial GitHub client
Objective-C
66
star
9

YiLotteryDemo

模仿美团积分抽奖功能
Objective-C
61
star
10

StateMachineSwift

StateMachineSwift, state machine library for Swift, supports an arbitrary number of States and Events.
Swift
42
star
11

bluedog

蓝牙调试助手小程序,支持扫描蓝牙设备,读取设备服务与特征
JavaScript
33
star
12

NewsDemo

模仿网易新闻客户端首页,实现滑动选择菜单。
Objective-C
30
star
13

markthing

online markdown editor with live preview. 在线markdown编辑器。http://coderyi.com/markthing/
JavaScript
28
star
14

ActionStage

ActionStage that dispatch message, decoupling between modules
Objective-C
27
star
15

monkeyweb

Monkey show the rank of coders and repositories on GitHub. http://coderyi.com/monkeyweb/
TypeScript
24
star
16

iOSSourceCodeAnalyze

《iOS开源库源码分析》http://coderyi.com/iOSSourceCodeAnalyze/
HTML
16
star
17

EventBus

A lightweight event bus for C++
C++
12
star
18

AutoLayoutDemo

AutoLayout代码实现方式的基本使用,包括NSLayoutConstraint创建一个约束,VFL创建一组约束以及使用Autolayout实现UITableView的Cell动态布局和高度动态改变
Objective-C
12
star
19

URLParser

an url parse/encode/decode tool
C++
10
star
20

iOSDemos

iOSDemos
Swift
9
star
21

YiUUID

This library provides the simplest API to obtain universally unique identifiers with different levels of persistence.
Swift
8
star
22

YiSwitch

类似UISwitch,想要水平的竖直的,圆的方的,有图片的没图片的,各种YiSwitch,最后原谅我的图片。
Objective-C
8
star
23

AssetsLibraryDemo

通过AssetsLibrary实现访问相册
Objective-C
6
star
24

YiDispatchQueue

a more convenient tool for dispatch queue
Objective-C
6
star
25

monkey-bytedance-miniapp

Monkey是一个可以展示GitHub上开发者、仓库排名的应用
JavaScript
5
star
26

qrcode-generator

在线二维码生成器,解码。http://coderyi.com/qrcode-generator/
Vue
5
star
27

YiAppUpdater

Checks if there is a newer version of your app in the AppStore and alerts the user to update.
Swift
5
star
28

StringFormat

A String Format Kit
Swift
4
star
29

monkey-weex

Monkey是一个GitHub Weex客户端,展示GitHub用户和仓库的排名
JavaScript
4
star
30

statemachine

An C++ library for implementing state machines.
C++
3
star
31

monkey-github-api

GitHub API for TypeScript
TypeScript
3
star
32

SystemServiceSwift

all available information about a device.
Swift
3
star
33

YiViewDrag

UIView extension that adds dragging capabilities
Swift
2
star
34

JavaScriptDemos

Objective-C
2
star
35

python-demos

python3-demos
Python
2
star
36

CounterVIPER

A simple example of the VIPER architecture for iOS apps
Swift
2
star
37

blog

1
star
38

coderyi.github.io

HTML
1
star
39

TestProject

1
star