Commit a4a5cb29 by 张立顺

feat 功能联调

1 parent ee89d401
...@@ -20,7 +20,8 @@ Page({ ...@@ -20,7 +20,8 @@ Page({
count: 0, count: 0,
text: '亏损预警' text: '亏损预警'
} }
] ],
list: []
}, },
getWarningStores() { getWarningStores() {
let { month, staffUuid, regionId, tabList } = this.data let { month, staffUuid, regionId, tabList } = this.data
...@@ -33,18 +34,18 @@ Page({ ...@@ -33,18 +34,18 @@ Page({
} }
IndexApi.getWarningStores(params).then(res => { IndexApi.getWarningStores(params).then(res => {
console.log(res, 'res') console.log(res, 'res')
let { backstopWarningList = [], lostShopWarningList = [], lossWarningList = [] } = let { backstopWarningCount, lostShopWarningCount, lossWarningCount, backstopWarningList = [], lostShopWarningList = [], lossWarningList = [] } =
res.data res.data
tabList[0].count = backstopWarningList?.length || 0 tabList[0].count = backstopWarningCount || 0
tabList[1].count = lostShopWarningList?.length || 0 tabList[1].count = lostShopWarningCount || 0
tabList[2].count = lossWarningList?.length || 0 tabList[2].count = lossWarningCount
// list 根据 // list 根据
this.setData({ this.setData({
tabList, tabList,
backstopWarningList, backstopWarningList,
lostShopWarningList, lostShopWarningList,
lossWarningList, lossWarningList,
list: backstopWarningList list: backstopWarningList || []
}) })
}) })
}, },
...@@ -94,7 +95,7 @@ Page({ ...@@ -94,7 +95,7 @@ Page({
: lossWarningList : lossWarningList
this.setData({ this.setData({
activeIndex: e.detail, activeIndex: e.detail,
list list: list || []
}) })
}, },
navigateToStoreDetail(e) { navigateToStoreDetail(e) {
......
...@@ -152,3 +152,21 @@ ...@@ -152,3 +152,21 @@
line-height: 40rpx; line-height: 40rpx;
padding: 0rpx 8rpx; padding: 0rpx 8rpx;
} }
.nothing {
padding: var(--fontSize30) 0;
text-align: center;
// font-size: var(--fontSize28);
color: #999ea8;
font-size: 24rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.img {
width: 172rpx;
height: 172rpx;
// margin-bottom: 40rpx;
}
}
\ No newline at end of file \ No newline at end of file
...@@ -34,4 +34,10 @@ ...@@ -34,4 +34,10 @@
</view> </view>
</view> </view>
</view> </view>
<block wx:if="{{ list.length <= 0 }}">
<view class="nothing">
<glsx-image class="img" src="{{ '/index/empty.png' }}" webp></glsx-image>
<view class="text">暂无数据</view>
</view>
</block>
</scroll-view> </scroll-view>
\ No newline at end of file \ No newline at end of file
...@@ -23,7 +23,7 @@ Page({ ...@@ -23,7 +23,7 @@ Page({
table: result table: result
}) })
}) })
.catch(err => {}) .catch(err => { })
}, },
handleMonthChange: function (e) { handleMonthChange: function (e) {
// 判断是不是当前月,是取当前日期;不是取该月第一天 // 判断是不是当前月,是取当前日期;不是取该月第一天
...@@ -62,6 +62,9 @@ Page({ ...@@ -62,6 +62,9 @@ Page({
console.log(reportDate) console.log(reportDate)
this.getList() this.getList()
}, },
onCreateVisit() {
wx.$router.go('salesDailyReport')
},
toDetail(e) { toDetail(e) {
let { item } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
let { orderObj } = this.data let { orderObj } = this.data
...@@ -171,35 +174,35 @@ Page({ ...@@ -171,35 +174,35 @@ Page({
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() {}, onReady() { },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() {}, onShow() { },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() {}, onHide() { },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() {}, onUnload() { },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() {}, onPullDownRefresh() { },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() {}, onReachBottom() { },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {} onShareAppMessage() { }
}) })
/* packageTool/pages/salesReport/salesReport.wxss */ /* packageTool/pages/salesReport/salesReport.wxss */
Page { Page {
background: #f7f8fa; background: #f7f8fa;
padding-bottom: 50rpx; padding-bottom: 125rpx;
} }
.main { .main {
...@@ -119,3 +119,31 @@ Page { ...@@ -119,3 +119,31 @@ Page {
// margin-bottom: 40rpx; // margin-bottom: 40rpx;
} }
} }
.bottom-bar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
background: #fff;
box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.06);
.inner {
padding: 20rpx 32rpx calc(8px + env(safe-area-inset-bottom));
.btn {
height: 80rpx;
text-align: center;
line-height: 80rpx;
color: #FFFFFF;
font-size: 32rpx;
font-weight: 500;
border-radius: 12rpx;
background: #347BFF;
}
}
}
.safe-area-bottom {
padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
\ No newline at end of file \ No newline at end of file
...@@ -27,4 +27,10 @@ ...@@ -27,4 +27,10 @@
</block> </block>
</view> </view>
</view> </view>
<!-- 底部固定操作条:新增拜访 -->
<view class="bottom-bar" wx:if="{{userInfo.loginRole == 2}}">
<view class="inner safe-area-bottom">
<view class="btn" bind:tap="onCreateVisit">日报填写</view>
</view>
</view>
<!-- </view> --> <!-- </view> -->
\ No newline at end of file \ No newline at end of file
...@@ -45,7 +45,7 @@ Component({ ...@@ -45,7 +45,7 @@ Component({
{ {
name: '完成率', name: '完成率',
key: 'completionRate', key: 'completionRate',
width: 'var(--fontSize84)', width: 'var(--fontSize100)',
unit: '%' unit: '%'
} }
], ],
...@@ -154,7 +154,7 @@ Component({ ...@@ -154,7 +154,7 @@ Component({
// 跳转客户页面 // 跳转客户页面
getCustomerPage(e) { getCustomerPage(e) {
let { type } = e.currentTarget.dataset let { type } = e.currentTarget.dataset
app.setTabParams('customer', {type}) app.setTabParams('customer', { type })
wx.switchTab({ wx.switchTab({
url: `/pages/tab/customer/customer` url: `/pages/tab/customer/customer`
}) })
......
...@@ -41,6 +41,8 @@ Component({ ...@@ -41,6 +41,8 @@ Component({
monthPickerShow: false, monthPickerShow: false,
minMonthDate: __MIN_YM_TS__, minMonthDate: __MIN_YM_TS__,
maxMonthDate: __CUR_YM_TS__, maxMonthDate: __CUR_YM_TS__,
monthPickerValue: __CUR_YM_TS__,
pendingMonthValue: 0,
warningStores: { warningStores: {
backstopWarningCount: 0, backstopWarningCount: 0,
lossWarningCount: 0, lossWarningCount: 0,
...@@ -67,15 +69,25 @@ Component({ ...@@ -67,15 +69,25 @@ Component({
const val = this.data.pendingMonthValue || this.data.monthPickerValue const val = this.data.pendingMonthValue || this.data.monthPickerValue
if (val) { if (val) {
const d = new Date(val) const d = new Date(val)
console.log(val, d)
this.setData( this.setData(
{ {
monthPickerValue: val, monthPickerValue: val,
boardMonthText: `${d.getMonth() + 1}月`, boardMonthText: `${d.getMonth() + 1}月`,
boardMonthActive: true, boardMonthActive: true,
boardScopeActive: false boardScopeActive: false,
// yyyy-MM(月份补零)
// value: `${y}-${String(m).padStart(2, '0')}`,
// M(回显用,不补零)
// name: `${m}月`
month: `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(
2,
'0'
)}`,
showMonth: `${d.getMonth() + 1}月`
}, },
() => { () => {
this.getPageData() this.getWarningStores()
} }
) )
} }
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<!-- bindtap="changeTableSort" --> <!-- bindtap="changeTableSort" -->
<view class="value" style="width: {{ item.width }};" id="header-{{ index }}" data-index="{{ index }}"> <view class="value" style="width: {{ item.width }};" id="header-{{ index }}" data-index="{{ index }}">
<view class="lable"> <view class="lable">
<view class="name">{{item.name}}{{item.unit}}</view> <view class="name">{{item.name}}</view>
</view> </view>
<!-- <view class="sort-list"> <!-- <view class="sort-list">
<view class="up {{ item.sort?'sort-active':'' }}" /> <view class="up {{ item.sort?'sort-active':'' }}" />
...@@ -31,16 +31,7 @@ ...@@ -31,16 +31,7 @@
</block> </block>
</view> </view>
</view> </view>
<scroll-view <scroll-view scroll-x scroll-y show-scrollbar="{{ false }}" bindrefresherrefresh="restPageNum" bindscrolltolower="scrollonReachBottom" refresher-threshold="304" refresher-triggered="{{ triggered }}" style="height: {{ itemTableHeight }}rpx;">
scroll-x
scroll-y
show-scrollbar="{{ false }}"
bindrefresherrefresh="restPageNum"
bindscrolltolower="scrollonReachBottom"
refresher-threshold="304"
refresher-triggered="{{ triggered }}"
style="height: {{ itemTableHeight }}rpx;"
>
<view class="table-body"> <view class="table-body">
<block wx:if="{{ tableFlag }}"> <block wx:if="{{ tableFlag }}">
<block wx:if="{{ table.length > 0 }}"> <block wx:if="{{ table.length > 0 }}">
...@@ -61,7 +52,7 @@ ...@@ -61,7 +52,7 @@
>{{item[i.key] || 0}}</view> >{{item[i.key] || 0}}</view>
</block> </block>
<block wx:elif="{{ i.key == 'upgradeRate' }}">{{item[i.key] || 0}}%</block> --> <block wx:elif="{{ i.key == 'upgradeRate' }}">{{item[i.key] || 0}}%</block> -->
<block>{{item[i.key] || 0}}</block> <block>{{item[i.key] || 0}}{{i.unit}}</block>
</view> </view>
</block> </block>
</view> </view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!