|
@@ -0,0 +1,357 @@
|
|
|
+<template>
|
|
|
+ <view class="container main">
|
|
|
+ <view class="one" v-if="total>0">
|
|
|
+ <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-view" @scrolltolower="toPage"
|
|
|
+ @scroll="toScroll">
|
|
|
+ <view class="list-scroll-view">
|
|
|
+ <view class="list" v-for="(item, index) in list" :key="index">
|
|
|
+ <view class="value">
|
|
|
+ <view class="title">编号:</view>
|
|
|
+ <view class="label"> <text :user-select="true">{{item.no||'暂无'}}</text> </view>
|
|
|
+ </view>
|
|
|
+ <view class="value">
|
|
|
+ <view class="title">赛事名称:</view>
|
|
|
+ <view class="label">{{item.match_name||'暂无'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="value">
|
|
|
+ <view class="title">用户名称:</view>
|
|
|
+ <view class="label">{{item.user_name||'暂无'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="value">
|
|
|
+ <view class="title">报名时间:</view>
|
|
|
+ <view class="label">{{item.time||'暂无'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="value" v-if="item.start_time">
|
|
|
+ <view class="title">初审时间:</view>
|
|
|
+ <view class="label">{{item.start_time||'暂无'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="value" v-if="item.score">
|
|
|
+ <view class="title">初审分数:</view>
|
|
|
+ <view class="label">{{item.score||'暂无'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="value" v-if="item.final_start_time">
|
|
|
+ <view class="title">决赛时间:</view>
|
|
|
+ <view class="label">{{item.final_start_time||'暂无'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="value" v-if="item.final_score">
|
|
|
+ <view class="title">决赛分数:</view>
|
|
|
+ <view class="label">{{item.final_score||'暂无'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="value">
|
|
|
+ <view class="title">是否进入决赛:</view>
|
|
|
+ <view class="label">{{getDict(item,'final_confirm')||'暂无'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="value">
|
|
|
+ <view class="title">流程状态:</view>
|
|
|
+ <view class="label">{{getDict(item,'ext_status')||'暂无'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="value" v-if="item.ext_status=='0'">
|
|
|
+ <view class="title">状态:</view>
|
|
|
+ <view class="label">{{getDict(item,'status')||'暂无'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="bottom">
|
|
|
+ <button class="button button_3" type="default" size="mini"
|
|
|
+ @tap.stop="toView(item)">查看详情</button>
|
|
|
+ <button v-if="item.ext_status=='0'" class="button button_1" type="default" size="mini"
|
|
|
+ @tap.stop="toStatus(item,'1')">已通过</button>
|
|
|
+ <button v-if="item.ext_status=='0'" class="button button_2" type="primary" size="mini"
|
|
|
+ @tap.stop="toStatus(item,'2')">已退回</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="is_bottom" v-if="is_bottom">
|
|
|
+ <text>{{config.bottom_title||'到底了!'}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+ <o-empty v-else />
|
|
|
+ <uni-popup ref="alertDialog" type="dialog">
|
|
|
+ <uni-popup-dialog type="warn" cancelText="关闭" confirmText="同意" title="提示" content="是否确定对该数据进行操作!"
|
|
|
+ @confirm="dialogConfirm"></uni-popup-dialog>
|
|
|
+ </uni-popup>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ id: '',
|
|
|
+ user: {},
|
|
|
+ config: {},
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ skip: 0,
|
|
|
+ limit: 5,
|
|
|
+ page: 0,
|
|
|
+ // 数据是否触底
|
|
|
+ is_bottom: false,
|
|
|
+ scrollTop: 0,
|
|
|
+ // 禁止滚动穿透
|
|
|
+ show: false,
|
|
|
+ statusList: [{
|
|
|
+ value: '0',
|
|
|
+ label: '待审核'
|
|
|
+ }, {
|
|
|
+ value: '1',
|
|
|
+ label: '已通过'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '-1',
|
|
|
+ label: '已退回'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ isList: [{
|
|
|
+ value: '0',
|
|
|
+ label: '是'
|
|
|
+ }, {
|
|
|
+ value: '1',
|
|
|
+ label: '否'
|
|
|
+ }],
|
|
|
+ extList: [],
|
|
|
+ form: {},
|
|
|
+ status: '',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad: async function(e) {
|
|
|
+ const that = this;
|
|
|
+ that.$set(that, `id`, e && e.id || '');
|
|
|
+ await that.searchToken();
|
|
|
+ await that.searchOther();
|
|
|
+ await that.searchConfig();
|
|
|
+ },
|
|
|
+ onShow: async function() {
|
|
|
+ const that = this;
|
|
|
+ that.clearPage();
|
|
|
+ await that.search();
|
|
|
+ },
|
|
|
+ onPullDownRefresh: async function() {
|
|
|
+ const that = this;
|
|
|
+ that.clearPage();
|
|
|
+ await that.search();
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 禁止滚动穿透
|
|
|
+ change(e) {
|
|
|
+ const that = this;
|
|
|
+ that.show = e.show
|
|
|
+ },
|
|
|
+ // 用户信息
|
|
|
+ searchToken() {
|
|
|
+ const that = this;
|
|
|
+ try {
|
|
|
+ const res = uni.getStorageSync('token');
|
|
|
+ if (res) {
|
|
|
+ const user = that.$jwt(res);
|
|
|
+ that.$set(that, `user`, user);
|
|
|
+ }
|
|
|
+ } catch (e) {}
|
|
|
+ },
|
|
|
+ async searchOther() {
|
|
|
+ const that = this;
|
|
|
+ let res;
|
|
|
+ // 查询证件类型
|
|
|
+ res = await that.$api(`/dictData`, 'GET', {
|
|
|
+ code: 'extStatus',
|
|
|
+ is_use: '0',
|
|
|
+ })
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ that.$set(that, `extList`, res.data)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ searchConfig() {
|
|
|
+ const that = this;
|
|
|
+ try {
|
|
|
+ const res = uni.getStorageSync('config');
|
|
|
+ if (res) that.$set(that, `config`, res);
|
|
|
+ } catch (e) {}
|
|
|
+ },
|
|
|
+ // 查询
|
|
|
+ async search() {
|
|
|
+ const that = this;
|
|
|
+ let info = {
|
|
|
+ skip: that.skip,
|
|
|
+ limit: that.limit,
|
|
|
+ match_id: that.id
|
|
|
+ }
|
|
|
+ const res = await that.$api(`/matchReg`, 'GET', info)
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ let list = [...that.list, ...res.data];
|
|
|
+ that.$set(that, `list`, list)
|
|
|
+ that.$set(that, `total`, res.total)
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.errmsg,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 处理字典表
|
|
|
+ getDict(item, model) {
|
|
|
+ if (item) {
|
|
|
+ const that = this;
|
|
|
+ let res;
|
|
|
+ if (model == 'status') res = that.statusList.find(i => i.value == item.status)
|
|
|
+ if (model == 'ext_status') res = that.extList.find(i => i.value == item.ext_status)
|
|
|
+ if (model == 'final_confirm') res = that.isList.find(i => i.value == item.final_confirm)
|
|
|
+ if (res) return res.label
|
|
|
+ else return '暂无'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async toView(item) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pagesMy/preliminary/view?id=${item.id||item._id}`
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 审核
|
|
|
+ async toStatus(item, status) {
|
|
|
+ const that = this;
|
|
|
+ that.$set(that, `form`, item)
|
|
|
+ that.$set(that, `status`, status)
|
|
|
+ that.$refs.alertDialog.open()
|
|
|
+ },
|
|
|
+ async dialogConfirm() {
|
|
|
+ const that = this;
|
|
|
+ let arr = await that.$api(`/matchReg/${that.form.id}`, 'POST', {
|
|
|
+ status: that.status
|
|
|
+ })
|
|
|
+ if (arr.errcode == '0') {
|
|
|
+ uni.showModal({
|
|
|
+ content: "操作成功!",
|
|
|
+ showCancel: false
|
|
|
+ });
|
|
|
+ that.$set(that, `form`, {})
|
|
|
+ that.$set(that, `status`, '')
|
|
|
+ that.$refs.alertDialog.close()
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: arr.errmsg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 分页
|
|
|
+ toPage(e) {
|
|
|
+ const that = this;
|
|
|
+ let list = that.list;
|
|
|
+ let limit = that.limit;
|
|
|
+ if (that.total > list.length) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ let page = that.page + 1;
|
|
|
+ that.$set(that, `page`, page)
|
|
|
+ let skip = page * limit;
|
|
|
+ that.$set(that, `skip`, skip)
|
|
|
+ that.search();
|
|
|
+ uni.hideLoading();
|
|
|
+ } else that.$set(that, `is_bottom`, true)
|
|
|
+ },
|
|
|
+ toScroll(e) {
|
|
|
+ const that = this;
|
|
|
+ let up = that.scrollTop;
|
|
|
+ let num = Math.sign(up - e.detail.scrollTop);
|
|
|
+ if (num == 1) that.$set(that, `is_bottom`, false);
|
|
|
+ // 检查滚动位置是否达到div显示的条件
|
|
|
+ if (e.detail.scrollTop >= 300 && !that.showDiv) {
|
|
|
+ that.showDiv = true;
|
|
|
+ } else if (e.detail.scrollTop < 300 && that.showDiv) {
|
|
|
+ that.showDiv = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 清空列表
|
|
|
+ clearPage() {
|
|
|
+ const that = this;
|
|
|
+ that.$set(that, `list`, [])
|
|
|
+ that.$set(that, `skip`, 0)
|
|
|
+ that.$set(that, `limit`, 5)
|
|
|
+ that.$set(that, `page`, 0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .main {
|
|
|
+ .one {
|
|
|
+ position: relative;
|
|
|
+ flex-grow: 1;
|
|
|
+ background-color: var(--f1Color);
|
|
|
+
|
|
|
+ .list {
|
|
|
+ background-color: var(--mainColor);
|
|
|
+ border-bottom: 1px solid var(--f5Color);
|
|
|
+ margin: 2vw 2vw 0 2vw;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 3vw;
|
|
|
+
|
|
|
+
|
|
|
+ .value {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ min-width: 70px;
|
|
|
+ font-size: var(--font14Size);
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ .label {
|
|
|
+ font-size: var(--font12Size);
|
|
|
+ color: var(--f85Color);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .bottom {
|
|
|
+ margin: 2vw 0 0 0;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ .button {
|
|
|
+ color: var(--mainColor);
|
|
|
+ font-size: var(--font14Size);
|
|
|
+ border-radius: 2vw;
|
|
|
+ }
|
|
|
+
|
|
|
+ .button_1 {
|
|
|
+ background-color: var(--f3CColor);
|
|
|
+ }
|
|
|
+
|
|
|
+ .button_2 {
|
|
|
+ background-color: var(--fF0Color);
|
|
|
+ }
|
|
|
+
|
|
|
+ .button_3 {
|
|
|
+ margin: 0 2vw 0 0;
|
|
|
+ background-color: var(--f3CColor);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .scroll-view {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+
|
|
|
+ .list-scroll-view {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .is_bottom {
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ text {
|
|
|
+ padding: 2vw 0;
|
|
|
+ display: inline-block;
|
|
|
+ color: var(--f85Color);
|
|
|
+ font-size: var(--font14Size);
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|