Compare commits
4 Commits
test/hw-se
...
tmp/tmp-01
| Author | SHA1 | Date | |
|---|---|---|---|
| a2616c9757 | |||
| fb47da8095 | |||
| 37958cbe39 | |||
| 9f53f147ee |
@@ -54,6 +54,6 @@ const localDevConfig = ({
|
|||||||
uniacid: 115,
|
uniacid: 115,
|
||||||
domain: 'https://5g.aigc-quickapp.com/',
|
domain: 'https://5g.aigc-quickapp.com/',
|
||||||
},
|
},
|
||||||
})['1']; // 选择要使用的环境配置
|
})['2811']; // 选择要使用的环境配置
|
||||||
|
|
||||||
export default localDevConfig;
|
export default localDevConfig;
|
||||||
1
App.vue
1
App.vue
@@ -266,7 +266,6 @@
|
|||||||
imgUrl: this.$util.img(share_data.imgUrl)
|
imgUrl: this.$util.img(share_data.imgUrl)
|
||||||
},
|
},
|
||||||
res => {
|
res => {
|
||||||
console.log(res);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,15 +40,6 @@ export default {
|
|||||||
*/
|
*/
|
||||||
async sendMessage(message, options = {}) {
|
async sendMessage(message, options = {}) {
|
||||||
try {
|
try {
|
||||||
// 调试:打印关键状态
|
|
||||||
console.log('[AI Service] sendMessage 开始执行');
|
|
||||||
console.log('[AI Service] store.state.memberInfo:', store.state.memberInfo);
|
|
||||||
console.log('[AI Service] uniacid:', this.getUniacid());
|
|
||||||
console.log('[AI Service] currentConversationId:', this.getConversationId());
|
|
||||||
|
|
||||||
const aiConfig = store.getters.globalAIKefuConfig;
|
|
||||||
console.log('[AI Service] aiConfig:', aiConfig);
|
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
url: '/api/kefu/chat',
|
url: '/api/kefu/chat',
|
||||||
data: {
|
data: {
|
||||||
@@ -66,16 +57,11 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('[AI Service] 发送请求到:', params.url);
|
|
||||||
console.log('[AI Service] 请求参数:', JSON.stringify(params.data, null, 2));
|
|
||||||
|
|
||||||
const response = await http.sendRequest({
|
const response = await http.sendRequest({
|
||||||
...params,
|
...params,
|
||||||
async: false
|
async: false
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('[AI Service] 收到响应:', response);
|
|
||||||
|
|
||||||
const result = this.handleResponse(response);
|
const result = this.handleResponse(response);
|
||||||
if (result.conversationId) {
|
if (result.conversationId) {
|
||||||
this.setConversationId(result.conversationId);
|
this.setConversationId(result.conversationId);
|
||||||
@@ -103,7 +89,6 @@ export default {
|
|||||||
const match = Config.baseUrl.match(/^(?:https?:\/\/|wss?:\/\/)([^\/\s:]+)/);
|
const match = Config.baseUrl.match(/^(?:https?:\/\/|wss?:\/\/)([^\/\s:]+)/);
|
||||||
const domain = match ? match[1] : '';
|
const domain = match ? match[1] : '';
|
||||||
const wssUrl = `wss://${domain}/ws/aikefu`;
|
const wssUrl = `wss://${domain}/ws/aikefu`;
|
||||||
console.log(`wssUrl = ${wssUrl}`);
|
|
||||||
const socketTask = wx.connectSocket({
|
const socketTask = wx.connectSocket({
|
||||||
url: wssUrl,
|
url: wssUrl,
|
||||||
header: {}
|
header: {}
|
||||||
@@ -114,7 +99,6 @@ export default {
|
|||||||
let isAuthenticated = false;
|
let isAuthenticated = false;
|
||||||
|
|
||||||
socketTask.onOpen(() => {
|
socketTask.onOpen(() => {
|
||||||
console.log('WebSocket 连接成功,开始认证...');
|
|
||||||
socketTask.send({
|
socketTask.send({
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'auth',
|
action: 'auth',
|
||||||
@@ -128,10 +112,8 @@ export default {
|
|||||||
socketTask.onMessage((res) => {
|
socketTask.onMessage((res) => {
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(res.data);
|
const data = JSON.parse(res.data);
|
||||||
console.log('收到 WebSocket 消息:', data);
|
|
||||||
|
|
||||||
if (data.type === 'auth_success') {
|
if (data.type === 'auth_success') {
|
||||||
console.log('认证成功,发送聊天消息...');
|
|
||||||
isAuthenticated = true;
|
isAuthenticated = true;
|
||||||
socketTask.send({
|
socketTask.send({
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
@@ -173,7 +155,6 @@ export default {
|
|||||||
|
|
||||||
// 可选:处理 done
|
// 可选:处理 done
|
||||||
else if (data.type === 'done') {
|
else if (data.type === 'done') {
|
||||||
console.log('对话完成:', data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -189,7 +170,6 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
socketTask.onClose(() => {
|
socketTask.onClose(() => {
|
||||||
console.log('WebSocket 连接已关闭');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const timeout = setTimeout(() => {
|
const timeout = setTimeout(() => {
|
||||||
@@ -388,7 +368,6 @@ export default {
|
|||||||
async: false,
|
async: false,
|
||||||
data: {}
|
data: {}
|
||||||
});
|
});
|
||||||
console.log('/api/kefu/health response', response);
|
|
||||||
const available = [response?.data?.status, response?.data?.components?.ai_service_config?.status]
|
const available = [response?.data?.status, response?.data?.components?.ai_service_config?.status]
|
||||||
.filter(item => item === 'healthy').length > 0;
|
.filter(item => item === 'healthy').length > 0;
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ if (process?.env?.NODE_ENV === 'development') {
|
|||||||
// 如果本地配置文件不存在或加载失败,保持使用默认配置
|
// 如果本地配置文件不存在或加载失败,保持使用默认配置
|
||||||
// 只在开发模式下输出提示信息
|
// 只在开发模式下输出提示信息
|
||||||
// #ifdef WEB
|
// #ifdef WEB
|
||||||
console.log('本地配置文件 .local.config.js 不存在,使用默认配置');
|
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ export class CustomerService {
|
|||||||
|
|
||||||
// 优先级:外部传入 > vuex store > 空对象
|
// 优先级:外部传入 > vuex store > 空对象
|
||||||
const servicerConfig = this.externalConfig || this.vm.$store.state.servicerConfig || {};
|
const servicerConfig = this.externalConfig || this.vm.$store.state.servicerConfig || {};
|
||||||
console.log(`【实时客服配置】`, servicerConfig);
|
|
||||||
|
|
||||||
let platformConfig = null;
|
let platformConfig = null;
|
||||||
|
|
||||||
@@ -167,8 +166,6 @@ export class CustomerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const config = this.getPlatformConfig();
|
const config = this.getPlatformConfig();
|
||||||
console.log('【当前客服配置】', config);
|
|
||||||
console.log('【客服类型】', config.type);
|
|
||||||
|
|
||||||
const { niushop = {}, sendMessageTitle = '', sendMessagePath = '', sendMessageImg = '' } = options;
|
const { niushop = {}, sendMessageTitle = '', sendMessagePath = '', sendMessageImg = '' } = options;
|
||||||
|
|
||||||
@@ -180,31 +177,24 @@ export class CustomerService {
|
|||||||
// 核心路由:根据 type 决定行为
|
// 核心路由:根据 type 决定行为
|
||||||
switch (config.type) {
|
switch (config.type) {
|
||||||
case 'aikefu':
|
case 'aikefu':
|
||||||
console.log('【跳转 AI 客服】目标路径: /pages_tool/ai-chat/index');
|
|
||||||
this.openDifyService();
|
this.openDifyService();
|
||||||
break;
|
break;
|
||||||
case 'wxwork':
|
case 'wxwork':
|
||||||
console.log('【跳转企业微信客服】');
|
|
||||||
this.openWxworkService(false, config, options);
|
this.openWxworkService(false, config, options);
|
||||||
break;
|
break;
|
||||||
case 'third':
|
case 'third':
|
||||||
console.log('【跳转第三方客服】');
|
|
||||||
this.openThirdService(config);
|
this.openThirdService(config);
|
||||||
break;
|
break;
|
||||||
case 'miniprogram':
|
case 'miniprogram':
|
||||||
console.log('【跳转第三方小程序客服】');
|
|
||||||
this.openThirdService(config);
|
this.openThirdService(config);
|
||||||
break;
|
break;
|
||||||
case 'niushop':
|
case 'niushop':
|
||||||
console.log('【跳转牛商客服】');
|
|
||||||
this.openNiushopService(niushop);
|
this.openNiushopService(niushop);
|
||||||
break;
|
break;
|
||||||
case 'weapp':
|
case 'weapp':
|
||||||
console.log('【跳转微信官方客服】');
|
|
||||||
this.openWeappService(config, options);
|
this.openWeappService(config, options);
|
||||||
break;
|
break;
|
||||||
case 'aliapp':
|
case 'aliapp':
|
||||||
console.log('【跳转支付宝客服】');
|
|
||||||
this.openAliappService(config);
|
this.openAliappService(config);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -225,7 +215,7 @@ export class CustomerService {
|
|||||||
wx.navigateToMiniProgram({
|
wx.navigateToMiniProgram({
|
||||||
appId: 'wxeb490c6f9b154ef9',
|
appId: 'wxeb490c6f9b154ef9',
|
||||||
path: `pages/contacts/externalContactDetail?url=${encodeURIComponent(wxworkConfig.contact_url)}`,
|
path: `pages/contacts/externalContactDetail?url=${encodeURIComponent(wxworkConfig.contact_url)}`,
|
||||||
success: () => console.log('跳转企业微信成功'),
|
success: () => {},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.error('跳转企业微信失败:', err);
|
console.error('跳转企业微信失败:', err);
|
||||||
this.fallbackToOriginalService();
|
this.fallbackToOriginalService();
|
||||||
@@ -262,24 +252,20 @@ export class CustomerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
openThirdService(config) {
|
openThirdService(config) {
|
||||||
console.log('【第三方客服配置】', config);
|
|
||||||
console.log('【配置字段】', Object.keys(config));
|
|
||||||
|
|
||||||
// 支持多种可能的字段名
|
// 支持多种可能的字段名
|
||||||
const miniAppId = config.mini_app_id || config.miniAppId || config.appid || config.appId || config.app_id;
|
const miniAppId = config.mini_app_id || config.miniAppId || config.appid || config.appId || config.app_id;
|
||||||
const miniAppPath = config.mini_app_path || config.miniAppPath || config.path || config.page_path || '';
|
const miniAppPath = config.mini_app_path || config.miniAppPath || config.path || config.page_path || '';
|
||||||
|
|
||||||
console.log('【解析后的小程序配置】AppID:', miniAppId, 'Path:', miniAppPath);
|
|
||||||
|
|
||||||
// 优先处理第三方微信小程序客服
|
// 优先处理第三方微信小程序客服
|
||||||
if (miniAppId) {
|
if (miniAppId) {
|
||||||
console.log('【跳转第三方小程序】AppID:', miniAppId, 'Path:', miniAppPath);
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
wx.navigateToMiniProgram({
|
wx.navigateToMiniProgram({
|
||||||
appId: miniAppId,
|
appId: miniAppId,
|
||||||
path: miniAppPath,
|
path: miniAppPath,
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log('【跳转第三方小程序成功】');
|
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.error('【跳转第三方小程序失败】', err);
|
console.error('【跳转第三方小程序失败】', err);
|
||||||
@@ -295,7 +281,6 @@ export class CustomerService {
|
|||||||
|
|
||||||
// 处理第三方链接客服
|
// 处理第三方链接客服
|
||||||
if (config.third_url) {
|
if (config.third_url) {
|
||||||
console.log('【跳转第三方链接】', config.third_url);
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
window.location.href = config.third_url;
|
window.location.href = config.third_url;
|
||||||
// #endif
|
// #endif
|
||||||
@@ -326,7 +311,7 @@ export class CustomerService {
|
|||||||
// 此方法仅用于自定义跳转(如 useOfficial: false)
|
// 此方法仅用于自定义跳转(如 useOfficial: false)
|
||||||
if (config.useOfficial !== false) {
|
if (config.useOfficial !== false) {
|
||||||
// 不做任何事,应由 <button open-type="contact"> 触发
|
// 不做任何事,应由 <button open-type="contact"> 触发
|
||||||
console.log('使用微信官方客服,请确保按钮为 <button open-type="contact">');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.handleCustomWeappService(config, options);
|
this.handleCustomWeappService(config, options);
|
||||||
@@ -384,7 +369,7 @@ export class CustomerService {
|
|||||||
this.openThirdService(config);
|
this.openThirdService(config);
|
||||||
} else {
|
} else {
|
||||||
// 支付宝原生客服由 button open-type="contact" 触发,此处不处理
|
// 支付宝原生客服由 button open-type="contact" 触发,此处不处理
|
||||||
console.log('使用支付宝官方客服');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -644,8 +629,6 @@ export class CustomerService {
|
|||||||
handleUnifiedKefuClick(options = {}) {
|
handleUnifiedKefuClick(options = {}) {
|
||||||
const validation = this.validateConfig();
|
const validation = this.validateConfig();
|
||||||
|
|
||||||
console.log('【客服配置验证】', validation);
|
|
||||||
|
|
||||||
if (!validation.isValid) {
|
if (!validation.isValid) {
|
||||||
console.error('客服配置无效:', validation.errors);
|
console.error('客服配置无效:', validation.errors);
|
||||||
uni.showToast({ title: '客服暂不可用', icon: 'none' });
|
uni.showToast({ title: '客服暂不可用', icon: 'none' });
|
||||||
@@ -657,12 +640,10 @@ export class CustomerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const platformConfig = this.getPlatformConfig();
|
const platformConfig = this.getPlatformConfig();
|
||||||
console.log('【当前客服配置】', platformConfig);
|
|
||||||
|
|
||||||
// 检查企业微信配置
|
// 检查企业微信配置
|
||||||
if (platformConfig.type === 'wxwork') {
|
if (platformConfig.type === 'wxwork') {
|
||||||
const wxworkConfig = this.getWxworkConfig();
|
const wxworkConfig = this.getWxworkConfig();
|
||||||
console.log('【企业微信配置】', wxworkConfig);
|
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
if (!wxworkConfig?.enable || !wxworkConfig?.contact_url) {
|
if (!wxworkConfig?.enable || !wxworkConfig?.contact_url) {
|
||||||
|
|||||||
@@ -200,7 +200,6 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
play(){
|
play(){
|
||||||
console.log(123)
|
|
||||||
},
|
},
|
||||||
async init() {
|
async init() {
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,6 @@ export default {
|
|||||||
|
|
||||||
// 商品详情
|
// 商品详情
|
||||||
if (this.goodsSkuDetail.goods_content) this.goodsSkuDetail.goods_content = (this.goodsSkuDetail.goods_content);
|
if (this.goodsSkuDetail.goods_content) this.goodsSkuDetail.goods_content = (this.goodsSkuDetail.goods_content);
|
||||||
console.log(this.goodsSkuDetail.goods_content)
|
|
||||||
// if (this.goodsSkuDetail.goods_content) this.goodsSkuDetail.goods_content = htmlParser(this.goodsSkuDetail.goods_content);
|
// if (this.goodsSkuDetail.goods_content) this.goodsSkuDetail.goods_content = htmlParser(this.goodsSkuDetail.goods_content);
|
||||||
|
|
||||||
//商品服务
|
//商品服务
|
||||||
|
|||||||
@@ -316,11 +316,9 @@ function replaceVideo(html){
|
|||||||
|
|
||||||
let rep = `<video style="width:100% !important;display:block;max-width: ${screenWidth} !important;"`;
|
let rep = `<video style="width:100% !important;display:block;max-width: ${screenWidth} !important;"`;
|
||||||
var html = html.replace(/\\/g, '').replace(/<video/g, rep);
|
var html = html.replace(/\\/g, '').replace(/<video/g, rep);
|
||||||
console.log(html)
|
|
||||||
html = html.replace(/<video [^>]*src=['"]([^'"]+)[^>]*>/gi, (match, capture) => {
|
html = html.replace(/<video [^>]*src=['"]([^'"]+)[^>]*>/gi, (match, capture) => {
|
||||||
return rep + ' src="' + util.img(capture) + '"/>';
|
return rep + ' src="' + util.img(capture) + '"/>';
|
||||||
});
|
});
|
||||||
// console.log(html)
|
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,16 +89,13 @@ export default {
|
|||||||
let platform = util.getDeviceInfo().platform;
|
let platform = util.getDeviceInfo().platform;
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
case 'android':
|
case 'android':
|
||||||
console.log('运行Android上')
|
|
||||||
openMapByAndroid(arr[1], arr[0], name)
|
openMapByAndroid(arr[1], arr[0], name)
|
||||||
break;
|
break;
|
||||||
case 'ios':
|
case 'ios':
|
||||||
console.log('运行iOS上')
|
|
||||||
openMapByIos(arr[1], arr[0], name)
|
openMapByIos(arr[1], arr[0], name)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
openMapByDefault(arr[1], arr[0], name)
|
openMapByDefault(arr[1], arr[0], name)
|
||||||
console.log('运行在开发者工具上')
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ export class NavigationHelper {
|
|||||||
|
|
||||||
query.select('.uni-page-head').boundingClientRect((rect) => {
|
query.select('.uni-page-head').boundingClientRect((rect) => {
|
||||||
if (rect && rect.height > 0) {
|
if (rect && rect.height > 0) {
|
||||||
console.log('直接查询导航栏高度成功:', rect.height)
|
|
||||||
resolve(rect.height)
|
resolve(rect.height)
|
||||||
} else {
|
} else {
|
||||||
console.warn('未找到 uni-page-head 元素或高度为0')
|
console.warn('未找到 uni-page-head 元素或高度为0')
|
||||||
@@ -64,7 +63,6 @@ export class NavigationHelper {
|
|||||||
|
|
||||||
const height = menuButtonInfo.bottom +
|
const height = menuButtonInfo.bottom +
|
||||||
(menuButtonInfo.top - systemInfo.statusBarHeight)
|
(menuButtonInfo.top - systemInfo.statusBarHeight)
|
||||||
console.log('微信小程序导航栏高度:', height)
|
|
||||||
resolve(height)
|
resolve(height)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('微信小程序高度计算失败:', error)
|
console.error('微信小程序高度计算失败:', error)
|
||||||
@@ -174,7 +172,6 @@ export class NavigationHelper {
|
|||||||
|
|
||||||
// 处理服务请求
|
// 处理服务请求
|
||||||
async handleServiceRequest(event, component) {
|
async handleServiceRequest(event, component) {
|
||||||
console.log('处理导航相关服务请求:', event.type)
|
|
||||||
|
|
||||||
// 安全检查事件目标
|
// 安全检查事件目标
|
||||||
if (this.shouldProcessNavigationRequest(event)) {
|
if (this.shouldProcessNavigationRequest(event)) {
|
||||||
@@ -278,7 +275,6 @@ export class NavigationHelper {
|
|||||||
// 清理缓存
|
// 清理缓存
|
||||||
clearCache() {
|
clearCache() {
|
||||||
this.navigationCache.clear()
|
this.navigationCache.clear()
|
||||||
console.log('导航缓存已清理')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,53 +21,35 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 判断是否已连接
|
// 判断是否已连接
|
||||||
checkOpenSocket() {
|
checkOpenSocket() {
|
||||||
console.log('判断是否已连接');
|
|
||||||
// alert('判断是否已连接')
|
|
||||||
let self = this;
|
let self = this;
|
||||||
uni.sendSocketMessage({
|
uni.sendSocketMessage({
|
||||||
data: 'ping',
|
data: 'ping',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log('连接成功,检查');
|
|
||||||
// alert('连接成功,检查')
|
|
||||||
// self.getChatList();
|
|
||||||
},
|
},
|
||||||
fail: (err) => { // 未连接打开websocket连接
|
fail: (err) => { // 未连接打开websocket连接
|
||||||
console.log('连接失败');
|
|
||||||
// alert('连接失败')
|
|
||||||
self.openConnection();
|
self.openConnection();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
openConnection() { // 打开连接
|
openConnection() { // 打开连接
|
||||||
console.log('打开连接');
|
|
||||||
// alert('打开连接')
|
|
||||||
// uni.closeSocket(); // 确保已经关闭后再重新打开
|
// uni.closeSocket(); // 确保已经关闭后再重新打开
|
||||||
uni.connectSocket({
|
uni.connectSocket({
|
||||||
url: config.webSocket,
|
url: config.webSocket,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log('连接成功 connectSocket=', res);
|
|
||||||
// alert('连接成功 connectSocket=', res);
|
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
console.log('连接失败 connectSocket=', err);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// uni.onSocketOpen((res) => {
|
|
||||||
// console.log('连接成功', res);
|
|
||||||
// });
|
|
||||||
this.onSocketMessage(); // 打开成功监听服务器返回的消息
|
this.onSocketMessage(); // 打开成功监听服务器返回的消息
|
||||||
},
|
},
|
||||||
// 打开成功监听服务器返回的消息
|
// 打开成功监听服务器返回的消息
|
||||||
onSocketMessage() { // 消息
|
onSocketMessage() { // 消息
|
||||||
console.log("开始监听");
|
|
||||||
|
|
||||||
let that = this;
|
let that = this;
|
||||||
this.pingInterval = config.pingInterval;
|
this.pingInterval = config.pingInterval;
|
||||||
this.timeoutObj = null;
|
this.timeoutObj = null;
|
||||||
uni.onSocketMessage((res) => { //type:init,connect,close,string,order,goods
|
uni.onSocketMessage((res) => { //type:init,connect,close,string,order,goods
|
||||||
let msg = JSON.parse(res.data);
|
let msg = JSON.parse(res.data);
|
||||||
console.log("监听该服务器消息", res);
|
|
||||||
if (msg.type == 'close') {
|
if (msg.type == 'close') {
|
||||||
clearInterval(that.timeoutObj);
|
clearInterval(that.timeoutObj);
|
||||||
that.timeoutObj = null;
|
that.timeoutObj = null;
|
||||||
@@ -141,22 +123,18 @@ export default {
|
|||||||
},
|
},
|
||||||
// 检测心跳reset
|
// 检测心跳reset
|
||||||
reset() {
|
reset() {
|
||||||
console.log("检测心跳");
|
|
||||||
clearInterval(this.timeoutObj);
|
clearInterval(this.timeoutObj);
|
||||||
this.start(); // 启动心跳
|
this.start(); // 启动心跳
|
||||||
},
|
},
|
||||||
// 启动心跳 start
|
// 启动心跳 start
|
||||||
start() {
|
start() {
|
||||||
console.log("启动心跳");
|
|
||||||
let self = this;
|
let self = this;
|
||||||
this.timeoutObj = setInterval(function () {
|
this.timeoutObj = setInterval(function () {
|
||||||
uni.sendSocketMessage({
|
uni.sendSocketMessage({
|
||||||
data: 'ping',
|
data: 'ping',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log('连接中....');
|
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log('连接失败重新连接....');
|
|
||||||
self.openConnection();
|
self.openConnection();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ export const makePhoneCall = (mobile) => {
|
|||||||
uni.makePhoneCall({
|
uni.makePhoneCall({
|
||||||
phoneNumber: `${mobile}`,
|
phoneNumber: `${mobile}`,
|
||||||
success(e) {
|
success(e) {
|
||||||
console.log(e);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -132,9 +132,7 @@ export default {
|
|||||||
let url = to;
|
let url = to;
|
||||||
|
|
||||||
// 替换url中的前缀
|
// 替换url中的前缀
|
||||||
console.log('页面跳转 redirectTo', to, param, mode);
|
|
||||||
url = adaptSubpackageUrl(url);
|
url = adaptSubpackageUrl(url);
|
||||||
console.log('adaptSubpackageUrl', url);
|
|
||||||
|
|
||||||
if (param != undefined) {
|
if (param != undefined) {
|
||||||
Object.keys(param).forEach(function (key) {
|
Object.keys(param).forEach(function (key) {
|
||||||
@@ -178,7 +176,6 @@ export default {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// 保留当前页面,跳转到应用内的某个页面,新增页面到栈顶,长度+1(上限10层)
|
// 保留当前页面,跳转到应用内的某个页面,新增页面到栈顶,长度+1(上限10层)
|
||||||
console.log('保留当前页面,navigateTo跳转到应用内的某个页面', url);
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url
|
url
|
||||||
});
|
});
|
||||||
@@ -623,13 +620,8 @@ export default {
|
|||||||
appId: 'wxeb490c6f9b154ef9', // 是企业微信官方小程序的AppID(固定值, 由腾讯企业微信团队维护, 不需要修改,用于展示"添加企业微信联系人"的官方页面)
|
appId: 'wxeb490c6f9b154ef9', // 是企业微信官方小程序的AppID(固定值, 由腾讯企业微信团队维护, 不需要修改,用于展示"添加企业微信联系人"的官方页面)
|
||||||
path: `pages/contacts/externalContactDetail?url=${encodeURIComponent(wxworkConfig?.contact_url)}`,
|
path: `pages/contacts/externalContactDetail?url=${encodeURIComponent(wxworkConfig?.contact_url)}`,
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log('跳转企业微信成功');
|
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.error('跳转企业微信失败:', err);
|
|
||||||
// 降级处理:使用原有客服方式
|
|
||||||
fallbackFunc && fallbackFunc();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
fallbackFunc && fallbackFunc();
|
fallbackFunc && fallbackFunc();
|
||||||
@@ -909,12 +901,11 @@ export default {
|
|||||||
},
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
if (res.code >= 0) {
|
if (res.code >= 0) {
|
||||||
uni.removeStorage({
|
uni.removeStorage({
|
||||||
key: 'source_member',
|
key: 'source_member',
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log('删除成功', res)
|
}
|
||||||
}
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -938,27 +929,23 @@ export default {
|
|||||||
success: res => {
|
success: res => {
|
||||||
if (res.data.length) {
|
if (res.data.length) {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
uni.requestSubscribeMessage({
|
uni.requestSubscribeMessage({
|
||||||
tmplIds: res.data,
|
tmplIds: res.data,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log("res", res)
|
},
|
||||||
},
|
fail: (res) => {
|
||||||
fail: (res) => {
|
}
|
||||||
console.log('fail', res)
|
})
|
||||||
}
|
|
||||||
})
|
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
my.requestSubscribeMessage({
|
my.requestSubscribeMessage({
|
||||||
entityIds: res.data,
|
entityIds: res.data,
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log("res", res)
|
},
|
||||||
},
|
fail: res => {
|
||||||
fail: res => {
|
}
|
||||||
console.log('fail', res)
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1213,7 +1200,6 @@ export default {
|
|||||||
let _isQuickApp = false;
|
let _isQuickApp = false;
|
||||||
try {
|
try {
|
||||||
const ua = navigator?.userAgent?.toLowerCase();
|
const ua = navigator?.userAgent?.toLowerCase();
|
||||||
// console.log('ua = ', ua);
|
|
||||||
_isQuickApp = ua.indexOf('quickapp') !== -1;
|
_isQuickApp = ua.indexOf('quickapp') !== -1;
|
||||||
|
|
||||||
if (!_isQuickApp) {
|
if (!_isQuickApp) {
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ let Weixin = function () {
|
|||||||
typeof callback == 'function' && callback(res);
|
typeof callback == 'function' && callback(res);
|
||||||
},
|
},
|
||||||
fail: (res) => {
|
fail: (res) => {
|
||||||
console.log('获取收货地址 fail',res);
|
|
||||||
alert(JSON.stringify(res))
|
alert(JSON.stringify(res))
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -98,9 +98,7 @@ export default {
|
|||||||
uni.setStorageSync('audio_list', audio_list)
|
uni.setStorageSync('audio_list', audio_list)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(uni.getStorageSync('audio_list'))
|
|
||||||
var n = this;
|
var n = this;
|
||||||
// console.log(a)
|
|
||||||
a.onPlay(function () {
|
a.onPlay(function () {
|
||||||
var e = setInterval(function () {
|
var e = setInterval(function () {
|
||||||
var i = a.currentTime / a.duration * 100 + "%", s = Math.floor(Math.ceil(a.currentTime) / 60), o = (Math.ceil(a.currentTime) % 60 / 100).toFixed(2).slice(-2), r = Math.ceil(a.currentTime);
|
var i = a.currentTime / a.duration * 100 + "%", s = Math.floor(Math.ceil(a.currentTime) / 60), o = (Math.ceil(a.currentTime) % 60 / 100).toFixed(2).slice(-2), r = Math.ceil(a.currentTime);
|
||||||
@@ -113,13 +111,12 @@ export default {
|
|||||||
|
|
||||||
var s = n.$util.img(n.value.audioUrl), o = n.audios[n.value.id].seconds || 0, r = 0, u = 1;
|
var s = n.$util.img(n.value.audioUrl), o = n.audios[n.value.id].seconds || 0, r = 0, u = 1;
|
||||||
0 == u && a.onEnded(function (e) {
|
0 == u && a.onEnded(function (e) {
|
||||||
c[t].status = !1, n.status = !1, c[t].seconds = 0, console.log(c), n.audios = c;
|
c[t].status = !1, n.status = !1, c[t].seconds = 0, n.audios = c;
|
||||||
});
|
});
|
||||||
var c = n.audios;
|
var c = n.audios;
|
||||||
c[t] || (c[t] = {}), a.paused && 0 == o ? (a.src = s, a.play(), 1 == u && (a.loop = !0),
|
c[t] || (c[t] = {}), a.paused && 0 == o ? (a.src = s, a.play(), 1 == u && (a.loop = !0),
|
||||||
c[t].status = !0, n.status = !0, n.pauseOther(t)) : a.paused && o > 0 ? (a.play(), 0 == r ? a.seek(o) : a.seek(0),
|
c[t].status = !0, n.status = !0, n.pauseOther(t)) : a.paused && o > 0 ? (a.play(), 0 == r ? a.seek(o) : a.seek(0),
|
||||||
c[t].status = !0, n.status = !0, n.pauseOther(t)) : (a.pause(), c[t].status = !1, n.status = !1), n.audios = c;
|
c[t].status = !0, n.status = !0, n.pauseOther(t)) : (a.pause(), c[t].status = !1, n.status = !1), n.audios = c;
|
||||||
console.log(n.audios)
|
|
||||||
},
|
},
|
||||||
pauseOther: function (e) {
|
pauseOther: function (e) {
|
||||||
var t = this;
|
var t = this;
|
||||||
@@ -190,18 +187,14 @@ export default {
|
|||||||
var u = s + ":" + o, c = that.audios;
|
var u = s + ":" + o, c = that.audios;
|
||||||
c[t].audiowidth = i, c[t].Time = e, c[t].audiotime = u, c[t].seconds = r
|
c[t].audiowidth = i, c[t].Time = e, c[t].audiotime = u, c[t].seconds = r
|
||||||
that.audios = c
|
that.audios = c
|
||||||
// console.log(c)
|
|
||||||
console.log(that.audios[that.value.id].audiotime)
|
|
||||||
that.audiotime = that.audios[that.value.id].audiotime
|
that.audiotime = that.audios[that.value.id].audiotime
|
||||||
that.audiowidth = that.audios[that.value.id].audiowidth
|
that.audiowidth = that.audios[that.value.id].audiowidth
|
||||||
console.log(i)
|
|
||||||
that.lyg = i
|
that.lyg = i
|
||||||
}, 1e3);
|
}, 1e3);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
this.audioContext.onEnded(() => {
|
this.audioContext.onEnded(() => {
|
||||||
console.log('播放结束');
|
|
||||||
this.status = 0
|
this.status = 0
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -256,7 +256,6 @@ export default {
|
|||||||
try {
|
try {
|
||||||
// 发送视频被点击播放事件
|
// 发送视频被点击播放事件
|
||||||
this.$emit('channel-video-click-play', item);
|
this.$emit('channel-video-click-play', item);
|
||||||
console.log('播放视频:', item);
|
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// 在微信小程序环境中调用视频播放接口
|
// 在微信小程序环境中调用视频播放接口
|
||||||
@@ -289,7 +288,6 @@ export default {
|
|||||||
*/
|
*/
|
||||||
imgError(index) {
|
imgError(index) {
|
||||||
// 图片加载失败的处理逻辑
|
// 图片加载失败的处理逻辑
|
||||||
console.log('图片加载失败:', index);
|
|
||||||
// 为失败的图片设置默认图片
|
// 为失败的图片设置默认图片
|
||||||
const item = this.value.list[index];
|
const item = this.value.list[index];
|
||||||
if (item) {
|
if (item) {
|
||||||
@@ -306,7 +304,6 @@ export default {
|
|||||||
addMouseDragScroll() {
|
addMouseDragScroll() {
|
||||||
// 只在Web环境中添加
|
// 只在Web环境中添加
|
||||||
// #ifndef MP
|
// #ifndef MP
|
||||||
console.log('addMouseDragScroll called');
|
|
||||||
|
|
||||||
let isDragging = false;
|
let isDragging = false;
|
||||||
let startX = 0;
|
let startX = 0;
|
||||||
@@ -329,11 +326,9 @@ export default {
|
|||||||
const handleMouseDown = (e) => {
|
const handleMouseDown = (e) => {
|
||||||
// 检查是否点击在组件内
|
// 检查是否点击在组件内
|
||||||
if (this.$el.contains(e.target)) {
|
if (this.$el.contains(e.target)) {
|
||||||
console.log('mousedown event in component:', e);
|
|
||||||
// 查找可滚动元素
|
// 查找可滚动元素
|
||||||
currentScrollElement = findScrollableParent(e.target);
|
currentScrollElement = findScrollableParent(e.target);
|
||||||
if (currentScrollElement) {
|
if (currentScrollElement) {
|
||||||
console.log('Found scrollable element:', currentScrollElement);
|
|
||||||
isDragging = true;
|
isDragging = true;
|
||||||
startX = e.pageX;
|
startX = e.pageX;
|
||||||
startScrollLeft = currentScrollElement.scrollLeft;
|
startScrollLeft = currentScrollElement.scrollLeft;
|
||||||
@@ -345,17 +340,14 @@ export default {
|
|||||||
// 鼠标移动事件
|
// 鼠标移动事件
|
||||||
const handleMouseMove = (e) => {
|
const handleMouseMove = (e) => {
|
||||||
if (!isDragging || !currentScrollElement) return;
|
if (!isDragging || !currentScrollElement) return;
|
||||||
console.log('mousemove event:', e);
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const dx = e.pageX - startX;
|
const dx = e.pageX - startX;
|
||||||
currentScrollElement.scrollLeft = startScrollLeft - dx;
|
currentScrollElement.scrollLeft = startScrollLeft - dx;
|
||||||
console.log('scrollLeft:', currentScrollElement.scrollLeft);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 鼠标释放事件
|
// 鼠标释放事件
|
||||||
const handleMouseUp = () => {
|
const handleMouseUp = () => {
|
||||||
if (isDragging && currentScrollElement) {
|
if (isDragging && currentScrollElement) {
|
||||||
console.log('mouseup event');
|
|
||||||
currentScrollElement.style.cursor = 'grab';
|
currentScrollElement.style.cursor = 'grab';
|
||||||
}
|
}
|
||||||
isDragging = false;
|
isDragging = false;
|
||||||
@@ -368,21 +360,17 @@ export default {
|
|||||||
document.addEventListener('mouseup', handleMouseUp);
|
document.addEventListener('mouseup', handleMouseUp);
|
||||||
document.addEventListener('mouseleave', handleMouseUp);
|
document.addEventListener('mouseleave', handleMouseUp);
|
||||||
|
|
||||||
console.log('Global mouse event listeners added');
|
|
||||||
|
|
||||||
// 组件销毁时移除事件监听器
|
// 组件销毁时移除事件监听器
|
||||||
this.$once('hook:beforeDestroy', () => {
|
this.$once('hook:beforeDestroy', () => {
|
||||||
document.removeEventListener('mousedown', handleMouseDown);
|
document.removeEventListener('mousedown', handleMouseDown);
|
||||||
document.removeEventListener('mousemove', handleMouseMove);
|
document.removeEventListener('mousemove', handleMouseMove);
|
||||||
document.removeEventListener('mouseup', handleMouseUp);
|
document.removeEventListener('mouseup', handleMouseUp);
|
||||||
document.removeEventListener('mouseleave', handleMouseUp);
|
document.removeEventListener('mouseleave', handleMouseUp);
|
||||||
console.log('Global mouse event listeners removed');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 为所有.channel-nav元素添加必要的样式
|
// 为所有.channel-nav元素添加必要的样式
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const channelNavs = document.querySelectorAll('.channel-nav');
|
const channelNavs = document.querySelectorAll('.channel-nav');
|
||||||
console.log('Found channel-nav elements:', channelNavs.length);
|
|
||||||
channelNavs.forEach(element => {
|
channelNavs.forEach(element => {
|
||||||
element.style.overflowX = 'auto';
|
element.style.overflowX = 'auto';
|
||||||
element.style.overflowY = 'hidden';
|
element.style.overflowY = 'hidden';
|
||||||
@@ -391,11 +379,9 @@ export default {
|
|||||||
element.style.maxWidth = '100%';
|
element.style.maxWidth = '100%';
|
||||||
element.style.cursor = 'grab';
|
element.style.cursor = 'grab';
|
||||||
element.style.userSelect = 'none'; // 防止文本选择
|
element.style.userSelect = 'none'; // 防止文本选择
|
||||||
console.log('Added styles to channel-nav:', element);
|
|
||||||
});
|
});
|
||||||
}, 100); // 延迟执行,确保DOM已完全渲染
|
}, 100); // 延迟执行,确保DOM已完全渲染
|
||||||
|
|
||||||
console.log('Mouse drag scroll setup completed');
|
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,7 +139,6 @@ export default {
|
|||||||
const enableEmbedMode = Boolean(this.value?.embedMode)
|
const enableEmbedMode = Boolean(this.value?.embedMode)
|
||||||
&& Boolean(this.value?.feedToken)
|
&& Boolean(this.value?.feedToken)
|
||||||
&& wechatChannelUtil.isEmbedModeSupported();
|
&& wechatChannelUtil.isEmbedModeSupported();
|
||||||
console.log('enableEmbedMode', enableEmbedMode);
|
|
||||||
return enableEmbedMode;
|
return enableEmbedMode;
|
||||||
// #endif
|
// #endif
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ export default {
|
|||||||
// 页面跳转
|
// 页面跳转
|
||||||
redirectTo(item) {
|
redirectTo(item) {
|
||||||
if (!item.wap_url || this.$util.getCurrRoute() != this.$util.MEMBER_PAGE_URL || this.storeToken) {
|
if (!item.wap_url || this.$util.getCurrRoute() != this.$util.MEMBER_PAGE_URL || this.storeToken) {
|
||||||
console.log(item);
|
|
||||||
this.$util.diyRedirectTo(item);
|
this.$util.diyRedirectTo(item);
|
||||||
} else {
|
} else {
|
||||||
this.$refs.login.open(item.wap_url);
|
this.$refs.login.open(item.wap_url);
|
||||||
|
|||||||
@@ -164,7 +164,6 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(link)
|
|
||||||
this.$util.diyRedirectTo(link);
|
this.$util.diyRedirectTo(link);
|
||||||
},
|
},
|
||||||
swiperChange(e) {
|
swiperChange(e) {
|
||||||
|
|||||||
@@ -358,11 +358,6 @@ export default {
|
|||||||
});
|
});
|
||||||
} else data = this.setPagestyle;
|
} else data = this.setPagestyle;
|
||||||
|
|
||||||
console.log(`diy-group ['diyDataArray'] = `, {
|
|
||||||
data: data,
|
|
||||||
diyData: this.diyData,
|
|
||||||
diyGlobalData: this.diyGlobalData,
|
|
||||||
})
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.log('get live status', err);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 往后间隔1分钟或更慢的频率去轮询获取直播状态
|
// 往后间隔1分钟或更慢的频率去轮询获取直播状态
|
||||||
@@ -127,8 +126,7 @@ export default {
|
|||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.log('get live status', err);
|
|
||||||
});
|
});
|
||||||
}, 60000);
|
}, 60000);
|
||||||
// #endif
|
// #endif
|
||||||
|
|||||||
@@ -119,7 +119,6 @@ export default {
|
|||||||
obj += 'border-bottom-left-radius:' + this.value.bottomAroundRadius * 2 + 'rpx;';
|
obj += 'border-bottom-left-radius:' + this.value.bottomAroundRadius * 2 + 'rpx;';
|
||||||
obj += 'border-bottom-right-radius:' + this.value.bottomAroundRadius * 2 + 'rpx;';
|
obj += 'border-bottom-right-radius:' + this.value.bottomAroundRadius * 2 + 'rpx;';
|
||||||
}
|
}
|
||||||
console.log(obj)
|
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
// 子项样式
|
// 子项样式
|
||||||
@@ -140,14 +139,12 @@ export default {
|
|||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getList() {
|
getList() {
|
||||||
console.log(121)
|
|
||||||
var data = {
|
var data = {
|
||||||
num: this.value.count
|
num: this.value.count
|
||||||
};
|
};
|
||||||
console.log(this.value)
|
|
||||||
if (this.value.sources == 'diy') {
|
if (this.value.sources == 'diy') {
|
||||||
data.num = 0;
|
data.num = 0;
|
||||||
data.merch_id_arr = this.value.merchIds.toString();
|
data.merch_id_arr = this.value.merchIds.toString();
|
||||||
|
|||||||
@@ -75,8 +75,6 @@ export default {
|
|||||||
// 允许从相机和相册扫码,h5端不起作用
|
// 允许从相机和相册扫码,h5端不起作用
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log('条码类型:' + res.scanType);
|
|
||||||
console.log('条码内容:' + res.result);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|||||||
@@ -221,10 +221,7 @@ export default {
|
|||||||
|
|
||||||
// 组件创建钩子
|
// 组件创建钩子
|
||||||
created() {
|
created() {
|
||||||
console.log(`diy-tab-create`, {
|
|
||||||
value: this.mergedValue,
|
|
||||||
tabs: this.mergedValue.tabs
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 组件挂载钩子
|
// 组件挂载钩子
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ export default {
|
|||||||
style += 'box-shadow:' + (this.value.ornament.type == 'shadow' ? '0 0 10rpx ' + this.value.ornament.color : '') + ';';
|
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 : '') + ';';
|
style += 'border:' + (this.value.ornament.type == 'stroke' ? '2rpx solid ' + this.value.ornament.color : '') + ';';
|
||||||
|
|
||||||
console.log(this.value);
|
|
||||||
|
|
||||||
return style;
|
return style;
|
||||||
},
|
},
|
||||||
@@ -174,7 +173,6 @@ export default {
|
|||||||
// 图片加载错误处理
|
// 图片加载错误处理
|
||||||
imgError(index) {
|
imgError(index) {
|
||||||
// 图片加载失败的处理逻辑
|
// 图片加载失败的处理逻辑
|
||||||
console.log('图片加载失败:', index);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 弹窗视频加载完成事件
|
// 弹窗视频加载完成事件
|
||||||
@@ -202,7 +200,6 @@ export default {
|
|||||||
|
|
||||||
if (width && height) {
|
if (width && height) {
|
||||||
this.popupVideoRatio = width >= height ? 'landscape' : 'portrait';
|
this.popupVideoRatio = width >= height ? 'landscape' : 'portrait';
|
||||||
console.log(`弹窗视频宽高比检测: ${width}x${height}, 比例: ${this.popupVideoRatio}`);
|
|
||||||
} else {
|
} else {
|
||||||
// 获取失败,默认竖屏
|
// 获取失败,默认竖屏
|
||||||
this.popupVideoRatio = 'portrait';
|
this.popupVideoRatio = 'portrait';
|
||||||
|
|||||||
@@ -127,8 +127,6 @@ export default {
|
|||||||
const videoUrl = this.videoUrl;
|
const videoUrl = this.videoUrl;
|
||||||
if (!videoUrl) return;
|
if (!videoUrl) return;
|
||||||
|
|
||||||
console.log('H5端预加载视频获取比例:', videoUrl);
|
|
||||||
|
|
||||||
const video = document.createElement('video');
|
const video = document.createElement('video');
|
||||||
video.preload = 'metadata';
|
video.preload = 'metadata';
|
||||||
video.src = videoUrl;
|
video.src = videoUrl;
|
||||||
@@ -138,11 +136,9 @@ export default {
|
|||||||
video.addEventListener('loadedmetadata', () => {
|
video.addEventListener('loadedmetadata', () => {
|
||||||
const width = video.videoWidth;
|
const width = video.videoWidth;
|
||||||
const height = video.videoHeight;
|
const height = video.videoHeight;
|
||||||
console.log('H5端预加载获取视频宽高:', width, height);
|
|
||||||
|
|
||||||
if (width && height) {
|
if (width && height) {
|
||||||
this.videoRatio = width >= height ? 'landscape' : 'portrait';
|
this.videoRatio = width >= height ? 'landscape' : 'portrait';
|
||||||
console.log('H5端视频比例判定:', this.videoRatio, width >= height ? '横屏' : '竖屏');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -156,8 +152,6 @@ export default {
|
|||||||
|
|
||||||
// 视频加载完成事件(组件内video标签)
|
// 视频加载完成事件(组件内video标签)
|
||||||
onVideoLoaded(event) {
|
onVideoLoaded(event) {
|
||||||
console.log('视频组件 loadedmetadata 事件触发');
|
|
||||||
|
|
||||||
let width = 0;
|
let width = 0;
|
||||||
let height = 0;
|
let height = 0;
|
||||||
|
|
||||||
@@ -165,7 +159,6 @@ export default {
|
|||||||
if (event && event.target) {
|
if (event && event.target) {
|
||||||
width = event.target.videoWidth || 0;
|
width = event.target.videoWidth || 0;
|
||||||
height = event.target.videoHeight || 0;
|
height = event.target.videoHeight || 0;
|
||||||
console.log('H5端组件视频宽高:', width, height);
|
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
@@ -173,24 +166,20 @@ export default {
|
|||||||
if (event && event.detail) {
|
if (event && event.detail) {
|
||||||
width = event.detail.width || 0;
|
width = event.detail.width || 0;
|
||||||
height = event.detail.height || 0;
|
height = event.detail.height || 0;
|
||||||
console.log('微信小程序端视频宽高:', width, height);
|
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
if (width && height) {
|
if (width && height) {
|
||||||
this.videoRatio = width >= height ? 'landscape' : 'portrait';
|
this.videoRatio = width >= height ? 'landscape' : 'portrait';
|
||||||
console.log('视频比例最终判定:', this.videoRatio);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 视频播放事件
|
// 视频播放事件
|
||||||
onVideoPlay() {
|
onVideoPlay() {
|
||||||
console.log('视频开始播放');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 视频暂停事件
|
// 视频暂停事件
|
||||||
onVideoPause() {
|
onVideoPause() {
|
||||||
console.log('视频暂停');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 视频错误事件
|
// 视频错误事件
|
||||||
|
|||||||
@@ -149,9 +149,8 @@ export const wechatChannelUtil = {
|
|||||||
wx.openChannelsActivity({
|
wx.openChannelsActivity({
|
||||||
feedId: item.feedId,
|
feedId: item.feedId,
|
||||||
finderUserName: item.finderUserName,
|
finderUserName: item.finderUserName,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log('打开视频号成功', res);
|
resolve(res);
|
||||||
resolve(res);
|
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
this.handleError(err, item);
|
this.handleError(err, item);
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 异步触发事件
|
// 异步触发事件
|
||||||
async __$emitEvent(payload = {eventName: '__unnamedEvent', data: {}, promiseCallback: null}) {
|
async __$emitEvent(payload = {eventName: '__unnamedEvent', data: {}, promiseCallback: null}) {
|
||||||
// console.log('__$emitEvent', payload)
|
|
||||||
await this.$eventBus.emit(payload.eventName, payload.data, payload.promiseCallback)
|
await this.$eventBus.emit(payload.eventName, payload.data, payload.promiseCallback)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -186,7 +186,6 @@ export default {
|
|||||||
uni.getStorage({
|
uni.getStorage({
|
||||||
key: 'shopInfo',
|
key: 'shopInfo',
|
||||||
success: (e) => {
|
success: (e) => {
|
||||||
console.log('【调试】当前 shopInfo:', e.data);
|
|
||||||
this.shopInfo = e.data;
|
this.shopInfo = e.data;
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
|
|||||||
@@ -53,40 +53,29 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 检查配置,决定是否显示隐私协议
|
this.listenPrivacySettingChange()
|
||||||
const shopInfo = uni.getStorageSync('shopInfo');
|
this.curPageShow()
|
||||||
if (shopInfo?.ischina == 1 && shopInfo?.index_login_auth == 1) {
|
this.proactive()
|
||||||
this.listenPrivacySettingChange()
|
|
||||||
this.curPageShow()
|
|
||||||
} else {
|
|
||||||
// 如果不需要显示隐私协议,直接触发同意事件
|
|
||||||
this.$emit('agree');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
try {
|
try {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
//查询微信侧记录的用户是否有待同意的隐私政策信息
|
|
||||||
wx.getPrivacySetting({
|
wx.getPrivacySetting({
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
// console.log('隐私政策信息', res);
|
|
||||||
// console.log(res.privacyContractName);
|
|
||||||
this.privacyContractName = res.privacyContractName
|
this.privacyContractName = res.privacyContractName
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef QUICKAPP-WEBVIEW || H5
|
// #ifdef QUICKAPP-WEBVIEW || H5
|
||||||
if (this.$util.isQuickApp()) {
|
if (this.$util.isQuickApp() && typeof has != 'undefined' && has?.getPrivacySetting) {
|
||||||
if (typeof has != 'undefined' && has?.getPrivacySetting) {
|
has.getPrivacySetting({
|
||||||
has.getPrivacySetting({
|
success: (res) => {
|
||||||
success: (res) => {
|
if (res.privacyContractName) {
|
||||||
if (res.privacyContractName) {
|
this.privacyContractName = res.privacyContractName
|
||||||
this.privacyContractName = res.privacyContractName
|
}
|
||||||
}
|
},
|
||||||
},
|
})
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -94,39 +83,50 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 统一弹窗 + 关闭其他页面的弹窗
|
||||||
|
*/
|
||||||
|
showPrivacyPopup() {
|
||||||
|
this.popUp()
|
||||||
|
this.closeOtherPagePopUp(this.disPopUp)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据是否需要授权决定弹窗或 emit agree
|
||||||
|
*/
|
||||||
|
checkAndShow(needAuthorization) {
|
||||||
|
if (needAuthorization) {
|
||||||
|
const privacyAgreed = uni.getStorageSync('privacyAgreed');
|
||||||
|
if (privacyAgreed) {
|
||||||
|
this.$emit('agree')
|
||||||
|
} else {
|
||||||
|
this.showPrivacyPopup()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$emit('agree')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
getPrivacySettingByQuickApp() {
|
getPrivacySettingByQuickApp() {
|
||||||
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||||
if (this.$util.isQuickApp()) {
|
if (!this.$util.isQuickApp()) return;
|
||||||
if (typeof has != 'undefined' && has?.getPrivacySetting) {
|
if (typeof has != 'undefined' && has?.getPrivacySetting) {
|
||||||
has.getPrivacySetting({
|
has.getPrivacySetting({
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
// console.log(res)
|
this.checkAndShow(res.needAuthorization)
|
||||||
if (res.needAuthorization) {
|
},
|
||||||
this.popUp()
|
})
|
||||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
} else {
|
||||||
this.closeOtherPagePopUp(this.disPopUp)
|
this.checkAndShow(!uni.getStorageSync('privacyAgreed'))
|
||||||
} else {
|
|
||||||
this.$emit('agree')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
// 属于嵌入到快应用Webview组件中的情况,按照H5的方式来处理,判断是否已经授权
|
|
||||||
if (uni.getStorageSync('privacyAgreed')) {
|
|
||||||
this.$emit('agree')
|
|
||||||
} else {
|
|
||||||
this.popUp()
|
|
||||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
|
||||||
this.closeOtherPagePopUp(this.disPopUp)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监听平台侧的隐私授权事件
|
||||||
|
*/
|
||||||
listenPrivacySettingChange() {
|
listenPrivacySettingChange() {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// 监听微信侧隐私政策授权变化事件
|
|
||||||
if (wx.onNeedPrivacyAuthorization) {
|
if (wx.onNeedPrivacyAuthorization) {
|
||||||
wx.onNeedPrivacyAuthorization((resolve) => {
|
wx.onNeedPrivacyAuthorization((resolve) => {
|
||||||
if (typeof this.privacyAuthorization === 'function') {
|
if (typeof this.privacyAuthorization === 'function') {
|
||||||
@@ -137,66 +137,28 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||||
if (this.$util.isQuickApp()) {
|
if (this.$util.isQuickApp() && typeof has != 'undefined' && has?.onPrivacySettingChange) {
|
||||||
// 监听快速应用侧隐私政策授权变化事件
|
has.onPrivacySettingChange((res) => {
|
||||||
if (typeof has != 'undefined' && has?.onPrivacySettingChange) {
|
this.checkAndShow(res.needAuthorization)
|
||||||
has.onPrivacySettingChange((res) => {
|
})
|
||||||
// console.log(res)
|
|
||||||
if (res.needAuthorization) {
|
|
||||||
this.popUp()
|
|
||||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
|
||||||
this.closeOtherPagePopUp(this.disPopUp)
|
|
||||||
} else {
|
|
||||||
this.$emit('agree')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// 主动查询用户隐私政策授权状态,针对快速应用
|
|
||||||
this.getPrivacySettingByQuickApp();
|
|
||||||
},
|
},
|
||||||
// 主动查询用户隐私政策授权状态
|
|
||||||
proactive() {
|
|
||||||
// 检查配置,决定是否显示隐私协议
|
|
||||||
const shopInfo = uni.getStorageSync('shopInfo');
|
|
||||||
if (!(shopInfo?.ischina == 1 && shopInfo?.index_login_auth == 1)) {
|
|
||||||
// 如果不需要显示隐私协议,直接触发同意事件
|
|
||||||
this.$emit('agree');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主动查询隐私授权状态并弹窗
|
||||||
|
*/
|
||||||
|
proactive() {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
if (wx.getPrivacySetting) {
|
if (wx.getPrivacySetting) {
|
||||||
wx.getPrivacySetting({
|
wx.getPrivacySetting({
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
// console.log(res)
|
this.checkAndShow(res.needAuthorization)
|
||||||
if (res.needAuthorization) {
|
|
||||||
// 检查本地存储中是否已经同意过隐私政策
|
|
||||||
const privacyAgreed = uni.getStorageSync('privacyAgreed');
|
|
||||||
if (!privacyAgreed) {
|
|
||||||
this.popUp()
|
|
||||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
|
||||||
this.closeOtherPagePopUp(this.disPopUp)
|
|
||||||
} else {
|
|
||||||
this.$emit('agree')
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$emit('agree')
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 检查本地存储中是否已经同意过隐私政策
|
// 低版本基础库直接检查本地存储
|
||||||
const privacyAgreed = uni.getStorageSync('privacyAgreed');
|
this.checkAndShow(!uni.getStorageSync('privacyAgreed'))
|
||||||
if (privacyAgreed) {
|
|
||||||
this.$emit('agree');
|
|
||||||
} else {
|
|
||||||
this.popUp()
|
|
||||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
|
||||||
this.closeOtherPagePopUp(this.disPopUp)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
@@ -205,29 +167,24 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef H5 || WEB
|
// #ifdef H5 || WEB
|
||||||
// 检查本地存储中是否已经同意过隐私政策
|
this.checkAndShow(!uni.getStorageSync('privacyAgreed'))
|
||||||
const privacyAgreed = uni.getStorageSync('privacyAgreed');
|
|
||||||
if (privacyAgreed) {
|
|
||||||
this.$emit('agree');
|
|
||||||
} else {
|
|
||||||
this.popUp()
|
|
||||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
|
||||||
this.closeOtherPagePopUp(this.disPopUp)
|
|
||||||
}
|
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
//初始化监听程序
|
|
||||||
|
/**
|
||||||
|
* 初始化监听程序(页面级)
|
||||||
|
*/
|
||||||
curPageShow() {
|
curPageShow() {
|
||||||
closeOtherPagePopUpHooks.add(this.disPopUp)
|
closeOtherPagePopUpHooks.add(this.disPopUp)
|
||||||
this.privacyAuthorization = resolve => {
|
this.privacyAuthorization = resolve => {
|
||||||
this.privacyResolves.add(resolve)
|
this.privacyResolves.add(resolve)
|
||||||
//打开弹窗
|
this.showPrivacyPopup()
|
||||||
this.popUp()
|
|
||||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
|
||||||
this.closeOtherPagePopUp(this.disPopUp)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
|
||||||
|
/**
|
||||||
|
* 弹窗时关掉其他页面的隐私弹窗,避免重叠
|
||||||
|
*/
|
||||||
closeOtherPagePopUp(closePopUp) {
|
closeOtherPagePopUp(closePopUp) {
|
||||||
closeOtherPagePopUpHooks.forEach(hook => {
|
closeOtherPagePopUpHooks.forEach(hook => {
|
||||||
if (closePopUp !== hook) {
|
if (closePopUp !== hook) {
|
||||||
@@ -235,16 +192,12 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//打开隐私协议
|
|
||||||
openPrivacyContract() {
|
openPrivacyContract() {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
wx.openPrivacyContract({
|
wx.openPrivacyContract({
|
||||||
success(res) {
|
success(res) {},
|
||||||
// console.log('打开隐私协议', res);
|
fail(err) {}
|
||||||
},
|
|
||||||
fail(err) {
|
|
||||||
// console.error('打开隐私协议失败', err)
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
@@ -252,59 +205,44 @@ export default {
|
|||||||
if (this.$util.isQuickApp()) {
|
if (this.$util.isQuickApp()) {
|
||||||
if (typeof has != 'undefined' && has?.openPrivacySetting) {
|
if (typeof has != 'undefined' && has?.openPrivacySetting) {
|
||||||
has.openPrivacySetting({
|
has.openPrivacySetting({
|
||||||
success: (res) => {
|
success: (res) => {},
|
||||||
// console.log('打开隐私协议', res);
|
fail: (err) => {}
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
// console.error('打开隐私协议失败', err)
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 属于嵌入到快应用Webview组件中的情况,按照H5的方式来处理
|
|
||||||
this.$util.redirectTo(privacyContractPage);
|
this.$util.redirectTo(privacyContractPage);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// H5 环境下的处理逻辑
|
|
||||||
this.$util.redirectTo(privacyContractPage);
|
this.$util.redirectTo(privacyContractPage);
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
//打开用户服务协议
|
|
||||||
openPrivacyService() {
|
openPrivacyService() {
|
||||||
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB
|
||||||
if (this.$util.isQuickApp()) {
|
if (this.$util.isQuickApp()) {
|
||||||
if (typeof has != 'undefined' && has?.openPrivacySetting) {
|
if (typeof has != 'undefined' && has?.openPrivacySetting) {
|
||||||
has.openPrivacySetting({
|
has.openPrivacySetting({
|
||||||
success: (res) => {
|
success: (res) => {},
|
||||||
// console.log('打开用户服务协议', res);
|
fail: (err) => {}
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
// console.error('打开用户服务协议失败', err)
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 属于嵌入到快应用Webview组件中的情况,按照H5的方式来处理
|
|
||||||
this.$util.redirectTo(privacyServicePage);
|
this.$util.redirectTo(privacyServicePage);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// H5 环境下的处理逻辑
|
|
||||||
this.$util.redirectTo(privacyServicePage);
|
this.$util.redirectTo(privacyServicePage);
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
// 不同意
|
|
||||||
handleDisagree() {
|
handleDisagree() {
|
||||||
this.privacyResolves.forEach(resolve => {
|
this.privacyResolves.forEach(resolve => {
|
||||||
resolve({
|
resolve({ event: 'disagree' })
|
||||||
event: 'disagree',
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
this.privacyResolves.clear()
|
this.privacyResolves.clear()
|
||||||
//关闭弹窗
|
|
||||||
this.disPopUp()
|
this.disPopUp()
|
||||||
// 保存用户授权状态到本地存储,无论同意还是不同意,都不再重复弹出
|
|
||||||
uni.setStorageSync('privacyAgreed', true);
|
uni.setStorageSync('privacyAgreed', true);
|
||||||
//退出小程序
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
content: '未同意隐私协议,无法使用相关功能',
|
content: '未同意隐私协议,无法使用相关功能',
|
||||||
success: () => {
|
success: () => {
|
||||||
@@ -312,7 +250,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 同意并继续
|
|
||||||
handleAgree() {
|
handleAgree() {
|
||||||
this.privacyResolves.forEach(resolve => {
|
this.privacyResolves.forEach(resolve => {
|
||||||
resolve({
|
resolve({
|
||||||
@@ -321,28 +259,23 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.privacyResolves.clear()
|
this.privacyResolves.clear()
|
||||||
//关闭弹窗
|
|
||||||
this.disPopUp()
|
this.disPopUp()
|
||||||
|
|
||||||
// 保存用户授权状态到本地存储,用于所有环境
|
uni.setStorageSync('privacyAgreed', true);
|
||||||
uni.setStorageSync('privacyAgreed', true);
|
|
||||||
this.$emit('agree')
|
this.$emit('agree')
|
||||||
},
|
},
|
||||||
//打开弹窗
|
|
||||||
popUp() {
|
popUp() {
|
||||||
this.showPop = true;
|
this.showPop = true;
|
||||||
},
|
},
|
||||||
//关闭弹窗
|
|
||||||
disPopUp() {
|
disPopUp() {
|
||||||
this.showPop = false;
|
this.showPop = false;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
// 清理事件监听器和集合
|
|
||||||
this.privacyResolves.clear()
|
this.privacyResolves.clear()
|
||||||
closeOtherPagePopUpHooks.delete(this.disPopUp)
|
closeOtherPagePopUpHooks.delete(this.disPopUp)
|
||||||
// 注意:这里需要根据实际情况清理微信和快速应用的事件监听器
|
|
||||||
// 由于微信的 wx.onNeedPrivacyAuthorization 没有对应的 off 方法,这里可能需要其他方式处理
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
endVal() {
|
endVal() {
|
||||||
console.log(123)
|
|
||||||
if (this.autoplay) {
|
if (this.autoplay) {
|
||||||
this.start()
|
this.start()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,7 +164,6 @@
|
|||||||
appId: 'wxeb490c6f9b154ef9', // 企业微信小程序AppID
|
appId: 'wxeb490c6f9b154ef9', // 企业微信小程序AppID
|
||||||
path: `pages/contacts/externalContactDetail?url=${encodeURIComponent(contactUrl)}`,
|
path: `pages/contacts/externalContactDetail?url=${encodeURIComponent(contactUrl)}`,
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log('跳转企业微信成功');
|
|
||||||
this.$util.showToast({
|
this.$util.showToast({
|
||||||
title: '跳转成功',
|
title: '跳转成功',
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
@@ -189,7 +188,6 @@
|
|||||||
this.wxWorkSDK.addContact({
|
this.wxWorkSDK.addContact({
|
||||||
userId: contactId
|
userId: contactId
|
||||||
}, (res) => {
|
}, (res) => {
|
||||||
console.log('打开用户资料成功:', res);
|
|
||||||
}, (err) => {
|
}, (err) => {
|
||||||
console.error('打开用户资料失败:', err);
|
console.error('打开用户资料失败:', err);
|
||||||
this.showError('打开用户资料失败');
|
this.showError('打开用户资料失败');
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
},
|
},
|
||||||
"router" : {
|
"router" : {
|
||||||
"mode" : "history",
|
"mode" : "history",
|
||||||
"base" : "/hwappx/test/"
|
"base" : "/hwappx/common/"
|
||||||
},
|
},
|
||||||
"title" : "",
|
"title" : "",
|
||||||
"devServer" : {
|
"devServer" : {
|
||||||
|
|||||||
@@ -87,8 +87,6 @@ export default {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开登录弹窗
|
|
||||||
// console.log('==> _handleDiyGroupInteractionEvent, 未登录,打开登录弹窗', { payload })
|
|
||||||
this.$refs.login?.open();
|
this.$refs.login?.open();
|
||||||
|
|
||||||
// 阻止事件继续传播
|
// 阻止事件继续传播
|
||||||
|
|||||||
@@ -413,10 +413,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log('success', res);
|
|
||||||
},
|
},
|
||||||
fail: function (res) {
|
fail: function (res) {
|
||||||
console.log('fail', res);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,8 +151,7 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
}, this.wait);
|
}, this.wait);
|
||||||
|
|
||||||
// console.log('this.top', this.top);
|
|
||||||
// console.log('this.radius', this.radius);
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.animationData = uni
|
this.animationData = uni
|
||||||
|
|||||||
@@ -566,7 +566,6 @@ export default {
|
|||||||
// 手指触摸事件 用于菜单左滑
|
// 手指触摸事件 用于菜单左滑
|
||||||
touchS(e) {
|
touchS(e) {
|
||||||
this.startX = e.touches[0].clientX;
|
this.startX = e.touches[0].clientX;
|
||||||
// console.log('开始' + e.touches[0].clientX);
|
|
||||||
},
|
},
|
||||||
touchE(e, cartIndex) {
|
touchE(e, cartIndex) {
|
||||||
this.endX = e.changedTouches[0].clientX;
|
this.endX = e.changedTouches[0].clientX;
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ export default {
|
|||||||
url: '/api/lucky/status',
|
url: '/api/lucky/status',
|
||||||
data: {},
|
data: {},
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log(res)
|
|
||||||
this.langstatus = res.status
|
this.langstatus = res.status
|
||||||
if(this.langstatus == 1){
|
if(this.langstatus == 1){
|
||||||
// this.$langConfig.refresh();
|
// this.$langConfig.refresh();
|
||||||
|
|||||||
@@ -762,13 +762,10 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
// this.orderCreateData.coupon[merch_id].coupon_id = data.coupon_id
|
// this.orderCreateData.coupon[merch_id].coupon_id = data.coupon_id
|
||||||
console.log(this.selectCouponId)
|
|
||||||
},
|
},
|
||||||
//确定使用优惠券
|
//确定使用优惠券
|
||||||
useCpopon() {
|
useCpopon() {
|
||||||
console.log(this.merchCoupon.merch_id)
|
|
||||||
this.orderCreateData.coupon[this.merchCoupon.merch_id].coupon_id = this.selectCouponId;
|
this.orderCreateData.coupon[this.merchCoupon.merch_id].coupon_id = this.selectCouponId;
|
||||||
console.log(this.orderCreateData.coupon)
|
|
||||||
this.$refs.couponPopup.close();
|
this.$refs.couponPopup.close();
|
||||||
this.calculate();
|
this.calculate();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -137,7 +137,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: function(res) {
|
fail: function(res) {
|
||||||
console.log('fail', res);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -359,9 +359,8 @@ export default {
|
|||||||
getFenxiaoDetail() {
|
getFenxiaoDetail() {
|
||||||
this.$api.sendRequest({
|
this.$api.sendRequest({
|
||||||
url: '/fenxiao/api/fenxiao/detail',
|
url: '/fenxiao/api/fenxiao/detail',
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log(res)
|
if (res.data) {
|
||||||
if (res.data) {
|
|
||||||
if (res.data.status == -1) {
|
if (res.data.status == -1) {
|
||||||
this.$util.showToast({
|
this.$util.showToast({
|
||||||
title: '当前分销商已冻结'
|
title: '当前分销商已冻结'
|
||||||
|
|||||||
@@ -136,12 +136,10 @@ export default {
|
|||||||
image_list: this.$util.img(this.goodsList[this.currIndex].goods_image)
|
image_list: this.$util.img(this.goodsList[this.currIndex].goods_image)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log('success', res);
|
},
|
||||||
},
|
fail: function (res) {
|
||||||
fail: function (res) {
|
}
|
||||||
console.log('fail', res);
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -312,9 +312,8 @@
|
|||||||
if (res.code == 0 && res.data.length) {
|
if (res.code == 0 && res.data.length) {
|
||||||
uni.requestSubscribeMessage({
|
uni.requestSubscribeMessage({
|
||||||
tmplIds: res.data,
|
tmplIds: res.data,
|
||||||
fail: res => {
|
fail: res => {
|
||||||
console.log('fail', res);
|
},
|
||||||
},
|
|
||||||
complete: () => {
|
complete: () => {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,6 @@
|
|||||||
this.categoryId = 'category-' + index;
|
this.categoryId = 'category-' + index;
|
||||||
// 阻止切换分类之后滚动事件也立即执行
|
// 阻止切换分类之后滚动事件也立即执行
|
||||||
this.scrollLock = true;
|
this.scrollLock = true;
|
||||||
console.log(index)
|
|
||||||
|
|
||||||
// this.goodsList = []
|
// this.goodsList = []
|
||||||
// this.getgoodslist()
|
// this.getgoodslist()
|
||||||
@@ -174,9 +173,8 @@
|
|||||||
data: {
|
data: {
|
||||||
is_type_show:1,
|
is_type_show:1,
|
||||||
},
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log( res.data)
|
this.categoryTree = res.data
|
||||||
this.categoryTree = res.data
|
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
this.$util.showToast({
|
this.$util.showToast({
|
||||||
|
|||||||
@@ -164,11 +164,8 @@ export default {
|
|||||||
id:this.goodsData.id
|
id:this.goodsData.id
|
||||||
},
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log(res)
|
|
||||||
if(res.result.detail){
|
if(res.result.detail){
|
||||||
this.goodsData = res.result.detail
|
this.goodsData = res.result.detail
|
||||||
console.log(this.goodsData.goods_image)
|
|
||||||
}else{
|
|
||||||
this.$util.showToast({
|
this.$util.showToast({
|
||||||
title: '商品不存在',
|
title: '商品不存在',
|
||||||
});
|
});
|
||||||
@@ -737,7 +734,6 @@ export default {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 清空规格的图片
|
// 清空规格的图片
|
||||||
console.log(this.goodsData)
|
|
||||||
return false
|
return false
|
||||||
for (var i = 0; i < this.goodsData.goods_sku_data.length; i++) {
|
for (var i = 0; i < this.goodsData.goods_sku_data.length; i++) {
|
||||||
if (this.goodsData.goods_sku_data[i].sku_images.length == 0) this.goodsData.goods_sku_data[i].sku_image = '';
|
if (this.goodsData.goods_sku_data[i].sku_images.length == 0) this.goodsData.goods_sku_data[i].sku_image = '';
|
||||||
@@ -796,9 +792,6 @@ export default {
|
|||||||
} else if (this.goodsData.verify_validity_type == 2) {
|
} else if (this.goodsData.verify_validity_type == 2) {
|
||||||
data.virtual_indate = this.virtualTime;
|
data.virtual_indate = this.virtualTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log(this.goodsData.goods_spec_format,'format')
|
|
||||||
// if(this.goodsData.goods_spec_format == '[]'){
|
|
||||||
// data.carmichael= data.carmichael
|
// data.carmichael= data.carmichael
|
||||||
// }
|
// }
|
||||||
var save = null;
|
var save = null;
|
||||||
|
|||||||
@@ -150,9 +150,8 @@ export default {
|
|||||||
data: {
|
data: {
|
||||||
merch_id:this.merch_id
|
merch_id:this.merch_id
|
||||||
},
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log(res)
|
this.merch = res.data
|
||||||
this.merch = res.data
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -54,9 +54,8 @@ export default {
|
|||||||
this.$api.sendRequest({
|
this.$api.sendRequest({
|
||||||
url: '/api/config/agreement',
|
url: '/api/config/agreement',
|
||||||
data: data,
|
data: data,
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log(res.data.title)
|
uni.setNavigationBarTitle({
|
||||||
uni.setNavigationBarTitle({
|
|
||||||
title: res.data.title
|
title: res.data.title
|
||||||
})
|
})
|
||||||
this.content = res.data.content
|
this.content = res.data.content
|
||||||
|
|||||||
@@ -671,15 +671,7 @@ async loadChatHistoryIfExist() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 需要根据实际返回的 response.data.messages 来映射
|
// 需要根据实际返回的 response.data.messages 来映射
|
||||||
console.log('【调试】后端返回的历史消息数据:', response.messages);
|
|
||||||
this.messages = response.messages.map(msg => {
|
this.messages = response.messages.map(msg => {
|
||||||
console.log('【调试】单条消息完整数据:', JSON.stringify(msg));
|
|
||||||
console.log('【调试】单条消息时间字段:');
|
|
||||||
console.log(' - created_at:', msg.created_at, typeof msg.created_at);
|
|
||||||
console.log(' - create_time:', msg.create_time, typeof msg.create_time);
|
|
||||||
console.log(' - time:', msg.time, typeof msg.time);
|
|
||||||
console.log(' - Date.now():', Date.now());
|
|
||||||
|
|
||||||
let content = '';
|
let content = '';
|
||||||
if (msg.role === 'user') {
|
if (msg.role === 'user') {
|
||||||
content = msg.query || (typeof msg.inputs === 'string' ? msg.inputs : JSON.stringify(msg.inputs || '')) || '';
|
content = msg.query || (typeof msg.inputs === 'string' ? msg.inputs : JSON.stringify(msg.inputs || '')) || '';
|
||||||
@@ -688,7 +680,6 @@ async loadChatHistoryIfExist() {
|
|||||||
}
|
}
|
||||||
// 只使用后端返回的真实时间,不使用假时间
|
// 只使用后端返回的真实时间,不使用假时间
|
||||||
const realTimestamp = msg.created_at || msg.create_time || msg.time;
|
const realTimestamp = msg.created_at || msg.create_time || msg.time;
|
||||||
console.log('【调试】最终使用的时间戳:', realTimestamp);
|
|
||||||
return {
|
return {
|
||||||
id: msg.message_id || (Date.now() + Math.random() * 10000),
|
id: msg.message_id || (Date.now() + Math.random() * 10000),
|
||||||
role: msg.role === 'user' ? 'user' : 'assistant',
|
role: msg.role === 'user' ? 'user' : 'assistant',
|
||||||
@@ -740,13 +731,11 @@ async loadChatHistoryIfExist() {
|
|||||||
|
|
||||||
// 从相册选择头像
|
// 从相册选择头像
|
||||||
chooseAvatarFromAlbum() {
|
chooseAvatarFromAlbum() {
|
||||||
console.log('选择从相册选择头像')
|
|
||||||
this.selectAvatar()
|
this.selectAvatar()
|
||||||
},
|
},
|
||||||
|
|
||||||
// 统一头像选择方法 - 仅从相册选择
|
// 统一头像选择方法 - 仅从相册选择
|
||||||
selectAvatar() {
|
selectAvatar() {
|
||||||
console.log('开始选择头像')
|
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
// H5环境下的处理 - 仅从相册选择
|
// H5环境下的处理 - 仅从相册选择
|
||||||
@@ -1259,11 +1248,9 @@ async loadChatHistoryIfExist() {
|
|||||||
offset: this.historyOffset // 改用独立偏移量
|
offset: this.historyOffset // 改用独立偏移量
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.success && Array.isArray(response.messages) && response.messages.length > 0) {
|
if (response.success && Array.isArray(response.messages) && response.messages.length > 0) {
|
||||||
console.log('【调试】加载更多历史消息数据:', response.messages);
|
const historyMessages = response.messages.map(msg => {
|
||||||
const historyMessages = response.messages.map(msg => {
|
// 只使用后端返回的真实时间,不使用假时间
|
||||||
console.log('【调试】加载更多单条消息数据:', msg);
|
|
||||||
// 只使用后端返回的真实时间,不使用假时间
|
|
||||||
const realTimestamp = msg.create_time || msg.created_at || msg.time;
|
const realTimestamp = msg.create_time || msg.created_at || msg.time;
|
||||||
return {
|
return {
|
||||||
id: msg.id || `history-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
id: msg.id || `history-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
||||||
@@ -1370,7 +1357,6 @@ async loadChatHistoryIfExist() {
|
|||||||
navigator.mediaDevices.getUserMedia({ audio: true })
|
navigator.mediaDevices.getUserMedia({ audio: true })
|
||||||
.then(stream => {
|
.then(stream => {
|
||||||
// 语音输入处理
|
// 语音输入处理
|
||||||
console.log('语音输入开始')
|
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error('语音输入错误:', error)
|
console.error('语音输入错误:', error)
|
||||||
@@ -1480,7 +1466,6 @@ async loadChatHistoryIfExist() {
|
|||||||
if (width && height) {
|
if (width && height) {
|
||||||
// 判断视频方向:宽度 >= 高度为横屏,否则为竖屏
|
// 判断视频方向:宽度 >= 高度为横屏,否则为竖屏
|
||||||
const videoRatio = width >= height ? 'landscape' : 'portrait';
|
const videoRatio = width >= height ? 'landscape' : 'portrait';
|
||||||
console.log(`AI聊天视频宽高比检测: ${width}x${height}, 比例: ${videoRatio}`);
|
|
||||||
|
|
||||||
// 动态设置视频样式
|
// 动态设置视频样式
|
||||||
// 这里可以添加逻辑来动态调整视频播放器的样式
|
// 这里可以添加逻辑来动态调整视频播放器的样式
|
||||||
|
|||||||
@@ -183,7 +183,6 @@ export default {
|
|||||||
onShow() {
|
onShow() {
|
||||||
// 监听键盘高度变化
|
// 监听键盘高度变化
|
||||||
uni.onKeyboardHeightChange((res) => {
|
uni.onKeyboardHeightChange((res) => {
|
||||||
console.log('键盘高度变化:', res.height);
|
|
||||||
this.keyboardHeight = res.height;
|
this.keyboardHeight = res.height;
|
||||||
if (this.$refs.chat && this.$refs.chat.updateKeyboardHeight) {
|
if (this.$refs.chat && this.$refs.chat.updateKeyboardHeight) {
|
||||||
this.$refs.chat.updateKeyboardHeight(res.height);
|
this.$refs.chat.updateKeyboardHeight(res.height);
|
||||||
@@ -233,7 +232,6 @@ export default {
|
|||||||
|
|
||||||
setupNavigationEvents() {
|
setupNavigationEvents() {
|
||||||
uni.onWindowResize((res) => {
|
uni.onWindowResize((res) => {
|
||||||
console.log('窗口大小变化:', res.size);
|
|
||||||
this.calculateScrollViewHeight();
|
this.calculateScrollViewHeight();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -241,8 +239,6 @@ export default {
|
|||||||
// ========== 事件处理方法 ==========
|
// ========== 事件处理方法 ==========
|
||||||
|
|
||||||
async handleServiceRequest(event) {
|
async handleServiceRequest(event) {
|
||||||
console.log('处理服务请求:', EventSafety.extractEventData(event));
|
|
||||||
|
|
||||||
if (event.matches('.service-component') ||
|
if (event.matches('.service-component') ||
|
||||||
event.detail?.componentType === 'service') {
|
event.detail?.componentType === 'service') {
|
||||||
await this.processServiceRequest(event);
|
await this.processServiceRequest(event);
|
||||||
@@ -250,12 +246,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async handleNavigationRequest(event) {
|
async handleNavigationRequest(event) {
|
||||||
console.log('处理导航请求:', event.type);
|
|
||||||
this.emitNavigationInfo(event);
|
this.emitNavigationInfo(event);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleComponentInteraction(event) {
|
handleComponentInteraction(event) {
|
||||||
console.log('处理组件交互:', event.detail);
|
|
||||||
this.processComponentInteraction(event);
|
this.processComponentInteraction(event);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -271,16 +265,11 @@ export default {
|
|||||||
|
|
||||||
// ========== 初始化页面 ==========
|
// ========== 初始化页面 ==========
|
||||||
initChat() {
|
initChat() {
|
||||||
console.log('AI聊天页面初始化');
|
|
||||||
|
|
||||||
// 检查是否有从商品分类传递过来的商品信息
|
// 检查是否有从商品分类传递过来的商品信息
|
||||||
const selectedProduct = uni.getStorageSync('selectedProduct')
|
const selectedProduct = uni.getStorageSync('selectedProduct')
|
||||||
if (selectedProduct) {
|
if (selectedProduct) {
|
||||||
console.log('检测到选择的商品:', selectedProduct)
|
|
||||||
|
|
||||||
// 清除存储的商品信息,避免重复发送
|
// 清除存储的商品信息,避免重复发送
|
||||||
uni.removeStorageSync('selectedProduct')
|
uni.removeStorageSync('selectedProduct')
|
||||||
|
|
||||||
// 延迟发送商品信息,确保聊天组件已经初始化
|
// 延迟发送商品信息,确保聊天组件已经初始化
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.sendProductToAI(selectedProduct)
|
this.sendProductToAI(selectedProduct)
|
||||||
@@ -329,7 +318,6 @@ export default {
|
|||||||
this. $off(eventType, handler);
|
this. $off(eventType, handler);
|
||||||
});
|
});
|
||||||
this.safeEventHandlers.clear();
|
this.safeEventHandlers.clear();
|
||||||
console.log('组件清理完成');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
showError(message) {
|
showError(message) {
|
||||||
@@ -443,11 +431,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onMessageSent(message) {
|
onMessageSent(message) {
|
||||||
console.log('用户发送消息:', message);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onAIResponse(message) {
|
onAIResponse(message) {
|
||||||
console.log('AI回复消息:', message);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
generateAIResponse(userMessage) {
|
generateAIResponse(userMessage) {
|
||||||
@@ -489,7 +475,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onHistoryLoaded(messages) {
|
onHistoryLoaded(messages) {
|
||||||
console.log('历史消息加载完成:', messages.length);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onFilePreview(message) {
|
onFilePreview(message) {
|
||||||
@@ -497,19 +482,15 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onAudioPlay(message) {
|
onAudioPlay(message) {
|
||||||
console.log('音频播放:', message);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onAudioPause(message) {
|
onAudioPause(message) {
|
||||||
console.log('音频暂停:', message);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onVideoPlay(message) {
|
onVideoPlay(message) {
|
||||||
console.log('视频播放:', message);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onVideoPause(message) {
|
onVideoPause(message) {
|
||||||
console.log('视频暂停:', message);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
sendProductToAI(product) {
|
sendProductToAI(product) {
|
||||||
@@ -520,8 +501,6 @@ export default {
|
|||||||
|
|
||||||
const productContent = `我想了解以下商品的详细信息:\n商品名称:${product.goods_name}\n价格:¥${product.price}\n商品ID:${product.goods_id}`
|
const productContent = `我想了解以下商品的详细信息:\n商品名称:${product.goods_name}\n价格:¥${product.price}\n商品ID:${product.goods_id}`
|
||||||
|
|
||||||
console.log('商品信息已发送到AI客服:', productContent)
|
|
||||||
|
|
||||||
// 使用sendMessageWithContent方法发送商品信息
|
// 使用sendMessageWithContent方法发送商品信息
|
||||||
this.$refs.chat.sendMessageWithContent(productContent)
|
this.$refs.chat.sendMessageWithContent(productContent)
|
||||||
},
|
},
|
||||||
@@ -548,7 +527,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onInputChange(value) {
|
onInputChange(value) {
|
||||||
console.log('输入内容:', value);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// ✅ 新增:权限校验(核心修复)
|
// ✅ 新增:权限校验(核心修复)
|
||||||
|
|||||||
@@ -130,12 +130,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log(err);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
toDetail(item) {
|
toDetail(item) {
|
||||||
console.log(item.files_url);
|
|
||||||
const url = item.files_url;
|
const url = item.files_url;
|
||||||
uni.showLoading({ title: "正在加载" });
|
uni.showLoading({ title: "正在加载" });
|
||||||
try {
|
try {
|
||||||
@@ -147,7 +145,6 @@ export default {
|
|||||||
uni.openDocument({
|
uni.openDocument({
|
||||||
filePath: filePath,
|
filePath: filePath,
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log("打开成功");
|
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
},
|
},
|
||||||
@@ -161,14 +158,12 @@ export default {
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
},
|
},
|
||||||
complete: (res) => {
|
complete: (res) => {
|
||||||
console.log("下载完成", res);
|
|
||||||
if (res.statusCode === 404) {
|
if (res.statusCode === 404) {
|
||||||
uni.showToast({ title: "文件不存在", icon: "none" });
|
uni.showToast({ title: "文件不存在", icon: "none" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("CatchClause", e);
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -196,7 +191,6 @@ export default {
|
|||||||
uni.openDocument({
|
uni.openDocument({
|
||||||
filePath: filePath,
|
filePath: filePath,
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log("打开成功");
|
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
},
|
},
|
||||||
@@ -210,14 +204,12 @@ export default {
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
},
|
},
|
||||||
complete: (res) => {
|
complete: (res) => {
|
||||||
console.log("下载完成", res);
|
|
||||||
if (res.statusCode === 404) {
|
if (res.statusCode === 404) {
|
||||||
uni.showToast({ title: "文件不存在", icon: "none" });
|
uni.showToast({ title: "文件不存在", icon: "none" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("CatchClause", e);
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -249,7 +241,6 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("CatchClause", e);
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -265,12 +256,10 @@ export default {
|
|||||||
this.$util.showToast({ title: res.message });
|
this.$util.showToast({ title: res.message });
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log(err);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
change(e) {
|
change(e) {
|
||||||
console.log(e);
|
|
||||||
this.ismessage = e.show ? 1 : 0;
|
this.ismessage = e.show ? 1 : 0;
|
||||||
},
|
},
|
||||||
tapMessage() {
|
tapMessage() {
|
||||||
@@ -285,7 +274,6 @@ export default {
|
|||||||
uni.makePhoneCall({
|
uni.makePhoneCall({
|
||||||
phoneNumber: phone + "",
|
phoneNumber: phone + "",
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log(res);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -293,11 +281,9 @@ export default {
|
|||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
data: text,
|
data: text,
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log("复制成功");
|
|
||||||
uni.showToast({ title: "复制成功", icon: "success", duration: 2000 });
|
uni.showToast({ title: "复制成功", icon: "success", duration: 2000 });
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
console.log("复制失败");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
toDetail(item) {
|
toDetail(item) {
|
||||||
console.log(item.files_url)
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '正在加载'
|
title: '正在加载'
|
||||||
})
|
})
|
||||||
@@ -118,12 +117,10 @@ export default {
|
|||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: item.files_url,
|
url: item.files_url,
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log(res)
|
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
uni.openDocument({
|
uni.openDocument({
|
||||||
filePath: res.tempFilePath,
|
filePath: res.tempFilePath,
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log('打开成功')
|
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
},
|
},
|
||||||
@@ -137,7 +134,6 @@ export default {
|
|||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
},
|
},
|
||||||
complete: res => {
|
complete: res => {
|
||||||
console.log('下载完成', res)
|
|
||||||
if (res.statusCode === 404) {
|
if (res.statusCode === 404) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '文件不存在',
|
title: '文件不存在',
|
||||||
@@ -147,7 +143,6 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('CatchClause', e)
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -324,9 +324,8 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: res => {
|
fail: res => {
|
||||||
console.log('fail', res);
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -265,9 +265,8 @@
|
|||||||
if (res.code == 0 && res.data.length) {
|
if (res.code == 0 && res.data.length) {
|
||||||
uni.requestSubscribeMessage({
|
uni.requestSubscribeMessage({
|
||||||
tmplIds: res.data,
|
tmplIds: res.data,
|
||||||
fail: res => {
|
fail: res => {
|
||||||
console.log('fail', res);
|
},
|
||||||
},
|
|
||||||
complete: () => {
|
complete: () => {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,8 +114,6 @@ export default {
|
|||||||
let msg = res.message;
|
let msg = res.message;
|
||||||
if (res.code == 0 && res.data) {
|
if (res.code == 0 && res.data) {
|
||||||
newArr = res.data.list;
|
newArr = res.data.list;
|
||||||
} else {
|
|
||||||
console.log(`后台服务器返回的信息:${msg}`);
|
|
||||||
}
|
}
|
||||||
mescroll.endSuccess(newArr.length);
|
mescroll.endSuccess(newArr.length);
|
||||||
//设置列表数据
|
//设置列表数据
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 跳转至登录页
|
// 跳转至登录页
|
||||||
toLogin(url) {
|
toLogin(url) {
|
||||||
console.log('跳转至登录页', {url, currentRoute: this.$util.getCurrentRoute()});
|
|
||||||
this.$refs.login.open(url ?? this.$util.getCurrentRoute());
|
this.$refs.login.open(url ?? this.$util.getCurrentRoute());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,7 +264,6 @@ export default {
|
|||||||
uni.requestSubscribeMessage({
|
uni.requestSubscribeMessage({
|
||||||
tmplIds: res.data,
|
tmplIds: res.data,
|
||||||
fail: (res) => {
|
fail: (res) => {
|
||||||
console.log('fail', res)
|
|
||||||
},
|
},
|
||||||
complete: ()=> {
|
complete: ()=> {
|
||||||
callback();
|
callback();
|
||||||
|
|||||||
@@ -266,7 +266,6 @@ export default {
|
|||||||
uni.requestSubscribeMessage({
|
uni.requestSubscribeMessage({
|
||||||
tmplIds: res.data,
|
tmplIds: res.data,
|
||||||
fail: (res) => {
|
fail: (res) => {
|
||||||
console.log('fail', res)
|
|
||||||
},
|
},
|
||||||
complete: ()=> {
|
complete: ()=> {
|
||||||
callback();
|
callback();
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("CatchClause", error);
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -103,7 +102,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log(err);
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
this.$util.showToast({ title: '下载失败' });
|
this.$util.showToast({ title: '下载失败' });
|
||||||
}
|
}
|
||||||
@@ -114,7 +112,6 @@ export default {
|
|||||||
url: '/api/seal/info',
|
url: '/api/seal/info',
|
||||||
data: { keyword: this.keyword },
|
data: { keyword: this.keyword },
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log(res);
|
|
||||||
this.list = res.value;
|
this.list = res.value;
|
||||||
this.info = res;
|
this.info = res;
|
||||||
this.title = res.name;
|
this.title = res.name;
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ export default {
|
|||||||
uni.openDocument({
|
uni.openDocument({
|
||||||
filePath: res.tempFilePath,
|
filePath: res.tempFilePath,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log('打开文档成功');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ export default {
|
|||||||
this.$api.sendRequest({
|
this.$api.sendRequest({
|
||||||
url: '/api/config/defaultvr',
|
url: '/api/config/defaultvr',
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log(res)
|
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title:res.data.title
|
title:res.data.title
|
||||||
|
|||||||
@@ -416,7 +416,6 @@ const store = new Vuex.Store({
|
|||||||
},
|
},
|
||||||
// 生成主题颜色CSS变量
|
// 生成主题颜色CSS变量
|
||||||
themeColorSet() {
|
themeColorSet() {
|
||||||
// console.log('样式颜色设置...');
|
|
||||||
let theme = this.state.themeStyle;
|
let theme = this.state.themeStyle;
|
||||||
if (!theme?.main_color || !theme?.aux_color) return;
|
if (!theme?.main_color || !theme?.aux_color) return;
|
||||||
try {
|
try {
|
||||||
@@ -440,7 +439,6 @@ const store = new Vuex.Store({
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('设置主题颜色失败', e);
|
console.error('设置主题颜色失败', e);
|
||||||
}
|
}
|
||||||
// console.log('themeColor => ', this.state.themeColor);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user