diff --git a/src/api/common.js b/src/api/common.js index d51d705e..8570d706 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -39,6 +39,29 @@ export const uploadFile = (file, data) => { }); }; +// 对象存储下载 /traoss/tras3/show/{文件ID} +export function downloadFile(id) { + const token = getToken(); + const header = { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", + }; + if (token) + header['summary'] = token + let baseUrl = get_base_url(); + + return new Promise((resolve, reject) => { + uni.downloadFile({ + url: `${baseUrl}/traoss/tras3/show/${id}`, + header, + success(result) { + resolve(result) + }, + fail(error) { + reject(new Error(error)); + } + }); + }); +} // 对象存储预览 /traoss/tras3/show/{文件ID} export function previewFile(id, responseType = 'arraybuffer') { @@ -91,7 +114,7 @@ export function previewCacheThumbImage(id, width = 30, height = 30) { let base64 = `data:image/png;base64,` + result.data.body resolve(base64) }else{ - reject(new Error(result.data.message)) + reject({error:result.data.message}) } }, fail(error) { diff --git a/src/components/image-preview/image-preview.vue b/src/components/image-preview/image-preview.vue index cc1a7fbf..cee0bf65 100644 --- a/src/components/image-preview/image-preview.vue +++ b/src/components/image-preview/image-preview.vue @@ -52,8 +52,10 @@ this.imgUrlShow = res; }); }else{ - previewFile(id).then((res) => { - this.imgUrlShow = res; + previewFile(id).then((result) => { + let _header = result.header['content-type'].split(';')[0] + let base64 = `data:${_header};base64,` + uni.arrayBufferToBase64(result.data) + this.imgUrlShow = base64; }); } }, diff --git a/src/components/image-preview/video-preview.vue b/src/components/image-preview/video-preview.vue index 5e21bebc..253439a4 100644 --- a/src/components/image-preview/video-preview.vue +++ b/src/components/image-preview/video-preview.vue @@ -1,12 +1,13 @@ \ No newline at end of file diff --git a/src/pages/course/index.vue b/src/pages/course/index.vue index abbcc608..4bda093d 100644 --- a/src/pages/course/index.vue +++ b/src/pages/course/index.vue @@ -277,6 +277,7 @@ import { onMounted, ref, computed } from 'vue' // 跳转 课程详情 const toCourseDetail = (item) => { common.navigateTo('/pages/courseDetail/index?crsNum=' + item.crsNum) + // common.navigateTo('/pages/course/study?crsNum=' + item.crsNum) } onMounted(()=>{ getCourseTypeListApi().then(res=>{ diff --git a/src/pages/course/study.vue b/src/pages/course/study.vue index 3eb2880b..025df81a 100644 --- a/src/pages/course/study.vue +++ b/src/pages/course/study.vue @@ -1,5 +1,4 @@ diff --git a/src/static/images/course/close-active.png b/src/static/images/course/close-active.png new file mode 100644 index 00000000..f139f096 Binary files /dev/null and b/src/static/images/course/close-active.png differ diff --git a/src/static/images/course/close.png b/src/static/images/course/close.png new file mode 100644 index 00000000..080473f6 Binary files /dev/null and b/src/static/images/course/close.png differ diff --git a/src/static/images/course/talk-icon.png b/src/static/images/course/talk-icon.png new file mode 100644 index 00000000..d91cd186 Binary files /dev/null and b/src/static/images/course/talk-icon.png differ diff --git a/src/static/images/course/talking.png b/src/static/images/course/talking.png new file mode 100644 index 00000000..930e3930 Binary files /dev/null and b/src/static/images/course/talking.png differ diff --git a/src/static/images/course/to-text.png b/src/static/images/course/to-text.png new file mode 100644 index 00000000..a8c799e8 Binary files /dev/null and b/src/static/images/course/to-text.png differ diff --git a/src/uni_modules/uv-overlay/changelog.md b/src/uni_modules/uv-overlay/changelog.md new file mode 100644 index 00000000..ff147138 --- /dev/null +++ b/src/uni_modules/uv-overlay/changelog.md @@ -0,0 +1,9 @@ +## 1.0.3(2023-07-02) +uv-overlay 由于弹出层uv-transition的修改,组件内部做了相应的修改,参数不变。 +## 1.0.2(2023-06-29) +1. 优化,H5端禁止穿透滚动 +## 1.0.1(2023-05-16) +1. 优化组件依赖,修改后无需全局引入,组件导入即可使用 +2. 优化部分功能 +## 1.0.0(2023-05-10) +1. 新增uv-overlay组件 diff --git a/src/uni_modules/uv-overlay/components/uv-overlay/props.js b/src/uni_modules/uv-overlay/components/uv-overlay/props.js new file mode 100644 index 00000000..267c613f --- /dev/null +++ b/src/uni_modules/uv-overlay/components/uv-overlay/props.js @@ -0,0 +1,25 @@ +export default { + props: { + // 是否显示遮罩 + show: { + type: Boolean, + default: false + }, + // 层级z-index + zIndex: { + type: [String, Number], + default: 10070 + }, + // 遮罩的过渡时间,单位为ms + duration: { + type: [String, Number], + default: 300 + }, + // 不透明度值,当做rgba的第四个参数 + opacity: { + type: [String, Number], + default: 0.5 + }, + ...uni.$uv?.props?.overlay + } +} \ No newline at end of file diff --git a/src/uni_modules/uv-overlay/components/uv-overlay/uv-overlay.vue b/src/uni_modules/uv-overlay/components/uv-overlay/uv-overlay.vue new file mode 100644 index 00000000..53568c0d --- /dev/null +++ b/src/uni_modules/uv-overlay/components/uv-overlay/uv-overlay.vue @@ -0,0 +1,85 @@ + + + + diff --git a/src/uni_modules/uv-overlay/package.json b/src/uni_modules/uv-overlay/package.json new file mode 100644 index 00000000..a664f3a8 --- /dev/null +++ b/src/uni_modules/uv-overlay/package.json @@ -0,0 +1,88 @@ +{ + "id": "uv-overlay", + "displayName": "uv-overlay 遮罩层 全面兼容小程序、nvue、vue2、vue3等多端", + "version": "1.0.3", + "description": "uv-overlay 创建一个遮罩层,用于强调特定的页面元素,并阻止用户对遮罩下层的内容进行操作,一般用于弹窗场景,uv-popup、uv-toast、uv-tooltip等组件就是用了该组件。", + "keywords": [ + "uv-overlay", + "uvui", + "uv-ui", + "overlay", + "遮罩层" +], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "uv-ui-tools", + "uv-transition" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "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", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/src/uni_modules/uv-overlay/readme.md b/src/uni_modules/uv-overlay/readme.md new file mode 100644 index 00000000..4e8af4b8 --- /dev/null +++ b/src/uni_modules/uv-overlay/readme.md @@ -0,0 +1,11 @@ +## Overlay 遮罩层 + +> **组件名:uv-overlay** + +创建一个遮罩层,用于强调特定的页面元素,并阻止用户对遮罩下层的内容进行操作,一般用于弹窗场景,uv-popup、uv-toast、uv-tooltip等组件就是用了该组件。 + +### 查看文档 + +### [完整示例项目下载 | 关注更多组件](https://ext.dcloud.net.cn/plugin?name=uv-ui) + +#### 如使用过程中有任何问题,或者您对uv-ui有一些好的建议,欢迎加入 uv-ui 交流群:uv-ui官方QQ群 diff --git a/src/uni_modules/uv-radio/changelog.md b/src/uni_modules/uv-radio/changelog.md new file mode 100644 index 00000000..e51b1818 --- /dev/null +++ b/src/uni_modules/uv-radio/changelog.md @@ -0,0 +1,31 @@ +## 1.0.13(2023-12-19) +1. 修复在group设置labelColor不生效的BUG +## 1.0.12(2023-11-04) +1. 修复label文字较多不分行的问题 +## 1.0.11(2023-10-11) +1. 优化:https://gitee.com/climblee/uv-ui/issues/I872VD +## 1.0.10(2023-09-01) +1. 修复点击空隙处无效的问题 +2. label支持插槽下可点击 +## 1.0.9(2023-08-27) +1. 优化 +## 1.0.8(2023-08-26) +1. 修复v-model 绑定布尔值控制台报警 +## 1.0.7(2023-08-26) +1. 修复设置 labelSize 属性设置无效的问题:https://gitee.com/climblee/uv-ui/issues/I7W6UN +## 1.0.6(2023-08-04) +1. 修复name为数字0时不能选中的BUG +## 1.0.5(2023-07-13) +1. 修复 uv-radio设置value属性不生效的BUG +## 1.0.4(2023-07-05) +修复vue3模式下,动态修改v-model绑定的值无效的BUG +## 1.0.3(2023-06-06) +1. 修正语法问题 +## 1.0.2(2023-06-06) +1. uv-radio-group 兼容自定义样式customStyle,方便通过样式调整整体位置等 +2. .uv-radio-group--row增加flex-wrap: wrap;允许换行 +## 1.0.1(2023-05-16) +1. 优化组件依赖,修改后无需全局引入,组件导入即可使用 +2. 优化部分功能 +## 1.0.0(2023-05-10) +uv-radio 单选框 diff --git a/src/uni_modules/uv-radio/components/uv-radio-group/props.js b/src/uni_modules/uv-radio/components/uv-radio-group/props.js new file mode 100644 index 00000000..b0dbd15a --- /dev/null +++ b/src/uni_modules/uv-radio/components/uv-radio-group/props.js @@ -0,0 +1,89 @@ +export default { + props: { + // 绑定的值 + value: { + type: [String, Number, Boolean], + default: '' + }, + modelValue: { + type: [String, Number, Boolean], + default: '' + }, + // 是否禁用全部radio + disabled: { + type: Boolean, + default: false + }, + // 形状,circle-圆形,square-方形 + shape: { + type: String, + default: 'circle' + }, + // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值 + activeColor: { + type: String, + default: '#2979ff' + }, + // 未选中的颜色 + inactiveColor: { + type: String, + default: '#c8c9cc' + }, + // 标识符 + name: { + type: String, + default: '' + }, + // 整个组件的尺寸,默认px + size: { + type: [String, Number], + default: 18 + }, + // 布局方式,row-横向,column-纵向 + placement: { + type: String, + default: 'row' + }, + // label的文本 + label: { + type: [String], + default: '' + }, + // label的颜色 (默认 '#303133' ) + labelColor: { + type: [String], + default: '#303133' + }, + // label的字体大小,px单位 + labelSize: { + type: [String, Number], + default: 14 + }, + // 是否禁止点击文本操作checkbox(默认 false ) + labelDisabled: { + type: Boolean, + default: false + }, + // 图标颜色 + iconColor: { + type: String, + default: '#fff' + }, + // 图标的大小,单位px + iconSize: { + type: [String, Number], + default: 12 + }, + // 竖向配列时,是否显示下划线 + borderBottom: { + type: Boolean, + default: false + }, + // 图标与文字的对齐方式 + iconPlacement: { + type: String, + default: 'left' + }, + ...uni.$uv?.props?.radioGroup + } +} \ No newline at end of file diff --git a/src/uni_modules/uv-radio/components/uv-radio-group/uv-radio-group.vue b/src/uni_modules/uv-radio/components/uv-radio-group/uv-radio-group.vue new file mode 100644 index 00000000..6b3069f1 --- /dev/null +++ b/src/uni_modules/uv-radio/components/uv-radio-group/uv-radio-group.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/src/uni_modules/uv-radio/components/uv-radio/props.js b/src/uni_modules/uv-radio/components/uv-radio/props.js new file mode 100644 index 00000000..1e5e2ac8 --- /dev/null +++ b/src/uni_modules/uv-radio/components/uv-radio/props.js @@ -0,0 +1,65 @@ +export default { + props: { + // radio的名称 + name: { + type: [String, Number, Boolean], + default: '' + }, + // 形状,square为方形,circle为圆型 + shape: { + type: String, + default: '' + }, + // 是否禁用 + disabled: { + type: [String, Boolean], + default: '' + }, + // 是否禁止点击提示语选中单选框 + labelDisabled: { + type: [String, Boolean], + default: '' + }, + // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值 + activeColor: { + type: String, + default: '' + }, + // 未选中的颜色 + inactiveColor: { + type: String, + default: '' + }, + // 图标的大小,单位px + iconSize: { + type: [String, Number], + default: '' + }, + // label的字体大小,px单位 + labelSize: { + type: [String, Number], + default: '' + }, + // label提示文字,因为nvue下,直接slot进来的文字,由于特殊的结构,无法修改样式 + label: { + type: [String, Number, Boolean], + default: '' + }, + // 整体的大小 + size: { + type: [String, Number], + default: '' + }, + // 图标颜色 + iconColor: { + type: String, + default: '' + }, + // label的颜色 + labelColor: { + type: String, + default: '' + }, + ...uni.$uv?.props?.radio + } +} \ No newline at end of file diff --git a/src/uni_modules/uv-radio/components/uv-radio/uv-radio.vue b/src/uni_modules/uv-radio/components/uv-radio/uv-radio.vue new file mode 100644 index 00000000..3c0236c1 --- /dev/null +++ b/src/uni_modules/uv-radio/components/uv-radio/uv-radio.vue @@ -0,0 +1,348 @@ + + + + \ No newline at end of file diff --git a/src/uni_modules/uv-radio/package.json b/src/uni_modules/uv-radio/package.json new file mode 100644 index 00000000..e7892460 --- /dev/null +++ b/src/uni_modules/uv-radio/package.json @@ -0,0 +1,88 @@ +{ + "id": "uv-radio", + "displayName": "uv-radio 单选框 全面兼容vue3+2、app、h5、小程序等多端", + "version": "1.0.13", + "description": "uv-radio 单选框用于有一个选择,用户只能选择其中一个的场景。", + "keywords": [ + "uv-radio", + "uvui", + "uv-ui", + "radio", + "单选框" +], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "uv-ui-tools", + "uv-icon" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "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", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/src/uni_modules/uv-radio/readme.md b/src/uni_modules/uv-radio/readme.md new file mode 100644 index 00000000..c8268984 --- /dev/null +++ b/src/uni_modules/uv-radio/readme.md @@ -0,0 +1,19 @@ +## Radio 单选框 + +> **组件名:uv-radio** + +单选框用于有一个选择,用户只能选择其中一个的场景。 + +# 查看文档 + +## [下载完整示例项目](https://ext.dcloud.net.cn/plugin?name=uv-ui) (请不要 下载插件ZIP) + +### [更多插件,请关注uv-ui组件库](https://ext.dcloud.net.cn/plugin?name=uv-ui) + + + +![image](https://mp-a667b617-c5f1-4a2d-9a54-683a67cff588.cdn.bspapp.com/uv-ui/banner.png) + + + +#### 如使用过程中有任何问题反馈,或者您对uv-ui有一些好的建议,欢迎加入uv-ui官方交流群:官方QQ群 \ No newline at end of file