mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-04-16 21:02:42 +08:00
Compare commits
34 Commits
v2.0.0-bet
...
6a43a25a9b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a43a25a9b | ||
|
|
2eadb6fb23 | ||
|
|
d19afd7b1a | ||
|
|
98eda94f66 | ||
|
|
e0f5cb71c5 | ||
|
|
58140fd4d2 | ||
|
|
b44e0e65a5 | ||
|
|
cc460d6108 | ||
|
|
1dd1927612 | ||
|
|
21d4c9d568 | ||
|
|
35eac7d19d | ||
|
|
c1ed14385a | ||
|
|
50ad3d35e7 | ||
|
|
4df53d9f58 | ||
|
|
8a6f50dda6 | ||
|
|
49488505e2 | ||
|
|
dd64e8f44e | ||
|
|
b39772fd94 | ||
|
|
fc1135a621 | ||
|
|
d7ea91a1b8 | ||
|
|
53a8729968 | ||
|
|
ad93703a45 | ||
|
|
329c2f09c4 | ||
|
|
1f7434a133 | ||
|
|
145211ba9a | ||
|
|
1d58fd6bfd | ||
|
|
26d4e09bc8 | ||
|
|
49619fbaa2 | ||
|
|
751a0dec0f | ||
|
|
bc560c393b | ||
|
|
8eb0e44845 | ||
|
|
14f9340d0a | ||
|
|
5ba4fbb383 | ||
|
|
1c29c3a737 |
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"Laya"
|
||||
]
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
BIN
data/en-us/character.xlsx
Normal file
BIN
data/en-us/character.xlsx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
data/zh-cn/character.xlsx
Normal file
BIN
data/zh-cn/character.xlsx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"source": [
|
||||
"../../data/specialthanks-afd.xlsx",
|
||||
"../../data/specialthanks-dun.xlsx"
|
||||
],
|
||||
"target": "../../public/data"
|
||||
},
|
||||
{
|
||||
"source": "../../data/zh-cn",
|
||||
"target": "../../public/data/zh-cn"
|
||||
},
|
||||
{
|
||||
"source": "../../data/en-us",
|
||||
"target": "../../public/data/en-us"
|
||||
}
|
||||
]
|
||||
}
|
||||
1204
laya/pages/view/CyberTheme/Celebrity.ui
Normal file
1204
laya/pages/view/CyberTheme/Celebrity.ui
Normal file
File diff suppressed because it is too large
Load Diff
128
laya/pages/view/CyberTheme/Mode.ui
Normal file
128
laya/pages/view/CyberTheme/Mode.ui
Normal file
@@ -0,0 +1,128 @@
|
||||
{
|
||||
"x":0,
|
||||
"type":"View",
|
||||
"selectedBox":1,
|
||||
"selecteID":8,
|
||||
"props":{"width":1125,"sceneColor":"#000000","height":2436},
|
||||
"nodeParent":-1,
|
||||
"label":"View",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":1,
|
||||
"child":[
|
||||
{
|
||||
"x":15,
|
||||
"type":"Box",
|
||||
"props":{"y":10,"x":10,"width":600,"var":"btnCustom","runtime":"Laya.runtime.ScaleButton","name":"btn","height":400,"centerY":-400,"centerX":0},
|
||||
"nodeParent":1,
|
||||
"label":"Box(btnCustom)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":2,
|
||||
"child":[
|
||||
{
|
||||
"x":30,
|
||||
"type":"Image",
|
||||
"props":{"top":-15,"skin":"images/border/achievement_complete@3x.png","right":-15,"left":-15,"bottom":-15},
|
||||
"nodeParent":2,
|
||||
"label":"Image",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":10,
|
||||
"child":[
|
||||
]
|
||||
},
|
||||
{
|
||||
"x":30,
|
||||
"type":"Label",
|
||||
"props":{"top":50,"text":"UI_CustomMode","fontSize":80,"font":"方正像素12","color":"#ffffff","centerX":0,"bold":true},
|
||||
"nodeParent":2,
|
||||
"label":"Label",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":4,
|
||||
"child":[
|
||||
]
|
||||
},
|
||||
{
|
||||
"x":30,
|
||||
"type":"Label",
|
||||
"props":{"top":200,"text":"UI_CustomModeDescription","right":0,"left":0,"leading":20,"fontSize":40,"font":"方正像素12","color":"#bcbcbc","bottom":0,"align":"center"},
|
||||
"nodeParent":2,
|
||||
"label":"Label",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":5,
|
||||
"child":[
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"x":15,
|
||||
"type":"Box",
|
||||
"props":{"y":10,"x":20,"width":600,"var":"btnCelebrity","runtime":"Laya.runtime.ScaleButton","name":"btn","height":400,"centerY":400,"centerX":0},
|
||||
"nodeParent":1,
|
||||
"label":"Box(btnCelebrity)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":3,
|
||||
"child":[
|
||||
{
|
||||
"x":30,
|
||||
"type":"Image",
|
||||
"props":{"y":-15,"x":-15,"top":-15,"skin":"images/border/achievement_complete@3x.png","right":-15,"left":-15,"bottom":-15},
|
||||
"nodeParent":3,
|
||||
"label":"Image",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":11,
|
||||
"child":[
|
||||
]
|
||||
},
|
||||
{
|
||||
"x":30,
|
||||
"type":"Label",
|
||||
"props":{"top":50,"text":"UI_CelebrityMode","fontSize":80,"font":"方正像素12","color":"#ffffff","centerX":0,"bold":true},
|
||||
"nodeParent":3,
|
||||
"label":"Label",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":7,
|
||||
"child":[
|
||||
]
|
||||
},
|
||||
{
|
||||
"x":30,
|
||||
"type":"Label",
|
||||
"props":{"top":200,"text":"UI_CelebrityModeDescription","right":0,"left":0,"leading":20,"fontSize":40,"font":"方正像素12","color":"#bcbcbc","bottom":0,"align":"center"},
|
||||
"nodeParent":3,
|
||||
"label":"Label",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":8,
|
||||
"child":[
|
||||
]
|
||||
}]
|
||||
}],
|
||||
"animations":[
|
||||
{
|
||||
"nodes":[
|
||||
],
|
||||
"name":"ani1",
|
||||
"id":1,
|
||||
"frameRate":24,
|
||||
"action":0
|
||||
}]
|
||||
}
|
||||
306
laya/pages/view/DefaultTheme/Celebrity.ui
Normal file
306
laya/pages/view/DefaultTheme/Celebrity.ui
Normal file
@@ -0,0 +1,306 @@
|
||||
{
|
||||
"x":0,
|
||||
"type":"View",
|
||||
"selectedBox":1,
|
||||
"selecteID":28,
|
||||
"props":{"width":1125,"sceneColor":"#000000","height":2436},
|
||||
"nodeParent":-1,
|
||||
"label":"View",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":1,
|
||||
"child":[
|
||||
{
|
||||
"x":15,
|
||||
"type":"Label",
|
||||
"props":{"y":80,"text":"UI_Title_Celebrity","name":"title","fontSize":80,"font":"SimHei","color":"#ffffff","centerX":0},
|
||||
"nodeParent":1,
|
||||
"label":"Label(title)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":19,
|
||||
"child":[
|
||||
]
|
||||
},
|
||||
{
|
||||
"x":15,
|
||||
"type":"Panel",
|
||||
"props":{"var":"panelCharacter","vScrollBarSkin":" ","top":200,"right":0,"name":"panelCharacter","left":0,"bottom":700},
|
||||
"nodeParent":1,
|
||||
"label":"Panel(panelCharacter)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":2,
|
||||
"child":[
|
||||
{
|
||||
"x":30,
|
||||
"type":"VBox",
|
||||
"props":{"y":10,"width":1000,"var":"vboxCharacter","space":20,"name":"vboxCharacter","centerX":0},
|
||||
"nodeParent":2,
|
||||
"label":"VBox(vboxCharacter)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":8,
|
||||
"child":[
|
||||
{
|
||||
"x":45,
|
||||
"type":"Box",
|
||||
"props":{"right":0,"name":"boxCharacter","left":0},
|
||||
"nodeParent":8,
|
||||
"label":"Box(boxCharacter)",
|
||||
"isOpen":false,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":10,
|
||||
"child":[
|
||||
{
|
||||
"type":"Box",
|
||||
"props":{"y":0,"runtime":"Laya.runtime.ColorfulBox","right":0,"name":"boxName","left":0,"height":100},
|
||||
"nodeParent":10,
|
||||
"label":"Box(boxName)",
|
||||
"isOpen":false,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":12,
|
||||
"child":[
|
||||
{
|
||||
"type":"Label",
|
||||
"props":{"valign":"middle","text":"颜值10 智力10 体质10 家境Π","name":"label","fontSize":55,"font":"SimHei","color":"#ffffff","centerY":0,"centerX":0,"align":"center"},
|
||||
"nodeParent":12,
|
||||
"label":"Label(label)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":18,
|
||||
"child":[
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"type":"VBox",
|
||||
"props":{"top":100,"space":20,"runtime":"Laya.runtime.ColorfulBox","right":25,"name":"vboxStates","left":25},
|
||||
"nodeParent":10,
|
||||
"label":"VBox(vboxStates)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":11,
|
||||
"child":[
|
||||
{
|
||||
"type":"Label",
|
||||
"props":{"valign":"middle","text":"颜值10 智力10 体质10 家境Π","name":"label","height":100,"fontSize":55,"font":"SimHei","color":"#ffffff","centerX":0,"align":"center"},
|
||||
"nodeParent":11,
|
||||
"label":"Label(label)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":14,
|
||||
"child":[
|
||||
]
|
||||
}]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"x":45,
|
||||
"type":"Box",
|
||||
"props":{"runtime":"Laya.runtime.ColorfulBox","right":25,"name":"boxTalent","left":25,"height":100},
|
||||
"nodeParent":8,
|
||||
"label":"Box(boxTalent)",
|
||||
"isOpen":false,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":15,
|
||||
"child":[
|
||||
{
|
||||
"type":"Label",
|
||||
"props":{"valign":"middle","text":"颜值10 智力10 体质10 家境Π","name":"label","fontSize":50,"font":"SimHei","color":"#ffffff","centerY":0,"centerX":0,"align":"center"},
|
||||
"nodeParent":15,
|
||||
"label":"Label(label)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":17,
|
||||
"child":[
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"x":45,
|
||||
"type":"Box",
|
||||
"props":{"y":10,"x":10,"right":0,"name":"boxUniqueUnGenerate","left":0},
|
||||
"nodeParent":8,
|
||||
"label":"Box(boxUniqueUnGenerate)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":20,
|
||||
"child":[
|
||||
{
|
||||
"x":60,
|
||||
"type":"Box",
|
||||
"props":{"y":0,"runtime":"Laya.runtime.ColorfulBox","right":0,"name":"boxName","left":0,"height":100},
|
||||
"nodeParent":20,
|
||||
"label":"Box(boxName)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":21,
|
||||
"child":[
|
||||
{
|
||||
"x":75,
|
||||
"type":"Label",
|
||||
"props":{"valign":"middle","text":"UI_UniqueWaTaShi","name":"label","fontSize":55,"font":"SimHei","color":"#ffffff","centerY":0,"centerX":0,"align":"center"},
|
||||
"nodeParent":21,
|
||||
"label":"Label(label)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":22,
|
||||
"child":[
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"x":60,
|
||||
"type":"VBox",
|
||||
"props":{"top":100,"space":20,"runtime":"Laya.runtime.ColorfulBox","right":25,"name":"vboxStates","left":25},
|
||||
"nodeParent":20,
|
||||
"label":"VBox(vboxStates)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":23,
|
||||
"child":[
|
||||
{
|
||||
"x":75,
|
||||
"type":"Label",
|
||||
"props":{"y":1,"valign":"middle","text":"UI_UniqueWaTaShiContent","right":0,"name":"label","left":0,"leading":30,"fontSize":55,"font":"SimHei","color":"#ffffff","align":"center"},
|
||||
"nodeParent":23,
|
||||
"label":"Label(label)",
|
||||
"isOpen":true,
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":24,
|
||||
"child":[
|
||||
]
|
||||
},
|
||||
{
|
||||
"x":75,
|
||||
"type":"Box",
|
||||
"props":{"y":2,"right":0,"name":"boxBtn","left":0,"height":150},
|
||||
"nodeParent":23,
|
||||
"label":"Box(boxBtn)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":25,
|
||||
"child":[
|
||||
{
|
||||
"x":90,
|
||||
"type":"Box",
|
||||
"props":{"runtime":"Laya.runtime.ColorfulBox","right":50,"name":"btn","left":50,"height":120,"centerY":0},
|
||||
"nodeParent":25,
|
||||
"label":"Box(btn)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":26,
|
||||
"child":[
|
||||
{
|
||||
"x":105,
|
||||
"type":"Label",
|
||||
"props":{"y":30,"x":290,"text":"UI_GenerateNow","name":"label","fontSize":60,"font":"SimHei","color":"#ffffff","centerY":0,"centerX":0},
|
||||
"nodeParent":26,
|
||||
"label":"Label(label)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":27,
|
||||
"child":[
|
||||
]
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"x":15,
|
||||
"type":"Box",
|
||||
"props":{"width":480,"var":"btnRetry","runtime":"Laya.runtime.ColorfulBox","name":"btnRetry","height":150,"centerX":0,"bottom":400},
|
||||
"nodeParent":1,
|
||||
"label":"Box(btnRetry)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":4,
|
||||
"child":[
|
||||
{
|
||||
"x":30,
|
||||
"type":"Label",
|
||||
"props":{"text":"UI_AllNot","name":"label","fontSize":60,"font":"SimHei","color":"#ffffff","centerY":0,"centerX":0},
|
||||
"nodeParent":4,
|
||||
"label":"Label(label)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":5,
|
||||
"child":[
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"x":15,
|
||||
"type":"Box",
|
||||
"props":{"width":480,"var":"btnNext","runtime":"Laya.runtime.ColorfulBox","name":"btnNext","height":150,"centerX":0,"bottom":150},
|
||||
"nodeParent":1,
|
||||
"label":"Box(btnNext)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":6,
|
||||
"child":[
|
||||
{
|
||||
"x":30,
|
||||
"type":"Label",
|
||||
"props":{"text":"UI_Make_New_Life","name":"label","fontSize":60,"font":"SimHei","color":"#ffffff","centerY":0,"centerX":0},
|
||||
"nodeParent":6,
|
||||
"label":"Label(label)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":7,
|
||||
"child":[
|
||||
]
|
||||
}]
|
||||
}],
|
||||
"animations":[
|
||||
{
|
||||
"nodes":[
|
||||
],
|
||||
"name":"ani1",
|
||||
"id":1,
|
||||
"frameRate":24,
|
||||
"action":0
|
||||
}]
|
||||
}
|
||||
128
laya/pages/view/DefaultTheme/Mode.ui
Normal file
128
laya/pages/view/DefaultTheme/Mode.ui
Normal file
@@ -0,0 +1,128 @@
|
||||
{
|
||||
"x":0,
|
||||
"type":"View",
|
||||
"selectedBox":1,
|
||||
"selecteID":11,
|
||||
"props":{"width":1125,"sceneColor":"#000000","height":2436},
|
||||
"nodeParent":-1,
|
||||
"label":"View",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":1,
|
||||
"child":[
|
||||
{
|
||||
"x":15,
|
||||
"type":"Box",
|
||||
"props":{"width":600,"var":"btnCustom","runtime":"Laya.runtime.ColorfulBox","name":"btn","height":400,"centerY":-400,"centerX":0},
|
||||
"nodeParent":1,
|
||||
"label":"Box(btnCustom)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":2,
|
||||
"child":[
|
||||
{
|
||||
"x":30,
|
||||
"type":"Label",
|
||||
"props":{"top":50,"text":"UI_CustomMode","name":"font_default","fontSize":80,"font":"SimHei","color":"#ffffff","centerX":0,"bold":true},
|
||||
"nodeParent":2,
|
||||
"label":"Label(font_default)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":4,
|
||||
"child":[
|
||||
]
|
||||
},
|
||||
{
|
||||
"x":30,
|
||||
"type":"Label",
|
||||
"props":{"top":200,"text":"UI_CustomModeDescription","right":0,"name":"font_default","left":0,"leading":20,"fontSize":40,"font":"SimHei","color":"#ffffff","bottom":0,"align":"center"},
|
||||
"nodeParent":2,
|
||||
"label":"Label(font_default)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":5,
|
||||
"child":[
|
||||
]
|
||||
},
|
||||
{
|
||||
"x":30,
|
||||
"type":"Label",
|
||||
"props":{"runtime":"Laya.runtime.ColorAgentLabel","name":"label"},
|
||||
"nodeParent":2,
|
||||
"label":"Label(label)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":10,
|
||||
"child":[
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"x":15,
|
||||
"type":"Box",
|
||||
"props":{"x":10,"width":600,"var":"btnCelebrity","runtime":"Laya.runtime.ColorfulBox","name":"btn","height":400,"centerY":400,"centerX":0},
|
||||
"nodeParent":1,
|
||||
"label":"Box(btnCelebrity)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":3,
|
||||
"child":[
|
||||
{
|
||||
"x":30,
|
||||
"type":"Label",
|
||||
"props":{"top":50,"text":"UI_CelebrityMode","name":"font_default","fontSize":80,"font":"SimHei","color":"#ffffff","centerX":0,"bold":true},
|
||||
"nodeParent":3,
|
||||
"label":"Label(font_default)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":8,
|
||||
"child":[
|
||||
]
|
||||
},
|
||||
{
|
||||
"x":30,
|
||||
"type":"Label",
|
||||
"props":{"top":200,"text":"UI_CelebrityModeDescription","right":0,"name":"font_default","left":0,"leading":20,"fontSize":40,"font":"SimHei","color":"#ffffff","bottom":0,"align":"center"},
|
||||
"nodeParent":3,
|
||||
"label":"Label(font_default)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":9,
|
||||
"child":[
|
||||
]
|
||||
},
|
||||
{
|
||||
"x":30,
|
||||
"type":"Label",
|
||||
"props":{"y":10,"x":10,"runtime":"Laya.runtime.ColorAgentLabel","name":"label"},
|
||||
"nodeParent":3,
|
||||
"label":"Label(label)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":11,
|
||||
"child":[
|
||||
]
|
||||
}]
|
||||
}],
|
||||
"animations":[
|
||||
{
|
||||
"nodes":[
|
||||
],
|
||||
"name":"ani1",
|
||||
"id":1,
|
||||
"frameRate":24,
|
||||
"action":0
|
||||
}]
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"x":0,
|
||||
"type":"View",
|
||||
"selectedBox":1,
|
||||
"selecteID":153,
|
||||
"selecteID":95,
|
||||
"props":{"width":1125,"sceneColor":"#000000","runtime":"Laya.runtime.ViewBase","height":2436},
|
||||
"nodeParent":-1,
|
||||
"label":"View",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"x":0,
|
||||
"type":"Dialog",
|
||||
"selectedBox":1,
|
||||
"selecteID":15,
|
||||
"props":{"width":645,"sceneColor":"#000000","height":250},
|
||||
"selecteID":25,
|
||||
"props":{"width":645,"sceneColor":"#000000","height":400},
|
||||
"nodeParent":-1,
|
||||
"label":"Dialog",
|
||||
"isOpen":true,
|
||||
@@ -15,17 +15,16 @@
|
||||
{
|
||||
"x":15,
|
||||
"type":"Box",
|
||||
"props":{"top":0,"right":0,"left":0,"bottom":150},
|
||||
"props":{"top":0,"right":0,"left":0,"bottom":300},
|
||||
"nodeParent":1,
|
||||
"label":"Box",
|
||||
"isOpen":true,
|
||||
"isOpen":false,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":15,
|
||||
"child":[
|
||||
{
|
||||
"x":30,
|
||||
"type":"Box",
|
||||
"props":{"y":0,"x":0,"width":645,"height":2},
|
||||
"nodeParent":15,
|
||||
@@ -50,7 +49,6 @@
|
||||
}]
|
||||
},
|
||||
{
|
||||
"x":30,
|
||||
"type":"Box",
|
||||
"props":{"width":645,"height":2,"centerX":0,"bottom":0},
|
||||
"nodeParent":15,
|
||||
@@ -75,7 +73,6 @@
|
||||
}]
|
||||
},
|
||||
{
|
||||
"x":30,
|
||||
"type":"Box",
|
||||
"props":{"width":645,"height":100,"centerY":0,"centerX":0,"alpha":0.2},
|
||||
"nodeParent":15,
|
||||
@@ -87,7 +84,6 @@
|
||||
"compId":22,
|
||||
"child":[
|
||||
{
|
||||
"x":45,
|
||||
"type":"Rect",
|
||||
"props":{"width":645,"lineWidth":1,"height":100,"fillColor":"#000000"},
|
||||
"nodeParent":22,
|
||||
@@ -104,7 +100,7 @@
|
||||
{
|
||||
"x":15,
|
||||
"type":"TextInput",
|
||||
"props":{"wordWrap":false,"var":"input","valign":"middle","top":0,"text":"content","right":0,"overflow":"scroll","left":0,"fontSize":35,"font":"SimHei","color":"#ffffff","bottom":150},
|
||||
"props":{"wordWrap":false,"var":"input","valign":"middle","top":0,"text":"content","right":0,"overflow":"scroll","left":0,"fontSize":35,"font":"SimHei","color":"#ffffff","bottom":300},
|
||||
"nodeParent":1,
|
||||
"label":"TextInput(input)",
|
||||
"isDirectory":false,
|
||||
@@ -117,7 +113,7 @@
|
||||
{
|
||||
"x":15,
|
||||
"type":"Box",
|
||||
"props":{"width":120,"var":"btnSave","runtime":"Laya.runtime.ColorfulBox","name":"btnSmall","left":5,"height":120,"bottom":5,"anchorY":0.5,"anchorX":0.5},
|
||||
"props":{"width":120,"var":"btnSave","runtime":"Laya.runtime.ColorfulBox","name":"btnSmall","left":5,"height":120,"bottom":155,"anchorY":0.5,"anchorX":0.5},
|
||||
"nodeParent":1,
|
||||
"label":"Box(btnSave)",
|
||||
"isOpen":false,
|
||||
@@ -142,7 +138,7 @@
|
||||
{
|
||||
"x":15,
|
||||
"type":"Box",
|
||||
"props":{"width":120,"var":"btnLoad","runtime":"Laya.runtime.ColorfulBox","name":"btnSmall","left":130,"height":120,"bottom":5,"anchorY":0.5,"anchorX":0.5},
|
||||
"props":{"width":120,"var":"btnLoad","runtime":"Laya.runtime.ColorfulBox","name":"btnSmall","left":130,"height":120,"bottom":155,"anchorY":0.5,"anchorX":0.5},
|
||||
"nodeParent":1,
|
||||
"label":"Box(btnLoad)",
|
||||
"isOpen":false,
|
||||
@@ -167,7 +163,7 @@
|
||||
{
|
||||
"x":15,
|
||||
"type":"Box",
|
||||
"props":{"y":335,"width":120,"var":"btnRead","runtime":"Laya.runtime.ColorfulBox","name":"btnSmall","left":260,"height":120,"bottom":5,"anchorY":0.5,"anchorX":0.5},
|
||||
"props":{"width":120,"var":"btnRead","runtime":"Laya.runtime.ColorfulBox","name":"btnSmall","left":260,"height":120,"bottom":155,"anchorY":0.5,"anchorX":0.5},
|
||||
"nodeParent":1,
|
||||
"label":"Box(btnRead)",
|
||||
"isOpen":false,
|
||||
@@ -192,7 +188,7 @@
|
||||
{
|
||||
"x":15,
|
||||
"type":"Box",
|
||||
"props":{"y":335,"width":120,"var":"btnWrite","runtime":"Laya.runtime.ColorfulBox","name":"btnSmall","left":390,"height":120,"bottom":5,"anchorY":0.5,"anchorX":0.5},
|
||||
"props":{"width":120,"var":"btnWrite","runtime":"Laya.runtime.ColorfulBox","name":"btnSmall","left":390,"height":120,"bottom":155,"anchorY":0.5,"anchorX":0.5},
|
||||
"nodeParent":1,
|
||||
"label":"Box(btnWrite)",
|
||||
"isOpen":false,
|
||||
@@ -217,7 +213,7 @@
|
||||
{
|
||||
"x":15,
|
||||
"type":"Box",
|
||||
"props":{"y":10,"x":10,"width":120,"var":"btnClose","runtime":"Laya.runtime.ColorfulBox","right":5,"name":"btnSmall","height":120,"bottom":5,"anchorY":0.5,"anchorX":0.5},
|
||||
"props":{"x":10,"width":120,"var":"btnClose","runtime":"Laya.runtime.ColorfulBox","right":5,"name":"btnSmall","height":120,"bottom":155,"anchorY":0.5,"anchorX":0.5},
|
||||
"nodeParent":1,
|
||||
"label":"Box(btnClose)",
|
||||
"isOpen":false,
|
||||
@@ -238,6 +234,32 @@
|
||||
"child":[
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"x":15,
|
||||
"type":"Box",
|
||||
"props":{"y":20,"var":"btnBackup","runtime":"Laya.runtime.ColorfulBox","right":5,"name":"btnBackup","left":5,"height":120,"bottom":5,"anchorY":0.5,"anchorX":0.5},
|
||||
"nodeParent":1,
|
||||
"label":"Box(btnBackup)",
|
||||
"isOpen":true,
|
||||
"isDirectory":true,
|
||||
"isAniNode":true,
|
||||
"hasChild":true,
|
||||
"compId":25,
|
||||
"child":[
|
||||
{
|
||||
"x":30,
|
||||
"type":"Label",
|
||||
"props":{"text":"UI_BackupBtn","name":"label","fontSize":50,"font":"SimHei","color":"#ffffff","centerY":0,"centerX":0,"bold":true,"anchorY":0.5,"anchorX":0.5},
|
||||
"nodeParent":25,
|
||||
"label":"Label(label)",
|
||||
"isDirectory":false,
|
||||
"isAniNode":true,
|
||||
"hasChild":false,
|
||||
"compId":26,
|
||||
"child":[
|
||||
]
|
||||
}]
|
||||
}],
|
||||
"animations":[
|
||||
{
|
||||
|
||||
BIN
liferestartWX/.DS_Store
vendored
Normal file
BIN
liferestartWX/.DS_Store
vendored
Normal file
Binary file not shown.
18
liferestartWX/README.md
Normal file
18
liferestartWX/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# lifeRestartWX - 人生重开模拟器微信小程序版
|
||||
人生重开模拟器[微信小程序版](https://github.com/uiiang/lifeRestartWX)
|
||||
|
||||
## 简介
|
||||
- 根据[人生重开模拟器](https://github.com/VickScarlet/lifeRestart)开发的微信小程序版
|
||||
|
||||
- 数据和核心逻辑代码均采用VickScarlet版
|
||||
|
||||
## 开发笔记
|
||||
|
||||
- age, events, telents数据修改为微信本地读取js
|
||||
|
||||
## 快速体验
|
||||
|
||||
- 微信小程序搜索 奇奇怪怪的软件
|
||||
|
||||
- 微信扫描二维码
|
||||
<img src="/assets/images/app_qcode.jpg" width="40%">
|
||||
19
liferestartWX/app.js
Normal file
19
liferestartWX/app.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// app.js
|
||||
App({
|
||||
onLaunch() {
|
||||
// 展示本地存储能力
|
||||
const logs = wx.getStorageSync('logs') || []
|
||||
logs.unshift(Date.now())
|
||||
wx.setStorageSync('logs', logs)
|
||||
|
||||
// 登录
|
||||
wx.login({
|
||||
success: res => {
|
||||
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
||||
}
|
||||
})
|
||||
},
|
||||
globalData: {
|
||||
userInfo: null
|
||||
}
|
||||
})
|
||||
19
liferestartWX/app.json
Normal file
19
liferestartWX/app.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"pages":[
|
||||
"pages/index",
|
||||
"pages/talents",
|
||||
"pages/summary",
|
||||
"pages/trajectory",
|
||||
"pages/property",
|
||||
"pages/ranking"
|
||||
],
|
||||
"window":{
|
||||
"backgroundColor": "#000",
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarBackgroundColor": "#F6F6F6",
|
||||
"navigationBarTitleText": "人生重开模拟器",
|
||||
"navigationBarTextStyle": "black"
|
||||
},
|
||||
"style": "v2",
|
||||
"sitemapLocation": "sitemap.json"
|
||||
}
|
||||
14
liferestartWX/app.wxss
Normal file
14
liferestartWX/app.wxss
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* 全局样式表
|
||||
* 使用@import语句可以导入外联样式表,@import后跟需要导入的外联样式表的相对路径,用;表示语句结束
|
||||
* 如果需要增加额外的WXSS样式表, 直接import即可, 但需注意引用顺序
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@import 'assets/styles/weui.wxss';
|
||||
@import 'assets/styles/example.wxss';
|
||||
page {
|
||||
height: 100%;
|
||||
background-color: #222831;
|
||||
}
|
||||
BIN
liferestartWX/assets/.DS_Store
vendored
Normal file
BIN
liferestartWX/assets/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
liferestartWX/assets/images/app_qcode.jpg
Normal file
BIN
liferestartWX/assets/images/app_qcode.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
BIN
liferestartWX/assets/media/guide/001.mp3
Normal file
BIN
liferestartWX/assets/media/guide/001.mp3
Normal file
Binary file not shown.
BIN
liferestartWX/assets/media/guide/002.mp3
Normal file
BIN
liferestartWX/assets/media/guide/002.mp3
Normal file
Binary file not shown.
BIN
liferestartWX/assets/media/guide/003.mp3
Normal file
BIN
liferestartWX/assets/media/guide/003.mp3
Normal file
Binary file not shown.
BIN
liferestartWX/assets/media/guide/004.mp3
Normal file
BIN
liferestartWX/assets/media/guide/004.mp3
Normal file
Binary file not shown.
BIN
liferestartWX/assets/media/guide/005.mp3
Normal file
BIN
liferestartWX/assets/media/guide/005.mp3
Normal file
Binary file not shown.
BIN
liferestartWX/assets/media/guide/006.mp3
Normal file
BIN
liferestartWX/assets/media/guide/006.mp3
Normal file
Binary file not shown.
BIN
liferestartWX/assets/media/guide/007.mp3
Normal file
BIN
liferestartWX/assets/media/guide/007.mp3
Normal file
Binary file not shown.
BIN
liferestartWX/assets/media/guide/end_cheer_001.mp3
Normal file
BIN
liferestartWX/assets/media/guide/end_cheer_001.mp3
Normal file
Binary file not shown.
BIN
liferestartWX/assets/media/guide/start_cheer_001.mp3
Normal file
BIN
liferestartWX/assets/media/guide/start_cheer_001.mp3
Normal file
Binary file not shown.
97
liferestartWX/assets/styles/example.wxss
Normal file
97
liferestartWX/assets/styles/example.wxss
Normal file
@@ -0,0 +1,97 @@
|
||||
page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
color: rgba(0, 0, 0, .85);
|
||||
background-color: #f8f8f8;
|
||||
font-size: 16px;
|
||||
font-family: PingFang SC, Helvetica Neue, Hiragino Sans GB, Helvetica, Microsoft YaHei, Arial;
|
||||
-ms-text-size-adjust: 100%;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
.page__hd {
|
||||
padding: 40px;
|
||||
}
|
||||
|
||||
.page__bd {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.page__bd_spacing {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.page__ft {
|
||||
padding-bottom: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.page__title {
|
||||
text-align: left;
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.page__desc {
|
||||
margin-top: 5px;
|
||||
color: rgba(0, 0, 0, .45);
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
background-color: #ebebef;
|
||||
color: #bbb;
|
||||
text-align: center;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.sub-title {
|
||||
padding: 30rpx 30rpx 18rpx;
|
||||
font-size: 28rpx;
|
||||
color: rgba(0, 0, 0, .65);
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.button-sp-area {
|
||||
margin: 20px auto 0;
|
||||
width: 80%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn-area {
|
||||
margin: 1.17647059em 15px 0.3em;
|
||||
}
|
||||
|
||||
.btn-area button {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.btn-area button:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.text-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
position: relative;
|
||||
z-index: 1010;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
1019
liferestartWX/assets/styles/weui.wxss
Normal file
1019
liferestartWX/assets/styles/weui.wxss
Normal file
File diff suppressed because it is too large
Load Diff
BIN
liferestartWX/pages/.DS_Store
vendored
Normal file
BIN
liferestartWX/pages/.DS_Store
vendored
Normal file
Binary file not shown.
44
liferestartWX/pages/index.js
Normal file
44
liferestartWX/pages/index.js
Normal file
@@ -0,0 +1,44 @@
|
||||
// miniprogram/pages/liferestart/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
wx.showShareMenu({
|
||||
withShareTicket: true,
|
||||
menus: ['shareAppMessage', 'shareTimeline']
|
||||
})
|
||||
},
|
||||
toRanking(e) {
|
||||
wx.navigateTo({
|
||||
url: 'ranking'
|
||||
})
|
||||
},
|
||||
toTalents(e) {
|
||||
wx.navigateTo({
|
||||
url: 'talents'
|
||||
})
|
||||
},
|
||||
onShareTimeline(e) {
|
||||
return {
|
||||
title: "人生重开模拟器",
|
||||
imageUrl: "../../../images/liferestart_cover.jpg",
|
||||
}
|
||||
},
|
||||
onShareAppMessage: function () {
|
||||
return {
|
||||
title: '人生重开模拟器',
|
||||
imageUrl: '../../../images/liferestart_cover.jpg',
|
||||
path: '/pages/index/index',
|
||||
}
|
||||
},
|
||||
})
|
||||
8
liferestartWX/pages/index.json
Normal file
8
liferestartWX/pages/index.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"wux-icon": "/utils/wux/icon/index",
|
||||
"wux-button": "/utils/wux/button/index",
|
||||
"wux-wing-blank": "/utils/wux/wing-blank/index",
|
||||
"wux-white-space": "/utils/wux/white-space/index"
|
||||
}
|
||||
}
|
||||
19
liferestartWX/pages/index.wxml
Normal file
19
liferestartWX/pages/index.wxml
Normal file
@@ -0,0 +1,19 @@
|
||||
<!--miniprogram/pages/liferestart/index.wxml-->
|
||||
<view class="container">
|
||||
<view class="title1">人生重开模拟器</view>
|
||||
<view class="title2">这垃圾人生一秒也不想呆了</view>
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<view class="btn-view">
|
||||
<view bindtap="toTalents" class="btn">
|
||||
<view class="btn-text">立即重开</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="btn2-view">
|
||||
<view bindtap="toRanking" class="btn2">
|
||||
<view class="btn2-text">卷起来</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
80
liferestartWX/pages/index.wxss
Normal file
80
liferestartWX/pages/index.wxss
Normal file
@@ -0,0 +1,80 @@
|
||||
/* miniprogram/pages/liferestart/index.wxss */
|
||||
|
||||
.container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 100rpx 50rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #222831;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.title1 {
|
||||
font-size: 82rpx;
|
||||
color: white;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.title2 {
|
||||
font-size: 42rpx;
|
||||
color: white;
|
||||
background-size: cover;
|
||||
}
|
||||
.btn-view {
|
||||
display:flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.btn {
|
||||
width: 400rpx;
|
||||
height: 400rpx;
|
||||
|
||||
background-image: -webkit-radial-gradient(45px 45px, circle cover, #99CC33, #003366);
|
||||
|
||||
animation-name: spin;
|
||||
animation-duration: 3s; /* 3 seconds */
|
||||
animation-iteration-count: infinite;
|
||||
animation-timing-function: linear;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.btn-text {
|
||||
width: 400rpx;
|
||||
height: 400rpx;
|
||||
text-align: center;
|
||||
font-size: 82rpx;
|
||||
line-height: 400rpx;
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
.btn2-view {
|
||||
position:fixed;
|
||||
bottom:0;
|
||||
left:0;
|
||||
padding-left: 50px;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
.btn2 {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
|
||||
background-image: -webkit-radial-gradient(45px 45px, circle cover, #99CC33, #003366);
|
||||
|
||||
animation-name: spin;
|
||||
animation-duration: 3s; /* 3 seconds */
|
||||
animation-iteration-count: infinite;
|
||||
animation-timing-function: linear;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.btn2-text {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
text-align: center;
|
||||
font-size: 42rpx;
|
||||
line-height: 200rpx;
|
||||
color: white;
|
||||
}
|
||||
170
liferestartWX/pages/property.js
Normal file
170
liferestartWX/pages/property.js
Normal file
@@ -0,0 +1,170 @@
|
||||
// miniprogram/pages/liferestart/property.js
|
||||
import {
|
||||
$wuxToptips
|
||||
} from '../utils/wux/index';
|
||||
import {computeTalentsStatus, computeUseableProp, randomProp} from '../utils/liferestart/data/dataUtils.js';
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
propertyResidue : 0,
|
||||
propertyCHR : 0,
|
||||
propertyINT : 0,
|
||||
propertySTR : 0,
|
||||
propertyMNY : 0,
|
||||
propertyCHRMAX : 10,
|
||||
propertyINTMAX : 10,
|
||||
propertySTRMAX : 10,
|
||||
propertyMNYMAX : 10,
|
||||
propertyMaxInit : 0,
|
||||
selectedTalentsID : [],
|
||||
selectedTalents : []
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
wx.showShareMenu({
|
||||
withShareTicket: true,
|
||||
menus: ['shareAppMessage', 'shareTimeline']
|
||||
})
|
||||
this.computeProperty()
|
||||
},
|
||||
|
||||
randomProperty(e) {
|
||||
const arr = randomProp(this.data.propertyMaxInit, [10,10,10,10])
|
||||
// console.log('randomProperty', t, arr)
|
||||
this.setData({
|
||||
propertyCHR : 10 - arr[0],
|
||||
propertyINT : 10 - arr[1],
|
||||
propertySTR : 10 - arr[2],
|
||||
propertyMNY : 10 - arr[3],
|
||||
propertyCHRMAX : 10 - arr[0],
|
||||
propertyINTMAX : 10 - arr[1],
|
||||
propertySTRMAX : 10 - arr[2],
|
||||
propertyMNYMAX : 10 - arr[3],
|
||||
propertyResidue : 0
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
bron(e) {
|
||||
const tData = this.data
|
||||
if (tData.propertyResidue > 0) {
|
||||
$wuxToptips().error({
|
||||
hidden: false,
|
||||
text: '你还有'+tData.propertyResidue+'属性点没有分配完',
|
||||
duration: 5000,
|
||||
success() {},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
wx.setStorage({
|
||||
key: 'propertyCHR',
|
||||
data: tData.propertyCHR
|
||||
})
|
||||
wx.setStorage({
|
||||
key: 'propertyINT',
|
||||
data: tData.propertyINT
|
||||
})
|
||||
wx.setStorage({
|
||||
key: 'propertySTR',
|
||||
data: tData.propertySTR
|
||||
})
|
||||
wx.setStorage({
|
||||
key: 'propertyMNY',
|
||||
data: tData.propertyMNY
|
||||
})
|
||||
|
||||
wx.redirectTo({
|
||||
url: 'trajectory'
|
||||
})
|
||||
},
|
||||
|
||||
onChange(e) {
|
||||
const id = e.currentTarget.id
|
||||
const value = e.detail.value
|
||||
const tdata = this.data
|
||||
switch (id) {
|
||||
case 'propertyCHR':
|
||||
this.setData({
|
||||
propertyCHR : value
|
||||
})
|
||||
break
|
||||
case 'propertyINT':
|
||||
this.setData({
|
||||
propertyINT : value
|
||||
})
|
||||
break
|
||||
case 'propertySTR':
|
||||
this.setData({
|
||||
propertySTR : value
|
||||
})
|
||||
break
|
||||
case 'propertyMNY':
|
||||
this.setData({
|
||||
propertyMNY : value
|
||||
})
|
||||
break
|
||||
}
|
||||
// console.log(tdata.propertyCHR
|
||||
// , tdata.propertyINT
|
||||
// , tdata.propertySTR
|
||||
// , tdata.propertyMNY)
|
||||
var max = tdata.propertyMaxInit
|
||||
- tdata.propertyCHR
|
||||
- tdata.propertyINT
|
||||
- tdata.propertySTR
|
||||
- tdata.propertyMNY
|
||||
max = max < 0 ? 0 : max
|
||||
// console.log(id, value, max)
|
||||
this.setData({
|
||||
propertyResidue : max < 0 ? 0 : max,
|
||||
propertyCHRMAX : max + tdata.propertyCHR >= 10? 10 : max + tdata.propertyCHR,
|
||||
propertyINTMAX : max + tdata.propertyINT >= 10? 10 : max + tdata.propertyINT,
|
||||
propertySTRMAX : max + tdata.propertySTR >= 10? 10 : max + tdata.propertySTR,
|
||||
propertyMNYMAX : max + tdata.propertyMNY >= 10? 10 : max + tdata.propertyMNY,
|
||||
})
|
||||
// console.log(tdata.propertyCHRMAX,tdata.propertyINTMAX,tdata.propertySTRMAX,tdata.propertyMNYMAX)
|
||||
},
|
||||
|
||||
computeProperty: function() {
|
||||
const selectedTalents = wx.getStorageSync('selectedTalents')
|
||||
const selectedTalentsID = wx.getStorageSync('selectedTalentsID')
|
||||
console.log('selectedTalents', selectedTalents)
|
||||
var status = computeTalentsStatus(selectedTalents)
|
||||
// console.log('status', status)
|
||||
var proNum = computeUseableProp(20, status)
|
||||
this.setData({
|
||||
propertyResidue: proNum,
|
||||
propertyMaxInit: proNum,
|
||||
selectedTalents: selectedTalents,
|
||||
selectedTalentsID: selectedTalentsID
|
||||
})
|
||||
// console.log('proNum', proNum)
|
||||
},
|
||||
|
||||
onShareTimeline(e) {
|
||||
return {
|
||||
title: "人生重开模拟器",
|
||||
imageUrl: "../../../images/liferestart_cover.jpg",
|
||||
}
|
||||
},
|
||||
onShareAppMessage: function () {
|
||||
return {
|
||||
title: '人生重开模拟器',
|
||||
imageUrl: '../../../images/liferestart_cover.jpg',
|
||||
path: '/pages/index/index',
|
||||
}
|
||||
},
|
||||
// change(prop, value) {
|
||||
// if(Array.isArray(value)) {
|
||||
// for(const v of value)
|
||||
// this.change(prop, Number(v));
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
})
|
||||
11
liferestartWX/pages/property.json
Normal file
11
liferestartWX/pages/property.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"wux-toptips": "/utils/wux/toptips/index",
|
||||
"wux-button": "/utils/wux/button/index",
|
||||
"wux-cell-group": "/utils/wux/cell-group/index",
|
||||
"wux-cell": "/utils/wux/cell/index",
|
||||
"wux-input-number": "/utils/wux/input-number/index",
|
||||
"wux-wing-blank": "/utils/wux/wing-blank/index",
|
||||
"wux-white-space": "/utils/wux/white-space/index"
|
||||
}
|
||||
}
|
||||
44
liferestartWX/pages/property.wxml
Normal file
44
liferestartWX/pages/property.wxml
Normal file
@@ -0,0 +1,44 @@
|
||||
<!--miniprogram/pages/liferestart/property.wxml-->
|
||||
<wux-toptips id="wux-toptips" />
|
||||
|
||||
<view class="container">
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<view class="title1 wux-text--center">调整初始属性</view>
|
||||
<view class="title2 wux-text--center">可用属性点:{{propertyResidue}}</view>
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<wux-wing-blank size="large">
|
||||
<wux-cell-group>
|
||||
<wux-cell title="颜值" hover-class="none">
|
||||
<wux-input-number id="propertyCHR" value="{{ propertyCHR }}"
|
||||
controlled min="{{ 0 }}" max="{{ propertyCHRMAX }}" bind:change="onChange" longpress
|
||||
color="assertive" slot="footer" />
|
||||
</wux-cell>
|
||||
<wux-cell title="智力" hover-class="none">
|
||||
<wux-input-number id="propertyINT" value="{{ propertyINT }}"
|
||||
controlled min="{{ 0 }}" max="{{ propertyINTMAX }}" bind:change="onChange" longpress
|
||||
color="assertive" slot="footer" />
|
||||
</wux-cell>
|
||||
<wux-cell title="体质" hover-class="none">
|
||||
<wux-input-number id="propertySTR" value="{{ propertySTR }}"
|
||||
controlled min="{{ 0 }}" max="{{ propertySTRMAX }}" bind:change="onChange" longpress
|
||||
color="assertive" slot="footer" />
|
||||
</wux-cell>
|
||||
<wux-cell title="家境" hover-class="none">
|
||||
<wux-input-number id="propertyMNY" value="{{ propertyMNY }}"
|
||||
controlled min="{{ 0 }}" max="{{ propertyMNYMAX }}"bind:change="onChange" longpress
|
||||
color="assertive" slot="footer" />
|
||||
</wux-cell>
|
||||
</wux-cell-group>
|
||||
<wux-white-space size="large" />
|
||||
<view class="title2 wux-text--center">已选天赋</view>
|
||||
<view class="talentsTable">
|
||||
<block wx:for="{{selectedTalents}}" wx:key="*this">
|
||||
<view class="grade{{item.grade}}b">{{item.name}} ({{item.description}})</view>
|
||||
</block>
|
||||
</view>
|
||||
<wux-button block type="royal" bindtap="randomProperty">随机分配</wux-button>
|
||||
<wux-button block type="balanced" bindtap="bron">开启新人生</wux-button>
|
||||
</wux-wing-blank>
|
||||
</view>
|
||||
72
liferestartWX/pages/property.wxss
Normal file
72
liferestartWX/pages/property.wxss
Normal file
@@ -0,0 +1,72 @@
|
||||
/* miniprogram/pages/liferestart/property.wxss */
|
||||
/* miniprogram/pages/liferestart/index.wxss */
|
||||
@import '../utils/wux/styles/index.wxss';
|
||||
.container {
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
/* padding: 50rpx 100rpx; */
|
||||
box-sizing: border-box;
|
||||
background-color: #222831;
|
||||
/* color: #fff; */
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
position: static !important;
|
||||
}
|
||||
|
||||
.title1 {
|
||||
font-size: 82rpx;
|
||||
color: white;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.title2 {
|
||||
font-size: 42rpx;
|
||||
color: white;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.input {
|
||||
width: 120rpx !important;
|
||||
border-color: transparent !important;
|
||||
}
|
||||
|
||||
.sub,
|
||||
.add {
|
||||
width: 52rpx !important;
|
||||
border: 2rpx solid #ececec !important;
|
||||
border-radius: 10rpx !important;
|
||||
}
|
||||
|
||||
.talentsTable{
|
||||
width: 100%;
|
||||
position: relative;
|
||||
border: 1px #ccc solid;
|
||||
display: inline-block;
|
||||
margin: 0.1rem 2px;
|
||||
font-size: 42rpx;
|
||||
text-align: center;
|
||||
border-radius: 0.2rem;
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.grade0b {
|
||||
background-color: #464646;
|
||||
border: #f8f8f8 2px solid !important;
|
||||
}
|
||||
.grade1b {
|
||||
background-color: #6495ed;
|
||||
border: #f8f8f8 2px solid !important;
|
||||
}
|
||||
.grade2b {
|
||||
background-color: #e2a7ff;
|
||||
border: #f8f8f8 2px solid !important;
|
||||
}
|
||||
.grade3b {
|
||||
background-color: #ffa07a;
|
||||
border: #f8f8f8 2px solid !important;
|
||||
}
|
||||
45
liferestartWX/pages/ranking.js
Normal file
45
liferestartWX/pages/ranking.js
Normal file
@@ -0,0 +1,45 @@
|
||||
// miniprogram/page/liferestart/pages/ranking.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
rankingAGE: [],//最长寿
|
||||
rankingSPR: [],//最快乐
|
||||
rankingMNY: [],//最有钱
|
||||
rankingSTR: [],//最健康
|
||||
rankingINT: [],//最聪明
|
||||
rankingCHR: [],//最漂亮
|
||||
rankingSCO: [],//最NB
|
||||
},
|
||||
|
||||
loadRanking() {
|
||||
console.log('loadRanking')
|
||||
wx.cloud.callFunction({
|
||||
name: 'ranking',
|
||||
data: {
|
||||
handle: 'getRankingAll'
|
||||
}
|
||||
}).then(res => {
|
||||
console.log('ranking page ', res.result)
|
||||
this.setData({
|
||||
rankingAGE: res.result.recordAGE.data,//最长寿
|
||||
rankingSPR: res.result.recordSPR.data,//最快乐
|
||||
rankingMNY: res.result.recordMNY.data,//最有钱
|
||||
rankingSTR: res.result.recordSTR.data,//最健康
|
||||
rankingINT: res.result.recordINT.data,//最聪明
|
||||
rankingCHR: res.result.recordCHR.data,//最漂亮
|
||||
rankingSCO: res.result.recordFinal.data,//最NB
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
this.loadRanking()
|
||||
},
|
||||
|
||||
})
|
||||
9
liferestartWX/pages/ranking.json
Normal file
9
liferestartWX/pages/ranking.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"wux-button": "/utils/wux/button/index",
|
||||
"wux-row": "/utils/wux/row/index",
|
||||
"wux-col": "/utils/wux/col/index",
|
||||
"wux-wing-blank": "/utils/wux/wing-blank/index",
|
||||
"wux-white-space": "/utils/wux/white-space/index"
|
||||
}
|
||||
}
|
||||
29
liferestartWX/pages/ranking.wxml
Normal file
29
liferestartWX/pages/ranking.wxml
Normal file
@@ -0,0 +1,29 @@
|
||||
<import src="./ranking_item_template.wxml" />
|
||||
<view class="container">
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<view class="title1 wux-text--center">内卷世界</view>
|
||||
<wux-white-space size="large" />
|
||||
<wux-wing-blank size="large">
|
||||
|
||||
<template is="ranking_item" data="{{title_name:'最快乐',rankingData:rankingSPR,type:'rankingSPR'}}"/>
|
||||
|
||||
<template is="ranking_item" data="{{title_name:'最健康',rankingData:rankingSTR,type:'rankingSTR'}}"/>
|
||||
|
||||
<template is="ranking_item" data="{{title_name:'最长寿',rankingData:rankingAGE,type:'rankingAGE'}}"/>
|
||||
|
||||
<template is="ranking_item" data="{{title_name:'最有钱',rankingData:rankingMNY,type:'rankingMNY'}}"/>
|
||||
|
||||
<template is="ranking_item" data="{{title_name:'最聪明',rankingData:rankingINT,type:'rankingINT'}}"/>
|
||||
|
||||
<template is="ranking_item" data="{{title_name:'最漂亮',rankingData:rankingCHR,type:'rankingCHR'}}"/>
|
||||
|
||||
<template is="ranking_item" data="{{title_name:'最NB',rankingData:rankingSCO,type:'rankingSCO'}}"/>
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<wux-button block
|
||||
type="light" class="title2" bindtap="again">
|
||||
再来一次
|
||||
</wux-button>
|
||||
</wux-wing-blank>
|
||||
</view>
|
||||
76
liferestartWX/pages/ranking.wxss
Normal file
76
liferestartWX/pages/ranking.wxss
Normal file
@@ -0,0 +1,76 @@
|
||||
/* miniprogram/pages/liferestart/index.wxss */
|
||||
@import '../utils/wux/styles/index.wxss';
|
||||
.container {
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
/* padding: 50rpx 100rpx; */
|
||||
box-sizing: border-box;
|
||||
background-color: #222831;
|
||||
/* color: #fff; */
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
position: static !important;
|
||||
}
|
||||
|
||||
.title1 {
|
||||
font-size: 82rpx;
|
||||
color: white;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.title2 {
|
||||
font-size: 42rpx;
|
||||
color: white;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.rankingTable{
|
||||
width: 100%;
|
||||
position: relative;
|
||||
border: 1px #ccc solid;
|
||||
display: inline-block;
|
||||
padding: 6px 6px 6px 6px;
|
||||
font-size: 42rpx;
|
||||
text-align: center;
|
||||
border-radius: 0.2rem;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.userinfo-avatar {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
margin: 5rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.main {
|
||||
border-style: solid;
|
||||
border: 1px #ccc solid;
|
||||
border-width: 2px 2px;
|
||||
border-radius: 0.2rem;
|
||||
margin-top: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin-top: 10px;
|
||||
font-size: 42rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
|
||||
padding: 0 10px;
|
||||
border-bottom: 1px dashed #cecece;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.index {
|
||||
flex: 1;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.desc {
|
||||
flex: 4;
|
||||
color: #fff;
|
||||
}
|
||||
27
liferestartWX/pages/ranking_item_template.wxml
Normal file
27
liferestartWX/pages/ranking_item_template.wxml
Normal file
@@ -0,0 +1,27 @@
|
||||
<template name="ranking_item">
|
||||
<wux-white-space size="large" />
|
||||
<view class="title2 wux-text--center">{{title_name}}</view>
|
||||
<view class="rankingTable">
|
||||
<block wx:for="{{rankingData}}" wx:key="*this">
|
||||
<wux-row>
|
||||
<wux-col span="2">
|
||||
<view>
|
||||
<image class="userinfo-avatar" src="{{item.avatar_url.length>0?item.avatar_url:j%2?'https://mmbiz.qpic.cn/mmbiz_png/G4dLFC4lBdRbLc31wbuQNFicqASrMdIK6zSRHzz0Q79EPfa5mDn2d8Jfu6lRI2kXe4o2y2UibR5P6ic97sNFeUAEQ/0?wx_fmt=png':'https://mmbiz.qpic.cn/mmbiz_png/G4dLFC4lBdRbLc31wbuQNFicqASrMdIK6aGmbKnmjDIxrROurLe5gop744hE2NUzR929XN3grVtl0ia0k2ISV1vg/0?wx_fmt=png'}}" />
|
||||
</view>
|
||||
</wux-col>
|
||||
<wux-col span="7">
|
||||
<view>{{item.nick_name}}</view>
|
||||
</wux-col>
|
||||
<wux-col span="3">
|
||||
<view wx:if="{{type == 'rankingSPR'}}">{{item.recordSPR.value}} {{item.recordSPR.judge}}</view>
|
||||
<view wx:if="{{type == 'rankingSTR'}}">{{item.recordSTR.value}} {{item.recordSTR.judge}}</view>
|
||||
<view wx:if="{{type == 'rankingAGE'}}">{{item.recordAGE.value}} {{item.recordAGE.judge}}</view>
|
||||
<view wx:if="{{type == 'rankingMNY'}}">{{item.recordMNY.value}} {{item.recordMNY.judge}}</view>
|
||||
<view wx:if="{{type == 'rankingINT'}}">{{item.recordINT.value}} {{item.recordINT.judge}}</view>
|
||||
<view wx:if="{{type == 'rankingCHR'}}">{{item.recordCHR.value}} {{item.recordCHR.judge}}</view>
|
||||
<view wx:if="{{type == 'rankingSCO'}}">{{item.recordFinal.value}} {{item.recordFinal.judge}}</view>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
75
liferestartWX/pages/summary.js
Normal file
75
liferestartWX/pages/summary.js
Normal file
@@ -0,0 +1,75 @@
|
||||
// miniprogram/pages/liferestart/summary.js
|
||||
import {buildSummary,finalSummary} from "../utils/liferestart/data/dataUtils.js";
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
summaryCHR : {},
|
||||
summaryINT : {},
|
||||
summarySTR : {},
|
||||
summaryMNY : {},
|
||||
summaryFinal:{}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
wx.showShareMenu({
|
||||
withShareTicket: true,
|
||||
menus: ['shareAppMessage', 'shareTimeline']
|
||||
})
|
||||
this.initData()
|
||||
},
|
||||
|
||||
initData() {
|
||||
var nickName = "神秘人"
|
||||
var avatarUrl = ""
|
||||
wx.getUserInfo({
|
||||
success: function(res) {
|
||||
var userInfo = res.userInfo
|
||||
nickName = userInfo.nickName
|
||||
avatarUrl = userInfo.avatarUrl
|
||||
}
|
||||
})
|
||||
const record = wx.getStorageSync('currentRecord')
|
||||
const recordCHR = buildSummary(record, 'CHR')
|
||||
const recordINT = buildSummary(record, 'INT');
|
||||
const recordSTR = buildSummary(record, 'STR');
|
||||
const recordMNY = buildSummary(record, 'MNY');
|
||||
const recordSPR = buildSummary(record, 'SPR');
|
||||
const recordAGE = buildSummary(record, 'AGE');
|
||||
const recordFinal = finalSummary(record)
|
||||
|
||||
this.setData({
|
||||
summaryCHR : recordCHR,
|
||||
summaryINT : recordINT,
|
||||
summarySTR : recordSTR,
|
||||
summaryMNY : recordMNY,
|
||||
summarySPR : recordSPR,
|
||||
summaryAGE : recordAGE,
|
||||
summaryFinal : recordFinal
|
||||
})
|
||||
console.log('initData',this.data.summaryFinal)
|
||||
},
|
||||
again(e) {
|
||||
wx.redirectTo({
|
||||
url: 'index'
|
||||
})
|
||||
},
|
||||
onShareTimeline(e) {
|
||||
return {
|
||||
title: "人生重开模拟器",
|
||||
imageUrl: "../../../images/liferestart_cover.jpg",
|
||||
}
|
||||
},
|
||||
onShareAppMessage: function () {
|
||||
return {
|
||||
title: '人生重开模拟器',
|
||||
imageUrl: '../../../images/liferestart_cover.jpg',
|
||||
path: '/pages/index/index',
|
||||
}
|
||||
},
|
||||
})
|
||||
9
liferestartWX/pages/summary.json
Normal file
9
liferestartWX/pages/summary.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"wux-button": "/utils/wux/button/index",
|
||||
"wux-row": "/utils/wux/row/index",
|
||||
"wux-col": "/utils/wux/col/index",
|
||||
"wux-wing-blank": "/utils/wux/wing-blank/index",
|
||||
"wux-white-space": "/utils/wux/white-space/index"
|
||||
}
|
||||
}
|
||||
70
liferestartWX/pages/summary.wxml
Normal file
70
liferestartWX/pages/summary.wxml
Normal file
@@ -0,0 +1,70 @@
|
||||
<view class="container">
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<view class="title1 wux-text--center">人生总结</view>
|
||||
<wux-white-space size="large" />
|
||||
<wux-wing-blank size="large">
|
||||
<wux-row>
|
||||
<wux-col span="3">
|
||||
<view class="userinfo-avatar">
|
||||
<open-data type="userAvatarUrl"></open-data>
|
||||
</view>
|
||||
</wux-col>
|
||||
<wux-col span="9">
|
||||
<view class="userinfo-nickname">
|
||||
<open-data type="userNickName"></open-data> 的来生
|
||||
</view>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
|
||||
|
||||
<view>
|
||||
<wux-row>
|
||||
<wux-col span="12">
|
||||
<view class="lifeProperty grade{{summaryCHR.grade}}b">颜值:{{summaryCHR.value}} {{summaryCHR.judge}}</view>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
<wux-row>
|
||||
<wux-col span="12">
|
||||
<view class="lifeProperty grade{{summaryINT.grade}}b">智力:{{summaryINT.value}} {{summaryINT.judge}}</view>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
<wux-row>
|
||||
<wux-col span="12">
|
||||
<view class="lifeProperty grade{{summarySTR.grade}}b">体质:{{summarySTR.value}} {{summarySTR.judge}}</view>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
<wux-row>
|
||||
<wux-col span="12">
|
||||
<view class="lifeProperty grade{{summaryMNY.grade}}b">家境:{{summaryMNY.value}} {{summaryMNY.judge}}</view>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
<wux-row>
|
||||
<wux-col span="12">
|
||||
<view class="lifeProperty grade{{summarySPR.grade}}b">快乐:{{summarySPR.value}} {{summarySPR.judge}}</view>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
<wux-row class="">
|
||||
<wux-col span="12">
|
||||
<view class="lifeProperty grade{{summaryAGE.grade}}b">享年:{{summaryAGE.value}} {{summaryAGE.judge}}</view>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
<wux-row class="">
|
||||
<wux-col span="12">
|
||||
<view class="lifeProperty grade{{summaryFinal.grade}}b">总评:{{summaryFinal.value}} {{summaryFinal.judge}}</view>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
</view>
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<view class="qcode-view">
|
||||
<image class="qcode" src="../assets/images/app_qcode.jpg" />
|
||||
</view>
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<wux-button block
|
||||
type="light" class="title2" bindtap="again">
|
||||
再来一次
|
||||
</wux-button>
|
||||
</wux-wing-blank>
|
||||
</view>
|
||||
94
liferestartWX/pages/summary.wxss
Normal file
94
liferestartWX/pages/summary.wxss
Normal file
@@ -0,0 +1,94 @@
|
||||
/* miniprogram/pages/liferestart/index.wxss */
|
||||
@import '../utils/wux/styles/index.wxss';
|
||||
|
||||
.container {
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
/* padding: 50rpx 100rpx; */
|
||||
box-sizing: border-box;
|
||||
background-color: #222831;
|
||||
/* color: #fff; */
|
||||
}
|
||||
|
||||
|
||||
.checkbox {
|
||||
position: static !important;
|
||||
}
|
||||
|
||||
.title1 {
|
||||
font-size: 82rpx;
|
||||
color: white;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.title2 {
|
||||
font-size: 42rpx;
|
||||
color: white;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.main {
|
||||
border-style: solid;
|
||||
border: 1px #ccc solid;
|
||||
border-width: 2px 2px;
|
||||
border-radius: 0.2rem;
|
||||
margin-top: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.lifeProperty{
|
||||
|
||||
width: 100%;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
margin: 0.1rem 2px;
|
||||
font-size: 38rpx;
|
||||
text-align: center;
|
||||
border-radius: 0.2rem;
|
||||
color: white;
|
||||
border-bottom: 1px dashed #cecece;
|
||||
}
|
||||
|
||||
.grade0b {
|
||||
background-color: #464646;
|
||||
border: #f8f8f8 2px solid !important;
|
||||
}
|
||||
.grade1b {
|
||||
background-color: #6495ed;
|
||||
border: #f8f8f8 2px solid !important;
|
||||
}
|
||||
.grade2b {
|
||||
background-color: #e2a7ff;
|
||||
border: #f8f8f8 2px solid !important;
|
||||
}
|
||||
.grade3b {
|
||||
background-color: #ffa07a;
|
||||
border: #f8f8f8 2px solid !important;
|
||||
}
|
||||
.qcode-view {
|
||||
display:flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.qcode {
|
||||
width: 300rpx;
|
||||
height: 300rpx;
|
||||
|
||||
border-radius: 50%;
|
||||
}
|
||||
.userinfo-avatar {
|
||||
width: 160rpx;
|
||||
height: 150rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.userinfo-nickname {
|
||||
font-size: 42rpx;
|
||||
color: white;
|
||||
text-align: center;
|
||||
background-size: cover;
|
||||
}
|
||||
202
liferestartWX/pages/talents.js
Normal file
202
liferestartWX/pages/talents.js
Normal file
@@ -0,0 +1,202 @@
|
||||
// miniprogram/pages/liferestart/talents.js
|
||||
// 颜值 charm CHR
|
||||
// 智力 intelligence INT
|
||||
// 体质 strength STR
|
||||
// 家境 money MNY
|
||||
// 快乐 spirit SPR
|
||||
// 生命 life LIF
|
||||
// 天赋 talent TLT
|
||||
// 事件 event EVT
|
||||
import {
|
||||
$wuxToptips
|
||||
} from '../utils/wux/index';
|
||||
import {randomTalents,computeTalentsStatus, computeUseableProp, randomProp} from '../utils/liferestart/data/dataUtils.js';
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
talentsArray: [],
|
||||
selectedTalentsID:[],
|
||||
selectedTalents:[],
|
||||
showSelectTalents: false
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function () {
|
||||
// console.log('telents page onLoad')
|
||||
wx.showShareMenu({
|
||||
withShareTicket: true,
|
||||
menus: ['shareAppMessage', 'shareTimeline']
|
||||
})
|
||||
this.clearStorage()
|
||||
this.loadTalents()
|
||||
},
|
||||
|
||||
clearStorage: function() {
|
||||
this.setData({
|
||||
talentsArray: [],
|
||||
selectedTalentsID: [],
|
||||
selectedTalents: []
|
||||
})
|
||||
wx.removeStorageSync('selectedTalentsID')
|
||||
wx.removeStorageSync('selectedTalents')
|
||||
wx.removeStorageSync('propertyCHR')
|
||||
wx.removeStorageSync('propertyINT')
|
||||
wx.removeStorageSync('propertySTR')
|
||||
wx.removeStorageSync('propertyMNY')
|
||||
wx.removeStorageSync('currentRecord')
|
||||
wx.removeStorageSync('trajectory')
|
||||
},
|
||||
|
||||
loadTalents: function() {
|
||||
const showTalents = randomTalents(10)
|
||||
// console.log('telents page loadTalents', showTalents)
|
||||
this.setData({
|
||||
talentsArray: showTalents
|
||||
})
|
||||
},
|
||||
|
||||
onSelectTalents(e) {
|
||||
// console.log('onSelectTalents e',e)
|
||||
const selectedIndex = e.detail.selectedIndex
|
||||
const selectedValue = e.detail.selectedValue
|
||||
if (selectedValue.length > 3) {
|
||||
$wuxToptips().error({
|
||||
hidden: false,
|
||||
text: '只能选三个天赋',
|
||||
duration: 5000,
|
||||
success() {},
|
||||
})
|
||||
// e.detail.selectedValue.pop()
|
||||
e.detail.selectedIndex.pop()
|
||||
}// else {
|
||||
const tData = this.data
|
||||
|
||||
tData.talentsArray.forEach((item) => {
|
||||
item.disabled = false
|
||||
});
|
||||
tData.selectedTalents = []
|
||||
// console.log('selectedIndex',selectedValue)
|
||||
if (selectedValue.length == 3) {
|
||||
tData.talentsArray.forEach(function(item, idx) {
|
||||
// console.log('item',item._id,(selectedValue.includes(item._id)))
|
||||
if (selectedValue.includes(item._id)) {
|
||||
item.disabled = false
|
||||
} else {
|
||||
// console.log('item2',idx,item.inputChecked)
|
||||
item.disabled = true
|
||||
}
|
||||
})
|
||||
}
|
||||
selectedIndex.forEach(function (item, idx) {
|
||||
// for (var i = 0; i < selectedIndex.length; i++) {
|
||||
const currentTalents = tData.talentsArray[item]
|
||||
// console.log('currentTalents=',idx,currentTalents)
|
||||
tData.selectedTalents.push(currentTalents)
|
||||
if ('exclusive' in currentTalents) {
|
||||
const currexc = currentTalents.exclusive
|
||||
// console.log('currexc',currexc.length)
|
||||
currexc.forEach(function (itemexc, idxexc) {
|
||||
// console.log('currexc',itemexc)
|
||||
tData.talentsArray.forEach(function(itemTal, idxTal) {
|
||||
if (itemTal._id == itemexc) {
|
||||
// console.log('itemTal',itemTal)
|
||||
itemTal.disabled = itemTal._id == itemexc
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
this.setData({
|
||||
talentsArray: tData.talentsArray,
|
||||
selectedTalentsID: e.detail.selectedValue,
|
||||
selectedTalents: tData.selectedTalents
|
||||
})
|
||||
wx.setStorage({
|
||||
key: 'selectedTalentsID',
|
||||
data: this.data.selectedTalentsID
|
||||
})
|
||||
wx.setStorage({
|
||||
key: 'selectedTalents',
|
||||
data: tData.selectedTalents
|
||||
})
|
||||
// console.log('checkbox发生change事件,携带value值为:', this.data.selectedTalents)
|
||||
// }
|
||||
},
|
||||
showTalents(e) {
|
||||
this.setData({
|
||||
showSelectTalents: true
|
||||
})
|
||||
},
|
||||
randomLife(e) {
|
||||
const selectedTalents = randomTalents(3)
|
||||
const selectedTalentsID = selectedTalents.map(function(item) {
|
||||
return item._id
|
||||
});
|
||||
const status = computeTalentsStatus(selectedTalents)
|
||||
// console.log('status', status)
|
||||
const proNum = computeUseableProp(20, status)
|
||||
const arr = randomProp(proNum, [10,10,10,10])
|
||||
console.log('selectedTalentsID', selectedTalentsID, proNum, arr)
|
||||
wx.setStorage({
|
||||
key: 'selectedTalentsID',
|
||||
data: selectedTalentsID
|
||||
})
|
||||
wx.setStorage({
|
||||
key: 'selectedTalents',
|
||||
data: selectedTalents
|
||||
})
|
||||
wx.setStorage({
|
||||
key: 'propertyCHR',
|
||||
data: arr[0]
|
||||
})
|
||||
wx.setStorage({
|
||||
key: 'propertyINT',
|
||||
data: arr[1]
|
||||
})
|
||||
wx.setStorage({
|
||||
key: 'propertySTR',
|
||||
data: arr[2]
|
||||
})
|
||||
wx.setStorage({
|
||||
key: 'propertyMNY',
|
||||
data: arr[3]
|
||||
})
|
||||
wx.redirectTo({
|
||||
url: 'trajectory'
|
||||
})
|
||||
},
|
||||
|
||||
toProperty(e) {
|
||||
if (this.data.selectedTalents.length < 3) {
|
||||
$wuxToptips().error({
|
||||
hidden: false,
|
||||
text: '请选择三个天赋',
|
||||
duration: 5000,
|
||||
success() {},
|
||||
})
|
||||
} else {
|
||||
wx.redirectTo({
|
||||
url: 'property'
|
||||
})
|
||||
}
|
||||
},
|
||||
onShareTimeline(e) {
|
||||
return {
|
||||
title: "人生重开模拟器",
|
||||
imageUrl: "../../../images/liferestart_cover.jpg",
|
||||
}
|
||||
},
|
||||
onShareAppMessage: function () {
|
||||
return {
|
||||
title: '人生重开模拟器',
|
||||
imageUrl: '../../../images/liferestart_cover.jpg',
|
||||
path: '/pages/index/index',
|
||||
}
|
||||
},
|
||||
|
||||
})
|
||||
13
liferestartWX/pages/talents.json
Normal file
13
liferestartWX/pages/talents.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"wux-toptips": "/utils/wux/toptips/index",
|
||||
"wux-checkbox-group": "/utils/wux/checkbox-group/index",
|
||||
"wux-checkbox": "/utils/wux/checkbox/index",
|
||||
"wux-cell-group": "/utils/wux/cell-group/index",
|
||||
"wux-cell": "/utils/wux/cell/index",
|
||||
"wux-icon": "/utils/wux/icon/index",
|
||||
"wux-button": "/utils/wux/button/index",
|
||||
"wux-wing-blank": "/utils/wux/wing-blank/index",
|
||||
"wux-white-space": "/utils/wux/white-space/index"
|
||||
}
|
||||
}
|
||||
42
liferestartWX/pages/talents.wxml
Normal file
42
liferestartWX/pages/talents.wxml
Normal file
@@ -0,0 +1,42 @@
|
||||
<!--miniprogram/pages/liferestart/talents.wxml-->
|
||||
<wux-toptips id="wux-toptips" />
|
||||
<view class="container">
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<view class="title1 wux-text--center">天赋抽卡</view>
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<wux-wing-blank size="large" wx:if="{{showSelectTalents}}">
|
||||
<scroll-view style="height:100%;width:100%;display: flex;flex-direction: column;" scroll-y="true">
|
||||
<wux-checkbox-group name="talentsList"
|
||||
value="{{ selectedTalentsID }}"
|
||||
bind:change="onSelectTalents">
|
||||
<block wx:for="{{talentsArray}}" wx:key="*this">
|
||||
<wux-checkbox class="grade{{item.grade}}b"
|
||||
title="{{item.name}} ({{item.description}})"
|
||||
value="{{item._id}}" disabled="{{item.disabled?true:false}}"/>
|
||||
</block>
|
||||
</wux-checkbox-group>
|
||||
</scroll-view>
|
||||
<wux-white-space size="large" />
|
||||
<wux-button block bindtap="toProperty" type="light" class="title2">
|
||||
请选择3个
|
||||
</wux-button>
|
||||
</wux-wing-blank>
|
||||
<wux-wing-blank size="large" wx:if="{{!showSelectTalents}}">
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<view class="btn-view">
|
||||
<view bindtap="randomLife" class="btn">
|
||||
<view class="btn-text">盲盒人生</view>
|
||||
</view>
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<view bindtap="showTalents" class="btn">
|
||||
<view class="btn-text">十连抽</view>
|
||||
</view>
|
||||
</view>
|
||||
</wux-wing-blank>
|
||||
</view>
|
||||
87
liferestartWX/pages/talents.wxss
Normal file
87
liferestartWX/pages/talents.wxss
Normal file
@@ -0,0 +1,87 @@
|
||||
/* miniprogram/pages/liferestart/index.wxss */
|
||||
@import '../utils/wux/styles/index.wxss';
|
||||
.container {
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
/* padding: 50rpx 100rpx; */
|
||||
box-sizing: border-box;
|
||||
background-color: #222831;
|
||||
/* color: #fff; */
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
position: static !important;
|
||||
}
|
||||
|
||||
.title1 {
|
||||
font-size: 82rpx;
|
||||
color: white;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.title2 {
|
||||
font-size: 42rpx;
|
||||
color: white;
|
||||
background-size: cover;
|
||||
}
|
||||
.main {
|
||||
border-style: solid;
|
||||
border: 1px #ccc solid;
|
||||
border-width: 2px 2px;
|
||||
border-radius: 0.2rem;
|
||||
margin-top: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
.item {
|
||||
font-size: 32rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 10px;
|
||||
|
||||
}
|
||||
.btn-view {
|
||||
display:flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.btn {
|
||||
width: 400rpx;
|
||||
height: 400rpx;
|
||||
|
||||
background-image: -webkit-radial-gradient(45px 45px, circle cover, #99CC33, #003366);
|
||||
animation-name: spin;
|
||||
animation-duration: 3s; /* 3 seconds */
|
||||
animation-iteration-count: infinite;
|
||||
animation-timing-function: linear;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.btn-text {
|
||||
width: 400rpx;
|
||||
height: 400rpx;
|
||||
text-align: center;
|
||||
font-size: 82rpx;
|
||||
line-height: 400rpx;
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.grade0b {
|
||||
background-color: #464646;
|
||||
/* border: #f8f8f8 2px solid !important; */
|
||||
}
|
||||
.grade1b {
|
||||
background-color: #6495ed;
|
||||
/* border: #f8f8f8 2px solid !important; */
|
||||
}
|
||||
.grade2b {
|
||||
background-color: #e2a7ff;
|
||||
/* border: #f8f8f8 2px solid !important; */
|
||||
}
|
||||
.grade3b {
|
||||
background-color: #ffa07a;
|
||||
/* border: #f8f8f8 2px solid !important; */
|
||||
}
|
||||
106
liferestartWX/pages/trajectory.js
Normal file
106
liferestartWX/pages/trajectory.js
Normal file
@@ -0,0 +1,106 @@
|
||||
// miniprogram/pages/liferestart/trajectory.js
|
||||
import Life from "../utils/liferestart/life";
|
||||
import Property from "../utils/liferestart/property";
|
||||
import {allAge} from "../utils/liferestart/data/dataUtils.js";
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
propertyCHR : 0,
|
||||
propertyINT : 0,
|
||||
propertySTR : 0,
|
||||
propertyMNY : 0,
|
||||
selectedTalentsID : [],
|
||||
isEnd : false,
|
||||
items : []
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
this.initialData()
|
||||
},
|
||||
|
||||
initialData() {
|
||||
const tData = this.data
|
||||
const _this = this
|
||||
const propertyCHR = wx.getStorageSync('propertyCHR')
|
||||
const propertyINT = wx.getStorageSync('propertyINT')
|
||||
const propertySTR = wx.getStorageSync('propertySTR')
|
||||
const propertyMNY = wx.getStorageSync('propertyMNY')
|
||||
const selectedTalentsID = wx.getStorageSync('selectedTalentsID')
|
||||
|
||||
this.property = new Property(this);
|
||||
this.life = new Life(this)
|
||||
this.life.initial()
|
||||
|
||||
this.life.restart({
|
||||
CHR: propertyCHR,
|
||||
INT: propertyINT,
|
||||
STR: propertySTR,
|
||||
MNY: propertyMNY,
|
||||
SPR: 5,
|
||||
TLT: selectedTalentsID,
|
||||
});
|
||||
var trajectory = this.life.next()
|
||||
|
||||
wx.setStorage({
|
||||
key: 'currentRecord',
|
||||
data: this.life.getRecord()
|
||||
})
|
||||
const { age, content, isEnd } = trajectory
|
||||
tData.items.push(trajectory)
|
||||
const newprop = this.life.getLastRecord()
|
||||
_this.setData({
|
||||
items : tData.items,
|
||||
selectedTalentsID : selectedTalentsID,
|
||||
propertyCHR : newprop.CHR,
|
||||
propertyINT : newprop.INT,
|
||||
propertySTR : newprop.STR,
|
||||
propertyMNY : newprop.MNY,
|
||||
scrollTopVal: 0,
|
||||
isEnd: isEnd,
|
||||
pageHeight: wx.getSystemInfoSync().windowHeight - (isEnd?200:150),
|
||||
})
|
||||
|
||||
|
||||
|
||||
},
|
||||
nextAge(e) {
|
||||
const tData = this.data
|
||||
// console.log('trajectorypage nextAge')
|
||||
if (!tData.isEnd) {
|
||||
const _this = this
|
||||
var trajectory = this.life.next()
|
||||
const { age, content, isEnd } = trajectory
|
||||
tData.items.push(trajectory)
|
||||
const newprop = this.life.getLastRecord()
|
||||
_this.setData({
|
||||
items : tData.items,
|
||||
propertyCHR : newprop.CHR,
|
||||
propertyINT : newprop.INT,
|
||||
propertySTR : newprop.STR,
|
||||
propertyMNY : newprop.MNY,
|
||||
scrollTopVal: tData.items.length * 999,
|
||||
isEnd: isEnd,
|
||||
pageHeight: wx.getSystemInfoSync().windowHeight - (isEnd?200:150),
|
||||
})
|
||||
}
|
||||
},
|
||||
toSummary(e) {
|
||||
wx.setStorage({
|
||||
key: 'currentRecord',
|
||||
data: this.life.getRecord()
|
||||
})
|
||||
wx.setStorage({
|
||||
key: 'trajectory',
|
||||
data: this.data.items
|
||||
})
|
||||
wx.redirectTo({
|
||||
url: 'summary'
|
||||
})
|
||||
},
|
||||
})
|
||||
10
liferestartWX/pages/trajectory.json
Normal file
10
liferestartWX/pages/trajectory.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"wux-divider": "/utils/wux/divider/index",
|
||||
"wux-button": "/utils/wux/button/index",
|
||||
"wux-row": "/utils/wux/row/index",
|
||||
"wux-col": "/utils/wux/col/index",
|
||||
"wux-wing-blank": "/utils/wux/wing-blank/index",
|
||||
"wux-white-space": "/utils/wux/white-space/index"
|
||||
}
|
||||
}
|
||||
61
liferestartWX/pages/trajectory.wxml
Normal file
61
liferestartWX/pages/trajectory.wxml
Normal file
@@ -0,0 +1,61 @@
|
||||
<!--miniprogram/pages/liferestart/talents.wxml-->
|
||||
<view class="container">
|
||||
<wux-white-space size="large" />
|
||||
<wux-white-space size="large" />
|
||||
<wux-wing-blank size="large">
|
||||
<wux-row>
|
||||
<wux-col span="4">
|
||||
<view class="lifeProperty">颜值:{{propertyCHR}}</view>
|
||||
</wux-col>
|
||||
<wux-col span="4">
|
||||
<view class="lifeProperty">智力:{{propertyINT}}</view>
|
||||
</wux-col>
|
||||
<wux-col span="4">
|
||||
<view class="lifeProperty">体质:{{propertySTR}}</view>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
<wux-row>
|
||||
<wux-col span="6">
|
||||
<view class="lifeProperty">家境:{{propertyMNY}}</view>
|
||||
</wux-col>
|
||||
<wux-col span="6">
|
||||
<view class="lifeProperty">快乐:{{propertyMNY}}</view>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
<view class="main"
|
||||
bindtap="nextAge">
|
||||
<wux-wing-blank size="large">
|
||||
<scroll-view style="height:{{pageHeight}}px;width: 100%;display: flex;flex-direction: column;margin-top: 54rpx;" scroll-y="true" scroll-top="{{scrollTopVal}}" bindtap="resetInputStatus">
|
||||
<block wx:for="{{items}}" wx:key="index">
|
||||
<wux-row>
|
||||
<wux-col span="2">
|
||||
{{ item.age }}岁:
|
||||
</wux-col>
|
||||
<wux-col span="10">
|
||||
|
||||
<block wx:for="{{item.content}}" wx:for-item="itemContent" wx:key="index">
|
||||
<wux-row wx:if="{{itemContent.type == 'TLT'}}">
|
||||
<wux-col span="12">
|
||||
<view>天赋【{{itemContent.name}}】发动:{{itemContent.description}}</view>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
<wux-row wx:if="{{itemContent.type == 'EVT'}}">
|
||||
<wux-col span="12">
|
||||
<view>
|
||||
{{itemContent.description}} \r\n{{itemContent.postEvent}}</view>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
</block>
|
||||
</wux-col>
|
||||
</wux-row>
|
||||
<wux-divider show-text="{{ false }}" dashed />
|
||||
</block>
|
||||
</scroll-view>
|
||||
</wux-wing-blank>
|
||||
</view>
|
||||
<wux-button block wx:if="{{isEnd}}"
|
||||
type="light" class="title2" bindtap="toSummary">
|
||||
人生总结
|
||||
</wux-button>
|
||||
</wux-wing-blank>
|
||||
</view>
|
||||
71
liferestartWX/pages/trajectory.wxss
Normal file
71
liferestartWX/pages/trajectory.wxss
Normal file
@@ -0,0 +1,71 @@
|
||||
/* miniprogram/pages/liferestart/index.wxss */
|
||||
@import '../utils/wux/styles/index.wxss';
|
||||
.container {
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
/* padding: 50rpx 100rpx; */
|
||||
box-sizing: border-box;
|
||||
background-color: #222831;
|
||||
/* color: #fff; */
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
position: static !important;
|
||||
}
|
||||
|
||||
.title1 {
|
||||
font-size: 82rpx;
|
||||
color: white;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.title2 {
|
||||
font-size: 42rpx;
|
||||
color: white;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.lifeProperty{
|
||||
|
||||
width: 100%;
|
||||
position: relative;
|
||||
border: 1px #ccc solid;
|
||||
display: inline-block;
|
||||
margin: 0.1rem 2px;
|
||||
font-size: 1rem;
|
||||
text-align: center;
|
||||
border-radius: 0.2rem;
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
.main {
|
||||
border-style: solid;
|
||||
border: 1px #ccc solid;
|
||||
border-width: 2px 2px;
|
||||
border-radius: 0.2rem;
|
||||
margin-top: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin-top: 10px;
|
||||
font-size: 42rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
|
||||
padding: 0 10px;
|
||||
border-bottom: 1px dashed #cecece;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.index {
|
||||
flex: 1;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.desc {
|
||||
flex: 4;
|
||||
color: #fff;
|
||||
}
|
||||
68
liferestartWX/project.config.json
Normal file
68
liferestartWX/project.config.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"description": "项目配置文件",
|
||||
"packOptions": {
|
||||
"ignore": []
|
||||
},
|
||||
"setting": {
|
||||
"bundle": false,
|
||||
"userConfirmedBundleSwitch": false,
|
||||
"urlCheck": true,
|
||||
"scopeDataCheck": false,
|
||||
"coverView": true,
|
||||
"es6": true,
|
||||
"postcss": true,
|
||||
"compileHotReLoad": false,
|
||||
"lazyloadPlaceholderEnable": false,
|
||||
"preloadBackgroundData": false,
|
||||
"minified": true,
|
||||
"autoAudits": false,
|
||||
"newFeature": false,
|
||||
"uglifyFileName": false,
|
||||
"uploadWithSourceMap": true,
|
||||
"useIsolateContext": true,
|
||||
"nodeModules": false,
|
||||
"enhance": true,
|
||||
"useMultiFrameRuntime": true,
|
||||
"useApiHook": true,
|
||||
"useApiHostProcess": false,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"packNpmManually": false,
|
||||
"enableEngineNative": false,
|
||||
"packNpmRelationList": [],
|
||||
"minifyWXSS": true,
|
||||
"showES6CompileOption": false
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "2.19.4",
|
||||
"appid": "wx88fe4c0115ad33dd",
|
||||
"projectname": "liferestart",
|
||||
"debugOptions": {
|
||||
"hidedInDevtools": []
|
||||
},
|
||||
"scripts": {},
|
||||
"staticServerOptions": {
|
||||
"baseURL": "",
|
||||
"servePath": ""
|
||||
},
|
||||
"isGameTourist": false,
|
||||
"condition": {
|
||||
"search": {
|
||||
"list": []
|
||||
},
|
||||
"conversation": {
|
||||
"list": []
|
||||
},
|
||||
"game": {
|
||||
"list": []
|
||||
},
|
||||
"plugin": {
|
||||
"list": []
|
||||
},
|
||||
"gamePlugin": {
|
||||
"list": []
|
||||
},
|
||||
"miniprogram": {
|
||||
"list": []
|
||||
}
|
||||
}
|
||||
}
|
||||
7
liferestartWX/sitemap.json
Normal file
7
liferestartWX/sitemap.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
|
||||
"rules": [{
|
||||
"action": "allow",
|
||||
"page": "*"
|
||||
}]
|
||||
}
|
||||
144
liferestartWX/style/guide.wxss
Normal file
144
liferestartWX/style/guide.wxss
Normal file
@@ -0,0 +1,144 @@
|
||||
page {
|
||||
background: #f6f6f6;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.list {
|
||||
margin-top: 40rpx;
|
||||
height: auto;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
padding: 0 40rpx;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
transition: all 300ms ease;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
line-height: 104rpx;
|
||||
font-size: 34rpx;
|
||||
color: #007aff;
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-content: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.list-item:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.list-item image {
|
||||
max-width: 100%;
|
||||
max-height: 20vh;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
|
||||
.request-text {
|
||||
color: #222;
|
||||
padding: 20rpx 0;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.guide {
|
||||
width: 100%;
|
||||
padding: 40rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.guide .headline {
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
color: #555;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.guide .p {
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.guide .code {
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
color: #666;
|
||||
background: white;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.guide .code-dark {
|
||||
margin-top: 20rpx;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
padding: 20rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
border-radius: 6rpx;
|
||||
color: #fff;
|
||||
white-space: pre
|
||||
}
|
||||
|
||||
.guide image {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.guide .image1 {
|
||||
margin-top: 20rpx;
|
||||
max-width: 100%;
|
||||
width: 356px;
|
||||
height: 47px;
|
||||
}
|
||||
|
||||
.guide .image2 {
|
||||
margin-top: 20rpx;
|
||||
width: 264px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.guide .flat-image {
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.guide .code-image {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.guide .copyBtn {
|
||||
width: 180rpx;
|
||||
font-size: 20rpx;
|
||||
margin-top: 16rpx;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.guide .nav {
|
||||
margin-top: 50rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-content: space-between;
|
||||
}
|
||||
|
||||
.guide .nav .prev {
|
||||
margin-left: unset;
|
||||
}
|
||||
|
||||
.guide .nav .next {
|
||||
margin-right: unset;
|
||||
}
|
||||
|
||||
BIN
liferestartWX/utils/.DS_Store
vendored
Normal file
BIN
liferestartWX/utils/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
liferestartWX/utils/liferestart/.DS_Store
vendored
Normal file
BIN
liferestartWX/utils/liferestart/.DS_Store
vendored
Normal file
Binary file not shown.
1
liferestartWX/utils/liferestart/data/age.js
Normal file
1
liferestartWX/utils/liferestart/data/age.js
Normal file
File diff suppressed because one or more lines are too long
96
liferestartWX/utils/liferestart/data/dataUtils.js
Normal file
96
liferestartWX/utils/liferestart/data/dataUtils.js
Normal file
@@ -0,0 +1,96 @@
|
||||
|
||||
import talentsData from './talents.js';
|
||||
import ageData from './age.js';
|
||||
import eventsData from './events.js';
|
||||
import { max, sum } from '../functions/util.js';
|
||||
import { summary } from "../functions/summary.js";
|
||||
//"\d*": ->
|
||||
//"age": "(\d*)", -> "_id": "$1", "age": "$1",
|
||||
//"\d*": \{ -> {
|
||||
//"id": -> "_id":
|
||||
function allTalents() {
|
||||
// wx.setStorage({
|
||||
// key: 'talentsData',
|
||||
// data: talentsData
|
||||
// })
|
||||
return talentsData.slice(0)
|
||||
}
|
||||
function allAge() {
|
||||
// wx.setStorage({
|
||||
// key: 'agedata',
|
||||
// data: ageData
|
||||
// })
|
||||
return ageData.slice(0)
|
||||
}
|
||||
function allEvents() {
|
||||
// wx.setStorage({
|
||||
// key: 'eventsData',
|
||||
// data: eventsData
|
||||
// })
|
||||
return eventsData.slice(0)
|
||||
}
|
||||
|
||||
function randomTalents(max) {
|
||||
const result = getRandomInRange(talentsData, max)
|
||||
return result
|
||||
}
|
||||
function getRandomInRange(arr, count) {
|
||||
var shuffled = arr.slice(0), i = arr.length, min = i - count, temp, index;
|
||||
while (i-- > min) {
|
||||
index = Math.floor((i + 1) * Math.random());
|
||||
temp = shuffled[index];
|
||||
shuffled[index] = shuffled[i];
|
||||
shuffled[i] = temp;
|
||||
}
|
||||
return shuffled.slice(min).sort(function(a,b){return a-b;});
|
||||
}
|
||||
|
||||
function buildSummary(records, type) {
|
||||
const value = max(records.map(({[type]:v})=>v));
|
||||
const { judge, grade } = summary(type, value);
|
||||
return { judge, grade, value };
|
||||
}
|
||||
|
||||
function finalSummary(records) {
|
||||
const m = type=>max(records.map(({[type]: value})=>value));
|
||||
const value = Math.floor(sum(m('CHR'), m('INT'), m('STR'), m('MNY'), m('SPR'))*2 + m('AGE')/2);
|
||||
const { judge, grade } = summary('SUM', value);
|
||||
return { judge, grade, value };
|
||||
}
|
||||
|
||||
function computeTalentsStatus(talents) {
|
||||
var status = talents.map(function(item) {
|
||||
if ('status' in item) {
|
||||
return item.status
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
})
|
||||
return status
|
||||
}
|
||||
|
||||
function computeUseableProp(max, status) {
|
||||
var proNum = max
|
||||
status.forEach(function(item){
|
||||
proNum = proNum + item
|
||||
})
|
||||
return proNum
|
||||
}
|
||||
|
||||
function randomProp(max, init){
|
||||
// console.log('randomProperty', t)
|
||||
var arr = init
|
||||
while(max>0) {
|
||||
const sub = Math.round(Math.random() * (Math.min(max, 10) - 1)) + 1;
|
||||
while(true) {
|
||||
const select = Math.floor(Math.random() * 4) % 4;
|
||||
if(arr[select] - sub <0) continue;
|
||||
arr[select] -= sub;
|
||||
max -= sub;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return arr
|
||||
}
|
||||
|
||||
export { randomTalents, getRandomInRange, allTalents, allAge, allEvents, buildSummary, finalSummary, computeTalentsStatus, computeUseableProp, randomProp };
|
||||
1
liferestartWX/utils/liferestart/data/events.js
Normal file
1
liferestartWX/utils/liferestart/data/events.js
Normal file
File diff suppressed because one or more lines are too long
1
liferestartWX/utils/liferestart/data/talents.js
Normal file
1
liferestartWX/utils/liferestart/data/talents.js
Normal file
File diff suppressed because one or more lines are too long
61
liferestartWX/utils/liferestart/event.js
Normal file
61
liferestartWX/utils/liferestart/event.js
Normal file
@@ -0,0 +1,61 @@
|
||||
import { clone } from './functions/util.js';
|
||||
import { checkCondition } from './functions/condition.js';
|
||||
|
||||
class Event {
|
||||
constructor() {}
|
||||
|
||||
#events;
|
||||
|
||||
// 初始化传参数去掉{}
|
||||
initial(events) {
|
||||
this.#events = events;
|
||||
for(const id in events) {
|
||||
const event = events[id];
|
||||
if(!event.branch || !'branch' in event) continue;
|
||||
//判断事件是否被处理过
|
||||
event.branch = event.branch.map(b=>{
|
||||
b = b.indexOf(":") != -1?b.split(':'):b;
|
||||
b[1] = Number(b[1]);
|
||||
return b;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
check(eventId, property) {
|
||||
const { include, exclude, NoRandom } = this.get(eventId);
|
||||
if(NoRandom) return false;
|
||||
if(exclude && checkCondition(property, exclude)) return false;
|
||||
if(include) return checkCondition(property, include);
|
||||
return true;
|
||||
}
|
||||
|
||||
get(eventId) {
|
||||
// const event = this.#events[eventId];
|
||||
// console.log('event.js get',eventId, this.#events)
|
||||
var event
|
||||
this.#events.forEach(function(item){
|
||||
if (item._id == eventId) {
|
||||
event = item
|
||||
}
|
||||
})
|
||||
if(!event) throw new Error(`[ERROR] No Event[${eventId}]`);
|
||||
return clone(event);
|
||||
}
|
||||
|
||||
information(eventId) {
|
||||
const { event: description } = this.get(eventId)
|
||||
return { description };
|
||||
}
|
||||
|
||||
do(eventId, property) {
|
||||
const { effect, branch, event: description, postEvent } = this.get(eventId);
|
||||
if(branch)
|
||||
for(const [cond, next] of branch)
|
||||
if(checkCondition(property, cond))
|
||||
return { effect, next, description };
|
||||
return { effect, postEvent, description };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default Event;
|
||||
129
liferestartWX/utils/liferestart/functions/condition.js
Normal file
129
liferestartWX/utils/liferestart/functions/condition.js
Normal file
@@ -0,0 +1,129 @@
|
||||
function parseCondition(condition) {
|
||||
|
||||
const conditions = [];
|
||||
const length = condition.length;
|
||||
const stack = [];
|
||||
stack.unshift(conditions);
|
||||
let cursor = 0;
|
||||
const catchString = i => {
|
||||
const str = condition.substring(cursor, i).trim();
|
||||
cursor = i;
|
||||
if(str) stack[0].push(str);
|
||||
};
|
||||
|
||||
for(let i=0; i<length; i++) {
|
||||
switch(condition[i]) {
|
||||
case ' ': continue;
|
||||
|
||||
case '(':
|
||||
catchString(i);
|
||||
cursor ++;
|
||||
const sub = [];
|
||||
stack[0].push(sub);
|
||||
stack.unshift(sub);
|
||||
break;
|
||||
|
||||
case ')':
|
||||
catchString(i);
|
||||
cursor ++;
|
||||
stack.shift();
|
||||
break;
|
||||
|
||||
case '|':
|
||||
case '&':
|
||||
catchString(i);
|
||||
catchString(i+1);
|
||||
break;
|
||||
default: continue;
|
||||
}
|
||||
}
|
||||
|
||||
catchString(length);
|
||||
|
||||
return conditions;
|
||||
}
|
||||
|
||||
function checkCondition(property, condition) {
|
||||
const conditions = parseCondition(condition);
|
||||
return checkParsedConditions(property, conditions);
|
||||
}
|
||||
|
||||
function checkParsedConditions(property, conditions) {
|
||||
if(!Array.isArray(conditions)) return checkProp(property, conditions);
|
||||
if(conditions.length == 0) return true;
|
||||
if(conditions.length == 1) return checkParsedConditions(property, conditions[0]);
|
||||
|
||||
let ret = checkParsedConditions(property, conditions[0]);
|
||||
for(let i=1; i<conditions.length; i+=2) {
|
||||
switch(conditions[i]) {
|
||||
case '&':
|
||||
if(ret) ret = checkParsedConditions(property, conditions[i+1]);
|
||||
break;
|
||||
case '|':
|
||||
if(ret) return true;
|
||||
ret = checkParsedConditions(property, conditions[i+1]);
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
function checkProp(property, condition) {
|
||||
|
||||
const length = condition.length;
|
||||
let i = condition.search(/[><\!\?=]/);
|
||||
|
||||
const prop = condition.substring(0,i);
|
||||
const symbol = condition.substring(i, i+=(condition[i+1]=='='?2:1));
|
||||
const d = condition.substring(i, length);
|
||||
|
||||
const propData = property.get(prop);
|
||||
const conditionData = d[0]=='['? JSON.parse(d): Number(d);
|
||||
|
||||
switch(symbol) {
|
||||
case '>': return propData > conditionData;
|
||||
case '<': return propData < conditionData;
|
||||
case '>=': return propData >= conditionData;
|
||||
case '<=': return propData <= conditionData;
|
||||
case '=':
|
||||
if(Array.isArray(propData))
|
||||
return propData.includes(conditionData);
|
||||
return propData == conditionData;
|
||||
case '!=':
|
||||
if(Array.isArray(propData))
|
||||
return !propData.includes(conditionData);
|
||||
return propData == conditionData;
|
||||
case '?':
|
||||
if(Array.isArray(propData)) {
|
||||
for(const p of propData)
|
||||
if(conditionData.includes(p)) return true;
|
||||
return false;
|
||||
}
|
||||
return conditionData.includes(propData);
|
||||
case '!':
|
||||
if(Array.isArray(propData)) {
|
||||
for(const p of propData)
|
||||
if(conditionData.includes(p)) return false;
|
||||
return true;
|
||||
}
|
||||
return !conditionData.includes(propData);
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
function extractMaxTriggers(condition) {
|
||||
// Assuming only age related talents can be triggered multiple times.
|
||||
const RE_AGE_CONDITION = /AGE\?\[([0-9\,]+)\]/;
|
||||
const match_object = RE_AGE_CONDITION.exec(condition);
|
||||
if (match_object == null) {
|
||||
// Not age related, single trigger.
|
||||
return 1;
|
||||
}
|
||||
|
||||
const age_list = match_object[1].split(",");
|
||||
return age_list.length;
|
||||
}
|
||||
|
||||
export { checkCondition, extractMaxTriggers };
|
||||
89
liferestartWX/utils/liferestart/functions/summary.js
Normal file
89
liferestartWX/utils/liferestart/functions/summary.js
Normal file
@@ -0,0 +1,89 @@
|
||||
const data = {
|
||||
"CHR": [
|
||||
{"judge": "地狱", "grade": 0},
|
||||
{"min":1, "judge": "折磨", "grade": 0},
|
||||
{"min":2, "judge": "不佳", "grade": 0},
|
||||
{"min":4, "judge": "普通", "grade": 0},
|
||||
{"min":7, "judge": "优秀", "grade": 1},
|
||||
{"min":9, "judge": "罕见", "grade": 2},
|
||||
{"min":11, "judge": "逆天", "grade": 3},
|
||||
],
|
||||
"MNY": [
|
||||
{"judge": "地狱", "grade": 0},
|
||||
{"min":1, "judge": "折磨", "grade": 0},
|
||||
{"min":2, "judge": "不佳", "grade": 0},
|
||||
{"min":4, "judge": "普通", "grade": 0},
|
||||
{"min":7, "judge": "优秀", "grade": 1},
|
||||
{"min":9, "judge": "罕见", "grade": 2},
|
||||
{"min":11, "judge": "逆天", "grade": 3},
|
||||
],
|
||||
"SPR": [
|
||||
{"judge": "地狱", "grade": 0},
|
||||
{"min":1, "judge": "折磨", "grade": 0},
|
||||
{"min":2, "judge": "不幸", "grade": 0},
|
||||
{"min":4, "judge": "普通", "grade": 0},
|
||||
{"min":7, "judge": "幸福", "grade": 1},
|
||||
{"min":9, "judge": "极乐", "grade": 2},
|
||||
{"min":11, "judge": "天命", "grade": 3},
|
||||
],
|
||||
"INT": [
|
||||
{"judge": "地狱", "grade": 0},
|
||||
{"min":1, "judge": "折磨", "grade": 0},
|
||||
{"min":2, "judge": "不佳", "grade": 0},
|
||||
{"min":4, "judge": "普通", "grade": 0},
|
||||
{"min":7, "judge": "优秀", "grade": 1},
|
||||
{"min":9, "judge": "罕见", "grade": 2},
|
||||
{"min":11, "judge": "逆天", "grade": 3},
|
||||
{"min":21, "judge": "识海", "grade": 3},
|
||||
{"min":131, "judge": "元神", "grade": 3},
|
||||
{"min":501, "judge": "仙魂", "grade": 3},
|
||||
],
|
||||
"STR": [
|
||||
{"judge": "地狱", "grade": 0},
|
||||
{"min":1, "judge": "折磨", "grade": 0},
|
||||
{"min":2, "judge": "不佳", "grade": 0},
|
||||
{"min":4, "judge": "普通", "grade": 0},
|
||||
{"min":7, "judge": "优秀", "grade": 1},
|
||||
{"min":9, "judge": "罕见", "grade": 2},
|
||||
{"min":11, "judge": "逆天", "grade": 3},
|
||||
{"min":21, "judge": "凝气", "grade": 3},
|
||||
{"min":101, "judge": "筑基", "grade": 3},
|
||||
{"min":401, "judge": "金丹", "grade": 3},
|
||||
{"min":1001, "judge": "元婴", "grade": 3},
|
||||
{"min":2001, "judge": "仙体", "grade": 3},
|
||||
],
|
||||
"AGE": [
|
||||
{"judge": "胎死腹中", "grade": 0},
|
||||
{"min":1, "judge": "早夭", "grade": 0},
|
||||
{"min":10, "judge": "少年", "grade": 0},
|
||||
{"min":18, "judge": "盛年", "grade": 0},
|
||||
{"min":40, "judge": "中年", "grade": 0},
|
||||
{"min":60, "judge": "花甲", "grade": 1},
|
||||
{"min":70, "judge": "古稀", "grade": 1},
|
||||
{"min":80, "judge": "杖朝", "grade": 2},
|
||||
{"min":90, "judge": "南山", "grade": 2},
|
||||
{"min":95, "judge": "不老", "grade": 3},
|
||||
{"min":100, "judge": "修仙", "grade": 3},
|
||||
{"min":500, "judge": "仙寿", "grade": 3},
|
||||
],
|
||||
"SUM": [
|
||||
{"judge": "地狱", "grade": 0},
|
||||
{"min":41, "judge": "折磨", "grade": 0},
|
||||
{"min":50, "judge": "不佳", "grade": 0},
|
||||
{"min":60, "judge": "普通", "grade": 0},
|
||||
{"min":80, "judge": "优秀", "grade": 1},
|
||||
{"min":100, "judge": "罕见", "grade": 2},
|
||||
{"min":110, "judge": "逆天", "grade": 3},
|
||||
{"min":120, "judge": "传说", "grade": 3},
|
||||
]
|
||||
}
|
||||
|
||||
function summary(type, value) {
|
||||
let length = data[type].length;
|
||||
while(length--) {
|
||||
const {min, judge, grade} = data[type][length];
|
||||
if(min==void 0 || value >= min) return {judge, grade};
|
||||
}
|
||||
}
|
||||
|
||||
export { summary };
|
||||
31
liferestartWX/utils/liferestart/functions/util.js
Normal file
31
liferestartWX/utils/liferestart/functions/util.js
Normal file
@@ -0,0 +1,31 @@
|
||||
function clone(value) {
|
||||
switch(typeof value) {
|
||||
case 'object':
|
||||
if(Array.isArray(value)) return value.map(v=>clone(v));
|
||||
const newObj = {};
|
||||
for(const key in value) newObj[key] = clone(value[key]);
|
||||
return newObj;
|
||||
default: return value;
|
||||
}
|
||||
}
|
||||
|
||||
function max(...arr) {
|
||||
return Math.max(...arr.flat());
|
||||
}
|
||||
|
||||
function min(...arr) {
|
||||
return Math.min(...arr.flat());
|
||||
}
|
||||
|
||||
function sum(...arr) {
|
||||
let s = 0;
|
||||
arr.flat().forEach(v=>s+=v);
|
||||
return s;
|
||||
}
|
||||
|
||||
function average(...arr) {
|
||||
const s = sum(...arr);
|
||||
return s / arr.flat().length;
|
||||
}
|
||||
|
||||
export { clone, max, min, sum, average };
|
||||
135
liferestartWX/utils/liferestart/life.js
Normal file
135
liferestartWX/utils/liferestart/life.js
Normal file
@@ -0,0 +1,135 @@
|
||||
import Property from './property.js';
|
||||
import Event from './event.js';
|
||||
import Talent from './talent.js';
|
||||
import {allAge, allEvents, allTalents} from './data/dataUtils.js';
|
||||
|
||||
class Life {
|
||||
constructor() {
|
||||
this.#property = new Property();
|
||||
this.#event = new Event();
|
||||
this.#talent = new Talent();
|
||||
}
|
||||
|
||||
#property;
|
||||
#event;
|
||||
#talent;
|
||||
#triggerTalents;
|
||||
|
||||
async initial() {
|
||||
// console.log('life.js initial', property, event, talent)
|
||||
// 加载数据方式改为从本地读取JS
|
||||
var _this = this
|
||||
_this.#property.initial(allAge());
|
||||
_this.#talent.initial(allTalents());
|
||||
_this.#event.initial(allEvents());
|
||||
// console.log('life.js initial 2 p', _this.#property,'e', _this.#event, 'e',_this.#talent)
|
||||
// var age = []
|
||||
// var talents = []
|
||||
// var events = []
|
||||
// const age = await json('age');
|
||||
// const talents = await json('talents');
|
||||
// const events = await json('events');
|
||||
|
||||
}
|
||||
|
||||
restart(allocation) {
|
||||
this.#triggerTalents = {};
|
||||
this.#property.restart(allocation);
|
||||
this.doTalent();
|
||||
this.#property.record();
|
||||
}
|
||||
|
||||
getTalentAllocationAddition(talents) {
|
||||
return this.#talent.allocationAddition(talents);
|
||||
}
|
||||
|
||||
getTalentCurrentTriggerCount(talentId) {
|
||||
return this.#triggerTalents[talentId] || 0;
|
||||
}
|
||||
|
||||
next() {
|
||||
const {age, event, talent} = this.#property.ageNext();
|
||||
|
||||
const talentContent = this.doTalent(talent);
|
||||
const eventContent = this.doEvent(this.random(event));
|
||||
this.#property.record();
|
||||
|
||||
const isEnd = this.#property.isEnd();
|
||||
|
||||
const content = [talentContent, eventContent].flat();
|
||||
return { age, content, isEnd };
|
||||
}
|
||||
|
||||
doTalent(talents) {
|
||||
if(talents) this.#property.change(this.#property.TYPES.TLT, talents);
|
||||
talents = this.#property.get(this.#property.TYPES.TLT)
|
||||
.filter(talentId => this.getTalentCurrentTriggerCount(talentId) < this.#talent.get(talentId).max_triggers);
|
||||
|
||||
const contents = [];
|
||||
for(const talentId of talents) {
|
||||
const result = this.#talent.do(talentId, this.#property);
|
||||
if(!result) continue;
|
||||
this.#triggerTalents[talentId] = this.getTalentCurrentTriggerCount(talentId) + 1;
|
||||
const { effect, name, description, grade } = result;
|
||||
contents.push({
|
||||
type: this.#property.TYPES.TLT,
|
||||
name,
|
||||
grade,
|
||||
description,
|
||||
})
|
||||
if(!effect) continue;
|
||||
this.#property.effect(effect);
|
||||
}
|
||||
return contents;
|
||||
}
|
||||
|
||||
doEvent(eventId) {
|
||||
const { effect, next, description, postEvent } = this.#event.do(eventId, this.#property);
|
||||
this.#property.change(this.#property.TYPES.EVT, eventId);
|
||||
this.#property.effect(effect);
|
||||
const content = {
|
||||
type: this.#property.TYPES.EVT,
|
||||
description,
|
||||
postEvent,
|
||||
}
|
||||
if(next) return [content, this.doEvent(next)].flat();
|
||||
return [content];
|
||||
}
|
||||
|
||||
random(events) {
|
||||
events = events.filter(([eventId])=>this.#event.check(eventId, this.#property));
|
||||
|
||||
let totalWeights = 0;
|
||||
for(const [, weight] of events)
|
||||
totalWeights += weight;
|
||||
|
||||
let random = Math.random() * totalWeights;
|
||||
for(const [eventId, weight] of events)
|
||||
if((random-=weight)<0)
|
||||
return eventId;
|
||||
return events[events.length-1];
|
||||
}
|
||||
|
||||
talentRandom() {
|
||||
return this.#talent.talentRandom(JSON.parse(localStorage.extendTalent||'null'));
|
||||
}
|
||||
|
||||
talentExtend(talentId) {
|
||||
localStorage.extendTalent = JSON.stringify(talentId);
|
||||
}
|
||||
|
||||
getRecord() {
|
||||
return this.#property.getRecord();
|
||||
}
|
||||
|
||||
getLastRecord() {
|
||||
return this.#property.getLastRecord();
|
||||
}
|
||||
|
||||
exclusive(talents, exclusive) {
|
||||
return this.#talent.exclusive(talents, exclusive);
|
||||
}
|
||||
}
|
||||
|
||||
export default Life;
|
||||
|
||||
166
liferestartWX/utils/liferestart/property.js
Normal file
166
liferestartWX/utils/liferestart/property.js
Normal file
@@ -0,0 +1,166 @@
|
||||
import { clone } from './functions/util.js';
|
||||
|
||||
class Property {
|
||||
constructor() {}
|
||||
|
||||
TYPES = {
|
||||
AGE: "AGE",
|
||||
CHR: "CHR",
|
||||
INT: "INT",
|
||||
STR: "STR",
|
||||
MNY: "MNY",
|
||||
SPR: "SPR",
|
||||
LIF: "LIF",
|
||||
TLT: "TLT",
|
||||
EVT: "EVT",
|
||||
};
|
||||
|
||||
#ageData;
|
||||
#data;
|
||||
#record;
|
||||
|
||||
// 初始化传参数去掉{}
|
||||
initial(age) {
|
||||
|
||||
this.#ageData = age;
|
||||
for(const a in age) {
|
||||
let { event, talent } = age[a];
|
||||
if(!Array.isArray(event))
|
||||
event = event?.split(',') || [];
|
||||
|
||||
event = event.map(v=>{
|
||||
const value = `${v}`.split('*').map(n=>Number(n));
|
||||
if(value.length==1) value.push(1);
|
||||
return value;
|
||||
});
|
||||
|
||||
if(!Array.isArray(talent))
|
||||
talent = talent?.split(',') || [];
|
||||
|
||||
talent = talent.map(v=>Number(v));
|
||||
|
||||
age[a] = { event, talent };
|
||||
}
|
||||
}
|
||||
|
||||
restart(data) {
|
||||
this.#data = {
|
||||
[this.TYPES.AGE]: -1,
|
||||
[this.TYPES.CHR]: 0,
|
||||
[this.TYPES.INT]: 0,
|
||||
[this.TYPES.STR]: 0,
|
||||
[this.TYPES.MNY]: 0,
|
||||
[this.TYPES.SPR]: 0,
|
||||
[this.TYPES.LIF]: 1,
|
||||
[this.TYPES.TLT]: [],
|
||||
[this.TYPES.EVT]: [],
|
||||
};
|
||||
for(const key in data)
|
||||
this.change(key, data[key]);
|
||||
this.#record = [];
|
||||
}
|
||||
|
||||
get(prop) {
|
||||
switch(prop) {
|
||||
case this.TYPES.AGE:
|
||||
case this.TYPES.CHR:
|
||||
case this.TYPES.INT:
|
||||
case this.TYPES.STR:
|
||||
case this.TYPES.MNY:
|
||||
case this.TYPES.SPR:
|
||||
case this.TYPES.LIF:
|
||||
case this.TYPES.TLT:
|
||||
case this.TYPES.EVT:
|
||||
return clone(this.#data[prop]);
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
set(prop, value) {
|
||||
switch(prop) {
|
||||
case this.TYPES.AGE:
|
||||
case this.TYPES.CHR:
|
||||
case this.TYPES.INT:
|
||||
case this.TYPES.STR:
|
||||
case this.TYPES.MNY:
|
||||
case this.TYPES.SPR:
|
||||
case this.TYPES.LIF:
|
||||
case this.TYPES.TLT:
|
||||
case this.TYPES.EVT:
|
||||
this.#data[prop] = clone(value);
|
||||
break;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
record() {
|
||||
this.#record.push({
|
||||
[this.TYPES.AGE]: this.get(this.TYPES.AGE),
|
||||
[this.TYPES.CHR]: this.get(this.TYPES.CHR),
|
||||
[this.TYPES.INT]: this.get(this.TYPES.INT),
|
||||
[this.TYPES.STR]: this.get(this.TYPES.STR),
|
||||
[this.TYPES.MNY]: this.get(this.TYPES.MNY),
|
||||
[this.TYPES.SPR]: this.get(this.TYPES.SPR),
|
||||
});
|
||||
}
|
||||
|
||||
getRecord() {
|
||||
return clone(this.#record);
|
||||
}
|
||||
|
||||
getLastRecord() {
|
||||
return clone(this.#record[this.#record.length - 1]);
|
||||
}
|
||||
|
||||
change(prop, value) {
|
||||
if(Array.isArray(value)) {
|
||||
for(const v of value)
|
||||
this.change(prop, Number(v));
|
||||
return;
|
||||
}
|
||||
switch(prop) {
|
||||
case this.TYPES.AGE:
|
||||
case this.TYPES.CHR:
|
||||
case this.TYPES.INT:
|
||||
case this.TYPES.STR:
|
||||
case this.TYPES.MNY:
|
||||
case this.TYPES.SPR:
|
||||
case this.TYPES.LIF:
|
||||
this.#data[prop] += Number(value);
|
||||
break;
|
||||
case this.TYPES.TLT:
|
||||
case this.TYPES.EVT:
|
||||
const v = this.#data[prop];
|
||||
if(value<0) {
|
||||
const index = v.indexOf(value);
|
||||
if(index!=-1) v.splice(index,1);
|
||||
}
|
||||
if(!v.includes(value)) v.push(value);
|
||||
break;
|
||||
default: return;
|
||||
}
|
||||
}
|
||||
|
||||
effect(effects) {
|
||||
for(const prop in effects)
|
||||
this.change(prop, Number(effects[prop]));
|
||||
}
|
||||
|
||||
isEnd() {
|
||||
return this.get(this.TYPES.LIF) < 1;
|
||||
}
|
||||
|
||||
ageNext() {
|
||||
this.change(this.TYPES.AGE, 1);
|
||||
const age = this.get(this.TYPES.AGE);
|
||||
const {event, talent} = this.getAgeData(age);
|
||||
return {age, event, talent};
|
||||
}
|
||||
|
||||
getAgeData(age) {
|
||||
return clone(this.#ageData[age]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default Property;
|
||||
103
liferestartWX/utils/liferestart/talent.js
Normal file
103
liferestartWX/utils/liferestart/talent.js
Normal file
@@ -0,0 +1,103 @@
|
||||
import { clone } from './functions/util.js';
|
||||
import { checkCondition, extractMaxTriggers } from './functions/condition.js';
|
||||
|
||||
class Talent {
|
||||
constructor() {}
|
||||
|
||||
#talents;
|
||||
|
||||
// 初始化传参数去掉{}
|
||||
initial(talents) {
|
||||
this.#talents = talents;
|
||||
for(const id in talents) {
|
||||
const talent = talents[id];
|
||||
talent.id= Number(id);
|
||||
talent.grade = Number(talent.grade);
|
||||
talent.max_triggers = extractMaxTriggers(talent.condition);
|
||||
}
|
||||
}
|
||||
|
||||
check(talentId, property) {
|
||||
const { condition } = this.get(talentId);
|
||||
return checkCondition(property, condition);
|
||||
}
|
||||
|
||||
get(talentId) {
|
||||
// console.log('talent.js get',talentId,this.#talents)
|
||||
var talent
|
||||
this.#talents.forEach(function(item){
|
||||
if (item._id == talentId) {
|
||||
talent = item
|
||||
}
|
||||
})
|
||||
if(!talent) throw new Error(`[ERROR] No Talent[${talentId}]`);
|
||||
return clone(talent);
|
||||
}
|
||||
|
||||
information(talentId) {
|
||||
const { grade, name, description } = this.get(talentId)
|
||||
return { grade, name, description };
|
||||
}
|
||||
|
||||
exclusive(talends, exclusiveId) {
|
||||
const { exclusive } = this.get(exclusiveId);
|
||||
if(!exclusive) return null;
|
||||
for(const talent of talends) {
|
||||
for(const e of exclusive) {
|
||||
if(talent == e) return talent;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
talentRandom(include) {
|
||||
// 1000, 100, 10, 1
|
||||
const talentList = {};
|
||||
for(const talentId in this.#talents) {
|
||||
const { id, grade, name, description } = this.#talents[talentId];
|
||||
if(id == include) {
|
||||
include = { grade, name, description, id };
|
||||
continue;
|
||||
}
|
||||
if(!talentList[grade]) talentList[grade] = [{ grade, name, description, id }];
|
||||
else talentList[grade].push({ grade, name, description, id });
|
||||
}
|
||||
|
||||
return new Array(10)
|
||||
.fill(1).map((v, i)=>{
|
||||
if(!i && include) return include;
|
||||
const gradeRandom = Math.random();
|
||||
let grade;
|
||||
if(gradeRandom>=0.111) grade = 0;
|
||||
else if(gradeRandom>=0.011) grade = 1;
|
||||
else if(gradeRandom>=0.001) grade = 2;
|
||||
else grade = 3;
|
||||
|
||||
while(talentList[grade].length == 0) grade--;
|
||||
|
||||
const length = talentList[grade].length;
|
||||
|
||||
const random = Math.floor(Math.random()*length) % length;
|
||||
return talentList[grade].splice(random,1)[0];
|
||||
});
|
||||
}
|
||||
|
||||
allocationAddition(talents) {
|
||||
if(Array.isArray(talents)) {
|
||||
let addition = 0;
|
||||
for(const talent of talents)
|
||||
addition += this.allocationAddition(talent);
|
||||
return addition;
|
||||
}
|
||||
return Number(this.get(talents).status) || 0;
|
||||
}
|
||||
|
||||
do(talentId, property) {
|
||||
const { effect, condition, grade, name, description } = this.get(talentId);
|
||||
if(condition && !checkCondition(property, condition))
|
||||
return null;
|
||||
return { effect, grade, name, description };
|
||||
}
|
||||
}
|
||||
|
||||
export default Talent;
|
||||
BIN
liferestartWX/utils/wux/.DS_Store
vendored
Normal file
BIN
liferestartWX/utils/wux/.DS_Store
vendored
Normal file
Binary file not shown.
1
liferestartWX/utils/wux/actionsheet/index.js
Normal file
1
liferestartWX/utils/wux/actionsheet/index.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames7=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(n,!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var defaults={prefixCls:"wux-actionsheet",theme:"ios",className:"",titleText:"",buttons:[],buttonClicked:function(){},cancelText:"取消",cancel:function(){}};(0,_baseComponent.default)({useFunc:!0,data:defaults,computed:{classes:["prefixCls, theme, buttons, cancelText",function(n,e,t,r){var o,c=(0,_classNames7.default)(n),a="".concat(n,"__popup"),s=(0,_classNames7.default)("".concat(n,"__content"),(_defineProperty(o={},"".concat(n,"__content--theme-").concat(e),e),_defineProperty(o,"".concat(n,"__content--has-cancel"),r),o)),i=(0,_classNames7.default)("".concat(n,"__group"),_defineProperty({},"".concat(n,"__group--options"),!0)),u="".concat(n,"__title"),d=(0,_classNames7.default)("".concat(n,"__button"),_defineProperty({},"".concat(n,"__button--destructive"),!0));return{wrap:c,popup:a,content:s,options:i,title:u,button:t.map(function(e){var t;return{wrap:(0,_classNames7.default)("".concat(n,"__button"),(_defineProperty(t={},"".concat(n,"__button--option"),!0),_defineProperty(t,"".concat(n,"__button--disabled"),e.disabled),_defineProperty(t,"".concat(e.className),e.className),t)),hover:e.hoverClass&&"default"!==e.hoverClass?e.hoverClass:"".concat(n,"__button--hover")}}),icon:"".concat(n,"__icon"),text:"".concat(n,"__text"),destructive:d,group:(0,_classNames7.default)("".concat(n,"__group"),_defineProperty({},"".concat(n,"__group--cancel"),!0)),cancel:(0,_classNames7.default)("".concat(n,"__button"),_defineProperty({},"".concat(n,"__button--cancel"),!0)),hover:"".concat(n,"__button--hover")}}]},methods:{showSheet:function(e){var t=0<arguments.length&&void 0!==e?e:{},n=this.$$mergeOptionsAndBindMethods(Object.assign({},defaults,t));return this.removed=!1,this.$$setData(_objectSpread({in:!0},n)),this.cancel.bind(this)},removeSheet:function(e){if(this.removed)return!1;this.removed=!0,this.$$setData({in:!1}),"function"==typeof e&&e(this.data.buttons)},buttonClicked:function(e){var t=e.currentTarget.dataset.index;!0===this.fns.buttonClicked(t,this.data.buttons[t])&&this.removeSheet()},destructiveButtonClicked:function(){!0===this.fns.destructiveButtonClicked()&&this.removeSheet()},cancel:function(){this.removeSheet(this.fns.cancel)},bindgetuserinfo:function(e){this.triggerEvent("getuserinfo",_objectSpread({},e.detail,{},e.currentTarget.dataset))},bindcontact:function(e){this.triggerEvent("contact",_objectSpread({},e.detail,{},e.currentTarget.dataset))},bindgetphonenumber:function(e){this.triggerEvent("getphonenumber",_objectSpread({},e.detail,{},e.currentTarget.dataset))},bindopensetting:function(e){this.triggerEvent("opensetting",_objectSpread({},e.detail,{},e.currentTarget.dataset))},onError:function(e){this.triggerEvent("error",_objectSpread({},e.detail,{},e.currentTarget.dataset))}}});
|
||||
6
liferestartWX/utils/wux/actionsheet/index.json
Normal file
6
liferestartWX/utils/wux/actionsheet/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wux-popup": "../popup/index"
|
||||
}
|
||||
}
|
||||
41
liferestartWX/utils/wux/actionsheet/index.wxml
Normal file
41
liferestartWX/utils/wux/actionsheet/index.wxml
Normal file
@@ -0,0 +1,41 @@
|
||||
<wux-popup wux-content-class="{{ theme === 'ios' ? classes.popup : '' }}" position="bottom" visible="{{ in }}" safeArea="bottom" bind:close="cancel">
|
||||
<view class="wux-class {{ classes.wrap }}">
|
||||
<view class="{{ classes.content }}">
|
||||
<view class="{{ classes.options }}">
|
||||
<view class="{{ classes.title }}" wx:if="{{ titleText }}">{{ titleText }}</view>
|
||||
<block wx:for="{{ buttons }}" wx:for-item="button" wx:key="index">
|
||||
<button
|
||||
class="{{ classes.button[index].wrap }}"
|
||||
data-index="{{ index }}"
|
||||
disabled="{{ button.disabled }}"
|
||||
open-type="{{ button.openType }}"
|
||||
hover-class="{{ !button.disabled ? classes.button[index].hover : 'none' }}"
|
||||
hover-stop-propagation="{{ button.hoverStopPropagation }}"
|
||||
hover-start-time="{{ button.hoverStartTime }}"
|
||||
hover-stay-time="{{ button.hoverStayTime }}"
|
||||
lang="{{ button.lang }}"
|
||||
bindgetuserinfo="bindgetuserinfo"
|
||||
session-from="{{ button.sessionFrom }}"
|
||||
send-message-title="{{ button.sendMessageTitle }}"
|
||||
send-message-path="{{ button.sendMessagePath }}"
|
||||
send-message-img="{{ button.sendMessageImg }}"
|
||||
show-message-card="{{ button.showMessageCard }}"
|
||||
bindcontact="bindcontact"
|
||||
bindgetphonenumber="bindgetphonenumber"
|
||||
app-parameter="{{ button.appParameter }}"
|
||||
binderror="onError"
|
||||
bindopensetting="bindopensetting"
|
||||
catchtap="buttonClicked"
|
||||
>
|
||||
<image class="{{ classes.icon }}" src="{{ button.icon }}" wx:if="{{ button.icon }}" />
|
||||
<text class="{{ classes.text }}">{{ button.text }}</text>
|
||||
</button>
|
||||
</block>
|
||||
<button class="{{ classes.destructive }}" wx:if="{{ destructiveText }}" catchtap="destructiveButtonClicked">{{ destructiveText }}</button>
|
||||
</view>
|
||||
<view class="{{ classes.group }}" wx:if="{{ cancelText }}">
|
||||
<button class="{{ classes.cancel }}" hover-class="{{ classes.hover }}" catchtap="cancel">{{ cancelText }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</wux-popup>
|
||||
1
liferestartWX/utils/wux/actionsheet/index.wxss
Normal file
1
liferestartWX/utils/wux/actionsheet/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
.wux-actionsheet__popup{background-color:transparent}.wux-actionsheet__content{margin-left:16rpx;margin-right:16rpx;width:auto;overflow:hidden}.wux-actionsheet__content--theme-wx{margin-left:0;margin-right:0;margin-bottom:0}.wux-actionsheet__content--theme-wx .wux-actionsheet__group{border-radius:0;margin-bottom:12rpx}.wux-actionsheet__content--theme-wx .wux-actionsheet__group--options{background-color:#fff}.wux-actionsheet__content--theme-wx .wux-actionsheet__group--cancel{margin-bottom:0}.wux-actionsheet__content--theme-wx .wux-actionsheet__button{font-size:36rpx;color:#000}.wux-actionsheet__content--theme-wx .wux-actionsheet__button--cancel{font-weight:400}.wux-actionsheet__content--theme-wx.wux-actionsheet__content--has-cancel{background-color:#efeff4}.wux-actionsheet__group{margin-bottom:16rpx;border-radius:8rpx;background-color:#fff;overflow:hidden}.wux-actionsheet__group--options{background-color:#f1f2f3}.wux-actionsheet__title{padding:32rpx;color:#8f8f8f;text-align:center;font-size:26rpx}.wux-actionsheet__button{position:relative;display:block;margin:0;padding:0;min-width:104rpx;min-height:96rpx;vertical-align:top;text-align:center;text-overflow:ellipsis;cursor:pointer;width:100%;border-radius:0;background-color:transparent;color:#007aff;font-size:42rpx;line-height:96rpx;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.wux-actionsheet__button--hover{box-shadow:none;border-color:#d1d3d6;color:#007aff;background:#e4e5e7}.wux-actionsheet__button--destructive{color:#ff3b30!important}.wux-actionsheet__button--cancel{font-weight:500}.wux-actionsheet__button--disabled{opacity:.3!important}.wux-actionsheet__group .wux-actionsheet__button{border-top:none}.wux-actionsheet__group .wux-actionsheet__button::after{transform:none;transform-origin:none;border:none;border-radius:0;content:" ";position:absolute;left:0;top:0;right:0;height:1PX;border-top:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:0 0;transform:scaleY(.5)}.wux-actionsheet__group .wux-actionsheet__button:first-child:last-child::after{border-width:0}.wux-actionsheet__icon{width:48rpx;height:48rpx;display:inline-block;margin-right:20rpx}
|
||||
1
liferestartWX/utils/wux/animation-group/index.js
Normal file
1
liferestartWX/utils/wux/animation-group/index.js
Normal file
File diff suppressed because one or more lines are too long
3
liferestartWX/utils/wux/animation-group/index.json
Normal file
3
liferestartWX/utils/wux/animation-group/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
3
liferestartWX/utils/wux/animation-group/index.wxml
Normal file
3
liferestartWX/utils/wux/animation-group/index.wxml
Normal file
@@ -0,0 +1,3 @@
|
||||
<view class="wux-class {{ wrapCls }} {{ animateCss }}" bindtap="onTap" catchtouchmove="{{ disableScroll ? 'noop' : '' }}" bindtransitionend="onTransitionEnd" bindanimationend="onAnimationEnd" wx:if="{{ animateStatus !== 'unmounted' }}" style="{{ extStyle }}">
|
||||
<slot></slot>
|
||||
</view>
|
||||
1
liferestartWX/utils/wux/animation-group/index.wxss
Normal file
1
liferestartWX/utils/wux/animation-group/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
.wux-animate--fadeIn-enter{transition:opacity .3s;opacity:0}.wux-animate--fadeIn-enter-active,.wux-animate--fadeIn-enter-done{opacity:1}.wux-animate--fadeIn-exit{transition:opacity .3s;opacity:1}.wux-animate--fadeIn-exit-active,.wux-animate--fadeIn-exit-done{opacity:0}.wux-animate--fadeInDown-enter{transition:opacity .3s,transform .3s;opacity:0;transform:translate3d(0,-100%,0)}.wux-animate--fadeInDown-enter-active,.wux-animate--fadeInDown-enter-done{opacity:1;transform:none}.wux-animate--fadeInDown-exit{transition:opacity .3s,transform .3s;opacity:1;transform:none}.wux-animate--fadeInDown-exit-active,.wux-animate--fadeInDown-exit-done{opacity:0;transform:translate3d(0,-100%,0)}.wux-animate--fadeInLeft-enter{transition:opacity .3s,transform .3s;opacity:0;transform:translate3d(-100%,0,0)}.wux-animate--fadeInLeft-enter-active,.wux-animate--fadeInLeft-enter-done{opacity:1;transform:none}.wux-animate--fadeInLeft-exit{transition:opacity .3s,transform .3s;opacity:1;transform:none}.wux-animate--fadeInLeft-exit-active,.wux-animate--fadeInLeft-exit-done{opacity:0;transform:translate3d(-100%,0,0)}.wux-animate--fadeInRight-enter{transition:opacity .3s,transform .3s;opacity:0;transform:translate3d(100%,0,0)}.wux-animate--fadeInRight-enter-active,.wux-animate--fadeInRight-enter-done{opacity:1;transform:none}.wux-animate--fadeInRight-exit{transition:opacity .3s,transform .3s;opacity:1;transform:none}.wux-animate--fadeInRight-exit-active,.wux-animate--fadeInRight-exit-done{opacity:0;transform:translate3d(100%,0,0)}.wux-animate--fadeInUp-enter{transition:opacity .3s,transform .3s;opacity:0;transform:translate3d(0,100%,0)}.wux-animate--fadeInUp-enter-active,.wux-animate--fadeInUp-enter-done{opacity:1;transform:none}.wux-animate--fadeInUp-exit{transition:opacity .3s,transform .3s;opacity:1;transform:none}.wux-animate--fadeInUp-exit-active,.wux-animate--fadeInUp-exit-done{opacity:0;transform:translate3d(0,100%,0)}.wux-animate--slideInUp-enter{transition:transform .3s;transform:translate3d(0,100%,0);visibility:visible}.wux-animate--slideInUp-enter-active,.wux-animate--slideInUp-enter-done{transform:translateZ(0)}.wux-animate--slideInUp-exit{transition:transform .3s;transform:translateZ(0)}.wux-animate--slideInUp-exit-active,.wux-animate--slideInUp-exit-done{transform:translate3d(0,100%,0);visibility:visible}.wux-animate--slideInDown-enter{transition:transform .3s;transform:translate3d(0,-100%,0);visibility:visible}.wux-animate--slideInDown-enter-active,.wux-animate--slideInDown-enter-done{transform:translateZ(0)}.wux-animate--slideInDown-exit{transition:transform .3s;transform:translateZ(0)}.wux-animate--slideInDown-exit-active,.wux-animate--slideInDown-exit-done{transform:translate3d(0,-100%,0);visibility:visible}.wux-animate--slideInLeft-enter{transition:transform .3s;transform:translate3d(-100%,0,0);visibility:visible}.wux-animate--slideInLeft-enter-active,.wux-animate--slideInLeft-enter-done{transform:translateZ(0)}.wux-animate--slideInLeft-exit{transition:transform .3s;transform:translateZ(0)}.wux-animate--slideInLeft-exit-active,.wux-animate--slideInLeft-exit-done{transform:translate3d(-100%,0,0);visibility:visible}.wux-animate--slideInRight-enter{transition:transform .3s;transform:translate3d(100%,0,0);visibility:visible}.wux-animate--slideInRight-enter-active,.wux-animate--slideInRight-enter-done{transform:none}.wux-animate--slideInRight-exit{transition:transform .3s;transform:none}.wux-animate--slideInRight-exit-active,.wux-animate--slideInRight-exit-done{transform:translate3d(100%,0,0);visibility:visible}.wux-animate--zoom-enter{transition:all .3s cubic-bezier(.215,.61,.355,1);opacity:.01;transform:scale(.75)}.wux-animate--zoom-enter-active,.wux-animate--zoom-enter-done{opacity:1;transform:none}.wux-animate--zoom-exit{transition:all .25s linear;transform:none}.wux-animate--zoom-exit-active,.wux-animate--zoom-exit-done{opacity:.01;transform:scale(.75)}.wux-animate--punch-enter{transition:all .3s cubic-bezier(.215,.61,.355,1);opacity:.01;transform:scale(1.35)}.wux-animate--punch-enter-active,.wux-animate--punch-enter-done{opacity:1;transform:none}.wux-animate--punch-exit{transition:all .25s linear;transform:none}.wux-animate--punch-exit-active,.wux-animate--punch-exit-done{opacity:.01;transform:scale(1.35)}
|
||||
1
liferestartWX/utils/wux/backdrop/index.js
Normal file
1
liferestartWX/utils/wux/backdrop/index.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(0,_baseComponent.default)({properties:{prefixCls:{type:String,value:"wux-backdrop"},transparent:{type:Boolean,value:!1},zIndex:{type:Number,value:1e3},classNames:{type:null,value:"wux-animate--fadeIn"}},computed:{classes:["prefixCls, transparent",function(e,t){return{wrap:t?"".concat(e,"--transparent"):e}}]},methods:{retain:function(){"number"==typeof this.backdropHolds&&this.backdropHolds||(this.backdropHolds=0),this.backdropHolds=this.backdropHolds+1,1===this.backdropHolds&&this.setData({in:!0})},release:function(){1===this.backdropHolds&&this.setData({in:!1}),this.backdropHolds=Math.max(0,this.backdropHolds-1)},onClick:function(){this.triggerEvent("click")}}});
|
||||
6
liferestartWX/utils/wux/backdrop/index.json
Normal file
6
liferestartWX/utils/wux/backdrop/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wux-animation-group": "../animation-group/index"
|
||||
}
|
||||
}
|
||||
1
liferestartWX/utils/wux/backdrop/index.wxml
Normal file
1
liferestartWX/utils/wux/backdrop/index.wxml
Normal file
@@ -0,0 +1 @@
|
||||
<wux-animation-group wux-class="{{ classes.wrap }}" in="{{ in }}" classNames="{{ classNames }}" bind:click="onClick" wrapStyle="{{ { zIndex } }}" disableScroll />
|
||||
1
liferestartWX/utils/wux/backdrop/index.wxss
Normal file
1
liferestartWX/utils/wux/backdrop/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
.wux-backdrop{background:rgba(0,0,0,.4)}.wux-backdrop,.wux-backdrop--transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.wux-backdrop--transparent{background:0 0}
|
||||
1
liferestartWX/utils/wux/button/index.js
Normal file
1
liferestartWX/utils/wux/button/index.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(0,_baseComponent.default)({properties:{prefixCls:{type:String,value:"wux-button"},type:{type:String,value:"stable"},clear:{type:Boolean,value:!1},block:{type:Boolean,value:!1},full:{type:Boolean,value:!1},outline:{type:Boolean,value:!1},bordered:{type:Boolean,value:!0},size:{type:String,value:"default"},disabled:{type:Boolean,value:!1},loading:{type:Boolean,value:!1},formType:{type:String,value:""},openType:{type:String,value:""},hoverClass:{type:String,value:"default"},hoverStopPropagation:{type:Boolean,value:!1},hoverStartTime:{type:Number,value:20},hoverStayTime:{type:Number,value:70},lang:{type:String,value:"en"},sessionFrom:{type:String,value:""},sendMessageTitle:{type:String,value:""},sendMessagePath:{type:String,value:""},sendMessageImg:{type:String,value:""},showMessageCard:{type:Boolean,value:!1},appParameter:{type:String,value:""}},computed:{classes:["prefixCls, hoverClass, type, size, block, full, clear, outline, bordered, disabled",function(e,t,n,r,a,o,i,l,u,s){var p;return{wrap:(0,_classNames2.default)(e,(_defineProperty(p={},"".concat(e,"--").concat(n),n),_defineProperty(p,"".concat(e,"--").concat(r),r),_defineProperty(p,"".concat(e,"--block"),a),_defineProperty(p,"".concat(e,"--full"),o),_defineProperty(p,"".concat(e,"--clear"),i),_defineProperty(p,"".concat(e,"--outline"),l),_defineProperty(p,"".concat(e,"--bordered"),u),_defineProperty(p,"".concat(e,"--disabled"),s),p)),hover:t&&"default"!==t?t:"".concat(e,"--hover")}}]},methods:{onTap:function(){this.data.disabled||this.data.loading||this.triggerEvent("click")},bindgetuserinfo:function(e){this.triggerEvent("getuserinfo",e.detail)},bindcontact:function(e){this.triggerEvent("contact",e.detail)},bindgetphonenumber:function(e){this.triggerEvent("getphonenumber",e.detail)},bindopensetting:function(e){this.triggerEvent("opensetting",e.detail)},onError:function(e){this.triggerEvent("error",e.detail)}}});
|
||||
3
liferestartWX/utils/wux/button/index.json
Normal file
3
liferestartWX/utils/wux/button/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
26
liferestartWX/utils/wux/button/index.wxml
Normal file
26
liferestartWX/utils/wux/button/index.wxml
Normal file
@@ -0,0 +1,26 @@
|
||||
<button
|
||||
class="wux-class {{ classes.wrap }}"
|
||||
disabled="{{ disabled }}"
|
||||
loading="{{ loading }}"
|
||||
form-type="{{ formType }}"
|
||||
open-type="{{ openType }}"
|
||||
hover-class="wux-hover-class {{ !disabled ? classes.hover : 'none' }}"
|
||||
hover-stop-propagation="{{ hoverStopPropagation }}"
|
||||
hover-start-time="{{ hoverStartTime }}"
|
||||
hover-stay-time="{{ hoverStayTime }}"
|
||||
lang="{{ lang }}"
|
||||
bindgetuserinfo="bindgetuserinfo"
|
||||
session-from="{{ sessionFrom }}"
|
||||
send-message-title="{{ sendMessageTitle }}"
|
||||
send-message-path="{{ sendMessagePath }}"
|
||||
send-message-img="{{ sendMessageImg }}"
|
||||
show-message-card="{{ showMessageCard }}"
|
||||
bindcontact="bindcontact"
|
||||
bindgetphonenumber="bindgetphonenumber"
|
||||
app-parameter="{{ appParameter }}"
|
||||
binderror="onError"
|
||||
bindopensetting="bindopensetting"
|
||||
bindtap="onTap"
|
||||
>
|
||||
<slot></slot>
|
||||
</button>
|
||||
1
liferestartWX/utils/wux/button/index.wxss
Normal file
1
liferestartWX/utils/wux/button/index.wxss
Normal file
File diff suppressed because one or more lines are too long
1
liferestartWX/utils/wux/card/index.js
Normal file
1
liferestartWX/utils/wux/card/index.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames3=_interopRequireDefault(require("../helpers/classNames")),_styleToCssString=_interopRequireDefault(require("../helpers/styleToCssString"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}(0,_baseComponent.default)({properties:{prefixCls:{type:String,value:"wux-card"},bordered:{type:Boolean,value:!0},full:{type:Boolean,value:!1},title:{type:String,value:""},thumb:{type:String,value:""},thumbStyle:{type:[String,Object],value:"",observer:function(e){this.setData({extStyle:(0,_styleToCssString.default)(e)})}},extra:{type:String,value:""},actions:{type:Array,value:[]}},data:{extStyle:""},computed:{classes:["prefixCls, bordered, full, actions",function(a,e,t,n){var r;return{wrap:(0,_classNames3.default)(a,(_defineProperty(r={},"".concat(a,"--bordered"),e),_defineProperty(r,"".concat(a,"--full"),t),_defineProperty(r,"".concat(a,"--has-actions"),0<n.length),r)),hd:"".concat(a,"__hd"),content:"".concat(a,"__content"),thumb:"".concat(a,"__thumb"),extra:"".concat(a,"__extra"),bd:"".concat(a,"__bd"),ft:"".concat(a,"__ft"),actions:"".concat(a,"__actions"),action:n.map(function(e){var t;return{wrap:(0,_classNames3.default)("".concat(a,"__action"),(_defineProperty(t={},"".concat(a,"__action--").concat(e.type||"default"),e.type||"default"),_defineProperty(t,"".concat(a,"__action--bold"),e.bold),_defineProperty(t,"".concat(a,"__action--disabled"),e.disabled),_defineProperty(t,"".concat(e.className),e.className),t)),hover:e.hoverClass&&"default"!==e.hoverClass?e.hoverClass:"".concat(a,"__action--hover")}})}}]},methods:{onAction:function(e){var t=e.currentTarget.dataset.index,a=this.data.actions,n=a[t];n.disabled||this.triggerEvent("action",{index:t,action:n,actions:a})}}});
|
||||
3
liferestartWX/utils/wux/card/index.json
Normal file
3
liferestartWX/utils/wux/card/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user