123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <template>
- <page title="审核" ref="pageRef" nav-color="#fff">
- <view class="pageWrapper">
- <tabbar
- custom-class="marginX14 marginT10"
- :data="tabs"
- labelKey="title"
- @change="clickTab"
- />
- <view class="listWrapper">
- <view
- v-for="(item, index) in tableData"
- :key="index"
- class="cell flex-align"
- style="margin-bottom: 10px"
- >
- <image :src="item.avatar" class="avatar" />
- <view class="font4 marginL12 flex1">{{ item.nickname }}</view>
- <view v-if="item.auditStatus === 0" class="flex-align-end">
- <view class="btn danger flex-align-center" @click="reject(item)">拒绝</view>
- <view class="btn success flex-align-center marginL15" @click="pass(item)">
- 通过
- </view>
- </view>
- <view v-else class="flex-align-end font3">
- <text v-if="item.auditStatus === 1" style="color: red">拒绝</text>
- <text v-if="item.auditStatus === 2" style="color: #6ABF45">通过</text>
- </view>
- </view>
- <empty v-if="!tableData || tableData.length === 0" :top="200" />
- </view>
- </view>
- </page>
- </template>
- <script>
- import tabbar from '@/components/tabbar'
- import pageMixin from '@/mixin/page'
- import empty from '@/components/empty'
- const Tabs = [
- { title: '待审核', value: 0 },
- { title: '审核通过', value: 2 },
- { title: '审核不通过', value: 1 }
- ]
- export default {
- mixins: [pageMixin],
- components: { tabbar, empty },
- data() {
- return {
- tabs: Tabs,
- tab: Tabs[0]
- }
- },
- onLoad(options) {
- this.roomId = options.id
- },
- mounted() {
- this.refresh(true)
- },
- onPullDownRefresh() {
- this.refresh()
- },
- onReachBottom() {
- this.loadMore()
- },
- methods: {
- clickTab(index) {
- this.tab = this.tabs[index]
- this.refresh(true)
- },
- async loadData(loading) {
- const res = await this.$service.weal.roomAuditRecord(
- this.pageNum,
- this.pageSize,
- this.roomId,
- this.tab.value,
- loading
- )
- return res
- },
- async pass(item) {
- const res = await this.$service.weal.roomAuditPass(item.id)
- if (res) {
- item.auditStatus = 2
- }
- },
- async reject(item) {
- const res = await this.$service.weal.roomAuditUnPass(item.id)
- if (res) {
- item.auditStatus = 1
- }
- }
- }
- }
- </script>
- <style></style>
- <style lang="scss" scoped>
- .pageWrapper {
- background-color: #fff;
- }
- .bg {
- position: fixed;
- z-index: -1;
- left: 0;
- right: 0;
- top: 0;
- width: 100%;
- height: 100%;
- background-color: #fff;
- }
- .listWrapper {
- background-color: #fff;
- min-height: 100vh;
- padding: 20rpx;
- }
- .cell {
- position: relative;
- height: 48px;
- background: #f8f8f8;
- border-radius: 4px;
- padding-left: 15px;
- padding-right: 15px;
- .avatar {
- width: 60rpx;
- height: 60rpx;
- border-radius: 30rpx;
- }
- .btn {
- width: 80rpx;
- height: 46rpx;
- border-radius: 8rpx;
- color: #fff;
- font-size: 24rpx;
- &.danger {
- background: #dd524d;
- }
- &.success {
- background: #6ac144;
- }
- }
- }
- </style>
|