Commit 4cbfaefc authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

parent 6852730f
{
"pages": [
"pages/pageshou_ye/pageshou_ye",
"pages/pagecanvas/pagecanvas",
"pages/myprize/myprize"
],
"window": {}
"window": {
"enableSkia": "true",
"allowsBounceVertical": "NO"
}
}
\ No newline at end of file
<view class="attion_dan_chuang modal-animate-zoom-in diacontmidpos">
<view class="attion_dan_chuang modal-animate-zoom-in diacontmidpos" disable-scroll="true">
<image class="dan_chuang_dibg" src={{resList['8cd6d3b2-8c53-4cda-80e0-c5de3fc5b0b2'].url}} />
<image class="guan_bi_an_niu2" src={{resList['6d394fc5-a3b4-4b85-a9ae-7ff535552bf1'].url}} onTap="onClose" />
<image class="gong_xi_ni" src={{resList['c94d9aad-00a6-40fe-8f2a-f76fdda5428a'].url}} />
......
<view class="dan_chuang_di">
<view class="dan_chuang_di modal-animate-fade-in" disable-scroll="true">
<image class="dialogbg" src={{resList['1c412a35-dce3-422e-9f7e-cff25bee6d2c'].url}} />
</view>
\ No newline at end of file
<view class="gui_ze_dan_chuang modal-animate-zoom-in diacontmidpos">
<view class="gui_ze_dan_chuang modal-animate-zoom-in diacontmidpos" disable-scroll="true">
<image class="gui_ze_dibg" src={{resList['69f7f864-b5ec-4e75-ac2f-d732cf74b5e5'].url}} />
<image class="guan_bi_an_niu5" src={{resList['6d394fc5-a3b4-4b85-a9ae-7ff535552bf1'].url}} onTap="onClose" />
<view class="rulegro">
......
<view class="info_dan_chuang modal-animate-zoom-in diacontmidpos">
<view class="info_dan_chuang modal-animate-zoom-in diacontmidpos" disable-scroll="true">
<image class="dan_chuang_dibg2" src={{resList['e4b535dd-c60d-4889-af6b-afc6b2b351a5'].url}} />
<image class="guan_bi_an_niu3" src={{resList['6d394fc5-a3b4-4b85-a9ae-7ff535552bf1'].url}} onTap="onClose" />
<image class="gong_xi_ni1" a:if="{{infotopshow}}" src={{resList['c94d9aad-00a6-40fe-8f2a-f76fdda5428a'].url}} />
......
<view class="pai_xing_bang modal-animate-fly-in diacontbotpos">
<view class="pai_xing_bang modal-animate-fly-in diacontbotpos" disable-scroll="true">
<image class="pai_xing_bang_dibg" src={{resList['fbded3c5-6e0f-45b5-ab8c-9cc3ecaad006'].url}} />
<image class="guan_bi_an_niu4" src={{resList['6d394fc5-a3b4-4b85-a9ae-7ff535552bf1'].url}} onTap="onClose" />
<label class="ren_qi_pai_ming">-人气排名-</label>
......
......@@ -2,7 +2,7 @@
top: 0rpx;
left: 0rpx;
width: 750rpx;
height: 690rpx;
height: 1040rpx;
display: block;
position: absolute;
}
......
<view class="sui_pian_dan_chuang modal-animate-zoom-in diacontmidpos">
<view class="sui_pian_dan_chuang modal-animate-fade-in diacontmidpos" disable-scroll="true">
<label class="sui_piantit">{{tit}}</label>
<label class="sui_pian_futit">{{subtit}}</label>
<image class="image" src={{spimg}} />
......
<view class="xin_ren_li_bao modal-animate-zoom-in diacontmidpos">
<view class="xin_ren_li_bao modal-animate-zoom-in diacontmidpos" disable-scroll="true">
<label class="li_baotit">集碎片赢特步新品同款鞋</label>
<label class="li_bao_futit">集齐新品碎片既有机会带TA回家哦</label>
<image class="li_baoimg" src={{resList['ecf30aa1-6e23-463e-9d24-e81e1086fa9e'].url}} />
......
<view class="xuan_ze_dan_chuang modal-animate-zoom-in diacontmidpos">
<view class="xuan_ze_dan_chuang modal-animate-zoom-in diacontmidpos" disable-scroll="true">
<view class="pintudiv1">
<image class="pin_tu_di1" src={{resList['85f45c26-b7df-4dbc-ae37-5e9325c35677'].url}} />
<image class="pin_tu_di_kuang1" src={{resList['2a1adc3a-b4db-47db-bf6e-6f1000e64a83'].url}} />
......
This diff is collapsed.
......@@ -3,7 +3,7 @@
"message":"网络异常",
"data": {
"name": "山海",
"type": 5,
"type": 3,
"image": "//yun.duiba.com.cn/spark/assets/原图二次元.a0ae5554ff69d2bd72fe3ad759da2fe6c914f280.jpg"
}
}
\ No newline at end of file
......@@ -1123,9 +1123,7 @@ exports.destroyLayers = destroyLayers;
"use strict";
__webpack_require__.r(__webpack_exports__);
const resCanvasList = {
};
const resCanvasList = {};
/* harmony default export */ __webpack_exports__["default"] = (resCanvasList);
......@@ -1191,7 +1189,7 @@ var Main = (function () {
FYGE.initedByCanvas(canvas);
sysInfo = my.getSystemInfoSync();
}
var stage = new FYGE.Stage(canvas, 750, 1624, sysInfo && sysInfo.windowWidth || document.body.clientWidth, sysInfo && sysInfo.windowHeight || document.body.clientHeight, FYGE.RENDERER_TYPE.WEBGL);
var stage = new FYGE.Stage(canvas, 750, 1624, sysInfo && sysInfo.windowWidth || document.body.clientWidth, sysInfo && sysInfo.windowHeight || document.body.clientHeight, FYGE.RENDERER_TYPE.CANVAS);
this.stage = stage;
stage.addEventListener(FYGE.Event.INIT_STAGE, this.onAddToStage, this);
var self = this;
......@@ -1216,7 +1214,6 @@ var Main = (function () {
_a.sent();
console.log("通用资源加载完成");
ctrls_1.changeScene(StartScene_1.StartScene);
exports.GDispatcher.dispatchEvent("game-load-complete");
return [2];
}
});
......@@ -1455,11 +1452,6 @@ var G_EVENT;
G_EVENT["ON_SHOW"] = "onShow";
G_EVENT["ON_HIDE"] = "onHide";
G_EVENT["UPDATE_TASK"] = "UpdateTask";
G_EVENT["JUMP_HIGH_RESET"] = "jump-high-reset";
G_EVENT["JUMP_HIGH_START"] = "jump-high-start";
G_EVENT["JUMP_HIGH_REVIVE"] = "jump-high-revive";
G_EVENT["JUMP_HIGH_PAUSE"] = "jump-high-pause";
G_EVENT["JUMP_HIGI_RESUME"] = "jump-high-resume";
})(G_EVENT = exports.G_EVENT || (exports.G_EVENT = {}));
......@@ -1797,10 +1789,8 @@ var StartScene = (function (_super) {
return __awaiter(this, void 0, void 0, function () {
var itxt;
return __generator(this, function (_a) {
console.log("Canvas========>initUi============");
this.whiteani = new FYGE.Lottie(whitedia_1.whitedia);
this.addChild(this.whiteani);
this.resetani();
itxt = new FYGE.TextField();
itxt.size = 66;
itxt.text = "测试动画";
......@@ -1813,21 +1803,24 @@ var StartScene = (function (_super) {
};
StartScene.prototype.initEvents = function () {
_super.prototype.initEvents.call(this);
console.log("initEvents===========");
Main_1.GDispatcher.addEventListener('playcardani', this.resetani, this);
};
StartScene.prototype.removeEvents = function () {
_super.prototype.removeEvents.call(this);
console.log("removeEvents=============");
Main_1.GDispatcher.removeEventListener('playcardani', this.resetani, this);
};
StartScene.prototype.resetani = function () {
console.log("resetani");
var _this = this;
this.whiteani.stop();
FYGE.Tween.removeTweens(this.whiteani);
this.whiteani.play(1, function () {
_this.whiteani.stop();
console.log("动画播放完毕");
Main_1.GDispatcher.dispatchEvent("cardani_over");
Main_1.GDispatcher.dispatchEvent({
type: "onMessage"
}, {
netName: "cardani_over"
});
});
};
StartScene.prototype.destroygame = function () {
......
......@@ -5,6 +5,7 @@
height: 1624rpx;
display: block;
position: absolute;
overflow: hidden;
}
.style1{
top: 0rpx;
......@@ -671,6 +672,62 @@
transform-origin: 0rpx 0rpx 0rpx;
text-align: center;
}
.shou_ye .contnode .whitept {
width: 589rpx;
height: 389rpx;
opacity: 1;
display: block;
left: 80.5rpx;
top: 30rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
opacity: 0;
animation: modalAnimateFadeIn .3s forwards;
}
.shou_ye .contnode .ptnode {
width: 589rpx;
height: 389rpx;
opacity: 1;
display: block;
left: 80.5rpx;
top: 33rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shou_ye .contnode .ptnode .showallimg {
width: 589rpx;
height: 389rpx;
opacity: 1;
display: block;
top:0;
left: 0;
bottom: 0;
right: 0;
/* margin: auto; */
position: absolute;
transform-origin: 50% 50%;
}
.ptimgani {
transform: scale(0);
animation: modalAnimatePtAni 1.0s forwards;
}
@keyframes modalAnimatePtAni{
from{
transform: scale(0)
}
30%{
transform: scale(0)
}
60%{
transform: scale(1)
}
80%{
transform: scale(0.98)
}
to{
transform: scale(1)
}
}
.shou_ye .botnode {
width: 750rpx;
height: 300rpx;
......@@ -1640,4 +1697,23 @@
top: 450rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shou_ye .canvas {
width:100%;
height:100%;
pointer-events: none;
}
.shou_ye .page-game {
/* position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
min-height: 100vh; */
width:100%;
height:100vh;
flex: 1;
display: flex;
flex-direction: column;
pointer-events: none;
}
\ No newline at end of file
<view class="shou_ye style1">
<view class="shou_ye" disable-scroll="{{canscroll}}">
<image class="bg" src={{resList['05608aab-d250-45fe-9cd0-6c55b3a7b821'].url}} />
<view class="homescroll" />
<view class="topnode">
......@@ -82,6 +82,10 @@
</view>
</view>
</view>
<image class="whitept" a:if="{{whitept_v}}" src={{resList['56d322ae-bfcb-4d03-b5bc-81603cb2fe5b'].url}} />
<view class="ptnode">
<image class="showallimg ptimgani" a:if="{{ptimg_v}}" src={{resList['jijia7'].url}} />
</view>
</view>
<view class="botnode">
<view class="selshoes" a:if="{{selected==1}}">
......@@ -191,12 +195,16 @@
<image class="shuang_shi_yi_zhuan_qu" onTap="registerD11" src={{resList['e9a0ad73-6fe7-40bd-98cc-9a985bc413e7'].url}} />
</view>
</view>
<dialog-modal a:if="{{showdia}}"></dialog-modal>
<rule-modal a:if="{{rule_v}}" onClose="closeRule" ruletxt={{rule}}></rule-modal>
<rank-modal a:if="{{rank_v}}" onClose="closeRank"></rank-modal>
<attion-modal a:if="{{attion_v}}" onClose="closeAttion" onOpenJlGift="onOpenJlGift" prizeimg="{{prizeimg}}" prizename="{{prizename}}" prizetype="{{prizetype}}" btntype="{{prizebtntype}}"></attion-modal>
<info-modal a:if="{{info_v}}" onClose="closeInfo" onShareFriends="shareAct" infobtntype="{{infobtntype}}" infotopshow="{{infotopshow}}" infotit="{{infotit}}"></info-modal>
<sp-modal a:if="{{sp_v}}" onClose="closeSp" onCollectSp="onCollectSp" onShareSp="onShareSp" onJoinGame="onJoinGame" onJoinVip="onJoinVip" onUpdateUinfo="getUserCardInfo" cardType={{cardType}} israre={{israre}} btntype={{btntype}} spimg={{spimg}} nearchashare={{nearchashare}} nearchaprize={{nearchaprize}} ></sp-modal>
<gift-modal a:if="{{gift_v}}" onClose="closeGift" onOpenGift="onOpenGift"></gift-modal>
<choose-modal a:if="{{choose_v}}" onClose="closeChoose" onPickShoes="pickShoesComp" selshoesidx="{{nselid}}"></choose-modal>
</view>
\ No newline at end of file
</view>
<dialog-modal a:if="{{showdia}}"></dialog-modal>
<view class="page-game" disable-scroll="true">
<canvas disable-scroll="true" id="canvas" class="canvas" onTouchStart="onMouseEvent" onTouchMove="onMouseEvent" onTouchEnd="onMouseEvent" onReady="onCanvasReady">
</canvas>
</view>
<rule-modal a:if="{{rule_v}}" onClose="closeRule" ruletxt={{rule}}></rule-modal>
<rank-modal a:if="{{rank_v}}" onClose="closeRank"></rank-modal>
<attion-modal a:if="{{attion_v}}" onClose="closeAttion" onOpenJlGift="onOpenJlGift" prizeimg="{{prizeimg}}" prizename="{{prizename}}" prizetype="{{prizetype}}" btntype="{{prizebtntype}}"></attion-modal>
<info-modal a:if="{{info_v}}" onClose="closeInfo" onShareFriends="shareAct" infobtntype="{{infobtntype}}" infotopshow="{{infotopshow}}" infotit="{{infotit}}"></info-modal>
<sp-modal a:if="{{sp_v}}" onClose="closeSp" onCollectSp="onCollectSp" onShareSp="onShareSp" onJoinGame="onJoinGame" onJoinVip="onJoinVip" onUpdateUinfo="getUserCardInfo" cardType={{cardType}} israre={{israre}} btntype={{btntype}} spimg={{spimg}} nearchashare={{nearchashare}} nearchaprize={{nearchaprize}} ></sp-modal>
<gift-modal a:if="{{gift_v}}" onClose="closeGift" onOpenGift="onOpenGift"></gift-modal>
<choose-modal a:if="{{choose_v}}" onClose="closeChoose" onPickShoes="pickShoesComp" selshoesidx="{{nselid}}"></choose-modal>
\ No newline at end of file
'use strict';
import {
Main
} from '../pagecanvas/output';
const app = getApp();
const { tbcc } = app;
import { SHARE_CONFIG } from '/tbcc-sdk/lib/constants';
......@@ -23,6 +26,7 @@ Page({
gift_v: false,//gift
choose_v: false,//choose
showdia: false,//有无弹窗层
canscroll:false,//可否滑动
//活动基本信息
rule: "",
......@@ -33,10 +37,14 @@ Page({
source2: "",
shoesList: [],
selectShoesList: [
"","","","",""
"", "", "", "", ""
],//选择得鞋子得数量
//兑换新品动画
whitept_v: false,//白底动画
ptimg_v: false,//拼图整图
ptimg_ani: false,//拼图动画
//用户信息
selected: 0,//0还未获得信息,1用户未选鞋,2用户已选鞋
selected: 2,//0还未获得信息,1用户未选鞋,2用户已选鞋
sharepropos: -100 + 'rpx 0rpx',//召唤进度maskpos
nearchashare: 0,//再召唤xx好友数量
nearchaprize: "",//再召唤xx好友得奖励x
......@@ -48,10 +56,10 @@ Page({
avatar: "//yun.duiba.com.cn/spark/assets/28092c7c919a2c8ea9b750fb79abd2416ba8f90f.png",
shoesName: "",
cardCountList: {},
collectedCount: 0,//已收集数量
collectedCount: 8,//已收集数量
shoesType: 0,
inviteResult: {},//
drawTimes: 0,//剩余抽卡次数
drawTimes: 1,//剩余抽卡次数
canTakeRankPrize: false,//是否可以领取锦鲤大奖
inviteAwardList: [],//邀请奖励阶梯领奖
inviteCount: 0,//已邀请总数
......@@ -98,6 +106,103 @@ Page({
app.avatar = "//yun.duiba.com.cn/spark/assets/头像test.30f8cbe95c93400e90281b524e1ab7685b7ccb16.png";
this.login();
},
onReady() {
let main = this.spark_startEngine(); //main.addEventListener....
},
spark_startEngine() {
var self = this;
console.log("taobao===>my.createCanvas");
my.createCanvas({
id: 'canvas',
success: ccc => {
console.log("createcanvas======>成功");
const dpr = my.getSystemInfoSync().pixelRatio;
const windowWidth = my.getSystemInfoSync().windowWidth;
const windowHeight = my.getSystemInfoSync().windowHeight;
ccc.width = windowWidth * dpr + dpr; //重新修改会有误差
ccc.height = windowHeight * dpr + dpr;
if (!this.main) {
this.main = new Main(ccc); //添加事件,为了和main里的通信
app.canvasMain = this.main;
this.main.addGlobalEvent("onMessage", self.onMessage, self);
}
},
fail: err => {
console.log("createcanvas=====》失败");
},
});
},
onCanvasReady() {
this.spark_startEngine();
},
postMessage(netName, data) {
this.main.dispatchGlobalEvent({
type: netName
}, data); //以防复用事件event串了,就用这种方式
},
//和main通信的方法,接收main的信息
onMessage(e) {
// console.log("message========",e);
//接口名字
let netName = e.data.netName; //接口参数
let parameter = e.data.parameter; //暂时发现3个需要用户操作的接口
//定制的授权
if (netName == "cardani_over") {
console.log("canvas动画播放完毕=======》");
}
// if (netName.indexOf("mine") == 0) {
// var data = {
// success: true
// };
// switch (netName) {
// case "mine.getAppData":
// //获取信息
// let tmpApp = getApp();
// console.log('app信息', tmpApp);
// data = {
// success: true,
// data: {
// activityId: tmpApp.activityId,
// //|| "5e7c40e98564b57d7fb95812",
// nickName: tmpApp.nickName,
// avatar: tmpApp.avatar,
// openId: tmpApp.openId,
// isFocusShop: tmpApp.isFollow || false
// }
// };
// break;
// case "cardani_over":
// console.log("canvas动画播放完毕=======》");
// break;
// case 'test':
// console.log('测试一下', parameter.hint);
// break;
// }
// this.postMessage(netName, data);
// } else {
// var app = getApp(); //获取后端接口
// const {
// function: fc
// } = app.cloud;
// const [myCloudName, handler] = netName.split("."); //待写,
// fc.invoke(myCloudName, parameter, handler).then(res => {
// this.postMessage(netName, res);
// });
// }
},
//鼠标事件
onMouseEvent(e) {
if (this.main) this.main.stage.onMouseEvent(e);
},
onShow() {
console.log("onshow=========>");
// 页面显示
......@@ -106,6 +211,12 @@ Page({
console.log("onhide==========>");
// 页面隐藏
},
/**
* startAni
*/
onStartAni() {
this.postMessage("playcardani", null);
},
/**
* 获取用户授权信息
*/
......@@ -206,7 +317,7 @@ Page({
}
}
//selected==1
if(this.data.selected==1){
if (this.data.selected == 1) {
this.getPickShoesList();
}
},
......@@ -370,11 +481,11 @@ Page({
if (success) {
let { list } = data;
let liststr = new Array();
for(let i=0;i<list.length;i++){
for (let i = 0; i < list.length; i++) {
let idata = list[i];
let ishoesType = idata.shoesType;
let icount = idata.count||1;
let istr = (icount*200)+"人已选";
let icount = idata.count || 1;
let istr = (icount * 200) + "人已选";
liststr.push(istr);
}
this.setData({
......@@ -385,8 +496,10 @@ Page({
//弹窗层
showDialog(_v) {
this.setData({
showdia: _v
showdia: _v,
canscroll:_v
});
// console.log("切换滑动=====>",this.data.canscroll);
},
//规则弹窗
openRule() {
......@@ -528,9 +641,17 @@ Page({
this.openInfo();
return;
}
let docardata = await API.doCardDraw().catch(res => {
commonToast(res && res.message);
}) || {};
// let docardata = await API.doCardDraw().catch(res => {
// commonToast(res && res.message);
// }) || {};
let docardata = {
"success": true,
"message": "",
"data": {
"cardType": 1,
"uncommon": true
}
}
const { success, data } = docardata;
console.log("抽卡结果", docardata);
if (success) {
......@@ -543,7 +664,11 @@ Page({
spimg: spimg,
btntype: btntype
});
this.openSp();
this.showDialog(true);
this.onStartAni();
setTimeout(() => {
this.openSp();
}, 500);
}
},
/**
......@@ -574,12 +699,20 @@ Page({
//收集完碎片,兑奖
async getSprize() {
console.log("收集碎片完毕,去兑奖");
let collectPrize = await API.takeCollectedPrize().catch(res => {
commonToast(res && res.message);
}) || {};
// let collectPrize = await API.takeCollectedPrize().catch(res => {
// commonToast(res && res.message);
// }) || {};
let collectPrize = {
success: true,
data: {
"name": "山海",
"type": 3,
"image": "//yun.duiba.com.cn/spark/assets/原图二次元.a0ae5554ff69d2bd72fe3ad759da2fe6c914f280.jpg"
}
}
console.log("兑换结果", collectPrize);
const { success, data } = collectPrize;
this.showPrizePage(success, data);
this.showPrizePage(success, data, "duihuan");
},
/**
......@@ -598,7 +731,7 @@ Page({
* @param {*} success
* @param {*} data
*/
showPrizePage(success, data) {
showPrizePage(success, data, type = "prize") {
if (success) {
//中奖了
let { name, type, image } = data;
......@@ -615,7 +748,18 @@ Page({
})
this.openInfo();
} else {
this.openAttion();
if (type == "prize") {
this.openAttion();
} else {//动效
this.setData({
whitept_v: true,
ptimg_v: true,
ptimg_ani: true
});
setTimeout(() => {
this.openAttion();
}, 800);
}
}
} else {//失败进谢谢参与
this.setData({
......@@ -629,7 +773,12 @@ Page({
//邀请好友
shareAct() {
console.log("邀请好友");
my.showSharePanel();
this.setData({
whitept_v: false,
ptimg_v: false,
ptimg_ani: false
});
// my.showSharePanel();
},
//邀请奖励
async getSarePrize(e) {
......
......@@ -622,6 +622,18 @@ const resList = {
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/碎片框普通.dcef25f95e0b0aa6470a162d13ef5b98b5e8be49.png',
uuid: '2a016267-8fd5-4524-8f7b-e3bdfa541fe1'
},
'56d322ae-bfcb-4d03-b5bc-81603cb2fe5b': {
name: '白底',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/白底.2c4713c15f032fcae533b246f98db6f20e0240ef.png',
uuid: '56d322ae-bfcb-4d03-b5bc-81603cb2fe5b'
},
'1e4870aa-4859-4541-a3b8-adc29113a946': {
name: '白色',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/白色.08a8b4bea2ef5778966eba1b96a40a207041c1f2.png',
uuid: '1e4870aa-4859-4541-a3b8-adc29113a946'
}
};
export default resList;
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