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
6a35ca75
Commit
6a35ca75
authored
Sep 30, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d07987ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
21 deletions
+32
-21
api.js
taobao_mini/client/api.js
+5
-5
package.json
taobao_mini/client/package.json
+0
-1
index.js
taobao_mini/client/pages/index/index.js
+27
-15
No files found.
taobao_mini/client/api.js
View file @
6a35ca75
...
@@ -15,14 +15,14 @@ const apiList = {
...
@@ -15,14 +15,14 @@ const apiList = {
login
:
{
login
:
{
handle
:
'login'
,
handle
:
'login'
,
method
:
'get'
,
method
:
'get'
,
isShowLoading
:
tru
e
isShowLoading
:
fals
e
},
},
// 获取游戏信息
// 获取游戏信息
getGameInfo
:
{
getGameInfo
:
{
handle
:
'getGameInfo'
,
handle
:
'getGameInfo'
,
method
:
'get'
,
method
:
'get'
,
isShowLoading
:
tru
e
isShowLoading
:
fals
e
},
},
// 埋点接口
// 埋点接口
...
@@ -36,7 +36,7 @@ const apiList = {
...
@@ -36,7 +36,7 @@ const apiList = {
drawLotteryPrize
:
{
drawLotteryPrize
:
{
handle
:
'lottery'
,
handle
:
'lottery'
,
method
:
'get'
,
method
:
'get'
,
isShowLoading
:
tru
e
isShowLoading
:
fals
e
},
},
// 获取大转盘所有奖品信息
// 获取大转盘所有奖品信息
...
@@ -50,14 +50,14 @@ const apiList = {
...
@@ -50,14 +50,14 @@ const apiList = {
doJoin
:
{
doJoin
:
{
handle
:
'doJoin'
,
handle
:
'doJoin'
,
method
:
'get'
,
method
:
'get'
,
isShowLoading
:
tru
e
isShowLoading
:
fals
e
},
},
// 完成游戏
// 完成游戏
gameOver
:
{
gameOver
:
{
handle
:
'gameOver'
,
handle
:
'gameOver'
,
method
:
'get'
,
method
:
'get'
,
isShowLoading
:
tru
e
isShowLoading
:
fals
e
},
},
// 观看视频发放雅顿币
// 观看视频发放雅顿币
...
...
taobao_mini/client/package.json
View file @
6a35ca75
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
"dependencies"
:
{
"dependencies"
:
{
"@tbmp/mp-cloud-sdk"
:
"*"
,
"@tbmp/mp-cloud-sdk"
:
"*"
,
"fyge-tbmini"
:
"^1.3.7"
,
"fyge-tbmini"
:
"^1.3.7"
,
"mini-types"
:
"^0.1.4"
,
"tans_lottie"
:
"^1.0.4"
"tans_lottie"
:
"^1.0.4"
}
}
}
}
taobao_mini/client/pages/index/index.js
View file @
6a35ca75
...
@@ -12,14 +12,15 @@ const SHARE_CONFIG = {
...
@@ -12,14 +12,15 @@ const SHARE_CONFIG = {
Page
({
Page
({
doShare
()
{
my
.
showSharePanel
();
},
doShare
()
{
my
.
showSharePanel
();
},
data
:
{
data
:
{
},
},
onLoad
(
query
)
{
onLoad
(
query
)
{
// 页面加载
// 页面加载
this
.
getAuth
();
this
.
getAuth
();
console
.
info
(
`Page onLoad with query:
${
JSON
.
stringify
(
query
)}
`
);
console
.
info
(
`Page onLoad with query:
${
JSON
.
stringify
(
query
)}
`
);
this
.
inviteId
=
query
.
inviteId
;
},
},
/**
/**
* 获取用户授权信息
* 获取用户授权信息
...
@@ -40,19 +41,30 @@ Page({
...
@@ -40,19 +41,30 @@ Page({
* 登录接口
* 登录接口
*/
*/
async
login
()
{
async
login
()
{
const
{
nickName
,
avatar
,
isFollow
}
=
app
;
const
{
nickName
,
avatar
,
isFollow
}
=
app
;
const
{
success
,
data
}
=
await
API
.
login
({
userNick
:
nickName
,
avatar
,
isFollow
:
true
}).
catch
(
res
=>
{
const
{
success
,
data
}
=
await
API
.
login
({
userNick
:
nickName
,
avatar
,
isFollow
:
true
}).
catch
(
res
=>
{
commonToast
(
res
&&
res
.
message
);
commonToast
(
res
&&
res
.
message
);
})
||
{};
})
||
{};
if
(
success
)
{
if
(
success
)
{
const
{
openId
}
=
data
;
const
{
openId
}
=
data
;
app
.
openId
=
openId
;
app
.
openId
=
openId
;
this
.
init
();
this
.
init
();
}
}
},
},
init
()
{
init
()
{
console
.
log
(
'do init'
)
console
.
log
(
'do init'
);
//有的时候是首页弹出助力弹窗
//有的时候是有单独的落地页
//如果是首页弹出助力弹窗
if
(
this
.
inviteId
)
{
commonToast
(
'首页助力类型,这是被邀请人页面'
)
}
else
{
commonToast
(
'首页助力类型,这是邀请人页面'
)
}
//todo 如果需要弹出邀请结果弹窗
},
},
onReady
()
{
onReady
()
{
// 页面加载完成
// 页面加载完成
...
@@ -75,7 +87,7 @@ Page({
...
@@ -75,7 +87,7 @@ Page({
onReachBottom
()
{
onReachBottom
()
{
// 页面被拉到底部
// 页面被拉到底部
},
},
/**
/**
* 获取主接口
* 获取主接口
*/
*/
...
@@ -89,7 +101,7 @@ Page({
...
@@ -89,7 +101,7 @@ Page({
this
.
setData
({
title
,
content
,
rule
});
this
.
setData
({
title
,
content
,
rule
});
}
}
},
},
/**
/**
* 显示规则弹层
* 显示规则弹层
*/
*/
...
@@ -109,17 +121,17 @@ Page({
...
@@ -109,17 +121,17 @@ Page({
onShareAppMessage
()
{
onShareAppMessage
()
{
// 返回自定义分享信息
// 返回自定义分享信息
let
{
let
{
path
,
path
,
...
rest
...
rest
}
=
SHARE_CONFIG
;
}
=
SHARE_CONFIG
;
if
(
app
.
openId
)
{
if
(
app
.
openId
)
{
path
+=
'?inviteId='
+
app
.
openId
;
path
+=
'?inviteId='
+
app
.
openId
;
}
}
console
.
log
(
'path'
,
path
)
console
.
log
(
'path'
,
path
)
return
{
return
{
...
rest
,
...
rest
,
path
path
}
}
}
}
});
});
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