Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
sales-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 83bf0342
authored
Nov 19, 2025
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat 首页刷新功能
1 parent
43aa0db3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
14 deletions
pages/components/regionalLeaders/regionalLeaders.js
pages/components/regionalLeaders/regionalLeaders.wxml
pages/components/staff/staff.js
pages/components/staff/staff.wxml
pages/tab/index/index.js
pages/tab/index/index.wxml
pages/components/regionalLeaders/regionalLeaders.js
View file @
83bf034
...
@@ -140,6 +140,21 @@ Component({
...
@@ -140,6 +140,21 @@ Component({
})
})
// 请求我的团队
// 请求我的团队
this
.
getMyTeam
()
this
.
getMyTeam
()
},
// 首页切回时统一刷新:我的团队 + 我的门店(KPI) + 预警
refresh
()
{
console
.
log
(
'refresh'
,
'大区'
)
// 刷新团队数据
this
.
getMyTeam
()
// 刷新门店 KPI
const
stat
=
this
.
selectComponent
(
'#storeStatistics'
)
if
(
stat
)
{
if
(
typeof
stat
.
getTotal
===
'function'
)
stat
.
getTotal
()
if
(
typeof
stat
.
getKpiProgress
===
'function'
)
stat
.
getKpiProgress
()
}
// 刷新预警列表
const
warn
=
this
.
selectComponent
(
'#storeWarning'
)
if
(
warn
&&
typeof
warn
.
refresh
===
'function'
)
warn
.
refresh
()
}
}
}
}
})
})
pages/components/regionalLeaders/regionalLeaders.wxml
View file @
83bf034
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
></table>
></table>
</view>
</view>
</view>
</view>
<storeStatistics regionId="{{ regionId }}"></storeStatistics>
<storeStatistics
id="storeStatistics"
regionId="{{ regionId }}"></storeStatistics>
<view class="storeWaring">
<view class="storeWaring">
<store-waring regionId="{{ regionId }}"></store-waring>
<store-waring
id="storeWarning"
regionId="{{ regionId }}"></store-waring>
</view>
</view>
\ No newline at end of file
\ No newline at end of file
pages/components/staff/staff.js
View file @
83bf034
...
@@ -31,5 +31,16 @@ Component({
...
@@ -31,5 +31,16 @@ Component({
/**
/**
* 组件的方法列表
* 组件的方法列表
*/
*/
methods
:
{}
methods
:
{
// 切回首页时,刷新内部门店统计与预警列表
refresh
()
{
const
stat
=
this
.
selectComponent
(
'#storeStatistics'
)
if
(
stat
)
{
if
(
typeof
stat
.
getTotal
===
'function'
)
stat
.
getTotal
()
if
(
typeof
stat
.
getKpiProgress
===
'function'
)
stat
.
getKpiProgress
()
}
const
warn
=
this
.
selectComponent
(
'#storeWarning'
)
if
(
warn
&&
typeof
warn
.
refresh
===
'function'
)
warn
.
refresh
()
}
}
})
})
pages/components/staff/staff.wxml
View file @
83bf034
<!--packageIndex/pages/staff/staff.wxml-->
<!--packageIndex/pages/staff/staff.wxml-->
<storeStatistics regionId="{{ regionId }}" staffUuid="{{ staffUuid }}"></storeStatistics>
<store-waring regionId="{{ regionId }}" staffUuid="{{ staffUuid }}"></store-waring>
\ No newline at end of file
\ No newline at end of file
<storeStatistics id="storeStatistics" regionId="{{ regionId }}" staffUuid="{{ staffUuid }}"></storeStatistics>
<store-waring id="storeWarning" regionId="{{ regionId }}" staffUuid="{{ staffUuid }}"></store-waring>
\ No newline at end of file
\ No newline at end of file
pages/tab/index/index.js
View file @
83bf034
...
@@ -9,7 +9,7 @@ Page({
...
@@ -9,7 +9,7 @@ Page({
data
:
{
data
:
{
navStyle
:
'background-color: rgba(0,0,0,0);'
,
navStyle
:
'background-color: rgba(0,0,0,0);'
,
track_event_code
:
'sales_index_view_page'
,
track_event_code
:
'sales_index_view_page'
,
navTitleStyle
:
"font-weight: 600; font- size: 32rpx; color: #000;"
,
navTitleStyle
:
'font-weight: 600; font- size: 32rpx; color: #000;'
},
},
// navbar高度设置
// navbar高度设置
// navbarReady(e) {
// navbarReady(e) {
...
@@ -43,7 +43,7 @@ Page({
...
@@ -43,7 +43,7 @@ Page({
/**
/**
* 生命周期函数--监听页面初次渲染完成
* 生命周期函数--监听页面初次渲染完成
*/
*/
onReady
:
function
()
{
},
onReady
:
function
()
{},
onReachBottom
()
{
onReachBottom
()
{
console
.
log
(
'滑到底部了'
)
console
.
log
(
'滑到底部了'
)
...
@@ -53,6 +53,7 @@ Page({
...
@@ -53,6 +53,7 @@ Page({
*/
*/
onShow
:
async
function
()
{
onShow
:
async
function
()
{
this
.
onPageShow
()
this
.
onPageShow
()
this
.
refreshActiveTab
()
},
},
/**
/**
* 生命周期函数--监听页面隐藏
* 生命周期函数--监听页面隐藏
...
@@ -71,11 +72,33 @@ Page({
...
@@ -71,11 +72,33 @@ Page({
/**
/**
* 页面相关事件处理函数--监听用户下拉动作
* 页面相关事件处理函数--监听用户下拉动作
*/
*/
onPullDownRefresh
:
function
()
{
},
onPullDownRefresh
:
function
()
{},
/**
/**
* 用户点击右上角分享
* 用户点击右上角分享
*/
*/
onShareAppMessage
:
function
()
{
},
onShareAppMessage
:
function
()
{},
onShareTimeline
:
function
()
{
}
onShareTimeline
:
function
()
{},
// 每次切换到首页 tab,刷新当前角色组件的数据
refreshActiveTab
()
{
const
{
loginRole
}
=
this
.
data
const
comp
=
this
.
selectComponent
(
'#roleComp'
)
if
(
!
comp
)
return
// 1-总监 2-大区经理 3-销售人员
if
(
loginRole
==
1
)
{
// 总监页封装了 refreshList
if
(
typeof
comp
.
refreshList
===
'function'
)
comp
.
refreshList
()
}
else
if
(
loginRole
==
2
)
{
// 大区经理页,统一刷新(我的团队、门店KPI、预警)
if
(
typeof
comp
.
refresh
===
'function'
)
{
comp
.
refresh
()
}
else
if
(
typeof
comp
.
getMyTeam
===
'function'
)
{
// 兼容旧实现
comp
.
getMyTeam
()
}
}
else
if
(
loginRole
==
3
)
{
// 员工页,转发刷新到内部门店统计
if
(
typeof
comp
.
refresh
===
'function'
)
comp
.
refresh
()
}
}
})
})
pages/tab/index/index.wxml
View file @
83bf034
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
<view style="height:100vh;overflow: hidden;">
<view style="height:100vh;overflow: hidden;">
<view class="layout" style="height:calc(100vh - {{ navBarHeight}}px); margin-top:{{ navBarHeight + 'px' }}">
<view class="layout" style="height:calc(100vh - {{ navBarHeight}}px); margin-top:{{ navBarHeight + 'px' }}">
<!-- 登录角色 1-总监 2-大区经理 3-销售人员 -->
<!-- 登录角色 1-总监 2-大区经理 3-销售人员 -->
<staff wx:if="{{ loginRole == 3 }}"></staff>
<staff id="roleComp" wx:if="{{ loginRole == 3 }}"></staff>
<regionalLeaders wx:if="{{ loginRole == 2 }}"></regionalLeaders>
<regionalLeaders id="roleComp" wx:if="{{ loginRole == 2 }}"></regionalLeaders>
<directorLeaders wx:if="{{ loginRole == 1 }}"></directorLeaders>
<directorLeaders id="roleComp" wx:if="{{ loginRole == 1 }}"></directorLeaders>
</view>
</view>
</view>
\ No newline at end of file
\ No newline at end of file
</view>
\ No newline at end of file
\ No newline at end of file
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