index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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}&orderGoodsId=${item.orderGoodsId}&goodsId=${item.goodsId}`" 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. systemStatusList:'1,2',
  53. pageNum: 1,
  54. pageSize: 8
  55. }
  56. };
  57. },
  58. onPullDownRefresh() {
  59. this.formData.pageNum = 1
  60. this.$api
  61. .getappinformUserlist(this.formData)
  62. .then(res => {
  63. if (res.data.code === 200) {
  64. this.listData = res.data.rows;
  65. this.totals = res.data.total;
  66. }
  67. })
  68. .finally(() => {
  69. uni.stopPullDownRefresh();
  70. });
  71. },
  72. onLoad(option) {
  73. this.$store.getters.dictObj;
  74. this.getInfo();
  75. },
  76. onShow() {
  77. // this.getInfo();
  78. },
  79. onShareAppMessage(res) {
  80. var self = this;
  81. return {
  82. title: '中正',
  83. path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
  84. };
  85. },
  86. methods: {
  87. getChangeData(v){
  88. this.listData.map(item => {
  89. if(item.id === v && item.receiptStatus !== 1){
  90. item.receiptStatus = 1
  91. }
  92. })
  93. },
  94. getInfo() {
  95. this.$api.getappinformUserlist(this.formData).then(res => {
  96. if (res.data.code === 200) {
  97. this.listData = res.data.rows;
  98. this.totals = res.data.total;
  99. }
  100. });
  101. },
  102. againGetApi() {
  103. this.$api.getappinformUserlist(this.formData).then(res => {
  104. if (res.data.code === 200) {
  105. this.listData = this.listData.concat(res.data.rows);
  106. }
  107. });
  108. }
  109. },
  110. onReachBottom() {
  111. if (this.listData.length < this.totals) {
  112. this.formData.pageNum++;
  113. this.againGetApi();
  114. }
  115. },
  116. computed: { ...mapGetters(['userInfo']) }
  117. };
  118. </script>
  119. <style>
  120. page {
  121. background: #eaeef1;
  122. }
  123. </style>
  124. <style scoped>
  125. .btn2 {
  126. width: 144rpx;
  127. height: 48rpx;
  128. background: #ffffff;
  129. border: 2rpx solid #007aff;
  130. border-radius: 16rpx;
  131. text-align: center;
  132. line-height: 48rpx;
  133. color: #007aff;
  134. margin: 0 8rpx;
  135. }
  136. .btn1 {
  137. width: 144rpx;
  138. height: 48rpx;
  139. background: #ffffff;
  140. border: 2rpx solid #999999;
  141. border-radius: 16rpx;
  142. text-align: center;
  143. line-height: 48rpx;
  144. color: #999999;
  145. margin: 0 8rpx;
  146. }
  147. .item {
  148. background: #ffffff;
  149. border-radius: 16rpx;
  150. padding: 15rpx;
  151. }
  152. .priceTag {
  153. font-size: 30rpx;
  154. font-family: PingFang SC;
  155. font-weight: bold;
  156. color: #ff2d55;
  157. display: flex;
  158. flex-direction: row-reverse;
  159. }
  160. .bottomBox {
  161. position: fixed;
  162. bottom: 0;
  163. width: 100%;
  164. left: 0;
  165. height: 98rpx;
  166. background-color: #ffffff;
  167. display: flex;
  168. justify-content: space-between;
  169. align-items: center;
  170. padding: 0 30rpx;
  171. }
  172. </style>