Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fair-online update #348

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading