Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
walk_daka_wx
Overview
Overview
Details
Activity
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
穆启卓
walk_daka_wx
Commits
44820500
Commit
44820500
authored
Apr 02, 2019
by
穆启卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
7cbece87
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
8 deletions
+30
-8
logo.png
images/authorization/logo.png
+0
-0
authorization.less
pages/authorization/authorization.less
+0
-1
authorization.wxml
pages/authorization/authorization.wxml
+1
-1
authorization.wxss
pages/authorization/authorization.wxss
+0
-1
index.js
pages/index/index.js
+26
-2
index.wxml
pages/index/index.wxml
+3
-3
No files found.
images/authorization/logo.png
0 → 100644
View file @
44820500
93.8 KB
pages/authorization/authorization.less
View file @
44820500
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
height: 148rpx;
height: 148rpx;
border-radius: 50%;
border-radius: 50%;
margin-top: 100rpx;
margin-top: 100rpx;
background: #000;
}
}
.app-name {
.app-name {
font-size: 36rpx;
font-size: 36rpx;
...
...
pages/authorization/authorization.wxml
View file @
44820500
<navbar showHome="{{false}}" navTitle="{{navTitle}}" navColor="#fff"></navbar>
<navbar showHome="{{false}}" navTitle="{{navTitle}}" navColor="#fff"></navbar>
<view class="page-container">
<view class="page-container">
<
view class="app-logo"></view
>
<
image class="app-logo" src="/images/authorization/logo.png"></image
>
<view class="app-name">步步运动赚</view>
<view class="app-name">步步运动赚</view>
<view class="title">请允许步步运动赚获取以下权限</view>
<view class="title">请允许步步运动赚获取以下权限</view>
<view class="explain">以下信息仅用于您登录步步运动赚,我们将严格保密绝不外泄,更不会对您发送垃圾信息造成骚扰</view>
<view class="explain">以下信息仅用于您登录步步运动赚,我们将严格保密绝不外泄,更不会对您发送垃圾信息造成骚扰</view>
...
...
pages/authorization/authorization.wxss
View file @
44820500
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
height: 148rpx;
height: 148rpx;
border-radius: 50%;
border-radius: 50%;
margin-top: 100rpx;
margin-top: 100rpx;
background: #000;
}
}
.page-container .app-name {
.page-container .app-name {
font-size: 36rpx;
font-size: 36rpx;
...
...
pages/index/index.js
View file @
44820500
...
@@ -3,6 +3,7 @@ let app = getApp();
...
@@ -3,6 +3,7 @@ let app = getApp();
Page
({
Page
({
data
:
{
data
:
{
userAuth
:
false
,
// 用户信息授权(为了拿unionId)
userAuth
:
false
,
// 用户信息授权(为了拿unionId)
unionAuth
:
false
,
// unionId授权: 如果为false是需要授权,true是不需要
stepAuth
:
false
,
// 步数授权
stepAuth
:
false
,
// 步数授权
// commitStepPopupShow: false, // 同步步数成功弹窗
// commitStepPopupShow: false, // 同步步数成功弹窗
activityExplainShow
:
false
,
// 活动说明弹窗
activityExplainShow
:
false
,
// 活动说明弹窗
...
@@ -13,9 +14,11 @@ Page({
...
@@ -13,9 +14,11 @@ Page({
isFirstReq
:
true
isFirstReq
:
true
},
},
on
Show
()
{
on
Load
()
{
this
.
getPageData
();
this
.
getPageData
();
},
},
onShow
()
{
},
getPageData
()
{
getPageData
()
{
// 1、第一步,先判断用户信息和步数是否授过权
// 1、第一步,先判断用户信息和步数是否授过权
...
@@ -36,6 +39,7 @@ Page({
...
@@ -36,6 +39,7 @@ Page({
// 视图层数据赋值
// 视图层数据赋值
this
.
setData
({
this
.
setData
({
userAuth
:
app
.
globalData
.
userAuth
,
userAuth
:
app
.
globalData
.
userAuth
,
unionAuth
:
app
.
globalData
.
unionAuth
,
stepAuth
:
app
.
globalData
.
stepAuth
stepAuth
:
app
.
globalData
.
stepAuth
});
});
if
(
app
.
globalData
.
unionAuth
&&
app
.
globalData
.
stepAuth
)
{
if
(
app
.
globalData
.
unionAuth
&&
app
.
globalData
.
stepAuth
)
{
...
@@ -108,6 +112,10 @@ Page({
...
@@ -108,6 +112,10 @@ Page({
}
}
}
}
});
});
},
fail
:(
err
)
=>
{
console
.
log
(
err
)
this
.
getWeRunDataFail
(
err
);
}
}
});
});
},
},
...
@@ -211,11 +219,24 @@ Page({
...
@@ -211,11 +219,24 @@ Page({
});
});
},
},
fail
:(
err
)
=>
{
fail
:(
err
)
=>
{
this
.
authorizationFail
();
console
.
log
(
err
)
this
.
getWeRunDataFail
(
err
);
}
}
});
});
},
},
// 获取微信步数失败处理,包括未授权、设备不支持等
getWeRunDataFail
(
err
)
{
if
(
'device not support'
.
indexOf
(
err
))
{
wx
.
showModal
({
content
:
'设备不支持'
,
showCancel
:
false
});
}
else
{
this
.
authorizationFail
();
}
},
// 显示隐藏用户信息授权弹框
// 显示隐藏用户信息授权弹框
showUserInfoPopup
()
{
showUserInfoPopup
()
{
this
.
setData
({
this
.
setData
({
...
@@ -251,6 +272,9 @@ Page({
...
@@ -251,6 +272,9 @@ Page({
success
:
myres
=>
{
success
:
myres
=>
{
if
(
myres
.
data
.
code
===
0
)
{
if
(
myres
.
data
.
code
===
0
)
{
app
.
globalData
.
unionAuth
=
true
;
app
.
globalData
.
unionAuth
=
true
;
this
.
setData
({
unionAuth
:
app
.
globalData
.
unionAuth
});
app
.
globalData
.
userInfo
=
myres
.
data
.
data
;
app
.
globalData
.
userInfo
=
myres
.
data
.
data
;
app
.
globalData
.
token
=
myres
.
data
.
data
.
token
;
app
.
globalData
.
token
=
myres
.
data
.
data
.
token
;
this
.
getClickStepData
();
this
.
getClickStepData
();
...
...
pages/index/index.wxml
View file @
44820500
...
@@ -6,14 +6,14 @@
...
@@ -6,14 +6,14 @@
<image class="explain" src="/images/index/sy_shuoming.png" bindtap="changeActivityExplainShow"></image>
<image class="explain" src="/images/index/sy_shuoming.png" bindtap="changeActivityExplainShow"></image>
<view class="today-step-info" bindtap="clickStepData">
<view class="today-step-info" bindtap="clickStepData">
<image class="today-step-info-bg" src="/images/index/sy_ybp.png"></image>
<image class="today-step-info-bg" src="/images/index/sy_ybp.png"></image>
<block wx:if="{{
currentSteps
}}">
<block wx:if="{{
stepAuth
}}">
<view class="info-title">今日步数</view>
<view class="info-title">今日步数</view>
<view class="today-step-num">{{currentSteps}}</view>
<view class="today-step-num">{{currentSteps}}</view>
</block>
</block>
<view class="info-title" style="margin-top: 200rpx" wx:else>点此获取步数数据</view>
<view class="info-title" style="margin-top: 200rpx" wx:else>点此获取步数数据</view>
</view>
</view>
<view class="get-info-btn" bindtap="clickStepData">{{u
ser
Auth&&stepAuth?'提交步数打卡':'获取步数记录'}}</view>
<view class="get-info-btn" bindtap="clickStepData">{{u
nion
Auth&&stepAuth?'提交步数打卡':'获取步数记录'}}</view>
<view class="step-progress-container" wx:if="{{
currentSteps &&
targetSteps}}">
<view class="step-progress-container" wx:if="{{targetSteps}}">
<view class="today-status">进行中</view>
<view class="today-status">进行中</view>
<view class="today-progress">{{currentSteps}}/{{targetSteps}}<text>步</text></view>
<view class="today-progress">{{currentSteps}}/{{targetSteps}}<text>步</text></view>
</view>
</view>
...
...
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