Commit 0719084f by zhangxw

样式优化

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