gxd-uni-library-editx 1.0.185 → 1.0.187

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gxd-uni-library-editx",
3
- "version": "1.0.185",
3
+ "version": "1.0.187",
4
4
  "private": false,
5
5
  "description": "聚福宝基础插件专用库",
6
6
  "main": "index.js",
@@ -18,6 +18,12 @@ import {
18
18
  baseInArray
19
19
  } from "@/utils/xd.base";
20
20
 
21
+ import {
22
+ codeForGetAppId,
23
+ toThirdMP,
24
+ checkMpUrl
25
+ } from './JumpTo';
26
+
21
27
  class Helpers {
22
28
 
23
29
  constructor(){
@@ -47,9 +53,9 @@ class Helpers {
47
53
  * @param obj
48
54
  * @returns {*}
49
55
  */
50
- checkVarType(obj){
51
- return baseCheckVarType(obj)
52
- }
56
+ checkVarType(obj){
57
+ return baseCheckVarType(obj)
58
+ }
53
59
 
54
60
  /**
55
61
  * @description 获取最近某时间断内的时间
@@ -1292,14 +1298,56 @@ class Helpers {
1292
1298
  else cb(obj);
1293
1299
  }
1294
1300
 
1301
+ /**
1302
+ * @description 跨平台处理
1303
+ */
1304
+ handleCrossPlatform(obj,cb){
1305
+
1306
+ //检查是否为第三方小程序
1307
+ if(checkMpUrl(obj.url)) {
1308
+ toThirdMP(obj.url);
1309
+ return;
1310
+ }
1311
+
1312
+ //目标为微信小程序时候处理
1313
+ if(obj['jfb-platform'] && obj['jfb-platform']['appType'] === 'wxmp'){
1314
+ let {deploy_dir, host} = store.state.brandInfo;
1315
+ let dir = obj['jfb-platform']['dir'];
1316
+
1317
+ //不同应用处理
1318
+ if(deploy_dir !== dir) {
1319
+ codeForGetAppId(
1320
+ obj['jfb-platform']['aopen_app_code'],
1321
+ obj['jfb-platform']['appType'],
1322
+ obj.url,
1323
+ '',
1324
+ dir
1325
+ );
1326
+ return
1327
+ }
1328
+
1329
+ //相同应用跳转
1330
+ else {
1331
+ delete obj['jfb-platform'];
1332
+ obj.url = obj.url.replace(`@site_domain@/${dir}`,'')
1333
+ if(typeof cb === 'function') cb();
1334
+ }
1335
+ }
1336
+
1337
+ //其他情况
1338
+ if(typeof cb === 'function') cb();
1339
+ }
1340
+
1295
1341
  /**
1296
1342
  * @description 保留当前页面,跳转到应用内的某个页面 https://uniapp.dcloud.io/api/router?id=navigateto
1297
1343
  * @param obj 与uni.navigateTo的Object参数相同
1298
1344
  * @param redirect 是否添加当前页面地址路径最为回调地址
1299
1345
  */
1300
1346
  navigateTo(obj = {}, redirect) {
1301
- this.specialApiTransform(obj,(res)=>{
1302
- this.handleTo(res, redirect);
1347
+ this.handleCrossPlatform(obj,()=>{
1348
+ this.specialApiTransform(obj,(res)=>{
1349
+ this.handleTo(res, redirect);
1350
+ })
1303
1351
  })
1304
1352
  }
1305
1353
 
@@ -1356,9 +1404,11 @@ class Helpers {
1356
1404
  * @param notHistory h5使用window.location.replace() H5生效
1357
1405
  */
1358
1406
  redirectTo(obj, redirect, notHistory=false) {
1359
- this.specialApiTransform(obj,(res)=>{
1360
- this.handleTo(res, redirect, false, notHistory);
1361
- })
1407
+ this.handleCrossPlatform(obj,()=>{
1408
+ this.specialApiTransform(obj,(res)=>{
1409
+ this.handleTo(res, redirect, false, notHistory);
1410
+ })
1411
+ });
1362
1412
  }
1363
1413
 
1364
1414
  /**
@@ -850,7 +850,8 @@ export function getContainerPropsValue(
850
850
  // }
851
851
 
852
852
  //是对象需要合并属性选项
853
- if(isMerge) return handleMerge(propsData,dDataValue )
853
+ let version = isDefStatus(container,props,true);
854
+ if(isMerge) return handleMerge(propsData,version?dDataValue:lastValue)
854
855
  //是对象需要合并属性选项
855
856
 
856
857
  //普通默认值