1234567891011121314151617181920212223242526272829303132333435363738 |
- "use strict";
- const common_vendor = require("../common/vendor.js");
- const services_ams = require("../services/ams.js");
- const getNavTop = () => {
- let windowWidth = common_vendor.wx$1.getSystemInfoSync().windowWidth;
- const statusBarHeight = common_vendor.wx$1.getSystemInfoSync().statusBarHeight;
- const menuButton = common_vendor.wx$1.getMenuButtonBoundingClientRect();
- (menuButton.height + (menuButton.top - statusBarHeight) * 2) * (750 / windowWidth);
- const navTop = statusBarHeight * (750 / windowWidth);
- return navTop;
- };
- const getActivityData = () => {
- const appid = common_vendor.index.getStorageSync("appid");
- let isAuth = false;
- services_ams.getActivity(appid).then((res) => {
- const data = res.data[0] || {};
- common_vendor.index.setStorageSync("activityData", JSON.stringify(data));
- }).catch((err) => {
- console.log(err);
- });
- return isAuth;
- };
- const getMobile = (code) => {
- services_ams.getPhoneNumberInfo(code).then((res) => {
- common_vendor.index.setStorageSync("phone", res.data);
- });
- };
- const isGetPhone = () => {
- const data = JSON.parse(common_vendor.index.getStorageSync("activityData")) || {};
- const authCheck = (data == null ? void 0 : data.authCheck.split(",")) || [];
- const isCheck = authCheck.includes("1");
- const isPhone = common_vendor.index.getStorageSync("phone") ? true : false;
- return isCheck && isPhone;
- };
- exports.getActivityData = getActivityData;
- exports.getMobile = getMobile;
- exports.getNavTop = getNavTop;
- exports.isGetPhone = isGetPhone;
|