|
@@ -30,21 +30,6 @@ cc.Class({
|
|
|
let item = cc.instantiate(this.jobItem);
|
|
|
item.active = true;
|
|
|
item.position = new cc.p(0, 0);
|
|
|
- item.getComponent('JobItem').bind(this.jobList[i]);
|
|
|
- this.pageview.addPage(item);
|
|
|
- }
|
|
|
- ///动态添加item的时候必须加这两行代码,刷新PageView的各种数值参数,让界面正常显示
|
|
|
- this.pageview.sizeMode = cc.PageView.SizeMode.Free;
|
|
|
- this.pageview._updatePageView();
|
|
|
- },
|
|
|
-
|
|
|
- bindJobList(jobList) {
|
|
|
- this.pageview.removeAllPages();
|
|
|
- this.jobList = jobList;
|
|
|
- for (var i = 0; i < this.jobList.length; i++) {
|
|
|
- let item = cc.instantiate(this.jobItem);
|
|
|
- item.active = true;
|
|
|
- item.position = new cc.p(0, 0);
|
|
|
item.getComponent('JobItem').bind(this.jobList[i], this.gender);
|
|
|
this.pageview.addPage(item);
|
|
|
}
|
|
@@ -53,6 +38,21 @@ cc.Class({
|
|
|
this.pageview._updatePageView();
|
|
|
},
|
|
|
|
|
|
+ // bindJobList(jobList) {
|
|
|
+ // this.pageview.removeAllPages();
|
|
|
+ // this.jobList = jobList;
|
|
|
+ // for (var i = 0; i < this.jobList.length; i++) {
|
|
|
+ // let item = cc.instantiate(this.jobItem);
|
|
|
+ // item.active = true;
|
|
|
+ // item.position = new cc.p(0, 0);
|
|
|
+ // item.getComponent('JobItem').bind(this.jobList[i], this.gender);
|
|
|
+ // this.pageview.addPage(item);
|
|
|
+ // }
|
|
|
+ // ///动态添加item的时候必须加这两行代码,刷新PageView的各种数值参数,让界面正常显示
|
|
|
+ // this.pageview.sizeMode = cc.PageView.SizeMode.Free;
|
|
|
+ // this.pageview._updatePageView();
|
|
|
+ // },
|
|
|
+
|
|
|
bindSelectedJobText() {
|
|
|
let jobInfo = this.jobList[this.pageview.getCurrentPageIndex()];
|
|
|
this.artistIconSprite.spriteFrame = this.jobIconFrames[jobInfo.id - 1];
|