Просмотр исходного кода

Merge branch 'master' of http://git.mokasz.com/zouyong/mk_framework

# Conflicts:
#	assets/script/game/data/g.ts
薛鸿潇 5 лет назад
Родитель
Сommit
0833a289e9

Разница между файлами не показана из-за своего большого размера
+ 1600 - 24
assets/resources/module/turnable/turnable.prefab


+ 31 - 15
assets/resources/module/turnable/item.prefab → assets/resources/module/turnable/turnableitem.prefab

@@ -25,9 +25,13 @@
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
-    "_components": [],
+    "_components": [
+      {
+        "__id__": 8
+      }
+    ],
     "_prefab": {
     "_prefab": {
-      "__id__": 8
+      "__id__": 9
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -78,7 +82,7 @@
   },
   },
   {
   {
     "__type__": "cc.Node",
     "__type__": "cc.Node",
-    "_name": "hb",
+    "_name": "图标",
     "_objFlags": 0,
     "_objFlags": 0,
     "_parent": {
     "_parent": {
       "__id__": 1
       "__id__": 1
@@ -177,15 +181,13 @@
     "root": {
     "root": {
       "__id__": 2
       "__id__": 2
     },
     },
-    "asset": {
-      "__uuid__": "29d84a7b-1843-43ee-ac07-c4458c76035a"
-    },
+    "asset": null,
     "fileId": "87pllbpidAepDuIXAprZLN",
     "fileId": "87pllbpidAepDuIXAprZLN",
     "sync": false
     "sync": false
   },
   },
   {
   {
     "__type__": "cc.Node",
     "__type__": "cc.Node",
-    "_name": "大量红包",
+    "_name": "名字",
     "_objFlags": 0,
     "_objFlags": 0,
     "_parent": {
     "_parent": {
       "__id__": 1
       "__id__": 1
@@ -210,8 +212,8 @@
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
-      "width": 120,
-      "height": 37.8
+      "width": 104,
+      "height": 32.76
     },
     },
     "_anchorPoint": {
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "__type__": "cc.Vec2",
@@ -264,8 +266,8 @@
     "_dstBlendFactor": 771,
     "_dstBlendFactor": 771,
     "_string": "大量红包",
     "_string": "大量红包",
     "_N$string": "大量红包",
     "_N$string": "大量红包",
-    "_fontSize": 30,
-    "_lineHeight": 30,
+    "_fontSize": 26,
+    "_lineHeight": 26,
     "_enableWrapText": true,
     "_enableWrapText": true,
     "_N$file": null,
     "_N$file": null,
     "_isSystemFontUsed": true,
     "_isSystemFontUsed": true,
@@ -285,19 +287,33 @@
     "root": {
     "root": {
       "__id__": 5
       "__id__": 5
     },
     },
-    "asset": {
-      "__uuid__": "135db755-1a7a-43cb-8f33-0c42cd2031c3"
-    },
+    "asset": null,
     "fileId": "a7LHeYawBIjpSQ5q/bEGyU",
     "fileId": "a7LHeYawBIjpSQ5q/bEGyU",
     "sync": false
     "sync": false
   },
   },
   {
   {
+    "__type__": "2df9fpSWF1G1a/os2Ev7z5Y",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "icon": {
+      "__id__": 3
+    },
+    "lbl_name": {
+      "__id__": 6
+    },
+    "_id": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "__type__": "cc.PrefabInfo",
     "root": {
     "root": {
       "__id__": 1
       "__id__": 1
     },
     },
     "asset": {
     "asset": {
-      "__id__": 0
+      "__uuid__": "1cdb74f7-8929-44c0-987f-ce38a49c2d05"
     },
     },
     "fileId": "",
     "fileId": "",
     "sync": false
     "sync": false

+ 0 - 0
assets/resources/module/turnable/item.prefab.meta → assets/resources/module/turnable/turnableitem.prefab.meta


+ 5 - 2
assets/script/game/component/Button.ts

@@ -17,6 +17,9 @@ export default class Button extends cc.Component {
     }
     }
 
 
     start() {
     start() {
+        if (!this.node.getComponent(cc.Button)) {
+            this.node.addComponent(cc.Button);
+        }
         this.node.on(cc.Node.EventType.TOUCH_START, this.touchStart, this);
         this.node.on(cc.Node.EventType.TOUCH_START, this.touchStart, this);
         this.node.on(cc.Node.EventType.TOUCH_END, this.touchEnd, this);
         this.node.on(cc.Node.EventType.TOUCH_END, this.touchEnd, this);
         this.node.on("click", this.click, this);
         this.node.on("click", this.click, this);
@@ -43,12 +46,12 @@ export default class Button extends cc.Component {
         }
         }
     }
     }
 
 
-    onDestroy(){
+    onDestroy() {
         this.node.off(cc.Node.EventType.TOUCH_START, this.touchStart, this);
         this.node.off(cc.Node.EventType.TOUCH_START, this.touchStart, this);
         this.node.off(cc.Node.EventType.TOUCH_END, this.touchEnd, this);
         this.node.off(cc.Node.EventType.TOUCH_END, this.touchEnd, this);
         this.node.off("click", this.click, this);
         this.node.off("click", this.click, this);
         this.onClick = [];
         this.onClick = [];
     }
     }
 
 
-    
+
 }
 }

+ 46 - 22
assets/script/game/data/g.ts

@@ -8,7 +8,13 @@ import { StorageData } from "./StorageData";
 import { WechatData } from "./WechatData";
 import { WechatData } from "./WechatData";
 import { HelpData } from "./module/HelpData";
 import { HelpData } from "./module/HelpData";
 import { PigBankData } from "./module/PigBankData";
 import { PigBankData } from "./module/PigBankData";
+import { TurnableData } from "./module/TurnableData";
 import { SignData } from "./module/SignData";
 import { SignData } from "./module/SignData";
+import { PushData } from "./module/PushData";
+import { FissionData } from "./module/FissionData";
+import { LuckyBagData } from "./module/LuckyBagData";
+import { CashNormalData } from "./module/CashNormalData";
+import { CashPigData } from "./module/CashPigData";
 
 
 /**
 /**
  * 数据集合全局类
  * 数据集合全局类
@@ -20,18 +26,24 @@ class g {
         this.init();
         this.init();
     }
     }
 
 
-    public loginData:LoginData;
-    public appData:AppData;
-    public gameData:GameData;
-    public wechatData:WechatData;
-    public httpData:HttpData;
-    public adData:AdData;
-    public storageData:StorageData;
-    public help:HelpData;
-    public pigbank:PigBankData;
-    public sign:SignData;
+    public loginData: LoginData;
+    public appData: AppData;
+    public gameData: GameData;
+    public wechatData: WechatData;
+    public httpData: HttpData;
+    public adData: AdData;
+    public storageData: StorageData;
 
 
-    public moduleDataMap:Map<string,Data>;
+    //module
+    public help: HelpData;
+    public push: PushData;
+    public turnable: TurnableData;
+    public fission: FissionData;
+    public pigbank: PigBankData;
+    public luckybag: LuckyBagData;
+    public signData: SignData;
+    public cashNormal: CashNormalData;
+    public cashPig: CashPigData;
 
 
     init() {
     init() {
         this.appData = new AppData();
         this.appData = new AppData();
@@ -41,22 +53,32 @@ class g {
         this.httpData = new HttpData();
         this.httpData = new HttpData();
         this.adData = new AdData();
         this.adData = new AdData();
         this.storageData = new StorageData();
         this.storageData = new StorageData();
-        this.sign = new SignData();
 
 
         this.help = new HelpData();
         this.help = new HelpData();
         this.pigbank = new PigBankData();
         this.pigbank = new PigBankData();
-    } 
-
-    public initModuleData(data){
-        this.moduleDataMap = new Map<string,Data>();
-        
-        // for
-        
+        this.push = new PushData();
+        this.turnable = new TurnableData();
+        this.fission = new FissionData();
+        this.pigbank = new PigBankData();
+        this.luckybag = new LuckyBagData();
+        this.signData = new SignData();
+        this.cashNormal = new CashNormalData();
+        this.cashPig = new CashPigData();
     }
     }
-    
-    getModuleData(key:string){
+}
 
 
-    }
+/**
+ * 提现模块的功能ID
+ */
+export enum Fun {
+    push = 1,       //互推
+    turnable = 2,   //转盘
+    fission = 3,    //裂变
+    pigbank = 4,    //存钱罐
+    luckybag = 5,   //福袋
+    sign = 6,       //签到
+    cashNormal = 7, //常规提现
+    cashPig = 8,    //金猪提现
 }
 }
 
 
 declare global {
 declare global {
@@ -64,3 +86,5 @@ declare global {
 }
 }
 window['g'] = new g();
 window['g'] = new g();
 
 
+
+

+ 8 - 0
assets/script/game/data/module/CashNormalData.ts

@@ -0,0 +1,8 @@
+/**
+ * @description 常规提现数据
+ * @author 邹勇
+ */
+ export class CashNormalData{
+
+    
+}

+ 9 - 0
assets/script/game/data/module/CashNormalData.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "5b3e05c3-511b-41b8-819c-83fffa683414",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 8 - 0
assets/script/game/data/module/CashPigData.ts

@@ -0,0 +1,8 @@
+/**
+ * @description 金猪提现数据
+ * @author 邹勇
+ */
+ export class CashPigData{
+
+    
+}

+ 9 - 0
assets/script/game/data/module/CashPigData.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "6dd0514b-a72d-44bc-b936-5773f03d821d",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 8 - 0
assets/script/game/data/module/FissionData.ts

@@ -0,0 +1,8 @@
+/**
+ * @description 裂变数据
+ * @author 邹勇
+ */
+ export class FissionData{
+
+    
+}

+ 9 - 0
assets/script/game/data/module/FissionData.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "38c62d15-c871-4e35-a714-2c6f3cf026b2",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 8 - 0
assets/script/game/data/module/LuckyBagData.ts

@@ -0,0 +1,8 @@
+/**
+ * @description 福袋数据
+ * @author 邹勇
+ */
+ export class LuckyBagData{
+
+    
+}

+ 9 - 0
assets/script/game/data/module/LuckyBagData.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "6247fd35-6ca7-4e1e-bbe0-b78eb3e6aa4f",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 8 - 0
assets/script/game/data/module/PushData.ts

@@ -0,0 +1,8 @@
+/**
+ * @description 互推数据
+ * @author 邹勇
+ */
+ export class PushData{
+
+    
+}

+ 9 - 0
assets/script/game/data/module/PushData.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "c05b768f-8452-4c43-82bb-99eec1ea1ea4",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 15 - 1
assets/script/game/data/module/TurnableData.ts

@@ -4,5 +4,19 @@
  */
  */
  export class TurnableData{
  export class TurnableData{
 
 
-    
+    /** 请求数据完成 */
+    public dataFinish:boolean = false;
+
+    public leftTimes:number = 2;
+
+
+
+    public async init(){
+        let data = {};
+        // let response = await mk.http.sendRequest('turnable', 'POST', JSON.stringify(data));
+        // if (response.errcode != 0) {
+        //     return;
+        // }
+        this.dataFinish = true;
+    }
 }
 }

+ 43 - 4
assets/script/game/module/module/turntable/Turnable.ts

@@ -1,22 +1,61 @@
+import TurnableItem from "./TurnableItem";
+
 const { ccclass, property } = cc._decorator;
 const { ccclass, property } = cc._decorator;
 
 
 @ccclass
 @ccclass
 export default class Turnable extends cc.Component {
 export default class Turnable extends cc.Component {
+    @property(cc.Node)
+    node_turn: cc.Node = null;
+    @property(cc.Node)
+    node_items: cc.Node[] = [];
+    @property(cc.Node)
+    btn_draw: cc.Node = null;
+    @property(cc.Sprite)
+    btn_close: cc.Sprite = null;
+    @property(cc.RichText)
+    lbl_left: cc.RichText = null;
+
+    private isPlaying: boolean = false;
 
 
     onLoad() {
     onLoad() {
 
 
     }
     }
 
 
-    start() {
-
+    /**
+     * 初始化奖励和抽奖次数
+     */
+    private initData() {
+        for (let i = 0; i < this.node_items.length; i++) {
+            let sc = this.node_items[i].getComponent(TurnableItem);
+            sc.initData(i + "");
+        }
+        let times = 1;
+        this.lbl_left.string = `剩余:<color=#FFED99>${times}</color>次`;
+    }
 
 
+    clickDraw() {
+        if (g.turnable.leftTimes > 0 && !this.isPlaying) {
+            this.draw();
+        }
     }
     }
 
 
-    clickBtn() {
+    private draw() {
+        this.node_turn.rotation = 1800;
+        let index = 2;
+        let tar = -index * 60;
+        cc.tween(this.node_turn)
+            .to(3, { rotation: -1800 }, { easing: 'quintIn' })
+            .call(() => {
 
 
+            }, this).start();
     }
     }
 
 
     update() {
     update() {
-
+        if (!g.turnable.dataFinish) {
+            g.turnable.init();
+        }
+        else{
+            this.initData();
+        }
     }
     }
 }
 }

+ 5 - 13
assets/script/game/module/module/turntable/TurnableItem.ts

@@ -1,25 +1,17 @@
 const { ccclass, property } = cc._decorator;
 const { ccclass, property } = cc._decorator;
 
 
 @ccclass
 @ccclass
-export default class Turnable extends cc.Component {
+export default class TurnableItem extends cc.Component {
     @property(cc.Sprite)
     @property(cc.Sprite)
     icon: cc.Sprite = null;
     icon: cc.Sprite = null;
     @property(cc.Label)
     @property(cc.Label)
     lbl_name: cc.Label = null;
     lbl_name: cc.Label = null;
 
 
-    onLoad() {
 
 
+    public async initData(data) {
+        // let src = data.type;
+        // this.icon.spriteFrame = await mk.loader.load(src, cc.SpriteFrame);
+        this.lbl_name.string = data;
     }
     }
 
 
-    start() {
-
-    }
-
-    clickBtn() {
-
-    }
-
-    update() {
-
-    }
 }
 }

Некоторые файлы не были показаны из-за большого количества измененных файлов