Browse Source

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

xx 1 year ago
parent
commit
48d82a17c2

File diff suppressed because it is too large
+ 1290 - 137
assets/resources/ui/feedback.prefab


+ 105 - 106
assets/resources/ui/home.prefab

@@ -3325,6 +3325,9 @@
     "_children": [
     "_children": [
       {
       {
         "__id__": 140
         "__id__": 140
+      },
+      {
+        "__id__": 146
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
@@ -3379,27 +3382,23 @@
     "_parent": {
     "_parent": {
       "__id__": 139
       "__id__": 139
     },
     },
-    "_children": [
-      {
-        "__id__": 141
-      }
-    ],
+    "_children": [],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 147
+        "__id__": 141
       },
       },
       {
       {
-        "__id__": 149
+        "__id__": 143
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 151
+      "__id__": 145
     },
     },
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
-      "x": 0,
-      "y": -45,
+      "x": -1,
+      "y": -27.5,
       "z": 0
       "z": 0
     },
     },
     "_lrot": {
     "_lrot": {
@@ -3425,31 +3424,117 @@
     },
     },
     "_id": ""
     "_id": ""
   },
   },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 140
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 142
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 903,
+      "height": 99
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "6eDvgkJwRH3pBufh8JvsUR"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 140
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 144
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "04062ca5-8e94-4619-896c-ea14dd4298d8@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 0,
+    "_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": "b4CyNbWT9PcJKmC/hPjAEI"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "berv92Oi1IOpZBwOPzAuea",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
   {
   {
     "__type__": "cc.Node",
     "__type__": "cc.Node",
     "_name": "lab_content",
     "_name": "lab_content",
     "_objFlags": 0,
     "_objFlags": 0,
     "__editorExtras__": {},
     "__editorExtras__": {},
     "_parent": {
     "_parent": {
-      "__id__": 140
+      "__id__": 139
     },
     },
     "_children": [],
     "_children": [],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 142
+        "__id__": 147
       },
       },
       {
       {
-        "__id__": 144
+        "__id__": 149
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 146
+      "__id__": 151
     },
     },
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
       "x": 540,
       "x": 540,
-      "y": 0,
+      "y": -27,
       "z": 0
       "z": 0
     },
     },
     "_lrot": {
     "_lrot": {
@@ -3481,11 +3566,11 @@
     "_objFlags": 0,
     "_objFlags": 0,
     "__editorExtras__": {},
     "__editorExtras__": {},
     "node": {
     "node": {
-      "__id__": 141
+      "__id__": 146
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 143
+      "__id__": 148
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
@@ -3509,11 +3594,11 @@
     "_objFlags": 0,
     "_objFlags": 0,
     "__editorExtras__": {},
     "__editorExtras__": {},
     "node": {
     "node": {
-      "__id__": 141
+      "__id__": 146
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 145
+      "__id__": 150
     },
     },
     "_customMaterial": null,
     "_customMaterial": null,
     "_srcBlendFactor": 2,
     "_srcBlendFactor": 2,
@@ -3584,92 +3669,6 @@
     "targetOverrides": null,
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
     "nestedPrefabInstanceRoots": null
   },
   },
-  {
-    "__type__": "cc.UITransform",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 140
-    },
-    "_enabled": true,
-    "__prefab": {
-      "__id__": 148
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 1079,
-      "height": 58
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_id": ""
-  },
-  {
-    "__type__": "cc.CompPrefabInfo",
-    "fileId": "6eDvgkJwRH3pBufh8JvsUR"
-  },
-  {
-    "__type__": "cc.Sprite",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 140
-    },
-    "_enabled": true,
-    "__prefab": {
-      "__id__": 150
-    },
-    "_customMaterial": null,
-    "_srcBlendFactor": 2,
-    "_dstBlendFactor": 4,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_spriteFrame": {
-      "__uuid__": "04062ca5-8e94-4619-896c-ea14dd4298d8@f9941",
-      "__expectedType__": "cc.SpriteFrame"
-    },
-    "_type": 0,
-    "_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": "b4CyNbWT9PcJKmC/hPjAEI"
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__id__": 0
-    },
-    "fileId": "berv92Oi1IOpZBwOPzAuea",
-    "instance": null,
-    "targetOverrides": null,
-    "nestedPrefabInstanceRoots": null
-  },
   {
   {
     "__type__": "cc.UITransform",
     "__type__": "cc.UITransform",
     "_name": "",
     "_name": "",
@@ -3747,7 +3746,7 @@
       "__id__": 157
       "__id__": 157
     },
     },
     "lab_content": {
     "lab_content": {
-      "__id__": 141
+      "__id__": 146
     },
     },
     "_id": ""
     "_id": ""
   },
   },

+ 2 - 0
assets/script/config.ts

@@ -17,6 +17,8 @@ export class config  {
         user_set_region: "/snake/user/set_region",
         user_set_region: "/snake/user/set_region",
         user_set_default_car_id: "/snake/user/set_default_car_id",
         user_set_default_car_id: "/snake/user/set_default_car_id",
         unlock_number_status: "/snake/user/unlock_number_status",
         unlock_number_status: "/snake/user/unlock_number_status",
+        feedback: "/snake/user/feedback",
+        up_feedback_img: "/tool/file/up_feedback_img",   
     }
     }
 
 
 
 

+ 1 - 0
assets/script/data.ts

@@ -65,6 +65,7 @@ export class rankData{
     public score:number = 0 //最大积分
     public score:number = 0 //最大积分
     public number:number = 0 //排名 0 没有分数和排名
     public number:number = 0 //排名 0 没有分数和排名
     public ranking_desc:string = "" //	排名描述
     public ranking_desc:string = "" //	排名描述
+    public user_id:number = 0 // 用户id
     public avatarUrl:string = "" //	头像
     public avatarUrl:string = "" //	头像
     public nickName:string = "" //昵称
     public nickName:string = "" //昵称
     public license_code:string = "" //车牌号
     public license_code:string = "" //车牌号

+ 79 - 4
assets/script/http.ts

@@ -1,15 +1,16 @@
-import { _decorator, Component, Node, sys } from 'cc';
+import { _decorator, Component, Node, sys, url } from 'cc';
 import { config } from './config';
 import { config } from './config';
 import { tools } from './tools';
 import { tools } from './tools';
 import { userDataManager } from './manager/userDataManager';
 import { userDataManager } from './manager/userDataManager';
 const { ccclass, property } = _decorator;
 const { ccclass, property } = _decorator;
 @ccclass('http')
 @ccclass('http')
 export class http {
 export class http {
+    public static domain = "https://zcapi.xwrun.com"
     public static static_domain =  "https://zcapi.xwrun.com"
     public static static_domain =  "https://zcapi.xwrun.com"
     public static statistics_domain =  "https://zcapi.xwrun.com"
     public static statistics_domain =  "https://zcapi.xwrun.com"
     public static post(url,opt, call_back,method:string='POST') {
     public static post(url,opt, call_back,method:string='POST') {
         var xml = new XMLHttpRequest()
         var xml = new XMLHttpRequest()
-        let request_url = http.static_domain+url
+        let request_url = http.domain+url
         xml.open(method,  request_url)
         xml.open(method,  request_url)
         xml.setRequestHeader('Content-Type', 'application/json');
         xml.setRequestHeader('Content-Type', 'application/json');
         if(userDataManager.user_data!=null){
         if(userDataManager.user_data!=null){
@@ -83,9 +84,83 @@ export class http {
         };
         };
     }
     }
 
 
-   
+    public static uploadFile(url, filePath, progress_call_back, call_back) {
+        if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
+            let task = tt.uploadFile({
+                url: http.domain + url,
+                filePath: filePath,
+                name: "file",
+                success(res) {
+                    if (res.statusCode === 200) {
+                        // console.log(`uploadFile调用成功 ${res.data}`);
+                        call_back(null,res.data)
+                    } else {
+                        call_back(res.statusCode,null)
+                    }
+                },
+                fail(err) {
+                    console.log(`uploadFile调用失败`,err);
+                    call_back(err,null)
+                },
+            });
+              
+            task.onProgressUpdate((res) => {
+                // console.log('res.progress=',res.progress)
+                if(progress_call_back) {
+                    progress_call_back(res.progress)
+                }
+            }); 
+
+            return
+        }
+
+        var xml = new XMLHttpRequest()
+        let request_url = http.domain+url
+        console.log('request_url=',request_url)
+        xml.open('POST', request_url, true)
+        xml.setRequestHeader('Content-Type', 'multipart/form-data');
+        if(userDataManager.user_data!=null){
+            xml.setRequestHeader('token',userDataManager.user_data.token);
+        }
+
+        //创建一个FormData对象来处理文件上传
+        let formData = new FormData()
+        formData.append("file", filePath)
+        //发送请求
+        xml.send(formData)
 
 
-   
+        // 监听上传进度事件
+        xml.upload.onprogress = function(event) {
+            if (event.lengthComputable) {
+                var percentComplete = (event.loaded / event.total) * 100;
+                console.log(Math.round(percentComplete) + "% uploaded");
+            }
+        };
+
+        // 监听请求完成事件
+        xml.onload = function() {
+            if (xml.status === 200) {
+                console.log("File uploaded successfully");
+            } else {
+                console.log("Upload failed with status: " + xml.status);
+            }
+        }
+
+        // 监听错误事件
+        xml.onerror = function() {
+            console.log("Network error occurred");
+        };
+
+        // Special event
+        xml.onreadystatechange = function () {
+            console.log('xml.readyState=',xml.readyState,'       xml.status=',xml.status)
+            if (xml.readyState === 4 && xml.status >= 200) {
+                call_back(null, xml.responseText);
+            } else if (xml.status === 404) {
+                call_back('404 page not found!', null);
+            }
+        }
+    }
 
 
 }
 }
 
 

+ 75 - 70
assets/script/sdkUtil.ts

@@ -39,24 +39,6 @@ export class SdkUtil {
         })
         })
     }
     }
 
 
-    // 苹果手机是否有灵动岛
-    public static iPhoneIsLingdongdao():boolean {
-        if(sys.platform==sys.Platform.BYTEDANCE_MINI_GAME) {
-            if(SdkUtil.tt_systemInfo !=null) {
-                if(SdkUtil.tt_systemInfo.brand=='Apple'||SdkUtil.tt_systemInfo.brand=='devtools')
-                if(SdkUtil.tt_systemInfo.model=='iPhone 14'||
-                   SdkUtil.tt_systemInfo.model=='iPhone 14 Pro'||
-                   SdkUtil.tt_systemInfo.model=='iPhone 14 Pro Max'||
-                   SdkUtil.tt_systemInfo.model=='iPhone 15'||
-                   SdkUtil.tt_systemInfo.model=='iPhone 15 Pro'||
-                   SdkUtil.tt_systemInfo.model=='iPhone 15 Pro Max') {
-                    return true
-                }
-            }
-        }
-        return false
-    }
-
     // 自定义事件统计
     // 自定义事件统计
     public static customEventStatistics(eventType: string, objParams?: any) {
     public static customEventStatistics(eventType: string, objParams?: any) {
         eventType = eventType.toString();
         eventType = eventType.toString();
@@ -76,6 +58,81 @@ export class SdkUtil {
             window.cocosAnalytics.CACustomEvent.onStarted(eventType, objParams);
             window.cocosAnalytics.CACustomEvent.onStarted(eventType, objParams);
         }
         }
     }
     }
+    
+    // 登录
+    public static login(call){
+        if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
+            tt.login({
+                force: true,
+                success(res) {
+                  console.log(`login 调用成功${res.code} ${res.anonymousCode}`);
+                  call({"code":res.code,"anonymousCode":res.anonymousCode})
+                },
+                fail(res) {
+                  console.log(`login 调用失败`);
+                  call(null)
+                },
+              });
+              
+        }else{
+            call(null)
+        }
+    }
+
+    // 获取用户信息
+    public static getUserInfo(call){
+        if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
+            tt.getUserInfo({
+                // withCredentials: true,
+                // withRealNameAuthenticationInfo: true,
+                success(res) {
+                  console.log(`getUserInfo 调用成功`, res.userInfo);
+                  call(res.userInfo)
+                },
+                fail(res) {
+                  console.log(`getUserInfo 调用失败`, res.errMsg);
+                },
+              });
+        }else{
+            call(null)
+        }
+    }
+
+    // 震动
+    public static vibrateShort(){
+        if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
+            tt.vibrateShort({
+                success(res) {
+                //   console.log(`${res}`);
+                },
+                fail(res) {
+                //   console.log(`vibrateShort调用失败`);
+                },
+              });
+        }
+          
+    }
+
+    // 选择系统相册
+    public static choosSystemImage(call_back) {
+        if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
+            tt.chooseImage({
+                sourceType: ["album"],
+                count:1,
+                success:(res)=>{
+                    console.log('chooseImage调用成功=',res)
+                    if(res.tempFilePaths.length>0) {
+                        call_back(res.tempFilePaths[0])
+                    }
+                },
+                fail(err) {
+                    console.log(`chooseImage调用失败=`,err);
+                },
+            })
+        } else {
+            // call_back()
+        }
+    }
 
 
     // 检测显示添加桌面
     // 检测显示添加桌面
     public static checkIsShowAddDesktop():boolean {
     public static checkIsShowAddDesktop():boolean {
@@ -374,56 +431,4 @@ export class SdkUtil {
         // })
         // })
     }
     }
 
 
-    //------------------------------  三方分别处理相关  ------------------------------//
-    public static login(call){
-        if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
-            tt.login({
-                force: true,
-                success(res) {
-                  console.log(`login 调用成功${res.code} ${res.anonymousCode}`);
-                  call({"code":res.code,"anonymousCode":res.anonymousCode})
-                },
-                fail(res) {
-                  console.log(`login 调用失败`);
-                  call(null)
-                },
-              });
-              
-        }else{
-            call(null)
-        }
-    }
-
-    public static getUserInfo(call){
-        if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
-            tt.getUserInfo({
-                // withCredentials: true,
-                // withRealNameAuthenticationInfo: true,
-                success(res) {
-                  console.log(`getUserInfo 调用成功`, res.userInfo);
-                  call(res.userInfo)
-                },
-                fail(res) {
-                  console.log(`getUserInfo 调用失败`, res.errMsg);
-                },
-              });
-        }else{
-            call(null)
-        }
-    }
-
-    public static vibrateShort(){
-        if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
-            tt.vibrateShort({
-                success(res) {
-                //   console.log(`${res}`);
-                },
-                fail(res) {
-                //   console.log(`vibrateShort调用失败`);
-                },
-              });
-        }
-          
-    }
-
 }
 }

+ 20 - 2
assets/script/ui/feedback/feedback.ts

@@ -1,6 +1,10 @@
 import { _decorator, Component, Node, Sprite, SpriteFrame } from 'cc';
 import { _decorator, Component, Node, Sprite, SpriteFrame } from 'cc';
 import { base_ui } from '../../fw/base_ui';
 import { base_ui } from '../../fw/base_ui';
 import { feedback_selected } from './feedback_selected';
 import { feedback_selected } from './feedback_selected';
+import { feedback_submit } from './feedback_submit';
+import { http } from '../../http';
+import { config } from '../../config';
+import { uiManager } from '../../manager/uiManager';
 const { ccclass, property } = _decorator;
 const { ccclass, property } = _decorator;
 
 
 @ccclass('feedback')
 @ccclass('feedback')
@@ -29,15 +33,29 @@ export class feedback extends base_ui {
         })
         })
 
 
         this.selected_node.getComponent(feedback_selected).initView((r)=>{
         this.selected_node.getComponent(feedback_selected).initView((r)=>{
+            this.img_title.getComponent(Sprite).spriteFrame = r.sf
             this.selected_node.active = false
             this.selected_node.active = false
             this.submit_bottom.active = true
             this.submit_bottom.active = true
             this.submit_node.active = true
             this.submit_node.active = true
-            this.img_title.getComponent(Sprite).spriteFrame = r.sf
+            this.submit_node.getComponent(feedback_submit).initView(r)
         })
         })
     }
     }
 
 
     onClickSubmit() {
     onClickSubmit() {
-        console.log('提交 提交')
+        let data = this.submit_node.getComponent(feedback_submit).getData()
+        // console.log('submit data=',data)
+        if(data!=null) {
+            uiManager.Instance().showLoading()
+            http.post(config.API.feedback, data, (err,d)=>{
+                uiManager.Instance().hideLoading()
+                if(!err){
+                    let nd = JSON.parse(d)
+                    if(nd.code === config.status.SUCCESS){
+                        this.close()
+                    }   
+                }
+            })
+        }
     }
     }
 
 
 }
 }

+ 54 - 4
assets/script/ui/feedback/feedback_submit.ts

@@ -1,14 +1,64 @@
-import { _decorator, Component, Node } from 'cc';
+import { _decorator, Component, EditBox, Label, Node, Sprite, SpriteFrame } from 'cc';
+import { base_ui } from '../../fw/base_ui';
+import { SdkUtil } from '../../sdkUtil';
+import { http } from '../../http';
+import { config } from '../../config';
+import { tools } from '../../tools';
 const { ccclass, property } = _decorator;
 const { ccclass, property } = _decorator;
 
 
 @ccclass('feedback_submit')
 @ccclass('feedback_submit')
-export class feedback_submit extends Component {
+export class feedback_submit extends base_ui {
+    @property(Node) lab_title:Node = null
+    @property(Node) btn_add_img:Node = null
+    @property(EditBox) editbox_content:EditBox = null
+    @property(EditBox) editbox_contact:EditBox = null
+
+    private m_data = null
+    private img_url:string = ''
     start() {
     start() {
+        this.onButtonListen(this.btn_add_img, ()=>{
+            this.onClickAddImg()
+        })
+        this.editbox_content.node.on(EditBox.EventType.EDITING_DID_ENDED, ()=>{
+            console.log('this.editbox_content=',this.editbox_content.string)
+        })
+        this.editbox_contact.node.on(EditBox.EventType.EDITING_DID_ENDED, ()=>{
+            console.log('this.editbox_contact=',this.editbox_contact.string)
+        })
+    }
+
+    initView(data) {
+        this.m_data = data
+        this.lab_title.getComponent(Label).string = '--  ' + data.title +'内容'
+    }
 
 
+    private onClickAddImg() {
+        SdkUtil.choosSystemImage((filePath)=>{
+            http.uploadFile(config.API.up_feedback_img,filePath,null,(err,d)=>{
+                if(!err){
+                    let data = JSON.parse(d)
+                    if(data.code===config.status.SUCCESS){
+                        // console.log('data=',data.content)
+                        this.img_url = data.content.surl
+                        tools.loadRemoteImg(this.img_url, (res)=>{
+                            this.btn_add_img.getComponent(Sprite).spriteFrame = res.sf
+                        })
+                    }
+                }
+            })           
+        })
     }
     }
 
 
-    update(deltaTime: number) {
-        
+    public getData() {
+        if(this.editbox_content.string.length<=0) {
+            return null
+        }
+        let data =  {'title': this.m_data.title, 
+                     'describe':this.editbox_content.string,
+                     'img_url':this.img_url,
+                     'mobile':this.editbox_contact.string,
+                    }
+        return data
     }
     }
 }
 }
 
 

+ 2 - 2
assets/script/ui/home/home_guangbo.ts

@@ -29,7 +29,7 @@ export class home_guangbo extends Component {
         // console.log('cur_content_width=',cur_content_width)
         // console.log('cur_content_width=',cur_content_width)
         let cur_content_height = this.lab_content.getComponent(UITransform).contentSize.height
         let cur_content_height = this.lab_content.getComponent(UITransform).contentSize.height
         this.lab_content.getComponent(UITransform).setContentSize(new Size(cur_content_width,cur_content_height))
         this.lab_content.getComponent(UITransform).setContentSize(new Size(cur_content_width,cur_content_height))
-        this.lab_content.setPosition(this.screen_width/2+this.left_padding,0,0)
+        this.lab_content.setPosition(this.screen_width/2+this.left_padding,this.lab_content.getPosition().y,0)
         this.runContent(cur_content_width)
         this.runContent(cur_content_width)
     }
     }
 
 
@@ -39,7 +39,7 @@ export class home_guangbo extends Component {
         this.schedule(()=>{
         this.schedule(()=>{
             run_pos_x -= this.speed
             run_pos_x -= this.speed
             // console.log('cur_lab_content_postion_x=',cur_lab_content_postion_x)
             // console.log('cur_lab_content_postion_x=',cur_lab_content_postion_x)
-            this.lab_content.setPosition(run_pos_x,0,0)
+            this.lab_content.setPosition(run_pos_x,this.lab_content.getPosition().y,0)
             if(run_pos_x<=-(content_width+this.screen_width/2)) {
             if(run_pos_x<=-(content_width+this.screen_width/2)) {
                 run_pos_x = this.screen_width/2+this.left_padding
                 run_pos_x = this.screen_width/2+this.left_padding
                 this.unscheduleAllCallbacks()
                 this.unscheduleAllCallbacks()

+ 7 - 1
assets/script/ui/rank/rank_list_item.ts

@@ -6,6 +6,8 @@ import { uiManager } from '../../manager/uiManager';
 import { config } from '../../config';
 import { config } from '../../config';
 import { base_ui } from '../../fw/base_ui';
 import { base_ui } from '../../fw/base_ui';
 import { user_info_view } from '../user_info_view';
 import { user_info_view } from '../user_info_view';
+import { userDataManager } from '../../manager/userDataManager';
+import { GameManager } from '../../GameManager';
 const { ccclass, property } = _decorator;
 const { ccclass, property } = _decorator;
 
 
 @ccclass('rank_list_item')
 @ccclass('rank_list_item')
@@ -33,7 +35,11 @@ export class rank_list_item extends base_ui {
         })
         })
         this.lab_nickname.getComponent(Label).string = data.nickName
         this.lab_nickname.getComponent(Label).string = data.nickName
         this.lab_score.getComponent(Label).string = data.score + ' 分'
         this.lab_score.getComponent(Label).string = data.score + ' 分'
-        this.img_car.getComponent(Sprite).spriteFrame = imageCacheManager.getRankCarImageById(data.car_id)
+        if(data.user_id==userDataManager.user_data.id) {
+            this.img_car.getComponent(Sprite).spriteFrame = GameManager.getUserDefaultRankCarSf()
+        } else {
+            this.img_car.getComponent(Sprite).spriteFrame = imageCacheManager.getRankCarImageById(data.car_id)
+        }
     }
     }
 }
 }
 
 

+ 7 - 1
assets/script/ui/rank/rank_list_top.ts

@@ -6,6 +6,8 @@ import { base_ui } from '../../fw/base_ui';
 import { uiManager } from '../../manager/uiManager';
 import { uiManager } from '../../manager/uiManager';
 import { config } from '../../config';
 import { config } from '../../config';
 import { user_info_view } from '../user_info_view';
 import { user_info_view } from '../user_info_view';
+import { userDataManager } from '../../manager/userDataManager';
+import { GameManager } from '../../GameManager';
 const { ccclass, property } = _decorator;
 const { ccclass, property } = _decorator;
 
 
 @ccclass('rank_list_top')
 @ccclass('rank_list_top')
@@ -108,7 +110,11 @@ export class rank_list_top extends base_ui {
     }
     }
 
 
     private setImgCar(node:Node, data:rankData) {
     private setImgCar(node:Node, data:rankData) {
-        node.getComponent(Sprite).spriteFrame = imageCacheManager.getRankCarImageById(data.car_id)
+        if(data.user_id==userDataManager.user_data.id) {
+            node.getComponent(Sprite).spriteFrame = GameManager.getUserDefaultRankCarSf()
+        } else {
+            node.getComponent(Sprite).spriteFrame = imageCacheManager.getRankCarImageById(data.car_id)
+        }
     }
     }
 
 
     private onClickRankGotoUserInfo(data:rankData) {
     private onClickRankGotoUserInfo(data:rankData) {

BIN
assets/texture/ui/home/img_gong_gao.png


+ 21 - 21
assets/texture/ui/home/img_gong_gao.png.meta

@@ -39,17 +39,17 @@
       "id": "f9941",
       "id": "f9941",
       "name": "spriteFrame",
       "name": "spriteFrame",
       "userData": {
       "userData": {
-        "trimType": "auto",
+        "trimType": "custom",
         "trimThreshold": 1,
         "trimThreshold": 1,
         "rotated": false,
         "rotated": false,
         "offsetX": 0,
         "offsetX": 0,
         "offsetY": 0,
         "offsetY": 0,
         "trimX": 0,
         "trimX": 0,
         "trimY": 0,
         "trimY": 0,
-        "width": 1079,
-        "height": 58,
-        "rawWidth": 1079,
-        "rawHeight": 58,
+        "width": 903,
+        "height": 99,
+        "rawWidth": 903,
+        "rawHeight": 99,
         "borderTop": 0,
         "borderTop": 0,
         "borderBottom": 0,
         "borderBottom": 0,
         "borderLeft": 0,
         "borderLeft": 0,
@@ -61,17 +61,17 @@
         "meshType": 0,
         "meshType": 0,
         "vertices": {
         "vertices": {
           "rawPosition": [
           "rawPosition": [
-            -539.5,
-            -29,
+            -451.5,
+            -49.5,
             0,
             0,
-            539.5,
-            -29,
+            451.5,
+            -49.5,
             0,
             0,
-            -539.5,
-            29,
+            -451.5,
+            49.5,
             0,
             0,
-            539.5,
-            29,
+            451.5,
+            49.5,
             0
             0
           ],
           ],
           "indexes": [
           "indexes": [
@@ -84,12 +84,12 @@
           ],
           ],
           "uv": [
           "uv": [
             0,
             0,
-            58,
-            1079,
-            58,
+            99,
+            903,
+            99,
             0,
             0,
             0,
             0,
-            1079,
+            903,
             0
             0
           ],
           ],
           "nuv": [
           "nuv": [
@@ -103,13 +103,13 @@
             1
             1
           ],
           ],
           "minPos": [
           "minPos": [
-            -539.5,
-            -29,
+            -451.5,
+            -49.5,
             0
             0
           ],
           ],
           "maxPos": [
           "maxPos": [
-            539.5,
-            29,
+            451.5,
+            49.5,
             0
             0
           ]
           ]
         },
         },

Some files were not shown because too many files changed in this diff