todaySpecialistsList.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="page">
  3. <!-- #ifdef H5-->
  4. <uni-nav-bar v-if="!$isWxBrowser()" :fixed="true" background-color="#FFE05C" :border="false" :statusBar="false"
  5. left-icon="left" title="今日新增专员记录" @clickLeft="back"/>
  6. <!-- #endif -->
  7. <view :style="{height:height}">
  8. <mescroll-item ref="MescrollItem" :i="0" :index="0" :height="height">
  9. </mescroll-item>
  10. </view>
  11. <!--#ifdef H5-->
  12. <liu-drag-button v-if="$isWxBrowser()" @clickBtn="back">返回</liu-drag-button>
  13. <!--#endif-->
  14. </view>
  15. </template>
  16. <script>
  17. import MescrollItem from "./module/mescrollUni-item.vue";
  18. export default {
  19. components: {
  20. MescrollItem
  21. },
  22. data() {
  23. return {
  24. height:'',
  25. }
  26. },
  27. onLoad(e) {
  28. let sysInfo = uni.getSystemInfoSync()
  29. this.height = sysInfo.windowHeight - 50 + 'px' //除标题栏栏外的屏幕可用高度
  30. },
  31. methods: {
  32. back() {
  33. let pages = getCurrentPages()
  34. if (pages.length > 1){
  35. uni.navigateBack({
  36. delta: 1,
  37. fail:err=>{
  38. console.log(err)
  39. }
  40. })
  41. }else {
  42. uni.switchTab({
  43. url: '/pages/my/my'
  44. });
  45. }
  46. },
  47. /*下拉刷新的回调 */
  48. downCallback() {
  49. // 这里加载你想下拉刷新的数据, 比如刷新轮播数据
  50. // loadSwiper();
  51. // 下拉刷新的回调,默认重置上拉加载列表为第一页 (自动执行 page.num=1, 再触发upCallback方法 )
  52. this.mescroll.resetUpScroll()
  53. },
  54. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  55. upCallback(page) {
  56. let status = this.index
  57. if (this.index === 3){
  58. status = 4
  59. }
  60. //联网加载数据
  61. this.mescroll.endSuccess(10, false);
  62. // this.$api.service.performanceList({
  63. // pageNum: page.num,
  64. // pageSize: 10,
  65. // type:this.index
  66. // }).then((res) => {
  67. // //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
  68. // this.mescroll.endSuccess(res.data.data.records.length, res.data.data.records.length === 10);
  69. // //设置列表数据
  70. // if (page.num === 1) this.list = []; //如果是第一页需手动制空列表
  71. // res.data.data.records.forEach(i=>{
  72. // if (i.avatar){
  73. // i.avatar = i.avatar.replace(/^http:/, "https:")
  74. // }
  75. // })
  76. // this.list = this.list.concat(res.data.data.records); //追加新数据
  77. // console.log(this.list)
  78. // }).catch((err) => {
  79. // //联网失败, 结束加载
  80. // this.mescroll.endErr();
  81. // })
  82. },
  83. //点击空布局按钮的回调
  84. emptyClick() {
  85. uni.showToast({
  86. title: '点击了按钮,具体逻辑自行实现'
  87. })
  88. },
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. @import './index.rpx.css';
  94. </style>