Răsfoiți Sursa

Merge branch 'master' of http://120.79.128.142:3000/904118851/car

xx 1 an în urmă
părinte
comite
e29cf08afa

+ 2 - 2
assets/resources/ui/car_info.prefab

@@ -146,7 +146,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -1222,7 +1222,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920.0000000000002
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 778 - 0
assets/resources/ui/mailbox_reward_item.prefab

@@ -0,0 +1,778 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "mailbox_reward_item",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "persistent": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "mailbox_reward_item",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      },
+      {
+        "__id__": 20
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 26
+      },
+      {
+        "__id__": 28
+      },
+      {
+        "__id__": 30
+      }
+    ],
+    "_prefab": {
+      "__id__": 32
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "icon_bg",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 9
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 15
+      },
+      {
+        "__id__": 17
+      }
+    ],
+    "_prefab": {
+      "__id__": 19
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 26,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "img_icon",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 2
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 4
+      },
+      {
+        "__id__": 6
+      }
+    ],
+    "_prefab": {
+      "__id__": 8
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 3
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 5
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 160,
+      "height": 160
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "b6uZcuzf5HlYK/bIiJttWo"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 3
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 7
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": null,
+    "_type": 1,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "376Konh/JHWKRCEvuMACq/"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "05zO619n5M9JqnT9oWtlGU",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "lab_count",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 2
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 10
+      },
+      {
+        "__id__": 12
+      }
+    ],
+    "_prefab": {
+      "__id__": 14
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 44,
+      "y": -54.66399999999999,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 9
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 11
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 80,
+      "height": 50
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "11LgPflAlAF6azbgyOl9qv"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 9
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 13
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_string": "",
+    "_horizontalAlign": 2,
+    "_verticalAlign": 1,
+    "_actualFontSize": 40,
+    "_fontSize": 40,
+    "_fontFamily": "Arial",
+    "_lineHeight": 40,
+    "_overflow": 1,
+    "_enableWrapText": false,
+    "_font": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_isItalic": false,
+    "_isBold": false,
+    "_isUnderline": false,
+    "_underlineHeight": 2,
+    "_cacheMode": 0,
+    "_enableOutline": true,
+    "_outlineColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_outlineWidth": 1,
+    "_enableShadow": true,
+    "_shadowColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_shadowOffset": {
+      "__type__": "cc.Vec2",
+      "x": 1,
+      "y": 1
+    },
+    "_shadowBlur": 2,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "58V4LYmVdKvbMSkOhAy+md"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "daJQnk2KBBkp5zv9cOxdOg",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 16
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 252,
+      "height": 253
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "0cvtO0arNA0Je11DxDtFkb"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 18
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "9c00cbe1-949d-4b31-b8bd-6ed9bbc2ba40@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 1,
+    "_fillType": 0,
+    "_sizeMode": 1,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "63LTdqsq1AbZ0ml37dBvIs"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "d486XZxGdOwppzHrO2spfN",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "lab_name",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 21
+      },
+      {
+        "__id__": 23
+      }
+    ],
+    "_prefab": {
+      "__id__": 25
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": -98,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 20
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 22
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 240,
+      "height": 40.32
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "14bxIIuPRNs4ecT8oj3uKj"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 20
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 24
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 32,
+      "g": 76,
+      "b": 128,
+      "a": 255
+    },
+    "_string": "S1碎片",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 32,
+    "_fontSize": 32,
+    "_fontFamily": "Arial",
+    "_lineHeight": 32,
+    "_overflow": 1,
+    "_enableWrapText": false,
+    "_font": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_isItalic": false,
+    "_isBold": true,
+    "_isUnderline": false,
+    "_underlineHeight": 2,
+    "_cacheMode": 0,
+    "_enableOutline": false,
+    "_outlineColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_outlineWidth": 2,
+    "_enableShadow": false,
+    "_shadowColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_shadowOffset": {
+      "__type__": "cc.Vec2",
+      "x": 2,
+      "y": 2
+    },
+    "_shadowBlur": 2,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "ffwxpMDBRFyq9KTGr5Gf58"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "c5vNVSbo1BrbPSye1pxXmA",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 27
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 252,
+      "height": 252
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "488mFWnIJFDJIt2W5G+Vnl"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": false,
+    "__prefab": {
+      "__id__": 29
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "b730527c-3233-41c2-aaf7-7cdab58f9749@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 1,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "e4YVLguMRDV7ovUVRbYbbm"
+  },
+  {
+    "__type__": "40bc2lLDJZOeKC90AmXTlgD",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 31
+    },
+    "img_icon": {
+      "__id__": 3
+    },
+    "lab_count": {
+      "__id__": 9
+    },
+    "lab_name": {
+      "__id__": 20
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "d6efIpRG9JOrT3Q5quRVpM"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "c46/YsCPVOJYA4mWEpNYRx",
+    "instance": null,
+    "targetOverrides": null
+  }
+]

+ 13 - 0
assets/resources/ui/mailbox_reward_item.prefab.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "1.1.50",
+  "importer": "prefab",
+  "imported": true,
+  "uuid": "588f8760-e0c1-4634-8402-9980761a27b6",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {
+    "syncNodeName": "mailbox_reward_item"
+  }
+}

Fișier diff suprimat deoarece este prea mare
+ 304 - 448
assets/resources/ui/mailbox_view.prefab


+ 4 - 0
assets/script/manager/uiManager.ts

@@ -63,6 +63,10 @@ export class uiManager  {
         SdkUtil.showToast(title, duration,success_cb,fail_cb)
     }
 
+    public static showModal(title:string, content:string, suc_cb=null, fail_cb=null, confirmText:string='确定', showCancel:boolean=true, cancelText:string='取消') {
+        SdkUtil.showModal(title,content,suc_cb,fail_cb,confirmText,showCancel,cancelText)
+    }
+
     public showSendMsgWait(){
         if(this.send_msg_view!=null){
             this.send_msg_view.active = true

+ 4 - 1
assets/script/sdkUtil.ts

@@ -271,7 +271,10 @@ export class SdkUtil {
                     fail(err) { if(fail_cb){ fail_cb(err) } },
                 });
             }
-
+        } else {
+            if(suc_cb) { 
+                suc_cb({'confirm':true}) 
+            }
         }
     }
     

+ 21 - 2
assets/script/ui/bag/bag_list_page.ts

@@ -1,5 +1,5 @@
 import { _decorator, Component, instantiate, Layout, Node, Prefab, UITransform } from 'cc';
-import { bag_list_item_data } from '../../data';
+import { bag_list_item_data, bag_type } from '../../data';
 import { bag_list_page_item } from './bag_list_page_item';
 const { ccclass, property } = _decorator;
 
@@ -7,6 +7,7 @@ const { ccclass, property } = _decorator;
 export class bag_list_page extends Component {
     @property(Node) bg:Node = null
     @property(Prefab) page_item:Prefab = null
+    private cur_xiangkuang_item:bag_list_page_item = null
     start() {
         let fixed_count = 4
         let item = instantiate(this.page_item)
@@ -26,7 +27,25 @@ export class bag_list_page extends Component {
     }
 
     private onClickItem(item:bag_list_page_item) {
-        item.setSelected()
+        let data = item.getData()
+        switch (data.stype) {
+            case bag_type.car_suipian:
+                break;
+            case bag_type.xiangkuang:
+                if(this.cur_xiangkuang_item!=null) {
+                    if(this.cur_xiangkuang_item.getData().id==data.id) {
+                        return
+                    }
+                    this.cur_xiangkuang_item.setUnselected()
+                }
+                item.setSelected()
+                this.cur_xiangkuang_item = item
+                break;
+            case bag_type.daoju:
+                break;
+            default:
+                break;
+        }
     }
 }
 

+ 1 - 5
assets/script/ui/bag/bag_list_page_item.ts

@@ -31,11 +31,7 @@ export class bag_list_page_item extends base_ui {
             this.img_icon.getComponent(Sprite).spriteFrame = r.sf
         })
         this.lab_name.getComponent(Label).string = data.name
-        if(data.quantity>0) {
-            this.lab_count.getComponent(Label).string = data.quantity + '' 
-        } else {
-            this.lab_count.getComponent(Label).string = '' 
-        }
+        this.lab_count.getComponent(Label).string = data.quantity + '' 
     }
 
     public setSelected() {

+ 5 - 1
assets/script/ui/car_lib/car_lib_list_item.ts

@@ -31,7 +31,11 @@ export class car_lib_list_item extends Component {
         this.m_cb = cb
         this.img_car.getComponent(Sprite).spriteFrame = dataManager.getUserRankCarSf(data.id, -1)
         this.lab_car_name.getComponent(Label).string = data.name
-        this.lab_car_score.getComponent(Label).string = data.unlock_points + '分'
+        if(data.stype==0) {
+            this.lab_car_score.getComponent(Label).string = data.unlock_points + '分'
+        } else {
+            this.lab_car_score.getComponent(Label).string = data.unlock_points + '碎片'
+        }
     }
 
     public getData():car_item_data{

+ 2 - 3
assets/script/ui/home/home_top.ts

@@ -21,12 +21,11 @@ export class home_top extends Component {
     @property(Node) guangbo:Node = null
     protected start(): void {
         uiManager.Instance().onButtonListen(this.btn_gong_gao,()=>{
-            uiManager.Instance().showUi(config.UI.ui_announcement)
+            // uiManager.Instance().showUi(config.UI.ui_announcement)
+            uiManager.Instance().showUi(config.UI.bag)
         })
         uiManager.Instance().onButtonListen(this.btn_setting,()=>{
             uiManager.Instance().showUi(config.UI.ui_setting)
-            // uiManager.Instance().showUi(config.UI.ui_mailbox_view)
-            // uiManager.Instance().showUi(config.UI.bag)
         })
         uiManager.Instance().onButtonListen(this.btn_car_lib, ()=>{
             this.node.parent.active = false

+ 63 - 0
assets/script/ui/mailbox_view/mailbox_details.ts

@@ -0,0 +1,63 @@
+import { _decorator, Component, instantiate, Label, Node, Prefab } from 'cc';
+import { base_ui } from '../../fw/base_ui';
+import { mail_item_data } from '../../data';
+import { mailbox_reward_item } from './mailbox_reward_item';
+const { ccclass, property } = _decorator;
+
+@ccclass('mailbox_details')
+export class mailbox_details extends base_ui {
+    @property(Node) public_bg:Node = null
+    @property(Node) lab_content:Node = null
+    @property(Node) lab_time:Node = null
+    @property(Node) reward_content:Node = null
+    @property(Prefab) reward_item:Prefab = null
+    @property(Node) btn_delete:Node = null
+    @property(Node) btn_recv:Node = null
+    private m_data:mail_item_data = null
+    private m_delete_cb = null
+    private m_recv_cb = null
+    start() {
+        this.onButtonListen(this.public_bg, ()=>{
+            this.node.active = false
+        })
+        this.onButtonListen(this.btn_delete, ()=>{
+            if(this.m_delete_cb) {
+                this.m_delete_cb(this)
+            }
+        })
+        this.onButtonListen(this.btn_recv, ()=>{
+            if(this.m_recv_cb) {
+                this.m_recv_cb(this)
+            }
+        })
+    }
+
+    initView(data:mail_item_data, delete_cb, recv_cb) {
+        this.m_data = data
+        this.m_delete_cb = delete_cb
+        this.m_recv_cb = recv_cb
+        this.lab_content.getComponent(Label).string = '    ' + data.content
+
+        this.btn_delete.active = false
+        this.btn_recv.active = false
+        if(data.state==1) {
+            this.btn_delete.active = true
+        } else {
+            this.btn_recv.active = true
+        }
+
+        this.reward_content.removeAllChildren()
+        // console.log('rewards_list=',data.rewards_list)
+        for (let index = 0; index < data.rewards_list.length; index++) {
+            const element = data.rewards_list[index];
+            let item = instantiate(this.reward_item)
+            item.parent = this.reward_content
+            item.getComponent(mailbox_reward_item).initView(element)
+        }
+    }
+
+    public getData():mail_item_data {
+        return this.m_data
+    }
+}
+

+ 9 - 0
assets/script/ui/mailbox_view/mailbox_details.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "37340f59-9a34-41b4-bd56-c54caed8b49f",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 5 - 1
assets/script/ui/mailbox_view/mailbox_read_item.ts

@@ -26,8 +26,12 @@ export class mailbox_read_item extends base_ui {
     }
 
     initView(data:mail_item_data, click_cb) {
-        this.m_data = data
+        this.setData(data)
         this.m_click_cb = click_cb
+    }
+
+    public setData(data:mail_item_data) {
+        this.m_data = data
         this.lab_title.getComponent(Label).string = this.m_data.title
         this.lab_time.getComponent(Label).string = this.m_data.create_at
         if(this.m_data.state==1) {

+ 27 - 0
assets/script/ui/mailbox_view/mailbox_reward_item.ts

@@ -0,0 +1,27 @@
+import { _decorator, Component, Label, Node, Sprite } from 'cc';
+import { mail_rewards_item_data } from '../../data';
+import { tools } from '../../tools';
+const { ccclass, property } = _decorator;
+
+@ccclass('mailbox_reward_item')
+export class mailbox_reward_item extends Component {
+    @property(Node) img_icon:Node = null
+    @property(Node) lab_count:Node = null
+    @property(Node) lab_name:Node = null
+
+    private m_data:mail_rewards_item_data = null
+    
+    initView(data:mail_rewards_item_data) {
+        this.m_data = data
+        tools.loadRemoteImg(data.icon, (d)=>{
+            this.img_icon.getComponent(Sprite).spriteFrame = d.sf
+        })
+        this.lab_count.getComponent(Label).string = data.quantity + ''
+        this.lab_name.getComponent(Label).string = data.name
+    }
+
+    public getData():mail_rewards_item_data {
+        return this.m_data
+    }
+}
+

+ 9 - 0
assets/script/ui/mailbox_view/mailbox_reward_item.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "40bc294b-0c96-4e78-a0bd-d009974e5803",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 83 - 28
assets/script/ui/mailbox_view/mailbox_view.ts

@@ -4,16 +4,16 @@ import { mailbox_read_item } from './mailbox_read_item';
 import { http } from '../../http';
 import { config } from '../../config';
 import { mail_item_data } from '../../data';
+import { uiManager } from '../../manager/uiManager';
+import { mailbox_details } from './mailbox_details';
 const { ccclass, property } = _decorator;
 
 @ccclass('mailbox_view')
 export class mailbox_view extends base_ui {
-    @property(Node) bg:Node = null
+    @property(Node) btn_back:Node = null
 
-    @property(Node) list_bg:Node = null
     @property(Node) img_empty:Node = null
     @property(Node) content_bg:Node = null
-    @property(Node) scrollView:Node = null
     @property(Node) content:Node = null
     @property(Prefab) read_item:Prefab = null
     @property(Node) btn_delete_read:Node = null
@@ -25,85 +25,140 @@ export class mailbox_view extends base_ui {
     private page:number = 1
     private limit:number = 15
     start() {
-        this.onButtonListen(this.bg, ()=>{
-            if(this.details_bg.active==true) {
-                this.list_bg.active = true
-                this.details_bg.active = false
-                return
-            }
+        this.onButtonListen(this.btn_back, ()=>{
             this.close()
         })
         this.onButtonListen(this.btn_delete_read, ()=>{
-            this.requestDelete(1,0)
+            uiManager.showModal('删除已读?', '', (res)=>{
+                if(res.confirm) {
+                    this.requestDelete(1,0, ()=>{
+                        this.requestListData(()=>{
+                            uiManager.showToast('删除成功')
+                        })
+                    })
+                }
+            })
         })
         this.onButtonListen(this.btn_get_all, ()=>{
-            this.requestRetrieve(1,0)
+            uiManager.showModal('全部领取?', '', (res)=>{
+                if(res.confirm) {
+                    this.requestRetrieve(1,0,()=>{
+                        this.requestListData(()=>{
+                            uiManager.showToast('领取成功')
+                        })
+                    })
+                }
+            })
         })
 
         this.requestListData()
     }
 
-    private requestListData() {
-        this.content_bg.active = true
-        this.img_empty.active = true
+    private showEmpty(show:boolean) {
+        if(show) {
+            this.content_bg.active = false
+            this.img_empty.active = true
+        } else {
+            this.content_bg.active = true
+            this.img_empty.active = false
+        }
+    }
 
+    private requestListData(suc_cb=null) {
         let opt = {'page':this.page, 'limit':this.limit}
         http.post(config.API.mail_lists,opt, (err,d)=>{
             if(!err){
                 let nd = JSON.parse(d)
                 if(nd.code === config.status.SUCCESS){
                     // console.log("mail data", nd.content)
+                    this.data_list = []
+                    this.content.removeAllChildren()
                     this.data_list = this.data_list.concat(nd.content)
                     if(this.data_list.length > 0) {
-                        this.content_bg.active = true
-                        this.img_empty.active = false
+                        this.showEmpty(false)
                         for (let index = 0; index < this.data_list.length; index++) {
                             const element = this.data_list[index];
                             let item = instantiate(this.read_item)
                             item.parent = this.content
                             item.getComponent(mailbox_read_item).initView(element,this.onClickItem.bind(this))
                         }
-
                     } else {
-                        this.content_bg.active = false
-                        this.img_empty.active = true
+                        this.showEmpty(true)
                     }
-                }   
+                }
+                suc_cb && suc_cb()
             }
         })
     }
 
     private onClickItem(item:mailbox_read_item) {
-        if(item.getData().state==1) {
-            return
-        }
-
-        this.list_bg.active = false
         this.details_bg.active = true
+        this.details_bg.getComponent(mailbox_details).initView(item.getData(), 
+        (v:mailbox_details)=>{
+            uiManager.showModal('删除已读?', '', (res)=>{
+                if(res.confirm) {
+                    this.details_bg.active = false
+                    this.requestDelete(0,v.getData().id, ()=>{
+                        this.deleteDataLocalHandle(item)
+                    })
+                }
+            })
+        }, (v:mailbox_details)=>{
+            this.details_bg.active = false
+            let data = v.getData()
+            if(data.state==0) {
+                this.requestRetrieve(0,v.getData().id, ()=>{
+                    data.state = 1
+                    item.setData(data)
+                })
+            }
+        })
     }
 
     // 领取邮件 stype 0:普通领取 1:一键领取
-    private requestRetrieve(stype:number, id:number) {
+    private requestRetrieve(stype:number, id:number, success_cb) {
         let opt = {'stype':stype, 'id':id}
+        uiManager.Instance().showLoading('正在领取...')
         http.post(config.API.mail_retrieve,opt,  (err,d)=>{
+            uiManager.Instance().hideLoading()
             if(!err){
                 let nd = JSON.parse(d)
                 if(nd.code === config.status.SUCCESS){
+                    success_cb && success_cb()
                 }
             }
         })
     }
 
     // 删除邮件 stype 0:普通删除 1:一键删除
-    private requestDelete(stype:number, id:number) {
+    private requestDelete(stype:number, id:number, success_cb) {
         let opt = {'stype':stype, 'id':id}
-        http.post(config.API.mail_retrieve,opt,  (err,d)=>{
+        uiManager.Instance().showLoading('正在删除...')
+        http.post(config.API.mail_del,opt,  (err,d)=>{
+            uiManager.Instance().hideLoading()
             if(!err){
                 let nd = JSON.parse(d)
                 if(nd.code === config.status.SUCCESS){
+                    success_cb && success_cb()
                 }
             }
         })
     }
+
+    private deleteDataLocalHandle(item:mailbox_read_item) {
+        if(item.node.isChildOf(this.content)) {
+            this.content.removeChild(item.node)
+            for (let index = 0; index < this.data_list.length; index++) {
+                const element = this.data_list[index];
+                if(element.id==item.getData().id) {
+                    this.data_list.splice(index,1)
+                    break
+                }
+            }
+            if(this.data_list.length<=0) {
+                this.showEmpty(true)
+            }
+        }
+    }
 }
 

BIN
assets/texture/ui/bag/bag_list_item_bg.png


+ 134 - 0
assets/texture/ui/bag/bag_list_item_bg.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.26",
+  "importer": "image",
+  "imported": true,
+  "uuid": "9c00cbe1-949d-4b31-b8bd-6ed9bbc2ba40",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "9c00cbe1-949d-4b31-b8bd-6ed9bbc2ba40@6c48a",
+      "displayName": "bag_list_item_bg",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "9c00cbe1-949d-4b31-b8bd-6ed9bbc2ba40",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "9c00cbe1-949d-4b31-b8bd-6ed9bbc2ba40@f9941",
+      "displayName": "bag_list_item_bg",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimType": "custom",
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 0,
+        "trimY": 0,
+        "width": 252,
+        "height": 253,
+        "rawWidth": 252,
+        "rawHeight": 253,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -126,
+            -126.5,
+            0,
+            126,
+            -126.5,
+            0,
+            -126,
+            126.5,
+            0,
+            126,
+            126.5,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            253,
+            252,
+            253,
+            0,
+            0,
+            252,
+            0
+          ],
+          "nuv": [
+            0,
+            0,
+            1,
+            0,
+            0,
+            1,
+            1,
+            1
+          ],
+          "minPos": [
+            -126,
+            -126.5,
+            0
+          ],
+          "maxPos": [
+            126,
+            126.5,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "9c00cbe1-949d-4b31-b8bd-6ed9bbc2ba40@6c48a",
+        "atlasUuid": ""
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "9c00cbe1-949d-4b31-b8bd-6ed9bbc2ba40@f9941"
+  }
+}

BIN
assets/texture/ui/mailbox_view/mailbox_bg.png


+ 27 - 27
assets/texture/ui/public/public_popup_bg_2.png.meta → assets/texture/ui/mailbox_view/mailbox_bg.png.meta

@@ -11,7 +11,7 @@
     "6c48a": {
       "importer": "texture",
       "uuid": "987286ff-9a5d-4ca5-9e8a-198c4e16c433@6c48a",
-      "displayName": "public_popup_bg_2",
+      "displayName": "mailbox_bg",
       "id": "6c48a",
       "name": "texture",
       "userData": {
@@ -35,7 +35,7 @@
     "f9941": {
       "importer": "sprite-frame",
       "uuid": "987286ff-9a5d-4ca5-9e8a-198c4e16c433@f9941",
-      "displayName": "public_popup_bg_2",
+      "displayName": "mailbox_bg",
       "id": "f9941",
       "name": "spriteFrame",
       "userData": {
@@ -43,13 +43,13 @@
         "trimThreshold": 1,
         "rotated": false,
         "offsetX": 0,
-        "offsetY": -1,
+        "offsetY": 0,
         "trimX": 0,
-        "trimY": 2,
-        "width": 980,
-        "height": 1585,
-        "rawWidth": 980,
-        "rawHeight": 1587,
+        "trimY": 0,
+        "width": 1080,
+        "height": 1920,
+        "rawWidth": 1080,
+        "rawHeight": 1920,
         "borderTop": 0,
         "borderBottom": 0,
         "borderLeft": 0,
@@ -61,17 +61,17 @@
         "meshType": 0,
         "vertices": {
           "rawPosition": [
-            -490,
-            -792.5,
+            -540,
+            -960,
             0,
-            490,
-            -792.5,
+            540,
+            -960,
             0,
-            -490,
-            792.5,
+            -540,
+            960,
             0,
-            490,
-            792.5,
+            540,
+            960,
             0
           ],
           "indexes": [
@@ -84,12 +84,12 @@
           ],
           "uv": [
             0,
-            1585,
-            980,
-            1585,
+            1920,
+            1080,
+            1920,
             0,
             0,
-            980,
+            1080,
             0
           ],
           "nuv": [
@@ -98,18 +98,18 @@
             1,
             0,
             0,
-            0.9987397605545053,
             1,
-            0.9987397605545053
+            1,
+            1
           ],
           "minPos": [
-            -490,
-            -792.5,
+            -540,
+            -960,
             0
           ],
           "maxPos": [
-            490,
-            792.5,
+            540,
+            960,
             0
           ]
         },
@@ -127,7 +127,7 @@
   },
   "userData": {
     "type": "sprite-frame",
-    "hasAlpha": true,
+    "hasAlpha": false,
     "fixAlphaTransparencyArtifacts": false,
     "redirect": "987286ff-9a5d-4ca5-9e8a-198c4e16c433@f9941"
   }

BIN
assets/texture/ui/mailbox_view/mailbox_info.png


+ 134 - 0
assets/texture/ui/mailbox_view/mailbox_info.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.26",
+  "importer": "image",
+  "imported": true,
+  "uuid": "efe3c9f4-d2a4-47f9-81f9-0929ad0befdc",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "efe3c9f4-d2a4-47f9-81f9-0929ad0befdc@6c48a",
+      "displayName": "mailbox_info",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "efe3c9f4-d2a4-47f9-81f9-0929ad0befdc",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "efe3c9f4-d2a4-47f9-81f9-0929ad0befdc@f9941",
+      "displayName": "mailbox_info",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimType": "auto",
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 2,
+        "trimY": 2,
+        "width": 1011,
+        "height": 1608,
+        "rawWidth": 1015,
+        "rawHeight": 1612,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -505.5,
+            -804,
+            0,
+            505.5,
+            -804,
+            0,
+            -505.5,
+            804,
+            0,
+            505.5,
+            804,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            2,
+            1610,
+            1013,
+            1610,
+            2,
+            2,
+            1013,
+            2
+          ],
+          "nuv": [
+            0.0019704433497536944,
+            0.0012406947890818859,
+            0.9980295566502463,
+            0.0012406947890818859,
+            0.0019704433497536944,
+            0.9987593052109182,
+            0.9980295566502463,
+            0.9987593052109182
+          ],
+          "minPos": [
+            -505.5,
+            -804,
+            0
+          ],
+          "maxPos": [
+            505.5,
+            804,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "efe3c9f4-d2a4-47f9-81f9-0929ad0befdc@6c48a",
+        "atlasUuid": ""
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "efe3c9f4-d2a4-47f9-81f9-0929ad0befdc@f9941"
+  }
+}

BIN
assets/texture/ui/mailbox_view/mailbox_top.png


+ 134 - 0
assets/texture/ui/mailbox_view/mailbox_top.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.26",
+  "importer": "image",
+  "imported": true,
+  "uuid": "b5ef4111-cad4-4a1c-859c-20cba014f8c6",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "b5ef4111-cad4-4a1c-859c-20cba014f8c6@6c48a",
+      "displayName": "mailbox_top",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "b5ef4111-cad4-4a1c-859c-20cba014f8c6",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "b5ef4111-cad4-4a1c-859c-20cba014f8c6@f9941",
+      "displayName": "mailbox_top",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimType": "auto",
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 6,
+        "trimY": 0,
+        "width": 612,
+        "height": 175,
+        "rawWidth": 624,
+        "rawHeight": 175,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -306,
+            -87.5,
+            0,
+            306,
+            -87.5,
+            0,
+            -306,
+            87.5,
+            0,
+            306,
+            87.5,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            6,
+            175,
+            618,
+            175,
+            6,
+            0,
+            618,
+            0
+          ],
+          "nuv": [
+            0.009615384615384616,
+            0,
+            0.9903846153846154,
+            0,
+            0.009615384615384616,
+            1,
+            0.9903846153846154,
+            1
+          ],
+          "minPos": [
+            -306,
+            -87.5,
+            0
+          ],
+          "maxPos": [
+            306,
+            87.5,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "b5ef4111-cad4-4a1c-859c-20cba014f8c6@6c48a",
+        "atlasUuid": ""
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "b5ef4111-cad4-4a1c-859c-20cba014f8c6@f9941"
+  }
+}

BIN
assets/texture/ui/public/public_popup_bg_2.png


Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff