memberlist.vue 4.6 KB

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