Commit a13386be authored by spc's avatar spc

Merge branch 'yd11_20200922' of gitlab2.dui88.com:wanghongyuan/new_taobao into yd11_20200922

parents 16d6ef05 96d0f052
{"code":68941424.68267184,"success":true}
\ No newline at end of file
{"success":true}
\ No newline at end of file
{
"success":true,
"data":[
{
"itemId": "111111",
"name": "labore esse ut magna",
"price": "400",
"url": "consectetur commodo occaecat",
"image": "http://dummyimage.com/120x600",
"desc": "ea est laborum in sit"
},
{
"itemId": "111111",
"name": "labore esse ut magna",
"price": "400",
"url": "consectetur commodo occaecat",
"image": "http://dummyimage.com/120x600",
"desc": "ea est laborum in sit"
},
{
"itemId": "111111",
"name": "labore esse ut magna",
"price": "400",
"url": "consectetur commodo occaecat",
"image": "http://dummyimage.com/120x600",
"desc": "ea est laborum in sit"
},
{
"itemId": "111111",
"name": "labore esse ut magna",
"price": "400",
"url": "consectetur commodo occaecat",
"image": "http://dummyimage.com/120x600",
"desc": "ea est laborum in sit"
},
{
"itemId": "111111",
"name": "labore esse ut magna",
"price": "400",
"url": "consectetur commodo occaecat",
"image": "http://dummyimage.com/120x600",
"desc": "ea est laborum in sit"
}
]
}
\ No newline at end of file
...@@ -4,6 +4,29 @@ ...@@ -4,6 +4,29 @@
"message":"ea non", "message":"ea non",
"data":{ "data":{
"list": [ "list": [
{
"useUrl":"elit non labore",
"openId":-16899820.960220918,
"_id":"Ut nulla",
"userNick":"in",
"avatar":"ullamco eu aliqua mollit eiusmod",
"activityId":"dolor",
"prizeId":"nulla enim non aliquip ipsum",
"type": 2,
"image":"https://dummyimage.com/400x400",
"name":"Duis nostrud dolore",
"drawStatus": 1,
"createTime":1602033015243,
"updateTime":1610946860060,
"addressdetail":"laboris ea tempor elit",
"area":"西湖区",
"city":"杭州市",
"phone":16270225970,
"provice":"浙江省",
"receiveName":"labore magna aliquip",
"receiveTime":1608949355424,
"expiredTime":1612654245440
},
{ {
"useUrl":"elit non labore", "useUrl":"elit non labore",
"openId":-16899820.960220918, "openId":-16899820.960220918,
...@@ -27,6 +50,52 @@ ...@@ -27,6 +50,52 @@
"receiveTime":1608949355424, "receiveTime":1608949355424,
"expiredTime":1612654245440 "expiredTime":1612654245440
}, },
{
"useUrl":"elit non labore",
"openId":-16899820.960220918,
"_id":"Ut nulla",
"userNick":"in",
"avatar":"ullamco eu aliqua mollit eiusmod",
"activityId":"dolor",
"prizeId":"nulla enim non aliquip ipsum",
"type": 3,
"image":"https://dummyimage.com/400x400",
"name":"Duis nostrud dolore",
"drawStatus": 5,
"createTime":1602033015243,
"updateTime":1610946860060,
"addressdetail":"laboris ea tempor elit",
"area":"西湖区",
"city":"杭州市",
"phone":16270225970,
"provice":"浙江省",
"receiveName":"labore magna aliquip",
"receiveTime":1608949355424,
"expiredTime":1612654245440
},
{
"useUrl":"elit non labore",
"openId":-16899820.960220918,
"_id":"Ut nulla",
"userNick":"in",
"avatar":"ullamco eu aliqua mollit eiusmod",
"activityId":"dolor",
"prizeId":"nulla enim non aliquip ipsum",
"type": 1,
"image":"https://dummyimage.com/400x400",
"name":"Duis nostrud dolore",
"drawStatus": 2,
"createTime":1602033015243,
"updateTime":1610946860060,
"addressdetail":"laboris ea tempor elit",
"area":"西湖区",
"city":"杭州市",
"phone":16270225970,
"provice":"浙江省",
"receiveName":"labore magna aliquip",
"receiveTime":1608949355424,
"expiredTime":1612654245440
},
{ {
"useUrl":"elit non labore", "useUrl":"elit non labore",
"openId":-16899820.960220918, "openId":-16899820.960220918,
...@@ -84,7 +153,7 @@ ...@@ -84,7 +153,7 @@
"type": 3, "type": 3,
"image":"https://dummyimage.com/400x400", "image":"https://dummyimage.com/400x400",
"name":"Duis nostrud dolore", "name":"Duis nostrud dolore",
"drawStatus": 3, "drawStatus": 1,
"createTime":1602033015243, "createTime":1602033015243,
"updateTime":1610946860060, "updateTime":1610946860060,
"addressdetail":"laboris ea tempor elit", "addressdetail":"laboris ea tempor elit",
...@@ -104,7 +173,7 @@ ...@@ -104,7 +173,7 @@
"avatar":"ullamco eu aliqua mollit eiusmod", "avatar":"ullamco eu aliqua mollit eiusmod",
"activityId":"dolor", "activityId":"dolor",
"prizeId":"nulla enim non aliquip ipsum", "prizeId":"nulla enim non aliquip ipsum",
"type": 4, "type": 3,
"image":"https://dummyimage.com/400x400", "image":"https://dummyimage.com/400x400",
"name":"Duis nostrud dolore", "name":"Duis nostrud dolore",
"drawStatus": 6, "drawStatus": 6,
......
{ {
"success": false, "success": true,
"code": "sit nulla labore in", "code": "sit nulla labore in",
"data":[ "data":[
{ {
"taskType":"oN6Bq", "taskType": "frontOrderGoods",
"title":"2A7h2", "title": "2A72A7h2h2",
"rewards":2, "rewards":2,
"taskRateType":2, "taskRateType":2,
"waitReceive":-13791948.109031975, "waitReceive": 1,
"status":-54118349.23389276, "status": 1,
"completeTimes":-92392435.91503823, "completeTimes": 2,
"times":"3", "times": "3",
"todayCompleteTimes":-80193158.01905021, "todayCompleteTimes":-80193158.01905021,
"itemIds":"non Duis id voluptate", "itemIds":"non Duis id voluptate",
"url":"esse Ut nulla eiusmod" "url":"esse Ut nulla eiusmod"
}, { }, {
"taskType":"T4[oj", "taskType": "invites",
"title":"Oj2ZN", "title": "Oj2ZOj2ZNN",
"rewards":2, "rewards":2,
"taskRateType":2, "taskRateType":2,
"waitReceive":-24361244.83615884, "waitReceive": 2,
"status":-93556772.20227832, "status": 1,
"completeTimes":99358061.68916574, "completeTimes": 2,
"times":"3", "times": "1",
"todayCompleteTimes":-92796921.9007521, "todayCompleteTimes":-92796921.9007521,
"itemIds":"cillum fugiat Duis pariatur Lorem", "itemIds":"cillum fugiat Duis pariatur Lorem",
"url":"dolor tempor in sed proident" "url":"dolor tempor in sed proident"
}, },
{ {
"taskType":"6MZs", "taskType": "browseGoods",
"title":"(1XhjD", "title": "(1X2A7h2hjD",
"rewards":2,
"taskRateType":2,
"waitReceive":40009903.06684077,
"status":-12612373.255133048,
"completeTimes":70433951.05683738,
"times":"3",
"todayCompleteTimes":3214292.4035636783,
"itemIds":"anim est Excepteur",
"url":"dolore labore elit Ut fugiat"
},
{
"taskType":"6MZs",
"title":"(1XhjD",
"rewards":2, "rewards":2,
"taskRateType":2, "taskRateType":2,
"waitReceive":40009903.06684077, "waitReceive": 1,
"status":-12612373.255133048, "status": 1,
"completeTimes":70433951.05683738, "completeTimes": 2,
"times":"3", "times": "3",
"todayCompleteTimes":3214292.4035636783, "todayCompleteTimes":3214292.4035636783,
"itemIds":"anim est Excepteur", "itemIds":"anim est Excepteur",
"url":"dolore labore elit Ut fugiat" "url":"dolore labore elit Ut fugiat"
}, },
{ {
"taskType":"6MZs", "taskType": "jumpLink",
"title":"(1XhjD", "title":"(1XhjD",
"rewards":2, "rewards":2,
"taskRateType":2, "taskRateType":2,
"waitReceive":40009903.06684077, "waitReceive": 2,
"status":-12612373.255133048, "status": 2,
"completeTimes":70433951.05683738, "completeTimes": 2,
"times":"3", "times": "3",
"todayCompleteTimes":3214292.4035636783, "todayCompleteTimes":3214292.4035636783,
"itemIds":"anim est Excepteur", "itemIds":"anim est Excepteur",
"url":"dolore labore elit Ut fugiat" "url":"dolore labore elit Ut fugiat"
}, },
{ {
"taskType":"6MZs", "taskType": "orderGoods",
"title":"(1XhjD", "title":"(1XhjD",
"rewards":2, "rewards":2,
"taskRateType":2, "taskRateType":2,
"waitReceive":40009903.06684077, "waitReceive": 1,
"status":-12612373.255133048, "status": 2,
"completeTimes":70433951.05683738, "completeTimes": 2,
"times":"3", "times": "3",
"todayCompleteTimes":3214292.4035636783, "todayCompleteTimes":3214292.4035636783,
"itemIds":"anim est Excepteur", "itemIds":"anim est Excepteur",
"url":"dolore labore elit Ut fugiat" "url":"dolore labore elit Ut fugiat"
}, },
{ {
"taskType":"6MZs", "taskType": "follow",
"title":"(1XhjD", "title":"(1XhjD",
"rewards":2, "rewards":2,
"taskRateType":2, "taskRateType":2,
"waitReceive":40009903.06684077, "waitReceive": 1,
"status":-12612373.255133048, "status": 1,
"completeTimes":70433951.05683738, "completeTimes": 2,
"times":"3", "times": "1",
"todayCompleteTimes":3214292.4035636783, "todayCompleteTimes":3214292.4035636783,
"itemIds":"anim est Excepteur", "itemIds":"anim est Excepteur",
"url":"dolore labore elit Ut fugiat" "url":"dolore labore elit Ut fugiat"
}, },
{ {
"taskType":"6MZs", "taskType": "member",
"title":"(1XhjD", "title":"(1XhjD",
"rewards":2, "rewards":2,
"taskRateType":2, "taskRateType":2,
"waitReceive":40009903.06684077, "waitReceive": 1,
"status":-12612373.255133048, "status": 1,
"completeTimes":70433951.05683738, "completeTimes": 2,
"times":"3", "times": "3",
"todayCompleteTimes":3214292.4035636783, "todayCompleteTimes":3214292.4035636783,
"itemIds":"anim est Excepteur", "itemIds":"anim est Excepteur",
"url":"dolore labore elit Ut fugiat" "url":"dolore labore elit Ut fugiat"
......
{
"success":false,
"data":{
"isVip":true,
"url":"dolor in aute elit"
}
}
\ No newline at end of file
{
"success": true,
"message": "领取消息"
}
\ No newline at end of file
...@@ -80,6 +80,10 @@ export default class Root extends FYGE.Container { ...@@ -80,6 +80,10 @@ export default class Root extends FYGE.Container {
this.addChild(this.scoreBoard) this.addChild(this.scoreBoard)
this.createTouchRect() this.createTouchRect()
setTimeout(() => {
this.gameStartFlag = true
}, 1000)
} }
// 开始游戏 // 开始游戏
......
...@@ -36,8 +36,8 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -36,8 +36,8 @@ export default class GoodsContainer extends FYGE.Container {
// 进入可被滑动的 掉落物 // 进入可被滑动的 掉落物
intoGoods = []; intoGoods = [];
private speed = 0.3 // 初速度 private speed = 2.5 // 初速度
private acceleratedSpeed = 0.006 // 加速度 private acceleratedSpeed = 0.01 // 加速度
constructor (root) { constructor (root) {
super() super()
...@@ -113,13 +113,15 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -113,13 +113,15 @@ export default class GoodsContainer extends FYGE.Container {
let g = this.intoGoods[0] let g = this.intoGoods[0]
g.turn = true g.turn = true
this.intoGoods.shift() this.intoGoods.shift()
if (g.dir === direction) {
this._root.gameScoreChange(g.score)
g.turnDirection(direction) g.turnDirection(direction)
} else { if (g.dir !== direction) {
if (g.wrong === 'endGame') { if (g.wrong === 'endGame') {
g.turnDirection(direction, 'gameOver') g.turnDirection(direction, 'gameOver')
} else {
this._root.gameScoreChange(g.score)
} }
} else {
this._root.gameScoreChange(g.score)
} }
} }
} }
...@@ -147,7 +149,7 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -147,7 +149,7 @@ export default class GoodsContainer extends FYGE.Container {
this.goodsArr.unshift(g) this.goodsArr.unshift(g)
this.goodsContainer.addChildAt(g, -1) this.goodsContainer.addChildAt(g, -1)
// g.zIndex = --this.goodsDeepIndex // g.zIndex = --this.goodsDeepIndex
}, 1250) }, 1000)
} }
createGoods () { createGoods () {
...@@ -239,9 +241,9 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -239,9 +241,9 @@ export default class GoodsContainer extends FYGE.Container {
// this.removeGood(index) // this.removeGood(index)
} else if (!good.turn) { } else if (!good.turn) {
let y1 = good.speed, let y1 = good.speed,
sx = 0.00168, sx = 0.003,
sy = 0.00168 sy = 0.003
good.alpha = good.alpha >= 0.7 ? 1 : good.alpha + 0.002 good.alpha = good.alpha >= 0.7 ? 1 : good.alpha + 0.01
good.scaleX += sx good.scaleX += sx
good.scaleY += sy good.scaleY += sy
good.y += y1 good.y += y1
...@@ -365,8 +367,8 @@ export default class GoodsContainer extends FYGE.Container { ...@@ -365,8 +367,8 @@ export default class GoodsContainer extends FYGE.Container {
if (line.y > 1000) { if (line.y > 1000) {
this.removeLine(index) this.removeLine(index)
} else { } else {
let y1 = line.speed + 0.00082 let y1 = line.speed + 0.0009
line.alpha = line.alpha >= 0.2 ? 0.9 : line.alpha + 0.0008 line.alpha = line.alpha >= 0.4 ? 0.9 : line.alpha + 0.0044
line.y += y1 line.y += y1
} }
} }
......
const app = getApp(); const app = getApp();
const { tbcc, cloudName, cloud, requestType } = app; const { tbcc, cloudName, cloud, requestType } = app;
const { utils: { generateAPI }, request: tbccRequest, capi } = tbcc; const { utils: { generateAPI }, request: tbccRequest, capi } = tbcc;
const request = tbccRequest({ const request = tbccRequest({
...@@ -117,9 +116,42 @@ const apiList = { ...@@ -117,9 +116,42 @@ const apiList = {
isShowLoading: false isShowLoading: false
}, },
getPrizeConfigList: {
handle: 'getPrizeConfigList',
method:'get',
isShowLoading: false
},
doBrowseGoodsTask: {
handle: 'doBrowseGoodsTask',
method:'get',
isShowLoading: false
},
// 概率抽奖 // 概率抽奖
drawLotteryPrize: { drawLotteryPrize: {
handle: 'getVipdrawLotteryPrizeInfo', handle: 'drawLotteryPrize',
method:'get',
isShowLoading: false
},
// 获取商品列表
getItemListByItemIds: {
handle: 'getItemListByItemIds',
method:'get',
isShowLoading: false
},
// 完成关注店铺
doFollowTask: {
handle: 'doFollowTask',
method:'get',
isShowLoading: false
},
// 领取完成任务奖励
receiveTaskRewards: {
handle: 'receiveTaskRewards',
method:'get', method:'get',
isShowLoading: false isShowLoading: false
}, },
......
...@@ -6,11 +6,17 @@ cloud.init({ ...@@ -6,11 +6,17 @@ cloud.init({
}); });
App({ App({
// requestType: 'cloud', // yapi,cloud: 云函数 requestType: 'cloud', // yapi,cloud: 云函数
requestType: 'yapi', // yapi,cloud: 云函数 // requestType: 'yapi', // yapi,cloud: 云函数
cloudName: 'yd', // 主云函数项目名 base clientTemplate2C cloudName: 'yd', // 主云函数项目名 base clientTemplate2C
cloud, cloud,
tbcc, tbcc,
// 店铺id
sellerId: '1818112088',
// 加入会员页面
vipUrl: '',
// 直播间页面
liveUrl: '',
// 全局数据 // 全局数据
globalData: {}, globalData: {},
...@@ -28,7 +34,7 @@ App({ ...@@ -28,7 +34,7 @@ App({
*/ */
handleQuery(query) { handleQuery(query) {
const { activityId } = query; const { activityId } = query;
this.activityId = activityId || '5f34e1c4964f9706aa7d803c'; this.activityId = activityId || '5f7294e28e6a08456786b14e';
} }
}); });
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
"pages/myprize/myprize", "pages/myprize/myprize",
"pages/index/index", "pages/index/index",
"pages/pageshop/pageshop", "pages/pageshop/pageshop",
"pages/tbccDemo/tbccDemo" "pages/tbccDemo/tbccDemo",
"pages/goodsPage/goodsPage",
"pages/turnTablePage/turnTablePage"
], ],
"window": { "window": {
"enableSkia": "true", "enableSkia": "true",
......
...@@ -32,16 +32,28 @@ ...@@ -32,16 +32,28 @@
position: absolute; position: absolute;
} }
.mission_scroll {
position: absolute;
z-index: 2;
width: 100%;
height: 920rpx;
box-sizing: border-box;
left: 0;
bottom: 20rpx;
}
.mission_block { .mission_block {
width: 702rpx; width: 702rpx;
height: 162rpx; height: 162rpx;
position: absolute; /* position: absolute; */
left: 24rpx; margin: 20rpx auto 0;
/* left: 24rpx; */
background: #fff; background: #fff;
border-radius: 10rpx; border-radius: 10rpx;
position: relative;
} }
.mission_block_5 { /* .mission_block_5 {
top: 948rpx; top: 948rpx;
} }
.mission_block_4 { .mission_block_4 {
...@@ -55,7 +67,7 @@ ...@@ -55,7 +67,7 @@
} }
.mission_block_1 { .mission_block_1 {
top: 208rpx; top: 208rpx;
} } */
.mission_icon { .mission_icon {
width: 100rpx; width: 100rpx;
...@@ -108,6 +120,18 @@ ...@@ -108,6 +120,18 @@
background: linear-gradient(to right, #ddc59f, #d6b682 ); background: linear-gradient(to right, #ddc59f, #d6b682 );
} }
.mission_invite_tips {
width: 350rpx;
height: 40rpx;
line-height: 40rpx;
text-align: center;
position: absolute;
bottom: -46rpx;
left: -100rpx;
font-size: 16rpx;
color: rgba(51, 51, 51, 1);
}
.mission_btn_active { .mission_btn_active {
background: linear-gradient(to right, #da5d7b, #ffabab ); background: linear-gradient(to right, #da5d7b, #ffabab );
} }
......
...@@ -9,71 +9,24 @@ ...@@ -9,71 +9,24 @@
trap-scroll="{{true}}" trap-scroll="{{true}}"
> >
<view class="mission_block mission_block_1" a:for="{{missionsList}}" a:for-item="item"> <view class="mission_block mission_block" a:for="{{missionsList}}" a:for-item="item">
<view class="ju_xing14"></view> <view class="ju_xing14"></view>
<image class="mission_icon" src="{{resList['95dc5f5a-d1b2-4994-b1bb-e45ba9e53914'].url}}" /> <image class="mission_icon" src="{{item.iconUrl}}" />
<view class="mission_content"> <view class="mission_content">
<view class="mission_title">浏览制定商品30s</view> <view class="mission_title">{{item.taskNameActiv}}</view>
<view class="mission_describe">乐园门票 <text class="mission_describe_hightlight">+1</text></view> <view class="mission_describe">乐园门票 <text class="mission_describe_hightlight">+{{item.waitReceive}}</text></view>
</view> </view>
<view class="mission_btn mission_btn_active" onTap="gotoSeeGoods"> <view class="mission_btn {{ item.status === 1 ? 'mission_btn_active' : '' }}"
<text class="mission_btn_text">去浏览</text> data-type="{{item.taskType}}" data-status="{{item.status}}" data-itemIds="{{item.itemIds}}" onTap="doTaskByType">
</view> <text a:if="{{item.status === 1}}" class="mission_btn_text">{{item.btnText}}</text>
</view> <text a:if="{{item.status === 2}}" class="mission_btn_text">待领取</text>
<text a:if="{{item.status === 3}}" class="mission_btn_text">已完成</text>
</scroll-view>
<view class="mission_block mission_block_2">
<view class="ju_xing19" />
<image class="mission_icon" src="{{resList['d2f81084-e23b-47f0-a016-eb590b6b7af2'].url}}" />
<view class="mission_content">
<view class="mission_title">观看直播1分钟</view>
<view class="mission_describe">乐园门票 <text class="mission_describe_hightlight">+1</text></view>
</view>
<view class="mission_btn" onTap="gotoSeeLive">
<text class="mission_btn_text">去观看</text>
</view>
</view>
<view class="mission_block mission_block_3">
<view class="ju_xing114"></view>
<image class="mission_icon" src="{{resList['56f68e31-8eba-42ce-aafa-0ad9b0bf9f68'].url}}" />
<view class="mission_content">
<view class="mission_title">完成下单订单</view>
<view class="mission_describe">乐园门票 <text class="mission_describe_hightlight">+1</text></view>
</view>
<view class="mission_btn" onTap="gotoBuy">
<text class="mission_btn_text">去下单</text>
</view>
</view>
<view class="mission_block mission_block_4"> <view a:if="{{item.taskType === 'invites'}}" class="mission_invite_tips">{{item.completeTimes}}个好友为你助力成功</view>
<view class="ju_xing118"></view>
<image class="mission_icon" src="{{resList['2eb24d59-d131-4dfb-9dfe-7b9f61bd4293'].url}}" />
<view class="mission_content">
<view class="mission_title">关注店铺</view>
<view class="mission_describe">乐园门票 <text class="mission_describe_hightlight">+1</text></view>
</view>
<view class="mission_btn" onTap="gotoFollow">
<text class="mission_btn_text">已关注</text>
</view>
</view>
<view class="mission_block mission_block_5">
<image class="mission_icon" src="{{resList['7b839a18-3277-41aa-9f41-0c3876651bdd'].url}}" />
<view class="mission_content">
<view class="mission_title">加入店铺会员</view>
<view class="mission_describe">乐园门票 <text class="mission_describe_hightlight">+1</text></view>
</view>
<view class="mission_btn" onTap="gotoJoin">
<text class="mission_btn_text">已关注</text>
</view> </view>
</view> </view>
</scroll-view>
<image class="mission_close_btn" onTap="onModalClose" src="{{resList['4abc8bb6-5779-49ad-84b4-b4ade4f51fcb'].url}}" /> <image class="mission_close_btn" onTap="onModalClose" src="{{resList['4abc8bb6-5779-49ad-84b4-b4ade4f51fcb'].url}}" />
......
import API from '../../api'; import API from '../../api';
const app = getApp(); const app = getApp();
const { tbcc } = app; const { tbcc } = app;
const { commonToast, getAuthUserInfo, navigateToOutside, getSystemInfo } = tbcc.tb; const { commonToast, getAuthUserInfo, navigateToOutside, getSystemInfo, ConsoleStyle, favorShop } = tbcc.tb;
const { SHARE_CONFIG, REDIRECT_URL } = tbcc.constants; const { SHARE_CONFIG, REDIRECT_URL } = tbcc.constants;
import resList from '../../resconfig/resList' import resList from '../../resconfig/resList'
const TASK_ENUM = {
"moneyGoods": {
"title": "支付定金",
"iconUrl": "//yun.duiba.com.cn/spark/assets/yd_支付定金.cbb7b5adc6a8b6ac87692f70d91bd7f0f184dd14.png",
"btnText": "去支付"
},
"invites": {
"title": "邀请好友",
"iconUrl": "//yun.duiba.com.cn/spark/assets/yd_邀请好友png.d1c54fe727c0e66e74a5d5614bfbb09b0422f83d.png",
"btnText": "去邀请"
},
"browseGoods": {
"title": "浏览指定商品30s",
"iconUrl": "//yun.duiba.com.cn/spark/assets/43081f4ee9aed1c4d89d9e0882b2b5210a93ef17.png",
"btnText": "去浏览"
},
"jumpLink": {
"title": "观看直播",
"iconUrl": "//yun.duiba.com.cn/spark/assets/d86c83dd677d64c43761cc1d7d3ea6669a4e40ac.png",
"btnText": "去观看"
},
"orderGoods": {
"title": "完成下单商品",
"iconUrl": "//yun.duiba.com.cn/spark/assets/43081f4ee9aed1c4d89d9e0882b2b5210a93ef17.png",
"btnText": "去下单"
},
"follow": {
"title": "关注店铺",
"iconUrl": "//yun.duiba.com.cn/spark/assets/1627a54ad359730603de6ae04bd24e46227f5bf2.png",
"btnText": "去关注"
},
"member": {
"title": "加入店铺会员",
"iconUrl": "//yun.duiba.com.cn/spark/assets/070961e7825588d4502a5032474b7e01f14f2686.png",
"btnText": "去加入"
},
}
Component({ Component({
data: { data: {
resList: resList, resList: resList,
...@@ -15,39 +53,156 @@ Component({ ...@@ -15,39 +53,156 @@ Component({
}, },
didMount() { didMount() {
if (this.props.missionsList.length) this.setData({ missionsList: this.props.missionsList }) // if (this.props.missionsList.length) this.setData({ missionsList: this.props.missionsList })
this.getMissionList()
}, },
didUpdate(prevProps, prevData) { didUpdate(prevProps, prevData) {
if (this.data.missionsList.length !== prevData.missionsList.length) { // if (this.data.missionsList.length !== prevData.missionsList.length) {
this.setData({ missionsList: this.props.missionsList }) // this.setData({ missionsList: this.props.missionsList })
} // }
}, },
methods: { methods: {
// 获取任务列表
getMissionList () {
API.getTaskList({activityId: app.activityId})
.then(res => {
const { success, message, data } = res
if (!success) { console.warn(res); commonToast(res && res.message) }
else {
console.log('%c--------任务列表\n' + '-----yd.getTaskList\n', ConsoleStyle, data)
let arr1 = []
let arr2 = []
let arr3 = []
data.forEach((item, index) => {
item.itemIds = item.itemIds ? item.itemIds : '11111'
item.iconUrl = TASK_ENUM[item.taskType].iconUrl
item.taskNameActiv = TASK_ENUM[item.taskType].title
item.btnText = TASK_ENUM[item.taskType].btnText
if (item.status === 3) {
arr1.push(item)
} else if (item.status === 2) {
arr2.push(item)
} else {
arr3.push(item)
}
})
arr3.push(...arr2, ...arr1)
this.setData({ missionsList: arr3 })
}
})
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
},
onModalClose() { onModalClose() {
const { onModalClose } = this.props; const { onModalClose } = this.props;
onModalClose && onModalClose(); onModalClose && onModalClose();
}, },
gotoSeeGoods() { doTaskByType (e) {
let ds = e.currentTarget.dataset
if (ds.status === 1) {
switch (ds.type) {
case "moneyGoods":
this.gotoFrontOrderGoods(ds.itemIds)
break;
case "invites":
this.gotoInvites()
break;
case "browseGoods":
this.gotoBrowseGoods(ds.itemIds)
break;
case "jumpLink":
this.gotoJumpLink()
break;
case "orderGoods":
this.gotoOrderGoods(ds.itemIds)
break;
case "follow":
this.gotoFollow()
break;
case "member":
this.gotoMember()
break;
default:
break;
}
} else if (ds.status === 2) {
API.receiveTaskRewards({activityId: app.activityId, taskType: ds.type})
.then(res => {
const { success, message, data } = res
if (!success) { console.warn(res); commonToast(res && res.message) }
else {
console.log('%c--------领取成功\n' + '-----yd.receiveTaskRewards\n', ConsoleStyle, data)
this.getMissionList()
}
})
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
} else if (ds.status === 3) {
commonToast('该任务您已经完成了哦')
}
}, },
gotoSeeLive() { // 支付定金
gotoFrontOrderGoods(itemIds) {
console.log(itemIds)
my.navigateTo({url: `../../pages/goodsPage/goodsPage?taskType=frontOrderGoods&itemIds=${itemIds}`})
},
// 邀请好友
gotoInvites() {
my.showSharePanel()
}, },
gotoBuy() { // 浏览商品倒计时
gotoBrowseGoods(itemIds) {
my.navigateTo({url: `../../pages/goodsPage/goodsPage?taskType=browseGoods&itemIds=${itemIds}`})
},
// 看直播
gotoJumpLink() {
navigateToOutside(app.liveUrl)
}, },
gotoFollow() { // 完成下单商品
gotoOrderGoods (itemIds) {
my.navigateTo({url: `../../pages/goodsPage/goodsPage?taskType=orderGoods&itemIds=${itemIds}`})
},
// 关注店铺
async gotoFollow () {
let res = await favorShop(app.sellerId)
if (res) {
API.doFollowTask({activityId: app.activityId})
.then(res => {
const { success, message, data } = res
if (!success) { console.warn(res); commonToast(res && res.message) }
else {
console.log('%c--------完成关注店铺\n' + '-----yd.doFollowTask\n', ConsoleStyle, data)
commonToast('完成关注店铺')
this.getMissionList()
}
})
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
}
},
// 成为会员
gotoMember () {
navigateToOutside(app.vipUrl)
}, },
gotoJoin() { // 跳转商品详情页
async goToGoodsDetail(e) {
clearInterval(this.timer)
this.setData({
percent: this.data.usePercent,
})
const { itemId } = e.target.dataset.item
await openDetail(String(itemId))
}, },
} }
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
.huo_de_ya_dun_bi { .huo_de_ya_dun_bi {
width: 100%; width: 100%;
height: 32rpx; height: 32rpx;
line-height: 32rpx; line-height: 42rpx;
opacity: 1; opacity: 1;
left: 0; left: 0;
top: 230rpx; top: 230rpx;
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
<text class="kan_shi_pin_jiang_li">{{title}}</text> <text class="kan_shi_pin_jiang_li">{{title}}</text>
<view class="flex_content"> <view class="flex_content">
<view class="huo_de_ya_dun_bi">{{content}}</view> <view class="huo_de_ya_dun_bi">
<text decode="{{true}}">{{content}}</text>
</view>
</view> </view>
<image class="commonT1_btn" src="{{btnImg}}" mode="aspectFill" onTap="onModalConfirm"/> <image class="commonT1_btn" src="{{btnImg}}" mode="aspectFill" onTap="onModalConfirm"/>
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
.jiang_li_dan_chuang { .jiang_li_dan_chuang {
width: 500rpx; width: 500rpx;
height: 523rpx; height: 668rpx;
opacity: 1; opacity: 1;
left: 125rpx; left: 125rpx;
top: calc(50% - 261rpx); top: calc(50% - 334rpx);
position: absolute; position: absolute;
} }
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
height: 88rpx; height: 88rpx;
opacity: 1; opacity: 1;
left: 31rpx; left: 31rpx;
bottom: 36rpx; bottom: 30rpx;
position: absolute; position: absolute;
} }
.ji_xu_guan_kan { .ji_xu_guan_kan {
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
height: 88rpx; height: 88rpx;
opacity: 1; opacity: 1;
left: 262rpx; left: 262rpx;
bottom: 36rpx; bottom: 30rpx;
position: absolute; position: absolute;
} }
.kan_shi_pin_jiang_li { .kan_shi_pin_jiang_li {
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
line-height: 56rpx; line-height: 56rpx;
opacity: 1; opacity: 1;
left: 0; left: 0;
top: 100rpx; top: 70rpx;
position: absolute; position: absolute;
display: inline-block; display: inline-block;
font-size: 50rpx; font-size: 50rpx;
...@@ -67,11 +67,11 @@ ...@@ -67,11 +67,11 @@
} }
.huo_de_ya_dun_bi { .huo_de_ya_dun_bi {
width: 100%; width: 100%;
height: 32rpx; height: 42rpx;
line-height: 32rpx; line-height: 32rpx;
opacity: 1; opacity: 1;
left: 0; left: 0;
top: 230rpx; top: 150rpx;
text-align: center; text-align: center;
position: absolute; position: absolute;
font-size: 32rpx; font-size: 32rpx;
...@@ -99,3 +99,18 @@ ...@@ -99,3 +99,18 @@
top: -50rpx; top: -50rpx;
position: absolute; position: absolute;
} }
.commonT2-modal_rewards {
width: 240rpx;
height: 240rpx;
top: 222rpx;
left: 130rpx;
position: absolute;
z-index: 5;
}
.commonT2-modal_rewards_image {
width: 100%;
height: 100%;
}
...@@ -3,17 +3,23 @@ ...@@ -3,17 +3,23 @@
<view class="jiang_li_dan_chuang"> <view class="jiang_li_dan_chuang">
<image class="dan_chuang_bei_jing2" src="{{resList['7203516e-8791-4974-955e-c8a044e16c80'].url}}"/> <image class="dan_chuang_bei_jing2" src="//yun.duiba.com.cn/spark/assets/弹窗背景.55cabcd27f981e4a20db75b0b9b34069ca196b3a.png"/>
<image class="qu_chou_jiang" src="{{resList['b71e74b5-16ad-4260-a382-8cf200e9e5a7'].url}}" />
<image class="ji_xu_guan_kan" src="{{resList['8da146cc-69cd-41fa-bed3-e7194ce037aa'].url}}" />
<image onTap="onModalOne" class="qu_chou_jiang" src="{{btnImg1}}" />
<image onTap="onModalTwo" class="ji_xu_guan_kan" src="{{btnImg2}}" />
<text class="kan_shi_pin_jiang_li">{{title}}</text> <text class="kan_shi_pin_jiang_li">{{title}}</text>
<view class="flex_content"> <view class="flex_content">
<view class="huo_de_ya_dun_bi">{{detail}}</view> <view class="huo_de_ya_dun_bi" style="top: {{ rewardsImg ? '150rpx' : '270rpx'}}">
<view class="tu_ceng40" a:if="{{}}"> <text decode="{{true}}">{{content}}</text>
<image class="flex_content_image" src="{{}}" /> </view>
<text>+{{coins}}</text>
</view> </view>
<view a:if="{{rewardsImg}}" class="commonT2-modal_rewards">
<image class="commonT2-modal_rewards_image" src="{{rewardsImg}}" mode="aspectFill" />
</view> </view>
<image <image
......
...@@ -4,36 +4,37 @@ Component({ ...@@ -4,36 +4,37 @@ Component({
data: { data: {
resList: resList, resList: resList,
title: '', title: '',
detail: '', content: '',
hasYDCoin: false, coins: 0,
coins: 0 btnImg1: '',
btnImg2: '',
rewardsImg: ''
}, },
props: { props: {
title: '', title: '',
detail: '', content: '',
hasYDCoin: false,
coins: 0 coins: 0
}, },
didMount () { didMount () {
this.setData({ this.setData({
title: this.props.data.title, title: this.props.data.title,
detail: this.props.data.detail, content: this.props.data.content,
hasYDCoin: this.props.data.hasYDCoin btnImg1: this.props.data.btnImg1,
btnImg2: this.props.data.btnImg2,
rewardsImg: this.props.data.rewardsImg
}) })
}, },
didUpdate (prevProps, prevData) { didUpdate (prevProps, prevData) {
if (this.props.data.title !== prevData.data.title || this.props.data.detail !== prevData.data.detail) { if (this.props.data.title !== prevData.title || this.props.data.content !== prevData.content) {
this.setData({ this.setData({
title: this.props.data.title, title: this.props.data.title,
detail: this.props.data.detail content: this.props.data.content,
}) btnImg1: this.props.data.btnImg1,
} btnImg2: this.props.data.btnImg2,
if (this.props.data.hasYDCoin !== prevData.data.hasYDCoin) { rewardsImg: this.props.data.rewardsImg
this.setData({
hasYDCoin: this.props.data.hasYDCoin
}) })
} }
}, },
...@@ -43,9 +44,13 @@ Component({ ...@@ -43,9 +44,13 @@ Component({
const { onModalClose } = this.props; const { onModalClose } = this.props;
onModalClose && onModalClose(); onModalClose && onModalClose();
}, },
onModalConfirm() { onModalOne () {
const { onModalConfirm } = this.props; const { onModalOne } = this.props;
onModalConfirm && onModalClose(); onModalOne && onModalOne();
} },
onModalTwo () {
const { onModalTwo } = this.props;
onModalTwo && onModalTwo();
},
} }
}); });
\ No newline at end of file
...@@ -18,8 +18,8 @@ Component({ ...@@ -18,8 +18,8 @@ Component({
data: {}, data: {},
props: { props: {
percent: 10, percent: 10,
usePercent:0, usePercent: 30,
countTime: 10, countTime: 30,
styleType: '01',//browse_txt_bg count_bg_02 styleType: '01',//browse_txt_bg count_bg_02
data: { data: {
text: '浏览商品10s,获得任务奖励', text: '浏览商品10s,获得任务奖励',
...@@ -33,7 +33,9 @@ Component({ ...@@ -33,7 +33,9 @@ Component({
} }
}, },
didMount() { }, didMount() { },
didUpdate() {}, didUpdate() {
this.setData({countTime: 30 - this.props.usePercent})
},
didUnmount() { }, didUnmount() { },
methods: {}, methods: {},
}); });
...@@ -6,31 +6,44 @@ ...@@ -6,31 +6,44 @@
bottom: 0; bottom: 0;
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
/* background: url('//yun.dui88.com/taobaomini/clientCTestgoods_bg@2x.png') no-repeat; */
background-size: 750rpx 1624rpx; background-size: 750rpx 1624rpx;
overflow: hidden; overflow: hidden;
z-index: 20; z-index: 20;
} }
.goods-modal-container__title {
.goods-modal-container_bg {
width: 750rpx; width: 750rpx;
height: 120rpx; height: 1624rpx;
margin: 29rpx 0 11rpx; position: absolute;
top: 0;
left: 0;
z-index: 0;
} }
.goods-modal-container__banner { .goods-modal-container__banner {
width: 750rpx; width: 750rpx;
height: 400rpx; height: 38rpx;
margin-bottom: 30rpx; margin: 30rpx 0 12rpx;
background: #E1E1E1; background: transparent;
position: absolute;
top: 90rpx;
}
.container__banner_image {
height: 40rpx;
width: 613rpx;
display: block;
margin: 0 auto;
} }
.goods-modal-container__content { .goods-modal-container__content {
position: absolute; position: absolute;
top: 190rpx; top: 160rpx;
left: 0; left: 0;
bottom: 0; bottom: 0;
padding-top: 41rpx; padding-top: 41rpx;
padding: 41rpx 25rpx 0; padding: 41rpx 33rpx 0;
width: 750rpx; width: 750rpx;
/* height: inherit; */
} }
.goods-modal-container__scroll { .goods-modal-container__scroll {
height: 100%; height: 100%;
...@@ -41,36 +54,39 @@ ...@@ -41,36 +54,39 @@
flex-wrap: wrap; flex-wrap: wrap;
} }
.goods-modal-container__content-item { .goods-modal-container__content-item {
width: 340rpx; width: 320rpx;
height: 510rpx; height: 380rpx;
background: #fff; background: #fef5f8;;
margin-bottom: 20rpx; margin-bottom: 35rpx;
border-radius: 12rpx;
overflow: hidden;
box-shadow: 0 0 20rpx rgba(251, 171, 228, .55);
} }
.goods-modal-container__content-item:nth-child(even) { .goods-modal-container__content-item:nth-child(even) {
margin-left: 20rpx; margin-left: 40rpx;
} }
.goods-modal-container__content-item__img { .goods-modal-container__content-item__img {
width: 340rpx; width: 320rpx;
height: 340rpx; height: 250rpx;
background: #E1E1E1;
} }
.goods-modal-container__content-item__img image { .goods-modal-container__content-item__img image {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #fff;
} }
.goods-modal-container__content-item__name { .goods-modal-container__content-item__name {
margin: 25rpx 0 31rpx 21rpx; margin: 25rpx 0 20rpx 21rpx;
width:310rpx; width:310rpx;
height:60rpx; height:30rpx;
font-size:24rpx; font-size: 20rpx;
font-family:PingFang SC; font-family:PingFang SC;
font-weight:400; font-weight:400;
color:rgba(24,24,24,1); color:#6b6b6b;
line-height:30rpx; line-height:30rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.goods-modal-container__content-item__price { .goods-modal-container__content-item__price {
...@@ -82,7 +98,8 @@ ...@@ -82,7 +98,8 @@
font-size:32rpx; font-size:32rpx;
font-family:PingFang SC; font-family:PingFang SC;
font-weight:600; font-weight:600;
color:rgba(255,42,0,1); color: #ef525f;
font-size: bold;
} }
.goods-modal-container__content-item__price-num text { .goods-modal-container__content-item__price-num text {
font-size: 24rpx; font-size: 24rpx;
......
<view class="goods-modal-container" style="{{{'background':`url(${task.image.bg}) no-repeat`}}}"> <view class="goods-modal-container">
<view a:if="{{task.type == '01'}}" <image class="goods-modal-container_bg" src="{{task.image.bg}}"/>
style="{{{'background':`url(${task.image.title}) no-repeat`,'backgroundSize': '100% 100%'}}}" class="goods-modal-container__title"></view> <view class="goods-modal-container__banner">
<view a:else class="goods-modal-container__banner" style="{{{'background':`url(${task.image.banner}) no-repeat`,'backgroundSize': '100% 100%','height':task.bannerHeight+'rpx'}}}"></view> <image class="container__banner_image" src="{{task.image.banner}}" />
<view class="goods-modal-container__content" style="{{{'top':task.type == '02'?task.bannerHeight+'rpx':'149rpx'}}}"> </view>
<view class="goods-modal-container__content">
<scroll-view scroll-y="{{true}}" class="goods-modal-container__scroll"> <scroll-view scroll-y="{{true}}" class="goods-modal-container__scroll">
<view class="goods-modal-container__content-list"> <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" a:for="{{goodsList}}" a:for-item="item">
<view class="goods-modal-container__content-item__img" data-item="{{item}}" onTap="goToGoodsDetail"> <view class="goods-modal-container__content-item__img" data-item="{{item}}" onTap="goToGoodsDetail">
<image mode="scaleToFill" src="{{item.image}}"/> <image mode="aspectFill" src="{{item.image}}"/>
</view> </view>
<view class="goods-modal-container__content-item__name" style="{{{'color':task.color}}}">{{item.name}}</view> <view class="goods-modal-container__content-item__name" style="{{{'color':task.color}}}">{{item.name}}</view>
<view class="goods-modal-container__content-item__price"> <view class="goods-modal-container__content-item__price">
<view class="goods-modal-container__content-item__price-num"><text>¥</text>{{item.price}}</view> <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> </view>
</view> </view>
......
...@@ -21,7 +21,6 @@ Component({ ...@@ -21,7 +21,6 @@ Component({
itemId: '617724147979,617724563528,617300295119,614139753189', itemId: '617724147979,617724563528,617300295119,614139753189',
taskType: 'browseGoods', taskType: 'browseGoods',
type: '02', type: '02',
bannerHeight: 430,
image: { image: {
bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png', bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
banner: '//yun.dui88.com/taobaomini/clientCTest/goods_banner@2x.png', banner: '//yun.dui88.com/taobaomini/clientCTest/goods_banner@2x.png',
...@@ -34,31 +33,31 @@ Component({ ...@@ -34,31 +33,31 @@ Component({
}, },
onCompleteTask: () => {} onCompleteTask: () => {}
}, },
didMount() { didMount() {
const { taskType } = this.props.task const { taskType } = this.props.task
this.setData({ isFlag: this.props.isBackFlag }) this.setData({ isFlag: this.props.isBackFlag })
console.log(this.props.goodsList)
if(taskType == 'browseGoods') { if(taskType == 'browseGoods') {
this.browseGoodsTimes() this.browseGoodsTimes()
} }
}, },
didUpdate(prevProps,prevData) { didUpdate(prevProps,prevData) {
if(prevData.isFlag && prevProps.isBackFlag != prevData.isFlag) { if(prevData.isFlag && prevProps.isBackFlag != prevData.isFlag) {
console.log(3) // console.log(3)
if(!this.timer) { if(!this.timer) {
this.setData({ usePercent: this.data.percent }) this.setData({ usePercent: this.data.percent })
this.browseGoodsTimes() this.browseGoodsTimes()
console.log(10 - this.usePercent) console.log(30 - this.usePercent)
} }
} }
}, },
didUnmount() { didUnmount() {
clearTimeout(this.timer) clearTimeout(this.timer)
}, },
methods: { methods: {
/** // 跳转商品详情页
* 跳转商品详情页
*/
async goToGoodsDetail(e) { async goToGoodsDetail(e) {
clearInterval(this.timer) clearInterval(this.timer)
this.setData({ this.setData({
...@@ -68,9 +67,8 @@ Component({ ...@@ -68,9 +67,8 @@ Component({
const { itemId } = e.target.dataset.item const { itemId } = e.target.dataset.item
await openDetail(String(itemId)) await openDetail(String(itemId))
}, },
/**
* 收藏商品 // 收藏商品
*/
async goToCollectGoods(e) { async goToCollectGoods(e) {
const { itemId, collected } = e.target.dataset.item const { itemId, collected } = e.target.dataset.item
const { taskType } = this.props.task const { taskType } = this.props.task
...@@ -80,9 +78,8 @@ Component({ ...@@ -80,9 +78,8 @@ Component({
this.props.onCompleteTask(taskType, itemId) this.props.onCompleteTask(taskType, itemId)
} }
}, },
/**
* 浏览商品倒计时 // 浏览商品倒计时
*/
browseGoodsTimes() { browseGoodsTimes() {
const { taskType } = this.props.task const { taskType } = this.props.task
...@@ -90,7 +87,7 @@ Component({ ...@@ -90,7 +87,7 @@ Component({
this.setData({ this.setData({
usePercent: this.data.usePercent + 1 usePercent: this.data.usePercent + 1
}, () => { }, () => {
if (this.data.usePercent >= 10) { if (this.data.usePercent >= 30) {
console.log(this.data.usePercent) console.log(this.data.usePercent)
this.props.onCompleteTask(taskType) this.props.onCompleteTask(taskType)
clearInterval(this.timer) clearInterval(this.timer)
......
...@@ -24,15 +24,29 @@ ...@@ -24,15 +24,29 @@
background-size: 100% 100%; background-size: 100% 100%;
} }
.my-prize-page .my-prize-list { .my-prize-list-content {
position: absolute;
top: 210rpx;
left: 0;
bottom: 0;
width: 750rpx;
}
.my-prize-list {
width: 100%; width: 100%;
height: auto; height: 100%;
} }
.my-prize-page .my-prize-empty { .my-prize-page .my-prize-empty {
text-align: center; text-align: center;
color: #fff; color: gray;
margin-top: 30rpx; margin-top: 60rpx;
font-size: 36rpx;
font-weight: bold;
position: absolute;
z-index: 100;
width: 100%;
text-align: center;
} }
.my-prize-page .my-prize-item { .my-prize-page .my-prize-item {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<view class="my-prize-wrap"> <view class="my-prize-wrap">
<view class="my-prize-label"></view> <view class="my-prize-label"></view>
<view class="my-prize-list-content">
<view class="my-prize-list" a:if="{{myPrizeList && myPrizeList.length > 0}}"> <scroll-view scroll-y="{{true}}" class="my-prize-list" a:if="{{myPrizeList && myPrizeList.length > 0}}">
<view class="my-prize-item" a:for="{{myPrizeList}}"> <view class="my-prize-item" a:for="{{myPrizeList}}">
...@@ -31,15 +31,18 @@ ...@@ -31,15 +31,18 @@
<!-- 实物填写地址 --> <!-- 实物填写地址 -->
<image a:if="{{item.type === PRIZE_TYPE_MAP.ENTITY}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.addressBth}}" /> <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}}" /> <image a:else onTap="handleClick" data-item="{{item}}" src="{{task.image.jj}}" />
</block> </block>
<!-- 处理中 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.DEALING}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.doOptions}}" />
<!-- 已领取 --> <!-- 已领取 -->
<block a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.SUCCESS}}"> <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:if="{{item.type === PRIZE_TYPE_MAP.ENTITY}}" onTap="handleView" data-item="{{item}}" src="{{task.image.logisticsBth}}" />
<!-- 优惠券去使用 --> <!-- 优惠券去使用 -->
<image a:else data-item="{{item}}" src="{{task.image.gotBtn}}" /> <image a:else data-item="{{item}}" src="{{task.image.hasGetBtn}}" />
<!-- <image a:else onTap="handleTouse" data-item="{{item}}" src="{{task.image.useBtn}}" /> --> <!-- <image a:else onTap="handleTouse" data-item="{{item}}" src="{{task.image.useBtn}}" /> -->
</block> </block>
...@@ -54,10 +57,11 @@ ...@@ -54,10 +57,11 @@
</view> </view>
</view> </view>
</view> </scroll-view>
</view>
<view a:if="{{myPrizeList && myPrizeList.length === 0}}" class="my-prize-empty">暂无奖品</view> <view a:if="{{!myPrizeList.length}}" class="my-prize-empty">暂无奖品</view>
</view> </view>
<logistics-modal a:if="{{isLogistic}}" prizeItem="{{currentPrize}}" onCloseModal="closeLogisticModal" task="{{task.logisticsImage}}"/> <logistics-modal a:if="{{isLogistic}}" prizeItem="{{currentPrize}}" onCloseModal="closeLogisticModal" task="{{task.logisticsImage}}"/>
</view> </view>
\ No newline at end of file
...@@ -18,14 +18,20 @@ ...@@ -18,14 +18,20 @@
.rule-modal__container { .rule-modal__container {
position: absolute; position: absolute;
width: 500rpx; width: 470rpx;
height: 600rpx; height: 524rpx;
background: #4eafd7;
background-size: 100% 100%; background-size: 100% 100%;
left: 50%; left: calc(50% - 235rpx);
top: 50%; top: calc(50% - 262rpx);
margin-left: -250rpx; }
margin-top: -300rpx;
.rule-modal__container_bgimage {
width: 100%;
left: 0;
top: 0;
height: 100%;
position: absolute;
z-index: 0;
} }
.rule-modal__bd { .rule-modal__bd {
...@@ -38,15 +44,42 @@ ...@@ -38,15 +44,42 @@
font-size: 24rpx; font-size: 24rpx;
color: #fff; color: #fff;
line-height: 1.5; line-height: 1.5;
z-index: 10;
overflow: hidden;
}
.rule-modal__bd_title {
color: #f26267;
font-size: 32rpx;
font-weight: bold;
text-align: center;
width: 100%;
margin-top: 44rpx;
line-height: 66rpx;
height: 66rpx;
} }
.rule-modal__bd_content {
color: #c85249;
font-size: 24rpx;
margin-top: 16rpx;
line-height: 1.26em;
height: 330rpx;
overflow: scroll;
}
.rule-modal__close { .rule-modal__close {
position: absolute; position: absolute;
right: -20rpx; right: -20rpx;
top: -80rpx; top: -40rpx;
height: 86rpx; height: 60rpx;
width: 86rpx; width: 60rpx;
background: url('../../assets/modal_close_btn.png') center center no-repeat;
background-size: 48rpx 48rpx; background-size: 48rpx 48rpx;
z-index: 9; z-index: 9;
} }
.rule-modal__close_image {
width: 60rpx;
height: 60rpx;
}
<view class="rule-modal"> <view class="rule-modal">
<view class="rule-modal__shade modal-animate-fade-in" /> <view class="rule-modal__shade modal-animate-fade-in" />
<view class="rule-modal__container modal-animate-zoom-in"> <view class="rule-modal__container modal-animate-zoom-in">
<view class="rule-modal__close" onTap="onModalClose" /> <image class="rule-modal__container_bgimage" src="//yun.duiba.com.cn/spark/assets/弹窗规则.10abd02fedc22a876f44f383a250c86f9b4466d6.png" mode="aspectFill" />
<view class="rule-modal__close" onTap="onModalClose">
<image class="rule-modal__close_image" src="//yun.duiba.com.cn/spark/assets/弹窗2关闭.478515dc464257d3f3e7c09b760b30e35d439a20.png" mode="aspectFill" />
</view>
<view class="rule-modal__bd"> <view class="rule-modal__bd">
<slot /> <view class="rule-modal__bd_title">活动规则</view>
<view class="rule-modal__bd_content">
<text decode="{{true}}">{{text}}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
Component({ Component({
data: {
text: ''
},
props: {
text: ''
},
didMount () {
this.setData({text: this.props.text})
},
didUpdate() {
this.setData({text: this.props.text})
},
methods: { methods: {
onModalClose() { onModalClose() {
const { onModalClose } = this.props; const { onModalClose } = this.props;
......
import API from './api';
//埋点
export function clickStat (activityId, type) {
API.clickStat({activityId: activityId, type: type})
.then(res => {
const { success, message, data } = res
if (!success) { console.warn(res); commonToast(res && res.message) }
else console.log(`%c打点成功--${type}`, 'color:#e06a82;font-size:12px;font-weight:bold;text-shadow:1px 1px rgba(0,0,0,0.2)')
})
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
}
\ No newline at end of file
<view class="goodsPage">
<goods-modal
isBackFlag="{{isBackFlag}}"
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 { openDetail, collectGoods, checkGoodsCollectedStatus, commonToast, ConsoleStyle } = tbcc.tb;
import API from '../../api';
Page({
data: {
query: {},
task: {},
isBackFlag: 1,
goodsList: [],
taskType: ''
},
onLoad(query) {
this.query = query || {}
// query: frontOrderGoods, browseGoods, orderGoods
if (!query) query = 'browseGoods'
this.setData({ taskType: query })
this.init()
},
onShow() {
//重新回到页面开启倒计时
this.setData({ isBackFlag: Math.floor((Math.random() * 100)) == this.data.isBackFlag ? 101 : Math.floor((Math.random() * 100)) })
},
init() {
let { itemId, taskType } = this.query
taskType = taskType ? taskType : 'browseGoods'
let banner
if (taskType === 'frontOrderGoods') banner = '//yun.duiba.com.cn/spark/assets/yd_title支付定金.ca58631100ce3b73a4a8b1cff3c1bad2c060fc3a.png'
else if (taskType === 'browseGoods') banner = '//yun.duiba.com.cn/spark/assets/yd_title浏览商品.78d3155ae8b60786d793b8c44fe898dc8bbbc4ea.png'
else if (taskType === 'orderGoods') banner = '//yun.duiba.com.cn/spark/assets/yd_title购买商品.b0548da1dc653c283a8c12de2767c7c7d9a789d8.png'
this.setData({
task: {
itemId,
taskType: taskType,
image: {
bg: '//yun.duiba.com.cn/spark/assets/bg1.d818f787351875b0982937d8bb68b0655febec3c.png',
banner: banner,
// 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'
}
})
this.initPage()
},
async initPage() {
const { activityId } = app
const { taskType, itemIds } = this.query
API.getItemListByItemIds({activityId: app.activityId, itemIds: itemIds})
.then(res => {
const { success, message, data } = res
if (!success) { console.warn(res); commonToast(res && res.message) }
else {
console.log('%c--------获取商品列表\n' + '-----yd.getItemListByItemIds\n', ConsoleStyle, data)
this.setData({ goodsList: data })
}
})
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
// let handel = taskType == 'collectGoods' ? 'getCollectItemList' : 'getItemListByItemIds'
// const { success, data } = await API[handel]({ activityId, itemIds }).catch(res => {
// res && commonToast(res)
// }) || {}
// if(success) {
// this.setData({ goodsList: data || [] })
// }
},
//任务完成
async onCompleteTask(taskType,itemId) {
console.log(taskType,itemId)
const { activityId } = app
switch(taskType) {
case 'collectGoods':
let { success, data } = await API.doCollectGoodsTask({ activityId, taskType, itemId }).catch(res => {
res && commonToast(res)
}) || {}
if(success) {
this.initPage()
}
break;
// 完成浏览任务
case 'browseGoods':
let browsResult = await API.doBrowseGoodsTask({ activityId, itemId }).catch(res => {
res && commonToast(res)
}) || {}
console.log(browsResult)
if(browsResult.success) {
commonToast('任务完成')
}
break;
}
}
});
{
"usingComponents": {
"goods-modal": "/components/goodsModal/goodsModal"
}
}
\ No newline at end of file
...@@ -146,6 +146,9 @@ ...@@ -146,6 +146,9 @@
z-index: 0; z-index: 0;
} }
.opciaty05 {
opacity: 0.5;
}
.bottom_ydgame_block { .bottom_ydgame_block {
...@@ -162,11 +165,11 @@ ...@@ -162,11 +165,11 @@
position: absolute; position: absolute;
} }
.bottom_ydgame_block_coin { .bottom_ydgame_block_coin {
width: 199rpx; width: 194rpx;
height: 44rpx; height: 40rpx;
line-height: 44rpx; line-height: 40rpx;
left: 34rpx; left: 0;
top: 268rpx; top: 214rpx;
background-color: #f7cbcf; background-color: #f7cbcf;
border-radius: 21rpx; border-radius: 21rpx;
text-align: center; text-align: center;
...@@ -185,16 +188,18 @@ ...@@ -185,16 +188,18 @@
position: absolute; position: absolute;
} }
.bottom_mission_block_freenum { .bottom_mission_block_freenum {
width: 100%; width: 224rpx;
height: 40rpx; height: 40rpx;
line-height: 40rpx; line-height: 40rpx;
opacity: 1; opacity: 1;
left: 0; left: 20rpx;
top: 206rpx; top: 266rpx;
position: absolute; position: absolute;
font-size: 23.8rpx; font-size: 23.8rpx;
font-weight: 500; font-weight: 500;
color: rgba(200, 82, 73, 1); color: rgba(200, 82, 73, 1);
border-radius: 20rpx;
background-color: #f7cbcf;
text-align: center; text-align: center;
} }
.bottom_mission_block_image { .bottom_mission_block_image {
...@@ -237,8 +242,8 @@ ...@@ -237,8 +242,8 @@
z-index: 40; z-index: 40;
width: 140rpx; width: 140rpx;
height: 100rpx; height: 100rpx;
top: 30; top: 0;
right: 30; left: 100rpx;
background: rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .9);
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
font-size: 22rpx; font-size: 22rpx;
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
<!-- 头部 规则-奖品 按钮 --> <!-- 头部 规则-奖品 按钮 -->
<view class="head"> <view class="head">
<image class="head_ruler" onTap="showCommonMoadalT1" src="{{resList['ee8882be-4b1d-43eb-bad7-8d96318c5022'].url}}" /> <image class="head_ruler" onTap="showRuleModal" src="{{resList['ee8882be-4b1d-43eb-bad7-8d96318c5022'].url}}" />
<!-- <image class="head_ruler" onTap="" src="{{resList['ee8882be-4b1d-43eb-bad7-8d96318c5022'].url}}" /> --> <!-- <image class="head_ruler" onTap="showCommonMoadalT1" src="{{resList['ee8882be-4b1d-43eb-bad7-8d96318c5022'].url}}" /> -->
<image class="head_rewards" onTap="gotoMyPrizePage" src="{{resList['74a63fd3-6776-44a2-990e-fadac00fb757'].url}}" /> <image class="head_rewards" onTap="gotoMyPrizePage" src="{{resList['74a63fd3-6776-44a2-990e-fadac00fb757'].url}}" />
</view> </view>
...@@ -46,13 +46,16 @@ ...@@ -46,13 +46,16 @@
<view class="video_hide" onTap="videoHideFunc"> 缩小视频 </view> <view class="video_hide" onTap="videoHideFunc"> 缩小视频 </view>
<!-- 视频部分 --> <!-- 视频部分 -->
<view hidden="{{videoBottom_timeout}}" onTap="videoShowFunc" class="video_block {{ videoBottom ? 'block_opciaty0' : ''}}"> <view hidden="{{videoBottom_timeout}}" class="video_block {{ videoBottom ? 'block_opciaty0' : ''}}">
<view class="video_block_wrapper"> <view class="video_block_wrapper" onTap="videoShowFunc" >
<view class="video_block_text"> <view class="video_block_text">
<image src="{{videoImgSrcSmall}}" mode="aspectFill" />
<view>观看XXXXX视频</view> <view>观看XXXXX视频</view>
<view>赢惊喜抽奖次数</view> <view>赢惊喜抽奖次数</view>
</view> </view>
<!--
<view class="video_block_up" onTap="onVideoTurnSmall">收起视频</view> <view class="video_block_up" onTap="onVideoTurnSmall">收起视频</view>
-->
</view> </view>
<!-- 按钮组 左-右 --> <!-- 按钮组 左-右 -->
...@@ -60,37 +63,36 @@ ...@@ -60,37 +63,36 @@
<image class="video_btn_right" onTap="videoTurnRight" src="{{resList['cf73af84-5751-4aee-a754-9106162786d9'].url}}" /> <image class="video_btn_right" onTap="videoTurnRight" src="{{resList['cf73af84-5751-4aee-a754-9106162786d9'].url}}" />
</view> </view>
<!--
<view hidden="{{!videoBottom_timeout}}" onTap="onVideoTurnBig" class="video_block_s {{ !videoBottom ? 'block_opciaty0' : ''}}" > <view hidden="{{!videoBottom_timeout}}" onTap="onVideoTurnBig" class="video_block_s {{ !videoBottom ? 'block_opciaty0' : ''}}" >
<!-- <image class='video_s' src='' /> -->
<view class='video_s'></view> <view class='video_s'></view>
<image class="bo_fang_an_niu" src="{{resList['8d5b83a6-59d9-484c-a74e-99f13ba20b02'].url}}" /> <image class="bo_fang_an_niu" src="{{resList['8d5b83a6-59d9-484c-a74e-99f13ba20b02'].url}}" />
<view class="video_block_tips">看视频 赢金币</view> <view class="video_block_tips">看视频 赢金币</view>
</view> </view>
-->
<!-- 底部 门票-乐园-抽奖 --> <!-- 底部 门票-乐园-抽奖 -->
<view class="bottom"> <view class="bottom">
<view class="bottom_turntable_block"> <view class="bottom_turntable_block" onTap="gotoTurnTable">
<image class="bottom_turntable_block_image" src="{{resList['44b8923b-c9f9-4246-a4ff-4093ff97ca33'].url}}" /> <image class="bottom_turntable_block_image" src="{{resList['44b8923b-c9f9-4246-a4ff-4093ff97ca33'].url}}" />
</view> </view>
<view class="bottom_ydgame_block" onTap="openShowChooseGame"> <view class="bottom_ydgame_block" onTap="openShowChooseGame">
<image class="bottom_ydgame_block_image" src="{{resList['81a085b2-ce9c-4a8f-bdcc-d08f10083134'].url}}" /> <image class="bottom_ydgame_block_image" src="{{resList['81a085b2-ce9c-4a8f-bdcc-d08f10083134'].url}}" />
<view class="bottom_ydgame_block_coin"> 免费门票 x2 </view> <view class="bottom_mission_block_freenum">免费抽奖次数 X{{drawNum}}</view>
</view> </view>
<view class="bottom_mission_block" onTap="showMissionModal"> <view class="bottom_mission_block" onTap="showMissionModal">
<image class="bottom_mission_block_image" src="{{resList['db8bff60-3223-428b-81a8-27c4742a6469'].url}}" /> <image class="bottom_mission_block_image" src="{{resList['db8bff60-3223-428b-81a8-27c4742a6469'].url}}" />
<!-- <view class="bottom_mission_block_freenum">免费次数X2</view> --> <view a:if="{{ticketNum}}" class="bottom_ydgame_block_coin"> 免费门票 X{{ticketNum}}</view>
</view> </view>
<!-- 选择游戏 --> <!-- 选择游戏 -->
<view class="gamechoose_block" a:if='{{ showChooseGame }}'> <view class="gamechoose_block" a:if='{{ showChooseGame }}'>
<image class="gamechoose_block_back" src="{{resList['22c949b8-84af-4a22-bb21-70088d1eafad'].url}}" /> <image class="gamechoose_block_back" src="{{resList['22c949b8-84af-4a22-bb21-70088d1eafad'].url}}" />
<image data-gameType='1' onTap="changeGameOrPage" class="gamechoose_block_sc" src="{{resList['f2915694-4e09-4776-8f38-9ddb285e4d17'].url}}" /> <image data-gameType='1' onTap="changeGameOrPage" class="gamechoose_block_sc {{ ticketNum ? '' : 'opciaty05' }}" src="{{resList['f2915694-4e09-4776-8f38-9ddb285e4d17'].url}}" />
<image data-gameType='2' onTap="changeGameOrPage" class="gamechoose_block_xxl" src="{{resList['7aafb158-7fec-4ae1-a83e-496779c4a107'].url}}" /> <image data-gameType='2' onTap="changeGameOrPage" class="gamechoose_block_xxl {{ ticketNum ? '' : 'opciaty05' }}" src="{{resList['7aafb158-7fec-4ae1-a83e-496779c4a107'].url}}" />
<view class="gameChoose_mask" onTap="closeShowChooseGame"></view> <view class="gameChoose_mask" onTap="closeShowChooseGame"></view>
</view> </view>
</view> </view>
...@@ -110,9 +112,9 @@ ...@@ -110,9 +112,9 @@
<!-- 弹窗部分 --> <!-- 弹窗部分 -->
<common-modal-t1 a:if="{{commonModalVisibleT1}}" data="{{commonModalDataT1}}" onModalClose="closeCommonModalT1" onModalConfirm="confirmCommonModalT1" /> <common-modal-t1 a:if="{{commonModalVisibleT1}}" data="{{commonModalDataT1}}" onModalClose="closeCommonModalT1" onModalConfirm="confirmCommonModalT1" />
<common-modal-t2 a:if="{{commonModalVisibleT2}}" data="{{commonModalDataT2}}" onModalClose="closeCommonModalT2" onModalConfirm="confirmCommonModalT2" /> <common-modal-t2 a:if="{{commonModalVisibleT2}}" data="{{commonModalDataT2}}" onModalClose="closeCommonModalT2" onModalOne="onModalT2One" onModalTwo="onModalT2Two"/>
<rule-modal a:if="{{ruleModalVisible}}" onModalClose="closeRuleModal"><text>{{rule}}</text></rule-modal> <rule-modal a:if="{{ruleModalVisible}}" onModalClose="closeRuleModal" text="{{rule}}"></rule-modal>
<rewards-modal a:if="{{rewardsModalVisible}}" onModalClose="closeRewardsModal"></rewards-modal> <rewards-modal a:if="{{rewardsModalVisible}}" onModalClose="closeRewardsModal"></rewards-modal>
<prizes-modal a:if="{{prizesModalVisible}}" onModalClose="closePrizesModal"></prizes-modal> <prizes-modal a:if="{{prizesModalVisible}}" onModalClose="closePrizesModal"></prizes-modal>
<mission-modal a:if="{{missionModalVisible}}" onModalClose="closeMissionModal"></mission-modal> <mission-modal a:if="{{missionModalVisible}}" onModalClose="closeMissionModal"></mission-modal>
const app = getApp(); const app = getApp();
import API from '../../api'; import API from '../../api';
import { clickStat } from '../../md';
import resList from '../../resconfig/resList.js' import resList from '../../resconfig/resList.js'
const { tbcc } = app; const { tbcc } = app;
const { SHARE_CONFIG, REDIRECT_URL } = tbcc.constants; const { SHARE_CONFIG, REDIRECT_URL } = tbcc.constants;
const { commonToast, getAuthUserInfo, navigateToOutside, ConsoleStyle } = tbcc.tb; const { commonToast, getAuthUserInfo, navigateToOutside, ConsoleStyle, checkShopFavoredStatus } = tbcc.tb;
Page({ Page({
doExchange: () => { doExchange: () => {
...@@ -14,9 +15,9 @@ Page({ ...@@ -14,9 +15,9 @@ Page({
// 视频地址列表 - 存储播放时常 // 视频地址列表 - 存储播放时常
videoSrcArr: [ videoSrcArr: [
{ url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0 }, { url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0, completed: false },
{ url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0 }, { url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0, completed: false },
{ url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0 } { url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0, completed: false }
], ],
// 视频记录 flag // 视频记录 flag
timeStampCountFlag: false, timeStampCountFlag: false,
...@@ -30,11 +31,16 @@ Page({ ...@@ -30,11 +31,16 @@ Page({
'https://yun.duiba.com.cn/spark/assets/弹窗背景_奖品.dce4e3dd9a3fcae166dfbd934b714ce1bc7fa5c9.png', 'https://yun.duiba.com.cn/spark/assets/弹窗背景_奖品.dce4e3dd9a3fcae166dfbd934b714ce1bc7fa5c9.png',
'https://yun.duiba.com.cn/spark/assets/7191ae57140b4937ae42500e76aa533693326ef9.png', 'https://yun.duiba.com.cn/spark/assets/7191ae57140b4937ae42500e76aa533693326ef9.png',
], ],
// 是否关注电批 // 小封面图
videoImgSrcSmallArr: [],
// 是否是会员
isVip: false,
// 是否关注店铺
isFollow: false, isFollow: false,
// 进入时获取 邀请码 // 进入时获取 邀请码
inviteId: '', inviteId: '',
// 用户是否登陆
userLogin: false,
data: { data: {
resList: resList, resList: resList,
title: '', title: '',
...@@ -48,8 +54,6 @@ Page({ ...@@ -48,8 +54,6 @@ Page({
videoBottom: false, videoBottom: false,
// 具有延迟的 视频收起 - flag // 具有延迟的 视频收起 - flag
videoBottom_timeout: false, videoBottom_timeout: false,
// 视频地址
videoSrc: '',
// 封面图地址 // 封面图地址
posterSrc: '', posterSrc: '',
// 视频变大 // 视频变大
...@@ -66,6 +70,7 @@ Page({ ...@@ -66,6 +70,7 @@ Page({
initTime: 0, initTime: 0,
mobilenetHintType: 1, mobilenetHintType: 1,
videoActiveIndex: 0, videoActiveIndex: 0,
videoImgSrcSmall: '', // 视频小封面图
// ------ 视频 配置 ------ // // ------ 视频 配置 ------ //
// 出现 选择游戏弹窗 // 出现 选择游戏弹窗
...@@ -78,19 +83,28 @@ Page({ ...@@ -78,19 +83,28 @@ Page({
gameType: 0, gameType: 0,
commonModalConfirmT1: null, commonModalConfirmT1: null,
commonModalVisibleT1: false, commonModalVisibleT1: false,
commonModalConfirmT2: null, onModalT2One: null,
onModalT2Two: null,
commonModalVisibleT2: false, commonModalVisibleT2: false,
ruleModalVisible: false, ruleModalVisible: false,
rewardsModalVisible: false, rewardsModalVisible: false,
prizesModalVisible: false, prizesModalVisible: false,
missionModalVisible: false, missionModalVisible: false,
ticketNum: 0,
drawNum: 0,
todayFirstLogin: true
}, },
async onLoad (query) { async onLoad (query) {
console.info(`%cPage onLoad with query: ${JSON.stringify(query)}`, ConsoleStyle) console.info(`%cPage onLoad with query: ${JSON.stringify(query)}`, ConsoleStyle)
if (query.inviteId) this.inviteId = query.inviteId if (query.inviteId) {
// 页面加载 app.inviteId = query.inviteId
this.inviteId = query.inviteId
console.log('%c该用户是 通过邀请链接 进入', 'color:green; font-size:16px; font-weight:bold;')
}
// 页面加载
// 开场动画 // 开场动画
// this.openAnimation().then(async res_ => { // this.openAnimation().then(async res_ => {
// this.backToPage() // this.backToPage()
...@@ -98,6 +112,9 @@ Page({ ...@@ -98,6 +112,9 @@ Page({
// this.init() // this.init()
// }) // })
// test - 打点
// clickStat(1, '2')
this.getAuth() this.getAuth()
}, },
...@@ -118,10 +135,22 @@ Page({ ...@@ -118,10 +135,22 @@ Page({
// 登录接口 // 登录接口
async login() { async login() {
const { nickName, avatar } = app; const { nickName, avatar } = app;
const { success, message, data } = await API.login({ activityId: app.activityId, avatar: app.avatar, userNick: nickName, avatar, isFollow: this.isFollow, inviteId: this.inviteId }) this.isFollow = await checkShopFavoredStatus(app.sellerId)
if (this.isFollow === undefined) this.isFollow = false
console.log(`%c-----是否关注店铺:${this.isFollow}`, ConsoleStyle)
let param = { activityId: app.activityId, avatar: app.avatar, userNick: nickName, avatar, isFollow: this.isFollow, }
if (this.inviteId) param.inviteId = this.inviteId
const { success, message, data } = await API.login(param)
.catch(res => { commonToast(res && res.message); }) || {}; .catch(res => { commonToast(res && res.message); }) || {};
if (success) { if (success) {
this.userLogin = true
console.log('%c-----用户登陆信息\n' + '-----yd.login\n', ConsoleStyle, data) console.log('%c-----用户登陆信息\n' + '-----yd.login\n', ConsoleStyle, data)
app.openId = data.openId
this.isNewUser = data.isNewUser
this.hasNewUserAndInvited()
this.getGameInfo()
this.init(data); this.init(data);
} }
}, },
...@@ -131,56 +160,132 @@ Page({ ...@@ -131,56 +160,132 @@ Page({
API.getActivityBaseInfoById({activityId: app.activityId}) API.getActivityBaseInfoById({activityId: app.activityId})
.then(res => { .then(res => {
const { success, message, data } = res const { success, message, data } = res
if (!success) { if (!success) { console.warn(res); commonToast(res && res.message) }
console.warn(res) else {
commonToast(res && res.message)
} else {
console.log('%c-----活动基本信息\n' + '-----yd.getActivityBaseInfoById\n', ConsoleStyle, data) console.log('%c-----活动基本信息\n' + '-----yd.getActivityBaseInfoById\n', ConsoleStyle, data)
data.videoUrlArr.forEach((item, index) => {
// this.videoSrcArr[index] = {
// url: item, timeStamp: 0, totalTime: 0, completed: false
// }
// this.posterSrcArr
// this.videoImgSrcSmallArr = data.videoImgSrcSmallArr
})
this.setData({
rule: data.rule,
videoSrc: this.videoSrcArr[0].url,
// videoImgSrcSmall: this.videoImgSrcSmallArr[0],
})
} }
}) })
.catch(res => { commonToast(res && res.message); }) || {}; .catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
// this.checkDohelp();
},
let res = await API.getTaskList({activityId: app.activityId}) // 助力
checkDohelp(){
if (this.inviteId) {
//是分享落地页,可以助力
//todo 需要判断是不是会员
commonToast('准备5秒后给邀请者助力~');
setTimeout(() => {
API.doHelp({activityId: app.activityId,inviteId:this.inviteId}).then(res=>{
commonToast('助力成功~');
}).catch(err=>{
commonToast(JSON.stringify(err));
});
}, 5000);
} else {
commonToast('不是分享落地页,不需要走助力~')
}
},
// 新用户/被邀请的 逻辑
hasNewUserAndInvited () {
API.getVipInfo({ activityId: app.activityId, inviteId: app.inviteId })
.then(res => { .then(res => {
const { success, message, data } = res const { success, data, message } = res
console.log(res) console.log('%c-----用户vip信息\n' + '-----yd.getVipInfo\n', ConsoleStyle, data)
console.log('%c--------任务列表\n' + '-----yd.getTaskList\n', ConsoleStyle, data) if (success && data) {
app.isVip = (data && data.isVip) || false;
app.vipUrl = (data && data.url) || '';
this.isVip = (data && data.isVip) || false;
} else {
commonToast(message)
}
}) })
.catch(res => { console.warn(res); commonToast(res && res.message) }) || {};
// 新用户 助力链接
if (this.isNewUser && this.inviteId) {
this.showCommonMoadalT1({
title: '温馨提示',
content: '成为会员 才能为他助力哦~',
confirmCallback: () => {
navigateToOutside(app.vipUrl)
},
btnImg: '//yun.duiba.com.cn/spark/assets/一秒成为会员.10be8a8ede8f6c62eadb005744dc54ae182911d9.png' })
// //yun.duiba.com.cn/spark/assets/为他助力.bc57a24aecb04934067712c76186d800343dabd5.png
}
// 新用户 不是助力链接
else if (this.isNewUser && !this.inviteId) console.log('isNewUser')
// 老用户 助力链接
else if (!this.isNewUser && this.inviteId) {
this.showCommonMoadalT1({
title: '很遗憾',
content: '新会员才能助力哦~',
confirmCallback: () => {
this.closeCommonModalT1()
},
btnImg: '//yun.duiba.com.cn/spark/assets/我也要赢大奖.a22bebbd5be4a6e557ee4ef611216ba73b729d10.png' })
}
},
// 用户今日首次进入
userFirstInToday () {
// 自动播放视频
this.videoShowFunc()
}, },
// 分享 // 分享
onShareAppMessage() { onShareAppMessage() {
// 返回自定义分享信息 // 返回自定义分享信息
SHARE_CONFIG.imageUrl = ''
SHARE_CONFIG.path = this.changeURLArg('/pages/homePage/homePage&', 'inviteId', app.openId)
return SHARE_CONFIG; return SHARE_CONFIG;
}, },
// 新用户 被邀请的 逻辑
hasBeenInvited () {
console.log('%c该用户是被 邀请 进入', 'color:green; font-size:16px; font-weight:bold;')
},
// 页面加载完成 // 页面加载完成
onReady() { onReady() {
this.videoCtx = my.createVideoContext('videoCtx') this.videoCtx = my.createVideoContext('videoCtx')
this.setData({ videoSrc: this.videoSrcArr[0].url, posterSrc: this.posterSrcArr[0] })
this.videoCtx.play() this.videoCtx.play()
// this.setData({ videoSrc: this.videoSrcArr[0].url, posterSrc: this.posterSrcArr[0] })
}, },
// 页面显示 // 页面显示
onShow() { onShow() {
if (this.userLogin) this.getGameInfo()
}, },
// start // 获取 游戏门票 抽奖次数 今日是否首次登陆
doStart() { getGameInfo () {
this.showCommonModal({ API.getGameInfo({ activityId: app.activityId })
content: '活动还未开始\n请稍后', .then(res => {
btnText: '我知道了', const { success, message, data } = res
commonModalVisibleT1: true, if (!success) { console.warn(res); commonToast(res && res.message) }
confirmCallback: () => { else {
this.closeCommonModal(); console.log('%c-----获取游戏信息\n' + '-----yd.getGameInfo\n', ConsoleStyle, data)
this.setData({
ticketNum: data.gameTimes,
drawNum: data.lotteryTimes,
todayFirstLogin: data.todayFirstLogin
})
if (this.data.todayFirstLogin) this.userFirstInToday()
} }
}); })
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
}, },
// 开场动画 // 开场动画
...@@ -195,10 +300,21 @@ Page({ ...@@ -195,10 +300,21 @@ Page({
// 切换到游戏 // 切换到游戏
changeGameOrPage (e) { changeGameOrPage (e) {
if (this.data.ticketNum == 0 && e.currentTarget.dataset.gameType != 3) {
this.showCommonMoadalT1({
title: '门票不足',
content: '门票消耗完了!\n快去做任务吧~',
confirmCallback: () => {
this.showMissionModal()
},
btnImg: '//yun.duiba.com.cn/spark/assets/赚门票.21d8c2fd01dffd454116bb6c1189ba6bb74306f4.png' })
return
} else {
let type = Number(e.currentTarget.dataset.gameType) let type = Number(e.currentTarget.dataset.gameType)
this.videoCtx.pause() this.videoCtx.pause()
this.setData({ gameShow: true, gameType: type }) this.setData({ gameShow: true, gameType: type })
setTimeout(() => { this.setData({ gameShow_timeout: true }) }, 350) setTimeout(() => { this.setData({ gameShow_timeout: true }) }, 350)
}
}, },
// 从游戏 返回 到 主页 // 从游戏 返回 到 主页
...@@ -207,18 +323,25 @@ Page({ ...@@ -207,18 +323,25 @@ Page({
setTimeout(() => { this.setData({ gameShow: false }) }, 350) setTimeout(() => { this.setData({ gameShow: false }) }, 350)
}, },
// 去转盘
gotoTurnTable () {
my.navigateTo({url: '../turnTablePage/turnTablePage'})
},
// video - turn left // video - turn left
videoTurnLeft () { videoTurnLeft () {
let i = this.data.videoActiveIndex let i = this.data.videoActiveIndex
if (i > 0) { if (i > 0) {
this.videoCtx.stop() this.videoCtx.stop()
this.videoRecord(i) // 因为 现在只有 视频缩小时 会暂停,所以切换时不需要记录 仅在缩小时记录
// this.videoRecord(i)
setTimeout(() => { setTimeout(() => {
i -= 1 i -= 1
let vsrc = this.videoSrcArr[i].url, let vsrc = this.videoSrcArr[i].url,
psrc = this.posterSrcArr[i] psrc = this.posterSrcArr[i],
spsrc = this.videoImgSrcSmallArr[i]
this.setData({ this.setData({
videoImgSrcSmall: spsrc,
videoSrc: vsrc, videoSrc: vsrc,
posterSrc: psrc, posterSrc: psrc,
videoActiveIndex: i videoActiveIndex: i
...@@ -233,12 +356,15 @@ Page({ ...@@ -233,12 +356,15 @@ Page({
let i = this.data.videoActiveIndex let i = this.data.videoActiveIndex
if (i < this.videoSrcArr.length - 1) { if (i < this.videoSrcArr.length - 1) {
this.videoCtx.stop() this.videoCtx.stop()
this.videoRecord(i) // 因为 现在只有 视频缩小时 会暂停,所以切换时不需要记录 仅在缩小时记录
// this.videoRecord(i)
setTimeout(() => { setTimeout(() => {
i += 1 i += 1
let vsrc = this.videoSrcArr[i].url, let vsrc = this.videoSrcArr[i].url,
psrc = this.posterSrcArr[i] psrc = this.posterSrcArr[i],
spsrc = this.videoImgSrcSmallArr[i]
this.setData({ this.setData({
videoImgSrcSmall: spsrc,
videoSrc: vsrc, videoSrc: vsrc,
posterSrc: psrc, posterSrc: psrc,
videoActiveIndex: i videoActiveIndex: i
...@@ -248,22 +374,6 @@ Page({ ...@@ -248,22 +374,6 @@ Page({
} }
}, },
// video - turn small
onVideoTurnSmall () {
this.videoCtx.pause()
this.setData({ videoBottom: true })
setTimeout(() => { this.setData({ videoBottom_timeout: true }) }, 350)
},
// video - turn big
onVideoTurnBig () {
this.setData({ videoBottom_timeout: false })
setTimeout(() => {
this.setData({ videoBottom: false })
this.videoCtx.play()
}, 350)
},
// video - change to another video // video - change to another video
videoRecord (index) { videoRecord (index) {
this.videoSrcArr[index].timeStamp = this.timeStamp this.videoSrcArr[index].timeStamp = this.timeStamp
...@@ -280,7 +390,8 @@ Page({ ...@@ -280,7 +390,8 @@ Page({
// video - onPause // video - onPause
onPause() { onPause() {
console.log('---- 视频播放暂停', this.timeStamp) console.log('---- 视频播放暂停', this.timeStamp)
this.videoRecord(this.data.videoActiveIndex) // 因为 现在只有 视频缩小时 会暂停,所以切换时不需要记录 仅在缩小时记录
// this.videoRecord(this.data.videoActiveIndex)
}, },
// video - onEnded // video - onEnded
...@@ -301,8 +412,39 @@ Page({ ...@@ -301,8 +412,39 @@ Page({
// video - hide // video - hide
videoHideFunc() { videoHideFunc() {
console.log('videoHideFunc') this.videoRecord(this.data.videoActiveIndex)
console.log('videoHideFunc', this.videoSrcArr)
this.setData({ videoShow: false }) this.setData({ videoShow: false })
// 观看超过 15000ms 15s
if (this.videoSrcArr[this.data.videoActiveIndex].timeStamp >= 15000 && !this.videoSrcArr[this.data.videoActiveIndex].completed) {
this.videoSrcArr[this.data.videoActiveIndex].completed = true
this.getWatchRewards()
}
},
// 观看视频领奖
getWatchRewards() {
API.sendCoinsByWatch({activityId: app.activityId, videoIndex: this.data.videoActiveIndex})
.then(res => {
const {success, data} = res
if (success) {
this.showCommonMoadalT2({
title: '看视频奖励',
content: `抽奖次数+${data.lotteryTimes}`,
confirmCallback1: () => {
this.gotoTurnTable()
},
confirmCallback2: () => {
this.closeCommonModalT2()
},
btnImg1: '//yun.duiba.com.cn/spark/assets/3d33327ff5974c06f1be66942b315339f310fac9.png',
btnImg2: '//yun.duiba.com.cn/spark/assets/b64ab7dbde250c686b9cc8346509ea6fc23e2a99.png',
rewardsImg: ''
})
} else {
commonToast('网络开小差啦')
}
})
}, },
videoShowFunc() { videoShowFunc() {
...@@ -315,14 +457,7 @@ Page({ ...@@ -315,14 +457,7 @@ Page({
// video - onLoading // video - onLoading
onLoading (e) { console.log(e) }, onLoading (e) { console.log(e) },
// 页面隐藏 gotoMyPrizePage() { my.navigateTo({url: '../myprize/myprize'}) },
onHide() {
},
gotoMyPrizePage() {
my.navigateTo({url: '../myprize/myprize'})
},
// 跳转到天猫页面 // 跳转到天猫页面
goTmallPage() { navigateToOutside(REDIRECT_URL['tmall']); }, goTmallPage() { navigateToOutside(REDIRECT_URL['tmall']); },
...@@ -353,22 +488,21 @@ Page({ ...@@ -353,22 +488,21 @@ Page({
} }
}) })
}, },
// 显示通用弹层 // 显示通用弹层
showCommonMoadalT2 ({ showCommonMoadalT2 (obj) {
title = 'test- title', let { title, content, confirmCallback1, confirmCallback2, btnImg1, btnImg2, rewardsImg } = obj
content = 'test- content',
confirmCallback,
btnImg = '//yun.duiba.com.cn/spark/assets/32d8536184c3539c0d9655d03c1b60f3d5e1f60a.png' }) {
this.setData({ this.setData({
commonModalVisibleT2: true, commonModalVisibleT2: true,
commonModalDataT2: { title, content, btnImg }, commonModalDataT2: { title, content, btnImg1, btnImg2, rewardsImg },
confirmCommonModalT2: () => { onModalT2One: () => { confirmCallback1() },
confirmCallback() onModalT2Two: () => { confirmCallback2() }
this.closeCommonModalT2()
}
}) })
}, },
onModalT2One () { this.data.onModalT2One() },
onModalT2Two () { this.data.onModalT2Two() },
confirmCommonModalT1 () { this.data.confirmCommonModalT1() },
// 弹窗控制 - 关闭 // 弹窗控制 - 关闭
closeRuleModal() { this.setData({ ruleModalVisible: false }) }, closeRuleModal() { this.setData({ ruleModalVisible: false }) },
closeRewardsModal () { this.setData({ rewardsModalVisible: false}) }, closeRewardsModal () { this.setData({ rewardsModalVisible: false}) },
...@@ -392,7 +526,9 @@ Page({ ...@@ -392,7 +526,9 @@ Page({
onReachBottom() { onReachBottom() {
// 页面被拉到底部 // 页面被拉到底部
}, },
// 页面隐藏
onHide() {
},
// 获取主接口 // 获取主接口
async getIndex() { async getIndex() {
...@@ -405,4 +541,49 @@ Page({ ...@@ -405,4 +541,49 @@ Page({
this.setData({ title, content, rule }); this.setData({ title, content, rule });
} }
}, },
/**
* 显示通用弹层
* @param {object} options content: 通用弹层内容 btnText:按钮文案 confirmCallback: 按钮确认回调
*/
showCommonModal({ content, btnText, confirmCallback }) {
this.setData({
commonModalConfirm: confirmCallback || null,
commonModalVisible: true,
commonModalData: { content, btnText }
});
},
changeURLArg(url, arg, arg_val) {
var pattern = arg + '=([^&]*)';
var replaceText = arg + '=' + arg_val;
if (url.match(pattern)) {
var tmp = '/(' + arg + '=)([^&]*)/gi';
// tmp = url.replace(eval(tmp), replaceText);
tmp = url.replace(new RegExp(tmp), replaceText);
return tmp;
} else {
if (url.match('[\?]')) {
return url + '&' + replaceText;
} else {
return url + '?' + replaceText;
}
}
}
// // video - turn small
// onVideoTurnSmall () {
// this.videoCtx.pause()
// this.setData({ videoBottom: true })
// setTimeout(() => { this.setData({ videoBottom_timeout: true }) }, 350)
// },
// // video - turn big
// onVideoTurnBig () {
// this.setData({ videoBottom_timeout: false })
// setTimeout(() => {
// this.setData({ videoBottom: false })
// this.videoCtx.play()
// }, 350)
// },
}); });
...@@ -3,7 +3,7 @@ import API from "/api"; ...@@ -3,7 +3,7 @@ import API from "/api";
import { SHARE_CONFIG } from '/tbcc-sdk/lib/constants'; import { SHARE_CONFIG } from '/tbcc-sdk/lib/constants';
const app = getApp(); const app = getApp();
const { tbcc } = app; const { tbcc } = app;
const { commonToast, navigateToOutside, getUserAddress, setClipboard } = tbcc.tb; const { commonToast, navigateToOutside, getUserAddress, setClipboard, ConsoleStyle } = tbcc.tb;
const { PRIZE_TYPE_MAP, PRIZE_DRAW_STATUS_MAP } = tbcc.constants; const { PRIZE_TYPE_MAP, PRIZE_DRAW_STATUS_MAP } = tbcc.constants;
let flag = false; let flag = false;
...@@ -23,7 +23,7 @@ Page({ ...@@ -23,7 +23,7 @@ Page({
addressBth: '//yun.duiba.com.cn/spark/assets/mybtn填写地址.ca58f849aea9c78e0290060624e1dd987ca988ae.png', //填写地址(实物奖品) addressBth: '//yun.duiba.com.cn/spark/assets/mybtn填写地址.ca58f849aea9c78e0290060624e1dd987ca988ae.png', //填写地址(实物奖品)
addressPriceBth: '//yun.duiba.com.cn/spark/assets/mybtn付邮费领取.dc12fb67b913ba8dd444e800b70f4fd54d377692.png', //填写地址(实物奖品) addressPriceBth: '//yun.duiba.com.cn/spark/assets/mybtn付邮费领取.dc12fb67b913ba8dd444e800b70f4fd54d377692.png', //填写地址(实物奖品)
jj: '//yun.duiba.com.cn/spark/assets/mybtn立即领取.3b85dd66efc6c18549868f543d48c9e6152d2432.png', //立即领取(除实物奖品外) jj: '//yun.duiba.com.cn/spark/assets/mybtn立即领取.3b85dd66efc6c18549868f543d48c9e6152d2432.png', //立即领取(除实物奖品外)
gotBtn: '//yun.duiba.com.cn/spark/assets/mybtn已领取.e342f48a85fbf9421a45cab37a3eb12eec091705.png', //已领取(优惠券) hasGetBtn: '//yun.duiba.com.cn/spark/assets/mybtn已领取.e342f48a85fbf9421a45cab37a3eb12eec091705.png', //已领取(优惠券)
getAgainBtn: '//yun.duiba.com.cn/spark/assets/mybtn重新领取.aba2a7e3d9f7724bb6f1aed8ccb50cea0268d0fb.png', //重新领取 getAgainBtn: '//yun.duiba.com.cn/spark/assets/mybtn重新领取.aba2a7e3d9f7724bb6f1aed8ccb50cea0268d0fb.png', //重新领取
invalidBtn: '//yun.duiba.com.cn/spark/assets/mybtn已失效.2fc529b912383145770f97a6c9dd7c413e528172.png', //已失效 invalidBtn: '//yun.duiba.com.cn/spark/assets/mybtn已失效.2fc529b912383145770f97a6c9dd7c413e528172.png', //已失效
failBth: '//yun.duiba.com.cn/spark/assets/mybtn领取失败.3fd23d113a41180b24da14e071772e167ce13b1a.png', //领取失败 failBth: '//yun.duiba.com.cn/spark/assets/mybtn领取失败.3fd23d113a41180b24da14e071772e167ce13b1a.png', //领取失败
...@@ -82,25 +82,25 @@ Page({ ...@@ -82,25 +82,25 @@ Page({
my.showLoading(); my.showLoading();
} }
const { success, data, message } = await API.getMyPrizeList({ activityId }) API.getMyPrizeList({ activityId })
.catch(res => { .then(res => {
this.setData({ const { success, data, message } = res
myPrizeList: [] if (!success) { console.warn(res); commonToast(res && res.message) }
}) else {
}) || {}; console.log('%c-----获取我的奖品\n' + '-----yd.getMyPrizeList\n', ConsoleStyle, data)
if (success && data) { this.setData({ myPrizeList: data })
this.setData({
myPrizeList: data.list
})
this.getEndTime(data.list) this.getEndTime(data.list)
} }
if (type != 'noLoading') { if (type != 'noLoading') { my.hideLoading() }
my.hideLoading(); })
} .catch(res => {
console.warn(res); commonToast(res && res.message);
if (type != 'noLoading') { my.hideLoading() } }) || {};
}, },
//领取奖品 // 领取奖品
async handleClick(e) { async handleClick(e) {
console.log(e)
const { item } = e.target.dataset; const { item } = e.target.dataset;
// 领取权益 // 领取权益
if (item.type === PRIZE_TYPE_MAP.EQUITY) return this.handleGetEquity(e) if (item.type === PRIZE_TYPE_MAP.EQUITY) return this.handleGetEquity(e)
...@@ -123,6 +123,7 @@ Page({ ...@@ -123,6 +123,7 @@ Page({
commonToast(res && res.message) commonToast(res && res.message)
}) || {}; }) || {};
if (success && data) { if (success && data) {
console.log('%c-----领取权益\n' + '-----yd.receiveEnamePrize\n', ConsoleStyle, data)
commonToast('领取成功') commonToast('领取成功')
this.getMyPrize() this.getMyPrize()
} }
...@@ -135,7 +136,7 @@ Page({ ...@@ -135,7 +136,7 @@ Page({
if (flag) { if (flag) {
return return
} }
// my.showLoading(); my.showLoading();
flag = true; flag = true;
const { activityId } = app; const { activityId } = app;
const { item } = e.target.dataset; const { item } = e.target.dataset;
...@@ -143,14 +144,14 @@ Page({ ...@@ -143,14 +144,14 @@ Page({
flag = false flag = false
console.log('getUserAddress出错了,错误信息是',data); console.log('getUserAddress出错了,错误信息是',data);
}) })
// my.hideLoading(); my.hideLoading();
if (!userAddress) return if (!userAddress) return
// commonToast(' getUserAddress =>'+JSON.stringify( userAddress)) // commonToast(' getUserAddress =>'+JSON.stringify( userAddress))
const { name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName } = userAddress || {}; const { name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName } = userAddress || {};
const params = { const params = {
activityId, activityId,
area:countyName, area:countyName,
addressdetail:detailInfo, addressDetail:detailInfo,
name, name,
phone: telNumber, phone: telNumber,
detailInfo, detailInfo,
...@@ -161,6 +162,7 @@ Page({ ...@@ -161,6 +162,7 @@ Page({
provinceName, provinceName,
countyName, countyName,
streetName, streetName,
id:item._id,
_id: item._id _id: item._id
} }
...@@ -183,7 +185,8 @@ Page({ ...@@ -183,7 +185,8 @@ Page({
// 领取实物 // 领取实物
async receiveObjectPrize(params) { async receiveObjectPrize(params) {
// commonToast('正在调用receiveObjectPrize'+JSON.stringify(params)) // commonToast('正在调用receiveObjectPrize'+JSON.stringify(params))
API.receiveObjectPrize(params).then((res) => { API.receiveObjectPrize(params)
.then((res) => {
// setTimeout(() => { // setTimeout(() => {
// commonToast(JSON.stringify(res)) // commonToast(JSON.stringify(res))
// }, 5000); // }, 5000);
...@@ -195,9 +198,10 @@ Page({ ...@@ -195,9 +198,10 @@ Page({
commonToast(message) commonToast(message)
} }
this.getMyPrize() this.getMyPrize()
},(rej)=>{ }, (rej)=>{
commonToast(rej.message) commonToast(rej.message)
}); })
.catch(res => { console.warn(res); commonToast(res && res.message); flag = false }) || {};z
}, },
// 积分 // 积分
async handleGetIntergation(e) { async handleGetIntergation(e) {
...@@ -207,11 +211,11 @@ Page({ ...@@ -207,11 +211,11 @@ Page({
flag = true; flag = true;
// 判断是否为会员 // 判断是否为会员
await this.getUserInfo() await this.getUserInfo()
const { isVip, vipLink } = app; const { isVip, vipUrl } = app;
if (!isVip) { if (!isVip) {
commonToast('立即加入会员,即可领取奖品', 2000); commonToast('立即加入会员,即可领取奖品', 2000);
setTimeout(() => { setTimeout(() => {
navigateToOutside(vipLink) navigateToOutside(vipUrl)
}, 1000) }, 1000)
flag = false flag = false
return return
...@@ -219,26 +223,41 @@ Page({ ...@@ -219,26 +223,41 @@ Page({
const { activityId } = app; const { activityId } = app;
const { item } = e.target.dataset; const { item } = e.target.dataset;
console.log(item, '领取积分') console.log(item, '领取积分')
const { success, data, message } = await API.receiveEnamePrize({ activityId, _id: item._id }) || {}; API.receiveEnamePrize({ activityId, _id: item._id })
.then(res => {
const { success, data, message } = res
if (success && data) { if (success && data) {
console.log('%c-----领取积分\n' + '-----yd.receiveEnamePrize\n', ConsoleStyle, data)
commonToast('领取成功') commonToast('领取成功')
flag = false
this.getMyPrize()
} else { } else {
commonToast(message) commonToast(message)
}
flag = false flag = false
this.getMyPrize() }
})
.catch(res => { console.warn(res); commonToast(res && res.message); flag = false }) || {};
}, },
//获取用户vip信息 //获取用户vip信息
async getUserInfo() { async getUserInfo() {
const { activityId } = app; const { activityId, inviteId } = app;
const { success, data, message } = await API.getVipInfo({ activityId }) || {}; API.getVipInfo({ activityId, inviteId })
console.log(data, '用户vip信息'); .then(res => {
const { success, data, message } = res
console.log('%c-----用户vip信息\n' + '-----yd.getVipInfo\n', ConsoleStyle, data)
if (success && data) { if (success && data) {
app.isVip = (data && data.isVip) || false; app.isVip = (data && data.isVip) || false;
app.vipLink = (data && data.url) || ''; app.vipUrl = (data && data.url) || '';
flag = false
this.getMyPrize()
} else { } else {
commonToast(message) commonToast(message)
flag = false
} }
})
.catch(res => { console.warn(res); commonToast(res && res.message); flag = false }) || {};
}, },
}); });
\ No newline at end of file
...@@ -96,12 +96,13 @@ Page({ ...@@ -96,12 +96,13 @@ Page({
/** /**
* 关注店铺 * 关注店铺
*/ */
async favorShop() { async favorShop(sellerId) {
const sellerId = 628189716; // 百草味sellerId // const sellerId = 628189716; // 百草味sellerId
const favorStatus = await favorShop(sellerId).catch(err => { const favorStatus = await favorShop(sellerId).catch(err => {
console.log('关注店铺失败', err); console.log('关注店铺失败', err);
}); });
commonToast(favorStatus ? '关注成功' : '关注失败'); commonToast(favorStatus ? '关注成功' : '关注失败');
return favorStatus
}, },
/** /**
* 查询店铺关注状态 * 查询店铺关注状态
...@@ -162,7 +163,7 @@ Page({ ...@@ -162,7 +163,7 @@ Page({
* 跳转到外部链接 * 跳转到外部链接
*/ */
navigateToOutside() { navigateToOutside() {
const url = 'https://www.tmall.com'; const url = app.vipUrl;
navigateToOutside(url); navigateToOutside(url);
}, },
/** /**
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
top: 0rpx; top: 0rpx;
left: 0rpx; left: 0rpx;
width: 750rpx; width: 750rpx;
height: auto; height: 1624rpx;
min-height: 100vh; position: fixed;
display: block; top: calc(50% - 812rpx);
position: relative; left: 0;
} }
.turntable_wrapper .bg1 { .turntable_wrapper .bg1 {
...@@ -55,11 +55,11 @@ ...@@ -55,11 +55,11 @@
} }
.rotate { .rotate {
width: 648rpx; width: 578rpx;
height: 648rpx; height: 578rpx;
opacity: 1; opacity: 1;
left: 52rpx; left: 85rpx;
top: 426rpx; top: 527rpx;
position: absolute; position: absolute;
z-index: 10; z-index: 10;
transform-origin: center center; transform-origin: center center;
...@@ -80,10 +80,8 @@ ...@@ -80,10 +80,8 @@
.backboard { .backboard {
width: 586rpx; width: 100%;
height: 586rpx; height: 100%;
opacity: 1;
margin: 31rpx auto;
/* left: 142rpx; /* left: 142rpx;
top: 526rpx; top: 526rpx;
position: absolute; */ position: absolute; */
...@@ -96,12 +94,13 @@ ...@@ -96,12 +94,13 @@
.rewards { .rewards {
width: 464rpx; width: 464rpx;
height: 448rpx; height: 464rpx;
opacity: 1; opacity: 1;
left: 92rpx; left: 57rpx;
top: 100rpx; top: 57rpx;
position: absolute; position: absolute;
z-index: 2; z-index: 2;
/* background: yellowgreen; */
} }
.rewards_item { .rewards_item {
...@@ -111,22 +110,28 @@ ...@@ -111,22 +110,28 @@
opacity: 1; opacity: 1;
/* background-color: black; */ /* background-color: black; */
transform-origin: center center; transform-origin: center center;
padding-top: 10rpx;
} }
.rewards_item_name { .rewards_item_name {
display: block; display: block;
width: 100%; width: 100%;
line-height: 2em; line-height: 2em;
font-size: 20rpx; font-size: 26rpx;
color: rgba(239, 43, 31, 1); color: #bb3346;
text-align: center; text-align: center;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
} }
.rewards_item_image { .rewards_item_image {
display: block; display: block;
width: 96rpx; width: 96rpx;
height: 96rpx; height: 96rpx;
margin: 4rpx auto 0; margin: 10rpx auto 0;
} }
...@@ -136,8 +141,8 @@ ...@@ -136,8 +141,8 @@
} }
.rewards_item_1{ .rewards_item_1{
left: -6rpx; left: -20rpx;
top: 140rpx; top: 154rpx;
} }
.rewards_item_2{ .rewards_item_2{
...@@ -151,8 +156,8 @@ ...@@ -151,8 +156,8 @@
} }
.rewards_item_4{ .rewards_item_4{
right: -6rpx; right: -20rpx;
top: 140rpx; top: 154rpx;
} }
.rewards_item_5{ .rewards_item_5{
...@@ -161,52 +166,33 @@ ...@@ -161,52 +166,33 @@
} }
.rotate_block .rotate_shadow {
width: 750rpx;
height: 1519rpx;
opacity: 0.10;
position: absolute;
}
.rotate_block .outside { .rotate_block .outside {
width: 648rpx; width: 620rpx;
height: 648rpx; height: 620rpx;
opacity: 1; opacity: 1;
left: 52rpx; left: 64rpx;
top: 426rpx; top: 505rpx;
position: absolute; position: absolute;
} }
.turntable .start_button { .turntable .start_button {
width: 148rpx; width: 210rpx;
height: 173rpx; height: 228rpx;
opacity: 1; opacity: 1;
left: 302rpx; left: 274rpx;
top: 650rpx; top: 700rpx;
position: absolute; position: absolute;
z-index: 10; z-index: 10;
} }
.start_button .start_button_image { .start_button .start_button_image {
width: 148rpx; width: 210rpx;
height: 173rpx; height: 228rpx;
opacity: 1; opacity: 1;
position: absolute; position: absolute;
} }
.start_button .start_button_text {
width: 66rpx;
height: 64rpx;
opacity: 1;
left: 42rpx;
top: 62rpx;
line-height: 36rpx;
position: absolute;
font-size: 32rpx;
font-weight: 500;
color: rgba(255, 255, 255, 1);
}
...@@ -300,11 +286,11 @@ ...@@ -300,11 +286,11 @@
height: 24rpx; height: 24rpx;
opacity: 1; opacity: 1;
left: 0; left: 0;
top: 1148rpx; top: 498rpx;
position: absolute; position: absolute;
font-size: 24rpx; font-size: 24rpx;
text-align: center; text-align: center;
color: rgba(0, 0, 0, 1); color: #d95477;
} }
.logo25 { .logo25 {
......
<view class="turntable_wrapper"> <view class="turntable_wrapper">
<!-- 背景 --> <!-- 背景 -->
<image class="bg1" src="{{resList['d5744a06-e2d1-461e-9163-795e5a6bc0b1'].url}}" /> <image class="bg1" src="{{resList['a6341ace-cb10-4143-8763-1a7234e80d7a'].url}}" />
<image class="zhuang_shi_kao_bei" src="{{resList['6340407d-93c4-449d-99af-d989f8122bcf'].url}}" />
<!-- MAIN BLOCK --> <!-- MAIN BLOCK -->
...@@ -10,14 +9,13 @@ ...@@ -10,14 +9,13 @@
<!-- 旋转转盘 --> <!-- 旋转转盘 -->
<view class="turntable"> <view class="turntable">
<view class="turntable_rotate"> <view class="turntable_rotate">
<view class="rotate_block"> <view class="rotate_block">
<!-- 转盘阴影 -->
<image class="rotate_shadow" src="{{resList['9afd16fe-ad73-4429-8249-ae238b7390fe'].url}}" />
<!-- 旋转部分 --> <!-- 旋转部分 -->
<view class="rotate" animation="{{myAnimation}}"> <view class="rotate" animation="{{myAnimation}}">
<view class='backboard'> <view class='backboard'>
<image src="{{resList['c701ee0a-3d13-4bc7-9d7c-efc1e7aceb6e'].url}}" mode="aspectFill" /> <image src="{{resList['b36c6a57-a96b-407d-b1a1-7745e3880ab2'].url}}" mode="aspectFill" />
</view> </view>
<view class="rewards"> <view class="rewards">
...@@ -33,14 +31,13 @@ ...@@ -33,14 +31,13 @@
</view> </view>
<!-- 外层不动 --> <!-- 外层不动 -->
<image class="outside" src="{{resList['432017f6-3320-4468-88bc-95b5d9930157'].url}}" /> <image class="outside" src="{{resList['7750fff8-383d-4135-b20b-b3108d5d0845'].url}}" />
</view> </view>
</view> </view>
<!-- 开始按钮 --> <!-- 开始按钮 -->
<view class="start_button" onTap='handdlerStartButton'> <view class="start_button" onTap='handdlerStartButton'>
<image class="start_button_image" src="{{resList['12643641-690f-4d56-be21-7c4c41b2177c'].url}}" /> <image class="start_button_image" src="{{resList['9ac2fe27-618d-444d-9548-6cab5e1c76dd'].url}}" />
<label class="start_button_text">开始 抽奖</label>
</view> </view>
</view> </view>
......
import { commonToast, getAuthUserInfo, navigateToOutside } from '../../utils/utils' const app = getApp();
import { SHARE_CONFIG, REDIRECT_URL } from '../../constants' import API from '../../api';
import API from '../../api' import { clickStat } from '../../md';
import resList from '../../resList' import resList from '../../resconfig/resList.js'
import { debounce } from '../../utils/utils' const { tbcc } = app;
const { SHARE_CONFIG, REDIRECT_URL } = tbcc.constants;
const app = getApp() const { commonToast, getAuthUserInfo, navigateToOutside, ConsoleStyle, checkShopFavoredStatus, debounce } = tbcc.tb;
Page({ Page({
data: { data: {
resList: resList, resList: resList,
listTurnTable_test: [1, 2, 3, 4, 5], // 转盘奖品信息_测试 listTurnTable_test: [1, 2, 3, 4, 5], // 转盘奖品信息_测试
listTurnTable: [], // 转盘奖品信息 listTurnTable: [], // 转盘奖品信息
listRange: [], // 排行榜奖品信息
prizeList: [], // props中获取到的奖品信息 prizeList: [], // props中获取到的奖品信息
tempStyle: { // 转盘旋转 tempStyle: { // 转盘旋转
transform: '' transform: ''
...@@ -32,44 +31,45 @@ Page({ ...@@ -32,44 +31,45 @@ Page({
let { activityId } = app let { activityId } = app
this.activityId = activityId this.activityId = activityId
this.getDataTurnTable() this.getDataTurnTable()
this.getDataRange() this.getGameInfo()
}, },
onCallBack () { onCallBack () {
console.log(this.data.listRange) // console.log(this.data.listRange)
},
async getGameInfo () {
API.getGameInfo({ activityId: this.activityId })
.then(res => {
const { success, message, data } = res
if (!success) { console.warn(res); commonToast(res && res.message) }
else {
console.log('%c-----获取游戏信息\n' + '-----yd.getGameInfo\n', ConsoleStyle, data)
this.setData({ leftTimes: data.lotteryTimes })
}
})
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
}, },
async getDataTurnTable () { async getDataTurnTable () {
const { success, data } = await API.getPrizeConfigList({ activityId: this.activityId, type: 2 }).catch(res => { let { success, data } = await API.getLotteryPrizeList({ activityId: this.activityId}).catch(res => {
console.warn(res)
commonToast(res && res.message) commonToast(res && res.message)
}) || {} }) || {}
if (success && data) { if (success && data) {
// 开发用 // 开发用
console.log('res Rewards: type- TurnTable', data) console.log('%c-----获取转盘奖品\n' + '-----getPrizeConfigList\n', ConsoleStyle, data)
let heartBroken = { let heartBroken = {
image: resList['acf10efc-702b-4145-aad3-805e269acb46'].url, image: resList['2a5c22ac-2449-4e2a-af33-8e3a837e20fe'].url,
name: '谢谢参与', name: '谢谢参与',
type: 5 type: 5
} }
data.list.splice(4, 0, heartBroken)
// list.push(heartBroken) data.push(...data)
this.setData({ listTurnTable: data.list, leftTimes: data.leftTimes }) data.push(heartBroken)
}
},
async getDataRange () { this.setData({ listTurnTable: data, leftTimes: data.leftTimes })
const { success, data } = await API.getPrizeConfigList({ activityId: this.activityId, type: 1 }).catch(res => {
commonToast(res && res.message)
}) || {}
if (success && data) {
console.log('res Rewards: type- Range', data)
if (data.list.length) data.list.forEach(item => {
item.rank = JSON.parse(item.rank)
item.rank = (item.rank.length === 1 && item.rank == 1) ? '第1名' : `${item.rank}名`
})
this.setData({ listRange: data.list })
} }
}, },
...@@ -86,14 +86,21 @@ Page({ ...@@ -86,14 +86,21 @@ Page({
console.log('startDraw run') console.log('startDraw run')
if (this.data.rotateFlag) return if (this.data.rotateFlag) return
if (!this.data.leftTimes > 0) { if (!this.data.leftTimes > 0) {
commonToast('您没有抽奖次数 快去邀请好友入会吧') commonToast('您还没有抽奖次数')
return return
} }
const { success, data } = await API.drawLotteryPrize({ activityId: this.activityId, type: 2 }).catch(res => {
const { success, data } = await API.drawLotteryPrize({ activityId: this.activityId, prizeDataType: 3 }).catch(res => {
commonToast(res && res.message) commonToast(res && res.message)
return return
}) || {} }) || {}
// let success = true
// let data = {
// id: '5f7295860cb733e8928791b6',
// type: 3,
// }
this.setData({ rotateFlag: true }) this.setData({ rotateFlag: true })
if (success && data) { if (success && data) {
...@@ -109,7 +116,7 @@ Page({ ...@@ -109,7 +116,7 @@ Page({
// 1:权益(优惠券),2:积分,3:实物 // 1:权益(优惠券),2:积分,3:实物
} else if (data.type == 1 || data.type == 2 || data.type == 3) { } else if (data.type == 1 || data.type == 2 || data.type == 3) {
this.data.listTurnTable.forEach((item, index) => { this.data.listTurnTable.forEach((item, index) => {
if (item.itemId == data.id) { if (item._id == data.id) {
rotateT = index + 1 rotateT = index + 1
rotateT = 4 + 1 rotateT = 4 + 1
this.setData({ rewardsInfo: data }) this.setData({ rewardsInfo: data })
......
...@@ -371,11 +371,245 @@ const resList = { ...@@ -371,11 +371,245 @@ const resList = {
url: '//yun.duiba.com.cn/spark/assets/mybtn查看物流.03ea3cdd889c8f09885b24a56dc99460734bc8a6.png', url: '//yun.duiba.com.cn/spark/assets/mybtn查看物流.03ea3cdd889c8f09885b24a56dc99460734bc8a6.png',
uuid: 'a5624249-1ab0-4cc8-bdfb-6e7c68a329d8' uuid: 'a5624249-1ab0-4cc8-bdfb-6e7c68a329d8'
}, },
'7cc61cbe-ca7c-4bb8-9d84-927fe00a4022': {
name: 'mybtn处理中',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/mybtn处理中.2b580c9a13cbaf0f905461d05f7f9a567c63f340.png',
uuid: '7cc61cbe-ca7c-4bb8-9d84-927fe00a4022'
},
'90260033-8018-4bf9-8b44-6e7583562e4c': {
name: 'lottieTexture',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/lottieTexture.47937ecaee2c2e3b2e7fba9457ad694eb41b9fda.png',
uuid: '90260033-8018-4bf9-8b44-6e7583562e4c'
},
'63cb446e-1158-4a94-bf0c-c19ecc7d2cc6': {
name: 'openTexture',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/openTexture.4558fad0aadb7003efd6b71716816a93ad181283.png',
uuid: '63cb446e-1158-4a94-bf0c-c19ecc7d2cc6'
},
'81a085b2-ce9c-4a8f-bdcc-d08f10083134': { '81a085b2-ce9c-4a8f-bdcc-d08f10083134': {
name: 'yd_happypark_new', name: 'yd_happypark_new',
ext: '.png', ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/yd_happypark_new.9c828c4054ba32b97937fd955b93d73029cc315e.png', url: '//yun.duiba.com.cn/spark/assets/yd_happypark_new.9c828c4054ba32b97937fd955b93d73029cc315e.png',
uuid: '81a085b2-ce9c-4a8f-bdcc-d08f10083134' uuid: '81a085b2-ce9c-4a8f-bdcc-d08f10083134'
},
'334aff33-1a9e-4277-aafe-3d9f22eab3d5': {
name: '传送带返回',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/传送带返回.2311961239a4cec1102cbaef694bcfa96e8e813d.png',
uuid: '334aff33-1a9e-4277-aafe-3d9f22eab3d5'
},
'ad20a814-c0d4-4010-a76d-8e9114778580': {
name: '传送带棍子',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/传送带棍子.1c8129c1c01b0ffff79c62f7248de814b90d5b58.png',
uuid: 'ad20a814-c0d4-4010-a76d-8e9114778580'
},
'217e095b-5c92-4c79-a8b2-a13730815d1d': {
name: '传送带bg',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/传送带bg.e8059ac6374da38450ba34c437b6b4040f931e87.png',
uuid: '217e095b-5c92-4c79-a8b2-a13730815d1d'
},
'd1379fca-f21e-40f0-b0f0-06c188d4b4dc': {
name: '商品1',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/商品1.599f9257a53195dceb9f40c0c0f7aded34cdc131.png',
uuid: 'd1379fca-f21e-40f0-b0f0-06c188d4b4dc'
},
'0bd734c1-9c1a-428e-8a9c-cef373baed9d': {
name: '商品2',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/商品2.8949611178fa2d44d4273855d7ec2f6dbaa2fbe0.png',
uuid: '0bd734c1-9c1a-428e-8a9c-cef373baed9d'
},
'9e512c7f-88e2-4b85-a2f0-afd2062247e1': {
name: '商品3',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/商品3.b767697456aee2b09886ebcf716ab1661f2d3ac3.png',
uuid: '9e512c7f-88e2-4b85-a2f0-afd2062247e1'
},
'30ac266d-0388-4659-9c3e-e741f3c671c7': {
name: '商品4',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/商品4.71ddf430f5224890c7a4740ac50e9d59b8fa32e4.png',
uuid: '30ac266d-0388-4659-9c3e-e741f3c671c7'
},
'f5c2161d-88e7-42f9-bcd6-de4ba299b73f': {
name: '引导1',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/引导1.82653046b0d6983278d2d4bed8dda890de8eb310.png',
uuid: 'f5c2161d-88e7-42f9-bcd6-de4ba299b73f'
},
'946ce030-1669-4d8f-a074-b120e738b148': {
name: '引导2',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/引导2.835e6f14c4d0be0a55a505671d54cdb3ac357c13.png',
uuid: '946ce030-1669-4d8f-a074-b120e738b148'
},
'e23c5ce1-444f-41c3-a05b-08024ac27678': {
name: '引导3',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/引导3.3cb22a085628a6e43b4e13182c1a26c1ec4c259d.png',
uuid: 'e23c5ce1-444f-41c3-a05b-08024ac27678'
},
'f455b42a-0e67-43d8-b7c5-520760160631': {
name: '炸弹',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/炸弹.67df66e9cf5e166c8cf6d340886ef094a84954c9.png',
uuid: 'f455b42a-0e67-43d8-b7c5-520760160631'
},
'b292e9c5-4565-4ecb-bf0b-1a9d7268b7c0': {
name: '主要传送带',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/主要传送带.123506a9d21e1e865dfb73a111841cf5d54432ca.png',
uuid: 'b292e9c5-4565-4ecb-bf0b-1a9d7268b7c0'
},
'9df91df7-fc44-4d31-9f52-88d1ff65c9ba': {
name: 'userboard_left',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/userboard_left.b3ac0315adf5b1fc08faf81dadad51e842d17c6f.png',
uuid: '9df91df7-fc44-4d31-9f52-88d1ff65c9ba'
},
'9606b410-5d79-4759-a3f6-026dbb6fad0b': {
name: 'userboard_right',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/userboard_right.e62f8797b851fa7758f16d0a5b1fae6729989f8c.png',
uuid: '9606b410-5d79-4759-a3f6-026dbb6fad0b'
},
'f6ba8f6a-54e0-4b75-93f3-00f5051f58eb': {
name: '齿轮',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/齿轮.d6b4a63009dbe5f489f39eec37952e644589337a.png',
uuid: 'f6ba8f6a-54e0-4b75-93f3-00f5051f58eb'
},
'b36dec27-734f-4458-8719-afda29c8c296': {
name: '传送带带子2',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/传送带带子2.57e04400bd98aeb93f87a6413c82ad39ea68c372.png',
uuid: 'b36dec27-734f-4458-8719-afda29c8c296'
},
'2137d3de-174f-42b1-8ebc-c5eb667ed250': {
name: '传送带左边传送带',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/传送带左边传送带.9ecaa198fe5be733f7de4f917aac0d8a8474aa0b.png',
uuid: '2137d3de-174f-42b1-8ebc-c5eb667ed250'
},
'01def08f-119f-463d-bc75-1c7ab44b55d5': {
name: '传送带左边传送带2',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/传送带左边传送带2.7fea2ca2aa3d648a8bdb8af805c6bd43bcdf7f19.png',
uuid: '01def08f-119f-463d-bc75-1c7ab44b55d5'
},
'3366a525-6a5c-4dc2-af0a-7f58ae2816a3': {
name: 'yd_邀请好友png',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/yd_邀请好友png.d1c54fe727c0e66e74a5d5614bfbb09b0422f83d.png',
uuid: '3366a525-6a5c-4dc2-af0a-7f58ae2816a3'
},
'1aec3103-7f56-4fd9-a54e-cd2373668b6a': {
name: 'yd_支付定金',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/yd_支付定金.cbb7b5adc6a8b6ac87692f70d91bd7f0f184dd14.png',
uuid: '1aec3103-7f56-4fd9-a54e-cd2373668b6a'
},
'47b20d49-a5ef-43e2-abce-794beb3b480c': {
name: 'yd_title购买商品',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/yd_title购买商品.b0548da1dc653c283a8c12de2767c7c7d9a789d8.png',
uuid: '47b20d49-a5ef-43e2-abce-794beb3b480c'
},
'c3d50493-a738-407f-81c6-a8f03fbca0a5': {
name: 'yd_title浏览商品',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/yd_title浏览商品.78d3155ae8b60786d793b8c44fe898dc8bbbc4ea.png',
uuid: 'c3d50493-a738-407f-81c6-a8f03fbca0a5'
},
'c72c35b8-23e2-4234-adae-7a4599fab4c8': {
name: 'yd_title支付定金',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/yd_title支付定金.ca58631100ce3b73a4a8b1cff3c1bad2c060fc3a.png',
uuid: 'c72c35b8-23e2-4234-adae-7a4599fab4c8'
},
'41cc803d-f306-4fe4-8db4-d5af08be078c': {
name: '背景',
ext: '.png',
uuid: '41cc803d-f306-4fe4-8db4-d5af08be078c',
url: '//yun.duiba.com.cn/spark/assets/bc2c1b9bca981d0675688619e1352cac23b95f41.png'
},
'a6341ace-cb10-4143-8763-1a7234e80d7a': {
name: '转盘背景',
ext: '.png',
uuid: 'a6341ace-cb10-4143-8763-1a7234e80d7a',
url: '//yun.duiba.com.cn/spark/assets/4912763a1c91167f4851d65257972be68add98e0.png'
},
'738011dd-8cdc-455e-8dfa-2f17f5112bdf': {
name: '底',
ext: '.png',
uuid: '738011dd-8cdc-455e-8dfa-2f17f5112bdf',
url: '//yun.duiba.com.cn/spark/assets/4185d42f5b2a3b3ccc93a69f935207ebcf712fdb.png'
},
'050b07b7-255a-4118-9221-0d4f1d45c296': {
name: '我的奖品按钮',
ext: '.png',
uuid: '050b07b7-255a-4118-9221-0d4f1d45c296',
url: '//yun.duiba.com.cn/spark/assets/1889cc68fd051ccf0327d38281d1090bd7380a18.png'
},
'18cbbf52-1bc5-4109-b60c-59de1d06a1e7': {
name: '立即抽奖按钮',
ext: '.png',
uuid: '18cbbf52-1bc5-4109-b60c-59de1d06a1e7',
url: '//yun.duiba.com.cn/spark/assets/6f7fb07aec94ff823064c34b814969a1d6bc4be8.png'
},
'7750fff8-383d-4135-b20b-b3108d5d0845': {
name: '转盘外层',
ext: '.png',
uuid: '7750fff8-383d-4135-b20b-b3108d5d0845',
url: '//yun.duiba.com.cn/spark/assets/ea242f5734825a14f3c13983cf8ee48d4a0af815.png'
},
'b36c6a57-a96b-407d-b1a1-7745e3880ab2': {
name: '转盘内层',
ext: '.png',
uuid: 'b36c6a57-a96b-407d-b1a1-7745e3880ab2',
url: '//yun.duiba.com.cn/spark/assets/1bc631b8e0bbedfca5f3b34be5079462150c6f0d.png'
},
'9ac2fe27-618d-444d-9548-6cab5e1c76dd': {
name: '转盘针',
ext: '.png',
uuid: '9ac2fe27-618d-444d-9548-6cab5e1c76dd',
url: '//yun.duiba.com.cn/spark/assets/ab9ece3f4eb4cf7634d3f62ad152637675acf5a9.png'
},
'15f5e59b-9660-407a-a2a7-aec000ee215a': {
name: '转盘返回1',
ext: '.png',
uuid: '15f5e59b-9660-407a-a2a7-aec000ee215a',
url: '//yun.duiba.com.cn/spark/assets/f4d5e7de3995e05e91e4246888146e336b8395ab.png'
},
'2a5c22ac-2449-4e2a-af33-8e3a837e20fe': {
name: '谢谢参与',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/谢谢参与.f0ecf9469bcf589fe2b61017631ef8e507a8cf24.png',
uuid: '2a5c22ac-2449-4e2a-af33-8e3a837e20fe'
},
'3ef613f7-698f-41e1-b81d-da9e44f13fca': {
name: '为他助力',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/为他助力.bc57a24aecb04934067712c76186d800343dabd5.png',
uuid: '3ef613f7-698f-41e1-b81d-da9e44f13fca'
},
'2e06aa38-3dff-4f72-8662-417614669d43': {
name: '我也要赢大奖',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/一秒成为会员.10be8a8ede8f6c62eadb005744dc54ae182911d9.png',
uuid: '2e06aa38-3dff-4f72-8662-417614669d43'
},
'fd8a805e-e2e3-49c6-8236-1f181177a313': {
name: '一秒成为会员',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/我也要赢大奖.a22bebbd5be4a6e557ee4ef611216ba73b729d10.png',
uuid: 'fd8a805e-e2e3-49c6-8236-1f181177a313'
} }
}; };
export default resList; export default resList;
\ No newline at end of file
// 分享配置 // 分享配置
export const SHARE_CONFIG = { export let 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/homePage/homePage'
}; };
// 链接配置 // 链接配置
......
...@@ -53,7 +53,8 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => { ...@@ -53,7 +53,8 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
const requestMock = () => { const requestMock = () => {
const mockUrlPrefix = { const mockUrlPrefix = {
ams: 'https://ams.dui88.com/server/index.php?g=Web&c=Mock&o=simple&projectID=218&uri=', ams: 'https://ams.dui88.com/server/index.php?g=Web&c=Mock&o=simple&projectID=218&uri=',
yapi: 'http://localhost:3000/' local: 'http://localhost:3000/',
yapi: 'https://docs.dui88.com/mock/140/'
}; };
const mockUrl = null; const mockUrl = null;
const requestPrefix = mockUrl || mockUrlPrefix[requestType]; const requestPrefix = mockUrl || mockUrlPrefix[requestType];
...@@ -83,9 +84,9 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => { ...@@ -83,9 +84,9 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
const requestCloud = () => { const requestCloud = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// console.log('requestCloud', handle, params);
cloud.function.invoke(_cloudName, params, handle).then(res => { cloud.function.invoke(_cloudName, params, handle).then(res => {
// console.log('request Cloud callback=>', handle, res,JSON.stringify(res)); // console.log('request Cloud callback=>', handle, res, JSON.stringify(res));
// console.log('requestCloud', handle, params, res);
hideMyLoading(); hideMyLoading();
if (res && res.success) { if (res && res.success) {
resolve(res); resolve(res);
...@@ -103,8 +104,8 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => { ...@@ -103,8 +104,8 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
// console.log('requestCloud', _cloudName, handle, params); // console.log('requestCloud', _cloudName, handle, params);
// return requestType === 'ams' ? requestAms() : requestCloud(); // return requestType === 'ams' ? requestAms() : requestCloud();
if (requestType === 'yapi') return requestMock() // console.log(requestType);
else if (requestType === 'ams') return requestCloud() return (requestType === 'ams' || requestType === 'yapi'|| requestType === 'local') ? requestMock() : requestCloud();
}; };
}; };
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @param {number} duration 显示时长 * @param {number} duration 显示时长
* @param {function} successCb 成功回调 * @param {function} successCb 成功回调
*/ */
export const commonToast = (content, duration = 3000, successCb) => { export const commonToast = (content, duration = 1500, successCb) => {
my.showToast({ my.showToast({
content: content || '换个姿势再试一次~', content: content || '换个姿势再试一次~',
duration, duration,
...@@ -303,7 +303,7 @@ export const getUserAddress = async (opts = {}) => { ...@@ -303,7 +303,7 @@ export const getUserAddress = async (opts = {}) => {
scopes: 'scope.addressList', scopes: 'scope.addressList',
success: () => { success: () => {
const { addAddress, searchAddress, locateAddress, joinTag } = _opts; const { addAddress, searchAddress, locateAddress, joinTag } = _opts;
if (!my.tb || !my.tb.chooseAddress) { if (!my.tb.chooseAddress) {
reject({ reject({
noSupport: true, noSupport: true,
errorMessage: '当前版本不支持选择收货地址,请升级到最新版本' errorMessage: '当前版本不支持选择收货地址,请升级到最新版本'
...@@ -336,14 +336,10 @@ export const getUserAddress = async (opts = {}) => { ...@@ -336,14 +336,10 @@ export const getUserAddress = async (opts = {}) => {
reject(res); reject(res);
} }
); );
},
fail: err => {
reject(err);
} }
}); });
}); });
}; };
/** /**
* 选择图片 * 选择图片
*/ */
...@@ -507,6 +503,7 @@ export const textRiskIdentification = async (text) => { ...@@ -507,6 +503,7 @@ export const textRiskIdentification = async (text) => {
text text
}, },
success: res => { success: res => {
console.log('textRiskIdentification callback res',res)
if (res.data && res.data.result) { if (res.data && res.data.result) {
const { suggestion }= res.data.result; const { suggestion }= res.data.result;
if (suggestion === 'pass') { if (suggestion === 'pass') {
...@@ -527,14 +524,6 @@ export function setClipboard(params) { ...@@ -527,14 +524,6 @@ export function setClipboard(params) {
return promisifyMyApi('setClipboard', params) return promisifyMyApi('setClipboard', params)
}; };
export const ConsoleStyle = [
'color: #e06a82',
'font-size: 12px',
'font-weight: bold',
'text-shadow: 1px 1px rgba(0, 0, 0, 0.2)',
'padding: 3px',
].join(';')
function promisifyMyApi(methodName, params = {}) { function promisifyMyApi(methodName, params = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -549,3 +538,19 @@ function promisifyMyApi(methodName, params = {}) { ...@@ -549,3 +538,19 @@ function promisifyMyApi(methodName, params = {}) {
}) })
}) })
} }
export const ConsoleStyle = [
'color: #e06a82',
'font-size: 12px',
'font-weight: bold',
'text-shadow: 1px 1px rgba(0, 0, 0, 0.2)',
'padding: 3px',
].join(';')
export function debounce(fn, wait) {
var timeout = null
return function () {
if (timeout !== null) clearTimeout(timeout)
timeout = setTimeout(fn, wait)
}
}
\ 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