Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
junlebao-milk-20240619
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
junlebao-milk-20240619
Commits
f1178ed2
Commit
f1178ed2
authored
Jun 28, 2024
by
俞嘉婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 活动页&我的页面 授权手机号流程
parent
58d06a09
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
1 deletion
+46
-1
activity.ts
miniprogram/pages/activity/activity.ts
+15
-0
my.ts
miniprogram/pages/my/my.ts
+21
-0
my.wxml
miniprogram/pages/my/my.wxml
+10
-1
No files found.
miniprogram/pages/activity/activity.ts
View file @
f1178ed2
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
{
ComponentWithStore
}
from
"mobx-miniprogram-bindings"
;
import
{
ComponentWithStore
}
from
"mobx-miniprogram-bindings"
;
import
{
store
}
from
"../../store/store"
;
import
{
store
}
from
"../../store/store"
;
import
{
_asyncThrottle
}
from
"../../utils/util"
;
import
{
_asyncThrottle
}
from
"../../utils/util"
;
import
{
dbLogin
}
from
"../../utils/request"
;
ComponentWithStore
({
ComponentWithStore
({
storeBindings
:
{
storeBindings
:
{
...
@@ -34,6 +35,20 @@ ComponentWithStore({
...
@@ -34,6 +35,20 @@ ComponentWithStore({
store
.
doLog
(
508
,
5
+
item
.
index
)
store
.
doLog
(
508
,
5
+
item
.
index
)
wx
.
navigateTo
({
url
:
`/pages/activityDetail/activityDetail?imgUrl=
${
item
.
detailImg
}
`
})
wx
.
navigateTo
({
url
:
`/pages/activityDetail/activityDetail?imgUrl=
${
item
.
detailImg
}
`
})
}),
}),
getPhoneNumber
(
e
:
any
)
{
if
(
e
.
detail
?.
iv
&&
e
.
detail
?.
encryptedData
)
{
wx
.
login
({
success
:
async
(
res
)
=>
{
console
.
log
(
res
.
code
)
await
dbLogin
({
code
:
res
.
code
,
iv
:
e
.
detail
.
iv
,
encryptedData
:
e
.
detail
.
encryptedData
,
});
},
});
}
},
// onShareAppMessage() {
// onShareAppMessage() {
// return {
// return {
...
...
miniprogram/pages/my/my.ts
View file @
f1178ed2
...
@@ -8,6 +8,13 @@ import { _asyncThrottle, defaultInfo } from "../../utils/util";
...
@@ -8,6 +8,13 @@ import { _asyncThrottle, defaultInfo } from "../../utils/util";
const
app
=
getApp
<
IAppOption
>
()
const
app
=
getApp
<
IAppOption
>
()
ComponentWithStore
({
ComponentWithStore
({
storeBindings
:
{
store
,
fields
:
{
showPhoneBtn
:
()
=>
!
store
.
homeInfo
.
mobile
,
},
actions
:
{},
},
data
:
{
data
:
{
defaultInfo
:
defaultInfo
,
defaultInfo
:
defaultInfo
,
userInfo
:
{
userInfo
:
{
...
@@ -27,6 +34,20 @@ ComponentWithStore({
...
@@ -27,6 +34,20 @@ ComponentWithStore({
},
},
});
});
},
},
getPhoneNumber
(
e
:
any
)
{
if
(
e
.
detail
?.
iv
&&
e
.
detail
?.
encryptedData
)
{
wx
.
login
({
success
:
async
(
res
)
=>
{
console
.
log
(
res
.
code
)
await
dbLogin
({
code
:
res
.
code
,
iv
:
e
.
detail
.
iv
,
encryptedData
:
e
.
detail
.
encryptedData
,
});
},
});
}
},
async
onChooseAvatar
(
e
:
any
)
{
async
onChooseAvatar
(
e
:
any
)
{
const
{
avatarUrl
}
=
e
.
detail
const
{
avatarUrl
}
=
e
.
detail
console
.
log
(
'avatarUrl'
,
avatarUrl
);
console
.
log
(
'avatarUrl'
,
avatarUrl
);
...
...
miniprogram/pages/my/my.wxml
View file @
f1178ed2
...
@@ -29,3 +29,12 @@
...
@@ -29,3 +29,12 @@
</view>
</view>
</view>
</view>
</view>
</view>
<!--获取手机号按钮-->
<button
type="primary"
wx:if="{{showPhoneBtn}}"
class="getPhoneBtn"
open-type="getPhoneNumber"
bindgetphonenumber="getPhoneNumber"
></button>
\ No newline at end of file
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