Commit 9d22853a authored by wildfirecode13's avatar wildfirecode13

11

parent 7aa323bf
# canvas开发
http://gitlab2.dui88.com/wanghongyuan/hello_canvas
# 注意的点
- 不要一次性预加载整个项目的图片,只预加载canvas game需要的。
- 复杂动效用Lottie
- project/src/canvas/game/resCanvasList.js里URL要https开头
# 打开弹窗
```js
sendTbNet(TbNetName.showModal, {name:'ruleModal'}, (s, res) => { })
```
# 切换场景
```js
sendTbNet(TbNetName.navigateToPage, {name:'pageshop'}, (s, res) => { })
```
\ No newline at end of file
# 邀请mvp
\ No newline at end of file
{
"pages": [
"pages/index/index",
"pages/homePage/homePage",
"pages/myprize/myprize",
"pages/index/index",
"pages/pageshop/pageshop",
"pages/tbccDemo/tbccDemo",
"pages/goodsPage/goodsPage",
......
const app = getApp();
const { tbcc } = app;
const { SHARE_CONFIG, REDIRECT_URL } = tbcc.constants;
import API from '../../api';
const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
const SHARE_CONFIG = {
title: '雅顿乐园',
desc: '雅顿乐园 邀请好友助力',
imageUrl: 'https://isv.alibabausercontent.com/00000000/imgextra/i2/676606897/O1CN01eNrwLl20osHoB4Y7d_!!676606897-2-isvtu-00000000.png', // 分享图片URL
path: '/pages/invitePage/invitePage'
};
Page({
doExchange: () => {
my.navigateTo({
url: `/pages/pageshop/pageshop`
});
},
data: {
title: '',
content: '',
......@@ -25,7 +26,6 @@ Page({
onLoad(query) {
// 页面加载
// this.getAuth();
my.navigateTo({url: '../homePage/homePage'})
console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
},
init() {
......@@ -108,52 +108,7 @@ Page({
const { commonModalConfirm } = this.data;
commonModalConfirm && commonModalConfirm();
},
/**
* 执行开始
*/
doStart() {
this.showCommonModal({
content: '活动还未开始\n请稍后',
btnText: '我知道了',
commonModalVisible: true,
confirmCallback: () => {
this.closeCommonModal();
}
});
},
/**
* 显示通用弹层
* @param {object} options content: 通用弹层内容 btnText:按钮文案 confirmCallback: 按钮确认回调
*/
showCommonModal({ content, btnText, confirmCallback }) {
this.setData({
commonModalConfirm: confirmCallback || null,
commonModalVisible: true,
commonModalData: { content, btnText }
});
},
/**
* 跳转到天猫页面
*/
goTmallPage() {
navigateToOutside(REDIRECT_URL['tmall']);
},
/**
* 关闭通用弹层
*/
closeCommonModal() {
this.setData({
commonModalVisible: false
});
},
/**
* 关闭活动规则弹层
*/
closeRuleModal() {
this.setData({
ruleModalVisible: false
});
},
onShareAppMessage() {
// 返回自定义分享信息
return SHARE_CONFIG;
......
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