first commit

This commit is contained in:
jefferyzhao
2025-07-31 17:44:12 +08:00
commit b9bdc8598b
42390 changed files with 4467935 additions and 0 deletions

37
node_modules/weixin-jsapi/.npmignore generated vendored Normal file
View File

@ -0,0 +1,37 @@
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules
jspm_packages
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history

21
node_modules/weixin-jsapi/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016 jere
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

12
node_modules/weixin-jsapi/README.md generated vendored Normal file
View File

@ -0,0 +1,12 @@
# weixin-jssdk
微信官方 js-sdk es6 版本
说明: 仅将官方 js-sdk 发布到 npm便于 webpack 使用
js源码: [http://res.wx.qq.com/open/js/jweixin-1.0.0.js](http://res.wx.qq.com/open/js/jweixin-1.0.0.js)
官方使用说明: [http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html](http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html)
安装:`npm install weixin-jsapi`
使用:`import wx from 'weixin-jsapi'`

389
node_modules/weixin-jsapi/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,389 @@
/**
* Copyright (c) 2015,Egret-Labs.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Egret-Labs.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EGRET-LABS.ORG AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Created by wibrst on 2015/1/10.
*/
declare class wx {
/**
* 通过config接口注入权限验证配置
* @param bodyConfig
*/
static config( bodyConfig:BodyConfig ):void;
/**
* 通过ready接口处理成功验证
* @param cbValidated 成功验证后的处理函数
*/
static ready( cbValidated:Function ):void;
/**
* 通过error接口处理失败验证
* @param cbError 处理失败验证后的处理函数
*/
static error( cbError:Function ):void;
/**
* 判断当前客户端版本是否支持指定JS接口
* @param bodyCheckJsAPISupport
*/
static checkJsApi( bodyCheckJsAPISupport:BodyCheckJsAPISupport ):void;
/**
* 获取“分享到朋友圈”按钮点击状态及自定义分享内容接口
* @param bodyMenuShareTimeline
*/
static onMenuShareTimeline( bodyMenuShareTimeline:BodyMenuShareTimeline ):void;
/**
* 获取“分享给朋友”按钮点击状态及自定义分享内容接口
* @param bodyMenuShareAppMessage
*/
static onMenuShareAppMessage( bodyMenuShareAppMessage:BodyMenuShareAppMessage ):void;
/**
* 获取“分享到QQ”按钮点击状态及自定义分享内容接口
* @param bodyMenuShareQQ
*/
static onMenuShareQQ( bodyMenuShareQQ:BodyMenuShareQQ ):void;
/**
* 获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口
* @param bodyMenuShareWeibo
*/
static onMenuShareWeibo( bodyMenuShareWeibo:BodyMenuShareWeibo ):void;
/// 华丽的分界线, 以下接口参数结构较简单或使用较少均可自行查阅微信官方api文档给出适合的参数
/**
* 拍照或从手机相册中选图接口
* @param bodyChooseImage
*/
static chooseImage( body:Object ):void;
/**
* 预览图片接口
* @param body
*/
static previewImage( body:Object ):void;
/**
* 上传图片接口
* @param body
*/
static uploadImage( body:Object ):void;
/**
* 下载图片接口
* @param body
*/
static downloadImage( body:Object ):void;
/**
* 开始录音接口
* @param body
*/
static startRecord( body:Object ):void;
/**
* 停止录音接口
* @param body
*/
static stopRecord( body:Object ):void;
/**
* 监听录音自动停止接口
* @param body
*/
static onVoiceRecordEnd( body:Object ):void;
/**
* 播放语音接口
* @param body
*/
static playVoice( body:Object ):void;
/**
* 暂停播放接口
* @param body
*/
static pauseVoice( body:Object ):void;
/**
* 停止播放接口
* @param body
*/
static stopVoice( body:Object ):void;
/**
* 监听语音播放完毕接口
* @param body
*/
static onVoicePlayEnd( body:Object ):void;
/**
* 上传语音接口
* @param body
*/
static uploadVoice( body:Object ):void;
/**
* 下载语音接口
* @param body
*/
static downloadVoice( body:Object ):void;
// ---- 智能接口
/**
* 识别音频并返回识别结果接口
* @param body
*/
static translateVoice( body:Object ):void;
/// ---- 设备信息
/**
* 获取网络状态接口
* @param body
*/
static getNetworkType( body:Object ):void;
/// ---- 地理位置
/**
* 使用微信内置地图查看位置接口
* @param body
*/
static openLocation( body:Object ):void;
/**
* 获取地理位置接口
* @param body
*/
static getLocation( body:Object ):void;
/// ---- 界面操作
/**
* 隐藏右上角菜单接口
* @param body
*/
static hideOptionMenu( body:Object ):void;
/**
* 显示右上角菜单接口
* @param body
*/
static showOptionMenu( body:Object ):void;
/**
* 关闭当前网页窗口接口
* @param body
*/
static closeWindow( body:Object ):void;
/**
* 批量隐藏功能按钮接口
* @param body
*/
static hideMenuItems( body:Object ):void;
/**
* 批量显示功能按钮接口
* @param body
*/
static showMenuItems( body:Object ):void;
/**
* 隐藏所有非基础按钮接口
* @param body
*/
static hideAllNonBaseMenuItem( body:Object ):void;
/**
* 显示所有功能按钮接口
* @param body
*/
static showAllNonBaseMenuItem( body:Object ):void;
/// ---- 微信扫一扫
/**
* 调起微信扫一扫接口
* @param body
*/
static scanQRCode( body:Object ):void;
/// ---- 微信小店
/**
* 跳转微信商品页接口
* @param body
*/
static openProductSpecificView( body:Object ):void;
/// ---- 微信卡券
/**
* 调起适用于门店的卡券列表并获取用户选择列表
* @param body
*/
static chooseCard( body:Object ):void;
/**
* 批量添加卡券接口
* @param body
*/
static addCard( body:Object ):void;
/**
* 查看微信卡包中的卡券接口
* @param body
*/
static openCard( body:Object ):void;
/// ---- 微信支付
/**
* 发起一个微信支付请求
* @param body
*/
static chooseWXPay( body:Object ):void;
}
///////////////////////////////// 常用API的参数结构类
/**
* config 参数结构
* jsApiList: 所有要调用的 API
*/
declare class BodyConfig {
debug:boolean;
appId:string;
timestamp:number;
nonceStr:string;
signature:string;
jsApiList:Array<string>;
}
/**
* checkJsApi 参数结构
* jsApiList: 需要检测的JS接口列表
*/
declare class BodyCheckJsAPISupport {
success:Function;
jsApiList:Array<string>;
}
/**
* onMenuShareTimeline 参数结构
*/
declare class BodyMenuShareTimeline {
title:string;
link:string;
imgUrl:string;
success:Function;
cancel: Function;
}
/**
* onMenuShareAppMessage 参数结构
*/
declare class BodyMenuShareAppMessage {
title:string;
desc:string;
link:string;
imgUrl:string;
type:string;
dataUrl:string;
success:Function;
cancel: Function;
}
/**
* onMenuShareQQ 参数结构
*/
declare class BodyMenuShareQQ {
title:string;
desc:string;
link:string;
imgUrl:string;
type:string;
dataUrl:string;
success:Function;
cancel: Function;
}
/**
* onMenuShareWeibo 参数结构
*/
declare class BodyMenuShareWeibo {
title:string;
desc:string;
link:string;
imgUrl:string;
success:Function;
cancel: Function;
}
export default wx;

382
node_modules/weixin-jsapi/index.js generated vendored Normal file
View File

@ -0,0 +1,382 @@
!function (a, b) {
function c(b, c, d) {
a.WeixinJSBridge ? WeixinJSBridge.invoke(b, e(c), function (a) {
g(b, a, d)
}) : j(b, d)
}
function d(b, c, d) {
a.WeixinJSBridge ? WeixinJSBridge.on(b, function (a) {
d && d.trigger && d.trigger(a), g(b, a, c)
}) : d ? j(b, d) : j(b, c)
}
function e(a) {
return a = a || {}, a.appId = z.appId, a.verifyAppId = z.appId, a.verifySignType = "sha1", a.verifyTimestamp = z.timestamp + "", a.verifyNonceStr = z.nonceStr, a.verifySignature = z.signature, a
}
function f(a) {
return {
timeStamp: a.timestamp + "",
nonceStr: a.nonceStr,
"package": a.package,
paySign: a.paySign,
signType: a.signType || "SHA1"
}
}
function g(a, b, c) {
var d, e, f;
switch (delete b.err_code, delete b.err_desc, delete b.err_detail, d = b.errMsg, d || (d = b.err_msg, delete b.err_msg, d = h(a, d, c), b.errMsg = d), c = c || {}, c._complete && (c._complete(b), delete c._complete), d = b.errMsg || "", z.debug && !c.isInnerInvoke && alert(JSON.stringify(b)), e = d.indexOf(":"), f = d.substring(e + 1)) {
case"ok":
c.success && c.success(b);
break;
case"cancel":
c.cancel && c.cancel(b);
break;
default:
c.fail && c.fail(b)
}
c.complete && c.complete(b)
}
function h(a, b) {
var d, e, f, g;
if (b) {
switch (d = b.indexOf(":"), a) {
case o.config:
e = "config";
break;
case o.openProductSpecificView:
e = "openProductSpecificView";
break;
default:
e = b.substring(0, d), e = e.replace(/_/g, " "), e = e.replace(/\b\w+\b/g, function (a) {
return a.substring(0, 1).toUpperCase() + a.substring(1)
}), e = e.substring(0, 1).toLowerCase() + e.substring(1), e = e.replace(/ /g, ""), -1 != e.indexOf("Wcpay") && (e = e.replace("Wcpay", "WCPay")), f = p[e], f && (e = f)
}
g = b.substring(d + 1), "confirm" == g && (g = "ok"), "failed" == g && (g = "fail"), -1 != g.indexOf("failed_") && (g = g.substring(7)), -1 != g.indexOf("fail_") && (g = g.substring(5)), g = g.replace(/_/g, " "), g = g.toLowerCase(), ("access denied" == g || "no permission to execute" == g) && (g = "permission denied"), "config" == e && "function not exist" == g && (g = "ok"), b = e + ":" + g
}
return b
}
function i(a) {
var b, c, d, e;
if (a) {
for (b = 0, c = a.length; c > b; ++b)d = a[b], e = o[d], e && (a[b] = e);
return a
}
}
function j(a, b) {
if (!(!z.debug || b && b.isInnerInvoke)) {
var c = p[a];
c && (a = c), b && b._complete && delete b._complete, console.log('"' + a + '",', b || "")
}
}
function k() {
if (!("6.0.2" > w || y.systemType < 0)) {
var b = new Image;
y.appId = z.appId, y.initTime = x.initEndTime - x.initStartTime, y.preVerifyTime = x.preVerifyEndTime - x.preVerifyStartTime, C.getNetworkType({
isInnerInvoke: !0,
success: function (a) {
y.networkType = a.networkType;
var c = "https://open.weixin.qq.com/sdk/report?v=" + y.version + "&o=" + y.isPreVerifyOk + "&s=" + y.systemType + "&c=" + y.clientVersion + "&a=" + y.appId + "&n=" + y.networkType + "&i=" + y.initTime + "&p=" + y.preVerifyTime + "&u=" + y.url;
b.src = c
}
})
}
}
function l() {
return (new Date).getTime()
}
function m(b) {
t && (a.WeixinJSBridge ? b() : q.addEventListener && q.addEventListener("WeixinJSBridgeReady", b, !1))
}
function n() {
C.invoke || (C.invoke = function (b, c, d) {
a.WeixinJSBridge && WeixinJSBridge.invoke(b, e(c), d)
}, C.on = function (b, c) {
a.WeixinJSBridge && WeixinJSBridge.on(b, c)
})
}
var o, p, q, r, s, t, u, v, w, x, y, z, A, B, C;
if (!a.jWeixin)return o = {
config: "preVerifyJSAPI",
onMenuShareTimeline: "menu:share:timeline",
onMenuShareAppMessage: "menu:share:appmessage",
onMenuShareQQ: "menu:share:qq",
onMenuShareWeibo: "menu:share:weiboApp",
onMenuShareQZone: "menu:share:QZone",
previewImage: "imagePreview",
getLocation: "geoLocation",
openProductSpecificView: "openProductViewWithPid",
addCard: "batchAddCard",
openCard: "batchViewCard",
chooseWXPay: "getBrandWCPayRequest"
}, p = function () {
var b, a = {};
for (b in o)a[o[b]] = b;
return a
}(), q = a.document,
r = q.title,
s = navigator.userAgent.toLowerCase(), t = -1 != s.indexOf("micromessenger"), u = -1 != s.indexOf("android"), v = -1 != s.indexOf("iphone") || -1 != s.indexOf("ipad"), w = function () {
var a = s.match(/micromessenger\/(\d+\.\d+\.\d+)/) || s.match(/micromessenger\/(\d+\.\d+)/);
return a ? a[1] : ""
}(), x = {initStartTime: l(), initEndTime: 0, preVerifyStartTime: 0, preVerifyEndTime: 0}, y = {
version: 1,
appId: "",
initTime: 0,
preVerifyTime: 0,
networkType: "",
isPreVerifyOk: 1,
systemType: v ? 1 : u ? 2 : -1,
clientVersion: w,
url: encodeURIComponent(location.href)
}, z = {}, A = {_completes: []}, B = {state: 0, res: {}}, m(function () {
x.initEndTime = l()
}), C = {
config: function (a) {
z = a, j("config", a);
var b = z.check === !1 ? !1 : !0;
m(function () {
var a, d, e;
if (b)c(o.config, {verifyJsApiList: i(z.jsApiList)}, function () {
A._complete = function (a) {
x.preVerifyEndTime = l(), B.state = 1, B.res = a
}, A.success = function () {
y.isPreVerifyOk = 0
}, A.fail = function (a) {
A._fail ? A._fail(a) : B.state = -1
};
var a = A._completes;
return a.push(function () {
z.debug || k()
}), A.complete = function () {
for (var c = 0, d = a.length; d > c; ++c)a[c]();
A._completes = []
}, A
}()), x.preVerifyStartTime = l(); else {
for (B.state = 1, a = A._completes, d = 0, e = a.length; e > d; ++d)a[d]();
A._completes = []
}
}), z.beta && n()
}, ready: function (a) {
0 != B.state ? a() : (A._completes.push(a), !t && z.debug && a())
}, error: function (a) {
"6.0.2" > w || (-1 == B.state ? a(B.res) : A._fail = a)
}, checkJsApi: function (a) {
var b = function (a) {
var c, d, b = a.checkResult;
for (c in b)d = p[c], d && (b[d] = b[c], delete b[c]);
return a
};
c("checkJsApi", {jsApiList: i(a.jsApiList)}, function () {
return a._complete = function (a) {
if (u) {
var c = a.checkResult;
c && (a.checkResult = JSON.parse(c))
}
a = b(a)
}, a
}())
}, onMenuShareTimeline: function (a) {
d(o.onMenuShareTimeline, {
complete: function () {
c("shareTimeline", {
title: a.title || r,
desc: a.title || r,
img_url: a.imgUrl || "",
link: a.link || location.href
}, a)
}
}, a)
}, onMenuShareAppMessage: function (a) {
d(o.onMenuShareAppMessage, {
complete: function () {
c("sendAppMessage", {
title: a.title || r,
desc: a.desc || "",
link: a.link || location.href,
img_url: a.imgUrl || "",
type: a.type || "link",
data_url: a.dataUrl || ""
}, a)
}
}, a)
}, onMenuShareQQ: function (a) {
d(o.onMenuShareQQ, {
complete: function () {
c("shareQQ", {
title: a.title || r,
desc: a.desc || "",
img_url: a.imgUrl || "",
link: a.link || location.href
}, a)
}
}, a)
}, onMenuShareWeibo: function (a) {
d(o.onMenuShareWeibo, {
complete: function () {
c("shareWeiboApp", {
title: a.title || r,
desc: a.desc || "",
img_url: a.imgUrl || "",
link: a.link || location.href
}, a)
}
}, a)
}, onMenuShareQZone: function (a) {
d(o.onMenuShareQZone, {
complete: function () {
c("shareQZone", {
title: a.title || r,
desc: a.desc || "",
img_url: a.imgUrl || "",
link: a.link || location.href
}, a)
}
}, a)
}, startRecord: function (a) {
c("startRecord", {}, a)
}, stopRecord: function (a) {
c("stopRecord", {}, a)
}, onVoiceRecordEnd: function (a) {
d("onVoiceRecordEnd", a)
}, playVoice: function (a) {
c("playVoice", {localId: a.localId}, a)
}, pauseVoice: function (a) {
c("pauseVoice", {localId: a.localId}, a)
}, stopVoice: function (a) {
c("stopVoice", {localId: a.localId}, a)
}, onVoicePlayEnd: function (a) {
d("onVoicePlayEnd", a)
}, uploadVoice: function (a) {
c("uploadVoice", {localId: a.localId, isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1}, a)
}, downloadVoice: function (a) {
c("downloadVoice", {serverId: a.serverId, isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1}, a)
}, translateVoice: function (a) {
c("translateVoice", {localId: a.localId, isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1}, a)
}, chooseImage: function (a) {
c("chooseImage", {
scene: "1|2",
count: a.count || 9,
sizeType: a.sizeType || ["original", "compressed"],
sourceType: a.sourceType || ["album", "camera"]
}, function () {
return a._complete = function (a) {
if (u) {
var b = a.localIds;
b && (a.localIds = JSON.parse(b))
}
}, a
}())
}, previewImage: function (a) {
c(o.previewImage, {current: a.current, urls: a.urls}, a)
}, uploadImage: function (a) {
c("uploadImage", {localId: a.localId, isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1}, a)
}, downloadImage: function (a) {
c("downloadImage", {serverId: a.serverId, isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1}, a)
}, getNetworkType: function (a) {
var b = function (a) {
var c, d, e, b = a.errMsg;
if (a.errMsg = "getNetworkType:ok", c = a.subtype, delete a.subtype, c)a.networkType = c; else switch (d = b.indexOf(":"), e = b.substring(d + 1)) {
case"wifi":
case"edge":
case"wwan":
a.networkType = e;
break;
default:
a.errMsg = "getNetworkType:fail"
}
return a
};
c("getNetworkType", {}, function () {
return a._complete = function (a) {
a = b(a)
}, a
}())
}, openLocation: function (a) {
c("openLocation", {
latitude: a.latitude,
longitude: a.longitude,
name: a.name || "",
address: a.address || "",
scale: a.scale || 28,
infoUrl: a.infoUrl || ""
}, a)
}, getLocation: function (a) {
a = a || {}, c(o.getLocation, {type: a.type || "wgs84"}, function () {
return a._complete = function (a) {
delete a.type
}, a
}())
}, hideOptionMenu: function (a) {
c("hideOptionMenu", {}, a)
}, showOptionMenu: function (a) {
c("showOptionMenu", {}, a)
}, closeWindow: function (a) {
a = a || {}, c("closeWindow", {immediate_close: a.immediateClose || 0}, a)
}, hideMenuItems: function (a) {
c("hideMenuItems", {menuList: a.menuList}, a)
}, showMenuItems: function (a) {
c("showMenuItems", {menuList: a.menuList}, a)
}, hideAllNonBaseMenuItem: function (a) {
c("hideAllNonBaseMenuItem", {}, a)
}, showAllNonBaseMenuItem: function (a) {
c("showAllNonBaseMenuItem", {}, a)
}, scanQRCode: function (a) {
a = a || {}, c("scanQRCode", {
needResult: a.needResult || 0,
scanType: a.scanType || ["qrCode", "barCode"]
}, function () {
return a._complete = function (a) {
var b, c;
v && (b = a.resultStr, b && (c = JSON.parse(b), a.resultStr = c && c.scan_code && c.scan_code.scan_result))
}, a
}())
}, openProductSpecificView: function (a) {
c(o.openProductSpecificView, {pid: a.productId, view_type: a.viewType || 0}, a)
}, addCard: function (a) {
var e, f, g, h, b = a.cardList, d = [];
for (e = 0, f = b.length; f > e; ++e)g = b[e], h = {card_id: g.cardId, card_ext: g.cardExt}, d.push(h);
c(o.addCard, {card_list: d}, function () {
return a._complete = function (a) {
var c, d, e, b = a.card_list;
if (b) {
for (b = JSON.parse(b), c = 0, d = b.length; d > c; ++c)e = b[c], e.cardId = e.card_id, e.cardExt = e.card_ext, e.isSuccess = e.is_succ ? !0 : !1, delete e.card_id, delete e.card_ext, delete e.is_succ;
a.cardList = b, delete a.card_list
}
}, a
}())
}, chooseCard: function (a) {
c("chooseCard", {
app_id: z.appId,
location_id: a.shopId || "",
sign_type: a.signType || "SHA1",
card_id: a.cardId || "",
card_type: a.cardType || "",
card_sign: a.cardSign,
time_stamp: a.timestamp + "",
nonce_str: a.nonceStr
}, function () {
return a._complete = function (a) {
a.cardList = a.choose_card_info, delete a.choose_card_info
}, a
}())
}, openCard: function (a) {
var e, f, g, h, b = a.cardList, d = [];
for (e = 0, f = b.length; f > e; ++e)g = b[e], h = {card_id: g.cardId, code: g.code}, d.push(h);
c(o.openCard, {card_list: d}, a)
}, chooseWXPay: function (a) {
c(o.chooseWXPay, f(a), a)
}
}, b && (a.wx = a.jWeixin = C), C
}(window,!0);
export default window.wx;

595
node_modules/weixin-jsapi/jweixin-1.0.0.js generated vendored Normal file
View File

@ -0,0 +1,595 @@
!(function(a, b) {
"function" == typeof define && (define.amd || define.cmd)
? define(function() {
return b(a);
})
: b(a, !0);
})(this, function(a, b) {
function c(b, c, d) {
a.WeixinJSBridge
? WeixinJSBridge.invoke(b, e(c), function(a) {
g(b, a, d);
})
: j(b, d);
}
function d(b, c, d) {
a.WeixinJSBridge
? WeixinJSBridge.on(b, function(a) {
d && d.trigger && d.trigger(a), g(b, a, c);
})
: d ? j(b, d) : j(b, c);
}
function e(a) {
return (a = a || {}), (a.appId = E.appId), (a.verifyAppId = E.appId), (a.verifySignType = "sha1"), (a.verifyTimestamp = E.timestamp + ""), (a.verifyNonceStr = E.nonceStr), (a.verifySignature = E.signature), a;
}
function f(a) {
return {
timeStamp: a.timestamp + "",
nonceStr: a.nonceStr,
package: a.package,
paySign: a.paySign,
signType: a.signType || "SHA1"
};
}
function g(a, b, c) {
var d, e, f;
switch ((delete b.err_code, delete b.err_desc, delete b.err_detail, (d =
b.errMsg), d || ((d = b.err_msg), delete b.err_msg, (d = h(a, d)), (b.errMsg = d)), (c = c || {}), c._complete && (c._complete(b), delete c._complete), (d = b.errMsg || ""), E.debug && !c.isInnerInvoke && alert(JSON.stringify(b)), (e = d.indexOf(":")), (f = d.substring(e + 1)))) {
case "ok":
c.success && c.success(b);
break;
case "cancel":
c.cancel && c.cancel(b);
break;
default:
c.fail && c.fail(b);
}
c.complete && c.complete(b);
}
function h(a, b) {
var e, f, c = a, d = p[c];
return d &&
(c = d), (e = "ok"), b && ((f = b.indexOf(":")), (e = b.substring(f + 1)), "confirm" == e && (e = "ok"), "failed" == e && (e = "fail"), -1 != e.indexOf("failed_") && (e = e.substring(7)), -1 != e.indexOf("fail_") && (e = e.substring(5)), (e = e.replace(/_/g, " ")), (e = e.toLowerCase()), ("access denied" == e || "no permission to execute" == e) && (e = "permission denied"), "config" == c && "function not exist" == e && (e = "ok"), "" == e && (e = "fail")), (b = c + ":" + e);
}
function i(a) {
var b, c, d, e;
if (a) {
for ((b = 0), (c = a.length); c > b; ++b)
(d = a[b]), (e = o[d]), e && (a[b] = e);
return a;
}
}
function j(a, b) {
if (!(!E.debug || (b && b.isInnerInvoke))) {
var c = p[a];
c && (a = c), b && b._complete && delete b._complete, console.log(
'"' + a + '",',
b || ""
);
}
}
function k() {
0 != D.preVerifyState &&
(u ||
v ||
E.debug ||
"6.0.2" > z ||
D.systemType < 0 ||
A ||
((A = !0), (D.appId = E.appId), (D.initTime =
C.initEndTime - C.initStartTime), (D.preVerifyTime =
C.preVerifyEndTime - C.preVerifyStartTime), H.getNetworkType({
isInnerInvoke: !0,
success: function(a) {
var b, c;
(D.networkType = a.networkType), (b =
"http://open.weixin.qq.com/sdk/report?v=" +
D.version +
"&o=" +
D.preVerifyState +
"&s=" +
D.systemType +
"&c=" +
D.clientVersion +
"&a=" +
D.appId +
"&n=" +
D.networkType +
"&i=" +
D.initTime +
"&p=" +
D.preVerifyTime +
"&u=" +
D.url), (c = new Image()), (c.src = b);
}
})));
}
function l() {
return new Date().getTime();
}
function m(b) {
w &&
(a.WeixinJSBridge
? b()
: q.addEventListener &&
q.addEventListener("WeixinJSBridgeReady", b, !1));
}
function n() {
H.invoke ||
((H.invoke = function(b, c, d) {
a.WeixinJSBridge && WeixinJSBridge.invoke(b, e(c), d);
}), (H.on = function(b, c) {
a.WeixinJSBridge && WeixinJSBridge.on(b, c);
}));
}
var o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H;
if (!a.jWeixin)
return (o = {
config: "preVerifyJSAPI",
onMenuShareTimeline: "menu:share:timeline",
onMenuShareAppMessage: "menu:share:appmessage",
onMenuShareQQ: "menu:share:qq",
onMenuShareWeibo: "menu:share:weiboApp",
onMenuShareQZone: "menu:share:QZone",
previewImage: "imagePreview",
getLocation: "geoLocation",
openProductSpecificView: "openProductViewWithPid",
addCard: "batchAddCard",
openCard: "batchViewCard",
chooseWXPay: "getBrandWCPayRequest"
}), (p = (function() {
var b, a = {};
for (b in o)
a[o[b]] = b;
return a;
})()), (q = a.document), (r =
q.title), (s = navigator.userAgent.toLowerCase()), (t = navigator.platform.toLowerCase()), (u = !(!t.match(
"mac"
) && !t.match("win"))), (v = -1 != s.indexOf("wxdebugger")), (w =
-1 != s.indexOf("micromessenger")), (x = -1 != s.indexOf("android")), (y =
-1 != s.indexOf("iphone") || -1 != s.indexOf("ipad")), (z = (function() {
var a =
s.match(/micromessenger\/(\d+\.\d+\.\d+)/) ||
s.match(/micromessenger\/(\d+\.\d+)/);
return a ? a[1] : "";
})()), (A = !1), (B = !1), (C = {
initStartTime: l(),
initEndTime: 0,
preVerifyStartTime: 0,
preVerifyEndTime: 0
}), (D = {
version: 1,
appId: "",
initTime: 0,
preVerifyTime: 0,
networkType: "",
preVerifyState: 1,
systemType: y ? 1 : x ? 2 : -1,
clientVersion: z,
url: encodeURIComponent(location.href)
}), (E = {}), (F = { _completes: [] }), (G = {
state: 0,
data: {}
}), m(function() {
C.initEndTime = l();
}), (H = {
config: function(a) {
(E = a), j("config", a);
var b = E.check === !1 ? !1 : !0;
m(function() {
var a, d, e;
if (b)
c(
o.config,
{ verifyJsApiList: i(E.jsApiList) },
(function() {
(F._complete = function(a) {
(C.preVerifyEndTime = l()), (G.state = 1), (G.data = a);
}), (F.success = function() {
D.preVerifyState = 0;
}), (F.fail = function(a) {
F._fail ? F._fail(a) : (G.state = -1);
});
var a = F._completes;
return a.push(function() {
k();
}), (F.complete = function() {
for (var c = 0, d = a.length; d > c; ++c)
a[c]();
F._completes = [];
}), F;
})()
), (C.preVerifyStartTime = l());
else {
for (
(G.state = 1), (a = F._completes), (d = 0), (e = a.length);
e > d;
++d
)
a[d]();
F._completes = [];
}
}), E.beta && n();
},
ready: function(a) {
0 != G.state ? a() : (F._completes.push(a), !w && E.debug && a());
},
error: function(a) {
"6.0.2" > z ||
B ||
((B = !0), -1 == G.state ? a(G.data) : (F._fail = a));
},
checkJsApi: function(a) {
var b = function(a) {
var c, d, b = a.checkResult;
for (c in b)
(d = p[c]), d && ((b[d] = b[c]), delete b[c]);
return a;
};
c(
"checkJsApi",
{ jsApiList: i(a.jsApiList) },
(function() {
return (a._complete = function(a) {
if (x) {
var c = a.checkResult;
c && (a.checkResult = JSON.parse(c));
}
a = b(a);
}), a;
})()
);
},
onMenuShareTimeline: function(a) {
d(
o.onMenuShareTimeline,
{
complete: function() {
c(
"shareTimeline",
{
title: a.title || r,
desc: a.title || r,
img_url: a.imgUrl || "",
link: a.link || location.href,
type: a.type || "link",
data_url: a.dataUrl || ""
},
a
);
}
},
a
);
},
onMenuShareAppMessage: function(a) {
d(
o.onMenuShareAppMessage,
{
complete: function() {
c(
"sendAppMessage",
{
title: a.title || r,
desc: a.desc || "",
link: a.link || location.href,
img_url: a.imgUrl || "",
type: a.type || "link",
data_url: a.dataUrl || ""
},
a
);
}
},
a
);
},
onMenuShareQQ: function(a) {
d(
o.onMenuShareQQ,
{
complete: function() {
c(
"shareQQ",
{
title: a.title || r,
desc: a.desc || "",
img_url: a.imgUrl || "",
link: a.link || location.href
},
a
);
}
},
a
);
},
onMenuShareWeibo: function(a) {
d(
o.onMenuShareWeibo,
{
complete: function() {
c(
"shareWeiboApp",
{
title: a.title || r,
desc: a.desc || "",
img_url: a.imgUrl || "",
link: a.link || location.href
},
a
);
}
},
a
);
},
onMenuShareQZone: function(a) {
d(
o.onMenuShareQZone,
{
complete: function() {
c(
"shareQZone",
{
title: a.title || r,
desc: a.desc || "",
img_url: a.imgUrl || "",
link: a.link || location.href
},
a
);
}
},
a
);
},
startRecord: function(a) {
c("startRecord", {}, a);
},
stopRecord: function(a) {
c("stopRecord", {}, a);
},
onVoiceRecordEnd: function(a) {
d("onVoiceRecordEnd", a);
},
playVoice: function(a) {
c("playVoice", { localId: a.localId }, a);
},
pauseVoice: function(a) {
c("pauseVoice", { localId: a.localId }, a);
},
stopVoice: function(a) {
c("stopVoice", { localId: a.localId }, a);
},
onVoicePlayEnd: function(a) {
d("onVoicePlayEnd", a);
},
uploadVoice: function(a) {
c(
"uploadVoice",
{
localId: a.localId,
isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1
},
a
);
},
downloadVoice: function(a) {
c(
"downloadVoice",
{
serverId: a.serverId,
isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1
},
a
);
},
translateVoice: function(a) {
c(
"translateVoice",
{
localId: a.localId,
isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1
},
a
);
},
chooseImage: function(a) {
c(
"chooseImage",
{
scene: "1|2",
count: a.count || 9,
sizeType: a.sizeType || ["original", "compressed"],
sourceType: a.sourceType || ["album", "camera"]
},
(function() {
return (a._complete = function(a) {
if (x) {
var b = a.localIds;
b && (a.localIds = JSON.parse(b));
}
}), a;
})()
);
},
previewImage: function(a) {
c(o.previewImage, { current: a.current, urls: a.urls }, a);
},
uploadImage: function(a) {
c(
"uploadImage",
{
localId: a.localId,
isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1
},
a
);
},
downloadImage: function(a) {
c(
"downloadImage",
{
serverId: a.serverId,
isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1
},
a
);
},
getNetworkType: function(a) {
var b = function(a) {
var c, d, e, b = a.errMsg;
if (
((a.errMsg = "getNetworkType:ok"), (c =
a.subtype), delete a.subtype, c)
)
a.networkType = c;
else
switch (((d = b.indexOf(":")), (e = b.substring(d + 1)))) {
case "wifi":
case "edge":
case "wwan":
a.networkType = e;
break;
default:
a.errMsg = "getNetworkType:fail";
}
return a;
};
c(
"getNetworkType",
{},
(function() {
return (a._complete = function(a) {
a = b(a);
}), a;
})()
);
},
openLocation: function(a) {
c(
"openLocation",
{
latitude: a.latitude,
longitude: a.longitude,
name: a.name || "",
address: a.address || "",
scale: a.scale || 28,
infoUrl: a.infoUrl || ""
},
a
);
},
getLocation: function(a) {
(a = a || {}), c(
o.getLocation,
{ type: a.type || "wgs84" },
(function() {
return (a._complete = function(a) {
delete a.type;
}), a;
})()
);
},
hideOptionMenu: function(a) {
c("hideOptionMenu", {}, a);
},
showOptionMenu: function(a) {
c("showOptionMenu", {}, a);
},
closeWindow: function(a) {
(a = a || {}), c("closeWindow", {}, a);
},
hideMenuItems: function(a) {
c("hideMenuItems", { menuList: a.menuList }, a);
},
showMenuItems: function(a) {
c("showMenuItems", { menuList: a.menuList }, a);
},
hideAllNonBaseMenuItem: function(a) {
c("hideAllNonBaseMenuItem", {}, a);
},
showAllNonBaseMenuItem: function(a) {
c("showAllNonBaseMenuItem", {}, a);
},
scanQRCode: function(a) {
(a = a || {}), c(
"scanQRCode",
{
needResult: a.needResult || 0,
scanType: a.scanType || ["qrCode", "barCode"]
},
(function() {
return (a._complete = function(a) {
var b, c;
y &&
((b = a.resultStr), b &&
((c = JSON.parse(b)), (a.resultStr =
c && c.scan_code && c.scan_code.scan_result)));
}), a;
})()
);
},
openProductSpecificView: function(a) {
c(
o.openProductSpecificView,
{ pid: a.productId, view_type: a.viewType || 0, ext_info: a.extInfo },
a
);
},
addCard: function(a) {
var e, f, g, h, b = a.cardList, d = [];
for ((e = 0), (f = b.length); f > e; ++e)
(g = b[e]), (h = { card_id: g.cardId, card_ext: g.cardExt }), d.push(
h
);
c(
o.addCard,
{ card_list: d },
(function() {
return (a._complete = function(a) {
var c, d, e, b = a.card_list;
if (b) {
for ((b = JSON.parse(b)), (c = 0), (d = b.length); d > c; ++c)
(e = b[c]), (e.cardId = e.card_id), (e.cardExt =
e.card_ext), (e.isSuccess = e.is_succ
? !0
: !1), delete e.card_id, delete e.card_ext, delete e.is_succ;
(a.cardList = b), delete a.card_list;
}
}), a;
})()
);
},
chooseCard: function(a) {
c(
"chooseCard",
{
app_id: E.appId,
location_id: a.shopId || "",
sign_type: a.signType || "SHA1",
card_id: a.cardId || "",
card_type: a.cardType || "",
card_sign: a.cardSign,
time_stamp: a.timestamp + "",
nonce_str: a.nonceStr
},
(function() {
return (a._complete = function(a) {
(a.cardList = a.choose_card_info), delete a.choose_card_info;
}), a;
})()
);
},
openCard: function(a) {
var e, f, g, h, b = a.cardList, d = [];
for ((e = 0), (f = b.length); f > e; ++e)
(g = b[e]), (h = { card_id: g.cardId, code: g.code }), d.push(h);
c(o.openCard, { card_list: d }, a);
},
chooseWXPay: function(a) {
c(o.chooseWXPay, f(a), a);
}
}), b && (a.wx = a.jWeixin = H), H;
});

24
node_modules/weixin-jsapi/package.json generated vendored Normal file
View File

@ -0,0 +1,24 @@
{
"name": "weixin-jsapi",
"version": "1.1.0",
"description": "微信官方 js-sdk es6 版本",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jerexyz/weixin-jssdk.git"
},
"keywords": [
"weixin",
"wechat",
"jssdk"
],
"author": "jere",
"license": "MIT",
"bugs": {
"url": "https://github.com/jerexyz/weixin-jssdk/issues"
},
"homepage": "https://github.com/jerexyz/weixin-jssdk#readme"
}