Skip to content

Commit

Permalink
edit:wss,分类
Browse files Browse the repository at this point in the history
  • Loading branch information
Sssitmonkey committed Dec 30, 2020
1 parent 673b15a commit aaa48d4
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
8 changes: 0 additions & 8 deletions App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/`, //开发环境
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
},
"h5" : {
"title" : "Shopro",
"domain" : "120.test.7wpp.com",
"domain" : "frontend.test.7wpp.com",
"optimization" : {
"treeShaking" : {
"enable" : true
Expand Down
4 changes: 2 additions & 2 deletions pages/index/category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export default {
computed: {},
onLoad(options) {
this.queryObj = options;
this.categoryId = Number(this.$Route.query.id);
this.getCategory();
},
methods: {
Expand All @@ -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
Expand Down
9 changes: 8 additions & 1 deletion pages/index/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ export default {
emptyData: {
img: this.$IMG_URL + '/imgs/empty/template_empty.png',
tip: '暂未找到模板,赶快去装修吧~'
}
},
netEmptyData: {}
};
},
computed: {
Expand Down Expand Up @@ -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() {
Expand Down
7 changes: 5 additions & 2 deletions pages/public/kefu/chat/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
3 changes: 2 additions & 1 deletion pages/public/kefu/chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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); //监听消息
Expand Down

0 comments on commit aaa48d4

Please sign in to comment.