03357ae2-014b-4fbc-9e33-732660b4a4e7.js
3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
"use strict";
cc._RF.push(module, '03357riAUtPvJ4zcyZgtKTn', 'ListView1');
// script/game/ui/list/ListView1.ts
// import ViewBase from "../../../common/classbase/ViewBase";
// import { UIManager } from "../../../common/gameplay/managers/UIManager";
// const { ccclass, property } = cc._decorator;
// export abstract class BaseCcComponent extends ViewBase implements BasePrefabNode {
// getNode = () => super.node
// registerEvent(action: "onOpen" | "onClose" | "onShow" | "onHide", handler: (target?: any) => void) {
// throw new Error("Method not implemented.");
// }
// abstract load()
// }
// export interface BasePrefabNode {
// onLoad()
// onOpen(param?: any)
// onClose()
// onShow()
// onHide()
// load()
// getNode: () => cc.Node
// registerEvent(action: "onOpen" | "onClose" | "onShow" | "onHide", handler: (target?: any) => void): void
// }
// //////////////////////////////////////////
// export interface ListPrefabNode extends BasePrefabNode {
// addItem(item: ListItem)
// }
// /**
// * 一个List里有什么?
// * * title
// */
// export class ListCcComponent extends BaseCcComponent implements ListPrefabNode {
// static prefabPath = "prefab/ui/list/ListView";
// @property({ type: cc.Layout })
// private contentLayout?: cc.Layout = undefined;
// private _loading = false;
// load(){
// let a: any = "jjk"
// let b: string = a as string
// }
// addItem(item: ListItem){
// }
// onOpen(sceneId: number) {
// super.onOpen();
// this._loading = true;
// // this.disposable.add(this._viewModel.LoadPlotList.on(this.loadChatBubbleList));
// }
// // loadChatBubbleList = async (plots: ((ReadonlyPlot & { selection?: number }) | "history")[]) => {
// // this.scrollView!.scrollToBottom();
// // this._loading = false;
// // }
// close() {
// UIManager.popView();
// }
// }
// /**
// * ListItem <| --- ChatBubble, MessageEntry
// * * 展示第一页: function initLoad(..)
// * * 获取下一页并展示: function loadMore(..)
// * * 操作某一个item(点击,拖放,点击特定区域): actions
// * * initLoading: bool
// * * loading: bool
// * * data: []
// * * items: ListItem[]
// * * itemType: string
// */
// export default class List {
// constructor(
// data: any[],
// itemType: string,
// prefab: ListPrefabNode,
// initLoading = true,
// loading = false,
// ) {
// this._data = data;
// this._itemType = itemType;
// this._initLoading = initLoading;
// this._loading = loading;
// this._prefab = prefab
// this.refresh()
// }
// private _loading: boolean;
// private _initLoading: boolean;
// private _itemType: string;
// private _data: any[];
// private _prefab: ListPrefabNode;
// refresh() {
// this._prefab.load()
// }
// onOpen(sceneId: number) {
// this._loading = true;
// // this.disposable.add(this._viewModel.LoadPlotList.on(this.loadChatBubbleList));
// }
// // loadChatBubbleList = async (plots: ((ReadonlyPlot & { selection?: number }) | "history")[]) => {
// // this.scrollView!.scrollToBottom();
// // this._loading = false;
// // }
// close() {
// UIManager.popView();
// }
// }
// export class ListItem {
// }
// class TestScript {
// test1() {
// //假设这里是某个入口点击后的command function(in xxxmanager)
// //先去取数据
// let data = [
// ]
// //取到数据后,创建view并灌入初始数据列表
// //创建ListCcComponent
// UIManager.pushView(ListCcComponent)
// .then((component) => {
// //新建List,绑定ListCcComponent,并初始化
// new List(data, "itemType", component)
// })
// }
// }
cc._RF.pop();