Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
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 2a823116
authored
Apr 04, 2023
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bug修复
1 parent
16b30cf5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
90 additions
and
70 deletions
api/outputApi/output.js
pages/tab/output/components/BusiCard/BusiCard.js
pages/tab/output/components/BusiCard/BusiCard.wxml
pages/tab/output/components/client/client.js
pages/tab/output/components/client/client.json
pages/tab/output/components/client/client.wxml
pages/tab/output/components/sortTab/sortTab.js
api/outputApi/output.js
View file @
2a82311
...
...
@@ -132,13 +132,5 @@ class outputApi {
...
data
})
}
/** 获取服务商下所有4S店 */
getMerchantList
(
data
)
{
return
api
.
post
({
method
:
'scrm.api.boutiquecoupon.partnermerchant.merchantList'
,
...
data
})
}
}
export
default
outputApi
pages/tab/output/components/BusiCard/BusiCard.js
View file @
2a82311
...
...
@@ -55,7 +55,7 @@ Component({
label
:
'战败订单'
,
name
:
'noUpgradeCount'
},
{
label
:
'转化率'
,
label
:
'
升级
转化率'
,
name
:
'calTransform'
,
suffix
:
'%'
}],
...
...
pages/tab/output/components/BusiCard/BusiCard.wxml
View file @
2a82311
...
...
@@ -7,7 +7,8 @@
</view>
<view class="content">
<view wx:for="{{formObj[sceneCode]}}" wx:key="index" class="content-item">
<view class="price">
<view wx:if="{{info[item.name] == '未开通'}}" class="price">{{info[item.name]}}</view>
<view wx:else="" class="price">
{{item.prefix || ''}}
{{item.isNum ? filter.money_three_for_two_thousands(info[item.name] || 0.00) : (info[item.name] || 0)}}
{{item.suffix || ''}}
...
...
pages/tab/output/components/client/client.js
View file @
2a82311
...
...
@@ -27,9 +27,11 @@ Component({
},
totalPages
:
-
1
,
list
:
[],
sceneCodeList
:
[
'SC002'
,
'SC003'
,
'SC004'
,
'SC001'
],
tabActive
:
'store'
,
// 业务经营汇总
merchantList
:
[],
stickyScrollTop
:
0
,
stickyOffsetTop
:
0
,
formData
:
{
// 0:全部-1;1:精品升级SC002;2:售后众筹SC004;3:会员权益/升级SC001
busiIdx
:
0
,
...
...
@@ -67,21 +69,9 @@ Component({
tabActive
})
},
getBusinessData
()
{
this
.
getMerchantList
()
},
// 获取服务商下的所有4s店
getMerchantList
()
{
let
{
userInfo
}
=
wx
.
$storage
.
get
()
let
params
=
{
merchantId
:
userInfo
.
merchantId
}
outputApi
.
getMerchantList
(
params
).
then
(
res
=>
{
this
.
setData
({
merchantList
:
res
})
this
.
getBusiStatistics
()
})
this
.
getBusiStatistics
()
},
// tab-业务经营切换
...
...
@@ -94,6 +84,21 @@ Component({
this
.
getBusiStatistics
(
true
)
},
// 吸顶
handleBusiScroll
(
e
)
{
console
.
log
(
e
)
wx
.
createSelectorQuery
()
.
select
(
'#scroller'
)
.
boundingClientRect
((
res
)
=>
{
console
.
log
(
res
)
this
.
setData
({
stickyScrollTop
:
e
.
detail
.
scrollTop
,
stickyOffsetTop
:
res
.
top
,
});
})
.
exec
();
},
resetBusiData
()
{
this
.
setData
({
busiObj
:
{},
...
...
@@ -108,38 +113,31 @@ Component({
totalNum
:
data
.
activityTotal
,
totalOrderCount
:
data
.
orderTotal
,
totalAmount
:
data
.
totalAmount
,
activityList
:
[]
activityList
:
data
.
activityList
||
[]
}
data
?.
merchantList
.
forEach
(
item
=>
{
let
_list
=
item
?.
merchantActivityRevenueDTO
?.
statistics
||
[]
_list
.
forEach
(
n
=>
{
let
_activityList
=
n
?.
activityList
||
[]
_activityList
.
forEach
(
k
=>
{
k
.
merchantName
=
item
.
merchantActivityRevenueDTO
.
merchantName
// 时间
k
.
time
=
k
.
startTime
.
slice
(
0
,
16
).
replace
(
/-/g
,
'.'
)
+
' - '
+
k
.
endTime
.
slice
(
0
,
16
).
replace
(
/-/g
,
'.'
)
let
startTimeFormat
=
k
.
startTime
.
slice
(
0
,
10
).
replace
(
/-/g
,
'/'
)
+
' 00:00:00'
let
nowDateFormat
=
new
Date
().
toLocaleDateString
().
replace
(
/-/g
,
'/'
)
+
' 23:59:59'
// activityStatus 1:未开始 2:进行中 3:已结束
switch
(
k
.
activityStatus
)
{
case
1
:
k
.
interDays
=
parseInt
((
new
Date
(
startTimeFormat
).
getTime
()
-
new
Date
().
getTime
())
/
(
1000
*
60
*
60
*
24
))
+
1
k
.
realTime
=
'-'
break
case
2
:
let
endTimeFormat
=
k
.
endTime
.
slice
(
0
,
10
).
replace
(
/-/g
,
'/'
)
+
' 23:59:59'
k
.
interDays
=
parseInt
((
new
Date
().
getTime
()
-
new
Date
(
startTimeFormat
).
getTime
())
/
(
1000
*
60
*
60
*
24
))
+
1
k
.
toEndDays
=
parseInt
((
new
Date
(
endTimeFormat
).
getTime
()
-
new
Date
(
nowDateFormat
).
getTime
())
/
(
1000
*
60
*
60
*
24
))
+
1
k
.
realTime
=
k
.
realStartTime
?.
slice
(
0
,
16
).
replace
(
/-/g
,
'.'
)
+
' - '
+
'已开始'
+
k
.
interDays
+
'天'
break
case
3
:
k
.
interDays
=
parseInt
((
new
Date
(
nowDateFormat
).
getTime
()
-
new
Date
(
k
.
endTime
.
replace
(
/-/g
,
'/'
)).
getTime
())
/
(
1000
*
60
*
60
*
24
))
+
1
k
.
realTime
=
(
k
.
realStartTime
?.
slice
(
0
,
16
).
replace
(
/-/g
,
'.'
)
||
''
)
+
' - '
+
(
k
.
realEndTime
?.
slice
(
0
,
16
).
replace
(
/-/g
,
'.'
)
||
''
)
break
}
})
_obj
.
activityList
=
_obj
.
activityList
.
concat
(
_activityList
)
})
console
.
log
(
data
)
_obj
.
activityList
.
forEach
(
k
=>
{
// 时间
k
.
time
=
k
.
startTime
.
slice
(
0
,
16
).
replace
(
/-/g
,
'.'
)
+
' - '
+
k
.
endTime
.
slice
(
0
,
16
).
replace
(
/-/g
,
'.'
)
let
startTimeFormat
=
k
.
startTime
.
slice
(
0
,
10
).
replace
(
/-/g
,
'/'
)
+
' 00:00:00'
let
nowDateFormat
=
new
Date
().
toLocaleDateString
().
replace
(
/-/g
,
'/'
)
+
' 23:59:59'
// activityStatus 1:未开始 2:进行中 3:已结束
switch
(
k
.
activityStatus
)
{
case
1
:
k
.
interDays
=
parseInt
((
new
Date
(
startTimeFormat
).
getTime
()
-
new
Date
().
getTime
())
/
(
1000
*
60
*
60
*
24
))
+
1
k
.
realTime
=
'-'
break
case
2
:
let
endTimeFormat
=
k
.
endTime
.
slice
(
0
,
10
).
replace
(
/-/g
,
'/'
)
+
' 23:59:59'
k
.
interDays
=
parseInt
((
new
Date
().
getTime
()
-
new
Date
(
startTimeFormat
).
getTime
())
/
(
1000
*
60
*
60
*
24
))
+
1
k
.
toEndDays
=
parseInt
((
new
Date
(
endTimeFormat
).
getTime
()
-
new
Date
(
nowDateFormat
).
getTime
())
/
(
1000
*
60
*
60
*
24
))
+
1
k
.
realTime
=
k
.
realStartTime
?.
slice
(
0
,
16
).
replace
(
/-/g
,
'.'
)
+
' - '
+
'已开始'
+
k
.
interDays
+
'天'
break
case
3
:
k
.
interDays
=
parseInt
((
new
Date
(
nowDateFormat
).
getTime
()
-
new
Date
(
k
.
endTime
.
replace
(
/-/g
,
'/'
)).
getTime
())
/
(
1000
*
60
*
60
*
24
))
+
1
k
.
realTime
=
(
k
.
realStartTime
?.
slice
(
0
,
16
).
replace
(
/-/g
,
'.'
)
||
''
)
+
' - '
+
(
k
.
realEndTime
?.
slice
(
0
,
16
).
replace
(
/-/g
,
'.'
)
||
''
)
break
}
})
this
.
setData
({
crowdOrderObj
:
_obj
...
...
@@ -157,11 +155,14 @@ Component({
this
.
setData
({
formData
:
JSON
.
parse
(
JSON
.
stringify
(
totalTabModule
.
data
.
formData
))
})
let
{
merchantList
,
formData
}
=
this
.
data
let
{
userInfo
}
=
wx
.
$storage
.
get
()
let
{
formData
}
=
this
.
data
let
params
=
{
...
busiSearchData
,
...
sortSearchData
,
merchantIds
:
merchantList
.
map
(
item
=>
item
.
merchantId
)
// serviceMerchantId: userInfo.merchantId
serviceMerchantId
:
userInfo
.
subLoginUser
.
merchantId
// serviceMerchantId: '44184606'
// merchantIds: ['44211227', '44211547', '10011000', '44184606', '44209535']
}
console
.
log
(
params
,
'params--'
)
...
...
@@ -183,12 +184,31 @@ Component({
switch
(
formData
.
sceneCode
)
{
case
'-1'
:
_list
=
res
.
merchantList
||
[]
console
.
log
(
_list
,
'_list---'
)
// 0:全部-1;1:精品升级SC002;2:售后众筹SC004;3:会员权益/升级SC001
let
_openList
=
[{
code
:
'SC002'
,
name
:
'boutiqueUpgrade'
},
{
code
:
'SC004'
,
name
:
'afterSalesCrowdfunding'
},
{
code
:
'SC001'
,
name
:
'vdUpgrade'
}]
_list
.
forEach
(
item
=>
{
_openList
.
forEach
(
k
=>
{
if
(
item
.
sceneCodes
&&
!
item
.
sceneCodes
.
includes
(
k
.
code
))
{
item
[
k
.
name
]
=
'未开通'
}
})
})
break
case
'SC002'
:
res
.
merchantList
.
forEach
(
item
=>
{
let
_dto
=
item
.
orderSummaryTotalDTO
_dto
.
calTransform
=
Math
.
round
((
_dto
.
upgradeCount
*
100
)
/
_dto
.
experienceCount
).
toFixed
(
0
)
_dto
.
calUpPrice
=
Math
.
round
(
_dto
.
totalSubOrderOrderMoney
/
_dto
.
upgradeCount
).
toFixed
(
2
)
_dto
.
calTransform
=
_dto
.
experienceCount
?
Math
.
round
((
_dto
.
upgradeCount
*
100
)
/
_dto
.
experienceCount
).
toFixed
(
0
)
:
'0'
_dto
.
calUpPrice
=
_dto
.
upgradeCount
?
Math
.
round
(
_dto
.
totalSubOrderOrderMoney
/
_dto
.
upgradeCount
).
toFixed
(
2
)
:
'0.00'
_list
.
push
(
_dto
)
})
break
...
...
@@ -253,6 +273,7 @@ Component({
})
},
getList
()
{
let
{
sceneCodeList
}
=
this
.
data
outputApi
.
getCustomerPageList
({
merchantId
:
this
.
data
.
pMerchantId
,
...
this
.
data
.
pageObj
}).
then
(
res
=>
{
var
list
=
this
.
data
.
list
list
=
list
.
concat
(
res
.
list
)
...
...
@@ -260,9 +281,10 @@ Component({
item
.
scenePriceList
=
[]
item
.
sceneList
.
forEach
((
k
,
idx
)
=>
{
item
[
'scene'
+
(
idx
+
1
)]
=
item
.
sceneList
[
idx
].
flag
item
.
scenePriceList
.
push
({
let
i
=
sceneCodeList
.
findIndex
(
m
=>
m
==
k
.
sceneCode
)
item
.
scenePriceList
[
i
]
=
{
total
:
item
.
sceneList
[
idx
].
totalMoney
||
0
}
)
}
})
item
.
isOpenScene
=
item
.
sceneList
.
map
(
item
=>
item
.
flag
).
some
(
item
=>
item
==
true
)
})
...
...
pages/tab/output/components/client/client.json
View file @
2a82311
...
...
@@ -5,6 +5,7 @@
"total-tab"
:
"../TotalTab/TotalTab"
,
"busi-card"
:
"../BusiCard/BusiCard"
,
"output-crowdfund"
:
"../outputCrowdfund/outputCrowdfund"
,
"sort-tab"
:
"../sortTab/sortTab"
"sort-tab"
:
"../sortTab/sortTab"
,
"van-sticky"
:
"@vant/weapp/sticky/index"
}
}
\ No newline at end of file
pages/tab/output/components/client/client.wxml
View file @
2a82311
...
...
@@ -53,7 +53,7 @@
</view>
</view>
</scroll-view>
<scroll-view wx:if="{{tabActive == 'business'}}" class="client"
scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="handleSort" lower-threshold='50'
scroll-top="{{busiScrollTop}}">
<scroll-view wx:if="{{tabActive == 'business'}}" class="client"
id="scroller" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="handleSort" lower-threshold='50' bind:scroll="handleBusiScroll"
scroll-top="{{busiScrollTop}}">
<view class="client-box">
<!-- 总收益 -->
<view wx:if="{{formData.sceneCode != 'SC004'}}">
...
...
@@ -61,7 +61,11 @@
<text>总收益</text>
<text class="price-txt">¥{{filter.money_three_for_two_thousands(busiObj.totalAmount || 0.00)}}</text>
</view>
<sort-tab id="sortTab" sceneCode="{{formData.sceneCode}}" bindhandleSort="handleSort"></sort-tab>
<view>
<van-sticky scroll-top="{{ stickyScrollTop }}" offset-top="{{ stickyOffsetTop }}">
<sort-tab id="sortTab" sceneCode="{{formData.sceneCode}}" bindhandleSort="handleSort"></sort-tab>
</van-sticky>
</view>
</view>
<!-- 售后众筹 -->
<view wx:if="{{formData.sceneCode == 'SC004'}}">
...
...
pages/tab/output/components/sortTab/sortTab.js
View file @
2a82311
...
...
@@ -61,7 +61,7 @@ Component({
asc
:
''
,
value
:
8
},
{
label
:
'转化率'
,
label
:
'
升级
转化率'
,
asc
:
''
,
value
:
9
}],
...
...
@@ -160,15 +160,15 @@ Component({
let
_asc
=
''
switch
(
formObj
[
sceneCode
][
idx
]?.
asc
)
{
case
'1'
:
_asc
=
'2'
break
case
'2'
:
_asc
=
''
_actIdx
=
'-1'
break
case
''
:
case
'
2
'
:
_asc
=
'1'
break
case
''
:
_asc
=
'2'
break
}
this
.
setData
({
[
`formObj.
${
sceneCode
}
[
${
idx
}
].asc`
]:
_asc
,
...
...
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