Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
daierGame
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
daierGame
Commits
a190c046
Commit
a190c046
authored
Oct 14, 2024
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
f8045841
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
211 additions
and
36 deletions
+211
-36
全部线索.json
json/全部线索.json
+3
-3
基础数据.json
json/基础数据.json
+4
-10
已提交线索.json
json/已提交线索.json
+26
-0
已选择线索.json
json/已选择线索.json
+2
-13
创新游戏.xlsx
res/创新游戏.xlsx
+0
-0
剧情表.xlsx
res/剧情表.xlsx
+0
-0
线索表.xlsx
res/线索表.xlsx
+0
-0
clue.ts
src/biz/clue.ts
+143
-10
play.ts
src/biz/play.ts
+1
-0
router.ts
src/routers/router.ts
+32
-0
No files found.
json/全部线索.json
View file @
a190c046
{
{
...
@@ -158,12 +158,12 @@
...
@@ -158,12 +158,12 @@
{
{
"xsid"
:
"C032"
,
"xsid"
:
"C032"
,
"xsnr"
:
"测试线索5"
,
"xsnr"
:
"测试线索5"
,
"isChoice"
:
tru
e
"isChoice"
:
fals
e
},
},
{
{
"xsid"
:
"C033"
,
"xsid"
:
"C033"
,
"xsnr"
:
"测试线索6"
,
"xsnr"
:
"测试线索6"
,
"isChoice"
:
tru
e
"isChoice"
:
fals
e
},
},
{
{
"xsid"
:
"C034"
,
"xsid"
:
"C034"
,
...
...
json/基础数据.json
View file @
a190c046
{
{
{
{
"1727399696222"
:
{
"1727399696222"
:
{
"初始资金"
:
500
,
"初始资金"
:
500
,
"商行"
:
{
"天数"
:
1
,
"SO11"
:
{
"结算"
:
500
"当前对话id"
:
"15"
,
"已获得的线索"
:
[
"C003"
,
"C012"
]
}
}
}
}
}
}
\ No newline at end of file
json/已提交线索.json
0 → 100644
View file @
a190c046
{
{
"1727399696222"
:
{
"SWOT"
:
{
"isSubmit"
:
false
,
"S"
:
[],
"W"
:
[],
"O"
:
[],
"T"
:
[]
},
"ROI"
:
{
"isSubmit"
:
true
,
"R"
:
[],
"I"
:
[]
},
"竞合"
:
{
"isSubmit"
:
false
,
"供应商"
:
[],
"行业竞争"
:
[],
"跨界竞争"
:
[],
"潜在替代"
:
[],
"消费者"
:
[]
}
}
}
\ No newline at end of file
json/已选择线索.json
View file @
a190c046
{
{
...
@@ -14,18 +14,7 @@
...
@@ -14,18 +14,7 @@
"isChoice"
:
false
"isChoice"
:
false
}
}
],
],
"W"
:
[
"W"
:
[],
{
"xsid"
:
"C032"
,
"xsnr"
:
"测试线索5"
,
"isChoice"
:
false
},
{
"xsid"
:
"C033"
,
"xsnr"
:
"测试线索6"
,
"isChoice"
:
false
}
],
"O"
:
[
"O"
:
[
{
{
"xsid"
:
"C030"
,
"xsid"
:
"C030"
,
...
...
res/创新游戏.xlsx
View file @
a190c046
No preview for this file type
res/剧情表.xlsx
View file @
a190c046
No preview for this file type
res/线索表.xlsx
View file @
a190c046
No preview for this file type
src/biz/clue.ts
View file @
a190c046
...
@@ -27,10 +27,9 @@ export function getClue(clueType?) {
...
@@ -27,10 +27,9 @@ export function getClue(clueType?) {
writeClueAll
[
"1727399696222"
].
push
({
xsid
,
xsnr
,
isChoice
:
false
});
writeClueAll
[
"1727399696222"
].
push
({
xsid
,
xsnr
,
isChoice
:
false
});
})
})
if
(
!
clueType
)
addAllClue
(
writeClueAll
);
let
clueList
=
[];
let
clueList
=
[];
let
allClueJson
=
getJsonData
(
"json/全部线索.json"
);
let
allClueJson
=
getJsonData
(
"json/全部线索.json"
);
if
(
!
clueType
||
Object
.
keys
(
allClueJson
).
length
===
0
)
addAllClue
(
writeClueAll
);
if
(
clueType
)
{
if
(
clueType
)
{
clueData
[
clueType
].
forEach
(
info
=>
{
clueData
[
clueType
].
forEach
(
info
=>
{
allClueJson
[
"1727399696222"
].
forEach
(
thisClue
=>
{
allClueJson
[
"1727399696222"
].
forEach
(
thisClue
=>
{
...
@@ -114,8 +113,12 @@ export function submitClue(clueType) {
...
@@ -114,8 +113,12 @@ export function submitClue(clueType) {
//isSubmit:false【未提交】、true【提交】
//isSubmit:false【未提交】、true【提交】
baseData
[
"1727399696222"
][
clueType
][
"isSubmit"
]
=
true
;
baseData
[
"1727399696222"
][
clueType
][
"isSubmit"
]
=
true
;
changeJsonData
(
"json/已
选择
线索.json"
,
baseData
);
changeJsonData
(
"json/已
提交
线索.json"
,
baseData
);
console
.
log
(
"已提交线索"
);
console
.
log
(
"已提交线索"
);
/**清空原有剧情和线索 */
restart
();
return
"已提交线索"
;
return
"已提交线索"
;
}
}
...
@@ -178,6 +181,8 @@ export function delClue(clueType, xxType, xsid) {
...
@@ -178,6 +181,8 @@ export function delClue(clueType, xxType, xsid) {
}
}
export
function
getWages
(
gr
:
string
)
{
export
function
getWages
(
gr
:
string
)
{
let
excelData
=
gongziTableData
();
let
excelData
=
gongziTableData
();
let
wagesExcelData
=
excelData
[
'工资表'
].
dataList
;
let
wagesExcelData
=
excelData
[
'工资表'
].
dataList
;
...
@@ -195,6 +200,141 @@ export function getWages(gr:string) {
...
@@ -195,6 +200,141 @@ export function getWages(gr:string) {
}
}
/**
* 统计线索数量
* @param clueType
* @returns
*/
export
function
getCount
()
{
let
jsonData
=
getJsonData
(
"json/已选择线索.json"
);
let
clueData
=
jsonData
[
"1727399696222"
];
let
personalData
=
{
clue
:
0
,
tael
:
0
,
hire
:
0
};
// 线索数
for
(
let
type
in
clueData
)
{
for
(
let
key
in
clueData
[
type
])
{
if
(
key
!=
"isSubmit"
)
personalData
.
clue
+=
clueData
[
type
][
key
].
length
;
}
}
// 银两数
let
baseData
=
getJsonData
(
"json/基础数据.json"
);
personalData
.
tael
=
baseData
[
"1727399696222"
][
"结算"
]
||
0
;
// 雇佣人数
return
personalData
;
}
/**
* 基础数据【当前天数、银两数】
* @returns
*/
export
function
getBaseData
()
{
let
baseData
=
getJsonData
(
"json/基础数据.json"
);
let
basicsData
=
{
day
:
0
,
tael
:
0
}
basicsData
.
day
=
baseData
[
"1727399696222"
][
"天数"
];
basicsData
.
tael
=
baseData
[
"1727399696222"
][
"结算"
];
return
basicsData
;
}
/**结算页面 */
export
function
getSettlement
(
clueType
)
{
let
jsonData
=
getJsonData
(
"json/已提交线索.json"
);
let
clueData
=
jsonData
[
"1727399696222"
][
clueType
];
let
baseData
=
getJsonData
(
"json/基础数据.json"
);
let
settlement
=
{
isPass
:
89
,
clue
:
0
,
tael
:
0
,
hire
:
0
};
//是否通关
// let defaultMoney = baseData["1727399696222"]["初始资金"];
let
endMoney
=
baseData
[
"1727399696222"
][
"结算"
];
// if (endMoney > defaultMoney) settlement.isPass = "通关"
// 线索数
for
(
let
key
in
clueData
)
{
if
(
key
!=
"isSubmit"
)
settlement
.
clue
+=
clueData
[
key
].
length
;
}
// 银两数
settlement
.
tael
=
endMoney
;
// 雇佣人数
return
settlement
;
}
/**
* 清空原有剧情和线索
*/
export
function
restart
()
{
let
yxzxs
=
{
"1727399696222"
:{
"SWOT"
:{
"isSubmit"
:
false
,
"S"
:[],
"W"
:[],
"O"
:[],
"T"
:[]
},
"ROI"
:{
"isSubmit"
:
false
,
"R"
:[],
"I"
:[]
},
"竞合"
:{
"isSubmit"
:
false
,
"供应商"
:[],
"行业竞争"
:[],
"跨界竞争"
:[],
"潜在替代"
:[],
"消费者"
:[]
}
}
};
changeJsonData
(
"json/已选择线索.json"
,
yxzxs
);
let
jsonData
=
getJsonData
(
"json/全部线索.json"
);
let
qbData
=
{
"1727399696222"
:[]};
jsonData
[
"1727399696222"
].
forEach
(
info
=>
{
let
isChoice
=
false
;
info
.
isChoice
=
isChoice
;
qbData
[
1727399696222
].
push
(
info
);
})
changeJsonData
(
"json/全部线索.json"
,
qbData
);
let
jcsj
=
{
"1727399696222"
:{
"初始资金"
:
500
,
"天数"
:
1
,
"结算"
:
500
}
};
changeJsonData
(
"json/基础数据.json"
,
jcsj
);
console
.
log
(
"已清空内容"
);
return
true
;
}
...
@@ -227,10 +367,3 @@ export function getWages(gr:string) {
...
@@ -227,10 +367,3 @@ export function getWages(gr:string) {
src/biz/play.ts
View file @
a190c046
...
@@ -102,6 +102,7 @@ export function plotClues(type:string, playId:string, dhId:string, glxsid:string
...
@@ -102,6 +102,7 @@ export function plotClues(type:string, playId:string, dhId:string, glxsid:string
}
}
}
else
{
//已经有对应数据
}
else
{
//已经有对应数据
userData
=
baseData
[
"1727399696222"
];
userData
=
baseData
[
"1727399696222"
];
// userData["结算"] = baseData["1727399696222"]["结算"] + 50; //暂时一个剧情对话回合加50银两
if
(
!
userData
[
type
])
{
if
(
!
userData
[
type
])
{
userData
[
type
]
=
{};
userData
[
type
]
=
{};
if
(
!
userData
[
type
][
playId
])
userData
[
type
][
playId
]
=
{
"当前对话id"
:
""
,
"已获得的线索"
:[]};
if
(
!
userData
[
type
][
playId
])
userData
[
type
][
playId
]
=
{
"当前对话id"
:
""
,
"已获得的线索"
:[]};
...
...
src/routers/router.ts
View file @
a190c046
...
@@ -17,6 +17,10 @@ export function setRouter(httpServer){
...
@@ -17,6 +17,10 @@ export function setRouter(httpServer){
httpServer
.
post
(
'/delclue'
,
asyncHandler
(
delClue
));
httpServer
.
post
(
'/delclue'
,
asyncHandler
(
delClue
));
// httpServer.post('/choiceclueall', asyncHandler(choiceClueAll));
// httpServer.post('/choiceclueall', asyncHandler(choiceClueAll));
httpServer
.
post
(
'/wages'
,
asyncHandler
(
getWages
));
httpServer
.
post
(
'/wages'
,
asyncHandler
(
getWages
));
httpServer
.
post
(
'/personal'
,
asyncHandler
(
getCount
));
httpServer
.
post
(
'/settlement'
,
asyncHandler
(
getSettlement
));
httpServer
.
post
(
'/restart'
,
asyncHandler
(
restart
));
httpServer
.
post
(
'/basedata'
,
asyncHandler
(
getBaseData
));
}
}
...
@@ -114,6 +118,34 @@ function delClue(req, res) {
...
@@ -114,6 +118,34 @@ function delClue(req, res) {
}
}
/**统计获得线索数 */
function
getCount
(
req
,
res
)
{
let
result
=
clueBiz
.
getCount
();
res
.
success
(
result
);
}
/**基础数据 */
function
getBaseData
(
req
,
res
)
{
let
result
=
clueBiz
.
getBaseData
();
res
.
success
(
result
);
}
/**结算页面 */
function
getSettlement
(
req
,
res
)
{
let
{
clueType
}
=
req
.
body
;
let
result
=
clueBiz
.
getSettlement
(
clueType
);
res
.
success
(
result
);
}
/**重新开始 */
function
restart
(
req
,
res
)
{
let
result
=
clueBiz
.
restart
();
res
.
success
(
result
);
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment