123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- <template>
- <view class="course_layout">
- <view class="course_list">
- <view class="course_item" v-for="(item,index) in productList" :key="index">
- <view class="course_title">
- <view class="left">
- <image :src="item.image"></image>
- </view>
- <view class="right">
- <view class="title">
- {{item.course_name}}
- <!-- 拳击课程 -->
- </view>
- <view class="skill">
- {{item.desc}}
- <!-- 拳击课程修炼 -->
- </view>
- <view class="course_option">
- <view class="course_num">
- 课程数量:{{item.course_number}}
- </view>
- <!-- <view class="course_num">
- 总计10课堂
- </view> -->
- <view class="remain_class">
- 预约人数:{{item.reservation_number}}
- </view>
- </view>
- <view class="course_remain">
- <view class="remain_class">
- <!-- 预约人数:{{item.reservation_number}} -->
- </view>
- <view class="price">
- ¥{{item.price_total}}
- <!-- ¥100 -->
- </view>
- </view>
- </view>
- </view>
- <view class="btn_title">
- <view class="title">
- 上课地址:{{item.address}}
- </view>
- <view class="btn">
- <navigator :url="`/pagesA/course/reservation?orders_product_id=${item.orders_product_id}&course_id=${item.course_id}`">
- <view class="course_make_btn">
- 预约上课
- </view>
- </navigator>
- <navigator url="/pagesA/course/usercourse">
- <view class="user_course_btn">
- 我的预约
- </view>
- </navigator>
- </view>
- </view>
- </view>
- </view>
- <view class="to_bottom">---到底啦---</view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- //产品列表
- productList:[],
- // 请求参数
- requestParam:{
- name:"",
- page:1,
- },
- // 是否最后一页
- isLast:false,
- // 是否请求中
- isReqing:false,
- }
- },
- onShow() {
- // 没有数据的话,或者请求中,不允许刷新
- if( this.isReqing ) return ;
- // 请求参数
- this.requestParam.name = "";
- // 请求参数
- this.requestParam.page = 1;
- // 是否是最后一页
- this.isLast = false;
- // 设置请求中
- this.isReqing = true;
- this.$http.request('api/course/get_list',this.requestParam.page).then((re)=>{
- // 设置非请求中
- this.isReqing = false;
- // 成功结果
- if( re.code == 'success' ){
- if(re.data.last_page <= this.requestParam.page ) this.isLast = true;
- this.productList = re.data.data;
- }
- });
- },
- methods: {
-
- }
- }
- </script>
- <style lang="less">
- .course_layout{
- width: 690rpx;
- margin: 30rpx auto;
- .course_list{
- display: block;
- width: 690rpx;
- .course_item{
- width:690rpx;
- display: block;
- background-color: #fafafa;
- padding: 1rpx 0rpx;
- margin: 20rpx 0rpx;
- .course_title{
- display: flex;
- width: 660rpx;
- margin: 20rpx auto;
- .left{
- width: 200rpx;
- // height: 200rpx;
- // background-color: aqua;
- // border: 2rpx solid;
- border-radius: 20rpx;
- image{
- width: 200rpx;
- height: 200rpx;
- border-radius: 20rpx;
- border: 2rpx solid;
- }
- }
- .right{
- font-size: 24rpx;
- margin-left: 20rpx;
- .title{
- font-size: 36rpx;
- }
- .skill{
- padding: 5rpx;
- margin: 10rpx 10rpx 10rpx 0rpx;
- color: #c9c9c9;
- }
- .course_option{
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
- width: 420rpx;
- justify-content: ;
- .course_num{
- display: inline-flex;
- justify-content: center;
- width: 180rpx;
- border: 2rpx solid #3985ff;
- border-radius: 15rpx;
- margin: 5rpx;
- padding: 5rpx;
- color: #3985ff;
- }
- .remain_class{
- display: inline-flex;
- justify-content: center;
- width: 180rpx;
- margin: 5rpx;
- padding: 5rpx;
- background-color: #3985ff;
- border-radius: 15rpx;
- color: #ffffff;
- }
- }
- .course_remain{
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
- width: 420rpx;
- margin-top: 30rpx;
- // .remain_class{
- // display: inline-flex;
- // justify-content: center;
- // width: 180rpx;
- // margin: 5rpx;
- // padding: 5rpx;
- // background-color: #3985ff;
- // border-radius: 15rpx;
- // color: #ffffff;
- // }
- .price{
- width: 180rpx;
- margin: 5rpx;
- padding: 5rpx;
- text-align: right;
- font-size: 30rpx;
- }
- }
- }
- }
- .btn_title{
- .title{
- margin-left: 20rpx;
- }
- .btn{
-
- display: flex;
- width: 690rpx;
- margin: 20rpx 0rpx;
- justify-content: space-between;
- .course_make_btn{
- width: 300rpx;
- height: 60rpx;
- line-height: 60rpx;
- text-align: center;
- padding: 10rpx;
- background-color: #1fbe7e;
- color: #ffffff;
- border-radius: 20rpx;
- }
- .user_course_btn{
- width: 300rpx;
- height: 60rpx;
- line-height: 60rpx;
- text-align: center;
- padding: 10rpx;
- background-color: #1fbe7e;
- color: #ffffff;
- border-radius: 20rpx;
- }
- }
-
- }
- }
- }
- }
- </style>
|