Commit 8a837778 authored by wildfirecode's avatar wildfirecode

1

parent ad3a038e
import { IModuleData } from "../interface/IModuleData";
import { IDestroy } from "../interface/IDestroy";
/**
*Created by cuiliqiang on 2018/3/1
* 组件基类
*/
export abstract class ABModule implements IDestroy {
/**
* 模块数据
*/
private _data: IModuleData;
/**
* 视图层
*/
private _view: any;
constructor(data: IModuleData) {
this._data = data;
let viewClass: any;
if (typeof this.data.viewClass === 'string') {
viewClass = eval(this.data.viewClass);
} else {
viewClass = this.data.viewClass;
}
this._view = new viewClass();
}
/**
* 初始化模型
*/
protected abstract initModel(): void
/**
* 初始化UI
*/
protected abstract initUI(): void
/**
* 显示
*/
protected abstract show(): void
/**
* 隐藏
*/
protected abstract hide(): void
/**
* 添加事件
*/
protected abstract addEvent(): void
/**
* 移除事件
*/
protected abstract removeEvent(): void
/**
* 更新页面
* @param args
*/
public abstract updateData(...args): void
/**
* 播放进场动画
* @param callback 回调函数
*/
public abstract playShowAnimation(callback?: Function): void
/**
* 播放退场动画
* @param callback 回调函数
*/
public abstract playHideAnimation(callback?: Function): void
/**
* 销毁
*/
public abstract dispose(): void
/**
* 模块数据
* @returns {IModuleData}
*/
public get data(): IModuleData {
return this._data;
}
/**
* 视图
* @returns {any}
*/
protected get view(): any {
return this._view;
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/13
* 布局枚举
*/
export enum LayoutType {
TOP = 0,
BOTTOM,
LEFT,
RIGHT,
HORIZONTAL,
VERTICAL
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/16
* 模块类型
*/
export enum ModuleType {
SCENE = 0,
PANEL,
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/15
* 资源加载优先级
*/
export enum ResPriority {
PRE = 0,
NOMARL,
DELAY
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/26
* 时间格式
*/
export enum TimeFormat {
HMS = 'hms',
DHMS = 'dhms'
}
\ No newline at end of file
// import { GLang } from './util/GLang';
// import { INetData } from './interface/INetData';
// import { GTime } from './util/GTime';
// import { GPool } from './util/GPool';
// import { GMath } from './util/GMath';
// import { GFun,getImgURL } from './util/GFun';
// import { GDispatcher } from './util/GDispatcher';
// import { GConsole } from './util/GConsole';
// import { GCache } from './util/GCache';
// import { ABPanelManager } from './manager/ABPanelManager';
// import { IModuleData } from './interface/IModuleData';
// import { IDestroy } from './interface/IDestroy';
// import { TimeFormat } from './enum/TimeFormat';
// import { ResPriority } from './enum/ResPriority';
// import { ModuleType } from './enum/ModuleType';
// import { LayoutType } from './enum/LayoutType';
// import { ABModule } from "./component/ABModule";
// import { IData } from './interface/IData';
// import { ABAnimationManager } from './manager/ABAnimationManager';
// import { ABAudioManager } from './manager/ABAudioManager';
// import { ABResManager } from './manager/ABResManager';
// import { ABSceneManager } from './manager/ABSceneManager';
// import { ABStageManager } from './manager/ABStageManager';
// import { ABDataManager } from './manager/ABDataManager';
// import { ABModuleManager } from './manager/ABModuleManager';
// import { ABNetManager } from './manager/ABNetManager';
// import { ABVideoManager } from './manager/ABVideoManager';
// export {
// ABModule, LayoutType, ModuleType, ResPriority, TimeFormat, IData, IDestroy, INetData,
// IModuleData, ABAnimationManager, ABAudioManager, ABDataManager, ABModuleManager, ABNetManager,
// ABPanelManager, ABResManager, ABSceneManager, ABStageManager, ABVideoManager, GCache, GConsole,
// GDispatcher, GFun, GMath, GPool, GTime, GLang,getImgURL
// }
export const a =1
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/8
*/
export interface IData {
update(data: any): void
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/2/28
* 销毁
*/
export interface IDestroy {
dispose(): void;
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/13
* 模块数据
*/
import { ResPriority } from "../enum/ResPriority";
import { ModuleType } from "../enum/ModuleType";
export interface IModuleData {
/**
* 模块名字
*/
moduleName: string;
/**
* 模块类
*/
moduleClass: any;
/**
* 视图类
*/
viewClass: any;
/**
* 资源
*/
res: string;
/**
* 资源加载优先级
*/
resPriority: ResPriority;
/**
* 类型 1 场景, 2面板
*/
type: ModuleType;
/**
* 显示层级
*/
layerIndex: number;
/**
* 显示遮罩背景
*/
showBg: boolean;
/**
* 是否可以事件穿透
*/
eventPenetrate: boolean;
/**
* 进场动画
*/
showAnimation?: Function;
/**
* 退场动画
*/
hideAnimation?: Function;
/**
* UI配置
*/
uiCfg?: any;
}
\ No newline at end of file
export interface INetData {
//名字
name: any;
//地址
uri: string;
//接口类型 get、post等
type: string;
//返回数据类型
dataType: string;
//参数
param: any;
//回调
callback: Function;
//轮询次数
pollingCount?: number;
//轮询条件检查
pollingCheck?: Function;
//url拼接内容
addUrl?: string;
//是否显示错误提示
hideMsg?: boolean;
}
\ No newline at end of file
/**
* 动画管理器
*/
export abstract class ABAnimationManager {
/**
* 播放动画
* @param animations 动画数组
*/
public abstract play(animations: any[]): void
}
\ No newline at end of file
export abstract class ABAudioManager {
constructor() {
}
/**
* 创建声音实例
* @param {string} name 标识
* @param {string} src 音频地址
*/
public abstract createSound(name: string, src: string): void
/**
* 获取当前声音实例
* @param {string} name 标识
* @returns {any}
* @constructor
*/
public abstract getSound(name: string): any
/**
* 播放声音
* @param {string} name 标识
* @param {number} start 开始点 默认为0
* @param {number} loop 循环次数 默认为1
*/
public abstract play(name: string, start?: number, loop?: number): void
/**
* 暂停播放,或者恢复播放
* @param {string} name 标识
* @param {boolean} isPause 默认为true;是否要暂停,如果要暂停,则暂停;否则则播放
*/
public abstract pause(name: string, isPause?: boolean): void
/**
* 停止声音播放
* @param {string} name 标识
* @param {.Sound} sound 声音实例
*/
public abstract stop(name: string): void
/**
* 设置音量
* @param {string} name 标识
* @param {number} volume 音量大小,从0-1 在ios里 volume只能是0 或者1,其他无效
*/
public abstract setVolume(name: string, volume: number): void
/**
* 设置所有音频音量
* @param volume
*/
public abstract setAllVolume(volume: number): void
/**
* 暂停状态
* @param name
*/
public abstract getPause(name: string): boolean
/**
* 从静态声音池中删除声音对象,如果一个声音再也不用了,建议先执行这个方法,再销毁
* @param {string} name 声音实例
*/
public abstract destory(name: string): void
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/8
* 数据管理
*/
export abstract class ABDataManager {
/**
* 更新数据
* @param {number} name 接口名字
* @param result 接口返回数据
* @returns {any}
*/
public abstract updateData(name: number, result: any): any
}
\ No newline at end of file
import { IModuleData } from './../interface/IModuleData';
/**
* 模块管理器
*/
export abstract class ABModuleManager {
/**
* 初始化
* @param {ModuleData} modules
*/
public abstract init(modules: IModuleData[]): void
/**
* 按模块名获取模块数据
* @param {string} moduleName 模块名
* @returns {ModuleData}
*/
public abstract getModule(moduleName: string): IModuleData
/**
* 打开一个模块
* @param {string} moduleName 模块名
* @param args 携带参数
*/
public abstract openModule(moduleName: string, ...args): void
/**
* 访问模块内的公用方法
* @param {string} moduleName 模块名
* @param {string} funcName 方法名
*/
public abstract callModuleFunc(moduleName: string, funcName: string, ...args): void
}
\ No newline at end of file
import { INetData } from './../interface/INetData';
import { GTime } from "../util/GTime";
import { GConsole } from "../util/GConsole";
import { IData } from '../interface/IData';
export abstract class ABNetManager {
/**
* 接口底层错误
*/
public static ERROR = 'Error';
/**
* 调用接口对象池
*/
private callbackPool: any = {};
constructor() {
}
/**
* 发送请求
* @param net
*/
public send(net: INetData): void {
let gTime: string = '?_=' + GTime.getTimestamp();
let realUrl: string = net.uri;
if (realUrl.indexOf('?') != -1) {
gTime = '&_=' + GTime.getTimestamp();
}
//url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点)
if (net.addUrl) {
realUrl += net.addUrl;
}
$.ajax({
type: net.type,
// url: realUrl + gTime,
url: realUrl,
dataType: net.dataType,
data: net.param,
async: true,
success: (result) => {
this.onResponse(net, result);
},
error: (message) => {
this.onError(net);
}
});
}
/**
* 消息响应
* @param net
*/
protected abstract onResponse(net: INetData, result: IData): void
/**
* 通讯底层错误
* @param net
* @param message
*/
protected abstract onError(net: INetData, message?: any): void
}
\ No newline at end of file
import { IModuleData } from "../interface/IModuleData";
/**
* 面板管理
*/
export abstract class ABPanelManager {
constructor() {
}
/**
* 显示面板
* @param {ModuleData} module 模块
* @param {any} data 数据
*/
public abstract show(module: IModuleData, data: any): void
/**
* 关闭面板
* @param moduleName
* @param dispose
*/
public abstract hide(moduleName: string, dispose?: boolean): void
/**
* 关闭所有面板
* @param {boolean} dispose
*/
public abstract hideAll(dispose?: boolean): void
/**
* 调用面板方法
* @param {ModuleName} moduleName
* @param {string} funcName
* @param args
*/
public abstract callFunc(moduleName: string, funcName: string, ...args): void
}
\ No newline at end of file
import { ResPriority } from './../enum/ResPriority';
import { IModuleData } from '../interface/IModuleData';
export abstract class ABResManager {
/**
* 添加资源到加载列表
* @param res
* @param priority
*/
public abstract addRes(res: any, priority: ResPriority): void
/**
* 加载资源
*/
public abstract loadRes(): void
/**
* 检测模块资源是否加载完成
* @param {ModuleData} module 模块数据
* @returns {boolean}
*/
public abstract checkRes(module: IModuleData): boolean
}
\ No newline at end of file
import { IModuleData } from "../interface/IModuleData";
/**
* 场景管理器
*/
export abstract class ABSceneManager {
constructor() {
}
/**
* 切换场景
* @param {ModuleData} module 模块数据
* @param {any} data 携带数据
*/
public abstract change(moduleData: IModuleData, data?: any): void
/**
* 调用场景方法
* @param {ModuleName} moduleName
* @param {string} funcName
* @param args 携带参数
*/
public abstract callFunc(moduleName: string, funcName: string, ...args): void
/**
* 当前场景名字
*/
public abstract get currSceneName(): string
}
\ No newline at end of file
import { LayoutType } from "../enum/LayoutType";
export abstract class ABStageManager {
/**
* 添加显示对象到指定容器
* @param {any} child 对象实例
* @param {any} container 容器实例
* @param {number} 指定层级 默认不指定层级
*/
public abstract addChild(child: any, container: any, index: number): void
/**
* 移除显示对象从父容器
* @param child 要移除的显示对象
*/
public abstract removeChild(child): void
/**
* 对齐方式
* @param display 显示对象
* @param mode 对齐方式 (left, right, top, bottom, horizontal, vertical)
* @param offset 偏移量
*/
public abstract align(display: any, layout: LayoutType, offset: number): void
}
\ No newline at end of file
export abstract class ABVideoManager {
/**
* 创建视频
* @param {string} name 名字
* @param {string} src 视频链接
* @param {number} width 视频宽,默认可以不填
* @param {number} height 视频高,默认可以不填
*/
public abstract createVideo(name: string, src: string, width?: number, height?: number): void
/**
* 获取当前最新的一个video对象
* @returns {any}
*/
public abstract getVideo(name: string): any
/**
* 开始播放媒体
* @method play
* @param {number} start 开始点 默认为0
* @param {number} loop 循环次数 默认为1
*/
public abstract play(start?: number, loop?: number): void
/**
* 暂停播放,或者恢复播放
* @method pause
* @param isPause 默认为true;是否要暂停,如果要暂停,则暂停;否则则播放
*/
public abstract pause(isPause?: boolean): void
/**
* 停止播放
*/
public abstract stop(): void
}
\ No newline at end of file
import { GFun } from './GFun';
import { GConsole } from './GConsole';
export class GCache {
private static gKey: string;
/**
* 初始化
* @param keys
*/
public static init(keys: string[]): void {
let i = 0;
const len: number = keys.length;
this.gKey = '';
for (i; i < len; i++) {
this.gKey += '_' + keys[i];
}
}
/**
* 写入缓存
* @param key
* @param value
* @param type type 缓存类型 localStorage永久缓存 sessionStorage浏览器生命周期结束前'
*/
public static writeCache(key: string, value: any, type = 'localStorage') {
if (!window[type]) {
GConsole.log(GFun.replace('webview不支持{0}', [type]));
return;
}
window[type].setItem(key + this.gKey, value);
}
/**
* 读取缓存
* @param key
* @param type type 缓存类型 localStorage永久缓存 sessionStorage浏览器生命周期结束前'
* @return
*/
public static readCache(key: string, type = 'localStorage'): string {
if (!window[type]) {
GConsole.log(GFun.replace('webview不支持{0}', [type]));
return;
}
return window[type].getItem(key + this.gKey);
}
/**
* 删除缓存
* @param key
* @param type 缓存类型 localStorage永久缓存 sessionStorage浏览器生命周期结束前
*/
public static removeCache(key: string, type = 'localStorage'): string {
if (!window[type]) {
GConsole.log(GFun.replace('webview不支持{0}', [type]));
return;
}
window[type].removeItem(key + this.gKey);
}
}
\ No newline at end of file
export class GConsole {
private static switch: boolean = window['debug'] || true;
/**
* 日志打印
* @param args
*/
public static log(...args): void {
if (!this.switch) {
return;
}
let i = 0;
const len: number = args.length;
for (i; i < len; i++) {
console.log(args[i]);
}
}
}
\ No newline at end of file
export class GDispatcher {
/**
* 事件回调池
*/
private static callbackPool: any = {};
/**
* 事件作用域池
*/
private static thisObjPool: any = {};
/**
*
* @param name 事件名
* @param callback 回调
* @param thisObj 作用域
*/
public static addEvent(name: string, callback, thisObj: any): void {
if (!this.callbackPool[name]) {
this.callbackPool[name] = [];
this.thisObjPool[name] = [];
}
const index: number = this.callbackPool[name].indexOf(callback);
if (index != -1) {
this.callbackPool[name][index] = callback;
this.thisObjPool[name][index] = thisObj;
} else {
this.callbackPool[name].push(callback);
this.thisObjPool[name].push(thisObj);
}
}
/**
*
* @param name 事件名
* @param callback 回调
* @param thisObj 作用域
*/
public static removeEvent(name: string, callback, thisObj?: any): void {
if (this.callbackPool[name]) {
const index: number = this.callbackPool[name].indexOf(callback);
if (index != -1) {
this.callbackPool[name].splice(index, 1);
this.thisObjPool[name].splice(index, 1);
}
}
}
/**
* 派发事件
* @param name 事件名
* @param args 任意参数
*/
public static dispatchEvent(name: string, ...args): void {
const callbacks: Function[] = this.callbackPool[name];
const thisObjs: any = this.thisObjPool[name];
if (callbacks) {
let i = 0;
const len: number = callbacks.length;
for (i; i < len; i++) {
callbacks[i].apply(thisObjs[i], args);
}
}
}
}
\ No newline at end of file
import { GMath } from './GMath';
import { GTime } from './GTime';
import { GConsole } from './GConsole';
export class GFun {
/**
* 加载 html Image
* @param url
* @param callback
*/
public static loadImage(url: string, callback: Function): any {
//取出跟url匹配的Image
const bitmapData: any = new Image();
bitmapData.onload = (e) => {
if (callback) {
callback(bitmapData);
}
};
bitmapData.src = url;
}
/**
* 替换字符串中元素
* @param str
* @param replaceList
*/
public static replace(str: string, replaceList: Array<string | number>) {
const len = replaceList.length;
for (let i = 0; i < len; i++) {
str = str.replace("{" + i + "}", replaceList[i].toString());
}
return str;
}
/**
* 是否在app内运行
* @param strs 匹配字符串
*/
public static checkInApp(strs: string[]): boolean {
const ua = navigator.userAgent.toLocaleLowerCase();
let i: number;
const len: number = strs.length;
for (i = 0; i < len; i++) {
if (ua.indexOf(strs[i]) != -1) {
return true;
}
}
return false;
}
/**
* 判断操作系统
* @returns {Array|{index: number, input: string}}
*/
public static get isIOS(): boolean {
return navigator.userAgent.match(/iphone|ipod|ipad/gi) != null;
}
/**
* 获取url参数
*/
public static getQueryString(name): any {
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
const r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
}
}
const check_webp_feature = (callback) => {
const _support_webp_ = localStorage.getItem('_support_webp_');
if (_support_webp_ !== null) {
return callback(_support_webp_ === '1')
}
const img = new Image();
img.onload = function () {
const result = (img.width > 0) && (img.height > 0);
callback(result);
localStorage.setItem('_support_webp_', result ? '1' : '0')
};
img.onerror = function () {
callback(false);
localStorage.setItem('_support_webp_', '0')
};
img.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA";
}
export const getImgURL = (url: string, cb) => {
check_webp_feature((isSupport) => {
if (isSupport) url += '?x-oss-process=image/format,webp';
cb(url)
})
}
\ No newline at end of file
export class GLang {
public static lang_001 = "pre资源加载完成";
public static lang_002 = "nomarl资源加载完成";
public static lang_003 = "delay资源加载完成";
}
\ No newline at end of file
export class GMath {
/**
* 向下取整
* @param n
* @returns {number}
*/
public static int(n: any): number {
return n >> 0;
}
/**
* 给数组随机排序
* @param arr
*/
public static randomArr(arr: any[]): any[] {
const len = arr.length;
for (let i = 0; i < len; i++) {
const n = this.random(0, arr.length, true);
const temp = arr[n];
arr[n] = arr[i];
arr[i] = temp;
}
return arr;
}
/**
* 范围随机数
* @param n1 范围起始
* @param n2 范围结束
* @param int 结果是否返回整数
* @return {*}
*/
public static random(n1: number, n2: number, int: boolean): number {
let n: number;
let min: number;
let max: number;
if ((typeof n1) != 'undefined' && (typeof n2) != 'undefined') {
min = Math.min(n1, n2);
max = Math.max(n1, n2);
n = Math.random() * (max - min) + min;
} else {
n = Math.random();
}
if (int) {
n = this.int(n);
}
return n;
}
}
\ No newline at end of file
/**
* 对象池
*/
export class GPool {
private static pool: any = {};
private static maxCount = {};
/**
* 根据类型设置缓存最大个数
* @param className
* @param count
*/
public static setMaxCountByType(className: any, count): void {
this.maxCount[className] = count;
}
/**
* 取出
* @param className 资源名
* @param 类名
*/
public static takeOut(className: string, classObj?: any, isCreate?: boolean): any {
if (!className || className == '') {
return;
}
let obj: any;
if (this.pool[className] && this.pool[className].length) {
obj = this.pool[className].shift();
} else if (isCreate) {
if (!classObj) {
classObj = eval(className);
}
obj = new classObj();
}
return obj;
}
/**
* 回收
* @param className 资源Class
* @param obj 资源
*/
public static recover(className: string, obj: any): void {
if (!obj || !className) {
return;
}
if (!this.pool[className]) {
this.pool[className] = [];
}
if (!this.maxCount[className]) {
this.maxCount[className] = 100;
}
if (this.pool[className].length > this.maxCount[className]) {
return;
}
this.pool[className].push(obj);
if (obj['dispose']) {
obj.dispose();
}
}
}
\ No newline at end of file
import { IData } from 'duiba-tc';
/**
*Created by cuiliqiang on 2018/3/12
* 数据基类
*/
export class Data implements IData {
private _success: boolean;
private _message: string;
private _code: number;
public update(data: any): void {
this._success = data.success == undefined ? true : data.success;
if (data.message) {
this._message = data.message;
} else if (data.desc) {
this._message = data.desc;
} else if (data.msg) {
this._message = data.msg;
}
this._code = data.code;
}
/**
* 接口状态
* @returns {boolean}
*/
public get success(): boolean {
return this._success;
}
/**
* 接口提示信息
* @returns {string}
*/
public get message(): string {
return this._message;
}
/**
* 状态码
* @returns {string}
*/
public get code(): number {
return this._code;
}
}
import { Data } from './../Data';
import { RecordData } from './record/RecordData';
export class GetRecordData extends Data {
public invalidPage: boolean;
public nextPage: boolean;
public records: RecordData[];
public update(data: any): void {
if(!data) {
return;
}
super.update(data);
this.invalidPage = data.invalidPage;
this.nextPage = data.nextPage;
this.records = data.records;
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/1
* 埋点信息
*/
export interface IExposureData {
activityId?: number;
activityUseType?: string;
advertId?: number;
appId: number;
consumerId: number;
dcm: string;
domain: string;
dpm: string;
ip?: string;
isEmbed?: boolean;
materialId?: number;
orderId?: string;
os?: string;
}
\ No newline at end of file
export interface IShareData {
/**
* 开发者名字
*/
appName: string;
/**
* 标题
*/
title: string;
/**
* 分享文案
*/
desc: string;
/**
* 分享链接
*/
link: string;
/**
* 分享图片
*/
imgUrl: string;
/**
* 分享整张图片(image_url),只支持微信、朋友圈、QQ。
*/
image_only: boolean;
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/7
* 添加游戏次数
*/
import { Data } from "../../Data";
export class AddTimesForActivityData extends Data {
/**
* 累计添加次数的总和
*/
public addedTimes: number;
/**
* 累计调用接口的次数
*/
public shareCount: number;
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.addedTimes = data.addedTimes;
this.shareCount = data.shareCount;
}
}
\ No newline at end of file
import { Data } from './../../Data';
import { ICollectRuleData } from './ICollectRuleData';
/**
*Created by cuiliqiang on 2018/3/7
* 集卡数据
*/
export class GetCollectRuleData extends Data {
/**
* 集卡规则列表
*/
public collectRules: ICollectRuleData[];
/**
* 奖品等级(几等奖)
*/
public prizeLevel: number;
/**
* 是否可以开奖
*/
public clickFlag: boolean;
/**
*
*/
public exchange: boolean;
/**
* 所有卡片数量
*/
public allCount: number;
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.prizeLevel = data.prizeLeve;
this.clickFlag = data.clickFlag;
this.exchange = data.exchange;
this.collectRules = data.collectRule;
if (data.collectGoods) {
const len = data.collectGoods.length;
let i = 0;
for (i; i < len; i++) {
this.allCount += data.collectGoods[i].count;
}
} else {
this.allCount = 0;
}
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/7
* 集卡卡片数据
*/
export interface ICollectGoodData {
/**
* 卡片数量
*/
count: number;
/**
* 卡片ID
*/
id: number;
/**
* 展示图片
*/
img: string;
/**
* 卡片名字
*/
name: string
}
import { ICollectGoodData } from "./ICollectGoodData";
/**
* 集卡规则
*/
export interface ICollectRuleData {
/**
* 奖品等级
*/
grade: number;
/**
* 是否是随机卡兑换,优先于固定卡
*/
entryCount: number;
/**
* 集卡规则
*/
rule: ICollectGoodData[];
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/12
* 用户剩余积分数据
*/
import { Data } from "../../Data";
export class GetCreditsData extends Data {
/**
* 积分单位
*/
public unitName: string;
/**
* 积分
*/
public credits: number;
/**
* 用户积分
*/
public consumerCredits: number;
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
this.unitName = result.data.unitName;
this.credits = result.data.credits;
this.consumerCredits = result.data.consumerCredits;
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/12
* 获取用户角色信息
*/
import { Data } from "../../Data";
export class GetRoleData extends Data {
/**
* 性别
*/
public role: string;
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.role = data.data.role;
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/1
* 奖品信息
*/
import { LotteryType } from "../../../enum/LotteryType";
import { IData } from "duiba-tc";
import { IExposureData } from "../IExposureData";
export class LotteryData implements IData {
/**
* 广告ID
*/
public id: number;
/**
* 安卓下载链接
*/
public androidDownloadUrl: string;
/**
* 图片链接
*/
public img: string;
/**
* IOS下载链接
*/
public iosDownloadUrl: string;
/**
* 跳转地址
*/
public link: string;
/**
* 奖品名字
*/
public name: string;
/**
*
*/
public openUrl: string;
/**
* 是否展示立即使用按钮
*/
public showUse: boolean;
/**
*
*/
public tip: string;
/**
* 标题
*/
public title: string;
/**
* 立即使用按钮文案
*/
public useBtnText: string;
/**
* 有效日期
*/
public validate: string;
/**
* 奖品类型
*/
public type: LotteryType;
/**
* 关闭按钮埋点
*/
public closeExposure: IExposureData;
/**
* 立即使用按钮埋点
*/
public useExposure: IExposureData;
/**
* 奖品图片埋点
*/
public imgExposure: IExposureData;
/**
* 是否弹出下载提示框
*/
public confirm: string;
/**
* 集卡id
*/
public itemId: number;
public update(data: any): void {
if (!data) {
return;
}
this.androidDownloadUrl = data.androidDownloadUrl;
this.iosDownloadUrl = data.iosDownloadUrl;
this.img = data.imgurl;
this.link = data.link;
this.name = data.name ? data.name : data.title;
this.openUrl = data.openUrl;
this.showUse = data.showUse;
this.tip = data.tip;
this.title = data.title;
this.useBtnText = data.useBtnText;
this.validate = data.validate;
this.type = data.type;
this.confirm = data.confirm;
this.id = data.id;
if (data.stinfodpmclose) {
this.closeExposure = JSON.parse(data.stinfodpmclose);
} else {
this.closeExposure = null;
}
if (data.stinfodpmgouse) {
this.useExposure = JSON.parse(data.stinfodpmgouse);
} else {
this.useExposure = null;
}
if (data.stinfodpmimg) {
this.imgExposure = JSON.parse(data.stinfodpmimg);
} else {
this.imgExposure = null;
}
if(data.itemId){
this.itemId = data.itemId;
}
}
}
\ No newline at end of file
import { Data } from './../../Data';
export class OpenCollectGoodsPrizeData extends Data {
/**
* 订单ID
*/
public orderId: number;
public update(data: any): void {
if(!data) {
return;
}
super.update(data);
this.orderId = data.orderId;
}
}
\ No newline at end of file
import { Data } from './../../Data';
export class RecordData extends Data {
public emdDpmJson: any;
public emdJson: any;
public gmtCreate: any;
public img: string;
public invalid: boolean;
public orderTypeTitle: string;
public quantity: number;
public statusText: string;
public text: string;
public title: string;
public trueActivityTitle: string;
public url: string;
public update(data: any): void {
if(!data) {
return;
}
super.update(data);
this.emdDpmJson = data.emdDpmJson;
this.emdJson = data.emdJson;
this.gmtCreate = data.gmtCreate;
this.img = data.img;
this.invalid = data.invalid;
this.orderTypeTitle = data.orderTypeTitle;
this.quantity = data.quantity;
this.statusText = data.statusText;
this.text = data.text;
this.title = data.title;
this.trueActivityTitle = data.trueActivityTitle;
this.url = data.url;
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/12
* 设置用户信息
*/
import { Data } from "../../Data";
export class SetRoleData extends Data {
/**
* 性别
*/
public role: string;
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.role = data.data.role;
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/10
* 获奖用户数据
*/
export interface IWinnerData {
/**
* 手机号码
*/
phone: string;
/**
* 花费充值账号
*/
phoneBill: string;
/**
* 支付宝充值账号
*/
alipayAccount: string;
/**
* Q币充值账号
*/
qqAccount: string;
/**
* 奖品类型
*/
prizeType: string;
/**
* 所在地
*/
city: string;
/**
* 用户ID
*/
userId: string;
/**
* 中奖日期
*/
date: string;
/**
*
*/
winnerCarouselId: number;
/**
* 昵称
*/
nickName: string;
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/10
* 中奖广播数据
*/
import { IWinnerData } from "./IWinnerData";
import { Data } from "../../Data";
export class WinnersData extends Data {
/**
* 用户列表
*/
public winnerList: IWinnerData[];
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.winnerList = data.data;
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/12
* 自定义活动配置信息
*/
import { Data } from "../../Data";
import { ICustomOptionData } from "./ICustomOptionData";
import { IElementData } from "./IElementData";
export class AjaxElementData extends Data {
/**
* 闯关信息
*/
public throughCurrent: number;
/**
* 闯关模式
*/
public throughMode: number;
/**
* 关卡ID
*/
public throughNum: number;
/**
* 站点位置
*/
public throughCurrentStep: number;
/**
* 弹层js
*/
public jsTest: string;
/**
* 弹层css
*/
public cssTest: string;
/**
* 活动规则
*/
public rule: any;
/**
* 活动类型
*/
public type: string;
/**
* 奖项列表
*/
public options: ICustomOptionData[];
/**
* 页面展示信息
*/
public element: IElementData;
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
this.throughCurrent = result.throughCurrent;
this.throughMode = result.throughMode;
this.throughNum = result.throughNum;
this.throughCurrentStep = result.throughCurrentStep;
this.jsTest = result.jsTest;
this.cssTest = result.cssTest;
this.rule = result.rule;
this.type = result.type;
this.options = result.options;
this.element = result.element;
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/12
* 活动工具奖项信息
*/
export interface ICustomOptionData {
/**
* 是否展示奖品
*/
hidden: boolean;
/**
* 奖品ID
*/
id: number;
/**
* 奖品图片
*/
logo: string;
/**
* 奖品名字
*/
name: string;
/**
* 奖品类型 lucky 福袋, virtual 虚拟商品, object 实物, coupon 优惠券, alipay 支付宝, phonebill 话费, qb Q币, collectGoods 集卡
*/
prizeType: string;
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/12
* 活动工具页面展示数据
*/
export interface IElementData {
/**
* 积分模式
*/
isCreditsTypeOpen: boolean;
/**
* 免费次数
*/
freeLimit: number;
/**
* 我的积分
*/
myCredits: string;
/**
* 参与积分
*/
needCredits: number;
/**
* 状态码 0其它异常 1积分不足 3今日没有抽奖次数 4没有抽奖次数 5次数提示为:今日剩余{0}次 6{0}元宝/次 7次数提示为:剩余{0}次 18未登录
*/
status: number;
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/12
* 闯关游戏配置数据
*/
import { Data } from "../../Data";
import { IThroughInfoData } from "./IThroughInfoData";
export class AjaxThroughInfoData extends Data {
/**
* 闯关信息
*/
public throughNum: number;
/**
* 闯关模式
*/
public throughCurrent: number;
/**
* 关卡ID
*/
public throughCurrentStep: number;
/**
* 站点位置
*/
public throughMode: number;
/**
* 关卡列表
*/
public throughInfoList: IThroughInfoData[];
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.throughCurrent = data.throughCurrent;
this.throughMode = data.throughMode;
this.throughNum = data.throughNum;
this.throughCurrentStep = data.throughCurrentStep;
this.throughInfoList = data.throughInfo;
}
}
\ No newline at end of file
import { IData } from "duiba-tc";
/**
*Created by cuiliqiang on 2018/3/12
* 闯关游戏关卡数据
*/
export interface IThroughInfoData {
/**
* 展示图片
*/
img: string;
/**
* 奖品类型
*/
type: string;
/**
* 所在步数
*/
step: number;
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/12
* 前置开奖提交数据
*/
import { Data } from "../../Data";
export class BeforSubmitData extends Data {
/**
* 状态 0处理成功
*/
public result: number;
/**
*
*/
public type: string;
/**
* 用户虚拟积分可达到的阈值 未中奖返回-1
*/
public facePrice: number;
/**
* 订单ID
*/
public orderId: number;
/**
* 标题
*/
public title: string;
public update(data: any): void {
if (!data) {
return;
}
this.result = data.result;
this.type = data.type;
this.facePrice = data.facePrice;
this.orderId = data.orderId;
this.title = data.title;
}
}
/**
*Created by cuiliqiang on 2018/3/12
* 活动工具基础配置数据
*/
export interface ICustomCfgData {
/**
* 活动ID
*/
actId: number;
/**
* 入库ID
*/
oaId: number;
/**
* 积分单位
*/
unitName: string;
/**
* 按钮单位
*/
btnUnitName: string;
/**
* 用户ID
*/
consumerId: number;
/**
*
*/
hdType: string;
/**
*
*/
hdToolId: number;
/**
*
*/
appId: number;
/**
* 兑换记录地址
*/
recordUrl: string;
/**
* 是否使用配置的优惠券弹窗
*/
needCouponModal: boolean;
/**
* 是否是预览
*/
preview: boolean;
/**
* 需要异步加载的文件列表
*/
asyncFiles: string[];
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/12
* 活动工具抽奖数据
*/
import { Data } from "../../Data";
export class DoJoinData extends Data {
/**
* 所需积分
*/
public needCredits: number;
/**
* 订单ID
*/
public orderId: number;
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.needCredits = data.needCredits;
this.orderId = data.orderId;
}
}
\ No newline at end of file
import { GPool } from "duiba-tc";
import { LotteryData } from "../../common/lottery/LotteryData";
import { Data } from "../../Data";
import { IExposureData } from "../../common/IExposureData";
/**
*Created by cuiliqiang on 2018/3/12
* 订单状态
*/
export class GetCustomOrderStatusData extends Data {
/**
* 推啊埋点数据
*/
public exposure: IExposureData;
/**
* 奖品数据
*/
public lottery: LotteryData;
/**
* 业务状态 -1处理失败 0处理中 1谢谢参与 2处理完成 3再来一次 101扣积分失败或者内部处理异常
*/
public result: number;
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.result = data.result;
if (data.exposure) {
this.exposure = data.exposure;
} else if (this.exposure) {
this.exposure = null;
}
if (data.lottery && data.lottery.type != 'thanks') {
this.lottery = GPool.takeOut('LotteryData', LotteryData);
if (!this.lottery) {
this.lottery = new LotteryData();
}
this.lottery.update(data.lottery);
} else {
GPool.recover('LotteryData', this.lottery);
this.lottery = null;
}
}
}
/**
*Created by cuiliqiang on 2018/3/13
* 中奖前置数据
*/
import { Data } from "../../Data";
export class GetOrderInfoData extends Data {
/**
* 状态 0,101 处理中 2处理成功
*/
public result: number;
/**
* 奖品类型
*/
public type: string;
/**
* 用户虚拟积分可达到的阈值 未中奖返回-1
*/
public facePrice: number;
/**
* 前端缓存到后端的数据
*/
public cacheInfo: any;
/**
* 订单ID
*/
public orderId: number;
/**
* 标题
*/
public title: string;
public update(data: any): void {
if (!data) {
return;
}
this.result = data.result;
this.type = data.type;
this.facePrice = data.facePrice;
this.cacheInfo = data.cacheInfo;
this.orderId = data.orderId;
this.title = data.title;
}
}
/**
*Created by cuiliqiang on 2018/3/12
* 答题提交结果数据
*/
import { Data } from "../../Data";
export class QuestionSubmitData extends Data {
/**
* 订单ID
*/
public orderId: number;
/**
* 1:插件式抽奖工具 返回数据中 对一个 plginOrderId 然后调用 collectRule/getOrderStatus?orderId=plginOrderId 查询奖品信息
* 2:后退 3:前进 4终点 5:活动工具奖品出奖 6:跳转地址
*/
public type: string;
/**
* 插件订单ID 对应type = 1时
*/
public plginOrderId: number;
/**
* 为true 时 需要调用 newActivity/getOrderStatus 查询奖品信息
*/
public needPrize: boolean;
/**
*
*/
public point: number;
/**
* 当前位置
*/
public currentLocation: number;
public update(data: any): void {
if (!data) {
return;
}
this.orderId = data.orderId;
this.type = data.prizeType;
this.plginOrderId = data.plginOrderId;
this.needPrize = data.needPrize;
this.point = data.point;
this.currentLocation = data.currentLocation;
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/12
* 闯关游戏提交结果数据
*/
import { Data } from "../../Data";
export class ThroughSubmitData extends Data {
/**
* 订单ID
*/
public orderId: number;
/**
* 1:插件式抽奖工具 返回数据中 对一个 plginOrderId 然后调用 collectRule/getOrderStatus?orderId=plginOrderId 查询奖品信息
* 2:后退 3:前进 4终点 5:活动工具奖品出奖 6:跳转地址
*/
public type: string;
/**
* 插件订单ID 对应type = 1时
*/
public plginOrderId: number;
/**
* 为true 时 需要调用 newActivity/getOrderStatus 查询奖品信息
*/
public needPrize: boolean;
/**
*
*/
public point: number;
/**
* 当前位置
*/
public currentLocation: number;
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.orderId = data.orderId;
this.type = data.prizeType;
this.plginOrderId = data.plginOrderId;
this.needPrize = data.needPrize;
this.point = data.point;
this.currentLocation = data.currentLocation;
}
}
\ No newline at end of file
import { IData } from "duiba-tc";
/**
*Created by cuiliqiang on 2018/3/1
*/
export interface IAppData {
/**
* AppID
*/
appId: number;
/**
* 赚取积分链接
*/
earnCreditsUrl: string;
/**
*
*/
isOpen: boolean;
/**
*
*/
openLogin: string;
/**
*
*/
loginProgram: string;
}
\ No newline at end of file
export interface IDefenseStrategyData {
/**
* 阶段性提交分值条件(每到此分值的倍数则提交一次)
*/
scoreUnit: number;
/**
* 每局可阶段性提交次数
*/
interfaceLimit: number;
}
\ No newline at end of file
import { IData } from "duiba-tc";
export interface IExtraCfgData {
/**
* 埋点域名
*/
embedDomain: string;
}
\ No newline at end of file
import { GetInfoData } from '../getInfo/GetInfoData';
import { IAppData } from './IAppData';
import { IGameData } from './IGameData';
import { IExtraCfgData } from './IExtraCfgData';
import { IDefenseStrategyData } from './IDefenseStrategyData';
export interface IGameCfgData {
/**
* App数据
*/
appInfo: IAppData;
/**
* 游戏配置数据
*/
gameInfo: IGameData;
/**
* 其它数据
*/
extra: IExtraCfgData;
/**
* 防作弊数据
*/
defenseStrategy: IDefenseStrategyData;
}
\ No newline at end of file
import { IData } from "duiba-tc";
import { IRecommendData } from "./IRecommendData";
export interface IGameData {
/**
* 皮肤内容
*/
skinContent: string;
/**
*
*/
oaId: number;
/**
* 活动结束时间
*/
offDate: string;
/**
* 是否是排名开奖
*/
rankPrize: boolean;
/**
* 是否开启积分累计模式
*/
openTotalScoreSwitch: boolean;
/**
* 游戏ID
*/
gameId: number;
/**
* 管理后台游戏ID
*/
id: number;
/**
* 推荐位数据
*/
recommend: IRecommendData;
}
\ No newline at end of file
import { IData } from "duiba-tc";
/**
*Created by cuiliqiang on 2018/3/1
* 推荐位
*/
export interface IRecommendData {
/**
* banner图
*/
bannerImg: string;
/**
* 展示图
*/
image: string;
/**
* 跳转地址
*/
link: string;
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/1
* 中奖用户信息
*/
export interface IUserData {
/**
* 是否参与过
*/
active: boolean;
/**
* 用户ID
*/
cid: string;
/**
* 最高分
*/
maxScore: number;
/**
* 排名
*/
rank: number;
/**
* 昵称
*/
nickName?: string;
/**
* 头像
*/
avatar?: string;
}
\ No newline at end of file
import { Data } from "../../Data";
/**
* 阶段提交数据
*/
export class DatapashData extends Data {
public update(result: any): void {
super.update(result);
}
}
\ No newline at end of file
export interface IDynamicData {
//x坐标
x: number;
//y坐标
y: number;
//action 行为类型 md按下 mu抬起
a: string;
//行为产生时间戳
t: number;
}
\ No newline at end of file
/**
*Created by huangwenjie on 2018/7/18
* 复活操作
*/
import { Data } from "../../Data";
export class DoReviveData extends Data {
/**
* 时间戳
*/
public timestamp:string;
/**
* 是否成功
*/
public isSuccess:boolean;
/**
* 复活卡数量
*/
public reviveCardNum:number;
/**
* 是否复活成功, true成功,false失败
*/
public status:boolean;
constructor() {
super();
}
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.timestamp = data.timestamp;
this.isSuccess = data.success;
this.reviveCardNum = data.data.reviveCardNum;
this.status = data.data.status;
}
}
\ No newline at end of file
/**
*Created by huangwenjie on 2018/7/18
* 获得复活卡数量
*/
import { Data } from "../../Data";
export class GetReviveCardNumData extends Data {
/**
* 时间戳
*/
public timestamp:string;
/**
* 是否成功
*/
public isSuccess:boolean;
/**
* 复活卡数量
*/
public reviveCardNum:number;
constructor() {
super();
}
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.timestamp = data.timestamp;
this.isSuccess = data.success;
this.reviveCardNum = data.data;
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/1
* 开始游戏
*/
import { Data } from "../../Data";
import { IExtraData } from "./ExtraData";
export class DoStartData extends Data {
/**
* 附加数据
*/
public extra: IExtraData;
/**
* 订单ID
*/
public ticketId: number;
/**
* 提交游戏数据token
*/
public submitToken: string;
/**
*
*/
public token: string;
/**
* 剩余积分
*/
public credits: number;
constructor() {
super();
}
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.extra = data.extra;
this.ticketId = data.ticketId;
this.credits = data.credits;
this.submitToken = window['resolve'](data.submitToken);
this.token = window['resolve'](data.token);
}
}
\ No newline at end of file
import { IData } from "duiba-tc";
/**
*Created by cuiliqiang on 2018/3/12
* 开始游戏附加数据
*/
export interface IExtraData {
/**
* 初始分数
*/
initialScore: number;
/**
* 初始卡牌
*/
poker: number;
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/8
* 查询游戏订单结果
*/
import { Data } from "../../Data";
export class GetStartStatusData extends Data {
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
}
}
\ No newline at end of file
import { IStatusData } from './IStatusData';
import { Data } from "../../Data";
export class GetInfoData extends Data {
/**
* 用户ID
*/
public consumerId: number;
/**
* 积分
*/
public credits: number;
/**
* 累计成绩
*/
public totalScore: number;
/**
* 最佳成绩
*/
public maxScore: number;
/**
* 最佳成绩产生时间
*/
public maxScoreTime: string;
/**
* 排名
*/
public rank: number;
/**
* 百分比排名
*/
public percentage: number;
/**
* 游戏状态
*/
public token: string;
/**
*
*/
public status: IStatusData;
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
let data;
if(result.data) {
if(result.data.rsp) {
data = result.data.rsp;
} else {
data = result.data;
}
}
this.consumerId = data.consumerId;
this.credits = data.credits;
this.totalScore = data.totalScore;
this.maxScore = data.maxScore;
this.maxScoreTime = data.maxScoreTime;
this.rank = data.rank;
this.percentage = data.percentage || 0;
if(data.token) {
this.token = window['resolve'](data.token);
}
this.status = data.status;
}
}
\ No newline at end of file
import { IStatusData } from './IStatusData';
import { Data } from "../../Data";
export class GetSummerInfoData extends Data {
/**
* 用户ID
*/
public consumerId: number;
/**
* 累计成绩
*/
public totalScore: number;
/**
* 最佳成绩
*/
public maxScore: number;
/**
* 游戏状态
*/
public status: IStatusData;
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
let data;
if(result.data) {
if(result.data.rsp) {
data = result.data.rsp;
} else {
data = result.data;
}
}
this.consumerId = data.consumerId;
this.totalScore = data.totalScore;
this.maxScore = data.maxScore;
this.status = data.status;
}
}
\ No newline at end of file
import { IData } from "duiba-tc";
/**
*Created by cuiliqiang on 2018/3/1
* 业务状态
*/
export interface IStatusData {
/**
* 按钮是否禁用 true不可点击 false可以点击
*/
btnDisable: boolean;
/**
* 按钮响应类型 click执行btnEvent url内部逻辑
*/
btnEventType: string;
/**
* 按钮处理内容
*/
btnEvent: string;
/**
* 按钮展示文案
*/
btnText: string;
/**
* 状态码 0开始游戏 1未登录 2积分不足 3参与次数用完 4已经结束等待开奖 5已开奖 6无大奖游戏结束
*/
code: number;
/**
* 业务展示文案
*/
text: string;
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/1
* 游戏奖项信息
*/
import { Data } from "../../Data";
import { IGameOptionData } from "./IGameOptionData";
export class GetOptionsData extends Data {
/**
* 奖品列表
*/
public optionList: IGameOptionData[];
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
this.optionList = result;
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/2
* 奖品数据
*/
export interface IGameOptionData {
/**
* 是否参与立即发奖
*/
autoOpen: boolean;
/**
* 奖品说明
*/
description: string;
/**
* 奖品图片
*/
logo: string;
/**
* 奖品名字
*/
name: string;
/**
* 排名范围(如:1-2)
*/
scope: string;
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/7
* 游戏规则数据
*/
import { Data } from './../../Data';
export class GetRuleData extends Data {
/**
* 规则文案
*/
public ruleText: any;
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
this.ruleText = result;
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/12
* 用户成长值数据
*/
import { Data } from "../../Data";
export class GetUserTotalScoreData extends Data {
/**
* 成长值
*/
private score: number;
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.score = data.data;
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/9
* 猜扑克数据
*/
import { Data } from "../../Data";
export class GuessPokerData extends Data {
/**
* 是否猜中
*/
public isWin: boolean;
/**
* 发出的卡牌
*/
public poker: number;
/**
* 当前成长值
*/
public score: number;
/**
* 当前第几轮
*/
public times: number;
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
if (!data.data) {
return;
}
this.isWin = data.data.win;
this.poker = data.data.poker;
this.score = data.data.score;
this.times = data.data.times;
}
}
\ No newline at end of file
import { DataManager } from './../../../manager/DataManager';
import { Data } from "../../Data";
import { IUserData } from '../common/IUserData';
/**
*Created by cuiliqiang on 2018/3/9
* 时时排行榜数据
*/
export class RealTimeRankData extends Data {
/**
* 是否在排行榜内
*/
public inRank: boolean;
/**
* 自己的排行数据
*/
public myUserData: IUserData;
/**
* 排行列表
*/
public userList: IUserData[];
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.inRank = data.data.inRank;
if (data.data.user) {
this.myUserData = data.data.user;
DataManager.ins.getInfoData.rank = this.myUserData.rank;
}
this.userList = data.data.userList;
}
}
\ No newline at end of file
import { IExposureData } from './../../common/IExposureData';
import { GPool } from "duiba-tc";
import { GetInfoData } from './../getInfo/GetInfoData';
import { LotteryData } from './../../common/lottery/LotteryData';
import { Data } from './../../Data';
/**
* 获取游戏抽奖结果
*/
export class GameGetSubmitResultData extends Data {
/**
* 奖品数据
*/
public lottery: LotteryData;
/**
* 推啊数据埋点
*/
public exposure: IExposureData;
/**
* 再来一次埋点
*/
public againExposure: IExposureData;
/**
* 是否需要继续轮询
*/
public flag: boolean;
/**
* 本局分数
*/
public score: number;
public update(result: any): void {
if(!result) {
return;
}
super.update(result);
this.flag = result.data.flag;
if (result.data.option) {
this.lottery = GPool.takeOut('LotteryData', LotteryData);
if (!this.lottery) {
this.lottery = new LotteryData();
}
if (!result.data.option.lottery) {
result.data.option.lottery = {};
}
result.data.option.lottery.type = result.data.option.type;
result.data.option.lottery.stinfodpmgouse = result.data.useDpm;
result.data.option.lottery.stinfodpmimg = result.data.useDpm;
result.data.option.lottery.imgurl = result.data.option.image;
result.data.option.lottery.link = result.data.option.link;
result.data.option.lottery.name = result.data.option.name;
result.data.option.lottery.type = result.data.option.type;
this.lottery.update(result.data.option.lottery);
} else if (this.lottery) {
GPool.recover('LotteryData', this.lottery);
this.lottery = null;
}
if (this.lottery) {
this.exposure = result.data.option.lottery.exposure;
} else if (this.exposure) {
this.exposure = null;
}
this.againExposure = JSON.parse(result.data.againDpm);
this.score = result.data.score;
}
}
\ No newline at end of file
import { DataManager } from './../../../manager/DataManager';
import { Data } from './../../Data';
export class GameSubmitData extends Data {
/**
* 订单ID
*/
public orderId: number;
/**
* 百分比排名
*/
public percentage: number;
/**
* 更新
* @param result
*/
public update(result: any): void {
super.update(result);
if(result.data){
this.orderId = result.data.orderId;
this.percentage = DataManager.ins.getInfoData.percentage = result.data.rsp.percentage;
}
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/1
* 用户中奖信息
*/
export interface IConsumerData {
/**
* 用户ID
*/
cid: string;
/**
* 参与过活动
*/
join: boolean;
/**
* 奖品名字
*/
option: string;
/**
* 用户ID
*/
rank: string;
}
\ No newline at end of file
import { IUserData } from "../common/IUserData";
/**
*Created by cuiliqiang on 2018/3/1
* 奖项及中奖用户列表
*/
export interface IRankData {
/**
* 奖品名字
*/
name: string;
/**
* 展示图片
*/
imageUrl: string;
/**
* 中奖用户列表
*/
users: IUserData[];
}
\ No newline at end of file
import { Data } from "../../Data";
import { IConsumerData } from "./IConsumerData";
import { IRankData } from "./IRankData";
/**
*Created by cuiliqiang on 2018/3/1
* 中奖数据
*/
export class WinRanksData extends Data {
/**
* 用户数据
*/
public consumer: IConsumerData;
/**
* 排行列表
*/
public rankList: IRankData[];
public update(data: any): void {
if (!data) {
return;
}
super.update(data);
this.consumer = data.consumer;
this.rankList = data.ranks;
}
}
\ No newline at end of file
import { Data } from "../Data";
/**
* 收取礼物
*/
export class CollectData extends Data {
public update(result: any): void {
if(!result) {
return;
}
super.update(result);
}
}
\ No newline at end of file
import { Data } from './../Data';
export class GetFoodPilesData extends Data {
public list:any[];
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
this.list = result.data;
}
}
\ No newline at end of file
export interface GetRankItemData {
/**
* 用户id
*/
consumerId:number;
/**
* 昵称
*/
nickname:string;
/**
* 头像
*/
avatar:string;
/**
* 排名
*/
rank:number;
/**
* 投食数量
*/
feedCount:string;
}
\ No newline at end of file
import { Data } from './../Data';
import { GetRankItemData } from './GetRankItemData';
export class GetRankListData extends Data {
/**
* 排名列表
*/
public list: GetRankItemData[];
/**
* 我的排行数据
*/
public myUserData: GetRankItemData;
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
if(!result.data){
return;
}
this.list = result.data.rankList;
if(result.data.user){
this.myUserData = result.data.user;
}
}
}
\ No newline at end of file
import { Data } from "../Data";
import { IToyItemData } from "./IToyItemData";
/**
* 道具展示接口
*/
export class GetToysData extends Data {
/**
* 道具列表
*/
public list: IToyItemData[];
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
this.list = result.data;
}
}
\ No newline at end of file
/**
*Created by ck on 2018/5/16
*/
export interface IPetToyData {
/**
* 道具id
*/
toyId: number;
/**
* 道具名字
*/
toyName: string;
/**
* 是否有状态(无状态即为装饰道具)
*/
withStatus: boolean;
/**
* 道具标识
*/
identifier: string;
/**
* 道具描述
*/
description: string;
}
\ No newline at end of file
/**
* 单个道具数据
*/
export interface IToyItemData {
/**
* 道具id
*/
toyId: number;
/**
* 道具名字
*/
toyName: string;
/**
* 积分消耗
*/
credits: number;
/**
* 道具标识
*/
identifier: string;
/**
* 道具描述
*/
description: string;
/**
* 道具数量
*/
count: number;
}
\ No newline at end of file
import { Data } from "../Data";
/**
* 宠物领养
*/
export class PetAdopteData extends Data {
/**
* 宠物id
*/
public petId: number;
/**
* 活动id
*/
public activityId: string;
/**
* 宠物名称
*/
public petName: string;
/**
* 宠物等级
*/
public petLevel: number;
/**
* 累计收到食物
*/
public totalReceivedNum: number;
/**
* 累计消耗食物
*/
public totalEatNum: number;
/**
* 当前状态(1:正常 2:外出 3:吃饭 4:学习 5:喝水 6:睡觉)
*/
public status: number;
/**
* 拥有萝卜数量
*/
public foodNum: number;
/**
* 状态剩余时间
*/
public leftMinutes: number;
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
if(!result.data) {
return;
}
result = result.data;
this.petId = result.petId;
this.activityId = result.activityId;
this.petName = result.petName;
this.petLevel = result.petLevel;
this.totalReceivedNum = result.totalReceivedNum;
this.totalEatNum = result.totalEatNum;
this.status = result.status;
this.foodNum = result.foodNum;
this.leftMinutes = result.leftMinutes;
}
}
\ No newline at end of file
import { Data } from "../Data";
/**
* 宠物喂食
*/
export class PetFeedData extends Data {
/**
* 错误标识码(见状态码-宠物养成-喂食错误码)
*/
public errorCode: string;
/**
* 当前状态(1:正常 2:外出 3:吃饭 4:学习 5:喝水 6:睡觉)
*/
public status: number;
/**
* 拥有萝卜数量
*/
public foodNum: number;
/**
* 状态剩余时间
*/
public leftMinutes: number;
/**
* 喂食周期剩余时间(分钟)
*/
public feedIntervalRemain: number;
public update(result: any): void {
if (!result) {
return;
}
result.message = window['errorMessage'] ? window['errorMessage'][result.errorCode] : "";
super.update(result);
this.errorCode = result.errorCode;
if (result.data) {
this.status = result.data.status;
this.foodNum = result.data.foodNum;
this.leftMinutes = result.data.leftMinutes;
this.feedIntervalRemain = result.data.feedIntervalRemain;
}
}
}
\ No newline at end of file
import { Data } from "../Data";
import { IPetToyData } from "./IPetToyData";
export class PetHomeInfoData extends Data {
/**
* 宠物id
*/
public petId: number;
/**
* 当前状态(1:正常 2:外出 3:吃饭 4:学习 5:喝水 6:睡觉)
*/
public status = 0;
/**
* 状态过期倒计时(单位:分钟,目前只针对吃饭状态有此值)
*/
public leftMinutes = "0";
/**
* 是否是吃饱状态
*/
public isFull: boolean;
/**
* 宠物名称
*/
public petName = "";
/**
* 宠物等级
*/
public petLevel = 0;
/**
* 饲养员拥有食物量
*/
public foodNum = 0;
/**
* 食物名称
*/
public foodName = "";
/**
* 每次喂养食物数量
*/
public feedLimit = 10;
/**
* 宝箱插件id
*/
public awardPluginId = 0;
/**
* 外出奖励(-1:自定义奖励 0:无奖励 1:粮食奖励)
*/
public travelRewardType = 0;
/**
* 外出奖励个数(针对粮食奖励)
*/
public travelRewardNum = 0;
/**
* 宠物正在使用的道具数据
*/
public toy: IPetToyData[] = [];
/**
* 等级奖励插件ID
*/
public levelRewardPluginId:number;
/**
* 当前经验值
*/
public petExp:number;
/**
* 当前级别初始的经验值
*/
public currentLevelExp:number;
/**
* 下个级别初始的经验值
*/
public nextLevelExp:number;
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
let result2;
if (result.data) {
result2 = result.data;
}
if(result2){
if (result2.petId) {
this.petId = result2.petId;
}
if (result2.status) {
this.status = result2.status;
}
if (result2.leftMinutes) {
this.leftMinutes = result2.leftMinutes;
}
if (result2.isFull) {
this.isFull = result2.isFull;
}
if (result2.petName) {
this.petName = result2.petName;
}
if (result2.petLevel) {
this.petLevel = result2.petLevel;
}
if (result2.foodNum) {
this.foodNum = result2.foodNum;
}
if (result2.foodName) {
this.foodName = result2.foodName;
}
if (result2.feedLimit) {
this.feedLimit = result2.feedLimit;
}
if (result2.awardPluginId) {
this.awardPluginId = result2.awardPluginId;
}
if (result2.travelRewardType) {
this.travelRewardType = result2.travelRewardType;
}
if (result2.travelRewardNum) {
this.travelRewardNum = result2.travelRewardNum;
}
this.toy = result2.toy;
if(result2.levelRewardPluginId){
this.levelRewardPluginId = result2.levelRewardPluginId;
}
if(result2.petExp){
this.petExp = result2.petExp;
}
if(result2.currentLevelExp){
this.currentLevelExp = result2.currentLevelExp;
}
if(result2.nextLevelExp){
this.nextLevelExp = result2.nextLevelExp;
}
}
}
}
\ No newline at end of file
/**
*Created by ck on 2018/5/2
*/
import { Data } from "../Data";
import { PetHomeInfoData } from "./PetHomeInfoData";
export class PetIndexData extends Data {
/**
* 积分
*/
public credits: number;
/**
* 积分单位
*/
public creditsUnitName: string;
/**
*
*/
public partnerUserId: string;
/**
* appId
*/
public appId: number;
/**
* 当前时间
*/
public currentTime: string;
/**
* 是否未登录
*/
public notLogin: any;
/**
* 商品域名
*/
public goodsDomain:string;
/**
* 楼层域名
*/
public homeDomain:string;
/**
* 埋点域名
*/
public embedDomain:string;
/**
* 唤起登录代码
*/
public openLogin:string;
/**
* 登录参数
*/
public loginProgram:string;
/**
* 用户自定义参数
*/
public dcustom:object = {};
/**
* 活动id
*/
public activityId:number;
/**
* 用户id
*/
public consumerId:number;
/**
* 首页宠物相关信息
*/
public petHomeInfo: PetHomeInfoData;
public update(result: any): void {
if(!result) {
return;
}
if(result.credits){
this.credits = result.credits;
}
if(result.creditsUnitName){
this.creditsUnitName = result.creditsUnitName;
}
if(result.partnerUserId){
this.partnerUserId = result.partnerUserId;
}
if(result.appId){
this.appId = result.appId;
}
if(result.currentTime){
this.currentTime = result.currentTime;
}
if(result.notLogin){
this.notLogin = result.notLogin;
}
if(result.goodsDomain){
this.goodsDomain = result.goodsDomain;
}
if(result.homeDomain){
this.homeDomain = result.homeDomain;
}
if(result.embedDomain){
this.embedDomain = result.embedDomain;
}
if(result.openLogin){
this.openLogin = result.openLogin;
}
if(result.loginProgram){
this.loginProgram = result.loginProgram;
}
if(result.dcustom){
this.dcustom = result.dcustom;
}
if(result.activityId){
this.activityId = result.activityId;
}
if(result.consumerId){
this.consumerId = result.consumerId;
}
// if(!this.petHomeInfo) {
// this.petHomeInfo = new PetHomeInfoData();
// }
// this.petHomeInfo.update(result.data);
}
}
\ No newline at end of file
import { Data } from "../Data";
/**
* 宠物状态刷新
*/
export class PetStatusData extends Data {
/**
* 当前状态(1:正常 2:外出 3:吃饭 4:学习 5:喝水 6:睡觉)
*/
public status: number;
/**
* 状态过期倒计时(单位:分钟,目前只针对吃饭状态有此值)
*/
public leftMinutes: string;
public update(result: any): void {
if (!result || !result.data) {
return;
}
super.update(result);
result = result.data;
this.status = result.status;
this.leftMinutes = result.leftMinutes;
}
}
\ No newline at end of file
import { SignInfoVo } from "./SignInfoVo";
import { Data } from "../Data";
/**
* 签到
*/
export class SignInfoData extends Data {
/**
* 签到流水ID
*/
public logId: number;
/**
* 签到信息
*/
public signInfoVO: SignInfoVo;
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
this.logId = result.logId;
this.signInfoVO = new SignInfoVo();
this.signInfoVO.update(result.signInfoVO);
}
}
\ No newline at end of file
import { IData } from "../../../tc/interface/IData";
// import { IData } from "duiba-tc";
/**
* 签到信息查询
*/
export class SignInfoVo implements IData {
/**
* 抽期内累计签到天数
*/
public acmDays = 0;
/**
* 今日奖励抽奖次数
*/
public activityCount = 0;
/**
* 明天签到奖励抽奖次数
*/
public activityCountTomorrow = 0;
/**
* 连续签到天数
*/
public continueDay = 0;
/**
* 今日签到奖励积分
*/
public credits = 0;
/**
* 明日签到奖励抽奖次数
*/
public creditsTomorrow = 0;
/**
* 首次签到日期
*/
public firstSignDate = 0;
/**
* 是否有累计奖励
*/
public hasAcmReward = false;
/**
* 连续签到天数
*/
public lastDays = 0;
/**
* 连续签到天数
*/
public monthResignedMap: any;
/**
* 周期内已签到日期记录
*/
public monthSignedMap: any;
/**
* 今天是否已签到
*/
public todaySigned = false;
/**
* 奖励集合
*/
public rewardMap: any;
public update(result: any): void {
if (!result) {
return;
}
this.acmDays = result.acmDays;
this.activityCount = result.activityCount;
this.activityCountTomorrow = result.activityCountTomorrow;
this.continueDay = result.continueDay;
this.credits = result.credits;
this.creditsTomorrow = result.creditsTomorrow;
this.firstSignDate = result.firstSignDate;
this.hasAcmReward = result.hasAcmReward;
this.lastDays = result.lastDays;
this.monthResignedMap = result.monthResignedMap;
this.monthSignedMap = result.monthSignedMap;
this.todaySigned = result.todaySigned;
if (result.rewardMap) {
this.rewardMap = result.rewardMap;
}
}
}
\ No newline at end of file
import { Data } from "../Data";
/**
* 道具兑换接口
*/
export class ToyExchangeData extends Data {
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
}
}
\ No newline at end of file
import { Data } from "../Data";
/**
* 道具使用
*/
export class ToyUseData extends Data {
public update(result: any): void {
if (!result) {
return;
}
super.update(result);
}
}
\ No newline at end of file
import { Data } from './../Data';
export interface GetActToysItemData{
/**
* 是否可重复购买
*/
canRepeatePurchase:boolean;
/**
* 道具兑换价值
*/
cost:number;
/**
* 道具描述
*/
description:string;
/**
* 道具兑换方式:1-积分 2-粮食
*/
exchangeType:number;
/**
* 道具主键id
*/
id:number;
/**
* 道具标识
*/
identifier:string;
/**
* 道具对当前用户是否开启
*/
openStatus:boolean;
/**
* 道具名称
*/
toyName:string;
/**
* 道具类型:1-状态类 2-装饰类 3-功能类 4-食物类 5-玩具类
*/
toyType:number;
/**
* 道具图片
*/
imgUrl:string;
/**
* 是否已经购买:针对不可重复购买的道具
*/
alreadyPurchased:boolean;
/**
* 是否因经验值不足无法开启
*/
expLimited:boolean;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment