index.vue 4.1 KB

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