Browse Source

2021年6月19日18:51:54上传

yh
杨豪 3 years ago
parent
commit
99d7899bdc
  1. 20
      api/knowledge.js
  2. 38
      components/uni-countdown/uni-countdown.vue
  3. 18
      pages.json
  4. 2
      pages/authorization/index.vue
  5. 460
      pages/course/detail.vue
  6. 22
      pages/course/index.vue
  7. 89
      pages/home/index.vue
  8. 2
      pages/shop/GoodsCon/index.vue
  9. 4
      pages/user/User/index.vue
  10. BIN
      static/article1.png
  11. BIN
      static/home-banner.png
  12. 2
      utils/request.js

20
api/knowledge.js

@ -4,7 +4,7 @@ import request from "@/utils/request";
* 课程文章分类 * 课程文章分类
*/ */
export function getCategory(data) { export function getCategory(data) {
return request.get("/api/CourseCategory", data); return request.get("/CourseCategory", data);
} }
/** /**
@ -25,11 +25,25 @@ export function getArticleDetails(data) {
* 获取学习榜单列表 * 获取学习榜单列表
*/ */
export function getStudyList(data) { export function getStudyList(data) {
return request.post("/api/StudyList/listStudyList",data); return request.post("/StudyList/listStudyList",data);
} }
/** /**
* 获取课程列表 * 获取课程列表
*/ */
export function getCourses(data) { export function getCourses(data) {
return request.post("/api/cyCourse/listCourses",data); return request.post("/Course/listCourses",data);
}
/**
* 获取课程详情
*/
export function getCourseDetail(data) {
return request.post("/Course/courseDetail",data);
}
/**
* 报名
*/
export function enterCourse(data) {
return request.post("/user/enterCourse",data);
} }

38
components/uni-countdown/uni-countdown.vue

@ -1,13 +1,13 @@
<template> <template>
<view class="uni-countdown"> <view class="uni-countdown">
<text v-if="showDay" :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ d }}</text> <text v-if="showDay" :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ d }}</text>
<text v-if="showDay" :style="{ color: splitorColor }" class="uni-countdown__splitor"></text> <text v-if="showDay" :style="{ color: color }" class="uni-countdown__splitor"></text>
<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ h }}</text> <text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ h }}</text>
<text :style="{ color: splitorColor }" class="uni-countdown__splitor">{{ showColon ? ':' : '时' }}</text> <text :style="{ color: color }" class="uni-countdown__splitor">{{ showColon ? ':' : '时' }}</text>
<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ i }}</text> <text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ i }}</text>
<text :style="{ color: splitorColor }" class="uni-countdown__splitor">{{ showColon ? ':' : '分' }}</text> <text :style="{ color: color }" class="uni-countdown__splitor">{{ showColon ? ':' : '分' }}</text>
<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ s }}</text> <text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ s }}</text>
<text v-if="!showColon" :style="{ color: splitorColor }" class="uni-countdown__splitor"></text> <text v-if="!showColon" :style="{ color: color }" class="uni-countdown__splitor"></text>
</view> </view>
</template> </template>
<script> <script>
@ -191,35 +191,7 @@
</script> </script>
<style scoped> <style scoped>
.uni-countdown { .uni-countdown {
/* #ifndef APP-NVUE */ display: inline-block;
display: flex;
/* #endif */
flex-direction: row;
justify-content: flex-start;
padding: 2rpx 0;
} }
.uni-countdown__splitor {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
line-height: 48rpx;
padding: 5rpx;
font-size: 12px;
}
.uni-countdown__number {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
width: 52rpx;
height: 48rpx;
line-height: 48rpx;
margin: 5rpx;
text-align: center;
font-size: 12px;
}
</style> </style>

18
pages.json

@ -568,24 +568,6 @@
"selectedIconPath": "static/tab5.png", "selectedIconPath": "static/tab5.png",
"text": "我的" "text": "我的"
} }
// {
// "pagePath": "pages/shop/GoodsClass/index",
// "iconPath": "static/icon-class.png",
// "selectedIconPath": "static/icon-class-hot.png",
// "text": "分类"
// },
// {
// "pagePath": "pages/shop/ShoppingCart/index",
// "iconPath": "static/icon-cart.png",
// "selectedIconPath": "static/icon-cart-hot.png",
// "text": "购物车"
// },
// {
// "pagePath": "pages/user/User/index",
// "iconPath": "static/icon-user.png",
// "selectedIconPath": "static/icon-user-hot.png",
// "text": "我的"
// }
] ]
} }
} }

2
pages/authorization/index.vue

@ -64,7 +64,7 @@ export default {
...mapMutations(['updateAuthorizationPage']), ...mapMutations(['updateAuthorizationPage']),
toLogin() { toLogin() {
this.$yrouter.push({ this.$yrouter.push({
path: '/pages/user/Login/index', path: '/pagesB/pages/user/Login/index',
query: {}, query: {},
}) })
}, },

460
pages/course/detail.vue

@ -1,201 +1,293 @@
<template> <template>
<view class="course-detail-index"> <view class="course-detail-index">
<view class="swiper-box"> <view v-if="$store.getters.token || userInfo.uid" class="content">
<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000"> <view class="swiper-box">
<swiper-item> <swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000">
<view class="swiper-item"></view> <swiper-item v-for="(item,index) in detail.imageArr" :key="index">
</swiper-item> <view class="swiper-item"><image :src="item" mode=""></image></view>
<swiper-item> </swiper-item>
<view class="swiper-item"></view> </swiper>
</swiper-item>
</swiper>
</view>
<view class="course-info-box">
<view class="course-title">一代天骄王者少年禪易课程教学</view>
<view class="tips-box">
<view class="tip-item blue">国学</view>
<view class="tip-item orange">国学院</view>
</view> </view>
</view> <view class="course-info-box">
<view class="tab-box acea-row row-around" :class="isFixedTop?'fixed':''"> <view class="course-title">{{detail.courseName}}</view>
<view class="tab-item" :class="active == '0' ? 'tab-item-active' : ''" @click="handelScroll('content1','0')">简介</view> <view class="tips-box">
<view class="tab-item" :class="active == '1' ? 'tab-item-active' : ''" @click="handelScroll('content2','1')">课程安排</view> <view class="tip-item blue">{{detail.categoryName}}</view>
<view class="tab-item" :class="active == '2' ? 'tab-item-active' : ''" @click="handelScroll('content3','2')">相关推荐</view> <!-- <view class="tip-item orange">国学院</view> -->
</view> </view>
</view>
<view class="content-box" bindscroll="scroll"> <view class="tab-box acea-row row-around" :class="isFixedTop?'fixed':''">
<scroll-view scroll-y="true" scroll-with-animation="true" style="height:100%;" :scroll-into-view="toView" > <view class="tab-item" :class="active == '0' ? 'tab-item-active' : ''" @click="handelScroll('content1','0')">简介</view>
<view class="teacher-info-box content" id="content1"> <view class="tab-item" :class="active == '1' ? 'tab-item-active' : ''" @click="handelScroll('content2','1')">课程安排</view>
<view class="title-box acea-row row-middle"> <view class="tab-item" :class="active == '2' ? 'tab-item-active' : ''" @click="handelScroll('content3','2')">相关推荐</view>
<view class="left-line"></view> </view>
<span>主讲人介绍</span>
</view> <view class="content-box" bindscroll="scroll">
<view class="info-box"> <scroll-view scroll-y="true" scroll-with-animation="true" style="height:100%;" :scroll-into-view="toView" >
<image src="../../static/img1.png"></image> <view class="teacher-info-box content" id="content1">
<view class="name">刘老师</view> <view class="title-box acea-row row-middle">
<view class="tip">禪易能量高级讲师</view> <view class="left-line"></view>
<view class="desc">抱朴书院孕育自华夏优秀传统文化博学致用抱朴含虚为院训弘扬国粹利益社会为动力</view> <span>主讲人介绍</span>
</view> </view>
</view> <scroll-view class="scroll-view_H" scroll-x="true">
<view class="course-desc-box"> <view class="info-box" v-for="(item,index) in detail.masterDtos" :key="index">
<view class="title-box acea-row row-middle"> <image :src="item.photoPath"></image>
<view class="left-line"></view> <view class="name">{{item.name}}</view>
<span>课程简介</span> <view class="tip">禪易能量高级讲师</view>
<view class="desc">{{item.introduction}}</view>
</view>
</scroll-view>
</view> </view>
<text class="desc"> <view class="course-desc-box">
抱朴书院孕育自华夏优秀传统文化博学致用抱朴含虚为院训弘扬国粹利益社会为动力\n <view class="title-box acea-row row-middle">
抱朴书院孕育自华夏优秀传统文化博学致用抱朴含虚为院训弘扬国粹利益社会为动力 <view class="left-line"></view>
</text> <span>课程简介</span>
</view> </view>
<view class="course-desc-box content" id="content2"> <text class="desc">{{item.courseIntroduce}}</text>
<view class="title-box acea-row row-middle">
<view class="left-line"></view>
<span>课程表</span>
</view> </view>
<view class="course-card-list"> <view class="course-desc-box content" id="content2">
<view class="course-card-item acea-row row-middle"> <view class="title-box acea-row row-middle">
<image src="../../static/course-icon1.png"></image> <view class="left-line"></view>
<view class="label">课程时间</view> <span>课程表</span>
<view class="info">2021.5.31 - 2021.6.3</view>
</view> </view>
<view class="course-card-item acea-row row-middle"> <view class="course-card-list">
<image src="../../static/course-icon2.png"></image> <view class="course-card-item acea-row row-middle">
<view class="label">课程地点</view> <image src="../../static/course-icon1.png"></image>
<view class="info">湖北 武汉</view> <view class="label">课程时间</view>
<view class="info">{{detail.courseStartTime}}</view>
</view>
<view class="course-card-item acea-row row-middle">
<image src="../../static/course-icon2.png"></image>
<view class="label">课程地点</view>
<view class="info">{{detail.coursePlace}}</view>
</view>
<view class="course-card-item acea-row row-middle">
<image src="../../static/course-icon3.png"></image>
<view class="label">签到时间</view>
<view class="info">{{detail.enterStartTime}}</view>
</view>
<view class="course-card-item acea-row row-middle">
<image src="../../static/course-icon4.png"></image>
<view class="label">报名截止</view>
<view class="info">{{detail.signEndTime}}</view>
</view>
</view> </view>
<view class="course-card-item acea-row row-middle"> </view>
<image src="../../static/course-icon3.png"></image> <view class="course-desc-box" >
<view class="label">签到时间</view> <view class="title-box acea-row row-middle">
<view class="info">2021.5.31 - 2021.6.3</view> <view class="left-line"></view>
<span>课程安排</span>
</view> </view>
<view class="course-card-item acea-row row-middle"> <view class="plan-box acea-row-nowrap" v-for="(item,index) in detail.courseScheduleList" :key="index">
<image src="../../static/course-icon4.png"></image> <text class="plan-time">{{item.courseDate.split(' ')[0]}}</text>
<view class="label">报名截止</view> <text>{{item.courseContent}}</text>
<view class="info">2021.5.31 - 2021.6.3</view>
</view> </view>
</view> </view>
</view> <view class="recommend-box content" id="content3">
<view class="title-box acea-row row-middle row-center">
<view class="course-desc-box" > <view class="row-line"></view>
<view class="title-box acea-row row-middle"> <view class="title">相关推荐</view>
<view class="left-line"></view> <view class="row-line"></view>
<span>课程安排</span>
</view>
<text class="desc">
1.1如何设定自己的吸财守财的银行卡密码
1.2如何设定自己的吸财守财的银行卡号
1.3如何设定自己的利财运利婚姻利子孙名利双收手机号
1.4如何选择自己用不发生车祸的车牌号
1.5如何选择家族兴旺的门牌号
1.6如何运用数字进行预测
</text>
</view>
<view class="recommend-box content" id="content3">
<view class="title-box acea-row row-middle row-center">
<view class="row-line"></view>
<view class="title">相关推荐</view>
<view class="row-line"></view>
</view>
<view class="knowledge-list">
<view class="knowledge-item acea-row" v-for="item in articleList" @click="toDetail(item.id)">
<view class="img-box">
<image :src="item.imageInput" mode=""></image>
</view>
<view class="knowledge-info-box">
<view class="title line1">{{item.title}}</view>
<view class="intro line2">{{item.synopsis}}</view>
<view class="type-box acea-row">
<view class="tip blue">{{item.chargeType == 0 ? '免费' : item.articleCharge}}</view>
<view class="time">{{item.addTime}}</view>
</view>
</view>
</view> </view>
<view class="knowledge-item acea-row"> <view class="knowledge-list">
<view class="img-box"> <view class="knowledge-item acea-row" v-for="(item,index) in detail.similarCourseList" :key="index" @click="toDetail(item.id)">
<image src="../../static/img1.png" mode=""></image> <view class="img-box">
</view> <image src="../../static/img1.png" mode=""></image>
<view class="knowledge-info-box"> </view>
<view class="title line1">阴阳五行一个人的阴阳五的阴阳五行</view> <view class="knowledge-info-box">
<view class="time">2021-5-31-6.3 8:30-18:30</view> <view class="title line1">{{item.courseName}}</view>
<view class="address">中国 武汉</view> <view class="time">{{setDate(item.courseStartTime)}}-{{setDate(item.courseEndTime)}}</view>
<view class="type-box acea-row row-between row-middle"> <view class="address">{{item.coursePlace}}</view>
<view class="price">3000</view> <view class="type-box acea-row row-between row-middle">
<view class="signin-btn red">去报名</view> <view class="price">{{item.courseCharge}}</view>
<view class="signin-btn red">去报名</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </scroll-view>
</scroll-view>
</view>
<view class="footer-box acea-row row-between-wrapper">
<view class="footer-left">
<view class="price"><span class="fz24"></span>199</view>
</view> </view>
<view class="footer-right"> <view class="footer-box acea-row row-between-wrapper">
<view class="btn-box acea-row row-between-wrapper"> <view class="footer-left">
<view class="count-down"> <view class="price"><span class="fz24"></span>{{detail.courseCharge}}</view>
<view>距离截止时间还剩</view> </view>
<view class="colR">03:23:28</view> <view class="footer-right">
<view class="btn-box acea-row row-between-wrapper" v-if="detail.haveSeller && !detail.enterState">
<view class="count-down">
<view>距离截止时间还剩</view>
<uni-countdown color="#EB5744" :day="day" :hour="hour" :minute="minute" :second="second" />
</view>
<view class="signin-btn" @click="signInClick">立即报名</view>
</view> </view>
<view class="signin-btn" @click="signInClick">立即报名</view> <view class="signin-btn call-btn" v-if="detail.enterState" >已报名</view>
<view class="signin-btn call-btn" @click="signInClick" v-if="userInfo.phone && !detail.haveSeller">联系服务老师</view>
<!-- #ifdef MP-WEIXIN -->
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="userInfo.phone == '' && detail.haveSeller == 0" class="binding signin-btn call-btn" v-else>
<text>联系服务老师2</text>
</button>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<button class="binding" @click="goBindPhone()" v-if="userInfo.phone == '' && detail.haveSeller == 0">
<text>联系服务老师</text>
</button>
<!-- #endif -->
</view> </view>
<!-- <view class="signin-btn call-btn" @click="call">联系服务老师</view> -->
</view> </view>
</view> <view class="mask-box" v-if="maskDialog">
<view class="mask-box" v-if="dialog"> <view class="dialog-box">
<view class="dialog-box"> <view class="close" @click="closeDialog()">×</view>
<view class="close" @click="dialog = false">×</view> <view class="dialog-top acea-row-nowrap row-center-wrapper">
<view class="dialog-top acea-row-nowrap row-center-wrapper"> <image src="../../static/error-icon.png"></image>
<image src="../../static/error-icon.png"></image> <view class="word">{{teacher.msg}}</view>
<view class="word">很遗憾您的会员等级较低无法报名该课程请联系服务老师进行升级</view> </view>
</view> <view class="dialog-btm">
<view class="dialog-btm"> <view class="l-box acea-row row-between-wrapper">
<view class="l-box acea-row row-between-wrapper"> <view class="acea-row row-middle">
<view class="acea-row row-middle"> <image :src="teacher.imgPath"></image>
<image src="../../static/img1.png"></image> <view>
<view> <view>{{teacher.name}}</view>
<view>王小明</view> <view>{{teacher.phone}}</view>
<view>15007992828</view> </view>
</view> </view>
<view class="call-btn" @click="call">拨打电话</view>
</view> </view>
<view class="call-btn">拨打电话</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<Authorization v-else />
</view> </view>
</template> </template>
<script> <script>
// import WucTab from '@/components/wuc-tab/wuc-tab.vue'; // import WucTab from '@/components/wuc-tab/wuc-tab.vue';
import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
import { getCourseDetail ,enterCourse } from '@/api/knowledge';
import Authorization from '@/pages/authorization/index'
export default { export default {
components: {
Authorization,
},
data() { data() {
return { return {
id: '',
detail:{courseScheduleList:[]},
active: '0', active: '0',
toView: '', toView: '',
heightArr:[], heightArr:[],
tabInitTop:'', tabInitTop:'',
isFixedTop: false, isFixedTop: false,
dialog:false maskDialog:false,
day:'',
hour:'',
minute:'',
second:'',
teacher:{}
} }
}, },
computed: mapGetters(['userInfo']),
onLoad() { onLoad() {
console.log(this.userInfo,'11')
// //
uni.createSelectorQuery().select('.tab-box').boundingClientRect((res) => { uni.createSelectorQuery().select('.tab-box').boundingClientRect((res) => {
console.log(res);
if (res && res.top > 0) { if (res && res.top > 0) {
var tabInitTop= res.top; var tabInitTop= res.top;
this.tabInitTop= tabInitTop this.tabInitTop= tabInitTop
} }
}).exec(); }).exec();
this.courseId = this.$yroute.query.id;
this.getDetail()
}, },
mounted() { mounted() {
this.getHeightArr() this.getHeightArr()
}, },
methods: { methods: {
getPhoneNumber: function(e) {
let thit = this
console.log(e)
//
if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
uni.showLoading({
title: '绑定中',
})
wxappBindingPhone({
encryptedData: e.mp.detail.encryptedData,
iv: e.mp.detail.iv,
})
.then(res => {
// this.User();
thit.$store.dispatch('userInfo', true)
uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'success',
duration: 2000,
})
})
.catch(error => {
uni.hideLoading()
thit.$store.dispatch('userInfo', true)
uni.showToast({
title: error.msg || error.response.data.msg || error.response.data.message,
icon: 'none',
duration: 2000,
})
})
} else {
uni.showToast({
title: '已拒绝授权',
icon: 'none',
duration: 2000,
})
}
},
setDate(t){
let str = t.split(" ")[0].split("-")[1] + "." + t.split(" ")[0].split("-")[2]
return str
},
toDetail(id){
this.$yrouter.push({
path: '/pages/course/detail',
query: {
id:id,
},
})
},
getDetail(){
let nowTime = Date.parse(new Date())/1000;
getCourseDetail({"id":this.courseId,"uid":this.userInfo.uid}).then((res)=>{
this.detail = res.data
let endTime = Date.parse(new Date(res.data.signEndTime))/1000
this.times = endTime - nowTime;
this.day = Math.floor(this.times / (60 * 60 * 24));
this.hour = Math.floor(this.times / (60 * 60)) - (this.day * 24);
this.minute = Math.floor(this.times / 60) - (this.day * 24 * 60) - (this.hour * 60);
this.second = Math.floor(this.times) - (this.day * 24 * 60 * 60) - (this.hour * 60 * 60) - (this.minute * 60);
})
},
signInClick(){ signInClick(){
this.dialog = true enterCourse({courseId:this.courseId}).then((res)=>{
if(res.data.state == 0){
this.maskDialog = true
this.teacher = res.data
} else if(res.data.state == 1){
uni.showToast({
title: res.data.msg,
duration: 2000,
type: "success"
});
this.getDetail()
}
})
},
call(){
uni.makePhoneCall({
phoneNumber: this.teacher.phone
});
},
closeDialog(){
this.maskDialog = false
}, },
handelScroll(id,idx){ handelScroll(id,idx){
uni.createSelectorQuery().select('#'+id).boundingClientRect(function(res){ uni.createSelectorQuery().select('#'+id).boundingClientRect(function(res){
@ -208,29 +300,29 @@
this.toView = id this.toView = id
}, },
getHeightArr(){ getHeightArr(){
let h=0; let h=0;
let heightArr = []; let heightArr = [];
//selectAll //selectAll
uni.createSelectorQuery().selectAll('.content').boundingClientRect((rect) => { uni.createSelectorQuery().selectAll('.content').boundingClientRect((rect) => {
}).exec((res) => { }).exec((res) => {
console.log(res) // console.log(res)
res[0].forEach((item)=>{ res[0].forEach((item)=>{
h+=item.height; h+=item.height;
heightArr.push(h); heightArr.push(h);
}) })
this.heightArr = heightArr; this.heightArr = heightArr;
}) })
}, },
onPageScroll(res) { onPageScroll(res) {
let scrollTop = res.scrollTop; let scrollTop = res.scrollTop;
let scrollArr = this.heightArr; let scrollArr = this.heightArr;
for  (let  i = 0; i < scrollArr.length; i++) { for  (let  i = 0; i < scrollArr.length; i++) {
if  (scrollTop >= 0  && scrollTop < scrollArr[0]) { if  (scrollTop >= 0  && scrollTop < scrollArr[0]) {
this.active = 0; this.active = 0;
} else if (scrollTop >= (scrollArr[i - 1]) && scrollTop < scrollArr[i]) { } else if (scrollTop >= (scrollArr[i - 1]) && scrollTop < scrollArr[i]) {
this.active= i; this.active= i;
}
} }
}
var isSatisfy = scrollTop >= this.tabInitTop? true : false; var isSatisfy = scrollTop >= this.tabInitTop? true : false;
// //
if (this.isFixedTop === isSatisfy) { if (this.isFixedTop === isSatisfy) {
@ -238,6 +330,9 @@
} }
this.isFixedTop = isSatisfy this.isFixedTop = isSatisfy
}, },
onHide() {
clearInterval(this.timer);
},
} }
} }
</script> </script>
@ -255,6 +350,7 @@
.dialog-box{ .dialog-box{
width: 600rpx; width: 600rpx;
border-radius: 12rpx; border-radius: 12rpx;
overflow: hidden;
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
@ -313,6 +409,14 @@
height: 340rpx; height: 340rpx;
swiper{ swiper{
height: 100%; height: 100%;
.swiper-item{
width: 100%;
height: 100%;
image{
width: 100%;
height: 100%;
}
}
} }
} }
.course-info-box{ .course-info-box{
@ -393,26 +497,35 @@
color: #666666; color: #666666;
line-height: 24px; line-height: 24px;
} }
.scroll-view_H{
white-space: nowrap;
width: 100%;
}
.info-box{ .info-box{
display: flex; width: 100%;
flex-direction: column; display: inline-block;
align-items: center; text-align: center;
justify-content: center;
image{ image{
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
border-radius: 25px; border-radius: 25px;
} }
.name{ .name{
width: 100%;
font-size: 32rpx; font-size: 32rpx;
color: #3C464F; color: #3C464F;
line-height: 44rpx; line-height: 44rpx;
} }
.tip{ .tip{
width: 100%;
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
line-height: 34px; line-height: 34px;
} }
.desc{
width: 100%;
white-space: pre-wrap;
}
} }
.title-box{ .title-box{
font-size: 36rpx; font-size: 36rpx;
@ -427,6 +540,16 @@
margin-right: 16rpx; margin-right: 16rpx;
} }
} }
.plan-box{
font-size: 28rpx;
color: #666;
line-height: 32rpx;
margin-bottom: 12rpx;
.plan-time{
width: 170rpx;
margin-right: 22rpx;
}
}
.course-card-item{ .course-card-item{
font-size: 32rpx; font-size: 32rpx;
image{ image{
@ -572,6 +695,7 @@
text-align: center; text-align: center;
line-height: 80rpx; line-height: 80rpx;
color: #fff; color: #fff;
font-size: 30rpx;
} }
} }

22
pages/course/index.vue

@ -37,7 +37,7 @@
</view> </view>
</view> </view>
<view class="knowledge-list"> <view class="knowledge-list">
<view class="active-word">国学·</view> <view class="active-word">{{categoryTitle}}</view>
<view class="knowledge-item acea-row" v-for="item in courseList" @click="toDetail(item.id)"> <view class="knowledge-item acea-row" v-for="item in courseList" @click="toDetail(item.id)">
<view class="img-box"> <view class="img-box">
<image :src="item.imageArr[0]" mode=""></image> <image :src="item.imageArr[0]" mode=""></image>
@ -52,7 +52,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="knowledge-item acea-row"> <!-- <view class="knowledge-item acea-row">
<view class="img-box"> <view class="img-box">
<image src="../../static/img1.png" mode=""></image> <image src="../../static/img1.png" mode=""></image>
</view> </view>
@ -65,7 +65,7 @@
<view class="signin-btn red" @click="toDetail(1)">去报名</view> <view class="signin-btn red" @click="toDetail(1)">去报名</view>
</view> </view>
</view> </view>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
@ -74,6 +74,7 @@
<script> <script>
import WucTab from '@/components/wuc-tab/wuc-tab.vue'; import WucTab from '@/components/wuc-tab/wuc-tab.vue';
import SecondMenu from '../knowledge/components/secondMenu.vue'; import SecondMenu from '../knowledge/components/secondMenu.vue';
import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
import { import {
getCategory, getCategory,
getArticle, getArticle,
@ -81,6 +82,7 @@
getCourses getCourses
} from '@/api/knowledge'; } from '@/api/knowledge';
export default { export default {
computed: mapGetters(['userInfo']),
data() { data() {
return { return {
TabCur: null, TabCur: null,
@ -88,21 +90,24 @@
secondMenu: [], secondMenu: [],
active: null, active: null,
courseList: [], courseList: [],
studyList:[] studyList:[],
categoryTitle:'',
} }
}, },
components: { components: {
WucTab, WucTab,
SecondMenu SecondMenu
}, },
onLoad() { onShow() {
getCategory().then((res) => { getCategory().then((res) => {
this.tabList = res.data this.tabList = res.data
this.$set(this, 'tabList', res.data) this.$set(this, 'tabList', res.data)
this.$set(this, 'secondMenu', res.data[0].categoryList) this.$set(this, 'secondMenu', res.data[0].categoryList)
this.$set(this, 'TabCur', res.data[0].id) this.$set(this, 'TabCur', res.data[0].id)
this.categoryTitle = res.data[0].categoryName;
if (res.data[0].categoryList.length > 0) { if (res.data[0].categoryList.length > 0) {
this.$set(this, 'active', res.data[0].categoryList[0].id) this.$set(this, 'active', res.data[0].categoryList[0].id)
this.categoryTitle = this.categoryTitle +'·'+res.data[0].categoryList[0].categoryName
} }
}).then(() => { }).then(() => {
this.getStudyList() this.getStudyList()
@ -138,23 +143,28 @@
getCourses() { getCourses() {
var cid = null; var cid = null;
this.active == null ? cid = this.TabCur : cid = this.active this.active == null ? cid = this.TabCur : cid = this.active
getCourses({categoryId: cid,listState:0}).then((res) => { getCourses({categoryId: cid,listState:0,uid:this.userInfo.uid}).then((res) => {
if (res.success) { if (res.success) {
this.courseList = res.data this.courseList = res.data
} }
}) })
}, },
tabChange(item) { tabChange(item) {
this.categoryTitle = item.categoryName;
if (item.categoryList.length > 0) { if (item.categoryList.length > 0) {
this.$set(this, 'active', item.categoryList[0].id) this.$set(this, 'active', item.categoryList[0].id)
this.categoryTitle = item.categoryList[0].categoryName;
} }
this.secondMenu = item.categoryList; this.secondMenu = item.categoryList;
this.TabCur = item.id; this.TabCur = item.id;
this.getStudyList() this.getStudyList()
this.getCourses() this.getCourses()
}, },
secondMenuClick(item) { secondMenuClick(item) {
this.active = item.id; this.active = item.id;
this.categoryTitle = item.categoryName;
this.getStudyList() this.getStudyList()
this.getCourses() this.getCourses()
} }

89
pages/home/index.vue

@ -70,18 +70,18 @@
<view class="more" @click="toCourse">查看全部课程</view> <view class="more" @click="toCourse">查看全部课程</view>
</view> </view>
<view class="recommend-list-box acea-row"> <view class="recommend-list-box acea-row">
<view class="recommend-item" v-for="(item,index) in 4" :key="index" @click="toCourseDetail(item.id)"> <view class="recommend-item" v-for="(item,index) in courseList" :key="index" @click="toCourseDetail(item.id)">
<view class="img-box"><image src="../../static/img2.png"></image></view> <view class="img-box"><image :src="item.imageArr[0]"></image></view>
<view class="course-content"> <view class="course-content">
<view class="course-title line1">一代天骄·王者少年</view> <view class="course-title line1">{{item.courseName}}</view>
<view class="course-tips-box acea-row"> <view class="course-tips-box acea-row">
<view class="course-tip-item blue">国学</view> <view class="course-tip-item blue">{{item.categoryName}}</view>
<view class="course-tip-item yellow">商学院</view> <!-- <view class="course-tip-item yellow">商学院</view> -->
</view> </view>
<view class="price">199</view> <view class="price">{{item.courseCharge}}</view>
<view class="course-address acea-row row-between-wrapper"> <view class="course-address acea-row row-between-wrapper">
<view class="address">中国 武汉</view> <view class="address">{{item.coursePlace}}</view>
<view class="course-time">2021 5 31-6.3</view> <view class="course-time">{{setDate(item.courseStartTime)}}-{{setDate(item.courseEndTime)}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -95,16 +95,16 @@
</view> </view>
<view class="study-list uni-padding-wrap uni-common-mt"> <view class="study-list uni-padding-wrap uni-common-mt">
<scroll-view class="scroll-view_H" scroll-x="true"> <scroll-view class="scroll-view_H" scroll-x="true">
<view class="study-item scroll-view-item_H" v-for="(item,index) in 6" :key="index" @click="toStudyDetail(item.id)"> <view class="study-item scroll-view-item_H" v-for="(item,index) in studyList" :key="index" @click="toStudyDetail(item.id)">
<view class="day-box acea-row row-middle"> <view class="day-box acea-row row-middle">
<image src="../../static/date-icon.png" mode="" v-if="index%2 == 0"></image> <image src="../../static/date-icon.png" mode="" v-if="index%2 == 0"></image>
<image src="../../static/date-icon2.png" mode="" v-if="index%2 != 0"></image> <image src="../../static/date-icon2.png" mode="" v-if="index%2 != 0"></image>
<text>20</text> <text>{{item.clockTimes}}</text>
</view> </view>
<view class="study-content"> <view class="study-content">
<view class="study-title">连续11天打卡站桩</view> <view class="study-title">{{item.listName}}</view>
<view class="study-time acea-row row-between-wrapper"> <view class="study-time acea-row row-between-wrapper">
<view>5.28开始</view> <view>{{setDate(item.listStartTime)}}开始</view>
<view>280人已参与</view> <view>280人已参与</view>
</view> </view>
</view> </view>
@ -210,64 +210,14 @@ export default {
lovely: [], lovely: [],
benefit: [], benefit: [],
couponList: [], couponList: [],
swiperOption: {
pagination: {
el: '.swiper-pagination',
clickable: true,
},
autoplay: {
disableOnInteraction: false,
delay: 2000,
},
loop: true,
speed: 1000,
observer: true,
observeParents: true,
},
swiperRoll: {
direction: 'vertical',
autoplay: {
disableOnInteraction: false,
delay: 2000,
},
loop: true,
speed: 1000,
observer: true,
observeParents: true,
},
swiperScroll: {
freeMode: true,
freeModeMomentum: false,
slidesPerView: 'auto',
observer: true,
observeParents: true,
},
swiperBoutique: {
pagination: {
el: '.swiper-pagination',
clickable: true,
},
autoplay: {
disableOnInteraction: false,
delay: 2000,
},
loop: true,
speed: 1000,
observer: true,
observeParents: true,
},
swiperProducts: {
freeMode: true,
freeModeMomentum: false,
slidesPerView: 'auto',
observer: true,
observeParents: true,
},
bgImage: '', bgImage: '',
chinese: ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九'], chinese: ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九'],
weeks: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], weeks: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
week:'', week:'',
todayDate:'', todayDate:'',
courseList: [],
studyList: [],
articleList: []
} }
}, },
computed: { computed: {
@ -305,6 +255,9 @@ export default {
that.$set(that, 'benefit', res.data.benefit) that.$set(that, 'benefit', res.data.benefit)
that.$set(that, 'couponList', res.data.couponList) that.$set(that, 'couponList', res.data.couponList)
that.$set(that, 'combinationList', res.data.combinationList) that.$set(that, 'combinationList', res.data.combinationList)
that.$set(that, 'courseList', res.data.cyCourseDtos)
that.$set(that, 'studyList', res.data.studyLists)
that.$set(that, 'articleList', res.data.articleDtos)
uni.hideLoading() uni.hideLoading()
that.setOpenShare() that.setOpenShare()
// that.doColorThief() // that.doColorThief()
@ -312,6 +265,11 @@ export default {
}, },
methods: { methods: {
...mapActions(['getLocation']), ...mapActions(['getLocation']),
setDate(t){
console.log()
let str = t.split(" ")[0].split("-")[1] + "." + t.split(" ")[0].split("-")[2]
return str
},
getDate(){ getDate(){
var today = new Date(); var today = new Date();
var m = (today.getMonth()+1).toString(); var m = (today.getMonth()+1).toString();
@ -642,6 +600,7 @@ export default {
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #333;
margin: 20rpx 18rpx 20rpx 0; margin: 20rpx 18rpx 20rpx 0;
overflow: hidden;
image{ image{
width: 334rpx; width: 334rpx;
height: 216rpx; height: 216rpx;

2
pages/shop/GoodsCon/index.vue

@ -363,7 +363,7 @@ export default {
}, },
goEvaluateList(id) { goEvaluateList(id) {
this.$yrouter.push({ this.$yrouter.push({
path: '/pages/shop/EvaluateList/index', path: '/pagesB/pages/shop/EvaluateList/index',
query: { query: {
id, id,
}, },

4
pages/user/User/index.vue

@ -63,7 +63,6 @@
<scroll-view class="scroll-view_H" scroll-x="true"> <scroll-view class="scroll-view_H" scroll-x="true">
<view class="bangdan-item" v-for="(item,index) in 6" :key="index"> <view class="bangdan-item" v-for="(item,index) in 6" :key="index">
<view class="bangdan-name">连续11天打卡站桩</view> <view class="bangdan-name">连续11天打卡站桩</view>
<!-- <view class="time">2021.5.28-2021.6.18</view> -->
<view class="acea-row row-between-wrapper"> <view class="acea-row row-between-wrapper">
<view class="signin-day">已连续12天</view> <view class="signin-day">已连续12天</view>
<view class="signin-btn">立即打榜</view> <view class="signin-btn">立即打榜</view>
@ -240,7 +239,8 @@ export default {
this.$yrouter.push('/pages/order/ReturnList/index') this.$yrouter.push('/pages/order/ReturnList/index')
}, },
goAddressManagement(){ goAddressManagement(){
this.$yrouter.push('/pages/user/address/AddressManagement/index') // this.$yrouter.push('/pagesB/pages/user/address/AddressManagement/index')
this.$yrouter.push('/pagesB/pages/shop/Live/LiveList/index')
}, },
goMyOrder(type) { goMyOrder(type) {
this.$yrouter.push({ this.$yrouter.push({

BIN
static/article1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 KiB

BIN
static/home-banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 KiB

2
utils/request.js

@ -92,7 +92,7 @@ function baseRequest(options) {
if (res.status !== 200) { if (res.status !== 200) {
return Promise.reject({ msg: '请求失败', res, data }) return Promise.reject({ msg: '请求失败', res, data })
} }
console.log(data) // console.log(data)
if ([401, 403].indexOf(data.status) !== -1) { if ([401, 403].indexOf(data.status) !== -1) {
handleLoginFailure() handleLoginFailure()
return Promise.reject({ msg: res.data.msg, res, data, toLogin: true }) return Promise.reject({ msg: res.data.msg, res, data, toLogin: true })

Loading…
Cancel
Save