From 7f5466662946584edaf034c96014e8b8fd180279 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Sat, 10 Jan 2026 13:44:50 +0800
Subject: [PATCH 01/38] =?UTF-8?q?chore(util):=20=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E8=9B=87=E5=BD=A2=E5=91=BD=E5=90=8D=E8=BD=AC=E9=A9=BC=E5=B3=B0?=
=?UTF-8?q?=E5=91=BD=E5=90=8D=EF=BC=88=E9=80=92=E5=BD=92=E5=A4=84=E7=90=86?=
=?UTF-8?q?=E5=AF=B9=E8=B1=A1=E4=B8=AD=E7=9A=84=E6=89=80=E6=9C=89=E5=B1=9E?=
=?UTF-8?q?=E6=80=A7=E5=90=8D=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/js/util.js | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/common/js/util.js b/common/js/util.js
index 9977c54..c6a7c57 100644
--- a/common/js/util.js
+++ b/common/js/util.js
@@ -1204,5 +1204,32 @@ export default {
(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
From 6f6899deaa537cd942928f6d8e629dfef7a434e7 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Sat, 10 Jan 2026 15:05:08 +0800
Subject: [PATCH 02/38] =?UTF-8?q?chore(=E8=A7=86=E9=A2=91=E5=8F=B7?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6):=20=E9=87=8D=E6=9E=84=E8=A7=86=E9=A2=91?=
=?UTF-8?q?=E5=8F=B7=E7=BB=84=E4=BB=B6=EF=BC=8C=E4=B8=8D=E5=8D=95=E5=8D=95?=
=?UTF-8?q?=E6=98=AF=E5=BE=AE=E4=BF=A1=E8=A7=86=E9=A2=91=E5=8F=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components-diy/css/common-channel.scss | 190 +++++++++
components-diy/diy-channel-header.vue | 45 ++
components-diy/diy-channel-list.vue | 275 +++++++++++++
components-diy/diy-channel-video.vue | 84 ++++
components-diy/diy-channel.vue | 95 +++++
components-diy/diy-group.vue | 12 +-
components-diy/diy-wechat-channel-list.vue | 458 ---------------------
components-diy/diy-wechat-channel.vue | 232 -----------
components-diy/js/wechat-channel.js | 179 ++++++++
9 files changed, 874 insertions(+), 696 deletions(-)
create mode 100644 components-diy/css/common-channel.scss
create mode 100644 components-diy/diy-channel-header.vue
create mode 100644 components-diy/diy-channel-list.vue
create mode 100644 components-diy/diy-channel-video.vue
create mode 100644 components-diy/diy-channel.vue
delete mode 100644 components-diy/diy-wechat-channel-list.vue
delete mode 100644 components-diy/diy-wechat-channel.vue
create mode 100644 components-diy/js/wechat-channel.js
diff --git a/components-diy/css/common-channel.scss b/components-diy/css/common-channel.scss
new file mode 100644
index 0000000..d9b9a85
--- /dev/null
+++ b/components-diy/css/common-channel.scss
@@ -0,0 +1,190 @@
+// 公共微信视频号样式
+
+// 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-avatar-size: 60rpx;
+ --channel-arrow-size: 24rpx;
+ --channel-border-radius: 12rpx;
+ --channel-stats-padding: 10rpx;
+ --channel-info-wrap-padding: 10rpx 0;
+
+ // 字体变量
+ --channel-name-font-size: 28rpx;
+ --channel-follow-font-size: 24rpx;
+ --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;
+ --channel-follow-color: #07c160;
+ --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-header-padding: 16rpx;
+ --channel-avatar-margin-right: 12rpx;
+ --channel-arrow-margin-left: 8rpx;
+ --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-avatar-size: 50rpx;
+ --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-avatar-size: 70rpx;
+ --channel-name-font-size: 32rpx;
+ --video-title-font-size: 32rpx;
+ }
+}
+
+// 播放按钮样式
+.channel-play-btn {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: var(--channel-play-btn-size);
+ height: var(--channel-play-btn-size);
+ background-color: var(--channel-play-btn-bg);
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ .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);
+}
+
+// 频道头部
+.channel-header {
+ display: flex;
+ align-items: center;
+ padding: var(--channel-header-padding);
+ border-bottom: 1rpx solid var(--channel-border-color);
+
+ .channel-avatar {
+ width: var(--channel-avatar-size);
+ height: var(--channel-avatar-size);
+ border-radius: 50%;
+ margin-right: var(--channel-avatar-margin-right);
+ }
+
+ .channel-info {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+
+ .channel-name {
+ font-size: var(--channel-name-font-size);
+ font-weight: 500;
+ color: var(--channel-name-color);
+ margin-bottom: var(--channel-name-margin-bottom);
+ }
+
+ .channel-follow {
+ font-size: var(--channel-follow-font-size);
+ color: var(--channel-follow-color);
+ }
+ }
+
+ .channel-arrow {
+ width: var(--channel-arrow-size);
+ height: var(--channel-arrow-size);
+ margin-left: var(--channel-arrow-margin-left);
+ }
+}
diff --git a/components-diy/diy-channel-header.vue b/components-diy/diy-channel-header.vue
new file mode 100644
index 0000000..d2c2c66
--- /dev/null
+++ b/components-diy/diy-channel-header.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components-diy/diy-channel-list.vue b/components-diy/diy-channel-list.vue
new file mode 100644
index 0000000..f4b2498
--- /dev/null
+++ b/components-diy/diy-channel-list.vue
@@ -0,0 +1,275 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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..a482149
--- /dev/null
+++ b/components-diy/diy-channel-video.vue
@@ -0,0 +1,84 @@
+
+
+
+
+ // #ifdef MP-WEIXIN
+
+
+ // #endif
+
+
+
+
+
+
+
+
+
+ {{ value.viewCount }}次观看
+
+
+ {{ value.videoTitle }}
+ {{ value.viewCount }}次观看
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components-diy/diy-channel.vue b/components-diy/diy-channel.vue
new file mode 100644
index 0000000..1f0bfe6
--- /dev/null
+++ b/components-diy/diy-channel.vue
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components-diy/diy-group.vue b/components-diy/diy-group.vue
index 16eebc3..dd88285 100644
--- a/components-diy/diy-group.vue
+++ b/components-diy/diy-group.vue
@@ -251,14 +251,14 @@
-
-
-
+
+
+
-
-
-
+
+
+
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..e774cde
--- /dev/null
+++ b/components-diy/js/wechat-channel.js
@@ -0,0 +1,179 @@
+// 微信视频号组件配置
+export const wechatChannelConfig = {
+ // 图标相关
+ icon: {
+ defaultSize: 80, // 默认图标尺寸(rpx)
+ smallSize: 60, // 小图标尺寸(rpx)
+ channelArrowSize: 24, // 频道箭头图标尺寸(rpx)
+ channelArrow: 'addon/personnel/shop/view/enterprise/arrow.png', // 频道箭头图标路径
+ playIcon: 'addon/personnel/shop/view/enterprise/play.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: 'component.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) {
+ reject(err);
+ return;
+ }
+
+ // 检查微信环境
+ if (typeof wx === 'undefined') {
+ reject(new Error(wechatChannelConfig.error.notWechat));
+ return;
+ }
+
+ // 检查基础库版本
+ const systemInfo = wx.getSystemInfoSync();
+ const SDKVersion = systemInfo.SDKVersion;
+ if (this.versionCompare(SDKVersion, wechatChannelConfig.wechat.minSdkVersion) < 0) {
+ reject(new Error(wechatChannelConfig.error.lowVersion));
+ 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);
+ reject(err);
+ }
+ });
+ } else {
+ reject(new Error(wechatChannelConfig.error.notSupported));
+ }
+ });
+ },
+
+ // 统一错误处理
+ handleError(err) {
+ console.error('微信视频号错误:', err);
+ // 可以添加错误上报或用户提示逻辑
+ switch (err.errCode) {
+ case 40001:
+ console.error('错误:40001,检查主体要求或嵌入式打开的关联关系');
+ break;
+ case 40002:
+ console.error('错误:40002,参数错误,检查 feedId 和 finderUserName');
+ break;
+ default:
+ console.error('错误:' + err.errCode + ',' + (err.errMsg || '未知错误'));
+ break;
+ }
+ }
+};
\ No newline at end of file
From f87c7d963e8003f5a26c3f81e0bf7573296a15e9 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Sat, 10 Jan 2026 16:12:36 +0800
Subject: [PATCH 03/38] =?UTF-8?q?chore(=E8=A7=86=E9=A2=91=E5=8F=B7?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6):=20=E6=9B=B4=E6=96=B0=E8=A7=86=E9=A2=91?=
=?UTF-8?q?=E5=8F=B7=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components-diy/diy-channel-header.vue | 6 +-
components-diy/diy-channel-list.vue | 182 +++++++++-----------------
components-diy/diy-channel-video.vue | 139 ++++++++++++++++++--
components-diy/diy-channel.vue | 2 -
4 files changed, 190 insertions(+), 139 deletions(-)
diff --git a/components-diy/diy-channel-header.vue b/components-diy/diy-channel-header.vue
index d2c2c66..e77d71b 100644
--- a/components-diy/diy-channel-header.vue
+++ b/components-diy/diy-channel-header.vue
@@ -12,9 +12,8 @@
+
+
From 8b01d8f8ec778376620890e6e2fb6d3a73bfebff Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Mon, 12 Jan 2026 15:03:28 +0800
Subject: [PATCH 15/38] =?UTF-8?q?chore(=E8=A7=86=E9=A2=91=E5=8F=B7?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6):=20=E9=9D=9E=E5=BE=AE=E4=BF=A1=E5=B0=8F?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E7=8E=AF=E5=A2=83=EF=BC=8C=E5=8F=91=E9=80=81?=
=?UTF-8?q?=E6=B6=88=E6=81=AF=EF=BC=8C=E8=AE=A9=E7=88=B6=E7=BB=84=E4=BB=B6?=
=?UTF-8?q?=E5=86=B3=E5=AE=9A=E6=9D=A5=E6=80=8E=E4=B9=88=E6=93=8D=E4=BD=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components-diy/diy-channel-list.vue | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/components-diy/diy-channel-list.vue b/components-diy/diy-channel-list.vue
index 605b46c..13b97c9 100644
--- a/components-diy/diy-channel-list.vue
+++ b/components-diy/diy-channel-list.vue
@@ -229,6 +229,11 @@ export default {
// 在微信小程序环境中调用视频播放接口
await wechatChannelUtil.playVideo(item);
// #endif
+
+ // #ifndef MP-WEIXIN
+ // 在非微信小程序环境中,直接触发事件
+ this.$emit('video-play', item);
+ // #endif
} catch (err) {
console.error('打开视频号失败', err);
}
From ce26a9be5f39a0238214e096497e724ed4b8ecd4 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Mon, 12 Jan 2026 15:28:04 +0800
Subject: [PATCH 16/38] =?UTF-8?q?feat(=E9=A1=B5=E9=9D=A2):=20=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E6=96=87=E4=BB=B6=E9=A2=84=E8=A7=88=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages.json | 24 +--
pages_tool/file-preview/file-preview.vue | 183 +++++++++++++++++++++++
2 files changed, 198 insertions(+), 9 deletions(-)
create mode 100644 pages_tool/file-preview/file-preview.vue
diff --git a/pages.json b/pages.json
index a4ee8dd..313ad68 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/file-preview/file-preview.vue b/pages_tool/file-preview/file-preview.vue
new file mode 100644
index 0000000..62f946d
--- /dev/null
+++ b/pages_tool/file-preview/file-preview.vue
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+
+
+ 文件地址不存在
+
+
+
+
+
+ 文件地址不存在
+
+
+
+
+
+ 视频地址不存在
+
+
+
+
+ 不支持的文件类型
+
+
+
+
+
+
+
+
From 4e1448d2c469fe674a374eb07d367462e9887e01 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Mon, 12 Jan 2026 15:35:23 +0800
Subject: [PATCH 17/38] =?UTF-8?q?chore(js):=20=E6=96=B0=E5=A2=9Ecommon/js/?=
=?UTF-8?q?share.js=EF=BC=8C=E4=B8=93=E6=B3=A8=E5=88=86=E4=BA=AB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/js/share.js | 100 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 100 insertions(+)
create mode 100644 common/js/share.js
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
From 191c803f66595ae2104b16656f4e4932dc48ac86 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Mon, 12 Jan 2026 16:05:25 +0800
Subject: [PATCH 18/38] =?UTF-8?q?chore(=E7=BB=84=E4=BB=B6):=20=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0ns-video-player-popup=20=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/ns-video-player-popup/ns-video-player-popup.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/ns-video-player-popup/ns-video-player-popup.vue b/components/ns-video-player-popup/ns-video-player-popup.vue
index fe86875..774b25f 100644
--- a/components/ns-video-player-popup/ns-video-player-popup.vue
+++ b/components/ns-video-player-popup/ns-video-player-popup.vue
@@ -142,4 +142,4 @@ export default {
}
}
}
-
+
\ No newline at end of file
From ce1ea6eadf0b83998f8af9379235a7b1569fe6c3 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Mon, 12 Jan 2026 16:11:53 +0800
Subject: [PATCH 19/38] =?UTF-8?q?chore(=E7=94=B5=E5=AD=90=E5=90=8D?=
=?UTF-8?q?=E7=89=87):=20=E6=9B=B4=E6=96=B0=E4=BC=81=E4=B8=9A=E6=96=87?=
=?UTF-8?q?=E4=BB=B6=E5=8F=8A=E4=BC=81=E4=B8=9A=E8=A7=86=E9=A2=91=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages_tool/contact/contact.vue | 50 +++++++++++++++++++++-------------
1 file changed, 31 insertions(+), 19 deletions(-)
diff --git a/pages_tool/contact/contact.vue b/pages_tool/contact/contact.vue
index c632c31..1caabc7 100644
--- a/pages_tool/contact/contact.vue
+++ b/pages_tool/contact/contact.vue
@@ -68,7 +68,7 @@
-
+
企业文件
@@ -77,14 +77,13 @@
{{ file.name }}
-
-
+
企业视频
@@ -98,10 +97,10 @@
-
+
@@ -183,11 +182,19 @@
+
+
+
-
-
\ No newline at end of file
diff --git a/components-diy/diy-channel.vue b/components-diy/diy-channel.vue
deleted file mode 100644
index d47877c..0000000
--- a/components-diy/diy-channel.vue
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/components-diy/diy-group.vue b/components-diy/diy-group.vue
index dd88285..6de5241 100644
--- a/components-diy/diy-group.vue
+++ b/components-diy/diy-group.vue
@@ -251,12 +251,7 @@
-
-
-
-
-
-
+
diff --git a/docs/WECHAT_CHANNEL_INTEGRATION.md b/docs/WECHAT_CHANNEL_INTEGRATION.md
index 2426372..bb19a67 100644
--- a/docs/WECHAT_CHANNEL_INTEGRATION.md
+++ b/docs/WECHAT_CHANNEL_INTEGRATION.md
@@ -102,29 +102,7 @@
## 3. 组件使用
-### 3.1 视频号头部组件 (diy-channel-header.vue)
-
-#### 基本用法
-
-```vue
-
-```
-
-#### 属性说明
-
-| 属性名 | 类型 | 默认值 | 说明 |
-|--------|------|--------|------|
-| channelName | String | "" | 视频号名称 |
-| avatarUrl | String | "" | 视频号头像URL |
-| showFollow | Boolean | false | 是否显示关注按钮 |
-
-#### 事件说明
-
-| 事件名 | 说明 | 参数 |
-|--------|------|------|
-| header-tap | 点击头部区域时触发 | 视频号数据对象 |
-
-### 3.2 视频号视频卡片组件 (diy-channel-video.vue)
+### 3.1 视频号视频卡片组件 (diy-channel-video.vue)
#### 基本用法
@@ -136,13 +114,15 @@
| 属性名 | 类型 | 默认值 | 说明 |
|--------|------|--------|------|
-| value | Object | {} | 视频数据对象 |
+| 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对象属性说明
@@ -163,45 +143,7 @@
|--------|------|------|
| video-play | 点击视频播放时触发 | 视频数据对象 |
-### 3.3 单个视频号组件 (diy-channel.vue)
-
-#### 基本用法
-
-```vue
-
-```
-
-#### 属性说明
-
-| 属性名 | 类型 | 默认值 | 说明 |
-|--------|------|--------|------|
-| channelName | String | "" | 视频号名称 |
-| avatarUrl | String | "" | 视频号头像URL |
-| videoTitle | String | "" | 视频标题 |
-| coverUrl | String | "" | 视频封面URL |
-| feedId | String | "" | 视频号内容ID,用于播放视频 |
-| viewCount | Number | 0 | 视频观看次数 |
-| showFollow | Boolean | false | 是否显示关注按钮 |
-| componentAngle | String | "" | 组件圆角类型,可选值:round |
-| topAroundRadius | Number | 0 | 顶部圆角半径 |
-| bottomAroundRadius | Number | 0 | 底部圆角半径 |
-| embedMode | Boolean | false | 是否启用嵌入式播放 |
-| showViewCount | Boolean | false | 是否显示观看次数 |
-| finderUserName | String | "" | 视频号ID,用于嵌入式播放 |
-| feedToken | String | "" | 视频token,用于嵌入式播放 |
-| titleLineClamp | Number | 1 | 标题显示行数 |
-| showPlayBtn | Boolean | true | 是否显示播放按钮 |
-| coverStyle | Object | {} | 视频封面图样式 |
-| playBtnStyle | Object | {} | 播放按钮样式 |
-
-#### 事件说明
-
-| 事件名 | 说明 | 参数 |
-|--------|------|------|
-| channel-tap | 点击视频号头像或名称时触发 | 视频号数据对象 |
-| video-play | 点击视频播放时触发 | 视频号数据对象 |
-
-### 3.4 视频号列表组件 (diy-channel-list.vue)
+### 3.2 视频号列表组件 (diy-channel-list.vue)
#### 基本用法
@@ -213,28 +155,30 @@
| 属性名 | 类型 | 默认值 | 说明 |
|--------|------|--------|------|
-| 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 | {} | 装饰样式配置 |
-| titleLineClamp | Number | 1 | 标题显示行数 |
-| showPlayBtn | Boolean | true | 是否显示播放按钮 |
-| coverStyle | Object | {} | 视频封面图样式 |
-| playBtnStyle | Object | {} | 播放按钮样式 |
-| imageSize | Number | 0 | 图片尺寸(仅在特定模式下使用) |
-| pageCount | Number | 1 | 每页显示的视频数量 |
-| carousel | Object | {} | 轮播配置 |
-| carousel.type | String | "" | 轮播类型,可选值:default, hide |
-| carousel.autoplay | Boolean | false | 是否自动播放 |
-| carousel.interval | Number | 3000 | 自动播放间隔,单位毫秒 |
-| carousel.duration | Number | 500 | 切换动画时长,单位毫秒 |
-| carousel.circular | Boolean | false | 是否循环播放 |
+| 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数组项说明
@@ -428,6 +372,7 @@ if (typeof wx !== 'undefined' && wx.openChannelsActivity) {
- 可通过组件的 `componentAngle`、`topAroundRadius`、`bottomAroundRadius` 等属性调整组件样式
- 可通过 `componentBgColor` 属性调整组件背景颜色
- 可通过 `font` 属性调整字体样式
+- 可通过 `aspectRatio` 属性调整视频比例,支持 '16:9' 和 '3:4' 两种比例
### 6.6 环境兼容性问题
@@ -489,24 +434,7 @@ if (typeof wx !== 'undefined' && wx.openChannelsActivity) {
## 7. 示例代码
-### 7.1 视频号头部组件示例
-
-```javascript
-// 视频号头部数据
-const headerData = {
- channelName: "示例视频号",
- avatarUrl: "https://example.com/avatar.jpg",
- showFollow: true
-};
-
-// 头部点击事件处理
-function handlerHeaderClick(data) {
- console.log("头部被点击", data);
- // 可以在这里处理跳转到视频号主页等逻辑
-}
-```
-
-### 7.2 视频号视频卡片组件示例
+### 7.1 视频号视频卡片组件示例
```javascript
// 视频卡片数据
@@ -529,7 +457,7 @@ function handlerVideoPlay(data) {
}
```
-### 7.3 单个视频号示例
+### 7.2 单个视频号示例
```javascript
// 单个视频号数据
@@ -550,6 +478,7 @@ const channelData = {
feedToken: "example_feed_token",
titleLineClamp: 2,
showPlayBtn: true,
+ aspectRatio: "16:9",
coverStyle: {
width: "100%",
height: "0",
@@ -564,7 +493,7 @@ const channelData = {
};
```
-### 7.4 视频号列表示例
+### 7.3 视频号列表示例
```javascript
// 视频号列表数据
@@ -608,6 +537,7 @@ const channelListData = {
ornament: {},
titleLineClamp: 2,
showPlayBtn: true,
+ aspectRatio: "16:9",
coverStyle: {
width: "100%",
height: "0",
From bb87f4b1d25e080b9098ea09338c6350708c1fdd Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Wed, 14 Jan 2026 09:41:41 +0800
Subject: [PATCH 31/38] =?UTF-8?q?fix(=E8=A7=86=E9=A2=91=E5=8F=B7=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6):=20=E7=94=A8=E6=88=B7=E5=8F=96=E6=B6=88=E7=9A=84?=
=?UTF-8?q?=E7=9B=91=E5=90=AC=E9=94=99=E8=AF=AF=EF=BC=8C=E4=B8=8D=E5=BC=B9?=
=?UTF-8?q?=E5=87=BA=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components-diy/js/wechat-channel.js | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/components-diy/js/wechat-channel.js b/components-diy/js/wechat-channel.js
index 9dc33a9..8dd75d1 100644
--- a/components-diy/js/wechat-channel.js
+++ b/components-diy/js/wechat-channel.js
@@ -163,11 +163,16 @@ export const wechatChannelUtil = {
// 统一错误处理
handleError(err, item) {
console.error('微信视频号错误:', err);
+ const { errMsg = '微信视频播放失败', errCode = -1 } = err;
+
+ // 错误码5: 表示用户点击了取消. openChannelsActivity:fail cancel
+ if ([5].includes(errCode)) {
+ return;
+ }
- let errorMsg = err.errMsg || '微信视频播放失败';
const showErrorToast = (otherMsgs = []) => {
uni.showToast({
- title: [errorMsg, ...otherMsgs].join('\n'),
+ title: [errMsg, ...otherMsgs].join('\n'),
icon: 'none',
duration: 2000
});
From db7a8d72028798fcb1072d5b587e72a20f160e15 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Wed, 14 Jan 2026 13:46:47 +0800
Subject: [PATCH 32/38] =?UTF-8?q?chore(=E8=A7=86=E9=A2=91=E5=8F=B7?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6):=20=E4=B8=8E=E5=90=8E=E7=AB=AF=E8=AE=BE?=
=?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=90=8C=E6=AD=A5=E6=A0=B7=E5=BC=8F=E5=B8=83?=
=?UTF-8?q?=E5=B1=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components-diy/diy-channel-list.vue | 2 +-
pages_tool/contact/contact.vue | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/components-diy/diy-channel-list.vue b/components-diy/diy-channel-list.vue
index c192f9f..de6746e 100644
--- a/components-diy/diy-channel-list.vue
+++ b/components-diy/diy-channel-list.vue
@@ -265,7 +265,7 @@ export default {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
- padding: 16rpx;
+ padding: 32rpx;
box-sizing: border-box;
.channel-item {
diff --git a/pages_tool/contact/contact.vue b/pages_tool/contact/contact.vue
index 2b45387..4a422f3 100644
--- a/pages_tool/contact/contact.vue
+++ b/pages_tool/contact/contact.vue
@@ -863,7 +863,9 @@ image {
}
}
-
+/deep/ .channel-list {
+ padding: 0rpx;
+}
/deep/ .mescroll-totop {
right: 27rpx !important;
From 392a8e29524307277d77a0ae8d0984a4f5d3efa6 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Wed, 14 Jan 2026 15:14:02 +0800
Subject: [PATCH 33/38] =?UTF-8?q?revert(=E8=A7=86=E9=A2=91=E5=8F=B7?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6):=20=E7=B2=BE=E7=AE=80=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4=E6=A0=B7=E5=BC=8F=E4=BB=A5=E5=92=8C?=
=?UTF-8?q?=E5=90=8E=E5=8F=B0=E8=AE=BE=E8=AE=A1=E7=BB=9F=E4=B8=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components-diy/diy-article.vue | 2 +-
components-diy/diy-channel-list.vue | 334 ++++++------------
components-diy/diy-channel-video.vue | 81 +----
components-diy/js/wechat-channel.js | 18 +-
pages_tool/contact/contact.vue | 2 +-
.../uni-datetime-picker/time-picker.vue | 2 +-
.../uni-datetime-picker.vue | 4 +-
.../components/uni-popup/uni-popup.vue | 2 +-
8 files changed, 134 insertions(+), 311 deletions(-)
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
index de6746e..f114b2c 100644
--- a/components-diy/diy-channel-list.vue
+++ b/components-diy/diy-channel-list.vue
@@ -6,13 +6,13 @@
:duration="value.carousel.duration || 500" :circular="value.carousel.circular || false"
:style="swiperHeight" class="channel-swiper">
-
-
-
-
+
+
+
+
@@ -22,9 +22,9 @@
-
@@ -36,9 +36,9 @@
-
@@ -190,6 +190,25 @@ export default {
}
return slides;
+ },
+ /**
+ * 视频封面样式
+ * 根据aspectRatio属性动态计算封面样式
+ * @returns {Object} 封面样式对象
+ */
+ computedCoverStyle() {
+ const aspectRatio = this.value?.aspectRatio || '16:9';
+ let paddingTop = '56.25%'; // 默认 16:9 比例
+
+ if (aspectRatio === '3:4') {
+ paddingTop = '133.33%'; // 3:4 比例
+ }
+
+ return {
+ width: '100%',
+ height: '0',
+ paddingTop: paddingTop
+ };
}
},
methods: {
@@ -259,69 +278,12 @@ export default {
/**
* 列表布局样式
- * 支持 2 列和 3 列布局
*/
.channel-list {
- display: flex;
- flex-wrap: wrap;
- gap: 16rpx;
- padding: 32rpx;
- box-sizing: border-box;
-
- .channel-item {
- // 默认 3 列布局
- flex: 0 0 calc(33.3333333% - 10rpx);
- box-sizing: border-box;
-
- &:nth-child(3n) {
- margin-right: 0;
- }
- }
-
- // 2 列布局
- &.row1-of2 {
- .channel-item {
- flex: 0 0 calc(50% - 8rpx);
-
- &:nth-child(3n) {
- margin-right: 16rpx;
- }
-
- &:nth-child(2n) {
- margin-right: 0;
- }
- }
- }
-
- // 4 列布局
- &.row1-of4 {
- .channel-item {
- flex: 0 0 calc(25% - 12rpx);
-
- &:nth-child(3n) {
- margin-right: 16rpx;
- }
-
- &:nth-child(4n) {
- margin-right: 0;
- }
- }
- }
-
- // 1 列布局
- &.row1-of1 {
- .channel-item {
- flex: 0 0 100%;
-
- &:nth-child(3n) {
- margin-right: 16rpx;
- }
-
- &:nth-child(1n) {
- margin-right: 0;
- }
- }
- }
+ display: grid;
+ grid-template-columns: repeat(var(--row-count, 2), 1fr);
+ gap: 8px;
+ padding: 16px 16px 0px;
}
/**
@@ -333,15 +295,17 @@ export default {
box-sizing: border-box;
.uni-scroll-view-content {
- display: flex;
- flex-wrap: wrap;
+ display: grid;
+ grid-template-columns: repeat(var(--row-count, 2), 1fr);
gap: 16rpx;
}
// 单滑动模式
&.singleSlide {
.uni-scroll-view-content {
+ display: flex;
flex-wrap: nowrap;
+ gap: 16rpx;
}
.channel-nav-item {
@@ -354,56 +318,33 @@ export default {
display: flex;
flex-direction: column;
box-sizing: border-box;
- // 默认 3 列布局
- flex: 0 0 calc(33.3333333% - 10rpx);
+ }
- &:nth-child(3n) {
- margin-right: 0;
+ // 1 列布局
+ &.row1-of1 {
+ .uni-scroll-view-content {
+ grid-template-columns: 1fr;
}
}
// 2 列布局
&.row1-of2 {
- .channel-nav-item {
- flex: 0 0 calc(50% - 8rpx);
+ .uni-scroll-view-content {
+ grid-template-columns: repeat(2, 1fr);
+ }
+ }
- &:nth-child(3n) {
- margin-right: 16rpx;
- }
-
- &:nth-child(2n) {
- margin-right: 0;
- }
+ // 3 列布局
+ &.row1-of3 {
+ .uni-scroll-view-content {
+ grid-template-columns: repeat(3, 1fr);
}
}
// 4 列布局
&.row1-of4 {
- .channel-nav-item {
- flex: 0 0 calc(25% - 12rpx);
-
- &:nth-child(3n) {
- margin-right: 16rpx;
- }
-
- &:nth-child(4n) {
- margin-right: 0;
- }
- }
- }
-
- // 1 列布局
- &.row1-of1 {
- .channel-nav-item {
- flex: 0 0 100%;
-
- &:nth-child(3n) {
- margin-right: 16rpx;
- }
-
- &:nth-child(1n) {
- margin-right: 0;
- }
+ .uni-scroll-view-content {
+ grid-template-columns: repeat(4, 1fr);
}
}
}
@@ -426,65 +367,36 @@ export default {
box-sizing: border-box;
.swiper-slide-content {
- display: flex;
- flex-wrap: wrap;
+ display: grid;
+ grid-template-columns: repeat(var(--row-count, 2), 1fr);
gap: 16rpx;
padding: 16rpx;
box-sizing: border-box;
.channel-item {
- // 默认 3 列布局
- flex: 0 0 calc(33.3333333% - 10rpx);
+ display: flex;
+ flex-direction: column;
box-sizing: border-box;
-
- &:nth-child(3n) {
- margin-right: 0;
- }
- }
-
- // 轮播模式下的 2 列布局
- &.row1-of2 {
- .channel-item {
- flex: 0 0 calc(50% - 8rpx);
-
- &:nth-child(3n) {
- margin-right: 16rpx;
- }
-
- &:nth-child(2n) {
- margin-right: 0;
- }
- }
- }
-
- // 轮播模式下的 4 列布局
- &.row1-of4 {
- .channel-item {
- flex: 0 0 calc(25% - 12rpx);
-
- &:nth-child(3n) {
- margin-right: 16rpx;
- }
-
- &:nth-child(4n) {
- margin-right: 0;
- }
- }
}
// 轮播模式下的 1 列布局
&.row1-of1 {
- .channel-item {
- flex: 0 0 100%;
+ grid-template-columns: 1fr;
+ }
- &:nth-child(3n) {
- margin-right: 16rpx;
- }
+ // 轮播模式下的 2 列布局
+ &.row1-of2 {
+ grid-template-columns: repeat(2, 1fr);
+ }
- &:nth-child(1n) {
- margin-right: 0;
- }
- }
+ // 轮播模式下的 3 列布局
+ &.row1-of3 {
+ grid-template-columns: repeat(3, 1fr);
+ }
+
+ // 轮播模式下的 4 列布局
+ &.row1-of4 {
+ grid-template-columns: repeat(4, 1fr);
}
}
}
@@ -500,76 +412,54 @@ export default {
.channel-swiper .swiper-slide-content {
gap: 12rpx;
padding: 12rpx;
-
- .channel-item,
- .channel-nav-item {
- // 默认 3 列布局
- flex: 0 0 calc(33.3333333% - 8rpx);
-
- &:nth-child(3n) {
- margin-right: 0;
- }
- }
-
- // 小屏幕上的 2 列布局
- &.row1-of2 {
-
- .channel-item,
- .channel-nav-item {
- flex: 0 0 calc(50% - 6rpx);
-
- &:nth-child(3n) {
- margin-right: 12rpx;
- }
-
- &:nth-child(2n) {
- margin-right: 0;
- }
- }
- }
-
- // 小屏幕上的 4 列布局
- &.row1-of4 {
-
- .channel-item,
- .channel-nav-item {
- flex: 0 0 calc(25% - 9rpx);
-
- &:nth-child(3n) {
- margin-right: 12rpx;
- }
-
- &:nth-child(4n) {
- margin-right: 0;
- }
- }
- }
-
- // 小屏幕上的 1 列布局
- &.row1-of1 {
-
- .channel-item,
- .channel-nav-item {
- flex: 0 0 100%;
-
- &:nth-child(3n) {
- margin-right: 12rpx;
- }
-
- &:nth-child(1n) {
- margin-right: 0;
- }
- }
- }
}
// 小屏幕上的单滑动模式
.channel-nav {
&.singleSlide {
+ .uni-scroll-view-content {
+ gap: 12rpx;
+ }
+
.channel-nav-item {
width: 240rpx;
}
}
}
}
+
+/**
+ * 视频比例样式调整
+ * 根据不同的视频比例调整布局
+ */
+
+// // 3:4 比例的视频卡片样式
+// .channel-video.ratio-3-4 {
+// // 调整视频卡片的整体高度
+// /deep/ .video-cover-wrap {
+// padding-top: 133.33%; // 3:4 比例
+// }
+
+// // 列表模式下的3:4比例调整
+// &.list-mode {
+// /deep/ .video-cover-wrap {
+// padding-top: 133.33%; // 3:4 比例
+// }
+// }
+// }
+
+// // 16:9 比例的视频卡片样式(默认)
+// .channel-video.ratio-16-9 {
+// // 保持默认的16:9比例
+// /deep/ .video-cover-wrap {
+// padding-top: 56.25%; // 16:9 比例
+// }
+
+// // 列表模式下的16:9比例保持默认
+// &.list-mode {
+// /deep/ .video-cover-wrap {
+// padding-top: 56.25%; // 16:9 比例
+// }
+// }
+// }
\ No newline at end of file
diff --git a/components-diy/diy-channel-video.vue b/components-diy/diy-channel-video.vue
index 1b8f143..cb1de1f 100644
--- a/components-diy/diy-channel-video.vue
+++ b/components-diy/diy-channel-video.vue
@@ -2,7 +2,7 @@
-
+
@@ -23,11 +23,10 @@
-
+
-
-
-
+
+
{{ value.viewCount }}次观看
@@ -81,15 +80,6 @@ export default {
type: Boolean,
default: false
},
- /**
- * 视频高度(仅适用于嵌入式播放)
- * @type {number}
- * @default 220
- */
- videoHeight: {
- type: Number,
- default: 220
- },
/**
* 标题显示行数
* @type {number}
@@ -104,17 +94,6 @@ export default {
type: Boolean,
default: true
},
- /**
- * 视频比例
- * @type {string}
- * @default '16:9'
- * @options '16:9', '3:4'
- */
- aspectRatio: {
- type: String,
- default: '16:9',
- validator: (value) => ['16:9', '3:4'].includes(value)
- },
/**
* 视频封面图样式
* 采用 16:9 比例的响应式高度
@@ -159,32 +138,6 @@ export default {
return enableEmbedMode;
// #endif
return false
- },
- /**
- * 播放按钮图标
- * @returns {string}
- */
- playIcon() {
- // #ifdef MP-WEIXIN
- return wechatChannelConfig.icon.playIcon
- // #endif
- return ''
- },
- /**
- * 计算视频封面类名
- * 根据环境和宽高比生成适当的 CSS 类
- * @returns {Array}
- */
- videoCoverClass() {
- const classes = [];
- // #ifdef MP-WEIXIN
- classes.push('mp-weixin');
- // #endif
- // #ifndef MP-WEIXIN
- classes.push('h5');
- // #endif
- classes.push(`ratio-${this.aspectRatio.replace(':', '-')}`);
- return classes;
}
},
methods: {
@@ -202,31 +155,6 @@ export default {
\ No newline at end of file
+// }
\ No newline at end of file
From b3cc86d088d427a8a63c350db8c27ab6c574689f Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Thu, 15 Jan 2026 14:37:39 +0800
Subject: [PATCH 36/38] chore: .local.config.js.example
---
.local.config.js.example | 4 ++++
1 file changed, 4 insertions(+)
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
From 28359f2f1624c637d3b4d1d577e4cabee5807f8e Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Thu, 15 Jan 2026 14:58:36 +0800
Subject: [PATCH 37/38] =?UTF-8?q?fix(=E8=A7=86=E9=A2=91=E5=8F=B7=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6):=20=E6=95=B4=E4=BD=93=E6=8E=A7=E5=88=B6=E6=98=AF?=
=?UTF-8?q?=E5=90=A6=E6=98=BE=E7=A4=BA=E8=A7=82=E7=9C=8B=E6=AC=A1=E6=95=B0?=
=?UTF-8?q?=E6=B2=A1=E6=9C=89=E7=94=9F=E6=95=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components-diy/diy-channel-list.vue | 4 ++++
components-diy/diy-channel-video.vue | 11 ++++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/components-diy/diy-channel-list.vue b/components-diy/diy-channel-list.vue
index c4c47b6..fa4c049 100644
--- a/components-diy/diy-channel-list.vue
+++ b/components-diy/diy-channel-list.vue
@@ -11,6 +11,7 @@
@@ -24,6 +25,7 @@
@@ -38,6 +40,7 @@
@@ -71,6 +74,7 @@ export default {
* @property {number} topAroundRadius - 顶部圆角半径
* @property {number} bottomAroundRadius - 底部圆角半径
* @property {Object} ornament - 装饰效果配置
+ * @property {boolean} showViewCount - 是否显示播放量,可选值:true, false
* @property {number} titleLineClamp - 标题显示行数
* @property {string} aspectRatio - 视频比例,可选值:16:9, 3:4
* @property {boolean} showPlayBtn - 是否显示播放按钮
diff --git a/components-diy/diy-channel-video.vue b/components-diy/diy-channel-video.vue
index cb1de1f..66d1061 100644
--- a/components-diy/diy-channel-video.vue
+++ b/components-diy/diy-channel-video.vue
@@ -17,7 +17,7 @@
{{ value.videoTitle }}
- {{ value.viewCount }}次观看
+ {{ value.viewCount }}次观看
@@ -28,7 +28,7 @@
-
+
{{ value.viewCount }}次观看
@@ -37,7 +37,7 @@
{{ value.videoTitle }}
- {{ value.viewCount }}次观看
+ {{ value.viewCount }}次观看
@@ -80,6 +80,11 @@ export default {
type: Boolean,
default: false
},
+ /** 是否显示观看次数,由父组件可以整体配置 */
+ showViewCount: {
+ type: Boolean,
+ default: true
+ },
/**
* 标题显示行数
* @type {number}
From 36fd0621fd232cd81b4cf036fe88fe90b9f64d6c Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Thu, 15 Jan 2026 17:26:02 +0800
Subject: [PATCH 38/38] =?UTF-8?q?fix(=E8=A7=86=E9=A2=91=E5=8F=B7=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6):=20padding=20=E5=BD=B1=E5=93=8D=E5=B8=83=E5=B1=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components-diy/diy-channel-list.vue | 210 ++++++++++++++++++++++++----
pages_tool/contact/contact.vue | 2 +-
2 files changed, 186 insertions(+), 26 deletions(-)
diff --git a/components-diy/diy-channel-list.vue b/components-diy/diy-channel-list.vue
index fa4c049..a7b582f 100644
--- a/components-diy/diy-channel-list.vue
+++ b/components-diy/diy-channel-list.vue
@@ -1,5 +1,5 @@
-
+
+ :show-view-count="value.showViewCount" :cover-style="computedCoverStyle"
+ :play-btn-style="value.playBtnStyle" :aspect-ratio="value.aspectRatio" />
@@ -25,24 +24,26 @@
+ :show-view-count="value.showViewCount" :cover-style="computedCoverStyle"
+ :play-btn-style="value.playBtnStyle" :aspect-ratio="value.aspectRatio" />
+ :class="['channel-nav', value.showStyle == 'fixed' ? 'fixed-layout' : 'singleSlide', 'row1-of' + value.rowCount]"
+ :scroll-x="true"
+ :scroll-y="false"
+ :enhanced="true"
+ :bounces="false">
-
+
+ :show-view-count="value.showViewCount" :cover-style="computedCoverStyle"
+ :play-btn-style="value.playBtnStyle" :aspect-ratio="value.aspectRatio" />
@@ -107,6 +108,14 @@ export default {
// 组件创建时的逻辑
// 可以在这里进行初始化操作,如获取页面宽度等
},
+ mounted() {
+ // 组件挂载后添加鼠标拖拽滚动功能
+ if (!['fixed', 'carousel'].includes(this.value?.showStyle)) {
+ this.$nextTick(() => {
+ this.addMouseDragScroll();
+ });
+ }
+ },
watch: {
/**
* 组件刷新监听
@@ -134,24 +143,24 @@ export default {
* @returns {string} 样式字符串
*/
componentStyle() {
- let style = '';
+ const style = {};
// 背景色
if (this.value?.componentBgColor) {
- style += 'background-color:' + this.value?.componentBgColor + ';';
+ style.backgroundColor = this.value?.componentBgColor;
}
// 圆角样式
if (this.value?.componentAngle == 'round') {
- style += 'border-top-left-radius:' + (2 * this.value?.topAroundRadius) + 'rpx;';
- style += 'border-top-right-radius:' + (2 * this.value?.topAroundRadius) + 'rpx;';
- style += 'border-bottom-left-radius:' + (2 * this.value?.bottomAroundRadius) + 'rpx;';
- style += 'border-bottom-right-radius:' + (2 * this.value?.bottomAroundRadius) + 'rpx;';
+ style.borderTopLeftRadius = (2 * this.value?.topAroundRadius) + 'rpx';
+ style.borderTopRightRadius = (2 * this.value?.topAroundRadius) + 'rpx';
+ style.borderBottomLeftRadius = (2 * this.value?.bottomAroundRadius) + 'rpx';
+ style.borderBottomRightRadius = (2 * this.value?.bottomAroundRadius) + 'rpx';
}
// 装饰效果:阴影
- style += 'box-shadow:' + (this.value?.ornament?.type == 'shadow' ? '0 0 10rpx ' + this.value?.ornament?.color : '') + ';';
+ style.boxShadow = this.value?.ornament?.type == 'shadow' ? '0 0 10rpx ' + this.value?.ornament?.color : '';
// 装饰效果:边框
- style += 'border:' + (this.value?.ornament?.type == 'stroke' ? '2rpx solid ' + this.value?.ornament?.color : '') + ';';
+ style.border = this.value?.ornament?.type == 'stroke' ? '2rpx solid ' + this.value?.ornament?.color : '';
return style;
},
@@ -180,7 +189,7 @@ export default {
height = [510, 280, 220, 180][this.value.rowCount - 1];
}
}
-
+
return 'height:' + (2 * height) + 'rpx';
},
@@ -289,6 +298,105 @@ export default {
item.coverUrl = wechatChannelConfig.video.defaultCoverUrl;
// #endif
}
+ },
+ /**
+ * 添加鼠标拖拽滚动功能
+ * 在Web环境中实现与微信小程序相同的拖拽滚动效果
+ */
+ addMouseDragScroll() {
+ // 只在Web环境中添加
+ // #ifndef MP
+ console.log('addMouseDragScroll called');
+
+ let isDragging = false;
+ let startX = 0;
+ let startScrollLeft = 0;
+ let currentScrollElement = null;
+
+ // 查找最近的可滚动祖先元素
+ const findScrollableParent = (element) => {
+ while (element && element !== document) {
+ const style = window.getComputedStyle(element);
+ if (style.overflowX === 'auto' || style.overflowX === 'scroll') {
+ return element;
+ }
+ element = element.parentElement;
+ }
+ return null;
+ };
+
+ // 鼠标按下事件
+ const handleMouseDown = (e) => {
+ // 检查是否点击在组件内
+ if (this.$el.contains(e.target)) {
+ console.log('mousedown event in component:', e);
+ // 查找可滚动元素
+ currentScrollElement = findScrollableParent(e.target);
+ if (currentScrollElement) {
+ console.log('Found scrollable element:', currentScrollElement);
+ isDragging = true;
+ startX = e.pageX;
+ startScrollLeft = currentScrollElement.scrollLeft;
+ currentScrollElement.style.cursor = 'grabbing';
+ }
+ }
+ };
+
+ // 鼠标移动事件
+ const handleMouseMove = (e) => {
+ if (!isDragging || !currentScrollElement) return;
+ console.log('mousemove event:', e);
+ e.preventDefault();
+ const dx = e.pageX - startX;
+ currentScrollElement.scrollLeft = startScrollLeft - dx;
+ console.log('scrollLeft:', currentScrollElement.scrollLeft);
+ };
+
+ // 鼠标释放事件
+ const handleMouseUp = () => {
+ if (isDragging && currentScrollElement) {
+ console.log('mouseup event');
+ currentScrollElement.style.cursor = 'grab';
+ }
+ isDragging = false;
+ currentScrollElement = null;
+ };
+
+ // 添加全局事件监听器
+ document.addEventListener('mousedown', handleMouseDown);
+ document.addEventListener('mousemove', handleMouseMove);
+ document.addEventListener('mouseup', handleMouseUp);
+ document.addEventListener('mouseleave', handleMouseUp);
+
+ console.log('Global mouse event listeners added');
+
+ // 组件销毁时移除事件监听器
+ this.$once('hook:beforeDestroy', () => {
+ document.removeEventListener('mousedown', handleMouseDown);
+ document.removeEventListener('mousemove', handleMouseMove);
+ document.removeEventListener('mouseup', handleMouseUp);
+ document.removeEventListener('mouseleave', handleMouseUp);
+ console.log('Global mouse event listeners removed');
+ });
+
+ // 为所有.channel-nav元素添加必要的样式
+ setTimeout(() => {
+ const channelNavs = document.querySelectorAll('.channel-nav');
+ console.log('Found channel-nav elements:', channelNavs.length);
+ channelNavs.forEach(element => {
+ element.style.overflowX = 'auto';
+ element.style.overflowY = 'hidden';
+ element.style.whiteSpace = 'nowrap';
+ element.style.width = '100%';
+ element.style.maxWidth = '100%';
+ element.style.cursor = 'grab';
+ element.style.userSelect = 'none'; // 防止文本选择
+ console.log('Added styles to channel-nav:', element);
+ });
+ }, 100); // 延迟执行,确保DOM已完全渲染
+
+ console.log('Mouse drag scroll setup completed');
+ // #endif
}
}
}
@@ -297,6 +405,10 @@ export default {