diff --git a/.gitignore b/.gitignore index f60e997..3a1e4f9 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ yarn-error.log* unpackage/ assets/css/style.css assets/css/style.css.map +.hbuilderx diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 501e01c..9cba30d 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -2,10 +2,15 @@ // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 "version": "0.0", "configurations": [{ - "type": "uniCloud", - "default": { - "launchtype": "remote" - } - } + "default" : + { + "launchtype" : "remote" + }, + "mp-weixin" : + { + "launchtype" : "remote" + }, + "type" : "uniCloud" + } ] } diff --git a/api/diandeng.js b/api/diandeng.js index 6802616..f4a2a25 100644 --- a/api/diandeng.js +++ b/api/diandeng.js @@ -46,7 +46,7 @@ export function addBlessing(data) { * 万年历 */ export function getWanniali(data) { - return request.get("/Wannianli/getWanniali?date", data); + return request.get("/Wannianli/getWanniali?date="+data); } /** diff --git a/api/knowledge.js b/api/knowledge.js index 2ee1356..040f275 100644 --- a/api/knowledge.js +++ b/api/knowledge.js @@ -90,14 +90,14 @@ export function myStudylist(data) { * 获取课程列表 */ export function getCourses(data) { - return request.post("/Course/listCourses",data); + return request.get("/lession/lessionList",data); } /** * 获取课程详情 */ export function getCourseDetail(data) { - return request.post("/Course/courseDetail",data); + return request.post("/lession/lessionDetail",data); } /** diff --git a/components/ShopLiveCard.vue b/components/ShopLiveCard.vue index a886766..2a983ce 100644 --- a/components/ShopLiveCard.vue +++ b/components/ShopLiveCard.vue @@ -38,9 +38,9 @@ // #ifdef MP-WEIXIN HAS_LIVE = true let livePlayer = null; - if (HAS_LIVE) { - // livePlayer = requirePlugin('live-player-plugin'); - } + // if (HAS_LIVE) { + // livePlayer = requirePlugin('live-player-plugin'); + // } // #endif let timer = null; export default { @@ -107,9 +107,9 @@ methods: { goRoom() { let that = this; - wx.navigateTo({ - url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${that.detail.roomId}` - }); + // wx.navigateTo({ + // url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${that.detail.roomId}` + // }); }, dateFormat(fmt, date) { let ret; diff --git a/config/index.js b/config/index.js index 263d6a0..c998654 100644 --- a/config/index.js +++ b/config/index.js @@ -1,11 +1,9 @@ // export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api' -// export const VUE_APP_API_URL = 'http://192.168.0.114:8088/api' -export const VUE_APP_API_URL = 'https://www.cyjyyjy.com:8096/api' -// export const VUE_APP_API_URL = 'https://hm2a5x.39nat.com/api' +// export const VUE_APP_API_URL = 'http://192.168.0.112:8088/api' +export const VUE_APP_API_URL = 'http://192.168.68.125:8088/api' +// export const VUE_APP_API_URL = 'https://www.cyjyyjy.com/api' // export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'https://thapi.xinxintuan.co/api' // export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api'; -// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api'; -export const VUE_APP_RESOURCES_URL = 'https://h5.yixiang.co/static' - \ No newline at end of file +// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api'; \ No newline at end of file diff --git a/libs/wechat.js b/libs/wechat.js index b95b507..0241fa2 100644 --- a/libs/wechat.js +++ b/libs/wechat.js @@ -1,6 +1,6 @@ import { subscribeMessage } from '@/libs/order' import { getProvider } from '@/utils' -import WechatJSSDK from 'wechat-jssdk/dist/client.umd' +// import WechatJSSDK from 'wechat-jssdk/dist/client.umd' import { getWechatConfig, wechatAuth } from '@/api/public' import { parseQuery } from '@/utils' import cookie from '@/utils/store/cookie' diff --git a/manifest.json b/manifest.json index 873c549..4ff1717 100644 --- a/manifest.json +++ b/manifest.json @@ -147,7 +147,14 @@ "scope.userLocation" : { "desc" : "你的位置信息将用于小程序位置接口的效果展示" } - } + }, + "plugins" : { + // #ifdef MP-WEIXIN + "live-player-plugin": { + "version": "1.3.0", + "provider": "wx2b03c6e691cd7370" + } + } }, // #endif "mp-alipay" : { diff --git a/pages.json b/pages.json index 3e8c84a..4276512 100644 --- a/pages.json +++ b/pages.json @@ -37,10 +37,17 @@ "navigationBarTitleText": "首页" } }, + { + "path": "pages/noticePage/index", + "style": { + "navigationBarTitleText": "公告" + } + }, { "path": "pages/home/index", "style": { - "navigationBarTitleText": "禅易教育研究院" + "navigationBarTitleText": "禅易教育研究院", + "enablePullDownRefresh": true } }, // { @@ -67,7 +74,15 @@ { "path": "pages/course/detail", "style": { - "navigationBarTitleText": "课程详情" + "navigationBarTitleText": "课程详情", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/course/signIn", + "style": { + "navigationBarTitleText": "课程签到", + "enablePullDownRefresh": true } }, { @@ -122,7 +137,8 @@ { "path": "pages/shop/GoodsClass/index", "style": { - "navigationBarTitleText": "商城" + "navigationBarTitleText": "商城", + "enablePullDownRefresh": true } }, { @@ -156,13 +172,15 @@ { "path": "pages/user/myCourses/index", "style": { - "navigationBarTitleText": "我的课程" + "navigationBarTitleText": "我的课程", + "enablePullDownRefresh": true } }, { "path": "pages/user/myBangdan/index", "style": { - "navigationBarTitleText": "我的打卡榜" + "navigationBarTitleText": "我的打卡榜", + "enablePullDownRefresh": true } }, { @@ -265,7 +283,8 @@ { "path": "pages/serviceTeacher/courseDetail", "style": { - "navigationBarTitleText": "课程详情" + "navigationBarTitleText": "课程详情", + "enablePullDownRefresh": true } }, { @@ -589,7 +608,15 @@ "navigationBarTitleText": "直播列表" } } - ] + ,{ + "path" : "pages/user/liveWelcome/index", + "style" : + { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + } + ] } ], "easycom": { diff --git a/pages/course/detail.vue b/pages/course/detail.vue index c08ccd3..f7f68c1 100644 --- a/pages/course/detail.vue +++ b/pages/course/detail.vue @@ -3,7 +3,7 @@ - + - {{detail.courseName}} + + {{detail.courseName}} + 公开课 + ¥{{detail.price}} + {{detail.categoryName}} - {{detail.levelName}} + {{detail.flag[0]}} @@ -54,10 +58,15 @@ 课程表 + + + 课程类型 + {{detail.courseType == 0 ? '线下课程' : '直播课程'}} + 课程时间 - {{courseStartTime}} 至 {{courseEndTime}} + {{detail.courseStartTime}} 至 {{detail.courseEndTime}} @@ -81,17 +90,19 @@ 课程安排 - + - {{item.courseContent}} + {{item}} + 相关推荐 + @@ -99,7 +110,7 @@ {{item.courseName}} - {{courseStartTime}}~{{courseEndTime}} + {{item.courseStartTime.split(' ')[0]}}-{{item.courseEndTime.split(' ')[0]}} {{item.coursePlace}} @@ -118,45 +129,35 @@ 座位号:{{detail.seat}} - - - - 距离截止时间还剩 - - - - - + 距离截止时间还剩 - - - + + + + + + + + + + - - - - + @@ -164,22 +165,34 @@ × - {{teacher.msg}} + 您还没有绑定服务老师,请点击按钮联系服务老师进行绑定! - + 拨打电话 + + + + + + @@ -198,6 +211,7 @@ }, data() { return { + yhStatus:0, id: '', teacherId:null, validCode:null, @@ -207,7 +221,9 @@ heightArr:[], tabInitTop:'', isFixedTop: false, - maskDialog:false, + maskDialog: false, + showSignUp: false, + times: 0, day:'', hour:'', minute:'', @@ -222,36 +238,37 @@ this.tabInitTop= res.top; } }).exec(); - if(this.$yroute.query.teacherId){ + if(this.$yroute.query.teacherId){ //服务老师分享链接 this.courseId = this.$yroute.query.courseId; this.validCode = this.$yroute.query.validCode; this.teacherId = this.$yroute.query.teacherId; - } else{ + } else{ //列表进入详情页 this.courseId = this.$yroute.query.id; } this.getDetail() this.$nextTick(()=>{ this.getHeightArr() }) - // if(this.userInfo.uid){ - // this.getDetail() - // this.$nextTick(()=>{ - // this.getHeightArr() - // }) - // } }, + computed:{ userInfo(){ return this.$store.getters["userInfo"] }, - courseStartTime(){ - return this.detail.courseStartTime.split(' ')[0] - }, - courseEndTime(){ - return this.detail.courseEndTime.split(' ')[0] - }, }, - mounted() { + mounted(){ + + }, + onPullDownRefresh() { + this.getDetail() + }, + onShareAppMessage: function(res) { + // console.log(this.detail.id) + return { + title: this.detail.courseName, + imageUrl:this.detail.coverImg, + path: '/pages/course/detail?id=' + this.detail.id, + } }, methods: { getPhoneNumber: function(e) { @@ -317,6 +334,41 @@ }, }) }, + test(){ + let yhStatus = 0; + let detail = this.detail; + if ( !detail.enterState ){ + yhStatus = 0; + if( new Date(detail.enterEndTime) >= new Date() && new Date(detail.enterStartTime) <= new Date() ){ + yhStatus = 1; // 可报名 + }else if(new Date(detail.enterEndTime) < new Date()){ + yhStatus = 2; // 超过报名时间 + }else if(new Date(detail.enterStartTime) > new Date()){ + yhStatus = 3; // 报名时间没开始 + } + + }else{ + // 是否已经超过课程时间 + if (detail.status == 1 && detail.courseType == 1){ + if( new Date(detail.courseEndTime) >= new Date() ){ + yhStatus = 4; // 直播中 + }else{ + yhStatus = 5; //查看回放 + } + }else if (detail.status == 1 && detail.courseType == 0){ + if (detail.signState == 0){ + yhStatus = 6; //线下课程未签到 + }else{ + yhStatus = 7; //已签到 + } + }else { + if ( detail.status == 0 ){ + yhStatus = 8; // 报名没有被确认 + } + } + } + this.yhStatus = yhStatus; + }, getDetail(){ uni.showLoading({ title:'正在加载中...' @@ -324,8 +376,9 @@ let nowTime = Date.parse(new Date())/1000; getCourseDetail({id:this.courseId}).then((res)=>{ uni.hideLoading() - res.data.courseIntroduce = res.data.courseIntroduce.replace(/\{ - if(res.data.state == 0){ - this.maskDialog = true - this.teacher = res.data - } else if(res.data.state == 1){ + if(res.data.state == 1){ + //直接成功 刷新页面 uni.showToast({ - title: '报名成功!', - duration: 2000, - type: "success" + title: res.data.msg }); setTimeout(()=>{ this.getDetail() - },2000) + },1500) + } else if(res.data.state == 2){ + this.payment(res.data.payData) } else{ uni.showToast({ title: res.msg, @@ -393,9 +460,39 @@ } }) }, + payment(orderInfo){ + // 调用支付接口 + uni.requestPayment({ + provider: 'wxpay', + ...orderInfo, + signType: 'MD5', + package:orderInfo.packageValue, + success: success => { + if(this.detail.courseType == 1){ + // this.showSignUp = true + this.getDetail() + } else{ + uni.showToast({ + title: '报名成功!' + }); + setTimeout(()=>{ + this.getDetail() + },1500) + } + }, + fail: error => { + console.log(error) + if (error.errMsg == 'requestPayment:fail cancel') { + uni.showToast({ title: '已取消支付', icon: 'none', duration: 5000 }) + } else { + uni.showToast({ title: error || error.msg, icon: 'none', duration: 5000 }) + } + }, + }) + }, call(){ uni.makePhoneCall({ - phoneNumber: this.teacher.phone + phoneNumber: '15623111593' }); }, closeDialog(){ @@ -420,7 +517,7 @@ //selectAll会选择所要含有该类名的盒子 uni.createSelectorQuery().selectAll('.content').boundingClientRect((rect) => { }).exec((res) => { - console.log('res',res) + // console.log('res',res) res[0].forEach((item)=>{ h+=item.top; heightArr.push(h); @@ -527,9 +624,108 @@ text-align: center; line-height: 60rpx; color: #6E85EB; + margin: 0 auto; + } + } + } + + } + .mask-box2{ + width: 100%; + height: 100%; + background: rgba(0,0,0,.6); + position: fixed; + top: 0; + z-index: 99; + .dialog-bg{ + width: 726rpx; + height: 1026rpx; + background: linear-gradient(180deg, #fbd8a5 0%, #fcc86a 100%); + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + border-radius: 8rpx; + } + .signUp-box{ + width: 543rpx; + height: 836rpx; + background: #fff; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + display: flex; + flex-direction: column; + align-items: center; + border-radius: 8rpx; + .signup-success{ + width: 470rpx; + height: 100rpx; + margin: 60rpx 0 46rpx; + } + .divsion-line{ + width: 467rpx; + border-bottom: 1px dashed #fbd69e; + position: relative; + &::before{ + display: inline-block; + content: ''; + width: 50rpx; + height: 50rpx; + border-radius: 50px; + background: #FBD293; + position: absolute; + left: -62rpx; + top: -25rpx; } + &::after{ + display: inline-block; + content: ''; + width: 50rpx; + height: 50rpx; + border-radius: 50px; + background: #FBD293; + position: absolute; + right: -62rpx; + top: -25rpx; + } + } + .er-code{ + image{ + width: 297rpx; + height: 297rpx; + } + } + .tips{ + width: 340rpx; + font-size: 28rpx; + color: #000; + margin: 28rpx auto 12rpx; + text-align: center; + } + .longpress-btn{ + width: 327rpx; + height: 75rpx; + text-align: center; + line-height: 75rpx; + font-size: 32rpx; + color: #fff; + background: linear-gradient(90deg, #F7D08E 0%, #E2B35D 99%); + border-radius: 37rpx; + margin-top: 32rpx; } } + .close-btn{ + width: 80rpx; + height: 80rpx; + background: url(../../static/close-btn.png) no-repeat; + background-size: 100% 100%; + position: absolute; + bottom: 100rpx; + left: 50%; + margin-left: -40rpx; + } } .swiper-box{ width: 100%; @@ -564,6 +760,9 @@ color: #333333; line-height: 56rpx; margin: 0rpx 0 20rpx; + .price{ + color: #EA533E; + } } .tips-box{ display: flex; @@ -827,14 +1026,16 @@ .colR{ color: #F99C10; } - .signin-btn{ - width: 178rpx; - height: 100%; - line-height: 84rpx; - font-size: 32rpx; - color: #fff; - background: #F99C10; - } + } + .signin-btn{ + min-width: 178rpx; + height: 100%; + line-height: 84rpx; + padding: 0 12rpx; + font-size: 32rpx; + border-radius: 44px; + color: #fff; + background: #F99C10; } .call-btn{ width: 268rpx; diff --git a/pages/course/index.vue b/pages/course/index.vue index 8cf1774..fca129d 100644 --- a/pages/course/index.vue +++ b/pages/course/index.vue @@ -53,7 +53,7 @@ 暂无内容... - + {{item.courseName}} @@ -68,20 +68,6 @@ - @@ -147,7 +133,7 @@ }, mounted() { uni.getSystemInfo({ - success:function(res){ + success:(res)=>{ this.windowWidth = res.windowWidth; } }) @@ -192,12 +178,17 @@ }) }, getCourses() { + uni.showLoading({ + title:'正在加载中...' + }) var cid = null; this.active == null ? cid = this.currentTab.id : cid = this.active - getCourses({categoryId: cid,listState:0,uid:this.userInfo.uid}).then((res) => { + getCourses({categoryId: cid,listState:0}).then((res) => { if (res.success) { this.courseList = res.data } + uni.hideLoading() + uni.stopPullDownRefresh() }) }, tabChange(item,index) { @@ -238,22 +229,8 @@ this.getCourses() }, onPullDownRefresh() { - getCategory().then((res) => { - this.tabList = res.data - this.$set(this, 'secondMenu', res.data[0].categoryList) - this.$set(this, 'currentTab', res.data[0]) - this.categoryTitle = res.data[0].categoryName; - if (res.data[0].categoryList.length > 0) { - this.$set(this, 'active', res.data[0].categoryList[0].id) - this.categoryTitle = this.categoryTitle +'·'+res.data[0].categoryList[0].categoryName - } else{ - // this.$set(this, 'tabSelect', 0) - // this.scrollLeft = 0 - } - }).then(() => { - this.getStudyList() - this.getCourses() - }) + this.getStudyList() + this.getCourses() } } } diff --git a/pages/course/signIn.vue b/pages/course/signIn.vue new file mode 100644 index 0000000..3bb5e83 --- /dev/null +++ b/pages/course/signIn.vue @@ -0,0 +1,246 @@ + + + + + diff --git a/pages/home/index.vue b/pages/home/index.vue index 28b7e76..e657272 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -5,14 +5,15 @@ 搜索商品 - - - - - @@ -40,29 +41,12 @@ {{ji}} - - - - - + @@ -71,19 +55,18 @@ - + {{item.courseName}} {{item.categoryName}} - {{item.levelName}} {{item.coursePlace}} - {{setDate(item.courseStartTime)}}-{{setDate(item.courseEndTime)}} + {{item.enterStartTime}}-{{item.enterEndTime}} @@ -104,7 +87,7 @@ {{item.clockTimes}} - {{item.listName}} + {{item.listName}} {{setDate(item.listStartTime)}}开始 {{item.enterNum}}人已参与 @@ -153,7 +136,6 @@ import Menu from '@/components/Menu' import UniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar' import Adv from '@/components/sh-adv' import Groupon from '@/components/sh-groupon.vue' - import Banner from './components/Banner' import HotCommodity from './components/HotCommodity' import FirstNewProduct from './components/FirstNewProduct' @@ -175,8 +157,6 @@ const HAS_COUPON_WINDOW = 'has_coupon_window' export default { name: 'Index', components: { - // swiper, - // swiperSlide, UniNoticeBar, GoodList, PromotionGood, @@ -188,7 +168,6 @@ export default { HotCommodity, FirstNewProduct, ProductsRecommended, - // Live, }, props: {}, data: function() { @@ -245,13 +224,12 @@ export default { }, customStyle() { var bgImage = this.bgImage - // var style = `height:${this.CustomBar}px;padding-top:${0}px;background: ${this.bgcolor}`; var style = `height:${this.CustomBar}px;padding-top:${this.StatusBar}px;background: ${this.bgcolor}` if (this.bgImage) { style = `${style}background-image:url(${bgImage});` } return style - }, + } }, onLoad: function() { this.getLocation() @@ -260,36 +238,12 @@ export default { uni.showLoading({ title:'正在加载中...' }) - // getCanvas() - // .then(res => {}) - // .catch(error => { - // this.homeData = JSON.parse(error.data.json) - // }) getBlessingFlag().then((res)=>{ this.flag = res.data }) - getHomeData().then(res => { - uni.hideLoading() - that.logoUrl = res.data.logoUrl - res.data.banner.map(item => (item.bgcolor = item.color || '')) - that.$set(that, 'info', res.data.info) - that.$set(that, 'firstList', res.data.firstList) - that.$set(that, 'bastList', res.data.bastList) - that.$set(that, 'likeInfo', res.data.likeInfo) - that.$set(that, 'live', res.data.liveList) - that.$set(that, 'lovely', res.data.lovely) - that.$set(that, 'benefit', res.data.benefit) - that.$set(that, 'couponList', res.data.couponList) - 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() - that.setOpenShare() - }) + this.getData() getWanniali(this.dateStr2).then((res)=>{ - console.log(res) var data = res.data if(res.success){ this.suici = JSON.parse(data.huangli.suici).join(' ') @@ -303,9 +257,39 @@ export default { } }) }, + onPullDownRefresh() { + this.getData() + }, methods: { ...mapActions(['getLocation']), + getData(){ + var that = this; + getHomeData().then(res => { + uni.hideLoading() + that.logoUrl = res.data.logoUrl + res.data.banner.map(item => (item.bgcolor = item.color || '')) + res.data.lessionDtos.map(item => { + item.enterStartTime = this.setDate(item.enterStartTime) + item.enterEndTime = this.setDate(item.enterEndTime) + }) + that.$set(that, 'info', res.data.info) + that.$set(that, 'firstList', res.data.firstList) + that.$set(that, 'bastList', res.data.bastList) + that.$set(that, 'likeInfo', res.data.likeInfo) + that.$set(that, 'live', res.data.liveList) + that.$set(that, 'lovely', res.data.lovely) + that.$set(that, 'benefit', res.data.benefit) + that.$set(that, 'couponList', res.data.couponList) + that.$set(that, 'combinationList', res.data.combinationList) + that.$set(that, 'courseList', res.data.lessionDtos) + that.$set(that, 'studyList', res.data.studyLists) + that.$set(that, 'articleList', res.data.articleDtos) + uni.hideLoading() + that.setOpenShare() + uni.stopPullDownRefresh() + }) + }, todiandeng(){ uni.navigateTo({ url:'/pages/diandeng/index' @@ -338,6 +322,11 @@ export default { path: 'pages/home/index?spread=' + uni.getStorageSync('uid'), } }, + toNoticePage(){ + this.$yrouter.push({ + path: '/pages/noticePage/index', + }) + }, toCourseDetail(id){ this.$yrouter.push({ path: '/pages/course/detail', @@ -441,43 +430,6 @@ export default { }) } }) - - // switch (option.pageType) { - // case 'good': - // // 跳转商品详情 - // this.$yrouter.push({ - // path: '/pages/shop/GoodsCon/index', - // query: { - // q: res.result, - // }, - // }) - // break - // case 'group': - // // 跳转团购 - // this.$yrouter.push({ - // path: '/pages/activity/GroupRule/index', - // query: { - // q: res.result, - // }, - // }) - // break - // case 'dargain': - // // 跳转砍价 - // this.$yrouter.push({ - // path: '/pages/activity/DargainDetails/index', - // query: { - // q: res.result, - // }, - // }) - // break - // default: - // // 跳转分销 - // this.$yrouter.push({ - // path: '/pages/Loading/index', - // query: {}, - // }) - // break - // } }, }) }, @@ -485,21 +437,18 @@ export default { this.bgcolor = e }, }, - created: async function() { - // await this.doColorThief(); - }, } diff --git a/pages/serviceTeacher/courseDetail.vue b/pages/serviceTeacher/courseDetail.vue index 932826f..6813989 100644 --- a/pages/serviceTeacher/courseDetail.vue +++ b/pages/serviceTeacher/courseDetail.vue @@ -1,19 +1,18 @@