Commit 0a45bd72 authored by 王杰's avatar 王杰

feat: 再写一点点

parent ae12560f
......@@ -185,7 +185,7 @@
"_priority": 1073741824,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 897.0108303249098,
"_orthoHeight": 739.5,
"_near": 1,
"_far": 2000,
"_color": {
......@@ -478,7 +478,7 @@
"y": -180,
"z": -12.000012657215834
},
"_id": "abCxfLOeRFsoE++XP//VtM"
"_id": "a4oWxEwWFM4Lu4iPpKs1mI"
},
{
"__type__": "cc.UITransform",
......@@ -500,7 +500,7 @@
"x": 0,
"y": 1
},
"_id": "33RwZa4M9FZag9hBPETZZk"
"_id": "784o5UlktClINNtz+eDuKT"
},
{
"__type__": "cc.Sprite",
......@@ -536,7 +536,7 @@
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "19CjnR2elHtrtIZETYGWEx"
"_id": "041XaUO5xCMqrKhy8dz0sj"
},
{
"__type__": "cc.Node",
......@@ -584,7 +584,7 @@
"y": -180,
"z": -11.00000220913452
},
"_id": "earDIrholGhbmpP7XD6Jzl"
"_id": "04Tdz2+fFHAJLzQWJ1ci1C"
},
{
"__type__": "cc.UITransform",
......@@ -606,7 +606,7 @@
"x": 0,
"y": 1
},
"_id": "279n81WyRIZqDz+br2gOIX"
"_id": "1aREbZQ7VJWpexIdzFxLdf"
},
{
"__type__": "cc.Sprite",
......@@ -642,7 +642,7 @@
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "3aPWmZkihGm4v9Jrsx94Bm"
"_id": "8dHtVRBuFFVr837DP5zESg"
},
{
"__type__": "cc.Node",
......@@ -690,7 +690,7 @@
"y": -180,
"z": -64.00000614258742
},
"_id": "7bf1Ek/JBL9psN0qa5v3dJ"
"_id": "07hM/etCZB97LhgBJSV+xy"
},
{
"__type__": "cc.UITransform",
......@@ -712,7 +712,7 @@
"x": 0,
"y": 1
},
"_id": "d30vc8Fi9C1bQZdFw1z20v"
"_id": "27yKoFl6dNO7YhAD7VD6vz"
},
{
"__type__": "cc.Sprite",
......@@ -748,7 +748,7 @@
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "55rhcxkEZDoJweYMXLHzUw"
"_id": "cbctaCqZlAoqm9waaeZyEc"
},
{
"__type__": "cc.Node",
......@@ -796,7 +796,7 @@
"y": 180,
"z": 25.99999385741257
},
"_id": "6bngQbXfNEKICc+jymGjOA"
"_id": "2c2zj2DklHk5Dr0S+gknHq"
},
{
"__type__": "cc.UITransform",
......@@ -818,7 +818,7 @@
"x": 0,
"y": 1
},
"_id": "b98/4+DGFLjoCajTjjBbAN"
"_id": "30vhT1v3lEv6qxvwUBuxjA"
},
{
"__type__": "cc.Sprite",
......@@ -854,7 +854,7 @@
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "6dEJzQONVI/LTK/7tv1Wv2"
"_id": "78O5+GLYRBOK5x/HXFHH30"
},
{
"__type__": "cc.UITransform",
......@@ -5232,7 +5232,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1624,
"height": 750
"height": 750.0000000000001
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "8fb09e0b-1eb3-4b77-99fd-784445492b24",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "MyBagItem"
}
}
This diff is collapsed.
import { _decorator, Button, Component, Label, Node, Size, Sprite, } from 'cc';
import { observer, render } from '../store/decorators';
import Panel from "../../Module/Panel";
import { _decorator, Button, Label, Node, Sprite, } from "cc";
import store from "../store/store";
import { observer, render } from "../store/decorators";
import { changeScene, hideWaiting, showWaiting } from '../../Module/UIFast';
import { _asyncThrottle, dateFormatter, strFormat } from '../Utils/Utils';
import { HomeScene } from '../Scenes/HomeScene';
import { sendWebNet, WebNetName } from '../Utils/WebNet/WebNet';
import { YXCollectionView, YXFlowLayout, YXIndexPath } from '../../Component/YXList/lib';
const { ccclass, property } = _decorator;
import { HTMLRichText } from "../../Component/HTMLRichText/HTMLRichText";
import { sendWebNet, WebNetName } from "../Utils/WebNet/WebNet";
import { strFormat } from "../Utils/Utils";
import { hidePanel, showPanel } from "../../Module/UIFast";
import SignSucPanel from "./SignSucPanel";
enum TAB {
PRIZE = "PRIZE",
TOOL = "TOOL",
}
@observer
@ccclass('MyBagPanel')
export default class MyBagPanel extends Panel {
static bundle = "MyBagPanel";
static skin = "MyBagPanel";
export class MyBagPanel extends Panel {
static bundle: string = "MyBagPanel";
static skin: string = "MyBagPanel";
@property(Node) closeBtn: Node = null;
@property(Node) Prize: Node = null;
@property(Node) Tool: Node = null;
@property(Node) prize_yes: Node = null;
@property(Node) prize_btn: Node = null;
@property(Node) tool_yes: Node = null;
@property(Node) tool_btn: Node = null;
@property(YXCollectionView) Prize_List: YXCollectionView = null;
@property(YXCollectionView) Tool_List: YXCollectionView = null;
private _tab: TAB = TAB.PRIZE;
set tab(tab: TAB) { // 设置tab切换
this._tab = tab;
const isPrize = tab == TAB.PRIZE;
const isTool = tab == TAB.TOOL;
this.prize_yes.active = isPrize;
this.tool_yes.active = isTool;
this.Prize.active = isPrize;
this.Tool.active = isTool;
}
get tab() {
return this._tab;
}
prizeDate: any[] = [];
toolDate: any[] = [];
onLoad() {
this.closeBtn.on(Button.EventType.CLICK, this.clickClose);
this.tab = TAB.TOOL;
this.closeBtn.on(Button.EventType.CLICK, this.clickClose, this);
this.prize_btn.on(Button.EventType.CLICK, this.clickSheng, this);
this.tool_btn.on(Button.EventType.CLICK, this.clickSingle, this);
}
async start() {
this.Prize_List.numberOfItems = () => this.prizeDate.length;
this.Prize_List.onCellDisplay = this.onShengCellDisplay;
const shengLayout = new YXFlowLayout();
shengLayout.itemSize = new Size(820, 140);
this.Prize_List.layout = shengLayout;
this.Prize_List.reloadData();
this.Tool_List.numberOfItems = () => this.toolDate.length;
this.Tool_List.onCellDisplay = this.onSingleCellDisplay;
const singleLayout = new YXFlowLayout();
singleLayout.itemSize = new Size(820, 140);
this.Tool_List.layout = singleLayout;
this.Tool_List.reloadData();
showWaiting(true);
await Promise.all([
this.updateSheng(),
this.updateSingle(),
]);
hideWaiting();
}
update(deltaTime: number) {
}
clickClose = () => {
this.hidePanel();
}
// 点击省榜
clickSheng() {
this.tab = TAB.PRIZE;
// this.Prize.getChildByName(`goCheck`).active = true;
}
// 个人榜
clickSingle() {
this.tab = TAB.TOOL;
}
/****** 数据 ******/
// 刷新道具
async updateSheng() {
const { success, data } = await sendWebNet(WebNetName.queryGameItem);
if (!success) return;
console.log("让我看看", data);
this.prizeDate = data.spInfo;
this.Prize_List.reloadData();
this.Prize_List.node.active = this.prizeDate.length > 0;
// for (let i = 1; i <= 7; i++) {
// const node = this[`day${i}`]
// // console.log("看看这里是什么结果",resData.signDay, i);
// if (resData.signDay >= i) {
// node.getChildByName("singed_mask").active = true;
// } else {
// node.getChildByName("singed_mask").active = false;
// }
// }
}
// 刷新奖品
async updateSingle() {
const { success, data = [] } = await sendWebNet(WebNetName.prizeDetail);
if (!success) return;
const excludeSp = false; //排除道具
let records = []
for (let item of data) {
const { extra: { name, icon, type }, id, prizeId, gmtCreate } = item;
records.push({
id,
prizeId,
name,
icon,
gmtCreate,
data: item,
});
}
this.toolDate = records;
this.Tool_List.reloadData();
this.Tool_List.node.active = this.toolDate.length > 0;
}
// 给每个cell设置数据
onShengCellDisplay = (cell: Node, indexPath: YXIndexPath, collectionView: YXCollectionView) => {
const data = this.prizeDate[indexPath.item];
this.onCellDisplay(cell, data);
}
onSingleCellDisplay = (cell: Node, indexPath: YXIndexPath, collectionView: YXCollectionView) => {
const data = this.toolDate[indexPath.item];
this.onCellDisplay(cell, data);
}
onCellDisplay = (cell: Node, data) => {
let { icon = 0, name = "", gmtCreate = 0, nickname = "", spId = "", spName = "", spNum = 0, url = "" } = data;
// const isPrize = this.tab == TAB.PRIZE;
// const isTool = this.tab == TAB.TOOL;
// const EDEN_TODO = false;
// cell.getChildByName(`goCheck`).active = isPrize;
// cell.getChildByName(`goBuy`).active = isTool && EDEN_TODO;
// cell.getChildByName(`goDress`).active = isTool && EDEN_TODO;
// cell.getChildByName(`Derssed`).active = isTool && EDEN_TODO;
cell.getChildByName(`name`).getComponent(Label).string = strFormat(name || nickname, 32);
cell.getChildByName(`time`).getComponent(Label).string = dateFormatter(gmtCreate, "yyyy.MM.dd hh:mm");
cell.getChildByName("img").getComponent(Sprite).spriteFrame = icon || url;
}
}
......@@ -21,9 +21,12 @@ export default class SignSucPanel extends Panel {
this.closeBtn.on(Button.EventType.CLICK, this.clickClose);
}
@render
render() {
console.log("看看这里拿到了什么数1",SignSucPanel.prototype);
async start() {
const { data = this.data } = this.data
// console.log("看看这里拿到了什么数", data.prizeInfo);
this.PrizeName.getComponent(Label).string = data.prizeInfo.options[0].optionName;
this.PrizeImg.getComponent(Sprite).spriteFrame = data.prizeInfo.options[0].optionImg;
}
clickClose = () => {
......
......@@ -17,7 +17,7 @@ import { PropPage } from "db://assets/Scripts/Scenes/PropPage";
import { AudioMgr } from "../../core_tgx/base/AudioMgr";
import SignPanel from "../Panels/SignPanel";
import { PointDetailScene } from "./PointDetailScene";
import MyBagPanel from "../Panels/MyBagPanel";
import { MyBagPanel } from "../Panels/MyBagPanel";
const { ccclass, property } = _decorator;
......
......@@ -40,6 +40,17 @@ export enum WebNetName {
// 好友榜
friendRank = "rank/friendRank.do",
/**
* 我的背包
*/
// 我的背包-查询游戏道具明细
queryGameItem = "myBackpack/getSp.do",
// 我的背包-装扮接口
doDress = "myBackpack/exchangeDecoration.do",
/**
* 奖品页面
*/
prizeDetail = "records.query",
/**
* 签到
......
......@@ -6,7 +6,7 @@
"options": [
{
"optionId": "dolor",
"optionImg": null,
"optionImg": "https://yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg",
"optionName": "minim sunt in ut pariatur",
"position": null,
"prizeId": "proident in amet",
......
{
"code": "in deserunt quis labore sint",
"message": "velit Lorem ea aliqua nulla",
"success": true
}
\ No newline at end of file
{
"code": "irure id cupidatat",
"message": "ipsum dolore incididunt sunt",
"success": true,
"data": {
"spInfo": [
{
"spId": "vfvefsectetur ad",
"spName": "commodo sed",
"spNum": "fugiat eiusmod cupidatat ex",
"url": "https://yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg"
},
{
"spId": "consectetur Ut labore cupidatat anim",
"spName": "ex enim",
"spNum": "est Ut",
"url": "https://yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg"
},
{
"spId": "deserunt et aute",
"spName": "deserunt",
"spNum": "officia fugiat nostrud sed ipsum",
"url": "https://yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg"
}
],
"dressingStatus": "cillum"
}
}
\ No newline at end of file
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