Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
ai-card
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 418af06b
authored
Nov 03, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v2.10.6' into 'master'
V2.10.6 See merge request
!8
2 parents
7196ca1d
7e1e50f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
28 deletions
pages/measure/measureResult/measureResult.js
pages/measure/measureResult/measureResult.wxml
pages/measure/measureResult/measureResult.js
View file @
418af06
...
...
@@ -29,7 +29,7 @@ Page({
formula
(
name
,
item
,
list
)
{
console
.
log
(
name
,
item
)
const
{
storeNumber
,
carNumber
,
customNumber
}
=
this
.
data
.
formData
const
{
rate
,
averagePrice
,
flowCost
,
serviceDividendRatio
,
parentName
}
=
item
const
{
rate
,
averagePrice
,
flowCost
,
serviceDividendRatio
,
typeIndex
}
=
item
console
.
log
(
storeNumber
,
carNumber
,
customNumber
)
let
value
=
0
switch
(
name
)
{
...
...
@@ -77,7 +77,7 @@ Page({
break
// 基盘客户数
case
'baseCustomersNumber'
:
if
(
parentName
==
'新车
1.3'
)
{
if
(
typeIndex
==
'
1.3'
)
{
value
=
customNumber
*
storeNumber
}
else
{
value
=
carNumber
*
12
*
storeNumber
...
...
@@ -85,7 +85,7 @@ Page({
break
// 增量产值/年(单个产品)总
case
'valueAddNumber'
:
if
(
parentName
==
'新车
1.3'
)
{
if
(
typeIndex
==
'
1.3'
)
{
value
=
(
customNumber
*
storeNumber
*
rate
*
averagePrice
).
toFixed
(
0
)
}
else
{
value
=
(
carNumber
*
12
*
storeNumber
*
rate
*
averagePrice
).
toFixed
(
0
)
...
...
@@ -93,7 +93,7 @@ Page({
break
// 单店产值
case
'singleValueAddNumber'
:
if
(
parentName
==
'新车
1.3'
)
{
if
(
typeIndex
==
'
1.3'
)
{
value
=
(
customNumber
*
storeNumber
*
rate
*
averagePrice
/
storeNumber
).
toFixed
(
0
)
}
else
{
value
=
(
carNumber
*
12
*
storeNumber
*
rate
*
averagePrice
/
storeNumber
).
toFixed
(
0
)
...
...
@@ -101,7 +101,7 @@ Page({
break
// 4s店收入/年
case
'storeIncomeNumber'
:
if
(
parentName
==
'新车
1.3'
)
{
if
(
typeIndex
==
'
1.3'
)
{
value
=
(
customNumber
*
storeNumber
*
rate
*
averagePrice
*
flowCost
).
toFixed
(
0
)
}
else
{
value
=
(
carNumber
*
12
*
storeNumber
*
rate
*
averagePrice
*
flowCost
).
toFixed
(
0
)
...
...
@@ -109,7 +109,7 @@ Page({
break
// 服务商收入/年
case
'serviceIncomeNumber'
:
if
(
parentName
==
'新车
1.3'
)
{
if
(
typeIndex
==
'
1.3'
)
{
value
=
(
customNumber
*
storeNumber
*
rate
*
averagePrice
*
serviceDividendRatio
).
toFixed
(
0
)
}
else
{
value
=
(
carNumber
*
12
*
storeNumber
*
rate
*
averagePrice
*
serviceDividendRatio
).
toFixed
(
0
)
...
...
@@ -117,7 +117,7 @@ Page({
break
// 4s店收入/年,单店
case
'singleStoreIncomeNumber'
:
if
(
parentName
==
'新车
1.3'
)
{
if
(
typeIndex
==
'
1.3'
)
{
value
=
(
customNumber
*
storeNumber
*
rate
*
averagePrice
*
flowCost
/
storeNumber
).
toFixed
(
0
)
}
else
{
value
=
(
carNumber
*
12
*
storeNumber
*
rate
*
averagePrice
*
flowCost
/
storeNumber
).
toFixed
(
0
)
...
...
@@ -125,7 +125,7 @@ Page({
break
// 服务商收入/年,单店
case
'singleServiceIncomeNumber'
:
if
(
parentName
==
'新车
1.3'
)
{
if
(
typeIndex
==
'
1.3'
)
{
value
=
(
customNumber
*
storeNumber
*
rate
*
averagePrice
*
serviceDividendRatio
/
storeNumber
).
toFixed
(
0
)
}
else
{
value
=
(
carNumber
*
12
*
storeNumber
*
rate
*
averagePrice
*
serviceDividendRatio
/
storeNumber
).
toFixed
(
0
)
...
...
pages/measure/measureResult/measureResult.wxml
View file @
418af06
...
...
@@ -7,43 +7,43 @@
<view class="card-item">
<view class="card-label m-b-8">增量产值/年</view>
<view class="card-value">
<view class="card-number">{{filter.formatValue(countData.valueAddCount)}}</view>
<view class="card-unit">元</view>
<view class="card-number">{{filter.formatValue(countData.valueAddCount
, false
)}}</view>
<view class="card-unit">
{{filter.formatValue(countData.valueAddCount, false, true)}}
元</view>
</view>
</view>
<view class="card-item">
<view class="card-label m-b-8">4S店收入/年</view>
<view class="card-value">
<view class="card-number">{{filter.formatValue(countData.storeIncomeCount)}}</view>
<view class="card-unit">元</view>
<view class="card-number">{{filter.formatValue(countData.storeIncomeCount
, false
)}}</view>
<view class="card-unit">
{{filter.formatValue(countData.storeIncomeCount, false, true)}}
元</view>
</view>
</view>
<view class="card-item">
<view class="card-label m-b-8">服务商收入/年</view>
<view class="card-value">
<view class="card-number">{{filter.formatValue(countData.serviceIncomeCount)}}</view>
<view class="card-unit">元</view>
<view class="card-number">{{filter.formatValue(countData.serviceIncomeCount
, false
)}}</view>
<view class="card-unit">
{{filter.formatValue(countData.serviceIncomeCount, false, true)}}
元</view>
</view>
</view>
<view class="m-b-24" wx:if="{{formData.storeNumber > 1}}">
<view class="card-item ">
<view class="card-label m-b-8 gray">单店均值</view>
<view class="card-value card-single-value">{{filter.formatValue(countData.singleValueAddCount)}}
<view class="card-single-unit">元</view>
<view class="card-value card-single-value">{{filter.formatValue(countData.singleValueAddCount
, false
)}}
<view class="card-single-unit">
{{filter.formatValue(countData.singleValueAddCount, false, true)}}
元</view>
</view>
</view>
<view class="card-item">
<view class="card-label m-b-8 gray">单店均值</view>
<view class="card-value card-single-value">
{{filter.formatValue(countData.singleStoreIncomeCount)}}
<view class="card-single-unit">元</view>
{{filter.formatValue(countData.singleStoreIncomeCount
, false
)}}
<view class="card-single-unit">
{{filter.formatValue(countData.singleStoreIncomeCount, false, true)}}
元</view>
</view>
</view>
<view class="card-item">
<view class="card-label m-b-8 gray">单店均值</view>
<view class="card-value card-single-value">
{{filter.formatValue(countData.singleServiceIncomeCount)}}
<view class="card-single-unit">元</view>
{{filter.formatValue(countData.singleServiceIncomeCount
, false
)}}
<view class="card-single-unit">
{{filter.formatValue(countData.singleServiceIncomeCount, false, true)}}
元</view>
</view>
</view>
</view>
...
...
@@ -193,20 +193,27 @@
</view>
<wxs module="filter">
function formatValue(value) {
function formatValue(value
, hasUnit = true, onlyUnit = false
) {
var val = value
var unit = ''
if (typeof value == 'number') {
val = value.toString()
}
if (val.length > 8 ) {
return (val / 100000000).toFixed(0) + '亿'
} else if (val.length > 7) {
return (val / 10000).toFixed(0) + '万'
} else {
return val
val = (val / 100000000).toFixed(0)
unit = '亿'
} else if (val.length > 5) {
val = (val / 10000).toFixed(0)
unit = '万'
}
// console.log(value, typeof value, value.toString().length, value.toString().length >= 8 ? (value / 10000).toFixed(0) + '万' : value)
// return value.toString().length >= 8 ? (value / 10000).toFixed(0) + '万' : value
return onlyUnit ? unit : hasUnit ? val + unit : val
// if (val.length > 8 ) {
// return (val / 100000000).toFixed(0) + '亿'
// } else if (val.length > 5) {
// return (val / 10000).toFixed(0) + '万'
// } else {
// return val
// }
}
function decimalFormat(value) {
return (value * 100).toFixed(2)
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment