Bladeren bron

模考推荐课程和下划线价格

xuqiaoying 3 jaren geleden
bovenliggende
commit
e137e5cd9d

+ 2 - 2
common/request.js

@@ -5,12 +5,12 @@ import api from './api.js'
 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 = 'https://test.xyyxt.net'   //预发布
 // 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 - 8
pages/course/index.vue

@@ -68,8 +68,8 @@
 								<text class="blackFont">{{item.classHours || '-'}}</text> 学时</view>
 								<view>
 									<text class="priceTag">¥ {{item.standPrice.toFixed(2)}}</text>
-									<text class="sale">¥ </text>
-									<text class="price_line"> {{ item.linePrice }}</text>
+									<text v-if="item.linePrice" class="sale">¥ </text>
+									<text v-if="item.linePrice" class="price_line"> {{ item.linePrice }}</text>
 								</view>
 								
 							</view>
@@ -90,8 +90,8 @@
 									
 									<view>
 										<text class="priceTag">¥ {{item.standPrice.toFixed(2)}}</text>
-										<text class="sale">¥ </text>
-										<text class="price_line"> {{ item.linePrice }}</text>
+										<text v-if="item.linePrice" class="sale">¥ </text>
+										<text v-if="item.linePrice" class="price_line"> {{ item.linePrice }}</text>
 									</view>
 								</view>
 							</view>
@@ -103,8 +103,8 @@
 								</view>
 								<view>
 									<text class="priceTag">¥ {{item.standPrice.toFixed(2)}}</text>
-									<text class="sale">¥ </text>
-									<text class="price_line"> {{ item.linePrice }}</text>
+									<text v-if="item.linePrice" class="sale">¥ </text>
+									<text v-if="item.linePrice" class="price_line"> {{ item.linePrice }}</text>
 								</view>
 							</view>
 						</view>
@@ -125,8 +125,8 @@
 									
 									<view>
 										<text class="priceTag">¥ {{item.standPrice.toFixed(2)}}</text>
-										<text class="sale">¥ </text>
-										<text class="price_line"> {{ item.linePrice }}</text>
+										<text v-if="item.linePrice" class="sale">¥ </text>
+										<text v-if="item.linePrice" class="price_line"> {{ item.linePrice }}</text>
 									</view>
 								</view>
 							</view>

+ 4 - 4
pages/index/index.vue

@@ -114,8 +114,8 @@
 										<view class="left">
 											<text class="mon_t">¥ {{toFixed(item.standPrice)}}</text>
 											<!-- <text class="sale">/限时优惠</text> -->
-											<text class="sale"> ¥ </text>
-											<text class="price_line">&nbsp;{{ item.linePrice }}</text>
+											<text v-if="item.linePrice" class="sale"> ¥ </text>
+											<text v-if="item.linePrice" class="price_line">&nbsp;{{ item.linePrice }}</text>
 										</view>
 										<view class="right">
 											<view class="regiser_row">立即购买</view>
@@ -150,8 +150,8 @@
 										<view class="left">
 											<text class="mon_t">¥ {{toFixed(item.standPrice)}}</text>
 											<!-- <text class="sale">/限时优惠</text> -->
-											<text class="sale"> ¥ </text>
-											<text class="price_line">&nbsp;{{ item.linePrice }}</text>
+											<text v-if="item.linePrice" class="sale"> ¥ </text>
+											<text v-if="item.linePrice" class="price_line">&nbsp;{{ item.linePrice }}</text>
 										</view>
 										<view class="right">
 											<view class="regiser_row">立即购买</view>

+ 2 - 2
pages2/bank/detail.vue

@@ -12,8 +12,8 @@
 					<view class="prices">
 						<!-- <text class="price_sym"></text> -->
 						<text class="price_word">¥ {{ goodsData.standPrice }}</text>
-						<text class="sale"> ¥ </text>
-						<text class="price_line"> {{ goodsData.linePrice }}</text>
+						<text v-if="item.linePrice" class="sale"> ¥ </text>
+						<text v-if="item.linePrice" class="price_line"> {{ goodsData.linePrice }}</text>
 					</view>
 					<view class="noteTag">
 						<!-- 共 <text class="blackFont">{{ goodsData.chapterNum }} 张卷 {{goodsData || '-'}}</text> 道题 -->

+ 2 - 2
pages3/course/detail.vue

@@ -32,8 +32,8 @@
 						<view class="prices">
 							<!-- <text class="price_sym">¥</text> -->
 							<text class="price_word">¥ {{ detail.standPrice }}</text>
-							<text class="sale"> ¥ </text>
-							<text class="price_line"> {{detail.linePrice }}</text>
+							<text v-if="item.linePrice" class="sale"> ¥ </text>
+							<text v-if="item.linePrice" class="price_line"> {{detail.linePrice }}</text>
 						</view>
 						<view class="noteTag">
 							<!-- <image src="/static/icon/wk_icon1.png" class="wk_icon"></image> -->

+ 7 - 3
pages5/mockExam/examApply.vue

@@ -141,6 +141,7 @@ export default {
             let tid = decodeURIComponent(option.scene)
             this.activityId = tid.split('=')[1]
             console.log('activityId: ', this.activityId)
+            this.getActivity()
         }
     },
     onShow() {
@@ -151,7 +152,7 @@ export default {
 		// 	})
 		// 	return
 		// }
-        this.getActivity()
+        
     },
     // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
 	onReady() {
@@ -162,7 +163,8 @@ export default {
         getActivity() {
             this.$http({
                 url: `/app/common/detail/${this.activityId}`,
-                method: 'get'
+                method: 'get',
+                noToken: true,
             }).then((res) => {
                 if (res.data.code == 200) {
                     if (res.data.data.majors) {
@@ -202,13 +204,15 @@ export default {
                         url: '/app/common/launch',
                         method: 'post',
                         data: params,
+                        noToken: true,
                     }).then((res) => {
                         console.log('提交', res)
                         this.subLoading = true
                         if (res.data.code == 200) {
                             let data = res.data.data
                             uni.navigateTo({
-                                url: '/pages5/mockExam/registrationSuccess?endTime='+data.endTime+'&startTime='+data.startTime
+                                url: '/pages5/mockExam/registrationSuccess?endTime=' + data.endTime + '&startTime=' + data.startTime 
+                                + '&activityId' + this.activityId
                             })
                         }
                     }).catch((err) => {

+ 209 - 3
pages5/mockExam/registrationSuccess.vue

@@ -85,6 +85,43 @@
             参加本次活动,请添加此次活动专属微信号
             <!-- <text class="entrys">考试入口:</text>请进入祥粤云学堂小程序或者网站, 在个人中心找到模考功能进行考试。 -->
         </view>
+
+        <view class="course-list">
+            <view class="titles">
+                <image class="code" src="../static/act_icon.png" ></image>
+                <text class="title">推荐课程</text>
+            </view>
+            <view class="list_item" v-for="(item,index) in courseList" :key="index" @click="toBuy(item)">
+                <view class="course_content">
+                    <view class="c_title">{{item.goodsName}}</view>
+                    <view class="c_downs">
+                        <view class="img">
+                            <image :src="$method.splitImgHost(item.coverUrl, true)"></image>
+                            <view class="time" v-if="item.year">{{item.year?item.year:''}}</view>
+                        </view>
+                        <view class="text">
+                            <view class="desc">
+                                <view class="left">
+                                    <text class="mon_t">¥ {{item.standPrice}}</text>
+                                    <!-- <text class="sale">/限时优惠</text> -->
+                                    <text v-if="item.linePrice" class="sale"> ¥ </text>
+                                    <text v-if="item.linePrice" class="price_line">&nbsp;{{ item.linePrice }}</text>
+                                </view>
+                                <view class="right">
+                                    <view class="regiser_row">立即购买</view>
+                                </view>
+                            </view>
+                            <view v-if="item.buyUserNum" class="joins">
+                                <!-- <image class="people" src="/static/index/people.png"></image> -->
+                                <!-- 为0时,不显示 -->
+                                <view class="people">{{ item.buyUserNum }}人参与</view>
+                            </view>
+                        </view>
+                    </view>
+                </view>					
+            </view>
+        </view>
+        
     </view>     
 </template>
 
@@ -100,6 +137,8 @@ export default {
             lastEndDay: '',
             sDay: '',
             eDay: '',
+            activityId: '',
+            courseList: [],
         }
     },
     filters: {
@@ -126,21 +165,54 @@ export default {
                 // this.eDay = this.lastEndDay/24/60/60
                 // console.log('lastStartDay', this.lastStartDay, this.lastEndDay, this.sDay, this.eDay)
             }
-        }
+        },
+        
     },
     onLoad(option) {
         console.log('option: ', option)
         this.startTime = option.startTime
         this.endTime = option.endTime
+        this.activityId = option.activityId
+        this.getAct()
         // this.startTime = "1663041599"
         // this.endTime = "1663127999"
     },
+    methods: {
+        getAct() {
+            this.$http({
+                url: `/app/common/activity/goodsList/${this.activityId}`,
+                method: 'get',
+                noToken: true,
+            }).then((res) => {
+                if (res.data.code == 200) {
+                    console.log('res', res)
+                    this.courseList = res.data.data || []
+                }
+            })
+        },
+        toBuy(item) {
+            if (item.goodsType == 1) {
+                uni.navigateTo({
+                    url: '/pages3/course/detail?id='+item.goodsId
+                })
+            } else if (item.goodsType == 2) {
+                uni.navigateTo({
+                    url: '/pages2/bank/detail?id='+item.goodsId
+                })
+            } else {
+                uni.navigateTo({
+                    url: '/pages5/liveDetail/index?id='+item.goodsId
+                })
+            }
+        },
+    }
 }
 </script>
 
 <style>
 page {
-    background-color: #DFECFD;
+    /* background-color: #DFECFD; */
+    background: linear-gradient(90deg, #EDF1FF 0%, #D9F0FF 100%);
 }
 </style>
 
@@ -402,7 +474,7 @@ page {
     font-size: 32rpx;
     font-weight: 500;
     color: #222222;
-    margin-bottom: 100rpx;
+    margin-bottom: 80rpx;
     // margin-top: 22rpx;
     // margin-bottom: 100rpx;
     // width: 686rpx;
@@ -418,4 +490,138 @@ page {
     //     color: #FFFFFF;
     // }
 }
+.course-list {
+    // width: 100%;
+    padding: 0rpx 32rpx;
+    box-shadow: 0px 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);			
+    .titles {
+        margin-left: 10rpx;
+        margin-bottom: 32rpx;
+        .code {
+            width: 38rpx;
+            height: 24rpx;
+        }
+        .title {
+            font-size: 40rpx;
+            font-family: OPPOSans-Bold, OPPOSans;
+            font-weight: bold;
+            color: #222222;
+            margin-left: 14rpx;
+        }
+    }
+    .list_item {
+        padding: 24rpx;
+        // height: 278rpx;
+        background: #FFFFFF;
+        box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(1,99,235,0.1000);
+        border-radius: 24rpx;
+        background:#fff;
+        margin-bottom: 32rpx;
+        display: flex;
+        align-items: center;
+        .c_title {
+            font-size: 32rpx;
+            font-weight: bold;
+            margin-bottom: 24rpx;
+            font-weight: bold;
+            color: #222222;
+        }
+        .c_downs {
+            display: flex;
+        }
+        .img {
+            position:relative;
+            margin-right: 24rpx;
+            border-radius: 16rpx ;
+            overflow: hidden;
+            width: 204rpx;
+            height: 120rpx;
+            image {
+                width:100%;
+                height:100%;
+            }
+            
+            .time {
+                position:absolute;
+                bottom:0;
+                right:0;
+                width: 80rpx;
+                height: 32rpx;
+                background: rgba(1, 25, 45, 0.4);
+                color:#fff;
+                text-align: center;
+                line-height: 32rpx;
+                font-size: 24rpx;
+                border-radius: 10rpx 0px 10rpx 0px;
+            }
+        }
+        
+        .text {
+            width: 440rpx;
+            position: relative;
+            display: flex;
+            flex-direction: column;
+            justify-content: space-between;
+            height: 120rpx;
+            .joins {
+                .people {
+                    width: 160rpx;
+                    font-size: 20rpx;
+                    color: #999999;
+                    padding: 0rpx 8rpx;
+                    text-align: center;
+                    height: 36rpx;
+                    line-height: 36rpx;
+                    background: #F6F7FB;
+                    border-radius: 4px;
+                }
+                
+            }
+            .desc {
+                margin-top: 10rpx;
+                display: flex;
+                align-items: center;
+                justify-content: space-between;
+                width: 100%;
+                .left {
+                    flex:1;
+                    color:#333;
+                    font-size: 26rpx;
+                    .mon_t {
+                        font-weight: bold;
+                        color: #FC3F3F;
+                        font-size: 36rpx;
+                    }
+                    .sale {
+                        color: #999999;
+                        font-size: 24rpx;
+                        margin-left: 8rpx;
+                    }
+                    .price_line {
+                        color: #999999;
+                        font-size: 24rpx;
+                        text-decoration:line-through;
+                        font-weight: 400;
+                    }
+                }
+                
+                .right {
+                    font-size: 24rpx;
+                    font-weight: bold;
+                    .regiser_row {
+                        width: 144rpx;
+                        height: 52rpx;
+                        line-height: 52rpx;
+                        text-align: center;
+                        border-radius: 16rpx;
+                        background-color: #FC3F3F;
+                        color: #fff;
+                        font-weight: 500;
+                        font-size: 26rpx;
+                    }
+                }
+            }
+        }
+    }
+}
 </style>

BIN
pages5/static/act_icon.png