index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <view>
  3. <nav-bar title="我的消息"></nav-bar>
  4. <view v-if="!listData.length"><u-empty text="消息列表为空" mode="message"></u-empty></view>
  5. <view v-else v-for="(item, index) in listData" :key="index" style="padding-bottom: 20rpx;">
  6. <navigator hover-class="none" :url="`/pages2/msg/detail?id=${item.id}`" class="item" :style="item.receiptStatus === 1 ? 'opacity: 0.7' : ''">
  7. <view style="display: flex;justify-content: space-between;align-items: center;height: 60rpx;">
  8. <view style="color: #333333;font-size: 30rpx;font-weight: bold;display: flex;align-items: center;">
  9. <image :src="item.systemStatus === 1 ? img1 : img2" style="width: 40rpx;height: 40rpx;margin-right: 10rpx;"></image>
  10. {{item.systemStatus === 1 ? '系统通知' : '教务通知'}}
  11. </view>
  12. <view style="color: #999999;font-size: 24rpx;">{{ $method.timestampToTime(item.sendTime, false) }}</view>
  13. </view>
  14. <u-line color="#D6D6DB" />
  15. <view style="display: flex;justify-content: space-between;padding: 25rpx;color: #666666;">
  16. {{ item.systemStatus === 2 ? item.informVo.informName : item.systemStatus === 1 ? item.text : '接口异常' }}
  17. </view>
  18. <u-line color="#D6D6DB" />
  19. <view style="display: flex;justify-content: space-between;align-items: center;height: 50rpx;margin-top: 10rpx;padding: 0 25rpx;">
  20. <view class="color: #333333;font-size: 28rpx;">查看详情</view>
  21. <view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
  22. </view>
  23. </navigator>
  24. </view>
  25. <u-divider v-if="totals !== 0 && listData.length === totals" bg-color="#eaeef1">到底了</u-divider>
  26. </view>
  27. </template>
  28. <script>
  29. import { mapGetters } from 'vuex';
  30. export default {
  31. components: {},
  32. data() {
  33. return {
  34. list: [
  35. {
  36. name: '待支付'
  37. },
  38. {
  39. name: '已支付'
  40. },
  41. {
  42. name: '已取消'
  43. }
  44. ],
  45. list1: [1, 2, 3, 4, 5, 6, 7],
  46. current: 0,
  47. img1: '/static/icon/msg_icon1.png',
  48. img2: '/static/icon/msg_icon2.png',
  49. listData: [],
  50. totals: 0,
  51. formData: {
  52. pageNum: 1,
  53. pageSize: 8
  54. }
  55. };
  56. },
  57. onPullDownRefresh() {
  58. this.formData.pageNum = 1
  59. this.$api
  60. .getappinformUserlist(this.formData)
  61. .then(res => {
  62. if (res.data.code === 200) {
  63. this.listData = res.data.rows;
  64. this.totals = res.data.total;
  65. }
  66. })
  67. .finally(() => {
  68. uni.stopPullDownRefresh();
  69. });
  70. },
  71. onLoad(option) {
  72. this.$store.getters.dictObj;
  73. this.getInfo();
  74. },
  75. onShow() {
  76. // this.getInfo();
  77. },
  78. onShareAppMessage(res) {
  79. var self = this;
  80. return {
  81. title: '中正',
  82. path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
  83. };
  84. },
  85. methods: {
  86. getChangeData(v){
  87. this.listData.map(item => {
  88. if(item.id === v && item.receiptStatus !== 1){
  89. item.receiptStatus = 1
  90. }
  91. })
  92. },
  93. getInfo() {
  94. this.$api.getappinformUserlist(this.formData).then(res => {
  95. if (res.data.code === 200) {
  96. this.listData = res.data.rows;
  97. this.totals = res.data.total;
  98. }
  99. });
  100. },
  101. againGetApi() {
  102. this.$api.getappinformUserlist(this.formData).then(res => {
  103. if (res.data.code === 200) {
  104. this.listData = this.listData.concat(res.data.rows);
  105. }
  106. });
  107. }
  108. },
  109. onReachBottom() {
  110. if (this.listData.length < this.totals) {
  111. this.formData.pageNum++;
  112. this.againGetApi();
  113. }
  114. },
  115. computed: { ...mapGetters(['userInfo']) }
  116. };
  117. </script>
  118. <style>
  119. page {
  120. background: #eaeef1;
  121. }
  122. </style>
  123. <style scoped>
  124. .btn2 {
  125. width: 144rpx;
  126. height: 48rpx;
  127. background: #ffffff;
  128. border: 2rpx solid #007aff;
  129. border-radius: 16rpx;
  130. text-align: center;
  131. line-height: 48rpx;
  132. color: #007aff;
  133. margin: 0 8rpx;
  134. }
  135. .btn1 {
  136. width: 144rpx;
  137. height: 48rpx;
  138. background: #ffffff;
  139. border: 2rpx solid #999999;
  140. border-radius: 16rpx;
  141. text-align: center;
  142. line-height: 48rpx;
  143. color: #999999;
  144. margin: 0 8rpx;
  145. }
  146. .item {
  147. background: #ffffff;
  148. border-radius: 16rpx;
  149. padding: 15rpx;
  150. }
  151. .priceTag {
  152. font-size: 30rpx;
  153. font-family: PingFang SC;
  154. font-weight: bold;
  155. color: #ff2d55;
  156. display: flex;
  157. flex-direction: row-reverse;
  158. }
  159. .bottomBox {
  160. position: fixed;
  161. bottom: 0;
  162. width: 100%;
  163. left: 0;
  164. height: 98rpx;
  165. background-color: #ffffff;
  166. display: flex;
  167. justify-content: space-between;
  168. align-items: center;
  169. padding: 0 30rpx;
  170. }
  171. </style>