Skip to content

Commit

Permalink
update remote url
Browse files Browse the repository at this point in the history
  • Loading branch information
tower1229 committed Nov 19, 2018
1 parent 1d700bf commit bf5fb97
Show file tree
Hide file tree
Showing 14 changed files with 81 additions and 75 deletions.
8 changes: 4 additions & 4 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
* rebuild
* 2017-07-12
*/
var proEnv = true;
var isDev = true;
window.appcfg = {
host: {
control: proEnv ? "" : "http://app.xxx.com",
source: proEnv ? "" : "http://source.xxx.com",
upload: proEnv ? "" : "http://app.xxx.com/upload/"
control: isDev ? "http://rap2api.taobao.org/app/mock/3567" : "",
source: isDev ? "http://source.xxx.com" : "",
upload: isDev ? "http://app.xxx.com/upload/" : ""
},
set: {
version: "",
Expand Down
4 changes: 2 additions & 2 deletions view/demo/event-pub/temp.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<div class="btn" id="goBack">
<i class="ion">&#xe651;</i>
</div>
<div class="title">全局事件</div>
<div class="title">发布全局事件</div>
</div>
<div class="flex-1 flex-col scroll_cont">
<div class="list">
<div class="item">
<button class="btn btn-success" id="sendEvent">发布全局事件</button>
<button class="btn btn-success" id="sendEvent">发布</button>
</div>

</div>
Expand Down
21 changes: 11 additions & 10 deletions view/demo/event-sub/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ define(function(require) {
require('sdk/common');
var $ = app.util;

$('#onSub').tap(function(){
app.subscribe('test-event', function(msg){
app.alert(msg);
});
app.toast('已开启监听');
});
$('#offSub').tap(function(){
app.off('test-event');
app.toast('已移除监听');
});
$('#toggle')[0].addEventListener('change', function(e) {
if (e.target.checked) {
app.subscribe('test-event', function(msg) {
app.alert(msg);
});
app.toast('已开启监听');
} else {
app.off('test-event');
app.toast('已移除监听');
}
})

});
15 changes: 10 additions & 5 deletions view/demo/event-sub/temp.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@
</div>
<div class="flex-1 flex-col scroll_cont">
<div class="list">
<div class="item item-toggle">
注册/移除监听
<label class="toggle toggle-primary">
<input type="checkbox" id="toggle">
<div class="track">
<div class="handle"></div>
</div>
</label>
</div>
<div class="item">
<button class="btn btn-success" id="onSub">开启监听</button>
<button class="btn btn-primary" id="offSub">关闭监听</button>
</div>
<div class="item">
<button class="btn btn-success" active="null,demo,event-pub">打开测试页面</button>
<button class="btn btn-success" active="null,demo,event-pub">打开事件发布页面</button>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion view/demo/index/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<div class="item" active="1,demo,list2detail">
list2detail (列表跳详细极致优化)
</div>
<div class="item" active="1,demo,scoll-list">
<div class="item" active="1,demo,scroll-list">
scoll-list (下拉刷新+滚动加载)
</div>
<div class="item" active="1,demo,ota">
Expand Down
2 changes: 1 addition & 1 deletion view/demo/paper/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define(function(require) {
var getData = function() {
app.loading.show('正在加载问卷');
app.ajax({
url: 'http://rapapi.org/mockjsdata/1201/member/getPaper',
url: appcfg.host.control + '/getPaper',
data: {
paper_id: '1',
member_id: '0000'
Expand Down
5 changes: 3 additions & 2 deletions view/demo/render-data/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ define(function(require) {
app.loading.hide();
}
});

var getData = function() {
app.loading.show();

app.ajax({
url: 'http://rapapi.org/mockjsdata/1201/other/render-data-mock/',
url: appcfg.host.control + '/render-data-mock',
type: 'get',
data: {},
success: function(res) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ define(function(require) {
var scrollLoadHandle;

var pageLoadObj = pageLoad({
url: 'http://rapapi.org/mockjsdata/1201/page-data-mock/',
url: appcfg.host.control + '/page-data-mock',
data: {},
success: function(res) {
if(res.status==='Y'){
Expand Down
File renamed without changes.
File renamed without changes.
45 changes: 20 additions & 25 deletions view/demo/scrollload/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,26 @@
<link href="../../../sdk/ui.css" rel="stylesheet">
</head>

<body class="flex-col scroll_cont list">
<div class="item">item1</div>
<div class="item">item2</div>
<div class="item">item3</div>
<div class="item">item4</div>
<div class="item">item5</div>
<div class="item">item6</div>
<div class="item">item7</div>
<div class="item">item8</div>
<div class="item">item9</div>
<div class="item">item10</div>
<div class="item">item11</div>
<div class="item">item12</div>
<div class="item">item1</div>
<div class="item">item2</div>
<div class="item">item3</div>
<div class="item">item4</div>
<div class="item">item5</div>
<div class="item">item6</div>
<div class="item">item7</div>
<div class="item">item8</div>
<div class="item">item9</div>
<div class="item">item10</div>
<div class="item">item11</div>
<div class="item">item12</div>
<body class="flex-col scroll_cont">
<div id="view">
<textarea class="hide" template>
<!--for: ${data} as ${el}-->
<div class="card">
<div class="card-head">
<div class="card-title">
${el.name}
<div class="item-note">
${el.number}
</div>
</div>
</div>
<div class="item item-body">
This is a basic Card which contains an item that has wrapping text.
</div>
</div>
<!--/for-->
</textarea>
</div>
</body>
<script src="../../../sdk/loader.js" data-script="content"> </script>

Expand Down
50 changes: 27 additions & 23 deletions view/demo/scrollload/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,46 @@
define(function(require) {
require('sdk/common');
var $ = app.util;


var render = require('render');
var myRender = render({
el: '#view',
reload: false,
callback: function(){
app.loading.hide();
}
});

var pageLoad = require('paging-load');
var scrollLoadHandle;

var pageLoadObj = pageLoad({
url: 'http://rapapi.org/mockjsdata/1201/other/render-data-mock/',
url: appcfg.host.control + '/page-data-mock',
data: {},
success: function(res) {
//此处简化数据渲染操作
var pFragment = document.createDocumentFragment();
for (var i = 0; i < 5; i++) {
var p = document.createElement("div");
p.className = 'item';
var oTxt = document.createTextNode("add" + i);
p.appendChild(oTxt);
pFragment.appendChild(p);
if(res.status==='Y'){
myRender.data(res);
}
$('body')[0].appendChild(pFragment);
},
nomore: function() {
//返回数据需要有count字段,否则永远不会触发nomore回调
app.toast('没有更多了');
scrollLoadHandle && scrollLoadHandle.destroy();
scrollLoadHandle && (scrollLoadHandle = scrollLoadHandle.destroy());
}
});

app.ready(function() {
require.async('scroll-load', function(scrollLoad) {
scrollLoadHandle = scrollLoad({
el: $('body')[0],
callback: function(stopFn) {
pageLoadObj.load(stopFn);
}
//滚动加载
var scrollLoad = require('scroll-load');
scrollLoadHandle = scrollLoad({
el: $('body')[0],
callback: function(stopFn) {
myRender.set({
reload: false
});
});


pageLoadObj.load(stopFn);
}
});
});

//初始加载
pageLoadObj.load();
});
2 changes: 1 addition & 1 deletion view/demo/tabList/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ define(function(require) {
pageLoadObj && pageLoadObj.destroy();
$('body')[0].scrollTop = 0;
pageLoadObj = pageLoad({
url: 'http://rapapi.org/mockjsdata/1201/page-data-mock/',
url: appcfg.host.control + '/page-data-mock',
data: {
status: status
},
Expand Down

0 comments on commit bf5fb97

Please sign in to comment.