This commit is contained in:
DESKTOP-5RP3AKU\Jisol 2024-01-23 02:53:23 +08:00
parent c6710e7dfa
commit 26cc480866
27 changed files with 2061 additions and 988 deletions

Binary file not shown.

Binary file not shown.

View File

@ -132,7 +132,7 @@
"_priority": 0,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 1000,
"_orthoHeight": 700,
"_near": 0,
"_far": 1000,
"_color": {

View File

@ -93,5 +93,25 @@
"value": 20
}
]
},
{
"id": 210001,
"name": "锻造礼包",
"tig": "锻造礼包",
"limit": 1,
"limitValue": 0,
"exchanges": [
{
"id": 90001,
"value": 2000
}
],
"rewards": [
{
"type": 1,
"id": 90002,
"value": 20
}
]
}
]

View File

@ -50,7 +50,7 @@
{
"id": 90007,
"icon": "90007",
"name": "兑换券",
"name": "点卷",
"tig": "用于购买礼包",
"args": "",
"quality": 1

View File

@ -1,22 +1,27 @@
[
{
"id": 1,
"tig": "金币礼包",
"giftId": 180001
"giftId": 180001,
"type": 0
},
{
"id": 2,
"tig": "好多金币礼包",
"giftId": 180002
"giftId": 180002,
"type": 0
},
{
"id": 3,
"tig": "限购矿石礼包",
"giftId": 190001
"giftId": 190001,
"type": 0
},
{
"id": 4,
"tig": "每日矿石礼包",
"giftId": 200001
"giftId": 200001,
"type": 0
},
{
"tig": "锻造礼包",
"giftId": 210001,
"type": 1
}
]

View File

@ -1119,8 +1119,8 @@
"_string": "购买",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 26,
"_fontSize": 26,
"_actualFontSize": 22,
"_fontSize": 22,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 1,
@ -1439,6 +1439,9 @@
"giftLimit": {
"__id__": 39
},
"giftPrice": {
"__id__": 48
},
"views": {
"__id__": 33
},

View File

@ -1482,7 +1482,7 @@
"b": 255,
"a": 255
},
"_string": "兑换\n商城",
"_string": "点卷\n商城",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 24,
@ -1702,10 +1702,12 @@
},
{
"__type__": "cc.ClickEvent",
"target": null,
"target": {
"__id__": 1
},
"component": "",
"_componentId": "b51bfKvsidNPKBbFirAFgQI",
"handler": "onClickShop",
"_componentId": "eb3d97OVbpKJIEDdbauLD9N",
"handler": "onClickTigs",
"customEventData": ""
},
{
@ -2243,10 +2245,12 @@
},
{
"__type__": "cc.ClickEvent",
"target": null,
"target": {
"__id__": 1
},
"component": "",
"_componentId": "b51bfKvsidNPKBbFirAFgQI",
"handler": "onClickShop",
"_componentId": "eb3d97OVbpKJIEDdbauLD9N",
"handler": "onClickTigs",
"customEventData": ""
},
{
@ -2337,6 +2341,8 @@
"__id__": 0
},
"fileId": "65LU7XwHdBEp0gEjbdLCNL",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
@ -2665,6 +2671,9 @@
"views": {
"__id__": 37
},
"tigs": {
"__id__": 48
},
"_id": ""
},
{

View File

@ -32,10 +32,10 @@ import { Component } from "cc";
// let WsPath = `ws://localhost:8080/websocket`
// let APIPath = `http://192.168.1.23:8080`
// let WsPath = `ws://192.168.1.23:8080/websocket`
let APIPath = `http://192.168.0.118:8080`
let WsPath = `ws://192.168.0.118:8080/websocket`
// let APIPath = `https://api.pet.jisol.cn`
// let WsPath = `wss://api.pet.jisol.cn/websocket`
// let APIPath = `http://192.168.0.118:8080`
// let WsPath = `ws://192.168.0.118:8080/websocket`
let APIPath = `https://api.pet.jisol.cn`
let WsPath = `wss://api.pet.jisol.cn/websocket`
//重写UI
class JNGLayer extends JNLayer{

View File

@ -66,7 +66,7 @@ export default class GNormalModeBase<T,DT> extends GDefaultMode<T,DT>{
//调整相机
this.camera.enabled = true;
let camreaPos = this.camera.node.worldPosition;
this.camera.node.worldPosition = v3(0,450,camreaPos.z)
this.camera.node.worldPosition = v3(0,400,camreaPos.z)
}
//获取配置

View File

@ -1212,18 +1212,14 @@ export namespace TB {
export class TbGShop {
constructor(_json_: any) {
if (_json_.id === undefined) { throw new Error() }
this.id = _json_.id
if (_json_.tig === undefined) { throw new Error() }
this.tig = _json_.tig
if (_json_.giftId === undefined) { throw new Error() }
this.giftId = _json_.giftId
if (_json_.type === undefined) { throw new Error() }
this.type = _json_.type
}
/**
* id
*/
readonly id: number
/**
*
*/
@ -1232,6 +1228,10 @@ export class TbGShop {
* Id
*/
readonly giftId: number
/**
* 0. 1.
*/
readonly type: number
resolve(tables:Tables)
{
@ -2012,23 +2012,23 @@ export class TbGGift{
export class TbGShop{
private _dataMap: Map<number, TB.TbGShop>
private _dataMap: Map<string, TB.TbGShop>
private _dataList: TB.TbGShop[]
constructor(_json_: any) {
this._dataMap = new Map<number, TB.TbGShop>()
this._dataMap = new Map<string, TB.TbGShop>()
this._dataList = []
for(var _json2_ of _json_) {
let _v: TB.TbGShop
_v = new TB.TbGShop(_json2_)
this._dataList.push(_v)
this._dataMap.set(_v.id, _v)
this._dataMap.set(_v.tig, _v)
}
}
getDataMap(): Map<number, TB.TbGShop> { return this._dataMap; }
getDataMap(): Map<string, TB.TbGShop> { return this._dataMap; }
getDataList(): TB.TbGShop[] { return this._dataList; }
get(key: number): TB.TbGShop | undefined { return this._dataMap.get(key); }
get(key: string): TB.TbGShop | undefined { return this._dataMap.get(key); }
resolve(tables:Tables)
{

View File

@ -12,8 +12,9 @@ export default class GiftData extends BaseData{
records:GiftRecord[] = [];
dayRecords:GiftDayRecord[] = [];
onInit() {
async onInit() {
await this.UpdateGiftRecord();
await this.UpdateGiftDayRecord();
}
//查询充值记录
@ -38,6 +39,8 @@ export default class GiftData extends BaseData{
//购买礼包
async buy(giftId:number){
await API.BuyGift(giftId);
await this.UpdateGiftRecord();
await this.UpdateGiftDayRecord();
app.event.emit(GiftDataEnum.BUY);
}

View File

@ -119,7 +119,7 @@ export default class PetEquipData extends BaseData{
//获取指定宠物等级
getForgingBenchPetLevel(petId:number = this.info.forgingPetId){
let exp = this.info.forgingPetLevels[`${petId}`] || 0;
let list = TD.TbGRoleEquipLevel.getDataList().filter(info => info.exp <= exp);
let list = TD.TbGRoleEquipLevel.getDataList().filter(info => (exp-=info.exp) >= 0);
return list[list.length - 1].id;
}

View File

@ -14,6 +14,7 @@ export enum ResourceType{
DungeonGold = 90004, //钥匙:金币副本
DungeonForgedStones = 90005, //钥匙:锻造石副本
Q1S = 90006, //魂:一品宠物魂
GiftCoupons = 90007, //兑换券
}
//资源刷新类型

View File

@ -25,8 +25,6 @@ export class PetIcon extends Component {
info:PlayerPetOV;
onLoad(){
this.reset();
//监听
app.event.on(PlayerPetEvent.UPDATE_INFO,this.onUpdateInfo,this)
}
@ -35,13 +33,6 @@ export class PetIcon extends Component {
app.event.off(PlayerPetEvent.UPDATE_INFO,this.onUpdateInfo,this)
}
//初始化
reset(){
this.starNode.active = false;
}
//信息更新
onUpdateInfo(info:PlayerPetOV){
if(this.info && info.petId == this.info.petId){
@ -51,6 +42,9 @@ export class PetIcon extends Component {
//刷新页面
onUpdateView(){
this.starNode.active = false;
this.spine.skeletonData = app.battleRes.getRoleSpine(this.info.petTbId);
this.spine.setAnimation(0,UIPetAnim.std,true);
@ -67,7 +61,6 @@ export class PetIcon extends Component {
//设置icon
set(info:PlayerPetOV){
this.reset();
this.info = info;
this.onUpdateView();
}

View File

@ -5,6 +5,7 @@ import { TD } from '../../App';
import { Label } from 'cc';
import JNScrollView from '../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollView';
import GiftData from '../../data/GiftData';
import NumberTools from '../../tools/NumberTools';
const { ccclass, property } = _decorator;
@ccclass('ShopGiftItem')
@ -16,6 +17,9 @@ export class ShopGiftItem extends JNScrollViewItem<TB.TbGShop> {
@property(Label)
giftLimit:Label; //限购
@property(Label)
giftPrice:Label; //价格
@property(JNScrollView)
views:JNScrollView; //礼包列表
@ -25,10 +29,6 @@ export class ShopGiftItem extends JNScrollViewItem<TB.TbGShop> {
this.gift = TD.TbGGift.get(data.giftId);
}
protected start(): void {
this.giftName.string = this.data.tig;
if(this.gift.limit == TbGEnum.TGiftLimit.Unlimited)
@ -38,10 +38,11 @@ export class ShopGiftItem extends JNScrollViewItem<TB.TbGShop> {
if(this.gift.limit == TbGEnum.TGiftLimit.Limit)
this.giftLimit.string = `限制( ${GiftData.getIns().getGiftRecordCount(this.gift.id)}/${this.gift.limitValue} )`;
this.giftPrice.string = `${NumberTools.NumberStr(this.gift.exchanges[0].value)} ${TD.TbGResource.get(this.gift.exchanges[0].id).name}`;
this.views.refreshData(this.gift.rewards);
}
}
//点击购买礼包
async onClickBuy(){

View File

@ -3,6 +3,9 @@ import JNLayerBase from '../../../../extensions/ngame/assets/ngame/ui/base/JNLay
import JNScrollView from '../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollView';
import { app, TD } from '../../App';
import GiftData, { GiftDataEnum } from '../../data/GiftData';
import { Sprite } from 'cc';
import { color } from 'cc';
import { EventTouch } from 'cc';
const { ccclass, property } = _decorator;
//商店页面
@ -13,6 +16,13 @@ export class ShopView extends JNLayerBase {
@property(JNScrollView)
views:JNScrollView
//商店标签
@property(Node)
tigs:Node;
//页面下标
index:number = 0;
async onJNLoad(data?: any) {
super.onJNLoad(data);
@ -31,13 +41,24 @@ export class ShopView extends JNLayerBase {
async onUpdateView() {
await GiftData.getIns().UpdateGiftRecord();
await GiftData.getIns().UpdateGiftDayRecord();
this.tigs.children.forEach((item,index) => {
if(this.index == index){
item.getComponentInChildren(Sprite).color = color(0,0,0);
}else{
item.getComponentInChildren(Sprite).color = color(255,255,255);
}
})
this.views.refreshData(TD.TbGShop.getDataList());
this.views.refreshData(TD.TbGShop.getDataList().filter(item => item.type == this.index));
}
//切换下标
onClickTigs(touch:EventTouch){
this.index = touch.target.getSiblingIndex();
this.onUpdateView();
}
}

@ -1 +1 @@
Subproject commit a98403e0e131001f21f870c9d511c3c63fbbc486
Subproject commit 7d40b6c6e3089fe4feb559e85fd051aa74885cab

View File

@ -16,19 +16,15 @@ import com.google.gson.JsonObject;
public final class TbGShop extends AbstractBean {
public TbGShop(JsonObject _buf) {
id = _buf.get("id").getAsInt();
tig = _buf.get("tig").getAsString();
giftId = _buf.get("giftId").getAsInt();
type = _buf.get("type").getAsInt();
}
public static TbGShop deserialize(JsonObject _buf) {
return new cfg.TB.TbGShop(_buf);
}
/**
* id
*/
public final int id;
/**
* 备注
*/
@ -37,6 +33,10 @@ public final class TbGShop extends AbstractBean {
* 礼包Id
*/
public final int giftId;
/**
* 0.点卷商店 1.金币商店
*/
public final int type;
public static final int __ID__ = 319422095;
@ -46,9 +46,9 @@ public final class TbGShop extends AbstractBean {
@Override
public String toString() {
return "{ "
+ "(format_field_name __code_style field.name):" + id + ","
+ "(format_field_name __code_style field.name):" + tig + ","
+ "(format_field_name __code_style field.name):" + giftId + ","
+ "(format_field_name __code_style field.name):" + type + ","
+ "}";
}
}

View File

@ -14,24 +14,24 @@ import com.google.gson.JsonElement;
public final class TbGShop {
private final java.util.HashMap<Integer, cfg.TB.TbGShop> _dataMap;
private final java.util.HashMap<String, cfg.TB.TbGShop> _dataMap;
private final java.util.ArrayList<cfg.TB.TbGShop> _dataList;
public TbGShop(JsonElement _buf) {
_dataMap = new java.util.HashMap<Integer, cfg.TB.TbGShop>();
_dataMap = new java.util.HashMap<String, cfg.TB.TbGShop>();
_dataList = new java.util.ArrayList<cfg.TB.TbGShop>();
for (com.google.gson.JsonElement _e_ : _buf.getAsJsonArray()) {
cfg.TB.TbGShop _v;
_v = cfg.TB.TbGShop.deserialize(_e_.getAsJsonObject());
_dataList.add(_v);
_dataMap.put(_v.id, _v);
_dataMap.put(_v.tig, _v);
}
}
public java.util.HashMap<Integer, cfg.TB.TbGShop> getDataMap() { return _dataMap; }
public java.util.HashMap<String, cfg.TB.TbGShop> getDataMap() { return _dataMap; }
public java.util.ArrayList<cfg.TB.TbGShop> getDataList() { return _dataList; }
public cfg.TB.TbGShop get(int key) { return _dataMap.get(key); }
public cfg.TB.TbGShop get(String key) { return _dataMap.get(key); }
}

View File

@ -11,6 +11,6 @@ spring:
serialization:
write-dates-as-timestamps: true
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#mybatis-plus:
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

View File

@ -93,5 +93,25 @@
"value": 20
}
]
},
{
"id": 210001,
"name": "锻造礼包",
"tig": "锻造礼包",
"limit": 1,
"limitValue": 0,
"exchanges": [
{
"id": 90001,
"value": 2000
}
],
"rewards": [
{
"type": 1,
"id": 90002,
"value": 20
}
]
}
]

View File

@ -50,7 +50,7 @@
{
"id": 90007,
"icon": "90007",
"name": "兑换券",
"name": "点卷",
"tig": "用于购买礼包",
"args": "",
"quality": 1

View File

@ -1,22 +1,27 @@
[
{
"id": 1,
"tig": "金币礼包",
"giftId": 180001
"giftId": 180001,
"type": 0
},
{
"id": 2,
"tig": "好多金币礼包",
"giftId": 180002
"giftId": 180002,
"type": 0
},
{
"id": 3,
"tig": "限购矿石礼包",
"giftId": 190001
"giftId": 190001,
"type": 0
},
{
"id": 4,
"tig": "每日矿石礼包",
"giftId": 200001
"giftId": 200001,
"type": 0
},
{
"tig": "锻造礼包",
"giftId": 210001,
"type": 1
}
]