Commit 5100ac8e authored by AU-Pro-mac's avatar AU-Pro-mac

add new code --04

parent b973aeff
......@@ -124,6 +124,24 @@ const resCanvasListCsd = {
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/传送带左边传送带.9ecaa198fe5be733f7de4f917aac0d8a8474aa0b.png',
uuid: '2137d3de-174f-42b1-8ebc-c5eb667ed250'
},
'828f6676-7956-473a-a951-bc2f5f1ba8a3': {
name: 'csd引导1',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/csd引导1.d0aed3a62df5cbac7680a56fb8fd3403e76abe1f.png',
uuid: '828f6676-7956-473a-a951-bc2f5f1ba8a3'
},
'bc6aa86d-7cd8-4a11-9bd1-931040af3c6e': {
name: 'csd引导2',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/csd引导2.17f2a21407b5e055d93595f63c9c23d029828ab9.png',
uuid: 'bc6aa86d-7cd8-4a11-9bd1-931040af3c6e'
},
'0668f8d0-6fb3-46f9-a5e4-952aef42f05c': {
name: 'csd引导3',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/csd引导3.3cb22a085628a6e43b4e13182c1a26c1ec4c259d.png',
uuid: '0668f8d0-6fb3-46f9-a5e4-952aef42f05c'
}
};
export default resCanvasListCsd;
\ No newline at end of file
import { RES } from "../../module/RES"
import resCanvasList from '../../resCanvasList'
import resCanvasListCsd from '../../resCanvasListCsd'
import { Ins } from "../Ins";
import { GDispatcher, Main } from './../Main';
import ScoreBoard from './game/ScoreBoard'
import { changeScene, showPanel } from "../../module/ctrls";
......@@ -34,6 +36,9 @@ export default class Root extends FYGE.Container {
touchXStart: number
touchYStart: number
//引导页
guideRes = ["828f6676-7956-473a-a951-bc2f5f1ba8a3", "bc6aa86d-7cd8-4a11-9bd1-931040af3c6e", "0668f8d0-6fb3-46f9-a5e4-952aef42f05c"]
time: number = 0 // 游戏时间 倒计时 时长
......@@ -70,7 +75,25 @@ export default class Root extends FYGE.Container {
const userInfoRes = await sendTbNet(TbNetName.getUserInfo, {})
this.userInfo = userInfoRes.data
console.log('CSD-GAME this.userInfo:', userInfoRes.data)
showPanel(MatchingPanel, this.userInfo)
if (this.userInfo.isNewUser) {
let i = 0
let guide = Ins.initSprite(this.guideRes[i])
guide.addEventListener(FYGE.MouseEvent.CLICK, () => {
i++
if (i > this.guideRes.length - 1) {
guide.visible = false
setTimeout(() => {
showPanel(MatchingPanel, this.userInfo)
}, 200)
} else {
guide.texture = Ins.getRes(this.guideRes[i])
}
}, this)
this.addChild(guide)
} else {
showPanel(MatchingPanel, this.userInfo)
}
// this.gameStart()
GDispatcher.addEventListener('MatchCompelete', this.gameStart, this)
......
......@@ -110,7 +110,7 @@ export default class Catecher extends FYGE.Container {
// 分数大于 3
if (scoreNow !== 0 && scoreNow > 3) {
console.log(scoreNow - this.scoreLeft)
// console.log(scoreNow - this.scoreLeft)
// 随机 加 3分 或 1分
if (scoreNow - this.scoreLeft >= 3) {
if (scoreNow - this.scoreRight <= 30) {
......
......@@ -11,6 +11,8 @@ App({
cloudName: 'yd', // 主云函数项目名 base clientTemplate2C
cloud,
tbcc,
// 用户 opneId
openId: '',
// 店铺id
sellerId: '1818112088',
// 加入会员页面
......
......@@ -15,22 +15,22 @@
<view class="mission_content">
<view class="mission_title">{{item.taskNameActiv}}</view>
<view a:if="{{item.type === 'moneyGoods'}}" class="">每支付1笔定金乐园门票<text class="mission_describe_hightlight">+{{item.rewards}}</text></view>
<view a:if="{{item.type === 'invites'}}" class="">每邀请1名好友入会乐园门票<text class="mission_describe_hightlight">+{{item.rewards}}</text></view>
<view a:if="{{item.type === 'orderGoods'}}" class="">每完成1笔下单乐园门票<text class="mission_describe_hightlight">+{{item.rewards}}</text></view>
<view a:if="{{item.type === 'moneyGoods' && item.type !== 'invites' && item.type !== 'orderGoods'}}"
<view a:if="{{item.taskType === 'moneyGoods'}}" class="mission_describe">每支付1笔定金乐园门票<text class="mission_describe_hightlight">+{{item.rewards}}</text></view>
<view a:if="{{item.taskType === 'invites'}}" class="mission_describe">每邀请1名好友入会乐园门票<text class="mission_describe_hightlight">+{{item.rewards}}</text></view>
<view a:if="{{item.taskType === 'orderGoods'}}" class="mission_describe">每完成1笔下单乐园门票<text class="mission_describe_hightlight">+{{item.rewards}}</text></view>
<view a:if="{{item.taskType !== 'moneyGoods' && item.taskType !== 'invites' && item.taskType !== 'orderGoods'}}"
class="mission_describe">乐园门票<text class="mission_describe_hightlight">+{{item.rewards}}</text></view>
</view>
<view class="mission_btn {{ item.status === 1 ? 'mission_btn_active' : '' }}"
data-type="{{item.taskType}}" data-status="{{item.status}}" data-itemIds="{{item.itemIds}}" data-info="{{item}}" onTap="doTaskByType">
data-taskType="{{item.taskType}}" data-status="{{item.status}}" data-itemIds="{{item.itemIds}}" data-info="{{item}}" 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>
<!-- 如果测试 这里 关注店铺 任务有bug
<text a:if="{{item.status === 2 && item.type === 'follow'}}" class="mission_btn_text">待领取</text>
<text a:if="{{item.status === 3 && item.type !== 'follow'}}" class="mission_btn_text">已完成</text>
<text a:if="{{item.status === 2 && item.taskType === 'follow'}}" class="mission_btn_text">待领取</text>
<text a:if="{{item.status === 3 && item.taskType !== 'follow'}}" class="mission_btn_text">已完成</text>
-->
<view a:if="{{item.taskType === 'invites'}}" class="mission_invite_tips">{{item.completeTimes}}个好友为你助力成功</view>
......
......@@ -108,7 +108,7 @@ Component({
doTaskByType (e) {
let ds = e.currentTarget.dataset
if (ds.status === 1) {
switch (ds.type) {
switch (ds.taskType) {
case "moneyGoods":
this.gotoFrontOrderGoods(ds.itemIds)
break;
......@@ -119,7 +119,7 @@ Component({
this.gotoBrowseGoods(ds.itemIds)
break;
case "jumpLink":
this.gotoJumpLink()
this.gotoJumpLink(ds.info.url)
break;
case "orderGoods":
this.gotoOrderGoods(ds.itemIds)
......@@ -128,21 +128,21 @@ Component({
this.gotoFollow()
break;
case "member":
this.gotoMember()
this.gotoMember(ds.info.url)
break;
default:
break;
}
} else if (ds.status === 2) {
// 如果测试 这里 关注店铺 任务有bug
// } else if (ds.status === 2 || (ds.status === 3 && ds.type === 'follow')) {
API.receiveTaskRewards({activityId: app.activityId, taskType: ds.type})
// } else if (ds.status === 2 || (ds.status === 3 && ds.taskType === 'follow')) {
API.receiveTaskRewards({activityId: app.activityId, taskType: ds.taskType})
.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)
if (ds.type === 'invites') {
if (ds.taskType === 'invites') {
commonToast(`已有${ds.info.todayCompleteTimes}位还有为你助力,获得次数,乐园门票+${Number(ds.info.todayCompleteTimes) * Number(ds.info.rewards)}`)
} else {
commonToast('领取成功')
......@@ -176,8 +176,8 @@ Component({
},
// 看直播
gotoJumpLink() {
navigateToOutside(app.liveUrl)
gotoJumpLink(url) {
navigateToOutside(url)
},
// 完成下单商品
......@@ -204,8 +204,8 @@ Component({
},
// 成为会员
gotoMember () {
navigateToOutside(app.vipUrl)
gotoMember (url) {
navigateToOutside(url)
},
// 跳转商品详情页
......
.newUser-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 20;
}
.newUser-modal__shade {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.75);
}
.newUser-modal__container {
position: absolute;
width: 470rpx;
height: 524rpx;
background-size: 100% 100%;
left: calc(50% - 235rpx);
top: calc(50% - 262rpx);
}
.newUser-modal__container_bgimage {
width: 100%;
left: 0;
top: 0;
height: 100%;
position: absolute;
z-index: 0;
}
.newUser-modal__bd {
position: absolute;
top: 40rpx;
left: 40rpx;
right: 40rpx;
bottom: 40rpx;
overflow-x: hidden;
font-size: 24rpx;
color: #fff;
line-height: 1.5;
z-index: 10;
overflow: hidden;
}
.newUser-modal__bd_title {
color: #f26267;
font-size: 32rpx;
font-weight: bold;
text-align: center;
width: 100%;
margin-top: 44rpx;
line-height: 66rpx;
height: 66rpx;
}
.newUser-modal__bd_content {
width: 100%;
text-align: center;
color: #000;
margin-top: 210rpx;
font-size: 26rpx;
height: 40rpx;
line-height: 40rpx;
}
.newUser-modal__bd_know {
width: 280rpx;
height: 65rpx;
position: absolute;
bottom: 22rpx;
left: 95rpx;
z-index: 10;
}
.newUser-modal__bd_know_image {
width: 100%;
height: 100%;
}
.newUser-modal__close {
position: absolute;
right: -20rpx;
top: -40rpx;
height: 60rpx;
width: 60rpx;
background-size: 48rpx 48rpx;
z-index: 9;
}
.newUser-modal__close_image {
width: 60rpx;
height: 60rpx;
}
<view class="newUser-modal">
<view class="newUser-modal__shade modal-animate-fade-in" />
<view class="newUser-modal__container modal-animate-zoom-in">
<image class="newUser-modal__container_bgimage" src="{{resList['210f6fd2-04c8-4779-a9f1-a1d92bf7ba90'].url}}" mode="aspectFill" />
<view class="newUser-modal__close" onTap="onModalClose">
<image class="newUser-modal__close_image" src="//yun.duiba.com.cn/spark/assets/弹窗2关闭.478515dc464257d3f3e7c09b760b30e35d439a20.png" mode="aspectFill" />
</view>
<view class="newUser-modal__bd">
<view class="newUser-modal__bd_title">欢迎光临</view>
<view class="newUser-modal__bd_content">
<text>有机会获得清空购物车大奖哦</text>
</view>
</view>
<view class="newUser-modal__bd_know" onTap="onModalClose">
<image class="newUser-modal__bd_know_image" src="{{resList['392bf401-3882-4f55-95c5-c9265a229b32'].url}}" mode="aspectFill" />
</view>
</view>
</view>
import resList from '../../resconfig/resList'
Component({
data: {
resList: resList
},
props: {},
didMount () {},
didUpdate() {},
methods: {
onModalClose() {
const { onModalClose } = this.props;
onModalClose && onModalClose();
}
}
});
\ No newline at end of file
......@@ -124,6 +124,7 @@
<common-modal-t2 a:if="{{commonModalVisibleT2}}" data="{{commonModalDataT2}}" onModalClose="closeCommonModalT2" onModalOne="onModalT2One" onModalTwo="onModalT2Two"/>
<rule-modal a:if="{{ruleModalVisible}}" onModalClose="closeRuleModal" text="{{rule}}"></rule-modal>
<newuser-modal a:if="{{newUserModalVisible}}" onModalClose="closeNewUserModal"></newuser-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" onRefreshGameInfo="getGameInfo"></mission-modal>
......@@ -81,6 +81,7 @@ Page({
onModalT2Two: null,
commonModalVisibleT2: false,
ruleModalVisible: false,
newUserModalVisible: false,
rewardsModalVisible: false,
prizesModalVisible: false,
missionModalVisible: false,
......@@ -136,6 +137,12 @@ Page({
app.openId = data.openId
this.isNewUser = data.isNewUser
// 首次进入 弹出活动规则
if (this.isNewUser) this.showNewUserModal()
// 检测是否参与过 消消乐 和 传送带游戏
this.checkNewUserInGame()
this.getGameInfo()
this.init(data);
......@@ -276,7 +283,7 @@ Page({
// 用户今日首次进入
userFirstInToday () {
// 自动播放视频
this.videoShowFunc()
// this.videoShowFunc()
},
// 分享
......@@ -288,10 +295,7 @@ Page({
},
// 页面加载完成
onReady() {
this.videoCtx = my.createVideoContext('videoCtx')
this.videoCtx.play()
},
onReady() { this.videoCtx = my.createVideoContext('videoCtx') },
// 页面显示
onShow() { if (this.userLogin) this.getGameInfo() },
......@@ -310,9 +314,9 @@ Page({
drawNum: data.lotteryTimes,
// ticketNum: 1,
// drawNum: 1,
todayFirstLogin: data.todayFirstLogin
// todayFirstLogin: data.todayFirstLogin
})
if (this.data.todayFirstLogin) this.userFirstInToday()
// if (this.data.todayFirstLogin) this.userFirstInToday()
}
resolve('complete')
})
......@@ -515,6 +519,7 @@ Page({
showPrizesModal() { this.setData({ prizesModalVisible: true }) },
showMissionModal () { this.setData({ missionModalVisible: true}) },
showNewUserModal () { this.setData({ newUserModalVisible: true }) },
// 显示通用弹层
showCommonMoadalT1 ({
......@@ -548,15 +553,30 @@ Page({
confirmCommonModalT1 () { this.data.confirmCommonModalT1() },
// 弹窗控制 - 关闭
closeRuleModal() { this.setData({ ruleModalVisible: false }) },
closeRewardsModal () { this.setData({ rewardsModalVisible: false}) },
closePrizesModal () { this.setData({ prizesModalVisible: false}) },
closeMissionModal () { this.setData({ missionModalVisible: false}) },
closeNewUserModal() { this.setData({ newUserModalVisible: false }) },
closeRewardsModal () {
this.setData({ rewardsModalVisible: false})
this.getGameInfo()
},
closePrizesModal () {
this.setData({ prizesModalVisible: false})
this.getGameInfo()
},
closeMissionModal () {
this.setData({ missionModalVisible: false})
this.getGameInfo()
},
// 通用弹层 - 关闭 - T1
closeCommonModalT1() { this.setData({ commonModalVisibleT1: false }); },
closeCommonModalT1() {
this.setData({ commonModalVisibleT1: false });
this.getGameInfo()
},
// 通用弹层 - 关闭 - T2
closeCommonModalT2() { this.setData({ commonModalVisibleT2: false }); },
closeCommonModalT2() {
this.setData({ commonModalVisibleT2: false });
this.getGameInfo()
},
// 点击前 检查活动 开始结束时间
checkStartEndTime () {
let time = new Date()
......@@ -582,7 +602,16 @@ Page({
})
}
},
// 检测是否参与过 消消乐 和 传送带游戏
checkNewUserInGame () {
let resXxl = my.getStorageSync({ key: `YD11_firstInGameXxl_${app.activityId}_${app.openId}` })
if (resXxl.data && resXxl.data === 1) app.isNewUser_xxl = true
else app.isNewUser_xxl = false
let resCsd = my.getStorageSync({ key: `YD11_firstInGameCsd_${app.activityId}_${app.openId}` })
if (resCsd.data && resCsd.data === 1) app.isNewUser_csd = true
else app.isNewUser_csd = false
},
onUnload() {
// 页面被关闭
},
......
......@@ -7,6 +7,7 @@
"common-modal-t1": "/components/commonModalT1/commonModalT1",
"common-modal-t2": "/components/commonModalT2/commonModalT2",
"mission-modal": "/components/comMissionModal/comMissionModal",
"end-modal": "/components/endModal/endModal"
"end-modal": "/components/endModal/endModal",
"newuser-modal": "/components/newUserModal/newUserModal"
}
}
\ No newline at end of file
......@@ -40,6 +40,20 @@ Component({
// 切换游戏场景
if (!this.main) return
this.main.changeGameSence(this.props.gameType)
// 存储本地 用户玩游戏的信息
if (this.props.gameType === 1) {
my.setStorage({
key: `YD11_firstInGameCsd_${app.activityId}_${app.openId}`,
data: 1
});
app.isNewUser_csd = true
} else if (this.props.gameType === 2) {
my.setStorage({
key: `YD11_firstInGameCsd_${app.activityId}_${app.openId}`,
data: 1
});
app.isNewUser_xxl = true
}
}
},
......
......@@ -634,6 +634,19 @@ const resList = {
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/视频暂停按钮.b02345a3f9a24464df94a1f8bd4bcfe4182ad40c.png',
uuid: '1a37baca-db9c-4e06-8bd3-e8bd78c72b1d'
}
},
'392bf401-3882-4f55-95c5-c9265a229b32': {
name: '首次进入按钮m',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/首次进入按钮m.f01c1112f10f030d421cf0a7018f12256c6f98cd.png',
uuid: '392bf401-3882-4f55-95c5-c9265a229b32'
},
'210f6fd2-04c8-4779-a9f1-a1d92bf7ba90': {
name: '首次进入弹窗背景m',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/首次进入弹窗背景m.3713e5c54c1efbccc1452fb070ea13d590ab26dd.png',
uuid: '210f6fd2-04c8-4779-a9f1-a1d92bf7ba90'
},
};
export default resList;
\ 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