|
@@ -2,18 +2,28 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="app_content">
|
|
<view class="app_content">
|
|
|
<scroll-view class="course_list" scroll-y>
|
|
<scroll-view class="course_list" scroll-y>
|
|
|
- <view class="list_item" v-for="(item, index) in 8" :key="index">
|
|
|
|
|
- <image src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fi1.sinaimg.cn%2FIT%2F2010%2F0419%2F201041993511.jpg&refer=http%3A%2F%2Fi1.sinaimg.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1621152651&t=08594a9b7bc95600bd5134c8be7f1150"></image>
|
|
|
|
|
- <view class="class_name">婚礼宴会设计班</view>
|
|
|
|
|
- <view class="class_introduce">针对花店花艺师,有一定花艺基础的花艺从业者</view>
|
|
|
|
|
|
|
+ <block v-if="!$util.isEmpty(pageList)">
|
|
|
|
|
+ <view class="list_item" v-for="(item, index) in pageList" :key="index" >
|
|
|
|
|
+ <image :src="item.cover"></image>
|
|
|
|
|
+ <view class="class_name">{{item.name}}</view>
|
|
|
|
|
+ <view class="class_introduce">{{item.target}}</view>
|
|
|
<view class="class_price">
|
|
<view class="class_price">
|
|
|
- <text>¥6800.00</text>
|
|
|
|
|
|
|
+ <text>¥{{item.tuition}}</text>
|
|
|
<view class="class_apply">
|
|
<view class="class_apply">
|
|
|
- <text>600人报名</text>
|
|
|
|
|
- <view class="apply_btn" @click="signUp">报名</view>
|
|
|
|
|
|
|
+ <text>{{item.num}}人报名</text>
|
|
|
|
|
+ <view class="apply_btn" @click="signUp(item)">报名</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ </block>
|
|
|
|
|
+ <block v-else>
|
|
|
|
|
+ <view class="nodata">
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <image src="http://img.huaml.com/common/nodata.png"></image>
|
|
|
|
|
+ <view>暂无课程~</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </block>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
<tab-bar
|
|
<tab-bar
|
|
|
:current="2"
|
|
:current="2"
|
|
@@ -23,20 +33,35 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import AppWrapperEmpty from '@/components/app-wrapper-empty'
|
|
|
|
|
+import { pxClassList } from '@/api/px-class/index'
|
|
|
export default {
|
|
export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ AppWrapperEmpty
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- currentTabIndex: 2
|
|
|
|
|
|
|
+ currentTabIndex: 2,
|
|
|
|
|
+ pageList: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ mounted(){
|
|
|
|
|
+ this.pxClassList()
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
tabClick (index) {
|
|
tabClick (index) {
|
|
|
this.currentTabIndex = index
|
|
this.currentTabIndex = index
|
|
|
},
|
|
},
|
|
|
- signUp() {
|
|
|
|
|
|
|
+ signUp(id) {
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url: '/pages/class/index'
|
|
|
|
|
|
|
+ url: '/pages/class/index?id=' + id + '&name=' + item.name + '&price=' + item.tuition + '&target=' + item.target
|
|
|
})
|
|
})
|
|
|
|
|
+ },
|
|
|
|
|
+ pxClassList() {
|
|
|
|
|
+ pxClassList().then(res => {
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ this.pageList = res.data.list
|
|
|
|
|
+ }).catch(err => {console.log(err)})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -114,4 +139,27 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+.nodata{
|
|
|
|
|
+ width: 100vw;
|
|
|
|
|
+ height: 100vh;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ &>view{
|
|
|
|
|
+ width: 318upx;
|
|
|
|
|
+ height: 326upx;
|
|
|
|
|
+ // background-color: pink;
|
|
|
|
|
+ &>image{
|
|
|
|
|
+ width: 318upx;
|
|
|
|
|
+ height: 256upx;
|
|
|
|
|
+ // background-color: green;
|
|
|
|
|
+ }
|
|
|
|
|
+ &>view{
|
|
|
|
|
+ font-size: 26px;
|
|
|
|
|
+ color: #999999;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ margin-top: 40upx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|