Commit db4086a0 authored by AU-Pro-mac's avatar AU-Pro-mac

add change

parent f832654d
{"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,
......
...@@ -3,104 +3,91 @@ ...@@ -3,104 +3,91 @@
"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
...@@ -125,7 +125,8 @@ export class Main { ...@@ -125,7 +125,8 @@ export class Main {
this.loadImageTextures(resCanvasList).then(res => { this.loadImageTextures(resCanvasList).then(res => {
// changeScene(OpenAni) // changeScene(OpenAni)
changeScene(XxlScene) // changeScene(XxlScene)
changeScene(CsdScene)
}) })
await InitLottie.initLottieList(resLottieList); await InitLottie.initLottieList(resLottieList);
......
...@@ -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) { g.turnDirection(direction)
this._root.gameScoreChange(g.score) if (g.dir !== direction) {
g.turnDirection(direction)
} else {
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
} }
} }
......
...@@ -116,14 +116,47 @@ const apiList = { ...@@ -116,14 +116,47 @@ 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', method:'get',
isShowLoading: false isShowLoading: false
}, },
// 获取商品列表 // 获取商品列表
getItemListByItemIds: {
handle: 'getItemListByItemIds',
method:'get',
isShowLoading: false
},
// 完成关注店铺
doFollowTask: {
handle: 'doFollowTask',
method:'get',
isShowLoading: false
},
// 领取完成任务奖励
receiveTaskRewards: {
handle: 'receiveTaskRewards',
method:'get',
isShowLoading: false
},
// 获取商品列表
getItemListByItemIds: { getItemListByItemIds: {
handle: 'getItemListByItemIds', handle: 'getItemListByItemIds',
method:'get', method:'get',
......
...@@ -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,72 +9,25 @@ ...@@ -9,72 +9,25 @@
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">
<text a:if="{{item.status === 1}}" class="mission_btn_text">{{item.btnText}}</text>
<text a:if="{{item.status === 2}}" class="mission_btn_text">待领取</text>
<text a:if="{{item.status === 3}}" class="mission_btn_text">已完成</text>
<view a:if="{{item.taskType === 'invites'}}" class="mission_invite_tips">{{item.completeTimes}}个好友为你助力成功</view>
</view> </view>
</view> </view>
</scroll-view> </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 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>
<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}}" />
</view> </view>
......
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 = {
"frontOrderGoods": {
"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,154 @@ Component({ ...@@ -15,39 +53,154 @@ 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 "frontOrderGoods":
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) {
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)
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))
}, },
} }
......
...@@ -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,9 +24,17 @@ ...@@ -24,9 +24,17 @@
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 {
......
...@@ -2,61 +2,65 @@ ...@@ -2,61 +2,65 @@
<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">
<scroll-view scroll-y="{{true}}" class="my-prize-list" a:if="{{myPrizeList && myPrizeList.length > 0}}">
<view 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}}"> <image class="my-prize-avatar" src="{{item.image}}"/>
<image class="my-prize-avatar" src="{{item.image}}"/> <view class="my-prize-content">
<label class="my-prize-name">{{item.name}}</label>
<view class="my-prize-content"> <!-- <view class="my-prize-subtitle"> -->
<label class="my-prize-name">{{item.name}}</label> <!-- <label class="my-prize-code">奖品编码:{{item._id}}</label> -->
<!-- </view> -->
<!-- 复制按钮 -->
<image class="my-prize-copy" data-text="{{item._id}}" onTap="handleCopyId" src="{{task.image.copyIcon}}" />
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.FAILURE}}">{{item.remark}}</view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.REPEAT || (item.drawStatus === PRIZE_DRAW_STATUS_MAP.RECEIVE)}}">请于{{item.endTime}}前领取</view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.FINISHED }}">奖品已过期失效</view>
</view>
<!-- <view class="my-prize-subtitle"> --> <view class="prize-status" style="{{task.btnStyle}}">
<!-- <label class="my-prize-code">奖品编码:{{item._id}}</label> -->
<!-- </view> -->
<!-- 复制按钮 -->
<image class="my-prize-copy" data-text="{{item._id}}" onTap="handleCopyId" src="{{task.image.copyIcon}}" />
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.FAILURE}}">{{item.remark}}</view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.REPEAT || (item.drawStatus === PRIZE_DRAW_STATUS_MAP.RECEIVE)}}">请于{{item.endTime}}前领取</view>
<view class="my-prize-tip" a:if="{{item.drawStatus === PRIZE_DRAW_STATUS_MAP.FINISHED }}">奖品已过期失效</view>
</view>
<view class="prize-status" style="{{task.btnStyle}}"> <!-- 未领取 -->
<block a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.RECEIVE}}">
<!-- 实物填写地址 -->
<image a:if="{{item.type === PRIZE_TYPE_MAP.ENTITY}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.addressBth}}" />
<!-- 优惠券立即领取 -->
<image a:else onTap="handleClick" data-item="{{item}}" src="{{task.image.jj}}" />
</block>
<!-- 未领取 --> <!-- 处理中 -->
<block a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.RECEIVE}}"> <image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.DEALING}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.doOptions}}" />
<!-- 实物填写地址 -->
<image a:if="{{item.type === PRIZE_TYPE_MAP.ENTITY}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.addressBth}}" />
<!-- 优惠券立即领取 -->
<image a:else onTap="handleClick" data-item="{{item}}" src="{{task.image.getBth}}" />
</block>
<!-- 已领取 --> <!-- 已领取 -->
<block a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.SUCCESS}}"> <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>
<!-- 重新领取 --> <!-- 重新领取 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.REPEAT}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.getAgainBtn}}" /> <image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.REPEAT}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.getAgainBtn}}" />
<!-- 已失效 --> <!-- 已失效 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.FINISHED}}" src="{{task.image.invalidBtn}}" /> <image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.FINISHED}}" src="{{task.image.invalidBtn}}" />
<!-- 领取失败 --> <!-- 领取失败 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.FAILURE}}" src="{{task.image.failBth}}" /> <image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.FAILURE}}" src="{{task.image.failBth}}" />
</view>
</view> </view>
</view> </scroll-view>
</view> </view>
<view a:if="{{myPrizeList && myPrizeList.length === 0}}" class="my-prize-empty">暂无奖品</view> <view a:if="{{myPrizeList && myPrizeList.length === 0}}" 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 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
...@@ -162,11 +162,11 @@ ...@@ -162,11 +162,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 +185,18 @@ ...@@ -185,16 +185,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 {
......
...@@ -72,18 +72,18 @@ ...@@ -72,18 +72,18 @@
<!-- 底部 门票-乐园-抽奖 --> <!-- 底部 门票-乐园-抽奖 -->
<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>
<!-- 选择游戏 --> <!-- 选择游戏 -->
......
...@@ -4,7 +4,7 @@ import { clickStat } from '../../md'; ...@@ -4,7 +4,7 @@ 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: () => {
...@@ -31,7 +31,7 @@ Page({ ...@@ -31,7 +31,7 @@ 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',
], ],
// 是否关注电批 // 是否关注店铺
isFollow: false, isFollow: false,
// 进入时获取 邀请码 // 进入时获取 邀请码
inviteId: '', inviteId: '',
...@@ -85,6 +85,9 @@ Page({ ...@@ -85,6 +85,9 @@ Page({
rewardsModalVisible: false, rewardsModalVisible: false,
prizesModalVisible: false, prizesModalVisible: false,
missionModalVisible: false, missionModalVisible: false,
ticketNum: 0,
drawNum: 0,
}, },
async onLoad (query) { async onLoad (query) {
...@@ -98,8 +101,8 @@ Page({ ...@@ -98,8 +101,8 @@ Page({
// this.init() // this.init()
// }) // })
// 打点 // test - 打点
clickStat(1, '2') // clickStat(1, '2')
this.getAuth() this.getAuth()
}, },
...@@ -121,10 +124,16 @@ Page({ ...@@ -121,10 +124,16 @@ 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) {
console.log('%c-----用户登陆信息\n' + '-----yd.login\n', ConsoleStyle, data) console.log('%c-----用户登陆信息\n' + '-----yd.login\n', ConsoleStyle, data)
app.openId = data.openId
this.init(data); this.init(data);
} }
}, },
...@@ -141,24 +150,13 @@ Page({ ...@@ -141,24 +150,13 @@ Page({
} }
}) })
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {}; .catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
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)
this.setData({
missionDataList: data
})
}
})
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
}, },
// 分享 // 分享
onShareAppMessage() { onShareAppMessage() {
// 返回自定义分享信息 // 返回自定义分享信息
SHARE_CONFIG.imageUrl = ''
SHARE_CONFIG.path = this.changeURLArg('/pages/homePage/homePage&', 'shareId', app.openId)
return SHARE_CONFIG; return SHARE_CONFIG;
}, },
...@@ -214,6 +212,10 @@ Page({ ...@@ -214,6 +212,10 @@ 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 () {
...@@ -412,4 +414,21 @@ Page({ ...@@ -412,4 +414,21 @@ Page({
this.setData({ title, content, rule }); this.setData({ title, content, rule });
} }
}, },
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;
}
}
}
}); });
...@@ -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({ this.getEndTime(data.list)
myPrizeList: data.list }
if (type != 'noLoading') { my.hideLoading() }
}) })
this.getEndTime(data.list) .catch(res => {
} console.warn(res); commonToast(res && res.message);
if (type != 'noLoading') { if (type != 'noLoading') { my.hideLoading() } }) || {};
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,7 +144,7 @@ Page({ ...@@ -143,7 +144,7 @@ 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 || {};
...@@ -183,21 +184,23 @@ Page({ ...@@ -183,21 +184,23 @@ 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)
// setTimeout(() => { .then((res) => {
// commonToast(JSON.stringify(res)) // setTimeout(() => {
// }, 5000); // commonToast(JSON.stringify(res))
// }, 5000);
const { success, data, message } = res; const { success, data, message } = res;
if (success && data) { if (success && data) {
commonToast('领取成功') commonToast('领取成功')
} else { } else {
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) {
...@@ -219,26 +222,41 @@ Page({ ...@@ -219,26 +222,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 })
if (success && data) { .then(res => {
commonToast('领取成功') const { success, data, message } = res
} else { if (success && data) {
commonToast(message) console.log('%c-----领取积分\n' + '-----yd.receiveEnamePrize\n', ConsoleStyle, data)
} commonToast('领取成功')
flag = false flag = false
this.getMyPrize() this.getMyPrize()
} else {
commonToast(message)
flag = false
}
})
.catch(res => { console.warn(res); commonToast(res && res.message); flag = false }) || {};
}, },
//获取用户vip信息 //获取用户vip信息
async getUserInfo() { async getUserInfo() {
const { activityId } = app; const { activityId } = app;
const { success, data, message } = await API.getVipInfo({ activityId }) || {}; API.getVipInfo({ activityId })
console.log(data, '用户vip信息'); .then(res => {
if (success && data) { const { success, data, message } = res
app.isVip = (data && data.isVip) || false; console.log('%c-----用户vip信息\n' + '-----yd.getVipInfo\n', ConsoleStyle, data)
app.vipLink = (data && data.url) || ''; if (success && data) {
} else { app.isVip = (data && data.isVip) || false;
commonToast(message) app.vipLink = (data && data.url) || '';
} flag = false
this.getMyPrize()
} else {
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.gameTimes })
}
})
.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,227 @@ const resList = { ...@@ -371,11 +371,227 @@ 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'
} }
}; };
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];
...@@ -84,7 +85,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => { ...@@ -84,7 +85,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
const requestCloud = () => { const requestCloud = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
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); // console.log('requestCloud', handle, params, res);
hideMyLoading(); hideMyLoading();
if (res && res.success) { if (res && res.success) {
...@@ -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,
...@@ -300,10 +300,10 @@ export const getUserAddress = async (opts = {}) => { ...@@ -300,10 +300,10 @@ export const getUserAddress = async (opts = {}) => {
let _opts = Object.assign({}, defaults, opts); let _opts = Object.assign({}, defaults, opts);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
my.authorize({ my.authorize({
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,9 +336,6 @@ export const getUserAddress = async (opts = {}) => { ...@@ -336,9 +336,6 @@ export const getUserAddress = async (opts = {}) => {
reject(res); reject(res);
} }
); );
},
fail: err => {
reject(err);
} }
}); });
}); });
...@@ -507,6 +504,7 @@ export const textRiskIdentification = async (text) => { ...@@ -507,6 +504,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 +525,6 @@ export function setClipboard(params) { ...@@ -527,14 +525,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 +539,19 @@ function promisifyMyApi(methodName, params = {}) { ...@@ -549,3 +539,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