Compare commits
59 Commits
8df59abd03
...
support/we
| Author | SHA1 | Date | |
|---|---|---|---|
| b3cc86d088 | |||
| 0ed0789528 | |||
| 16d1a3a945 | |||
| 392a8e2952 | |||
| db7a8d7202 | |||
| bb87f4b1d2 | |||
| fe039ed126 | |||
| 03c1a8d71a | |||
| 9e0cab7ec4 | |||
| a31c004508 | |||
| ee8c24cdf8 | |||
| b043601a77 | |||
| e20968aee2 | |||
| 8ceeca33b4 | |||
| 02e9cfa313 | |||
| 3f894bcb20 | |||
| 8d5d6e3da8 | |||
| ce1ea6eadf | |||
| 191c803f66 | |||
| 4e1448d2c4 | |||
| ce26a9be5f | |||
| 8b01d8f8ec | |||
| 6ab2834fdc | |||
| 85816e416c | |||
| bf8e177c30 | |||
| 57111a00c2 | |||
| aa7c7cbe60 | |||
| d012c7fff7 | |||
| 128d75b921 | |||
| 7e0d61c7e5 | |||
| 26af083839 | |||
| 68bc853dff | |||
| 13166132c7 | |||
| f87c7d963e | |||
| 6f6899deaa | |||
| 7f54666629 | |||
| 9ed337b59a | |||
| 31336f9a80 | |||
| 2f7c9bf0af | |||
| f8257361b5 | |||
| ec05534ff1 | |||
| 4f9c353e9a | |||
| 52b5f5b006 | |||
| 5a8663eb48 | |||
| 8108802204 | |||
| 6fe3bceb4b | |||
| ee4fbb277c | |||
| 6718010ceb | |||
| faf1f6d3d8 | |||
| 2d98a32efc | |||
| 7fde30063b | |||
| 10465b7cf2 | |||
| c7e9b497ae | |||
| de63cd4c6a | |||
| 2f230d3b2c | |||
| 6f01b3c1c6 | |||
| b10fcf02d4 | |||
| 6956841c8b | |||
| 90820ade30 |
@@ -38,6 +38,10 @@ const localDevConfig = ({
|
|||||||
uniacid: 1,
|
uniacid: 1,
|
||||||
domain: 'https://test.aigc-quickapp.com',
|
domain: 'https://test.aigc-quickapp.com',
|
||||||
},
|
},
|
||||||
|
'local-2': { // 测试平台
|
||||||
|
uniacid: 2,
|
||||||
|
domain: 'http://localhost:8050/',
|
||||||
|
},
|
||||||
})['2811']; // 选择要使用的环境配置
|
})['2811']; // 选择要使用的环境配置
|
||||||
|
|
||||||
export default localDevConfig;
|
export default localDevConfig;
|
||||||
@@ -20,6 +20,10 @@ try {
|
|||||||
// 默认域名, 自定义发行时可以修改
|
// 默认域名, 自定义发行时可以修改
|
||||||
let defaultDomain = '';
|
let defaultDomain = '';
|
||||||
|
|
||||||
|
// #ifdef H5_XCX_5G_QUICKAPP_COM
|
||||||
|
defaultDomain = 'https://xcx20.5g-quickapp.com';
|
||||||
|
// #endif
|
||||||
|
|
||||||
// #ifdef H5_XCX_AIGC_QUICKAPP_COM
|
// #ifdef H5_XCX_AIGC_QUICKAPP_COM
|
||||||
defaultDomain = 'https://xcx.aigc-quickapp.com/';
|
defaultDomain = 'https://xcx.aigc-quickapp.com/';
|
||||||
// #endif
|
// #endif
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export default {
|
|||||||
if (isJump && route != 'pages/index/index') {
|
if (isJump && route != 'pages/index/index') {
|
||||||
uni.setStorageSync('manual_change_store', true); // 手动切换门店
|
uni.setStorageSync('manual_change_store', true); // 手动切换门店
|
||||||
this.$store.dispatch('getCartNumber'); //重新获取购物车数据
|
this.$store.dispatch('getCartNumber'); //重新获取购物车数据
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ export default {
|
|||||||
},
|
},
|
||||||
goHome() {
|
goHome() {
|
||||||
if (this.preview) return; // 开启预览,禁止任何操作和跳转
|
if (this.preview) return; // 开启预览,禁止任何操作和跳转
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
},
|
},
|
||||||
goCart() {
|
goCart() {
|
||||||
if (this.preview) return; // 开启预览,禁止任何操作和跳转
|
if (this.preview) return; // 开启预览,禁止任何操作和跳转
|
||||||
|
|||||||
@@ -66,15 +66,16 @@ export default {
|
|||||||
|
|
||||||
const locale = uni.getStorageSync('lang') || "zh-cn"; //设置语言
|
const locale = uni.getStorageSync('lang') || "zh-cn"; //设置语言
|
||||||
|
|
||||||
var value = '';
|
let value = ''; // 存放解析后的语言值
|
||||||
|
let langPath = ''; // 存放当前页面语言包路径
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//公共语言包(同步加载)
|
//公共语言包(同步加载)
|
||||||
var lang = loadLangPackSync(locale, 'common');
|
var lang = loadLangPackSync(locale, 'common');
|
||||||
|
|
||||||
//当前页面语言包(同步加载)
|
//当前页面语言包(同步加载)
|
||||||
let route = _this.route;
|
let route = _this.route;
|
||||||
let langPath = processRoutePath(route);
|
langPath = processRoutePath(route);
|
||||||
console.log(`当前语言: ${locale}, 当前页面语言包路径: ${langPath}`);
|
|
||||||
|
|
||||||
// 加载当前页面语言包
|
// 加载当前页面语言包
|
||||||
let currentPageLang = loadLangPackSync(locale, langPath);
|
let currentPageLang = loadLangPackSync(locale, langPath);
|
||||||
@@ -102,7 +103,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('解析语言包失败:', e);
|
console.error('解析语言包失败:', e, { langPath, field, locale });
|
||||||
value = field;
|
value = field;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +116,10 @@ export default {
|
|||||||
if (value == undefined || (value == 'title' && field == 'title')) value = ''; // field
|
if (value == undefined || (value == 'title' && field == 'title')) value = ''; // field
|
||||||
|
|
||||||
// 多语言调试,注释后可以关闭控制台输出
|
// 多语言调试,注释后可以关闭控制台输出
|
||||||
console.log(`字段: ${field}, 值: ${value}`)
|
if (field == value) {
|
||||||
|
console.warn(`警告: 字段 ${field} 在语言包 ${langPath} 中未找到对应值,使用默认值 ${field} 当前语言: ${locale}`);
|
||||||
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
100
common/js/share.js
Normal file
100
common/js/share.js
Normal file
@@ -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
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -7,15 +7,19 @@ import {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 首页路径
|
// 关于页面路径,使用常量导出
|
||||||
export const INDEX_PAGE_URL = '/pages/index/index';
|
export const INDEX_PAGE_URL = '/pages/index/index';
|
||||||
|
export const CATEGORY_PAGE_URL = '/pages_goods/category';
|
||||||
|
export const CONTACT_PAGE_URL = '/pages_tool/contact/contact';
|
||||||
|
export const MEMBER_PAGE_URL = '/pages_tool/member/index';
|
||||||
|
export const LOGIN_PAGE_URL = '/pages_tool/login/login';
|
||||||
|
|
||||||
// 当前最新的tabBar.list (参见pages.json 中的tabBar.list 配置)
|
// 当前最新的tabBar.list (参见pages.json 中的tabBar.list 配置)
|
||||||
export const systemTabBarList = [
|
export const systemTabBarList = [
|
||||||
INDEX_PAGE_URL,
|
INDEX_PAGE_URL,
|
||||||
'/pages_goods/category',
|
CATEGORY_PAGE_URL,
|
||||||
'/pages_tool/contact/contact',
|
CONTACT_PAGE_URL,
|
||||||
'/pages_tool/member/index'
|
MEMBER_PAGE_URL
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,7 +93,7 @@ export const checkTabBarActive = (linkUrl, currentPageRoute) => {
|
|||||||
const linkUrlParts = adaptSubpackageUrl(linkUrl).split('/');
|
const linkUrlParts = adaptSubpackageUrl(linkUrl).split('/');
|
||||||
const currentPageRouteParts = currentPageRoute.split('/');
|
const currentPageRouteParts = currentPageRoute.split('/');
|
||||||
|
|
||||||
console.log('diy-bottom-nav verify:', { linkUrlParts, currentPageRouteParts});
|
// console.log('diy-bottom-nav verify:', { linkUrlParts, currentPageRouteParts});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 二级页面
|
// 二级页面
|
||||||
@@ -109,17 +113,24 @@ export const checkTabBarActive = (linkUrl, currentPageRoute) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
/** 导出页面URL常量 */
|
||||||
|
MEMBER_PAGE_URL,
|
||||||
|
CATEGORY_PAGE_URL,
|
||||||
|
CONTACT_PAGE_URL,
|
||||||
|
INDEX_PAGE_URL,
|
||||||
|
LOGIN_PAGE_URL,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面跳转
|
* 页面跳转
|
||||||
* @param {string} to 跳转链接 /pages/idnex/index
|
* @param {string} to 跳转链接 /pages/idnex/index
|
||||||
* @param {Object} param 参数 {key : value, ...}
|
* @param {Object} param 参数 {key : value, ...}, 默认{}
|
||||||
* @param {string} mode 模式
|
* @param {string} mode 模式 navigateTo、redirectTo、reLaunch、tabbar, 默认navigateTo
|
||||||
*/
|
*/
|
||||||
redirectTo(to, param, mode) {
|
redirectTo(to, param = {}, mode = 'navigateTo') {
|
||||||
let url = to;
|
let url = to;
|
||||||
|
|
||||||
// 替换url中的前缀
|
// 替换url中的前缀
|
||||||
console.log('redirectTo', to, param, mode);
|
console.log('页面跳转 redirectTo', to, param, mode);
|
||||||
url = adaptSubpackageUrl(url);
|
url = adaptSubpackageUrl(url);
|
||||||
console.log('adaptSubpackageUrl', url);
|
console.log('adaptSubpackageUrl', url);
|
||||||
|
|
||||||
@@ -146,26 +157,26 @@ export default {
|
|||||||
// 如果url不包含tabBarList中的路径,根据mode判断跳转方式
|
// 如果url不包含tabBarList中的路径,根据mode判断跳转方式
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case 'tabbar':
|
case 'tabbar':
|
||||||
// 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面。
|
// 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面。重置页面栈,仅保留 tabBar 页面
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url
|
url
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'redirectTo':
|
case 'redirectTo':
|
||||||
// 关闭当前页面,跳转到应用内的某个页面。
|
// 关闭当前页面,跳转到应用内的某个页面。替换栈顶页面,长度不变(上限10层)
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url
|
url
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'reLaunch':
|
case 'reLaunch':
|
||||||
// 关闭所有页面,打开到应用内的某个页面。
|
// 关闭所有页面,打开到应用内的某个页面。清空栈后打开新页面,长度=1
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url
|
url
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// 保留当前页面,跳转到应用内的某个页面
|
// 保留当前页面,跳转到应用内的某个页面,新增页面到栈顶,长度+1(上限10层)
|
||||||
console.log('保留当前页面,跳转到应用内的某个页面', url);
|
console.log('保留当前页面,navigateTo跳转到应用内的某个页面', url);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url
|
url
|
||||||
});
|
});
|
||||||
@@ -592,6 +603,9 @@ export default {
|
|||||||
}
|
}
|
||||||
return cloneObj
|
return cloneObj
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义模板的跳转链接
|
* 自定义模板的跳转链接
|
||||||
* @param {Object} link
|
* @param {Object} link
|
||||||
@@ -614,7 +628,6 @@ export default {
|
|||||||
|
|
||||||
} else if (link.appid) {
|
} else if (link.appid) {
|
||||||
// 跳转其他小程序
|
// 跳转其他小程序
|
||||||
|
|
||||||
uni.navigateToMiniProgram({
|
uni.navigateToMiniProgram({
|
||||||
appId: link.appid,
|
appId: link.appid,
|
||||||
path: link.page
|
path: link.page
|
||||||
@@ -622,7 +635,6 @@ export default {
|
|||||||
|
|
||||||
} else if (link.name == 'MOBILE' && !link.wap_url) {
|
} else if (link.name == 'MOBILE' && !link.wap_url) {
|
||||||
// 拨打电话
|
// 拨打电话
|
||||||
|
|
||||||
uni.makePhoneCall({
|
uni.makePhoneCall({
|
||||||
phoneNumber: link.mobile,
|
phoneNumber: link.mobile,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
@@ -792,7 +804,7 @@ export default {
|
|||||||
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
||||||
return routes.length ? routes[routes.length - 1].route : '';
|
return routes.length ? routes[routes.length - 1].route : '';
|
||||||
},
|
},
|
||||||
goBack(backUrl = '/pages/index/index') {
|
goBack(backUrl = INDEX_PAGE_URL) {
|
||||||
if (getCurrentPages().length == 1) {
|
if (getCurrentPages().length == 1) {
|
||||||
this.redirectTo(backUrl);
|
this.redirectTo(backUrl);
|
||||||
} else {
|
} else {
|
||||||
@@ -1148,5 +1160,74 @@ export default {
|
|||||||
verifyMobile(mobile) {
|
verifyMobile(mobile) {
|
||||||
var parse = /^\d{11}$/.test(mobile);
|
var parse = /^\d{11}$/.test(mobile);
|
||||||
return parse;
|
return parse;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 判断是否为快应用环境
|
||||||
|
* @returns {boolean} 是否为快应用
|
||||||
|
*/
|
||||||
|
isQuickApp() {
|
||||||
|
// #ifndef QUICKAPP-WEBVIEW
|
||||||
|
let _isQuickApp = false;
|
||||||
|
try {
|
||||||
|
const ua = navigator?.userAgent?.toLowerCase();
|
||||||
|
console.log('ua = ', ua);
|
||||||
|
_isQuickApp = ua.indexOf('quickapp') !== -1;
|
||||||
|
|
||||||
|
if (!_isQuickApp) {
|
||||||
|
// 特殊说明由于网站是嵌入到快应用的Webview组件中<web>,UA中不会包含quickapp字符串,
|
||||||
|
// 但是会包含uniacid参数,所以这里通过uniacid参数来判断是否为快应用环境
|
||||||
|
_isQuickApp = ua.indexOf('uniacid=') !== -1;
|
||||||
|
}
|
||||||
|
} catch (e) { }
|
||||||
|
|
||||||
|
if (!_isQuickApp) {
|
||||||
|
const systemInfo = this.getDeviceInfo();
|
||||||
|
_isQuickApp = systemInfo?.platform === 'quickapp' || process?.env?.UNI_PLATFORM === 'quickapp';
|
||||||
|
}
|
||||||
|
return _isQuickApp;
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 判断是否为华为快应用环境
|
||||||
|
* @returns {boolean} 是否为华为快应用
|
||||||
|
*/
|
||||||
|
isHuaweiQuickApp() {
|
||||||
|
if (!this.isQuickApp()) return false;
|
||||||
|
|
||||||
|
// #ifndef QUICKAPP-WEBVIEW-HUAWEI
|
||||||
|
const systemInfo = this.getDeviceInfo();
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
143
components-diy/css/common-channel.scss
Normal file
143
components-diy/css/common-channel.scss
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<view class="article-wrap" :style="warpCss">
|
<view class="article-wrap" :style="warpCss">
|
||||||
<view :class="['list-wrap', value.style]" :style="warpCss">
|
<view :class="['list-wrap', value.style]" :style="warpCss">
|
||||||
<!-- 自动垂直滚动 -->
|
<!-- 自动垂直滚动 -->
|
||||||
<swiper class="auto-scroll-swiper" :style="swiperStyle" :vertical="swiperConfig.vertical !== false"
|
<swiper class="auto-scroll-swiper" :style="[swiperStyle]" :vertical="swiperConfig.vertical !== false"
|
||||||
:autoplay="swiperConfig.autoplay !== false" :circular="swiperConfig.circular !== false"
|
:autoplay="swiperConfig.autoplay !== false" :circular="swiperConfig.circular !== false"
|
||||||
:interval="swiperConfig.interval || 3000" :duration="swiperConfig.duration || 500"
|
:interval="swiperConfig.interval || 3000" :duration="swiperConfig.duration || 500"
|
||||||
:display-multiple-items="safeDisplayMultipleItems">
|
:display-multiple-items="safeDisplayMultipleItems">
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export default {
|
|||||||
let linkUrl = link.wap_url;
|
let linkUrl = link.wap_url;
|
||||||
|
|
||||||
// 首页特殊处理
|
// 首页特殊处理
|
||||||
if (linkUrl === '/pages/index/index' && this.name === 'DIY_VIEW_INDEX') {
|
if (linkUrl === this.$util.INDEX_PAGE_URL && this.name === 'DIY_VIEW_INDEX') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
481
components-diy/diy-channel-list.vue
Normal file
481
components-diy/diy-channel-list.vue
Normal file
@@ -0,0 +1,481 @@
|
|||||||
|
<template>
|
||||||
|
<view :style="[componentStyle, { '--row-count': value.rowCount }]">
|
||||||
|
<!-- 轮播模式 -->
|
||||||
|
<swiper v-if="value.showStyle == 'carousel' && carouselConfig.type != 'hide'" :indicator-dots="isIndicatorDots"
|
||||||
|
:autoplay="carouselConfig.autoplay || false" :interval="carouselConfig.interval || 3000"
|
||||||
|
:duration="carouselConfig.duration || 500" :circular="carouselConfig.circular || false"
|
||||||
|
:style="swiperHeight" class="channel-swiper">
|
||||||
|
<swiper-item v-for="(slide, slideIndex) in swiperSlides" :key="slideIndex">
|
||||||
|
<view :class="['swiper-slide-content', 'row1-of' + value.rowCount]">
|
||||||
|
<view v-for="(item, index) in slide" :key="index" :class="['channel-item', value.mode]">
|
||||||
|
<!-- 视频号视频卡片,轮播模式 -->
|
||||||
|
<diy-channel-video :value="item" @video-play="playVideo" :list-mode="true"
|
||||||
|
:title-line-clamp="value.titleLineClamp" :show-play-btn="value.showPlayBtn"
|
||||||
|
:cover-style="computedCoverStyle" :play-btn-style="value.playBtnStyle"
|
||||||
|
:aspect-ratio="value.aspectRatio" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
|
||||||
|
<!-- 固定布局模式 -->
|
||||||
|
<view v-else-if="value.showStyle == 'fixed'" :class="['channel-list', 'row1-of' + value.rowCount]">
|
||||||
|
<view v-for="(item, index) in value.list" :key="index" class="channel-item">
|
||||||
|
<!-- 视频号视频卡片,列表模式 -->
|
||||||
|
<diy-channel-video :value="item" @video-play="playVideo" :list-mode="true"
|
||||||
|
:title-line-clamp="value.titleLineClamp" :show-play-btn="value.showPlayBtn"
|
||||||
|
:cover-style="computedCoverStyle" :play-btn-style="value.playBtnStyle"
|
||||||
|
:aspect-ratio="value.aspectRatio" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 其他布局模式(如滚动布局) -->
|
||||||
|
<scroll-view v-else
|
||||||
|
:class="['channel-nav', value.showStyle == 'fixed' ? 'fixed-layout' : value.showStyle, 'row1-of' + value.rowCount]"
|
||||||
|
:scroll-x="value.showStyle == 'singleSlide'">
|
||||||
|
<view class="uni-scroll-view-content">
|
||||||
|
<view v-for="(item, index) in value.list" :key="index" :class="['channel-nav-item', value.mode]">
|
||||||
|
<!-- 视频号视频卡片,滚动模式 -->
|
||||||
|
<diy-channel-video :value="item" @video-play="playVideo" :list-mode="true"
|
||||||
|
:title-line-clamp="value.titleLineClamp" :show-play-btn="value.showPlayBtn"
|
||||||
|
:cover-style="computedCoverStyle" :play-btn-style="value.playBtnStyle"
|
||||||
|
:aspect-ratio="value.aspectRatio" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* 微信视频号列表组件
|
||||||
|
* 支持多种布局模式,包括固定布局和滚动布局
|
||||||
|
* 可配置列数、视频高度、标题行数等属性
|
||||||
|
* 用于在页面中展示多个微信视频号视频
|
||||||
|
*/
|
||||||
|
import DiyMinx from './minx.js'
|
||||||
|
import { wechatChannelUtil, wechatChannelConfig } from './js/wechat-channel.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'diy-channel-list',
|
||||||
|
props: {
|
||||||
|
/**
|
||||||
|
* 组件配置数据
|
||||||
|
* @type {Object}
|
||||||
|
* @default () => ({})
|
||||||
|
* @property {string} showStyle - 显示样式,可选值:carousel, fixed, singleSlide
|
||||||
|
* @property {number} rowCount - 每行显示的视频数量
|
||||||
|
* @property {Array} list - 视频列表数据
|
||||||
|
* @property {string} componentBgColor - 组件背景色
|
||||||
|
* @property {string} componentAngle - 组件圆角类型,可选值:round
|
||||||
|
* @property {number} topAroundRadius - 顶部圆角半径
|
||||||
|
* @property {number} bottomAroundRadius - 底部圆角半径
|
||||||
|
* @property {Object} ornament - 装饰效果配置
|
||||||
|
* @property {number} titleLineClamp - 标题显示行数
|
||||||
|
* @property {string} aspectRatio - 视频比例,可选值:16:9, 3:4
|
||||||
|
* @property {boolean} showPlayBtn - 是否显示播放按钮
|
||||||
|
* @property {Object} coverStyle - 视频封面图样式
|
||||||
|
* @property {Object} playBtnStyle - 播放按钮样式
|
||||||
|
* @property {string} mode - 显示模式, 可选值:video, text, image, graphic
|
||||||
|
* @property {number} imageSize - 图片尺寸(仅在特定模式下使用)
|
||||||
|
* @property {number} pageCount - 每页显示的视频数量
|
||||||
|
* @property {Object} carousel - 轮播配置
|
||||||
|
* @property {string} carousel.type - 轮播类型,可选值:default, hide
|
||||||
|
* @property {boolean} carousel.autoplay - 是否自动播放,默认false
|
||||||
|
* @property {number} carousel.interval - 自动播放间隔,默认3000ms
|
||||||
|
* @property {number} carousel.duration - 切换动画时长,默认500ms
|
||||||
|
* @property {boolean} carousel.circular - 是否循环播放,默认false
|
||||||
|
*/
|
||||||
|
value: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mixins: [DiyMinx],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pageWidth: '', // 页面宽度
|
||||||
|
indicatorDots: false, // 是否显示轮播指示器
|
||||||
|
swiperCurrent: 0 // 当前轮播索引
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
// 组件创建时的逻辑
|
||||||
|
// 可以在这里进行初始化操作,如获取页面宽度等
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
/**
|
||||||
|
* 组件刷新监听
|
||||||
|
* 当组件需要刷新时触发
|
||||||
|
* @param {*} newValue - 新值
|
||||||
|
*/
|
||||||
|
componentRefresh(newValue) {
|
||||||
|
// 监听组件刷新
|
||||||
|
// 可以在这里处理组件刷新时的逻辑
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
carouselConfig() {
|
||||||
|
return this.value?.carousel || {
|
||||||
|
type: 'default',
|
||||||
|
autoplay: false,
|
||||||
|
interval: 3000,
|
||||||
|
duration: 500,
|
||||||
|
circular: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件样式
|
||||||
|
* 根据配置动态生成样式字符串,包括背景色、圆角、阴影和边框
|
||||||
|
* @returns {string} 样式字符串
|
||||||
|
*/
|
||||||
|
componentStyle() {
|
||||||
|
let style = '';
|
||||||
|
// 背景色
|
||||||
|
if (this.value?.componentBgColor) {
|
||||||
|
style += 'background-color:' + 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 += 'box-shadow:' + (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 : '') + ';';
|
||||||
|
|
||||||
|
return style;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轮播高度
|
||||||
|
* 根据模式和配置计算轮播高度
|
||||||
|
* @returns {string} 轮播高度样式
|
||||||
|
*/
|
||||||
|
swiperHeight() {
|
||||||
|
let height = 0;
|
||||||
|
|
||||||
|
const pageCount = this.value?.pageCount || 1;
|
||||||
|
|
||||||
|
// 根据不同模式计算高度
|
||||||
|
if (this.value?.mode == 'graphic') {
|
||||||
|
height = (49 + this.value?.imageSize) * pageCount;
|
||||||
|
} else if (this.value?.mode == 'img') {
|
||||||
|
height = (22 + this.value?.imageSize) * pageCount;
|
||||||
|
} else if (this.value?.mode == 'text') {
|
||||||
|
height = 43 * pageCount;
|
||||||
|
} else { // 默认视频模式
|
||||||
|
if (this.value?.aspectRatio == '16:9') {
|
||||||
|
height = [250, 160, 140, 120][this.value.rowCount - 1];
|
||||||
|
} else {
|
||||||
|
height = [510, 280, 220, 180][this.value.rowCount - 1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'height:' + (2 * height) + 'rpx';
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否显示指示器
|
||||||
|
* 根据轮播配置和列表长度判断是否显示指示器
|
||||||
|
* @returns {boolean} 是否显示指示器
|
||||||
|
*/
|
||||||
|
isIndicatorDots() {
|
||||||
|
// 当轮播类型不是隐藏,且视频数量超过一页时显示指示器
|
||||||
|
const pageCount = this.value?.pageCount || 1;
|
||||||
|
return this.value?.carousel?.type != 'hide' && Math.ceil(this.value?.list?.length / (pageCount * this.value?.rowCount)) > 1
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轮播幻灯片数据
|
||||||
|
* 将视频列表分割成轮播所需的幻灯片数据
|
||||||
|
* @returns {Array} 轮播幻灯片数据
|
||||||
|
*/
|
||||||
|
swiperSlides() {
|
||||||
|
const slides = [];
|
||||||
|
const list = this.value?.list || [];
|
||||||
|
const pageSize = (this.value?.pageCount || 1) * (this.value?.rowCount || 1);
|
||||||
|
|
||||||
|
// 将列表数据分割成每页显示的数量
|
||||||
|
for (let i = 0; i < list.length; i += pageSize) {
|
||||||
|
slides.push(list.slice(i, i + pageSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
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: {
|
||||||
|
/**
|
||||||
|
* 播放视频
|
||||||
|
* 触发 video-play 事件,并在微信小程序中调用视频播放接口
|
||||||
|
* @param {Object} item - 视频数据对象
|
||||||
|
*/
|
||||||
|
async playVideo(item) {
|
||||||
|
await this.__$emitEvent({
|
||||||
|
eventName: 'video-play',
|
||||||
|
data: item,
|
||||||
|
promiseCallback: async (event, handler, awaitedResult) => {
|
||||||
|
if (!awaitedResult) return;
|
||||||
|
try {
|
||||||
|
// 发送视频被点击播放事件
|
||||||
|
this.$emit('channel-video-click-play', item);
|
||||||
|
console.log('播放视频:', item);
|
||||||
|
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
// 在微信小程序环境中调用视频播放接口
|
||||||
|
await wechatChannelUtil.playVideo(item);
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
if (item?.channelType === 'wechat') {
|
||||||
|
uni.showToast({
|
||||||
|
title: '视频号仅支持在微信小程序环境中播放',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 在非微信小程序环境中,直接触发事件
|
||||||
|
this.$emit('video-play', item);
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
} catch (err) {
|
||||||
|
console.error('打开视频号失败', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片加载错误处理
|
||||||
|
* 当图片加载失败时,设置默认图片
|
||||||
|
* @param {number} index - 图片索引
|
||||||
|
*/
|
||||||
|
imgError(index) {
|
||||||
|
// 图片加载失败的处理逻辑
|
||||||
|
console.log('图片加载失败:', index);
|
||||||
|
// 为失败的图片设置默认图片
|
||||||
|
const item = this.value.list[index];
|
||||||
|
if (item) {
|
||||||
|
// 使用默认图片替代加载失败的图片
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
item.coverUrl = wechatChannelConfig.video.defaultCoverUrl;
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import './css/common-channel.scss';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表布局样式
|
||||||
|
*/
|
||||||
|
.channel-list {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(var(--row-count, 2), 1fr);
|
||||||
|
gap: 8px;
|
||||||
|
padding: 16px 16px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导航布局样式
|
||||||
|
* 支持固定布局和滚动布局
|
||||||
|
*/
|
||||||
|
.channel-nav {
|
||||||
|
padding: 16rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.uni-scroll-view-content {
|
||||||
|
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 {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 280rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.channel-nav-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1 列布局
|
||||||
|
&.row1-of1 {
|
||||||
|
.uni-scroll-view-content {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2 列布局
|
||||||
|
&.row1-of2 {
|
||||||
|
.uni-scroll-view-content {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3 列布局
|
||||||
|
&.row1-of3 {
|
||||||
|
.uni-scroll-view-content {
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4 列布局
|
||||||
|
&.row1-of4 {
|
||||||
|
.uni-scroll-view-content {
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确保所有视频卡片高度一致
|
||||||
|
*/
|
||||||
|
.channel-item,
|
||||||
|
.channel-nav-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轮播样式
|
||||||
|
* 支持轮播模式的布局和样式
|
||||||
|
*/
|
||||||
|
.channel-swiper {
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.swiper-slide-content {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(var(--row-count, 2), 1fr);
|
||||||
|
gap: 16rpx;
|
||||||
|
padding: 16rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.channel-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 轮播模式下的 1 列布局
|
||||||
|
&.row1-of1 {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 轮播模式下的 2 列布局
|
||||||
|
&.row1-of2 {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 轮播模式下的 3 列布局
|
||||||
|
&.row1-of3 {
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 轮播模式下的 4 列布局
|
||||||
|
&.row1-of4 {
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 响应式调整
|
||||||
|
* 在小屏幕设备上调整布局和间距
|
||||||
|
*/
|
||||||
|
@media (max-width: 375px) {
|
||||||
|
|
||||||
|
.channel-list,
|
||||||
|
.channel-nav,
|
||||||
|
.channel-swiper .swiper-slide-content {
|
||||||
|
gap: 12rpx;
|
||||||
|
padding: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 小屏幕上的单滑动模式
|
||||||
|
.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 比例
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }</style>
|
||||||
484
components-diy/diy-channel-video.vue
Normal file
484
components-diy/diy-channel-video.vue
Normal file
@@ -0,0 +1,484 @@
|
|||||||
|
<template>
|
||||||
|
<view class="channel-video" :class="{ 'list-mode': listMode }">
|
||||||
|
<!-- 嵌入式视频播放 -->
|
||||||
|
<view v-if="canUseEmbedMode" class="embed-video-container">
|
||||||
|
<view class="video-cover-wrap" :style="[coverStyle]">
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<native-component>
|
||||||
|
<!-- 嵌入式视频播放组件 -->
|
||||||
|
<channel-video :feed-id="value.feedId" :finder-user-name="value.finderUserName"
|
||||||
|
:feed-token="value.feedToken" :auto-play="autoPlay">
|
||||||
|
</channel-video>
|
||||||
|
</native-component>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
<view class="video-info">
|
||||||
|
<!-- 视频标题,支持多行显示控制 -->
|
||||||
|
<view class="video-title" :style="{ '--title-line-clamp': titleLineClamp }">{{ value.videoTitle }}
|
||||||
|
</view>
|
||||||
|
<!-- 视频统计信息 -->
|
||||||
|
<view class="video-stats" v-if="value.showViewCount">{{ value.viewCount }}次观看</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 跳转式视频播放 -->
|
||||||
|
<view v-else @click.stop="playVideo" class="video-container">
|
||||||
|
<view class="video-cover-wrap" :style="[coverStyle]">
|
||||||
|
<image class="video-cover" :src="$util.img(value.coverUrl)" mode="aspectFill"></image>
|
||||||
|
<view class="channel-play-btn" v-if="showPlayBtn" :style="[playBtnStyle]">
|
||||||
|
<view class="play-icon-css"></view>
|
||||||
|
</view>
|
||||||
|
<view class="video-stats-overlay" v-if="value.showViewCount">
|
||||||
|
{{ value.viewCount }}次观看
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="video-info">
|
||||||
|
<!-- 视频标题,支持多行显示控制 -->
|
||||||
|
<view class="video-title" :style="{ '--title-line-clamp': titleLineClamp }">{{ value.videoTitle }}
|
||||||
|
</view>
|
||||||
|
<!-- 视频统计信息,非列表模式下显示 -->
|
||||||
|
<view class="video-stats" v-if="value.showViewCount && !listMode">{{ value.viewCount }}次观看</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import { wechatChannelUtil, wechatChannelConfig } from './js/wechat-channel.js'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信视频号视频卡片组件
|
||||||
|
* 支持嵌入式播放和跳转式播放两种模式
|
||||||
|
* 可配置列表模式、视频高度、标题行数等属性
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
name: 'diy-channel-video',
|
||||||
|
props: {
|
||||||
|
/**
|
||||||
|
* 视频数据对象
|
||||||
|
* @type {Object}
|
||||||
|
* @required
|
||||||
|
* @property {string} feedId - 视频 feedId
|
||||||
|
* @property {string} feedToken - 视频 token
|
||||||
|
* @property {string} coverUrl - 视频封面图
|
||||||
|
* @property {string} videoTitle - 视频标题
|
||||||
|
* @property {number} viewCount - 观看次数
|
||||||
|
* @property {boolean} showViewCount - 是否显示观看次数
|
||||||
|
* @property {boolean} embedMode - 是否启用嵌入式播放
|
||||||
|
*/
|
||||||
|
value: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 是否为列表模式
|
||||||
|
* @type {boolean}
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
listMode: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 标题显示行数
|
||||||
|
* @type {number}
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
titleLineClamp: {
|
||||||
|
type: Number,
|
||||||
|
default: 1
|
||||||
|
},
|
||||||
|
/** 是否显示播放按钮 */
|
||||||
|
showPlayBtn: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 视频封面图样式
|
||||||
|
* 采用 16:9 比例的响应式高度
|
||||||
|
*/
|
||||||
|
coverStyle: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({
|
||||||
|
width: '100%',
|
||||||
|
height: '0',
|
||||||
|
paddingTop: '56.25%' // 16:9 比例
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 播放按钮样式
|
||||||
|
*/
|
||||||
|
playBtnStyle: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({
|
||||||
|
width: '60rpx',
|
||||||
|
height: '60rpx',
|
||||||
|
borderRadius: '30rpx',
|
||||||
|
backgroundColor: 'rgba(0, 0, 0, 0.6)'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 是否自动播放 */
|
||||||
|
autoPlay: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
/**
|
||||||
|
* 是否支持嵌入式播放
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
canUseEmbedMode() {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
const enableEmbedMode = Boolean(this.value?.embedMode)
|
||||||
|
&& Boolean(this.value?.feedToken)
|
||||||
|
&& wechatChannelUtil.isEmbedModeSupported();
|
||||||
|
console.log('enableEmbedMode', enableEmbedMode);
|
||||||
|
return enableEmbedMode;
|
||||||
|
// #endif
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 播放视频
|
||||||
|
* 触发 video-play 事件,由父组件处理具体播放逻辑
|
||||||
|
*/
|
||||||
|
async playVideo() {
|
||||||
|
this.$emit('video-play', this.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import './css/common-channel.scss';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频卡片容器样式
|
||||||
|
* 包含卡片基础样式、悬停效果和列表模式样式
|
||||||
|
*/
|
||||||
|
.channel-video {
|
||||||
|
position: relative;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||||
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
// 悬停效果
|
||||||
|
&:hover {
|
||||||
|
transform: translateY(-4rpx);
|
||||||
|
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 列表模式样式调整
|
||||||
|
&.list-mode {
|
||||||
|
border-radius: 10rpx;
|
||||||
|
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.08);
|
||||||
|
|
||||||
|
.video-info {
|
||||||
|
padding: 14rpx;
|
||||||
|
|
||||||
|
.video-title {
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-bottom: 6rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频容器样式
|
||||||
|
* 用于跳转式播放模式
|
||||||
|
*/
|
||||||
|
.video-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 嵌入式视频容器样式
|
||||||
|
* 与视频容器样式保持一致
|
||||||
|
*/
|
||||||
|
.embed-video-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频封面容器
|
||||||
|
*/
|
||||||
|
.video-cover-wrap {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
padding-top: 56.25%;
|
||||||
|
/* 16:9 比例 */
|
||||||
|
height: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 12rpx 12rpx 0 0;
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
|
||||||
|
// 悬停时缩放效果
|
||||||
|
.channel-video:hover & {
|
||||||
|
transform: scale(1.02);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 列表模式下的边框圆角调整
|
||||||
|
.channel-video.list-mode & {
|
||||||
|
border-radius: 10rpx 10rpx 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频封面图片
|
||||||
|
* 绝对定位填充整个容器
|
||||||
|
*/
|
||||||
|
.video-cover {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频统计信息遮罩
|
||||||
|
* 显示在视频封面底部
|
||||||
|
*/
|
||||||
|
.video-stats-overlay {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
|
||||||
|
padding: 12rpx 16rpx;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 20rpx;
|
||||||
|
text-align: right;
|
||||||
|
font-weight: 500;
|
||||||
|
transition: opacity 0.3s ease;
|
||||||
|
|
||||||
|
// 悬停时的透明度变化
|
||||||
|
.channel-video:hover & {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.channel-video:not(:hover) & {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频信息区域
|
||||||
|
* 包含标题和统计信息
|
||||||
|
*/
|
||||||
|
.video-info {
|
||||||
|
padding: 16rpx;
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
background-color: #fff;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
|
|
||||||
|
// 悬停时的背景色变化
|
||||||
|
.channel-video:hover & {
|
||||||
|
background-color: #fafafa;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频标题
|
||||||
|
* 支持多行显示控制和渐变遮罩效果
|
||||||
|
*/
|
||||||
|
.video-title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #222;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
line-height: 1.4;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: var(--title-line-clamp, 2);
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
transition: color 0.3s ease;
|
||||||
|
position: relative;
|
||||||
|
word-break: break-all;
|
||||||
|
word-wrap: break-word;
|
||||||
|
white-space: normal;
|
||||||
|
|
||||||
|
// 悬停时的颜色变化
|
||||||
|
.channel-video:hover & {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 列表模式下的样式调整
|
||||||
|
.channel-video.list-mode & {
|
||||||
|
-webkit-line-clamp: var(--title-line-clamp, 1);
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-bottom: 6rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加渐变遮罩效果,让过长的文字有柔和的结束
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 1.4em;
|
||||||
|
background: linear-gradient(to right, transparent, #fff 90%);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 列表模式下的遮罩高度调整
|
||||||
|
.channel-video.list-mode &::after {
|
||||||
|
height: 1.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据行数调整遮罩高度
|
||||||
|
&[style*="--title-line-clamp: 1"]::after {
|
||||||
|
height: 1.4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
&[style*="--title-line-clamp: 3"]::after {
|
||||||
|
height: 4.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
&[style*="--title-line-clamp: 4"]::after {
|
||||||
|
height: 5.6em;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 列表模式下的多行遮罩高度调整
|
||||||
|
.channel-video.list-mode &[style*="--title-line-clamp: 1"]::after {
|
||||||
|
height: 1.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.channel-video.list-mode &[style*="--title-line-clamp: 3"]::after {
|
||||||
|
height: 3.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.channel-video.list-mode &[style*="--title-line-clamp: 4"]::after {
|
||||||
|
height: 5.2em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频统计信息
|
||||||
|
* 显示观看次数等数据
|
||||||
|
*/
|
||||||
|
.video-stats {
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-top: 6rpx;
|
||||||
|
transition: color 0.3s ease;
|
||||||
|
|
||||||
|
// 悬停时的颜色变化
|
||||||
|
.channel-video:hover & {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表模式下的播放按钮样式
|
||||||
|
* 更小的尺寸和悬停效果
|
||||||
|
*/
|
||||||
|
.channel-video.list-mode .channel-play-btn {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
// 悬停效果
|
||||||
|
&:hover {
|
||||||
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 播放图标尺寸
|
||||||
|
.play-icon {
|
||||||
|
width: 25rpx;
|
||||||
|
height: 25rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用播放按钮样式优化
|
||||||
|
* 添加悬停效果
|
||||||
|
*/
|
||||||
|
.channel-play-btn {
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
// 悬停效果
|
||||||
|
&:hover {
|
||||||
|
background-color: rgba(0, 0, 0, 0.6);
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纯 CSS 播放按钮图标
|
||||||
|
*/
|
||||||
|
.play-icon-css {
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-top: 12rpx solid transparent;
|
||||||
|
border-bottom: 12rpx solid transparent;
|
||||||
|
border-left: 18rpx solid #fff;
|
||||||
|
margin-left: 4rpx;
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
|
||||||
|
// 悬停时的缩放效果
|
||||||
|
.channel-play-btn:hover & {
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 列表模式下的尺寸调整
|
||||||
|
.channel-video.list-mode & {
|
||||||
|
border-top: 10rpx solid transparent;
|
||||||
|
border-bottom: 10rpx solid transparent;
|
||||||
|
border-left: 15rpx solid #fff;
|
||||||
|
margin-left: 3rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原生组件样式控制
|
||||||
|
* 确保 native-component 和 channel-video 正确填充容器
|
||||||
|
*/
|
||||||
|
native-component {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* channel-video 组件样式控制
|
||||||
|
* 避免受到 wx-channel-video 全局样式的影响
|
||||||
|
*/
|
||||||
|
channel-video {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
min-width: 100%;
|
||||||
|
min-height: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -454,7 +454,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$refs.login.open('/pages/index/index');
|
this.$refs.login.open(this.$util.INDEX_PAGE_URL);
|
||||||
this.couponBtnSwitch = false;
|
this.couponBtnSwitch = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export default {
|
|||||||
|
|
||||||
// 页面跳转
|
// 页面跳转
|
||||||
redirectTo(item) {
|
redirectTo(item) {
|
||||||
if (!item.wap_url || this.$util.getCurrRoute() != 'pages/member/index' || this.storeToken) {
|
if (!item.wap_url || this.$util.getCurrRoute() != this.$util.MEMBER_PAGE_URL || this.storeToken) {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
this.$util.diyRedirectTo(item);
|
this.$util.diyRedirectTo(item);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export default {
|
|||||||
this.currentRoute = '/' + currentPage.route;
|
this.currentRoute = '/' + currentPage.route;
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo(
|
this.$util.redirectTo(
|
||||||
'/pages_tool/login/login',
|
this.$util.LOGIN_PAGE_URL,
|
||||||
{
|
{
|
||||||
back: this.currentRoute
|
back: this.currentRoute
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ export default {
|
|||||||
redirectTo(link) {
|
redirectTo(link) {
|
||||||
|
|
||||||
if (link.wap_url) {
|
if (link.wap_url) {
|
||||||
if (this.$util.getCurrRoute() == 'pages/member/index' && !this.storeToken) {
|
if (this.$util.getCurrRoute() == this.$util.MEMBER_PAGE_URL && !this.storeToken) {
|
||||||
this.$refs.login.open(link.wap_url);
|
this.$refs.login.open(link.wap_url);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,6 +251,11 @@
|
|||||||
<diy-icon :value="item"></diy-icon>
|
<diy-icon :value="item"></diy-icon>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template v-if="['ChannelList', 'WechatChannel'].includes(item.componentName)">
|
||||||
|
<!-- 视频号列表 -->
|
||||||
|
<diy-channel-list :value="item"></diy-channel-list>
|
||||||
|
</template>
|
||||||
|
|
||||||
<!-- 自定义扩展组件 -->
|
<!-- 自定义扩展组件 -->
|
||||||
<diy-comp-extend :value="item"></diy-comp-extend>
|
<diy-comp-extend :value="item"></diy-comp-extend>
|
||||||
</view>
|
</view>
|
||||||
@@ -260,8 +265,8 @@
|
|||||||
<script>
|
<script>
|
||||||
// 组件组展示
|
// 组件组展示
|
||||||
import DiyMinx from './minx.js'
|
import DiyMinx from './minx.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
|
||||||
props: {
|
props: {
|
||||||
diyData: {
|
diyData: {
|
||||||
type: Object
|
type: Object
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export default {
|
|||||||
|
|
||||||
// 页面跳转
|
// 页面跳转
|
||||||
redirectTo(link) {
|
redirectTo(link) {
|
||||||
if (!link.wap_url || this.$util.getCurrRoute() != 'pages/member/index' || this.storeToken) {
|
if (!link.wap_url || this.$util.getCurrRoute() != this.$util.MEMBER_PAGE_URL || this.storeToken) {
|
||||||
this.$util.diyRedirectTo(link);
|
this.$util.diyRedirectTo(link);
|
||||||
} else {
|
} else {
|
||||||
this.$refs.login.open(link.wap_url);
|
this.$refs.login.open(link.wap_url);
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
redirectTo(link) {
|
redirectTo(link) {
|
||||||
if (link.wap_url) {
|
if (link.wap_url) {
|
||||||
if (this.$util.getCurrRoute() == 'pages/member/index' && !this.storeToken) {
|
if (this.$util.getCurrRoute() == this.$util.MEMBER_PAGE_URL && !this.storeToken) {
|
||||||
this.$refs.login.open(link.wap_url);
|
this.$refs?.login?.open(link.wap_url);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
@click.stop="modifyInfo()">{{ langIndex == 0 ? 'CN' : 'EN' }}</view>
|
@click.stop="modifyInfo()">{{ langIndex == 0 ? 'CN' : 'EN' }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info-wrap" v-else :style="infoStyle" @click="redirect('/pages/member/index')">
|
<view class="info-wrap" v-else :style="infoStyle" @click="redirect($util.MEMBER_PAGE_URL)">
|
||||||
<view class="headimg">
|
<view class="headimg">
|
||||||
<image :src="$util.getDefaultImage().head" mode="widthFix"></image>
|
<image :src="$util.getDefaultImage().head" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
@@ -545,7 +545,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
redirectBeforeAuth(url) {
|
redirectBeforeAuth(url) {
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$refs.login.open('/pages/member/index');
|
this.$refs.login.open(this.$util.MEMBER_PAGE_URL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -583,7 +583,7 @@ export default {
|
|||||||
url: '/wechat/api/wechat/authcode',
|
url: '/wechat/api/wechat/authcode',
|
||||||
data: {
|
data: {
|
||||||
scopes: 'snsapi_userinfo',
|
scopes: 'snsapi_userinfo',
|
||||||
redirect_url: this.$config.h5Domain + '/pages/member/index'
|
redirect_url: this.$config.h5Domain + this.$util.MEMBER_PAGE_URL
|
||||||
},
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
if (res.code >= 0) {
|
if (res.code >= 0) {
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ export default {
|
|||||||
/* 点赞 */
|
/* 点赞 */
|
||||||
giveLike(noteId, index) {
|
giveLike(noteId, index) {
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$refs.login.open('/pages/index/index');
|
this.$refs.login.open(this.$util.INDEX_PAGE_URL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export default {
|
|||||||
},
|
},
|
||||||
redirectTo(link) {
|
redirectTo(link) {
|
||||||
if (link.wap_url) {
|
if (link.wap_url) {
|
||||||
if (this.$util.getCurrRoute() == 'pages/member/index' && !this.storeToken) {
|
if (this.$util.getCurrRoute() == this.$util.MEMBER_PAGE_URL && !this.storeToken) {
|
||||||
this.$refs.login.open(link.wap_url);
|
this.$refs.login.open(link.wap_url);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
redirectTo(link) {
|
redirectTo(link) {
|
||||||
if (link.wap_url) {
|
if (link.wap_url) {
|
||||||
if (this.$util.getCurrRoute() == 'pages/member/index' && !this.storeToken) {
|
if (this.$util.getCurrRoute() == this.$util.MEMBER_PAGE_URL && !this.storeToken) {
|
||||||
this.$refs.login.open(link.wap_url);
|
this.$refs.login.open(link.wap_url);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ export default {
|
|||||||
},
|
},
|
||||||
redirectTo(link) {
|
redirectTo(link) {
|
||||||
if (link.wap_url) {
|
if (link.wap_url) {
|
||||||
if (this.$util.getCurrRoute() == 'pages/member/index' && !this.storeToken) {
|
if (this.$util.getCurrRoute() == this.$util.MEMBER_PAGE_URL && !this.storeToken) {
|
||||||
this.$refs.login.open(link.wap_url);
|
this.$refs.login.open(link.wap_url);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
188
components-diy/js/wechat-channel.js
Normal file
188
components-diy/js/wechat-channel.js
Normal file
@@ -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();
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -270,7 +270,7 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export default {
|
|||||||
if (this.emptyBtn.url) {
|
if (this.emptyBtn.url) {
|
||||||
this.$util.redirectTo(this.emptyBtn.url, {}, 'redirectTo');
|
this.$util.redirectTo(this.emptyBtn.url, {}, 'redirectTo');
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
re(text) {
|
re(text) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
addCart(config, data, event) {
|
addCart(config, data, event) {
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$refs.login.open('/pages/index/index')
|
this.$refs.login.open(this.$util.INDEX_PAGE_URL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (config == "detail" || data.is_virtual) {
|
if (config == "detail" || data.is_virtual) {
|
||||||
|
|||||||
@@ -413,7 +413,7 @@
|
|||||||
this.isLoad = false;
|
this.isLoad = false;
|
||||||
if (callback) callback();
|
if (callback) callback();
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -441,7 +441,7 @@
|
|||||||
this.skuId = res.data[0].sku_id;
|
this.skuId = res.data[0].sku_id;
|
||||||
this.goodsSkuInfo = obj;
|
this.goodsSkuInfo = obj;
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -467,7 +467,7 @@
|
|||||||
this.skuId = res.data[0].sku_id;
|
this.skuId = res.data[0].sku_id;
|
||||||
this.goodsSkuInfo = obj;
|
this.goodsSkuInfo = obj;
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -500,7 +500,7 @@
|
|||||||
this.skuId = res.data[0].sku_id;
|
this.skuId = res.data[0].sku_id;
|
||||||
this.goodsSkuInfo = obj;
|
this.goodsSkuInfo = obj;
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -527,7 +527,7 @@
|
|||||||
this.skuId = res.data[0].sku_id;
|
this.skuId = res.data[0].sku_id;
|
||||||
this.goodsSkuInfo = obj;
|
this.goodsSkuInfo = obj;
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -553,7 +553,7 @@
|
|||||||
this.skuId = res.data[0].sku_id;
|
this.skuId = res.data[0].sku_id;
|
||||||
this.goodsSkuInfo = obj;
|
this.goodsSkuInfo = obj;
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -579,7 +579,7 @@
|
|||||||
this.skuId = res.data[0].sku_id;
|
this.skuId = res.data[0].sku_id;
|
||||||
this.goodsSkuInfo = obj;
|
this.goodsSkuInfo = obj;
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -606,7 +606,7 @@
|
|||||||
this.skuId = res.data[0].sku_id;
|
this.skuId = res.data[0].sku_id;
|
||||||
this.goodsSkuInfo = obj;
|
this.goodsSkuInfo = obj;
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -630,7 +630,7 @@
|
|||||||
this.skuId = res.data[0].sku_id;
|
this.skuId = res.data[0].sku_id;
|
||||||
this.goodsSkuInfo = obj;
|
this.goodsSkuInfo = obj;
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -42,26 +42,22 @@
|
|||||||
|
|
||||||
<!-- 协议勾选 -->
|
<!-- 协议勾选 -->
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
<view
|
<view class="iconfont"
|
||||||
class="iconfont"
|
|
||||||
:class="isAgree ? 'icon-fuxuankuang1 color-base-text' : 'icon-fuxuankuang2'"
|
:class="isAgree ? 'icon-fuxuankuang1 color-base-text' : 'icon-fuxuankuang2'"
|
||||||
@click="isAgree = !isAgree"
|
@click="isAgree = !isAgree"></view>
|
||||||
></view>
|
|
||||||
<view style="text-align: left; margin-left: 10rpx; padding-top: 2rpx; font-size: 28rpx;">
|
<view style="text-align: left; margin-left: 10rpx; padding-top: 2rpx; font-size: 28rpx;">
|
||||||
我同意
|
我同意
|
||||||
<text style="color: #4395ff;" @click="tourl('/pages_tool/agreement/contenr?type=0')">《隐私条款》</text>
|
<text style="color: #4395ff;"
|
||||||
<text style="color: #4395ff;" @click="tourl('/pages_tool/agreement/contenr?type=1')">《用户服务协议》</text>
|
@click="tourl('/pages_tool/agreement/contenr?type=0')">《隐私条款》</text>
|
||||||
|
<text style="color: #4395ff;"
|
||||||
|
@click="tourl('/pages_tool/agreement/contenr?type=1')">《用户服务协议》</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 手机号授权按钮 -->
|
<!-- 手机号授权按钮 -->
|
||||||
<block v-if="isAgree">
|
<block v-if="isAgree">
|
||||||
<button
|
<button class="auth-login save-btn border-0" style="border: none;" open-type="getPhoneNumber"
|
||||||
class="auth-login save-btn border-0"
|
@getphonenumber="getPhoneNumber">
|
||||||
style="border: none;"
|
|
||||||
open-type="getPhoneNumber"
|
|
||||||
@getphonenumber="getPhoneNumber"
|
|
||||||
>
|
|
||||||
<text style="color: #fff; font-size: 30rpx;">同意隐私协议并授权手机号</text>
|
<text style="color: #fff; font-size: 30rpx;">同意隐私协议并授权手机号</text>
|
||||||
</button>
|
</button>
|
||||||
</block>
|
</block>
|
||||||
@@ -71,7 +67,8 @@
|
|||||||
</button>
|
</button>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<view @click="closeLogin" style="font-size: 30rpx; color: #888; text-align: center; padding-top: 10rpx;">
|
<view @click="closeLogin"
|
||||||
|
style="font-size: 30rpx; color: #888; text-align: center; padding-top: 10rpx;">
|
||||||
暂不登录
|
暂不登录
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -254,7 +251,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
open(url) {
|
open(url = '', mode = 'navigateTo') {
|
||||||
if (url) this.url = url;
|
if (url) this.url = url;
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
this.getCode(authData => {
|
this.getCode(authData => {
|
||||||
@@ -266,28 +263,33 @@ export default {
|
|||||||
if (this.$util.isWeChatMiniProgram()) {
|
if (this.$util.isWeChatMiniProgram()) {
|
||||||
// 微信小程序环境,使用微信授权登录
|
// 微信小程序环境,使用微信授权登录
|
||||||
let authData = uni.getStorageSync('authInfo');
|
let authData = uni.getStorageSync('authInfo');
|
||||||
if (authData) this.authLogin(authData);
|
if (authData) {
|
||||||
else this.getCode();
|
this.authLogin(authData);
|
||||||
|
} else {
|
||||||
|
this.getCode(authData => {
|
||||||
|
this.authLogin(authData, 'authOnlyLogin');
|
||||||
|
});
|
||||||
|
}
|
||||||
} else if (this.$util.isWeiXin()) {
|
} else if (this.$util.isWeiXin()) {
|
||||||
// 微信浏览器环境,显示登录页面
|
// 微信浏览器环境,显示登录页面
|
||||||
this.toLogin();
|
this.toLogin(mode);
|
||||||
} else {
|
} else {
|
||||||
// 其他浏览器环境,显示登录页面
|
// 其他浏览器环境,显示登录页面
|
||||||
this.toLogin();
|
this.toLogin(mode);
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifndef MP || H5
|
// #ifndef MP || H5
|
||||||
this.toLogin();
|
this.toLogin(mode);
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
// 跳转去登录页
|
// 跳转去登录页
|
||||||
toLogin() {
|
toLogin(mode = 'navigateTo') {
|
||||||
if (this.url) this.$util.redirectTo('/pages_tool/login/login', {
|
if (this.url) this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||||
back: encodeURIComponent(this.url)
|
back: encodeURIComponent(this.url)
|
||||||
});
|
}, mode);
|
||||||
else this.$util.redirectTo('/pages_tool/login/login');
|
else this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {}, mode);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 取消完善信息
|
// 取消完善信息
|
||||||
@@ -535,7 +537,8 @@ export default {
|
|||||||
getPhoneNumber(e) {
|
getPhoneNumber(e) {
|
||||||
if (e.detail.errMsg === 'getPhoneNumber:ok') {
|
if (e.detail.errMsg === 'getPhoneNumber:ok') {
|
||||||
const authInfo = uni.getStorageSync('authInfo');
|
const authInfo = uni.getStorageSync('authInfo');
|
||||||
if (authInfo) { Object.assign(this.authMobileData, authInfo, e.detail);
|
if (authInfo) {
|
||||||
|
Object.assign(this.authMobileData, authInfo, e.detail);
|
||||||
}
|
}
|
||||||
if (uni.getStorageSync('source_member')) {
|
if (uni.getStorageSync('source_member')) {
|
||||||
this.authMobileData.source_member = uni.getStorageSync('source_member');
|
this.authMobileData.source_member = uni.getStorageSync('source_member');
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ export default {
|
|||||||
title: '未获取到支付信息!'
|
title: '未获取到支付信息!'
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 1500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
145
components/ns-video-player-popup/ns-video-player-popup.vue
Normal file
145
components/ns-video-player-popup/ns-video-player-popup.vue
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
<template>
|
||||||
|
<view class="video-player-popup">
|
||||||
|
<uni-popup ref="videoPopup" type="center" :mask-click="true" @change="onVideoPopupChange">
|
||||||
|
<view class="video-popup-content">
|
||||||
|
<view class="video-popup-header">
|
||||||
|
<text class="video-popup-title">{{ videoTitle }}</text>
|
||||||
|
<text class="iconfont icon-close" @click="close"></text>
|
||||||
|
</view>
|
||||||
|
<view class="video-popup-body">
|
||||||
|
<video
|
||||||
|
v-if="videoUrl"
|
||||||
|
:src="videoUrl"
|
||||||
|
controls
|
||||||
|
autoplay
|
||||||
|
class="video-player"
|
||||||
|
></video>
|
||||||
|
<view v-else class="video-error">视频地址不存在</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'ns-video-player-popup',
|
||||||
|
props: {
|
||||||
|
/**
|
||||||
|
* 当前播放的视频信息
|
||||||
|
* @type {Object}
|
||||||
|
* @property {string} title - 视频标题
|
||||||
|
* @property {string} videoUrl - 视频地址
|
||||||
|
*/
|
||||||
|
currentVideo: {
|
||||||
|
type: Object,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
videoUrl() {
|
||||||
|
return this.currentVideo?.videoUrl || '';
|
||||||
|
},
|
||||||
|
|
||||||
|
videoTitle() {
|
||||||
|
return this.currentVideo?.title || '';
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 视频弹窗是否显示
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
isVisible() {
|
||||||
|
return this.$refs.videoPopup?.visible || false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 打开视频弹窗
|
||||||
|
*/
|
||||||
|
open() {
|
||||||
|
if (this.$refs.videoPopup) {
|
||||||
|
this.$refs.videoPopup.open();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭视频弹窗
|
||||||
|
*/
|
||||||
|
close() {
|
||||||
|
if (this.$refs.videoPopup) {
|
||||||
|
this.$refs.videoPopup.close();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频弹窗状态变化
|
||||||
|
* @param {Object} e - 弹窗状态变化事件
|
||||||
|
*/
|
||||||
|
onVideoPopupChange(e) {
|
||||||
|
this.$emit('popup-change', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
/* 视频播放弹窗样式 */
|
||||||
|
.video-player-popup {
|
||||||
|
.video-popup-content {
|
||||||
|
width: 90%;
|
||||||
|
max-width: 600rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-popup-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-bottom: 1rpx solid #f0f0f0;
|
||||||
|
background-color: #fafafa;
|
||||||
|
|
||||||
|
.video-popup-title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-close {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #999;
|
||||||
|
padding: 0 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-popup-body {
|
||||||
|
padding: 20rpx;
|
||||||
|
|
||||||
|
.video-player {
|
||||||
|
width: 100%;
|
||||||
|
height: 400rpx;
|
||||||
|
background-color: #000;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-error {
|
||||||
|
width: 100%;
|
||||||
|
height: 400rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
color: #999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,78 +1,164 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- #ifdef MP -->
|
<view>
|
||||||
<view v-if="showPop">
|
<view class="privacy-mask" v-if="showPop">
|
||||||
<view class="privacy-mask">
|
|
||||||
<view class="privacy-wrap">
|
<view class="privacy-wrap">
|
||||||
<view class="privacy-title">用户隐私保护提示</view>
|
<view class="privacy-title">用户隐私保护提示</view>
|
||||||
<view class="privacy-desc">
|
<view class="privacy-desc">
|
||||||
感谢您使用本小程序,在使用前您应当阅读并同意
|
感谢您使用{{ appName }},在使用前您应当阅读并同意
|
||||||
<text class="privacy-link" @tap="openPrivacyContract">{{privacyContractName}}</text>,
|
<text class="privacy-link" @tap="openPrivacyContract">{{ privacyContractName }}</text>
|
||||||
当点击同意并继续时,即表示您已理解并同意该条款内容,该条款将对您产生法律约束力;如您不同意,将无法继续使用小程序相关功能。
|
<!-- #ifdef QUICKAPP-WEBVIEW || H5 -->
|
||||||
|
<text class="privacy-link" @tap="openPrivacyService">{{ privacyServiceName }}</text>
|
||||||
|
<!-- #endif -->
|
||||||
|
,当点击同意并继续时,即表示您已理解并同意该条款内容,该条款将对您产生法律约束力;如您不同意,将无法继续使用{{ appName }}相关功能。
|
||||||
</view>
|
</view>
|
||||||
<view class="privacy-button-flex">
|
<view class="privacy-button-flex">
|
||||||
<button class="privacy-button-btn bg-disagree" @tap="handleDisagree">不同意</button>
|
<button class="privacy-button-btn bg-disagree" @tap="handleDisagree">不同意</button>
|
||||||
<button id="agree-btn" class="privacy-button-btn bg-agree" open-type="agreePrivacyAuthorization" @agreeprivacyauthorization="handleAgree">同意并继续</button>
|
<!-- #ifdef QUICKAPP-WEBVIEW || MP-WEIXIN -->
|
||||||
</view>
|
<button id="agree-btn" class="privacy-button-btn bg-agree" open-type="agreePrivacyAuthorization"
|
||||||
</view>
|
@agreeprivacyauthorization="handleAgree">同意并继续</button>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef WEB || H5 -->
|
<!-- #ifdef WEB || H5 -->
|
||||||
<view v-if="showPop"></view>
|
<button id="agree-btn" class="privacy-button-btn bg-agree" @tap="handleAgree" @click="handleAgree">同意并继续</button>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
// #ifdef QUICKAPP-WEBVIEW
|
||||||
|
import has from '@system.has'
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
const closeOtherPagePopUpHooks = new Set();
|
||||||
|
const privacyContractPage = '/pages_tool/agreement/contenr?type=0';
|
||||||
|
const privacyServicePage = '/pages_tool/agreement/contenr?type=1';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
name: 'PrivacyPopup',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
agree: false,
|
agree: false,
|
||||||
showPop: false,
|
showPop: false,
|
||||||
privacyAuthorization: null,
|
privacyAuthorization: null,
|
||||||
privacyResolves: new Set(),
|
privacyResolves: new Set(),
|
||||||
closeOtherPagePopUpHooks: new Set(),
|
privacyContractName: '用户隐私保护指引',
|
||||||
privacyContractName: '用户隐私保护指引'
|
appName: '本小程序',
|
||||||
|
// #ifdef WEB || H5
|
||||||
|
appName: '本应用',
|
||||||
|
privacyContractName: '《隐私条款》',
|
||||||
|
privacyServiceName: '《用户服务协议》',
|
||||||
|
// #endif
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init()
|
this.listenPrivacySettingChange()
|
||||||
this.curPageShow()
|
this.curPageShow()
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
let that = this
|
|
||||||
//查询微信侧记录的用户是否有待同意的隐私政策信息
|
|
||||||
try {
|
try {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
//查询微信侧记录的用户是否有待同意的隐私政策信息
|
||||||
wx.getPrivacySetting({
|
wx.getPrivacySetting({
|
||||||
success(res) {
|
success: (res) => {
|
||||||
// console.log('隐私政策信息', res);
|
// console.log('隐私政策信息', res);
|
||||||
// console.log(res.privacyContractName);
|
// console.log(res.privacyContractName);
|
||||||
that.privacyContractName = res.privacyContractName
|
this.privacyContractName = res.privacyContractName
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef QUICKAPP-WEBVIEW || H5
|
||||||
|
if (this.$util.isQuickApp()) {
|
||||||
|
if (typeof has != 'undefined' && has?.getPrivacySetting) {
|
||||||
|
has.getPrivacySetting({
|
||||||
|
success: (res) => {
|
||||||
|
if (res.privacyContractName) {
|
||||||
|
this.privacyContractName = res.privacyContractName
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// console.log("=========低版本基础库==========")
|
console.error("=========低版本基础库==========", e)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 监听何时需要提示用户阅读隐私政策
|
getPrivacySettingByQuickApp() {
|
||||||
init() {
|
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||||
let that = this;
|
if (this.$util.isQuickApp()) {
|
||||||
|
if (typeof has != 'undefined' && has?.getPrivacySetting) {
|
||||||
|
has.getPrivacySetting({
|
||||||
|
success: (res) => {
|
||||||
|
// console.log(res)
|
||||||
|
if (res.needAuthorization) {
|
||||||
|
this.popUp()
|
||||||
|
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||||
|
this.closeOtherPagePopUp(this.disPopUp)
|
||||||
|
} else {
|
||||||
|
this.$emit('agree')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 属于嵌入到快应用Webview组件中的情况,按照H5的方式来处理,判断是否已经授权
|
||||||
|
if (uni.getStorageSync('privacyAgreed')) {
|
||||||
|
this.$emit('agree')
|
||||||
|
} else {
|
||||||
|
this.popUp()
|
||||||
|
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||||
|
this.closeOtherPagePopUp(this.disPopUp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
|
||||||
|
listenPrivacySettingChange() {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
// 监听微信侧隐私政策授权变化事件
|
||||||
if (wx.onNeedPrivacyAuthorization) {
|
if (wx.onNeedPrivacyAuthorization) {
|
||||||
wx.onNeedPrivacyAuthorization((resolve) => {
|
wx.onNeedPrivacyAuthorization((resolve) => {
|
||||||
if (typeof that.privacyAuthorization === 'function') {
|
if (typeof this.privacyAuthorization === 'function') {
|
||||||
that.privacyAuthorization(resolve)
|
this.privacyAuthorization(resolve)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||||
|
if (this.$util.isQuickApp()) {
|
||||||
|
// 监听快速应用侧隐私政策授权变化事件
|
||||||
|
if (typeof has != 'undefined' && has?.onPrivacySettingChange) {
|
||||||
|
has.onPrivacySettingChange((res) => {
|
||||||
|
// console.log(res)
|
||||||
|
if (res.needAuthorization) {
|
||||||
|
this.popUp()
|
||||||
|
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||||
|
this.closeOtherPagePopUp(this.disPopUp)
|
||||||
|
} else {
|
||||||
|
this.$emit('agree')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// 主动查询用户隐私政策授权状态,针对快速应用
|
||||||
|
this.getPrivacySettingByQuickApp();
|
||||||
},
|
},
|
||||||
|
// 主动查询用户隐私政策授权状态
|
||||||
proactive() {
|
proactive() {
|
||||||
let that = this
|
// #ifdef MP-WEIXIN
|
||||||
if (wx.getPrivacySetting) {
|
if (wx.getPrivacySetting) {
|
||||||
wx.getPrivacySetting({
|
wx.getPrivacySetting({
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
// console.log(res)
|
// console.log(res)
|
||||||
if (res.needAuthorization) {
|
if (res.needAuthorization) {
|
||||||
that.popUp()
|
this.popUp()
|
||||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||||
this.closeOtherPagePopUp(this.disPopUp)
|
this.closeOtherPagePopUp(this.disPopUp)
|
||||||
} else {
|
} else {
|
||||||
@@ -83,9 +169,15 @@
|
|||||||
} else {
|
} else {
|
||||||
this.$emit('agree')
|
this.$emit('agree')
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef QUICKAPP-WEBVIEW
|
||||||
|
this.getPrivacySettingByQuickApp();
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
//初始化监听程序
|
//初始化监听程序
|
||||||
curPageShow() {
|
curPageShow() {
|
||||||
|
closeOtherPagePopUpHooks.add(this.disPopUp)
|
||||||
this.privacyAuthorization = resolve => {
|
this.privacyAuthorization = resolve => {
|
||||||
this.privacyResolves.add(resolve)
|
this.privacyResolves.add(resolve)
|
||||||
//打开弹窗
|
//打开弹窗
|
||||||
@@ -93,11 +185,10 @@
|
|||||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||||
this.closeOtherPagePopUp(this.disPopUp)
|
this.closeOtherPagePopUp(this.disPopUp)
|
||||||
}
|
}
|
||||||
this.closeOtherPagePopUpHooks.add(this.disPopUp)
|
|
||||||
},
|
},
|
||||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
||||||
closeOtherPagePopUp(closePopUp) {
|
closeOtherPagePopUp(closePopUp) {
|
||||||
this.closeOtherPagePopUpHooks.forEach(hook => {
|
closeOtherPagePopUpHooks.forEach(hook => {
|
||||||
if (closePopUp !== hook) {
|
if (closePopUp !== hook) {
|
||||||
hook()
|
hook()
|
||||||
}
|
}
|
||||||
@@ -105,6 +196,7 @@
|
|||||||
},
|
},
|
||||||
//打开隐私协议
|
//打开隐私协议
|
||||||
openPrivacyContract() {
|
openPrivacyContract() {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
wx.openPrivacyContract({
|
wx.openPrivacyContract({
|
||||||
success(res) {
|
success(res) {
|
||||||
// console.log('打开隐私协议', res);
|
// console.log('打开隐私协议', res);
|
||||||
@@ -113,6 +205,51 @@
|
|||||||
// console.error('打开隐私协议失败', err)
|
// console.error('打开隐私协议失败', err)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||||
|
if (this.$util.isQuickApp()) {
|
||||||
|
if (typeof has != 'undefined' && has?.openPrivacySetting) {
|
||||||
|
has.openPrivacySetting({
|
||||||
|
success: (res) => {
|
||||||
|
// console.log('打开隐私协议', res);
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
// console.error('打开隐私协议失败', err)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 属于嵌入到快应用Webview组件中的情况,按照H5的方式来处理
|
||||||
|
this.$util.redirectTo(privacyContractPage);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// H5 环境下的处理逻辑
|
||||||
|
this.$util.redirectTo(privacyContractPage);
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
//打开用户服务协议
|
||||||
|
openPrivacyService() {
|
||||||
|
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||||
|
if (this.$util.isQuickApp()) {
|
||||||
|
if (typeof has != 'undefined' && has?.openPrivacySetting) {
|
||||||
|
has.openPrivacySetting({
|
||||||
|
success: (res) => {
|
||||||
|
// console.log('打开用户服务协议', res);
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
// console.error('打开用户服务协议失败', err)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 属于嵌入到快应用Webview组件中的情况,按照H5的方式来处理
|
||||||
|
this.$util.redirectTo(privacyServicePage);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// H5 环境下的处理逻辑
|
||||||
|
this.$util.redirectTo(privacyServicePage);
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
// 不同意
|
// 不同意
|
||||||
handleDisagree() {
|
handleDisagree() {
|
||||||
@@ -143,21 +280,29 @@
|
|||||||
this.privacyResolves.clear()
|
this.privacyResolves.clear()
|
||||||
//关闭弹窗
|
//关闭弹窗
|
||||||
this.disPopUp()
|
this.disPopUp()
|
||||||
|
|
||||||
|
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||||
|
// 保存用户授权状态到本地存储,用于快应用Webview组件中的H5方式处理
|
||||||
|
uni.setStorageSync('privacyAgreed', true);
|
||||||
|
// #endif
|
||||||
this.$emit('agree')
|
this.$emit('agree')
|
||||||
},
|
},
|
||||||
//打开弹窗
|
//打开弹窗
|
||||||
popUp() {
|
popUp() {
|
||||||
if (this.showPop === false) {
|
this.showPop = true;
|
||||||
this.showPop = true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
//关闭弹窗
|
//关闭弹窗
|
||||||
disPopUp() {
|
disPopUp() {
|
||||||
if (this.showPop === true) {
|
this.showPop = false;
|
||||||
this.showPop = false
|
},
|
||||||
}
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
// 清理事件监听器和集合
|
||||||
|
this.privacyResolves.clear()
|
||||||
|
closeOtherPagePopUpHooks.delete(this.disPopUp)
|
||||||
|
// 注意:这里需要根据实际情况清理微信和快速应用的事件监听器
|
||||||
|
// 由于微信的 wx.onNeedPrivacyAuthorization 没有对应的 off 方法,这里可能需要其他方式处理
|
||||||
},
|
},
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -210,6 +355,9 @@
|
|||||||
.privacy-button-btn {
|
.privacy-button-btn {
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
|
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||||
|
font-size: 28rpx;
|
||||||
|
// #endif
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: 100rpx;
|
line-height: 100rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
@@ -138,7 +138,7 @@
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (this.back) this.$util.redirectTo(decodeURIComponent(this.back), {}, 'redirectTo');
|
if (this.back) this.$util.redirectTo(decodeURIComponent(this.back), {}, 'redirectTo');
|
||||||
else this.$util.redirectTo('/pages/index/index');
|
else this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
568
docs/WECHAT_CHANNEL_INTEGRATION.md
Normal file
568
docs/WECHAT_CHANNEL_INTEGRATION.md
Normal file
@@ -0,0 +1,568 @@
|
|||||||
|
# 微信视频号集成指南
|
||||||
|
|
||||||
|
## 1. 概述
|
||||||
|
|
||||||
|
本文档提供了在UniApp项目中集成微信视频号的详细指导,包括组件实现、配置修改和使用方法。
|
||||||
|
|
||||||
|
## 2. 准备工作
|
||||||
|
|
||||||
|
### 2.1 微信小程序配置
|
||||||
|
|
||||||
|
在 `manifest.json` 文件中,需要确保微信小程序配置正确:
|
||||||
|
|
||||||
|
```json
|
||||||
|
"mp-weixin": {
|
||||||
|
"appid": "你的小程序appid",
|
||||||
|
"setting": {
|
||||||
|
"urlCheck": false,
|
||||||
|
"postcss": false,
|
||||||
|
"es6": true,
|
||||||
|
"minified": true
|
||||||
|
},
|
||||||
|
"usingComponents": true,
|
||||||
|
"permission": {
|
||||||
|
"scope.userLocation": {
|
||||||
|
"desc": "为了更好地为您提供服务"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"requiredPrivateInfos": ["chooseLocation", "getLocation", "chooseAddress"],
|
||||||
|
"__usePrivacyCheck__": true,
|
||||||
|
"optimization": {
|
||||||
|
"subPackages": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2.2 微信视频号API权限与关联
|
||||||
|
|
||||||
|
#### 2.2.1 权限说明
|
||||||
|
|
||||||
|
`wx.openChannelsActivity` API 是小程序的基础能力,不需要单独开通权限,但需要满足以下条件:
|
||||||
|
|
||||||
|
- **跳转打开视频号视频**:无主体限制,基础库版本 2.19.2 及以上
|
||||||
|
- **内嵌视频号视频**:
|
||||||
|
- 从基础库版本 2.25.1 至 2.31.1,小程序需与视频号视频相同主体或关联主体
|
||||||
|
- 从基础库版本 2.31.1 开始,非个人主体小程序可内嵌非同主体/关联主体视频号视频
|
||||||
|
|
||||||
|
#### 2.2.2 小程序与视频号关联(可选)
|
||||||
|
|
||||||
|
虽然跳转打开视频号视频无主体限制,但如果需要内嵌非同主体视频号视频(基础库 2.31.1 以下),则需要关联小程序与视频号:
|
||||||
|
|
||||||
|
1. **小程序管理员操作**
|
||||||
|
- 登录微信小程序后台
|
||||||
|
- 左侧菜单:设置 → 基本设置
|
||||||
|
- 向下滚动找到「关联设置」部分
|
||||||
|
- 点击「关联视频号」按钮
|
||||||
|
- 输入视频号名称或视频号ID
|
||||||
|
- 点击「搜索」找到对应的视频号
|
||||||
|
- 点击「发送关联邀请」
|
||||||
|
|
||||||
|
2. **视频号管理员操作**
|
||||||
|
- 视频号管理员需要在24小时内确认关联邀请
|
||||||
|
- 视频号管理员登录 [视频号助手](https://channels.weixin.qq.com/)
|
||||||
|
- 进入「设置」→「关联设置」→「小程序关联」
|
||||||
|
- 找到待确认的关联邀请
|
||||||
|
- 点击「同意」完成关联
|
||||||
|
|
||||||
|
3. **关联失败处理**
|
||||||
|
- 检查视频号是否已完成实名认证
|
||||||
|
- 检查小程序是否已发布上线
|
||||||
|
- 检查视频号名称或ID是否输入正确
|
||||||
|
- 如超过24小时未确认,需要重新发送关联邀请
|
||||||
|
|
||||||
|
#### 2.2.3 关联条件
|
||||||
|
|
||||||
|
- **小程序要求**:必须已经发布上线,未被处罚或限制
|
||||||
|
- **视频号要求**:必须已经完成实名认证,状态正常
|
||||||
|
- **数量限制**:同一个小程序最多可以关联50个视频号,同一个视频号最多可以关联50个小程序
|
||||||
|
- **权限要求**:关联操作需要小程序管理员和视频号管理员共同确认
|
||||||
|
- **主体要求**:小程序和视频号的主体可以不同,但需要双方管理员确认
|
||||||
|
|
||||||
|
#### 2.2.4 功能验证
|
||||||
|
|
||||||
|
可以通过以下方式验证视频号功能是否可用:
|
||||||
|
|
||||||
|
1. **在微信开发者工具中验证**
|
||||||
|
- 在微信开发者工具中打开小程序
|
||||||
|
- 在控制台执行以下代码:
|
||||||
|
```javascript
|
||||||
|
console.log('是否支持视频号API:', typeof wx !== 'undefined' && typeof wx.openChannelsActivity === 'function');
|
||||||
|
```
|
||||||
|
- 如果返回 `true`,则表示API可用
|
||||||
|
|
||||||
|
2. **在真机环境中验证**
|
||||||
|
- 使用微信扫码打开小程序
|
||||||
|
- 触发视频号相关功能
|
||||||
|
- 检查是否能正常打开视频号内容
|
||||||
|
|
||||||
|
3. **功能验证失败处理**
|
||||||
|
- 检查微信小程序基础库版本是否满足要求(跳转打开需要 2.19.2+,内嵌打开需要 2.25.1+)
|
||||||
|
- 对于内嵌打开,检查主体是否满足要求或是否已关联
|
||||||
|
- 检查 `feedId` 等参数是否正确
|
||||||
|
|
||||||
|
## 3. 组件使用
|
||||||
|
|
||||||
|
### 3.1 视频号视频卡片组件 (diy-channel-video.vue)
|
||||||
|
|
||||||
|
#### 基本用法
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<diy-channel-video :value="videoData" @video-play="handlerVideoPlay" />
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 属性说明
|
||||||
|
|
||||||
|
| 属性名 | 类型 | 默认值 | 说明 |
|
||||||
|
|--------|------|--------|------|
|
||||||
|
| 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 | "" | 视频标题 |
|
||||||
|
| viewCount | Number | 0 | 观看次数 |
|
||||||
|
| showViewCount | Boolean | false | 是否显示观看次数 |
|
||||||
|
| embedMode | Boolean | false | 是否启用嵌入式播放 |
|
||||||
|
|
||||||
|
#### 事件说明
|
||||||
|
|
||||||
|
| 事件名 | 说明 | 参数 |
|
||||||
|
|--------|------|------|
|
||||||
|
| video-play | 点击视频播放时触发 | 视频数据对象 |
|
||||||
|
|
||||||
|
### 3.2 视频号列表组件 (diy-channel-list.vue)
|
||||||
|
|
||||||
|
#### 基本用法
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<diy-channel-list :value="channelListData" />
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 属性说明
|
||||||
|
|
||||||
|
| 属性名 | 类型 | 默认值 | 说明 |
|
||||||
|
|--------|------|--------|------|
|
||||||
|
| 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数组项说明
|
||||||
|
|
||||||
|
| 属性名 | 类型 | 默认值 | 说明 |
|
||||||
|
|--------|------|--------|------|
|
||||||
|
| channelName | String | "" | 视频号名称 |
|
||||||
|
| coverUrl | String | "" | 视频封面URL |
|
||||||
|
| videoTitle | String | "" | 视频标题 |
|
||||||
|
| feedId | String | "" | 视频号内容ID,用于播放视频 |
|
||||||
|
| viewCount | Number | 0 | 视频观看次数 |
|
||||||
|
| embedMode | Boolean | false | 是否启用嵌入式播放 |
|
||||||
|
| showViewCount | Boolean | false | 是否显示观看次数 |
|
||||||
|
| finderUserName | String | "" | 视频号ID,用于嵌入式播放 |
|
||||||
|
| feedToken | String | "" | 视频token,用于嵌入式播放 |
|
||||||
|
|
||||||
|
## 4. 视频播放实现
|
||||||
|
|
||||||
|
小程序提供两种打开视频号视频的方式:跳转打开和内嵌打开。
|
||||||
|
|
||||||
|
### 4.1 跳转打开视频号视频
|
||||||
|
|
||||||
|
组件内部使用微信小程序的 `wx.openChannelsActivity` API 来打开视频号内容:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
if (typeof wx !== 'undefined' && wx.openChannelsActivity) {
|
||||||
|
wx.openChannelsActivity({
|
||||||
|
feedId: item.feedId, // 视频号内容ID,必填
|
||||||
|
finderUserName: item.finderUserName, // 视频号ID(可选)
|
||||||
|
success: (res) => {
|
||||||
|
console.log('打开视频号成功', res);
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('打开视频号失败', err);
|
||||||
|
// 常见错误处理
|
||||||
|
if (err.errCode === 40001) {
|
||||||
|
console.error('未授权,请检查小程序是否与视频号关联');
|
||||||
|
} else if (err.errCode === 40002) {
|
||||||
|
console.error('参数错误,请检查feedId是否正确');
|
||||||
|
} else if (err.errCode === 40003) {
|
||||||
|
console.error('视频号内容不存在或已被删除');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error('当前环境不支持微信视频号');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.2 内嵌视频号视频
|
||||||
|
|
||||||
|
从基础库 2.25.1 开始支持,小程序可以通过 `channel-video` 组件在小程序中内嵌视频号视频,且支持无弹窗跳转打开视频号对应视频,使用该组件时需注意:
|
||||||
|
|
||||||
|
- 组件调用无资质要求
|
||||||
|
- 暂不支持纯图片视频号内容
|
||||||
|
- 在 UniApp 中使用时,需要用 `<native-component>` 包裹以确保组件正确显示
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<native-component>
|
||||||
|
<channel-video
|
||||||
|
feed-id="{{feedId}}"
|
||||||
|
finder-user-name="{{finderUserName}}"
|
||||||
|
feed-token="{{feedToken}}"
|
||||||
|
bindenterfullscreen="enterFullscreen"
|
||||||
|
bindexitfullscreen="exitFullscreen"
|
||||||
|
binderror="videoError"
|
||||||
|
></channel-video>
|
||||||
|
</native-component>
|
||||||
|
<!-- #endif -->
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.3 API参数说明
|
||||||
|
|
||||||
|
- **feedId**:视频号内容ID,必填,必须是有效的视频号内容ID
|
||||||
|
- **finderUserName**:视频号ID,可选
|
||||||
|
- **feedToken**:非同主体视频号视频的标识,从基础库 2.31.1 开始支持,非个人主体小程序可使用
|
||||||
|
- **success**:调用成功的回调函数
|
||||||
|
- **fail**:调用失败的回调函数
|
||||||
|
- **complete**:调用完成的回调函数(无论成功或失败)
|
||||||
|
|
||||||
|
### 4.4 错误码说明
|
||||||
|
|
||||||
|
| 错误码 | 说明 | 解决方案 |
|
||||||
|
|--------|------|----------|
|
||||||
|
| 40001 | 未授权 | 对于内嵌打开,检查主体是否满足要求或是否已关联 |
|
||||||
|
| 40002 | 参数错误 | 检查feedId是否正确,确保是有效的视频号内容ID |
|
||||||
|
| 40003 | 视频号内容不存在或已被删除 | 确认feedId对应的视频号内容是否仍然存在 |
|
||||||
|
| 40004 | 系统错误 | 稍后重试,或联系微信公众平台客服 |
|
||||||
|
|
||||||
|
### 4.5 获取参数方法
|
||||||
|
|
||||||
|
1. **获取finderUserName(视频号ID)**
|
||||||
|
- 登录视频号助手
|
||||||
|
- 在首页可以查看自己的视频号ID
|
||||||
|
|
||||||
|
2. **获取feedId(视频号内容ID)**
|
||||||
|
- 登录视频号助手
|
||||||
|
- 在「动态管理」模块可以复制自己发表的每个视频对应的feedId
|
||||||
|
|
||||||
|
3. **获取feed-token(非同主体视频号视频标识)**
|
||||||
|
- 登录MP平台,在「设置-基本设置-隐私与安全」找到「获取视频号视频ID权限」,并将开关打开
|
||||||
|
- 移动端找到想要内嵌的视频号视频,并复制该视频的feed-token
|
||||||
|
- 注意:打开开关后24小时内生效,失效后需要再次打开开关;开关打开状态仅对当前操作者生效
|
||||||
|
|
||||||
|
### 4.6 主体判断逻辑
|
||||||
|
|
||||||
|
#### 主体信息查询
|
||||||
|
小程序主体信息可通过小程序资料页-开发团队进行查询,视频号主体信息可通过视频号首页-认证进行查询。
|
||||||
|
|
||||||
|
#### 主体判断逻辑
|
||||||
|
- **跳转打开视频号视频**:无主体限制,基础库版本 2.19.2 及以上
|
||||||
|
- **内嵌视频号视频**:
|
||||||
|
- 从基础库版本 2.25.1 至 2.31.1,小程序需与视频号视频相同主体或关联主体
|
||||||
|
- 从基础库版本 2.31.1 开始,非个人主体小程序可内嵌非同主体/关联主体视频号视频
|
||||||
|
|
||||||
|
关联主体申请流程可以参考:https://kf.qq.com/faq/190726e6JFja190726qMJBn6.html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 5. 注意事项
|
||||||
|
|
||||||
|
### 5.1 环境限制
|
||||||
|
|
||||||
|
- 微信视频号API只能在微信小程序环境中使用,其他环境(如H5、App)不支持
|
||||||
|
- 跳转打开视频号视频需要微信小程序基础库版本 2.19.2 及以上
|
||||||
|
- 内嵌视频号视频需要微信小程序基础库版本 2.25.1 及以上
|
||||||
|
- 小程序与视频号关联仅在需要内嵌非同主体视频号视频(基础库 2.31.1 以下)时需要
|
||||||
|
- 必须确保在 `manifest.json` 中设置 `usingComponents: true` 以启用组件支持
|
||||||
|
|
||||||
|
### 5.2 数据格式
|
||||||
|
|
||||||
|
确保传递给组件的数据格式正确,特别是 `feedId` 必须是有效的视频号内容ID
|
||||||
|
|
||||||
|
### 5.3 图片资源
|
||||||
|
|
||||||
|
- 视频号头像和封面图片建议使用CDN地址,确保加载速度
|
||||||
|
- 图片尺寸建议:
|
||||||
|
- 头像:200x200px
|
||||||
|
- 封面:640x360px
|
||||||
|
|
||||||
|
### 5.4 播放按钮图标
|
||||||
|
|
||||||
|
- 组件支持两种播放按钮图标方式:
|
||||||
|
1. **图片图标**:通过 `playIcon` 属性设置,优先级较高
|
||||||
|
2. **纯 CSS 图标**:当 `playIcon` 不可用时,组件会自动使用纯 CSS 生成的播放图标,确保播放按钮始终可见
|
||||||
|
|
||||||
|
- 纯 CSS 图标特点:
|
||||||
|
- 不依赖外部图片资源,加载更快
|
||||||
|
- 支持响应式调整大小
|
||||||
|
- 具有与图片图标相同的悬停效果
|
||||||
|
- 在所有环境中都能正常显示
|
||||||
|
|
||||||
|
### 5.5 权限和关联
|
||||||
|
|
||||||
|
- 确保在微信小程序后台开通了「打开视频号内容」权限
|
||||||
|
- 确保小程序已与视频号成功关联
|
||||||
|
- 关联操作需要小程序管理员和视频号管理员共同确认
|
||||||
|
|
||||||
|
## 6. 常见问题
|
||||||
|
|
||||||
|
### 6.1 视频无法播放
|
||||||
|
|
||||||
|
- 检查 `feedId` 是否正确,确保是有效的视频号内容ID
|
||||||
|
- 检查微信小程序基础库版本是否满足要求(跳转打开需要 2.19.2+,内嵌打开需要 2.25.1+)
|
||||||
|
- 对于内嵌打开,检查主体是否满足要求(基础库 2.31.1 以下需要相同主体或关联主体)
|
||||||
|
- 检查视频号内容是否仍然存在(未被删除)
|
||||||
|
|
||||||
|
### 6.2 功能不可用
|
||||||
|
|
||||||
|
- 确认当前环境是否为微信小程序环境
|
||||||
|
- 检查微信小程序基础库版本是否满足要求
|
||||||
|
- 对于内嵌打开,检查主体条件是否满足
|
||||||
|
- 检查 `feedId` 等参数是否正确
|
||||||
|
|
||||||
|
### 6.3 关联失败
|
||||||
|
|
||||||
|
- 检查视频号是否已完成实名认证
|
||||||
|
- 检查小程序是否已发布上线
|
||||||
|
- 检查视频号名称或ID是否输入正确
|
||||||
|
- 确认视频号管理员是否在24小时内确认关联邀请
|
||||||
|
- 如超过24小时未确认,需要重新发送关联邀请
|
||||||
|
|
||||||
|
### 6.4 组件显示异常
|
||||||
|
|
||||||
|
- 检查传递给组件的数据格式是否正确
|
||||||
|
- 确认图片资源是否可访问
|
||||||
|
- 检查微信小程序基础库版本是否支持视频号API
|
||||||
|
|
||||||
|
### 6.5 样式问题
|
||||||
|
|
||||||
|
- 可通过组件的 `componentAngle`、`topAroundRadius`、`bottomAroundRadius` 等属性调整组件样式
|
||||||
|
- 可通过 `componentBgColor` 属性调整组件背景颜色
|
||||||
|
- 可通过 `font` 属性调整字体样式
|
||||||
|
- 可通过 `aspectRatio` 属性调整视频比例,支持 '16:9' 和 '3:4' 两种比例
|
||||||
|
|
||||||
|
### 6.6 环境兼容性问题
|
||||||
|
|
||||||
|
- 微信视频号API只能在微信小程序环境中使用
|
||||||
|
- 在其他环境中,组件会显示但无法播放视频
|
||||||
|
- 建议在非小程序环境中添加友好的提示信息
|
||||||
|
|
||||||
|
### 6.7 在uni-app中使用原生组件时,可能会遇到组件不显示的问题
|
||||||
|
|
||||||
|
在uni-app中使用原生组件时,可能会遇到组件不显示的问题。以下是已验证的解决方案:
|
||||||
|
|
||||||
|
#### 解决方案
|
||||||
|
|
||||||
|
**方法一:使用 `<native-component>` 包裹**
|
||||||
|
|
||||||
|
在 UniApp 中使用 `channel-video` 组件时,必须用 `<native-component>` 包裹以确保组件正确显示:
|
||||||
|
|
||||||
|
``` vue
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<native-component>
|
||||||
|
<channel-video
|
||||||
|
feed-id="{{feedId}}"
|
||||||
|
finder-user-name="{{finderUserName}}"
|
||||||
|
feed-token="{{feedToken}}"
|
||||||
|
style="width: 100%; height: 320rpx;"
|
||||||
|
></channel-video>
|
||||||
|
</native-component>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
```
|
||||||
|
|
||||||
|
**方法二:检查 `manifest.json` 配置**
|
||||||
|
|
||||||
|
确保在 `manifest.json` 文件中正确设置了 `usingComponents: true`,特别是在 `mp-weixin` 部分:
|
||||||
|
|
||||||
|
``` json
|
||||||
|
"mp-weixin": {
|
||||||
|
"appid": "你的小程序appid",
|
||||||
|
"usingComponents": true,
|
||||||
|
// 其他配置...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**方法三:检查微信小程序基础库版本**
|
||||||
|
|
||||||
|
确保微信小程序基础库版本满足要求:
|
||||||
|
- 跳转打开视频号视频需要基础库版本 2.19.2 及以上
|
||||||
|
- 内嵌视频号视频需要基础库版本 2.25.1 及以上
|
||||||
|
|
||||||
|
**方法四:检查参数是否正确**
|
||||||
|
|
||||||
|
确保传递给 `channel-video` 组件的参数正确:
|
||||||
|
- `feedId`:视频号内容ID,必填
|
||||||
|
- `finderUserName`:视频号ID,可选
|
||||||
|
- `feedToken`:非同主体视频号视频的标识,可选(基础库 2.31.1+)
|
||||||
|
|
||||||
|
## 7. 示例代码
|
||||||
|
|
||||||
|
### 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: "这是一个示例视频,标题可能会很长,需要测试多行显示效果",
|
||||||
|
coverUrl: "https://example.com/cover.jpg",
|
||||||
|
feedId: "v02004g10000c3f7l7j5u87l33n8f160",
|
||||||
|
viewCount: 12345,
|
||||||
|
showFollow: true,
|
||||||
|
componentAngle: "round",
|
||||||
|
topAroundRadius: 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.3 视频号列表示例
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// 视频号列表数据
|
||||||
|
const channelListData = {
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
channelName: "示例视频号1",
|
||||||
|
coverUrl: "https://example.com/cover1.jpg",
|
||||||
|
videoTitle: "这是示例视频1,标题可能会很长,需要测试多行显示效果",
|
||||||
|
feedId: "v02004g10000c3f7l7j5u87l33n8f160",
|
||||||
|
viewCount: 12345,
|
||||||
|
embedMode: false,
|
||||||
|
showViewCount: true,
|
||||||
|
finderUserName: "example_finder1",
|
||||||
|
feedToken: "example_feed_token1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
channelName: "示例视频号2",
|
||||||
|
coverUrl: "https://example.com/cover2.jpg",
|
||||||
|
videoTitle: "这是示例视频2,标题可能会很长,需要测试多行显示效果",
|
||||||
|
feedId: "v02004g10000c3f7m7j5u87l33n8f161",
|
||||||
|
viewCount: 67890,
|
||||||
|
embedMode: false,
|
||||||
|
showViewCount: true,
|
||||||
|
finderUserName: "example_finder2",
|
||||||
|
feedToken: "example_feed_token2"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
rowCount: 2,
|
||||||
|
showStyle: "fixed",
|
||||||
|
mode: "",
|
||||||
|
font: {
|
||||||
|
size: 14,
|
||||||
|
weight: "normal",
|
||||||
|
color: "#333"
|
||||||
|
},
|
||||||
|
componentBgColor: "#fff",
|
||||||
|
componentAngle: "round",
|
||||||
|
topAroundRadius: 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
|
||||||
|
}
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
## 8. 总结
|
||||||
|
|
||||||
|
通过本文档提供的组件和配置指导,你可以在UniApp项目中轻松集成微信视频号功能,为用户提供更加丰富的内容体验。
|
||||||
|
|
||||||
|
如果在集成过程中遇到问题,请参考本文档的常见问题部分,或查阅微信官方文档获取更多帮助。
|
||||||
165
docs/example/wechat-channel-demo.vue
Normal file
165
docs/example/wechat-channel-demo.vue
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
<template>
|
||||||
|
<view class="wechat-channel-demo">
|
||||||
|
<view class="demo-header">
|
||||||
|
<text class="demo-title">微信视频号集成示例</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="demo-section">
|
||||||
|
<view class="section-title">单个视频号</view>
|
||||||
|
<diy-wechat-channel :value="channelData" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="demo-section">
|
||||||
|
<view class="section-title">视频号列表</view>
|
||||||
|
<diy-wechat-channel-list :value="channelListData" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="demo-section">
|
||||||
|
<view class="section-title">使用说明</view>
|
||||||
|
<view class="section-content">
|
||||||
|
<view class="content-item">1. 确保微信小程序已开通视频号权限</view>
|
||||||
|
<view class="content-item">2. 小程序需与视频号关联</view>
|
||||||
|
<view class="content-item">3. 传递正确的feedId用于播放视频</view>
|
||||||
|
<view class="content-item">4. 仅支持微信小程序环境</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import diyWechatChannel from '@/components-diy/diy-wechat-channel.vue'
|
||||||
|
import diyWechatChannelList from '@/components-diy/diy-wechat-channel-list.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'wechat-channel-demo',
|
||||||
|
components: {
|
||||||
|
diyWechatChannel,
|
||||||
|
diyWechatChannelList
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 单个视频号数据
|
||||||
|
channelData: {
|
||||||
|
channelName: "示例视频号",
|
||||||
|
avatarUrl: "https://via.placeholder.com/100",
|
||||||
|
videoTitle: "这是一个示例视频,展示如何使用微信视频号组件",
|
||||||
|
coverUrl: "https://via.placeholder.com/640x360",
|
||||||
|
feedId: "v02004g10000c3f7l7j5u87l33n8f160",
|
||||||
|
viewCount: 12345,
|
||||||
|
showFollow: true,
|
||||||
|
componentAngle: "round",
|
||||||
|
topAroundRadius: 10,
|
||||||
|
bottomAroundRadius: 10
|
||||||
|
},
|
||||||
|
// 视频号列表数据
|
||||||
|
channelListData: {
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
channelName: "示例视频号1",
|
||||||
|
coverUrl: "https://via.placeholder.com/640x360",
|
||||||
|
videoTitle: "这是示例视频1,展示如何使用微信视频号组件",
|
||||||
|
feedId: "v02004g10000c3f7l7j5u87l33n8f160",
|
||||||
|
viewCount: 12345
|
||||||
|
},
|
||||||
|
{
|
||||||
|
channelName: "示例视频号2",
|
||||||
|
coverUrl: "https://via.placeholder.com/640x360",
|
||||||
|
videoTitle: "这是示例视频2,展示如何使用微信视频号组件",
|
||||||
|
feedId: "v02004g10000c3f7m7j5u87l33n8f161",
|
||||||
|
viewCount: 67890
|
||||||
|
},
|
||||||
|
{
|
||||||
|
channelName: "示例视频号3",
|
||||||
|
coverUrl: "https://via.placeholder.com/640x360",
|
||||||
|
videoTitle: "这是示例视频3,展示如何使用微信视频号组件",
|
||||||
|
feedId: "v02004g10000c3f7n7j5u87l33n8f162",
|
||||||
|
viewCount: 98765
|
||||||
|
},
|
||||||
|
{
|
||||||
|
channelName: "示例视频号4",
|
||||||
|
coverUrl: "https://via.placeholder.com/640x360",
|
||||||
|
videoTitle: "这是示例视频4,展示如何使用微信视频号组件",
|
||||||
|
feedId: "v02004g10000c3f7o7j5u87l33n8f163",
|
||||||
|
viewCount: 54321
|
||||||
|
}
|
||||||
|
],
|
||||||
|
rowCount: 2,
|
||||||
|
showStyle: "fixed",
|
||||||
|
font: {
|
||||||
|
size: 14,
|
||||||
|
weight: "normal",
|
||||||
|
color: "#333"
|
||||||
|
},
|
||||||
|
componentBgColor: "#fff",
|
||||||
|
componentAngle: "round",
|
||||||
|
topAroundRadius: 10,
|
||||||
|
bottomAroundRadius: 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
console.log('微信视频号示例页面加载');
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 可以在这里添加自定义方法
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.wechat-channel-demo {
|
||||||
|
padding: 20rpx;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-header {
|
||||||
|
text-align: center;
|
||||||
|
padding: 40rpx 0;
|
||||||
|
background-color: #fff;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-section {
|
||||||
|
background-color: #fff;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-bottom: 1rpx solid #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-content {
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-item {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 组件样式调整 */
|
||||||
|
.demo-section >>> .diy-wechat-channel {
|
||||||
|
margin: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-section >>> .diy-wechat-channel-list {
|
||||||
|
margin: 20rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
export const lang = {
|
export const lang = {
|
||||||
//title为每个页面的标题
|
//title为每个页面的标题
|
||||||
title: '退款',
|
title: '售后',
|
||||||
checkDetail: '查看详情',
|
checkDetail: '查看详情',
|
||||||
emptyTips: '暂无退款记录'
|
emptyTips: '暂无售后记录'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@
|
|||||||
"minified" : true
|
"minified" : true
|
||||||
},
|
},
|
||||||
"usingComponents" : true,
|
"usingComponents" : true,
|
||||||
|
"lazyCodeLoading": "requiredComponents",
|
||||||
"permission" : {
|
"permission" : {
|
||||||
"scope.userLocation" : {
|
"scope.userLocation" : {
|
||||||
"desc" : "为了更好地为您提供服务"
|
"desc" : "为了更好地为您提供服务"
|
||||||
|
|||||||
11
package.json
11
package.json
@@ -21,6 +21,17 @@
|
|||||||
"PRODUCTION": true
|
"PRODUCTION": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"h5-xcx20.5g-quickapp.com": {
|
||||||
|
"title": "H5-xcx20.5g-quickapp.com",
|
||||||
|
"env": {
|
||||||
|
"UNI_PLATFORM": "h5"
|
||||||
|
},
|
||||||
|
"define": {
|
||||||
|
"H5_XCX_5G_QUICKAPP_COM": true,
|
||||||
|
"H5_PRODUCTION": true,
|
||||||
|
"PRODUCTION": true
|
||||||
|
}
|
||||||
|
},
|
||||||
"h5-xcx.aigc-quickapp.com": {
|
"h5-xcx.aigc-quickapp.com": {
|
||||||
"title": "H5-xcx.aigc-quickapp.com",
|
"title": "H5-xcx.aigc-quickapp.com",
|
||||||
"env": {
|
"env": {
|
||||||
|
|||||||
@@ -919,6 +919,12 @@
|
|||||||
// #endif
|
// #endif
|
||||||
"navigationBarTitleText": "查看文件"
|
"navigationBarTitleText": "查看文件"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "file-preview/file-preview",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "文件预览"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,10 +137,8 @@
|
|||||||
</uni-popup>
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
<hover-nav :need="true"></hover-nav>
|
<hover-nav :need="true"></hover-nav>
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- 隐私协议 -->
|
||||||
<!-- 小程序隐私协议 -->
|
|
||||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||||
<!-- #endif -->
|
|
||||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||||
<ns-login ref="login"></ns-login>
|
<ns-login ref="login"></ns-login>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ export default {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
>>>.uni-tag--primary.uni-tag--inverted {
|
>>>.uni-tag--primary.uni-tag--inverted {
|
||||||
background-color: #f5f5f5 !important;
|
background-color: #f5f5f5 !important;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||||
|
|||||||
@@ -400,7 +400,7 @@
|
|||||||
.price {
|
.price {
|
||||||
color: var(--price-color);
|
color: var(--price-color);
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
font-size: 15rpx !important;
|
font-size: 27rpx !important;
|
||||||
font-weight: bold !important;
|
font-weight: bold !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -669,7 +669,7 @@ export default {
|
|||||||
this.getEvaluateConfig();
|
this.getEvaluateConfig();
|
||||||
this.getOrderData();
|
this.getOrderData();
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages_tool/login/login', {
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||||
back: '/pages_order/detail?order_id=' + this.orderId + '&merchant_trade_no=' + this.merchantTradeNo
|
back: '/pages_order/detail?order_id=' + this.orderId + '&merchant_trade_no=' + this.merchantTradeNo
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ export default {
|
|||||||
if (this.storeToken) {
|
if (this.storeToken) {
|
||||||
this.getOrderData();
|
this.getOrderData();
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages_tool/login/login', {
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||||
back: '/pages_order/detail_point?order_id=' + this.orderId
|
back: '/pages_order/detail_point?order_id=' + this.orderId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,11 +156,12 @@
|
|||||||
<ns-payment ref="choosePaymentPopup"></ns-payment>
|
<ns-payment ref="choosePaymentPopup"></ns-payment>
|
||||||
<ns-payment ref="choosePaymentMergePopup"></ns-payment>
|
<ns-payment ref="choosePaymentMergePopup"></ns-payment>
|
||||||
|
|
||||||
<ns-login ref="login"></ns-login>
|
|
||||||
<loading-cover ref="loadingCover"></loading-cover>
|
|
||||||
<!-- #ifdef MP -->
|
<!-- #ifdef MP -->
|
||||||
</mescroll-uni>
|
</mescroll-uni>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<ns-login ref="login"></ns-login>
|
||||||
|
<loading-cover ref="loadingCover"></loading-cover>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -207,7 +208,7 @@ export default {
|
|||||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||||
} else {
|
} else {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.login.open('/pages_order/list?status=' + this.orderStatus);
|
this.$refs?.login?.open('/pages_order/list?status=' + this.orderStatus, 'redirectTo');
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -196,7 +196,7 @@
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
},1000);
|
},1000);
|
||||||
@@ -213,7 +213,7 @@
|
|||||||
this.applyStatus();
|
this.applyStatus();
|
||||||
this.getSourceMemberInfo();
|
this.getSourceMemberInfo();
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages_tool/login/login', {
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||||
back: '/pages_promotion/fenxiao/apply'
|
back: '/pages_promotion/fenxiao/apply'
|
||||||
}, 'redirectTo');
|
}, 'redirectTo');
|
||||||
}
|
}
|
||||||
@@ -261,7 +261,7 @@
|
|||||||
this.status = res.data.status;
|
this.status = res.data.status;
|
||||||
this.isSub = false;
|
this.isSub = false;
|
||||||
if (this.status == 2) {
|
if (this.status == 2) {
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$refs.loadingCover.hide();
|
this.$refs.loadingCover.hide();
|
||||||
@@ -410,7 +410,7 @@
|
|||||||
if (options.from === 'navigateBack') {
|
if (options.from === 'navigateBack') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index', {}, 'redirectTo');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL, {}, 'redirectTo');
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@@ -348,7 +348,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -367,7 +367,7 @@ export default {
|
|||||||
title: '当前分销商已冻结'
|
title: '当前分销商已冻结'
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -457,7 +457,7 @@ export default {
|
|||||||
if (options.from === 'navigateBack') {
|
if (options.from === 'navigateBack') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.$util.redirectTo('/pages/member/index', {}, 'reLaunch');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@@ -213,7 +213,7 @@
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
},1000);
|
},1000);
|
||||||
@@ -224,7 +224,7 @@
|
|||||||
this.getFenxiaoInfo();
|
this.getFenxiaoInfo();
|
||||||
this.getBasicsConfig();
|
this.getBasicsConfig();
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages_tool/login/login', {
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||||
back: '/pages_promotion/fenxiao/level'
|
back: '/pages_promotion/fenxiao/level'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
},1000);
|
},1000);
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export default {
|
|||||||
this.$api.sendRequest({
|
this.$api.sendRequest({
|
||||||
url: '/fenxiao/api/fenxiao/poster',
|
url: '/fenxiao/api/fenxiao/poster',
|
||||||
data: {
|
data: {
|
||||||
page: '/pages/index/index',
|
page: this.$util.INDEX_PAGE_URL,
|
||||||
qrcode_param: JSON.stringify({}),
|
qrcode_param: JSON.stringify({}),
|
||||||
template_id: id
|
template_id: id
|
||||||
},
|
},
|
||||||
@@ -154,7 +154,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@@ -40,7 +40,7 @@ export default {
|
|||||||
|
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo(
|
this.$util.redirectTo(
|
||||||
'/pages_tool/login/login', {
|
this.$util.LOGIN_PAGE_URL, {
|
||||||
back: '/pages_promotion/fenxiao/goods_list'
|
back: '/pages_promotion/fenxiao/goods_list'
|
||||||
},
|
},
|
||||||
'redirectTo'
|
'redirectTo'
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
this.getBankAccountInfo();
|
this.getBankAccountInfo();
|
||||||
this.getWithdrawInfo();
|
this.getWithdrawInfo();
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages_tool/login/login', {
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||||
back: '/pages_promotion/fenxiao/withdraw_apply'
|
back: '/pages_promotion/fenxiao/withdraw_apply'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export default {
|
|||||||
if (this.storeToken) {
|
if (this.storeToken) {
|
||||||
this.getDetail();
|
this.getDetail();
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages_tool/login/login', {
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||||
back: '/pages_promotion/fenxiao/withdraw_list'
|
back: '/pages_promotion/fenxiao/withdraw_list'
|
||||||
}, 'redirectTo');
|
}, 'redirectTo');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@@ -544,7 +544,7 @@ export default {
|
|||||||
if (getCurrentPages().length > 1) uni.navigateBack({
|
if (getCurrentPages().length > 1) uni.navigateBack({
|
||||||
delta: 1
|
delta: 1
|
||||||
});
|
});
|
||||||
else this.$util.redirectTo('/pages/index/index');
|
else this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
},
|
},
|
||||||
getNewestGame() {
|
getNewestGame() {
|
||||||
this.$api.sendRequest({
|
this.$api.sendRequest({
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index', {}, 'redirectTo');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL, {}, 'redirectTo');
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ export default {
|
|||||||
title: '未获取到创建订单所需数据!'
|
title: '未获取到创建订单所需数据!'
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 1500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -122,7 +122,7 @@ export default {
|
|||||||
title: '未获取到创建订单所需数据!'
|
title: '未获取到创建订单所需数据!'
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 1500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -547,7 +547,7 @@ export default {
|
|||||||
}
|
}
|
||||||
// 判断登录
|
// 判断登录
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo('/pages_tool/login/login');
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||||
} else {
|
} else {
|
||||||
this.getOrderPaymentData();
|
this.getOrderPaymentData();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
this.$util.redirectTo('/pages_promotion/point/order_list', {}, 'redirectTo');
|
this.$util.redirectTo('/pages_promotion/point/order_list', {}, 'redirectTo');
|
||||||
},
|
},
|
||||||
toIndex() {
|
toIndex() {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<view class="bg border-top"></view>
|
<view class="bg border-top"></view>
|
||||||
<view class="list_cotact padding-top">
|
<view class="list_cotact padding-top">
|
||||||
<view class="container">
|
<view class="container">
|
||||||
|
<!-- 专属客服 + 在线留言 -->
|
||||||
<!-- #ifdef H5 -->
|
<!-- #ifdef H5 -->
|
||||||
<view class="view_ul view_ul_one clearfix">
|
<view class="view_ul view_ul_one clearfix">
|
||||||
<view @click="tapMessage" class="view_li w50_li text-center"
|
<view @click="tapMessage" class="view_li w50_li text-center"
|
||||||
@@ -14,7 +15,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view @click="test()">Test</view> -->
|
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<view class="view_ul view_ul_one clearfix">
|
<view class="view_ul view_ul_one clearfix">
|
||||||
@@ -34,6 +34,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<!-- 人员信息/名片 -->
|
||||||
<view class="view_ul_100" v-for="(item, index) in dataList" :key="index"
|
<view class="view_ul_100" v-for="(item, index) in dataList" :key="index"
|
||||||
style="margin-bottom: 20rpx;">
|
style="margin-bottom: 20rpx;">
|
||||||
|
|
||||||
@@ -65,20 +66,50 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="view_ul view_ul_two clearfix " v-if="dataList.length > 3" >
|
|
||||||
<view @click="Tel(item.mobile)" class="view_li w50_li" v-for="(item,index) in dataList" >
|
<!-- 企业文件 -->
|
||||||
<view class="bl bor" hoverClass="none" url="" style="box-shadow: 5rpx 5rpx 10rpx #dcdcdc;height: 230rpx;position: relative;">
|
<view class="view_files_container" v-if="showFileListDiy && fileList.length > 0">
|
||||||
<view class="contact_name" v-if="item.position">{{item.position_text}}:{{item.position}}</view>
|
<view class="section-title">企业文件</view>
|
||||||
<view class="contact_name">{{item.title_text}}:{{item.realname}}</view>
|
<view class="files-list">
|
||||||
<view class="contact_name">{{item.mobile_text}}:{{item.mobile}}</view>
|
<view v-for="(file, index) in fileList" :key="index" class="file-item">
|
||||||
<view class="contact_name" style="padding-bottom:10rpx;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">{{item.address_text}}:{{item.address}}</view>
|
<image mode="aspectFill" :src="$util.img('public/static/img/pdf-icon.png')" class="file-icon"></image>
|
||||||
<view class="contact_name" style="padding-top:10rpx;padding-bottom:0rpx;border-top: solid 1px #eee;position: absolute;bottom: 0;display: flex">
|
<view class="file-info">
|
||||||
<image mode="widthFix":src="$util.img('public/static/img/boda.png')"></image>
|
<view class="file-name">{{ file.name }}</view>
|
||||||
<view style="margin-top: -6rpx;margin-left: 10rpx;font-size: 24rpx;color:rgba(71,71,71,.79)">点击拨打电话</view>
|
<view class="file-actions">
|
||||||
|
<button class="file-btn share-btn" @click="shareFile(file)">{{ $lang('share') }}</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 企业视频 -->
|
||||||
|
<view class="view_videos_container" v-if="showVideoListDiy && videoList.length > 0">
|
||||||
|
<view class="section-title">企业视频</view>
|
||||||
|
<view class="videos-list">
|
||||||
|
<view v-for="(video, index) in videoList" :key="index" class="video-item" @click="playVideo(video)">
|
||||||
|
<image mode="aspectFill" :src="video.coverUrl" class="video-cover"></image>
|
||||||
|
<view class="video-play-btn">
|
||||||
|
<image mode="aspectFill" :src="$util.img('public/static/img/play-icon.png')" class="play-icon"></image>
|
||||||
|
</view>
|
||||||
|
<view class="video-title">{{ video.title }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 视频号视频列表 -->
|
||||||
|
<view class="view_channel_container" v-if="showChannelListDiy && channelList.length > 0">
|
||||||
|
<diy-channel-list :value="{
|
||||||
|
list: channelList,
|
||||||
|
showStyle: diyChannelSettings.channel_display_style,
|
||||||
|
rowCount: diyChannelSettings.channel_row_count,
|
||||||
|
aspectRatio: diyChannelSettings.channel_aspect_ratio,
|
||||||
|
showViewCount: diyChannelSettings.channel_show_view_count,
|
||||||
|
titleLineClamp: diyChannelSettings.channel_title_line_clamp,
|
||||||
|
showPlayBtn: diyChannelSettings.channel_show_play_btn,
|
||||||
|
}" @channel-video-click-play="onChannelVideoClickPlay"/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 地图 -->
|
||||||
<map v-if="shop.longitude > 0 && shop.latitude > 0 && ismessage == 0" id="map"
|
<map v-if="shop.longitude > 0 && shop.latitude > 0 && ismessage == 0" id="map"
|
||||||
style="width: 100%; height:400rpx" scale="12" :markers="markers" bindupdated="bindupdated"
|
style="width: 100%; height:400rpx" scale="12" :markers="markers" bindupdated="bindupdated"
|
||||||
:longitude="shop.longitude" :latitude="shop.latitude" show-location>
|
:longitude="shop.longitude" :latitude="shop.latitude" show-location>
|
||||||
@@ -90,14 +121,6 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <view wx:if="landline !=0">
|
|
||||||
<button bindtap="contact">
|
|
||||||
<view class="message">
|
|
||||||
<image mode="widthFix" src="{{contactbg}}"></image>
|
|
||||||
</view>
|
|
||||||
</button>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
<!--留言弹窗-->
|
<!--留言弹窗-->
|
||||||
<view class="goods-sku">
|
<view class="goods-sku">
|
||||||
@@ -113,20 +136,44 @@
|
|||||||
<view class="fui-cell ">
|
<view class="fui-cell ">
|
||||||
<view class="fui-cell-label ">{{ $lang('name') }}</view>
|
<view class="fui-cell-label ">{{ $lang('name') }}</view>
|
||||||
<view class="fui-cell-info">
|
<view class="fui-cell-info">
|
||||||
<input v-model="Form.realname" class="fui-input" :placeholder="$lang('pleaseEnterName')" value=""></input>
|
<input
|
||||||
|
id="input-realname"
|
||||||
|
:value="Form.realname"
|
||||||
|
@input="e => Form.realname = e.detail.value"
|
||||||
|
class="fui-input"
|
||||||
|
:placeholder="$lang('pleaseEnterName')"
|
||||||
|
:key="formKey"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fui-cell ">
|
<view class="fui-cell ">
|
||||||
<view class="fui-cell-label">{{ $lang('contactInfo') }}</view>
|
<view class="fui-cell-label">{{ $lang('contactInfo') }}</view>
|
||||||
<view class="fui-cell-info">
|
<view class="fui-cell-info">
|
||||||
<input v-model="Form.mobile" class="fui-input" maxlength="11" :placeholder="$lang('pleaseEnterMobile')" type="number"></input>
|
<input
|
||||||
|
id="input-mobile"
|
||||||
|
:value="Form.mobile"
|
||||||
|
@input="e => Form.mobile = e.detail.value"
|
||||||
|
class="fui-input"
|
||||||
|
maxlength="11"
|
||||||
|
:placeholder="$lang('pleaseEnterMobile')"
|
||||||
|
type="number"
|
||||||
|
:key="formKey"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fui-cell ">
|
<view class="fui-cell ">
|
||||||
<view class="fui-cell-label" style="position: absolute;top:10px">{{ $lang('messageContent') }}</view>
|
<view class="fui-cell-label" style="position: absolute;top:10px">{{ $lang('messageContent') }}</view>
|
||||||
<view class="fui-cell-info" style="margin-left: 160rpx;border: solid 2rpx #eee;">
|
<view class="fui-cell-info" style="margin-left: 160rpx;border: solid 2rpx #eee;">
|
||||||
<!-- <input v-model="Form.mailbox" class="fui-input" placeholder="请输入您的邮箱" type="text" ></input> -->
|
<!-- <input v-model="Form.mailbox" class="fui-input" placeholder="请输入您的邮箱" type="text" ></input> -->
|
||||||
<textarea class="textarea" v-model="Form.remark" :placeholder="$lang('pleaseEnterMessage')" style="font-size: 28rpx;padding: 10rpx;"></textarea>
|
<textarea
|
||||||
|
id="textarea-remark"
|
||||||
|
:value="Form.remark"
|
||||||
|
@input="e => Form.remark = e.detail.value"
|
||||||
|
class="textarea"
|
||||||
|
:placeholder="$lang('pleaseEnterMessage')"
|
||||||
|
style="font-size: 28rpx;padding: 10rpx;"
|
||||||
|
:key="formKey"
|
||||||
|
></textarea>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -139,25 +186,55 @@
|
|||||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||||
<hover-nav></hover-nav>
|
<hover-nav></hover-nav>
|
||||||
<diy-bottom-nav></diy-bottom-nav>
|
<diy-bottom-nav></diy-bottom-nav>
|
||||||
|
|
||||||
|
<!-- 视频播放弹窗 -->
|
||||||
|
<ns-video-player-popup
|
||||||
|
ref="videoPlayerPopup"
|
||||||
|
:current-video="currentVideo"
|
||||||
|
@popup-change="onVideoPopupChange"
|
||||||
|
></ns-video-player-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import scroll from '@/common/js/scroll-view.js';
|
import scroll from '@/common/js/scroll-view.js';
|
||||||
|
import shareUtil from '@/common/js/share.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [scroll],
|
mixins: [scroll],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
minScrollTop: 100, // 设置回到顶端按钮显示要求,最小页面滚动距离
|
minScrollTop: 100,
|
||||||
dataList: [],
|
|
||||||
|
showKefuDiy: true, // 是否显示客服及留言
|
||||||
|
showContactListDiy: true, // 是否显示联系人列表
|
||||||
|
showMapDiy: false, // 是否显示地图
|
||||||
|
showVideoListDiy: false, // 是否显示企业视频
|
||||||
|
showFileListDiy: false, // 是否显示企业文件
|
||||||
|
showChannelListDiy: false, // 是否显示视频号
|
||||||
|
|
||||||
|
dataList: [], // 电子名片信息
|
||||||
|
fileList: [], // 企业文件
|
||||||
|
videoList: [], // 企业视频
|
||||||
|
channelList: [], // 视频号
|
||||||
|
|
||||||
|
diyChannelSettings: {
|
||||||
|
channel_display_style: 'fixed',
|
||||||
|
channel_aspect_ratio: '16:9',
|
||||||
|
channel_show_view_count: true,
|
||||||
|
channel_row_count: 2,
|
||||||
|
channel_title_line_clamp: 2,
|
||||||
|
channel_show_play_btn: true,
|
||||||
|
}, // 自定义设置
|
||||||
|
|
||||||
ismessage: 0,
|
ismessage: 0,
|
||||||
|
currentVideo: null, // 当前播放的视频
|
||||||
Form: {
|
Form: {
|
||||||
realname: '',
|
realname: '',
|
||||||
mobile: '',
|
mobile: '',
|
||||||
remark: ''
|
remark: ''
|
||||||
|
|
||||||
},
|
},
|
||||||
|
formKey: Date.now(),
|
||||||
markers: [
|
markers: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@@ -182,87 +259,198 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
//刷新多语言
|
|
||||||
this.$langConfig.refresh();
|
this.$langConfig.refresh();
|
||||||
this.$api.sendRequest({
|
this.$api.sendRequest({
|
||||||
url: '/api/member/personnel',
|
url: '/api/member/personnel',
|
||||||
success: res => {
|
success: res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.dataList = res.data
|
this.dataList = res.data; // 电子名片信息
|
||||||
this.shop = res.shop
|
this.fileList = res.file_list; // 企业文件
|
||||||
this.personnel_bg = res.set.personnel_bg ? res.set.personnel_bg : 'public/static/img/diy_view/member_info_bg.png'
|
this.videoList = res.video_list; // 企业视频
|
||||||
|
this.channelList = res.channel_list.map(item => this.$util.snakeToCamelForObj(item)).map(item => {
|
||||||
|
if (item.coverImageType === 'upload') {
|
||||||
|
item.coverUrl = this.$util.img(item.coverUrl);
|
||||||
|
}
|
||||||
|
if (item.avatarImageType === 'upload') {
|
||||||
|
item.avatarUrl = this.$util.img(item.avatarUrl);
|
||||||
|
}
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
// item.embedMode = Boolean(item.feedToken);
|
||||||
|
item.finderUserName = item.channelName;
|
||||||
|
// #endif
|
||||||
|
return item;
|
||||||
|
}); // 视频号
|
||||||
|
|
||||||
|
this.shop = res.shop;
|
||||||
|
this.personnel_bg = res.set.personnel_bg ? res.set.personnel_bg : 'public/static/img/diy_view/member_info_bg.png';
|
||||||
this.markers = [{
|
this.markers = [{
|
||||||
id: 1,
|
id: 1,
|
||||||
//iconPath:'http://saas.cn//public/static/img/kefu.png',
|
|
||||||
latitude: this.shop.latitude,
|
latitude: this.shop.latitude,
|
||||||
longitude: this.shop.longitude
|
longitude: this.shop.longitude
|
||||||
}]
|
}];
|
||||||
|
|
||||||
|
// 设置是否展示各模块
|
||||||
|
this.showKefuDiy = res.diy.is_kefu == 1;
|
||||||
|
this.showContactListDiy = res.diy.is_contact == 1;
|
||||||
|
this.showMapDiy = res.diy.is_map == 1;
|
||||||
|
this.showVideoListDiy = res.diy.is_video == 1;
|
||||||
|
this.showFileListDiy = res.diy.is_file == 1;
|
||||||
|
this.showChannelListDiy = res.diy.is_channel == 1;
|
||||||
|
|
||||||
|
// 遍历res.diy所有key,然后判断key前缀包含channel_,如果包含,就赋值给diyChannelSettings
|
||||||
|
for (let key in res.diy) {
|
||||||
|
if (key.startsWith('channel_')) {
|
||||||
|
this.diyChannelSettings[key] = res.diy[key];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 分享文件
|
||||||
|
shareFile(file) {
|
||||||
|
shareUtil.shareFile(file);
|
||||||
|
},
|
||||||
|
|
||||||
|
onChannelVideoClickPlay(item) {
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/api/member/incrementChannelViewCount',
|
||||||
|
data: {
|
||||||
|
channel_id: item.channelId
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
|
||||||
},
|
},
|
||||||
fail: res => {
|
fail: res => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
test() {
|
|
||||||
// channelReady(function(bAvailable) {
|
|
||||||
// alert('是否存在框架服务:' + bAvailable)
|
|
||||||
// })
|
|
||||||
// window.location.href = 'https://hapjs.org/app//[path][?key=value] hap://app//[path][?key=value] '
|
|
||||||
//参数说明: package: 应用包名,必选 path: 应用内页面的 path,可选,默认为首页 key-value: 希望传给页面的参数,可选,可以有多个
|
|
||||||
|
|
||||||
// const isQuickAppEnv = navigator.userAgent.includes('HuaweiQuickApp');
|
// 播放视频
|
||||||
// let quickAppBridge;
|
playVideo(video) {
|
||||||
// console.log(window.quickapp)
|
// 实现视频播放逻辑
|
||||||
// if (isQuickAppEnv) {
|
if (video.videoUrl) {
|
||||||
// quickAppBridge = window.quickapp;
|
this.currentVideo = video;
|
||||||
// }
|
this.$refs.videoPlayerPopup.open();
|
||||||
// quickAppBridge.invoke('startQuickAppPage', { page: '/NativePage' });
|
} else {
|
||||||
// window.postMessage({ action: 'someAction', data: 'some data' }, '*');
|
uni.showToast({ title: '视频地址不存在', icon: 'none' });
|
||||||
// window.open('https://xcx10.5g-quickapp.com/test.php')
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 关闭视频弹窗
|
||||||
|
closeVideoPopup() {
|
||||||
|
this.$refs.videoPlayerPopup.close();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 视频弹窗状态变化
|
||||||
|
onVideoPopupChange(e) {
|
||||||
|
if (!e.show) {
|
||||||
|
// 弹窗关闭时重置当前视频
|
||||||
|
this.currentVideo = null;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
|
if (!this.Form.realname.trim()) {
|
||||||
|
uni.showToast({ title: '请填写姓名', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.Form.mobile || !/^1[3-9]\d{9}$/.test(this.Form.mobile)) {
|
||||||
|
uni.showToast({ title: '手机号格式不正确', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.Form.remark.trim()) {
|
||||||
|
uni.showToast({ title: '请填写留言内容', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$api.sendRequest({
|
this.$api.sendRequest({
|
||||||
url: '/api/member/message',
|
url: '/api/member/message',
|
||||||
data: this.Form,
|
data: this.Form,
|
||||||
success: res => {
|
success: res => {
|
||||||
|
uni.showToast({ title: res.message || '提交成功', icon: 'success' });
|
||||||
|
|
||||||
|
|
||||||
|
// 重置表单数据
|
||||||
|
this.Form = { realname: '', mobile: '', remark: '' };
|
||||||
|
this.formKey = Date.now();
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
this.$refs.informationPopup.close();
|
this.$refs.informationPopup.close();
|
||||||
this.$util.showToast({
|
|
||||||
title: res.message
|
// 微信小程序:延迟清空原生输入框(确保 DOM 已更新)
|
||||||
});
|
// #ifdef MP-WEIXIN
|
||||||
|
setTimeout(() => {
|
||||||
|
this.clearInputValues();
|
||||||
|
}, 100);
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
fail: res => {
|
fail: () => {
|
||||||
|
uni.showToast({ title: '提交失败,请重试', icon: 'none' });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
change(e) {
|
change(e) {
|
||||||
console.log(e)
|
this.ismessage = e.show ? 1 : 0;
|
||||||
this.ismessage = e.show ? 1 : 0
|
|
||||||
},
|
},
|
||||||
//留言打开
|
|
||||||
tapMessage() {
|
tapMessage() {
|
||||||
this.ismessage = 1
|
// 重置数据
|
||||||
|
this.Form = { realname: '', mobile: '', remark: '' };
|
||||||
|
this.formKey = Date.now();
|
||||||
|
this.ismessage = 1;
|
||||||
this.$refs.informationPopup.open();
|
this.$refs.informationPopup.open();
|
||||||
|
|
||||||
|
// 微信小程序:打开后清空原生输入框
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
setTimeout(() => {
|
||||||
|
this.clearInputValues();
|
||||||
|
}, 300); // 确保弹窗已渲染
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
//留言关闭
|
|
||||||
closeinformationPopup() {
|
closeinformationPopup() {
|
||||||
this.ismessage = 0
|
this.ismessage = 0;
|
||||||
this.$refs.informationPopup.close();
|
this.$refs.informationPopup.close();
|
||||||
|
|
||||||
|
// 微信小程序:关闭后也清空(防止下次打开残留)
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
setTimeout(() => {
|
||||||
|
this.clearInputValues();
|
||||||
|
}, 100);
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 专门用于微信小程序清空原生 input/textarea
|
||||||
|
clearInputValues() {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
const query = uni.createSelectorQuery().in(this);
|
||||||
|
|
||||||
|
// 分别清空每个输入框
|
||||||
|
['input-realname', 'input-mobile', 'textarea-remark'].forEach(id => {
|
||||||
|
query.select('#' + id).fields({ node: true }, (res) => {
|
||||||
|
if (res && res.node) {
|
||||||
|
res.node.value = '';
|
||||||
|
}
|
||||||
|
}).exec();
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
|
||||||
Tel(m) {
|
Tel(m) {
|
||||||
uni.makePhoneCall({
|
uni.makePhoneCall({
|
||||||
phoneNumber: m + '',
|
phoneNumber: m + '',
|
||||||
success(e) {
|
success(e) {
|
||||||
console.log(e)
|
console.log(e);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
copy(text) {
|
copy(text) {
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
data: text,
|
data: text,
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log('复制成功');
|
|
||||||
// 可以添加用户友好的提示,例如使用uni.showToast提示复制成功
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: this.$lang('copySuccess'),
|
title: this.$lang('copySuccess'),
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
@@ -270,8 +458,6 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log('复制失败');
|
|
||||||
// 可以添加错误处理或用户友好的提示
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.message || err.errMsg || this.$lang('copyFailed'),
|
title: err.message || err.errMsg || this.$lang('copyFailed'),
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -280,12 +466,13 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
tomap() {
|
tomap() {
|
||||||
uni.openLocation({
|
uni.openLocation({
|
||||||
latitude: parseFloat(this.shop.latitude),
|
latitude: parseFloat(this.shop.latitude),
|
||||||
longitude: parseFloat(this.shop.longitude),
|
longitude: parseFloat(this.shop.longitude),
|
||||||
name: this.$lang('oneClickNavigation'),
|
name: this.$lang('oneClickNavigation'),
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -438,7 +625,6 @@ image {
|
|||||||
position: relative;
|
position: relative;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
image {
|
image {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
@@ -483,7 +669,6 @@ image {
|
|||||||
line-height: 20rpx;
|
line-height: 20rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.view_ul_100 .fl {
|
.view_ul_100 .fl {
|
||||||
width: 10%;
|
width: 10%;
|
||||||
}
|
}
|
||||||
@@ -511,7 +696,6 @@ image {
|
|||||||
.list_cotact .view_ul_100>view {
|
.list_cotact .view_ul_100>view {
|
||||||
padding: 20rpx 30rpx 0rpx 30rpx;
|
padding: 20rpx 30rpx 0rpx 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list_cotact .view_ul_two .view_li>view {
|
.list_cotact .view_ul_two .view_li>view {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 20rpx 30rpx 0rpx 30rpx;
|
padding: 20rpx 30rpx 0rpx 30rpx;
|
||||||
@@ -531,7 +715,6 @@ image {
|
|||||||
.view_ul_two {
|
.view_ul_two {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contact_name {
|
.contact_name {
|
||||||
color: rgba(71, 71, 71, .79);
|
color: rgba(71, 71, 71, .79);
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
@@ -553,7 +736,7 @@ image {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border-radius: 50rpx;
|
border-radius: 50rpx;
|
||||||
width: 160rpx; // 足够容纳4个汉字(8个字符)
|
width: 160rpx;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.15), 0 1rpx 3rpx rgba(0, 0, 0, 0.1);
|
box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.15), 0 1rpx 3rpx rgba(0, 0, 0, 0.1);
|
||||||
@@ -565,7 +748,6 @@ image {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.message {
|
.message {
|
||||||
/* background-color: rgba(0,0,0,.8); */
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
bottom: 50%;
|
bottom: 50%;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
@@ -579,6 +761,132 @@ image {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
/* 企业文件样式 */
|
||||||
|
.view_files_container {
|
||||||
|
margin-top: 30rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.files-list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-item {
|
||||||
|
width: calc(50% - 10rpx);
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-icon {
|
||||||
|
width: 60rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-info {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-name {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-btn {
|
||||||
|
font-size: 20rpx;
|
||||||
|
padding: 6rpx 12rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.share-btn {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 企业视频样式 */
|
||||||
|
.view_videos_container {
|
||||||
|
margin-top: 30rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.videos-list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-item {
|
||||||
|
width: calc(33.333% - 14rpx);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-cover {
|
||||||
|
width: 100%;
|
||||||
|
aspect-ratio: 16/9;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-play-btn {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.play-icon {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-title {
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #333;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .channel-list {
|
||||||
|
padding: 0rpx !important;
|
||||||
|
}
|
||||||
|
|
||||||
/deep/ .mescroll-totop {
|
/deep/ .mescroll-totop {
|
||||||
right: 27rpx !important;
|
right: 27rpx !important;
|
||||||
/* #ifdef H5 */
|
/* #ifdef H5 */
|
||||||
@@ -588,4 +896,5 @@ image {
|
|||||||
bottom: 180rpx !important;
|
bottom: 180rpx !important;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
183
pages_tool/file-preview/file-preview.vue
Normal file
183
pages_tool/file-preview/file-preview.vue
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
<template>
|
||||||
|
<view class="file-preview-container" :style="themeColor">
|
||||||
|
<view class="header">
|
||||||
|
<view class="back-btn" @click="goBack">
|
||||||
|
<text class="iconfont icon-back"></text>
|
||||||
|
</view>
|
||||||
|
<view class="header-title">{{ fileName }}</view>
|
||||||
|
<view class="placeholder"></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="content">
|
||||||
|
<!-- PDF 文件预览 -->
|
||||||
|
<view v-if="fileType === 'pdf'" class="file-viewer">
|
||||||
|
<web-view v-if="fileUrl" :src="fileUrl"></web-view>
|
||||||
|
<view v-else class="error-message">文件地址不存在</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- Word 文件预览 -->
|
||||||
|
<view v-else-if="fileType === 'word'" class="file-viewer">
|
||||||
|
<web-view v-if="fileUrl" :src="fileUrl"></web-view>
|
||||||
|
<view v-else class="error-message">文件地址不存在</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 视频文件预览 -->
|
||||||
|
<view v-else-if="fileType === 'video'" class="video-viewer">
|
||||||
|
<video v-if="fileUrl" :src="fileUrl" controls autoplay class="video-player"></video>
|
||||||
|
<view v-else class="error-message">视频地址不存在</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 其他文件类型 -->
|
||||||
|
<view v-else class="file-viewer">
|
||||||
|
<view class="error-message">不支持的文件类型</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
fileName: '',
|
||||||
|
fileUrl: '',
|
||||||
|
fileType: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
// 解析传递的参数
|
||||||
|
if (option.fileName) {
|
||||||
|
this.fileName = decodeURIComponent(option.fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (option.fileUrl) {
|
||||||
|
this.fileUrl = decodeURIComponent(option.fileUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (option.fileType) {
|
||||||
|
this.fileType = decodeURIComponent(option.fileType);
|
||||||
|
} else {
|
||||||
|
// 根据文件名后缀推断文件类型
|
||||||
|
this.inferFileType();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 根据文件名后缀推断文件类型
|
||||||
|
*/
|
||||||
|
inferFileType() {
|
||||||
|
if (this.fileName) {
|
||||||
|
const ext = this.fileName.split('.').pop().toLowerCase();
|
||||||
|
if (['pdf'].includes(ext)) {
|
||||||
|
this.fileType = 'pdf';
|
||||||
|
} else if (['doc', 'docx'].includes(ext)) {
|
||||||
|
this.fileType = 'word';
|
||||||
|
} else if (['mp4', 'avi', 'mov', 'wmv', 'flv', 'mkv'].includes(ext)) {
|
||||||
|
this.fileType = 'video';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回上一页
|
||||||
|
*/
|
||||||
|
goBack() {
|
||||||
|
uni.navigateBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.file-preview-container {
|
||||||
|
min-height: 100vh;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 100rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.icon-back {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-title {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
text-align: center;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.placeholder {
|
||||||
|
width: 60rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
flex: 1;
|
||||||
|
padding: 20rpx;
|
||||||
|
|
||||||
|
.file-viewer {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 80vh;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
|
.error-message {
|
||||||
|
width: 100%;
|
||||||
|
height: 80vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-viewer {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 80vh;
|
||||||
|
background-color: #000;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
|
.video-player {
|
||||||
|
width: 100%;
|
||||||
|
height: 80vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-message {
|
||||||
|
width: 100%;
|
||||||
|
height: 80vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
background-color: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -99,7 +99,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
},1000);
|
},1000);
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ export default {
|
|||||||
if (this.stepShow > 0) {
|
if (this.stepShow > 0) {
|
||||||
this.stepShow -= 1;
|
this.stepShow -= 1;
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages_tool/login/login', '', 'redirectTo');
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, '', 'redirectTo');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 下一步
|
// 下一步
|
||||||
@@ -318,7 +318,7 @@ export default {
|
|||||||
uni.removeStorage({
|
uni.removeStorage({
|
||||||
key: 'forgot_password_token'
|
key: 'forgot_password_token'
|
||||||
});
|
});
|
||||||
this.$util.redirectTo('/pages_tool/login/login', {}, 'redirectTo');
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {}, 'redirectTo');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
} else {
|
} else {
|
||||||
this.stepShow -= 1;
|
this.stepShow -= 1;
|
||||||
|
|||||||
@@ -234,13 +234,13 @@ export default {
|
|||||||
this.$util.showToast({
|
this.$util.showToast({
|
||||||
title: this.$lang('loginSuccessTip')
|
title: this.$lang('loginSuccessTip')
|
||||||
});
|
});
|
||||||
let back = this.back ? this.back : '/pages/member/index';
|
let back = this.back ? this.back : this.$util.MEMBER_PAGE_URL;
|
||||||
if (this.$refs.registerReward) this.$refs.registerReward.open(back);
|
if (this.$refs.registerReward) this.$refs.registerReward.open(back);
|
||||||
} else {
|
} else {
|
||||||
if (this.back != '') {
|
if (this.back != '') {
|
||||||
this.$util.redirectTo(decodeURIComponent(this.back), {}, 'reLaunch');
|
this.$util.redirectTo(decodeURIComponent(this.back), {}, 'reLaunch');
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages/member/index', {}, 'reLaunch');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -348,13 +348,13 @@ export default {
|
|||||||
this.$store.dispatch('getCartNumber');
|
this.$store.dispatch('getCartNumber');
|
||||||
this.getMemberInfo(() => {
|
this.getMemberInfo(() => {
|
||||||
if (can_receive_registergift == 1) {
|
if (can_receive_registergift == 1) {
|
||||||
let back = this.back ? this.back : '/pages/member/index';
|
let back = this.back ? this.back : this.$util.MEMBER_PAGE_URL;
|
||||||
if (this.$refs.registerReward) this.$refs.registerReward.open(back);
|
if (this.$refs.registerReward) this.$refs.registerReward.open(back);
|
||||||
} else {
|
} else {
|
||||||
if (this.back != '') {
|
if (this.back != '') {
|
||||||
this.$util.redirectTo(decodeURIComponent(this.back), {}, this.redirect);
|
this.$util.redirectTo(decodeURIComponent(this.back), {}, this.redirect);
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages/member/index', {}, this.redirect);
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, this.redirect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
this.getWithdrawInfo();
|
this.getWithdrawInfo();
|
||||||
this.getBankAccountInfo();
|
this.getBankAccountInfo();
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages_tool/login/login', {
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||||
back: '/pages_tool/member/apply_withdrawal'
|
back: '/pages_tool/member/apply_withdrawal'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
title: '未开启提现'
|
title: '未开启提现'
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
}, 1500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export default {
|
|||||||
|
|
||||||
// 判断登录
|
// 判断登录
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo('/pages_tool/login/login');
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||||
} else {
|
} else {
|
||||||
this.getAccountInfo();
|
this.getAccountInfo();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
'height': menuButtonBounding.height + 'px'
|
'height': menuButtonBounding.height + 'px'
|
||||||
}">
|
}">
|
||||||
<view class="navbar-wrap">
|
<view class="navbar-wrap">
|
||||||
<text class="iconfont icon-back_light back" @click="$util.redirectTo('/pages/member/index')"></text>
|
<text class="iconfont icon-back_light back" @click="$util.redirectTo($util.MEMBER_PAGE_URL)"></text>
|
||||||
<view class="navbar-title">
|
<view class="navbar-title">
|
||||||
账户余额
|
账户余额
|
||||||
</view>
|
</view>
|
||||||
@@ -171,7 +171,7 @@ export default {
|
|||||||
if (options.from === 'navigateBack') {
|
if (options.from === 'navigateBack') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.$util.redirectTo('/pages/member/index', {}, 'reLaunch');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export default {
|
|||||||
if (option.back) this.back = option.back;
|
if (option.back) this.back = option.back;
|
||||||
// 判断登录
|
// 判断登录
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo('/pages_tool/login/login');
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||||
} else {
|
} else {
|
||||||
this.getCancelAgreement();
|
this.getCancelAgreement();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default {
|
|||||||
|
|
||||||
// 判断登录
|
// 判断登录
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo('/pages_tool/login/login');
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||||
} else {
|
} else {
|
||||||
this.getStatus();
|
this.getStatus();
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
toIndex() {
|
toIndex() {
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
},
|
},
|
||||||
apply() {
|
apply() {
|
||||||
this.$util.redirectTo('/pages_tool/member/cancellation');
|
this.$util.redirectTo('/pages_tool/member/cancellation');
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
// 判断登录
|
// 判断登录
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo('/pages_tool/login/login');
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||||
} else {
|
} else {
|
||||||
this.getStatus();
|
this.getStatus();
|
||||||
}
|
}
|
||||||
@@ -71,13 +71,13 @@
|
|||||||
this.$store.commit('setMemberInfo', '');
|
this.$store.commit('setMemberInfo', '');
|
||||||
this.$store.commit('setMemberInfo', '');
|
this.$store.commit('setMemberInfo', '');
|
||||||
this.$store.dispatch('emptyCart');
|
this.$store.dispatch('emptyCart');
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
back() {
|
back() {
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
},
|
},
|
||||||
revoke() {
|
revoke() {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
url: '/membercancel/api/membercancel/cancelApply',
|
url: '/membercancel/api/membercancel/cancelApply',
|
||||||
success: res => {
|
success: res => {
|
||||||
if (res.code >= 0) {
|
if (res.code >= 0) {
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
// 判断登录
|
// 判断登录
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo('/pages_tool/login/login');
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||||
} else {
|
} else {
|
||||||
this.getStatus();
|
this.getStatus();
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
this.$store.commit('setToken', '');
|
this.$store.commit('setToken', '');
|
||||||
this.$store.commit('setMemberInfo', '');
|
this.$store.commit('setMemberInfo', '');
|
||||||
this.$store.dispatch('emptyCart');
|
this.$store.dispatch('emptyCart');
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ export default {
|
|||||||
if (options.from === 'navigateBack') {
|
if (options.from === 'navigateBack') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -220,7 +220,7 @@ export default {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style scoped>
|
<style lang="scss" scoped>
|
||||||
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||||
max-height: unset !important;
|
max-height: unset !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -418,7 +418,7 @@ export default {
|
|||||||
if (options.from === 'navigateBack') {
|
if (options.from === 'navigateBack') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
</block>
|
</block>
|
||||||
<!-- 第一个列表为空时 -->
|
<!-- 第一个列表为空时 -->
|
||||||
<view class="collection-empty" v-else>
|
<view class="collection-empty" v-else>
|
||||||
<ns-empty v-if="collectionList.length == 0 && isShowEmpty" text="暂无关注的商品"
|
<ns-empty v-if="collectionList.length == 0 && isShowEmpty" text="暂无关注的商品" subText="赶紧去逛逛, 关注心仪的商品吧"
|
||||||
:isIndex="Boolean(storeToken)" :emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
:isIndex="Boolean(storeToken)" :emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
||||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
||||||
@click="toLogin">{{ $lang('toLogin') }}</button>
|
@click="toLogin">{{ $lang('toLogin') }}</button>
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="!list.length && showEmpty" class="margin-top cart-empty" :fixed="false">
|
<view v-if="!list.length && showEmpty" class="margin-top cart-empty" :fixed="false">
|
||||||
<ns-empty :isIndex="true" :emptyBtn="{url: '/pages/index/index',text: '去逛逛'}" text="暂无优惠券"></ns-empty>
|
<ns-empty :isIndex="true" :emptyBtn="{url: $util.INDEX_PAGE_URL,text: '去逛逛'}" text="暂无优惠券"></ns-empty>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</mescroll-uni>
|
</mescroll-uni>
|
||||||
@@ -93,7 +93,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
},1000);
|
},1000);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="footprint-empty" v-else>
|
<view class="footprint-empty" v-else>
|
||||||
<ns-empty text="暂无浏览过的商品" :isIndex="Boolean(storeToken)" :emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
<ns-empty text="暂无浏览过的商品" subText="赶紧去逛逛, 发现更多商品吧" :isIndex="Boolean(storeToken)" :emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
||||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
||||||
@click="toLogin">{{ $lang('toLogin') }}</button>
|
@click="toLogin">{{ $lang('toLogin') }}</button>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -96,7 +96,8 @@ export default {
|
|||||||
this.$store.commit('setMemberInfo', '');
|
this.$store.commit('setMemberInfo', '');
|
||||||
this.$store.dispatch('emptyCart');
|
this.$store.dispatch('emptyCart');
|
||||||
uni.removeStorageSync('authInfo');
|
uni.removeStorageSync('authInfo');
|
||||||
this.$util.redirectTo('/pages/member/index');
|
uni.removeStorageSync('privacyAgreed');
|
||||||
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -118,7 +119,9 @@ export default {
|
|||||||
this.$store.commit('setMemberInfo', '');
|
this.$store.commit('setMemberInfo', '');
|
||||||
this.$store.dispatch('emptyCart');
|
this.$store.dispatch('emptyCart');
|
||||||
uni.removeStorageSync('authInfo');
|
uni.removeStorageSync('authInfo');
|
||||||
this.$util.redirectTo('/pages/member/index');
|
uni.removeStorageSync('privacyAgreed');
|
||||||
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.$util.showToast({
|
this.$util.showToast({
|
||||||
title: rres.message
|
title: rres.message
|
||||||
|
|||||||
@@ -354,7 +354,7 @@
|
|||||||
if (options.from === 'navigateBack') {
|
if (options.from === 'navigateBack') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
onShow() {
|
onShow() {
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo(
|
this.$util.redirectTo(
|
||||||
'/pages_tool/login/login', {
|
this.$util.LOGIN_PAGE_URL, {
|
||||||
back: '/pages_tool/member/modify_face'
|
back: '/pages_tool/member/modify_face'
|
||||||
},
|
},
|
||||||
'redirectTo'
|
'redirectTo'
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
// 判断登录
|
// 判断登录
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo('/pages_tool/login/login');
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||||
} else {
|
} else {
|
||||||
if (this.memberInfo.mobile == '') {
|
if (this.memberInfo.mobile == '') {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
}, 'redirectTo');
|
}, 'redirectTo');
|
||||||
} else {
|
} else {
|
||||||
if (this.back) this.$util.redirectTo(this.back);
|
if (this.back) this.$util.redirectTo(this.back);
|
||||||
else this.$util.redirectTo('/pages/member/index');
|
else this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.back) this.$util.redirectTo(this.back, {},
|
if (this.back) this.$util.redirectTo(this.back, {},
|
||||||
'redirectTo');
|
'redirectTo');
|
||||||
else this.$util.redirectTo('/pages/member/index');
|
else this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
} else {
|
} else {
|
||||||
this.initInfo();
|
this.initInfo();
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<view class="navbar-wrap">
|
<view class="navbar-wrap">
|
||||||
<text class="iconfont icon-back_light back" @click="$util.redirectTo('/pages/member/index')"></text>
|
<text class="iconfont icon-back_light back" @click="$util.redirectTo($util.MEMBER_PAGE_URL)"></text>
|
||||||
<view class="navbar-title">
|
<view class="navbar-title">
|
||||||
我的积分
|
我的积分
|
||||||
</view>
|
</view>
|
||||||
@@ -143,7 +143,7 @@ export default {
|
|||||||
if (options.from === 'navigateBack') {
|
if (options.from === 'navigateBack') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.$util.redirectTo('/pages/member/index', {}, 'reLaunch');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export default {
|
|||||||
onShow() {
|
onShow() {
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo(
|
this.$util.redirectTo(
|
||||||
'/pages_tool/login/login',
|
this.$util.LOGIN_PAGE_URL,
|
||||||
{
|
{
|
||||||
back: '/pages_tool/member/point'
|
back: '/pages_tool/member/point'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
// 跳转至登录页
|
// 跳转至登录页
|
||||||
toLogin() {
|
toLogin(url) {
|
||||||
this.$refs.login.open();
|
console.log('跳转至登录页', {url, currentRoute: this.$util.getCurrentRoute()});
|
||||||
|
this.$refs.login.open(url ?? this.$util.getCurrentRoute());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -256,7 +256,7 @@ export default {
|
|||||||
this.$store.dispatch('emptyCart');
|
this.$store.dispatch('emptyCart');
|
||||||
this.$store.dispatch('emptyCart');
|
this.$store.dispatch('emptyCart');
|
||||||
uni.removeStorageSync('authInfo');
|
uni.removeStorageSync('authInfo');
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
} else {
|
} else {
|
||||||
this.$util.showToast({
|
this.$util.showToast({
|
||||||
title: rres.message
|
title: rres.message
|
||||||
@@ -329,7 +329,7 @@ export default {
|
|||||||
this.$store.dispatch('emptyCart');
|
this.$store.dispatch('emptyCart');
|
||||||
this.$store.dispatch('emptyCart');
|
this.$store.dispatch('emptyCart');
|
||||||
uni.removeStorageSync('authInfo');
|
uni.removeStorageSync('authInfo');
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export default {
|
|||||||
this.$refs.rulePopup.close();
|
this.$refs.rulePopup.close();
|
||||||
},
|
},
|
||||||
copyUrl() {
|
copyUrl() {
|
||||||
let text = this.$config.h5Domain + '/pages/index/index';
|
let text = this.$config.h5Domain + this.$util.INDEX_PAGE_URL;
|
||||||
if (this.memberInf && this.memberInfo.member_id) text += '?source_member=' + this.memberInfo.member_id;
|
if (this.memberInf && this.memberInfo.member_id) text += '?source_member=' + this.memberInfo.member_id;
|
||||||
this.$util.copy(text, () => {
|
this.$util.copy(text, () => {
|
||||||
this.closeSharePopup();
|
this.closeSharePopup();
|
||||||
@@ -76,7 +76,7 @@ export default {
|
|||||||
this.$api.sendRequest({
|
this.$api.sendRequest({
|
||||||
url: "/memberrecommend/api/memberrecommend/poster",
|
url: "/memberrecommend/api/memberrecommend/poster",
|
||||||
data: {
|
data: {
|
||||||
page: '/pages/index/index',
|
page: this.$util.INDEX_PAGE_URL,
|
||||||
qrcode_param: JSON.stringify(qrcode_param)
|
qrcode_param: JSON.stringify(qrcode_param)
|
||||||
},
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export default {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$util.redirectTo('/pages/index/index');
|
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
},1000);
|
},1000);
|
||||||
@@ -106,7 +106,7 @@ export default {
|
|||||||
if (this.back != '') {
|
if (this.back != '') {
|
||||||
this.$util.redirectTo(this.back, {}, this.redirect);
|
this.$util.redirectTo(this.back, {}, this.redirect);
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages/member/index');
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取rule
|
//获取rule
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default {
|
|||||||
onShow() {
|
onShow() {
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo(
|
this.$util.redirectTo(
|
||||||
'/pages_tool/login/login',
|
this.$util.LOGIN_PAGE_URL,
|
||||||
{
|
{
|
||||||
back: '/pages_tool/member/point'
|
back: '/pages_tool/member/point'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export default {
|
|||||||
this.getDetail();
|
this.getDetail();
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo(
|
this.$util.redirectTo(
|
||||||
'/pages_tool/login/login',
|
this.$util.LOGIN_PAGE_URL,
|
||||||
{
|
{
|
||||||
back: '/pages_tool/member/point'
|
back: '/pages_tool/member/point'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export default {
|
|||||||
onShow() {
|
onShow() {
|
||||||
// 判断登录
|
// 判断登录
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo('/pages_tool/login/login');
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||||
} else {
|
} else {
|
||||||
this.getPackageInfo();
|
this.getPackageInfo();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default {
|
|||||||
|
|
||||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||||
if (!this.storeToken) {
|
if (!this.storeToken) {
|
||||||
this.$util.redirectTo('/pages_tool/login/login', {
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||||
back: '/pages_tool/order/evaluate?order_id=' + this.orderId
|
back: '/pages_tool/order/evaluate?order_id=' + this.orderId
|
||||||
}, 'redirectTo');
|
}, 'redirectTo');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ export default {
|
|||||||
if (this.storeToken) {
|
if (this.storeToken) {
|
||||||
this.getRefundData();
|
this.getRefundData();
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages_tool/login/login', { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id });
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export default {
|
|||||||
if (this.storeToken) {
|
if (this.storeToken) {
|
||||||
this.getRefundData();
|
this.getRefundData();
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages_tool/login/login', { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id });
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ export default {
|
|||||||
if (this.storeToken) {
|
if (this.storeToken) {
|
||||||
this.getRefundDetail();
|
this.getRefundDetail();
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages_tool/login/login', { back: '/pages_tool/order/refund_detail?order_goods_id=' + this.order_goods_id });
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, { back: '/pages_tool/order/refund_detail?order_goods_id=' + this.order_goods_id });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
if (this.storeToken) {
|
if (this.storeToken) {
|
||||||
this.getRefundData();
|
this.getRefundData();
|
||||||
} else {
|
} else {
|
||||||
this.$util.redirectTo('/pages_tool/login/login', {
|
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||||
back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id
|
back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user