Commit 94dd4a96 authored by zhangjinzhou's avatar zhangjinzhou

默认选人

parent 1621f59c
...@@ -4,7 +4,7 @@ export const homeInfo = { ...@@ -4,7 +4,7 @@ export const homeInfo = {
{ {
"canUpdateNickName": false, "canUpdateNickName": false,
"figures": [{ "figureId": "1" }, { "figureId": "2" }, { "figureId": "3" }], "figures": [{ "figureId": "1" }, { "figureId": "2" }, { "figureId": "3" }],
"newUser": 0, "newUser": 1,
"userInfo": { "figureId": "1", "joyBeans": 10100, "nickName": "13" } "userInfo": { "figureId": "1", "joyBeans": 10100, "nickName": "13" }
}, },
"message": null, "message": null,
......
...@@ -6,7 +6,7 @@ import dataCenter, { getAPIdata, getHomeInfo, netErrMsg, Role, Store } from '../ ...@@ -6,7 +6,7 @@ import dataCenter, { getAPIdata, getHomeInfo, netErrMsg, Role, Store } from '../
import resList from '../../resconfig/resList'; //import API from '../../api'; import resList from '../../resconfig/resList'; //import API from '../../api';
import './select.less'; import './select.less';
const startselidx = 3;
class Select extends Component { class Select extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -27,11 +27,25 @@ class Select extends Component { ...@@ -27,11 +27,25 @@ class Select extends Component {
Role[i].figureid = ifigure.figureId; Role[i].figureid = ifigure.figureId;
} }
} }
console.log("figureid设置==》",Role); // console.log("figureid设置==》",Role);
// setTimeout(() => { // setTimeout(() => {
// console.log('关闭这个弹窗'); // console.log('关闭这个弹窗');
// this.props.onClose(); // this.props.onClose();
// }, 1000); // }, 1000);
this.nshowidx = startselidx;
this.setState({
nshowidx:startselidx
});
let startClass = [
["cardtwo","cardthr","cardone"],
["cardone","cardtwo","cardthr"],
["cardthr","cardone","cardtwo"],
]
this.refs.cardone.className = startClass[startselidx-1][0];
this.refs.cardtwo.className = startClass[startselidx-1][1];
this.refs.cardthr.className = startClass[startselidx-1][2];
} }
cantouch = false; cantouch = false;
lastouchx; lastouchx;
...@@ -58,19 +72,21 @@ class Select extends Component { ...@@ -58,19 +72,21 @@ class Select extends Component {
} }
nshowidx = 2; nshowidx = 2;
changeShowRole(dir){ changeShowRole(dir){
let changenum = dir=="left"?-1:1; let changenum = dir=="left"?+1:-1;
let nshowidx = this.nshowidx + changenum; let nshowidx = this.nshowidx + changenum;
this.nshowidx = this.changeIdxShow(nshowidx,this.refs.cardtwo,"onemaskadd"); this.nshowidx = this.changeIdxShow(nshowidx,this.refs.cardtwo,"onemaskadd");
let lshowidx = this.nshowidx-1; let lshowidx = this.nshowidx+1;
let tshowidx = this.nshowidx+1; let tshowidx = this.nshowidx-1;
this.changeIdxShow(lshowidx,this.refs.cardone,"twomaskadd"); this.changeIdxShow(lshowidx,this.refs.cardone,"twomaskadd");
this.changeIdxShow(tshowidx,this.refs.cardthr,"thrmaskadd"); this.changeIdxShow(tshowidx,this.refs.cardthr,"thrmaskadd");
this.setState({ this.setState({
nshowidx:this.nshowidx, nshowidx:this.nshowidx,
changed:true, changed:true,
}); });
console.error("当前选中====》",this.nshowidx);
} }
changeIdxShow(showidx,target,maskadd){ changeIdxShow(showidx,target,maskadd){
if(showidx==4){ if(showidx==4){
...@@ -83,7 +99,7 @@ class Select extends Component { ...@@ -83,7 +99,7 @@ class Select extends Component {
let srcClass = target.className; let srcClass = target.className;
let showclass = ['cardone','cardtwo','cardthr'][showidx-1]; let showclass = ['cardthr','cardtwo','cardone'][showidx-1];
let aniclass = ''; let aniclass = '';
if(showclass=="cardone"){ if(showclass=="cardone"){
if(srcClass.indexOf("cardtwo")!=-1){ if(srcClass.indexOf("cardtwo")!=-1){
...@@ -121,7 +137,6 @@ class Select extends Component { ...@@ -121,7 +137,6 @@ class Select extends Component {
} }
async selectRole(){ async selectRole(){
let planame = this.refs.planame.value; let planame = this.refs.planame.value;
console.log(planame);
if(planame.length<1){ if(planame.length<1){
return Toast("名字不能为空"); return Toast("名字不能为空");
} }
...@@ -160,7 +175,7 @@ class Select extends Component { ...@@ -160,7 +175,7 @@ class Select extends Component {
src={this.state.resList['8872d3a6-1d19-4a83-a07d-ae084b8a1392'].url} src={this.state.resList['8872d3a6-1d19-4a83-a07d-ae084b8a1392'].url}
/> />
<img <img
className={"onemask "+(nshowidx==3?"opacitycur":"opacitylat")+(changed?nshowidx==3?" opalatocur":" opacurtolat":"")} className={"onemask "+(nshowidx==1?"opacitycur":"opacitylat")+(changed?nshowidx==1?" opalatocur":" opacurtolat":"")}
src={this.state.resList['5608e852-913b-47e0-a286-0c33a86aed10'].url} src={this.state.resList['5608e852-913b-47e0-a286-0c33a86aed10'].url}
uuid="912dc687-6727-4bb1-9e87-936ea77074ce" uuid="912dc687-6727-4bb1-9e87-936ea77074ce"
/> />
...@@ -184,7 +199,7 @@ class Select extends Component { ...@@ -184,7 +199,7 @@ class Select extends Component {
src={this.state.resList['9da0a542-17dc-4c4c-bcc3-2ee8fba66ffa'].url} src={this.state.resList['9da0a542-17dc-4c4c-bcc3-2ee8fba66ffa'].url}
/> />
<img <img
className={"thrmask "+(nshowidx==1?"opacitycur":"opacitylat")+(changed?nshowidx==1?" opalatocur":" opacurtolat":"")} className={"thrmask "+(nshowidx==3?"opacitycur":"opacitylat")+(changed?nshowidx==3?" opalatocur":" opacurtolat":"")}
src={this.state.resList['5608e852-913b-47e0-a286-0c33a86aed10'].url} src={this.state.resList['5608e852-913b-47e0-a286-0c33a86aed10'].url}
uuid="28141b28-0c40-4810-8233-cc392753d698" uuid="28141b28-0c40-4810-8233-cc392753d698"
/> />
......
...@@ -16,15 +16,15 @@ export const Store = { ...@@ -16,15 +16,15 @@ export const Store = {
//人物角色对应 //人物角色对应
export let Role = { export let Role = {
1:{ 1:{
name:"熊猫1", name:"熊猫1",
figureid:1, figureid:1,
}, },
2:{ 2:{
name:"熊猫2", name:"熊猫2",
figureid:2, figureid:2,
}, },
3:{ 3:{
name:"熊猫3", name:"熊猫3墨镜",
figureid:3, figureid:3,
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment