Commit 0719084f by zhangxw

样式优化

1 parent 8989419b
...@@ -183,7 +183,8 @@ Component({ ...@@ -183,7 +183,8 @@ Component({
pageNum: 1, // 接待记录时间轴分页 pageNum: 1, // 接待记录时间轴分页
searchForm: {}, searchForm: {},
showEmployeeName: false, // 是否展示销售顾问字段 showEmployeeName: false, // 是否展示销售顾问字段
isShowDefeatBtn: true // 是否展示录单按钮入口 isShowDefeatBtn: true, // 是否展示录单按钮入口
loaded: false
}, },
lifetimes: { lifetimes: {
...@@ -525,29 +526,35 @@ Component({ ...@@ -525,29 +526,35 @@ Component({
// 获取接待记录统计数据 // 获取接待记录统计数据
getReceptionList() { getReceptionList() {
let params = this.getParams() let params = this.getParams()
wx.$util.showLoading() this.setData({
getReceptionRecordList({ loaded: false
merchantNo: params.merchantNo, }, () => {
startDateTime: params.startDateTime, wx.showLoading('加载中')
endDateTime: params.endDateTime, getReceptionRecordList({
staffUuids: params.staffUuids merchantNo: params.merchantNo,
}).then(res => { startDateTime: params.startDateTime,
let { code, message, data } = res endDateTime: params.endDateTime,
if (code == 0) { staffUuids: params.staffUuids
data?.forEach(val => { }).then(res => {
val.receptionStaticInfoDTOList = [] let { code, message, data } = res
val.staticDateStr = `${new Date(val.staticDate).getMonth() + 1}月${new Date(val.staticDate).getDate()}日` if (code == 0) {
}) data?.forEach(val => {
this.setData({ val.receptionStaticInfoDTOList = []
listData: data, val.staticDateStr = `${new Date(val.staticDate).getMonth() + 1}月${new Date(val.staticDate).getDate()}日`
pageNum: 1, })
nothing: false this.setData({
}, () => { listData: data,
this.getReceptionRecordDetailInfo() pageNum: 1,
}) nothing: false
} else { }, () => {
wx.$util.showToast(message) this.getReceptionRecordDetailInfo()
} })
} else {
wx.$util.showToast(message)
}
}).catch(err => {
wx.hideLoading()
})
}) })
}, },
// 获取接待记录接待时间轴详情数据 // 获取接待记录接待时间轴详情数据
...@@ -558,7 +565,7 @@ Component({ ...@@ -558,7 +565,7 @@ Component({
...this.getParams() ...this.getParams()
} }
if (nothing) return // 进获取近七天数据 if (nothing) return // 进获取近七天数据
wx.$util.showLoading() wx.showLoading('加载中')
getRecordDetailList(params).then(res => { getRecordDetailList(params).then(res => {
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
...@@ -568,6 +575,7 @@ Component({ ...@@ -568,6 +575,7 @@ Component({
}) })
}) })
this.setData({ this.setData({
loaded: true,
listData, listData,
pageNum: pageNum + 1, pageNum: pageNum + 1,
nothing: pageNum == data?.pages || data?.total == listData.reduce((acc, curr) => acc + curr?.receptionStaticInfoDTOList?.length, 0) nothing: pageNum == data?.pages || data?.total == listData.reduce((acc, curr) => acc + curr?.receptionStaticInfoDTOList?.length, 0)
...@@ -575,7 +583,9 @@ Component({ ...@@ -575,7 +583,9 @@ Component({
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
} }
wx.$util.hideLoading() wx.hideLoading()
}).catch(err => {
wx.hideLoading()
}) })
}, },
// 过滤升级/战败接待记录数据 // 过滤升级/战败接待记录数据
......
...@@ -633,7 +633,7 @@ swiper{ ...@@ -633,7 +633,7 @@ swiper{
} }
.list-not-text{ .list-not-text{
margin-top: var(--fontSize10); margin-top: var(--fontSize10);
font-size: var(--fontSize28); font-size: var(--fontSize24);
color: #BEC1C7; color: #BEC1C7;
} }
} }
......
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
</block> </block>
</block> </block>
</block> </block>
<block wx:if="{{!filter.isShowEmpty(listData)}}"> <block wx:if="{{!filter.isShowEmpty(listData) && loaded}}">
<view class="empty-box"> <view class="empty-box">
<image class="no-data-img" src="{{IMG_URL}}empty_data.png" /> <image class="no-data-img" src="{{IMG_URL}}empty_data.png" />
<view class="list-not-text">近七天暂无接待记录数据</view> <view class="list-not-text">近七天暂无接待记录数据</view>
......
...@@ -16,7 +16,8 @@ Page({ ...@@ -16,7 +16,8 @@ Page({
searchForm: {}, searchForm: {},
nothing: false, nothing: false,
showEmployeeName: false, // 是否展示销售顾问字段 showEmployeeName: false, // 是否展示销售顾问字段
isShowDefeatBtn: true isShowDefeatBtn: true,
loaded: false
}, },
/** /**
...@@ -128,29 +129,36 @@ Page({ ...@@ -128,29 +129,36 @@ Page({
getReceptionList() { getReceptionList() {
let { listData } = this.data let { listData } = this.data
let params = this.getParams() let params = this.getParams()
wx.$util.showLoading() this.setData({
getReceptionRecordList({ loaded: false
merchantNo: params.merchantNo, }, () => {
startDateTime: params.startDateTime, wx.showLoading()
endDateTime: params.endDateTime, getReceptionRecordList({
staffUuids: params.staffUuids merchantNo: params.merchantNo,
}).then(res => { startDateTime: params.startDateTime,
let { code, message, data } = res endDateTime: params.endDateTime,
if (code == 0) { staffUuids: params.staffUuids
data?.forEach(val => { }).then(res => {
val.receptionStaticInfoDTOList = [] let { code, message, data } = res
val.staticDateStr = `${new Date(val.staticDate).getMonth() + 1}月${new Date(val.staticDate).getDate()}日` if (code == 0) {
}) data?.forEach(val => {
this.setData({ val.receptionStaticInfoDTOList = []
listData: listData.concat(data), val.staticDateStr = `${new Date(val.staticDate).getMonth() + 1}月${new Date(val.staticDate).getDate()}日`
pageNum: 1 })
}, () => { this.setData({
this.getReceptionRecordDetailInfo() listData: listData.concat(data),
}) pageNum: 1
} else { }, () => {
wx.$util.showToast(message) this.getReceptionRecordDetailInfo()
} })
} else {
wx.$util.showToast(message)
}
}).catch(err => {
wx.hideLoading()
})
}) })
}, },
// 获取接待记录接待时间轴详情数据 // 获取接待记录接待时间轴详情数据
getReceptionRecordDetailInfo() { getReceptionRecordDetailInfo() {
...@@ -160,7 +168,7 @@ Page({ ...@@ -160,7 +168,7 @@ Page({
...this.getParams() ...this.getParams()
} }
if (nothing) return if (nothing) return
wx.$util.showLoading() wx.showLoading('加载中')
getRecordDetailList(params).then(res => { getRecordDetailList(params).then(res => {
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
...@@ -171,6 +179,7 @@ Page({ ...@@ -171,6 +179,7 @@ Page({
}) })
let listDataLength = listData.reduce((acc, curr) => acc + curr?.receptionStaticInfoDTOList?.length, 0) let listDataLength = listData.reduce((acc, curr) => acc + curr?.receptionStaticInfoDTOList?.length, 0)
this.setData({ this.setData({
loaded: true,
listData, listData,
pageNum: pageNum + 1, pageNum: pageNum + 1,
triggered: false, triggered: false,
...@@ -179,7 +188,9 @@ Page({ ...@@ -179,7 +188,9 @@ Page({
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
} }
wx.$util.hideLoading() wx.hideLoading()
}).catch(err => {
wx.hideLoading()
}) })
}, },
// 过滤升级/战败接待记录数据 // 过滤升级/战败接待记录数据
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<view class="list-nothing">到底了~</view> <view class="list-nothing">到底了~</view>
</block> </block>
</block> </block>
<block wx:else> <block wx:if="{{!filter.isShowEmpty(listData) && loaded}}">
<empty-data /> <empty-data />
</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!