diff --git a/.local.config.js.example b/.local.config.js.example
index 28cf028..6386cb0 100644
--- a/.local.config.js.example
+++ b/.local.config.js.example
@@ -38,6 +38,10 @@ const localDevConfig = ({
uniacid: 1,
domain: 'https://test.aigc-quickapp.com',
},
+ 'local-2': { // 测试平台
+ uniacid: 2,
+ domain: 'http://localhost:8050/',
+ },
})['2811']; // 选择要使用的环境配置
export default localDevConfig;
\ No newline at end of file
diff --git a/common/js/share.js b/common/js/share.js
new file mode 100644
index 0000000..65924c9
--- /dev/null
+++ b/common/js/share.js
@@ -0,0 +1,100 @@
+// 文件分享工具函数
+export default {
+ /**
+ * 生成文件预览链接
+ * @param {Object} file - 文件对象,包含 name 和 url 属性
+ * @returns {string} - 生成的文件预览链接
+ */
+ generateFilePreviewUrl(file) {
+ // 推断文件类型
+ let fileType = '';
+ if (file.name) {
+ const ext = file.name.split('.').pop().toLowerCase();
+ if (['pdf'].includes(ext)) {
+ fileType = 'pdf';
+ } else if (['doc', 'docx'].includes(ext)) {
+ fileType = 'word';
+ } else if (['mp4', 'avi', 'mov', 'wmv', 'flv', 'mkv'].includes(ext)) {
+ fileType = 'video';
+ }
+ }
+
+ // 构建文件预览链接
+ const previewUrl = `/pages_tool/file-preview/file-preview?fileName=${encodeURIComponent(file.name)}&fileUrl=${encodeURIComponent(file.url || '')}&fileType=${encodeURIComponent(fileType)}`;
+ return previewUrl;
+ },
+
+ /**
+ * 分享文件
+ * @param {Object} file - 文件对象,包含 name 和 url 属性
+ * @param {string} title - 分享标题,默认使用文件名
+ * @param {string} desc - 分享描述,默认使用固定文案
+ */
+ shareFile(file, title = file.name, desc = '查看企业文件:' + file.name) {
+ // 生成文件预览链接
+ const filePreviewUrl = this.generateFilePreviewUrl(file);
+
+ // #ifdef H5
+ // H5 平台分享
+ if (navigator.share) {
+ // 使用 Web Share API
+ navigator.share({
+ title: title,
+ text: desc,
+ url: filePreviewUrl
+ }).catch(err => {
+ console.error('分享失败:', err);
+ uni.showToast({ title: '分享失败', icon: 'none' });
+ });
+ } else {
+ // 不支持 Web Share API 的浏览器
+ uni.setClipboardData({
+ data: filePreviewUrl,
+ success: () => {
+ uni.showToast({ title: '链接已复制,请粘贴分享', icon: 'success' });
+ },
+ fail: () => {
+ uni.showToast({ title: '复制失败', icon: 'none' });
+ }
+ });
+ }
+ // #endif
+
+ // #ifdef MP-WEIXIN
+ // 微信小程序分享
+ uni.showActionSheet({
+ itemList: ['发送给朋友', '分享到朋友圈'],
+ success: (res) => {
+ if (res.tapIndex === 0) {
+ // 发送给朋友
+ uni.shareAppMessage({
+ title: title,
+ path: filePreviewUrl,
+ success: () => {
+ uni.showToast({ title: '分享成功', icon: 'success' });
+ },
+ fail: () => {
+ uni.showToast({ title: '分享失败', icon: 'none' });
+ }
+ });
+ } else if (res.tapIndex === 1) {
+ // 分享到朋友圈
+ uni.shareTimeline({
+ title: desc,
+ path: filePreviewUrl,
+ success: () => {
+ uni.showToast({ title: '分享成功', icon: 'success' });
+ },
+ fail: () => {
+ uni.showToast({ title: '分享失败', icon: 'none' });
+ }
+ });
+ }
+ },
+ fail: () => {
+ // 用户取消分享
+ }
+ });
+ // #endif
+ }
+};
\ No newline at end of file
diff --git a/common/js/util.js b/common/js/util.js
index 8fc002c..24036f4 100644
--- a/common/js/util.js
+++ b/common/js/util.js
@@ -94,7 +94,7 @@ export const checkTabBarActive = (linkUrl, currentPageRoute) => {
const currentPageRouteParts = currentPageRoute.split('/');
// console.log('diy-bottom-nav verify:', { linkUrlParts, currentPageRouteParts});
-
+
try {
// 二级页面
if (linkUrlParts[2] === currentPageRouteParts[2]) {
@@ -655,7 +655,6 @@ export default {
} else if (link.appid) {
// 跳转其他小程序
-
uni.navigateToMiniProgram({
appId: link.appid,
path: link.page
@@ -663,7 +662,6 @@ export default {
} else if (link.name == 'MOBILE' && !link.wap_url) {
// 拨打电话
-
uni.makePhoneCall({
phoneNumber: link.mobile,
success: (res) => {
@@ -1210,7 +1208,7 @@ export default {
// 但是会包含uniacid参数,所以这里通过uniacid参数来判断是否为快应用环境
_isQuickApp = ua.indexOf('uniacid=') !== -1;
}
- } catch (e) {}
+ } catch (e) { }
if (!_isQuickApp) {
const systemInfo = this.getDeviceInfo();
@@ -1230,9 +1228,36 @@ export default {
// #ifndef QUICKAPP-WEBVIEW-HUAWEI
const systemInfo = this.getDeviceInfo();
- return systemInfo.brand === 'HUAWEI' || systemInfo.manufacturer === 'HUAWEI' ||
- (typeof qh !== 'undefined' && qh.platform === 'huawei');
+ return systemInfo.brand === 'HUAWEI' || systemInfo.manufacturer === 'HUAWEI' ||
+ (typeof qh !== 'undefined' && qh.platform === 'huawei');
// #endif
return true;
+ },
+
+ /**
+ * 蛇形命名转驼峰命名
+ * @param {string} str 蛇形命名字符串
+ * @returns {string} 驼峰命名字符串
+ */
+ snakeToCamel(str) {
+ return str.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
+ },
+
+ /**
+ * 蛇形命名转驼峰命名(递归处理对象中的所有属性名)
+ * @param {Object} obj 包含蛇形命名字符串属性的对象
+ * @returns {Object} 驼峰命名字符串属性的对象
+ */
+ snakeToCamelForObj(obj) {
+ if (typeof obj !== 'object' || obj === null) return obj;
+ if (Array.isArray(obj)) return obj.map(this.snakeToCamelForObj.bind(this));
+ const newObj = {};
+ for (const key in obj) {
+ if (Object.hasOwnProperty.call(obj, key)) {
+ const newKey = this.snakeToCamel(key);
+ newObj[newKey] = this.snakeToCamelForObj(obj[key]);
+ }
+ }
+ return newObj;
}
}
\ No newline at end of file
diff --git a/components-diy/css/common-channel.scss b/components-diy/css/common-channel.scss
new file mode 100644
index 0000000..8a1cad6
--- /dev/null
+++ b/components-diy/css/common-channel.scss
@@ -0,0 +1,143 @@
+// 公共微信视频号样式
+
+// CSS 变量
+:root {
+ // 尺寸变量
+ --channel-play-btn-size: 80rpx;
+ --channel-play-btn-small-size: 60rpx;
+ --channel-play-btn-icon-size: 40rpx;
+ --channel-play-btn-icon-small-size: 30rpx;
+ --channel-border-radius: 12rpx;
+ --channel-stats-padding: 10rpx;
+ --channel-info-wrap-padding: 10rpx 0;
+
+ // 字体变量
+ --channel-name-font-size: 28rpx;
+ --video-title-font-size: 28rpx;
+ --video-title-small-font-size: 24rpx;
+ --video-stats-font-size: 24rpx;
+ --channel-stats-font-size: 20rpx;
+
+ // 颜色变量
+ --channel-name-color: #333;
+ --video-title-color: #333;
+ --video-title-small-color: #666;
+ --video-stats-color: #999;
+ --channel-stats-color: #fff;
+ --channel-border-color: #f0f0f0;
+ --channel-play-btn-bg: rgba(0, 0, 0, 0.4);
+ --channel-stats-bg: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
+
+ // 间距变量
+ --channel-name-margin-bottom: 4rpx;
+ --video-title-margin-bottom: 8rpx;
+}
+
+// 响应式设计
+@media (max-width: 375px) {
+ :root {
+ --channel-play-btn-size: 70rpx;
+ --channel-play-btn-small-size: 50rpx;
+ --channel-play-btn-icon-size: 35rpx;
+ --channel-play-btn-icon-small-size: 25rpx;
+ --channel-name-font-size: 24rpx;
+ --video-title-font-size: 24rpx;
+ }
+}
+
+@media (min-width: 750px) {
+ :root {
+ --channel-play-btn-size: 90rpx;
+ --channel-play-btn-small-size: 70rpx;
+ --channel-play-btn-icon-size: 45rpx;
+ --channel-play-btn-icon-small-size: 35rpx;
+ --channel-name-font-size: 32rpx;
+ --video-title-font-size: 32rpx;
+ }
+}
+
+// 播放按钮样式
+.channel-play-btn {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: var(--channel-play-btn-size);
+ height: var(--channel-play-btn-size);
+ background-color: var(--channel-play-btn-bg);
+ border-radius: 50%;
+
+ .play-icon {
+ width: var(--channel-play-btn-icon-size);
+ height: var(--channel-play-btn-icon-size);
+ }
+}
+
+// 小尺寸播放按钮(用于列表)
+.channel-play-btn.small {
+ width: var(--channel-play-btn-small-size);
+ height: var(--channel-play-btn-small-size);
+
+ .play-icon {
+ width: var(--channel-play-btn-icon-small-size);
+ height: var(--channel-play-btn-icon-small-size);
+ }
+}
+
+// 视频统计信息
+.channel-stats {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background: var(--channel-stats-bg);
+ padding: var(--channel-stats-padding);
+ color: var(--channel-stats-color);
+ font-size: var(--channel-stats-font-size);
+}
+
+// 视频信息容器
+.channel-info-wrap {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ padding: var(--channel-info-wrap-padding);
+
+ .channel-name {
+ margin-bottom: var(--channel-name-margin-bottom);
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ font-size: var(--channel-name-font-size);
+ font-weight: 500;
+ color: var(--channel-name-color);
+ }
+
+ .video-title {
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ font-size: var(--video-title-small-font-size);
+ color: var(--video-title-small-color);
+ }
+}
+
+// 视频标题
+.video-title {
+ font-size: var(--video-title-font-size);
+ font-weight: 500;
+ color: var(--video-title-color);
+ margin-bottom: var(--video-title-margin-bottom);
+ line-height: 1.4;
+}
+
+// 视频统计信息(非绝对定位版本)
+.video-stats {
+ font-size: var(--video-stats-font-size);
+ color: var(--video-stats-color);
+}
+
+
diff --git a/components-diy/diy-article.vue b/components-diy/diy-article.vue
index 5539a1b..2f4097a 100644
--- a/components-diy/diy-article.vue
+++ b/components-diy/diy-article.vue
@@ -3,7 +3,7 @@
-
diff --git a/components-diy/diy-channel-list.vue b/components-diy/diy-channel-list.vue
new file mode 100644
index 0000000..a7b582f
--- /dev/null
+++ b/components-diy/diy-channel-list.vue
@@ -0,0 +1,645 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components-diy/diy-channel-video.vue b/components-diy/diy-channel-video.vue
new file mode 100644
index 0000000..66d1061
--- /dev/null
+++ b/components-diy/diy-channel-video.vue
@@ -0,0 +1,489 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ value.videoTitle }}
+
+
+ {{ value.viewCount }}次观看
+
+
+
+
+
+
+
+
+
+
+
+ {{ value.viewCount }}次观看
+
+
+
+
+ {{ value.videoTitle }}
+
+
+ {{ value.viewCount }}次观看
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components-diy/diy-group.vue b/components-diy/diy-group.vue
index 16eebc3..6de5241 100644
--- a/components-diy/diy-group.vue
+++ b/components-diy/diy-group.vue
@@ -251,14 +251,9 @@
-
-
-
-
-
-
-
-
+
+
+
diff --git a/components-diy/diy-wechat-channel-list.vue b/components-diy/diy-wechat-channel-list.vue
deleted file mode 100644
index 52b974d..0000000
--- a/components-diy/diy-wechat-channel-list.vue
+++ /dev/null
@@ -1,458 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- {{ item.viewCount }}次观看
-
-
-
- {{ item.channelName }}
- {{ item.videoTitle }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.viewCount }}次观看
-
-
- {{ item.videoTitle }}
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/components-diy/diy-wechat-channel.vue b/components-diy/diy-wechat-channel.vue
deleted file mode 100644
index f1dc278..0000000
--- a/components-diy/diy-wechat-channel.vue
+++ /dev/null
@@ -1,232 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ value.videoTitle }}
-
- {{ value.viewCount }}次观看
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/components-diy/js/wechat-channel.js b/components-diy/js/wechat-channel.js
new file mode 100644
index 0000000..30457ed
--- /dev/null
+++ b/components-diy/js/wechat-channel.js
@@ -0,0 +1,188 @@
+// 微信视频号组件配置
+export const wechatChannelConfig = {
+ // 图标相关
+ icon: {
+ defaultSize: 80, // 默认图标尺寸(rpx)
+ smallSize: 60, // 小图标尺寸(rpx)
+ channelArrowSize: 24, // 频道箭头图标尺寸(rpx)
+ channelArrow: 'addon/personnel/shop/view/enterprise/arrow.png', // 频道箭头图标路径
+ },
+
+
+ // 视频相关配置
+ video: {
+ defaultHeight: 320, // 默认视频高度(rpx)
+ minHeight: 200, // 最小视频高度(rpx)
+ maxHeight: 500, // 最大视频高度(rpx)
+ defaultCoverUrl: 'addon/personnel/shop/view/enterprise/default-video-cover.png', // 默认视频封面
+ },
+
+ // 播放按钮配置
+ playButton: {
+ size: 80, // 标准尺寸(rpx)
+ smallSize: 60, // 小尺寸(rpx)
+ iconSize: 40, // 标准图标尺寸(rpx)
+ smallIconSize: 30, // 小图标尺寸(rpx)
+ background: 'rgba(0, 0, 0, 0.4)', // 背景颜色
+ },
+
+ // 布局配置
+ layout: {
+ borderRadius: 12, // 圆角(rpx)
+ padding: 16, // 内边距(rpx)
+ margin: 10, // 外边距(rpx)
+ },
+
+ // 字体配置
+ font: {
+ channelNameSize: 28, // 频道名称字体大小(rpx)
+ videoTitleSize: 28, // 视频标题字体大小(rpx)
+ statsSize: 24, // 统计信息字体大小(rpx)
+ },
+
+ // 颜色配置
+ color: {
+ channelName: '#333', // 频道名称颜色
+ videoTitle: '#333', // 视频标题颜色
+ stats: '#999', // 统计信息颜色
+ border: '#f0f0f0', // 边框颜色
+ },
+
+ // 微信相关配置
+ wechat: {
+ minSdkVersion: '2.19.2', // 最小微信基础库版本
+ embedComponent: 'channel-video', // 嵌入式视频组件名称
+ },
+
+ // 错误提示配置
+ error: {
+ notWechat: '当前环境不是微信小程序',
+ lowVersion: '当前微信基础库版本过低,需要 2.19.2 或以上版本',
+ notSupported: '当前环境不支持微信视频号',
+ missingFields: '缺少必要字段: {field}',
+ },
+};
+
+// 获取配置项的辅助函数
+export const getwechatChannelConfig = (key, defaultValue = null) => {
+ const keys = key.split('.');
+ let config = wechatChannelConfig;
+
+ for (const k of keys) {
+ if (config[k] === undefined) {
+ return defaultValue;
+ }
+ config = config[k];
+ }
+
+ return config;
+};
+
+// 微信视频号工具函数
+export const wechatChannelUtil = {
+ // 版本比较
+ versionCompare(v1, v2) {
+ const arr1 = v1.split('.');
+ const arr2 = v2.split('.');
+ for (let i = 0; i < Math.max(arr1.length, arr2.length); i++) {
+ const num1 = parseInt(arr1[i] || 0);
+ const num2 = parseInt(arr2[i] || 0);
+ if (num1 > num2) return 1;
+ if (num1 < num2) return -1;
+ }
+ return 0;
+ },
+
+ // 检查是否支持嵌入式播放
+ isEmbedModeSupported() {
+ return typeof wx !== 'undefined' && wx.canIUse(wechatChannelConfig.wechat.embedComponent);
+ },
+
+ // 获取默认视频封面
+ getDefaultCoverUrl() {
+ return wechatChannelConfig.video.defaultCoverUrl;
+ },
+
+ // 数据校验
+ validateVideoData(item) {
+ const requiredFields = ['feedId', 'finderUserName'];
+ for (const field of requiredFields) {
+ if (!item[field]) {
+ throw new Error(`缺少必要字段: ${field}`);
+ }
+ }
+ return true;
+ },
+
+ // 播放视频
+ playVideo(item) {
+ return new Promise((resolve, reject) => {
+ try {
+ // 数据校验
+ this.validateVideoData(item);
+ } catch (err) {
+ this.handleError(err, item);
+ reject(err);
+ return;
+ }
+
+ // 检查微信环境
+ if (typeof wx === 'undefined') {
+ const err = new Error(wechatChannelConfig.error.notWechat);
+ this.handleError(err, item);
+ reject(err);
+ return;
+ }
+
+ // 检查基础库版本
+ const systemInfo = wx.getSystemInfoSync();
+ const SDKVersion = systemInfo.SDKVersion;
+ if (this.versionCompare(SDKVersion, wechatChannelConfig.wechat.minSdkVersion) < 0) {
+ const err = new Error(wechatChannelConfig.error.lowVersion);
+ this.handleError(err, item);
+ reject(err);
+ return;
+ }
+
+ // 调用微信视频号播放API
+ if (wx.openChannelsActivity) {
+ wx.openChannelsActivity({
+ feedId: item.feedId,
+ finderUserName: item.finderUserName,
+ success: (res) => {
+ console.log('打开视频号成功', res);
+ resolve(res);
+ },
+ fail: (err) => {
+ this.handleError(err, item);
+ reject(err);
+ }
+ });
+ } else {
+ const err = new Error(wechatChannelConfig.error.notSupported);
+ this.handleError(err, item);
+ reject(err);
+ }
+ });
+ },
+
+ // 统一错误处理
+ handleError(err, item) {
+ console.error('微信视频号错误:', err);
+ const { message = '', errMsg = '微信视频播放失败!', errCode = -1 } = err;
+
+ // 错误码5: 表示用户点击了取消. openChannelsActivity:fail cancel
+ if ([5].includes(errCode)) {
+ return;
+ }
+
+ const showErrorToast = (otherMsgs = []) => {
+ uni.showToast({
+ title: [errMsg, message,...otherMsgs].join('\n'),
+ icon: 'none',
+ duration: 2000
+ });
+ }
+ showErrorToast();
+ }
+};
\ No newline at end of file
diff --git a/components/ns-video-player-popup/ns-video-player-popup.vue b/components/ns-video-player-popup/ns-video-player-popup.vue
new file mode 100644
index 0000000..774b25f
--- /dev/null
+++ b/components/ns-video-player-popup/ns-video-player-popup.vue
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/WECHAT_CHANNEL_INTEGRATION.md b/docs/WECHAT_CHANNEL_INTEGRATION.md
index dfd987e..bb19a67 100644
--- a/docs/WECHAT_CHANNEL_INTEGRATION.md
+++ b/docs/WECHAT_CHANNEL_INTEGRATION.md
@@ -102,58 +102,83 @@
## 3. 组件使用
-### 3.1 单个视频号组件 (diy-wechat-channel.vue)
+### 3.1 视频号视频卡片组件 (diy-channel-video.vue)
#### 基本用法
```vue
-
+
```
#### 属性说明
| 属性名 | 类型 | 默认值 | 说明 |
|--------|------|--------|------|
-| channelName | String | "" | 视频号名称 |
-| avatarUrl | String | "" | 视频号头像URL |
+| value | Object | 必填 | 视频数据对象 |
+| listMode | Boolean | false | 是否为列表模式 |
+| videoHeight | Number | 220 | 视频高度(仅适用于嵌入式播放) |
+| titleLineClamp | Number | 1 | 标题显示行数 |
+| showPlayBtn | Boolean | true | 是否显示播放按钮 |
+| aspectRatio | String | '16:9' | 视频比例,可选值:'16:9', '3:4' |
+| coverStyle | Object | {} | 视频封面图样式 |
+| playBtnStyle | Object | {} | 播放按钮样式 |
+| autoPlay | Boolean | false | 是否自动播放(仅适用于嵌入式播放) |
+
+#### value对象属性说明
+
+| 属性名 | 类型 | 默认值 | 说明 |
+|--------|------|--------|------|
+| feedId | String | "" | 视频 feedId |
+| finderUserName | String | "" | 视频号用户名 |
+| feedToken | String | "" | 视频 token |
+| coverUrl | String | "" | 视频封面图 |
| videoTitle | String | "" | 视频标题 |
-| coverUrl | String | "" | 视频封面URL |
-| feedId | String | "" | 视频号内容ID,用于播放视频 |
-| viewCount | Number | 0 | 视频观看次数 |
-| showFollow | Boolean | false | 是否显示关注按钮 |
-| componentAngle | String | "" | 组件圆角类型,可选值:round |
-| topAroundRadius | Number | 0 | 顶部圆角半径 |
-| bottomAroundRadius | Number | 0 | 底部圆角半径 |
+| viewCount | Number | 0 | 观看次数 |
+| showViewCount | Boolean | false | 是否显示观看次数 |
+| embedMode | Boolean | false | 是否启用嵌入式播放 |
#### 事件说明
| 事件名 | 说明 | 参数 |
|--------|------|------|
-| channel-tap | 点击视频号头像或名称时触发 | 视频号数据对象 |
-| video-play | 点击视频播放时触发 | 视频号数据对象 |
+| video-play | 点击视频播放时触发 | 视频数据对象 |
-### 3.2 视频号列表组件 (diy-wechat-channel-list.vue)
+### 3.2 视频号列表组件 (diy-channel-list.vue)
#### 基本用法
```vue
-
+
```
#### 属性说明
| 属性名 | 类型 | 默认值 | 说明 |
|--------|------|--------|------|
-| list | Array | [] | 视频号列表数据 |
-| rowCount | Number | 2 | 每行显示的视频号数量 |
-| showStyle | String | "fixed" | 显示样式,可选值:fixed, singleSlide |
-| mode | String | "" | 显示模式 |
-| font | Object | {} | 字体样式配置 |
-| componentBgColor | String | "#fff" | 组件背景颜色 |
-| componentAngle | String | "" | 组件圆角类型,可选值:round |
-| topAroundRadius | Number | 0 | 顶部圆角半径 |
-| bottomAroundRadius | Number | 0 | 底部圆角半径 |
-| ornament | Object | {} | 装饰样式配置 |
+| value | Object | 必填 | 组件配置数据 |
+| value.list | Array | [] | 视频号列表数据 |
+| value.rowCount | Number | 2 | 每行显示的视频号数量 |
+| value.showStyle | String | "fixed" | 显示样式,可选值:fixed, singleSlide |
+| value.mode | String | "" | 显示模式 |
+| value.font | Object | {} | 字体样式配置 |
+| value.componentBgColor | String | "#fff" | 组件背景颜色 |
+| value.componentAngle | String | "" | 组件圆角类型,可选值:round |
+| value.topAroundRadius | Number | 0 | 顶部圆角半径 |
+| value.bottomAroundRadius | Number | 0 | 底部圆角半径 |
+| value.ornament | Object | {} | 装饰样式配置 |
+| value.titleLineClamp | Number | 1 | 标题显示行数 |
+| value.showPlayBtn | Boolean | true | 是否显示播放按钮 |
+| value.aspectRatio | String | '16:9' | 视频比例,可选值:'16:9', '3:4' |
+| value.coverStyle | Object | {} | 视频封面图样式 |
+| value.playBtnStyle | Object | {} | 播放按钮样式 |
+| value.imageSize | Number | 0 | 图片尺寸(仅在特定模式下使用) |
+| value.pageCount | Number | 1 | 每页显示的视频数量 |
+| value.carousel | Object | {} | 轮播配置 |
+| value.carousel.type | String | "" | 轮播类型,可选值:default, hide |
+| value.carousel.autoplay | Boolean | false | 是否自动播放 |
+| value.carousel.interval | Number | 3000 | 自动播放间隔,单位毫秒 |
+| value.carousel.duration | Number | 500 | 切换动画时长,单位毫秒 |
+| value.carousel.circular | Boolean | false | 是否循环播放 |
#### list数组项说明
@@ -164,6 +189,10 @@
| videoTitle | String | "" | 视频标题 |
| feedId | String | "" | 视频号内容ID,用于播放视频 |
| viewCount | Number | 0 | 视频观看次数 |
+| embedMode | Boolean | false | 是否启用嵌入式播放 |
+| showViewCount | Boolean | false | 是否显示观看次数 |
+| finderUserName | String | "" | 视频号ID,用于嵌入式播放 |
+| feedToken | String | "" | 视频token,用于嵌入式播放 |
## 4. 视频播放实现
@@ -290,7 +319,19 @@ if (typeof wx !== 'undefined' && wx.openChannelsActivity) {
- 头像:200x200px
- 封面:640x360px
-### 5.4 权限和关联
+### 5.4 播放按钮图标
+
+- 组件支持两种播放按钮图标方式:
+ 1. **图片图标**:通过 `playIcon` 属性设置,优先级较高
+ 2. **纯 CSS 图标**:当 `playIcon` 不可用时,组件会自动使用纯 CSS 生成的播放图标,确保播放按钮始终可见
+
+- 纯 CSS 图标特点:
+ - 不依赖外部图片资源,加载更快
+ - 支持响应式调整大小
+ - 具有与图片图标相同的悬停效果
+ - 在所有环境中都能正常显示
+
+### 5.5 权限和关联
- 确保在微信小程序后台开通了「打开视频号内容」权限
- 确保小程序已与视频号成功关联
@@ -331,6 +372,7 @@ if (typeof wx !== 'undefined' && wx.openChannelsActivity) {
- 可通过组件的 `componentAngle`、`topAroundRadius`、`bottomAroundRadius` 等属性调整组件样式
- 可通过 `componentBgColor` 属性调整组件背景颜色
- 可通过 `font` 属性调整字体样式
+- 可通过 `aspectRatio` 属性调整视频比例,支持 '16:9' 和 '3:4' 两种比例
### 6.6 环境兼容性问题
@@ -392,25 +434,66 @@ if (typeof wx !== 'undefined' && wx.openChannelsActivity) {
## 7. 示例代码
-### 7.1 单个视频号示例
+### 7.1 视频号视频卡片组件示例
+
+```javascript
+// 视频卡片数据
+const videoData = {
+ channelName: "示例视频号",
+ coverUrl: "https://example.com/cover.jpg",
+ videoTitle: "这是一个示例视频,标题可能会很长,需要测试多行显示效果",
+ feedId: "v02004g10000c3f7l7j5u87l33n8f160",
+ viewCount: 12345,
+ embedMode: false,
+ showViewCount: true,
+ finderUserName: "example_finder",
+ feedToken: "example_feed_token"
+};
+
+// 视频播放事件处理
+function handlerVideoPlay(data) {
+ console.log("视频播放", data);
+ // 可以在这里处理视频播放逻辑
+}
+```
+
+### 7.2 单个视频号示例
```javascript
// 单个视频号数据
const channelData = {
channelName: "示例视频号",
avatarUrl: "https://example.com/avatar.jpg",
- videoTitle: "这是一个示例视频",
+ videoTitle: "这是一个示例视频,标题可能会很长,需要测试多行显示效果",
coverUrl: "https://example.com/cover.jpg",
feedId: "v02004g10000c3f7l7j5u87l33n8f160",
viewCount: 12345,
showFollow: true,
componentAngle: "round",
topAroundRadius: 10,
- bottomAroundRadius: 10
+ bottomAroundRadius: 10,
+ embedMode: false,
+ showViewCount: true,
+ finderUserName: "example_finder",
+ feedToken: "example_feed_token",
+ titleLineClamp: 2,
+ showPlayBtn: true,
+ aspectRatio: "16:9",
+ coverStyle: {
+ width: "100%",
+ height: "0",
+ paddingTop: "56.25%" // 16:9 比例
+ },
+ playBtnStyle: {
+ width: "60rpx",
+ height: "60rpx",
+ borderRadius: "30rpx",
+ backgroundColor: "rgba(0, 0, 0, 0.6)"
+ }
};
```
-### 7.2 视频号列表示例
+### 7.3 视频号列表示例
```javascript
// 视频号列表数据
@@ -419,20 +502,29 @@ const channelListData = {
{
channelName: "示例视频号1",
coverUrl: "https://example.com/cover1.jpg",
- videoTitle: "这是示例视频1",
+ videoTitle: "这是示例视频1,标题可能会很长,需要测试多行显示效果",
feedId: "v02004g10000c3f7l7j5u87l33n8f160",
- viewCount: 12345
+ viewCount: 12345,
+ embedMode: false,
+ showViewCount: true,
+ finderUserName: "example_finder1",
+ feedToken: "example_feed_token1"
},
{
channelName: "示例视频号2",
coverUrl: "https://example.com/cover2.jpg",
- videoTitle: "这是示例视频2",
+ videoTitle: "这是示例视频2,标题可能会很长,需要测试多行显示效果",
feedId: "v02004g10000c3f7m7j5u87l33n8f161",
- viewCount: 67890
+ viewCount: 67890,
+ embedMode: false,
+ showViewCount: true,
+ finderUserName: "example_finder2",
+ feedToken: "example_feed_token2"
}
],
rowCount: 2,
showStyle: "fixed",
+ mode: "",
font: {
size: 14,
weight: "normal",
@@ -441,7 +533,31 @@ const channelListData = {
componentBgColor: "#fff",
componentAngle: "round",
topAroundRadius: 10,
- bottomAroundRadius: 10
+ bottomAroundRadius: 10,
+ ornament: {},
+ titleLineClamp: 2,
+ showPlayBtn: true,
+ aspectRatio: "16:9",
+ coverStyle: {
+ width: "100%",
+ height: "0",
+ paddingTop: "56.25%" // 16:9 比例
+ },
+ playBtnStyle: {
+ width: "60rpx",
+ height: "60rpx",
+ borderRadius: "30rpx",
+ backgroundColor: "rgba(0, 0, 0, 0.6)"
+ },
+ imageSize: 150,
+ pageCount: 1,
+ carousel: {
+ type: "default",
+ autoplay: true,
+ interval: 3000,
+ duration: 500,
+ circular: true
+ }
};
```
diff --git a/manifest.json b/manifest.json
index 0873c23..1b405e6 100644
--- a/manifest.json
+++ b/manifest.json
@@ -66,6 +66,7 @@
"minified" : true
},
"usingComponents" : true,
+ "lazyCodeLoading": "requiredComponents",
"permission" : {
"scope.userLocation" : {
"desc" : "为了更好地为您提供服务"
diff --git a/pages.json b/pages.json
index 4405045..5513174 100644
--- a/pages.json
+++ b/pages.json
@@ -912,16 +912,22 @@
},
//******************文件模块******************
{
- "path": "files/list",
- "style": {
- // #ifdef APP-PLUS
- "navigationStyle": "custom",
- // #endif
- "navigationBarTitleText": "查看文件"
- }
+ "path": "files/list",
+ "style": {
+ // #ifdef APP-PLUS
+ "navigationStyle": "custom",
+ // #endif
+ "navigationBarTitleText": "查看文件"
}
- ]
- }
+ },
+ {
+ "path": "file-preview/file-preview",
+ "style": {
+ "navigationBarTitleText": "文件预览"
+ }
+ }
+ ]
+ }
],
"globalStyle": {
"navigationBarTextStyle": "black",
diff --git a/pages_tool/contact/contact.vue b/pages_tool/contact/contact.vue
index 70ae2b0..3a30e12 100644
--- a/pages_tool/contact/contact.vue
+++ b/pages_tool/contact/contact.vue
@@ -4,6 +4,7 @@
+
-
@@ -33,6 +33,8 @@
+
+
@@ -64,20 +66,50 @@
-
+
+
+
+ 企业文件
+
+
+
+
+ {{ file.name }}
+
+
+
+
+
+
+
+
+
+ 企业视频
+
+
+
+
+
+
+ {{ video.title }}
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
@@ -166,19 +186,49 @@
+
+
+
+
+
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue
index 699aa63..6245625 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue
@@ -13,7 +13,7 @@