Commit a07257ab by chenjinjing

no message

parent 0cf4b358
{
"1730359573927": {},
"1729153582461": {},
"1730359559228": {
"isSubmit": false,
"R": [],
"I": [
{
"xsid": "C030",
"xsnr": "工人辛 - 产量1650",
"isChoice": false
},
{
"xsid": "C033",
"xsnr": "画师3 - 产量1900",
"isChoice": false
},
{
"xsid": "C035",
"xsnr": "掌柜B - 产量1100",
"isChoice": false
}
]
}
}
\ No newline at end of file
{}
\ No newline at end of file
{
"1730359573927": {},
"1729153582461": {},
"1730359559228": {
"isSubmit": false,
"S": [
{
"xsid": "C014",
"xsnr": "熟悉整套生产运输流程",
"isChoice": false
},
{
"xsid": "C015",
"xsnr": "还有熟识的好友可以提供协助",
"isChoice": false
},
{
"xsid": "C016",
"xsnr": "流行的瓷器粗制滥造,市场难觅好的瓷器",
"isChoice": false
},
{
"xsid": "C017",
"xsnr": "资金匮乏",
"isChoice": false
},
{
"xsid": "C018",
"xsnr": "商人可选择带回国做贸易的商品众多",
"isChoice": false
}
],
"W": [],
"O": [
{
"xsid": "C019",
"xsnr": "虽然流行的瓷器品质一般,但数量众多",
"isChoice": false
}
],
"T": []
}
}
\ No newline at end of file
{}
\ No newline at end of file
{
{
{
"1727399696222": {
"初始资金": 500,
"天数": 1,
"天数": 12,
"结算": 500,
"广州府介绍": true,
"广州府介绍": false,
"酒馆剧情": 0,
"当前线索确认": 0,
"商行选择": false,
......@@ -11,40 +11,38 @@
"ROI": false,
"竞合": false
},
"1730359559228": {
"1729153582461": {
"初始资金": 500,
"天数": 4,
"结算": -214000,
"天数": 208,
"结算": 500,
"广州府介绍": false,
"酒馆剧情": 1,
"当前线索确认": 1,
"商行选择": true,
"酒馆剧情": 0,
"当前线索确认": 0,
"商行选择": false,
"SWOT": true,
"ROI": true,
"竞合": true,
"ROI": false,
"竞合": false,
"码头": {
"SO11": {
"当前对话id": "15",
"S011": {
"当前对话id": "18",
"已获得的线索": [
"C023",
"C013",
"C046",
"C047",
"C048",
"C049",
"C001",
"C002",
"C003",
"C012"
"C024"
]
}
},
"酒馆": {
"SO12_1": {
"当前对话id": "15",
"已获得的线索": []
}
}
},
"1729153582461": {
"1730359559228": {
"初始资金": 500,
"天数": 3,
"天数": 0,
"结算": 500,
"广州府介绍": false,
"广州府介绍": true,
"酒馆剧情": 0,
"当前线索确认": 0,
"商行选择": false,
......@@ -52,9 +50,9 @@
"ROI": false,
"竞合": false
},
"1730359573927": {
"1730970187744": {
"初始资金": 500,
"天数": 2,
"天数": 20,
"结算": 500,
"广州府介绍": false,
"酒馆剧情": 0,
......@@ -64,11 +62,11 @@
"ROI": false,
"竞合": false
},
"1730970187744": {
"1730359573927": {
"初始资金": 500,
"天数": 1,
"天数": 0,
"结算": 500,
"广州府介绍": false,
"广州府介绍": true,
"酒馆剧情": 0,
"当前线索确认": 0,
"商行选择": false,
......
{
{
{
"js":"十三行[Shísānháng]历史地名。位于广州市荔湾区沙面与文化公园的北面。清康熙二十五(1686),广州城西南江边开设洋货行,又称十三行。据谭元亨《十三行史稿》考证,“广州十三行与早先月港的,职能’一脉相承”。作者认为“十三行”一词缘起明代的月港:涵盖经营珠宝、棉布瓷器、丝绸、箍(豆饼)、铸鼎、糖、丝线、鱼、纸、茶、造船等13种行业。“十三行”是专称一个行业、一种职能,即明清对外贸易特有的机制与行当,其意义超越地域名、商馆数之名、资本集团之名以及制度名,而是历史之名,是传统的延续。 [13]十三只为特指数,不确实是十区。清乾隆二十二年(1757)-清道光二十二方允许的。"
"js":[
[
"你来自景德镇,曾官至从五品景德镇御窑驻厂协造,负责协助督陶官管理景德镇御窑厂务,负责具体的生产组织和协调工作。曾经参与设计过几款深得西宫赏喜爱的瓷器。",
"然而一次因为官瓷烧造质量问题,当任督陶官受到康熙帝问责,连你一并革职贬为庶民。",
"没了差事,做些什么好呢?你听闻南方广州府最近对外贸易很是活跃,想着是否可以去那儿看看有什么有意思的事情,顺便走访一下好友散散心。",
"于是,你带着自己这些年勤勤恳恳赚的俸禄,告别景德镇的一众好友,只身一人一路南下来到了广州府。"
],
[
"广州府是广东省的治所所在地,商贸繁荣,目前是整个清朝唯一的通商口岸,大量外国商人前来从事贸易活动,这也使得广州府成为了清朝与世界交流的重要窗口。此外,广州府的农业、手工业也十分发达,尤其是丝绸、制茶等行业,为当地经济注入了源源不断的活力。",
"广州十三行商,简称十三行,是广州府特许经营对外贸易的专业商行。十三行具有半官半商的性质,是清政府特许的外贸垄断组织。大量的外国商船在这里进行贸易,使得十三行成为了清朝与世界交易的中心。十三行也因此积累了大量的财富,有“金山珠海,天子南库”之称。",
"你望着十三行熙熙攘攘的人群, 想起前段时间的无妄之灾,释然的笑了笑,下定决心卷土重来。这正是:",
"革职南来意未休,",
"广州商海望风流。",
"东山再起非虚梦,",
"西洋贸易展宏猷。"
]
]
}
\ No newline at end of file
{
{
......@@ -10,16 +10,20 @@
"竞合": 0
},
"1730359559228": {
"SWOT": 14.285714285714285,
"ROI": 30,
"竞合": 17.77777777777778
"SWOT": 0,
"ROI": 0,
"竞合": 0
},
"1730359573927": {},
"1730970187744": {
"SWOT": 0,
"ROI": 0,
"竞合": 0
},
"1730359573927": {
"SWOT": 0,
"ROI": 0,
"竞合": 0
},
"1730970810891": {
"SWOT": 0,
"ROI": 0,
......
[
[
......@@ -2,7 +2,8 @@
{
"userId": "1727399696222",
"loginId": "玩家1",
"pwd": "123456"
"pwd": "123456",
"name": "小陈"
},
{
"userId": "1729153582461",
......@@ -15,18 +16,18 @@
"pwd": "123456"
},
{
"userId": "1730359573927",
"loginId": "123",
"pwd": "123"
},
{
"userId": "1730970187744",
"loginId": "111",
"pwd": "111"
"pwd": "123456"
},
{
"userId": 1730970810891,
"userId": "1730359573927",
"loginId": "222",
"pwd": "123456"
},
{
"userId": "1730970810891",
"loginId": "333",
"pwd": "333"
"pwd": "123456"
}
]
\ No newline at end of file
{
{}
{
"1729153582461": {},
"1730359573927": {},
"1730359559228": {}
}
\ No newline at end of file
{}
\ No newline at end of file
{
{
{
"SWOT": {
"S": [
"C014",
"C015"
"C002",
"C003",
"C004",
"C005"
],
"W": [
"C017"
"C006",
"C007",
"C008"
],
"O": [
"C016",
"C020"
"C012",
"C013",
"C014"
],
"T": [
"C018",
"C019"
"C009",
"C010",
"C011"
]
},
"ROI": {
"R": [
"C042",
"C043",
"C044",
"C045",
"C046"
"C046",
"C047",
"C048",
"C049"
],
"I": [
"C023",
"C024",
"C025",
"C026",
"C027",
"C028",
"C029",
......@@ -43,29 +44,31 @@
"C038",
"C039",
"C040",
"C041"
"C041",
"C042",
"C043",
"C044",
"C045"
]
},
"竞合": {
"供应商": [
"C003",
"C004"
"供": [
"C017",
"C018"
],
"行业竞争": [
"C005"
"现有竞争": [
"C019"
],
"跨界竞争": [
"C006",
"C007"
"潜在竞争": [
"C020"
],
"替代竞争": [
"C008",
"C009",
"C010"
"C021",
"C022"
],
"消费者": [
"C011"
"买方": [
"C023",
"C024"
]
},
"1730359573927": {}
}
}
\ No newline at end of file
{
{}
{
"1730359573927": {},
"1730359559228": {
"原材料": {
"瓷器": "C040",
"颜料": "C039"
},
"运输": "C037"
}
}
\ No newline at end of file
{}
\ No newline at end of file
No preview for this file type
No preview for this file type
......@@ -27,7 +27,7 @@ export function isEnabled(userId:string) {
/**
* 添加线索
* 添加线索 todo线索改为剧情走过才添加
* @param userId
*/
export function addClue(userId:string) {
......@@ -54,7 +54,7 @@ export function addClue(userId:string) {
/**
* 添加细分线索
* 添加细分线索 todo线索改为剧情走过才添加
*/
export function xfxxClue() {
let excelData = xiansuoTableData();
......@@ -62,7 +62,7 @@ export function xfxxClue() {
let clueExcelData = excelData["线索表"].dataList;
let swotClue = { "S":[], "W":[], "O":[], "T":[] };
let roiClue = { "R":[], "I":[] };
let jinheClue = { "供应商":[], "行业竞争":[], "跨界竞争":[], "替代竞争":[], "消费者":[] }
let jinheClue = { "供方":[], "现有竞争":[], "潜在竞争":[], "替代竞争":[], "买方":[] }
clueExcelData.forEach( info => {
let xslxxf = info.xslxxf;
for (let key in swotClue) {
......@@ -131,7 +131,7 @@ export function addAllClue(data) {
/**
* 线索
* 线索 todo线索改为剧情走过才添加
* 有参数返回对应线索类型数据,没有参数返回全部线索数据
* @param clueType 线索类型
* @returns
......
......@@ -4,7 +4,7 @@
* 分数计算规则:N/M*20
* M:线索总数
* N:选对线索数
* 1/5:细分线索类型数量(供应商、行业竞争、跨界竞争、替代竞争、消费者)
* 1/5:细分线索类型数量(供方、现有竞争、潜在竞争、替代竞争、买方)
*/
import { NOWCLUE } from "../config/enum";
......@@ -14,7 +14,7 @@ import { changeJsonData, getJsonData } from "../util/tools";
/**
* 竞合线索确认
* @param subdivide 细分线索类型【供应商、行业竞争、跨界竞争、替代竞争、消费者
* @param subdivide 细分线索类型【供方、现有竞争、潜在竞争、替代竞争、买方
* @param xs [{xsid:"", xsnr:""}, ...]
*/
export function submitJinheClue(userId, subdivide, xs) {
......@@ -26,11 +26,11 @@ export function submitJinheClue(userId, subdivide, xs) {
if (!jinheClueData[userId] || Object.keys(jinheClueData[userId]).length === 0) {
jinheClueData[userId] = {
"isSubmit": false,
"供应商": [],
"行业竞争": [],
"跨界竞争": [],
"供": [],
"现有竞争": [],
"潜在竞争": [],
"替代竞争": [],
"消费者": []
"买方": []
};
}
......@@ -87,7 +87,7 @@ export function checkJinhe(userId) {
let score = 0;
let conf = ["供应商", "行业竞争", "跨界竞争", "替代竞争", "消费者"];
let conf = ["供方", "现有竞争", "潜在竞争", "替代竞争", "买方"];
for (let i = 0; i < conf.length; i++) {
let allxf = xfclueROIJson[conf[i]] || []; //所有细分的线索
sumClue += allxf.length;
......
......@@ -22,6 +22,16 @@ import { addClue, xfxxClue } from "./clue";
export function getPlayData(userId:string, type:string, playId:string, dhId:string) {
let excelData = juqingTableData(type, playId);
/**获取玩家昵称 */
let userData = getJsonData("json/用户.json");
let name = "";
userData.forEach( info => {
if (info.userId == userId) {
if (info["name"]) name = info["name"]
else name = info.loginId;
}
})
let playData = excelData[playId].dataList;
let nextStory:any = {};
playData.forEach( info => {
......@@ -31,9 +41,21 @@ export function getPlayData(userId:string, type:string, playId:string, dhId:stri
//根据传入的id查找对应对话
nextStory = info;
nextStory["img"] = `${systemConfig.ipUrl}NPC/${glnpc}.png`;
if(nextStory.dhlx == "玩家") nextStory.glnpc = name;
//记录当前走到的剧情
plotClues(userId, type, playId, dhId, glxsid);
/**根据走过的剧情添加线索 */
}
});
......@@ -47,6 +69,7 @@ export function getPlayData(userId:string, type:string, playId:string, dhId:stri
}
nextStory.hzjq = dhStory;
nextStory.img = `${systemConfig.ipUrl}NPC/${nextStory.glnpc}.png`
if(nextStory.dhlx == "玩家") nextStory.glnpc = name;
}
if (nextStory.hzjqid == '999') {
......@@ -61,6 +84,22 @@ export function getPlayData(userId:string, type:string, playId:string, dhId:stri
}
}
return nextStory;
}
......@@ -75,6 +114,16 @@ export function getPlayData(userId:string, type:string, playId:string, dhId:stri
export function getJGPlayData(userId:string, type:string, playId:string, dhId:string) {
let allClueJson = getJsonData("json/基础数据.json");
/**获取玩家昵称 */
let userData = getJsonData("json/用户.json");
let name = "";
userData.forEach( info => {
if (info.userId == userId) {
if (info["name"]) name = info["name"]
else name = info.loginId;
}
})
let duihua = `${playId}_1`;
if (allClueJson[userId]["酒馆剧情"] > HARITYPE.未开始) {
duihua = `${playId}_${allClueJson[userId]["酒馆剧情"]}`;
......@@ -92,6 +141,7 @@ export function getJGPlayData(userId:string, type:string, playId:string, dhId:st
//根据传入的id查找对应对话
nextStory = info;
nextStory["img"] = `${systemConfig.ipUrl}NPC/${glnpc}.png`;
if(nextStory.dhlx == "玩家") nextStory.glnpc = name;
//记录当前走到的剧情
plotClues(userId, type, duihua, dhId, glxsid);
......@@ -112,6 +162,7 @@ export function getJGPlayData(userId:string, type:string, playId:string, dhId:st
}
nextStory.hzjq = dhStory;
nextStory.img = `${systemConfig.ipUrl}NPC/${nextStory.glnpc}.png`;
if(nextStory.dhlx == "玩家") nextStory.glnpc = name;
}
......@@ -167,7 +218,7 @@ export function plotClues(userId:string, type:string, playId:string, dhId:string
"天数":1,
"结算":500,
"广州府介绍": true, //广州府第一次介绍:true
"酒馆剧情": false, //酒馆已选择雇佣工人:true
"酒馆剧情": HARITYPE.未开始, //酒馆已选择雇佣工人:true
"当前线索确认": NOWCLUE.未开始,
"商行选择":false,
"SWOT": false,
......@@ -230,6 +281,7 @@ export function plotClues(userId:string, type:string, playId:string, dhId:string
if(!userData[type][playId]["已获得的线索"]) userData[type][playId]["已获得的线索"] = fruitsEmpty
else {
for(let i = 0; i < fruitsEmpty.length; i++) {
/**剧情相关线索 */
userData[type][playId]["已获得的线索"].push(fruitsEmpty[i]);
let uniqueArray = [...new Set(userData[type][playId]["已获得的线索"])];
userData[type][playId]["已获得的线索"] = uniqueArray;
......@@ -415,12 +467,13 @@ export function displayRawMaterial(userId) {
export function getGzf(userId) {
//获取已有json数据
let baseJsonData = getJsonData("json/基础数据.json");
let firstGzf = baseJsonData[userId]["广州府介绍"];
let writeBaseAll = baseJsonData;
writeBaseAll[userId]["广州府介绍"] = false;
changeJsonData("json/基础数据.json", writeBaseAll);
return {firstGzf:baseJsonData[userId]["广州府介绍"]};
return {firstGzf};
}
......
......@@ -63,7 +63,7 @@ import { changeJsonData, getJsonData } from "../util/tools";
let baseJsonData = getJsonData("json/基础数据.json");
baseJsonData[userId]["当前线索确认"] = NOWCLUE.SWOT;
baseJsonData[userId]["酒馆剧情"] = HARITYPE.已开始;
if (baseJsonData[userId]["酒馆剧情"] < HARITYPE.已开始) baseJsonData[userId]["酒馆剧情"] = HARITYPE.已开始;
changeJsonData("json/基础数据.json", baseJsonData);
return successResult();
......
......@@ -10,6 +10,7 @@ import { changeJsonData, getJsonData } from "../util/tools";
/**
* 登录账号的时候判断是否有初始化全部线索,没有的话写入全部线索json
* 基础数据没有的话也写入
* todo线索改为剧情走过才添加
*/
export function initAllClue(userId) {
let excelData = xiansuoTableData();
......
......@@ -23,12 +23,14 @@ export function login(loginId, pwd) {
/**判断是否有对应账号 */
let hasUser = userData.some(item => item.loginId === loginId);
if (!hasUser) throw new BizError(ERRORENUM.账号不存在);
let firstLogin = false;
userData.forEach( info => {
initAllClue(info.userId);
if (info.loginId == loginId) {
if (info.pwd != pwd) throw new BizError(ERRORENUM.账号或密码错误);
dataInfo = {userId:info.userId, loginId:info.loginId};
if (!info.name) firstLogin = true;
dataInfo = {userId:info.userId, loginId:info.loginId, firstLogin};
gameLoop(info.userId);
}
......@@ -108,17 +110,38 @@ export function getCount(userId) {
// 雇佣人数
let hireData = getJsonData("json/雇佣选择.json");
if (hireData[userId]) {
if (Object.keys(hireData[userId]).length != 0) {
if (!hireData[userId]["人工"]) hireData[userId]["人工"] = {}
if (Object.keys(hireData[userId]["人工"]).length != 0) {
personalData.hire = Object.keys(hireData[userId]["人工"]).length;
}
}
}
return personalData;
}
/**
* 修改昵称
* @param userId
*/
export function updateName(userId, name) {
let userData = getJsonData("json/用户.json");
userData.forEach( info => {
if (info.userId == userId) {
info["name"] = name;
}
})
changeJsonData("json/用户.json", userData);
return successResult();
}
......
......@@ -14,6 +14,7 @@ import { eccReqParamater } from '../tools/eccParam';
export function setRouter(httpServer){
httpServer.post('/login', asyncHandler(login));
httpServer.post('/updatename', asyncHandler(updateName));
httpServer.post('/register', asyncHandler(register));
httpServer.post('/basedata', asyncHandler(getBaseData));
httpServer.post('/personal', asyncHandler(getCount));
......@@ -42,19 +43,6 @@ export function setRouter(httpServer){
httpServer.post('/checkjinhe', asyncHandler(checkJinhe));
httpServer.post('/isenabled', asyncHandler(isEnabled));
// httpServer.post('/jgplay', asyncHandler(getJGPlay));
// httpServer.post('/submitswot', asyncHandler(submitSWOTClue));
// httpServer.post('/submitroi', asyncHandler(submitROIClue));
// httpServer.post('/submitjinhe', asyncHandler(submitJinheClue));
// httpServer.post('/addclue', asyncHandler(addClue));
// httpServer.post('/choiceclue', asyncHandler(getChoiceClue));
// httpServer.post('/delclue', asyncHandler(delClue));
// httpServer.post('/choiceclueall', asyncHandler(choiceClueAll));
// httpServer.post('/wages', asyncHandler(getWages));
// httpServer.post('/settlement', asyncHandler(getSettlement));
// httpServer.post('/restart', asyncHandler(restart));
}
......@@ -73,6 +61,18 @@ function login(req, res) {
/**
* 修改昵称
*/
function updateName(req, res) {
let userId = req.headers.userid;
let {name} = req.body;
let result = userBiz.updateName(userId, name);
res.success(result);
}
/**
* 注册
* @param req
* @param res
......@@ -123,21 +123,6 @@ function getPlay(req, res) {
/**
* 酒馆剧情 弃用
* @param req
* @param res
*/
// function getJGPlay(req, res) {
// let userId = req.headers.userid;
// // 对话Id(后置剧情id)
// let {dhId} = req.body;
// let result = playBiz.getJGPlayData(userId, dhId);
// res.success(result);
// }
/**
* 雇佣工人表格
* @param req
* @param res
......@@ -234,7 +219,7 @@ function getGzf(req, res) {
/**
* 广州府是否第一次阅读
* 广州府介绍
* @param req
* @param res
*/
......@@ -426,51 +411,6 @@ function checkJinhe(req, res) {
/**
* SWOT线索提交 弃用
* @param req
* @param res
*/
function submitSWOTClue(req, res) {
let userId = req.headers.userid;
let {subdivide, xs} = req.body;
let result = swotBiz.submitSWOTClue(userId, subdivide, xs);
res.success(result);
}
/**
* ROI线索提交 弃用
* @param req
* @param res
*/
function submitROIClue(req, res) {
let userId = req.headers.userid;
let {subdivide, xs} = req.body;
let result = roiBiz.submitROIClue(userId, subdivide, xs);
res.success(result);
}
/**
* 竞合线索提交 弃用
* @param req
* @param res
*/
function submitJinheClue(req, res) {
let userId = req.headers.userid;
let {subdivide, xs} = req.body;
let result = jinheBiz.submitJinheClue(userId, subdivide, xs);
res.success(result);
}
......
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