Commit 62f5a0d7 authored by Edwise's avatar Edwise 🍷

Merge remote-tracking branch 'refs/remotes/origin/tianmaoxiaoyuan' into tianmaoxiaoyuan

parents e131b8dc 887be58f
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -23,6 +23,11 @@ const request = tbccRequest({
// api handle 列表
const apiList = {
...capi,
doHelp: {
handle: 'doHelp',
method: 'get',
isShowLoading: false
},
doFollowTask: {
handle: 'doFollowTask',
method: 'get',
......
......@@ -81,6 +81,9 @@ Component({
await this.handleGoFollow(sellerId);
await this.getTaskList();
break;
case 'invites':
my.showSharePanel();
break;
default:
console.log('handleTapGoBtn', taskType);
break;
......
import * as FYGE from "fyge-tbmini";
import * as SvgaParser from "svga-parser";
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
......@@ -16,6 +16,13 @@ const {
getSystemInfo
} = tbcc.tb;
const SHARE_CONFIG = {
title: '欧泊莱泡泡大作战',
desc: '快来领取我为你准备的超值小样吧',
imageUrl: "https://yun.duiba.com.cn/db_games/activity/pacman/share.jpg",
path: 'pages/pagecanvas/pagecanvas'
}
const checkSystem = async () => {
const {
version
......@@ -44,9 +51,27 @@ Page({
catbackbedModalVisible: false,
catruleModalVisible: 0
},
onLoad(props) {
async doHelp() {
if(!app.inviteId) return;
commonToast('正在发起助力~')
const { success, data, message } = await API.doHelp({ inviteId: app.inviteId }).catch(res => {
commonToast(res && res.message);
}) || {};
if (success) {
commonToast('助力成功~');
}
},
onLoad(query) {
this.setData({});
if (query) app.inviteId = query.openId;
console.log('onload=>query', query);
// my.showToast({
// content: "query " + JSON.stringify(query),
// duration: 5000
// });
checkSystem().then(r => {
if (!r) {
......@@ -61,7 +86,6 @@ Page({
async onReady() {
console.log('on ready')
//授权和登录先搞
// await this.getAuth();
......@@ -137,14 +161,16 @@ Page({
this.main.addGlobalEvent("toast", self.showToastHandler, self);
this.main.addGlobalEvent("loading", self.showLoadingHandler, self);
this.main.addGlobalEvent("hideloading", self.hideLoadingHandler, self);
this.doHelp();
}
},
fail: () => { console.log('createCanvas fail'); }
});
},
onCanvasReady() {
console.log('onCanvasReady')
onCanvasReady(query) {
console.log('onCanvasReady',query)
//授权和登录先搞
checkSystem().then(r => {
if (r) {
......@@ -195,7 +221,8 @@ Page({
activityId: app.activityId,
nickName: app.nickName,
avatar: app.avatar,
openId: app.openId
openId: app.openId,
inviteId: app.inviteId
}
};
break;
......@@ -292,11 +319,11 @@ Page({
*/
async login() {
const {
nickName,
avatar
nickName,
avatar
} = app;
const {
success
success, data,
} = await API.login({
userNick: nickName,
avatar
......@@ -391,5 +418,18 @@ Page({
this.setData({
catruleModalVisible: false
})
},
onShareAppMessage() {
// 返回自定义分享信息
let { path, ...rest } = SHARE_CONFIG
if (app.openId) {
path = '/pages/pagecanvas/pagecanvas' + '?openId=' + app.openId;
}
console.log(path)
return {
...rest,
path
}
}
});
\ No newline at end of file
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