Commit 90e3e76f authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

parent f97a1da8
{
"current": 0,
"modes": [
{
"title": "分享进",
"page": "pages/pageshou_ye/pageshou_ye",
"pageQuery": "openId=AAGK5ZCBAMaFIi626fKFCdXP&shoestype=3",
"update": true
}
]
}
\ No newline at end of file
......@@ -101,6 +101,11 @@ const apiList = {
handle: 'getPickShoesList',
method:'post',
isShowLoading: false
},
notification:{
handle: 'notification',
method:'post',
isShowLoading: false
}
};
......
......@@ -2,13 +2,12 @@ import cloud from '@tbmp/mp-cloud-sdk';
import tbcc from './tbcc-sdk';
cloud.init({
env: 'online' // 云函数环境 test 测试环境 online 线上环境
env: 'test' // 云函数环境 test 测试环境 online 线上环境
});
App({
requestType: 'cloud', // yapi,cloud: 云函数
requestType: 'local', // yapi,cloud: 云函数
cloudName: 'tmallCat', // 主云函数项目名 tmallCat
cloudName: 'xtepCard2c', // 主云函数项目名 tmallCat
// cloudName: 'bubbleSurviva', // 主云函数项目名 tmallCat
cloud,
tbcc,
......@@ -25,7 +24,7 @@ App({
*/
handleQuery(query) {
const { activityId } = query;
this.activityId = activityId || '5f34e1c4964f9706aa7d803c';
this.activityId = activityId || '5f85118f738989848eb9ab4b';
}
});
......@@ -27,15 +27,24 @@ Component({
},
lower(e) {
let getpage = this.data.getpage;
console.log("lower=========>", e,getpage);
if(!getpage){
this.getRankData();
console.log("lower=========>", e, getpage);
if (!getpage) {
// this.getRankData();
}
},
scroll(e) {
// let scrollTop = e.detail.scrollTop;
// console.log("scroll=========>", scrollTop);
},
changenameShow(name) {
let firststr = name.slice(0, 1);
let endstr = name.slice(-1);
let contstr = "";
for (let i = 0; i < name.length - 2; i++) {
contstr += "*";
}
return firststr + contstr + endstr;
},
async getRankData() {
let topN = 200;
let setpagesize = 20;
......@@ -59,17 +68,22 @@ Component({
console.log("rankdata=====>", rankdata);
const { success, data } = rankdata;
if (success) {
const { myData, list } = data;
const { myRank, list } = data;
let getpage = false;
if (list.length < pagesize) {
getpage = true;
}
myRank.userNick = this.changenameShow(myRank.userNick);
if(!myRank.count)myRank.count=0;
for(let i=0;i<list.length;i++){
let idata = list[i];
idata.userNick = this.changenameShow(idata.userNick);
}
let nrankdata = this.data.rankdata;
nrankdata.push(...list);
this.setData({
rankdata: nrankdata,
myData: myData,
myData: myRank,
getpage: getpage,
pageidx: pageno + 1
});
......@@ -84,7 +98,4 @@ Component({
});
this.getRankData();
},
});
\ No newline at end of file
......@@ -32,6 +32,34 @@
transform-origin: 0rpx 0rpx 0rpx;
text-align: center;
}
.sui_pian_dan_chuang .sui_piantit1 {
width: 750rpx;
height: 40rpx;
opacity: 1;
display: block;
left: 0rpx;
top: 80rpx;
position: absolute;
font-size: 36rpx;
letter-spacing: 1rpx;
color: #ffffff;
transform-origin: 0rpx 0rpx 0rpx;
text-align: center;
}
.sui_pian_dan_chuang .sui_pian_futit1 {
width: 750rpx;
height: 40rpx;
opacity: 1;
display: block;
left: 0rpx;
top: 130rpx;
position: absolute;
font-size: 36rpx;
letter-spacing: 1rpx;
color: #ffffff;
transform-origin: 0rpx 0rpx 0rpx;
text-align: center;
}
.sui_pian_dan_chuang .image {
width: 508rpx;
height: 335rpx;
......
<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>
<label class="{{btntype!=5?'sui_piantit':'sui_piantit1'}}">{{tit}}</label>
<label class="{{btntype!=5?'sui_pian_futit':'sui_pian_futit1'}}">{{subtit}}</label>
<image class="image" src={{spimg}} />
<image class="prizekuang1" a:if="{{israre==1}}" src={{resList['2a016267-8fd5-4524-8f7b-e3bdfa541fe1'].url}} />
<image class="prizekuang2" a:if="{{israre==2}}" src={{resList['a6f59e24-ff10-4aab-b9c2-3dacf6c91399'].url}} />
......
......@@ -40,21 +40,23 @@ Component({
},
//老用户,关闭,新用户加入会员
checkJoinVip(){
const {isvip} = this.props;
if(isvip){
this.onClose();
}else{
this.onJoinVip();
}
const {onCheckJoinVip} = this.props;
onCheckJoinVip&&onCheckJoinVip();
// const {isvip} = this.props;
// if(isvip){
// this.onClose();
// }else{
// this.onJoinVip();
// }
}
},
didMount() {
let { cardType, israre, btntype, spimg ,nearchashare,nearchaprize} = this.props;
let { cardType, shoesName,israre, btntype, spimg ,nearchashare,nearchaprize} = this.props;
let tit = "你获得了xx碎片";
let subtit = "";
if (btntype == 1) {
tit = "你获得了" + cardType + "碎片";
tit = "你获得了" + shoesName + "碎片";
if(nearchashare&&nearchaprize.length>0&&nearchashare<=3){
subtit = "再召唤"+nearchashare+"位好友就能获得"+nearchaprize;
}
......@@ -64,10 +66,15 @@ Component({
tit = "你的好友邀请你一起集碎片\n赢特步全年12双新款鞋";
} else if (btntype == 4) {
tit = "集碎片赢特步新品同款鞋\n你的好友送了你一个卡包";
} else {
} else if(btntype==5){
tit = "你的好友邀请你为TA助力";
subtit = "赢特步全年12双新鞋随心穿福利";
}else{
console.error("未定义类型23333========》");
}
if(btntype!=4){
if(btntype==1||btntype==2){
this.onUpdateUinfo();
}
this.setData({
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"exclude": [
"server/**"
]
}
{
"success": true,
"message":"网络异常",
"data": {
"showTakeSurprisePrize": true,
"inviteResult":{
"inviteCount":5,
"addDrawTimes":7
}
}
}
\ No newline at end of file
<view class="style1" scroll-y="{{true}}" scroll-top="{{scrolltop}}" disable-scroll="{{canscroll}}">
<scroll-view class="shou_ye">
<scroll-view class="style1" scroll-y={{true}} scroll-top={{100}} disable-scroll={{canscroll}}>
<view class="shou_ye">
<image class="bg" src={{resList['05608aab-d250-45fe-9cd0-6c55b3a7b821'].url}} />
<view class="homescroll" />
<view class="topnode">
......@@ -19,65 +19,65 @@
<view class="pintudiv" a:if="{{selected==2}}">
<image class="pin_tu_di" src={{resList['85f45c26-b7df-4dbc-ae37-5e9325c35677'].url}} />
<image class="pin_tu_di_kuang" src={{resList['2a1adc3a-b4db-47db-bf6e-6f1000e64a83'].url}} />
<view class="pic1{{selected==2&&cardCountList[1]==0?' blackWhiteFilter':''}}">
<view class="pic1{{selected==2&&!cardCountList[1]||cardCountList[1]==0?' blackWhiteFilter':''}}">
<image class="picimg1" src={{resList[selshoesname+1].url}} />
<view class="picredot1" a:if="{{selected==2&&cardCountList[1]}}">
<view class="picredot1" a:if="{{selected==2&&cardCountList[1]&&cardCountList[1]>1}}">
<image class="picredotimg1" src={{resList['9b49cfcd-9ce8-4fe2-bfc0-17532b0ff35b'].url}} />
<label class="picredotnum1">{{cardCountList[1]}}</label>
</view>
</view>
<view class="pic2{{selected==2&&cardCountList[2]==0?' blackWhiteFilter':''}}">
<view class="pic2{{selected==2&&!cardCountList[2]||cardCountList[2]==0?' blackWhiteFilter':''}}">
<image class="picimg2" src={{resList[selshoesname+2].url}} />
<view class="picredot2" a:if="{{selected==2&&cardCountList[2]}}">
<view class="picredot2" a:if="{{selected==2&&cardCountList[2]&&cardCountList[2]>1}}">
<image class="picredotimg2" src={{resList['9b49cfcd-9ce8-4fe2-bfc0-17532b0ff35b'].url}} />
<label class="picredotnum2">{{cardCountList[2]}}</label>
</view>
</view>
<view class="pic3{{selected==2&&cardCountList[3]==0?' blackWhiteFilter':''}}">
<view class="pic3{{selected==2&&!cardCountList[3]||cardCountList[3]==0?' blackWhiteFilter':''}}">
<image class="picimg3" src={{resList[selshoesname+3].url}} />
<view class="picredot3" a:if="{{selected==2&&cardCountList[3]}}">
<view class="picredot3" a:if="{{selected==2&&cardCountList[3]&&cardCountList[3]>1}}">
<image class="picredotimg3" src={{resList['9b49cfcd-9ce8-4fe2-bfc0-17532b0ff35b'].url}} />
<label class="picredotnum3">{{cardCountList[3]}}</label>
</view>
</view>
<view class="pic4{{selected==2&&cardCountList[4]==0?' blackWhiteFilter':''}}">
<view class="pic4{{selected==2&&!cardCountList[4]||cardCountList[4]==0?' blackWhiteFilter':''}}">
<image class="picimg4" src={{resList[selshoesname+4].url}} />
<view class="picredot4" a:if="{{selected==2&&cardCountList[4]}}">
<view class="picredot4" a:if="{{selected==2&&cardCountList[4]&&cardCountList[4]>1}}">
<image class="picredotimg4" src={{resList['9b49cfcd-9ce8-4fe2-bfc0-17532b0ff35b'].url}} />
<label class="picredotnum4">{{cardCountList[4]}}</label>
</view>
</view>
<view class="pic5{{selected==2&&cardCountList[5]==0?' blackWhiteFilter':''}}">
<view class="pic5{{selected==2&&!cardCountList[5]||cardCountList[5]==0?' blackWhiteFilter':''}}">
<image class="picimg5" src={{resList[selshoesname+5].url}} />
<view class="picredot5" a:if="{{selected==2&&cardCountList[5]}}">
<view class="picredot5" a:if="{{selected==2&&cardCountList[5]&&cardCountList[5]>1}}">
<image class="picredotimg5" src={{resList['9b49cfcd-9ce8-4fe2-bfc0-17532b0ff35b'].url}} />
<label class="picredotnum5">{{cardCountList[5]}}</label>
</view>
</view>
<view class="pic6{{selected==2&&cardCountList[6]==0?' blackWhiteFilter':''}}">
<view class="pic6{{selected==2&&!cardCountList[6]||cardCountList[6]==0?' blackWhiteFilter':''}}">
<image class="picimg6" src={{resList[selshoesname+6].url}} />
<view class="picredot6" a:if="{{selected==2&&cardCountList[6]}}">
<view class="picredot6" a:if="{{selected==2&&cardCountList[6]&&cardCountList[6]>1}}">
<image class="picredotimg6" src={{resList['9b49cfcd-9ce8-4fe2-bfc0-17532b0ff35b'].url}} />
<label class="picredotnum6">{{cardCountList[6]}}</label>
</view>
</view>
<view class="pic7{{selected==2&&cardCountList[7]==0?' blackWhiteFilter':''}}">
<view class="pic7{{selected==2&&!cardCountList[7]||cardCountList[7]==0?' blackWhiteFilter':''}}">
<image class="picimg7" src={{resList[selshoesname+7].url}} />
<view class="picredot7" a:if="{{selected==2&&cardCountList[7]}}">
<view class="picredot7" a:if="{{selected==2&&cardCountList[7]&&cardCountList[7]>0}}">
<image class="picredotimg7" src={{resList['9b49cfcd-9ce8-4fe2-bfc0-17532b0ff35b'].url}} />
<label class="picredotnum7">{{cardCountList[7]}}</label>
</view>
</view>
<view class="pic8{{selected==2&&cardCountList[8]==0?' blackWhiteFilter':''}}">
<view class="pic8{{selected==2&&!cardCountList[8]||cardCountList[8]==0?' blackWhiteFilter':''}}">
<image class="picimg8" src={{resList[selshoesname+8].url}} />
<view class="picredot8" a:if="{{selected==2&&cardCountList[8]}}">
<view class="picredot8" a:if="{{selected==2&&cardCountList[8]&&cardCountList[8]>1}}">
<image class="picredotimg8" src={{resList['9b49cfcd-9ce8-4fe2-bfc0-17532b0ff35b'].url}} />
<label class="picredotnum8">{{cardCountList[8]}}</label>
</view>
</view>
<view class="pic9{{selected==2&&cardCountList[9]==0?' blackWhiteFilter':''}}">
<view class="pic9{{selected==2&&!cardCountList[9]||cardCountList[9]==0?' blackWhiteFilter':''}}">
<image class="picimg9" src={{resList[selshoesname+9].url}} />
<view class="picredot9" a:if="{{selected==2&&cardCountList[9]}}">
<view class="picredot9" a:if="{{selected==2&&cardCountList[9]&&cardCountList[9]>1}}">
<image class="picredotimg9" src={{resList['9b49cfcd-9ce8-4fe2-bfc0-17532b0ff35b'].url}} />
<label class="picredotnum9">{{cardCountList[9]}}</label>
</view>
......@@ -91,7 +91,6 @@
<image class="finaptdi" src={{resList['56d322ae-bfcb-4d03-b5bc-81603cb2fe5b'].url}} />
<image class="finaptimg" src={{ptimgbig}} />
</view>
</view>
<view class="botnode">
<view class="selshoes" a:if="{{selected==1}}">
......@@ -161,49 +160,49 @@
</view>
<view class="zhao_huan_jiang_li">
<image class="zhao_huan_jiang_liimg" src={{resList['c591e5b6-4085-4c04-bac9-b8dd970c9718'].url}} />
<view class="prizel1{{inviteAwardList[0].status==1?' blackWhiteFilter':''}}{{inviteAwardList[0].status==2?' btnclickStyle':''}}" onTap="getSarePrize" data-pidx=0>
<view class="prizel1{{inviteAwardList[0].status==1?' blackWhiteFilter':''}}{{inviteAwardList[0].status==2?' btnclickStyle':''}}" onTap="getSarePrize" data-pidx=1>
<image class="sprize1" src={{resList['0e0a7587-08f3-4ffb-a4bf-4565c1992c30'].url}} />
<image class="wei_jie_suo1" a:if="{{inviteAwardList[0].status==1}}" src={{resList['e3e0ee1d-d967-4e71-9a65-7f993c0c64e9'].url}} />
<image class="yi_ling_qu1" a:if="{{inviteAwardList[0].status==3}}" src={{resList['7900e00b-1490-4a6c-848d-0508174c15fc'].url}} />
<image class="dai_ling_qu1" a:if="{{inviteAwardList[0].status==2}}" src={{resList['137464f5-e3af-4bcf-9e5a-f329d03ebfcc'].url}} />
<image class="prizenums1" a:if="{{inviteAwardList[0].type==1}}" src={{resList['262b288e-57dd-4607-978a-b3da8a6d6d1a'].url}} />
<label class="prizename1">{{inviteAwardList[0].type==3?"解锁未拥有碎片":inviteAwardList[0].type==2?"随机稀有碎片":"抽碎片次数"}}</label>
<label class="prizenumstxt1" a:if="{{inviteAwardList[0].type==1}}">{{inviteAwardList[0].rewards}}次</label>
<label class="prizenumstxt1" a:if="{{inviteAwardList[0].type==1}}">{{inviteAwardList[0].rewards+""}}次</label>
</view>
<view class="prizel2{{inviteAwardList[1].status==1?' blackWhiteFilter':''}}{{inviteAwardList[1].status==2?' btnclickStyle':''}}" onTap="getSarePrize" data-pidx=1>
<view class="prizel2{{inviteAwardList[1].status==1?' blackWhiteFilter':''}}{{inviteAwardList[1].status==2?' btnclickStyle':''}}" onTap="getSarePrize" data-pidx=2>
<image class="sprize2" src={{resList['6aeff20e-a8da-40ae-843a-2bc652221c80'].url}} />
<image class="wei_jie_suo2" a:if="{{inviteAwardList[1].status==1}}" src={{resList['e3e0ee1d-d967-4e71-9a65-7f993c0c64e9'].url}} />
<image class="yi_ling_qu2" a:if="{{inviteAwardList[1].status==3}}" src={{resList['7900e00b-1490-4a6c-848d-0508174c15fc'].url}} />
<image class="dai_ling_qu2" a:if="{{inviteAwardList[1].status==2}}" src={{resList['137464f5-e3af-4bcf-9e5a-f329d03ebfcc'].url}} />
<image class="prizenums2" a:if="{{inviteAwardList[1].type==1}}" src={{resList['262b288e-57dd-4607-978a-b3da8a6d6d1a'].url}} />
<label class="prizename2">{{inviteAwardList[1].type==3?"解锁未拥有碎片":inviteAwardList[1].type==2?"随机稀有碎片":"抽碎片次数"}}</label>
<label class="prizenumstxt2" a:if="{{inviteAwardList[1].type==1}}">{{inviteAwardList[1].rewards}}次</label>
<label class="prizenumstxt2" a:if="{{inviteAwardList[1].type==1}}">{{inviteAwardList[1].rewards+""}}次</label>
</view>
<view class="prizel3{{inviteAwardList[2].status==1?' blackWhiteFilter':''}}{{inviteAwardList[2].status==2?' btnclickStyle':''}}" onTap="getSarePrize" data-pidx=2>
<view class="prizel3{{inviteAwardList[2].status==1?' blackWhiteFilter':''}}{{inviteAwardList[2].status==2?' btnclickStyle':''}}" onTap="getSarePrize" data-pidx=3>
<image class="sprize3" src={{resList['6aeff20e-a8da-40ae-843a-2bc652221c80'].url}} />
<image class="wei_jie_suo3" a:if="{{inviteAwardList[2].status==1}}" src={{resList['e3e0ee1d-d967-4e71-9a65-7f993c0c64e9'].url}} />
<image class="yi_ling_qu3" a:if="{{inviteAwardList[2].status==3}}" src={{resList['7900e00b-1490-4a6c-848d-0508174c15fc'].url}} />
<image class="dai_ling_qu3" a:if="{{inviteAwardList[2].status==2}}" src={{resList['137464f5-e3af-4bcf-9e5a-f329d03ebfcc'].url}} />
<image class="prizenums3" a:if="{{inviteAwardList[2].type==1}}" src={{resList['262b288e-57dd-4607-978a-b3da8a6d6d1a'].url}} />
<label class="prizename3">{{inviteAwardList[2].type==3?"解锁未拥有碎片":inviteAwardList[2].type==2?"随机稀有碎片":"抽碎片次数"}}</label>
<label class="prizenumstxt3" a:if="{{inviteAwardList[2].type==1}}">{{inviteAwardList[2].rewards}}次</label>
<label class="prizenumstxt3" a:if="{{inviteAwardList[2].type==1}}">{{inviteAwardList[2].rewards+""}}次</label>
</view>
<view class="prizel4{{inviteAwardList[3].status==1?' blackWhiteFilter':''}}{{inviteAwardList[3].status==2?' btnclickStyle':''}}" onTap="getSarePrize" data-pidx=3>
<view class="prizel4{{inviteAwardList[3].status==1?' blackWhiteFilter':''}}{{inviteAwardList[3].status==2?' btnclickStyle':''}}" onTap="getSarePrize" data-pidx=4>
<image class="sprize4" src={{resList['e59cd832-5a10-4d15-bfc6-875d702e2726'].url}} />
<image class="wei_jie_suo4" a:if="{{inviteAwardList[3].status==1}}" src={{resList['e3e0ee1d-d967-4e71-9a65-7f993c0c64e9'].url}} />
<image class="yi_ling_qu4" a:if="{{inviteAwardList[3].status==3}}" src={{resList['7900e00b-1490-4a6c-848d-0508174c15fc'].url}} />
<image class="dai_ling_qu4" a:if="{{inviteAwardList[3].status==2}}" src={{resList['137464f5-e3af-4bcf-9e5a-f329d03ebfcc'].url}} />
<image class="prizenums4" a:if="{{inviteAwardList[3].type==1}}" src={{resList['262b288e-57dd-4607-978a-b3da8a6d6d1a'].url}} />
<label class="prizename4">{{inviteAwardList[3].type==3?"解锁未拥有碎片":inviteAwardList[3].type==2?"随机稀有碎片":"抽碎片次数"}}</label>
<label class="prizenumstxt4" a:if="{{inviteAwardList[3].type==1}}">{{inviteAwardList[3].rewards}}次</label>
<label class="prizenumstxt4" a:if="{{inviteAwardList[3].type==1}}">{{inviteAwardList[3].rewards+""}}次</label>
</view>
</view>
<image class="hui_yuan_zhuan_qu" onTap="registerVip" src={{resList['d1159e9d-900f-45cf-874f-f7efec6ad918'].url}} />
<image class="shuang_shi_yi_zhuan_qu" onTap="registerD11" src={{resList['e9a0ad73-6fe7-40bd-98cc-9a985bc413e7'].url}} />
</view>
</view>
</view>
</scroll-view>
</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">
......@@ -211,8 +210,8 @@
</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}}" attionfrom="{{attionfrom}}" ></attion-modal>
<attion-modal a:if="{{attion_v}}" onClose="closeAttion" onOpenJlGift="onOpenJlGift" prizeimg="{{prizeimg}}" prizename="{{prizename}}" prizetype="{{prizetype}}" btntype="{{prizebtntype}}" attionfrom="{{attionfrom}}"></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>
<sp-modal a:if="{{sp_v}}" onClose="closeSp" onCollectSp="onCollectSp" onShareSp="onShareSp" onJoinGame="onJoinGame" onJoinVip="onJoinVip" onCheckJoinVip="checkJoinVip" onUpdateUinfo="getUserCardInfo" cardType={{cardType}} shoesName={{shoesName}} israre={{israre}} btntype={{btntype}} spimg={{spimg}} nearchashare={{nearchashare}} nearchaprize={{nearchaprize}} ></sp-modal>
<gift-modal a:if="{{gift_v}}" onClose="closeGift" onOpenGift="getOpenNgift"></gift-modal>
<choose-modal a:if="{{choose_v}}" onClose="closeChoose" onPickShoes="pickShoesComp" selshoesidx="{{nselid}}"></choose-modal>
\ No newline at end of file
......@@ -13,11 +13,12 @@ const checkSystem = async () => {
const {
version
} = await getSystemInfo();
console.log('version', version);
// console.log('version', version);
return tbcc.utils.versionCompare(version, '9.8.0');
}
Page({
data: {
resList: resList,
rule_v: false,//规则
rank_v: false,//排行
attion_v: false,//attion
......@@ -39,7 +40,7 @@ Page({
selectShoesList: [
"", "", "", "", ""
],//选择得鞋子得数量
scrolltop:100,//默认滑动位置
scrolltop: 100,//默认滑动位置
//兑换新品动画
whitept_v: false,//白底动画
ptimg_v: false,//拼图整图
......@@ -93,19 +94,23 @@ Page({
//选鞋阶段,单选不可取消
nselid: 1,//默认选中1,,,,psd顺序,1-机甲,2-减震,3-二次元,4-山海,5--暂无,定山海
//弹窗序列
dialogsData:[
{
data:{
dialogsData: [
},
dianame:""
}
],
needattion: true,//是否
},
onLoad(query) {
if (query) {
if (query.openId) {
app.inviteId = query.openId;
}
if (query.shoestype) {
app.shoestype = query.shoestype;
}
}
this.setData({
scrolltop:150
scrolltop: 150
});
checkSystem().then(r => {
if (!r) {
......@@ -116,55 +121,100 @@ Page({
}
})
this.setData({
resList: resList
});
this.getAuth();
this.setData({
nickname: "张三",
avatar: "//yun.duiba.com.cn/spark/assets/28092c7c919a2c8ea9b750fb79abd2416ba8f90f.png"
})
app.nickName = "张三";
app.avatar = "//yun.duiba.com.cn/spark/assets/头像test.30f8cbe95c93400e90281b524e1ab7685b7ccb16.png";
this.login();
// this.setData({
// nickname: "张三",
// avatar: "//yun.duiba.com.cn/spark/assets/28092c7c919a2c8ea9b750fb79abd2416ba8f90f.png"
// })
// app.nickName = "张三";
// app.avatar = "//yun.duiba.com.cn/spark/assets/头像test.30f8cbe95c93400e90281b524e1ab7685b7ccb16.png";
// this.login();
console.log("onload========>");
// console.log("onload========>");
//助力弹窗
if(query){
app.inviteId = query.openId;
let cardType = query.cardType;
let spimg = resList["shanhaibig"].url;
// if (query) {
// app.inviteId = query.openId;
// let cardType = query.cardType;
// let spimg = resList["shanhaibig"].url;
// this.setData({
// cardType: cardType,
// israre: 3,
// spimg: spimg,
// btntype: 5
// });
// this.openSp();
// }
},
//弹窗序列todo
/**
* 进来弹窗顺序
* 1.助力----zhuli
* 2.新手礼盒----xinshou
* 3.开惊喜礼盒----jinxi
* 4.新邀请多少人提醒----invite
* 5.自动开新手礼盒---xinshouprize
*/
openDialogSx() {
let dialogsData = this.data.dialogsData;
if (dialogsData.length > 0) {
let firstdianame = dialogsData[0].dianame;
console.log("序列弹窗===》",firstdianame,this.data.selected);
if(firstdianame!="zhuli"&&this.data.selected!=2){
this.setData({
cardType: cardType,
israre: 3,
spimg: spimg,
btntype: 5
needattion:true
});
this.openSp();
return;
}
},
//弹窗序列233
openDialogSx(){
let onedata = this.data.dialogsData.shift();
let onedata = dialogsData.shift();
let data = onedata.data;
let dianame = onedata.dianame;
console.log("弹窗序列=======》", dianame, data);
this.setData(data);
setTimeout(() => {
if (dianame == "zhuli") {
this.openSp();
} else if (dianame == "xinshou") {
this.openGift();
} else if (dianame == "jinxi") {
this.openInfo();
} else if (dianame == "invite") {
this.openInfo();
} else if (dianame == "xinshouprize") {
this.getOpenNgift();
}
this.setData({
dialogsData: dialogsData
});
}, 200);
//dianame切换弹窗
}
},
//第一个弹窗
checkOpenAttion() {
let needattion = this.data.needattion;
console.log("第一个弹窗===>", needattion);
if (needattion) {
this.setData({
needattion: false
});
this.openDialogSx();
}
},
firstShow(e) {
console.log("firstshow", Document);
// console.log("firstshow", Document);
},
onReady() {
let main = this.spark_startEngine(); //main.addEventListener....
},
spark_startEngine() {
var self = this;
console.log("taobao===>my.createCanvas");
// console.log("taobao===>my.createCanvas");
my.createCanvas({
id: 'canvas',
success: ccc => {
console.log("createcanvas======>成功");
// console.log("createcanvas======>成功");
const dpr = my.getSystemInfoSync().pixelRatio;
const windowWidth = my.getSystemInfoSync().windowWidth;
const windowHeight = my.getSystemInfoSync().windowHeight;
......@@ -202,19 +252,19 @@ Page({
let parameter = e.data.parameter; //暂时发现3个需要用户操作的接口
//定制的授权
if (netName == "cardani_over") {
console.log("canvas动画播放完毕=======》");
// console.log("canvas动画播放完毕=======》");
}
},
//鼠标事件
onMouseEvent(e) {
if (this.main) this.main.stage.onMouseEvent(e);
},
onShow() {
console.log("onshow=========>");
onShow(query) {
console.log("onshow=========>", query);
// 页面显示
},
onHide() {
console.log("onhide==========>");
// console.log("onhide==========>");
// 页面隐藏
},
/**
......@@ -231,10 +281,14 @@ Page({
console.log('未授权成功', err);
});
if (userInfo) {
console.log('userInfo', userInfo);
// console.log('userInfo', userInfo);
const { nickName, avatar } = userInfo;
app.nickName = nickName;
app.avatar = avatar;
this.setData({
nickname: nickName,
avatar: avatar
});
this.login();
}
},
......@@ -243,7 +297,7 @@ Page({
*/
async login() {
const { nickName, avatar } = app;
const { success, data } = await API.login({ userNick: nickName, avatar: avatar }).catch(res => {
const { success, data } = await API.login({ userNick: nickName, avatar: avatar, isFollow: false }).catch(res => {
commonToast(res && res.message);
}) || {};
......@@ -256,10 +310,12 @@ Page({
* 登录完毕,请求其余数据
*/
async init() {
console.log("获取基本信息");
// console.log("获取基本信息");
this.getactivityData();
console.log("from=====>init");
this.getUserCardInfo();
//获取vip信息
await this.checkIsVip();
},
/**
* 获取基本信息
......@@ -292,15 +348,47 @@ Page({
* 更新用户信息
*/
async getUserCardInfo() {
//进来提示助力
let lselected = this.data.selected;
if (lselected == 0 && app.inviteId && app.shoestype) {//进来,提示助力弹窗
let myid = app.openId;
let inid = app.inviteId;
if (myid == inid) {
return;
} else {
}
let invitename = ["jijia", "jianzhen", "erciyuan", "shanhai", "tiancheng"][Number(app.shoestype) - 1];
let spimg = resList[invitename + "big"].url;
this.addDialogsData({
cardType: 1,
israre: 3,
spimg: spimg,
btntype: 5
}, "zhuli");
}
const userinfo = await API.getUserCardInfo().catch(res => {
commonToast(res && res.message);
}) || {};
const { success, data } = userinfo;
if (success) {
console.log("我的信息", userinfo);
let { shoesName, cardCountList, collectedCount, canTakeRankPrize, shoesType, inviteResult, hasTakeCollectedPrize, hasTakeFirstPrize } = data;
let selected = 2;
let nselid = 1;
if ((!shoesName || shoesName.length == 0) && this.data.selected == 0) {//当前未选择鞋子
if (!collectedCount) {
collectedCount = 0;
for (let k in cardCountList) {
let kdata = Number(cardCountList[k]);
if (kdata > 0) {
collectedCount += 1;
}
}
}
if ((!shoesName || shoesName.length == 0 || !shoesType) && this.data.selected == 0) {//当前未选择鞋子
selected = 1;
shoesName = "jijia";
} else {//todo,实际的选鞋
......@@ -310,6 +398,10 @@ Page({
this.getDrawTimes();
this.getInviteAwardsList();
}
if (!shoesType) {
shoesType = 1;
}
let selshoesname = ["jijia", "jianzhen", "erciyuan", "shanhai", "tiancheng"][Number(shoesType) - 1];
let collectxt = [
{
name: "label",
......@@ -343,11 +435,12 @@ Page({
}
]
let ptimgbig = resList[shoesName+"big"].url;
let ptimgbig = resList[selshoesname + "big"].url;
this.setData({
selected: selected,
shoesName: shoesName,
ptimgbig:ptimgbig,
ptimgbig: ptimgbig,
cardCountList: cardCountList,
collectedCount: collectedCount,
collectxt: collectxt,
......@@ -355,34 +448,60 @@ Page({
shoesType: shoesType,
inviteResult: inviteResult,
isduihuan: hasTakeCollectedPrize,//是否已领集满奖励
opengift: hasTakeFirstPrize
opengift: hasTakeFirstPrize,
selshoesname: selshoesname
});
this.checkGiftType();
this.checkOpenNgift();
this.checkOpenInfo1();
// this.checkOpenInfo1();
} else {
if (this.data.selected == 0) {
let selshoesname = "jijia";
let ptimgbig = resList[selshoesname + "big"].url;
this.setData({
selected: 1
selected: 1,
ptimgbig: ptimgbig,
selshoesname: selshoesname
});
}
this.checkOpenAttion();
}
//selected==1
if (this.data.selected == 1) {
this.getPickShoesList();
}
},
/**
* 礼盒状态
*/
checkGiftType() {
let canTakeRankPrize = this.data.canTakeRankPrize;
let opengift = this.data.opengift;
let invitecount = this.data.inviteCount;
let giftype = 0;
if (canTakeRankPrize) {
giftype = 3;
} else if (!opengift) {
giftype = 1;
} else if (invitecount < 1) {
giftype = 2;
}
this.setData({
giftype: giftype
});
},
/**
* 进首页,弹出新邀请提示
*/
checkOpenInfo1(){
checkOpenInfo1() {
let inviteResult = this.data.inviteResult;
let inviteCount = inviteResult.inviteCount;
let addDrawTimes = inviteResult.addDrawTimes;
if(inviteCount>0){
let infotit = "召回了"+inviteCount+"位好友";
if(addDrawTimes>0){
infotit += "\n获得"+addDrawTimes+"次抽碎片机会";
if (inviteCount > 0) {
let infotit = "召回了" + inviteCount + "位好友";
if (addDrawTimes > 0) {
infotit += "\n获得" + addDrawTimes + "次抽碎片机会";
}
this.setData({
infobtntype: 1,
......@@ -399,7 +518,7 @@ Page({
const timedata = await API.getDrawTimes().catch(res => {
commonToast(res && res.message);
}) || {};
console.log("抽卡数据", timedata);
// console.log("抽卡数据", timedata);
const { success, data } = timedata;
if (success) {
const { drawTimes } = data;
......@@ -416,7 +535,7 @@ Page({
const shareaward = await API.getInviteAwardsList().catch(res => {
commonToast(res && res.message);
}) || {};
console.log("邀请奖励", shareaward);
// console.log("邀请奖励", shareaward);
const { success, data } = shareaward;
if (success) {
const { list, inviteCount } = data;
......@@ -442,7 +561,7 @@ Page({
if (nearchashare > 0) {
nearchatxt = "再召唤" + nearchashare + "好友必得" + nearchaprize;
}
console.log("sharepropos55555555===>", sharepropos, nearchatxt, nearchashare);
// console.log("sharepropos55555555===>", sharepropos, nearchatxt, nearchashare);
this.setData({
inviteAwardList: list,
inviteCount: inviteCount,
......@@ -450,7 +569,8 @@ Page({
nearchashare: nearchashare,
nearchaprize: nearchaprize,
nearchatxt: nearchatxt,
})
});
this.checkGiftType();
}
},
/**
......@@ -461,12 +581,14 @@ Page({
let opengift = this.data.opengift;
let selected = this.data.selected;
if (!opengift && selected == 2) {//新人
this.openGift();
// this.openGift();
this.addDialogsData({}, "xinshou");
} else {
// this.setData({
// opengift: true
// });
}
this.notification();
},
/**
* 打开礼盒
......@@ -497,9 +619,9 @@ Page({
* 领取新人奖励
*/
async getOpenNgift() {
console.log("领取新人礼===========》?");
// console.log("领取新人礼===========》?");
//领取新人礼
await this.checkIsVip();
if (this.data.isVip) {
} else {
......@@ -517,7 +639,7 @@ Page({
if (success) {
let { cardType } = data;
let cardname = this.data.shoesName;
let spimg = resList[cardname + "" + cardType].url;
let spimg = resList[this.data.selshoesname + "" + cardType].url;
let uncommon = false;
let btntype = uncommon ? 2 : 1;
this.setData({
......@@ -535,7 +657,9 @@ Page({
* 进来新老会员区分
*/
async checkIsVip() {
const uvipinfo = await API.getVipInfo().catch(res => {
const uvipinfo = await API.getVipInfo({
inviteId: app.inviteId
}).catch(res => {
commonToast(res && res.message);
}) || {};
const { success, data } = uvipinfo;
......@@ -547,6 +671,21 @@ Page({
});
}
},
//点击助力
checkJoinVip() {
let isvip = this.data.isVip;
// console.log("点击助力",isvip);
if (isvip) {
this.closeSp();
this.doHelp();
} else {
commonToast('1秒成为会员,即可为TA助力哦', 2000);
let vipLink = this.data.vipLink;
setTimeout(() => {
navigateToOutside(vipLink)
}, 1000)
}
},
/**
* 助力
*/
......@@ -596,6 +735,9 @@ Page({
showdia: _v,
canscroll: _v
});
if (_v == false) {
this.openDialogSx();
}
// console.log("切换滑动=====>",this.data.canscroll);
},
//规则弹窗
......@@ -691,16 +833,17 @@ Page({
},
//选鞋完毕
pickShoesComp() {
console.log("选鞋成功3444=======》");
// console.log("选鞋成功3444=======》");
this.closeChoose();
this.setData({
selected: 2
});
console.log("from=====>pickShoesComp");
this.getUserCardInfo();
},
//prize
openPrize() {
console.log("跳转奖品===todo");
// console.log("跳转奖品===todo");
my.navigateTo({
url: '/pages/myprize/myprize'
});
......@@ -729,7 +872,7 @@ Page({
return false;
}
console.log("点击集碎片");
// console.log("点击集碎片");
let drawTimes = this.data.drawTimes;
if (drawTimes < 1) {//无次数
let infotit = "今日免费次数已用完";
......@@ -758,12 +901,13 @@ Page({
// }
// }
const { success, data } = docardata;
console.log("抽卡结果", docardata);
// console.log("抽卡结果", docardata);
if (success) {
const { cardType, uncommon } = data;
let cardname = this.data.shoesName;
console.log(cardname, cardType);
let spimg = resList[cardname + "" + cardType].url;
// console.log(cardname, cardType);
let spimg = resList[this.data.selshoesname + "" + cardType].url;
let btntype = uncommon ? 2 : 1;
this.setData({
cardType: cardType,
......@@ -794,33 +938,33 @@ Page({
* 分享碎片
*/
onShareSp() {
console.log("分享碎片");
// console.log("分享碎片");
this.shareAct();
},
/**
* 助力-会员直接加入游戏
*/
onJoinGame() {
console.log("会员直接加入");
// console.log("会员直接加入");
},
/**
* 助力-非会员引导加入会员
*/
onJoinVip() {
console.log("非会员直接跳转加入vip");
// console.log("非会员直接跳转加入vip");
},
//收集完碎片,兑奖
async getSprize() {
console.log("兑奖点击");
// console.log("兑奖点击");
let cancontinue = this.checkClickBtn();
if (!cancontinue) {
return false;
}
if (this.data.isduihuan) {
console.log("兑换过了");
// console.log("兑换过了");
return;
}
console.log("收集碎片完毕,去兑奖");
// console.log("收集碎片完毕,去兑奖");
// let collectPrize = await API.takeCollectedPrize().catch(res => {
// commonToast(res && res.message);
// }) || {};
......@@ -832,7 +976,7 @@ Page({
"image": "//yun.duiba.com.cn/spark/assets/原图二次元.a0ae5554ff69d2bd72fe3ad759da2fe6c914f280.jpg"
}
}
console.log("兑换结果", collectPrize);
// console.log("兑换结果", collectPrize);
const { success, data } = collectPrize;
this.showPrizePage(success, data, "duihuan");
......@@ -844,7 +988,7 @@ Page({
let glPrizeData = await API.takeRankPrize().catch(res => {
commonToast(res && res.message);
}) || {};
console.log("抽奖结果", glPrizeData);
// console.log("抽奖结果", glPrizeData);
const { success, data } = glPrizeData;
this.showPrizePage(success, data);
},
......@@ -900,7 +1044,7 @@ Page({
if (!cancontinue) {
return false;
}
console.log("邀请好友");
// console.log("邀请好友");
// this.setData({
// whitept_v: false,
// ptimg_v: false,
......@@ -910,12 +1054,14 @@ Page({
},
//邀请奖励
async getSarePrize(e) {
console.log("获取邀请好友奖励", e);
// console.log("获取邀请好友奖励", e);
let dataset = e.currentTarget.dataset;
if (dataset) {
let pidx = Number(dataset.pidx);
let pstatus = this.data.inviteAwardList[pidx].status;
let sharenums = this.data.inviteAwardList[pidx].times;
console.log("领取奖励=====》", pidx);
let pstatus = this.data.inviteAwardList[pidx - 1].status;
let sharenums = this.data.inviteAwardList[pidx - 1].times;
console.log("邀请好友奖励=====》", pidx, pstatus, sharenums);
if (pstatus == 2) {//点击领取
......@@ -923,7 +1069,7 @@ Page({
if (!cancontinue) {
return false;
}
console.log("发起请求=======》");
let invitePrize = await API.takeInvitePrize({
type: pidx
}).catch(res => {
......@@ -933,7 +1079,7 @@ Page({
if (success) {
let { cardType, uncommon, rewardType, addDrawTimes } = data;
if (cardType) {//给卡片
let cardname = this.data.shoesName;
let cardname = this.data.selshoesname;
let spimg = resList[cardname + "" + cardType].url;
let btntype = uncommon ? 2 : 1;
......@@ -953,6 +1099,7 @@ Page({
this.openInfo();
}
//领取完毕,更新领取状态
console.log("from=====>getSarePrize");
this.getUserCardInfo();
......@@ -962,13 +1109,13 @@ Page({
},
//会员专区
registerVip() {
console.log("会员专区");
// console.log("会员专区");
let url = this.data.source1;
navigateToOutside(url);
},
//双十一会场链接
registerD11() {
console.log("双十一专区");
// console.log("双十一专区");
let url = this.data.source2;
navigateToOutside(url);
},
......@@ -977,11 +1124,11 @@ Page({
path,
...rest
} = SHARE_CONFIG;
console.log('app.openId', app.openId, "shoesname", this.data.shoesName);
// console.log('app.openId', app.openId, "shoesname", this.data.shoesName);
if (app.openId) {
path = '/pages/pageshou_ye/pageshou_ye' + '?openId=' + app.openId + "&shoestype=" + this.data.shoesName;
path = '/pages/pageshou_ye/pageshou_ye' + '?openId=' + app.openId + "&shoestype=" + this.data.shoesType;
}
console.log('path', path)
// console.log('path', path)
return {
...rest,
......@@ -1002,5 +1149,57 @@ Page({
} else {
return true;
}
},
//消息通知接口
async notification() {
let infodata = await API.notification().catch(res => {
commonToast(res && res.message);
}) || {};
const { success, data } = infodata;
if (success) {
const { showTakeSurprisePrize, inviteResult } = data;
if (showTakeSurprisePrize) {
this.addDialogsData({
infobtntype: 1,
infotopshow: true,
infotit: "完成了惊喜礼盒\n获得3次抽取碎片机会"
}, "jinxi");
}
if (inviteResult && inviteResult.inviteCount > 0) {
let infotit = "召回了" + inviteResult.inviteCount + "位好友";
if (inviteResult.addDrawTimes > 0) {
infotit += "\n获得" + inviteResult.addDrawTimes + "次抽碎片机会";
}
this.addDialogsData({
infobtntype: 1,
infotopshow: true,
infotit: infotit
}, "invite");
}
}
this.checkOpenAttion();
},
//序列弹窗添数据
addDialogsData(data, dianame) {
let dialogsData = this.data.dialogsData;
let havedia = false;
for (let i = 0; i < dialogsData.length; i++) {
let idata = dialogsData[i];
let idianame = idata.dianame;
if (idianame == dianame) {
havedia = true;
break;
}
}
if (!havedia) {
dialogsData.push({
data: data,
dianame: dianame
});
this.setData({
dialogsData: dialogsData
});
}
}
});
\ 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