Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
new_taobao
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
wildfirecode13
new_taobao
Commits
bffd3324
Commit
bffd3324
authored
Sep 24, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
70e69a68
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
10 deletions
+47
-10
tmallCat.getTaskList.json
...ect/src/canvas/game/mock/miniTb/tmallCat.getTaskList.json
+2
-2
app.js
taobao_mini/client/app.js
+3
-1
comtask.axml
taobao_mini/client/components/comtask/comtask.axml
+2
-2
comtask.js
taobao_mini/client/components/comtask/comtask.js
+26
-3
pagecanvas.js
taobao_mini/client/pages/pagecanvas/pagecanvas.js
+12
-2
pageshop.js
taobao_mini/client/pages/pageshop/pageshop.js
+2
-0
No files found.
project/src/canvas/game/mock/miniTb/tmallCat.getTaskList.json
View file @
bffd3324
...
...
@@ -15,7 +15,7 @@
{
"completeTimes"
:
0
,
"rewards"
:
10
,
"sellerId"
:
"
wwwww
"
,
"sellerId"
:
"
oooo
"
,
"status"
:
1
,
"taskRateType"
:
1
,
"taskType"
:
"follow"
,
...
...
@@ -24,7 +24,7 @@
{
"completeTimes"
:
0
,
"rewards"
:
10
,
"sellerId"
:
"
oooo
"
,
"sellerId"
:
"
wwwww
"
,
"status"
:
1
,
"taskRateType"
:
1
,
"taskType"
:
"follow"
,
...
...
taobao_mini/client/app.js
View file @
bffd3324
import
cloud
from
'@tbmp/mp-cloud-sdk'
;
import
tbcc
from
'./tbcc-sdk'
;
const
env
=
'test'
// 云函数环境 test 测试环境 online 线上环境
cloud
.
init
({
env
:
'test'
// 云函数环境 test 测试环境 online 线上环境
env
:
env
});
App
({
env
,
requestType
:
'cloud'
,
// yapi,cloud: 云函数
// requestType: 'local', // yapi,cloud: 云函数
cloudName
:
'tmallCat'
,
// 主云函数项目名 tmallCat
...
...
taobao_mini/client/components/comtask/comtask.axml
View file @
bffd3324
...
...
@@ -12,8 +12,8 @@
<image class="task_inviteicon " src={{resList['61cf4c2c-54e4-4cde-aa16-78ee5d17ab06'].url}} />
<image class="task_focusicon " src={{resList['61cf4c2c-54e4-4cde-aa16-78ee5d17ab06'].url}} />
<image class="task_readicon " src={{resList['61cf4c2c-54e4-4cde-aa16-78ee5d17ab06'].url}} />
<label class="task_title ">
签到
</label>
<label class="task_award ">精力 +
10
</label>
<label class="task_title ">
{{item.title}}
</label>
<label class="task_award ">精力 +
{{item.rewards}}
</label>
<label class="task_progress ">(10/10)</label>
</view>
</view>
...
...
taobao_mini/client/components/comtask/comtask.js
View file @
bffd3324
...
...
@@ -5,16 +5,39 @@ import API from '../../api';
const
app
=
getApp
();
const
{
tbcc
}
=
app
;
const
{
commonToast
}
=
tbcc
.
tb
;
const
findTask
=
(
key
,
list
)
=>
{
const
result
=
list
.
filter
(
i
=>
i
.
taskType
==
key
);
if
(
!
result
||
result
.
length
==
0
)
throw
new
Error
(
`不存在key=
${
key
}
的任务,请检查接口`
)
return
result
[
0
]
};
const
findFollowTask
=
(
key
,
list
)
=>
{
const
result
=
list
.
filter
(
i
=>
i
.
taskType
==
key
);
if
(
!
result
||
result
.
length
==
0
)
throw
new
Error
(
`不存在key=
${
key
}
的任务,请检查接口`
)
return
result
;
};
Component
({
props
:
{},
data
:
{
resList
:
resList
,
list
:
[
1
,
2
,
3
,
4
]
},
data
:
{
resList
:
resList
,
list
:
[]
},
async
didMount
()
{
const
{
success
,
data
,
message
}
=
await
API
.
getTaskList
().
catch
(
res
=>
{
commonToast
(
res
&&
res
.
message
);
})
||
{};
//签到邀请关注浏览
let
list
=
[
findTask
(
'sign'
,
data
),
findTask
(
'invites'
,
data
)
];
list
=
list
.
concat
(
findFollowTask
(
'follow'
,
data
));
list
.
push
(
findTask
(
'browseGoods'
,
data
));
if
(
success
&&
data
)
{
this
.
setData
({
list
})
}
},
methods
:
{
...
...
taobao_mini/client/pages/pagecanvas/pagecanvas.js
View file @
bffd3324
...
...
@@ -29,7 +29,7 @@ Page({
catType
:
1
,
catName
:
''
,
recallCatInfo
:
{},
taskModalVisible
:
false
,
taskModalVisible
:
1
,
messageModalVisible
:
false
,
messageModalData
:
{},
ruleModalVisible
:
false
,
...
...
@@ -67,6 +67,15 @@ Page({
my
.
__onMessage__
=
(
e
)
=>
{
this
.
onMessage
(
e
)
}
my
.
__getdata__
=
(
key
)
=>
{
my
.
__onMessage__
({
data
:
{
netName
:
'tmallCat.'
+
key
}
})
}
my
.
__showModal__
=
(
key
,
data
)
=>
{
this
.
onMessage
({
data
:
{
...
...
@@ -158,7 +167,7 @@ Page({
//接口名字
let
netName
=
e
.
data
.
netName
;
//接口参数
let
parameter
=
e
.
data
.
parameter
;
//暂时发现3个需要用户操作的接口
let
parameter
=
e
.
data
.
parameter
||
{};
//定制的授权
if
(
netName
.
indexOf
(
"mine"
)
==
0
)
{
...
...
@@ -221,6 +230,7 @@ Page({
parameter
.
activityId
=
app
.
activityId
;
fc
.
invoke
(
myCloudName
,
parameter
,
handler
).
then
(
res
=>
{
this
.
postMessage
(
netName
,
res
);
console
.
log
(
'request Cloud callback=>'
,
handler
,
res
,
JSON
.
stringify
(
res
));
});
}
},
...
...
taobao_mini/client/pages/pageshop/pageshop.js
View file @
bffd3324
...
...
@@ -28,6 +28,7 @@ Page({
async
handleClick
(
e
)
{
if
(
flag
)
return
;
my
.
showLoading
();
flag
=
1
;
const
{
item
}
=
e
.
target
.
dataset
;
const
{
_id
,
code
,
type
}
=
item
;
...
...
@@ -36,6 +37,7 @@ Page({
const
{
success
,
data
,
message
}
=
await
API
.
exchangeGood
(
params
).
catch
(
res
=>
{
commonToast
(
res
&&
res
.
message
);
})
||
{};
my
.
hideLoading
();
if
(
success
&&
data
)
{
this
.
setData
({
exchangedModalVisible
:
1
,
exchangedModalData
:
item
})
...
...
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