Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
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
高淑倩
7-Eleven
Commits
c6ed6b19
Commit
c6ed6b19
authored
Aug 06, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 渐变进度条
parent
ad1f1344
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
91 additions
and
10 deletions
+91
-10
progressPoint.js
src/component/progressPoint/progressPoint.js
+50
-0
progressPoint.json
src/component/progressPoint/progressPoint.json
+6
-0
progressPoint.wxml
src/component/progressPoint/progressPoint.wxml
+5
-0
progressPoint.wxss
src/component/progressPoint/progressPoint.wxss
+1
-0
pointDetail.js
src/pages/pointDetail/pointDetail.js
+9
-4
pointDetail.json
src/pages/pointDetail/pointDetail.json
+3
-1
pointDetail.wxml
src/pages/pointDetail/pointDetail.wxml
+17
-5
No files found.
src/component/progressPoint/progressPoint.js
0 → 100644
View file @
c6ed6b19
// component/progressPoint/progressPoint.js
const
wxService
=
require
(
'../../utils/wxService'
)
Component
({
properties
:
{
percent
:
{
type
:
[
Number
,
String
],
value
:
50
},
width
:
{
type
:
[
Number
,
String
],
value
:
650
},
strokeWidth
:
{
type
:
[
Number
,
String
],
value
:
10
},
activeColor
:
{
type
:
[
String
,
Array
],
value
:
'#949494'
},
backgroundColor
:
{
type
:
String
,
value
:
'#e5e5e5'
},
radius
:
{
type
:
[
Number
,
String
],
value
:
5
},
orientation
:
{
type
:
[
Number
,
String
],
value
:
'landscape'
// slider方向 landscape横向 portrait纵向
},
portraitOrientation
:
{
type
:
[
Number
,
String
],
value
:
'bottom'
// 纵向方向 top 从上到下 bottom 从下到上
}
},
attached
:
function
()
{
let
activeColor
=
this
.
data
.
activeColor
;
if
(
!!~
activeColor
.
indexOf
(
','
))
{
this
.
setData
({
activeLineColor
:
activeColor
.
split
(
','
)
})
}
}
})
\ No newline at end of file
src/component/progressPoint/progressPoint.json
0 → 100644
View file @
c6ed6b19
{
"component"
:
true
,
"usingComponents"
:
{
}
}
\ No newline at end of file
src/component/progressPoint/progressPoint.wxml
0 → 100644
View file @
c6ed6b19
<!--component/progressPoint/progressPoint.wxml-->
<view class="progress progress__bg" style="width: {{orientation == 'landscape' ? width : strokeWidth}}rpx; border-radius:{{radius}}rpx; background-color: {{backgroundColor}}; height: {{orientation == 'landscape' ? strokeWidth : width}}rpx">
<view class="progress__line" style="width: {{orientation == 'landscape' ? percent / 100 * width : strokeWidth}}rpx; height: {{orientation == 'landscape' ? strokeWidth : percent / 100 * width}}rpx; top:{{ portraitOrientation == 'bottom' && orientation == 'portrait' ? (100 - percent) / 100 * width : 0 }}rpx; border-radius:{{radius}}rpx; {{ orientation == 'landscape' ?(activeLineColor[1] ? 'background-image: linear-gradient(to right, ' + activeLineColor[0] + ', ' + activeLineColor[1] + ');' : 'background-color:' + activeColor + ';') : (activeLineColor[1] ? 'background-image: linear-gradient(to top, ' + activeLineColor[0] + ', ' + activeLineColor[1] + ');' : 'background-color:' + activeColor + ';')}}" />
</view>
\ No newline at end of file
src/component/progressPoint/progressPoint.wxss
0 → 100644
View file @
c6ed6b19
/* component/progressPoint/progressPoint.wxss */
src/pages/pointDetail/pointDetail.js
View file @
c6ed6b19
...
...
@@ -22,8 +22,13 @@ wxService.page({
popupType
:
0
,
// 默认不跳转 1 优惠券 2 积分
goal
:
0
,
detailImage
:
''
,
countObj
:
null
,
currentPercent
:
0
,
// 当前进度
countObj
:
{
surplusPoints
:
0
,
exchangeCount
:
0
,
totalPoints
:
0
},
currentPercent
:
(
100
/
5
)
*
2
,
// currentPercent: 0, // 当前进度
isDisabled
:
false
},
/**
...
...
@@ -77,8 +82,8 @@ wxService.page({
if
(
result
==
0
)
{
this
.
setData
({
countObj
:
data
,
//
currentPercent: (100 / 5) * 2
currentPercent
:
(
100
/
this
.
data
.
goal
)
*
data
.
surplusPoints
currentPercent
:
(
100
/
5
)
*
2
//
currentPercent: (100 / this.data.goal) * data.surplusPoints
},
()
=>
{
wx
.
hideLoading
()
})
...
...
src/pages/pointDetail/pointDetail.json
View file @
c6ed6b19
...
...
@@ -2,6 +2,7 @@
"navigationBarTitleText"
:
"集点详情"
,
"usingComponents"
:
{
"status-img"
:
"/component/statusPoint/statusPoint"
,
"x-dialog"
:
"/component/dialog/dialog"
"x-dialog"
:
"/component/dialog/dialog"
,
"x-progress-point"
:
"/component/progressPoint/progressPoint"
}
}
\ No newline at end of file
src/pages/pointDetail/pointDetail.wxml
View file @
c6ed6b19
...
...
@@ -12,16 +12,28 @@
</view>
</view>
<view class="info-progress border_box">
<progress
percent="{{currentPercent}}"
<x-progress-point
active-color='#3EEB9A, #04C25C'
percent='{{currentPercent}}'
stroke-width='20'
radius='20'
/>
<!-- <progress
percent="{{50}}"
activeColor="#05C35B"
stroke-width="10"
active
border-radius="{{20}}"
/>
/>
-->
</view>
<button wx:if="{{!countObj.totalPoints}}" bindtap="handleToGet" class="info-status-btn border_box available breathe-btn" disabled="{{isDisabled}}">可领取奖励
<text class="total-points"> {{countObj.totalPoints}} </text>次
<button
wx:if="{{countObj.totalPoints}}"
bindtap="handleToGet"
class="info-status-btn border_box available breathe-btn"
disabled="{{isDisabled}}"
>可领取奖励
<text class="total-points"> {{countObj.totalPoints}} </text>
次
</button>
<view wx:else class="info-status-btn unacommpolished border_box">
还未达成,继续加油呀
...
...
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