notification.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view>
  3. <u-list @scrolltolower="scrolltolower" class="view">
  4. <view class="hand">
  5. <u-row>
  6. <u-col span="8">
  7. <view class="orgTop">
  8. <uni-row>
  9. <uni-col :span="12">
  10. <u--text text="所属机构" size="22" bold color="#619f8a"></u--text>
  11. </uni-col>
  12. <uni-col :span="12">
  13. <u--text :text="data.organizationName" size="22" bold color="#757575">
  14. </u--text>
  15. </uni-col>
  16. </uni-row>
  17. </view>
  18. </u-col>
  19. <!--<u-col span="4">
  20. <view>
  21. <u-button class="sxButton" size="normal" loadingMode="circle" color="#65c1aa">统计查看
  22. </u-button>
  23. </view>
  24. </u-col> -->
  25. </u-row>
  26. </view>
  27. <u-list-item v-for="(item, index) in indexList" :key="index">
  28. <view class="listItemStyle">
  29. <view class="nitTitleLocation">
  30. <u--text :text="item.nitTitle" size="24" bold></u--text>
  31. </view>
  32. <view class="nitCententLocation">
  33. <u--text :text="item.nitCentent" size="18"></u--text>
  34. </view>
  35. <view class="nitDateLocation">
  36. <u--text :text="item.nitDate" size="12" color="#a1a1a1"></u--text>
  37. </view>
  38. <view>
  39. <u-gap height="1" bgColor="#b6b6b6"></u-gap>
  40. </view>
  41. <view>
  42. <u-cell-group :border="false">
  43. <u-cell title="查看详情" :isLink="true" arrow-direction="left" :border="false"></u-cell>
  44. </u-cell-group>
  45. </view>
  46. </view>
  47. </u-list-item>
  48. <br>
  49. <br>
  50. </u-list>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. dateShow: false,
  58. data: {
  59. organizationName: "暂无机构",
  60. },
  61. from: {},
  62. indexList: []
  63. }
  64. },
  65. onLoad() {
  66. //this.getRechargeHistoryList()
  67. },
  68. methods: {
  69. async getRechargeHistoryList() {
  70. this.from.userName = uni.getStorageSync('userInfo').userName
  71. const orgInfo = uni.getStorageSync('orgInfo');
  72. this.from.organizationCode = orgInfo.organizationCode
  73. this.data.organizationName = orgInfo.organizationName
  74. // 发送请求
  75. const {
  76. data: res
  77. } = await this.$httpRequest({
  78. url: '/app',
  79. method: 'post',
  80. data: this.from
  81. });
  82. if (res.code === 200) {
  83. uni.showToast({
  84. duration: 1500,
  85. icon: 'checkmark'
  86. });
  87. this.loadmore(res.data)
  88. }
  89. },
  90. submitDate(e) {
  91. this.dateShow = false
  92. //使用change事件中的日期数据 防止用户快速滑动同时点击确定后数据丢失
  93. this.from.date = this.changeDate
  94. //获取消费信息
  95. this.indexList = this.getRechargeHistoryList()
  96. },
  97. change(e) {
  98. this.changeDate = this.result(e.value, e.mode)
  99. },
  100. scrolltolower() {
  101. //this.getRechargeHistoryList()
  102. },
  103. loadmore(data) {
  104. for (var i = 0; i < data.length; i++) {
  105. this.indexList.push(data[i])
  106. }
  107. },
  108. result(time, mode) {
  109. const timeFormat = uni.$u.timeFormat
  110. switch (mode) {
  111. case 'datetime':
  112. return timeFormat(time, 'yyyy-mm-dd hh:MM')
  113. case 'date':
  114. return timeFormat(time, 'yyyy-mm-dd')
  115. case 'year-month':
  116. return timeFormat(time, 'yyyy-mm')
  117. case 'time':
  118. return time
  119. default:
  120. return ''
  121. }
  122. }
  123. }
  124. }
  125. </script>
  126. <style>
  127. .view {
  128. background-color: #ebebeb;
  129. }
  130. .hand {
  131. padding: 5%;
  132. margin: 0 10px;
  133. border-radius: 15px;
  134. background: linear-gradient(to bottom right, #97dad8, #f1fef9);
  135. }
  136. .orgTop {
  137. margin-bottom: 5px;
  138. }
  139. .sxButton {
  140. width: 100px;
  141. display: flex;
  142. flex-direction: column;
  143. align-items: center;
  144. }
  145. .listTermDate {
  146. padding: 10px 0;
  147. }
  148. .listItemStyle {
  149. margin: 10px 12px;
  150. padding: 5px;
  151. border-radius: 15px;
  152. background-color: #fafafa;
  153. }
  154. .nitTitleLocation {
  155. margin: 10px 0 0 10px;
  156. }
  157. .nitCententLocation {
  158. margin: 10px 0 0 10px;
  159. }
  160. .nitDateLocation {
  161. margin: 10px 0 10px 10px;
  162. }
  163. </style>