Commit 5cde1400 authored by haiyoucuv's avatar haiyoucuv

init

parent 0958ae10
...@@ -12,6 +12,5 @@ ...@@ -12,6 +12,5 @@
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="rem" level="application" />
</component> </component>
</module> </module>
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "2f6698ad-1617-4e04-a3b8-c65e9f3957f0",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "2f6698ad-1617-4e04-a3b8-c65e9f3957f0@6c48a",
"displayName": "减",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "2f6698ad-1617-4e04-a3b8-c65e9f3957f0",
"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": "2f6698ad-1617-4e04-a3b8-c65e9f3957f0@f9941",
"displayName": "减",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 48,
"height": 48,
"rawWidth": 48,
"rawHeight": 48,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-24,
-24,
0,
24,
-24,
0,
-24,
24,
0,
24,
24,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
48,
48,
48,
0,
0,
48,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-24,
-24,
0
],
"maxPos": [
24,
24,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "2f6698ad-1617-4e04-a3b8-c65e9f3957f0@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "2f6698ad-1617-4e04-a3b8-c65e9f3957f0@6c48a"
}
}
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "0fd20aff-b339-4a94-bb30-ce1975a7c805",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "0fd20aff-b339-4a94-bb30-ce1975a7c805@6c48a",
"displayName": "加",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "0fd20aff-b339-4a94-bb30-ce1975a7c805",
"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": "0fd20aff-b339-4a94-bb30-ce1975a7c805@f9941",
"displayName": "加",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 48,
"height": 48,
"rawWidth": 48,
"rawHeight": 48,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-24,
-24,
0,
24,
-24,
0,
-24,
24,
0,
24,
24,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
48,
48,
48,
0,
0,
48,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-24,
-24,
0
],
"maxPos": [
24,
24,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "0fd20aff-b339-4a94-bb30-ce1975a7c805@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "0fd20aff-b339-4a94-bb30-ce1975a7c805@6c48a"
}
}
import Panel from "../../Module/Panel"; import Panel from "../../Module/Panel";
import { _decorator, Button, Node, Sprite, Label } from "cc"; import { _decorator, Button, Node, Sprite, Label, math } from "cc";
import { observer } from "../store/decorators"; import { observer } from "../store/decorators";
import { showPanel, showToast } from "db://assets/Module/UIFast"; import { showPanel, showToast } from "db://assets/Module/UIFast";
import ExchangeSuccess from "db://assets/Scripts/Panels/ExchangeSuccess"; import ExchangeSuccess from "db://assets/Scripts/Panels/ExchangeSuccess";
import { creditsCost, sendWebNetWithToken, WebNetName } from "db://assets/Scripts/Utils/WebNet/WebNet"; import { creditsCost, sendWebNetWithToken, WebNetName } from "db://assets/Scripts/Utils/WebNet/WebNet";
import { _asyncThrottle } from "../Utils/Utils"; import { _asyncThrottle } from "../Utils/Utils";
import store from "../store/store";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
...@@ -22,9 +23,26 @@ export default class ProPop extends Panel { ...@@ -22,9 +23,26 @@ export default class ProPop extends Panel {
@property(Label) explanation: Label = null; @property(Label) explanation: Label = null;
@property(Label) num: Label = null; @property(Label) num: Label = null;
@property(Node) add: Node = null;
@property(Node) sub: Node = null;
@property(Label) numTxt: Label = null;
private _buyNum: number = 1;
get buyNum() {
return this._buyNum;
}
set buyNum(val) {
val = math.clamp(1, 99, val);
this._buyNum = val;
this.numTxt.string = `${val}`;
}
onLoad() { onLoad() {
this.closeBtn.on(Button.EventType.CLICK, this.clickClose); this.closeBtn.on(Button.EventType.CLICK, this.clickClose);
this.btn.on(Button.EventType.CLICK, this.clickExchange); this.btn.on(Button.EventType.CLICK, this.clickExchange);
this.add.on(Button.EventType.CLICK, this.clickAdd);
this.sub.on(Button.EventType.CLICK, this.clickSub);
} }
start() { start() {
...@@ -49,14 +67,19 @@ export default class ProPop extends Panel { ...@@ -49,14 +67,19 @@ export default class ProPop extends Panel {
this.prizeName.string = optionName; this.prizeName.string = optionName;
} }
clickAdd = () => {
this.buyNum++;
};
clickSub = () => {
this.buyNum--;
};
clickClose = () => { clickClose = () => {
this.hidePanel(); this.hidePanel();
}; };
clickExchange = _asyncThrottle(async () => { clickExchange = _asyncThrottle(async () => {
const num = 1;
const { const {
id, id,
optionName, optionName,
...@@ -68,10 +91,14 @@ export default class ProPop extends Panel { ...@@ -68,10 +91,14 @@ export default class ProPop extends Panel {
consumeCreditsNum consumeCreditsNum
} = this.data; } = this.data;
if((+consumeCreditsNum) * this.buyNum > store.exchangeInfo.remainCredits){
return showToast("积分数量不足");
}
const { const {
success: costSuc, success: costSuc,
ticket ticket
} = await creditsCost("exchange", "exchangeSp", `sp_deduct_desc`, (+consumeCreditsNum) * num); } = await creditsCost("exchange", "exchangeSp", `sp_deduct_desc`, (+consumeCreditsNum) * this.buyNum);
if (!costSuc) { if (!costSuc) {
showToast("网络异常,请稍后重试~"); showToast("网络异常,请稍后重试~");
...@@ -82,7 +109,7 @@ export default class ProPop extends Panel { ...@@ -82,7 +109,7 @@ export default class ProPop extends Panel {
const { success, data } = await sendWebNetWithToken(WebNetName.propExchange, { const { success, data } = await sendWebNetWithToken(WebNetName.propExchange, {
id, id,
ticketNum: ticket, ticketNum: ticket,
num: num, num: this.buyNum,
// ruId: item.ruleId, // ruId: item.ruleId,
}); });
......
...@@ -32,10 +32,10 @@ export class Global { ...@@ -32,10 +32,10 @@ export class Global {
/** 磁吸道具持续时间 */ /** 磁吸道具持续时间 */
static PROP_MAGNET_DUR_TIME: number = 10; static PROP_MAGNET_DUR_TIME: number = 10;
/** 磁吸吸取半径 */ /** 磁吸吸取半径 */
static PROP_MAGNET_RADIUS: number = 200; static PROP_MAGNET_RADIUS: number = 100;
/** 加长道具增加能量值百分比 */ /** 加长道具增加能量值百分比 */
static PROP_ADD_LENGTH: number = .1; static PROP_ADD_LENGTH: number = .05;
/** 双倍经验持续时间 */ /** 双倍经验持续时间 */
......
...@@ -259,8 +259,8 @@ export class MainGame extends Scene { ...@@ -259,8 +259,8 @@ export class MainGame extends Scene {
if (!currentStage || currentStage == 3) { if (!currentStage || currentStage == 3) {
PropManager.ins.init(gameStore.startInfo?.barrierFlag ? 2 : 5); PropManager.ins.init(gameStore.startInfo?.barrierFlag ? 1 : 2);
CardManager.ins.init(gameStore.startInfo?.barrierFlag ? 2 : 5); CardManager.ins.init(gameStore.startInfo?.barrierFlag ? 1 : 2);
LuckyBagManager.ins.init(); LuckyBagManager.ins.init();
await Target.ins.showTarget3(); await Target.ins.showTarget3();
// await PreCd.ins.startCd(); // await PreCd.ins.startCd();
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
"optionName": "optionName1", "optionName": "optionName1",
"optionImg": "optionImg1", "optionImg": "optionImg1",
"prizeId": "prizeId1", "prizeId": "prizeId1",
"spDetail": "spDetail1",
"alreadyUserCount": 21, "alreadyUserCount": 21,
"userLimitCount": 121, "userLimitCount": 121,
"consumeCreditsNum": 123 "consumeCreditsNum": 123
......
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