user.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <view class="pos-r padding-lr-sm">
  3. <use-tabbar :tabbar="false" />
  4. <view class="gold-section">
  5. <view class="item dflex dflex-flow-c">
  6. <text>共{{page}}个用户</text>
  7. </view>
  8. </view>
  9. <!-- 记录列表 -->
  10. <view class="record-list margin-top-sm" v-if="fetch">
  11. <view class="record-title fs fwbd ft-black margin-bottom-sm">用户列表</view>
  12. <u-empty v-if="fetch.list && fetch.list.length <= 0" marginTop="30" mode="data" text="暂无记录"></u-empty>
  13. <view v-else>
  14. <view class="record-item" v-for="(item, index) in fetch.list" :key="index"
  15. @click="Dever.pic.preview([item.avatar], item.avatar)">
  16. <view class="record-left">
  17. <image class="record-avatar" :src="item.avatar" mode="aspectFill"></image>
  18. <view class="record-info">
  19. <view class="record-name">{{ item.name }}</view>
  20. <view class="record-time">{{ item.cdate_str }}</view>
  21. </view>
  22. </view>
  23. <view class="record-amount lock">
  24. <text>{{ item.order }}</text>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="safe-area-inset-bottom"></view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. fetch: {},
  37. page: 0,
  38. type: 0,
  39. id: 0,
  40. };
  41. },
  42. onLoad(options) {
  43. this.type = options.type;
  44. this.id = options.id;
  45. if (!this.type || !this.id) {
  46. return Dever.goUser()
  47. }
  48. },
  49. onShow() {
  50. this.loadData(1);
  51. },
  52. //下拉刷新
  53. onPullDownRefresh() {
  54. this.loadData(1);
  55. },
  56. //加载更多
  57. onReachBottom() {
  58. this.loadData(2);
  59. },
  60. methods: {
  61. loadData(page) {
  62. this.DeverApi.page([page, 'list'], this, 'sales.getUser', {sales_type:this.type, sales_id: this.id}, res => {
  63. this.page = res.page;
  64. });
  65. },
  66. }
  67. };
  68. </script>
  69. <style lang="scss">
  70. .gold-section {
  71. background: #ffffff;
  72. border-radius: 24rpx;
  73. padding: 32rpx;
  74. .dflex-b {
  75. display: flex;
  76. justify-content: space-between;
  77. align-items: center;
  78. }
  79. .title {
  80. font-size: 32rpx;
  81. font-weight: bold;
  82. color: #333;
  83. }
  84. .link {
  85. font-size: 24rpx;
  86. color: #ff9800;
  87. text-decoration: underline;
  88. }
  89. .balance-number {
  90. margin-top: 20rpx;
  91. .price {
  92. font-size: 48rpx;
  93. color: #ff9800;
  94. font-weight: bold;
  95. }
  96. }
  97. .amount-summary {
  98. display: flex;
  99. justify-content: space-between;
  100. margin-top: 32rpx;
  101. .summary-item {
  102. flex: 1;
  103. display: flex;
  104. flex-direction: column;
  105. .label {
  106. font-size: 24rpx;
  107. color: #888;
  108. }
  109. .value {
  110. margin-top: 10rpx;
  111. font-size: 30rpx;
  112. font-weight: 600;
  113. color: #333;
  114. }
  115. }
  116. }
  117. }
  118. .card-tile {
  119. border-radius: 24rpx;
  120. padding: 30rpx;
  121. background: #ffffff;
  122. display: flex;
  123. align-items: center;
  124. justify-content: center;
  125. transition: all 0.2s ease-in-out;
  126. .icon {
  127. font-size: 60rpx;
  128. margin-right: 24rpx;
  129. }
  130. .text-content {
  131. display: flex;
  132. flex-direction: column;
  133. .title {
  134. font-size: 30rpx;
  135. font-weight: 600;
  136. color: #333;
  137. }
  138. .desc {
  139. font-size: 24rpx;
  140. color: #999;
  141. margin-top: 6rpx;
  142. }
  143. }
  144. &:active {
  145. transform: scale(0.97);
  146. }
  147. &:first-child {
  148. margin-right: 10rpx;
  149. }
  150. }
  151. .wpre-50 .card-tile {
  152. &:first-child {
  153. margin-bottom: 12rpx;
  154. margin-right: 0rpx;
  155. }
  156. }
  157. .record-list {
  158. background: #ffffff;
  159. border-radius: 20rpx;
  160. padding: 30rpx;
  161. .record-title {
  162. font-size: 30rpx;
  163. font-weight: bold;
  164. color: #333;
  165. }
  166. .record-item {
  167. display: flex;
  168. justify-content: space-between;
  169. align-items: center;
  170. padding: 20rpx 0;
  171. border-bottom: 1px solid #f0f0f0;
  172. &:last-child {
  173. border-bottom: none;
  174. }
  175. .record-left {
  176. display: flex;
  177. align-items: center;
  178. .record-avatar {
  179. width: 84rpx;
  180. height: 84rpx;
  181. border-radius: 50%; // 圆形头像
  182. margin-right: 20rpx;
  183. }
  184. .record-info {
  185. display: flex;
  186. flex-direction: column;
  187. .record-name {
  188. font-size: 28rpx;
  189. color: #333;
  190. }
  191. .record-time {
  192. font-size: 24rpx;
  193. color: #999;
  194. margin-top: 6rpx;
  195. }
  196. }
  197. .record-name {
  198. font-size: 28rpx;
  199. color: #333;
  200. }
  201. .record-desc {
  202. font-size: 28rpx;
  203. color: #999;
  204. }
  205. .record-time {
  206. font-size: 24rpx;
  207. color: #999;
  208. margin-top: 6rpx;
  209. }
  210. }
  211. .record-amount {
  212. font-size: 28rpx;
  213. font-weight: bold;
  214. &.income {
  215. color: #4caf50;
  216. }
  217. &.expense {
  218. color: #f44336;
  219. }
  220. &.lock {
  221. color: #999;
  222. }
  223. }
  224. }
  225. }
  226. .empty-record {
  227. text-align: center;
  228. padding: 60rpx 0;
  229. .empty-icon {
  230. width: 160rpx;
  231. height: 160rpx;
  232. margin-bottom: 20rpx;
  233. opacity: 0.6;
  234. }
  235. .empty-text {
  236. font-size: 28rpx;
  237. color: #999;
  238. }
  239. }
  240. </style>