Commit c2b2ce55 authored by 李硕's avatar 李硕

提交

parent 21a405d7
...@@ -96,7 +96,7 @@ export const join = { ...@@ -96,7 +96,7 @@ export const join = {
*/ */
export const myWishData = { export const myWishData = {
"data": { "data": {
"wishCountFlg": false, "wishCountFlg": true,
"nickName": "中奖昵称", "nickName": "中奖昵称",
"wishData": { "wishData": {
"blessing": "祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语", "blessing": "祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语祝福之语",
......
...@@ -14,7 +14,8 @@ class Comnickpanel extends Component { ...@@ -14,7 +14,8 @@ class Comnickpanel extends Component {
this.state = { this.state = {
resList: resList, resList: resList,
nickName: "", nickName: "",
modalType: "" modalType: "",
pass: true,
}; };
} }
...@@ -23,7 +24,7 @@ class Comnickpanel extends Component { ...@@ -23,7 +24,7 @@ class Comnickpanel extends Component {
*/ */
postNickname(nickName) { postNickname(nickName) {
let { onClose } = this.props; let { onClose } = this.props;
let { pass } = this.state;
let str = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/; let str = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
console.log(">......>>>>>.....", str.test(nickName)); console.log(">......>>>>>.....", str.test(nickName));
// return; // return;
...@@ -34,11 +35,33 @@ class Comnickpanel extends Component { ...@@ -34,11 +35,33 @@ class Comnickpanel extends Component {
console.log('接口调用成功', nickName); console.log('接口调用成功', nickName);
onClose(true); onClose(true);
} else { } else {
Toast(ERROR_MESSSAGE(code)) if (pass) {
this.setState({
pass: false
})
Toast(ERROR_MESSSAGE(code), 2000)
setTimeout(() => {
this.setState({
pass: true
})
}, 2000)
}
} }
}) })
} else { } else {
Toast('请输入正确昵称') if (pass) {
this.setState({
pass: false
})
Toast('请输入正确昵称', 2000)
setTimeout(() => {
this.setState({
pass: true
})
}, 2000)
}
} }
} }
...@@ -50,8 +73,6 @@ class Comnickpanel extends Component { ...@@ -50,8 +73,6 @@ class Comnickpanel extends Component {
}) })
} }
render() { render() {
let { onClose } = this.props; let { onClose } = this.props;
let { nickName } = this.state; let { nickName } = this.state;
......
...@@ -36,11 +36,12 @@ ...@@ -36,11 +36,12 @@
} }
.awardcontent { .awardcontent {
width: 365px; width: 500px;
height: 105px; height: 105px;
opacity: 1; opacity: 1;
left: 216px; left: 160px;
top: 1000px; top: 1000px;
text-align: center;
position: absolute; position: absolute;
transform-origin: 0px 0px 0px; transform-origin: 0px 0px 0px;
font-size: 60px; font-size: 60px;
......
...@@ -40,7 +40,7 @@ class Pagemainscene extends Component { ...@@ -40,7 +40,7 @@ class Pagemainscene extends Component {
}) })
this.modalControl(MODAL_NAME.P_RULE) this.modalControl(MODAL_NAME.P_RULE)
} else { } else {
Toast(ERROR_MESSSAGE(code)) Toast(ERROR_MESSSAGE(code),2000)
} }
} }
...@@ -69,7 +69,7 @@ class Pagemainscene extends Component { ...@@ -69,7 +69,7 @@ class Pagemainscene extends Component {
if (url) { if (url) {
window.location.href = url; window.location.href = url;
} else { } else {
Toast("请检查网络"); Toast("请检查网络",2000);
} }
} }
} }
......
...@@ -23,7 +23,8 @@ class Pageresultscene extends Component { ...@@ -23,7 +23,8 @@ class Pageresultscene extends Component {
resultObj: {}, resultObj: {},
shareImg: "", shareImg: "",
wishLimit: false, wishLimit: false,
rule: "" rule: "",
pass: true
}; };
} }
...@@ -57,7 +58,7 @@ class Pageresultscene extends Component { ...@@ -57,7 +58,7 @@ class Pageresultscene extends Component {
shareImg: "12" shareImg: "12"
}) })
} else { } else {
Toast(ERROR_MESSSAGE(code)) Toast(ERROR_MESSSAGE(code), 2000)
} }
} }
...@@ -81,15 +82,27 @@ class Pageresultscene extends Component { ...@@ -81,15 +82,27 @@ class Pageresultscene extends Component {
if (url) { if (url) {
window.location.href = url; window.location.href = url;
} else { } else {
Toast("请检查网络"); Toast("请检查网络", 2000);
} }
} }
} }
againWish() { againWish() {
let { wishLimit } = this.state; let { wishLimit, pass } = this.state;
if (wishLimit) { if (wishLimit) {
Toast('今日许愿已达上限,请明日再来~'); if (pass) {
this.setState({
pass: false
})
Toast('今日许愿已达上限,请明日再来~', 2000);
setTimeout(() => {
this.setState({
pass: true
})
}, 2000)
}
} else { } else {
console.log('场景跳转---------'); console.log('场景跳转---------');
mHistory.push({ pathname: '/' }) mHistory.push({ pathname: '/' })
...@@ -105,7 +118,23 @@ class Pageresultscene extends Component { ...@@ -105,7 +118,23 @@ class Pageresultscene extends Component {
}) })
this.modalControl(MODAL_NAME.P_RULE); this.modalControl(MODAL_NAME.P_RULE);
} else { } else {
Toast(ERROR_MESSSAGE(code)) Toast(ERROR_MESSSAGE(code), 2000)
}
}
shareMsg() {
let { pass } = this.state;
if (pass) {
this.setState({
pass: false
})
Toast('可保存到相册分享你的许愿树哦!', 2000);
setTimeout(() => {
this.setState({
pass: true
})
}, 2000)
} }
} }
...@@ -117,7 +146,7 @@ class Pageresultscene extends Component { ...@@ -117,7 +146,7 @@ class Pageresultscene extends Component {
<img className="awardbtn2 " onClick={() => { this.jumpUrl(JUMP_URL.AWARD_URL); }} src={this.state.resList['df88f4c3-4e66-4936-84dc-654eb165ae93'].url} /> <img className="awardbtn2 " onClick={() => { this.jumpUrl(JUMP_URL.AWARD_URL); }} src={this.state.resList['df88f4c3-4e66-4936-84dc-654eb165ae93'].url} />
<img className="rulebtn2 " onClick={() => { this.setRuleData() }} src={this.state.resList['1b800919-334c-4223-a299-3946e453fc80'].url} /> <img className="rulebtn2 " onClick={() => { this.setRuleData() }} src={this.state.resList['1b800919-334c-4223-a299-3946e453fc80'].url} />
<img className="againbtn point7" onClick={() => { this.againWish() }} src={this.state.resList['442a4667-1ae0-43f7-b1f9-37a6cedf138f'].url} /> <img className="againbtn point7" onClick={() => { this.againWish() }} src={this.state.resList['442a4667-1ae0-43f7-b1f9-37a6cedf138f'].url} />
<img className="sharebtn point6" onClick={() => { Toast("可保存到相册分享你的许愿树哦!") }} src={this.state.resList['73f4c449-b3e1-4797-90ce-438b9ba415de'].url} /> <img className="sharebtn point6" onClick={() => { this.shareMsg() }} src={this.state.resList['73f4c449-b3e1-4797-90ce-438b9ba415de'].url} />
<div className="wishresult "> <div className="wishresult ">
<img className="wishbg " src={this.state.resList['57172e95-f331-47b6-af37-9464c39ba69d'].url} /> <img className="wishbg " src={this.state.resList['57172e95-f331-47b6-af37-9464c39ba69d'].url} />
<img className="shareImg " src={this.state.resList['0dd921f7-14be-4900-b404-24574796ac07'].url} /> <img className="shareImg " src={this.state.resList['0dd921f7-14be-4900-b404-24574796ac07'].url} />
......
...@@ -58,7 +58,9 @@ class Pagewishscene extends Component { ...@@ -58,7 +58,9 @@ class Pagewishscene extends Component {
indexData: {}, indexData: {},
showGuide: "", showGuide: "",
prizeData: {}, prizeData: {},
prizeResult: {} prizeResult: {},
pass: true
}; };
} }
componentDidMount() { componentDidMount() {
...@@ -78,7 +80,7 @@ class Pagewishscene extends Component { ...@@ -78,7 +80,7 @@ class Pagewishscene extends Component {
if (!success) { if (!success) {
//失败 //失败
Loading.hide(); Loading.hide();
Toast(ERROR_MESSSAGE(code)); Toast(ERROR_MESSSAGE(code), 2000);
} else { } else {
let { nicknameFlg, newHandFlg, wishCountFlg } = data; let { nicknameFlg, newHandFlg, wishCountFlg } = data;
Loading.hide(); Loading.hide();
...@@ -93,7 +95,7 @@ class Pagewishscene extends Component { ...@@ -93,7 +95,7 @@ class Pagewishscene extends Component {
console.log('data>>>>>>>>', data); console.log('data>>>>>>>>', data);
//是否达到许愿上限 //是否达到许愿上限
if (wishCountFlg) { if (wishCountFlg) {
Toast('每天可以许2次愿望,看看之前的许愿结果吧~') Toast('每天可以许2次愿望,看看之前的许愿结果吧~', 2000)
setTimeout(() => { setTimeout(() => {
mHistory.push({ pathname: '/b' }); mHistory.push({ pathname: '/b' });
}, 1000) }, 1000)
...@@ -132,7 +134,6 @@ class Pagewishscene extends Component { ...@@ -132,7 +134,6 @@ class Pagewishscene extends Component {
else { else {
this.backScene(); this.backScene();
} }
} }
...@@ -140,7 +141,6 @@ class Pagewishscene extends Component { ...@@ -140,7 +141,6 @@ class Pagewishscene extends Component {
* 获取所有的许愿签 * 获取所有的许愿签
*/ */
async getWishTagsList() { async getWishTagsList() {
let { success, data, code } = await API.getWishIndexInfo(); let { success, data, code } = await API.getWishIndexInfo();
if (success) { if (success) {
console.log("data-------", data.wishPool); console.log("data-------", data.wishPool);
...@@ -162,7 +162,7 @@ class Pagewishscene extends Component { ...@@ -162,7 +162,7 @@ class Pagewishscene extends Component {
} }
} }
else { else {
Toast(ERROR_MESSSAGE(code)); Toast(ERROR_MESSSAGE(code), 2000);
} }
//接口获取心愿信息 //接口获取心愿信息
// let data = ["一字成语", "二字成语", "三字成语", "四字成语", "五字成语", "六字成语", "七字成语", "八字成语", "九字成语", "十字成语", "11字成语", "12字成语", "13字成语", "14字成语"]; // let data = ["一字成语", "二字成语", "三字成语", "四字成语", "五字成语", "六字成语", "七字成语", "八字成语", "九字成语", "十字成语", "11字成语", "12字成语", "13字成语", "14字成语"];
...@@ -174,8 +174,7 @@ class Pagewishscene extends Component { ...@@ -174,8 +174,7 @@ class Pagewishscene extends Component {
* @param {*} index * @param {*} index
*/ */
clickCurTag(index) { clickCurTag(index) {
let that = this; let { chooseList, wishName, pass } = this.state;
let { chooseList, wishName } = this.state;
console.log('点击chooseList===', chooseList, '点击wishName----', wishName || "null", chooseList.includes(-1), !wishName); console.log('点击chooseList===', chooseList, '点击wishName----', wishName || "null", chooseList.includes(-1), !wishName);
if (chooseList.includes(index)) { if (chooseList.includes(index)) {
this.setState({ this.setState({
...@@ -183,15 +182,28 @@ class Pagewishscene extends Component { ...@@ -183,15 +182,28 @@ class Pagewishscene extends Component {
}) })
} }
else { else {
if (chooseList.length < 5) { if (chooseList.length < 5) {
this.setState({ this.setState({
chooseList: chooseList.concat([index]) chooseList: chooseList.concat([index])
}) })
} }
else { else {
Toast("不得选择超过五个心愿"); if (pass) {
this.setState({
pass: false
})
Toast("不得选择超过五个心愿", 2000);
setTimeout(() => {
this.setState({
pass: true
})
}, 2000)
}
} }
} }
} }
onInputChangeValue() { onInputChangeValue() {
let { chooseList, wishName } = this.state; let { chooseList, wishName } = this.state;
...@@ -222,7 +234,18 @@ class Pagewishscene extends Component { ...@@ -222,7 +234,18 @@ class Pagewishscene extends Component {
this.setState({ this.setState({
wishName: '', wishName: '',
}) })
Toast("不得超过五个心愿") let { pass } = this.state;
if (pass) {
this.setState({
pass: false
})
Toast("不得选择超过五个心愿", 2000);
setTimeout(() => {
this.setState({
pass: true
})
}, 2000)
}
} }
} }
...@@ -262,7 +285,7 @@ class Pagewishscene extends Component { ...@@ -262,7 +285,7 @@ class Pagewishscene extends Component {
if (code == "600020") { if (code == "600020") {
this.modalControl(MODAL_NAME.P_PRIZE_REGRET); this.modalControl(MODAL_NAME.P_PRIZE_REGRET);
} else { } else {
Toast(ERROR_MESSSAGE(code)); Toast(ERROR_MESSSAGE(code), 2000);
} }
} }
}, 1500) }, 1500)
...@@ -273,36 +296,36 @@ class Pagewishscene extends Component { ...@@ -273,36 +296,36 @@ class Pagewishscene extends Component {
*/ */
async startOpenPrize() { async startOpenPrize() {
this.clickBuried(4) this.clickBuried(4)
let { chooseList, wishName } = this.state; let { chooseList, wishName ,pass} = this.state;
console.log("许愿结果", chooseList); console.log("许愿结果", chooseList);
let wishIds = chooseList.filter((item) => { return item != -1 }).map(item => { return item = +item + 1 }).join(','); let wishIds = chooseList.filter((item) => { return item != -1 }).map(item => { return item = +item + 1 }).join(',');
console.log('{{{{{{{{{', wishIds); console.log('{{{{{{{{{', wishIds);
getPxToken(async token => {
let postObj = { token: "" }; if (pass) {
postObj.token = token;
postObj.wishIds = wishIds;
if (chooseList.includes(-1) && wishName) {
postObj.userWishName = wishName;
}
console.log('/////////////', postObj);
let result = await API.getOpenPrize(postObj);
this.setState({ this.setState({
prizeResult: result pass: false
}) })
this.showLoading(); getPxToken(async token => {
// if (success) { let postObj = { token: "" };
// this.setState({ postObj.token = token;
// prizeData: data postObj.wishIds = wishIds;
// }) if (chooseList.includes(-1) && wishName) {
// } else { postObj.userWishName = wishName;
// if (code == "600020") { }
// this.modalControl(MODAL_NAME.P_PRIZE_REGRET); console.log('/////////////', postObj);
// } else { let result = await API.getOpenPrize(postObj);
// Toast(ERROR_MESSSAGE(code)); this.setState({
// } prizeResult: result
// } })
this.showLoading();
}) })
setTimeout(() => {
this.setState({
pass: true
})
}, 2000)
}
} }
jumpResultScene() { jumpResultScene() {
mHistory.push({ pathname: "/b" }) mHistory.push({ pathname: "/b" })
......
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