index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <page title="审核" ref="pageRef" nav-color="#fff">
  3. <view class="pageWrapper">
  4. <tabbar
  5. custom-class="marginX14 marginT10"
  6. :data="tabs"
  7. labelKey="title"
  8. @change="clickTab"
  9. />
  10. <view class="listWrapper">
  11. <view
  12. v-for="(item, index) in tableData"
  13. :key="index"
  14. class="cell flex-align"
  15. style="margin-bottom: 10px"
  16. >
  17. <image :src="item.avatar" class="avatar" />
  18. <view class="font4 marginL12 flex1">{{ item.nickname }}</view>
  19. <view v-if="item.auditStatus === 0" class="flex-align-end">
  20. <view class="btn danger flex-align-center" @click="reject(item)">拒绝</view>
  21. <view class="btn success flex-align-center marginL15" @click="pass(item)">
  22. 通过
  23. </view>
  24. </view>
  25. <view v-else class="flex-align-end font3">
  26. <text v-if="item.auditStatus === 1" style="color: red">拒绝</text>
  27. <text v-if="item.auditStatus === 2" style="color: #6ABF45">通过</text>
  28. </view>
  29. </view>
  30. <empty v-if="!tableData || tableData.length === 0" :top="200" />
  31. </view>
  32. </view>
  33. </page>
  34. </template>
  35. <script>
  36. import tabbar from '@/components/tabbar'
  37. import pageMixin from '@/mixin/page'
  38. import empty from '@/components/empty'
  39. const Tabs = [
  40. { title: '待审核', value: 0 },
  41. { title: '审核通过', value: 2 },
  42. { title: '审核不通过', value: 1 }
  43. ]
  44. export default {
  45. mixins: [pageMixin],
  46. components: { tabbar, empty },
  47. data() {
  48. return {
  49. tabs: Tabs,
  50. tab: Tabs[0]
  51. }
  52. },
  53. onLoad(options) {
  54. this.roomId = options.id
  55. },
  56. mounted() {
  57. this.refresh(true)
  58. },
  59. onPullDownRefresh() {
  60. this.refresh()
  61. },
  62. onReachBottom() {
  63. this.loadMore()
  64. },
  65. methods: {
  66. clickTab(index) {
  67. this.tab = this.tabs[index]
  68. this.refresh(true)
  69. },
  70. async loadData(loading) {
  71. const res = await this.$service.weal.roomAuditRecord(
  72. this.pageNum,
  73. this.pageSize,
  74. this.roomId,
  75. this.tab.value,
  76. loading
  77. )
  78. return res
  79. },
  80. async pass(item) {
  81. const res = await this.$service.weal.roomAuditPass(item.id)
  82. if (res) {
  83. item.auditStatus = 2
  84. }
  85. },
  86. async reject(item) {
  87. const res = await this.$service.weal.roomAuditUnPass(item.id)
  88. if (res) {
  89. item.auditStatus = 1
  90. }
  91. }
  92. }
  93. }
  94. </script>
  95. <style></style>
  96. <style lang="scss" scoped>
  97. .pageWrapper {
  98. background-color: #fff;
  99. }
  100. .bg {
  101. position: fixed;
  102. z-index: -1;
  103. left: 0;
  104. right: 0;
  105. top: 0;
  106. width: 100%;
  107. height: 100%;
  108. background-color: #fff;
  109. }
  110. .listWrapper {
  111. background-color: #fff;
  112. min-height: 100vh;
  113. padding: 20rpx;
  114. }
  115. .cell {
  116. position: relative;
  117. height: 48px;
  118. background: #f8f8f8;
  119. border-radius: 4px;
  120. padding-left: 15px;
  121. padding-right: 15px;
  122. .avatar {
  123. width: 60rpx;
  124. height: 60rpx;
  125. border-radius: 30rpx;
  126. }
  127. .btn {
  128. width: 80rpx;
  129. height: 46rpx;
  130. border-radius: 8rpx;
  131. color: #fff;
  132. font-size: 24rpx;
  133. &.danger {
  134. background: #dd524d;
  135. }
  136. &.success {
  137. background: #6ac144;
  138. }
  139. }
  140. }
  141. </style>