acdr-ui/dist/build/mp-weixin/modules/mall/sheep/platform/index.js

2 lines
1.2 KiB
JavaScript
Raw Normal View History

2024-10-01 09:15:35 +08:00
"use strict";const e=require("../../../../common/vendor.js"),t=require("./provider/wechat/index.js"),r=require("./provider/apple/index.js"),n=require("./share.js"),o=require("./pay.js"),a=e.index.getSystemInfoSync(),i=a.platform;let s="",c="",l="";s="WechatMiniProgram",l="miniProgram",c="wechat",e.isEmpty(s)&&e.index.showToast({title:"暂不支持该平台",icon:"none"});const h=(e="")=>(""===e&&(e=c),"wechat"===e?t.wechat:"apple"===e?r.apple:void 0);const p=(()=>{let t=e.index.getMenuButtonBoundingClientRect();return t||(t={bottom:56,height:32,left:278,right:365,top:24,width:87}),t})(),d=a.statusBarHeight+44;const u={name:s,device:a,os:i,provider:c,platform:"miniProgram",useProvider:h,checkUpdate:(e=!1)=>{h().checkUpdate(e)},checkNetwork:function(){return t=this,r=null,n=function*(){return"none"==(yield e.index.getNetworkType()).networkType?Promise.resolve(!1):Promise.resolve(!0)},new Promise(((e,o)=>{var a=e=>{try{s(n.next(e))}catch(t){o(t)}},i=e=>{try{s(n.throw(e))}catch(t){o(t)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(a,i);s((n=n.apply(t,r)).next())}));var t,r,n},pay:(e,t,r)=>new o.SheepPay(e,t,r),share:n.$share,load:()=>{t.wechat.load()},capsule:p,navbar:d,landingPage:"",isWechatInstalled:!0};exports._platform=u;