index.vue 4.6 KB

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