Skip to content

Commit

Permalink
Merge pull request #348 from wanbing/dev_wanbing
Browse files Browse the repository at this point in the history
fair-online update
  • Loading branch information
wanbing authored Sep 20, 2023
2 parents cbf2393 + f8223ef commit b238588
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,121 @@
GLOBAL['#FairKey#']=(function(__initProps__){const __global__=this;defineModule(1,function(__mod__){with(__mod__.imports){}},[]);return runCallback(function(__mod__){with(__mod__.imports){function HotelModel(){const inner=HotelModel.__inner__;if(this==__global__){return new HotelModel({__args__:arguments});}else{const args=arguments.length>0?arguments[0].__args__||arguments:[];inner.apply(this,args);HotelModel.prototype.ctor.apply(this,args);return this;}}HotelModel.__inner__=function inner(){this.imagePath='';this.titleTxt='';this.subTxt='';this.dist='';this.reviews='';this.perNight='';};HotelModel.prototype={};HotelModel.prototype.ctor=function(){};function _HotelListViewState(){const inner=_HotelListViewState.__inner__;if(this==__global__){return new _HotelListViewState({__args__:arguments});}else{const args=arguments.length>0?arguments[0].__args__||arguments:[];inner.apply(this,args);_HotelListViewState.prototype.ctor.apply(this,args);return this;}}_HotelListViewState.__inner__=function inner(){this._listData=[];this._page=0;};_HotelListViewState.prototype={initState:function initState(){const __thiz__=this;with(__thiz__){onLoad();}},onLoad:function onLoad(){const __thiz__=this;with(__thiz__){requestData();}},onUnload:function onUnload(){const __thiz__=this;with(__thiz__){}},requestData:function requestData(){const __thiz__=this;with(__thiz__){_page++;FairNet().requestData(convertObjectLiteralToSetOrMap({['pageName']:'#FairKey#',['method']:'GET',['url']:'https://wos2.58cdn.com.cn/DeFazYxWvDti/frsupload/3be6c61070d3b48c8165af5d18464c0e_hotel_list_data.json',['data']:convertObjectLiteralToSetOrMap({['page']:_page,}),['success']:function dummy(resp){if(resp==null){return null;}let data=resp.__op_idx__('data');data.forEach(function dummy(item){let dataItem=HotelModel();try{dataItem.imagePath=item.imagePath;dataItem.titleTxt=item.titleTxt;dataItem.subTxt=item.subTxt;dataItem.dist=item.dist+' km';dataItem.reviews=item.reviews+' reviews';dataItem.perNight=item.perNight+'';}catch(e){dataItem.imagePath=item.__op_idx__('imagePath');dataItem.titleTxt=item.__op_idx__('titleTxt');dataItem.subTxt=item.__op_idx__('subTxt');dataItem.dist=`${item['dist']} km`;dataItem.reviews=`${item['reviews']} reviews`;dataItem.perNight=`${item['perNight']}`;}_listData.add(dataItem);});setState('#FairKey#',function dummy(){});},}));}},isDataEmpty:function isDataEmpty(){const __thiz__=this;with(__thiz__){return _listData.isEmpty;}},};_HotelListViewState.prototype.ctor=function(){};;return _HotelListViewState();}},[1]);})(convertObjectLiteralToSetOrMap(JSON.parse('#FairProps#')));
GLOBAL['#FairKey#'] = (function(__initProps__) {
const __global__ = this;
return runCallback(function(__mod__) {
with(__mod__.imports) {
function HotelModel() {
const inner = HotelModel.__inner__;
if (this == __global__) {
return new HotelModel({
__args__: arguments
});
} else {
const args = arguments.length > 0 ? arguments[0].__args__ || arguments: [];
inner.apply(this, args);
HotelModel.prototype.ctor.apply(this, args);
return this;
}
}
HotelModel.__inner__ = function inner() {
this.imagePath = '';
this.titleTxt = '';
this.subTxt = '';
this.dist = '';
this.reviews = '';
this.perNight = '';
};
HotelModel.prototype = {};
HotelModel.prototype.ctor = function() {};
function _HotelListViewState() {
const inner = _HotelListViewState.__inner__;
if (this == __global__) {
return new _HotelListViewState({
__args__: arguments
});
} else {
const args = arguments.length > 0 ? arguments[0].__args__ || arguments: [];
inner.apply(this, args);
_HotelListViewState.prototype.ctor.apply(this, args);
return this;
}
}
_HotelListViewState.__inner__ = function inner() {
this._listData = [];
this._page = 0;
};
_HotelListViewState.prototype = {
initState: function initState() {
const __thiz__ = this;
with(__thiz__) {
onLoad();
}
},
onLoad: function onLoad() {
const __thiz__ = this;
with(__thiz__) {
requestData();
}
},
onUnload: function onUnload() {
const __thiz__ = this;
with(__thiz__) {}
},
requestData: function requestData() {
const __thiz__ = this;
with(__thiz__) {
_page++;
FairNet().requestData(convertObjectLiteralToSetOrMap({ ['pageName'] : '#FairKey#',
['method'] : 'GET',
['url'] : 'https://wos2.58cdn.com.cn/DeFazYxWvDti/frsupload/3be6c61070d3b48c8165af5d18464c0e_hotel_list_data.json',
['data'] : convertObjectLiteralToSetOrMap({ ['page'] : _page,
}),
['success'] : function dummy(resp) {
if (resp == null) {
return null;
}
let data = resp.__op_idx__('data');
data.forEach(function dummy(item) {
let dataItem = HotelModel();
try {
dataItem.imagePath = item.imagePath;
dataItem.titleTxt = item.titleTxt;
dataItem.subTxt = item.subTxt;
dataItem.dist = item.dist + ' km';
dataItem.reviews = item.reviews + ' reviews';
dataItem.perNight = item.perNight + '';
} catch(e) {
dataItem.imagePath = item.__op_idx__('imagePath');
dataItem.titleTxt = item.__op_idx__('titleTxt');
dataItem.subTxt = item.__op_idx__('subTxt');
dataItem.dist = `$ {
item['dist']
}
km`;
dataItem.reviews = `$ {
item['reviews']
}
reviews`;
dataItem.perNight = `$ {
item['perNight']
}`;
}
_listData.add(dataItem);
});
setState('#FairKey#',
function dummy() {});
},
}));
}
},
isDataEmpty: function isDataEmpty() {
const __thiz__ = this;
with(__thiz__) {
return _listData.isEmpty;
}
},
};
_HotelListViewState.prototype.ctor = function() {};;
return _HotelListViewState();
}
},
[]);
})(convertObjectLiteralToSetOrMap(JSON.parse('#FairProps#')));
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ let callBackId = 0;

let FairNet = function () {
return {
request: function (resp) {
requestData: function (resp) {
let respMap = {};
respMap = mapOrSetToObject(resp);
let id = 'FairNet$' + (++callBackId);
let requestParameter = {};
requestParameter['className'] = "FairNet#request";
requestParameter['className'] = "FairNet#requestData";
callBack[id] = [respMap['complete'], respMap['error'], respMap['success']];
respMap['callId'] = id;
requestParameter['funcName'] = 'invokePlugin';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ let callBackId = 0;

let FairNet = function () {
return {
request: function (resp) {
requestData: function (resp) {
let respMap = {};
respMap = mapOrSetToObject(resp);
let id = 'FairNet$' + (++callBackId);
let requestParameter = {};
requestParameter['className'] = "FairNet#request";
requestParameter['className'] = "FairNet#requestData";
callBack[id] = [respMap['complete'], respMap['error'], respMap['success']];
respMap['callId'] = id;
requestParameter['funcName'] = 'invokePlugin';
Expand Down

0 comments on commit b238588

Please sign in to comment.