gxd-uni-library-editx 1.0.69 → 1.0.70

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.69",
3
+ "version": "1.0.70",
4
4
  "private": false,
5
5
  "description": "聚福宝基础插件专用库",
6
6
  "main": "index.js",
@@ -47,6 +47,7 @@
47
47
  <script>
48
48
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
49
49
  export default {
50
+ name:'XdCardV2',
50
51
  components: {
51
52
  XdFontIcon
52
53
  },
@@ -1035,13 +1035,38 @@ class Helpers {
1035
1035
  }
1036
1036
  }
1037
1037
 
1038
+ /**
1039
+ * @description 特殊翻译
1040
+ */
1041
+ async specialApiTranform(obj, cb){
1042
+ let reg = /(-apiuri\/v)/;
1043
+ //需要转化的特殊访问地址
1044
+ if(reg.test(obj.url)){
1045
+ store.dispatch('getSpecialApiTranform',{url: obj.url})
1046
+ .then(res=>{
1047
+ //链接地址
1048
+ if(res.type === 'url' && res.value){
1049
+ obj.url = res.value;
1050
+ cb(obj)
1051
+ }
1052
+ })
1053
+ .catch(err=>{
1054
+ console.error(err);
1055
+ });
1056
+ }
1057
+
1058
+ else cb(obj);
1059
+ }
1060
+
1038
1061
  /**
1039
1062
  * @description 保留当前页面,跳转到应用内的某个页面 https://uniapp.dcloud.io/api/router?id=navigateto
1040
1063
  * @param obj 与uni.navigateTo的Object参数相同
1041
1064
  * @param redirect 是否添加当前页面地址路径最为回调地址
1042
1065
  */
1043
1066
  navigateTo(obj = {}, redirect) {
1044
- this.handleTo( obj, redirect)
1067
+ this.specialApiTranform(obj,(res)=>{
1068
+ this.handleTo(res, redirect);
1069
+ })
1045
1070
  }
1046
1071
 
1047
1072
  /**
@@ -1097,7 +1122,9 @@ class Helpers {
1097
1122
  * @param notHistory h5使用window.location.replace() H5生效
1098
1123
  */
1099
1124
  redirectTo(obj, redirect, notHistory=false) {
1100
- this.handleTo(obj, redirect, false, notHistory)
1125
+ this.specialApiTranform(obj,(res)=>{
1126
+ this.handleTo(res, redirect,notHistory);
1127
+ })
1101
1128
  }
1102
1129
 
1103
1130
  /**
@@ -604,6 +604,20 @@ export function isWechat() {
604
604
  return false
605
605
  }
606
606
 
607
+ /**
608
+ * @description 判断是否为企业微信环境
609
+ * @return {boolean}
610
+ */
611
+ export function isWechatWork(){
612
+ //#ifdef H5
613
+ let ua = window.navigator.userAgent.toLowerCase();
614
+ return (ua.indexOf('micromessenger') !== -1 //是否为微信客户端
615
+ || ua.indexOf("miniProgram") !== -1) //是否为webview
616
+ && ua.indexOf('wxwork') !== -1
617
+ // #endif
618
+ return false
619
+ }
620
+
607
621
  /**
608
622
  * @description 判断客户端是不是微信客户端
609
623
  * @returns {boolean}