|
@@ -77,7 +77,7 @@ export function isAlipay() {
|
|
|
// 是否在微信小程序中运行
|
|
|
export function getIsMin() {
|
|
|
const platform = getPlatform();
|
|
|
- console.log('platform====>80', platform);
|
|
|
+ // console.log('platform====>80', platform);
|
|
|
return platform === 'miniprogram';
|
|
|
}
|
|
|
|
|
@@ -134,7 +134,7 @@ export function getUrlParams( url = window.location.href ) {
|
|
|
|
|
|
// 根据不同环境和lsbid返回 groupId 和 mallId
|
|
|
export function getGroupIdAndMallIdByLsbId( lbsId ) {
|
|
|
- console.log(125,lbsId);
|
|
|
+ // console.log(125,lbsId);
|
|
|
const lbsObj = lbsDictionary[lbsId];
|
|
|
if ( window.env === 'prod' ) {
|
|
|
return lbsObj['prod'];
|
|
@@ -159,12 +159,12 @@ export function wxToLoginCallback( path,callback ) {
|
|
|
},
|
|
|
});
|
|
|
window.subscribe('callback',( options ) => {
|
|
|
- console.log('登录页面的回调',JSON.stringify(options));
|
|
|
+ // console.log('登录页面的回调',JSON.stringify(options));
|
|
|
if ( options.isReload ) {
|
|
|
- console.log('刷新页面');
|
|
|
+ // console.log('刷新页面');
|
|
|
window.location.reload();
|
|
|
} else {
|
|
|
- console.log('刷新页面:callback');
|
|
|
+ // console.log('刷新页面:callback');
|
|
|
callback && callback(options);
|
|
|
uni.setStorageSync('oldPath','');
|
|
|
}
|
|
@@ -300,24 +300,17 @@ export function windowSendInit() {
|
|
|
export function wssInit() {
|
|
|
return new Promise(( resolve,reject ) => {
|
|
|
try {
|
|
|
- console.log('platform====>303');
|
|
|
const socket = new SockJS(`${ getUrl() }/hafengWebsocket?token=${ window.token }`);
|
|
|
- console.log('platform====>305');
|
|
|
window.stompClient = Stomp.over(socket);
|
|
|
- console.log('platform====>307');
|
|
|
// window.stompClient.debug = false;
|
|
|
- console.log('platform====>308');
|
|
|
windowSendInit();
|
|
|
- console.log('platform====>311');
|
|
|
window.stompClient.connect({},( frame ) => {
|
|
|
- console.log('platform====>312');
|
|
|
// 请求 projectId
|
|
|
window.toWXSendMsg({
|
|
|
type: 'getProjectId',
|
|
|
options: {},
|
|
|
});
|
|
|
window.subscribe('projectId',( options ) => {
|
|
|
- console.log('platform====>320');
|
|
|
resolve(options);
|
|
|
});
|
|
|
});
|
|
@@ -326,3 +319,32 @@ export function wssInit() {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+// 获取当前的主题
|
|
|
+export function getsTheCurrentTopic() {
|
|
|
+ let theme = ''
|
|
|
+ let componentName = ''
|
|
|
+ const source = uni.getStorageSync('source')
|
|
|
+ const custTypeId = uni.getStorageSync('custTypeId')
|
|
|
+ const com = ['purpleCom', 'blueCom', 'greenCom', 'officeBlueCom', 'purpleCom'];
|
|
|
+ if (custTypeId < 3 || !custTypeId) {
|
|
|
+ componentName = 'baseParkingFeeCom';
|
|
|
+ theme = 'theme-mall'
|
|
|
+ } else {
|
|
|
+ componentName = com[custTypeId];
|
|
|
+ theme = 'theme-office'
|
|
|
+ }
|
|
|
+ if (source === 'KIP') {
|
|
|
+ theme = 'theme-office'
|
|
|
+ }
|
|
|
+ if (source === 'PUDONG') {
|
|
|
+ theme = 'theme-pudong'
|
|
|
+ }
|
|
|
+ if (source === 'JINGAN') {
|
|
|
+ theme = 'theme-jingan'
|
|
|
+ }
|
|
|
+ return { theme, componentName }
|
|
|
+}
|
|
|
+
|
|
|
+export * from './common/websocket.js'
|