xuqiaoying 3 anni fa
parent
commit
71625e5368

+ 2 - 2
common/request.js

@@ -6,11 +6,11 @@ var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
 // export const BASE_URL = 'https://test.xyyxt.net'   //预发布
-export const BASE_URL = 'http://120.79.166.78:19012' // 测试环境
+// export const BASE_URL = 'http://120.79.166.78:19012' // 测试环境
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test(后端本地)
 // export const BASE_URL = 'http://192.168.1.222:5055'    //后端本地更新到222
 // export const BASE_URL = 'http://192.168.1.24:5055'    //后端本地
-// export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
+export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
 
  //图片上传api
 export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release

+ 8 - 5
pages/course/index.vue

@@ -272,11 +272,14 @@ export default {
 			});
 		},
 		active2(item){
-			// pages4/courseTopic/goodsTopic
-			uni.navigateTo({
-				url: '/pages4/courseTopic/goodsTopic'
-			})
-			return
+			// console.log('item', item)
+			if (item.topicId) {
+				uni.navigateTo({
+					url: '/pages4/courseTopic/goodsTopic?topicId=' + item.topicId
+				})
+				return
+			}
+			
 			this.selObj.bId = item.id
 			this.show = false
 			this.selObj.pId = item.projectId

+ 308 - 13
pages4/courseTopic/goodsTopic.vue

@@ -3,7 +3,7 @@
         <nav-bar title="选课中心"></nav-bar>
         <view class="banner_header">
             <image class="ban_img" src="../static/topic/banner_bg.png"></image>
-            <view class="selects">
+            <view class="selects" @click="back()">
                 <view class="titles">
                     考前培训:二级建造师
                 </view>
@@ -20,20 +20,95 @@
                 <image class="code" src="@/static/learn/act_icon.png" ></image>
                 <text class="title">免费试听</text>
             </view>
-            <view class="pictures">
+            <view class="pictures" @click="toDetail()">
                 <view class="pic_imgs">
-                    <image class="basic_img" src="../static/topic/basic.png" ></image>
+                    <image v-if="goodsInfo.goodsCoverUrl" :src="$method.splitImgHost(goodsInfo.goodsCoverUrl, true)" class="basic_img"></image>
+                    <image v-else class="basic_img" src="../static/topic/basic.png" ></image>
                 </view>
-                <view class="pic_title">建筑全科 2022年二建精华班建筑知识全系列课程</view>
+                <view class="pic_title">{{ goodsInfo.goodsName }}</view>
             </view>
             <view class="titles">
                 <image class="code" src="@/static/learn/act_icon.png" ></image>
                 <text class="title">推荐课程</text>
             </view>
             <view class="courses">
-                <view v-for="(item, index) in  courseName" :key="index" class="cou_items" :class="{nactive: courseNum == index}">{{ item.name }}</view>
+                <view v-for="(item, index) in  courseName" :key="index" class="cou_items"
+                 :class="{nactive: courseNum == index}" @click="tochangeCourse(item, index)">{{ item.name }}</view>
+            </view>
+            <view class="lines"></view>
+            <view class="course_list">
+                <view class="clist_item">
+                    <image v-if="courseNum == 0" class="type_img" src="../static/topic/type1_one.png" ></image>
+                    <image v-if="courseNum == 1" class="type_img" src="../static/topic/type2_two.png" ></image>
+                    <image v-if="courseNum == 2" class="type_img" src="../static/topic/type3_three.png" ></image>
+                    <view class="type_right">
+                        <view class="type_title">全科</view>
+                        <view class="type_down">
+                            <view class="prices">¥980</view>
+                            <view class="tobuy" @click="togoBuy(1)">立即购买</view>
+                        </view>
+                    </view>
+                </view>
+                <view class="clist_item">
+                    <image v-if="courseNum == 0" class="type_img" src="../static/topic/type1_one.png" ></image>
+                    <image v-if="courseNum == 1" class="type_img" src="../static/topic/type2_two.png" ></image>
+                    <image v-if="courseNum == 2" class="type_img" src="../static/topic/type3_three.png" ></image>
+                    <view class="type_right">
+                        <view class="type_title">公共单科</view>
+                        <view class="type_down">
+                            <view class="prices">¥350</view>
+                            <view class="tobuy" @click="togoBuy(2)">立即购买</view>
+                        </view>
+                    </view>
+                </view>
+                <view class="clist_item">
+                    <image v-if="courseNum == 0" class="type_img" src="../static/topic/type1_one.png" ></image>
+                    <image v-if="courseNum == 1" class="type_img" src="../static/topic/type2_two.png" ></image>
+                    <image v-if="courseNum == 2" class="type_img" src="../static/topic/type3_three.png" ></image>
+                    <view class="type_right">
+                        <view class="type_title">实务单科</view>
+                        <view class="type_down">
+                            <view class="prices">¥500</view>
+                            <view class="tobuy" @click="togoBuy(3)">立即购买</view>
+                        </view>
+                    </view>
+                </view>
+            </view>
+
+            <view class="titles">
+                <image class="code" src="@/static/learn/act_icon.png" ></image>
+                <text class="title">详情</text>
+            </view>
+            <view class="details">
+                <image v-if="courseNum == 0" class="detail_img" src="../static/topic/type1_detail.png" ></image>
+                <image v-if="courseNum == 1" class="detail_img" src="../static/topic/type2_detail.png" ></image>
+                <image v-if="courseNum == 2" class="detail_img" src="../static/topic/type3_detail.png" ></image>
             </view>
         </view>
+
+        <!-- 弹窗 -->
+        <u-popup v-model="toggleCourseShow" mode="bottom" border-radius="40">
+			<view class="popup_box">
+                <view class="check_head">
+                    <view class="headers">
+                    <view class="grade">选择课程</view>
+                        <u-icon name="close" color="#9C9C9C" size="40" @click="closePop()"></u-icon>
+                    </view>
+                </view>
+                <view class="pop_prices">
+                    <text class="price">¥ {{ skuItem.standPrice || 0 }}</text>
+                    <text v-if="skuItem.linePrice" class="lin_price">{{ skuItem.linePrice }}</text>
+                </view>
+                <view class="check_con">
+                    <scroll-view scroll-y="true" style="height: 550rpx;">
+                        <view class="course_items" v-for="(item, index) in courseSku" :key="index" :class="{nactive: skuIndex == index}" @click="selectSku(item, index)">
+                            {{ item.goodsName }}
+                        </view>
+                    </scroll-view>
+                </view>
+                <view class="right_now" @click="rightNowBuy()">立即购买</view>
+			</view>
+		</u-popup>
     </view>
 </template>
 
@@ -57,18 +132,92 @@ export default {
                 }
             ],
             courseNum: 0,
+            topicId: '',
+            goodsInfo: {},
+            toggleCourseShow: true,
+            courseSku: [1],
+            skuItem: {},
+            skuIndex: -1,
         }
     },
+    onLoad(option) {
+        this.topicId = option.topicId
+        this.getgoodsInfo()
+    },
+    methods: {
+        getgoodsInfo() {
+            this.$http({
+                url: `/course/topicPage/get/goodsInfo/${this.topicId}`,
+                method: 'get',
+            }).then((res) => {
+                if (res.data.code == 200) {
+                    this.goodsInfo = res.data.data
+                }
+            })
+        },
+        tochangeCourse(item, index) {
+            console.log(item, index)
+            this.courseNum = index
+        },
+        back() {
+            uni.navigateBack()
+        },
+        toDetail() {
+            if (this.goodsInfo.goodsType == 1) {
+                uni.navigateTo({
+                    url: '/pages3/course/detail?id='+this.goodsInfo.goodsId
+                })
+            } else if (this.goodsInfo.goodsType == 2) {
+                uni.navigateTo({
+                    url: '/pages2/bank/detail?id='+this.goodsInfo.goodsId
+                })
+            } else {
+                uni.navigateTo({
+                    url: '/pages5/liveDetail/index?id='+this.goodsInfo.goodsId
+                })
+            }
+        },
+        closePop() {
+            this.toggleCourseShow = false
+        },
+        togoBuy(subjectType) {
+            this.skuItem = {}
+            this.skuIndex = -1
+            this.$http({
+                url: '/course/topicPage/get/goodsList',
+                method: 'get',
+                data: {
+                    subjectType: subjectType,
+                    topicId: this.topicId,
+                    type: this.courseNum + 1
+                }
+            }).then((res) => {
+                if (res.data.code == 200) {
+                    this.toggleCourseShow = true
+                    this.courseSku = res.data.data || []
+                } else {
+                    this.$u.toast(res.data.msg)
+                }
+            })
+        },
+        selectSku(item, index) {
+            this.skuItem = item
+            this.skuIndex = index
+        },
+        rightNowBuy() {
+            if (Object.keys(this.skuItem).length == 0) {
+                this.$u.toast('请选择科目')
+                return
+            }
+            if(this.$method.isGoLogin()){
+				return
+			}
+			this.$navTo.togo('/pages2/order/confirm_list?id='+this.skuItem.goodsId)
+        }
+    }
 }
 </script>
 
-<style>
-page {
-    width: 100%;
-    
-    /* background: linear-gradient(180deg, rgba(223,236,253,0) 0%, #DFECFD 100%); */
-}
-</style>
 
 <style lang="scss" scoped>
 @mixin dis_center {
@@ -115,7 +264,7 @@ page {
                 height: 36rpx;
                 background: #FFFFFF;
                 border-radius: 50%;
-                @include dis_center()
+                @include dis_center();
             }
         }
         .imgs {
@@ -176,10 +325,14 @@ page {
             margin-top: 44rpx;
             display: flex;
             align-items: center;
+            height: 78rpx;
             .cou_items {
                 font-size: 28rpx;
                 color: #969696;
                 margin-right: 48rpx;
+                position: relative;
+                top: 0rpx;
+                left: 0rpx;
                 &:nth-child(1) {
                     margin-left: 16rpx;
                 }
@@ -187,9 +340,151 @@ page {
                     font-size: 32rpx;
                     font-weight: bold;
                     color: #498AFE;
+                    &::after {
+                        content: '';
+                        position: absolute;
+                        bottom: -18rpx;
+                        left: 60rpx;
+                        width: 32rpx;
+                        height: 8rpx;
+                        background: #498AFE;
+                        border-radius: 180rpx;
+                    }
                 }
+                
+            }
+        }
+        .lines {
+            width: 100%;
+            height: 2rpx;
+            background: #FFFFFF;
+        }
+        .course_list {
+            width: 100%;
+            padding: 40rpx 32rpx;
+            background: #fff;
+            border-radius: 14rpx;
+            margin-top: 40rpx;
+            .clist_item {
+                height: 120rpx;
+                margin-bottom: 48rpx;
+                display: flex;
+                &:last-child {
+                    margin-bottom: 0rpx;
+                }
+                .type_img {
+                    width: 212rpx;
+                    height: 120rpx;
+                    margin-right: 24rpx;
+                }
+                .type_title {
+                    font-size: 32rpx;
+                    font-weight: 500;
+                    color: #222222;
+                }
+                .type_down {
+                    width: 370rpx;
+                    margin-top: 24rpx;
+                    @include dis_center();
+                    justify-content: space-between;
+                }
+                .prices {
+                    font-size: 36rpx;
+                    font-weight: 500;
+                    color: #F67205;
+                }
+                .tobuy {
+                    width: 144rpx;
+                    height: 52rpx;
+                    line-height: 52rpx;
+                    text-align: center;
+                    background: #FFB102;
+                    border-radius: 16rpx;
+                    font-size: 26rpx;
+                    font-weight: 500;
+                    color: #FFFFFF;
+                }
+            }
+        }
+
+        .details {
+            width: 100%;
+            height: 5035rpx;
+            margin-top: 32rpx;
+            .detail_img {
+                width: 100%;
+                height: 100%;
+                display: block;
             }
         }
     }
+
+    // 弹窗
+.popup_box {
+    width: 100%;
+    height: 938rpx;
+    padding: 56rpx 56rpx 0rpx;
+    .pop_prices {
+        margin-top: 50rpx;
+        margin-bottom: 40rpx;
+        .types {
+            font-size: 32rpx;
+            font-weight: bold;
+            color: #222222;
+            margin-right: 24rpx;
+        }
+        .price {
+            font-size: 36rpx;
+            font-weight: 500;
+            color: #F67205;
+        }
+        .lin_price {
+            color: #999999;
+            font-size: 30rpx;
+            text-decoration:line-through;
+        }
+    }
+    .headers {
+      width: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      .grade {
+        font-size: 40rpx;
+        font-weight: bold;
+        color: #222222;
+      }
+    }
+    .course_items {
+        width: 100%;
+        height: 96rpx;
+        background: #F8F8F8;
+        border-radius: 24rpx;
+        padding: 30rpx 32rpx;
+        font-size: 28rpx;
+        color: #222222;
+        margin-bottom: 32rpx;
+        &.nactive {
+            background: #D5E4FF;
+            color: #3F8DFD;
+        }
+        &:last-child {
+            margin-bottom: 0rpx;
+        }
+    }
+    
+    .right_now {
+        width: 100%;
+        height: 92rpx;
+        line-height: 92rpx;
+        text-align: center;
+        background: #3F8DFD;
+        border-radius: 120rpx;
+        font-size: 32rpx;
+        font-weight: 500;
+        color: #FFFFFF;
+    }
+    
+  }
 }
 </style>

BIN
pages4/static/topic/type1_detail.png


BIN
pages4/static/topic/type1_one.png


BIN
pages4/static/topic/type1_three.png


BIN
pages4/static/topic/type1_two.png


BIN
pages4/static/topic/type2_detail.png


BIN
pages4/static/topic/type2_one.png


BIN
pages4/static/topic/type2_three.png


BIN
pages4/static/topic/type2_two.png


+ 0 - 0
pages4/static/topic/detail.png → pages4/static/topic/type3_detail.png


BIN
pages4/static/topic/type3_one.png


BIN
pages4/static/topic/type3_three.png


BIN
pages4/static/topic/type3_two.png


+ 1 - 1
pages5/examList/index.vue

@@ -278,7 +278,7 @@ export default {
 			}
 			
 			uni.navigateTo({
-				url:'../examBank/index?examId='+item.examId+'&eachExamId='+item.eachExamId
+				url:'../examBank/index?examId='+item.examId+'&eachExamId='+item.eachExamId+'&subscribeId='+item.subscribeId
 			})
 		},
 		goTest(item) {

+ 1 - 1
pages5/examReport/index.vue

@@ -67,7 +67,7 @@
 					:url="
 						'/pages5/examBank/index?examId=' +
 							reportdata.examId +
-							'&eachExamId='+eachExamId
+							'&eachExamId='+eachExamId+'&subscribeId='+reportdata.subscribeId
 					"
 				>
 					<button  hover-class="none" :disabled="subscribeInfo.canDo === 0"  class="btnACs">去做题</button>