Commit ac49b1e2 authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

parent 70019c6d
...@@ -106,6 +106,11 @@ const apiList = { ...@@ -106,6 +106,11 @@ const apiList = {
handle: 'notification', handle: 'notification',
method:'post', method:'post',
isShowLoading: false isShowLoading: false
},
addStat:{
handle: 'addStat',
method:'post',
isShowLoading: false
} }
}; };
......
...@@ -6,6 +6,6 @@ ...@@ -6,6 +6,6 @@
<image class="prizeimg" src="{{prizeimg}}" style="top:{{prizetop}}" /> <image class="prizeimg" src="{{prizeimg}}" style="top:{{prizetop}}" />
<rich-text nodes="{{subtit}}" class="attiontxt1"></rich-text> <rich-text nodes="{{subtit}}" class="attiontxt1"></rich-text>
<image class="kai_xin_shou_xia btnclickStyle" a:if="{{btntype==1}}" src={{resList['8f03f3b2-3ac3-4f5a-8c86-1ca251174f3a'].url}} onTap="onClose" /> <image class="kai_xin_shou_xia btnclickStyle" a:if="{{btntype==1}}" src={{resList['8f03f3b2-3ac3-4f5a-8c86-1ca251174f3a'].url}} onTap="onJumpPrizePage" />
<image class="li_ji_chou_jiang btnclickStyle" a:if="{{btntype==2}}" src={{resList['07579ad9-d3d4-410a-a95f-0683d9bdda8c'].url}} onTap="onOpenJlGift" /> <image class="li_ji_chou_jiang btnclickStyle" a:if="{{btntype==2}}" src={{resList['07579ad9-d3d4-410a-a95f-0683d9bdda8c'].url}} onTap="onOpenJlGift" />
</view> </view>
\ No newline at end of file
'use strict'; 'use strict';
const app = getApp();
const { tbcc } = app;
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
import API from '/api';
const { commonToast, getAuthUserInfo, navigateToOutside, getSystemInfo, getServerTime } = tbcc.tb;
Component({ Component({
props: {}, props: {},
data: { data: {
resList: resList, resList: resList,
tit:"", tit: "",
subtit:[], subtit: [],
prizeimg: "", prizeimg: "",
prizename: "", prizename: "",
prizetype: "", prizetype: "",
btntype:1,//开心收下,2立即抽奖 btntype: 1,//开心收下,2立即抽奖
prizetop:"220rpx" prizetop: "220rpx"
}, },
methods: { methods: {
onClose() { onClose() {
const { onClose } = this.props; const { onClose } = this.props;
onClose && onClose(); onClose && onClose();
}, },
//领取奖励
async getPrize() {
const { prizetype, prizeid } = this.props;
if (prizetype && prizetype == 1 && prizeid) {
const { success, data, message } = await API.receiveEnamePrize({ id: prizeid }).catch(res => {
// commonToast(res && res.message)
}) || {};
if (success && data) {
// commonToast('领取成功')
}
}
},
//关闭弹窗,进入奖品页
onJumpPrizePage() {
this.onClose();
my.navigateTo({
url: '/pages/myprize/myprize'
});
},
//立即抽奖 //立即抽奖
onOpenJlGift() { onOpenJlGift() {
this.onClose(); this.onClose();
...@@ -26,49 +49,49 @@ Component({ ...@@ -26,49 +49,49 @@ Component({
} }
}, },
didMount() { didMount() {
let { prizeimg, prizename, prizetype,btntype,attionfrom } = this.props; let { prizeimg, prizename, prizetype, btntype, attionfrom } = this.props;
//tit=== 特步减震旋系列新品一双 //tit=== 特步减震旋系列新品一双
// subtit== 请至“我的奖品”处查看 // subtit== 请至“我的奖品”处查看
let tit = ""; let tit = "";
if(attionfrom=="gift"){ if (attionfrom == "gift") {
tit = "获得抽取年度人气锦鲤大奖的机会\n快去抽奖吧"; tit = "获得抽取年度人气锦鲤大奖的机会\n快去抽奖吧";
}else if(attionfrom=="prize"){ } else if (attionfrom == "prize") {
tit = "获得了"+prizename; tit = "获得了" + prizename;
} }
this.getPrize();
let subtit = []; let subtit = [];
let prizetop = "275rpx"; let prizetop = "275rpx";
if(btntype==1){ if (btntype == 1) {
prizetop = "220rpx"; prizetop = "220rpx";
subtit = [ subtit = [
{ {
name:"label", name: "label",
attrs:{ attrs: {
style:"color:#000000" style: "color:#000000"
}, },
children:[{ children: [{
type:"text", type: "text",
text:"请至“" text: "请至“"
}] }]
}, },
{ {
name:"label", name: "label",
attrs:{ attrs: {
style:"color:#cc3333" style: "color:#cc3333"
}, },
children:[{ children: [{
type:"text", type: "text",
text:"我的奖品" text: "我的奖品"
}] }]
}, },
{ {
name:"label", name: "label",
attrs:{ attrs: {
style:"color:#000000" style: "color:#000000"
}, },
children:[{ children: [{
type:"text", type: "text",
text:"”处查看奖品" text: "”处查看奖品"
}] }]
} }
] ]
...@@ -80,10 +103,10 @@ Component({ ...@@ -80,10 +103,10 @@ Component({
prizeimg: prizeimg, prizeimg: prizeimg,
prizename: prizename, prizename: prizename,
prizetype: prizetype, prizetype: prizetype,
tit:tit, tit: tit,
subtit:subtit, subtit: subtit,
btntype:btntype, btntype: btntype,
prizetop:prizetop, prizetop: prizetop,
}); });
} }
......
...@@ -213,7 +213,7 @@ ...@@ -213,7 +213,7 @@
<!-- <ani-modal a:if="{{showani}}"></ani-modal> --> <!-- <ani-modal a:if="{{showani}}"></ani-modal> -->
<rule-modal a:if="{{rule_v}}" onClose="closeRule" ruletxt={{rule}}></rule-modal> <rule-modal a:if="{{rule_v}}" onClose="closeRule" ruletxt={{rule}}></rule-modal>
<rank-modal a:if="{{rank_v}}" onClose="closeRank"></rank-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}}" prizeid="{{prizeid}}" btntype="{{prizebtntype}}" attionfrom="{{attionfrom}}"></attion-modal>
<info-modal a:if="{{info_v}}" onClose="closeInfo" onShareFriends="onShareSp" infobtntype="{{infobtntype}}" infotopshow="{{infotopshow}}" infotit="{{infotit}}"></info-modal> <info-modal a:if="{{info_v}}" onClose="closeInfo" onShareFriends="onShareSp" infobtntype="{{infobtntype}}" infotopshow="{{infotopshow}}" infotit="{{infotit}}"></info-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> <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> <gift-modal a:if="{{gift_v}}" onClose="closeGift" onOpenGift="getOpenNgift"></gift-modal>
......
...@@ -88,6 +88,7 @@ Page({ ...@@ -88,6 +88,7 @@ Page({
prizeimg: "", prizeimg: "",
prizename: "", prizename: "",
prizetype: "", prizetype: "",
prizeid:"",
prizebtntype: 1, prizebtntype: 1,
attionfrom: "",//啥功能gift--人气抽奖,prize--中奖弹窗 attionfrom: "",//啥功能gift--人气抽奖,prize--中奖弹窗
//info弹窗 //info弹窗
...@@ -107,7 +108,7 @@ Page({ ...@@ -107,7 +108,7 @@ Page({
}, },
onLoad(query) { onLoad(query) {
console.log("onLoad======>",query); console.log("onLoad======>", query);
if (query) { if (query) {
...@@ -255,7 +256,7 @@ Page({ ...@@ -255,7 +256,7 @@ Page({
const windowWidth = my.getSystemInfoSync().windowWidth; const windowWidth = my.getSystemInfoSync().windowWidth;
const windowHeight = my.getSystemInfoSync().windowHeight; const windowHeight = my.getSystemInfoSync().windowHeight;
ccc.width = windowWidth * dpr + dpr;//重新修改会有误差 ccc.width = windowWidth * dpr + dpr;//重新修改会有误差
ccc.height = ccc.width/750*1624; ccc.height = ccc.width / 750 * 1624;
r(ccc); r(ccc);
}, },
fail: () => { fail: () => {
...@@ -263,7 +264,7 @@ Page({ ...@@ -263,7 +264,7 @@ Page({
} }
}) })
}) })
if(!canvas){ if (!canvas) {
return; return;
} }
console.log(111) console.log(111)
...@@ -277,7 +278,7 @@ Page({ ...@@ -277,7 +278,7 @@ Page({
// sysInfo && sysInfo.windowWidth || document.body.clientWidth, // sysInfo && sysInfo.windowWidth || document.body.clientWidth,
// sysInfo && sysInfo.windowHeight || document.body.clientHeight, // sysInfo && sysInfo.windowHeight || document.body.clientHeight,
sysInfo.windowWidth, sysInfo.windowWidth,
sysInfo.windowWidth/750*1624, sysInfo.windowWidth / 750 * 1624,
FYGE.RENDERER_TYPE.CANVAS FYGE.RENDERER_TYPE.CANVAS
); );
var con = stage.addChild(new FYGE.Container()) var con = stage.addChild(new FYGE.Container())
...@@ -401,7 +402,7 @@ Page({ ...@@ -401,7 +402,7 @@ Page({
this.setData({ this.setData({
showani: true showani: true
}); });
if(this.whateani){ if (this.whateani) {
FYGE.Tween.removeTweens(this.whateani); FYGE.Tween.removeTweens(this.whateani);
this.whateani.play(1); this.whateani.play(1);
} }
...@@ -933,7 +934,7 @@ Page({ ...@@ -933,7 +934,7 @@ Page({
} }
this.changeBtnReady(false); this.changeBtnReady(false);
if (!app.inviteId) return; if (!app.inviteId) return;
commonToast('正在发起助力~') // commonToast('正在发起助力~')
const { const {
success, success,
data, data,
...@@ -1053,7 +1054,7 @@ Page({ ...@@ -1053,7 +1054,7 @@ Page({
closeSp() { closeSp() {
this.setData({ this.setData({
sp_v: false, sp_v: false,
showani:false showani: false
}); });
this.showDialog(false); this.showDialog(false);
}, },
...@@ -1140,6 +1141,7 @@ Page({ ...@@ -1140,6 +1141,7 @@ Page({
if (!cancontinue) { if (!cancontinue) {
return false; return false;
} }
this.changeBtnReady(false);
// console.log("点击集碎片"); // console.log("点击集碎片");
let drawTimes = this.data.drawTimes; let drawTimes = this.data.drawTimes;
...@@ -1156,9 +1158,12 @@ Page({ ...@@ -1156,9 +1158,12 @@ Page({
infotit: infotit//"今日免费次数已用完\n再召唤x位好友就能获得xxx" infotit: infotit//"今日免费次数已用完\n再召唤x位好友就能获得xxx"
}); });
this.openInfo(); this.openInfo();
setTimeout(() => {
this.changeBtnReady(true);
}, 1000);
return; return;
} }
this.changeBtnReady(false);
let docardata = await API.doCardDraw().catch(res => { let docardata = await API.doCardDraw().catch(res => {
commonToast(res && res.message); commonToast(res && res.message);
}) || {}; }) || {};
...@@ -1202,7 +1207,9 @@ Page({ ...@@ -1202,7 +1207,9 @@ Page({
// }); // });
// }, 1000); // }, 1000);
} }
setTimeout(() => {
this.changeBtnReady(true);
}, 1000);
}, },
/** /**
* 再抽一次 * 再抽一次
...@@ -1299,11 +1306,12 @@ Page({ ...@@ -1299,11 +1306,12 @@ Page({
showPrizePage(success, data, atype = "prize") { showPrizePage(success, data, atype = "prize") {
if (success) { if (success) {
//中奖了 //中奖了
let { name, type, image } = data; let { name, type, image, id } = data;
this.setData({ this.setData({
prizeimg: image, prizeimg: image,
prizename: name, prizename: name,
prizetype: type, prizetype: type,
prizeid: id || 0,
prizebtntype: 1, prizebtntype: 1,
attionfrom: "prize", attionfrom: "prize",
}); });
...@@ -1552,15 +1560,11 @@ Page({ ...@@ -1552,15 +1560,11 @@ Page({
}, },
//埋点 //埋点
addStat(type) { addStat(type) {
try {
API.addStat({ API.addStat({
type: type type: type
}).catch(res => { }).catch(res => {
console.error(res);
}); });
} catch (e) {
}
}, },
//修改按钮点击 //修改按钮点击
changeBtnReady(_v) { changeBtnReady(_v) {
......
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