|
...
|
...
|
@@ -3,7 +3,6 @@ |
|
|
|
<uv-navbar leftIcon="" placeholder bgColor="rgba(255, 255, 255, 0)">
|
|
|
|
<template v-slot:left>
|
|
|
|
<view class="uv-nav-slot">
|
|
|
|
XXXX
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
</uv-navbar>
|
|
...
|
...
|
@@ -15,7 +14,8 @@ |
|
|
|
style="margin-left: 6rpx;"></uv-icon>
|
|
|
|
</view>
|
|
|
|
<view @click="showAccountsPop" class="select-item">
|
|
|
|
{{ state.accounts }}<uv-icon name="arrow-down-fill" color="#7175f0" size="20" style="margin-left: 6rpx;"></uv-icon>
|
|
|
|
{{ state.accounts }}<uv-icon name="arrow-down-fill" color="#7175f0" size="20"
|
|
|
|
style="margin-left: 6rpx;"></uv-icon>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
...
|
...
|
@@ -23,12 +23,14 @@ |
|
|
|
<view v-for="item in state.courses" class="course-box">
|
|
|
|
<image :src="item.img" style="width: 160rpx;height: 160rpx;border-radius: 20rpx;"></image>
|
|
|
|
<view style="flex: 1;display: flex;">
|
|
|
|
<view style="flex: 1;padding: 0 20rpx;display: flex;flex-direction: column;justify-content: space-between;">
|
|
|
|
<view
|
|
|
|
style="flex: 1;padding: 0 20rpx;display: flex;flex-direction: column;justify-content: space-between;">
|
|
|
|
<view style="font-size: 30rpx;">{{ item.name }} - {{ item.subject }}</view>
|
|
|
|
<view style="color: #ff3838;font-weight: 600;">¥{{ item.price }}</view>
|
|
|
|
</view>
|
|
|
|
<view style="width: 160rpx;display: flex;align-items: center;justify-content: flex-end;">
|
|
|
|
<view @click="gotoSignUp(item.id)" style="width: 100%;;background-color: #f57c28;color: #fff;text-align: center;padding: 10rpx 0;border-radius: 9999rpx;">
|
|
|
|
<view @click="gotoSignUp(item.id)"
|
|
|
|
style="width: 100%;;background-color: #f57c28;color: #fff;text-align: center;padding: 10rpx 0;border-radius: 9999rpx;">
|
|
|
|
去报名
|
|
|
|
</view>
|
|
|
|
</view>
|
|
...
|
...
|
@@ -41,7 +43,8 @@ |
|
|
|
<uv-popup ref="gradesRef" safeAreaInsetBottom closeable :round="20">
|
|
|
|
<view class="pop-box">
|
|
|
|
<view class="content-pop">
|
|
|
|
<view @click="selectGrade('全部年级')" class="pop-inner-item" style="margin: 20rpx 0;" :style="state.grade === '全部年级' ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''">
|
|
|
|
<view @click="selectGrade('全部年级')" class="pop-inner-item" style="margin: 20rpx 0;"
|
|
|
|
:style="state.grade === '全部年级' ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''">
|
|
|
|
全部年级
|
|
|
|
</view>
|
|
|
|
<view v-for="item in state.gradOptions" style="margin-bottom: 30rpx;">
|
|
...
|
...
|
@@ -63,11 +66,13 @@ |
|
|
|
<uv-popup ref="accountsRef" safeAreaInsetBottom closeable :round="20">
|
|
|
|
<view class="pop-box">
|
|
|
|
<view class="content-pop">
|
|
|
|
<view @click="selectaccounts('全部科目')" class="pop-inner-item" style="margin: 20rpx 0;" :style="state.accounts === '全部科目' ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''">
|
|
|
|
<view @click="selectaccounts('全部科目')" class="pop-inner-item" style="margin: 20rpx 0;"
|
|
|
|
:style="state.accounts === '全部科目' ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''">
|
|
|
|
全部科目
|
|
|
|
</view>
|
|
|
|
<view class="pop-inner">
|
|
|
|
<view v-for="item1 in state.accountsOptions" @click="selectaccounts(item1)" class="pop-inner-item"
|
|
|
|
<view v-for="item1 in state.accountsOptions" @click="selectaccounts(item1)"
|
|
|
|
class="pop-inner-item"
|
|
|
|
:style="state.accounts === item1 ? 'border-color:#7175f0;color:#7175f0;background-color:#f6f7ff;' : ''">
|
|
|
|
{{ item1 }}
|
|
|
|
</view>
|
|
...
|
...
|
@@ -81,10 +86,14 @@ |
|
|
|
<script setup>
|
|
|
|
import {
|
|
|
|
reactive,
|
|
|
|
ref,
|
|
|
|
onMounted
|
|
|
|
ref
|
|
|
|
} from 'vue';
|
|
|
|
import { courseListApi } from "@/api/index.js"
|
|
|
|
import {
|
|
|
|
onShow
|
|
|
|
} from '@dcloudio/uni-app'
|
|
|
|
import {
|
|
|
|
courseListApi
|
|
|
|
} from "@/api/index.js"
|
|
|
|
|
|
|
|
const gradesRef = ref(null)
|
|
|
|
const accountsRef = ref(null)
|
|
...
|
...
|
@@ -110,7 +119,7 @@ |
|
|
|
accountsOptions: ["语文", "数学", "英语", "物理", "化学"]
|
|
|
|
})
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
onShow(() => {
|
|
|
|
getCourseList()
|
|
|
|
})
|
|
|
|
|
|
...
|
...
|
@@ -122,8 +131,12 @@ |
|
|
|
|
|
|
|
const getCourseList = async () => {
|
|
|
|
try {
|
|
|
|
uni.showLoading({ title: "加载中" })
|
|
|
|
const { data } = await courseListApi({
|
|
|
|
uni.showLoading({
|
|
|
|
title: "加载中"
|
|
|
|
})
|
|
|
|
const {
|
|
|
|
data
|
|
|
|
} = await courseListApi({
|
|
|
|
grade: state.grade === "全部年级" ? "" : state.grade,
|
|
|
|
subject: state.accounts === "全部科目" ? "" : state.accounts
|
|
|
|
})
|
|
...
|
...
|
@@ -173,6 +186,7 @@ |
|
|
|
.course-list {
|
|
|
|
margin-top: 20rpx;
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
.course-box {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
...
|
...
|
|