├── .metadata ├── app-dependency-modules.json ├── app-dependency-modules │ ├── M1354_syssetting.json │ ├── M2590_PickerView.json │ ├── do_3DTouch.json │ ├── do_ALayout.json │ ├── do_AccelerometerSensor.json │ ├── do_Album.json │ ├── do_Algorithm.json │ ├── do_Alipay.json │ ├── do_Animation.json │ ├── do_Animator.json │ ├── do_App.json │ ├── do_AppleIAP.json │ ├── do_AssistiveTouch.json │ ├── do_Audio.json │ ├── do_BarcodeView.json │ ├── do_Bitmap.json │ ├── do_Bluetooth.json │ ├── do_BorderView.json │ ├── do_Button.json │ ├── do_CacheManager.json │ ├── do_Calendar.json │ ├── do_Camera.json │ ├── do_CheckBox.json │ ├── do_ComboBox.json │ ├── do_Contact.json │ ├── do_CoverFlowView.json │ ├── do_DataCache.json │ ├── do_DateTimePicker.json │ ├── do_Device.json │ ├── do_Dialog.json │ ├── do_ExpandableListView.json │ ├── do_External.json │ ├── do_FragmentView.json │ ├── do_FrameAnimationView.json │ ├── do_GestureView.json │ ├── do_Global.json │ ├── do_GridView.json │ ├── do_GyroSensor.json │ ├── do_HashData.json │ ├── do_Http.json │ ├── do_ImageBrowser.json │ ├── do_ImageCropView.json │ ├── do_ImageView.json │ ├── do_IndexListView.json │ ├── do_InitData.json │ ├── do_Label.json │ ├── do_LinearLayout.json │ ├── do_ListData.json │ ├── do_ListView.json │ ├── do_LocalNotification.json │ ├── do_MarqueeLabel.json │ ├── do_MultiSelectComboBox.json │ ├── do_Network.json │ ├── do_Notification.json │ ├── do_PDFView.json │ ├── do_Page.json │ ├── do_PainterView.json │ ├── do_Picker.json │ ├── do_ProgressBar.json │ ├── do_ProgressBar1.json │ ├── do_ProgressBar2.json │ ├── do_QRCode.json │ ├── do_RichLabel.json │ ├── do_RichLabel1.json │ ├── do_SQLite.json │ ├── do_SangforVPN.json │ ├── do_ScrollView.json │ ├── do_SeekBar.json │ ├── do_SegmentView.json │ ├── do_Sensor.json │ ├── do_SlideListView.json │ ├── do_SlideView.json │ ├── do_Socket.json │ ├── do_Storage.json │ ├── do_SwitchView.json │ ├── do_TencentQQ.json │ ├── do_TextBox.json │ ├── do_TextField.json │ ├── do_Timer.json │ ├── do_TouchID.json │ ├── do_Unionpay.json │ ├── do_VerticalSlideView.json │ ├── do_VideoRecord.json │ ├── do_VideoView.json │ ├── do_ViewShower.json │ ├── do_WebView.json │ └── do_iFlyVoice.json └── deviceone.js ├── .project ├── .settings ├── org.eclipse.core.resources.prefs └── tern.eclipse.ide.core.prefs ├── .tern-project ├── README.md ├── app.doproj ├── initdata ├── .README └── mock │ └── baidu │ └── s_POST.json └── source ├── app.js ├── image ├── appGuide1.png ├── appGuide2.png ├── appGuide3.png ├── samples │ ├── a_1.png │ ├── a_2.png │ ├── arrow.png │ ├── b_1.png │ ├── b_2.png │ ├── c_1.png │ ├── c_2.png │ ├── d_1.png │ ├── d_2.png │ ├── e_1.png │ └── e_2.png └── start.png ├── modules ├── appGuide │ ├── call.js │ ├── sample │ │ ├── image │ │ │ ├── 1.JPG │ │ │ ├── 2.JPG │ │ │ ├── 3.JPG │ │ │ └── 4.JPG │ │ └── test.js │ └── src │ │ ├── img_template.ui │ │ ├── img_template.ui.js │ │ ├── main.ui │ │ ├── main.ui.js │ │ ├── ui_template.ui │ │ └── ui_template.ui.js ├── baseLayer │ ├── call.js │ ├── sample │ │ ├── baseLayerCallback.js │ │ └── test.js │ └── src │ │ ├── main.ui │ │ └── main.ui.js ├── forgetPassword │ ├── call.js │ ├── sample │ │ ├── forgetPasswordCallback.js │ │ └── test.js │ └── src │ │ ├── close.png │ │ ├── main.ui │ │ └── main.ui.js ├── image │ └── return.png ├── inputTextField │ ├── call.js │ ├── sample │ │ └── test.js │ └── src │ │ ├── close.png │ │ ├── main.ui │ │ └── main.ui.js ├── login │ ├── call.js │ ├── sample │ │ ├── loginCallback.js │ │ └── test.js │ └── src │ │ ├── QQ.png │ │ ├── close.png │ │ ├── main.ui │ │ ├── main.ui.js │ │ ├── pwd.png │ │ ├── sina.png │ │ ├── user.png │ │ └── weixin.png ├── mainFrame │ ├── call.js │ ├── sample │ │ ├── a.ui │ │ ├── a.ui.js │ │ ├── b.ui │ │ ├── b.ui.js │ │ ├── c.ui │ │ ├── c.ui.js │ │ ├── d.ui │ │ ├── d.ui.js │ │ ├── img │ │ │ ├── a_1.png │ │ │ ├── a_2.png │ │ │ ├── b_1.png │ │ │ ├── b_2.png │ │ │ ├── c_1.png │ │ │ ├── c_2.png │ │ │ ├── d_1.png │ │ │ └── d_2.png │ │ └── test.js │ └── src │ │ ├── main.ui │ │ ├── main.ui.js │ │ ├── main_1.ui │ │ └── main_1.ui.js ├── popupMenu │ ├── call.js │ ├── sample │ │ └── test.js │ └── src │ │ ├── main.ui │ │ ├── main.ui.js │ │ ├── main_1.ui │ │ ├── main_1.ui.js │ │ ├── main_2.ui │ │ └── main_2.ui.js ├── realNameAuth │ ├── call.js │ ├── sample │ │ ├── realNameAuthCallback.js │ │ └── test.js │ └── src │ │ ├── close.png │ │ ├── main.ui │ │ ├── main.ui.js │ │ ├── real_name1.png │ │ ├── real_name2.png │ │ └── real_name3.png ├── register │ ├── call.js │ ├── sample │ │ ├── registerCallback.js │ │ └── test.js │ └── src │ │ ├── close.png │ │ ├── main.ui │ │ └── main.ui.js ├── scanBarcode │ ├── call.js │ ├── sample │ │ └── test.js │ └── src │ │ ├── main.ui │ │ └── main.ui.js ├── simpleIndex │ ├── call.js │ ├── sample │ │ ├── a.js │ │ ├── a.png │ │ ├── b.png │ │ ├── b.ui │ │ ├── b.ui.js │ │ ├── c.png │ │ ├── c.ui │ │ ├── c.ui.js │ │ ├── d.png │ │ ├── d.ui │ │ ├── d.ui.js │ │ ├── e.ui │ │ ├── e.ui.js │ │ └── test.js │ └── src │ │ ├── arrow.png │ │ ├── main.ui │ │ ├── main.ui.js │ │ ├── main_1.ui │ │ ├── main_1.ui.js │ │ ├── main_2.ui │ │ ├── main_2.ui.js │ │ ├── main_3.ui │ │ └── main_3.ui.js ├── singleChoiceList │ ├── call.js │ ├── sample │ │ └── test.js │ └── src │ │ ├── cell.ui │ │ ├── cell.ui.js │ │ ├── main.ui │ │ ├── main.ui.js │ │ ├── select.png │ │ ├── seperate.ui │ │ └── seperate.ui.js └── waittingLayer │ ├── call.js │ ├── sample │ └── test.js │ └── src │ ├── main.ui │ └── main.ui.js ├── samples ├── api │ ├── main.ui │ ├── main.ui.js │ ├── main_1.ui │ └── main_1.ui.js ├── modules │ ├── README.md │ ├── main.ui │ ├── main.ui.js │ ├── main_1.ui │ └── main_1.ui.js ├── others │ ├── main.ui │ ├── main.ui.js │ ├── main_1.ui │ └── main_1.ui.js ├── script │ ├── dojs │ │ ├── core │ │ │ ├── README.md │ │ │ ├── inPage.js │ │ │ ├── index.js │ │ │ ├── newUUID.js │ │ │ └── print.js │ │ ├── global │ │ │ ├── README.md │ │ │ └── index.js │ │ ├── http │ │ │ ├── README.md │ │ │ ├── cacheLastResult.js │ │ │ ├── fullOption.js │ │ │ ├── getPara.js │ │ │ ├── index.js │ │ │ ├── mockData │ │ │ │ ├── index.js │ │ │ │ ├── mockCondition.js │ │ │ │ ├── mockData.js │ │ │ │ └── mockResult.js │ │ │ ├── needWaitting.js │ │ │ ├── postPara.js │ │ │ ├── requestWithWaiting.js │ │ │ └── simpleRequest.js │ │ ├── page │ │ │ ├── README.md │ │ │ └── index.js │ │ └── style │ │ │ ├── README.md │ │ │ ├── main.ui │ │ │ └── main.ui.js │ ├── main.ui │ ├── main.ui.js │ ├── main_1.ui │ ├── main_1.ui.js │ └── tools │ │ └── twowaybinding │ │ ├── index.js │ │ ├── main.ui │ │ └── main.ui.js └── userControls │ ├── README.md │ ├── demo.ui │ ├── demo.ui.js │ ├── main.ui │ ├── main.ui.js │ ├── main_1.ui │ └── main_1.ui.js ├── script ├── .README ├── do │ ├── core.js │ ├── defaultSetting │ │ ├── coreSetting.js │ │ ├── globalSetting.js │ │ ├── httpSetting.js │ │ ├── pageSetting.js │ │ └── styleSetting.js │ ├── global.js │ ├── http.js │ ├── page.js │ └── style.js ├── dojs.js ├── ext │ ├── arrayExt.js │ ├── dateExt.js │ └── stringExt.js └── tools │ ├── crypt │ ├── md5.js │ ├── ripemd160.js │ ├── sha1.js │ ├── sha256.js │ └── sha512.js │ ├── res │ └── region.js │ └── twowayBinding.js └── userControls ├── appGuide ├── sample │ └── test.js └── src │ ├── main.ui │ ├── main.ui.js │ ├── template.ui │ └── template.ui.js ├── imageBanner ├── sample │ ├── banner1.jpg │ ├── banner2.jpg │ ├── banner3.jpg │ └── test.js └── src │ ├── main.ui │ ├── main.ui.js │ ├── template.ui │ └── template.ui.js ├── radioButton ├── sample │ └── test.js └── src │ ├── main.ui │ └── main.ui.js ├── starComment ├── sample │ └── test.js └── src │ ├── main.ui │ ├── main.ui.js │ ├── star.png │ └── starep.png ├── topBar ├── sample │ ├── add.png │ ├── background.jpg │ ├── return.png │ └── test.js └── src │ ├── main.ui │ └── main.ui.js └── userControl.js /.metadata/app-dependency-modules/M1354_syssetting.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "M1354_syssetting", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "UIType": "Layout", 6 | "Name": "系统设置", 7 | "Version": "Internal", 8 | "Description": "M1354_syssetting组件封装了启动系统常用的设置页面的接口,如:蓝牙设置、定位设置、WiFi设置等。", 9 | "Icon": "https://do-store.oss-cn-beijing.aliyuncs.com/D/20160925/M1354_syssetting/gear19.png", 10 | "BBS": "http://bbs.deviceone.net/forum.php?mod=viewthread&tid=914", 11 | "Keyword": "设备功能", 12 | "IOS": { 13 | "Support": 0, 14 | "MinVersion": "" 15 | }, 16 | "Android": { 17 | "Support": 1, 18 | "MinVersion": "4.0" 19 | }, 20 | "Windows": { 21 | "Support": 0, 22 | "MinVersion": "" 23 | }, 24 | "WindowsPhone": { 25 | "Support": 0, 26 | "MinVersion": "" 27 | }, 28 | "Html": { 29 | "Support": 1, 30 | "MinVersion": "5.0" 31 | }, 32 | "Properties": [], 33 | "Events": [], 34 | "syncMethodes": [ 35 | { 36 | "ID": "open", 37 | "Name": "open", 38 | "Description": "打开系统设置", 39 | "ReturnType": "", 40 | "ReturnType_JavaScript": "", 41 | "ReturnDesc": "", 42 | "Paras": [ 43 | { 44 | "ID": "type", 45 | "Name": "type", 46 | "Type": "String", 47 | "Type_JavaScript": "String", 48 | "Required": 0, 49 | "DefaultValue": "", 50 | "Description": "设置的具体页面" 51 | } 52 | ] 53 | } 54 | ], 55 | "asyncMethodes": [] 56 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/M2590_PickerView.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "M2590_PickerView", 3 | "IsContainer": "*", 4 | "Type": "UI", 5 | "UIType": "Container", 6 | "Name": "滑动选择框", 7 | "Version": "Internal", 8 | "Description": "null", 9 | "Icon": "", 10 | "BBS": "null", 11 | "Keyword": "null", 12 | "IOS": { 13 | "Support": 0, 14 | "MinVersion": "" 15 | }, 16 | "Android": { 17 | "Support": 1, 18 | "MinVersion": "19" 19 | }, 20 | "Windows": { 21 | "Support": 0, 22 | "MinVersion": "" 23 | }, 24 | "WindowsPhone": { 25 | "Support": 0, 26 | "MinVersion": "" 27 | }, 28 | "Html": { 29 | "Support": 1, 30 | "MinVersion": "5.0" 31 | }, 32 | "Properties": [], 33 | "Events": [ 34 | { 35 | "ID": "cancel", 36 | "Description": "点击取消", 37 | "ReturnType": "", 38 | "ReturnType_JavaScript": "", 39 | "ReturnDesc": "" 40 | }, 41 | { 42 | "ID": "ok", 43 | "Description": "选择框确定按钮", 44 | "ReturnType": "Node", 45 | "ReturnType_JavaScript": "Node", 46 | "ReturnDesc": "返回选择的对象" 47 | } 48 | ], 49 | "syncMethodes": [ 50 | { 51 | "ID": "bindItems", 52 | "Name": "bindItems", 53 | "Description": "", 54 | "ReturnType": "", 55 | "ReturnType_JavaScript": "", 56 | "ReturnDesc": "", 57 | "Paras": [ 58 | { 59 | "ID": "json", 60 | "Name": "json", 61 | "Type": "Node", 62 | "Type_JavaScript": "Node", 63 | "Required": 0, 64 | "DefaultValue": "", 65 | "Description": "" 66 | } 67 | ] 68 | }, 69 | { 70 | "ID": "refreshItems", 71 | "Name": "refreshItems", 72 | "Description": "", 73 | "ReturnType": "", 74 | "ReturnType_JavaScript": "", 75 | "ReturnDesc": "", 76 | "Paras": [] 77 | }, 78 | { 79 | "ID": "setSelected", 80 | "Name": "setSelected", 81 | "Description": "", 82 | "ReturnType": "", 83 | "ReturnType_JavaScript": "", 84 | "ReturnDesc": "", 85 | "Paras": [ 86 | { 87 | "ID": "index", 88 | "Name": "index", 89 | "Type": "Number", 90 | "Type_JavaScript": "Number", 91 | "Required": 0, 92 | "DefaultValue": "", 93 | "Description": "index" 94 | } 95 | ] 96 | } 97 | ], 98 | "asyncMethodes": [] 99 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_AccelerometerSensor.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_AccelerometerSensor", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "UIType": "Layout", 6 | "Name": "加速度传感器", 7 | "Version": "Internal", 8 | "Description": "Windows平台不支持", 9 | "Icon": "", 10 | "BBS": "", 11 | "Keyword": "设备功能", 12 | "IOS": { 13 | "Support": 1, 14 | "MinVersion": "7.0" 15 | }, 16 | "Android": { 17 | "Support": 1, 18 | "MinVersion": "4.0" 19 | }, 20 | "Windows": { 21 | "Support": 1, 22 | "MinVersion": "10" 23 | }, 24 | "WindowsPhone": { 25 | "Support": 1, 26 | "MinVersion": "10" 27 | }, 28 | "Html": { 29 | "Support": 1, 30 | "MinVersion": "5.0" 31 | }, 32 | "Properties": [], 33 | "Events": [ 34 | { 35 | "ID": "change", 36 | "Description": "加速度变化触发", 37 | "ReturnType": "Node", 38 | "ReturnType_JavaScript": "Node", 39 | "ReturnDesc": "{x:'x轴的加速度',y:'y轴的加速度',z:'z轴的加速度'}" 40 | }, 41 | { 42 | "ID": "shake", 43 | "Description": "摇一摇", 44 | "ReturnType": "String", 45 | "ReturnType_JavaScript": "String", 46 | "ReturnDesc": "" 47 | } 48 | ], 49 | "syncMethodes": [ 50 | { 51 | "ID": "getAccelerometerData", 52 | "Name": "获取加速度", 53 | "Description": "手机绕三个方向运动的加速度", 54 | "ReturnType": "Node", 55 | "ReturnType_JavaScript": "Node", 56 | "ReturnDesc": "{x:'x轴的加速度',y:'y轴的加速度',z:'z轴的加速度'}", 57 | "Paras": [] 58 | }, 59 | { 60 | "ID": "start", 61 | "Name": "开始采集数据", 62 | "Description": "", 63 | "ReturnType": "", 64 | "ReturnType_JavaScript": "", 65 | "ReturnDesc": "", 66 | "Paras": [] 67 | }, 68 | { 69 | "ID": "stop", 70 | "Name": "停止采集数据", 71 | "Description": "", 72 | "ReturnType": "", 73 | "ReturnType_JavaScript": "", 74 | "ReturnDesc": "", 75 | "Paras": [] 76 | } 77 | ], 78 | "asyncMethodes": [] 79 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_Animator.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_Animator", 3 | "IsContainer": "0", 4 | "Type": "MM", 5 | "Name": "属性动画组合", 6 | "Version": "Internal", 7 | "Description": "控制UI组件动画的状态变化,每个状态点都支持对应5种属性的变化:x, y, width,height,bgColor;也支持修改透明值alpha,如50表示半透明,若同时用bgColor的后两位和alpha修改了透明值,以alpha为主,若alpha为父容器,则里面的子组件的透明值也随着改变", 8 | "Icon": "https://do-store.oss-cn-beijing.aliyuncs.com/D/20160121/do_Animator/帧动画.jpg", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7.0" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 1, 19 | "MinVersion": "10" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 1, 23 | "MinVersion": "10" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [], 30 | "Events": [], 31 | "syncMethodes": [ 32 | { 33 | "ID": "append", 34 | "Name": "创建属性动画", 35 | "Description": "创建属性动画", 36 | "ReturnType": "", 37 | "ReturnDesc": "", 38 | "Paras": [ 39 | { 40 | "ID": "duration", 41 | "Name": "动画持续时间", 42 | "Type": "Number", 43 | "Required": 1, 44 | "DefaultValue": "", 45 | "Description": "单位为毫秒" 46 | }, 47 | { 48 | "ID": "props", 49 | "Name": "动画属性", 50 | "Type": "Node", 51 | "Required": 0, 52 | "DefaultValue": "", 53 | "Description": "这是一个JSON node节点,包含多个参数,参数集合如下:{'x':10,'y':50,'height':500...}为空时表示状态不变" 54 | }, 55 | { 56 | "ID": "curve", 57 | "Name": "动画曲线类型", 58 | "Type": "String", 59 | "Required": 0, 60 | "DefaultValue": "Linear", 61 | "Description": "支持四种情况:1.'EaseInOut'动画启动时候慢,中间快,结束的时候慢、2.'EaseIn'动画启动的时候慢、3.'EaseOut'动画结束的时候慢、4.'Linear'动画速度不变" 62 | } 63 | ] 64 | } 65 | ], 66 | "asyncMethodes": [] 67 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_AppleIAP.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_AppleIAP", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "Name": "Apple应用内支付", 6 | "Version": "Internal", 7 | "Description": "用户通过传入商品ID,数量可以调起Apple支付界面,同时支持商品重复购买更新", 8 | "Icon": "", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7.0" 12 | }, 13 | "Android": { 14 | "Support": 0, 15 | "MinVersion": "" 16 | }, 17 | "Windows": { 18 | "Support": 0, 19 | "MinVersion": "" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 0, 23 | "MinVersion": "" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [], 30 | "Events": [], 31 | "syncMethodes": [ 32 | { 33 | "ID": "restoreProduct", 34 | "Name": "恢复购买", 35 | "Description": "刷新产品购买状态,在不同设备上用同一账户购买过,调用该方法可以恢复成已购买状态;或购买后将应用卸载,重新安装后可恢复已购买状态", 36 | "ReturnType": "", 37 | "ReturnDesc": "", 38 | "Paras": [] 39 | } 40 | ], 41 | "asyncMethodes": [ 42 | { 43 | "ID": "purchase", 44 | "Name": "购买商品", 45 | "Description": "用户", 46 | "ReturnType": "String", 47 | "ReturnDesc": "得到苹果返回的一个收据(receipt),如果用verifyURL中两个枚举值之一作为验证,购买成功后会返回收据;若自己搭建service需将得到的receipt用http的post去请求https://buy.itunes.apple.com/verifyReceipt以校验是否购买成功", 48 | "Paras": [ 49 | { 50 | "ID": "productID", 51 | "Name": "产品ID", 52 | "Type": "String", 53 | "Required": 1, 54 | "DefaultValue": "", 55 | "Description": "对应iTunes Connect中配置的“产品ID“" 56 | }, 57 | { 58 | "ID": "verifyURL", 59 | "Name": "实际购买验证URL", 60 | "Type": "String", 61 | "Required": 0, 62 | "DefaultValue": "", 63 | "Description": "App Store上实际购买验证URL,是一个枚举值,开发测试用https://sandbox.itunes.apple.com/verifyReceipt。发布版用https://buy.itunes.apple.com/verifyReceipt,实际的项目中使用发布版,开发测试是用于调试测试。如果不填,就需要自己搭建server端去验证;苹果官方建议自己搭建service" 64 | } 65 | ] 66 | } 67 | ] 68 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_AssistiveTouch.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_AssistiveTouch", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "Name": "辅助按钮", 6 | "Version": "Internal", 7 | "Description": "可用于模拟类似iOS设备的AssistiveTouch按钮,支持自定义样式和大小;android平台需要通过订阅page组件的pause和result事件来控制组件的显示和隐藏", 8 | "Icon": "https://do-store.oss-cn-beijing.aliyuncs.com/D/20160121/do_AssistiveTouch/辅助按钮.jpg", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7.0" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 1, 19 | "MinVersion": "10" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 1, 23 | "MinVersion": "10" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [], 30 | "Events": [ 31 | { 32 | "ID": "touch", 33 | "Description": "点击view触发", 34 | "ReturnType": "String", 35 | "ReturnType_JavaScript": "String", 36 | "ReturnDesc": "" 37 | } 38 | ], 39 | "syncMethodes": [ 40 | { 41 | "ID": "hideView", 42 | "Name": "隐藏辅助按钮", 43 | "Description": "", 44 | "ReturnType": "", 45 | "ReturnType_JavaScript": "", 46 | "ReturnDesc": "", 47 | "Paras": [] 48 | }, 49 | { 50 | "ID": "showView", 51 | "Name": "显示辅助按钮", 52 | "Description": "可设置view的样式、位置和是否移动", 53 | "ReturnType": "", 54 | "ReturnType_JavaScript": "", 55 | "ReturnDesc": "", 56 | "Paras": [ 57 | { 58 | "ID": "location", 59 | "Name": "view初始的位置", 60 | "Type": "String", 61 | "Type_JavaScript": "String", 62 | "Required": 1, 63 | "DefaultValue": "", 64 | "Description": "x,y,中间用逗号隔开" 65 | }, 66 | { 67 | "ID": "image", 68 | "Name": "view的展示图片", 69 | "Type": "String", 70 | "Type_JavaScript": "String", 71 | "Required": 1, 72 | "DefaultValue": "", 73 | "Description": "图片地址,支持source://、data://路径" 74 | }, 75 | { 76 | "ID": "isMove", 77 | "Name": "是否支持移动", 78 | "Type": "Bool", 79 | "Type_JavaScript": "Bool", 80 | "Required": 0, 81 | "DefaultValue": "true", 82 | "Description": "view是否支持移动,缺省支持" 83 | } 84 | ] 85 | } 86 | ], 87 | "asyncMethodes": [] 88 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_BarcodeView.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_BarcodeView", 3 | "IsContainer": "0", 4 | "Type": "UI", 5 | "Name": "二维码扫描视图", 6 | "Version": "Internal", 7 | "Description": "条码扫描视图,能设置view的基本属性,宽高等,扫描框内有矩形校正区域,扫描时有简单的动画显示,支持一维码、二维码(包括QR码、DM码等),若想在页面已启动时就加载扫描功能,建议将start方法放在do_Page的loaded事件回调中执行", 8 | "Icon": "https://do-store.oss-cn-beijing.aliyuncs.com/D/20160121/do_BarcodeView/QR二维码.jpg", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7.0" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 1, 19 | "MinVersion": "10" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 1, 23 | "MinVersion": "10" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [ 30 | { 31 | "ID": "scanArea", 32 | "Name": "扫描的区域", 33 | "Type": "String", 34 | "Type_JavaScript": "String", 35 | "DefaultValue": "", 36 | "EditType": "1", 37 | "Group": "", 38 | "Description": "设置扫描区域的位置和宽高,x,y,width,height,中间用逗号隔开;扫描区域不建议设置超出组件本身宽高和范围;默认值取控件的一半宽高,居中显示,修改后必须重新调start才会生效", 39 | "Design": { 40 | "Type": "Text", 41 | "Data": [] 42 | } 43 | } 44 | ], 45 | "Events": [], 46 | "syncMethodes": [ 47 | { 48 | "ID": "flash", 49 | "Name": "开关闪光灯", 50 | "Description": "开关手机系统闪光灯", 51 | "ReturnType": "", 52 | "ReturnType_JavaScript": "", 53 | "ReturnDesc": "", 54 | "Paras": [ 55 | { 56 | "ID": "status", 57 | "Name": "闪光灯状态", 58 | "Type": "String", 59 | "Type_JavaScript": "String", 60 | "Required": 1, 61 | "DefaultValue": "", 62 | "Description": "闪光灯状态,支持两种状态:on(开启)、off(关闭)" 63 | } 64 | ] 65 | } 66 | ], 67 | "asyncMethodes": [ 68 | { 69 | "ID": "start", 70 | "Name": "启动扫描", 71 | "Description": "条码扫描成功后会自动停止并执行异步回调,将扫描结果返回,如需再次扫描需重新调用该方法", 72 | "ReturnType": "Node", 73 | "ReturnType_JavaScript": "Node", 74 | "ReturnDesc": "返回data是一个JSON对象类型", 75 | "Paras": [] 76 | } 77 | ] 78 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_CacheManager.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_CacheManager", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "Name": "缓存管理", 6 | "Version": "Internal", 7 | "Description": "管理应用内缓存,windows平台不支持", 8 | "Icon": "https://deviceone.blob.core.chinacloudapi.cn/store/D/20151230/do_CacheManager/iconfont-huancunfuwu20x20.png", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7.0" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 0, 19 | "MinVersion": "" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 0, 23 | "MinVersion": "" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [], 30 | "Events": [], 31 | "syncMethodes": [], 32 | "asyncMethodes": [ 33 | { 34 | "ID": "clearImageCache", 35 | "Name": "清除图片缓存", 36 | "Description": "清除应用内所有图片缓存", 37 | "ReturnType": "Bool", 38 | "ReturnDesc": "成功返回true,失败返回false", 39 | "Paras": [] 40 | }, 41 | { 42 | "ID": "getImageCacheSize", 43 | "Name": "获取图片缓存", 44 | "Description": "获取", 45 | "ReturnType": "String", 46 | "ReturnDesc": "返回应用内所有图片缓存的大小总和,单位为k", 47 | "Paras": [] 48 | } 49 | ] 50 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_Calendar.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_Calendar", 3 | "IsContainer": "0", 4 | "Type": "UI", 5 | "Name": "日历控件", 6 | "Version": "Internal", 7 | "Description": "日历控件", 8 | "Icon": "", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7.0" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 1, 19 | "MinVersion": "10" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 1, 23 | "MinVersion": "10" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [], 30 | "Events": [ 31 | { 32 | "ID": "selectedDate", 33 | "Description": "点击日历上的日期触发事件", 34 | "ReturnType": "Node", 35 | "ReturnDesc": "返回当前选中的日期{'year':,'mouth':,'day':,'week':},年、月、日、星期" 36 | } 37 | ], 38 | "syncMethodes": [ 39 | { 40 | "ID": "getSelectedDate", 41 | "Name": "当前选中日期", 42 | "Description": "获取当前选中日期", 43 | "ReturnType": "Node", 44 | "ReturnDesc": "返回当前选中的日期{'year':,'mouth':,'day':,'week':},年、月、日、星期", 45 | "Paras": [] 46 | }, 47 | { 48 | "ID": "jump", 49 | "Name": "跳转到指定日期", 50 | "Description": "跳转到指定日期", 51 | "ReturnType": "", 52 | "ReturnDesc": "", 53 | "Paras": [ 54 | { 55 | "ID": "data", 56 | "Name": "日期数据数据", 57 | "Type": "String", 58 | "Required": 1, 59 | "DefaultValue": "", 60 | "Description": "data数据格式为:2016-03-05(yyyy-mm-dd)" 61 | } 62 | ] 63 | } 64 | ], 65 | "asyncMethodes": [] 66 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_DateTimePicker.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_DateTimePicker", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "Name": "日期,时间选择控件", 6 | "Version": "Internal", 7 | "Description": "弹出时间,日期选择窗口来选择时间,时间格式都是long型时间戳格式,windows平台不支持long型", 8 | "Icon": "https://do-store.oss-cn-beijing.aliyuncs.com/D/20160121/do_DateTimePicker/日期.jpg", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 1, 19 | "MinVersion": "10" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 1, 23 | "MinVersion": "10" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [], 30 | "Events": [], 31 | "syncMethodes": [], 32 | "asyncMethodes": [ 33 | { 34 | "ID": "show", 35 | "Name": "弹出选择日期,时间,或日期时间窗口", 36 | "Description": "", 37 | "ReturnType": "Node", 38 | "ReturnDesc": "{\"flag\":0,\"time\":\"2312412343\"},flag =0 表示点击了第一个按钮,flag = 1 表示点击了第二个按钮...,time表示long型时间", 39 | "Paras": [ 40 | { 41 | "ID": "type", 42 | "Name": "打开窗口的类型", 43 | "Type": "Number", 44 | "Required": 1, 45 | "DefaultValue": "", 46 | "Description": "0表示日期及时间,1表示只有日期,2表示只有时间,3表示日期、星期及时间" 47 | }, 48 | { 49 | "ID": "data", 50 | "Name": "预设置的日期", 51 | "Type": "String", 52 | "Required": 0, 53 | "DefaultValue": "", 54 | "Description": "long型时间,缺失值是当前日期时间long型" 55 | }, 56 | { 57 | "ID": "maxDate", 58 | "Name": "最大日期", 59 | "Type": "String", 60 | "Required": 0, 61 | "DefaultValue": "4102329600000", 62 | "Description": "long型时间,缺省值是2099年对应的long型" 63 | }, 64 | { 65 | "ID": "minDate", 66 | "Name": "最小日期", 67 | "Type": "String", 68 | "Required": 0, 69 | "DefaultValue": "0", 70 | "Description": "long型时间,最小日期不能大于最大日期,缺省值是1970年对应的long型" 71 | }, 72 | { 73 | "ID": "title", 74 | "Name": "窗口的标题", 75 | "Type": "String", 76 | "Required": 0, 77 | "DefaultValue": "日期时间选择", 78 | "Description": "缺省值是‘时间选择’或者‘日期选择’或者‘日期时间选择’,根据type来区分" 79 | }, 80 | { 81 | "ID": "buttons", 82 | "Name": "button集合", 83 | "Type": "Node", 84 | "Required": 0, 85 | "DefaultValue": "[\"取消\",\"确定\"]", 86 | "Description": "为空或不设值不显示按钮,显示缺省值,如果设值为[],则不显示按钮" 87 | } 88 | ] 89 | } 90 | ] 91 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_Dialog.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_Dialog", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "UIType": "Layout", 6 | "Name": "窗口", 7 | "Version": "Internal", 8 | "Description": "显示在屏幕上的窗口", 9 | "Icon": "", 10 | "BBS": "", 11 | "Keyword": "其它类型", 12 | "IOS": { 13 | "Support": 1, 14 | "MinVersion": "7.0" 15 | }, 16 | "Android": { 17 | "Support": 1, 18 | "MinVersion": "4.0" 19 | }, 20 | "Windows": { 21 | "Support": 1, 22 | "MinVersion": "10" 23 | }, 24 | "WindowsPhone": { 25 | "Support": 1, 26 | "MinVersion": "10" 27 | }, 28 | "Html": { 29 | "Support": 1, 30 | "MinVersion": "5.0" 31 | }, 32 | "Properties": [], 33 | "Events": [], 34 | "syncMethodes": [ 35 | { 36 | "ID": "close", 37 | "Name": "关闭窗口", 38 | "Description": "", 39 | "ReturnType": "", 40 | "ReturnType_JavaScript": "", 41 | "ReturnDesc": "", 42 | "Paras": [ 43 | { 44 | "ID": "data", 45 | "Name": "传递数据", 46 | "Type": "String", 47 | "Type_JavaScript": "String", 48 | "Required": 0, 49 | "DefaultValue": "", 50 | "Description": "在关闭窗口时data参数传递给open方法的回调函数" 51 | } 52 | ] 53 | }, 54 | { 55 | "ID": "getData", 56 | "Name": "获取数据", 57 | "Description": "", 58 | "ReturnType": "String", 59 | "ReturnType_JavaScript": "String", 60 | "ReturnDesc": "获取open方法的data参数保存的数据", 61 | "Paras": [] 62 | } 63 | ], 64 | "asyncMethodes": [ 65 | { 66 | "ID": "open", 67 | "Name": "打开窗口", 68 | "Description": "打开的窗口在屏幕中居中显示", 69 | "ReturnType": "", 70 | "ReturnType_JavaScript": "", 71 | "ReturnDesc": "返回close方法的data参数值", 72 | "Paras": [ 73 | { 74 | "ID": "path", 75 | "Name": "要显示的窗口路径", 76 | "Type": "String", 77 | "Type_JavaScript": "String", 78 | "Required": 1, 79 | "DefaultValue": "", 80 | "Description": "支持source和data目录" 81 | }, 82 | { 83 | "ID": "data", 84 | "Name": "数据", 85 | "Type": "String", 86 | "Type_JavaScript": "String", 87 | "Required": 0, 88 | "DefaultValue": "", 89 | "Description": "传递到Dialog的数据,通过getData方法获取该数据" 90 | }, 91 | { 92 | "ID": "supportClickClose", 93 | "Name": "支持点击关闭", 94 | "Type": "Bool", 95 | "Type_JavaScript": "Bool", 96 | "Required": 0, 97 | "DefaultValue": "true", 98 | "Description": "设置成true时可以通过点击窗口外页面其他空白处关闭当前窗口;为false时则不支持点击关闭" 99 | } 100 | ] 101 | } 102 | ] 103 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_GestureView.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_GestureView", 3 | "IsContainer": "0", 4 | "Type": "UI", 5 | "Name": "手势组件", 6 | "Version": "Internal", 7 | "Description": "手势组件,缺省是透明的,windowsPC不支持", 8 | "Icon": "", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7.0" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 1, 19 | "MinVersion": "10" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 1, 23 | "MinVersion": "10" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [], 30 | "Events": [ 31 | { 32 | "ID": "fling", 33 | "Description": "手指在触摸屏上迅速移动,并松开的动作,松开时触发", 34 | "ReturnType": "Node", 35 | "ReturnDesc": "{velocityX:'100',velocityY:'100'} 返回手指在手指x,y方向滑动的速率,其中正值表示的是往下和往右、负值表示的是往上和往左。iOS的速率是固定值" 36 | }, 37 | { 38 | "ID": "longTouch", 39 | "Description": "长按触发该事件", 40 | "ReturnType": "Node", 41 | "ReturnDesc": "{x:'100',y:'100'} 返回手指x,y在屏幕的绝对值" 42 | }, 43 | { 44 | "ID": "move", 45 | "Description": "手指在触摸屏上移动时触发", 46 | "ReturnType": "Node", 47 | "ReturnDesc": "{x:'100',y:'100'} 返回手指x,y在屏幕的绝对值" 48 | }, 49 | { 50 | "ID": "touch", 51 | "Description": "按下并在组件范围抬起,触发该事件", 52 | "ReturnType": "Node", 53 | "ReturnDesc": "{x:'100',y:'100'} 返回手指x,y在屏幕的绝对值" 54 | }, 55 | { 56 | "ID": "touchDown", 57 | "Description": "组件范围内按下即可触发", 58 | "ReturnType": "Node", 59 | "ReturnDesc": "{x:'100',y:'100'} 返回手指x,y在屏幕的绝对值" 60 | }, 61 | { 62 | "ID": "touchUp", 63 | "Description": "一旦按下,手指离开即触发,不论是否在组件范围内", 64 | "ReturnType": "Node", 65 | "ReturnDesc": "{x:'100',y:'100'} 返回手指x,y在屏幕的绝对值" 66 | } 67 | ], 68 | "syncMethodes": [], 69 | "asyncMethodes": [] 70 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_GyroSensor.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_GyroSensor", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "UIType": "Layout", 6 | "Name": "陀螺仪传感器", 7 | "Version": "Internal", 8 | "Description": "绕x/y/z三轴旋转的三个角度取值范围为 ±180,其中角度的正负遵循右手原则,即右手大拇指伸直,其余四指握拳,大拇指指向数轴,手指指向的方向为正,相反为负。Windows平台不支持", 9 | "Icon": "", 10 | "BBS": "", 11 | "Keyword": "设备功能", 12 | "IOS": { 13 | "Support": 1, 14 | "MinVersion": "7.0" 15 | }, 16 | "Android": { 17 | "Support": 1, 18 | "MinVersion": "4.0" 19 | }, 20 | "Windows": { 21 | "Support": 1, 22 | "MinVersion": "10" 23 | }, 24 | "WindowsPhone": { 25 | "Support": 1, 26 | "MinVersion": "10" 27 | }, 28 | "Html": { 29 | "Support": 1, 30 | "MinVersion": "5.0" 31 | }, 32 | "Properties": [], 33 | "Events": [ 34 | { 35 | "ID": "change", 36 | "Description": "加速度变化触发", 37 | "ReturnType": "Node", 38 | "ReturnType_JavaScript": "Node", 39 | "ReturnDesc": "{x:'绕x轴旋转的角度’,y:’绕y轴旋转的角度’,z:’绕z轴旋转的角度’}" 40 | } 41 | ], 42 | "syncMethodes": [ 43 | { 44 | "ID": "getAccelerometerData", 45 | "Name": "获取加速度", 46 | "Description": "手机绕三个方向运动的加速度", 47 | "ReturnType": "Node", 48 | "ReturnType_JavaScript": "Node", 49 | "ReturnDesc": "{x:'x轴的加速度',y:'y轴的加速度',z:'z轴的加速度'}", 50 | "Paras": [] 51 | }, 52 | { 53 | "ID": "getGyroData", 54 | "Name": "获取角度", 55 | "Description": "手机绕三个方向旋转的角度值", 56 | "ReturnType": "Node", 57 | "ReturnType_JavaScript": "Node", 58 | "ReturnDesc": "{x:'绕x轴旋转的角度’,y:’绕y轴旋转的角度’,z:’绕z轴旋转的角度’}", 59 | "Paras": [] 60 | }, 61 | { 62 | "ID": "start", 63 | "Name": "开始采集数据", 64 | "Description": "", 65 | "ReturnType": "", 66 | "ReturnType_JavaScript": "", 67 | "ReturnDesc": "", 68 | "Paras": [] 69 | }, 70 | { 71 | "ID": "stop", 72 | "Name": "停止采集数据", 73 | "Description": "", 74 | "ReturnType": "", 75 | "ReturnType_JavaScript": "", 76 | "ReturnDesc": "", 77 | "Paras": [] 78 | } 79 | ], 80 | "asyncMethodes": [] 81 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_ImageBrowser.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_ImageBrowser", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "UIType": "Layout", 6 | "Name": "图片预览", 7 | "Version": "Internal", 8 | "Description": "这个组件用于浏览大量网络或本地图片,图片路径可以http://链接或本地data://、source://、initdata://目录,支持放大后缩放原图,多图片支持左右滑动预览,进入浏览界面单击一下屏幕退出", 9 | "Icon": "https://do-store.oss-cn-beijing.aliyuncs.com/D/20160121/do_ImageBrowser/图片预览.jpg", 10 | "BBS": "", 11 | "Keyword": "图片处理", 12 | "IOS": { 13 | "Support": 1, 14 | "MinVersion": "7.0" 15 | }, 16 | "Android": { 17 | "Support": 1, 18 | "MinVersion": "4.0" 19 | }, 20 | "Windows": { 21 | "Support": 1, 22 | "MinVersion": "10" 23 | }, 24 | "WindowsPhone": { 25 | "Support": 1, 26 | "MinVersion": "10" 27 | }, 28 | "Html": { 29 | "Support": 1, 30 | "MinVersion": "5.0" 31 | }, 32 | "Properties": [], 33 | "Events": [ 34 | { 35 | "ID": "result", 36 | "Description": "点击关闭预览时触发", 37 | "ReturnType": "Node", 38 | "ReturnType_JavaScript": "Node", 39 | "ReturnDesc": "当前预览图片的索引{'index':''}" 40 | } 41 | ], 42 | "syncMethodes": [ 43 | { 44 | "ID": "show", 45 | "Name": "预览", 46 | "Description": "打开预览,图片底部显示当前图片索引和总图片数", 47 | "ReturnType": "", 48 | "ReturnType_JavaScript": "", 49 | "ReturnDesc": "", 50 | "Paras": [ 51 | { 52 | "ID": "data", 53 | "Name": "", 54 | "Type": "Node", 55 | "Type_JavaScript": "Node", 56 | "Required": 1, 57 | "DefaultValue": "", 58 | "Description": "预览图片传递数据结构[{ source : '', init : ''},{source :'' , init : ''}, ..... ]其中source 为原图,init为缩略图" 59 | }, 60 | { 61 | "ID": "index", 62 | "Name": "", 63 | "Type": "Number", 64 | "Type_JavaScript": "Number", 65 | "Required": 1, 66 | "DefaultValue": "0", 67 | "Description": "设置当前预览图片索引值,默认为0" 68 | } 69 | ] 70 | } 71 | ], 72 | "asyncMethodes": [] 73 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_ImageCropView.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_ImageCropView", 3 | "IsContainer": "0", 4 | "Type": "UI", 5 | "Name": "图片裁剪视图", 6 | "Version": "Internal", 7 | "Description": "图片裁剪视图,能设置view的基本属性,宽高等", 8 | "Icon": "https://do-store.oss-cn-beijing.aliyuncs.com/D/20160121/do_ImageCropView/裁剪图片视图.jpg", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 0, 19 | "MinVersion": "" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 1, 23 | "MinVersion": "10" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [ 30 | { 31 | "ID": "cropArea", 32 | "Name": "裁剪的区域", 33 | "Type": "String", 34 | "DefaultValue": "", 35 | "EditType": "1", 36 | "Group": "", 37 | "Description": "设置裁剪区域的宽高,width,height,中间用逗号隔开;裁剪区域不建议设置超出组件本身宽高和范围;默认值取控件的一半宽高,居中显示", 38 | "Design": { 39 | "Type": "Text", 40 | "Data": [] 41 | } 42 | }, 43 | { 44 | "ID": "source", 45 | "Name": "图片路径", 46 | "Type": "String", 47 | "DefaultValue": "", 48 | "EditType": "1", 49 | "Group": "", 50 | "Description": "可设置本地文件,支持 data:// source:// 打头", 51 | "Design": { 52 | "Type": "ImageSource", 53 | "Data": [] 54 | } 55 | } 56 | ], 57 | "Events": [], 58 | "syncMethodes": [], 59 | "asyncMethodes": [ 60 | { 61 | "ID": "crop", 62 | "Name": "裁剪图片", 63 | "Description": "根据裁剪区域,裁剪图片", 64 | "ReturnType": "String", 65 | "ReturnDesc": "返回裁剪图片的路径", 66 | "Paras": [] 67 | } 68 | ] 69 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_Network.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_Network", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "Name": "网络状态类", 6 | "Version": "Internal", 7 | "Description": "能获取当前手机端的网络状态,监听网络状态的变化", 8 | "Icon": "https://do-store.oss-cn-beijing.aliyuncs.com/D/20160121/do_Network/network.jpg", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7.0" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 1, 19 | "MinVersion": "10" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 1, 23 | "MinVersion": "10" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [], 30 | "Events": [ 31 | { 32 | "ID": "changed", 33 | "Description": "网络状态发生变化的回调方法", 34 | "ReturnType": "String", 35 | "ReturnDesc": "返回以下枚举类型的一种:'wifi'-wifi网络,'2G/3G/4G'-2G、3G或者4G,'none'-没有网络连接,'unknown'-未知网络连接" 36 | } 37 | ], 38 | "syncMethodes": [ 39 | { 40 | "ID": "getIP", 41 | "Name": "获取移动终端ip地址", 42 | "Description": "获取当前的ip地址", 43 | "ReturnType": "String", 44 | "ReturnDesc": "当前的ip地址", 45 | "Paras": [] 46 | }, 47 | { 48 | "ID": "getMACAddress", 49 | "Name": "获取物理地址", 50 | "Description": "当前设备的物理地址", 51 | "ReturnType": "String", 52 | "ReturnDesc": "返回当前设备的物理地址,windows平台返回的地址与直接在手机上查看的不一致,但也表示的是唯一地址;iOS平台不支持", 53 | "Paras": [] 54 | }, 55 | { 56 | "ID": "getStatus", 57 | "Name": "获取当前网络状态", 58 | "Description": "获取手机端当前处于的网络环境", 59 | "ReturnType": "String", 60 | "ReturnDesc": "以下枚举类型的一种:'wifi'-wifi网络,'2G/3G/4G'-2G、3G或者4G,'none'-没有网络连接,'unknown'-未知网络连接", 61 | "Paras": [] 62 | }, 63 | { 64 | "ID": "openWifiSetting", 65 | "Name": "打开无线网络连接界面", 66 | "Description": "打开无线网络连接界面,选择网络连接", 67 | "ReturnType": "", 68 | "ReturnDesc": "", 69 | "Paras": [] 70 | } 71 | ], 72 | "asyncMethodes": [] 73 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_PDFView.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_PDFView", 3 | "IsContainer": "0", 4 | "Type": "UI", 5 | "UIType": "Layout", 6 | "Name": "PDF阅读器", 7 | "Version": "Internal", 8 | "Description": "PDF阅读器,不支持windows平台", 9 | "Icon": "", 10 | "BBS": "", 11 | "Keyword": "", 12 | "IOS": { 13 | "Support": 1, 14 | "MinVersion": "7" 15 | }, 16 | "Android": { 17 | "Support": 1, 18 | "MinVersion": "4.0" 19 | }, 20 | "Windows": { 21 | "Support": 1, 22 | "MinVersion": "10" 23 | }, 24 | "WindowsPhone": { 25 | "Support": 1, 26 | "MinVersion": "10" 27 | }, 28 | "Html": { 29 | "Support": 1, 30 | "MinVersion": "5.0" 31 | }, 32 | "Properties": [ 33 | { 34 | "ID": "url", 35 | "Name": "打开的pdf文件路径", 36 | "Type": "String", 37 | "Type_JavaScript": "String", 38 | "DefaultValue": "", 39 | "EditType": "1", 40 | "Group": "", 41 | "Description": "支持data://与source://目录", 42 | "Design": { 43 | "Type": "Richtext", 44 | "Data": [] 45 | } 46 | } 47 | ], 48 | "Events": [ 49 | { 50 | "ID": "pageChanged", 51 | "Description": "页面切换时触发", 52 | "ReturnType": "Node", 53 | "ReturnType_JavaScript": "Node", 54 | "ReturnDesc": "{'total':100,'current':2}" 55 | } 56 | ], 57 | "syncMethodes": [ 58 | { 59 | "ID": "getPageCount", 60 | "Name": "总共页数以及当前页数", 61 | "Description": "返回总共页数以及当前页数", 62 | "ReturnType": "Node", 63 | "ReturnType_JavaScript": "Node", 64 | "ReturnDesc": "{'total':100,'current':2}", 65 | "Paras": [] 66 | }, 67 | { 68 | "ID": "jump", 69 | "Name": "跳转到指定页", 70 | "Description": "", 71 | "ReturnType": "", 72 | "ReturnType_JavaScript": "", 73 | "ReturnDesc": "", 74 | "Paras": [ 75 | { 76 | "ID": "page", 77 | "Name": "页数", 78 | "Type": "Number", 79 | "Type_JavaScript": "Number", 80 | "Required": 0, 81 | "DefaultValue": "", 82 | "Description": "" 83 | } 84 | ] 85 | }, 86 | { 87 | "ID": "next", 88 | "Name": "下一页", 89 | "Description": "", 90 | "ReturnType": "", 91 | "ReturnType_JavaScript": "", 92 | "ReturnDesc": "", 93 | "Paras": [] 94 | }, 95 | { 96 | "ID": "prev", 97 | "Name": "上一页", 98 | "Description": "", 99 | "ReturnType": "", 100 | "ReturnType_JavaScript": "", 101 | "ReturnDesc": "", 102 | "Paras": [] 103 | } 104 | ], 105 | "asyncMethodes": [] 106 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_ProgressBar.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_ProgressBar", 3 | "IsContainer": "0", 4 | "Type": "UI", 5 | "Name": "进度条", 6 | "Version": "Internal", 7 | "Description": "可以设置基于值填充的进度条和显示重复模式的进度条", 8 | "Icon": "https://deviceone.blob.core.chinacloudapi.cn/store/D/20160121/do_ProgressBar/进度条progress.jpg", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7.0" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "14" 16 | }, 17 | "Windows": { 18 | "Support": 1, 19 | "MinVersion": "10" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 1, 23 | "MinVersion": "10" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [ 30 | { 31 | "ID": "progress", 32 | "Name": "进度值", 33 | "Type": "Number", 34 | "DefaultValue": "无", 35 | "EditType": "1", 36 | "Group": "", 37 | "Description": "设置进度值,取值范围是0-100的Number(style=horizontal有效)", 38 | "Design": { 39 | "Type": "Text", 40 | "Data": [] 41 | } 42 | }, 43 | { 44 | "ID": "style", 45 | "Name": "进度条样式", 46 | "Type": "String", 47 | "DefaultValue": "normal", 48 | "EditType": "0", 49 | "Group": "", 50 | "Description": "进度条样式可以是以下几种类型:horizontal,large,small,normal", 51 | "Design": { 52 | "Type": "List", 53 | "Data": [ 54 | { 55 | "id": "horizontal", 56 | "value": "水平" 57 | }, 58 | { 59 | "id": "large", 60 | "value": "大" 61 | }, 62 | { 63 | "id": "small", 64 | "value": "小" 65 | }, 66 | { 67 | "id": "normal", 68 | "value": "普通" 69 | } 70 | ] 71 | } 72 | } 73 | ], 74 | "Events": [], 75 | "syncMethodes": [], 76 | "asyncMethodes": [] 77 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_QRCode.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_QRCode", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "Name": "二维码", 6 | "Version": "Internal", 7 | "Description": "二维码的生成和识别;其中iOS平台的二维码识别功能系统需要iOS8级以上的系统,设备需要5S及以上产品", 8 | "Icon": "https://do-store.oss-cn-beijing.aliyuncs.com/D/20160121/do_QRCode/QR二维码.jpg", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "8" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 1, 19 | "MinVersion": "10" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 1, 23 | "MinVersion": "10" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [], 30 | "Events": [], 31 | "syncMethodes": [], 32 | "asyncMethodes": [ 33 | { 34 | "ID": "create", 35 | "Name": "生成二维码", 36 | "Description": "", 37 | "ReturnType": "String", 38 | "ReturnType_JavaScript": "String", 39 | "ReturnDesc": "生成的二维码图片会保存在data://temp/do_QRCode目录下,并返回生成的二维码图片的路径", 40 | "Paras": [ 41 | { 42 | "ID": "text", 43 | "Name": "内容文本", 44 | "Type": "String", 45 | "Type_JavaScript": "String", 46 | "Required": 1, 47 | "DefaultValue": "", 48 | "Description": "" 49 | }, 50 | { 51 | "ID": "length", 52 | "Name": "图片边长", 53 | "Type": "Number", 54 | "Type_JavaScript": "Number", 55 | "Required": 0, 56 | "DefaultValue": "500", 57 | "Description": "生成的二维码图片边长" 58 | } 59 | ] 60 | }, 61 | { 62 | "ID": "recognition", 63 | "Name": "识别二维码", 64 | "Description": "", 65 | "ReturnType": "String", 66 | "ReturnType_JavaScript": "String", 67 | "ReturnDesc": "返回二维码的文本内容", 68 | "Paras": [ 69 | { 70 | "ID": "path", 71 | "Name": "二维码图片路径", 72 | "Type": "String", 73 | "Type_JavaScript": "String", 74 | "Required": 1, 75 | "DefaultValue": "", 76 | "Description": "可设置html链接或本地文件,支持:http:// https:// data:// source:// 打头的URI格式,不能包含@符号。其中文件格式说明可参考Storage类" 77 | } 78 | ] 79 | } 80 | ] 81 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_SangforVPN.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_SangforVPN", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "Name": "SangforVPN", 6 | "Version": "Internal", 7 | "Description": "使用深信服科技公司提供的VPN服务访问服务器资源,提供VPN登录,VPN注销登录的功能,仅支持android平台", 8 | "Icon": "", 9 | "IOS": { 10 | "Support": 0, 11 | "MinVersion": "" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 0, 19 | "MinVersion": "" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 0, 23 | "MinVersion": "" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [], 30 | "Events": [], 31 | "syncMethodes": [], 32 | "asyncMethodes": [ 33 | { 34 | "ID": "login", 35 | "Name": "登录VPN", 36 | "Description": "登录VPN", 37 | "ReturnType": "Node", 38 | "ReturnDesc": "{\"result\":\"true 登录成功,false 登录失败\",\"code\":\"0\",\"msg\":\"\"}", 39 | "Paras": [ 40 | { 41 | "ID": "host", 42 | "Name": "地址", 43 | "Type": "String", 44 | "Required": 1, 45 | "DefaultValue": "", 46 | "Description": "连接VPN地址" 47 | }, 48 | { 49 | "ID": "username", 50 | "Name": "用户名", 51 | "Type": "String", 52 | "Required": 1, 53 | "DefaultValue": "", 54 | "Description": "登录VPN的用户名" 55 | }, 56 | { 57 | "ID": "password", 58 | "Name": "密码", 59 | "Type": "String", 60 | "Required": 1, 61 | "DefaultValue": "", 62 | "Description": "登录VPN的密码" 63 | }, 64 | { 65 | "ID": "port", 66 | "Name": "端口号", 67 | "Type": "Number", 68 | "Required": 0, 69 | "DefaultValue": "443", 70 | "Description": "连接VPN端口" 71 | } 72 | ] 73 | }, 74 | { 75 | "ID": "logout", 76 | "Name": "注销VPN", 77 | "Description": "注销退出VPN", 78 | "ReturnType": "Node", 79 | "ReturnDesc": "{\"result\":\"true 注销成功,false 注销失败\",\"code\":\"0\",\"msg\":\"\"}", 80 | "Paras": [] 81 | } 82 | ] 83 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_SeekBar.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_SeekBar", 3 | "IsContainer": "0", 4 | "Type": "UI", 5 | "Name": "拖动条", 6 | "Version": "Internal", 7 | "Description": "可以拖动的进度条,取值范围为0~100", 8 | "Icon": "https://deviceone.blob.core.chinacloudapi.cn/store/D/20160121/do_SeekBar/拖动条.jpg", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 1, 19 | "MinVersion": "8.1" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 1, 23 | "MinVersion": "8.1" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [ 30 | { 31 | "ID": "progress", 32 | "Name": "第一进度值", 33 | "Type": "Number", 34 | "DefaultValue": "", 35 | "EditType": "1", 36 | "Group": "", 37 | "Description": "设置第一进度值,支持手势拖动", 38 | "Design": { 39 | "Type": "Text", 40 | "Data": [] 41 | } 42 | }, 43 | { 44 | "ID": "secondaryProgress", 45 | "Name": "第二进度值", 46 | "Type": "Number", 47 | "DefaultValue": "", 48 | "EditType": "1", 49 | "Group": "", 50 | "Description": "设置第二进度值", 51 | "Design": { 52 | "Type": "Text", 53 | "Data": [] 54 | } 55 | } 56 | ], 57 | "Events": [ 58 | { 59 | "ID": "progressChanged", 60 | "Description": "进度变化时候触发", 61 | "ReturnType": "String", 62 | "ReturnDesc": "" 63 | } 64 | ], 65 | "syncMethodes": [], 66 | "asyncMethodes": [] 67 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_SegmentView.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_SegmentView", 3 | "IsContainer": "0", 4 | "Type": "UI", 5 | "UIType": "Container", 6 | "Name": "滑动视图", 7 | "Version": "Internal", 8 | "Description": "分段选择视图,支持手势滑动和点击选中一个index,通常和do_SlideView结合在一起使用,互相联动;当height=-1时,表示自动宽度", 9 | "Icon": "https://do-store.oss-cn-beijing.aliyuncs.com/D/20160121/do_SegmentView/滑动视图.jpg", 10 | "BBS": "", 11 | "Keyword": "其它类型", 12 | "IOS": { 13 | "Support": 1, 14 | "MinVersion": "7.0" 15 | }, 16 | "Android": { 17 | "Support": 1, 18 | "MinVersion": "14" 19 | }, 20 | "Windows": { 21 | "Support": 1, 22 | "MinVersion": "10" 23 | }, 24 | "WindowsPhone": { 25 | "Support": 1, 26 | "MinVersion": "10" 27 | }, 28 | "Html": { 29 | "Support": 1, 30 | "MinVersion": "5.0" 31 | }, 32 | "Properties": [ 33 | { 34 | "ID": "index", 35 | "Name": "当前滑动cell索引", 36 | "Type": "Number", 37 | "Type_JavaScript": "Number", 38 | "DefaultValue": "0", 39 | "EditType": "1", 40 | "Group": "", 41 | "Description": "设置当前滑动cell索引值,默认为0", 42 | "Design": { 43 | "Type": "UInteger", 44 | "Data": [] 45 | } 46 | }, 47 | { 48 | "ID": "templates", 49 | "Name": "cell对应的模板UI文件组", 50 | "Type": "String", 51 | "Type_JavaScript": "String", 52 | "DefaultValue": "", 53 | "EditType": "0", 54 | "Group": "", 55 | "Description": "一个SegmentView可以有多个cell模板,这个属性是一个json array,每一个元素都是一个source ui文件。这个属性的格式类似如下: source://view/cell1.ui,source://view/cell2.ui,source://view/cell3.ui", 56 | "Design": { 57 | "Type": "Richtext", 58 | "Data": [] 59 | } 60 | } 61 | ], 62 | "Events": [ 63 | { 64 | "ID": "indexChanged", 65 | "Description": "点击cell加载完成后触发", 66 | "ReturnType": "String", 67 | "ReturnType_JavaScript": "String", 68 | "ReturnDesc": "返回当前cell的index" 69 | } 70 | ], 71 | "syncMethodes": [ 72 | { 73 | "ID": "bindItems", 74 | "Name": "绑定item的数据", 75 | "Description": "可绑定listData实例", 76 | "ReturnType": "", 77 | "ReturnType_JavaScript": "", 78 | "ReturnDesc": "", 79 | "Paras": [ 80 | { 81 | "ID": "data", 82 | "Name": "数据", 83 | "Type": "Node", 84 | "Type_JavaScript": "Node", 85 | "Required": 0, 86 | "DefaultValue": "", 87 | "Description": "" 88 | } 89 | ] 90 | }, 91 | { 92 | "ID": "refreshItems", 93 | "Name": "刷新item数据", 94 | "Description": "", 95 | "ReturnType": "", 96 | "ReturnType_JavaScript": "", 97 | "ReturnDesc": "", 98 | "Paras": [] 99 | } 100 | ], 101 | "asyncMethodes": [] 102 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_SwitchView.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_SwitchView", 3 | "IsContainer": "0", 4 | "Type": "UI", 5 | "Name": "开关", 6 | "Version": "Internal", 7 | "Description": "SwitchView 是一个带有开关选择的UI组件,只有(开,关)两种状态,点击或拽动改变状态,该组件的样式是跟随系统,各平台显示效果不完全一样 ,可以应用于是否记住密码场景和一些具有布尔类型的配置页面", 8 | "Icon": "https://do-store.oss-cn-beijing.aliyuncs.com/D/20160121/do_SwitchView/开关.jpg", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7.0" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 1, 19 | "MinVersion": "8.1" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 1, 23 | "MinVersion": "8.1" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [ 30 | { 31 | "ID": "checked", 32 | "Name": "是否选中", 33 | "Type": "Bool", 34 | "DefaultValue": "false", 35 | "EditType": "1", 36 | "Group": "", 37 | "Description": "设置当前状态,默认为不选中状态", 38 | "Design": { 39 | "Type": "Boolean", 40 | "Data": [] 41 | } 42 | }, 43 | { 44 | "ID": "colors", 45 | "Name": "组件状态颜色", 46 | "Type": "String", 47 | "DefaultValue": "00FF00,888888,FFFFFF", 48 | "EditType": "0", 49 | "Group": "", 50 | "Description": "SwitchView 各种状态的颜色:open的背景颜色值,close的背景颜色值,slider的背景颜色值, 默认值为:“00FF00,888888,FFFFFF”", 51 | "Design": { 52 | "Type": "Richtext", 53 | "Data": [] 54 | } 55 | }, 56 | { 57 | "ID": "shape", 58 | "Name": "组件形状", 59 | "Type": "String", 60 | "DefaultValue": "circle", 61 | "EditType": "0", 62 | "Group": "", 63 | "Description": "设置组件形状,有两种形状,rect矩形,circle圆形", 64 | "Design": { 65 | "Type": "List", 66 | "Data": [ 67 | { 68 | "id": "rect", 69 | "value": "矩形" 70 | }, 71 | { 72 | "id": "circle", 73 | "value": "圆形" 74 | } 75 | ] 76 | } 77 | } 78 | ], 79 | "Events": [ 80 | { 81 | "ID": "changed", 82 | "Description": "开关状态触发", 83 | "ReturnType": "Bool", 84 | "ReturnDesc": "当前状态" 85 | } 86 | ], 87 | "syncMethodes": [], 88 | "asyncMethodes": [] 89 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_Timer.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_Timer", 3 | "IsContainer": "0", 4 | "Type": "MM", 5 | "Name": "定时器", 6 | "Version": "Internal", 7 | "Description": "定时器,功能是在指定的时间间隔内反复触发指定任务事件,应用于“发送验证码倒计时“等记时相关的场景", 8 | "Icon": "https://do-store.oss-cn-beijing.aliyuncs.com/D/20160121/do_Timer/timer.jpg", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7.0" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "14" 16 | }, 17 | "Windows": { 18 | "Support": 1, 19 | "MinVersion": "8.1" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 1, 23 | "MinVersion": "8.1" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [ 30 | { 31 | "ID": "delay", 32 | "Name": "延时启动时间", 33 | "Type": "Number", 34 | "Type_JavaScript": "Number", 35 | "DefaultValue": "0", 36 | "EditType": "1", 37 | "Group": "", 38 | "Description": "从现在起延迟多长时间开始启动,单位为毫秒,<0时不执行定时任务", 39 | "Design": { 40 | "Type": "UInteger", 41 | "Data": [] 42 | } 43 | }, 44 | { 45 | "ID": "interval", 46 | "Name": "间隔时间", 47 | "Type": "Number", 48 | "Type_JavaScript": "Number", 49 | "DefaultValue": "1000", 50 | "EditType": "1", 51 | "Group": "", 52 | "Description": "定时器将每隔指定豪秒时间触发一次事件,单位毫秒,默认为1000,<=0时不执行定时任务", 53 | "Design": { 54 | "Type": "UInteger", 55 | "Data": [] 56 | } 57 | } 58 | ], 59 | "Events": [ 60 | { 61 | "ID": "tick", 62 | "Description": "固定间隔被调用触发", 63 | "ReturnType": "String", 64 | "ReturnType_JavaScript": "String", 65 | "ReturnDesc": "" 66 | } 67 | ], 68 | "syncMethodes": [ 69 | { 70 | "ID": "isStart", 71 | "Name": "是否启动定时器", 72 | "Description": "判断定时器是否启动,返回当前状态", 73 | "ReturnType": "Bool", 74 | "ReturnType_JavaScript": "Bool", 75 | "ReturnDesc": "为true时定时器为启动状态,false时定时器为未启动状态", 76 | "Paras": [] 77 | }, 78 | { 79 | "ID": "start", 80 | "Name": "启动", 81 | "Description": "启动定时器", 82 | "ReturnType": "", 83 | "ReturnType_JavaScript": "", 84 | "ReturnDesc": "", 85 | "Paras": [] 86 | }, 87 | { 88 | "ID": "stop", 89 | "Name": "取消", 90 | "Description": "取消定时器", 91 | "ReturnType": "", 92 | "ReturnType_JavaScript": "", 93 | "ReturnDesc": "", 94 | "Paras": [] 95 | } 96 | ], 97 | "asyncMethodes": [] 98 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_TouchID.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_TouchID", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "Name": "指纹验证", 6 | "Version": "Internal", 7 | "Description": "iPhone 5s以后版本的手机特有的指纹识别功能,调用此模块可实现用户指纹输入验证登陆app 。使用本模块需要支持指纹识别的手机和ios8.0以上的操作系统", 8 | "Icon": "", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "8.0" 12 | }, 13 | "Android": { 14 | "Support": 0, 15 | "MinVersion": "" 16 | }, 17 | "Windows": { 18 | "Support": 0, 19 | "MinVersion": "" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 0, 23 | "MinVersion": "" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [], 30 | "Events": [], 31 | "syncMethodes": [], 32 | "asyncMethodes": [ 33 | { 34 | "ID": "evaluate", 35 | "Name": "指纹验证", 36 | "Description": "", 37 | "ReturnType": "Node", 38 | "ReturnDesc": "{\"code\":\"0: 认证失败;1:用户取消验证;2:选择输入密码;3:系统取消认证;4:未设置密码,无法开启认证;5:当前设备未录入指纹信息;6:当前设备不支持指纹识别\",\"status\":\"true||false\"}", 39 | "Paras": [ 40 | { 41 | "ID": "title", 42 | "Name": "验证标题", 43 | "Type": "String", 44 | "Required": 0, 45 | "DefaultValue": "指纹验证", 46 | "Description": "使用touchID的原因" 47 | } 48 | ] 49 | } 50 | ] 51 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_Unionpay.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_Unionpay", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "Name": "银联支付", 6 | "Version": "Internal", 7 | "Description": "接入银联SDK,完成支付功能", 8 | "Icon": "", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7.0" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "4.0" 16 | }, 17 | "Windows": { 18 | "Support": 0, 19 | "MinVersion": "" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 0, 23 | "MinVersion": "" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [], 30 | "Events": [], 31 | "syncMethodes": [], 32 | "asyncMethodes": [ 33 | { 34 | "ID": "startPay", 35 | "Name": "支付", 36 | "Description": "调用银联支付", 37 | "ReturnType": "Node", 38 | "ReturnType_JavaScript": "Node", 39 | "ReturnDesc": "{'code':'0','msg':'success'},其中pay_result的返回值为0表示订单支付成功,1为支付失败,-1为用户取消了支付,-2支付发生未知错误", 40 | "Paras": [ 41 | { 42 | "ID": "orderInfo", 43 | "Name": "交易流水号", 44 | "Type": "String", 45 | "Type_JavaScript": "String", 46 | "Required": 1, 47 | "DefaultValue": "", 48 | "Description": "交易流水号,是商户后台通过调用银联后台获取的" 49 | }, 50 | { 51 | "ID": "mode", 52 | "Name": "测试类型", 53 | "Type": "String", 54 | "Type_JavaScript": "String", 55 | "Required": 1, 56 | "DefaultValue": "", 57 | "Description": "测试类型,取值为”00”、”01”。”00”表示银联正式环境,若开发者已经接入网银联支付,可用正式环境测试;”01”表示银联测试环境,测试环境仅用于测试插件功能是否正常" 58 | }, 59 | { 60 | "ID": "verifyUrl", 61 | "Name": "商户后台验证支付结果的接口", 62 | "Type": "String", 63 | "Type_JavaScript": "String", 64 | "Required": 0, 65 | "DefaultValue": "", 66 | "Description": "根据银联支付开发者网站提供的网站API文档搭建的商户验证支付结果的接口,如不填写则不进行二次校验,以银联控件支付结果为准,建议填写" 67 | } 68 | ] 69 | } 70 | ] 71 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_VideoRecord.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_VideoRecord", 3 | "IsContainer": "0", 4 | "Type": "UI", 5 | "UIType": "View", 6 | "Name": "视频录制", 7 | "Version": "Internal", 8 | "Description": "录制视频,输出MP4格式", 9 | "Icon": "", 10 | "BBS": "", 11 | "Keyword": "音频视频", 12 | "IOS": { 13 | "Support": 1, 14 | "MinVersion": "7.0" 15 | }, 16 | "Android": { 17 | "Support": 1, 18 | "MinVersion": "4.0" 19 | }, 20 | "Windows": { 21 | "Support": 1, 22 | "MinVersion": "10" 23 | }, 24 | "WindowsPhone": { 25 | "Support": 1, 26 | "MinVersion": "10" 27 | }, 28 | "Html": { 29 | "Support": 1, 30 | "MinVersion": "5.0" 31 | }, 32 | "Properties": [], 33 | "Events": [ 34 | { 35 | "ID": "error", 36 | "Description": "录制出错事件", 37 | "ReturnType": "String", 38 | "ReturnType_JavaScript": "String", 39 | "ReturnDesc": "" 40 | }, 41 | { 42 | "ID": "finish", 43 | "Description": "完成录制", 44 | "ReturnType": "Node", 45 | "ReturnType_JavaScript": "Node", 46 | "ReturnDesc": "返回值包含两个节点{path:'data://temp/do_VideoRecord/20160101101010111.mp4',size:'232342'},其中path为保存视频的路径,文件名是日期+精确到毫秒时间;size为视频大小,单位为KB" 47 | } 48 | ], 49 | "syncMethodes": [ 50 | { 51 | "ID": "start", 52 | "Name": "开始录制视频", 53 | "Description": "打开录制界面开始录制视频", 54 | "ReturnType": "", 55 | "ReturnType_JavaScript": "", 56 | "ReturnDesc": "", 57 | "Paras": [ 58 | { 59 | "ID": "quality", 60 | "Name": "录制视频质量", 61 | "Type": "String", 62 | "Type_JavaScript": "String", 63 | "Required": 0, 64 | "DefaultValue": "normal", 65 | "Description": "选择录音输出的质量,支持high(1920*1080)、normal(1280*720)、low(640*480),如果手机不支持high,以及normal,默认为low格式" 66 | }, 67 | { 68 | "ID": "limit", 69 | "Name": "视频时长限制", 70 | "Type": "Number", 71 | "Type_JavaScript": "Number", 72 | "Required": 0, 73 | "DefaultValue": "-1", 74 | "Description": "录制视频的时长限制,以毫秒为单位,-1时表示不限时长" 75 | } 76 | ] 77 | }, 78 | { 79 | "ID": "stop", 80 | "Name": "停止录制视频", 81 | "Description": "停止录制视频", 82 | "ReturnType": "", 83 | "ReturnType_JavaScript": "", 84 | "ReturnDesc": "", 85 | "Paras": [] 86 | } 87 | ], 88 | "asyncMethodes": [] 89 | } -------------------------------------------------------------------------------- /.metadata/app-dependency-modules/do_iFlyVoice.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "do_iFlyVoice", 3 | "IsContainer": "0", 4 | "Type": "SM", 5 | "Name": "讯飞语音", 6 | "Version": "Internal", 7 | "Description": "集成讯飞提供的语音识别类", 8 | "Icon": "https://deviceone.blob.core.chinacloudapi.cn/store/R/20150624/f492056e-ef9e-4938-95e6-c4e5837f901f.png", 9 | "IOS": { 10 | "Support": 1, 11 | "MinVersion": "7.0" 12 | }, 13 | "Android": { 14 | "Support": 1, 15 | "MinVersion": "14" 16 | }, 17 | "Windows": { 18 | "Support": 0, 19 | "MinVersion": "" 20 | }, 21 | "WindowsPhone": { 22 | "Support": 0, 23 | "MinVersion": "" 24 | }, 25 | "Html": { 26 | "Support": 1, 27 | "MinVersion": "5.0" 28 | }, 29 | "Properties": [], 30 | "Events": [ 31 | { 32 | "ID": "begin", 33 | "Description": "开始播放时触发", 34 | "ReturnType": "String", 35 | "ReturnDesc": "" 36 | }, 37 | { 38 | "ID": "finished", 39 | "Description": "播放完成或播放错误时触发", 40 | "ReturnType": "String", 41 | "ReturnDesc": "" 42 | } 43 | ], 44 | "syncMethodes": [ 45 | { 46 | "ID": "pause", 47 | "Name": "暂停播放", 48 | "Description": "", 49 | "ReturnType": "", 50 | "ReturnDesc": "", 51 | "Paras": [] 52 | }, 53 | { 54 | "ID": "resume", 55 | "Name": "继续播放", 56 | "Description": "", 57 | "ReturnType": "", 58 | "ReturnDesc": "", 59 | "Paras": [] 60 | }, 61 | { 62 | "ID": "speak", 63 | "Name": "开始播放", 64 | "Description": "", 65 | "ReturnType": "", 66 | "ReturnDesc": "", 67 | "Paras": [ 68 | { 69 | "ID": "text", 70 | "Name": "文本内容", 71 | "Type": "String", 72 | "Required": 1, 73 | "DefaultValue": "", 74 | "Description": "要读出的文本内容" 75 | }, 76 | { 77 | "ID": "role", 78 | "Name": "角色", 79 | "Type": "String", 80 | "Required": 0, 81 | "DefaultValue": "xiaoyan", 82 | "Description": "需要朗读的角色,值列表见http://bbs.deviceone.net/forum.php?mod=viewthread&tid=32&extra=" 83 | } 84 | ] 85 | }, 86 | { 87 | "ID": "stop", 88 | "Name": "停止播放", 89 | "Description": "", 90 | "ReturnType": "", 91 | "ReturnDesc": "", 92 | "Paras": [] 93 | } 94 | ], 95 | "asyncMethodes": [ 96 | { 97 | "ID": "open", 98 | "Name": "打开语音识别功能", 99 | "Description": "", 100 | "ReturnType": "Node", 101 | "ReturnDesc": "{\\\"result\\\":\\\"你好\\\",\\\"spell\\\":\\\"nihao\\\",\\\"errorMsg\\\":\\\"\\\"}", 102 | "Paras": [] 103 | } 104 | ] 105 | } -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | dojs 4 | 5 | 6 | 7 | 8 | 9 | com.eclipsesource.jshint.ui.builder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.jsdt.core.javascriptValidator 15 | 16 | 17 | 18 | 19 | org.eclipse.dltk.core.scriptbuilder 20 | 21 | 22 | 23 | 24 | 25 | net.deviceone.ui.DeviceOneNature 26 | 27 | 28 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /.settings/tern.eclipse.ide.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | loadingLocalPlugin=true 3 | -------------------------------------------------------------------------------- /.tern-project: -------------------------------------------------------------------------------- 1 | { 2 | "libs": [ 3 | "ecma5" 4 | ], 5 | "plugins": { 6 | ".metadata/deviceone": { 7 | 8 | } 9 | }, 10 | "loadEagerly": [ 11 | "source/script/*.js" 12 | ] 13 | } -------------------------------------------------------------------------------- /app.doproj: -------------------------------------------------------------------------------- 1 | {"Base":{"AppID":"00d946ad-65aa-4650-ad38-9d9413e60567","ScriptType":"javascript"},"DesignEnvironment":{"ScreenHeight":"1334","ScreenWidth":"750"}} -------------------------------------------------------------------------------- /initdata/.README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/initdata/.README -------------------------------------------------------------------------------- /initdata/mock/baidu/s_POST.json: -------------------------------------------------------------------------------- 1 | {"name":"张鹏2", "age":33, "address":"辽宁省沈阳市浑南区"} -------------------------------------------------------------------------------- /source/app.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs = require("dojs"); 3 | 4 | var options = [ { 5 | name : "scripts", 6 | path : "source://samples/script/main.ui", 7 | image_on : "source://image/samples/a_2.png", 8 | image_off : "source://image/samples/a_1.png", 9 | fontColor_on : "55C5B9FF", 10 | fontColor_off : "9E9E9EFF" 11 | }, { 12 | name : "modules", 13 | path : "source://samples/modules/main.ui", 14 | image_on : "source://image/samples/b_2.png", 15 | image_off : "source://image/samples/b_1.png", 16 | fontColor_on : "55C5B9FF", 17 | fontColor_off : "9E9E9EFF" 18 | }, { 19 | name : "uControls", 20 | path : "source://samples/userControls/main.ui", 21 | image_on : "source://image/samples/c_2.png", 22 | image_off : "source://image/samples/c_1.png", 23 | fontColor_on : "55C5B9FF", 24 | fontColor_off : "9E9E9EFF" 25 | }, { 26 | name : "API", 27 | path : "source://samples/api/main.ui", 28 | image_on : "source://image/samples/d_2.png", 29 | image_off : "source://image/samples/d_1.png", 30 | fontColor_on : "55C5B9FF", 31 | fontColor_off : "9E9E9EFF" 32 | }, { 33 | name : "examples", 34 | path : "source://samples/others/main.ui", 35 | image_on : "source://image/samples/e_2.png", 36 | image_off : "source://image/samples/e_1.png", 37 | fontColor_on : "55C5B9FF", 38 | fontColor_off : "9E9E9EFF" 39 | } ]; 40 | 41 | d1.sm("do_App").on("loaded", function() { 42 | var mainFrame = require("source://modules/mainFrame/call"); 43 | mainFrame.invoke(options); 44 | }); -------------------------------------------------------------------------------- /source/image/appGuide1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/appGuide1.png -------------------------------------------------------------------------------- /source/image/appGuide2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/appGuide2.png -------------------------------------------------------------------------------- /source/image/appGuide3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/appGuide3.png -------------------------------------------------------------------------------- /source/image/samples/a_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/samples/a_1.png -------------------------------------------------------------------------------- /source/image/samples/a_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/samples/a_2.png -------------------------------------------------------------------------------- /source/image/samples/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/samples/arrow.png -------------------------------------------------------------------------------- /source/image/samples/b_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/samples/b_1.png -------------------------------------------------------------------------------- /source/image/samples/b_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/samples/b_2.png -------------------------------------------------------------------------------- /source/image/samples/c_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/samples/c_1.png -------------------------------------------------------------------------------- /source/image/samples/c_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/samples/c_2.png -------------------------------------------------------------------------------- /source/image/samples/d_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/samples/d_1.png -------------------------------------------------------------------------------- /source/image/samples/d_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/samples/d_2.png -------------------------------------------------------------------------------- /source/image/samples/e_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/samples/e_1.png -------------------------------------------------------------------------------- /source/image/samples/e_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/samples/e_2.png -------------------------------------------------------------------------------- /source/image/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/image/start.png -------------------------------------------------------------------------------- /source/modules/appGuide/call.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs = require("dojs"); 3 | 4 | // --------------------------------------------------------------- 5 | /** 6 | * 应用的导览页 7 | * 8 | * @param _option 9 | * 选项参数 10 | */ 11 | var module_appGuide_callback=null; 12 | module.exports.invoke = function(_option) { 13 | module_appGuide_callback=_option.onCallback; 14 | dojs.core.openPage({ 15 | source : "source://modules/appGuide/src/main.ui", 16 | animationType : "fade", 17 | data : _option, 18 | statusBarState : "transparent" 19 | }); 20 | }; 21 | if (!dojs.core.inPage()){ 22 | dojs.core.error("不允许在app.js中调用 appGuide 模块"); 23 | } 24 | else{ 25 | d1.sm("do_Page").on("result", function(data){ 26 | if (dojs.core.isNull(data) || 27 | dojs.core.isNull(data.moduleType) || 28 | data.moduleType != "$$appGuide$$" || 29 | dojs.core.isNullData(module_appGuide_callback)) return; 30 | dojs.core.callFunction(module_appGuide_callback, data); 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /source/modules/appGuide/sample/image/1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/appGuide/sample/image/1.JPG -------------------------------------------------------------------------------- /source/modules/appGuide/sample/image/2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/appGuide/sample/image/2.JPG -------------------------------------------------------------------------------- /source/modules/appGuide/sample/image/3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/appGuide/sample/image/3.JPG -------------------------------------------------------------------------------- /source/modules/appGuide/sample/image/4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/appGuide/sample/image/4.JPG -------------------------------------------------------------------------------- /source/modules/appGuide/sample/test.js: -------------------------------------------------------------------------------- 1 | var dojs = require("dojs"); 2 | 3 | module.exports.demo = function() { 4 | var appGuide = require("source://modules/appGuide/call"); 5 | appGuide.invoke({ 6 | // 定义每个导览页的内容(最多支持5页) 7 | content : [ { 8 | // 内容来源的路径(图片或自定义ui视图) 9 | path : "source://modules/appGuide/sample/image/1.JPG", 10 | // 是否显示关闭按钮 11 | showCloseButton:false 12 | }, { 13 | // 内容来源的路径(图片或自定义ui视图) 14 | path : "source://modules/appGuide/sample/image/2.JPG", 15 | // 是否显示关闭按钮 16 | showCloseButton:false 17 | }, { 18 | // 内容来源的路径(图片或自定义ui视图) 19 | path : "source://modules/appGuide/sample/image/3.JPG", 20 | // 是否显示关闭按钮 21 | showCloseButton:false 22 | } , { 23 | // 内容来源的路径(图片或自定义ui视图) 24 | path : "source://modules/appGuide/sample/image/4.JPG", 25 | // 是否显示关闭按钮 26 | showCloseButton:true 27 | } ], 28 | //导览图片的索引图 29 | indexImage : { 30 | //是否显示 31 | visible:true, 32 | //当前索引的颜色 33 | selectedColor:"FF0000FF", 34 | //其它非当前索引的颜色 35 | unSelectedColor:"9C9C9CFF", 36 | //垂直方向的位置 37 | y:1206 38 | }, 39 | //关闭按钮 40 | closeButton : { 41 | //文本内容 42 | text:"进入应用", 43 | //垂直方向的位置 44 | y:1134, 45 | //宽度 46 | width:500, 47 | //背景颜色 48 | bgColor:"FF000099", 49 | //字体颜色 50 | fontColor:"FFFFFFFF" 51 | }, 52 | //回调事件 53 | onCallback:function(data){ 54 | //此处可以编写回调代码,例如:打开其它页面 55 | //dojs.core.openPage(""); 56 | } 57 | }); 58 | }; 59 | -------------------------------------------------------------------------------- /source/modules/appGuide/src/img_template.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "width":"750", 4 | "type":"do_ALayout", 5 | "views":[ 6 | { 7 | "width":"750", 8 | "id":"bgImageView", 9 | "type":"do_ImageView", 10 | "height":"1334" 11 | }, 12 | { 13 | "border":"D3D3B7FF,1,10", 14 | "bgColor":"D3D3B7FF", 15 | "width":"500", 16 | "x":"125", 17 | "y":"1134", 18 | "fontSize":"45", 19 | "id":"do_Button_close", 20 | "text":"进入", 21 | "type":"do_Button", 22 | "fontColor":"FFFFFFFF" 23 | } 24 | ], 25 | "height":"1334" 26 | } 27 | } -------------------------------------------------------------------------------- /source/modules/appGuide/src/img_template.ui.js: -------------------------------------------------------------------------------- 1 | /** 2 | * related to template.ui 3 | * 4 | * @Author : and 5 | * @Timestamp : 2016-11-12 6 | */ 7 | var dojs = require("dojs"); 8 | ui("$").setMapping({ 9 | "bgImageView.source" : "path", 10 | "do_Button_close.visible" : "showCloseButton", 11 | "do_Button_close.x" : "x", 12 | "do_Button_close.y" : "y", 13 | "do_Button_close.text" : "text", 14 | "do_Button_close.width" : "width", 15 | "do_Button_close.bgColor" : "bgColor", 16 | "do_Button_close.fontColor" : "fontColor" 17 | }) 18 | dojs.style.css(ui("do_Button_close"), "dynamicButton"); 19 | 20 | ui("do_Button_close").on("touch", function() { 21 | sm("do_Page").fire("appCuideClose"); 22 | }) 23 | 24 | ui("$").on("dataRefreshed", function(){ 25 | ui("do_Button_close").redraw(); 26 | }); -------------------------------------------------------------------------------- /source/modules/appGuide/src/main.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "width":"750", 4 | "type":"do_ALayout", 5 | "views":[ 6 | { 7 | "templates":"source://modules/appGuide/src/img_template.ui,source://modules/appGuide/src/ui_template.ui", 8 | "width":"750", 9 | "isAllCache":"true", 10 | "id":"do_SlideView_content", 11 | "type":"do_SlideView", 12 | "height":"1334" 13 | }, 14 | { 15 | "width":"550", 16 | "x":"100", 17 | "y":"1206", 18 | "id":"do_ALayout_index", 19 | "type":"do_ALayout", 20 | "isStretch":"false", 21 | "views":[ 22 | { 23 | "border":"00000000,1,9", 24 | "bgColor":"000000FF", 25 | "x":"66", 26 | "width":"18", 27 | "y":"31", 28 | "id":"do_ALayout_index1", 29 | "type":"do_ALayout", 30 | "views":[], 31 | "height":"18" 32 | }, 33 | { 34 | "border":"00000000,1,9", 35 | "bgColor":"000000FF", 36 | "x":"166", 37 | "width":"18", 38 | "y":"31", 39 | "id":"do_ALayout_index2", 40 | "type":"do_ALayout", 41 | "views":[], 42 | "height":"18" 43 | }, 44 | { 45 | "border":"00000000,1,9", 46 | "bgColor":"000000FF", 47 | "x":"266", 48 | "width":"18", 49 | "y":"31", 50 | "id":"do_ALayout_index3", 51 | "type":"do_ALayout", 52 | "views":[], 53 | "height":"18" 54 | }, 55 | { 56 | "border":"00000000,1,9", 57 | "bgColor":"000000FF", 58 | "x":"366", 59 | "width":"18", 60 | "y":"31", 61 | "id":"do_ALayout_index4", 62 | "type":"do_ALayout", 63 | "height":"18" 64 | }, 65 | { 66 | "border":"00000000,1,9", 67 | "bgColor":"000000FF", 68 | "x":"466", 69 | "width":"18", 70 | "y":"31", 71 | "id":"do_ALayout_index5", 72 | "type":"do_ALayout", 73 | "height":"18" 74 | } 75 | ] 76 | } 77 | ], 78 | "height":"1334" 79 | } 80 | } -------------------------------------------------------------------------------- /source/modules/appGuide/src/ui_template.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "width":"750", 4 | "type":"do_ALayout", 5 | "views":[ 6 | { 7 | "width":"750", 8 | "id":"do_ALayout_body", 9 | "type":"do_ALayout", 10 | "height":"1334" 11 | }, 12 | { 13 | "border":"D3D3B7FF,1,10", 14 | "bgColor":"D3D3B7FF", 15 | "width":"500", 16 | "x":"125", 17 | "y":"1134", 18 | "fontSize":"45", 19 | "id":"do_Button_close", 20 | "text":"进入", 21 | "type":"do_Button", 22 | "fontColor":"FFFFFFFF" 23 | } 24 | ], 25 | "height":"1334" 26 | } 27 | } -------------------------------------------------------------------------------- /source/modules/appGuide/src/ui_template.ui.js: -------------------------------------------------------------------------------- 1 | var dojs = require("dojs"); 2 | ui("$").setMapping({ 3 | "do_ALayout_body.tag" : "path", 4 | "do_Button_close.visible" : "showCloseButton", 5 | "do_Button_close.x" : "x", 6 | "do_Button_close.y" : "y", 7 | "do_Button_close.text" : "text", 8 | "do_Button_close.width" : "width", 9 | "do_Button_close.bgColor" : "bgColor", 10 | "do_Button_close.fontColor" : "fontColor" 11 | 12 | }); 13 | dojs.style.css(ui("do_Button_close"), "dynamicButton"); 14 | ui("do_Button_close").on("touch", function() { 15 | sm("do_Page").fire("appCuideClose"); 16 | }); 17 | 18 | ui("$").on("dataRefreshed", function(){ 19 | ui("do_ALayout_body").add("uipath", ui("do_ALayout_body").tag); 20 | ui("do_Button_close").redraw(); 21 | }); 22 | -------------------------------------------------------------------------------- /source/modules/baseLayer/call.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs=require("dojs"); 3 | 4 | //--------------------------------------------------------------- 5 | /** 6 | * 基础视图层(一般用做应用最低层的ui) 7 | * @param _option 选项参数 8 | */ 9 | module.exports.invoke = function(_option){ 10 | dojs.core.openPage({ 11 | source:"source://modules/baseLayer/src/main.ui", 12 | animationType:"fade", 13 | data:_option, 14 | statusBarState:"transparent" 15 | }); 16 | }; -------------------------------------------------------------------------------- /source/modules/baseLayer/sample/baseLayerCallback.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | 3 | module.exports.invoke = function(data) { 4 | //此处baseLayer页面打开后的代码 5 | 6 | } 7 | 8 | d1.sm("do_Page").on("result", function(data){ 9 | //此处编写baseLayer上层页面关闭后的事件处理 10 | 11 | }); -------------------------------------------------------------------------------- /source/modules/baseLayer/sample/test.js: -------------------------------------------------------------------------------- 1 | module.exports.demo = function() { 2 | var baseLayer=require("source://modules/baseLayer/call"); 3 | baseLayer.invoke({ 4 | // 背景颜色 5 | bgColor:"00000000", 6 | // 背景图片 7 | bgImage:"", 8 | // 回调的代码 9 | onCallback:"source://modules/baseLayer/sample/baseLayerCallback" 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /source/modules/baseLayer/src/main.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "x":"0", 4 | "width":"750", 5 | "y":"0", 6 | "type":"do_ALayout", 7 | "views":[ 8 | { 9 | "width":"750", 10 | "id":"do_ImageView_body", 11 | "type":"do_ImageView", 12 | "height":"1334" 13 | } 14 | ], 15 | "height":"1334" 16 | } 17 | } -------------------------------------------------------------------------------- /source/modules/baseLayer/src/main.ui.js: -------------------------------------------------------------------------------- 1 | var dojs = require("dojs"); 2 | var currentOption = sm("do_Page").getData(); 3 | 4 | if (!dojs.core.isNullData(currentOption)) { 5 | if (!dojs.core.isNullData(currentOption.bgColor)) { 6 | ui("$").bgColor=currentOption.bgColor; 7 | ui("do_ImageView_body").bgColor = currentOption.bgColor; 8 | } 9 | if (!dojs.core.isNullData(currentOption.bgImage)) { 10 | ui("do_ImageView_body").source = currentOption.bgImage; 11 | } 12 | } 13 | 14 | sm("do_Page").on("loaded", function(){ 15 | var _jsFile=require(currentOption.onCallback); 16 | _jsFile.invoke(); 17 | }); -------------------------------------------------------------------------------- /source/modules/forgetPassword/call.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs=require("dojs"); 3 | 4 | //--------------------------------------------------------------- 5 | /** 6 | * 忘记密码 7 | * @param _option 选项参数 8 | */ 9 | module.exports.invoke = function(_option){ 10 | dojs.core.openPage({ 11 | source:"source://modules/forgetPassword/src/main.ui", 12 | animationType:"push_r2l_1", 13 | data:_option, 14 | statusBarState:"transparent" 15 | }); 16 | }; -------------------------------------------------------------------------------- /source/modules/forgetPassword/sample/forgetPasswordCallback.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs = require("dojs"); 3 | 4 | module.exports.invoke = function(data) { 5 | if (data.type=="register"){ 6 | //用户注册的操作 7 | if (dojs.core.isNullData(data.phone)){ 8 | dojs.core.toast("手机号不允许空"); 9 | return; 10 | } 11 | if (dojs.core.isNullData(data.code)){ 12 | dojs.core.toast("验证码不允许空"); 13 | return; 14 | } 15 | if (dojs.core.isNullData(data.password)){ 16 | dojs.core.toast("新用户的密码不允许空"); 17 | return; 18 | } 19 | //TODO:提交服务端,完成注册功能 20 | 21 | dojs.core.closePage(); 22 | return; 23 | } 24 | 25 | if (data.type=="sendSms"){ 26 | //发送短信的操作 27 | if (dojs.core.isNullData(data.phone)){ 28 | dojs.core.toast("手机号不允许空"); 29 | return; 30 | } 31 | //TODO:由服务端调用短信网关,发送验证码短信 32 | 33 | dojs.core.toast("验证码已经通过短信发送,请尽快查收"); 34 | //通知UI,短信已经来时发送 35 | d1.sm("do_Page").fire("smsStartSending"); 36 | 37 | return; 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /source/modules/forgetPassword/sample/test.js: -------------------------------------------------------------------------------- 1 | module.exports.demo = function() { 2 | var forgetPassword=require("source://modules/forgetPassword/call"); 3 | forgetPassword.invoke({ 4 | // 标题 5 | title:"重置密码", 6 | // 短信重复发送的间隔时间 (秒) 7 | sendSmsInterval : 60, 8 | // 手机号 9 | phoneNumber:{ 10 | // 提示内容 11 | hint : "手机号", 12 | // 最大长度限制 13 | maxLength : 32 14 | }, 15 | // 短信验证码 16 | smsCode:{ 17 | // 提示内容 18 | hint : "输入短信验证码", 19 | // 最大长度限制 20 | maxLength : 6 21 | }, 22 | // 新用户的密码 23 | password:{ 24 | // 提示内容 25 | hint : "设置6-18位字母数字组合的新密码", 26 | // 最大长度限制 27 | maxLength : 18 28 | }, 29 | // 回调的代码 30 | onCallback:"source://modules/forgetPassword/sample/forgetPasswordCallback" 31 | 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /source/modules/forgetPassword/src/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/forgetPassword/src/close.png -------------------------------------------------------------------------------- /source/modules/image/return.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/image/return.png -------------------------------------------------------------------------------- /source/modules/inputTextField/call.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs=require("dojs"); 3 | 4 | var module_inputTextField_callback=null; 5 | //--------------------------------------------------------------- 6 | /** 7 | * 文本输入 8 | * @param _option 选项参数 9 | * @param _callback 回调函数 10 | */ 11 | module.exports.invoke = function(_option){ 12 | module_inputTextField_callback=_option.onCallback; 13 | dojs.core.openPage({ 14 | source:"source://modules/inputTextField/src/main.ui", 15 | animationType:"push_r2l_1", 16 | data:_option, 17 | statusBarState:"transparent" 18 | }); 19 | }; 20 | if (!dojs.core.inPage()){ 21 | dojs.core.error("不允许在app.js中调用 inputTextField 模块"); 22 | } 23 | else{ 24 | d1.sm("do_Page").on("result", function(data){ 25 | if (dojs.core.isNull(data) || 26 | dojs.core.isNull(data.moduleType) || 27 | data.moduleType != "$$inputTextField$$" || 28 | dojs.core.isNullData(module_inputTextField_callback)) return; 29 | dojs.core.callFunction(module_inputTextField_callback, data.result); 30 | }); 31 | } 32 | -------------------------------------------------------------------------------- /source/modules/inputTextField/sample/test.js: -------------------------------------------------------------------------------- 1 | var dojs = require("dojs"); 2 | 3 | module.exports.demo = function() { 4 | var inputTextField=require("source://modules/inputTextField/call"); 5 | inputTextField.invoke({ 6 | // 标题 7 | title : "请输入内容", 8 | // 提示内容 9 | hint : "请输入内容", 10 | // 初始值 11 | text : "001", 12 | // 最大长度:默认值是16 13 | maxLength : 10, 14 | // 软键盘的类型,支持:ENG, PHONENUMBER, DECIMAL, ASC, URL; 默认是ASC 15 | inputType : "ASC", 16 | //回调事件 17 | onCallback:function(data){ 18 | //此处可以编写回调代码 19 | dojs.core.alert(data.value); 20 | } 21 | }); 22 | }; 23 | -------------------------------------------------------------------------------- /source/modules/inputTextField/src/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/inputTextField/src/close.png -------------------------------------------------------------------------------- /source/modules/inputTextField/src/main.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"ECECECFF", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "type":"do_ALayout", 8 | "views":[ 9 | { 10 | "bgColor":"16AF9FFF", 11 | "width":"750", 12 | "id":"do_ALayout_topbar", 13 | "type":"do_ALayout", 14 | "views":[ 15 | { 16 | "textAlign":"center", 17 | "x":"164", 18 | "width":"455", 19 | "y":"65", 20 | "fontSize":"40", 21 | "id":"do_Label_title", 22 | "text":"请输入", 23 | "type":"do_Label", 24 | "fontColor":"FFFFFFFF", 25 | "height":"60" 26 | }, 27 | { 28 | "width":"155", 29 | "x":"4", 30 | "id":"do_ALayout_back", 31 | "type":"do_ALayout", 32 | "views":[ 33 | { 34 | "width":"25", 35 | "x":"30", 36 | "y":"65", 37 | "id":"do_ImageView_1", 38 | "source":"source://modules/image/return.png", 39 | "type":"do_ImageView", 40 | "height":"42" 41 | } 42 | ], 43 | "height":"130" 44 | }, 45 | { 46 | "border":"00000000,1,8", 47 | "bgColor":"16AF9FFF", 48 | "x":"620", 49 | "width":"120", 50 | "y":"60", 51 | "fontSize":"32", 52 | "id":"do_Button_ok", 53 | "text":"确定", 54 | "type":"do_Button", 55 | "fontColor":"CCCCCCFF", 56 | "height":"53" 57 | } 58 | ], 59 | "height":"128" 60 | }, 61 | { 62 | "bgColor":"FFFFFFFF", 63 | "width":"750", 64 | "y":"158", 65 | "id":"do_ALayout_2", 66 | "type":"do_ALayout", 67 | "height":"78" 68 | }, 69 | { 70 | "hintColor":"CCCCCCFF", 71 | "bgColor":"FFFFFFFF", 72 | "hint":"请输入", 73 | "width":"734", 74 | "x":"16", 75 | "y":"158", 76 | "fontSize":"32", 77 | "id":"do_TextField_Data", 78 | "type":"do_TextField", 79 | "maxLength":"16", 80 | "height":"78" 81 | }, 82 | { 83 | "x":"670", 84 | "width":"78", 85 | "y":"158", 86 | "id":"do_ALayout_close", 87 | "type":"do_ALayout", 88 | "views":[ 89 | { 90 | "x":"23", 91 | "width":"32", 92 | "y":"23", 93 | "id":"do_ImageView_close", 94 | "source":"source://modules/inputTextField/src/close.png", 95 | "type":"do_ImageView", 96 | "height":"32" 97 | } 98 | ], 99 | "height":"78" 100 | } 101 | ], 102 | "height":"1334" 103 | } 104 | } -------------------------------------------------------------------------------- /source/modules/inputTextField/src/main.ui.js: -------------------------------------------------------------------------------- 1 | var dojs = require("dojs"); 2 | 3 | dojs.style.css(ui("do_ALayout_topbar"), "pageTopbar"); 4 | dojs.style.css(ui("do_ALayout_back"), "dynamicButton"); 5 | dojs.style.css(ui("do_Button_ok"), "dynamicButton"); 6 | dojs.style.css(ui("do_ALayout_close"), "dynamicButton"); 7 | 8 | dojs.page.allowClose(ui("do_ALayout_back")); 9 | 10 | var initValue = ""; 11 | 12 | function returnResult() { 13 | sm("do_Page").hideKeyboard(); 14 | sm("do_App").closePage({ 15 | moduleType : "$$inputTextField$$", 16 | result : { 17 | value : ui("do_TextField_Data").text 18 | } 19 | }); 20 | } 21 | 22 | dojs.page.onTouch(ui("do_Button_ok"), function() { 23 | returnResult(); 24 | }); 25 | 26 | ui("do_TextField_Data").on("enter", function() { 27 | returnResult(); 28 | }); 29 | 30 | ui("do_TextField_Data").on("textChanged", function() { 31 | if (ui("do_TextField_Data").text == "") { 32 | ui("do_ALayout_close").visible = false; 33 | } else { 34 | ui("do_ALayout_close").visible = true; 35 | } 36 | if (ui("do_TextField_Data").text == initValue) { 37 | ui("do_Button_ok").fontColor="ACACACFF"; 38 | ui("do_Button_ok").enabled=false; 39 | } else { 40 | ui("do_Button_ok").fontColor="FFFFFFFF"; 41 | ui("do_Button_ok").enabled=true; 42 | } 43 | }); 44 | 45 | ui("do_ALayout_close").on("touch", function() { 46 | ui("do_TextField_Data").text = ""; 47 | ui("do_TextField_Data").setFocus(true); 48 | }); 49 | ui("do_ALayout_close").visible = false; 50 | 51 | var data = sm("do_Page").getData(); 52 | if (!dojs.core.isNullData(data)) { 53 | if (!dojs.core.isNullData(data.title)) { 54 | ui("do_Label_title").text = data.title; 55 | } 56 | if (!dojs.core.isNullData(data.text)) { 57 | initValue = data.text; 58 | ui("do_TextField_Data").text = data.text; 59 | } 60 | if (!dojs.core.isNullData(data.inputType)) { 61 | ui("do_TextField_Data").inputType = data.inputType; 62 | } 63 | 64 | if (!dojs.core.isNullData(data.hint)) { 65 | ui("do_TextField_Data").hint = data.hint; 66 | } 67 | if (!dojs.core.isNullData(data.maxLength)) { 68 | ui("do_TextField_Data").maxLength = data.maxLength; 69 | } 70 | } 71 | ui("do_TextField_Data").fire("textChanged"); 72 | 73 | sm("do_Page").on("loaded", function(){ 74 | ui("do_TextField_Data").setFocus(true); 75 | }); 76 | -------------------------------------------------------------------------------- /source/modules/login/call.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs=require("dojs"); 3 | 4 | //--------------------------------------------------------------- 5 | /** 6 | * 用户登录 7 | * @param _option 选项参数 8 | */ 9 | module.exports.invoke = function(_option){ 10 | dojs.core.openPage({ 11 | source:"source://modules/login/src/main.ui", 12 | animationType:"push_r2l_1", 13 | data:_option, 14 | statusBarState:"transparent" 15 | }); 16 | }; -------------------------------------------------------------------------------- /source/modules/login/sample/loginCallback.js: -------------------------------------------------------------------------------- 1 | var dojs = require("dojs"); 2 | 3 | module.exports.invoke = function(data) { 4 | if (data.type=="login_normal"){ 5 | //用户名+密码登录 6 | if (dojs.core.isNullData(data.user)){ 7 | dojs.core.toast("账户不允许空"); 8 | return; 9 | } 10 | if (dojs.core.isNullData(data.password)){ 11 | dojs.core.toast("密码不允许空"); 12 | return; 13 | } 14 | //TODO:TODO:此处编写认证逻辑 15 | 16 | dojs.core.closePage(); 17 | 18 | return; 19 | } 20 | 21 | if (data.type=="register"){ 22 | //用户注册 23 | 24 | return; 25 | } 26 | 27 | if (data.type=="login_sina"){ 28 | //第三方登录 - 新浪微博 29 | 30 | return; 31 | } 32 | 33 | if (data.type=="login_weixin"){ 34 | //第三方登录 - 微信 35 | 36 | return; 37 | } 38 | 39 | if (data.type=="login_qq"){ 40 | //第三方登录 - QQ 41 | 42 | return; 43 | } 44 | 45 | if (data.type=="fetchPassword"){ 46 | //忘记密码 47 | 48 | } 49 | 50 | }; 51 | -------------------------------------------------------------------------------- /source/modules/login/sample/test.js: -------------------------------------------------------------------------------- 1 | module.exports.demo = function() { 2 | var login=require("source://modules/login/call"); 3 | login.invoke({ 4 | // 标题 5 | title:"登录", 6 | // 是否允许关闭页面 7 | allowClose : true, 8 | // 是否允许"注册" 9 | allowRegister : true, 10 | // 是否允许"忘记密码" 11 | allowFetchPwd : true, 12 | // 是否允许第三方登录-新浪微博 13 | allowSinaLogin : true, 14 | // 是否允许第三方登录-微信 15 | allowWeiXinLogin : true, 16 | // 是否允许第三方登录-QQ 17 | allowQQLogin : true, 18 | // 用户配置项 19 | user:{ 20 | //提示内容 21 | hint : "请输入账户名或手机号", 22 | //最大长度的限制 23 | maxLength:32 24 | }, 25 | // 密码配置项 26 | password:{ 27 | //加密算法:md5, sha1, sha256, none; 默认为:none 28 | encryption: "md5", 29 | //提示内容 30 | hint : "请输入密码", 31 | //最大长度的限制 32 | maxLength:32 33 | }, 34 | // 回调的代码 35 | onCallback:"source://modules/login/sample/loginCallback" 36 | 37 | }); 38 | }; 39 | -------------------------------------------------------------------------------- /source/modules/login/src/QQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/login/src/QQ.png -------------------------------------------------------------------------------- /source/modules/login/src/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/login/src/close.png -------------------------------------------------------------------------------- /source/modules/login/src/pwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/login/src/pwd.png -------------------------------------------------------------------------------- /source/modules/login/src/sina.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/login/src/sina.png -------------------------------------------------------------------------------- /source/modules/login/src/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/login/src/user.png -------------------------------------------------------------------------------- /source/modules/login/src/weixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/login/src/weixin.png -------------------------------------------------------------------------------- /source/modules/mainFrame/call.js: -------------------------------------------------------------------------------- 1 | var dojs=require("dojs"); 2 | 3 | //--------------------------------------------------------------- 4 | /** 5 | * 主页面 6 | * @param _option 选项参数 7 | */ 8 | module.exports.invoke = function(_option){ 9 | dojs.core.openPage({ 10 | source:"source://modules/mainFrame/src/main.ui", 11 | animationType:"fade", 12 | data:_option, 13 | statusBarState:"transparent" 14 | }); 15 | }; 16 | -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/a.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"FF0000FF", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "type":"do_ALayout", 8 | "views":[ 9 | { 10 | "bgColor":"16AF9FFF", 11 | "width":"750", 12 | "id":"do_ALayout_topbar", 13 | "type":"do_ALayout", 14 | "views":[ 15 | { 16 | "textAlign":"center", 17 | "x":"200", 18 | "width":"350", 19 | "y":"65", 20 | "fontSize":"40", 21 | "id":"do_Label_2", 22 | "text":"第一页", 23 | "type":"do_Label", 24 | "fontColor":"FFFFFFFF", 25 | "height":"60" 26 | }, 27 | { 28 | "width":"174", 29 | "x":"4", 30 | "id":"do_ALayout_back", 31 | "type":"do_ALayout", 32 | "views":[ 33 | { 34 | "width":"25", 35 | "x":"30", 36 | "y":"65", 37 | "id":"do_ImageView_1", 38 | "source":"source://modules/image/return.png", 39 | "type":"do_ImageView", 40 | "height":"42" 41 | } 42 | ], 43 | "height":"130" 44 | } 45 | ], 46 | "height":"128" 47 | } 48 | ], 49 | "height":"1206" 50 | } 51 | } -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/a.ui.js: -------------------------------------------------------------------------------- 1 | var dojs=require("dojs"); 2 | dojs.style.css(ui("do_ALayout_topbar"), "pageTopbar"); 3 | 4 | ui("do_ALayout_back").on("touch", function(){ 5 | dojs.core.closePage(); 6 | }); -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/b.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"00FF00FF", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "type":"do_ALayout", 8 | "views":[ 9 | { 10 | "bgColor":"16AF9FFF", 11 | "width":"750", 12 | "id":"do_ALayout_topbar", 13 | "type":"do_ALayout", 14 | "views":[ 15 | { 16 | "textAlign":"center", 17 | "x":"200", 18 | "width":"350", 19 | "y":"65", 20 | "fontSize":"40", 21 | "id":"do_Label_2", 22 | "text":"第二页", 23 | "type":"do_Label", 24 | "fontColor":"FFFFFFFF", 25 | "height":"60" 26 | }, 27 | { 28 | "width":"174", 29 | "x":"4", 30 | "id":"do_ALayout_back", 31 | "type":"do_ALayout", 32 | "views":[ 33 | { 34 | "width":"25", 35 | "x":"30", 36 | "y":"65", 37 | "id":"do_ImageView_1", 38 | "source":"source://modules/image/return.png", 39 | "type":"do_ImageView", 40 | "height":"42" 41 | } 42 | ], 43 | "height":"130" 44 | } 45 | ], 46 | "height":"128" 47 | } 48 | ], 49 | "height":"1206" 50 | } 51 | } -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/b.ui.js: -------------------------------------------------------------------------------- 1 | var dojs=require("dojs"); 2 | dojs.style.css(ui("do_ALayout_topbar"), "pageTopbar"); 3 | 4 | ui("do_ALayout_back").on("touch", function(){ 5 | dojs.core.closePage(); 6 | }); -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/c.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"0000FFFF", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "type":"do_ALayout", 8 | "views":[ 9 | { 10 | "bgColor":"16AF9FFF", 11 | "width":"750", 12 | "id":"do_ALayout_topbar", 13 | "type":"do_ALayout", 14 | "views":[ 15 | { 16 | "textAlign":"center", 17 | "x":"200", 18 | "width":"350", 19 | "y":"65", 20 | "fontSize":"40", 21 | "id":"do_Label_2", 22 | "text":"第三页", 23 | "type":"do_Label", 24 | "fontColor":"FFFFFFFF", 25 | "height":"60" 26 | }, 27 | { 28 | "width":"174", 29 | "x":"4", 30 | "id":"do_ALayout_back", 31 | "type":"do_ALayout", 32 | "views":[ 33 | { 34 | "width":"25", 35 | "x":"30", 36 | "y":"65", 37 | "id":"do_ImageView_1", 38 | "source":"source://modules/image/return.png", 39 | "type":"do_ImageView", 40 | "height":"42" 41 | } 42 | ], 43 | "height":"130" 44 | } 45 | ], 46 | "height":"128" 47 | } 48 | ], 49 | "height":"1206" 50 | } 51 | } -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/c.ui.js: -------------------------------------------------------------------------------- 1 | var dojs=require("dojs"); 2 | dojs.style.css(ui("do_ALayout_topbar"), "pageTopbar"); 3 | 4 | ui("do_ALayout_back").on("touch", function(){ 5 | dojs.core.closePage(); 6 | }); -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/d.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"9C9C9CFF", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "type":"do_ALayout", 8 | "views":[ 9 | { 10 | "bgColor":"16AF9FFF", 11 | "width":"750", 12 | "id":"do_ALayout_topbar", 13 | "type":"do_ALayout", 14 | "views":[ 15 | { 16 | "textAlign":"center", 17 | "x":"200", 18 | "width":"350", 19 | "y":"65", 20 | "fontSize":"40", 21 | "id":"do_Label_2", 22 | "text":"第四页", 23 | "type":"do_Label", 24 | "fontColor":"FFFFFFFF", 25 | "height":"60" 26 | }, 27 | { 28 | "width":"174", 29 | "x":"4", 30 | "id":"do_ALayout_back", 31 | "type":"do_ALayout", 32 | "views":[ 33 | { 34 | "width":"25", 35 | "x":"30", 36 | "y":"65", 37 | "id":"do_ImageView_1", 38 | "source":"source://modules/image/return.png", 39 | "type":"do_ImageView", 40 | "height":"42" 41 | } 42 | ], 43 | "height":"130" 44 | } 45 | ], 46 | "height":"128" 47 | } 48 | ], 49 | "height":"1206" 50 | } 51 | } -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/d.ui.js: -------------------------------------------------------------------------------- 1 | var dojs=require("dojs"); 2 | dojs.style.css(ui("do_ALayout_topbar"), "pageTopbar"); 3 | 4 | ui("do_ALayout_back").on("touch", function(){ 5 | dojs.core.closePage(); 6 | }); -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/img/a_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/mainFrame/sample/img/a_1.png -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/img/a_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/mainFrame/sample/img/a_2.png -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/img/b_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/mainFrame/sample/img/b_1.png -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/img/b_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/mainFrame/sample/img/b_2.png -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/img/c_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/mainFrame/sample/img/c_1.png -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/img/c_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/mainFrame/sample/img/c_2.png -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/img/d_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/mainFrame/sample/img/d_1.png -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/img/d_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/mainFrame/sample/img/d_2.png -------------------------------------------------------------------------------- /source/modules/mainFrame/sample/test.js: -------------------------------------------------------------------------------- 1 | module.exports.demo = function(){ 2 | var options=[ 3 | { 4 | name:"首页", 5 | path:"source://modules/mainFrame/sample/a.ui", 6 | image_on:"source://modules/mainFrame/sample/img/a_2.png", 7 | image_off:"source://modules/mainFrame/sample/img/a_1.png", 8 | fontColor_on:"55C5B9FF", 9 | fontColor_off:"9E9E9EFF" 10 | }, 11 | { 12 | name:"通讯录", 13 | path:"source://modules/mainFrame/sample/b.ui", 14 | image_on:"source://modules/mainFrame/sample/img/b_2.png", 15 | image_off:"source://modules/mainFrame/sample/img/b_1.png", 16 | fontColor_on:"55C5B9FF", 17 | fontColor_off:"9E9E9EFF" 18 | }, 19 | { 20 | name:"周边", 21 | path:"source://modules/mainFrame/sample/c.ui", 22 | image_on:"source://modules/mainFrame/sample/img/c_2.png", 23 | image_off:"source://modules/mainFrame/sample/img/c_1.png", 24 | fontColor_on:"55C5B9FF", 25 | fontColor_off:"9E9E9EFF" 26 | }, 27 | { 28 | name:"我", 29 | path:"source://modules/mainFrame/sample/d.ui", 30 | image_on:"source://modules/mainFrame/sample/img/d_2.png", 31 | image_off:"source://modules/mainFrame/sample/img/d_1.png", 32 | fontColor_on:"55C5B9FF", 33 | fontColor_off:"9E9E9EFF" 34 | } 35 | ]; 36 | var mainFrame=require("source://modules/mainFrame/call"); 37 | mainFrame.invoke(options); 38 | }; 39 | -------------------------------------------------------------------------------- /source/modules/mainFrame/src/main.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"FFFFFFFF", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "type":"do_ALayout", 8 | "views":[ 9 | { 10 | "width":"750", 11 | "id":"do_ALayout_1", 12 | "type":"do_ALayout", 13 | "views":[ 14 | { 15 | "width":"750", 16 | "id":"do_ViewShower_index", 17 | "type":"do_ViewShower", 18 | "height":"1207" 19 | } 20 | ], 21 | "height":"1237" 22 | }, 23 | { 24 | "bgColor":"C0C0C0FF", 25 | "width":"750", 26 | "y":"1207", 27 | "id":"do_ALayout_2", 28 | "type":"do_ALayout", 29 | "height":"1" 30 | }, 31 | { 32 | "bgColor":"CCCCCCFF", 33 | "width":"750", 34 | "y":"1208", 35 | "id":"do_Label_1", 36 | "type":"do_Label", 37 | "height":"1" 38 | }, 39 | { 40 | "bgColor":"FFFFFFFF", 41 | "width":"750", 42 | "y":"1209", 43 | "id":"do_ALayout_bottom", 44 | "type":"do_ALayout", 45 | "views":[], 46 | "height":"126" 47 | } 48 | ], 49 | "height":"1334" 50 | } 51 | } -------------------------------------------------------------------------------- /source/modules/mainFrame/src/main.ui.js: -------------------------------------------------------------------------------- 1 | var dojs = require("dojs"); 2 | 3 | dojs.page.allowExit(); 4 | 5 | var viewShower_data; 6 | var bottom_uis; 7 | 8 | var data = sm("do_Page").getData(); 9 | var buttonCount = data.length; 10 | if (buttonCount > 5) { 11 | dojs.core.error("mainFrame最多只能支持5个底部按钮"); 12 | } else { 13 | viewShower_data = []; 14 | bottom_uis = []; 15 | var width = Math.floor(750 / buttonCount); 16 | var x = 0; 17 | for (var i = 0; i < buttonCount; i++) { 18 | var addedUI = ui(ui("do_ALayout_bottom").add("addedUI" + i, "source://modules/mainFrame/src/main_1.ui", x, 0)); 19 | x = x + width; 20 | data[i]["width"] = width; 21 | addedUI.fire("initWidth", data[i]); 22 | bottom_uis[i] = addedUI; 23 | viewShower_data.push({ 24 | id : "b_" + i, 25 | path : data[i].path 26 | }); 27 | } 28 | ui("do_ViewShower_index").addViews(viewShower_data); 29 | for (var i = 0; i < buttonCount; i++) { 30 | bottom_uis[i].on("touch", i, function(d, e) { 31 | var index = e.data; 32 | for (var j = 0; j < bottom_uis.length; j++) { 33 | 34 | if (j == index) { 35 | data[j]["selected"] = "1"; 36 | } else { 37 | data[j]["selected"] = "0"; 38 | } 39 | bottom_uis[j].fire("selected", data[j]); 40 | } 41 | ui("do_ViewShower_index").showView(viewShower_data[index].id); 42 | }) 43 | } 44 | bottom_uis[0].fire("touch"); 45 | } 46 | -------------------------------------------------------------------------------- /source/modules/mainFrame/src/main_1.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"00000000", 4 | "x":"0", 5 | "width":"150", 6 | "y":"0", 7 | "id":"", 8 | "type":"do_ALayout", 9 | "views":[ 10 | { 11 | "x":"50", 12 | "width":"50", 13 | "y":"18", 14 | "id":"do_ImageView_button", 15 | "source":"source://image/icon_chat_on.png", 16 | "type":"do_ImageView", 17 | "height":"50" 18 | }, 19 | { 20 | "bgColor":"00000000", 21 | "textAlign":"center", 22 | "width":"150", 23 | "y":"80", 24 | "fontSize":"28", 25 | "id":"do_Label_button", 26 | "text":"首页", 27 | "type":"do_Label", 28 | "fontColor":"55C5B9FF", 29 | "height":"36" 30 | } 31 | ], 32 | "height":"126" 33 | } 34 | } -------------------------------------------------------------------------------- /source/modules/mainFrame/src/main_1.ui.js: -------------------------------------------------------------------------------- 1 | var dojs = require("dojs"); 2 | 3 | var image_button = ui("do_ImageView_button"); 4 | var label_button = ui("do_Label_button"); 5 | 6 | ui("$").on("initWidth", function(data) { 7 | var _width = data["width"]; 8 | if (this.width != _width) { 9 | this.width = _width; 10 | image_button.x = (_width - image_button.width) / 2; 11 | label_button.width = _width; 12 | this.redraw(); 13 | } 14 | image_button.source = data.image_off; 15 | label_button.fontColor = data.fontColor_off; 16 | label_button.text = data.name; 17 | 18 | }).on("selected", function(data) { 19 | if (data.selected == "1") { 20 | image_button.source = data.image_on; 21 | label_button.fontColor = data.fontColor_on; 22 | } else { 23 | image_button.source = data.image_off; 24 | label_button.fontColor = data.fontColor_off; 25 | } 26 | }); 27 | -------------------------------------------------------------------------------- /source/modules/popupMenu/call.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs=require("dojs"); 3 | 4 | //--------------------------------------------------------------- 5 | /** 6 | * 弹出式菜单 7 | * @param _option 选项参数 8 | */ 9 | module.exports.invoke = function(_option){ 10 | modules_menus=_option; 11 | dojs.page.showView("source://modules/popupMenu/src/main.ui", _option); 12 | }; 13 | 14 | if (!dojs.core.inPage()){ 15 | dojs.core.error("不允许在app.js中调用 popupMenu 模块"); 16 | } 17 | else{ 18 | d1.sm("do_Page").on("$$modules_internal_Event$$",function(data){ 19 | if (dojs.core.isNull(data) || 20 | dojs.core.isNull(data.moduleType) || 21 | data.moduleType != "$$popupMenu$$" || 22 | dojs.core.isNull(modules_menus)|| 23 | dojs.core.isNullData(modules_menus[data.result.index].callback)) return; 24 | dojs.core.callFunction(modules_menus[data.result.index].callback); 25 | }); 26 | } -------------------------------------------------------------------------------- /source/modules/popupMenu/sample/test.js: -------------------------------------------------------------------------------- 1 | var dojs = require("dojs"); 2 | 3 | module.exports.demo = function() { 4 | var menus = [ { 5 | //菜单名 6 | name : "拍照", 7 | //回调函数 8 | callback : function() { 9 | dojs.core.alert("点击了拍照"); 10 | } 11 | }, { 12 | //菜单名 13 | name : "相册", 14 | //回调函数 15 | callback : function() { 16 | dojs.core.alert("点击了相册"); 17 | } 18 | }, {}, { 19 | //菜单名 20 | name : "取消", 21 | //回调函数 22 | callback : function() { 23 | //do nothing 24 | } 25 | } ]; 26 | //弹出菜单 27 | var popupMenu = require("source://modules/popupMenu/call"); 28 | popupMenu.invoke(menus); 29 | }; 30 | -------------------------------------------------------------------------------- /source/modules/popupMenu/src/main.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"00000000", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "id":"do_ALayout_root", 8 | "type":"do_ALayout", 9 | "views":[ 10 | { 11 | "bgColor":"FFFFFFFF", 12 | "templates":"source://modules/popupMenu/src/main_1.ui,source://modules/popupMenu/src/main_2.ui", 13 | "width":"750", 14 | "id":"do_ListView_index", 15 | "type":"do_ListView", 16 | "height":"900" 17 | } 18 | ], 19 | "height":"1334" 20 | } 21 | } -------------------------------------------------------------------------------- /source/modules/popupMenu/src/main.ui.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs=require("dojs"); 3 | 4 | var animHide; 5 | var animMaskShow = mm("do_Animator"); 6 | var animMaskHide = mm("do_Animator"); 7 | animMaskShow.append(320, {bgColor:"00000044"}, "EaseOut"); 8 | animMaskHide.append(200, {bgColor:"00000000"}, "EaseOut"); 9 | function hideView(_func){ 10 | if (!ui("$").visible) return; 11 | sm("do_Page").hideKeyboard(); 12 | ui("$").animate(animMaskHide); 13 | ui("do_ListView_index").animate(animHide, function(){ 14 | ui("$").visible = false; 15 | if (_func){ 16 | dojs.core.callFunction(_func); 17 | } 18 | }); 19 | } 20 | var json_data; 21 | var do_ListData=mm("do_ListData"); 22 | dojs.page.allowHide( 23 | ui("$"), 24 | function(data){ 25 | var height=0; 26 | if (data){ 27 | json_data=[]; 28 | for(var i=0; i 900) height=900; 43 | ui("do_ListView_index").height=height; 44 | ui("do_ListView_index").y= 1334; 45 | ui("do_ListView_index").redraw(); 46 | do_ListData.removeAll(); 47 | do_ListData.addData(json_data); 48 | ui("do_ListView_index").bindItems(do_ListData); 49 | ui("$").bgColor="00000000"; 50 | ui("$").visible=true; 51 | var animShow = mm("do_Animator"); 52 | animHide = mm("do_Animator"); 53 | animShow.append(320, { 54 | "y" : 1334-height 55 | }); 56 | animHide.append(200, { 57 | "y" :1334 58 | }); 59 | ui("$").animate(animMaskShow); 60 | ui("do_ListView_index").animate(animShow); 61 | } 62 | else{ 63 | ui("do_ListView_index").visible=false; 64 | ui("$").visible=true; 65 | } 66 | }, 67 | function(data){ 68 | hideView(); 69 | } 70 | ); 71 | 72 | ui("do_ListView_index").on("touch", function(_index){ 73 | if (_index <0) return; 74 | var data = json_data[_index]; 75 | if (data.template !=0) return; 76 | hideView(function(){ 77 | d1.sm("do_Page").fire("$$modules_internal_Event$$", 78 | {moduleType:"$$popupMenu$$", result:{index:_index}}); 79 | }); 80 | }); 81 | -------------------------------------------------------------------------------- /source/modules/popupMenu/src/main_1.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"FFFFFFFF", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "id":"do_ALayout_root", 8 | "type":"do_ALayout", 9 | "views":[ 10 | { 11 | "textAlign":"center", 12 | "width":"750", 13 | "y":"25", 14 | "fontSize":"32", 15 | "id":"do_Label_name", 16 | "type":"do_Label", 17 | "height":"60" 18 | }, 19 | { 20 | "bgColor":"ACACACFF", 21 | "width":"750", 22 | "y":"109", 23 | "id":"do_Label_line", 24 | "type":"do_Label", 25 | "height":"1" 26 | } 27 | ], 28 | "height":"110" 29 | } 30 | } -------------------------------------------------------------------------------- /source/modules/popupMenu/src/main_1.ui.js: -------------------------------------------------------------------------------- 1 | ui("$").setMapping({ 2 | "do_Label_name.text":"name" 3 | }); 4 | -------------------------------------------------------------------------------- /source/modules/popupMenu/src/main_2.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"ACACACFF", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "id":"do_ALayout_root", 8 | "type":"do_ALayout", 9 | "views":[ 10 | { 11 | "bgColor":"ACACACFF", 12 | "width":"750", 13 | "y":"107", 14 | "id":"do_Label_line", 15 | "type":"do_Label", 16 | "height":"1" 17 | } 18 | ], 19 | "height":"10" 20 | } 21 | } -------------------------------------------------------------------------------- /source/modules/popupMenu/src/main_2.ui.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/popupMenu/src/main_2.ui.js -------------------------------------------------------------------------------- /source/modules/realNameAuth/call.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs=require("dojs"); 3 | 4 | //--------------------------------------------------------------- 5 | /** 6 | * 实名认证 7 | * @param _option 选项参数 8 | */ 9 | module.exports.invoke = function(_option){ 10 | dojs.core.openPage({ 11 | source:"source://modules/realNameAuth/src/main.ui", 12 | animationType:"push_r2l_1", 13 | data:_option, 14 | statusBarState:"transparent" 15 | }); 16 | }; -------------------------------------------------------------------------------- /source/modules/realNameAuth/sample/realNameAuthCallback.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs = require("dojs"); 3 | 4 | module.exports.invoke = function(data) { 5 | //TODO:提交服务端,完成实名认证功能 6 | dojs.core.p(data) 7 | 8 | dojs.core.closePage(); 9 | return; 10 | }; 11 | -------------------------------------------------------------------------------- /source/modules/realNameAuth/sample/test.js: -------------------------------------------------------------------------------- 1 | module.exports.demo = function() { 2 | var realNameAuth=require("source://modules/realNameAuth/call"); 3 | realNameAuth.invoke({ 4 | // 标题 5 | title:"实名认证", 6 | // 真实姓名 7 | name:{ 8 | // 提示内容 9 | hint : "真实姓名", 10 | // 最大长度限制 11 | maxLength : 10 12 | }, 13 | // 身份证号 14 | id:{ 15 | // 提示内容 16 | hint : "身份证号", 17 | // 最大长度限制 18 | maxLength : 18 19 | }, 20 | //提示信息 21 | prompt:"上传相关照片", 22 | // 回调的代码 23 | onCallback:"source://modules/realNameAuth/sample/realNameAuthCallback" 24 | 25 | }); 26 | }; 27 | -------------------------------------------------------------------------------- /source/modules/realNameAuth/src/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/realNameAuth/src/close.png -------------------------------------------------------------------------------- /source/modules/realNameAuth/src/real_name1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/realNameAuth/src/real_name1.png -------------------------------------------------------------------------------- /source/modules/realNameAuth/src/real_name2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/realNameAuth/src/real_name2.png -------------------------------------------------------------------------------- /source/modules/realNameAuth/src/real_name3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/realNameAuth/src/real_name3.png -------------------------------------------------------------------------------- /source/modules/register/call.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs=require("dojs"); 3 | 4 | //--------------------------------------------------------------- 5 | /** 6 | * 用户注册 7 | * @param _option 选项参数 8 | */ 9 | module.exports.invoke = function(_option){ 10 | dojs.core.openPage({ 11 | source:"source://modules/register/src/main.ui", 12 | animationType:"push_r2l_1", 13 | data:_option, 14 | statusBarState:"transparent" 15 | }); 16 | }; -------------------------------------------------------------------------------- /source/modules/register/sample/registerCallback.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs = require("dojs"); 3 | 4 | module.exports.invoke = function(data) { 5 | if (data.type=="register"){ 6 | //用户注册的操作 7 | if (dojs.core.isNullData(data.phone)){ 8 | dojs.core.toast("手机号不允许空"); 9 | return; 10 | } 11 | if (dojs.core.isNullData(data.code)){ 12 | dojs.core.toast("验证码不允许空"); 13 | return; 14 | } 15 | if (dojs.core.isNullData(data.password)){ 16 | dojs.core.toast("新用户的密码不允许空"); 17 | return; 18 | } 19 | //TODO:提交服务端,完成注册功能 20 | 21 | dojs.core.closePage(); 22 | return; 23 | } 24 | 25 | if (data.type=="sendSms"){ 26 | //发送短信的操作 27 | if (dojs.core.isNullData(data.phone)){ 28 | dojs.core.toast("手机号不允许空"); 29 | return; 30 | } 31 | //TODO:由服务端调用短信网关,发送验证码短信 32 | 33 | dojs.core.toast("验证码已经通过短信发送,请尽快查收"); 34 | //通知UI,短信已经来时发送 35 | d1.sm("do_Page").fire("smsStartSending"); 36 | 37 | return; 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /source/modules/register/sample/test.js: -------------------------------------------------------------------------------- 1 | module.exports.demo = function() { 2 | var register=require("source://modules/register/call"); 3 | register.invoke({ 4 | // 标题 5 | title:"会员注册", 6 | // 短信重复发送的间隔时间 (秒) 7 | sendSmsInterval : 60, 8 | // 手机号 9 | phoneNumber:{ 10 | // 提示内容 11 | hint : "手机号", 12 | // 最大长度限制 13 | maxLength : 32 14 | }, 15 | // 短信验证码 16 | smsCode:{ 17 | // 提示内容 18 | hint : "输入短信验证码", 19 | // 最大长度限制 20 | maxLength : 6 21 | }, 22 | // 新用户的密码 23 | password:{ 24 | // 提示内容 25 | hint : "设置6-18位字母数字组合的新用户密码", 26 | // 最大长度限制 27 | maxLength : 18 28 | }, 29 | // 回调的代码 30 | onCallback:"source://modules/register/sample/registerCallback" 31 | 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /source/modules/register/src/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/register/src/close.png -------------------------------------------------------------------------------- /source/modules/scanBarcode/call.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs=require("dojs"); 3 | 4 | var module_scanBarcode_callback=null; 5 | //--------------------------------------------------------------- 6 | /** 7 | * 二维码扫描 8 | * @param _option 选项参数 9 | * @param _callback 回调函数 10 | */ 11 | module.exports.invoke = function(_option){ 12 | module_scanBarcode_callback=_option.onCallback; 13 | dojs.core.openPage({ 14 | source:"source://modules/scanBarcode/src/main.ui", 15 | animationType:"push_r2l_1", 16 | data:_option, 17 | statusBarState:"transparent" 18 | }); 19 | }; 20 | 21 | if (!dojs.core.inPage()){ 22 | dojs.core.error("不允许在app.js中调用 scanBarcode 模块"); 23 | } 24 | else{ 25 | d1.sm("do_Page").on("result", function(data){ 26 | if (dojs.core.isNull(data) || 27 | dojs.core.isNull(data.moduleType) || 28 | data.moduleType != "$$scanBarcode$$" || 29 | dojs.core.isNullData(module_scanBarcode_callback )) return; 30 | dojs.core.callFunction(module_scanBarcode_callback, data.result); 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /source/modules/scanBarcode/sample/test.js: -------------------------------------------------------------------------------- 1 | module.exports.demo = function() { 2 | var scanBarcode=require("source://modules/scanBarcode/call"); 3 | scanBarcode.invoke({ 4 | //标题 5 | title : "扫描二维码", 6 | //提示内容 7 | hint : "扫描二维码", 8 | //回调事件 9 | onCallback:function(data){ 10 | //此处可以编写回调代码 11 | var dojs=require("dojs"); 12 | dojs.core.alert(data.value, data.code); 13 | } 14 | }); 15 | }; 16 | -------------------------------------------------------------------------------- /source/modules/scanBarcode/src/main.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"000000FF", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "type":"do_ALayout", 8 | "views":[ 9 | { 10 | "bgColor":"000000FF", 11 | "width":"750", 12 | "y":"127", 13 | "scanArea":"175, 400, 400, 400", 14 | "id":"do_BarcodeView_Scaner", 15 | "type":"do_BarcodeView", 16 | "height":"1206" 17 | }, 18 | { 19 | "bgColor":"16AF9FFF", 20 | "width":"750", 21 | "id":"do_ALayout_topbar", 22 | "type":"do_ALayout", 23 | "views":[ 24 | { 25 | "textAlign":"center", 26 | "x":"200", 27 | "width":"350", 28 | "y":"65", 29 | "fontSize":"40", 30 | "id":"do_Label_title", 31 | "text":"扫描二维码", 32 | "type":"do_Label", 33 | "fontColor":"FFFFFFFF", 34 | "height":"60" 35 | }, 36 | { 37 | "width":"174", 38 | "x":"4", 39 | "id":"do_ALayout_back", 40 | "type":"do_ALayout", 41 | "views":[ 42 | { 43 | "width":"25", 44 | "x":"30", 45 | "y":"65", 46 | "id":"do_ImageView_1", 47 | "source":"source://modules/image/return.png", 48 | "type":"do_ImageView", 49 | "height":"42" 50 | } 51 | ], 52 | "height":"130" 53 | } 54 | ], 55 | "height":"128" 56 | }, 57 | { 58 | "textAlign":"center", 59 | "width":"750", 60 | "y":"937", 61 | "fontSize":"20", 62 | "id":"do_Label_1", 63 | "text":"请将二维码/条码放入框内,即可自动扫描", 64 | "type":"do_Label", 65 | "fontColor":"FFFFFFFF", 66 | "height":"45" 67 | }, 68 | { 69 | "textAlign":"center", 70 | "width":"750", 71 | "y":"982", 72 | "fontSize":"20", 73 | "id":"do_Label_hint", 74 | "text":"扫描二维码", 75 | "type":"do_Label", 76 | "fontColor":"00FF00FF", 77 | "height":"45" 78 | } 79 | ], 80 | "height":"1334" 81 | } 82 | } -------------------------------------------------------------------------------- /source/modules/scanBarcode/src/main.ui.js: -------------------------------------------------------------------------------- 1 | var dojs=require("dojs"); 2 | 3 | dojs.style.css(ui("do_ALayout_topbar"), "pageTopbar"); 4 | dojs.style.css(ui("do_ALayout_back"), "dynamicButton"); 5 | dojs.page.allowClose(ui("do_ALayout_back")); 6 | 7 | var data=sm("do_Page").getData(); 8 | if (!dojs.core.isNullData(data) && !dojs.core.isNullData(data.title)){ 9 | ui("do_Label_title").text = data.title; 10 | 11 | if (!dojs.core.isNullData(data) && !dojs.core.isNullData(data.hint)){ 12 | ui("do_Label_hint").text = data.hint; 13 | } 14 | ui("do_BarcodeView_Scaner").start(function(scanResult){ 15 | sm("do_Device").beep(); 16 | sm("do_App").closePage({ 17 | moduleType:"$$scanBarcode$$", 18 | result:{ 19 | value:scanResult.value, 20 | code:scanResult.code 21 | } 22 | }); 23 | }); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /source/modules/simpleIndex/call.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs=require("dojs"); 3 | 4 | //--------------------------------------------------------------- 5 | /** 6 | * 简单索引 7 | * @param _definition 索引定义 8 | * @param _option 选项参数 9 | */ 10 | module.exports.invoke = function(_definition, _option){ 11 | _option=_option||{}; 12 | _definition=_definition||[]; 13 | module_simpleIndex_model=_definition; 14 | dojs.core.openPage({ 15 | source:"source://modules/simpleIndex/src/main.ui", 16 | animationType:"push_r2l_1", 17 | data:{model:_definition, 18 | option:_option 19 | }, 20 | statusBarState:"transparent" 21 | }); 22 | }; -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/a.js: -------------------------------------------------------------------------------- 1 | var simpleIndex = require("source://modules/simpleIndex/call"); 2 | var dojs = require("dojs"); 3 | 4 | module.exports.invoke = function() { 5 | dojs.core.alert("点击了 '我的照片'"); 6 | }; 7 | -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/simpleIndex/sample/a.png -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/simpleIndex/sample/b.png -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/b.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"00000000", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "type":"do_ALayout", 8 | "views":[ 9 | { 10 | "bgColor":"16AF9FFF", 11 | "width":"750", 12 | "id":"do_ALayout_topbar", 13 | "type":"do_ALayout", 14 | "views":[ 15 | { 16 | "textAlign":"center", 17 | "x":"200", 18 | "width":"350", 19 | "y":"65", 20 | "fontSize":"40", 21 | "id":"do_Label_2", 22 | "text":"我的二维码", 23 | "type":"do_Label", 24 | "fontColor":"FFFFFFFF", 25 | "height":"60" 26 | }, 27 | { 28 | "width":"174", 29 | "x":"4", 30 | "id":"do_ALayout_back", 31 | "type":"do_ALayout", 32 | "views":[ 33 | { 34 | "width":"25", 35 | "x":"30", 36 | "y":"65", 37 | "id":"do_ImageView_1", 38 | "source":"source://modules/image/return.png", 39 | "type":"do_ImageView", 40 | "height":"42" 41 | } 42 | ], 43 | "height":"130" 44 | } 45 | ], 46 | "height":"128" 47 | } 48 | ], 49 | "height":"1334" 50 | } 51 | } -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/b.ui.js: -------------------------------------------------------------------------------- 1 | var dojs=require("dojs"); 2 | dojs.style.css(ui("do_ALayout_topbar"), "pageTopbar"); 3 | 4 | dojs.page.allowClose(ui("do_ALayout_back")); -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/simpleIndex/sample/c.png -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/c.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"00000000", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "type":"do_ALayout", 8 | "views":[ 9 | { 10 | "bgColor":"16AF9FFF", 11 | "width":"750", 12 | "id":"do_ALayout_topbar", 13 | "type":"do_ALayout", 14 | "views":[ 15 | { 16 | "textAlign":"center", 17 | "x":"200", 18 | "width":"350", 19 | "y":"65", 20 | "fontSize":"40", 21 | "id":"do_Label_2", 22 | "text":"我的团队", 23 | "type":"do_Label", 24 | "fontColor":"FFFFFFFF", 25 | "height":"60" 26 | }, 27 | { 28 | "width":"174", 29 | "x":"4", 30 | "id":"do_ALayout_back", 31 | "type":"do_ALayout", 32 | "views":[ 33 | { 34 | "width":"25", 35 | "x":"30", 36 | "y":"65", 37 | "id":"do_ImageView_1", 38 | "source":"source://modules/image/return.png", 39 | "type":"do_ImageView", 40 | "height":"42" 41 | } 42 | ], 43 | "height":"130" 44 | } 45 | ], 46 | "height":"128" 47 | } 48 | ], 49 | "height":"1334" 50 | } 51 | } -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/c.ui.js: -------------------------------------------------------------------------------- 1 | var dojs=require("dojs"); 2 | dojs.style.css(ui("do_ALayout_topbar"), "pageTopbar"); 3 | 4 | dojs.page.allowClose(ui("do_ALayout_back")); -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/simpleIndex/sample/d.png -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/d.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"00000000", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "type":"do_ALayout", 8 | "views":[ 9 | { 10 | "bgColor":"16AF9FFF", 11 | "width":"750", 12 | "id":"do_ALayout_topbar", 13 | "type":"do_ALayout", 14 | "views":[ 15 | { 16 | "textAlign":"center", 17 | "x":"200", 18 | "width":"350", 19 | "y":"65", 20 | "fontSize":"40", 21 | "id":"do_Label_2", 22 | "text":"购物车", 23 | "type":"do_Label", 24 | "fontColor":"FFFFFFFF", 25 | "height":"60" 26 | }, 27 | { 28 | "width":"174", 29 | "x":"4", 30 | "id":"do_ALayout_back", 31 | "type":"do_ALayout", 32 | "views":[ 33 | { 34 | "width":"25", 35 | "x":"30", 36 | "y":"65", 37 | "id":"do_ImageView_1", 38 | "source":"source://modules/image/return.png", 39 | "type":"do_ImageView", 40 | "height":"42" 41 | } 42 | ], 43 | "height":"130" 44 | } 45 | ], 46 | "height":"128" 47 | } 48 | ], 49 | "height":"1334" 50 | } 51 | } -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/d.ui.js: -------------------------------------------------------------------------------- 1 | var dojs=require("dojs"); 2 | dojs.style.css(ui("do_ALayout_topbar"), "pageTopbar"); 3 | 4 | dojs.page.allowClose(ui("do_ALayout_back")); -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/e.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"00000000", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "type":"do_ALayout", 8 | "views":[ 9 | { 10 | "bgColor":"16AF9FFF", 11 | "width":"750", 12 | "id":"do_ALayout_topbar", 13 | "type":"do_ALayout", 14 | "views":[ 15 | { 16 | "textAlign":"center", 17 | "x":"200", 18 | "width":"350", 19 | "y":"65", 20 | "fontSize":"40", 21 | "id":"do_Label_2", 22 | "text":"通用功能", 23 | "type":"do_Label", 24 | "fontColor":"FFFFFFFF", 25 | "height":"60" 26 | }, 27 | { 28 | "width":"174", 29 | "x":"4", 30 | "id":"do_ALayout_back", 31 | "type":"do_ALayout", 32 | "views":[ 33 | { 34 | "width":"25", 35 | "x":"30", 36 | "y":"65", 37 | "id":"do_ImageView_1", 38 | "source":"source://modules/image/return.png", 39 | "type":"do_ImageView", 40 | "height":"42" 41 | } 42 | ], 43 | "height":"130" 44 | } 45 | ], 46 | "height":"128" 47 | } 48 | ], 49 | "height":"1334" 50 | } 51 | } -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/e.ui.js: -------------------------------------------------------------------------------- 1 | var dojs=require("dojs"); 2 | dojs.style.css(ui("do_ALayout_topbar"), "pageTopbar"); 3 | 4 | dojs.page.allowClose(ui("do_ALayout_back")); -------------------------------------------------------------------------------- /source/modules/simpleIndex/sample/test.js: -------------------------------------------------------------------------------- 1 | module.exports.demo = function() { 2 | var simpleIndex = require("source://modules/simpleIndex/call"); 3 | var _indexDefine = [ { 4 | //列表名称 5 | name : "我的照片", 6 | //列表图标 7 | image : "source://modules/simpleIndex/sample/a.png", 8 | //调用指定的js文件中的call函数 9 | path : "source://modules/simpleIndex/sample/a" 10 | }, { 11 | name : "我的二维码", 12 | image : "source://modules/simpleIndex/sample/b.png", 13 | //打开指定的页面 14 | path : "source://modules/simpleIndex/sample/b.ui" 15 | }, { 16 | name : "我的团队", 17 | image : "source://modules/simpleIndex/sample/c.png", 18 | path : "source://modules/simpleIndex/sample/c.ui" 19 | }, {}, { 20 | name : "购物车", 21 | image : "source://modules/simpleIndex/sample/d.png", 22 | path : "source://modules/simpleIndex/sample/d.ui" 23 | }, {}, { 24 | name : "通用功能", 25 | path : "source://modules/simpleIndex/sample/e.ui" 26 | } ]; 27 | simpleIndex.invoke(_indexDefine, { 28 | title : "个人信息" 29 | }); 30 | }; 31 | -------------------------------------------------------------------------------- /source/modules/simpleIndex/src/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/modules/simpleIndex/src/arrow.png -------------------------------------------------------------------------------- /source/modules/simpleIndex/src/main.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"ECECECFF", 4 | "x":"0", 5 | "width":"750", 6 | "y":"0", 7 | "type":"do_ALayout", 8 | "views":[ 9 | { 10 | "bgColor":"16AF9FFF", 11 | "width":"750", 12 | "id":"do_ALayout_topbar", 13 | "type":"do_ALayout", 14 | "views":[ 15 | { 16 | "textAlign":"center", 17 | "x":"120", 18 | "width":"510", 19 | "y":"65", 20 | "fontSize":"40", 21 | "id":"do_Label_title", 22 | "type":"do_Label", 23 | "fontColor":"FFFFFFFF", 24 | "height":"60" 25 | }, 26 | { 27 | "width":"120", 28 | "x":"4", 29 | "id":"do_ALayout_back", 30 | "type":"do_ALayout", 31 | "views":[ 32 | { 33 | "width":"25", 34 | "x":"30", 35 | "y":"65", 36 | "id":"do_ImageView_1", 37 | "source":"source://modules/image/return.png", 38 | "type":"do_ImageView", 39 | "height":"42" 40 | } 41 | ], 42 | "height":"130" 43 | } 44 | ], 45 | "height":"128" 46 | }, 47 | { 48 | "bgColor":"ECECECFF", 49 | "templates":"source://modules/simpleIndex/src/main_1.ui,source://modules/simpleIndex/src/main_2.ui,source://modules/simpleIndex/src/main_3.ui", 50 | "width":"750", 51 | "y":"128", 52 | "id":"do_ListView_index", 53 | "type":"do_ListView", 54 | "height":"1206" 55 | } 56 | ], 57 | "height":"1334" 58 | } 59 | } -------------------------------------------------------------------------------- /source/modules/simpleIndex/src/main.ui.js: -------------------------------------------------------------------------------- 1 | var dojs = require("dojs"); 2 | require("ext/stringExt") 3 | 4 | dojs.style.css(ui("do_ALayout_topbar"), "pageTopbar"); 5 | dojs.style.css(ui("do_ALayout_back"), "dynamicButton"); 6 | 7 | dojs.page.allowClose(ui("do_ALayout_back")); 8 | 9 | var data = sm("do_Page").getData(); 10 | if (dojs.core.isNullData(data)) data={}; 11 | if (dojs.core.isNullData(data.option)) data.option={}; 12 | if (!dojs.core.isNullData(data.option.title)) { 13 | ui("do_Label_title").text = data.option.title; 14 | } 15 | if (dojs.core.isNullData(data.model)) data.model=[]; 16 | var json_data=[]; 17 | var do_ListData=mm("do_ListData"); 18 | for(var i=0; i 1 && v.indexOf("@")==0){ 22 | v=do_Global.getMemory(v.substr(1)); 23 | } 24 | if (typeof(v)=="function"){ 25 | if (typeof(ui)=="object" && ui.length > 0){ 26 | for (var i=0; i 0){ 40 | for (var i=0; i 5) 20 | count = 5; 21 | var _w = root.width / count; 22 | var _h = root.height; 23 | var zoom = 50 / 125; 24 | for (var i = 0; i < count; i++) { 25 | ui(tags[i]).width = _w; 26 | ui(tags[i]).height = _h; 27 | ui(tags[i]).x = _w * i; 28 | 29 | drawRound(ui(tags[i] + "_1"), ui(tags[i] + "_2"), _w * zoom, _h, (_option.selected == i)); 30 | 31 | drawTitle(ui(tags[i] + "_3"), _w, _h, zoom, _option.content[i]); 32 | } 33 | for (var i = count; i < 5; i++) { 34 | ui(tags[i]).visible = false; 35 | } 36 | root.redraw(); 37 | root.visible = true; 38 | }); 39 | for (var i = 0; i < tags.length; i++) { 40 | var click = ui(tags[i]); 41 | click.on("touch", i, function(d, e) { 42 | send_type(d, e); 43 | }) 44 | } 45 | // private Function 46 | 47 | function drawTitle(v, _w, _h, zoom, data) { 48 | v.x = _w * zoom + 2; 49 | v.y = 2; 50 | v.width = _w * (1 - zoom) - 4; 51 | v.height = _h - 4; 52 | v.text = data.text; 53 | v.tag = data.tag; 54 | } 55 | function drawRound(v1, v2, w, h, isSelected) { 56 | var r = Math.min(w, h); 57 | v1.width = r - 4; 58 | v1.height = r - 4; 59 | v1.x = (w - v1.width) / 2; 60 | v1.y = (h - v1.height) / 2 61 | 62 | radius = v1.width / 2; 63 | if (isSelected) 64 | v1.border = "FF8000FF,1," + radius; 65 | else 66 | v1.border = "000000FF,1," + radius; 67 | 68 | v2.width = radius; 69 | v2.height = radius; 70 | v2.x = (v1.width - v2.width) / 2; 71 | v2.y = (v1.height - v2.height) / 2; 72 | 73 | if (isSelected) 74 | v2.bgColor = "FF8000FF"; 75 | else 76 | v2.bgColor = "00000000"; 77 | } 78 | 79 | function send_type(d, e) { 80 | var i = e.data; 81 | var d = {}; 82 | var tagLabel = ui(tags[i] + "_3"); 83 | d.text = tagLabel.text; 84 | d.tag = tagLabel.tag; 85 | root.fire("onSelected", d); 86 | 87 | for (var j = 0; j < tags.length; j++) { 88 | var border = ui(tags[j] + "_1"); 89 | var bgcolor = ui(tags[j] + "_2"); 90 | if (i == j) { 91 | border.border = "FF8000FF,1," + radius; 92 | bgcolor.bgColor = "FF8000FF"; 93 | } else { 94 | border.border = "000000FF,1," + radius; 95 | bgcolor.bgColor = "00000000"; 96 | } 97 | } 98 | } -------------------------------------------------------------------------------- /source/userControls/starComment/sample/test.js: -------------------------------------------------------------------------------- 1 | var dojs = require("dojs"); 2 | /** 3 | * 五星评价 4 | */ 5 | module.exports.demo = function(_parent) { 6 | var userControl = require("source://userControls/userControl"); 7 | userControl.addView(_parent, "starComment", { 8 | // 加到ALayout上的坐标值 9 | x : 50, 10 | y : 340, 11 | // 标题ALayout上的宽高,建议宽度是高度的5倍 12 | width : 600, 13 | height : 120, 14 | // 初始选中的星数 15 | star : 2, 16 | onStarTouch : function(data) { 17 | // 处理选中几颗星的返回结果 18 | dojs.core.toast(data); 19 | } 20 | }); 21 | }; 22 | -------------------------------------------------------------------------------- /source/userControls/starComment/src/main.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"00000000", 4 | "x":"0", 5 | "width":"600", 6 | "y":"0", 7 | "id":"", 8 | "type":"do_ALayout", 9 | "views":[ 10 | { 11 | "width":"120", 12 | "id":"star1", 13 | "source":"source://userControls/starComment/src/star.png", 14 | "type":"do_ImageView", 15 | "enabled":"true", 16 | "height":"120" 17 | }, 18 | { 19 | "width":"120", 20 | "x":"120", 21 | "id":"star2", 22 | "source":"source://userControls/starComment/src/star.png", 23 | "type":"do_ImageView", 24 | "enabled":"true", 25 | "height":"120" 26 | }, 27 | { 28 | "width":"120", 29 | "x":"240", 30 | "id":"star3", 31 | "source":"source://userControls/starComment/src/star.png", 32 | "type":"do_ImageView", 33 | "enabled":"true", 34 | "height":"120" 35 | }, 36 | { 37 | "width":"120", 38 | "x":"360", 39 | "id":"star4", 40 | "source":"source://userControls/starComment/src/star.png", 41 | "type":"do_ImageView", 42 | "enabled":"true", 43 | "height":"120" 44 | }, 45 | { 46 | "width":"120", 47 | "x":"480", 48 | "id":"star5", 49 | "source":"source://userControls/starComment/src/starep.png", 50 | "type":"do_ImageView", 51 | "enabled":"true", 52 | "height":"120" 53 | } 54 | ], 55 | "height":"120" 56 | } 57 | } -------------------------------------------------------------------------------- /source/userControls/starComment/src/main.ui.js: -------------------------------------------------------------------------------- 1 | /** 2 | * related to main.ui 3 | * 4 | * @Author : and 5 | * @Timestamp : 2016-10-03 6 | */ 7 | 8 | // variable 9 | var do_Page = sm("do_Page"); 10 | var root = ui("$"); 11 | // event 12 | root.on("usreControlInit", function(_option) { 13 | root.visible = false; 14 | root.width = _option.width; 15 | root.height = _option.height; 16 | var _w = root.width / 5; 17 | var _h = root.height; 18 | for (var i = 0; i < 5; i++) { 19 | var star = ui("star" + (i + 1)) 20 | star.width = _w; 21 | star.height = _h; 22 | star.x = i * _w; 23 | star.on("touch", (i + 1), function(d, e) { 24 | comment(d, e); 25 | }) 26 | } 27 | root.redraw(); 28 | if (_option["star"]) { 29 | comment(null, { 30 | data : _option["star"] 31 | }) 32 | } 33 | root.visible = true; 34 | 35 | }); 36 | 37 | // private function 38 | function comment(d, e) { 39 | var i = parseInt(e.data); 40 | for (var j = 0; j < i; j++) { 41 | ui("star" + (j + 1)).source = "source://userControls/starComment/src/star.png" 42 | } 43 | for (var j = i; j < 5; j++) { 44 | ui("star" + (j + 1)).source = "source://userControls/starComment/src/starep.png" 45 | } 46 | root.fire("onStarTouch", i); 47 | } -------------------------------------------------------------------------------- /source/userControls/starComment/src/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/userControls/starComment/src/star.png -------------------------------------------------------------------------------- /source/userControls/starComment/src/starep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/userControls/starComment/src/starep.png -------------------------------------------------------------------------------- /source/userControls/topBar/sample/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/userControls/topBar/sample/add.png -------------------------------------------------------------------------------- /source/userControls/topBar/sample/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/userControls/topBar/sample/background.jpg -------------------------------------------------------------------------------- /source/userControls/topBar/sample/return.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/do-js/dojs/c2845b90c354355cd3e497468f00d8aaa5038381/source/userControls/topBar/sample/return.png -------------------------------------------------------------------------------- /source/userControls/topBar/sample/test.js: -------------------------------------------------------------------------------- 1 | var dojs = require("dojs"); 2 | /** 3 | * topBar宽固定是750,高固定为128或88,x,y固定为0,0 4 | */ 5 | module.exports.demo = function(_parent) { 6 | var userControl = require("source://userControls/userControl"); 7 | userControl.addView(_parent, "topBar", { 8 | // 背景图片或颜色,如下为图片,也可以是FF0000FF这种颜色值 9 | background : "source://userControls/topBar/sample/background.jpg", 10 | // 包括系统状态栏,则高度为128,否则为88 11 | noSystemStatusBar : false, 12 | // 左边按钮是一个do_ImageView,可以设置这个组件的任何属性 13 | leftButton : { 14 | source : "source://userControls/topBar/sample/return.png", 15 | }, 16 | // 右边按钮是一个do_ImageView,可以设置这个组件的任何属性 17 | rightButton : { 18 | source : "source://userControls/topBar/sample/add.png", 19 | }, 20 | // 是否允许左边按钮点击的时候关闭当前page,缺省是false 21 | leftButtonAllowClose : true, 22 | // 中间的title是一个label,可以设置它的任意有效属性 23 | titleLabel : { 24 | text : "我是TopBar1" 25 | }, 26 | // 点击左边按钮触发的回调 27 | onLeftButtonTouch : function() { 28 | dojs.core.toast("点击左边按钮"); 29 | }, 30 | // 点击右边边按钮触发的回调 31 | onRightButtonTouch : function() { 32 | dojs.core.toast("点击右边按钮"); 33 | } 34 | }); 35 | } -------------------------------------------------------------------------------- /source/userControls/topBar/src/main.ui: -------------------------------------------------------------------------------- 1 | { 2 | "RootView":{ 3 | "bgColor":"00000000", 4 | "width":"750", 5 | "id":"root", 6 | "type":"do_ALayout", 7 | "views":[ 8 | { 9 | "textAlign":"center", 10 | "x":"126", 11 | "width":"500", 12 | "y":"55", 13 | "fontSize":"42", 14 | "id":"title_label", 15 | "text":"标题", 16 | "type":"do_Label", 17 | "fontColor":"FFFFFFFF", 18 | "height":"60" 19 | }, 20 | { 21 | "width":"110", 22 | "x":"631", 23 | "y":"14", 24 | "id":"rightButton", 25 | "type":"do_ALayout", 26 | "views":[ 27 | { 28 | "x":"40", 29 | "width":"48", 30 | "y":"54", 31 | "id":"rightImage", 32 | "source":"source://image/add.png", 33 | "type":"do_ImageView", 34 | "height":"48" 35 | } 36 | ], 37 | "height":"110" 38 | }, 39 | { 40 | "width":"110", 41 | "x":"9", 42 | "y":"14", 43 | "id":"leftButton", 44 | "type":"do_ALayout", 45 | "views":[ 46 | { 47 | "x":"22", 48 | "width":"48", 49 | "y":"54", 50 | "id":"leftImage", 51 | "source":"source://image/add.png", 52 | "type":"do_ImageView", 53 | "height":"48" 54 | } 55 | ], 56 | "height":"110" 57 | } 58 | ], 59 | "height":"128" 60 | } 61 | } -------------------------------------------------------------------------------- /source/userControls/topBar/src/main.ui.js: -------------------------------------------------------------------------------- 1 | /** 2 | * related to main.ui 3 | * 4 | * @Author : and 5 | * @Timestamp : 2016-10-03 6 | */ 7 | 8 | // variable 9 | var dojs = require("dojs"); 10 | var do_Page = sm("do_Page"); 11 | var root = ui("$"); 12 | // event 13 | root.on("usreControlInit", function(_option) { 14 | // 调整大小,如果不需要系统状态栏,则高度减少40 15 | if (_option["noSystemStatusBar"]) { 16 | root.height = root.height - 40; 17 | ui("leftButton").y = ui("leftButton").y - 40; 18 | ui("rightButton").y = ui("rightButton").y - 40; 19 | ui("title_label").y = ui("title_label").y - 40; 20 | } 21 | root.redraw(); 22 | // 修改title 23 | if (_option["titleLabel"]) { 24 | ui("title_label").set(_option["titleLabel"]); 25 | } 26 | // 支持背景色或背景图片 27 | var background = _option["background"]; 28 | if (background) { 29 | if (background.indexOf("source://") >= 0 || background.indexOf("data://") >= 0) { 30 | root.bgImage = background; 31 | } else { 32 | root.bgColor = background; 33 | } 34 | } 35 | // 36 | if (_option["leftButton"]) { 37 | ui("leftImage").set(_option["leftButton"]); 38 | } 39 | if (_option["rightButton"]) { 40 | ui("rightImage").set(_option["rightButton"]); 41 | } 42 | // 43 | ui("leftButton").on("touch", function() { 44 | root.fire("onLeftButtonTouch") 45 | }); 46 | ui("rightButton").on("touch", function() { 47 | root.fire("onRightButtonTouch") 48 | }); 49 | 50 | dojs.style.css(ui("leftImage"), "dynamicButton"); 51 | dojs.style.css(ui("rightImage"), "dynamicButton"); 52 | 53 | if (_option["leftButtonAllowClose"]) { 54 | dojs.page.allowClose(ui("leftButton")); 55 | } 56 | }); 57 | // private Function 58 | 59 | -------------------------------------------------------------------------------- /source/userControls/userControl.js: -------------------------------------------------------------------------------- 1 | var d1 = require("deviceone"); 2 | var dojs=require("dojs"); 3 | 4 | //--------------------------------------------------------------- 5 | module.exports.addView = function(_parent, _controlName, _option){ 6 | _option.x=_option.x||0; 7 | _option.y=_option.y||0; 8 | _option.width=_option.width||0; 9 | _option.height=_option.height||0; 10 | if (dojs.core.isNull(_parent)){ 11 | dojs.core.error("试图userControl加入到null对象上"); 12 | return null; 13 | } 14 | if (_parent.getType() == "do_ALayout"){ 15 | var _id=dojs.core.getUUID(); 16 | var _address = _parent.add(_id, "source://userControls/" + _controlName + "/src/main.ui", _option.x, _option.y); 17 | var _view=d1.ui(_address); 18 | _view.fire("usreControlInit", _option); 19 | for(var k in _option){ 20 | if (typeof(_option[k]) !="function") continue; 21 | _view.on(k, _option[k]); 22 | } 23 | _view.visible=true; 24 | _view.fire("usreControlInitialized", _option); 25 | return _view; 26 | } 27 | if (_parent.getType() == "do_LinearLayout"){ 28 | var _id=dojs.core.getUUID(); 29 | var _address = _parent.add(_id, "source://userControls/" + _controlName + "/src/main.ui", _option.target); 30 | var _view=d1.ui(_address); 31 | _view.fire("usreControlInit", _option); 32 | for(var k in _option){ 33 | if (typeof(_option[k]) !="function") continue; 34 | _view.on(k, _option[k]); 35 | } 36 | _view.visible=true; 37 | _view.fire("usreControlInitialized", _option); 38 | return _view; 39 | } 40 | dojs.core.error("试图userControl加入到无效的" + _parent.getType() + "父视图上,目前父视图只支持do_ALayout和do_LinearLayout"); 41 | return null; 42 | }; --------------------------------------------------------------------------------