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
190d04f7
Commit
190d04f7
authored
Oct 22, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kpi
parent
d3e23e19
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
20 deletions
+31
-20
project.config.json
src/project.config.json
+1
-8
kpi.js
src/shoppingGuid/page/pages/kpi/kpi.js
+14
-2
kpi.wxml
src/shoppingGuid/page/pages/kpi/kpi.wxml
+11
-10
utils.wxs
src/wxs/utils.wxs
+5
-0
No files found.
src/project.config.json
View file @
190d04f7
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
"list"
:
[]
"list"
:
[]
},
},
"miniprogram"
:
{
"miniprogram"
:
{
"current"
:
50
,
"current"
:
-1
,
"list"
:
[
"list"
:
[
{
{
"id"
:
-1
,
"id"
:
-1
,
...
@@ -375,13 +375,6 @@
...
@@ -375,13 +375,6 @@
"scene"
:
null
"scene"
:
null
},
},
{
{
"id"
:
50
,
"name"
:
"kpi"
,
"pathName"
:
"pages/shopping/kpi/kpi"
,
"query"
:
""
,
"scene"
:
null
},
{
"id"
:
-1
,
"id"
:
-1
,
"name"
:
"销售任务详情"
,
"name"
:
"销售任务详情"
,
"pathName"
:
"shoppingGuid/page/pages/saleTaskInfo/saleTaskInfo"
,
"pathName"
:
"shoppingGuid/page/pages/saleTaskInfo/saleTaskInfo"
,
...
...
src/shoppingGuid/page/pages/kpi/kpi.js
View file @
190d04f7
...
@@ -14,9 +14,10 @@ wxService.page({
...
@@ -14,9 +14,10 @@ wxService.page({
// { name: '维护任务', type: 4, isActive: false }
// { name: '维护任务', type: 4, isActive: false }
],
],
current
:
1
,
current
:
1
,
list
:
[
{
id
:
1
,},{
id
:
2
},{
id
:
3
},{
id
:
4
},{
id
:
5
},{
id
:
6
},{
id
:
7
},{
id
:
8
}
],
list
:
[],
pageSize
:
10
,
pageSize
:
10
,
pageNo
:
1
pageNo
:
1
,
totalPages
:
0
},
},
/**
/**
...
@@ -49,8 +50,15 @@ wxService.page({
...
@@ -49,8 +50,15 @@ wxService.page({
const
{
result
,
data
}
=
res
.
data
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
if
(
result
==
0
)
{
wx
.
hideLoading
()
wx
.
hideLoading
()
data
.
content
.
forEach
(
item
=>
{
let
curStart
=
new
Date
(
item
.
task
.
startTime
)
let
curEnd
=
new
Date
(
item
.
task
.
endTime
)
item
.
task
.
startTime
=
`
${
curStart
.
getMonth
()}
月
${
curStart
.
getDay
()}
日`
item
.
task
.
endTime
=
`
${
curEnd
.
getMonth
()}
月
${
curEnd
.
getDay
()}
日`
})
this
.
setData
({
this
.
setData
({
list
:
pageNo
==
1
?
[...
data
.
content
]:
[...
this
.
data
.
list
,...
data
.
content
],
list
:
pageNo
==
1
?
[...
data
.
content
]:
[...
this
.
data
.
list
,...
data
.
content
],
totalPages
:
data
.
totalPages
})
})
}
}
}
}
...
@@ -70,6 +78,7 @@ wxService.page({
...
@@ -70,6 +78,7 @@ wxService.page({
this
.
setData
({
this
.
setData
({
pageNo
:
1
,
pageNo
:
1
,
totalPages
:
0
,
navBar
:
this
.
data
.
navBar
,
navBar
:
this
.
data
.
navBar
,
current
:
this
.
data
.
current
current
:
this
.
data
.
current
},()
=>
{
},()
=>
{
...
@@ -116,6 +125,7 @@ wxService.page({
...
@@ -116,6 +125,7 @@ wxService.page({
*/
*/
onReachBottom
:
function
()
{
onReachBottom
:
function
()
{
console
.
log
(
'-------------'
)
console
.
log
(
'-------------'
)
if
(
pageNo
<
totalPages
)
{
this
.
setData
({
this
.
setData
({
pageNo
:
this
.
data
.
pageNo
+
1
,
pageNo
:
this
.
data
.
pageNo
+
1
,
},()
=>
{
},()
=>
{
...
@@ -123,4 +133,5 @@ wxService.page({
...
@@ -123,4 +133,5 @@ wxService.page({
this
.
getTaskPage
(
pageSize
,
pageNo
,
current
)
this
.
getTaskPage
(
pageSize
,
pageNo
,
current
)
})
})
}
}
}
})
})
\ No newline at end of file
src/shoppingGuid/page/pages/kpi/kpi.wxml
View file @
190d04f7
<!--shoppingGuid/page/pages/kpi/kpi.wxml-->
<!--shoppingGuid/page/pages/kpi/kpi.wxml-->
<wxs src="../../../../wxs/utils.wxs" module="utils" />
<!-- KPI界面 -->
<!-- KPI界面 -->
<view class='main-container'>
<view class='main-container'>
<view class='header-tab'>
<view class='header-tab'>
...
@@ -25,20 +26,20 @@
...
@@ -25,20 +26,20 @@
wx:for-item="item">
wx:for-item="item">
<view class='status-bar'>
<view class='status-bar'>
<view class='status'>
<view class='status'>
已完成:<text>1
33
</text>
已完成:<text>1
0
</text>
</view>
</view>
<view class='percent'>
133%
</view>
<view class='percent'>
{{utils.toPercent( 10, 100) }}
</view>
</view>
</view>
<view class='task-time'>
<view class='task-time'>
<image src='/assets/imgs/shoppingGuide/kpi_task_time.png' mode='widthFix'></image>
<image src='/assets/imgs/shoppingGuide/kpi_task_time.png' mode='widthFix'></image>
<text>
9月1日~10月1日
</text>
<text>
{{item.task.startTime}}~{{item.task.endTime}}
</text>
</view>
</view>
<view class='task-info'>
<view class='task-info'>
<view class='lf'>
<view class='lf'>
<image src='/assets/imgs/shoppingGuide/kpi_task_name.png' mode='widthFix'></image>
<image src='/assets/imgs/shoppingGuide/kpi_task_name.png' mode='widthFix'></image>
<text>
新品上市任务
</text>
<text>
{{item.task.name}}
</text>
</view>
</view>
<view class='rg'> 目标:
100000
</view>
<view class='rg'> 目标:
{{item.task.target}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -54,20 +55,20 @@
...
@@ -54,20 +55,20 @@
wx:for-item="item">
wx:for-item="item">
<view class='status-bar'>
<view class='status-bar'>
<view class='status'>
<view class='status'>
已完成:<text>1
33
</text>
已完成:<text>1
0
</text>
</view>
</view>
<view class='percent'>
133%
</view>
<view class='percent'>
{{utils.toPercent( 10, 100) }}
</view>
</view>
</view>
<view class='task-time'>
<view class='task-time'>
<image src='/assets/imgs/shoppingGuide/kpi_task_time.png' mode='widthFix'></image>
<image src='/assets/imgs/shoppingGuide/kpi_task_time.png' mode='widthFix'></image>
<text>
9月1日~10月1日
</text>
<text>
{{item.task.startTime}}~{{item.task.endTime}}
</text>
</view>
</view>
<view class='task-info'>
<view class='task-info'>
<view class='lf'>
<view class='lf'>
<image src='/assets/imgs/shoppingGuide/kpi_task_name.png' mode='widthFix'></image>
<image src='/assets/imgs/shoppingGuide/kpi_task_name.png' mode='widthFix'></image>
<text>
普通会员招募
</text>
<text>
{{item.task.name}}
</text>
</view>
</view>
<view class='rg'> 目标:
100
</view>
<view class='rg'> 目标:
{{item.task.target}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
...
...
src/wxs/utils.wxs
View file @
190d04f7
...
@@ -4,6 +4,10 @@ function date(time,format){
...
@@ -4,6 +4,10 @@ function date(time,format){
return date.getFullYear() + '-' + date.getMonth() + 1 + '-'+ date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' +date.getSeconds();
return date.getFullYear() + '-' + date.getMonth() + 1 + '-'+ date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' +date.getSeconds();
}
}
function toPercent(num, total) {
return (Math.round(num / total * 10000) / 100.00 + "%");// 小数点后两位百分比
}
function numberFormat(val,d){
function numberFormat(val,d){
if(val){
if(val){
return val.toFixed(d || 2);
return val.toFixed(d || 2);
...
@@ -46,6 +50,7 @@ function hanlerLinkNeedAuth(link){
...
@@ -46,6 +50,7 @@ function hanlerLinkNeedAuth(link){
module.exports = {
module.exports = {
toPercent:toPercent,
formateUrl:formateUrl,
formateUrl:formateUrl,
numberFormat: numberFormat,
numberFormat: numberFormat,
date: date,
date: date,
...
...
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