/////////////////////////////////////
defineClass('CourseCenterpurchaseController',{
pushPayView: function() {
require('ZTKStatistics,ZTKTools,UIStoryboard,NSBundle');
ZTKStatistics.event("ZTKPurchase");
ZTKTools.hideHudWithView(self.view());
var story = UIStoryboard.storyboardWithName_bundle("OrderTableViewController", NSBundle.mainBundle());
var myView = story.instantiateViewControllerWithIdentifier("myView");
myView.setListmodel(self.VideoListmodel());
console.log(myView.Listmodel().NetClassId())
console.log(self.VideoListmodel().rid())
if (!myView.Listmodel().NetClassId()) {
myView.Listmodel().setNetClassId(self.VideoListmodel().rid());
}
self.navigationController().pushViewController_animated(myView, YES);
}
});
///////////////////////////////////////
/*https://github.com/bang590/JSPatch/issues/453
require('UIView,UIColor,UIButton,UIImageView,UIScreen');
defineClass('AddProductViewController', {
viewDidLoad: function() {
self.super().viewDidLoad();
self.creatBottomView();
},
creatBottomView: function() {
console.log("底部创建2个按钮")
不能用???
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
#define SetColor(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
*/
var aView1 = UIImageView.alloc().initWithFrame({x: 10, y: 100, width: 140, height: 25})
aView1.setBackgroundColor(UIColor.yellowColor())
self.view().addSubview(aView1)
var ScreenHeight = 480
var ScreenWidth = 320
//ScreenWidth / 2, ScreenHeight - 45, ScreenWidth / 2, 45)
var aView = UIView.alloc().initWithFrame({x: 100, y: ScreenHeight - 145, width: ScreenWidth / 2, height: 45})
aView.setBackgroundColor(UIColor.purpleColor())
self.view().addSubview(aView)
},
})
*/
//////////////////////////////////
defineClass('PostCaptchaViewController',{
loginToHome: function() {
console.log('www')
var VC = require('PostCaptchaViewController').alloc().init();
self.LogIn();
}
});
/////////////////////////////////
defineClass('ZTKHomeViewController',{
createTreeViews: function() {
require('UITableView');
var x0 = self.tableView().frame().x;
if(
require('UIDevice').currentDevice().userInterfaceIdiom() == 0
)
{
var y0 = self.testModuleView().frame().y+95+39;
}else{
var y0 = self.testModuleView().frame().y+150+39;
}
var width0 = require('UIScreen').mainScreen().bounds().width;
var height0 =self.tableView().contentSize().height;
self.tableView().setFrame({x:x0, y:y0, width:width0, height:height0})
self.backScrollView().addSubview(self.tableView());
var width1=require('UIScreen').mainScreen().bounds().width;
var height1=self.tableView().contentSize().height+y0+39;
self.backScrollView().setContentSize({width: width1, height:height1});
}
});
/////////////////////////////////////////
/*
https://github.com/bang590/JSPatch/wiki/JSPatch-%E5%9F%BA%E7%A1%80%E7%94%A8%E6%B3%95
http://bang590.github.io/JSPatchConvertor/
*/
defineClass('MainNavgationController', {
viewDidLoad: function() {
self.super().viewDidLoad();
self.alerttt();
}
});
defineClass('MainNavgationController', {
alerttt: function() {
var alert = require('UIAlertView').alloc().initWithTitle_message_delegate_cancelButtonTitle_otherButtonTitles("我是JS", "你是谁", self, "OKOKOK", null, null);
alert.show();
}
});
defineClass('VideoViewWithTaped', {
makeVideoItem: function() {
var alert = require('UIAlertView').alloc().initWithTitle_message_delegate_cancelButtonTitle_otherButtonTitles("VideoViewWithTaped", "makeVideoItem", self, "OK", null, null);
alert.show();
require('VodManage,VodDownLoader,NS_Keys');
downitems = null;
downitems = VodManage.shareManage().findDownItem(self.recordLessonModel().JoinCode());
if (downitems) {
isPlayOffLine = YES;
self.playVodpLayer();
} else {
isPlayOffLine = NO;
self.setVodDownLoader(require('VodDownLoader').alloc().init());
self.vodDownLoader().setDelegate(self);
if (self.recordLessonModel().JoinPassword() == null) {
self.recordLessonModel().setJoinPassword("");
}
var username = NS_Keys.Instance().username();
self.vodDownLoader().addItem_number_loginName_vodPassword_loginPassword_vodid_downFlag_serType_oldVersion_kToken(self.recordLessonModel().domainName(), "", username, self.recordLessonModel().JoinPassword(), self.recordLessonModel().JoinPassword(), self.recordLessonModel().JoinCode(), 0, "webcast", YES, null);
}
}
});
//////////////////////////////////////////
require('ZTKStatistics,ZTKTools,UIStoryboard,NSBundle');
pushPayView: function() {
ZTKStatistics.event("ZTKPurchase");
ZTKTools.hideHudWithView(self.view());
var story = UIStoryboard.storyboardWithName_bundle("OrderTableViewController", NSBundle.mainBundle());
var myView = story.instantiateViewControllerWithIdentifier("myView");
myView.setListmodel(self.VideoListmodel());
if (myView.Listmodel().NetClassId() == null) {
myView.Listmodel().setNetClassId(self.VideoListmodel().rid());
}
self.navigationController().pushViewController_animated(myView, YES);
}
defineClass('VideoViewWithTaped', {
makeVideoItem: function() {
require('VodManage,VodDownLoader,NS_Keys');
downitems = null;
downitems = VodManage.shareManage().findDownItem(self.recordLessonModel().JoinCode());
if (downitems) {
isPlayOffLine = YES;
self.playVodpLayer();
} else {
isPlayOffLine = NO;
self.setVodDownLoader(require('VodDownLoader').alloc().init());
self.vodDownLoader().setDelegate(self);
if (self.recordLessonModel().JoinPassword() == null) {
self.recordLessonModel().setJoinPassword("");
}
var username = NS_Keys.Instance().username();
self.vodDownLoader().addItem_number_loginName_vodPassword_loginPassword_vodid_downFlag_serType_oldVersion_kToken(self.recordLessonModel().domainName(), "", username, self.recordLessonModel().JoinPassword(), self.recordLessonModel().JoinPassword(), self.recordLessonModel().JoinCode(), 0, "webcast", YES, null);
}
}
});
defineClass('RegisterViewController', {
actionLeft: function() {
if (require('LoginViewController').class()) {
self.navigationController().popViewControllerAnimated(YES);
}
}
});
defineClass('IntroductionViewController', {
cellContentDataSource: function() {
detailsmodel = self.detailsmodel();
self.setListArr(require('NSArray').arrayWithObjects(
self.spliceContent_with("科目", detailsmodel.SubjectName()),
self.spliceContent_with("主题", detailsmodel.title()),
self.spliceContent_with("讲师", detailsmodel.TeacherDesc()),
self.spliceContent_with("课时", detailsmodel.TimeLength()),
null));
self.baseViewTableView().reloadInputViews();
self.baseViewTableView().reloadData();
self.createWebView();
}
});
defineClass('IntroductionViewController', {
createWebView: function() {
var temp = self.detailsmodel().NetClassId();
if(temp){
require('UIWebView,NSURL,NSString,NSURLRequest');
var webView =require('UIWebView').alloc().init();
webView = self.webView();
self.setWebView(require('UIWebView').alloc().initWithFrame({x:0, y:10, width:320, height:720}))
self.webView().setDelegate(self);
self.webView().setScalesPageToFit(NO);
self.webView().setMultipleTouchEnabled(YES);
self.webView().scrollView().setScrollEnabled(NO);
self.webView().scrollView().setBounces(NO);
var str = self.detailsmodel().NetClassId();
model = str.toJS()
console.log(str);
console.log(model);
var webUrl = 'http://v.huatu.com/h5/detail_zhuanti_contents.php?rid='
var url = webUrl + model
var strurl = webUrl + str
console.log(webUrl);
console.log(url);
require('NSURLRequest');
var urllll111 = url
var urllll222 = require('NSURL').URLWithString(require('NSString').stringWithFormat(urllll111));
self.webView().loadRequest(NSURLRequest.requestWithURL(urllll222));
require('UIDevice');
var version = UIDevice.currentDevice().systemVersion().floatValue();
if(version>9.2)
{
self.webView().valueForKeyPath("documentView.webView.mainFrame.javaScriptContext")
}
}
}
});
defineClass("VideoListViewController", ['totalCount'], {
init: function() {
self = self.super().init()
self.setTotalCount(0)
return self
},
viewWillAppear: function(animated) {
require('LogInfoBase');
self.super().viewWillAppear(animated);
var totalCount = self.totalCount()
if (totalCount == 0) {
self.ALiveLessonList().PullDownRefresh();
self.setTotalCount(1);
}
LogInfoBase.Instance().beginEvent("Course_Center");
LogInfoBase.Instance().beginLogPageView("VideoListViewController");
var totalCount = self.totalCount()
console.log(totalCount);
},
})
x:self.tableView().frame().x, y:CGRectGetMaxY(_testModuleView.frame().y)+ 39, width:self.tableView().width(), height:self.tableView().contentSize().height())
CGSizeMake(self.backScrollView.width(), self.tableView().contentSize().height() + CGRectGetMaxY(self.testModuleView.frame()) + 39)