Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qiaqia_qx
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邱旭
qiaqia_qx
Commits
ec1680f1
Commit
ec1680f1
authored
Jun 11, 2020
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
aebab240
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
239 additions
and
97 deletions
+239
-97
workspace.xml
.idea/workspace.xml
+48
-29
qiaqia2.completeTask.json
mock/miniTb/qiaqia2.completeTask.json
+5
-0
qiaqia2.exchangeGoods.json
mock/miniTb/qiaqia2.exchangeGoods.json
+20
-0
qiaqia2.getExchangeGoodsList.json
mock/miniTb/qiaqia2.getExchangeGoodsList.json
+9
-3
qiaqia2.getMyPrizeList.json
mock/miniTb/qiaqia2.getMyPrizeList.json
+41
-0
qiaqia2.getTaskList.json
mock/miniTb/qiaqia2.getTaskList.json
+1
-1
panelCtrl.ts
module/ctrls/panelCtrl.ts
+12
-8
TaoBaoNet.ts
src/TaoBaoNet.ts
+6
-0
ExRecordPanel.ts
src/panels/ExRecordPanel.ts
+12
-34
ExSuccessPanel.ts
src/panels/ExSuccessPanel.ts
+23
-6
ExchangePanel.ts
src/panels/ExchangePanel.ts
+33
-13
TaskPanel.ts
src/panels/TaskPanel.ts
+26
-1
UILayer.ts
src/parts/UI/UILayer.ts
+3
-2
No files found.
.idea/workspace.xml
View file @
ec1680f1
This diff is collapsed.
Click to expand it.
mock/miniTb/qiaqia2.completeTask.json
0 → 100644
View file @
ec1680f1
{
"success"
:
true
,
"message"
:
""
,
"data"
:
true
}
mock/miniTb/qiaqia2.exchangeGoods.json
0 → 100644
View file @
ec1680f1
{
"code"
:
"000000"
,
"data"
:{
"image"
:
"https://source.unsplash.com/user/erondu/250x250"
,
"amount"
:
20
,
"drawStatus"
:
4
,
"openId"
:
"AAEAuNyCAKrpWdzBzedO22-F"
,
"remark"
:
"订购应用已过期,请联系商家处理"
,
"type"
:
1
,
"prizeId"
:
"5edf3a16f344891ad1f6adab"
,
"activityId"
:
"5edf3a162fccfb74b1d9c5e3"
,
"ename"
:
"111111"
,
"userNick"
:
"wmm"
,
"name"
:
"权益奖品"
,
"_id"
:
"AAEAuNyCAKrpWdzBzedO22-F1591776396365"
,
"exchangeDay"
:
"2020/06/10"
},
"success"
:
true
,
"message"
:
"成功"
}
mock/miniTb/qiaqia2.getExchangeGoodsList.json
View file @
ec1680f1
...
...
@@ -19,7 +19,9 @@
"startTime"
:
1591682068000
,
"_id"
:
"5edf3a16f344891ad1f6adab"
,
"endTime"
:
1591682068000
,
"type"
:
1
"type"
:
1
,
"desc"
:
"描述描述描述描述"
,
"stock"
:
2000
},
{
"image"
:
"https://source.unsplash.com/user/erondu/100x100"
,
...
...
@@ -69,7 +71,9 @@
"startTime"
:
1591682068000
,
"_id"
:
"5edf3a16f344891ad1f6adab"
,
"endTime"
:
1591682068000
,
"type"
:
1
"type"
:
1
,
"desc"
:
"描述描述描述描述"
,
"stock"
:
2000
},
{
"image"
:
"https://source.unsplash.com/user/erondu/100x100"
,
...
...
@@ -89,7 +93,9 @@
"startTime"
:
1591682068000
,
"_id"
:
"5edf3a16f344891ad1f6adab"
,
"endTime"
:
1591682068000
,
"type"
:
1
"type"
:
1
,
"desc"
:
"描述描述描述描述"
,
"stock"
:
2000
}
],
"success"
:
true
...
...
mock/miniTb/qiaqia2.getMyPrizeList.json
0 → 100644
View file @
ec1680f1
{
"code"
:
"000000"
,
"data"
:
[
{
"image"
:
"https://source.unsplash.com/user/erondu/250x250"
,
"amount"
:
20
,
"drawStatus"
:
4
,
"openId"
:
"AAEAuNyCAKrpWdzBzedO22-F"
,
"remark"
:
"订购应用已过期,请联系商家处理"
,
"updateTime"
:
1591775841679
,
"type"
:
1
,
"prizeId"
:
"5edf3a16f344891ad1f6adab"
,
"activityId"
:
"5edf3a162fccfb74b1d9c5e3"
,
"ename"
:
"111111"
,
"userNick"
:
"wmm"
,
"createTime"
:
1591775841651
,
"name"
:
"权益奖品"
,
"_id"
:
"AAEAuNyCAKrpWdzBzedO22-F1591775841650"
,
"exchangeDay"
:
"2020/06/10"
},
{
"image"
:
"https://source.unsplash.com/user/erondu/250x250"
,
"amount"
:
20
,
"drawStatus"
:
4
,
"openId"
:
"AAEAuNyCAKrpWdzBzedO22-F"
,
"remark"
:
"订购应用已过期,请联系商家处理"
,
"updateTime"
:
1591775703547
,
"type"
:
1
,
"prizeId"
:
"5edf3a16f344891ad1f6adab"
,
"activityId"
:
"5edf3a162fccfb74b1d9c5e3"
,
"ename"
:
"111111"
,
"userNick"
:
"wmm"
,
"createTime"
:
1591775703513
,
"name"
:
"权益奖品"
,
"_id"
:
"AAEAuNyCAKrpWdzBzedO22-F1591775703513"
,
"exchangeDay"
:
"2020/06/10"
}
],
"success"
:
true
,
"message"
:
"成功"
}
mock/miniTb/qiaqia2.getTaskList.json
View file @
ec1680f1
...
...
@@ -20,7 +20,7 @@
{
"taskType"
:
"follow"
,
"times"
:
1
,
"todayCompleteTimes"
:
0
,
"todayCompleteTimes"
:
1
,
"rewards"
:
2
,
"value"
:
""
,
"waitReceive"
:
0
...
...
module/ctrls/panelCtrl.ts
View file @
ec1680f1
import
{
Panel
}
from
"../views/Panel"
;
import
{
layers
}
from
"../views/layers"
;
import
{
showWaiting
,
hideWaiting
}
from
"./waitingCtrl"
;
import
{
showToast
}
from
"./toastCtrl"
;
import
Tween
=
FYGE
.
Tween
;
export
default
class
PanelCtrl
{
/**
...
...
@@ -45,7 +44,12 @@ export default class PanelCtrl {
* 关闭所有弹框
*/
closeAll
()
{
this
.
stacks
.
forEach
(
e
=>
e
.
hidePanel
());
this
.
stacks
.
forEach
(
e
=>
{
Tween
.
removeTweens
(
e
);
// e.hidePanel();
e
.
destroy
();
}
);
}
show
<
T
extends
Panel
>
(
cls
:
any
,
data
?:
any
):
T
{
...
...
@@ -82,7 +86,7 @@ export default class PanelCtrl {
this
.
_bg
.
visible
=
true
;
this
.
_bg
.
alpha
=
0
;
FYGE
.
Tween
.
removeTweens
(
this
.
_bg
);
FYGE
.
Tween
.
get
(
this
.
_bg
).
to
({
alpha
:
0.7
},
200
,
FYGE
.
Ease
.
cubicOut
)
FYGE
.
Tween
.
get
(
this
.
_bg
).
to
({
alpha
:
0.7
},
200
,
FYGE
.
Ease
.
cubicOut
)
}
}
...
...
src/TaoBaoNet.ts
View file @
ec1680f1
...
...
@@ -33,10 +33,16 @@ export enum TbNetName {
shopList
=
'qiaqia2.getExchangeGoodsList'
,
completeTask
=
'qiaqia2.completeTask'
,
taskList
=
'qiaqia2.getTaskList'
,
wareHouse
=
'qiaqiaHome.getStorages'
,
exchangeGoods
=
'qiaqia2.exchangeGoods'
,
getMyPrizeList
=
'qiaqia2.getMyPrizeList'
,
// 游戏信息
gameInfo
=
'qiaqiaHome.getGameInfo'
,
...
...
src/panels/ExRecordPanel.ts
View file @
ec1680f1
import
{
Panel
}
from
"../../module/views/Panel"
;
import
{
Tool
}
from
"../Tools"
;
import
Sprite
=
FYGE
.
Sprite
;
import
{
layers
}
from
"../../module/views/layers"
;
import
{
activityId
,
sendTbNet
,
TbNetName
}
from
"../TaoBaoNet"
;
import
Sprite
=
FYGE
.
Sprite
;
import
Tween
=
FYGE
.
Tween
;
import
ScrollList
=
FYGE
.
ScrollList
;
import
Container
=
FYGE
.
Container
;
...
...
@@ -32,36 +33,12 @@ export default class ExRecordPanel extends Panel {
this
.
scroll
=
this
.
addChild
(
new
ScrollList
(
RecordItem
,
653
,
200
,
653
,
830
));
this
.
scroll
.
position
.
set
((
this
.
width
-
this
.
scroll
.
width
)
/
2
,
210
);
this
.
scroll
.
updateData
([
{
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
prizeName
:
'恰恰10元抵扣卷'
,
prizeDate
:
'1010.01.01'
,
},
{
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
prizeName
:
'恰恰20元抵扣卷'
,
prizeDate
:
'2020.02.02'
,
},
{
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
prizeName
:
'恰恰30元抵扣卷'
,
prizeDate
:
'3030.03.03'
,
},
{
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
prizeName
:
'恰恰40元抵扣卷'
,
prizeDate
:
'4040.04.04'
,
},
{
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
prizeName
:
'恰恰50元抵扣卷'
,
prizeDate
:
'5050.05.05'
,
},
]);
sendTbNet
(
TbNetName
.
getMyPrizeList
,
{
activityId
:
activityId
},
(
success
,
res
)
=>
{
if
(
!
success
)
return
;
this
.
scroll
.
updateData
(
res
.
data
);
});
}
public
showAni
()
{
...
...
@@ -111,9 +88,9 @@ class RecordItem extends Container implements IScrollListItem {
public
initData
(
id
:
number
,
data
:
any
):
void
{
if
(
!
data
)
return
;
this
.
prizeImg
.
texture
=
Texture
.
fromUrl
(
data
.
prizeImg
);
this
.
prizeName
.
text
=
data
.
prizeN
ame
;
this
.
prizeDate
.
text
=
`
${
data
.
prizeDate
}
兑换`
;
this
.
prizeImg
.
texture
=
Texture
.
fromUrl
(
data
.
image
);
this
.
prizeName
.
text
=
data
.
n
ame
;
this
.
prizeDate
.
text
=
`
${
data
.
exchangeDay
}
兑换`
;
}
constructor
()
{
...
...
@@ -123,6 +100,7 @@ class RecordItem extends Container implements IScrollListItem {
this
.
prizeImg
=
this
.
addChild
(
new
Sprite
());
this
.
prizeImg
.
position
.
set
(
34
,
25
);
this
.
prizeImg
.
width
=
this
.
prizeImg
.
height
=
116
;
const
mask
=
this
.
addChild
(
new
Graphics
());
mask
.
drawCircle
(
92
,
83
,
58
);
...
...
src/panels/ExSuccessPanel.ts
View file @
ec1680f1
...
...
@@ -3,6 +3,9 @@ import { Tool } from "../Tools";
import
Sprite
=
FYGE
.
Sprite
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
import
TextField
=
FYGE
.
TextField
;
import
Texture
=
FYGE
.
Texture
;
import
{
showToast
}
from
"../../module/ctrls"
;
import
PanelCtrl
from
"../../module/ctrls/panelCtrl"
;
export
default
class
ExSuccessPanel
extends
Panel
{
get
groupNames
()
{
...
...
@@ -22,14 +25,15 @@ export default class ExSuccessPanel extends Panel {
this
.
closeBtn
.
position
.
set
(
600
,
350
);
// 图片
this
.
prizeImg
=
this
.
addChild
(
Tool
.
getSprite
(
'进度_fill.png'
));
this
.
prizeImg
=
this
.
addChild
(
new
Sprite
());
this
.
prizeImg
.
texture
=
Texture
.
fromUrl
(
this
.
data
.
image
);
this
.
prizeImg
.
width
=
427
;
this
.
prizeImg
.
height
=
200
;
this
.
prizeImg
.
position
.
set
((
this
.
width
-
this
.
prizeImg
.
width
)
/
2
,
677
);
// 文案
this
.
prizeLabel
=
this
.
addChild
(
new
TextField
());
this
.
prizeLabel
.
text
=
'6字文案'
;
this
.
prizeLabel
.
text
=
this
.
data
.
name
;
this
.
prizeLabel
.
fillColor
=
'#c28b4c'
;
this
.
prizeLabel
.
size
=
24
;
this
.
prizeLabel
.
position
.
set
((
this
.
width
-
this
.
prizeLabel
.
textWidth
)
/
2
,
910
);
...
...
@@ -39,18 +43,31 @@ export default class ExSuccessPanel extends Panel {
this
.
btn
.
position
.
set
((
this
.
width
-
this
.
btn
.
width
)
/
2
,
960
);
}
private
clickBtn
()
{
if
(
+
this
.
data
.
type
==
1
&&
(
this
.
data
.
drawStatus
==
4
||
this
.
data
.
drawStatus
==
6
))
{
showToast
(
'奖品发放失败
\
n请前往我的奖品处进行处理'
);
}
else
if
(
+
this
.
data
.
type
==
3
)
{
/// TODO 淘宝地址选择页?
}
this
.
hideAll
();
}
private
hideAll
()
{
PanelCtrl
.
instance
.
closeAll
();
}
start
(
data
)
{
super
.
start
();
}
initEvents
()
{
this
.
closeBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
hide
Pane
l
,
this
);
this
.
btn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
hidePanel
,
this
);
this
.
closeBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
hide
Al
l
,
this
);
this
.
btn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
clickBtn
,
this
);
}
removeEvents
()
{
this
.
closeBtn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
hide
Pane
l
,
this
);
this
.
btn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
hidePanel
,
this
);
this
.
closeBtn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
hide
Al
l
,
this
);
this
.
btn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
clickBtn
,
this
);
}
}
src/panels/ExchangePanel.ts
View file @
ec1680f1
...
...
@@ -8,6 +8,10 @@ import MouseEvent = FYGE.MouseEvent;
import
Container
=
FYGE
.
Container
;
import
TEXT_ALIGN
=
FYGE
.
TEXT_ALIGN
;
import
TEXT_lINETYPE
=
FYGE
.
TEXT_lINETYPE
;
import
{
activityId
,
sendTbNet
,
TbNetName
}
from
"../TaoBaoNet"
;
import
PanelCtrl
from
"../../module/ctrls/panelCtrl"
;
import
ExSuccessPanel
from
"./ExSuccessPanel"
;
import
{
showToast
}
from
"../../module/ctrls"
;
export
class
ExchangePanel
extends
Panel
{
get
groupNames
()
{
...
...
@@ -50,32 +54,48 @@ export class ExchangePanel extends Panel {
this
.
btn
=
this
.
addChild
(
Tool
.
getSprite
(
enough
?
'exchange_btn_en.png'
:
'exchange_btn_dis.png'
));
enough
&&
this
.
btn
.
addEventListener
(
MouseEvent
.
CLICK
,
()
=>
{
console
.
log
(
'兑换'
);
/// TODO
});
this
.
btn
.
position
.
set
((
this
.
width
-
this
.
btn
.
width
)
/
2
,
876
);
this
.
setExchangeInfo
();
let
introduction
=
this
.
addChild
(
Tool
.
getText
(
`商品介绍:
${
this
.
data
.
name
}
`
,
20
,
'#dbd2ca'
));
let
introduction
=
this
.
addChild
(
Tool
.
getText
(
`商品介绍:
${
this
.
data
.
desc
}
`
,
20
,
'#dbd2ca'
));
introduction
.
textWidth
=
470
;
introduction
.
lineType
=
TEXT_lINETYPE
.
MULTI
;
introduction
.
textAlign
=
TEXT_ALIGN
.
LEFT
;
introduction
.
position
.
set
(
139
,
980
);
if
(
this
.
data
.
type
==
1
)
{
// let sDate = new Date(this.data.startTime);
let
eDate
=
new
Date
(
this
.
data
.
endTime
);
// let sLabel = `${sDate.getFullYear()}/${sDate.getMonth() + 1}/${sDate.getDate()}`;
let
eLabel
=
`
${
eDate
.
getFullYear
()}
/
${
eDate
.
getMonth
()
+
1
}
/
${
eDate
.
getDate
()}
${
eDate
.
getHours
()}
:
${
eDate
.
getMinutes
()}
`
;
let
date
=
this
.
addChild
(
Tool
.
getText
(
`
${
eLabel
}
合成截止`
,
20
,
'#dbd2ca'
));
date
.
position
.
set
(
137
,
introduction
.
y
+
introduction
.
textHeight
+
5
);
}
//
if (this.data.type == 1) {
//
// let sDate = new Date(this.data.startTime);
//
let eDate = new Date(this.data.endTime);
//
// let sLabel = `${sDate.getFullYear()}/${sDate.getMonth() + 1}/${sDate.getDate()}`;
//
let eLabel = `${eDate.getFullYear()}/${eDate.getMonth() + 1}/${eDate.getDate()} ${eDate.getHours()}:${eDate.getMinutes()}`;
//
let date = this.addChild(Tool.getText(`${eLabel}合成截止`, 20, '#dbd2ca'));
//
date.position.set(137, introduction.y + introduction.textHeight + 5);
//
}
if
(
this
.
data
.
isLimitStock
)
{
// 库存剩余label
let
stock
=
this
.
addChild
(
Tool
.
getText
(
`剩余数量:
${
this
.
data
.
restStock
}
/
${
this
.
data
.
stock
}
份`
,
20
,
'#dbd2ca'
));
introduction
.
textWidth
=
470
;
introduction
.
lineType
=
TEXT_lINETYPE
.
MULTI
;
introduction
.
textAlign
=
TEXT_ALIGN
.
LEFT
;
stock
.
position
.
set
(
137
,
introduction
.
y
+
introduction
.
textHeight
+
5
);
}
enough
&&
this
.
btn
.
addEventListener
(
MouseEvent
.
CLICK
,
()
=>
{
console
.
log
(
'兑换'
);
sendTbNet
(
TbNetName
.
exchangeGoods
,
{
activityId
:
activityId
,
_id
:
this
.
data
.
_id
},
(
success
,
res
)
=>
{
if
(
!
success
||
!
res
||
!
res
.
data
)
{
showToast
(
'兑换失败,请稍后再试'
)
return
;
}
let
data
=
res
.
data
;
PanelCtrl
.
instance
.
show
(
ExSuccessPanel
,
data
);
});
});
}
private
setExchangeInfo
()
{
...
...
src/panels/TaskPanel.ts
View file @
ec1680f1
...
...
@@ -11,6 +11,7 @@ import Tween = FYGE.Tween;
import
TextField
=
FYGE
.
TextField
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
import
Ease
=
FYGE
.
Ease
;
import
{
showToast
}
from
"../../module/ctrls"
;
const
TASK_TYPE
=
{
sign
:
'sign'
,
...
...
@@ -52,7 +53,19 @@ export default class TaskPanel extends Panel {
if
(
!
success
)
{
return
;
}
this
.
scroll
.
updateData
(
res
.
data
);
const
a
=
[
'member'
,
'follow'
,
'joinGroup'
,
];
let
data
=
[];
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
if
(
a
.
indexOf
(
res
.
data
[
i
].
taskType
)
>
-
1
&&
res
.
data
[
i
].
todayCompleteTimes
>=
res
.
data
[
i
].
times
)
{
continue
;
}
data
.
push
(
res
.
data
[
i
]);
}
this
.
scroll
.
updateData
(
data
);
});
}
...
...
@@ -159,11 +172,23 @@ class TaskItem extends Container implements IScrollListItem {
}
else
{
this
.
btn
.
texture
=
RES
.
getRes
(
'task_go.png'
);
this
.
btn
.
addEventListener
(
MouseEvent
.
CLICK
,
()
=>
{
/// TODO 跳转链接?
if
(
data
.
taskType
==
'joinGroup'
||
data
.
taskType
==
'member'
)
{
console
.
log
(
'跳转'
,
data
.
value
);
}
else
{
console
.
log
(
'不跳转'
);
}
sendTbNet
(
TbNetName
.
completeTask
,
{
taskType
:
data
.
taskType
,
activityId
:
activityId
},
(
success
,
res
)
=>
{
if
(
!
success
||
!
res
||
!
res
.
data
){
showToast
(
'网络异常,请稍后重试'
);
return
;
}
});
});
}
}
...
...
src/parts/UI/UILayer.ts
View file @
ec1680f1
...
...
@@ -11,6 +11,7 @@ import WareHousePanel from "../../panels/WareHousePanel";
import
ShopPanel
from
"../../panels/ShopPanel"
;
import
RulePanel
from
"../../panels/RulePanel"
;
import
{
getTbData
,
TbNetName
}
from
"../../TaoBaoNet"
;
import
ExRecordPanel
from
"../../panels/ExRecordPanel"
;
export
let
G_wareHouseEffect
=
()
=>
{
};
...
...
@@ -74,8 +75,8 @@ export class UILayer extends Container {
break
;
case
this
.
ruleBtn
:
console
.
log
(
'点击了规则'
);
PanelCtrl
.
instance
.
show
(
RulePanel
);
//
PanelCtrl.instance.show(ExRecordPanel);
//
PanelCtrl.instance.show(RulePanel);
PanelCtrl
.
instance
.
show
(
ExRecordPanel
);
break
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment