Commit 75546213 authored by Edwise's avatar Edwise 🍷

123

parent 10126358
......@@ -4,6 +4,7 @@ import {
Main
} from './output';
import API from '../../api';
import mock from '../../mock';
const app = getApp();
const {
tbcc
......@@ -28,7 +29,9 @@ Page({
messageModalVisible: false,
messageModalData: {},
ruleModalVisible: false,
levelupModalVisible: false
levelupModalVisible: false,
selectcatModalVisible: false,
catnameModalVisible: false
},
onLoad(props) {
......@@ -47,44 +50,23 @@ Page({
onReady() {
console.log('on ready')
var that = this;
setTimeout(()=>{
var parameter = {name:"catnameModal"}
var data = {netName:"mine.showModal",parameter}
that.onMessage({data:data})
},2000)
//授权和登录先搞
// this.getAuth();
setTimeout(() => {
// this.onMessage({
// data: {
// netName: 'mine.showModal',
// parameter: {
// name: 'levelupModal'
// }
// }
// });
// this.onMessage({
// data: {
// netName: 'mine.showModal',
// parameter: {
// name: 'messageModal',
// data: { catName: '喵喵1122' }
// }
// }
// });
// this.onMessage({
// data: {
// netName: 'mine.navigateToPage',
// parameter: {
// name: 'pageshop'
// }
// }
// });
}, 1000);
my.__onMessage__ = (e) => {
this.onMessage(e)
}
},
init() {
console.log('do init');
this.spark_startEngine();
},
spark_startEngine() {
......@@ -193,6 +175,12 @@ Page({
} = app.cloud;
const [myCloudName, handler] = netName.split("."); //待写,
if (app.requestType == 'yapi') {
console.log('mock[handler]', mock[handler])
this.postMessage(netName, mock[handler]);
return;
}
parameter.activityId = app.activityId;
fc.invoke(myCloudName, parameter, handler).then(res => {
this.postMessage(netName, res);
......@@ -236,7 +224,8 @@ Page({
} = userInfo;
app.nickName = nickName;
app.avatar = avatar;
this.login();
this.init();
// this.login();
}
},
/**
......@@ -274,6 +263,15 @@ Page({
this.setData({
messageModalVisible: false
});
}
},
closeCatnameModal() {
this.setData({
catnameModalVisible: false
})
},
closeSelectcatModal() {
this.setData({
selectcatModalVisible: false
})
},
});
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