Commit 2c5aefbd authored by 任建锋's avatar 任建锋

--

parent 707e931e
.common-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 20;
}
.common-modal__shade {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.75);
}
.common-modal__container {
position: absolute;
width: 500rpx;
height: 300rpx;
background: #4eafd7;
background-size: 100% 100%;
left: 50%;
top: 50%;
margin-left: -250rpx;
margin-top: -150rpx;
padding: 30rpx;
}
.common-modal__bd {
font-size: 28rpx;
text-align: center;
color: #fff;
padding: 50rpx 0;
}
.common-modal__close {
position: absolute;
right: -20rpx;
top: -80rpx;
height: 86rpx;
width: 86rpx;
background: url('../../assets/modal_close_btn.png') center center no-repeat;
background-size: 48rpx 48rpx;
z-index: 9;
}
.common-modal__confirm-btn {
margin: 0 auto;
text-align: center;
width: 341rpx;
height: 77rpx;
line-height: 77rpx;
background: #FFF;
background-size: 100% 100%;
font-size: 30rpx;
color: #0077a9;
font-weight: bold;
}
<view class="common-modal">
<view class="common-modal__shade modal-animate-fade-in" />
<view class="common-modal__container modal-animate-zoom-in">
<view class="common-modal__close" onTap="onModalClose" />
<view class="common-modal__bd">
<text>{{data.content}}</text>
</view>
<view class="common-modal__ft" a:if="{{data.btnText}}">
<view onTap="onModalConfirm" class="common-modal__confirm-btn">{{data.btnText}}</view>
</view>
</view>
</view>
Component({
methods: {
onModalClose() {
const { onModalClose } = this.props;
onModalClose && onModalClose();
},
onModalConfirm () {
const { onModalConfirm } = this.props;
onModalConfirm && onModalConfirm();
}
}
});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
.countdown {
position: fixed;
width: 144rpx;
height: 162rpx;
right: 0;
top: 600rpx;
z-index: 20;
}
.countdown-box-clock {
position: absolute;
top: 0;
left: 50%;
margin-left: -41rpx;
width: 82rpx;
height: 88rpx;
background-size: 100% 100%;
z-index: 10;
}
.countdown-box-clock__time {
position: absolute;
top: 5rpx;
left: 0;
width: 82rpx;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
}
.countdown-box-clock image {
width: 100%;
height: 100%;
}
.countdown-box {
position: absolute;
width: 130rpx;
height: 18rpx;
border-radius: 10rpx;
border: 1px solid #a6fffe;
background: #111192;
box-shadow: 0 0 4rpx 1rpx #7fd5ff;
top: 25rpx;
bottom: 20rpx;
left: 0;
right: 0;
margin: auto;
overflow: hidden;
z-index: 11;
}
@keyframes countdownAnimation {
to {
transform: translateX(0);
}
}
.countdown-box .countdown-time {
height: 100%;
width: 100%;
background: linear-gradient(#3996f8, #19dffd);
}
.countdown-txt {
position: absolute;
width: 147rpx;
height: 91rpx;
bottom: 0rpx;
z-index: 1;
}
.countdown-txt image {
width: 100%;
height: 100%;
}
.countdown-txt__content {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
line-height: 25rpx;
color: #2A2A2A;
text-align: center;
font-size: 20rpx;
}
.countdown-txt .txt:first-child{
margin-top: 25rpx;
}
.countdown-two {
position: absolute;
width: 554rpx;
height: 104rpx;
left: 50%;
margin-left: -277rpx;
bottom: 70rpx;
}
.countdown-two-clock {
position: absolute;
right: -10rpx;
bottom: 10rpx;
width: 104rpx;
height: 95rpx;
z-index: 15;
}
.countdown-two-clock image {
width: 100%;
height: 100%;
}
.countdown-two-clock .countdown-box-clock__time {
position: absolute;
top: 5rpx;
left: 0;
width: 104rpx;
height: 95rpx;
display: flex;
align-items: center;
justify-content: center;
}
.countdown-two-clock .countdown-box{
position: absolute;
left: 0;
bottom: -20rpx;
}
.countdown-two-txt {
position: absolute;
right: 90rpx;
top: 5rpx;
width: 323rpx;
height: 60rpx;
z-index: 14;
background: url('//yun.dui88.com/taobaomini/clientCTest/count_bg_02@2x.png');
background-size: 100% 100%;
color: #2A2A2A;
text-align: center;
font-size: 20rpx;
line-height: 60rpx;
}
.countdown-two-txt image {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 14;
}
.countdown-two__content {
position: absolute;
left: 0;
top: 0;
width: 323rpx;
height: 60rpx;
color: #2A2A2A;
text-align: center;
font-size: 20rpx;
}
\ No newline at end of file
<view class="countdown" a:if="{{styleType == '01'}}">
<view class="countdown-box-clock">
<image mode="scaleToFill" src="{{data.clock_bg}}"/>
<view class="countdown-box-clock__time" style="{{{'color':data.countTxtColor,'fontSize':data.countTxtSize+'rpx'}}}">{{countTime}}</view>
</view>
<view class="countdown-box" style="{{{'height':data.progressHeight+'rpx','width':data.progressWidth+'rpx'}}}">
<view class="countdown-time" style="transform: translateX({{percent*10 -100}}%);animation: countdownAnimation {{countTime-percent}}s forwards linear;"></view>
</view>
<view class="countdown-txt">
<image mode="scaleToFill" src="{{data.textBg}}"/>
<view class="countdown-txt__content">
<view class="txt">{{data.text.split('\n')[0]}}</view>
<view class="txt">{{data.text.split('\n')[1]}}</view>
</view>
</view>
</view>
<view class="countdown-two" a:else>
<view class="countdown-two-clock">
<image mode="scaleToFill" src="{{data.clock_bg}}"/>
<view class="countdown-box-clock__time" style="{{{'color':data.countTxtColor,'fontSize':42+'rpx'}}}">{{countTime}}</view>
</view>
<view class="countdown-box" style="{{{'height':55+'rpx','width':490+'rpx'}}}">
<view class="countdown-time" style="transform: translateX({{percent*10 -100}}%);animation: countdownAnimation {{countTime-percent}}s forwards linear;"></view>
</view>
<view class="countdown-two-txt" style="{{{'background':`url(${data.textBg}) no-repeat`,'backgroundSize': '100% 100%'}}}">
{{data.text}}
</view>
</view>
/**
* data: {
* text: //文案描述
* textBg: //文案背景
* progressWidth: //进度条宽
* progressHeight: //进度条高
* clock_bg: //时钟icon
* countTxt: //时钟文案
* countTxtColor: //时钟文字颜色
* countTxtSize: //时钟文字大小
* }
* hasPercent: //任务完成剩余时长
* countTime: //倒计时长
* styleType: //样式(01——右对齐,02—底部)
*/
Component({
mixins: [],
data: {},
props: {
percent: 10,
hasPercent:10,
countTime: 10,
styleType: '01',//browse_txt_bg count_bg_02
data: {
text: '浏览商品10s\n获得任务奖励',
textBg: '//yun.duiba.com.cn/taobaomini/clientCTest/browse_txt_bg@2x.png',
progressWidth:'130',
progressHeight:'18',
clock_bg: '//yun.duiba.com.cn/taobaomini/clientCTest/clock@2x.png',
countTxt: '10',
countTxtColor: '#1CA4ED',
countTxtSize: '32'
}
},
didMount() {},
didUpdate() {},
didUnmount() { },
methods: {},
});
{
"component": true
}
\ No newline at end of file
.end-modal-container {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
min-height: 100vh;
/* background: url('//yun.dui88.com/taobaomini/clientCTest/end_bg@2x.png') no-repeat; */
background-size: 750rpx 1624rpx;
overflow: hidden;
z-index: 20;
}
.end-modal-container-content {
position: absolute;
width: 750rpx;
height: 480rpx;
top: 50%;
left: 0;
margin-top: -240rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
.end-modal-container-content__icon {
width: 478rpx;
height: 340rpx;
}
.end-modal-container-content__icon image {
width: 100%;
height: 100%;
}
.end-modal-container-content__desc {
font-size: 36rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #ADADAD;
}
\ No newline at end of file
<view class="end-modal-container" style="{{{'background':`url(${data.image.bg}) no-repeat`}}}">
<view class="end-modal-container-content">
<view class="end-modal-container-content__icon">
<image mode="scaleToFill" src="{{data.image.end_icon}}"/>
</view>
<view class="end-modal-container-content__desc">{{data.text}}</view>
</view>
</view>
\ No newline at end of file
Component({
mixins: [],
data: {},
props: {
data: {
image: {
bg: '//yun.dui88.com/taobaomini/clientCTest/end_bg@2x.png',
end_icon: '//yun.dui88.com/taobaomini/clientCTest/end_icon@2x.png',
},
text: '活动未开始'
}
},
didMount() {},
didUpdate() {},
didUnmount() {},
methods: {},
});
{
"component": true
}
\ No newline at end of file
.goods-modal-container {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
min-height: 100vh;
/* background: url('//yun.dui88.com/taobaomini/clientCTestgoods_bg@2x.png') no-repeat; */
background-size: 750rpx 1624rpx;
overflow: hidden;
z-index: 20;
}
.gotobuybtn{
position:absolute;
width: 96rpx;
height: 34rpx;
right: 10rpx;
pointer-events: none;
}
.goods-modal-container__title {
width: 355rpx;
height: 49rpx;
margin: 0rpx auto;
margin-top:96rpx;
margin-bottom:40rpx;
}
.goods-modal-container__banner {
width: 750rpx;
height: 400rpx;
margin-bottom: 30rpx;
background: #E1E1E1;
}
.goods-modal-container__content {
position: absolute;
top: 190rpx;
left: 0;
bottom: 0;
padding-top: 41rpx;
padding: 41rpx 23rpx 0;
width: 750rpx;
/* height: inherit; */
}
.goods-modal-container__scroll {
height: 100%;
}
.goods-modal-container__content-list {
width: 100%;
display: flex;
flex-wrap: wrap;
}
.goods-modal-container__content-item {
width: 340rpx;
height: 470rpx;
background: #fff;
margin-bottom: 20rpx;
border-radius: 20rpx;
overflow: hidden;
border: 4rpx solid #4b2a0a;
position: relative;
}
.goods-modal-container__content-item:nth-child(even) {
margin-left: 20rpx;
}
.goods-modal-container__content-item__img {
width: 340rpx;
height: 340rpx;
background: #E1E1E1;
}
.goods-modal-container__content-item__img image {
width: 100%;
height: 100%;
}
.goods-modal-container__content-item__name {
margin: 4rpx 0 4rpx 21rpx;
width:310rpx;
height:60rpx;
font-size:24rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(24,24,24,1);
line-height:30rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.goods-modal-container__content-item__price {
padding: 0 31rpx 0 24rpx;
display: flex;
justify-content: space-between;
}
.goods-modal-container__content-item__price-num {
font-size:32rpx;
font-family:PingFang SC;
font-weight:600;
color:rgba(255,42,0,1);
}
.goods-modal-container__content-item__price-num text {
font-size: 24rpx;
margin-right: 2rpx;
}
.goods-modal-container__content-item__price-collect {
width: 118rpx;
height: 31rpx;
background-size: 100% 100%;
}
.goods-modal-container__content-item__price-collect image {
width: 100%;
height: 100%;
}
.goods-modal-container__content-item__price-no-collect {
width: 30rpx;
height: 30rpx;
}
.goods-modal-container__content-item__price-no-collect image {
width: 100%;
height: 100%;
}
.goods-modal-timer {
width: 147rpx;
height: 223rpx;
position: absolute;
top: 502rpx;
right: 19rpx;
background: #eee;
}
.goods-modal-timer__clock {
}
\ No newline at end of file
<view class="goods-modal-container" style="{{{'background':`url(${task.image.bg}) no-repeat`,'backgroundSize': '750rpx 1624rpx'}}}">
<view a:if="{{task.type == '01'}}"
style="{{{'background':`url(${task.image.title}) no-repeat`,'backgroundSize': '100% auto'}}}"
class="goods-modal-container__title">
</view>
<view a:else class="goods-modal-container__banner" style="{{{'background':`url(${task.image.banner}) no-repeat`,'backgroundSize': '100% auto','height':task.bannerHeight+'rpx'}}}"></view>
<view class="goods-modal-container__content" style="{{{'top':task.type == '02'?task.bannerHeight+'rpx':'130rpx'}}}">
<scroll-view scroll-y="{{true}}" class="goods-modal-container__scroll">
<view class="goods-modal-container__content-list">
<view class="goods-modal-container__content-item" a:for="{{goodsList}}" a:for-item="item">
<view class="goods-modal-container__content-item__img" data-item="{{item}}" onTap="goToGoodsDetail">
<image mode="scaleToFill" src="{{item.image}}"/>
</view>
<view class="goods-modal-container__content-item__name" style="{{{'color':task.color}}}">{{item.name}}</view>
<image class="gotobuybtn" src="//yun.duiba.com.cn/aurora/assets/fb4321a6e0283d4b4ef7f982918370567a6255c8.png"/>
<view class="goods-modal-container__content-item__price">
<view class="goods-modal-container__content-item__price-num"><text>¥</text>{{item.price}}</view>
<view a:if="{{task.taskType == 'collectGoods'}}"
data-item="{{item}}"
onTap="goToCollectGoods"
class="{{item.collected ? 'goods-modal-container__content-item__price-collect' : 'goods-modal-container__content-item__price-no-collect'}}"
>
<image mode="scaleToFill" src="{{item.collected?task.image.collect:task.image.no_collect}}"/>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
\ No newline at end of file
/**
* 任务类型(taskType):collectGoods、orderGoods、browseGoods、
*/
const app = getApp();
const { tbcc } = app;
const { openDetail, collectGoods, checkGoodsCollectedStatus, commonToast } = tbcc.tb;
Component({
mixins: [],
data: {
},
props: {
isBackFlag: 0,
goodsList: [1,2,3],
task: {
itemId: '617724147979,617724563528,617300295119',
taskType: 'browseGoods',
type: '02',
bannerHeight: 430,
image: {
bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
banner: '//yun.dui88.com/taobaomini/clientCTest/goods_banner@2x.png',
title: '//yun.dui88.com/taobaomini/clientCTest/goods_title@2x.png',
collect: '//yun.dui88.com/taobaomini/clientCTest/goods_collection@2x.png',
no_collect: '//yun.dui88.com/taobaomini/clientCTest/collection_no_collect@2x.png',
img: '//yun.dui88.com/taobaomini/clientCTest/goods_img@2x.png',
},
color: '#181818'
},
onCompleteTask: () => {},
onOpenDetail: () => {}
},
didMount() {
},
didUpdate(prevProps,prevData) {
},
didUnmount() {
},
methods: {
/**
* 跳转商品详情页
*/
async goToGoodsDetail(e) {
const { taskType } = this.props.task
const { itemId } = e.target.dataset.item
if(taskType == 'browseGoods') {
this.props.onOpenDetail(itemId)
}
await openDetail(String(itemId))
},
/**
* 收藏商品
*/
async goToCollectGoods(e) {
let { itemId, collected } = e.target.dataset.item
const { taskType } = this.props.task
if(collected) {
commonToast('您已收藏过该商品了')
return;
}
//判断是否活动外已收藏商品
let isCollected = await checkGoodsCollectedStatus(+itemId)
if(isCollected) {
this.props.onCompleteTask(taskType, itemId)
return;
}
let result = await collectGoods(+itemId)
if(result) {
this.props.onCompleteTask(taskType, itemId)
}
}
},
});
{
"component": true,
"usingComponents": {
"count-down-modal": "/_components/countDownModal/countDownModal"
}
}
\ No newline at end of file
@keyframes modalAnimation {
to {
opacity: 1;
}
}
.logistics-modal-container {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
z-index: 20;
opacity: 0;
animation: modalAnimation .3s forwards;
}
@keyframes containerAnimation {
to {
transform: scale(1)
}
}
.logistics-modal-container__content {
width: 646rpx;
height: 244rpx;
padding: 0 46rpx;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
display: flex;
align-items: center;
transform: scale(0);
animation: containerAnimation .3s forwards;
}
.logistics-modal-container__close {
position: absolute;
right: -10rpx;
top: -70rpx;
height: 48rpx;
width: 48rpx;
background: url("//yun.duiba.com.cn/taobaomini/aupresViva/tc_close.png") no-repeat;
background-size: 100% 100%;
}
.logistics-modal-container__content-item {
border-radius: 10rpx;
display: flex;
}
.logistics-modal-container__content-left {
width: 144rpx;
height: 144rpx;
background: rgba(244, 244, 244, 1);
}
.logistics-modal-container__content-left image {
width: 100%;
height: 100%;
}
.logistics-modal-container__content-right {
height: 144rpx;
margin-left: 24rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
font-size: 20rpx;
color: #959595;
flex: 1;
overflow: hidden;
white-space: nowrap;
}
.logistics-modal-container__content-name {
font-size: 28rpx;
color: rgba(51, 51, 51, 1);
}
.logistics-modal-container__content-desc {
font-size: 20rpx;
}
.logistics-modal-container__content-ids {
margin-bottom: 20rpx;
}
.logistics-modal-container__content-copy {
display: flex;
align-items: center;
height: 30rpx;
}
.logistics-modal-container__content-copy__code {
font-size: 20rpx;
}
.logistics-modal-container__content-copy__img {
width: 20rpx;
height: 20rpx;
background-size: 100% 100%;
margin-left: 20rpx;
}
\ No newline at end of file
<view class="logistics-modal-container">
<view class="logistics-modal-container__content"
style="{{prizeItem.shipStatus == 3 ?`background: url(${task.shipped}) no-repeat;background-size: 100% 100%;`
:`background: url(${task.notShipped}) no-repeat;background-size: 100% 100%;`}}">
<view class="logistics-modal-container__close" onTap="closeModal"></view>
<view class="logistics-modal-container__content-item">
<view class="logistics-modal-container__content-left">
<image mode="scaleToFill" src="{{prizeItem.image}}"/>
</view>
<view class="logistics-modal-container__content-right">
<view class="logistics-modal-container__content-name">{{prizeItem.name}}</view>
<view class="logistics-modal-container__content-copy">
<view class="logistics-modal-container__content-copy__code">奖品编码:{{prizeItem._id}}</view>
<view class="logistics-modal-container__content-copy__img" onTap="copyPrizeId"></view>
</view>
<view class="logistics-modal-container__content-desc">{{prizeItem.shipStatus== 3?'发货状态:已发货':'发货状态:未发货'}}</view>
<view class="logistics-modal-container__content-desc" a:if="{{prizeItem.shipStatus == 2}}">温馨提示:奖品将在活动结束7天内陆续发出</view>
<view class="logistics-modal-container__content-copy" a:else>
<view class="logistics-modal-container__content-copy__code">{{'物流单号:'+prizeItem.shipNum}}</view>
<view class="logistics-modal-container__content-copy__img" style="{{`background: url(${task.copyIcon}) no-repeat;background-size: 100% 100%;`}}" onTap="copyCode"></view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
const app = getApp();
const { tbcc } = app;
const { commonToast } = tbcc.tb;
Component({
mixins: [],
data: {},
props: {
prizeItem: {},
onCloseModal: () => { },
task: {
shipped: '',
notShipped: '',
}
},
didMount() { },
didUpdate() { },
didUnmount() { },
methods: {
closeModal() {
this.props.onCloseModal()
},
//复制运单号
copyCode() {
let { shipNum } = this.props.prizeItem
my.setClipboard({
text: shipNum + '',
success: () => {
commonToast('复制成功')
}
});
},
copyPrizeId() {
let { _id } = this.props.prizeItem
my.setClipboard({
text: _id + '',
success: () => {
commonToast('复制成功')
}
});
}
},
});
{
"component": true
}
\ No newline at end of file
.my-prize-page {
width: 100vw;
height: 100vh;
opacity: 1;
position: absolute;
top: 0;
left: 0;
overflow: hidden;
/* background: url('') no-repeat center top/cover; */
}
.my-prize-page .my-prize-wrap {
width: 100%;
height: 100%;
overflow: auto;
}
.my-prize-page .my-prize-label {
width: 305rpx;
height: 96rpx;
margin: 140rpx auto 40rpx;
background: url('//yun.dui88.com/duiba-components-c-myprizeprize_title.png') no-repeat;
background-size: 100% 100%;
}
.my-prize-page .my-prize-list {
width: 100%;
height: auto;
}
.my-prize-page .my-prize-empty {
text-align: center;
color: #fff;
margin-top: 30rpx;
}
.my-prize-page .my-prize-item {
display: flex;
justify-content: center;
align-items: center;
padding: 0 28rpx 0 26rpx;
margin: 0 auto 24rpx;
position: relative;
box-sizing: border-box;
width: 700rpx;
height: 161rpx;
background-color: #ffffff;
box-shadow: 2rpx 3rpx 18rpx 0 rgba(230, 146, 255, 0.6);
border-radius: 10rpx;
box-sizing: border-box;
border: 4rpx solid #4b2a0a;
}
.my-prize-page .my-prize-item .my-prize-avatar {
width: 120rpx;
height: 120rpx;
}
.my-prize-page .my-prize-item .my-prize-content {
flex: 1;
min-width: 0;
padding: 0 20rpx;
display: flex;
flex-direction: column;
height: 130rpx;
}
.my-prize-page .my-prize-item .my-prize-subtitle {
display: flex;
justify-content: center;
align-items: center;
}
.my-prize-page .my-prize-item .my-prize-copy {
width: 20rpx;
height: 20rpx;
margin-left: 18rpx;
}
.my-prize-page .my-prize-item .prize-status {
width: 150rpx !important;
height: 53rpx !important;
}
.prize-status>image {
width: 100%;
height: 100%;
}
.my-prize-page .my-prize-item .my-prize-name {
width: 100%;
font-size: 28rpx;
color: #2d2d2d;
letter-spacing: -1rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.my-prize-page .my-prize-item .my-prize-tip {
margin-top: 8rpx;
font-size: 20rpx;
line-height: 20rpx;
letter-spacing: 0;
color: #8a8a8a;
}
.my-prize-page .my-prize-item .my-prize-code {
width: 290rpx;
font-family: PingFangSC-Regular;
font-size: 20rpx;
color: #8a8a8a;
letter-spacing: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
\ No newline at end of file
<view class="my-prize-page" style="{{{'background':`url(${task.image.bg}) no-repeat center top/cover`}}}">
<view class="my-prize-wrap">
<view class="my-prize-label" style="{{{'background':`url(${task.image.title}) no-repeat`,'backgroundSize':'100% 100%'}}}"></view>
<view class="my-prize-list" a:if="{{myPrizeList && myPrizeList.length > 0}}">
<view class="my-prize-item" a:for="{{myPrizeList}}">
<image class="my-prize-avatar" src="{{item.image}}"/>
<view class="my-prize-content">
<label class="my-prize-name">{{item.name}}</label>
<view class="my-prize-subtitle">
<label class="my-prize-code">奖品编码:{{item._id}}</label>
<!-- 复制按钮 -->
<image class="my-prize-copy" data-text="{{item._id}}" onTap="handleCopyId" src="{{task.image.copyIcon}}" />
</view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.FAILURE}}">{{item.remark}}</view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.REPEAT || (item.drawStatus === PRIZE_DRAW_STATUS_MAP.RECEIVE)}}">请于{{endTime}}前领取</view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.FINISHED }}">奖品已过期失效</view>
</view>
<view class="prize-status" style="{{task.btnStyle}}">
<!-- 未领取 -->
<block a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.RECEIVE}}">
<!-- 实物填写地址 -->
<image a:if="{{item.type === PRIZE_TYPE_MAP.ENTITY}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.addressBth}}" />
<!-- 优惠券立即领取 -->
<image a:else onTap="handleClick" data-item="{{item}}" src="{{task.image.getBth}}" />
</block>
<!-- 已领取 -->
<block a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.SUCCESS}}">
<!-- 实物查看物流 -->
<image a:if="{{item.type === PRIZE_TYPE_MAP.ENTITY}}" onTap="handleView" data-item="{{item}}" src="{{task.image.logisticsBth}}" />
<!-- 优惠券去使用 -->
<image a:else onTap="handleTouse" data-item="{{item}}" src="{{task.image.useBtn}}" />
</block>
<!-- 重新领取 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.REPEAT}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.getAgainBtn}}" />
<!-- 已失效 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.FINISHED}}" src="{{task.image.invalidBtn}}" />
<!-- 领取失败 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.FAILURE}}" src="{{task.image.failBth}}" />
</view>
</view>
</view>
<view a:if="{{myPrizeList && myPrizeList.length === 0}}" class="my-prize-empty">{{task.blankTxt}}</view>
</view>
<logistics-modal a:if="{{isLogistic}}" prizeItem="{{currentPrize}}" onCloseModal="closeLogisticModal" task="{{task.logisticsImage}}"/>
</view>
\ No newline at end of file
const app = getApp();
const { tbcc } = app;
const { commonToast, navigateToOutside, getUserAddress, setClipboard } = tbcc.tb;
const { PRIZE_TYPE_MAP, PRIZE_DRAW_STATUS_MAP } = tbcc.constants;
Component({
mixins: [],
data: {
PRIZE_TYPE_MAP,
PRIZE_DRAW_STATUS_MAP,
currentPrize: {},
isLogistic: false,
},
props: {
myPrizeList: null, //我的奖品
endTime: null,//到期时间
task: {
image: {},
logisticsImage: {},
btnStyle: {}
}
},
didMount() { },
didUpdate() { },
didUnmount() { },
methods: {
//领取奖品
handleClick(e) {
this.props.onHandleClick(e)
},
// 复制编码
async handleCopyId(e) {
const { text } = e.target.dataset || {}
await setClipboard({ text })
console.log(text)
commonToast('复制成功')
},
// 去使用
handleTouse(e) {
const { item } = e.target.dataset;
navigateToOutside(item.useUrl)
},
//查看物流
handleView(e) {
let { item } = e.target.dataset
this.setData({ currentPrize: item, isLogistic: true })
},
/**
* 关闭物流弹窗
*/
closeLogisticModal() {
this.setData({ isLogistic: false })
},
},
});
{
"component": true,
"usingComponents": {
"logistics-modal": "/_components/logisticsModal/logisticsModal"
}
}
\ No newline at end of file
.rule-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 20;
}
.rule-modal__shade {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.75);
}
.rule-modal__container {
position: absolute;
width: 500rpx;
height: 600rpx;
background: #4eafd7;
background-size: 100% 100%;
left: 50%;
top: 50%;
margin-left: -250rpx;
margin-top: -300rpx;
}
.rule-modal__bd {
position: absolute;
top: 40rpx;
left: 40rpx;
right: 40rpx;
bottom: 40rpx;
overflow-x: hidden;
font-size: 24rpx;
color: #fff;
line-height: 1.5;
}
.rule-modal__close {
position: absolute;
right: -20rpx;
top: -80rpx;
height: 86rpx;
width: 86rpx;
background: url('../../assets/modal_close_btn.png') center center no-repeat;
background-size: 48rpx 48rpx;
z-index: 9;
}
<view class="rule-modal">
<view class="rule-modal__shade modal-animate-fade-in" />
<view class="rule-modal__container modal-animate-zoom-in">
<view class="rule-modal__close" onTap="onModalClose" />
<view class="rule-modal__bd">
<slot />
</view>
</view>
</view>
Component({
methods: {
onModalClose() {
const { onModalClose } = this.props;
onModalClose && onModalClose();
}
}
});
\ No newline at end of file
...@@ -118,6 +118,31 @@ const apiList = { ...@@ -118,6 +118,31 @@ const apiList = {
method: 'get', method: 'get',
isShowLoading: false isShowLoading: false
}, },
getGiftCard: {
handle: 'getGiftCard',
method: 'get',
isShowLoading: false
},
getVipInfo: {
handle: 'getVipInfo',
method: 'get',
isShowLoading: false
},
getCollectGoodsList: {
handle: 'getCollectGoodsList',
method: 'get',
isShowLoading: false
},
getItemListByItemIds: {
handle: 'getItemListByItemIds',
method: 'get',
isShowLoading: false
},
getMyPrizeList: {
handle: 'getMyPrizeList',
method: 'get',
isShowLoading: false
},
/**获取用户信息 */ /**获取用户信息 */
getUserInfo: { getUserInfo: {
handle: 'getUserInfo', handle: 'getUserInfo',
......
...@@ -14,6 +14,7 @@ App({ ...@@ -14,6 +14,7 @@ App({
// cloudName: 'bubbleSurviva', // 主云函数项目名 tmallCat // cloudName: 'bubbleSurviva', // 主云函数项目名 tmallCat
cloud, cloud,
tbcc, tbcc,
sellerId:"628189716",
onLaunch(options) { onLaunch(options) {
this.handleQuery(options.query || {}); this.handleQuery(options.query || {});
var pages = getCurrentPages() var pages = getCurrentPages()
......
{ {
"pages": [ "pages": [
"pages/pageindexpage/pageindexpage" "pages/pageindexpage/pageindexpage",
"pages/myprize/myprize",
"pages/collectGoods/collectGoods",
"pages/orderGoods/orderGoods",
"pages/orderDepositGoods/orderDepositGoods"
], ],
"window": { "window": {
"enableSkia": "true", "enableSkia": "true",
......
...@@ -28,4 +28,13 @@ ...@@ -28,4 +28,13 @@
} }
.btn:active{ .btn:active{
transform: scale(0.9); transform: scale(0.9);
}
.disibleAll{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
z-index:999;
background:rgba(0,0,0,0.01)
} }
\ No newline at end of file
/* 程序样式 */
@import './your.acss';
.getgivingcardpanel { .getgivingcardpanel {
width: 739rpx; width: 739rpx;
height: 954rpx; height: 954rpx;
......
<view class="getgivingcardpanel "> <view class="getgivingcardpanel ">
<image class="dim66 " src={{resList['76a9cc41-7074-45cc-ab2f-c5dd47e07058'].url}} /> <image class="dim66 " src={{resList['76a9cc41-7074-45cc-ab2f-c5dd47e07058'].url}} />
<image class="getgivingcardalsobtn " src={{resList['c83cb68d-c685-4a21-987d-f374d903c006'].url}} /> <image class="getgivingcardalsobtn " src={{resList['c83cb68d-c685-4a21-987d-f374d903c006'].url}} />
<image class="xiao_biao_ti64 " src={{resList['71cc94bd-5822-4f37-9824-94634cceacfe'].url}} /> <image class="xiao_biao_ti64 " src={{resList['71cc94bd-5822-4f37-9824-94634cceacfe'].url}} />
<image class="getgivingcardimg " src={{resList['4d109fea-6c5b-457a-af9a-1630f3d9d6a1'].url}} /> <image class="getgivingcardimg " src={{GiftCard.image}} />
<image class="getgivingcardclosebtn " src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} /> <image class="getgivingcardclosebtn " onTap="hiddenPanelEvent" data-value="getgivingcardpanel" src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} />
</view> </view>
\ No newline at end of file \ No newline at end of file
'use strict'; 'use strict';
import { DataCenter } from '../../DataCenter';
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
Component({ Component({
props: {}, props: {},
data: {}, data: {},
methods: {}, methods: {
hiddenPanelEvent(e){
onInit(props) { this.props.onTapHiddenPanelEvent(e);
}
},
didMount(props) {
this.setData({ this.setData({
resList: resList resList: resList,
GiftCard:DataCenter.GiftCard
}); });
} }
}); });
\ No newline at end of file
.getgivingcardpanel{
height:1224rpx !important;
}
\ No newline at end of file
<view class="givingcardpanel "> <view class="givingcardpanel ">
<image class="dim6 " src={{resList['3474c828-84f0-4513-b32d-d1987a7d5e58'].url}} /> <image class="dim6 " src={{resList['3474c828-84f0-4513-b32d-d1987a7d5e58'].url}} />
<image class="getgivingcardbtn " src={{resList['d3f306d2-fe7d-4167-8ce4-912b1e1f0782'].url}} /> <image class="getgivingcardbtn " onTap="onTapGetGivingCardBtn" data-value="givingcardpanel" src={{resList['d3f306d2-fe7d-4167-8ce4-912b1e1f0782'].url}} />
<image class="wow_kao_bei " src={{resList['81c19179-8097-44d0-a296-5f89f3f77f70'].url}} /> <image class="wow_kao_bei " src={{resList['81c19179-8097-44d0-a296-5f89f3f77f70'].url}} />
<image class="givingcardimg " src={{cardUrl}} /> <image class="givingcardimg " src={{cardUrl}} />
<image class="givingcardclosebtn " onTap="hiddenPanelEvent" data-value="givingcardpanel" src={{resList['17952009-08e1-4439-b51f-3e4e1e66333f'].url}} /> <image class="givingcardclosebtn " onTap="hiddenPanelEvent" data-value="givingcardpanel" src={{resList['17952009-08e1-4439-b51f-3e4e1e66333f'].url}} />
......
...@@ -4,6 +4,7 @@ import resList from '../../resconfig/resList'; ...@@ -4,6 +4,7 @@ import resList from '../../resconfig/resList';
const app = getApp(); const app = getApp();
const { tbcc } = app; const { tbcc } = app;
import API from '../../api'; import API from '../../api';
import events from '../../events';
const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb; const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
Component({ Component({
props: {}, props: {},
...@@ -26,6 +27,37 @@ Component({ ...@@ -26,6 +27,37 @@ Component({
} }
} }
} }
},
async onTapGetGivingCardBtn(e){
events.emit("doDisibleAll",true)
const { activityId } = getApp();
let GiftCard = await API.getGiftCard({
activityId,
type:DataCenter.givingCardData.cardType,
inviteId:DataCenter.givingCardData.cardId
}).catch(res => {
if(res&&res.code=="430008"){
//非店铺会员
DataCenter.joinmemberpanelText="不能领取自己的卡牌哦~"
this.showPanel("joinmemberpanel");
}else if(res&&res.code=="430011"){
//只有新会员才能助力哦
DataCenter.sorryMsgText="手速太慢啦\n该卡牌已被其他好友截胡领走啦..."
this.showPanel("sorrypanel");
}else{
commonToast(res && res.message);
}
}) || {};
DataCenter.GiftCard=GiftCard.data;
if(GiftCard&&GiftCard.success){
this.props.onTapHiddenPanelEvent(e);
events.emit("updateIndex")
this.showPanel("getgivingcardpanel")
}
events.emit("doDisibleAll",false)
},
showPanel(name){
this.props.onShowPanel(name)
} }
}, },
didMount(props) { didMount(props) {
......
<view class="helpnoneprizepanel "> <view class="helpnoneprizepanel ">
<image class="dim85 " src={{resList['c22d4fcc-ebd6-463b-82d7-fb5b872b79da'].url}} /> <image class="dim85 " src={{resList['c22d4fcc-ebd6-463b-82d7-fb5b872b79da'].url}} />
<image class="helpnoneprizealsobtn " src={{resList['cedeaa81-51f0-488f-a1de-92d14c84cffc'].url}} /> <image class="helpnoneprizealsobtn " onTap="hiddenPanelEvent" data-value="helpnoneprizepanel" src={{resList['cedeaa81-51f0-488f-a1de-92d14c84cffc'].url}} />
<view class="xiao_biao_ti83 "> <view class="xiao_biao_ti83 ">
<text class="hen_yi_han_ni_lai_wan_la_jiang_pin_liu_zou_la ">很遗憾,你来晚啦 奖品溜走啦......</text> <text class="hen_yi_han_ni_lai_wan_la_jiang_pin_liu_zou_la ">很遗憾,你来晚啦 奖品溜走啦......</text>
</view> </view>
......
<view class="helpprizepanel "> <view class="helpprizepanel ">
<image class="dim91 " src={{resList['12e4a261-7106-4bec-b9e9-6df026fcd440'].url}} /> <image class="dim91 " src={{resList['12e4a261-7106-4bec-b9e9-6df026fcd440'].url}} />
<image class="helpprizealsojoinbtn " src={{resList['27a7f1d2-f272-4f12-8ff5-2cde96d149fd'].url}} /> <image class="helpprizealsojoinbtn " onTap="hiddenPanelEvent" data-value="helpprizepanel" src={{resList['27a7f1d2-f272-4f12-8ff5-2cde96d149fd'].url}} />
<view class="xiao_biao_ti88 "> <view class="xiao_biao_ti88 ">
<text class="gong_xi_ni_huo_de_yi_xia_jiang_li ">恭喜你获得以下奖励</text> <text class="gong_xi_ni_huo_de_yi_xia_jiang_li ">恭喜你获得以下奖励</text>
<text class="jiang_pin_yi_fa_fang_ke_zai_jiang_pin_zhong_cha_kan89 ">奖品已发放,可在【奖品】中查看</text> <text class="jiang_pin_yi_fa_fang_ke_zai_jiang_pin_zhong_cha_kan89 ">奖品已发放,可在【奖品】中查看</text>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="invitesuccesstitle "> <view class="invitesuccesstitle ">
<text class="cheng_gong_yao_qingx_ming_hao_you ">成功邀请X名好友</text> <text class="cheng_gong_yao_qingx_ming_hao_you ">成功邀请X名好友</text>
</view> </view>
<image class="invitecontinueplaybtn " src={{resList['464252af-98b7-4451-8331-b3d5f9be3a5d'].url}} /> <image class="invitecontinueplaybtn " onTap="hiddenPanelEvent" data-value="invitesuccesspanel" src={{resList['464252af-98b7-4451-8331-b3d5f9be3a5d'].url}} />
<text class="chi_da_jiang_jin_yi_bu_zhi_yao78 ">离大奖仅一步之遥</text> <text class="chi_da_jiang_jin_yi_bu_zhi_yao78 ">离大奖仅一步之遥</text>
<view class="xiao_biao_ti77 "> <view class="xiao_biao_ti77 ">
<text class="fan_pai_ci_shu ">翻牌次数</text> <text class="fan_pai_ci_shu ">翻牌次数</text>
......
<view class="joinmemberpanel "> <view class="joinmemberpanel ">
<image class="dim106 " src={{resList['11de08fa-6456-4123-8aba-ef9b3d980eb5'].url}} /> <image class="dim106 " src={{resList['11de08fa-6456-4123-8aba-ef9b3d980eb5'].url}} />
<image class="joinmemberbtn " src={{resList['3b7870b4-578d-4781-9a56-58916f02c376'].url}} /> <image class="joinmemberbtn " onTap="onTapJoinMemberBtn" src={{resList['3b7870b4-578d-4781-9a56-58916f02c376'].url}} />
<text class="joinmembertext ">加入会员\n才能参与活动赢大奖哦~</text> <text class="joinmembertext ">{{joinmemberpanelText}}</text>
<image class="joinmemberclosebtn " onTap="hiddenPanelEvent" data-value="joinmemberpanel" src={{resList['17952009-08e1-4439-b51f-3e4e1e66333f'].url}} /> <image class="joinmemberclosebtn " onTap="hiddenPanelEvent" data-value="joinmemberpanel" src={{resList['17952009-08e1-4439-b51f-3e4e1e66333f'].url}} />
</view> </view>
\ No newline at end of file
'use strict'; 'use strict';
import { DataCenter } from '../../DataCenter';
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
Component({ Component({
props: {}, props: {},
...@@ -7,12 +8,18 @@ Component({ ...@@ -7,12 +8,18 @@ Component({
methods: { methods: {
hiddenPanelEvent(e){ hiddenPanelEvent(e){
this.props.onTapHiddenPanelEvent(e); this.props.onTapHiddenPanelEvent(e);
} },
onTapJoinMemberBtn(e){
my.navigateTo({
url: DataCenter.vipInfo.url
});
},
}, },
didMount(props) { didMount(props) {
this.setData({ this.setData({
resList: resList resList: resList,
joinmemberpanelText:DataCenter.joinmemberpanelText
}); });
} }
......
<view class="noneprizepanel "> <view class="noneprizepanel ">
<image class="dim56 " src={{resList['d9dff4ee-9718-43f2-8197-e752b1a91028'].url}} /> <image class="dim56 " src={{resList['d9dff4ee-9718-43f2-8197-e752b1a91028'].url}} />
<image class="noneprizecontinuebtn " src={{resList['9d618b16-4a1c-448f-b30d-80996f64e4cb'].url}} /> <image class="noneprizecontinuebtn " onTap="hiddenPanelEvent" data-value="noneprizepanel" src={{resList['9d618b16-4a1c-448f-b30d-80996f64e4cb'].url}} />
<text class="hen_yi_han_jiang_li_yu_ni_ca_jian_er_guo ">很遗憾,奖励与你擦肩而过…</text> <text class="hen_yi_han_jiang_li_yu_ni_ca_jian_er_guo ">很遗憾,奖励与你擦肩而过…</text>
<image class="noneprizeclosebtn " onTap="hiddenPanelEvent" data-value="noneprizepanel" src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} /> <image class="noneprizeclosebtn " onTap="hiddenPanelEvent" data-value="noneprizepanel" src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} />
<text class="chi_da_jiang_jin_yi_bu_zhi_yao53 ">离大奖仅一步之遥</text> <text class="chi_da_jiang_jin_yi_bu_zhi_yao53 ">离大奖仅一步之遥</text>
......
<view class="prizepanel "> <view class="prizepanel ">
<image class="dim97 " src={{resList['76a9cc41-7074-45cc-ab2f-c5dd47e07058'].url}} /> <image class="dim97 " src={{resList['76a9cc41-7074-45cc-ab2f-c5dd47e07058'].url}} />
<image class="prizecontinuebtn " src={{resList['d1ef5d28-4bb0-4e36-b4cd-f03032b5c15e'].url}} /> <image class="prizecontinuebtn " onTap="hiddenPanelEvent" data-value="prizepanel" src={{resList['d1ef5d28-4bb0-4e36-b4cd-f03032b5c15e'].url}} />
<view class="xiao_biao_ti94 "> <view class="xiao_biao_ti94 ">
<text class="gong_xi_huo_de_yi_xia_jiang_li ">恭喜获得以下奖励</text> <text class="gong_xi_huo_de_yi_xia_jiang_li ">恭喜获得以下奖励</text>
<text class="jiang_pin_yi_fa_fang_ke_zai_jiang_pin_zhong_cha_kan95 ">奖品已发放,可在【奖品】中查看</text> <text class="jiang_pin_yi_fa_fang_ke_zai_jiang_pin_zhong_cha_kan95 ">奖品已发放,可在【奖品】中查看</text>
......
<view class="sorrypanel "> <view class="sorrypanel ">
<image class="dim75 " src={{resList['32da4042-3a54-409d-90ef-cb8320f41622'].url}} /> <image class="dim75 " src={{resList['32da4042-3a54-409d-90ef-cb8320f41622'].url}} />
<image class="sorrycontinuebtn " src={{resList['3c6dd474-9224-4776-96ae-ed0cc94ba7d7'].url}} /> <image class="sorrycontinuebtn " onTap="hiddenPanelEvent" data-value="sorrypanel" src={{resList['3c6dd474-9224-4776-96ae-ed0cc94ba7d7'].url}} />
<span class="sorrytext ">助力失败! 新入会的会员才能助力成功哦~</span> <text class="sorrytext ">{{sorryMsgText}}</text>
<image class="sorryclosebtn " src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} /> <image class="sorryclosebtn " onTap="hiddenPanelEvent" data-value="sorrypanel" src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} />
</view> </view>
\ No newline at end of file \ No newline at end of file
'use strict'; 'use strict';
import { DataCenter } from '../../DataCenter';
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
Component({ Component({
props: {}, props: {},
data: {}, data: {},
methods: {}, methods: {
hiddenPanelEvent(e){
console.log(this)
this.props.onTapHiddenPanelEvent(e);
}
},
onInit(props) { didMount(props) {
this.setData({ this.setData({
resList: resList resList: resList,
sorryMsgText:DataCenter.sorryMsgText
}); });
} },
}); });
\ No newline at end of file
...@@ -9,24 +9,31 @@ ...@@ -9,24 +9,31 @@
<!-- 去购买 --> <!-- 去购买 -->
<image class="tasknonebuybtn " <image class="tasknonebuybtn "
a:if={{(item.taskType==="orderGoods")}} a:if={{(item.taskType==="orderGoods")}}
onTap="onTapTaskNoneGotoBtn"
data-value={{item}}
src={{resList['befa9414-7e21-4e4a-a4d6-d42324525cd2'].url}} /> src={{resList['befa9414-7e21-4e4a-a4d6-d42324525cd2'].url}} />
<!-- 去购买 --> <!-- 去购买 -->
<image class="tasknonebuybtn " <image class="tasknonebuybtn "
a:elif={{(item.taskType==="orderDepositGoods")}} a:elif={{(item.taskType==="orderDepositGoods")}}
onTap="onTapTaskNoneGotoBtn"
data-value={{item}}
src={{resList['befa9414-7e21-4e4a-a4d6-d42324525cd2'].url}} /> src={{resList['befa9414-7e21-4e4a-a4d6-d42324525cd2'].url}} />
<!-- 去关注 --> <!-- 去关注 -->
<image class="tasknonetofocusbtn " <image class="tasknonetofocusbtn "
onTap="onTapTaskNoneToFocusbtn"
a:elif={{(item.taskType==="follow")}} a:elif={{(item.taskType==="follow")}}
src={{resList['ba2793d6-94cd-4fe1-ae3d-11278e0a66f8'].url}} /> src={{resList['ba2793d6-94cd-4fe1-ae3d-11278e0a66f8'].url}} />
<!-- 去浏览 --> <!-- 去浏览 -->
<image class="tasknonetobrowsebtn " <image class="tasknonetobrowsebtn "
a:elif={{(item.taskType==="jumpLink")}} a:elif={{(item.taskType==="jumpLink")}}
onTap="onTapTaskNoneGotoBtn"
data-value={{item}}
src={{resList['8473ab9f-df8e-4c4e-b249-8d1cad9f04ae'].url}} /> src={{resList['8473ab9f-df8e-4c4e-b249-8d1cad9f04ae'].url}} />
<!-- 去完成 --> <!-- 去完成 -->
<image class="tasknonegotobtn " <image class="tasknonegotobtn "
a:else a:else
onTap="onTapTaskNoneGotoBtn" onTap="onTapTaskNoneGotoBtn"
data-value={{item.taskType}} data-value={{item}}
src={{resList['f4a40fdc-4ac7-4917-bdca-704ac6e293d6'].url}} /> src={{resList['f4a40fdc-4ac7-4917-bdca-704ac6e293d6'].url}} />
</view> </view>
......
...@@ -5,7 +5,8 @@ import resList from '../../resconfig/resList'; ...@@ -5,7 +5,8 @@ import resList from '../../resconfig/resList';
const app = getApp(); const app = getApp();
const { tbcc } = app; const { tbcc } = app;
import API from '../../api'; import API from '../../api';
const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb; import events from '../../events';
const { commonToast, getAuthUserInfo, navigateToOutside,favorShop} = tbcc.tb;
Component({ Component({
...@@ -57,6 +58,7 @@ Component({ ...@@ -57,6 +58,7 @@ Component({
methods: { methods: {
hiddenPanelEvent(e){ hiddenPanelEvent(e){
this.props.onTapHiddenPanelEvent(e); this.props.onTapHiddenPanelEvent(e);
events.emit("updateIndex");
}, },
async onTapTaskReadyBtn(e){ async onTapTaskReadyBtn(e){
//获取活动基础信息 //获取活动基础信息
...@@ -69,11 +71,94 @@ Component({ ...@@ -69,11 +71,94 @@ Component({
commonToast(`任务完成,翻牌次数+${receiveTaskRewards.data.rewards}`); commonToast(`任务完成,翻牌次数+${receiveTaskRewards.data.rewards}`);
} }
}, },
onTapTaskNoneGotoBtn(){ async onTapTaskNoneToFocusbtn(){
this.inviteTask() const favorStatus = await favorShop(sellerId).catch(err => {
console.log('关注店铺失败', err);
});
if(favorStatus){
const { activityId } = getApp();
let taskType=e.target.dataset.value;
let doCompleteTask = await API.doCompleteTask({ activityId,taskType }).catch(res => {
commonToast(res && res.message);
}) || {};
if(doCompleteTask&&doCompleteTask.success){
commonToast("关注成功");
await this.updateData()
}
}
},
onTapTaskNoneGotoBtn(e){
let taskType=e.target.dataset.value.taskType;
if(taskType=="invites"){
this.inviteTask()
}else if(taskType=="groupChat"){
this.groupChatTask(taskType,e.target.dataset.value.url)
}else if(taskType=="member"){
this.memberTask(taskType,e.target.dataset.value.url)
}else if(taskType=="jumpLink"){
this.jumpLinkTask(taskType,e.target.dataset.value.url)
}else if(taskType=="collectGoods"){
my.navigateTo({
url:"/pages/collectGoods/collectGoods?itemIds="+e.target.dataset.value.itemIds
});
}else if(taskType=="orderGoods"){
my.navigateTo({
url:"/pages/orderGoods/orderGoods?itemIds="+e.target.dataset.value.itemIds
});
}else if(taskType=="orderDepositGoods"){
my.navigateTo({
url:"/pages/orderDepositGoods/orderDepositGoods?itemIds="+e.target.dataset.value.itemIds
});
}
},
async groupChatTask(taskType,url){
let doCompleteTask = await API.doCompleteTask({ activityId,taskType }).catch(res => {
commonToast(res && res.message);
}) || {};
await this.updateData()
if(doCompleteTask&&doCompleteTask.success){
my.navigateTo({
url:url
});
}
},
async jumpLinkTask(taskType,url){
let doCompleteTask = await API.doCompleteTask({ activityId,taskType }).catch(res => {
commonToast(res && res.message);
}) || {};
await this.updateData()
if(doCompleteTask&&doCompleteTask.success){
my.navigateTo({
url:url
});
}
},
async memberTask(taskType,url){
let doCompleteTask = await API.doCompleteTask({ activityId,taskType }).catch(res => {
commonToast(res && res.message);
}) || {};
await this.updateData()
if(doCompleteTask&&doCompleteTask.success){
my.navigateTo({
url:url
});
}
}, },
inviteTask(){ inviteTask(){
this.props.onInviteTask() this.props.onInviteTask()
},
async updateData(){
const { activityId } = getApp();
//获取中奖轮播
let TaskList = await API.getTaskList({ activityId }).catch(res => {
commonToast(res && res.message);
}) || {};
if(TaskList&&TaskList.success){
DataCenter.TaskList=TaskList.data.list;
this.setData({
TaskList:DataCenter.TaskList
});
}
} }
}, },
didMount(props) { didMount(props) {
......
/**
* Created by renjianfeng on 2020-06-17.
*/
import { EventEmitter } from 'events';
const events = new EventEmitter();
export default events;
<view class="win_bg" a:if={{showWinLists.length>0}}> <view class="win_bg" a:if={{showWinLists.length>0}}>
<sorrypanel a:if={{showWinLists.indexOf("sorrypanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<rulepanel a:if={{showWinLists.indexOf("rulepanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" /> <rulepanel a:if={{showWinLists.indexOf("rulepanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<getcardpanel a:if={{showWinLists.indexOf("getcardpanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" /> <getcardpanel a:if={{showWinLists.indexOf("getcardpanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<joinmemberpanel a:if={{showWinLists.indexOf("joinmemberpanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" /> <joinmemberpanel a:if={{showWinLists.indexOf("joinmemberpanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
...@@ -12,5 +13,6 @@ ...@@ -12,5 +13,6 @@
<helppanel a:if={{showWinLists.indexOf("helppanel")!=-1}} onIndexDoHelp="indexDoHelp" onTapHiddenPanelEvent="hiddenPanelEvent" /> <helppanel a:if={{showWinLists.indexOf("helppanel")!=-1}} onIndexDoHelp="indexDoHelp" onTapHiddenPanelEvent="hiddenPanelEvent" />
<helpnoneprizepanel a:if={{showWinLists.indexOf("helpnoneprizepanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" /> <helpnoneprizepanel a:if={{showWinLists.indexOf("helpnoneprizepanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<helpprizepanel a:if={{showWinLists.indexOf("helpprizepanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" /> <helpprizepanel a:if={{showWinLists.indexOf("helpprizepanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<givingcardpanel a:if={{showWinLists.indexOf("givingcardpanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" /> <givingcardpanel a:if={{showWinLists.indexOf("givingcardpanel")!=-1}} onShowPanel="showPanel" onTapHiddenPanelEvent="hiddenPanelEvent" />
<getgivingcardpanel a:if={{showWinLists.indexOf("getgivingcardpanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
</view> </view>
...@@ -19,7 +19,9 @@ Component({ ...@@ -19,7 +19,9 @@ Component({
}, },
indexDoHelp(){ indexDoHelp(){
this.props.onIndexDoHelp() this.props.onIndexDoHelp()
},
showPanel(name){
this.props.onShowPanel(name)
} }
}, },
}); });
\ No newline at end of file
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
"helppanel":"../../components/comhelppanel/comhelppanel", "helppanel":"../../components/comhelppanel/comhelppanel",
"helpprizepanel":"../../components/comhelpprizepanel/comhelpprizepanel", "helpprizepanel":"../../components/comhelpprizepanel/comhelpprizepanel",
"helpnoneprizepanel":"../../components/comhelpnoneprizepanel/comhelpnoneprizepanel", "helpnoneprizepanel":"../../components/comhelpnoneprizepanel/comhelpnoneprizepanel",
"givingcardpanel":"../../components/comgivingcardpanel/comgivingcardpanel" "givingcardpanel":"../../components/comgivingcardpanel/comgivingcardpanel",
"getgivingcardpanel":"../../components/comgetgivingcardpanel/comgetgivingcardpanel",
"sorrypanel":"../../components/comsorrypanel/comsorrypanel"
} }
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@tbminiapp/lottie-miniapp": "^0.0.4", "@tbminiapp/lottie-miniapp": "^0.0.4",
"@tbmp/mp-cloud-sdk": "*" "@tbmp/mp-cloud-sdk": "*",
"events": "^3.2.0"
} }
} }
<view class="goodsPage">
<goods-modal
goodsList="{{goodsList}}"
task="{{task}}"
onCompleteTask="onCompleteTask" />
</view>
\ No newline at end of file
/**
* 任务类型(taskType):collectGoods、 orderGoods 、 browseGoods 、exchangeCredits
* task: {
* itemId: //商品ID
* taskType: //任务类型
* type: //头部样式(02——banner,01——标题)
* image: {//图片
* bg: //集合页背景
* banner: //头部banner
* title: //头部title
* collect: //商品以收藏
* no_collect: //商品未收藏
* }
* color: //商品名称:文字颜色
* }
*/
const app = getApp();
const { tbcc } = app;
const { commonToast } = tbcc.tb;
import API from '../../api';
Page({
data: {
query: {},
task: {},
goodsList: []
},
onLoad(query) {
this.query = query || {}
this.init()
},
onShow() {
},
init() {
this.setData({
task: {
taskType: 'collectGoods',
type: '01',
image: {
bg: '//yun.duiba.com.cn/spark/assets/bd40dc26018211c59d937ad8e1ddd7ae1de09db6.png',
banner: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_banner@2x.png',
title: '//yun.duiba.com.cn/spark/assets/7ac9b1ca4bdea23b5f8b69b46e373900d56562e2.png',
collect: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_collection@2x.png',
no_collect: '//yun.duiba.com.cn/taobaomini/clientCTest/collection_no_collect@2x.png',
img: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png',
},
color: '#181818'
}
})
this.initPage()
},
async initPage() {
const { activityId } = app
const { itemIds } = this.query
const { success, data } = await API.getCollectGoodsList({ activityId, itemIds }).catch(res => {
res && commonToast(res)
}) || {}
if(success) {
this.setData({ goodsList: data || [] })
}
},
//任务完成 616444374083
async onCompleteTask(taskType,itemId) {
console.log(taskType,itemId)
const { activityId } = app
let { success, data } = await API.doCollectGoodsTask({ activityId, itemId }).catch(res => {
res && commonToast(res)
}) || {}
if(success) {
this.initPage()
}
}
});
{
"usingComponents": {
"goods-modal": "/_components/goodsModal/goodsModal"
}
}
\ No newline at end of file
<view class="my-prize">
<prize-modal
myPrizeList="{{myPrizeList}}"
task="{{task}}"
endTime="{{endTime}}"
onHandleClick="handleClick"/>
</view>
\ No newline at end of file
'use strict';
import API from "/api";
const app = getApp();
const { tbcc } = app;
const { commonToast, navigateToOutside, getUserAddress, setClipboard } = tbcc.tb;
const { dateFormatter, throttleHandle } = tbcc.utils;
const { PRIZE_TYPE_MAP, PRIZE_DRAW_STATUS_MAP } = tbcc.constants;
Page({
data: {
PRIZE_TYPE_MAP,
PRIZE_DRAW_STATUS_MAP,
myPrizeList: null, //我的奖品
endTime: null,//到期时间
task: {
image: {
bg: '//yun.duiba.com.cn/spark/assets/bd40dc26018211c59d937ad8e1ddd7ae1de09db6.png', //背景图
title: '//yun.duiba.com.cn/spark/assets/3a8e39ddef151ce8583508d40d2916715beb7dd6.png',//标题
copyIcon: '//yun.duiba.com.cn/spark/assets/7ac9b1ca4bdea23b5f8b69b46e373900d56562e2.png', //复制
addressBth: '//yun.duiba.com.cn/spark/assets/a1f0d3f252236a599d0dc37d04f9abf1167b0afd.png', //填写地址(实物奖品)
getBth: '//yun.duiba.com.cn/spark/assets/f710c4170feac9e38992c7b79df8b20dffa151d6.png', //立即领取(除实物奖品外)
logisticsBth: '//yun.duiba.com.cn/spark/assets/743acdfa0d596a0d2d04b989e84b756a587a8235.png', //查看物流
useBtn: '//yun.duiba.com.cn/spark/assets/1f00b5a8dd5a24529eb3e11227b0d661e7bc5cf9.png', //去使用(除实物奖品外)
getAgainBtn: ' //yun.duiba.com.cn/aurora/assets/7730b53739e8b0e4a723088ee0dc2cf7d8a71874.png', //重新领取
invalidBtn: '//yun.duiba.com.cn/spark/assets/cfc0a1ecb5f5fc1465058861102430a708d75f34.png', //已失效
failBth: '//yun.duiba.com.cn/spark/assets/e158e8c9d0343f2beee909820a3948f52c00d19e.png', //领取失败
},
logisticsImage: {
shipped: '//yun.dui88.com/duiba-components-c-myprizeprize_shipped.png', // 已发货物理弹窗
notShipped: '//yun.dui88.com/duiba-components-c-myprizenotshipped.png', // 待发货物流弹窗
copyIcon: '//yun.dui88.com/duiba-components-c-myprizemyprize_copy_code.png', //复制
},
blankTxt: '暂无奖品',
btnStyle: { // 按钮自定义样式
width: '150rpx',
height: '41rpx',
}
}
},
onShow() {
this.getMyPrize();
},
// 到期时间
getEndTime(prizeList = []) {
if (!prizeList || !prizeList.length) return null
let endTime = prizeList[0].expiredTime
if (!endTime) return null
this.setData({
endTime: dateFormatter(endTime, 'yyyy/MM/dd hh:mm:ss')
})
console.log(this.data.endTime)
},
/**
* 获取奖品列表
* @param {string} type 是否展示loading
*/
async getMyPrize(type) {
const { activityId } = app;
if (type != 'noLoading') {
my.showLoading();
}
const { success, data } = await API.getMyPrizeList({ activityId }).catch(res => {
commonToast(res && res.message);
this.setData({
myPrizeList: []
})
}) || {};
if (success && data) {
this.setData({
myPrizeList: data.list
})
console.log(data.list)
this.getEndTime(data.list)
}
if (type != 'noLoading') {
my.hideLoading();
}
},
//领取奖品
handleClick: throttleHandle(async function(e) {
const { item } = e.target.dataset;
// 领取权益
if (item.type === PRIZE_TYPE_MAP.EQUITY) return this.handleGetEquity(e)
// 领取实物
if (item.type === PRIZE_TYPE_MAP.ENTITY) return this.handleGetEntity(e)
// 领取积分
if (item.type === PRIZE_TYPE_MAP.INTEGRATION) return this.handleGetIntergation(e)
},1000),
// 优惠券
async handleGetEquity(e) {
const { activityId } = app;
const { item } = e.target.dataset;
console.log(item, '领取权益')
const { success, data, message } = await API.receiveEnamePrize({ activityId, id: item._id || item.id }).catch(res => {
this.getMyPrize('noLoading')
commonToast(res && res.message)
}) || {};
if (success && data) {
commonToast('领取成功')
this.getMyPrize()
}
},
// 领取实物前询问
async handleGetEntity(e) {
my.showLoading();
const { activityId } = app;
const { item } = e.target.dataset;
const userAddress = await getUserAddress().catch(err => {
commonToast(err && err.errorMessage);
});
my.hideLoading();
if (!userAddress) return
const { name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName } = userAddress || {};
const params = {
activityId,
name,
phone: telNumber,
addressDetail: detailInfo,
cityCode,
city: cityName,
province: provinceName,
area: countyName,
streetName,
id: item._id || item.id
}
my.confirm({
title: '提示',
content: '确认使用该收货地址:' + name + telNumber + userAddress.duibaAddress.address,
confirmButtonText: '确定',
cancelButtonText: '取消',
success: (result) => {
console.log(result)
const { confirm } = result;
if (confirm) {
this.receiveObjectPrize(params);
}
},
});
},
// 领取实物
async receiveObjectPrize(params) {
const { success, data } = await API.receiveObjectPrize(params).catch(res => {
commonToast(res && res.message)
}) || {}
if (success && data) {
commonToast('领取成功')
}
this.getMyPrize()
},
// 积分
async handleGetIntergation(e) {
// 判断是否为会员
await this.getUserInfo()
const { isVip, vipLink } = app;
if (!isVip) {
commonToast('立即加入会员,即可领取奖品', 2000);
setTimeout(() => {
navigateToOutside(vipLink)
}, 1000)
return
}
const { activityId } = app;
const { item } = e.target.dataset;
console.log(item, '领取积分')
const { success, data } = await API.receiveEnamePrize({ activityId, id: item._id }).catch(res => {
commonToast(res && res.message)
}) || {};
if (success && data) {
commonToast('领取成功')
}
this.getMyPrize()
},
//获取用户vip信息
async getUserInfo() {
const { activityId } = app;
const { success, data } = await API.getVipInfo({ activityId }).catch(res => {
commonToast(res && res.message)
}) || {};
console.log(data, '用户vip信息');
if (success && data) {
app.isVip = (data && data.isVip) || false;
app.vipLink = (data && data.url) || '';
}
},
});
\ No newline at end of file
{
"usingComponents": {
"prize-modal": "/_components/prizeModal/prizeModal"
}
}
\ No newline at end of file
<view class="goodsPage">
<goods-modal
goodsList="{{goodsList}}"
task="{{task}}"
onCompleteTask="onCompleteTask" />
</view>
\ No newline at end of file
/**
* 任务类型(taskType): collectGoods 、 orderGoods 、 browseGoods 、exchangeCredits
* task: {
* itemId: //商品ID
* taskType: //任务类型
* type: //头部样式(02——banner,01——标题)
* image: {//图片
* bg: //集合页背景
* banner: //头部banner
* title: //头部title
* collect: //商品以收藏
* no_collect: //商品未收藏
* }
* color: //商品名称:文字颜色
* }
*/
const app = getApp();
const { tbcc } = app;
const { commonToast } = tbcc.tb;
import API from '../../api';
Page({
data: {
query: {},
task: {},
goodsList: []
},
onLoad(query) {
this.query = query || {}
this.init()
},
onShow() {
},
init() {
this.setData({
task: {
taskType: 'orderGoods',
type: '01',
image: {
bg: '//yun.duiba.com.cn/spark/assets/bd40dc26018211c59d937ad8e1ddd7ae1de09db6.png',
banner: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_banner@2x.png',
title: ' //yun.duiba.com.cn/aurora/assets/56a080467665313bbec375032c2bbbecf93bd4fc.png',
collect: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_collection@2x.png',
no_collect: '//yun.duiba.com.cn/taobaomini/clientCTest/collection_no_collect@2x.png',
img: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png',
},
color: '#181818'
}
})
this.initPage()
},
async initPage() {
const { activityId } = app
const { itemIds } = this.query
const { success, data } = await API.getItemListByItemIds({ activityId, itemIds }).catch(res => {
res && commonToast(res)
}) || {}
if(success) {
this.setData({ goodsList: data || [] })
}
},
});
{
"usingComponents": {
"goods-modal": "/_components/goodsModal/goodsModal"
}
}
\ No newline at end of file
<view class="goodsPage">
<goods-modal
goodsList="{{goodsList}}"
task="{{task}}"
onCompleteTask="onCompleteTask" />
</view>
\ No newline at end of file
/**
* 任务类型(taskType): collectGoods 、 orderGoods 、 browseGoods 、exchangeCredits
* task: {
* itemId: //商品ID
* taskType: //任务类型
* type: //头部样式(02——banner,01——标题)
* image: {//图片
* bg: //集合页背景
* banner: //头部banner
* title: //头部title
* collect: //商品以收藏
* no_collect: //商品未收藏
* }
* color: //商品名称:文字颜色
* }
*/
const app = getApp();
const { tbcc } = app;
const { commonToast } = tbcc.tb;
import API from '../../api';
Page({
data: {
query: {},
task: {},
goodsList: []
},
onLoad(query) {
this.query = query || {}
this.init()
},
onShow() {
},
init() {
this.setData({
task: {
taskType: 'orderGoods',
type: '01',
image: {
bg: '//yun.duiba.com.cn/spark/assets/bd40dc26018211c59d937ad8e1ddd7ae1de09db6.png',
banner: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_banner@2x.png',
title: ' //yun.duiba.com.cn/aurora/assets/4f527b1098359d72f856dc696104eb5cd9469a87.png',
collect: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_collection@2x.png',
no_collect: '//yun.duiba.com.cn/taobaomini/clientCTest/collection_no_collect@2x.png',
img: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png',
},
color: '#181818'
}
})
this.initPage()
},
async initPage() {
const { activityId } = app
const { itemIds } = this.query
const { success, data } = await API.getItemListByItemIds({ activityId, itemIds }).catch(res => {
res && commonToast(res)
}) || {}
if(success) {
this.setData({ goodsList: data || [] })
}
},
});
{
"usingComponents": {
"goods-modal": "/_components/goodsModal/goodsModal"
}
}
\ No newline at end of file
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
</view> </view>
</view> </view>
<image class="indexrulebtn " onTap="showPanelEvent" data-value="{{'rulepanel'}}" src={{resList['abc5f112-fa04-42fa-bfec-f633567807c8'].url}} /> <image class="indexrulebtn " onTap="showPanelEvent" data-value="{{'rulepanel'}}" src={{resList['abc5f112-fa04-42fa-bfec-f633567807c8'].url}} />
<image class="indexrecordbtn " src={{resList['5a6679e0-89f7-4582-a89b-116a35e9750a'].url}} /> <image class="indexrecordbtn " onTap="onTapIndexRecordBtn" src={{resList['5a6679e0-89f7-4582-a89b-116a35e9750a'].url}} />
</view> </view>
<panel <panel
showWinLists={{showWinLists}} showWinLists={{showWinLists}}
...@@ -89,6 +89,8 @@ ...@@ -89,6 +89,8 @@
onInviteTask="inviteTask" onInviteTask="inviteTask"
onGivingCard="givingCard" onGivingCard="givingCard"
onIndexDoHelp="indexDoHelp" onIndexDoHelp="indexDoHelp"
onShowPanel="showPanel"
onTapHiddenPanelEvent="hiddenPanelEvent"/> onTapHiddenPanelEvent="hiddenPanelEvent"/>
<canvas id="canvas" type="2d" onReady="onCanvasReady"></canvas> <canvas id="canvas" type="2d" onReady="onCanvasReady"></canvas>
<view a:if={{disibleAll}} class="disibleAll"></view>
</view> </view>
\ No newline at end of file
// 分享配置 // 分享配置
export const SHARE_CONFIG = { export const SHARE_CONFIG = {
title: '爱斐楼上请', title: '兑吧集卡',
desc: '积分盖楼赢锦鲤 享一年新衣', desc: '兑吧集卡',
imageUrl: 'https://isv.alibabausercontent.com/00000000/imgextra/i2/676606897/O1CN01eNrwLl20osHoB4Y7d_!!676606897-2-isvtu-00000000.png', // 分享图片URL imageUrl: 'https://isv.alibabausercontent.com/00000000/imgextra/i2/676606897/O1CN01eNrwLl20osHoB4Y7d_!!676606897-2-isvtu-00000000.png', // 分享图片URL
path: '/pages/pageshou_ye/pageshou_ye' path: '/pages/pageindexpage/pageindexpage'
}; };
// 链接配置 // 链接配置
......
...@@ -92,4 +92,23 @@ export const generateAPI = (apiList, request) => { ...@@ -92,4 +92,23 @@ export const generateAPI = (apiList, request) => {
}); });
api.fn = capiFn(apiList, request); api.fn = capiFn(apiList, request);
return api; return api;
}; };
\ No newline at end of file
/**
* 防连点
* @param {fn} fn 函数
* @param {wait} wait 时间
*/
export const throttleHandle = (fn, wait = 500) => {
let lastTime = 0
return function cb(...args) {
let nowTime = Date.now()
if(nowTime - lastTime > wait) {
fn.call(this,...args)
lastTime = nowTime
}
}
}
\ No newline at end of file
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@tbminiapp/lottie-miniapp@^0.0.4":
version "0.0.4"
resolved "http://npm.dui88.com:80/@tbminiapp%2flottie-miniapp/-/lottie-miniapp-0.0.4.tgz#60137da714d96b69b1ce60d043a6b9c1fe850391"
integrity sha1-YBN9pxTZa2mxzmDQQ6a5wf6FA5E=
"@tbmp/mp-cloud-sdk@*":
version "1.4.2"
resolved "http://npm.dui88.com:80/@tbmp%2fmp-cloud-sdk/-/mp-cloud-sdk-1.4.2.tgz#ff8f41b5d0da349e87f7e7fd0c304c3e0b7f05b4"
integrity sha1-/49BtdDaNJ6H9+f9DDBMPgt/BbQ=
events@^3.2.0:
version "3.2.0"
resolved "http://npm.dui88.com:80/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379"
integrity sha1-k7h8GPjvzUICpGGuxN/AVWtjk3k=
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