Commit 75546213 authored by Edwise's avatar Edwise 🍷

123

parent 10126358
...@@ -4,6 +4,7 @@ import { ...@@ -4,6 +4,7 @@ import {
Main Main
} from './output'; } from './output';
import API from '../../api'; import API from '../../api';
import mock from '../../mock';
const app = getApp(); const app = getApp();
const { const {
tbcc tbcc
...@@ -28,7 +29,9 @@ Page({ ...@@ -28,7 +29,9 @@ Page({
messageModalVisible: false, messageModalVisible: false,
messageModalData: {}, messageModalData: {},
ruleModalVisible: false, ruleModalVisible: false,
levelupModalVisible: false levelupModalVisible: false,
selectcatModalVisible: false,
catnameModalVisible: false
}, },
onLoad(props) { onLoad(props) {
...@@ -47,44 +50,23 @@ Page({ ...@@ -47,44 +50,23 @@ Page({
onReady() { onReady() {
console.log('on ready') 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(); // this.getAuth();
setTimeout(() => { my.__onMessage__ = (e) => {
// this.onMessage({ this.onMessage(e)
// 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);
}, },
init() { init() {
console.log('do init'); console.log('do init');
this.spark_startEngine(); this.spark_startEngine();
}, },
spark_startEngine() { spark_startEngine() {
...@@ -193,6 +175,12 @@ Page({ ...@@ -193,6 +175,12 @@ Page({
} = app.cloud; } = app.cloud;
const [myCloudName, handler] = netName.split("."); //待写, 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; parameter.activityId = app.activityId;
fc.invoke(myCloudName, parameter, handler).then(res => { fc.invoke(myCloudName, parameter, handler).then(res => {
this.postMessage(netName, res); this.postMessage(netName, res);
...@@ -236,7 +224,8 @@ Page({ ...@@ -236,7 +224,8 @@ Page({
} = userInfo; } = userInfo;
app.nickName = nickName; app.nickName = nickName;
app.avatar = avatar; app.avatar = avatar;
this.login(); this.init();
// this.login();
} }
}, },
/** /**
...@@ -274,6 +263,15 @@ Page({ ...@@ -274,6 +263,15 @@ Page({
this.setData({ this.setData({
messageModalVisible: false 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