Skip to content

Commit 88603fe

Browse files
committed
WechatPlugin: upgrade to 1.3.2 #2396
1 parent 17a17a8 commit 88603fe

File tree

6 files changed

+750
-38
lines changed

6 files changed

+750
-38
lines changed

.eslintignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ config/*.js
55
src/tools/*/*.js
66
src/components/video/zy.media.js
77
src/plugins/wechat/1.3.0.js
8-
src/plugins/wechat/origin.1.3.0.js
8+
src/plugins/wechat/1.3.2.js
9+
src/plugins/wechat/origin.1.3.0.js
10+
src/plugins/wechat/origin.1.3.2.js

src/plugins/wechat/1.3.0.js

Lines changed: 61 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ let wx
184184
f(function () {
185185
V.initEndTime = p()
186186
});
187-
var O = !1,
188-
E = [],
187+
var E = !1,
188+
O = [],
189189
N = {
190190
config: function (e) {
191191
C = e, u("config", e);
@@ -383,14 +383,14 @@ let wx
383383
}, e)
384384
},
385385
getLocalImgData: function (e) {
386-
!1 === O ? (O = !0, i("getLocalImgData", {
386+
!1 === E ? (E = !0, i("getLocalImgData", {
387387
localId: e.localId
388388
}, (e._complete = function (e) {
389-
if (O = !1, E.length > 0) {
390-
var n = E.shift();
389+
if (E = !1, O.length > 0) {
390+
var n = O.shift();
391391
wx.getLocalImgData(n)
392392
}
393-
}, e))) : E.push(e)
393+
}, e))) : O.push(e)
394394
},
395395
getNetworkType: function (e) {
396396
var n = function (e) {
@@ -572,44 +572,69 @@ let wx
572572
},
573573
miniProgram: {
574574
navigateBack: function (e) {
575-
i("invokeMiniProgramAPI", {
576-
name: "navigateBack",
577-
arg: {
578-
delta: (e = e || {}).delta || 1
579-
}
580-
}, e)
575+
e = e || {}, f(function () {
576+
i("invokeMiniProgramAPI", {
577+
name: "navigateBack",
578+
arg: {
579+
delta: e.delta || 1
580+
}
581+
}, e)
582+
})
581583
},
582584
navigateTo: function (e) {
583-
i("invokeMiniProgramAPI", {
584-
name: "navigateTo",
585-
arg: {
586-
url: e.url
587-
}
588-
}, e)
585+
f(function () {
586+
i("invokeMiniProgramAPI", {
587+
name: "navigateTo",
588+
arg: {
589+
url: e.url
590+
}
591+
}, e)
592+
})
589593
},
590594
redirectTo: function (e) {
591-
i("invokeMiniProgramAPI", {
592-
name: "redirectTo",
593-
arg: {
594-
url: e.url
595-
}
596-
}, e)
595+
f(function () {
596+
i("invokeMiniProgramAPI", {
597+
name: "redirectTo",
598+
arg: {
599+
url: e.url
600+
}
601+
}, e)
602+
})
597603
},
598604
switchTab: function (e) {
599-
i("invokeMiniProgramAPI", {
600-
name: "switchTab",
601-
arg: {
602-
url: e.url
603-
}
604-
}, e)
605+
f(function () {
606+
i("invokeMiniProgramAPI", {
607+
name: "switchTab",
608+
arg: {
609+
url: e.url
610+
}
611+
}, e)
612+
})
605613
},
606614
reLaunch: function (e) {
607-
i("invokeMiniProgramAPI", {
608-
name: "reLaunch",
609-
arg: {
610-
url: e.url
611-
}
612-
}, e)
615+
f(function () {
616+
i("invokeMiniProgramAPI", {
617+
name: "reLaunch",
618+
arg: {
619+
url: e.url
620+
}
621+
}, e)
622+
})
623+
},
624+
postMessage: function (e) {
625+
f(function () {
626+
i("invokeMiniProgramAPI", {
627+
name: "postMessage",
628+
arg: e.data || {}
629+
}, e)
630+
})
631+
},
632+
getEnv: function (n) {
633+
f(function () {
634+
n({
635+
miniprogram: "miniprogram" === e.__wxjs_environment
636+
})
637+
})
613638
}
614639
}
615640
},

0 commit comments

Comments
 (0)