1 |
- "use strict";const t=require("../common/vendor.js"),e=require("../services/ams.js"),n=t.index.getWindowInfo(),o=()=>n.statusBarHeight;exports.getActivityData=()=>{const n=t.index.getStorageSync("appid");return e.getActivity(n).then((e=>{const n=e.data[0]||{};t.index.setStorageSync("activityData",JSON.stringify(n))})).catch((t=>{console.log(t)})),!1},exports.getMobile=async(n,o)=>{const i={code:n,appid:t.index.getStorageSync("appid")},a=await e.getPhoneNumberInfo(i);try{return 200===a.code?(t.index.setStorageSync("phone",a.data),o&&t.index.navigateTo({url:o})):t.index.showToast({title:"获取手机号失败",icon:"none"}),a.data}catch(r){t.index.showToast({title:"获取手机号失败",icon:"none"})}},exports.getNavBarPaddingTop=()=>{if(t.index.getMenuButtonBoundingClientRect){let{top:e,height:n}=t.index.getMenuButtonBoundingClientRect();return n+(e-o())}return 0},exports.getNavTop=()=>{let e=t.wx$1.getSystemInfoSync().windowWidth;const n=t.wx$1.getSystemInfoSync().statusBarHeight,o=t.wx$1.getMenuButtonBoundingClientRect();o.height,o.top;return n*(750/e)},exports.getStatusBarHeight=o,exports.isGetPhone=()=>{const e=JSON.parse(t.index.getStorageSync("activityData"))||{},n=((null==e?void 0:e.authCheck.split(","))||[]).includes("1"),o=!!t.index.getStorageSync("phone");return n&&o};
|