memberlist.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <view class="orderItem" v-for="(item, index) in list" :key="index">
  5. <image class="goodImg" src="https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTLuLiaFYKXBMuc4a35Yv0f2dAlClwv2rqeZSOibsp7MQMoB47VV24FdrQaLhrmjYESqn08PKlic43x7A/132" ></image>
  6. <view class="orderInfo">
  7. <view class="info1">
  8. <view>{{ item.pname||'张三' }}</view>
  9. </view>
  10. <view class="info2">
  11. <view>{{ parse.filterTime(item.createtime) }}</view>
  12. </view>
  13. </view>
  14. </view>
  15. <view v-if="!list.length" style='color:#999;text-align:center;margin:150rpx 0;font-size:30rpx'>暂无数据</view>
  16. </view>
  17. </view>
  18. </template>
  19. <script module="parse" lang="wxs">
  20. module.exports = {
  21. filterTime: function(time) {
  22. console.log(time)
  23. var nowDate = getDate(time * 1000);
  24. var year = nowDate.getFullYear();
  25. var month = nowDate.getMonth() + 1;
  26. var date = nowDate.getDate();
  27. var hours = nowDate.getHours();
  28. var minutes = nowDate.getMinutes();
  29. var seconds = nowDate.getSeconds();
  30. month = month > 9 ? month : '0' + month;
  31. date = date > 9 ? date : '0' + date;
  32. hours = hours > 9 ? hours : '0' + hours;
  33. minutes = minutes > 9 ? minutes : '0' + minutes;
  34. seconds=seconds>9?seconds:'0'+seconds;
  35. return year + '-' + month + '-' + date + " " + hours + ":" + minutes+ ":" + seconds;
  36. }
  37. }
  38. </script>
  39. <script>
  40. // pages/backstage/index/index.js
  41. var app = getApp();
  42. // import { request } from '../../../utils/request.js';
  43. export default {
  44. data() {
  45. return {
  46. page: 1,
  47. list: [
  48. ],
  49. loaded: false,
  50. };
  51. }
  52. /**
  53. * 生命周期函数--监听页面加载
  54. */,
  55. onLoad: function (options) {
  56. this.getlist();
  57. },
  58. /**
  59. * 生命周期函数--监听页面初次渲染完成
  60. */
  61. onReady: function () {},
  62. /**
  63. * 生命周期函数--监听页面显示
  64. */
  65. onShow: function () {},
  66. /**
  67. * 生命周期函数--监听页面隐藏
  68. */
  69. onHide: function () {},
  70. /**
  71. * 生命周期函数--监听页面卸载
  72. */
  73. onUnload: function () {},
  74. /**
  75. * 页面相关事件处理函数--监听用户下拉动作
  76. */
  77. onPullDownRefresh: function () {
  78. this.init();
  79. this.getlist();
  80. uni.stopPullDownRefresh();
  81. },
  82. /**
  83. * 页面上拉触底事件的处理函数
  84. */
  85. onReachBottom: function () {
  86. this.loaded || this.getlist();
  87. },
  88. /**
  89. * 用户点击右上角分享
  90. */
  91. onShareAppMessage: function () {},
  92. methods: {
  93. async getlist() {
  94. var that = this;
  95. let res = await this.$api.request('/Activity/index', 'GET', {
  96. page: this.page,
  97. });
  98. console.log(res)
  99. if (res) {
  100. if (res.list.length > 0) {
  101. this.list = this.list.concat(res.list);
  102. this.page++;
  103. } else {
  104. this.loaded = true
  105. this.$api.msg('没有更多数据');
  106. }
  107. }
  108. },
  109. init() {
  110. this.page = 1
  111. this.loaded = false
  112. this.list = []
  113. }
  114. }
  115. };
  116. </script>
  117. <style>
  118. page {
  119. background: #fff;
  120. }
  121. .content {
  122. margin: 26rpx;
  123. background: #fff;
  124. border-radius: 20rpx;
  125. }
  126. .orderItem {
  127. display: flex;
  128. align-items: center;
  129. padding: 24rpx 20rpx;
  130. border-bottom: 1px solid #e4e5ee;
  131. box-sizing: border-box;
  132. }
  133. .orderItem > image {
  134. width: 110rpx;
  135. height: 110rpx;
  136. border-radius: 12rpx;
  137. }
  138. .orderInfo {
  139. display: flex;
  140. flex-direction: column;
  141. flex: 1;
  142. justify-content: space-between;
  143. margin-left:30rpx;
  144. }
  145. .info1 {
  146. display: flex;
  147. align-items: center;
  148. justify-content: space-between;
  149. }
  150. .info1 > view:nth-child(1) {
  151. font-size: 34rpx;
  152. width: 300rpx;
  153. overflow: hidden;
  154. text-overflow: ellipsis;
  155. white-space: nowrap;
  156. color: #010101;
  157. }
  158. .info1 > view:nth-child(2) {
  159. font-size: 28rpx;
  160. }
  161. .info2 {
  162. display: flex;
  163. align-items: center;
  164. justify-content: space-between;
  165. margin-top: 26rpx;
  166. }
  167. .info2 > view:nth-child(1) {
  168. color: #8E8E8E;
  169. font-size: 26rpx;
  170. }
  171. .color1 {
  172. color: #EC8E02 !important;
  173. }
  174. view{
  175. font-size: 24rpx;
  176. }
  177. .goodImg{
  178. width: 100rpx;
  179. height: 100rpx;
  180. border-radius: 50%!important;
  181. }
  182. </style>