Browse Source

feat: 修改

linwenxin 1 year ago
parent
commit
69b728005f
3 changed files with 50 additions and 4 deletions
  1. 3 3
      package-lock.json
  2. 1 0
      package.json
  3. 46 1
      src/common/utils/navPag.js

+ 3 - 3
package-lock.json

@@ -4920,7 +4920,7 @@
     },
     "charenc": {
       "version": "0.0.2",
-      "resolved": "https://registry.npmmirror.com/charenc/-/charenc-0.0.2.tgz",
+      "resolved": "http://121.41.110.30:4873/charenc/-/charenc-0.0.2.tgz",
       "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA=="
     },
     "check-types": {
@@ -5753,7 +5753,7 @@
     },
     "crypt": {
       "version": "0.0.2",
-      "resolved": "https://registry.npmmirror.com/crypt/-/crypt-0.0.2.tgz",
+      "resolved": "http://121.41.110.30:4873/crypt/-/crypt-0.0.2.tgz",
       "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow=="
     },
     "crypto-browserify": {
@@ -11159,7 +11159,7 @@
     },
     "md5": {
       "version": "2.3.0",
-      "resolved": "https://registry.npmmirror.com/md5/-/md5-2.3.0.tgz",
+      "resolved": "http://121.41.110.30:4873/md5/-/md5-2.3.0.tgz",
       "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==",
       "requires": {
         "charenc": "0.0.2",

+ 1 - 0
package.json

@@ -104,6 +104,7 @@
     "js-base64": "^3.7.2",
     "js-perform-lock": "^1.0.5",
     "jweixin-module": "^1.6.0",
+    "md5": "^2.3.0",
     "regenerator-runtime": "^0.12.1",
     "uni-read-pages": "^1.0.5",
     "uni-simple-router": "2.0.7",

+ 46 - 1
src/common/utils/navPag.js

@@ -6,6 +6,8 @@ import {
 } from "./common.js"
 import store from '@/store/index.js'
 
+import md5 from "md5"
+
 export function webViewHref(url, pam = {}) {
 
   var defaultPam = {
@@ -103,4 +105,47 @@ export const navToPage = (function() {
     })
     // #endif
   }
-})()
+})()
+
+// export const crossPage = (function() {
+//   var funs = {}
+//   var funco = {
+//     $emit(name, data) {
+//       if (funs[name]) {
+//         Object.keys(funs[name]).map(key => {
+//           funs[name][key](data)
+//         })
+//       }
+//       uni.setStorageSync(name, data);
+//     },
+
+//     $on(name, fun) {
+//       if (!funs[name]) {
+//         funs[name] = {}
+//       }
+//       funs[name][md5(fun.toString())] = fun
+//     },
+
+//     $off(name, fun) {
+//       var skey = md5(fun.toString())
+//       if (funs[name] && funs[name][skey]) {
+//         delete funs[name][skey]
+//       }
+//     }
+//   }
+//   (function tiemID(){
+//     Object.keys(funs).map(name=>{
+//       var data = uni.getStorageSync(name);
+//       if (funs[name]) {
+//         Object.keys(funs[name]).map(key => {
+//           funs[name][key](data)
+//         })
+//       }
+//     })
+    
+
+
+//     setTimeout(tiemID,300)
+//   })()
+//   return funco
+// })()