|
@@ -1,31 +1,35 @@
|
|
<template>
|
|
<template>
|
|
- <view class="phone-kecheng-page">
|
|
|
|
|
|
+ <view class="admin-kaoshi-page">
|
|
|
|
+ <view class="icon-title-navBar-box">
|
|
|
|
+ <view @click="goUpPage" class="nav-bar-icon"></view>
|
|
|
|
+ <text class="nav-bar-title">课程管理</text>
|
|
|
|
+ </view>
|
|
<!-- 查询职业 -->
|
|
<!-- 查询职业 -->
|
|
- <view style="padding: 10px">
|
|
|
|
- <view class="phone-search-content">
|
|
|
|
- <input class="search-input" placeholder="请输入职业名称" v-model="data.zyName" />
|
|
|
|
- <view class="search-icon" @click="handleSearch">
|
|
|
|
- <uni-icons type="search" size="20"></uni-icons>
|
|
|
|
- </view>
|
|
|
|
|
|
+ <view class="phone-search-box">
|
|
|
|
+ <input class="search-input" placeholder="请输入职业名称" v-model="data.zyName" />
|
|
|
|
+ <view class="search-icon" @click="handleSearch">
|
|
|
|
+ <uni-icons type="search" size="24" color="#fff"></uni-icons>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <!-- 考试列表 -->
|
|
|
|
- <view class="cuoti-content-box">
|
|
|
|
- <scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
|
|
|
|
|
|
+ <!-- 课程列表 -->
|
|
|
|
+ <view class="kaoshi-content-box">
|
|
|
|
+ <scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
|
|
:refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"
|
|
:refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"
|
|
- class="cuoti-scroll-view">
|
|
|
|
- <uni-list>
|
|
|
|
- <uni-list-item v-for="item in data.list" class="list-item-box">
|
|
|
|
|
|
+ class="kaoshi-scroll-view">
|
|
|
|
+ <uni-list class="admin-list-box">
|
|
|
|
+ <uni-list-item v-for="item in data.list" class="admin-list-item-box">
|
|
<template v-slot:body>
|
|
<template v-slot:body>
|
|
- <!-- 数量 -->
|
|
|
|
- <view class="item-cuoti-row">
|
|
|
|
- <view>{{item.ksName}}</view>
|
|
|
|
- <view>时间:{{item.totalTm}} 分钟</view>
|
|
|
|
- <view>次数: {{item.maxTimes}}</view>
|
|
|
|
- <view>总分: {{item.ksScore}}</view>
|
|
|
|
- <view>及格分: {{item.okScore}}</view>
|
|
|
|
|
|
+ <view class="item-kaoshi-row">
|
|
|
|
+ <!-- 数量 -->
|
|
|
|
+ <view class="ks-item-top">
|
|
|
|
+ <view>{{item.name}}</view>
|
|
|
|
+ <view class="ks-zyLevelName">{{item.zyLevelName}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="ks-totalTm">
|
|
|
|
+ <icon class="phone-time-icon" />时间:{{formatDuration(item.period)}}分钟
|
|
|
|
+ </view>
|
|
|
|
+ <button @click="checkKecheng(item)" type="primary" size="mini" class="kaoshi-btn">查看内容</button>
|
|
</view>
|
|
</view>
|
|
- <view @click="checkKaoshi(item)" class="cuoti-btn">查看内容</view>
|
|
|
|
</template>
|
|
</template>
|
|
</uni-list-item>
|
|
</uni-list-item>
|
|
<uni-load-more :status="data.state" @click="getMore(0)"
|
|
<uni-load-more :status="data.state" @click="getMore(0)"
|
|
@@ -33,21 +37,27 @@
|
|
</uni-list>
|
|
</uni-list>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
|
|
+ <!-- 页面底端 -->
|
|
|
|
+ <customTabbarAdminVue></customTabbarAdminVue>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
|
+ import customTabbarAdminVue from "@/components/custom-tabbar/custom-tabbar-admin.vue";
|
|
import {
|
|
import {
|
|
- ref,reactive
|
|
|
|
|
|
+ ref,
|
|
|
|
+ reactive
|
|
} from "vue";
|
|
} from "vue";
|
|
import {
|
|
import {
|
|
onLoad
|
|
onLoad
|
|
} from "@dcloudio/uni-app";
|
|
} from "@dcloudio/uni-app";
|
|
import * as kechengApi from "@/api/kecheng.js"
|
|
import * as kechengApi from "@/api/kecheng.js"
|
|
|
|
+ import {formatDuration} from "@/utils/common.js"
|
|
|
|
|
|
const data = reactive({
|
|
const data = reactive({
|
|
zyName: '', // 职业名称
|
|
zyName: '', // 职业名称
|
|
- list: [], // 考试列表
|
|
|
|
|
|
+ list: [], // 考试列表
|
|
loading: false,
|
|
loading: false,
|
|
page: 0,
|
|
page: 0,
|
|
size: 10,
|
|
size: 10,
|
|
@@ -58,25 +68,31 @@
|
|
contentnomore: '没有更多'
|
|
contentnomore: '没有更多'
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ function goUpPage() {
|
|
|
|
+ uni.redirectTo({
|
|
|
|
+ url: '/pages/admin/ShouYe/shouye'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
function handleSearch() {
|
|
function handleSearch() {
|
|
data.page = 0;
|
|
data.page = 0;
|
|
refreshData();
|
|
refreshData();
|
|
}
|
|
}
|
|
|
|
|
|
- function checkKaoshi(item) {
|
|
|
|
|
|
+ function checkKecheng(item) {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: `/pages/admin/Kecheng/exam?ksId=${item.ksId}`
|
|
|
|
|
|
+ url: `/pages/admin/Kecheng/study?kcId=${item.kcId}`
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
function onRefresh() {
|
|
function onRefresh() {
|
|
data.page = 0;
|
|
data.page = 0;
|
|
data.list = [];
|
|
data.list = [];
|
|
data.loading = true;
|
|
data.loading = true;
|
|
refreshData();
|
|
refreshData();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
function refreshData() {
|
|
function refreshData() {
|
|
const opt = {
|
|
const opt = {
|
|
page: 1,
|
|
page: 1,
|
|
@@ -88,16 +104,16 @@
|
|
data.state = 'loading';
|
|
data.state = 'loading';
|
|
data.page++;
|
|
data.page++;
|
|
opt.page = data.page;
|
|
opt.page = data.page;
|
|
-
|
|
|
|
- kechengApi.getKechengGlList(opt).then(res =>{
|
|
|
|
|
|
+
|
|
|
|
+ kechengApi.getKechengGlList(opt).then(res => {
|
|
data.list = data.list.concat(res.data.data);
|
|
data.list = data.list.concat(res.data.data);
|
|
data.loading = false;
|
|
data.loading = false;
|
|
-
|
|
|
|
- if (res.data.total >= data.list.length) {
|
|
|
|
- data.state = 'no-more';
|
|
|
|
|
|
+
|
|
|
|
+ if (res.data.total > data.list.length) {
|
|
|
|
+ data.state = 'more';
|
|
data.loading = false;
|
|
data.loading = false;
|
|
} else {
|
|
} else {
|
|
- data.state = 'more';
|
|
|
|
|
|
+ data.state = 'no-more';
|
|
data.loading = false;
|
|
data.loading = false;
|
|
}
|
|
}
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
@@ -116,22 +132,20 @@
|
|
data.state = 'loading';
|
|
data.state = 'loading';
|
|
data.page++;
|
|
data.page++;
|
|
opt.page = data.page;
|
|
opt.page = data.page;
|
|
- kechengApi.getKechengGlList(opt).then(res =>{
|
|
|
|
|
|
+ kechengApi.getKechengGlList(opt).then(res => {
|
|
data.list = data.list.concat(res.data.data);
|
|
data.list = data.list.concat(res.data.data);
|
|
data.loading = false;
|
|
data.loading = false;
|
|
-
|
|
|
|
- if (res.data.total >= data.list.length) {
|
|
|
|
- // 数学
|
|
|
|
- data.state = 'no-more';
|
|
|
|
|
|
+
|
|
|
|
+ if (res.data.total > data.list.length) {
|
|
|
|
+ data.state = 'more';
|
|
data.loading = false;
|
|
data.loading = false;
|
|
} else {
|
|
} else {
|
|
- // 数学
|
|
|
|
- data.state = 'more';
|
|
|
|
|
|
+ data.state = 'no-more';
|
|
data.loading = false;
|
|
data.loading = false;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
onLoad(() => {
|
|
onLoad(() => {
|
|
getMore()
|
|
getMore()
|
|
})
|
|
})
|