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 @@
"message":"ea non",
"data":{
"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",
"openId":-16899820.960220918,
......@@ -27,6 +50,52 @@
"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": 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",
"openId":-16899820.960220918,
......@@ -84,7 +153,7 @@
"type": 3,
"image":"https://dummyimage.com/400x400",
"name":"Duis nostrud dolore",
"drawStatus": 3,
"drawStatus": 1,
"createTime":1602033015243,
"updateTime":1610946860060,
"addressdetail":"laboris ea tempor elit",
......@@ -104,7 +173,7 @@
"avatar":"ullamco eu aliqua mollit eiusmod",
"activityId":"dolor",
"prizeId":"nulla enim non aliquip ipsum",
"type": 4,
"type": 3,
"image":"https://dummyimage.com/400x400",
"name":"Duis nostrud dolore",
"drawStatus": 6,
......
{
"success": false,
"success": true,
"code": "sit nulla labore in",
"data":[
{
"taskType":"oN6Bq",
"title":"2A7h2",
"taskType": "frontOrderGoods",
"title": "2A72A7h2h2",
"rewards":2,
"taskRateType":2,
"waitReceive":-13791948.109031975,
"status":-54118349.23389276,
"completeTimes":-92392435.91503823,
"times":"3",
"waitReceive": 1,
"status": 1,
"completeTimes": 2,
"times": "3",
"todayCompleteTimes":-80193158.01905021,
"itemIds":"non Duis id voluptate",
"url":"esse Ut nulla eiusmod"
}, {
"taskType":"T4[oj",
"title":"Oj2ZN",
"taskType": "invites",
"title": "Oj2ZOj2ZNN",
"rewards":2,
"taskRateType":2,
"waitReceive":-24361244.83615884,
"status":-93556772.20227832,
"completeTimes":99358061.68916574,
"times":"3",
"waitReceive": 2,
"status": 1,
"completeTimes": 2,
"times": "1",
"todayCompleteTimes":-92796921.9007521,
"itemIds":"cillum fugiat Duis pariatur Lorem",
"url":"dolor tempor in sed proident"
},
{
"taskType":"6MZs",
"title":"(1XhjD",
"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",
"taskType": "browseGoods",
"title": "(1X2A7h2hjD",
"rewards":2,
"taskRateType":2,
"waitReceive":40009903.06684077,
"status":-12612373.255133048,
"completeTimes":70433951.05683738,
"times":"3",
"waitReceive": 1,
"status": 1,
"completeTimes": 2,
"times": "3",
"todayCompleteTimes":3214292.4035636783,
"itemIds":"anim est Excepteur",
"url":"dolore labore elit Ut fugiat"
},
{
"taskType":"6MZs",
"taskType": "jumpLink",
"title":"(1XhjD",
"rewards":2,
"taskRateType":2,
"waitReceive":40009903.06684077,
"status":-12612373.255133048,
"completeTimes":70433951.05683738,
"times":"3",
"waitReceive": 2,
"status": 2,
"completeTimes": 2,
"times": "3",
"todayCompleteTimes":3214292.4035636783,
"itemIds":"anim est Excepteur",
"url":"dolore labore elit Ut fugiat"
},
{
"taskType":"6MZs",
"taskType": "orderGoods",
"title":"(1XhjD",
"rewards":2,
"taskRateType":2,
"waitReceive":40009903.06684077,
"status":-12612373.255133048,
"completeTimes":70433951.05683738,
"times":"3",
"waitReceive": 1,
"status": 2,
"completeTimes": 2,
"times": "3",
"todayCompleteTimes":3214292.4035636783,
"itemIds":"anim est Excepteur",
"url":"dolore labore elit Ut fugiat"
},
{
"taskType":"6MZs",
"taskType": "follow",
"title":"(1XhjD",
"rewards":2,
"taskRateType":2,
"waitReceive":40009903.06684077,
"status":-12612373.255133048,
"completeTimes":70433951.05683738,
"times":"3",
"waitReceive": 1,
"status": 1,
"completeTimes": 2,
"times": "1",
"todayCompleteTimes":3214292.4035636783,
"itemIds":"anim est Excepteur",
"url":"dolore labore elit Ut fugiat"
},
{
"taskType":"6MZs",
"taskType": "member",
"title":"(1XhjD",
"rewards":2,
"taskRateType":2,
"waitReceive":40009903.06684077,
"status":-12612373.255133048,
"completeTimes":70433951.05683738,
"times":"3",
"waitReceive": 1,
"status": 1,
"completeTimes": 2,
"times": "3",
"todayCompleteTimes":3214292.4035636783,
"itemIds":"anim est Excepteur",
"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 {
this.addChild(this.scoreBoard)
this.createTouchRect()
setTimeout(() => {
this.gameStartFlag = true
}, 1000)
}
// 开始游戏
......
......@@ -36,8 +36,8 @@ export default class GoodsContainer extends FYGE.Container {
// 进入可被滑动的 掉落物
intoGoods = [];
private speed = 0.3 // 初速度
private acceleratedSpeed = 0.006 // 加速度
private speed = 2.5 // 初速度
private acceleratedSpeed = 0.01 // 加速度
constructor (root) {
super()
......@@ -113,13 +113,15 @@ export default class GoodsContainer extends FYGE.Container {
let g = this.intoGoods[0]
g.turn = true
this.intoGoods.shift()
if (g.dir === direction) {
this._root.gameScoreChange(g.score)
g.turnDirection(direction)
} else {
g.turnDirection(direction)
if (g.dir !== direction) {
if (g.wrong === 'endGame') {
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 {
this.goodsArr.unshift(g)
this.goodsContainer.addChildAt(g, -1)
// g.zIndex = --this.goodsDeepIndex
}, 1250)
}, 1000)
}
createGoods () {
......@@ -239,9 +241,9 @@ export default class GoodsContainer extends FYGE.Container {
// this.removeGood(index)
} else if (!good.turn) {
let y1 = good.speed,
sx = 0.00168,
sy = 0.00168
good.alpha = good.alpha >= 0.7 ? 1 : good.alpha + 0.002
sx = 0.003,
sy = 0.003
good.alpha = good.alpha >= 0.7 ? 1 : good.alpha + 0.01
good.scaleX += sx
good.scaleY += sy
good.y += y1
......@@ -365,8 +367,8 @@ export default class GoodsContainer extends FYGE.Container {
if (line.y > 1000) {
this.removeLine(index)
} else {
let y1 = line.speed + 0.00082
line.alpha = line.alpha >= 0.2 ? 0.9 : line.alpha + 0.0008
let y1 = line.speed + 0.0009
line.alpha = line.alpha >= 0.4 ? 0.9 : line.alpha + 0.0044
line.y += y1
}
}
......
const app = getApp();
const { tbcc, cloudName, cloud, requestType } = app;
const { utils: { generateAPI }, request: tbccRequest, capi } = tbcc;
const request = tbccRequest({
......@@ -117,14 +116,47 @@ const apiList = {
isShowLoading: false
},
getPrizeConfigList: {
handle: 'getPrizeConfigList',
method:'get',
isShowLoading: false
},
doBrowseGoodsTask: {
handle: 'doBrowseGoodsTask',
method:'get',
isShowLoading: false
},
// 概率抽奖
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',
isShowLoading: false
},
// 获取商品列表
getItemListByItemIds: {
handle: 'getItemListByItemIds',
method:'get',
......
......@@ -6,11 +6,17 @@ cloud.init({
});
App({
// requestType: 'cloud', // yapi,cloud: 云函数
requestType: 'yapi', // yapi,cloud: 云函数
requestType: 'cloud', // yapi,cloud: 云函数
// requestType: 'yapi', // yapi,cloud: 云函数
cloudName: 'yd', // 主云函数项目名 base clientTemplate2C
cloud,
tbcc,
// 店铺id
sellerId: '1818112088',
// 加入会员页面
vipUrl: '',
// 直播间页面
liveUrl: '',
// 全局数据
globalData: {},
......@@ -28,7 +34,7 @@ App({
*/
handleQuery(query) {
const { activityId } = query;
this.activityId = activityId || '5f34e1c4964f9706aa7d803c';
this.activityId = activityId || '5f7294e28e6a08456786b14e';
}
});
......@@ -4,7 +4,9 @@
"pages/myprize/myprize",
"pages/index/index",
"pages/pageshop/pageshop",
"pages/tbccDemo/tbccDemo"
"pages/tbccDemo/tbccDemo",
"pages/goodsPage/goodsPage",
"pages/turnTablePage/turnTablePage"
],
"window": {
"enableSkia": "true",
......
......@@ -32,16 +32,28 @@
position: absolute;
}
.mission_scroll {
position: absolute;
z-index: 2;
width: 100%;
height: 920rpx;
box-sizing: border-box;
left: 0;
bottom: 20rpx;
}
.mission_block {
width: 702rpx;
height: 162rpx;
position: absolute;
left: 24rpx;
/* position: absolute; */
margin: 20rpx auto 0;
/* left: 24rpx; */
background: #fff;
border-radius: 10rpx;
position: relative;
}
.mission_block_5 {
/* .mission_block_5 {
top: 948rpx;
}
.mission_block_4 {
......@@ -55,7 +67,7 @@
}
.mission_block_1 {
top: 208rpx;
}
} */
.mission_icon {
width: 100rpx;
......@@ -108,6 +120,18 @@
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 {
background: linear-gradient(to right, #da5d7b, #ffabab );
}
......
......@@ -9,72 +9,25 @@
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>
<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_title">浏览制定商品30s</view>
<view class="mission_describe">乐园门票 <text class="mission_describe_hightlight">+1</text></view>
<view class="mission_title">{{item.taskNameActiv}}</view>
<view class="mission_describe">乐园门票 <text class="mission_describe_hightlight">+{{item.waitReceive}}</text></view>
</view>
<view class="mission_btn mission_btn_active" onTap="gotoSeeGoods">
<text class="mission_btn_text">去浏览</text>
<view class="mission_btn {{ item.status === 1 ? 'mission_btn_active' : '' }}"
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>
</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}}" />
</view>
......
import API from '../../api';
const app = getApp();
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;
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({
data: {
resList: resList,
......@@ -15,39 +53,156 @@ Component({
},
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) {
if (this.data.missionsList.length !== prevData.missionsList.length) {
this.setData({ missionsList: this.props.missionsList })
}
// if (this.data.missionsList.length !== prevData.missionsList.length) {
// this.setData({ missionsList: this.props.missionsList })
// }
},
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() {
const { onModalClose } = this.props;
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 @@
.huo_de_ya_dun_bi {
width: 100%;
height: 32rpx;
line-height: 32rpx;
line-height: 42rpx;
opacity: 1;
left: 0;
top: 230rpx;
......
......@@ -7,7 +7,9 @@
<text class="kan_shi_pin_jiang_li">{{title}}</text>
<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>
<image class="commonT1_btn" src="{{btnImg}}" mode="aspectFill" onTap="onModalConfirm"/>
......
......@@ -18,10 +18,10 @@
.jiang_li_dan_chuang {
width: 500rpx;
height: 523rpx;
height: 668rpx;
opacity: 1;
left: 125rpx;
top: calc(50% - 261rpx);
top: calc(50% - 334rpx);
position: absolute;
}
......@@ -38,7 +38,7 @@
height: 88rpx;
opacity: 1;
left: 31rpx;
bottom: 36rpx;
bottom: 30rpx;
position: absolute;
}
.ji_xu_guan_kan {
......@@ -46,7 +46,7 @@
height: 88rpx;
opacity: 1;
left: 262rpx;
bottom: 36rpx;
bottom: 30rpx;
position: absolute;
}
.kan_shi_pin_jiang_li {
......@@ -55,7 +55,7 @@
line-height: 56rpx;
opacity: 1;
left: 0;
top: 100rpx;
top: 70rpx;
position: absolute;
display: inline-block;
font-size: 50rpx;
......@@ -67,11 +67,11 @@
}
.huo_de_ya_dun_bi {
width: 100%;
height: 32rpx;
height: 42rpx;
line-height: 32rpx;
opacity: 1;
left: 0;
top: 230rpx;
top: 150rpx;
text-align: center;
position: absolute;
font-size: 32rpx;
......@@ -99,3 +99,18 @@
top: -50rpx;
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,19 +3,25 @@
<view class="jiang_li_dan_chuang">
<image class="dan_chuang_bei_jing2" src="{{resList['7203516e-8791-4974-955e-c8a044e16c80'].url}}"/>
<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 class="dan_chuang_bei_jing2" src="//yun.duiba.com.cn/spark/assets/弹窗背景.55cabcd27f981e4a20db75b0b9b34069ca196b3a.png"/>
<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>
<view class="flex_content">
<view class="huo_de_ya_dun_bi">{{detail}}</view>
<view class="tu_ceng40" a:if="{{}}">
<image class="flex_content_image" src="{{}}" />
<text>+{{coins}}</text>
</view>
<view class="huo_de_ya_dun_bi" style="top: {{ rewardsImg ? '150rpx' : '270rpx'}}">
<text decode="{{true}}">{{content}}</text>
</view>
</view>
<view a:if="{{rewardsImg}}" class="commonT2-modal_rewards">
<image class="commonT2-modal_rewards_image" src="{{rewardsImg}}" mode="aspectFill" />
</view>
<image
class="an_niu_guan_bi_dan_chuang_kao_bei23" onTap="onModalClose"
src="{{resList['4abc8bb6-5779-49ad-84b4-b4ade4f51fcb'].url}}"
......
......@@ -4,36 +4,37 @@ Component({
data: {
resList: resList,
title: '',
detail: '',
hasYDCoin: false,
coins: 0
content: '',
coins: 0,
btnImg1: '',
btnImg2: '',
rewardsImg: ''
},
props: {
title: '',
detail: '',
hasYDCoin: false,
content: '',
coins: 0
},
didMount () {
this.setData({
title: this.props.data.title,
detail: this.props.data.detail,
hasYDCoin: this.props.data.hasYDCoin
content: this.props.data.content,
btnImg1: this.props.data.btnImg1,
btnImg2: this.props.data.btnImg2,
rewardsImg: this.props.data.rewardsImg
})
},
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({
title: this.props.data.title,
detail: this.props.data.detail
})
}
if (this.props.data.hasYDCoin !== prevData.data.hasYDCoin) {
this.setData({
hasYDCoin: this.props.data.hasYDCoin
content: this.props.data.content,
btnImg1: this.props.data.btnImg1,
btnImg2: this.props.data.btnImg2,
rewardsImg: this.props.data.rewardsImg
})
}
},
......@@ -43,9 +44,13 @@ Component({
const { onModalClose } = this.props;
onModalClose && onModalClose();
},
onModalConfirm() {
const { onModalConfirm } = this.props;
onModalConfirm && onModalClose();
}
onModalOne () {
const { onModalOne } = this.props;
onModalOne && onModalOne();
},
onModalTwo () {
const { onModalTwo } = this.props;
onModalTwo && onModalTwo();
},
}
});
\ No newline at end of file
......@@ -18,8 +18,8 @@ Component({
data: {},
props: {
percent: 10,
usePercent:0,
countTime: 10,
usePercent: 30,
countTime: 30,
styleType: '01',//browse_txt_bg count_bg_02
data: {
text: '浏览商品10s,获得任务奖励',
......@@ -33,7 +33,9 @@ Component({
}
},
didMount() { },
didUpdate() {},
didUpdate() {
this.setData({countTime: 30 - this.props.usePercent})
},
didUnmount() { },
methods: {},
});
......@@ -6,31 +6,44 @@
bottom: 0;
width: 100%;
min-height: 100vh;
/* background: url('//yun.dui88.com/taobaomini/clientCTestgoods_bg@2x.png') no-repeat; */
background-size: 750rpx 1624rpx;
overflow: hidden;
z-index: 20;
}
.goods-modal-container__title {
.goods-modal-container_bg {
width: 750rpx;
height: 120rpx;
margin: 29rpx 0 11rpx;
height: 1624rpx;
position: absolute;
top: 0;
left: 0;
z-index: 0;
}
.goods-modal-container__banner {
width: 750rpx;
height: 400rpx;
margin-bottom: 30rpx;
background: #E1E1E1;
height: 38rpx;
margin: 30rpx 0 12rpx;
background: transparent;
position: absolute;
top: 90rpx;
}
.container__banner_image {
height: 40rpx;
width: 613rpx;
display: block;
margin: 0 auto;
}
.goods-modal-container__content {
position: absolute;
top: 190rpx;
top: 160rpx;
left: 0;
bottom: 0;
padding-top: 41rpx;
padding: 41rpx 25rpx 0;
padding: 41rpx 33rpx 0;
width: 750rpx;
/* height: inherit; */
}
.goods-modal-container__scroll {
height: 100%;
......@@ -41,36 +54,39 @@
flex-wrap: wrap;
}
.goods-modal-container__content-item {
width: 340rpx;
height: 510rpx;
background: #fff;
margin-bottom: 20rpx;
width: 320rpx;
height: 380rpx;
background: #fef5f8;;
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) {
margin-left: 20rpx;
margin-left: 40rpx;
}
.goods-modal-container__content-item__img {
width: 340rpx;
height: 340rpx;
background: #E1E1E1;
width: 320rpx;
height: 250rpx;
}
.goods-modal-container__content-item__img image {
width: 100%;
height: 100%;
background-color: #fff;
}
.goods-modal-container__content-item__name {
margin: 25rpx 0 31rpx 21rpx;
margin: 25rpx 0 20rpx 21rpx;
width:310rpx;
height:60rpx;
font-size:24rpx;
height:30rpx;
font-size: 20rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(24,24,24,1);
color:#6b6b6b;
line-height:30rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.goods-modal-container__content-item__price {
......@@ -82,7 +98,8 @@
font-size:32rpx;
font-family:PingFang SC;
font-weight:600;
color:rgba(255,42,0,1);
color: #ef525f;
font-size: bold;
}
.goods-modal-container__content-item__price-num text {
font-size: 24rpx;
......
<view class="goods-modal-container" style="{{{'background':`url(${task.image.bg}) no-repeat`}}}">
<view a:if="{{task.type == '01'}}"
style="{{{'background':`url(${task.image.title}) no-repeat`,'backgroundSize': '100% 100%'}}}" class="goods-modal-container__title"></view>
<view a:else class="goods-modal-container__banner" style="{{{'background':`url(${task.image.banner}) no-repeat`,'backgroundSize': '100% 100%','height':task.bannerHeight+'rpx'}}}"></view>
<view class="goods-modal-container__content" style="{{{'top':task.type == '02'?task.bannerHeight+'rpx':'149rpx'}}}">
<view class="goods-modal-container">
<image class="goods-modal-container_bg" src="{{task.image.bg}}"/>
<view class="goods-modal-container__banner">
<image class="container__banner_image" src="{{task.image.banner}}" />
</view>
<view class="goods-modal-container__content">
<scroll-view scroll-y="{{true}}" class="goods-modal-container__scroll">
<view class="goods-modal-container__content-list">
<view class="goods-modal-container__content-item" a:for="{{goodsList}}" a:for-item="item">
<view class="goods-modal-container__content-item__img" data-item="{{item}}" onTap="goToGoodsDetail">
<image mode="scaleToFill" src="{{item.image}}"/>
<image mode="aspectFill" src="{{item.image}}"/>
</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-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>
......
......@@ -21,7 +21,6 @@ Component({
itemId: '617724147979,617724563528,617300295119,614139753189',
taskType: 'browseGoods',
type: '02',
bannerHeight: 430,
image: {
bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
banner: '//yun.dui88.com/taobaomini/clientCTest/goods_banner@2x.png',
......@@ -34,31 +33,31 @@ Component({
},
onCompleteTask: () => {}
},
didMount() {
const { taskType } = this.props.task
this.setData({ isFlag: this.props.isBackFlag })
console.log(this.props.goodsList)
if(taskType == 'browseGoods') {
this.browseGoodsTimes()
}
},
didUpdate(prevProps,prevData) {
if(prevData.isFlag && prevProps.isBackFlag != prevData.isFlag) {
console.log(3)
// console.log(3)
if(!this.timer) {
this.setData({ usePercent: this.data.percent })
this.browseGoodsTimes()
console.log(10 - this.usePercent)
console.log(30 - this.usePercent)
}
}
},
didUnmount() {
clearTimeout(this.timer)
},
methods: {
/**
* 跳转商品详情页
*/
// 跳转商品详情页
async goToGoodsDetail(e) {
clearInterval(this.timer)
this.setData({
......@@ -68,9 +67,8 @@ Component({
const { itemId } = e.target.dataset.item
await openDetail(String(itemId))
},
/**
* 收藏商品
*/
// 收藏商品
async goToCollectGoods(e) {
const { itemId, collected } = e.target.dataset.item
const { taskType } = this.props.task
......@@ -80,9 +78,8 @@ Component({
this.props.onCompleteTask(taskType, itemId)
}
},
/**
* 浏览商品倒计时
*/
// 浏览商品倒计时
browseGoodsTimes() {
const { taskType } = this.props.task
......@@ -90,7 +87,7 @@ Component({
this.setData({
usePercent: this.data.usePercent + 1
}, () => {
if (this.data.usePercent >= 10) {
if (this.data.usePercent >= 30) {
console.log(this.data.usePercent)
this.props.onCompleteTask(taskType)
clearInterval(this.timer)
......
......@@ -24,15 +24,29 @@
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%;
height: auto;
height: 100%;
}
.my-prize-page .my-prize-empty {
text-align: center;
color: #fff;
margin-top: 30rpx;
color: gray;
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 {
......
......@@ -2,62 +2,66 @@
<view class="my-prize-wrap">
<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">
<label class="my-prize-name">{{item.name}}</label>
<!-- <view class="my-prize-subtitle"> -->
<!-- <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"> -->
<!-- <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}}">
<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.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>
<!-- 处理中 -->
<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}}">
<!-- 实物查看物流 -->
<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 onTap="handleTouse" data-item="{{item}}" src="{{task.image.useBtn}}" /> -->
</block>
<!-- 已领取 -->
<block a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.SUCCESS}}">
<!-- 实物查看物流 -->
<image a:if="{{item.type === PRIZE_TYPE_MAP.ENTITY}}" onTap="handleView" data-item="{{item}}" src="{{task.image.logisticsBth}}" />
<!-- 优惠券去使用 -->
<image a:else data-item="{{item}}" src="{{task.image.hasGetBtn}}" />
<!-- <image a:else onTap="handleTouse" data-item="{{item}}" src="{{task.image.useBtn}}" /> -->
</block>
<!-- 重新领取 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.REPEAT}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.getAgainBtn}}" />
<!-- 重新领取 -->
<image a:if="{{item.drawStatus===PRIZE_DRAW_STATUS_MAP.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>
</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>
<logistics-modal a:if="{{isLogistic}}" prizeItem="{{currentPrize}}" onCloseModal="closeLogisticModal" task="{{task.logisticsImage}}"/>
</view>
\ No newline at end of file
......@@ -18,14 +18,20 @@
.rule-modal__container {
position: absolute;
width: 500rpx;
height: 600rpx;
background: #4eafd7;
width: 470rpx;
height: 524rpx;
background-size: 100% 100%;
left: 50%;
top: 50%;
margin-left: -250rpx;
margin-top: -300rpx;
left: calc(50% - 235rpx);
top: calc(50% - 262rpx);
}
.rule-modal__container_bgimage {
width: 100%;
left: 0;
top: 0;
height: 100%;
position: absolute;
z-index: 0;
}
.rule-modal__bd {
......@@ -38,15 +44,42 @@
font-size: 24rpx;
color: #fff;
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 {
position: absolute;
right: -20rpx;
top: -80rpx;
height: 86rpx;
width: 86rpx;
background: url('../../assets/modal_close_btn.png') center center no-repeat;
top: -40rpx;
height: 60rpx;
width: 60rpx;
background-size: 48rpx 48rpx;
z-index: 9;
}
.rule-modal__close_image {
width: 60rpx;
height: 60rpx;
}
<view class="rule-modal">
<view class="rule-modal__shade modal-animate-fade-in" />
<view class="rule-modal__container modal-animate-zoom-in">
<view class="rule-modal__close" onTap="onModalClose" />
<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">
<slot />
<view class="rule-modal__bd_title">活动规则</view>
<view class="rule-modal__bd_content">
<text decode="{{true}}">{{text}}</text>
</view>
</view>
</view>
</view>
Component({
data: {
text: ''
},
props: {
text: ''
},
didMount () {
this.setData({text: this.props.text})
},
didUpdate() {
this.setData({text: this.props.text})
},
methods: {
onModalClose() {
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 @@
z-index: 0;
}
.opciaty05 {
opacity: 0.5;
}
.bottom_ydgame_block {
......@@ -162,11 +165,11 @@
position: absolute;
}
.bottom_ydgame_block_coin {
width: 199rpx;
height: 44rpx;
line-height: 44rpx;
left: 34rpx;
top: 268rpx;
width: 194rpx;
height: 40rpx;
line-height: 40rpx;
left: 0;
top: 214rpx;
background-color: #f7cbcf;
border-radius: 21rpx;
text-align: center;
......@@ -185,16 +188,18 @@
position: absolute;
}
.bottom_mission_block_freenum {
width: 100%;
width: 224rpx;
height: 40rpx;
line-height: 40rpx;
opacity: 1;
left: 0;
top: 206rpx;
left: 20rpx;
top: 266rpx;
position: absolute;
font-size: 23.8rpx;
font-weight: 500;
color: rgba(200, 82, 73, 1);
border-radius: 20rpx;
background-color: #f7cbcf;
text-align: center;
}
.bottom_mission_block_image {
......@@ -237,8 +242,8 @@
z-index: 40;
width: 140rpx;
height: 100rpx;
top: 30;
right: 30;
top: 0;
left: 100rpx;
background: rgba(255, 255, 255, .9);
color: rgb(0, 0, 0);
font-size: 22rpx;
......
......@@ -10,8 +10,8 @@
<!-- 头部 规则-奖品 按钮 -->
<view class="head">
<image class="head_ruler" onTap="showCommonMoadalT1" 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="showRuleModal" 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}}" />
</view>
......@@ -46,13 +46,16 @@
<view class="video_hide" onTap="videoHideFunc"> 缩小视频 </view>
<!-- 视频部分 -->
<view hidden="{{videoBottom_timeout}}" onTap="videoShowFunc" class="video_block {{ videoBottom ? 'block_opciaty0' : ''}}">
<view class="video_block_wrapper">
<view hidden="{{videoBottom_timeout}}" class="video_block {{ videoBottom ? 'block_opciaty0' : ''}}">
<view class="video_block_wrapper" onTap="videoShowFunc" >
<view class="video_block_text">
<image src="{{videoImgSrcSmall}}" mode="aspectFill" />
<view>观看XXXXX视频</view>
<view>赢惊喜抽奖次数</view>
</view>
<!--
<view class="video_block_up" onTap="onVideoTurnSmall">收起视频</view>
-->
</view>
<!-- 按钮组 左-右 -->
......@@ -60,37 +63,36 @@
<image class="video_btn_right" onTap="videoTurnRight" src="{{resList['cf73af84-5751-4aee-a754-9106162786d9'].url}}" />
</view>
<!--
<view hidden="{{!videoBottom_timeout}}" onTap="onVideoTurnBig" class="video_block_s {{ !videoBottom ? 'block_opciaty0' : ''}}" >
<!-- <image class='video_s' src='' /> -->
<view class='video_s'></view>
<image class="bo_fang_an_niu" src="{{resList['8d5b83a6-59d9-484c-a74e-99f13ba20b02'].url}}" />
<view class="video_block_tips">看视频 赢金币</view>
</view>
-->
<!-- 底部 门票-乐园-抽奖 -->
<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}}" />
</view>
<view class="bottom_ydgame_block" onTap="openShowChooseGame">
<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 class="bottom_mission_block" onTap="showMissionModal">
<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 class="gamechoose_block" a:if='{{ showChooseGame }}'>
<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='2' onTap="changeGameOrPage" class="gamechoose_block_xxl" src="{{resList['7aafb158-7fec-4ae1-a83e-496779c4a107'].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 {{ ticketNum ? '' : 'opciaty05' }}" src="{{resList['7aafb158-7fec-4ae1-a83e-496779c4a107'].url}}" />
<view class="gameChoose_mask" onTap="closeShowChooseGame"></view>
</view>
</view>
......@@ -110,9 +112,9 @@
<!-- 弹窗部分 -->
<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>
<prizes-modal a:if="{{prizesModalVisible}}" onModalClose="closePrizesModal"></prizes-modal>
<mission-modal a:if="{{missionModalVisible}}" onModalClose="closeMissionModal"></mission-modal>
......@@ -3,7 +3,7 @@ import API from "/api";
import { SHARE_CONFIG } from '/tbcc-sdk/lib/constants';
const app = getApp();
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;
let flag = false;
......@@ -23,7 +23,7 @@ Page({
addressBth: '//yun.duiba.com.cn/spark/assets/mybtn填写地址.ca58f849aea9c78e0290060624e1dd987ca988ae.png', //填写地址(实物奖品)
addressPriceBth: '//yun.duiba.com.cn/spark/assets/mybtn付邮费领取.dc12fb67b913ba8dd444e800b70f4fd54d377692.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', //重新领取
invalidBtn: '//yun.duiba.com.cn/spark/assets/mybtn已失效.2fc529b912383145770f97a6c9dd7c413e528172.png', //已失效
failBth: '//yun.duiba.com.cn/spark/assets/mybtn领取失败.3fd23d113a41180b24da14e071772e167ce13b1a.png', //领取失败
......@@ -82,25 +82,25 @@ Page({
my.showLoading();
}
const { success, data, message } = await API.getMyPrizeList({ activityId })
.catch(res => {
this.setData({
myPrizeList: []
})
}) || {};
if (success && data) {
this.setData({
myPrizeList: data.list
API.getMyPrizeList({ activityId })
.then(res => {
const { success, data, message } = res
if (!success) { console.warn(res); commonToast(res && res.message) }
else {
console.log('%c-----获取我的奖品\n' + '-----yd.getMyPrizeList\n', ConsoleStyle, data)
this.setData({ myPrizeList: data })
this.getEndTime(data.list)
}
if (type != 'noLoading') { my.hideLoading() }
})
this.getEndTime(data.list)
}
if (type != 'noLoading') {
my.hideLoading();
}
.catch(res => {
console.warn(res); commonToast(res && res.message);
if (type != 'noLoading') { my.hideLoading() } }) || {};
},
//领取奖品
// 领取奖品
async handleClick(e) {
console.log(e)
const { item } = e.target.dataset;
// 领取权益
if (item.type === PRIZE_TYPE_MAP.EQUITY) return this.handleGetEquity(e)
......@@ -123,6 +123,7 @@ Page({
commonToast(res && res.message)
}) || {};
if (success && data) {
console.log('%c-----领取权益\n' + '-----yd.receiveEnamePrize\n', ConsoleStyle, data)
commonToast('领取成功')
this.getMyPrize()
}
......@@ -135,7 +136,7 @@ Page({
if (flag) {
return
}
// my.showLoading();
my.showLoading();
flag = true;
const { activityId } = app;
const { item } = e.target.dataset;
......@@ -143,14 +144,14 @@ Page({
flag = false
console.log('getUserAddress出错了,错误信息是',data);
})
// my.hideLoading();
my.hideLoading();
if (!userAddress) return
// commonToast(' getUserAddress =>'+JSON.stringify( userAddress))
const { name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName } = userAddress || {};
const params = {
activityId,
area:countyName,
addressdetail:detailInfo,
addressDetail:detailInfo,
name,
phone: telNumber,
detailInfo,
......@@ -161,6 +162,7 @@ Page({
provinceName,
countyName,
streetName,
id:item._id,
_id: item._id
}
......@@ -183,21 +185,23 @@ Page({
// 领取实物
async receiveObjectPrize(params) {
// commonToast('正在调用receiveObjectPrize'+JSON.stringify(params))
API.receiveObjectPrize(params).then((res) => {
// setTimeout(() => {
// commonToast(JSON.stringify(res))
// }, 5000);
API.receiveObjectPrize(params)
.then((res) => {
// setTimeout(() => {
// commonToast(JSON.stringify(res))
// }, 5000);
const { success, data, message } = res;
if (success && data) {
commonToast('领取成功')
} else {
commonToast(message)
}
this.getMyPrize()
},(rej)=>{
commonToast(rej.message)
});
const { success, data, message } = res;
if (success && data) {
commonToast('领取成功')
} else {
commonToast(message)
}
this.getMyPrize()
}, (rej)=>{
commonToast(rej.message)
})
.catch(res => { console.warn(res); commonToast(res && res.message); flag = false }) || {};z
},
// 积分
async handleGetIntergation(e) {
......@@ -207,11 +211,11 @@ Page({
flag = true;
// 判断是否为会员
await this.getUserInfo()
const { isVip, vipLink } = app;
const { isVip, vipUrl } = app;
if (!isVip) {
commonToast('立即加入会员,即可领取奖品', 2000);
setTimeout(() => {
navigateToOutside(vipLink)
navigateToOutside(vipUrl)
}, 1000)
flag = false
return
......@@ -219,26 +223,41 @@ Page({
const { activityId } = app;
const { item } = e.target.dataset;
console.log(item, '领取积分')
const { success, data, message } = await API.receiveEnamePrize({ activityId, _id: item._id }) || {};
if (success && data) {
commonToast('领取成功')
} else {
commonToast(message)
}
flag = false
this.getMyPrize()
API.receiveEnamePrize({ activityId, _id: item._id })
.then(res => {
const { success, data, message } = res
if (success && data) {
console.log('%c-----领取积分\n' + '-----yd.receiveEnamePrize\n', ConsoleStyle, data)
commonToast('领取成功')
flag = false
this.getMyPrize()
} else {
commonToast(message)
flag = false
}
})
.catch(res => { console.warn(res); commonToast(res && res.message); flag = false }) || {};
},
//获取用户vip信息
async getUserInfo() {
const { activityId } = app;
const { success, data, message } = await API.getVipInfo({ activityId }) || {};
console.log(data, '用户vip信息');
if (success && data) {
app.isVip = (data && data.isVip) || false;
app.vipLink = (data && data.url) || '';
} else {
commonToast(message)
}
const { activityId, inviteId } = app;
API.getVipInfo({ activityId, inviteId })
.then(res => {
const { success, data, message } = res
console.log('%c-----用户vip信息\n' + '-----yd.getVipInfo\n', ConsoleStyle, data)
if (success && data) {
app.isVip = (data && data.isVip) || false;
app.vipUrl = (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({
/**
* 关注店铺
*/
async favorShop() {
const sellerId = 628189716; // 百草味sellerId
async favorShop(sellerId) {
// const sellerId = 628189716; // 百草味sellerId
const favorStatus = await favorShop(sellerId).catch(err => {
console.log('关注店铺失败', err);
});
commonToast(favorStatus ? '关注成功' : '关注失败');
return favorStatus
},
/**
* 查询店铺关注状态
......@@ -162,7 +163,7 @@ Page({
* 跳转到外部链接
*/
navigateToOutside() {
const url = 'https://www.tmall.com';
const url = app.vipUrl;
navigateToOutside(url);
},
/**
......
......@@ -2,10 +2,10 @@
top: 0rpx;
left: 0rpx;
width: 750rpx;
height: auto;
min-height: 100vh;
display: block;
position: relative;
height: 1624rpx;
position: fixed;
top: calc(50% - 812rpx);
left: 0;
}
.turntable_wrapper .bg1 {
......@@ -55,11 +55,11 @@
}
.rotate {
width: 648rpx;
height: 648rpx;
width: 578rpx;
height: 578rpx;
opacity: 1;
left: 52rpx;
top: 426rpx;
left: 85rpx;
top: 527rpx;
position: absolute;
z-index: 10;
transform-origin: center center;
......@@ -80,10 +80,8 @@
.backboard {
width: 586rpx;
height: 586rpx;
opacity: 1;
margin: 31rpx auto;
width: 100%;
height: 100%;
/* left: 142rpx;
top: 526rpx;
position: absolute; */
......@@ -96,12 +94,13 @@
.rewards {
width: 464rpx;
height: 448rpx;
height: 464rpx;
opacity: 1;
left: 92rpx;
top: 100rpx;
left: 57rpx;
top: 57rpx;
position: absolute;
z-index: 2;
/* background: yellowgreen; */
}
.rewards_item {
......@@ -111,22 +110,28 @@
opacity: 1;
/* background-color: black; */
transform-origin: center center;
padding-top: 10rpx;
}
.rewards_item_name {
display: block;
width: 100%;
line-height: 2em;
font-size: 20rpx;
color: rgba(239, 43, 31, 1);
font-size: 26rpx;
color: #bb3346;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.rewards_item_image {
display: block;
width: 96rpx;
height: 96rpx;
margin: 4rpx auto 0;
margin: 10rpx auto 0;
}
......@@ -136,8 +141,8 @@
}
.rewards_item_1{
left: -6rpx;
top: 140rpx;
left: -20rpx;
top: 154rpx;
}
.rewards_item_2{
......@@ -151,8 +156,8 @@
}
.rewards_item_4{
right: -6rpx;
top: 140rpx;
right: -20rpx;
top: 154rpx;
}
.rewards_item_5{
......@@ -161,52 +166,33 @@
}
.rotate_block .rotate_shadow {
width: 750rpx;
height: 1519rpx;
opacity: 0.10;
position: absolute;
}
.rotate_block .outside {
width: 648rpx;
height: 648rpx;
width: 620rpx;
height: 620rpx;
opacity: 1;
left: 52rpx;
top: 426rpx;
left: 64rpx;
top: 505rpx;
position: absolute;
}
.turntable .start_button {
width: 148rpx;
height: 173rpx;
width: 210rpx;
height: 228rpx;
opacity: 1;
left: 302rpx;
top: 650rpx;
left: 274rpx;
top: 700rpx;
position: absolute;
z-index: 10;
}
.start_button .start_button_image {
width: 148rpx;
height: 173rpx;
width: 210rpx;
height: 228rpx;
opacity: 1;
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 @@
height: 24rpx;
opacity: 1;
left: 0;
top: 1148rpx;
top: 498rpx;
position: absolute;
font-size: 24rpx;
text-align: center;
color: rgba(0, 0, 0, 1);
color: #d95477;
}
.logo25 {
......
<view class="turntable_wrapper">
<!-- 背景 -->
<image class="bg1" src="{{resList['d5744a06-e2d1-461e-9163-795e5a6bc0b1'].url}}" />
<image class="zhuang_shi_kao_bei" src="{{resList['6340407d-93c4-449d-99af-d989f8122bcf'].url}}" />
<image class="bg1" src="{{resList['a6341ace-cb10-4143-8763-1a7234e80d7a'].url}}" />
<!-- MAIN BLOCK -->
......@@ -10,14 +9,13 @@
<!-- 旋转转盘 -->
<view class="turntable">
<view class="turntable_rotate">
<view class="rotate_block">
<!-- 转盘阴影 -->
<image class="rotate_shadow" src="{{resList['9afd16fe-ad73-4429-8249-ae238b7390fe'].url}}" />
<!-- 旋转部分 -->
<view class="rotate" animation="{{myAnimation}}">
<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 class="rewards">
......@@ -33,14 +31,13 @@
</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 class="start_button" onTap='handdlerStartButton'>
<image class="start_button_image" src="{{resList['12643641-690f-4d56-be21-7c4c41b2177c'].url}}" />
<label class="start_button_text">开始 抽奖</label>
<image class="start_button_image" src="{{resList['9ac2fe27-618d-444d-9548-6cab5e1c76dd'].url}}" />
</view>
</view>
......
import { commonToast, getAuthUserInfo, navigateToOutside } from '../../utils/utils'
import { SHARE_CONFIG, REDIRECT_URL } from '../../constants'
import API from '../../api'
import resList from '../../resList'
import { debounce } from '../../utils/utils'
const app = getApp()
const app = getApp();
import API from '../../api';
import { clickStat } from '../../md';
import resList from '../../resconfig/resList.js'
const { tbcc } = app;
const { SHARE_CONFIG, REDIRECT_URL } = tbcc.constants;
const { commonToast, getAuthUserInfo, navigateToOutside, ConsoleStyle, checkShopFavoredStatus, debounce } = tbcc.tb;
Page({
data: {
resList: resList,
listTurnTable_test: [1, 2, 3, 4, 5], // 转盘奖品信息_测试
listTurnTable: [], // 转盘奖品信息
listRange: [], // 排行榜奖品信息
prizeList: [], // props中获取到的奖品信息
tempStyle: { // 转盘旋转
transform: ''
......@@ -32,44 +31,45 @@ Page({
let { activityId } = app
this.activityId = activityId
this.getDataTurnTable()
this.getDataRange()
this.getGameInfo()
},
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 () {
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)
}) || {}
if (success && data) {
// 开发用
console.log('res Rewards: type- TurnTable', data)
console.log('%c-----获取转盘奖品\n' + '-----getPrizeConfigList\n', ConsoleStyle, data)
let heartBroken = {
image: resList['acf10efc-702b-4145-aad3-805e269acb46'].url,
image: resList['2a5c22ac-2449-4e2a-af33-8e3a837e20fe'].url,
name: '谢谢参与',
type: 5
}
data.list.splice(4, 0, heartBroken)
// list.push(heartBroken)
this.setData({ listTurnTable: data.list, leftTimes: data.leftTimes })
}
},
data.push(...data)
data.push(heartBroken)
async getDataRange () {
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 })
this.setData({ listTurnTable: data, leftTimes: data.leftTimes })
}
},
......@@ -86,14 +86,21 @@ Page({
console.log('startDraw run')
if (this.data.rotateFlag) return
if (!this.data.leftTimes > 0) {
commonToast('您没有抽奖次数 快去邀请好友入会吧')
commonToast('您还没有抽奖次数')
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)
return
}) || {}
// let success = true
// let data = {
// id: '5f7295860cb733e8928791b6',
// type: 3,
// }
this.setData({ rotateFlag: true })
if (success && data) {
......@@ -109,7 +116,7 @@ Page({
// 1:权益(优惠券),2:积分,3:实物
} else if (data.type == 1 || data.type == 2 || data.type == 3) {
this.data.listTurnTable.forEach((item, index) => {
if (item.itemId == data.id) {
if (item._id == data.id) {
rotateT = index + 1
rotateT = 4 + 1
this.setData({ rewardsInfo: data })
......
......@@ -371,11 +371,245 @@ const resList = {
url: '//yun.duiba.com.cn/spark/assets/mybtn查看物流.03ea3cdd889c8f09885b24a56dc99460734bc8a6.png',
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': {
name: 'yd_happypark_new',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/yd_happypark_new.9c828c4054ba32b97937fd955b93d73029cc315e.png',
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 = {
title: '爱斐楼上请',
desc: '积分盖楼赢锦鲤 享一年新衣',
export let SHARE_CONFIG = {
title: '雅顿乐园',
desc: '雅顿乐园 邀请好友助力',
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' }) => {
const requestMock = () => {
const mockUrlPrefix = {
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 requestPrefix = mockUrl || mockUrlPrefix[requestType];
......@@ -83,9 +84,9 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
const requestCloud = () => {
return new Promise((resolve, reject) => {
// console.log('requestCloud', handle, params);
cloud.function.invoke(_cloudName, params, handle).then(res => {
// console.log('request Cloud callback=>', handle, res,JSON.stringify(res));
// console.log('requestCloud', handle, params, res);
// console.log('request Cloud callback=>', handle, res, JSON.stringify(res));
hideMyLoading();
if (res && res.success) {
resolve(res);
......@@ -103,8 +104,8 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
// console.log('requestCloud', _cloudName, handle, params);
// return requestType === 'ams' ? requestAms() : requestCloud();
if (requestType === 'yapi') return requestMock()
else if (requestType === 'ams') return requestCloud()
// console.log(requestType);
return (requestType === 'ams' || requestType === 'yapi'|| requestType === 'local') ? requestMock() : requestCloud();
};
};
......
......@@ -4,7 +4,7 @@
* @param {number} duration 显示时长
* @param {function} successCb 成功回调
*/
export const commonToast = (content, duration = 3000, successCb) => {
export const commonToast = (content, duration = 1500, successCb) => {
my.showToast({
content: content || '换个姿势再试一次~',
duration,
......@@ -300,10 +300,10 @@ export const getUserAddress = async (opts = {}) => {
let _opts = Object.assign({}, defaults, opts);
return new Promise((resolve, reject) => {
my.authorize({
scopes: 'scope.addressList',
scopes: 'scope.addressList',
success: () => {
const { addAddress, searchAddress, locateAddress, joinTag } = _opts;
if (!my.tb || !my.tb.chooseAddress) {
if (!my.tb.chooseAddress) {
reject({
noSupport: true,
errorMessage: '当前版本不支持选择收货地址,请升级到最新版本'
......@@ -336,14 +336,10 @@ export const getUserAddress = async (opts = {}) => {
reject(res);
}
);
},
fail: err => {
reject(err);
}
});
});
};
/**
* 选择图片
*/
......@@ -507,6 +503,7 @@ export const textRiskIdentification = async (text) => {
text
},
success: res => {
console.log('textRiskIdentification callback res',res)
if (res.data && res.data.result) {
const { suggestion }= res.data.result;
if (suggestion === 'pass') {
......@@ -527,14 +524,6 @@ export function 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 = {}) {
return new Promise((resolve, reject) => {
......@@ -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