Commit ac49b1e2 authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

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