diff --git a/pages.json b/pages.json index 41c498a..d33e87b 100644 --- a/pages.json +++ b/pages.json @@ -252,7 +252,8 @@ "path" : "pages/course/courseDetail", "style" : { - "navigationBarTitleText" : "课程详细" + "navigationBarTitleText" : "课程详细", + "enablePullDownRefresh": true } }, { @@ -263,10 +264,18 @@ } }, { - "path" : "pages/course/illustrate", + "path" : "pages/course/illustrate", "style" : { - "navigationBarTitleText" : "课程说明" + "navigationBarTitleText" : "课程说明", + "enablePullDownRefresh": true + } + }, + { + "path" : "pages/course/outline", + "style" : + { + "navigationBarTitleText" : "课程大纲" } } ], diff --git a/pages/course/courseSet.vue b/pages/course/courseSet.vue index e3f482a..313069c 100644 --- a/pages/course/courseSet.vue +++ b/pages/course/courseSet.vue @@ -2,17 +2,85 @@ - - - - + + + + + + + + + + 点击课程名称即可查看对应的课程说明 + + + + + + + + {{item1.title}} + + + {{item2.title}} + + + {{item3.title}}33 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/course/illustrate - 副本.vue b/pages/course/illustrate - 副本.vue new file mode 100644 index 0000000..f9de287 --- /dev/null +++ b/pages/course/illustrate - 副本.vue @@ -0,0 +1,226 @@ + + + + \ No newline at end of file diff --git a/pages/course/illustrate.vue b/pages/course/illustrate.vue index f9de287..b01c585 100644 --- a/pages/course/illustrate.vue +++ b/pages/course/illustrate.vue @@ -2,73 +2,78 @@ - + + + - - 点击课程名称即可查看对应的课程说明 - - - - - - - - --- {{item1.title}} - - - --- --- {{item2.title}} - - - --- --- --- {{item3.title}} + + + + + + 点击课程名称即可查看对应的课程说明 + + + + + + + + {{item1.title}} + + + {{item2.title}} + + + {{item3.title}}33 + + - - - - - - - - - - - 超强树选择器、树组件、树插件、无限级联树、单选树、多选树、自定义样式树、树形选择 - - - - - - - - - + + + + + + + + + + - + + + + + + + + + + + + @@ -92,9 +97,11 @@ // size: '100', // } treeList: [], + tagId: null, pid: null, - infopop: false, - pupContent: {}, + + courseInfo: {}, + poster:'../../static/videoF.jpg', //封面图 current: { poster: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/music-a.png', name: '致爱丽丝', @@ -103,7 +110,12 @@ }, audioAction: { method: 'pause' - } + }, + curId: null, + courseTitle: '', + showTemp:true, + videoContext:null, + videoUrl:'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4' }; }, //第一次加载 @@ -111,23 +123,84 @@ // 隐藏原生的tabbar uni.hideTabBar(); this.pid = e.pid + this.tagId = e.id console.log(e, '------') + this.videoContext = uni.createVideoContext('myVideo') }, computed: { - ...mapState(['userInfo']) - }, + ...mapState(['userInfo']), + videoHTML() { + return `` + } + }, //页面显示 onShow() { // 隐藏原生的tabbar uni.hideTabBar(); this.getData() + this.getCourseInfo(this.tagId) + }, + onUnload() { + // #ifdef APP-PLUS + plus.screen.lockOrientation('portrait-primary'); // 清除横屏 + // #endif + this.showTemp = true + this.videoContext = null + }, + onPullDownRefresh(){ + uni.stopPullDownRefresh() }, components: { // musicPlay }, //方法 methods: { - change() {}, + showDrawer(e) { + this.$refs[e].open() + this.videoContext.pause() + this.showTemp = true + console.log(5555) + }, + // 关闭窗口 + closeDrawer(e) { + this.$refs[e].close() + + }, + changeD(e, type) { + // console.log((type === 'showRight' ? '左窗口' : '右窗口') + (e ? '打开' : '关闭')); + this[type] = e + if(!e){ + this.showTemp = false + console.log('关闭弹窗') + this.videoContext.play() + } + + }, + formatRichText(html) { //控制图片大小 + let newContent = html.replace(/]*>/gi, function (match, capture) { + match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, ''); + match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, ''); + match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, ''); + return match; + }); + newContent = newContent.replace(/style="[^"]+"/gi, function (match, capture) { + match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi, + 'max-width:100%;'); + return match; + }); + newContent = newContent.replace(/]*\/>/gi, ''); + newContent = newContent.replace(/\ { if (res.code == 0 && res.course.id) { - this.pupContent = res.course + this.courseInfo = res.course + this.courseTitle = this.courseInfo.title + '课程说明' + this.curId = id + if(this.courseInfo.mediaType == 1 && this.courseInfo.media != ''){ + // this.videoUrl = this.courseInfo.media + // this.poster = this.videoUrl + + // "?x-oss-process=video/snapshot,t_0,f_jpg" + }else{ + // this.videoUrl = '' + this.poster = '' + } + + // console.log(id, 'id') } else { - this.pupContent = {} + this.courseInfo = {} + this.videoUrl = '' + this.poster = '' } }).catch(e => { - console.log(e, '报错') + this.courseInfo = {} + this.courseTitle = '' + this.curId = null + this.poster = '' + this.videoUrl = '' + console.log(e, '课程详情报错') }); - this.infopop = true + }, + clickCourseInfo(item) { + + this.getCourseInfo(item.id) + this.closeDrawer('showRight') + }, + playEnd(){ + this.showTemp = true + }, + clickToPlay(){ + this.showTemp = false + this.videoContext.play() } }, @@ -168,19 +275,22 @@ @import '@/style/mixin.scss'; ::v-deep .containerBg { - .uni-collapse-item__title-box { - background-color: transparent !important; + // .uni-collapse-item__title-box { + // background-color: transparent !important; + // } + + // .uni-collapse-item__title { + // background-image: linear-gradient(90deg, #258feb 0%, #00e1ec 100%) !important; + + // text { + // color: #fff !important; + // font-size: 28rpx !important; + // } + // } + #myVideo { + width: 100% !important; } - - .uni-collapse-item__title { - background-image: linear-gradient(90deg, #258feb 0%, #00e1ec 100%) !important; - - text { - color: #fff !important; - font-size: 28rpx !important; - } - } - + video{width: 100% !important; } } .infoBox { @@ -201,24 +311,89 @@ .uni-collapse-item__title-text { font-size: 30rpx; } - .proTitle{text-align: center; padding:20rpx 0 ; margin-bottom: 20rpx; color: #666; font-size: 28rpx;} + + .videoTemp { + position: relative; + + .u-icon { + position: absolute; + z-index: 2; + left: calc(50% - 40rpx); + top: calc(50% - 40rpx); + } + + image { + width: 100%; + } + } + + .videoTemp:before { + content: ''; + display: block; + width: 100%; + position: absolute; + left: 0; + top: 0; + height: 100%; + background-color: rgba(0, 0, 0, .5); + z-index: 1; + } + + + .proTitle { + text-align: center; + padding: 20rpx 0; + margin-top: 60rpx; + // margin-bottom: 20rpx; + color: #666; + font-size: 26rpx; + } + .sub1List { background-color: #f7f7f7; - padding-left: 20rpx; + // padding-left: 20rpx; } .content { .item { + background-color: #fff; line-height: 80rpx; - font-size: 28rpx; + font-size: 26rpx; color: #497387; - border-bottom: 1px solid #dae8f0; - } - } + // border-bottom: 1px solid #dae8f0; - #myVideo { - width: 100%; - } + text { + padding-left: 20rpx; + } + .item:last-child{ + border-bottom: 0; + } + } + + .item.active { + // background-color: #aed1ec; + color: #fff; + background-image: linear-gradient(90deg, #258feb 0%, #00e1ec 100%) !important; + } + .textss{display: inline-block; width: 100%; border-bottom: 1px solid #ebeef5;} + .leve2{ + .textss{padding-left: 20rpx;} + } + .leve2{ + .textss{padding-left: 40rpx;} + } + .leve3{ + .textss{padding-left: 60rpx;} + } + .leve4{ + .textss{padding-left: 80rpx;} + } + } + // .textss:last-child{ + // border-bottom: 0; + // } + .topRight{margin-right: 20rpx; font-size: 28rpx; display: flex;} + audio { width: 100% !important; diff --git a/pages/course/index.vue b/pages/course/index.vue index f69210e..c299c74 100644 --- a/pages/course/index.vue +++ b/pages/course/index.vue @@ -2,7 +2,7 @@ - 课程说明 + 课程说明 - + + 了解课程 @@ -301,7 +302,7 @@ padding: 0 20rpx; } - .curseSet{margin-right: 20rpx; font-size: 26rpx;} + .curseSet{margin-right: 20rpx; font-size: 28rpx; display: flex; align-items: center;} .fixed { position: fixed; z-index: 1; width: 100%; background-color: #fff; diff --git a/pages/course/outline.vue b/pages/course/outline.vue new file mode 100644 index 0000000..d510cef --- /dev/null +++ b/pages/course/outline.vue @@ -0,0 +1,183 @@ + + + + \ No newline at end of file diff --git a/pages/peanut/home.vue b/pages/peanut/home.vue index 43d8b86..cfc9458 100644 --- a/pages/peanut/home.vue +++ b/pages/peanut/home.vue @@ -4,7 +4,7 @@ - + 我的课程 +
+ + 学习大纲 +
太湖讲堂 @@ -25,11 +29,7 @@
吴门医述 -
-
- - 学习大纲 -
+
diff --git a/static/bg2.jpg b/static/bg2.jpg new file mode 100644 index 0000000..a23601b Binary files /dev/null and b/static/bg2.jpg differ diff --git a/static/homeLogo.png b/static/homeLogo.png new file mode 100644 index 0000000..465da7e Binary files /dev/null and b/static/homeLogo.png differ diff --git a/static/jianjieIcon.png b/static/jianjieIcon.png new file mode 100644 index 0000000..67d7c91 Binary files /dev/null and b/static/jianjieIcon.png differ diff --git a/static/pageBg.jpg b/static/pageBg.jpg new file mode 100644 index 0000000..76e4d34 Binary files /dev/null and b/static/pageBg.jpg differ diff --git a/static/priceIcon.png b/static/priceIcon.png new file mode 100644 index 0000000..e4b15e0 Binary files /dev/null and b/static/priceIcon.png differ diff --git a/static/shuomingIcon.png b/static/shuomingIcon.png new file mode 100644 index 0000000..4ae8d5b Binary files /dev/null and b/static/shuomingIcon.png differ diff --git a/static/videoF.jpg b/static/videoF.jpg new file mode 100644 index 0000000..a0e1627 Binary files /dev/null and b/static/videoF.jpg differ diff --git a/uni_modules/uni-drawer/changelog.md b/uni_modules/uni-drawer/changelog.md new file mode 100644 index 0000000..6d2488c --- /dev/null +++ b/uni_modules/uni-drawer/changelog.md @@ -0,0 +1,13 @@ +## 1.2.1(2021-11-22) +- 修复 vue3中个别scss变量无法找到的问题 +## 1.2.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-drawer](https://uniapp.dcloud.io/component/uniui/uni-drawer) +## 1.1.1(2021-07-30) +- 优化 vue3下事件警告的问题 +## 1.1.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.0.7(2021-05-12) +- 新增 组件示例地址 +## 1.0.6(2021-02-04) +- 调整为uni_modules目录规范 diff --git a/uni_modules/uni-drawer/components/uni-drawer/keypress.js b/uni_modules/uni-drawer/components/uni-drawer/keypress.js new file mode 100644 index 0000000..62dda46 --- /dev/null +++ b/uni_modules/uni-drawer/components/uni-drawer/keypress.js @@ -0,0 +1,45 @@ +// #ifdef H5 +export default { + name: 'Keypress', + props: { + disable: { + type: Boolean, + default: false + } + }, + mounted () { + const keyNames = { + esc: ['Esc', 'Escape'], + tab: 'Tab', + enter: 'Enter', + space: [' ', 'Spacebar'], + up: ['Up', 'ArrowUp'], + left: ['Left', 'ArrowLeft'], + right: ['Right', 'ArrowRight'], + down: ['Down', 'ArrowDown'], + delete: ['Backspace', 'Delete', 'Del'] + } + const listener = ($event) => { + if (this.disable) { + return + } + const keyName = Object.keys(keyNames).find(key => { + const keyName = $event.key + const value = keyNames[key] + return value === keyName || (Array.isArray(value) && value.includes(keyName)) + }) + if (keyName) { + // 避免和其他按键事件冲突 + setTimeout(() => { + this.$emit(keyName, {}) + }, 0) + } + } + document.addEventListener('keyup', listener) + // this.$once('hook:beforeDestroy', () => { + // document.removeEventListener('keyup', listener) + // }) + }, + render: () => {} +} +// #endif diff --git a/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue b/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue new file mode 100644 index 0000000..2471521 --- /dev/null +++ b/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue @@ -0,0 +1,183 @@ + + + + + diff --git a/uni_modules/uni-drawer/package.json b/uni_modules/uni-drawer/package.json new file mode 100644 index 0000000..dd056e4 --- /dev/null +++ b/uni_modules/uni-drawer/package.json @@ -0,0 +1,87 @@ +{ + "id": "uni-drawer", + "displayName": "uni-drawer 抽屉", + "version": "1.2.1", + "description": "抽屉式导航,用于展示侧滑菜单,侧滑导航。", + "keywords": [ + "uni-ui", + "uniui", + "drawer", + "抽屉", + "侧滑导航" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": ["uni-scss"], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uni-drawer/readme.md b/uni_modules/uni-drawer/readme.md new file mode 100644 index 0000000..dcf6e6b --- /dev/null +++ b/uni_modules/uni-drawer/readme.md @@ -0,0 +1,10 @@ + + +## Drawer 抽屉 +> **组件名:uni-drawer** +> 代码块: `uDrawer` + +抽屉侧滑菜单。 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-drawer) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file