Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
qinhaitao
taobao-mini-template
Commits
cc986442
Commit
cc986442
authored
Sep 11, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs:
✏
️ 增加注释
parent
3d922eb8
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
56 additions
and
10 deletions
+56
-10
add.json
client/pages/activity/add/add.json
+18
-0
awards.controller.d.ts
v2.0/dist/controller/awards.controller.d.ts
+1
-1
task.controller.js
v2.0/dist/controller/task.controller.js
+2
-3
task.controller.js.map
v2.0/dist/controller/task.controller.js.map
+1
-1
index.d.ts
v2.0/dist/index.d.ts
+1
-1
time.d.ts
v2.0/dist/utils/package/time.d.ts
+2
-0
time.js
v2.0/dist/utils/package/time.js
+27
-0
time.js.map
v2.0/dist/utils/package/time.js.map
+1
-0
task.controller.ts
v2.0/src/controller/task.controller.ts
+3
-4
No files found.
client/pages/activity/add/add.json
0 → 100644
View file @
cc986442
{
"component"
:
true
,
"usingComponents"
:
{
"tb-label"
:
"/components/form/tb-label/tb-label"
,
"tb-input"
:
"/components/form/tb-input/tb-input"
,
"tb-config-input"
:
"/components/form/tb-config-input/tb-config-input"
,
"tb-range-picker"
:
"/components/form/tb-range-picker/tb-range-picker"
,
"question-tips"
:
"/components/basic/question-tips/question-tips"
,
"tb-rule"
:
"/components/form/tb-rule/tb-rule"
,
"probability-prize-table"
:
"/components/prize/probability-prize-table/probability-prize-table"
,
"list-table"
:
"/components/list/list-table/list-table"
,
"rank-config"
:
"/components/rank/rank-config/rank-config"
,
"rank-table"
:
"/components/rank/rank-table/rank-table"
,
"task-config"
:
"/components/task/task-config/task-config"
,
"tb-image-upload"
:
"/components/form/tb-image-upload/tb-image-upload"
,
"items-config"
:
"/components/task/items-config/items-config"
}
}
\ No newline at end of file
v2.0/dist/controller/awards.controller.d.ts
View file @
cc986442
...
@@ -32,7 +32,7 @@ export default class AwardsController {
...
@@ -32,7 +32,7 @@ export default class AwardsController {
/**
/**
* 权益重新领取
* 权益重新领取
*/
*/
receiveEnamePrize
(
context
:
IContext
<
IReceiveEnameParams
>
,
{}:
{},
[
awardSer
]:
[
AwardsService
]):
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
object
[]
|
number
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
IAwards
|
CodeType
,
true
>>
;
receiveEnamePrize
(
context
:
IContext
<
IReceiveEnameParams
>
,
{}:
{},
[
awardSer
]:
[
AwardsService
]):
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
object
[]
|
number
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
CodeType
|
IAwards
,
true
>>
;
/**
/**
* 概率抽奖
* 概率抽奖
*/
*/
...
...
v2.0/dist/controller/task.controller.js
View file @
cc986442
...
@@ -177,7 +177,7 @@ var Task = /** @class */ (function () {
...
@@ -177,7 +177,7 @@ var Task = /** @class */ (function () {
return
[
4
/*yield*/
,
sdk_1
.
TBAPIS
.
changeCredits
(
context
,
session
,
{
return
[
4
/*yield*/
,
sdk_1
.
TBAPIS
.
changeCredits
(
context
,
session
,
{
quantity
:
+
credits
,
quantity
:
+
credits
,
change_type
:
2
,
change_type
:
2
,
opt_type
:
'1'
,
opt_type
:
1
,
remark
:
"
\
u79EF
\
u5206
\
u5151
\
u6362
\
u4EFB
\
u52A1
\
u51CF
\
u79EF
\
u5206"
remark
:
"
\
u79EF
\
u5206
\
u5151
\
u6362
\
u4EFB
\
u52A1
\
u51CF
\
u79EF
\
u5206"
})];
})];
case
2
:
case
2
:
...
@@ -215,8 +215,7 @@ var Task = /** @class */ (function () {
...
@@ -215,8 +215,7 @@ var Task = /** @class */ (function () {
if
(
!
itemIdArray
.
includes
(
+
itemId
))
if
(
!
itemIdArray
.
includes
(
+
itemId
))
return
[
2
/*return*/
,
sdk_1
.
resultsModel
.
error
(
constants_1
.
CODE_TYPES
.
PARAMS_ERROR
,
'商品id不匹配'
)];
return
[
2
/*return*/
,
sdk_1
.
resultsModel
.
error
(
constants_1
.
CODE_TYPES
.
PARAMS_ERROR
,
'商品id不匹配'
)];
_d
=
taskService
.
getTodayCompleteTask
(
'browseGoods'
,
userInfo
),
todayTaskInfo
=
_d
.
todayTaskInfo
,
todayCompleteTimes
=
_d
.
todayCompleteTimes
;
_d
=
taskService
.
getTodayCompleteTask
(
'browseGoods'
,
userInfo
),
todayTaskInfo
=
_d
.
todayTaskInfo
,
todayCompleteTimes
=
_d
.
todayCompleteTimes
;
hasCompleteToday
=
todayTaskInfo
.
filter
(
function
(
v
)
{
return
v
.
itemId
===
itemId
;
}).
length
&&
hasCompleteToday
=
todayTaskInfo
.
some
(
function
(
v
)
{
return
v
.
itemId
===
itemId
;
})
&&
taskRateType
===
constants_1
.
TASK_RATE_TYPE
.
EVERYDAY
;
taskRateType
===
constants_1
.
TASK_RATE_TYPE
.
EVERYDAY
;
// 今日任务已经完成
// 今日任务已经完成
if
(
hasCompleteToday
)
{
if
(
hasCompleteToday
)
{
return
[
2
/*return*/
,
sdk_1
.
resultsModel
.
error
(
constants_1
.
CODE_TYPES
.
PARAMS_ERROR
,
'今日该浏览商品任务已完成'
)];
return
[
2
/*return*/
,
sdk_1
.
resultsModel
.
error
(
constants_1
.
CODE_TYPES
.
PARAMS_ERROR
,
'今日该浏览商品任务已完成'
)];
...
...
v2.0/dist/controller/task.controller.js.map
View file @
cc986442
This diff is collapsed.
Click to expand it.
v2.0/dist/index.d.ts
View file @
cc986442
...
@@ -15,7 +15,7 @@ declare const _default: {
...
@@ -15,7 +15,7 @@ declare const _default: {
list
:
IAwards
[];
list
:
IAwards
[];
}
>>
;
}
>>
;
receiveObjectPrize
:
(
context
:
IContext
<
import
(
"./controller/awards.controller"
).
IReceiveOjectParams
>
,
{}:
{},
[
awardSer
]:
[
import
(
"./service"
).
AwardsService
])
=>
Promise
<
IResult
<
boolean
>>
;
receiveObjectPrize
:
(
context
:
IContext
<
import
(
"./controller/awards.controller"
).
IReceiveOjectParams
>
,
{}:
{},
[
awardSer
]:
[
import
(
"./service"
).
AwardsService
])
=>
Promise
<
IResult
<
boolean
>>
;
receiveEnamePrize
:
(
context
:
IContext
<
import
(
"./controller/awards.controller"
).
IReceiveEnameParams
>
,
{}:
{},
[
awardSer
]:
[
import
(
"./service"
).
AwardsService
])
=>
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
object
[]
|
number
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
IAwards
|
import
(
"taobao-mini-sdk/lib/utils/codetypes"
).
CodeType
,
true
>>
;
receiveEnamePrize
:
(
context
:
IContext
<
import
(
"./controller/awards.controller"
).
IReceiveEnameParams
>
,
{}:
{},
[
awardSer
]:
[
import
(
"./service"
).
AwardsService
])
=>
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
object
[]
|
number
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
import
(
"taobao-mini-sdk/lib/utils/codetypes"
).
CodeType
|
IAwards
,
true
>>
;
doHelp
:
(
context
:
IContext
<
IParams
>
,
{
userInfo
,
vipInfo
,
activityInfo
}:
IControllerInfos
,
[
userService
,
taskService
,
accessService
]:
[
import
(
"./service/user.service"
).
default
,
import
(
"./service"
).
TaskService
,
import
(
"./service"
).
AccessService
])
=>
Promise
<
IResult
<
boolean
>>
;
doHelp
:
(
context
:
IContext
<
IParams
>
,
{
userInfo
,
vipInfo
,
activityInfo
}:
IControllerInfos
,
[
userService
,
taskService
,
accessService
]:
[
import
(
"./service/user.service"
).
default
,
import
(
"./service"
).
TaskService
,
import
(
"./service"
).
AccessService
])
=>
Promise
<
IResult
<
boolean
>>
;
getStats
:
(
context
:
IContext
<
import
(
"./controller/stat.controller"
).
IGetStatsParams
>
)
=>
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
object
[]
|
number
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
any
[],
true
>>
;
getStats
:
(
context
:
IContext
<
import
(
"./controller/stat.controller"
).
IGetStatsParams
>
)
=>
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
object
[]
|
number
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
any
[],
true
>>
;
};
};
...
...
v2.0/dist/utils/package/time.d.ts
0 → 100644
View file @
cc986442
/** @format */
export
declare
const
getToday
:
()
=>
string
;
v2.0/dist/utils/package/time.js
0 → 100644
View file @
cc986442
"use strict"
;
/** @format */
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
exports
.
getToday
=
void
0
;
var
sdk_1
=
require
(
"../../sdk"
);
// 获取今天的时间
exports
.
getToday
=
function
()
{
console
.
log
(
sdk_1
.
transformBeijingDate
(
Date
.
now
()));
return
sdk_1
.
dateFormatter
(
sdk_1
.
transformBeijingDate
(
Date
.
now
()),
'yyyy/MM/dd'
);
};
var
getDayStartAndEnd
=
function
(
day
)
{
var
startDate
=
new
Date
(
day
+
" 00:00:00"
).
getTime
();
var
endDate
=
new
Date
(
day
+
" 23:59:59"
).
getTime
();
};
var
getdaystarttime
=
function
(
day
)
{
var
date
=
new
Date
(
day
+
" 00:00:00"
).
getTime
();
var
start
=
date
-
8
*
60
*
60
*
1000
;
console
.
log
(
"getdaystarttime: "
,
start
);
return
start
;
};
var
getdayendtime
=
function
(
day
)
{
var
date
=
new
Date
(
day
+
" 23:59:59"
).
getTime
();
var
end
=
date
-
8
*
60
*
60
*
1000
;
console
.
log
(
"getdayendtime: "
,
end
);
return
end
;
};
//# sourceMappingURL=time.js.map
\ No newline at end of file
v2.0/dist/utils/package/time.js.map
0 → 100644
View file @
cc986442
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../../src/utils/package/time.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,iCAA+D;AAE/D,UAAU;AACG,QAAA,QAAQ,GAAG;IACtB,OAAO,CAAC,GAAG,CAAC,0BAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IAC7C,OAAO,mBAAa,CAAC,0BAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,YAAY,CAAC,CAAA;AACtE,CAAC,CAAA;AAED,IAAM,iBAAiB,GAAG,UAAA,GAAG;IAC3B,IAAI,SAAS,GAAG,IAAI,IAAI,CAAI,GAAG,cAAW,CAAC,CAAC,OAAO,EAAE,CAAA;IACrD,IAAI,OAAO,GAAG,IAAI,IAAI,CAAI,GAAG,cAAW,CAAC,CAAC,OAAO,EAAE,CAAA;AACrD,CAAC,CAAA;AAED,IAAM,eAAe,GAAG,UAAA,GAAG;IACzB,IAAI,IAAI,GAAG,IAAI,IAAI,CAAI,GAAG,cAAW,CAAC,CAAC,OAAO,EAAE,CAAA;IAChD,IAAI,KAAK,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IACrC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAA;IACvC,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,IAAM,aAAa,GAAG,UAAA,GAAG;IACvB,IAAI,IAAI,GAAG,IAAI,IAAI,CAAI,GAAG,cAAW,CAAC,CAAC,OAAO,EAAE,CAAA;IAChD,IAAI,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IACnC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAA;IACnC,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA"}
\ No newline at end of file
v2.0/src/controller/task.controller.ts
View file @
cc986442
...
@@ -132,8 +132,8 @@ export default class Task {
...
@@ -132,8 +132,8 @@ export default class Task {
// 扣积分
// 扣积分
let
result
=
await
TBAPIS
.
changeCredits
(
context
,
session
,
{
let
result
=
await
TBAPIS
.
changeCredits
(
context
,
session
,
{
quantity
:
+
credits
,
quantity
:
+
credits
,
change_type
:
2
,
change_type
:
2
,
//变更类型:0交易,1:互动活动,2:权益兑换,3:手工调整
opt_type
:
'1'
,
opt_type
:
1
,
// 操作类型,'0':增加,1:扣减
remark
:
`积分兑换任务减积分`
remark
:
`积分兑换任务减积分`
})
})
...
@@ -173,8 +173,7 @@ export default class Task {
...
@@ -173,8 +173,7 @@ export default class Task {
const
{
todayTaskInfo
,
todayCompleteTimes
}
=
taskService
.
getTodayCompleteTask
(
'browseGoods'
,
userInfo
)
const
{
todayTaskInfo
,
todayCompleteTimes
}
=
taskService
.
getTodayCompleteTask
(
'browseGoods'
,
userInfo
)
const
hasCompleteToday
=
const
hasCompleteToday
=
todayTaskInfo
.
filter
((
v
:
{
itemId
:
string
})
=>
v
.
itemId
===
itemId
).
length
&&
todayTaskInfo
.
some
((
v
:
{
itemId
:
string
})
=>
v
.
itemId
===
itemId
)
&&
taskRateType
===
TASK_RATE_TYPE
.
EVERYDAY
taskRateType
===
TASK_RATE_TYPE
.
EVERYDAY
// 今日任务已经完成
// 今日任务已经完成
if
(
hasCompleteToday
)
{
if
(
hasCompleteToday
)
{
...
...
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