diff --git a/App.vue b/App.vue index 3ced02db..c3b6765f 100644 --- a/App.vue +++ b/App.vue @@ -85,14 +85,6 @@ export default { if (process.env.NODE_ENV === 'development') { await this.getRoutes(); } - // #ifdef APP-PLUS - // 监听设备网络状态变化事件,接口ios市场首次安装网络切换问题 - plus.globalEvent.addEventListener('netchange', function() { - var nt = plus.networkinfo.getCurrentType(); //网络状态 - that.getTemplate(); - that.getAppInit(); - }); - // #endif }, onShow: function() { this.$store.commit('CART_NUM'); diff --git a/env.js b/env.js index f3d25ca5..854fe95e 100644 --- a/env.js +++ b/env.js @@ -5,8 +5,8 @@ const ENV_BASE_URL = { - development: 'http://peitong.test.7wpp.com', //开发环境 - production: 'http://peitong.test.7wpp.com', //生产环境 + development: 'https://dev.7wpp.com', //开发环境 + production: 'https://dev.7wpp.com', //生产环境 } const ENV_API_URL = { development: `${ENV_BASE_URL.development}/addons/shopro/`, //开发环境 diff --git a/manifest.json b/manifest.json index 38a01f7a..bfc4dd14 100644 --- a/manifest.json +++ b/manifest.json @@ -211,7 +211,7 @@ }, "h5" : { "title" : "Shopro", - "domain" : "120.test.7wpp.com", + "domain" : "frontend.test.7wpp.com", "optimization" : { "treeShaking" : { "enable" : true diff --git a/pages/index/category.vue b/pages/index/category.vue index 9325d1c6..15d30c5f 100644 --- a/pages/index/category.vue +++ b/pages/index/category.vue @@ -42,7 +42,6 @@ export default { computed: {}, onLoad(options) { this.queryObj = options; - this.categoryId = Number(this.$Route.query.id); this.getCategory(); }, methods: { @@ -52,11 +51,12 @@ export default { */ getCategory() { this.$api('category.info', { - id: this.$Route.query.id + id: this.$Route.query.id ? this.$Route.query.id : 0 }).then(res => { if (res.code === 1) { if (res.data.type) { this.categoryType = Number(res.data.type); + this.categoryId = Number(res.data.id); } uni.setNavigationBarTitle({ title: res.data.name diff --git a/pages/index/index.vue b/pages/index/index.vue index b941c198..b953fa0c 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -151,7 +151,8 @@ export default { emptyData: { img: this.$IMG_URL + '/imgs/empty/template_empty.png', tip: '暂未找到模板,赶快去装修吧~' - } + }, + netEmptyData: {} }; }, computed: { @@ -190,6 +191,12 @@ export default { this.showPrivacy = true; this.showNoticeModal = false; } + // 监听设备网络状态变化事件,接口ios市场首次安装网络切换问题 + plus.globalEvent.addEventListener('netchange', function() { + var nt = plus.networkinfo.getCurrentType(); //网络状态 + console.log(nt,11111); + + }); // #endif }, mounted() { diff --git a/pages/public/kefu/chat/chat.js b/pages/public/kefu/chat/chat.js index e9909404..79bcbc07 100644 --- a/pages/public/kefu/chat/chat.js +++ b/pages/public/kefu/chat/chat.js @@ -14,14 +14,17 @@ import { } from '@/env.js' const service = BASE_URL.split('://')[1]; +cosnt + export default class Socket { constructor(initData, callback) { let { ping, - is_ssl + is_ssl, + gateway_port } = initData; this.config = { - url: `${is_ssl?'wss':'ws'}://${service}:1818/`, + url: `${is_ssl?'wss':'ws'}://${service}:${gateway_port}/`, session_id: uni.getStorageSync('chatSessionId'), token: uni.getStorageSync('token'), identify: 'user' diff --git a/pages/public/kefu/chat/index.vue b/pages/public/kefu/chat/index.vue index 9cd86eb8..91d02d58 100644 --- a/pages/public/kefu/chat/index.vue +++ b/pages/public/kefu/chat/index.vue @@ -336,7 +336,8 @@ export default { that.socket = new Socket( { ping: 20000, - is_ssl: res.data.config.system.is_ssl + is_ssl: res.data.config.system.is_ssl, + gateway_port: res.data.config.system.gateway_port }, msg => { that.parseMsgStatus(msg.data); //监听消息