|
@@ -12,6 +12,12 @@ export default {
|
|
|
getQrcode,
|
|
|
formateEnvIndicatorValue,
|
|
|
random,
|
|
|
+ getAppId,
|
|
|
+ getVersion,
|
|
|
+ getTimeStamp,
|
|
|
+ getMiniProgram,
|
|
|
+ commonParams,
|
|
|
+ getMapSpaceIcon,
|
|
|
getSearchRegEx
|
|
|
};
|
|
|
|
|
@@ -1005,3 +1011,192 @@ function previewAgreement(url, serviceAgreementTitle, cacheKey) {
|
|
|
});
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+function getMiniProgram() {
|
|
|
+ const miniProgram = wx.getAccountInfoSync();
|
|
|
+ return miniProgram;
|
|
|
+ // this.version = miniProgram.miniProgram.version;
|
|
|
+}
|
|
|
+function getAppId() {
|
|
|
+ const miniProgram = wx.getAccountInfoSync();
|
|
|
+ return miniProgram && miniProgram.miniProgram && miniProgram.miniProgram.appId || 'wxda2ef261ac3cca32';
|
|
|
+}
|
|
|
+
|
|
|
+// 正式版本上能获取,体验和开发版本无法获取到版本号
|
|
|
+function getVersion() {
|
|
|
+ const miniProgram = wx.getAccountInfoSync();
|
|
|
+ return miniProgram && miniProgram.miniProgram && miniProgram.miniProgram.version;
|
|
|
+}
|
|
|
+
|
|
|
+// 获取时间戳
|
|
|
+function getTimeStamp() {
|
|
|
+ let timeStamp = Date.parse(new Date());
|
|
|
+ return timeStamp;
|
|
|
+}
|
|
|
+
|
|
|
+// http请求通用参数
|
|
|
+function commonParams() {
|
|
|
+ // openid=${storeUser().openId}&
|
|
|
+ let url = `pubname=${config.brsgServer.pubname}`
|
|
|
+ if (storeUser().projectId) {
|
|
|
+ url = url + `&projectId=${storeUser().projectId}`
|
|
|
+ }
|
|
|
+ if (storeUser().userName) {
|
|
|
+ url = url + `&userName=${storeUser().userName}`
|
|
|
+ }
|
|
|
+ if (storeUser().userId) {
|
|
|
+ url = url + `&userId=${storeUser().userId}`
|
|
|
+ }
|
|
|
+ if (storeToken()) {
|
|
|
+ url = url + `&saga-token=${storeToken()}`
|
|
|
+ }
|
|
|
+ return url;
|
|
|
+}
|
|
|
+
|
|
|
+// 获取空间类型
|
|
|
+function getMapSpaceIcon(type) {
|
|
|
+ let typeName = '公共区域'
|
|
|
+ if (type === '300'
|
|
|
+ || type === '313'
|
|
|
+ || type === '314'
|
|
|
+ || type === '315') {
|
|
|
+ typeName = '开放办公区'
|
|
|
+ }
|
|
|
+ else if (type === '312'
|
|
|
+ || type === '311'
|
|
|
+ || type === '310') {
|
|
|
+ typeName = '个人办公区'
|
|
|
+ }
|
|
|
+ else if (type === '120'
|
|
|
+ || type === '140'
|
|
|
+ || type === '130') {
|
|
|
+ typeName = '走廊'
|
|
|
+ }
|
|
|
+ else if (type === '310' ||
|
|
|
+ type === '320'
|
|
|
+ || type === '321'
|
|
|
+ || type === '322'
|
|
|
+ || type === '323'
|
|
|
+ || type === '490'
|
|
|
+ || type === '931'
|
|
|
+ ) {
|
|
|
+ typeName = '会议室'
|
|
|
+ }
|
|
|
+ else if (type === '600'
|
|
|
+ || type === '223'
|
|
|
+ || type === '930') {
|
|
|
+ typeName = '茶水间'
|
|
|
+ }
|
|
|
+ else if (type === '331') {
|
|
|
+ typeName = '接待室'
|
|
|
+ }
|
|
|
+ else if (type === '330') {
|
|
|
+ typeName = '打印室'
|
|
|
+ }
|
|
|
+ else if (type === '112') {
|
|
|
+ typeName = '更衣室'
|
|
|
+ }
|
|
|
+ else if (type === '111') {
|
|
|
+ typeName = '卫生间'
|
|
|
+ }
|
|
|
+ else if (type === '160') {
|
|
|
+ typeName = '前台(大堂)'
|
|
|
+ }
|
|
|
+ else if (type === '936'
|
|
|
+ || type === '935'
|
|
|
+ || type === '937' ||
|
|
|
+ type === '938' ||
|
|
|
+ type === '170'
|
|
|
+ || type === '915') {
|
|
|
+ typeName = '休闲活动区(吸烟室)'
|
|
|
+ }
|
|
|
+ else if (type === '690'
|
|
|
+ || type === '932'
|
|
|
+ || type === '934'
|
|
|
+ || type === '933'
|
|
|
+ || type === '6A0') {
|
|
|
+ typeName = '健身房'
|
|
|
+ }
|
|
|
+ else if (type === '113') {
|
|
|
+ typeName = '母婴室'
|
|
|
+ }
|
|
|
+ else if (type === '333'
|
|
|
+ || type === '250'
|
|
|
+ || type === '253') {
|
|
|
+ typeName = '普通库房'
|
|
|
+ }
|
|
|
+ else if (type === '252'
|
|
|
+ || type === '246'
|
|
|
+ || type === '1B5'
|
|
|
+ || type === '234'
|
|
|
+ || type === '231'
|
|
|
+ || type === '230'
|
|
|
+ || type === '233'
|
|
|
+ || type === '232'
|
|
|
+ || type === '234'
|
|
|
+ || type === '235'
|
|
|
+ || type === '236'
|
|
|
+ || type === '237'
|
|
|
+ || type === '241'
|
|
|
+ || type === '242'
|
|
|
+ || type === '244'
|
|
|
+ || type === '245'
|
|
|
+ || type === '251'
|
|
|
+ || type === '254'
|
|
|
+ || type === '211'
|
|
|
+ || type === '212'
|
|
|
+ || type === '222') {
|
|
|
+ typeName = '通迅机房'
|
|
|
+ } else if (type == '239') {
|
|
|
+ typeName = '空调机房'
|
|
|
+ }
|
|
|
+ else if (type === '430'
|
|
|
+ || type === '410'
|
|
|
+ || type === '220'
|
|
|
+ || type === '221'
|
|
|
+ ||
|
|
|
+ type === '400'
|
|
|
+ || type === '4B0'
|
|
|
+ || type === '441'
|
|
|
+ || type === '442'
|
|
|
+ || type === '451'
|
|
|
+ || type === '452'
|
|
|
+ || type === '461'
|
|
|
+ || type === '462'
|
|
|
+ || type === '471'
|
|
|
+ || type === '472'
|
|
|
+ || type === '733'
|
|
|
+ || type === '440'
|
|
|
+ || type === '450') {
|
|
|
+ typeName = '餐饮区'
|
|
|
+ } else if (type == '500') {
|
|
|
+ typeName = '零售区'
|
|
|
+ } else {
|
|
|
+ typeName = '公共区域'
|
|
|
+ }
|
|
|
+
|
|
|
+ let obj = {
|
|
|
+ "开放办公区": "map-icon1.svg",
|
|
|
+ "个人办公区": "map-icon2.svg",
|
|
|
+ "会议室": "map-icon3.svg",
|
|
|
+ "走廊": "map-icon4.svg",
|
|
|
+ "前台(大堂)": "map-icon5.svg",
|
|
|
+ "茶水间": "map-icon6.svg",
|
|
|
+ "接待室": "map-icon7.svg",
|
|
|
+ "休闲活动区(吸烟室)": "map-icon8.svg",
|
|
|
+ "餐饮区": "map-icon9.svg",
|
|
|
+ "零售区": "map-icon10.svg",
|
|
|
+ "公共区域": "map-icon10.svg",
|
|
|
+ "卫生间": "map-icon11.svg",
|
|
|
+ "健身房": "map-icon12.svg",
|
|
|
+ "母婴室": "map-icon13.svg",
|
|
|
+ "更衣室": "map-icon14.svg",
|
|
|
+ "打印室": "map-icon15.svg",
|
|
|
+ "普通库房": "map-icon16.svg",
|
|
|
+ "通讯机房": "map-icon17.svg",
|
|
|
+ "空调机房": "map-icon18.svg",
|
|
|
+
|
|
|
+ }
|
|
|
+ return obj[typeName]
|
|
|
+}
|
|
|
+
|