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 fc26aa84
authored
Aug 23, 2023
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
看产值-联调
1 parent
e96cf622
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
114 additions
and
52 deletions
packagesList/packageOutput/pages/newSummary/newSummary.js
pages/tab/outputValue/components/merchant/merchant.js
pages/tab/outputValue/components/merchant/merchant.scss
pages/tab/outputValue/components/merchant/merchant.wxml
pages/tab/outputValue/components/merchantCom/MerchantScene/MerchantScene.js
pages/tab/outputValue/components/merchantCom/MerchantScene/MerchantScene.scss
pages/tab/outputValue/components/merchantCom/MerchantScene/MerchantScene.wxml
pages/tab/outputValue/components/merchantCom/merchantAll/merchantAll.js
pages/tab/outputValue/components/merchantCom/merchantAll/merchantAll.wxml
packagesList/packageOutput/pages/newSummary/newSummary.js
View file @
fc26aa8
...
...
@@ -145,12 +145,13 @@ Page({
pIdx
:
-
1
,
idx
:
-
1
}
let
{
userInfo
}
=
wx
.
$storage
.
get
()
if
(
this
.
data
.
mockObj
?.
crowdObj
)
{
let
pList
=
this
.
data
.
mockObj
.
crowdObj
.
map
(
item
=>
item
.
pMerchantId
)
for
(
let
i
=
0
;
i
<
this
.
data
.
mockObj
.
crowdObj
.
length
;
i
++
)
{
let
item
=
this
.
data
.
mockObj
.
crowdObj
[
i
]
let
cList
=
item
.
merchantList
.
map
(
k
=>
k
.
merhantId
)
if
(
cList
.
includes
((
id
||
this
.
data
.
merchantInfo
.
merchantId
)
+
''
)
&&
pList
.
includes
((
pId
||
this
.
data
.
merchantInfo
.
pM
erchantId
)
+
''
))
{
if
(
cList
.
includes
((
id
||
this
.
data
.
merchantInfo
.
merchantId
)
+
''
)
&&
pList
.
includes
((
pId
||
userInfo
.
subLoginUser
.
m
erchantId
)
+
''
))
{
res
=
{
flag
:
true
,
pIdx
:
i
,
...
...
@@ -165,7 +166,8 @@ Page({
// 处理SC004的mock数据
mockDealCrowd
(
data
)
{
var
obj
=
this
.
judgeCrowd
(
this
.
data
.
merchantInfo
.
pMerchantId
,
data
.
merchantId
)
let
{
userInfo
}
=
wx
.
$storage
.
get
()
var
obj
=
this
.
judgeCrowd
(
userInfo
.
subLoginUser
.
merchantId
,
data
.
merchantId
)
if
(
!
obj
.
flag
)
{
return
data
}
...
...
pages/tab/outputValue/components/merchant/merchant.js
View file @
fc26aa8
// pages/tab/outputValue/components/merchant/merchant.js
import
{
IMG_URL
}
from
'~/utils/constantData'
// import outputApi from '~/api/outputApi/index'
import
outputValueApi
from
'~/api/outputValueApi/index'
Component
({
/**
...
...
@@ -40,6 +39,8 @@ Component({
startYearMonth
:
''
,
endYearMonth
:
''
},
isEnd
:
false
,
loading
:
true
,
// totalObj: {
// scene1Total: '72536',
// scene0Total: '76400',
...
...
@@ -191,26 +192,18 @@ Component({
// }]
// }]
},
// lifetimes: {
// attached() {
// this.getMerchantList()
// }
// },
/**
* 组件的方法列表
*/
methods
:
{
// search() {
// console.log(this.data.searchForm, 'searchForm---')
// let { sceneType } = this.data.searchForm
// let { allMerchantList, otherMerchantList } = this.data
// this.setData({
// merchantList: !sceneType ? allMerchantList : otherMerchantList
// })
// },
merchantRefresh
(
isReset
=
false
)
{
// wx.showLoading()
if
(
isReset
)
{
this
.
setData
({
[
'pageCof.startYearMonth'
]:
''
,
[
'pageCof.endYearMonth'
]:
''
})
}
this
.
getTotal
()
this
.
getMerchantList
(
isReset
)
},
...
...
@@ -225,32 +218,44 @@ Component({
})
})
},
getMore
()
{
this
.
getMerchantList
()
},
// month作为分页参数
dealMonth
(
isReset
=
false
,
monthInterval
=
2
)
{
dealMonth
(
isReset
=
false
,
monthInterval
=
1
)
{
let
{
startTime
,
endTime
}
=
this
.
data
.
searchForm
let
{
startYearMonth
,
endYearMonth
}
=
this
.
data
.
pageCof
// 起始为空
if
(
!
startTime
&&
!
endTime
)
{
// 获取当前日期
var
_currentDate
=
new
Date
()
// 获取前n个月的日期
var
_endMonthDate
=
new
Date
()
_endMonthDate
.
setMonth
(
_currentDate
.
getMonth
()
-
monthInterval
)
var
_startMonthDate
=
new
Date
()
_startMonthDate
.
setMonth
(
isReset
?
_currentDate
.
getMonth
()
-
monthInterval
:
_endMonthDate
.
getMonth
()
-
monthInterval
)
endYearMonth
=
isReset
?
_currentDate
.
format
(
'yyyy-MM'
)
:
_endMonthDate
.
format
(
'yyyy-MM'
)
startYearMonth
=
_startMonthDate
.
format
(
'yyyy-MM'
)
// 获取当前日期
let
_currentDate
=
new
Date
()
// 获取前n个月的日期
let
_endMonthDate
=
new
Date
()
let
searchStart
=
''
// 翻页
if
(
startYearMonth
&&
endYearMonth
)
{
_currentDate
=
new
Date
(
startYearMonth
)
_endMonthDate
=
new
Date
(
startYearMonth
)
}
else
if
(
startTime
&&
endTime
)
{
_currentDate
=
new
Date
(
endTime
)
_endMonthDate
=
new
Date
(
endTime
)
searchStart
=
new
Date
(
startTime
)
}
_endMonthDate
.
setMonth
(
_currentDate
.
getMonth
()
-
monthInterval
)
let
_startMonthDate
=
new
Date
(
isReset
?
_currentDate
:
_endMonthDate
)
_startMonthDate
.
setMonth
(
_startMonthDate
.
getMonth
()
-
monthInterval
)
endYearMonth
=
isReset
?
_currentDate
.
format
(
'yyyy-MM'
)
:
_endMonthDate
.
format
(
'yyyy-MM'
)
startYearMonth
=
searchStart
>
_startMonthDate
?
new
Date
(
searchStart
).
format
(
'yyyy-MM'
)
:
_startMonthDate
.
format
(
'yyyy-MM'
)
this
.
setData
({
[
'pageCof.startYearMonth'
]:
startYearMonth
,
[
'pageCof.endYearMonth'
]:
endYearMonth
[
'pageCof.endYearMonth'
]:
endYearMonth
,
isEnd
:
new
Date
(
new
Date
(
startTime
)).
format
(
'yyyy-MM'
)
==
startYearMonth
})
},
getMerchantList
(
isReset
=
false
)
{
let
{
userInfo
}
=
wx
.
$storage
.
get
()
let
{
searchForm
,
merchantList
}
=
this
.
data
this
.
setData
({
serviceName
:
userInfo
.
subLoginUser
.
merchantName
serviceName
:
userInfo
.
subLoginUser
.
merchantName
,
loading
:
true
})
this
.
dealMonth
(
isReset
)
let
params
=
{
...
...
@@ -259,18 +264,24 @@ Component({
sceneType
:
searchForm
.
sceneType
,
...
this
.
data
.
pageCof
}
console
.
log
(
params
)
wx
.
$api
.
showLoading
(
'加载中...'
)
const
paiName
=
searchForm
.
sceneType
?
'getQuerySceneList'
:
'getAllSceneList'
outputValueApi
[
paiName
](
params
).
then
(
res
=>
{
console
.
log
(
res
,
'res---'
)
this
.
setData
({
merchantList
:
isReset
?
(
res
||
[])
:
merchantList
.
push
(
res
||
[])
merchantList
:
isReset
?
(
res
||
[])
:
merchantList
.
concat
(
res
||
[])
})
if
(
isReset
)
{
this
.
setData
({
busiScrollTop
:
0
})
}
}).
finally
(()
=>
{
wx
.
hideLoading
()
this
.
setData
({
triggered
:
false
,
loading
:
false
})
})
}
}
...
...
pages/tab/outputValue/components/merchant/merchant.scss
View file @
fc26aa8
...
...
@@ -15,6 +15,19 @@
.merchant-content
{
// margin: 0 16rpx;
margin-bottom
:
44rpx
;
}
.btn
{
width
:
256rpx
;
height
:
80rpx
;
line-height
:
80rpx
;
border
:
1
.6rpx
solid
#DDDDDD
;
border-radius
:
12rpx
;
font-size
:
24rpx
;
color
:
#5A6066
;
text-align
:
center
;
margin
:
0
auto
44rpx
;
}
.end-txt
{
...
...
pages/tab/outputValue/components/merchant/merchant.wxml
View file @
fc26aa8
<!--pages/tab/outputValue/components/merchant/merchant.wxml-->
<view class="merchantCon">
<scroll-view class="merchant" id="scroller" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="
handleSearc
h" lower-threshold='50' scroll-top="{{busiScrollTop}}">
<scroll-view class="merchant" id="scroller" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="
merchantRefres
h" lower-threshold='50' scroll-top="{{busiScrollTop}}">
<!-- 全部 - 服务商总产值 -->
<service-total wx:if="{{!searchForm.sceneType}}" serviceName="{{serviceName}}" totalObj="{{totalObj}}"></service-total>
<service-total wx:if="{{!searchForm.sceneType
&& merchantList.length
}}" serviceName="{{serviceName}}" totalObj="{{totalObj}}"></service-total>
<view wx:for="{{merchantList}}" wx:key="index" class="merchant-content">
<!-- 全部 -->
<merchant-all wx:if="{{!searchForm.sceneType}}" curInfo="{{item}}"></merchant-all>
<!-- 指定场景:太阳膜,售后众筹,会员权益/升级 -->
<merchant-scene wx:else searchForm="{{searchForm}}" curInfo="{{item}}"></merchant-scene>
</view>
<view wx:if="{{!merchantList.length}}" class="end-txt">
<nothing-tips tips="暂无数据~" bgColor="{{'#FFFFFF'}}" bg="{{bgUrl}}" />
</view>
<view wx:else class="end-txt">
<view>到底啦~</view>
<view wx:if="{{!loading}}">
<view wx:if="{{!merchantList.length}}" class="end-txt">
<nothing-tips tips="暂无数据~" bgColor="{{'#FFFFFF'}}" bg="{{bgUrl}}" />
</view>
<view class="btn" wx:elif="{{!isEnd}}" bindtap="getMore">加载更多</view>
<view wx:else class="end-txt">
<view>到底啦~</view>
</view>
</view>
</scroll-view>
</view>
\ No newline at end of file
pages/tab/outputValue/components/merchantCom/MerchantScene/MerchantScene.js
View file @
fc26aa8
...
...
@@ -8,7 +8,11 @@ Component({
curInfo
:
{
type
:
Object
,
value
:
()
=>
{
},
observer
(
n
)
{
}
observer
(
n
)
{
if
(
n
)
{
this
.
dealYearMonth
()
}
}
},
searchForm
:
{
type
:
Object
,
...
...
@@ -38,14 +42,23 @@ Component({
sceneTopList
:
constant
.
membranesTopList
,
sceneFormList
:
constant
.
membranesFormList
,
sceneObj
:
{},
compareList
:
[],
switchChecked
:
false
date
:
{
year
:
''
,
month
:
''
}
},
/**
* 组件的方法列表
*/
methods
:
{
dealYearMonth
()
{
let
{
yearMonth
}
=
this
.
data
.
curInfo
this
.
setData
({
[
'date.year'
]:
new
Date
(
yearMonth
||
''
).
getFullYear
(),
[
'date.month'
]:
new
Date
(
yearMonth
||
''
).
getMonth
()
+
1
,
})
},
dealData
()
{
let
{
searchForm
,
sceneToInfo
}
=
this
.
data
let
sceneObj
=
sceneToInfo
.
find
(
item
=>
item
.
type
==
(
searchForm
.
sceneType
||
1
))
...
...
@@ -54,6 +67,11 @@ Component({
sceneTopList
:
constant
[(
sceneObj
.
name
||
'membranes'
)
+
'TopList'
],
sceneFormList
:
constant
[(
sceneObj
.
name
||
'membranes'
)
+
'FormList'
]
})
}
},
jump
(
e
)
{
let
{
info
}
=
e
.
currentTarget
.
dataset
console
.
log
(
info
)
wx
.
$router
.
go
(
'packagesList.newSummary'
,
info
)
},
}
})
pages/tab/outputValue/components/merchantCom/MerchantScene/MerchantScene.scss
View file @
fc26aa8
...
...
@@ -130,6 +130,14 @@
background-image
:
linear-gradient
(
179deg
,
#FAFAFA
0%
,
#FFFFFF
50%
);
}
.list
:hover
{
background
:
#000000
05
;
}
.title-box-first
:hover
{
background-image
:
none
;
}
.title-box
{
position
:
relative
;
padding
:
26rpx
24rpx
;
...
...
pages/tab/outputValue/components/merchantCom/MerchantScene/MerchantScene.wxml
View file @
fc26aa8
...
...
@@ -7,7 +7,7 @@
<text class="num-red">¥{{filter.money_three_for_two_thousands(curInfo.curMonthTotalData.bizTotal || 0)}}</text>
</view>
<view>
<text class="num-month">
8</text><text class="month">月</text><text class="year">2023
年</text>
<text class="num-month">
{{date.month}}</text><text class="month">月</text><text class="year">{{date.year}}
年</text>
</view>
<view class="top-num-box">
<view>
...
...
@@ -31,7 +31,7 @@
</view>
<!-- 门店列表 -->
<view class="contanier">
<view wx:for="{{curInfo.merchantDataList}}" wx:key="index" class="list">
<view wx:for="{{curInfo.merchantDataList}}" wx:key="index" class="list"
bindtap="jump" data-info="{{item}}"
>
<view class="title-box flex-between {{index == 0 ? 'title-box-first' : ''}}">
<view class="title-block">
<view class="title-name text-hide">{{item.merchantName}}</view>
...
...
pages/tab/outputValue/components/merchantCom/merchantAll/merchantAll.js
View file @
fc26aa8
...
...
@@ -23,7 +23,11 @@ Component({
data
:
{
sceneFormList
:
constant
.
sceneFormList
,
compareList
:
[],
switchChecked
:
false
switchChecked
:
false
,
date
:
{
year
:
''
,
month
:
''
}
},
/**
...
...
@@ -31,7 +35,11 @@ Component({
*/
methods
:
{
dealYearMonth
()
{
let
{
merchantDataList
}
=
this
.
data
.
curInfo
let
{
yearMonth
}
=
this
.
data
.
curInfo
this
.
setData
({
[
'date.year'
]:
new
Date
(
yearMonth
||
''
).
getFullYear
(),
[
'date.month'
]:
new
Date
(
yearMonth
||
''
).
getMonth
()
+
1
,
})
},
dealCompare
()
{
let
{
merchantDataList
}
=
this
.
data
.
curInfo
...
...
@@ -49,9 +57,8 @@ Component({
this
.
setData
({
compareList
:
list
})
console
.
log
(
this
.
data
.
compareList
,
'compareList---'
)
},
handleClick
(
e
)
{
jump
(
e
)
{
let
{
info
}
=
e
.
currentTarget
.
dataset
console
.
log
(
info
)
wx
.
$router
.
go
(
'packagesList.newSummary'
,
info
)
...
...
pages/tab/outputValue/components/merchantCom/merchantAll/merchantAll.wxml
View file @
fc26aa8
...
...
@@ -6,7 +6,7 @@
<switch style="zoom:.6; margin-left: 8rpx;" color="#3666FE" checked="{{switchChecked}}" bindchange="switchChange" />
</view>
<view>
<text class="num-month">
8</text><text class="month">月</text><text class="year">2023
年</text>
<text class="num-month">
{{date.month}}</text><text class="month">月</text><text class="year">{{date.year}}
年</text>
</view>
<view class="top-num-box">
<view>
...
...
@@ -23,7 +23,7 @@
</view>
<!-- 门店列表 -->
<view class="contanier">
<view wx:for="{{curInfo.merchantDataList}}" wx:key="index" class="list" bindtap="
handleClick
" data-info="{{item}}">
<view wx:for="{{curInfo.merchantDataList}}" wx:key="index" class="list" bindtap="
jump
" data-info="{{item}}">
<view class="title-box flex-between {{index == 0 ? 'title-box-first' : ''}}">
<view class="title-block">
<view class="title-name text-hide">{{item.merchantName}}</view>
...
...
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