revert(视频号组件): 精简代码,调整样式以和后台设计统一
This commit is contained in:
@@ -6,7 +6,6 @@ export const wechatChannelConfig = {
|
||||
smallSize: 60, // 小图标尺寸(rpx)
|
||||
channelArrowSize: 24, // 频道箭头图标尺寸(rpx)
|
||||
channelArrow: 'addon/personnel/shop/view/enterprise/arrow.png', // 频道箭头图标路径
|
||||
playIcon: 'addon/personnel/shop/view/enterprise/play.png', // 播放按钮图标路径
|
||||
},
|
||||
|
||||
|
||||
@@ -122,13 +121,16 @@ export const wechatChannelUtil = {
|
||||
// 数据校验
|
||||
this.validateVideoData(item);
|
||||
} catch (err) {
|
||||
this.handleError(err, item);
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查微信环境
|
||||
if (typeof wx === 'undefined') {
|
||||
reject(new Error(wechatChannelConfig.error.notWechat));
|
||||
const err = new Error(wechatChannelConfig.error.notWechat);
|
||||
this.handleError(err, item);
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,7 +138,9 @@ export const wechatChannelUtil = {
|
||||
const systemInfo = wx.getSystemInfoSync();
|
||||
const SDKVersion = systemInfo.SDKVersion;
|
||||
if (this.versionCompare(SDKVersion, wechatChannelConfig.wechat.minSdkVersion) < 0) {
|
||||
reject(new Error(wechatChannelConfig.error.lowVersion));
|
||||
const err = new Error(wechatChannelConfig.error.lowVersion);
|
||||
this.handleError(err, item);
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -155,7 +159,9 @@ export const wechatChannelUtil = {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
reject(new Error(wechatChannelConfig.error.notSupported));
|
||||
const err = new Error(wechatChannelConfig.error.notSupported);
|
||||
this.handleError(err, item);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -163,7 +169,7 @@ export const wechatChannelUtil = {
|
||||
// 统一错误处理
|
||||
handleError(err, item) {
|
||||
console.error('微信视频号错误:', err);
|
||||
const { errMsg = '微信视频播放失败', errCode = -1 } = err;
|
||||
const { message = '', errMsg = '微信视频播放失败!', errCode = -1 } = err;
|
||||
|
||||
// 错误码5: 表示用户点击了取消. openChannelsActivity:fail cancel
|
||||
if ([5].includes(errCode)) {
|
||||
@@ -172,7 +178,7 @@ export const wechatChannelUtil = {
|
||||
|
||||
const showErrorToast = (otherMsgs = []) => {
|
||||
uni.showToast({
|
||||
title: [errMsg, ...otherMsgs].join('\n'),
|
||||
title: [errMsg, message,...otherMsgs].join('\n'),
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user