uni-events-helper-wx
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
2.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <view class="content flex_col flex_start">
  3. <!-- item -->
  4. <view class="item flex_col flex_start_y bg-white padding " v-for="(i,k) in pageList" @click="jumpDetail(i)">
  5. <view class="title flex_row flex_start">
  6. <view class="text-m text-left">{{i.msg_title}}</view>
  7. <view class="bandage" v-if="!i.is_read"></view>
  8. </view>
  9. <view class="time">{{i.updated_at}}</view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import {msgList} from "../../nxTemp/apis/userAPI.js"
  15. export default {
  16. data() {
  17. return {
  18. address:"",
  19. login:true,
  20. postData:{
  21. page:1,
  22. page_size:10
  23. },
  24. listLoadFinished:false,
  25. listTotal:0,
  26. pageList:[],
  27. no_data_txt:"还没有任何赛事~"
  28. };
  29. },
  30. onLoad(parms) {
  31. },
  32. onShow() {
  33. this.updateList()
  34. },
  35. onUnload() {
  36. this.resetPostData()
  37. },
  38. onReachBottom(){
  39. console.log("onReachBottom");
  40. this.updateList()
  41. },
  42. methods: {
  43. updateList(){
  44. if(this.listLoadFinished)return this.$tools.showNone("已加载完毕")
  45. msgList(this.postData).then(res => {
  46. // this.$tools.showNone("已更新");
  47. this.pageList.push(...res.list)
  48. checkListLoadFinished(res,this);
  49. }).catch(e=>{
  50. this.$tools.showNone(e.errMsg)
  51. })
  52. function checkListLoadFinished(res,that){
  53. if(that.pageList.length == res.total)that.listLoadFinished = true
  54. else that.postData.page++
  55. }
  56. },
  57. //重置请求参数
  58. resetPostData(){
  59. this.postData = {
  60. page:1,
  61. page_size:10
  62. }
  63. this.pageList = []
  64. this.listLoadFinished = false
  65. },
  66. jumpPage(name){
  67. this.$Router.push({name:name})
  68. },
  69. jumpDetail(i){
  70. let {id,msg_optid} = i
  71. this.resetPostData()
  72. this.$Router.push({
  73. name:"messageDetail",
  74. params:{
  75. id,msg_optid
  76. }
  77. })
  78. },
  79. }
  80. }
  81. </script>
  82. <style lang="less" scoped>
  83. .content{
  84. .item{
  85. color: #333333;
  86. position: relative;
  87. margin-top: 24rpx;
  88. border-radius: 10rpx;
  89. width: 702rpx;
  90. height: 124rpx;
  91. .title{
  92. font-size: 32rpx;
  93. color: #1A1A1A;
  94. margin-bottom: 10rpx;
  95. font-weight: 700;
  96. }
  97. .time{
  98. font-size: 24rpx;
  99. color: #B2B2B2;
  100. }
  101. .bandage{
  102. width: 16rpx;
  103. height: 16rpx;
  104. // position: absolute;
  105. // right: 60rpx;
  106. background: #EA5061;
  107. border-radius: 50%;
  108. font-size: 24rpx;
  109. color: white;
  110. text-align: center;
  111. line-height: 34rpx;
  112. margin-top: -16rpx;
  113. margin-left: 10rpx;
  114. }
  115. }
  116. }
  117. </style>