Commit 7937ad81 authored by Edwise's avatar Edwise 🍷

1234

parent 199cae6d
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
"experience": 50, "experience": 50,
"level": "1", "level": "1",
"avatar": "https://yun.duiba.com.cn/spark/assets/a3ae99684afa9a1f8d94f4c95ee6f1ed81de9996.png", "avatar": "https://yun.duiba.com.cn/spark/assets/a3ae99684afa9a1f8d94f4c95ee6f1ed81de9996.png",
"sence": 3, "sence": 4,
"catName": "喵喵喵", "catName": "哈哈哈",
"senceTips":["1说话说话说话说话说话说话说话说话说话说话说话","2说话说话说话说话说话说话说话说话说话说话说话说话","3说话说话说话说话说话说话说话说话说话说话说话说话"] "senceTips":["1说话说话说话说话说话说话说话说话说话说话说话","2说话说话说话说话说话说话说话说话说话说话说话说话","3说话说话说话说话说话说话说话说话说话说话说话说话"]
} }
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -2,6 +2,7 @@ import { RES } from "../module/RES"; ...@@ -2,6 +2,7 @@ import { RES } from "../module/RES";
import resCanvasList from "../resCanvasList" import resCanvasList from "../resCanvasList"
import { SCENETYPE } from "./Enum"; import { SCENETYPE } from "./Enum";
import { sendTbNet, TbNetName } from "./TaoBaoNet";
/**记录全局信息与全局方法 */ /**记录全局信息与全局方法 */
export class Ins { export class Ins {
/**舞台宽高 */ /**舞台宽高 */
...@@ -28,6 +29,12 @@ export class Ins { ...@@ -28,6 +29,12 @@ export class Ins {
} }
public static showModule(name:string,data?){
sendTbNet(TbNetName.showModal, { name: name, data: data?data:{} }, (s, res) => {
console.log('showModal ruleModal, success,res', s, res)
})
}
public static showToast(msg?:any){ public static showToast(msg?:any){
FYGE.GDispatcher.dispatchEvent("toast",msg); FYGE.GDispatcher.dispatchEvent("toast",msg);
} }
......
...@@ -10,5 +10,5 @@ export const ResJson = { ...@@ -10,5 +10,5 @@ export const ResJson = {
"name": "startScene" "name": "startScene"
} }
], ],
"path": "https://yun.duiba.com.cn/db_games/activity/babycare_xiaoxiao/1600763276/resource/" "path": "https://yun.duiba.com.cn/db_games/activity/babycare_xiaoxiao/1600851674/resource/"
} }
\ No newline at end of file
...@@ -57,7 +57,7 @@ export class MainScene extends Scene { ...@@ -57,7 +57,7 @@ export class MainScene extends Scene {
//0:教室,1:操场,2:寝室 //0:教室,1:操场,2:寝室
that.bgUUID = ["c6d699b0-b276-4985-b3ea-47bcef13f2ea", "efaf990e-5392-49ad-94d8-25c04f651ede", "b3c8c187-e5c9-4968-9a00-a118d18ab2fc"]; that.bgUUID = ["c6d699b0-b276-4985-b3ea-47bcef13f2ea", "efaf990e-5392-49ad-94d8-25c04f651ede", "b3c8c187-e5c9-4968-9a00-a118d18ab2fc"];
//生成默认场景,后面要改成根据接口值判断 //生成默认场景,后面要改成根据接口值判断
that.sceneBg = Ins.initSprite(that.bgUUID[Ins.curScene-1]); that.sceneBg = Ins.initSprite(that.bgUUID[Ins.curScene==4?2:Ins.curScene-1]);
that.addChild(that.sceneBg); that.addChild(that.sceneBg);
that.tlBtn = Ins.initSprite("1f8b040d-2fbc-4ff8-92f9-159773364fae", 0, 640); that.tlBtn = Ins.initSprite("1f8b040d-2fbc-4ff8-92f9-159773364fae", 0, 640);
...@@ -72,7 +72,7 @@ export class MainScene extends Scene { ...@@ -72,7 +72,7 @@ export class MainScene extends Scene {
that.mxqBtn.mouseEnable = true; that.mxqBtn.mouseEnable = true;
that.addChild(that.mxqBtn); that.addChild(that.mxqBtn);
if(Ins.curScene==SCENETYPE.BEADROOM){ if(Ins.curScene==SCENETYPE.BEADROOM||Ins.curScene==4){
that.tlBtn.visible = true; that.tlBtn.visible = true;
that.mxqBtn.visible = true; that.mxqBtn.visible = true;
}else{ }else{
...@@ -80,7 +80,7 @@ export class MainScene extends Scene { ...@@ -80,7 +80,7 @@ export class MainScene extends Scene {
that.mxqBtn.visible = false; that.mxqBtn.visible = false;
} }
that.mainUi = new MainSceneBtnUi({ uiType: Ins.curScene }); that.mainUi = new MainSceneBtnUi({ uiType: Ins.curScene==4?3:Ins.curScene });
that.addChild(that.mainUi); that.addChild(that.mainUi);
that.initCat(); that.initCat();
...@@ -105,9 +105,7 @@ export class MainScene extends Scene { ...@@ -105,9 +105,7 @@ export class MainScene extends Scene {
openLetter() { openLetter() {
console.log("打开信封弹窗") console.log("打开信封弹窗")
if (this.letter && this.letter.visible) { if (this.letter && this.letter.visible) {
sendTbNet(TbNetName.showModal, { name: 'messageModal', data: { catName: Ins.userInfo.catName } }, (s, res) => { Ins.showModule('messageModal',{ catName: Ins.userInfo.catName })
console.log('showModal ruleModal, success,res', s, res)
})
} }
} }
......
...@@ -9,38 +9,50 @@ import { changeScene, showPanel, showToast } from "../../module/ctrls"; ...@@ -9,38 +9,50 @@ import { changeScene, showPanel, showToast } from "../../module/ctrls";
import { SelectCatPanel } from "../panels/selectcatpanel/SelectCatPanel"; import { SelectCatPanel } from "../panels/selectcatpanel/SelectCatPanel";
import { sendTbNet, TbNetName } from "../TaoBaoNet"; import { sendTbNet, TbNetName } from "../TaoBaoNet";
export class StartScene extends Scene { export class StartScene extends Scene {
initUi() { initUi() {
super.initUi(); super.initUi();
var sceneBg = Ins.initSprite("b3c8c187-e5c9-4968-9a00-a118d18ab2fc"); var sceneBg = Ins.initSprite("b3c8c187-e5c9-4968-9a00-a118d18ab2fc");
this.addChild(sceneBg); this.addChild(sceneBg);
this.x = (Ins.stageW - 750)>>1; this.x = (Ins.stageW - 750) >> 1;
this.y = (Ins.stageH - 1624)>>1; this.y = (Ins.stageH - 1624) >> 1;
sendTbNet(TbNetName.getUserInfo,{},(s,r)=>{ sendTbNet(TbNetName.getUserInfo, {}, (s, r) => {
if(s){ if (s) {
if(r.data){ if (r.data) {
Ins.userInfo = r.data; Ins.userInfo = r.data;
/**判断猫咪是否出寝,只在用户进入游戏时判断,后面要根据接口改写,现在先做测试 */ /**判断猫咪是否出寝,只在用户进入游戏时判断,后面要根据接口改写,现在先做测试 */
if(r.data.sence==4){ if (r.data.sence == 4) {
Ins.catIsOut = true; Ins.catIsOut = true;
}else{ } else {
Ins.catIsOut = false; Ins.catIsOut = false;
}
changeScene(MainScene)
} else {
Ins.showModule("selectcatModal")
} }
changeScene(MainScene) } else {
}else Ins.showToast(r.message)
{
showPanel(SelectCatPanel);
} }
}else })
{
Ins.showToast(r.message) // this.addChild(new MainScene());
}
})
// this.addChild(new MainScene());
} }
/**领养完毕猫咪 */
getCat(r) {
console.log("选择完猫咪",r)
Ins.userInfo = r.data;
/**判断猫咪是否出寝,只在用户进入游戏时判断,后面要根据接口改写,现在先做测试 */
if (r.data.sence == 4) {
Ins.catIsOut = true;
} else {
Ins.catIsOut = false;
}
changeScene(MainScene)
}
start() { initEvents(){
} FYGE.GDispatcher.addEventListener("selectEnd",this.getCat,this);
}
} }
'use strict';
import React, { Component } from 'react';
import resList from '../../resconfig/resList';
import './comgetcat.less';
class Comgetcat extends Component {
constructor(props) {
super(props);
this.state = this.state || { resList: resList };
}
render() {
return (
<div className="getcat">
<img className="getcatimg" src={this.state.resList['02aacfd1-3347-40a7-8a3a-9f20c1b5706b'].url} />
<div className="getcatdialog">
<img className="getcatdialogbg" src={this.state.resList['24b7d459-41d6-408c-9829-4768fe38abf5'].url} />
<span className="getcatdialogtext">好了,现在你就是 猫咪名字 的铲屎官了~</span>
</div>
<img className="getcatgo" src={this.state.resList['97484cf2-5146-4287-b104-ed1f43c71ee0'].url} />
</div>
);
}
}
export default Comgetcat;
\ No newline at end of file
.getcat {
width: 465px;
height: 671px;
opacity: 1;
left: 130px;
top: 378px;
position: absolute;
transform-origin: 0px 0px 0px;
.getcatimg {
width: 421px;
height: 301px;
opacity: 1;
left: 34px;
top: 202px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.getcatdialog {
width: 465px;
height: 176px;
opacity: 1;
position: absolute;
transform-origin: 0px 0px 0px;
.getcatdialogbg {
width: 465px;
height: 176px;
opacity: 1;
position: absolute;
transform-origin: 0px 0px 0px;
}
.getcatdialogtext {
width: 326px;
height: 73px;
opacity: 1;
left: 69px;
top: 39px;
position: absolute;
transform-origin: 0px 0px 0px;
font-size: 28px;
color: rgba(87, 75, 69, 1);
}
}
.getcatgo {
width: 282px;
height: 106px;
opacity: 1;
left: 107px;
top: 565px;
position: absolute;
transform-origin: 0px 0px 0px;
}
}
\ No newline at end of file
'use strict';
import React, { Component } from 'react';
import resList from '../../resconfig/resList';
import './comrecallcat.less';
class Comrecallcat extends Component {
constructor(props) {
super(props);
this.state = this.state || { resList: resList };
}
render() {
return (
<div className="recallcat">
<img className="recallcatbg" src={this.state.resList['40cac443-7998-4c2a-8f9c-38121b2385e3'].url} />
<span className="recallcatbacklabel">猫咪预计 1 小时 23 分 后回寝</span>
<span className="recallcathappycoin">101010</span>
<div className="recallbtngroup">
<img className="recallbtncancel" src={this.state.resList['6957d9f3-9aa4-4ed6-9b83-57cc68f16512'].url} />
<img className="recallbtngo" src={this.state.resList['6d8cdd11-fbc5-4e84-b5ef-1f74c9070738'].url} />
</div>
<img className="recallbtnclose" src={this.state.resList['29e80fbb-98ed-40fb-a11b-e14b45fee158'].url} />
</div>
);
}
}
export default Comrecallcat;
.recallcat {
width: 721px;
height: 562px;
opacity: 1;
left: 18px;
top: 392px;
position: absolute;
transform-origin: 0px 0px 0px;
.recallcatbg {
width: 721px;
height: 562px;
opacity: 1;
position: absolute;
transform-origin: 0px 0px 0px;
}
.recallcatbacklabel {
width: 615px;
height: 25px;
opacity: 1;
left: 52px;
top: 335px;
position: absolute;
transform-origin: 0px 0px 0px;
font-size: 26px;
color: rgba(104, 91, 78, 1);
text-align: center;
}
.recallcathappycoin {
width: 119px;
height: 29px;
opacity: 1;
left: 265px;
top: 250px;
position: absolute;
transform-origin: 0px 0px 0px;
font-size: 36px;
color: rgba(231, 72, 70, 1);
}
.recallbtngroup {
width: 608px;
height: 105px;
opacity: 1;
left: 54px;
top: 421px;
position: absolute;
transform-origin: 0px 0px 0px;
.recallbtncancel {
width: 281px;
height: 105px;
opacity: 1;
position: absolute;
transform-origin: 0px 0px 0px;
}
.recallbtngo {
width: 281px;
height: 105px;
opacity: 1;
left: 327px;
position: absolute;
transform-origin: 0px 0px 0px;
}
}
.recallbtnclose {
width: 44px;
height: 44px;
opacity: 1;
display: block;
left: 624px;
top: 38px;
position: absolute;
transform-origin: 0px 0px 0px;
}
}
\ No newline at end of file
...@@ -41,6 +41,16 @@ const apiList = { ...@@ -41,6 +41,16 @@ const apiList = {
handle: 'login', handle: 'login',
method:'get', method:'get',
isShowLoading: false isShowLoading: false
},
adoptCat:{
handle: 'adoptCat',
method:'get',
isShowLoading: false
},
recallInfo:{
handle:'recallInfo',
method:'get',
isShowLoading: false
} }
}; };
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
height: 72rpx; height: 72rpx;
opacity: 1; opacity: 1;
left: 59rpx; left: 59rpx;
top: 46rpx; top: 38rpx;
position: absolute; position: absolute;
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
font-size: 28rpx; font-size: 28rpx;
...@@ -67,24 +67,27 @@ ...@@ -67,24 +67,27 @@
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
} }
.catname .catnameinput .catnameinputlabel { .catname .catnameinput .catnameinputlabel {
width: 104rpx; width: 420rpx;
height: 27rpx; height: 47rpx;
opacity: 1; opacity: 1;
left: 199rpx; left: 33rpx;
top: 37rpx; top: 25rpx;
position: absolute; position: absolute;
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
font-size: 28rpx; font-size: 28rpx;
color: #685b4e; color: #685b4e;
background-color: rgba(0, 0, 0, 0);
} }
.catname .catnameinput .catnameinputrandom { .catname .catnameinput .catnameinputrandom {
width: 91rpx; width: 500rpx;
height: 26rpx; height: 26rpx;
opacity: 1; opacity: 1;
left: 205rpx; left: 0rpx;
top: 121rpx; top: 121rpx;
position: absolute; position: absolute;
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
font-size: 24rpx; font-size: 24rpx;
color: #f8f1eb; color: #f8f1eb;
text-align: center
} }
<view class="catname"> <view class="catname">
<image class="catnamecatimg" src={{resList['02aacfd1-3347-40a7-8a3a-9f20c1b5706b'].url}} /> <image class="catnamecatimg" src="{{catImg}}" />
<view class="catnamedialog"> <view class="catnamedialog">
<image class="catnamedialogbg" src={{resList['50779aee-069e-4dd9-b2ff-88beda9f43d1'].url}} /> <image class="catnamedialogbg" src={{resList['50779aee-069e-4dd9-b2ff-88beda9f43d1'].url}} />
<label class="catnamedialoglabel">铲屎官~帮我取个名字吧!喵~</label> <label class="catnamedialoglabel">铲屎官~帮我取个名字吧!喵~</label>
</view> </view>
<image class="catnamesure" src={{resList['c7916d41-ea9d-4f8e-b5aa-e2060d6ae265'].url}} /> <image class="catnamesure" onTap="catNameSure" src={{resList['c7916d41-ea9d-4f8e-b5aa-e2060d6ae265'].url}} />
<view class="catnameinput"> <view class="catnameinput">
<image class="catnameinputbg" src={{resList['947d970f-52bf-4319-82f0-a3e65620ed75'].url}} /> <image class="catnameinputbg" src={{resList['947d970f-52bf-4319-82f0-a3e65620ed75'].url}} />
<label class="catnameinputlabel">输入名字</label> <input class="catnameinputlabel" maxlength="6" onBlur="getCatName" value="{{catName}}" placeholder="输入名字" name="" ></input>
<label class="catnameinputrandom">随机名字</label> <text class="catnameinputrandom" onTap="randomName" >随机名字</text>
</view> </view>
</view> </view>
\ No newline at end of file
'use strict'; 'use strict';
import API from '../../api';
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
Component({ Component({
props: {}, props: {
data: { catImgArr: ["90b114e6-83cb-46f1-b607-f88c50077b05", "003e9904-aee4-4b8d-8d5d-fb4b1188bec1", "90283bd3-4b18-4535-97a8-90318f068781", "4e471df6-01ab-421d-ba0b-084b2110dc6d"],
resList: resList catName: ""
}, },
methods: {}, data: {
resList: resList,
catName: "",
catImg: ""
},
methods: {
onModalClose() {
const {
onModalClose
} = this.props;
onModalClose && onModalClose();
},
onSelectCatOk() {
const {
onSelectCatOk
} = this.props;
onSelectCatOk && onSelectCatOk(this.props.catName);
},
/**随机名字 */
randomName() {
console.log("随即名字")
let name = "Edwise"
this.setData({
catName: name
})
this.props.catName = name;
},
/**获取名字 */
getCatName(e) {
// console.log(e.detail.value)
this.props.catName = e.detail.value;
// console.log(this.props.catName)
},
/**确认 */
async catNameSure() {
let name = this.props.catName;
if (name.length <= 0) {
my.showToast({
content: "名字不能为空哦",
});
} else {
/**检查敏感词 */
/**调用领养接口 */
const adoptCat = await API.adoptCat({
catName: name,
catType: this.props.selectType
});
console.log("aaaa",adoptCat)
if (adoptCat && adoptCat.success) {
this.onModalClose();
this.onSelectCatOk();
} else {
my.showToast(adoptCat?adoptCat.message:null)
}
}
console.log(this.props.catName)
}
},
didMount() {
console.log(this.props.catImgArr[this.props.selectType - 1].url)
this.setData({
catImg: resList[this.props.catImgArr[this.props.selectType - 1]].url
})
console.log("类型" + this.props.selectType + "起名")
}
onInit(props) {
this.setData(this.data || {
resList: resList
});
}
}); });
\ No newline at end of file
.getcat {
width: 465rpx;
height: 671rpx;
opacity: 1;
left: 130rpx;
top: 378rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.getcat .getcatimg {
width: 421rpx;
height: 301rpx;
opacity: 1;
left: 34rpx;
top: 202rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.getcat .getcatdialog {
width: 465rpx;
height: 176rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.getcat .getcatdialog .getcatdialogbg {
width: 465rpx;
height: 176rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.getcat .getcatdialog .getcatdialogtext {
width: 326rpx;
height: 73rpx;
opacity: 1;
left: 69rpx;
top: 39rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 28rpx;
color: #574b45;
}
.getcat .getcatgo {
width: 282rpx;
height: 106rpx;
opacity: 1;
left: 107rpx;
top: 565rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
<view class="getcat">
<image class="getcatimg" src={{resList['02aacfd1-3347-40a7-8a3a-9f20c1b5706b'].url}} />
<view class="getcatdialog">
<image class="getcatdialogbg" src={{resList['24b7d459-41d6-408c-9829-4768fe38abf5'].url}} />
<label class="getcatdialogtext">好了,现在你就是{{catName}}的铲屎官了~</label>
</view>
<image class="getcatgo" onTap="onPostSelectCat" src={{resList['97484cf2-5146-4287-b104-ed1f43c71ee0'].url}} />
</view>
\ No newline at end of file
'use strict';
import resList from '../../resconfig/resList';
Component({
props: {
catName: ''
},
data: {
resList: resList
},
methods: {
onModalClose() {
const {
onModalClose
} = this.props;
onModalClose && onModalClose();
console.log('onModalClose')
},
onPostSelectCat() {
const {
onPostSelectCat
} = this.props;
onPostSelectCat && onPostSelectCat();
}
},
});
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="message-modal"> <view class="message-modal">
<view class="message__shade modal-animate-fade-in" /> <view class="message__shade modal-animate-fade-in" />
<view class="message "> <view class="message ">
<image class="message_bg " src={{resList['0c446868-16d2-47f1-a0d6-27dadff681f2'].url}} /> <image class="message_bg " src={{resList['ed31e83e-535d-45bf-ba5b-20827a4cd104'].url}} />
<label class="message_txt ">{{mydata.catName}}</label> <label class="message_txt ">{{mydata.catName}}</label>
<image class="message_btn " onTap="onModalClose" src={{resList['3ad6a924-dda8-49f4-b8fc-0e796347e802'].url}} /> <image class="message_btn " onTap="onModalClose" src={{resList['3ad6a924-dda8-49f4-b8fc-0e796347e802'].url}} />
<image class="message_closebtn " onTap="onModalClose" src={{resList['5488b126-f520-496f-ace6-010a89eb108f'].url}} /> <image class="message_closebtn " onTap="onModalClose" src={{resList['5488b126-f520-496f-ace6-010a89eb108f'].url}} />
......
'use strict'; 'use strict';
import API from '../../api';
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
Component({ Component({
props: { props: {
mydata:null mydata:null
}, },
data: { data: {
resList: resList resList: resList,
backTime:''
}, },
methods: { methods: {
onModalClose() { onModalClose() {
...@@ -16,6 +18,15 @@ Component({ ...@@ -16,6 +18,15 @@ Component({
} }
}, },
async didMount(){
const recall = await API.recallInfo();
if(recall&&recall.success){
this.setData({
backTime:recall.data.backTime
})
}else{
my.showToast(recall?recall.message:null);
}
}
}); });
\ No newline at end of file
.recallcat {
width: 721rpx;
height: 562rpx;
opacity: 1;
left: 18rpx;
top: 500rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.recallcat .recallcatbg {
width: 721rpx;
height: 562rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.recallcat .recallcatbacklabel {
width: 615rpx;
height: 25rpx;
opacity: 1;
left: 52rpx;
top: 335rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 26rpx;
color: #685b4e;
text-align: center;
}
.recallcat .recallcathappycoin {
width: 119rpx;
height: 29rpx;
opacity: 1;
left: 265rpx;
top: 235rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 36rpx;
color: #e74846;
text-align: center
}
.recallcat .recallbtngroup {
width: 608rpx;
height: 105rpx;
opacity: 1;
left: 54rpx;
top: 421rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.recallcat .recallbtngroup .recallbtncancel {
width: 281rpx;
height: 105rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.recallcat .recallbtngroup .recallbtngo {
width: 281rpx;
height: 105rpx;
opacity: 1;
left: 327rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.recallcat .recallbtnclose {
width: 44rpx;
height: 44rpx;
opacity: 1;
display: block;
left: 624rpx;
top: 38rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
<view class="recallcat">
<image class="recallcatbg" src={{resList['40cac443-7998-4c2a-8f9c-38121b2385e3'].url}} />
<label class="recallcatbacklabel">{{timeText}}</label>
<label class="recallcathappycoin">{{happyCoinCnt}}</label>
<view class="recallbtngroup">
<image class="recallbtncancel" onTap="onModalClose" src={{resList['6957d9f3-9aa4-4ed6-9b83-57cc68f16512'].url}} />
<image class="recallbtngo" src={{resList['6d8cdd11-fbc5-4e84-b5ef-1f74c9070738'].url}} />
</view>
<image class="recallbtnclose" onTap="onModalClose" src={{resList['29e80fbb-98ed-40fb-a11b-e14b45fee158'].url}} />
</view>
\ No newline at end of file
'use strict';
import API from '../../api';
import resList from '../../resconfig/resList';
Component({
props: {},
data: {
resList: resList,
timeText: '',
happyCoinCnt:''
},
methods: {
onModalClose() {
const {
onModalClose
} = this.props;
onModalClose && onModalClose();
console.log('onModalClose')
},
/**根据时间戳获取日期-月-日 */
getDateDayMonthByTime(time) {
let date = new Date(time);
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
let hours = date.getHours();
let minutes = date.getMinutes();;
let seconds = date.getSeconds();
if (hours <= 0) {
if (minutes <= 0) {
// if (seconds <= 0) {
date = 0 + '小时' + 0 + '分';
// } else {
// date = seconds + "秒"
// }
} else {
date = hours + '小时' + minutes + '分';
}
} else {
date = hours + '小时' + minutes + '分';
}
console.log(hours);
return date;
}
},
async didMount() {
const recall = await API.recallInfo();
console.log(recall);
if (recall && recall.success) {
var text = "猫咪预计" + this.getDateDayMonthByTime(recall.data.backTime - recall.data.serverTime) + "后回寝";
this.setData({
timeText: text,
happyCoinCnt:recall.data.value+''
})
} else {
my.showToast(recall ? recall.message : null)
}
}
});
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
...@@ -2,45 +2,49 @@ ...@@ -2,45 +2,49 @@
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
Component({ Component({
props: { props: {
}, },
data: { data: {
resList: resList, resList: resList,
curSelect:1 //1:蓝猫,2:三花,3:暹罗,4:橘猫 curSelect: 1 //1:蓝猫,2:三花,3:暹罗,4:橘猫
},
methods: {
onModalClose() {
const { onModalClose } = this.props;
onModalClose && onModalClose();
console.log('onModalClose')
}, },
methods: {
changeSelectCat(e){ onModalClose() {
// console.log(e.currentTarget.id); const {
let type = parseInt(e.currentTarget.id.split("_")[1]); onModalClose
this.setData({ } = this.props;
curSelect:type onModalClose && onModalClose();
}) console.log('onModalClose')
console.log(type); },
changeSelectCat(e) {
// console.log(e.currentTarget.id);
let type = parseInt(e.currentTarget.id.split("_")[1]);
this.setData({
curSelect: type
})
console.log(type);
},
selectSure() {
console.log(this.props);
this.onModalClose();
const {
onSelectCat
} = this.props;
console.log(onSelectCat)
onSelectCat && onSelectCat(this.data.curSelect);
}
},
didMount() {
console.log(this.data.curSelect)
this.setData({
curSelect: 2
})
}, },
selectSure(){
console.log(this.props);
const {closeModal,onModalClose} = this.props;
onModalClose && onModalClose();
console.log(closeModal)
closeModal&&closeModal();
}
},
didMount() {
console.log(this.data.curSelect)
this.setData({
curSelect:2
})
},
}); });
\ No newline at end of file
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
<rule-modal a:if="{{ruleModalVisible}}" onModalClose="closeRuleModal"><text>{{rule}}</text></rule-modal> <rule-modal a:if="{{ruleModalVisible}}" onModalClose="closeRuleModal"><text>{{rule}}</text></rule-modal>
<levelup-modal a:if="{{levelupModalVisible}}" onModalClose="closeLevelupModal"></levelup-modal> <levelup-modal a:if="{{levelupModalVisible}}" onModalClose="closeLevelupModal"></levelup-modal>
<message-modal a:if="{{messageModalVisible}}" mydata="{{messageModalData}}" onModalClose="closeMessageModal"></message-modal> <message-modal a:if="{{messageModalVisible}}" mydata="{{messageModalData}}" onModalClose="closeMessageModal"></message-modal>
<view class="popcontainer" a:if="{{selectcatModalVisible}}"><selectcat-modal onModalClose="closeSelectcatModal" closeModal=closeModal></selectcat-modal></view> <view class="popcontainer" a:if="{{selectcatModalVisible}}"><selectcat-modal onModalClose="closeSelectcatModal" onSelectCat="selectCat"></selectcat-modal></view>
<view class="popcontainer" a:if="{{catnameModalVisible}}" ><catname-modal onModalClose="closeCatnameModal"/></view> <view class="popcontainer" a:if="{{catnameModalVisible}}" ><catname-modal selectType="{{catType}}" onModalClose="closeCatnameModal" onSelectCatOk="selectCatOk" /></view>
<view class="popcontainer" a:if="{{recallcatModalVisible}}"><recallcat-modal onModalClose="closeRecallcatModal"></recallcat-modal></view>
<view class="popcontainer" a:if="{{getcatModalVisible}}"><getcat-modal catName="{{catName}}" onPostSelectCat="postSelectCat" onModalClose="closeGetcatModal"></getcat-modal></view>
\ No newline at end of file
...@@ -34,6 +34,8 @@ Page({ ...@@ -34,6 +34,8 @@ Page({
levelupModalVisible: false, levelupModalVisible: false,
selectcatModalVisible: false, selectcatModalVisible: false,
catnameModalVisible: false, catnameModalVisible: false,
recallcatModalVisible:false,
getcatModalVisible:false
}, },
onLoad(props) { onLoad(props) {
...@@ -64,7 +66,7 @@ Page({ ...@@ -64,7 +66,7 @@ Page({
that.onMessage({ that.onMessage({
data: data data: data
}) })
}, 2000) }, 1000)
//授权和登录先搞 //授权和登录先搞
// this.getAuth(); // this.getAuth();
my.__onMessage__ = (e) => { my.__onMessage__ = (e) => {
...@@ -97,8 +99,8 @@ Page({ ...@@ -97,8 +99,8 @@ Page({
this.main.addGlobalEvent("onMessage", self.onMessage, self); this.main.addGlobalEvent("onMessage", self.onMessage, self);
this.main.addGlobalEvent("toast", self.showToast, self); this.main.addGlobalEvent("toast", self.showToast, self);
this.main.addGlobalEvent("loading", self.showLoadingHandler,self); this.main.addGlobalEvent("loading", self.showLoadingHandler, self);
this.main.addGlobalEvent("hideloading",self.hideLoadingHandler,self); this.main.addGlobalEvent("hideloading", self.hideLoadingHandler, self);
} }
} }
}); });
...@@ -120,10 +122,10 @@ Page({ ...@@ -120,10 +122,10 @@ Page({
duration: 2000 duration: 2000
}); });
}, },
showLoadingHandler(){ showLoadingHandler() {
my.showLoading(); my.showLoading();
}, },
hideLoadingHandler(){ hideLoadingHandler() {
my.hideLoading(); my.hideLoading();
}, },
...@@ -267,9 +269,24 @@ Page({ ...@@ -267,9 +269,24 @@ Page({
} }
}, },
/**选择猫咪,打开取名弹窗 */ /**选择猫咪,打开取名弹窗 */
closeModal() { selectCat(type) {
// this.catType = type; // this.catType = type;
// console.log("选择了", type) this.setData({
catType:type,
catnameModalVisible:true
})
console.log("选择了", type)
},
/**选择好猫咪后打开getCat弹窗 */
selectCatOk(name){
this.setData({
catName:name,
getcatModalVisible:true
})
},
/**领养完猫咪之后传输消息给主页 */
postSelectCat(r){
this.main.dispatchGlobalEvent("selectEnd",r);
}, },
closeLevelupModal() { closeLevelupModal() {
this.setData({ this.setData({
...@@ -296,4 +313,14 @@ Page({ ...@@ -296,4 +313,14 @@ Page({
selectcatModalVisible: false selectcatModalVisible: false
}) })
}, },
closeRecallcatModal(){
this.setData({
recallcatModalVisible:false
})
},
closeGetcatModal(){
this.setData({
getcatModalVisible:false
})
}
}); });
\ No newline at end of file
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
"levelup-modal": "/components/comlevelup/comlevelup", "levelup-modal": "/components/comlevelup/comlevelup",
"message-modal": "/components/commessage/commessage", "message-modal": "/components/commessage/commessage",
"selectcat-modal":"/components/comselectcat/comselectcat", "selectcat-modal":"/components/comselectcat/comselectcat",
"catname-modal":"/components/comcatname/comcatname" "catname-modal":"/components/comcatname/comcatname",
"recallcat-modal":"/components/comrecallcat/comrecallcat",
"getcat-modal":"/components/comgetcat/comgetcat"
} }
} }
\ No newline at end of file
...@@ -7,6 +7,12 @@ const resList = { ...@@ -7,6 +7,12 @@ const resList = {
uuid: '0c446868-16d2-47f1-a0d6-27dadff681f2', uuid: '0c446868-16d2-47f1-a0d6-27dadff681f2',
url: '//yun.duiba.com.cn/spark/assets/3b954e2265924a7fd5250a5b2b48627360a0b905.png' url: '//yun.duiba.com.cn/spark/assets/3b954e2265924a7fd5250a5b2b48627360a0b905.png'
}, },
'ed31e83e-535d-45bf-ba5b-20827a4cd104': {
name: 'catMessageBg',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/catMessageBg.da96302fead094c1d868dc0edc62f9c3e4085472.png',
uuid: 'ed31e83e-535d-45bf-ba5b-20827a4cd104'
},
'3ad6a924-dda8-49f4-b8fc-0e796347e802': { '3ad6a924-dda8-49f4-b8fc-0e796347e802': {
name: 'message_btn', name: 'message_btn',
ext: '.png', ext: '.png',
...@@ -239,5 +245,58 @@ const resList = { ...@@ -239,5 +245,58 @@ const resList = {
uuid: '947d970f-52bf-4319-82f0-a3e65620ed75', uuid: '947d970f-52bf-4319-82f0-a3e65620ed75',
url: '//yun.duiba.com.cn/spark/assets/b29d45b60af4e4daecce521a84896cb4d276e2a5.png' url: '//yun.duiba.com.cn/spark/assets/b29d45b60af4e4daecce521a84896cb4d276e2a5.png'
}, },
'90b114e6-83cb-46f1-b607-f88c50077b05': {
name: 'bluCat',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/bluCat.57cf00351ffde1985720a877d2e1384390970cd6.png',
uuid: '90b114e6-83cb-46f1-b607-f88c50077b05'
},
'4e471df6-01ab-421d-ba0b-084b2110dc6d': {
name: 'orengeCat',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/orengeCat.c664a89d9d7f63895c5460144098a5bac5fc31f5.png',
uuid: '4e471df6-01ab-421d-ba0b-084b2110dc6d'
},
'003e9904-aee4-4b8d-8d5d-fb4b1188bec1': {
name: 'sanhuaCat',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/sanhuaCat.b58ed1a3960ecd123ff0b0ff38b9cb8ad44c1b4d.png',
uuid: '003e9904-aee4-4b8d-8d5d-fb4b1188bec1'
},
'90283bd3-4b18-4535-97a8-90318f068781': {
name: 'xianluoCat',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/xianluoCat.c28961a75753d2d6ffe788a3ae38e7f3c3937344.png',
uuid: '90283bd3-4b18-4535-97a8-90318f068781'
},
'40cac443-7998-4c2a-8f9c-38121b2385e3': {
name: 'recallCatBg',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/recallCatBg.adb5325fab0c5387d334fe66dc24c98b5cfb39ca.png',
uuid: '40cac443-7998-4c2a-8f9c-38121b2385e3'
},
'6957d9f3-9aa4-4ed6-9b83-57cc68f16512': {
name: '左',
ext: '.png',
uuid: '6957d9f3-9aa4-4ed6-9b83-57cc68f16512',
url: '//yun.duiba.com.cn/spark/assets/dbc32e22d1df97f18aa30e4da22c13d10ee95a9e.png'
},
'6d8cdd11-fbc5-4e84-b5ef-1f74c9070738': {
name: '右',
ext: '.png',
uuid: '6d8cdd11-fbc5-4e84-b5ef-1f74c9070738',
url: '//yun.duiba.com.cn/spark/assets/a55c324b7e8b1560204abe2a60dd1880b2dda47c.png'
},
'29e80fbb-98ed-40fb-a11b-e14b45fee158': {
name: 'X',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/X.ae6442265f9321c6a127197988053c0714963acd.png',
uuid: '29e80fbb-98ed-40fb-a11b-e14b45fee158'
},
}; };
export default resList; export default resList;
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