Commit 2a71abcb authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

parent 84a3c2ba
...@@ -1915,7 +1915,7 @@ ...@@ -1915,7 +1915,7 @@
width: 750rpx; width: 750rpx;
height: 1624rpx; height: 1624rpx;
position: fixed; position: fixed;
top: 400rpx; top: 220rpx;
left: 0rpx; left: 0rpx;
right: 0rpx; right: 0rpx;
bottom: 0rpx; bottom: 0rpx;
......
...@@ -11,7 +11,6 @@ import { SHARE_CONFIG } from '/tbcc-sdk/lib/constants'; ...@@ -11,7 +11,6 @@ import { SHARE_CONFIG } from '/tbcc-sdk/lib/constants';
import resList from '../../resconfig/resList'; //import API from '../../api'; import resList from '../../resconfig/resList'; //import API from '../../api';
import API from '../../api'; import API from '../../api';
const { commonToast, getAuthUserInfo, navigateToOutside, getSystemInfo, getServerTime } = tbcc.tb; const { commonToast, getAuthUserInfo, navigateToOutside, getSystemInfo, getServerTime } = tbcc.tb;
let cardani;
const checkSystem = async () => { const checkSystem = async () => {
const { const {
version version
...@@ -108,6 +107,7 @@ Page({ ...@@ -108,6 +107,7 @@ Page({
}, },
onLoad(query) { onLoad(query) {
console.log("onLoad======>",query);
if (query) { if (query) {
if (query.inviteId) { if (query.inviteId) {
app.inviteId = query.inviteId; app.inviteId = query.inviteId;
...@@ -243,6 +243,7 @@ Page({ ...@@ -243,6 +243,7 @@ Page({
// }); // });
console.log(123) console.log(123)
try {
var canvas = await new Promise((r) => { var canvas = await new Promise((r) => {
my.createCanvas({ my.createCanvas({
id: 'canvas', id: 'canvas',
...@@ -269,7 +270,7 @@ Page({ ...@@ -269,7 +270,7 @@ Page({
FYGE.RENDERER_TYPE.CANVAS FYGE.RENDERER_TYPE.CANVAS
); );
var con = stage.addChild(new FYGE.Container()) var con = stage.addChild(new FYGE.Container())
con.y=stage.viewRect.y; con.y = stage.viewRect.y;
//stage初始化 //stage初始化
stage.addEventListener(FYGE.Event.INIT_STAGE, () => { stage.addEventListener(FYGE.Event.INIT_STAGE, () => {
...@@ -286,7 +287,7 @@ Page({ ...@@ -286,7 +287,7 @@ Page({
var a = con.addChild(new FYGE.Lottie(whitedia)) var a = con.addChild(new FYGE.Lottie(whitedia))
a.play(); a.play();
cardani = a; // cardani = a;
//加个lottie //加个lottie
// this.eggBreak = stage.addChild(new FYGE.Lottie(egg_break)) // this.eggBreak = stage.addChild(new FYGE.Lottie(egg_break))
// b.play(); // b.play();
...@@ -311,6 +312,9 @@ Page({ ...@@ -311,6 +312,9 @@ Page({
stage.flush(); stage.flush();
FYGE.getRequestAnimationFrame()(loop); FYGE.getRequestAnimationFrame()(loop);
} }
} catch (e) {
}
}, },
onCanvasReady() { onCanvasReady() {
console.log("oncanvasready========>"); console.log("oncanvasready========>");
...@@ -386,12 +390,7 @@ Page({ ...@@ -386,12 +390,7 @@ Page({
this.setData({ this.setData({
showani: "block" showani: "block"
}); });
if(cardani){ // this.postMessage("playcardani", null);
cardani.stop();
FYGE.Tween.removeTweens(cardani);
cardani.play(1,()=>{});
}
this.postMessage("playcardani", null);
}, },
/** /**
* 获取用户授权信息 * 获取用户授权信息
...@@ -682,7 +681,7 @@ Page({ ...@@ -682,7 +681,7 @@ Page({
const shareaward = await API.getInviteAwardsList().catch(res => { const shareaward = await API.getInviteAwardsList().catch(res => {
commonToast(res && res.message); commonToast(res && res.message);
}) || {}; }) || {};
// console.log("邀请奖励", shareaward); console.log("邀请奖励", shareaward);
const { success, data } = shareaward; const { success, data } = shareaward;
if (success) { if (success) {
let { list, inviteCount } = data; let { list, inviteCount } = data;
...@@ -692,12 +691,14 @@ Page({ ...@@ -692,12 +691,14 @@ Page({
// list[2].times = 30; // list[2].times = 30;
// list[3].times = 36; // list[3].times = 36;
// // // //
// inviteCount = 6; // inviteCount = 4;
let nearchashare = 0; let nearchashare = 0;
let nearchaprize = ""; let nearchaprize = "";
let prostartx = -438; let prostartx = -438;
let proendx = 0; let proendx = 0;
let levelpro = 0; let levelpro = 0;
let havesetpro = false;
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
let idata = list[i]; let idata = list[i];
...@@ -705,7 +706,7 @@ Page({ ...@@ -705,7 +706,7 @@ Page({
if (itimes >= inviteCount && nearchashare == 0) {//最近差多少 if (itimes >= inviteCount && nearchashare == 0) {//最近差多少
nearchashare = itimes - inviteCount; nearchashare = itimes - inviteCount;
if (!havesetpro) {
if (i == 0) { if (i == 0) {
prostartx = -438; prostartx = -438;
proendx = -410; proendx = -410;
...@@ -713,17 +714,20 @@ Page({ ...@@ -713,17 +714,20 @@ Page({
} else if (i == 1) { } else if (i == 1) {
prostartx = -410; prostartx = -410;
proendx = nearchashare > 1 ? -300 : -275; proendx = nearchashare > 1 ? -300 : -275;
levelpro = nearchashare > 1 ? inviteCount / (itimes - 1) : 1; levelpro = nearchashare > 1 ? inviteCount / (itimes - 1 - list[0].times) : 1;
} else if (i == 2) { } else if (i == 2) {
prostartx = -275; prostartx = -275;
proendx = nearchashare > 1 ? -165 : -138; proendx = nearchashare > 1 ? -165 : -138;
levelpro = nearchashare > 1 ? inviteCount / (itimes - 1) : 1; levelpro = nearchashare > 1 ? inviteCount / (itimes - 1 - list[1].times) : 1;
} else if (i == 3) { } else if (i == 3) {
prostartx = -138; prostartx = -138;
proendx = nearchashare > 1 ? -28 : 0; proendx = nearchashare > 1 ? -28 : 0;
levelpro = nearchashare > 1 ? inviteCount / (itimes - 1) : 1; levelpro = nearchashare > 1 ? inviteCount / (itimes - 1 - list[2].times) : 1;
}
havesetpro = true;
} }
if (nearchashare != 0) { if (nearchashare != 0) {
let itype = Number(idata.type); let itype = Number(idata.type);
nearchaprize = ["抽碎片次数", "随机稀有碎片", "未收录碎片"][itype - 1]; nearchaprize = ["抽碎片次数", "随机稀有碎片", "未收录碎片"][itype - 1];
...@@ -732,13 +736,17 @@ Page({ ...@@ -732,13 +736,17 @@ Page({
} }
} }
console.log(nearchashare,nearchaprize); console.log(nearchashare, nearchaprize);
let sharepropos = '-438rpx 0rpx'; let sharepropos = '-438rpx 0rpx';
if (inviteCount >= list[list.length - 1].times) { if (inviteCount >= list[list.length - 1].times) {
sharepropos = '0rpx orpx'; console.log("test23333333======>1")
sharepropos = '0rpx 0rpx';
} else { } else {
console.log("test23333333======>2")
sharepropos = (proendx - prostartx) * levelpro + prostartx + 'rpx 0rpx'; sharepropos = (proendx - prostartx) * levelpro + prostartx + 'rpx 0rpx';
} }
console.log("test23333333======>", inviteCount, list[list.length - 1].times, proendx, prostartx, levelpro);
// let sharepro = inviteCount / list[list.length - 1].times; // let sharepro = inviteCount / list[list.length - 1].times;
// // console.log("代码暂存233====》",sharepro,inviteCount,list[list.length-1].times); // // console.log("代码暂存233====》",sharepro,inviteCount,list[list.length-1].times);
// if (sharepro > 1) sharepro = 1; // if (sharepro > 1) sharepro = 1;
...@@ -868,7 +876,7 @@ Page({ ...@@ -868,7 +876,7 @@ Page({
async checkIsVip() { async checkIsVip() {
const uvipinfo = await API.getVipInfo({ const uvipinfo = await API.getVipInfo({
inviteId: app.inviteId, inviteId: app.inviteId,
shoesType:app.shoesType, shoesType: app.shoesType,
}).catch(res => { }).catch(res => {
commonToast(res && res.message); commonToast(res && res.message);
}) || {}; }) || {};
......
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