| | |
| | | "use strict"; |
| | | const common_vendor = require("../../common/vendor.js"); |
| | | const common_assets = require("../../common/assets.js"); |
| | | const api_index = require("../../api/index.js"); |
| | | const _sfc_main = { |
| | | __name: "index", |
| | | setup(__props) { |
| | | const topHeight = common_vendor.ref(0); |
| | | const isVip = common_vendor.ref(false); |
| | | function navToAddCard() { |
| | | common_vendor.index.navigateTo({ |
| | | url: "/pages/addCard/index" |
| | | }); |
| | | } |
| | | const functionList = common_vendor.ref([ |
| | | { text: "余额记录", icon: "../../static/images/index/icon31.png", url: "/pages/balanceRecord/index" }, |
| | | { text: "消费记录", icon: "../../static/images/index/icon32.png", url: "/pages/login/index" }, |
| | | { text: "充值记录", icon: "../../static/images/index/icon33.png", url: "/pages/login/index" }, |
| | | { text: "账户共享", icon: "../../static/images/index/icon34.png", url: "/pages/login/index" }, |
| | | { text: "优惠卷", icon: "../../static/images/index/icon35.png", url: "/pages/login/index" }, |
| | | { text: "电子发票", icon: "../../static/images/index/icon36.png", url: "/pages/login/index" }, |
| | | { text: "联系客服", icon: "../../static/images/index/icon37.png", url: "/pages/login/index" }, |
| | | { text: "推广分佣", icon: "../../static/images/index/icon38.png", url: "/pages/login/index" } |
| | | ]); |
| | | function navTo(itemUrl) { |
| | | common_vendor.index.navigateTo({ |
| | | url: itemUrl |
| | | }); |
| | | } |
| | | common_vendor.onMounted(() => { |
| | | function getTopHeight() { |
| | | if (common_vendor.index.getMenuButtonBoundingClientRect) { |
| | | topHeight.value = (common_vendor.index.getMenuButtonBoundingClientRect().top + common_vendor.index.getMenuButtonBoundingClientRect().height) * 2; |
| | | } |
| | | } |
| | | const vipInfo = common_vendor.ref(); |
| | | const isVip = common_vendor.ref(false); |
| | | async function getVipInfo() { |
| | | let res = await api_index.getUserInfo(); |
| | | if (res.data.userInfo.waterCardNumber) { |
| | | let res1 = await api_index.getVipInfoApi(); |
| | | vipInfo.value = res1.data; |
| | | isVip.value = true; |
| | | } else { |
| | | isVip.value = false; |
| | | } |
| | | } |
| | | const functionList = common_vendor.ref([ |
| | | { text: "余额记录", icon: "../../static/images/index/icon31.png", url: "/pages/balanceRecord/index" }, |
| | | { text: "消费记录", icon: "../../static/images/index/icon32.png", url: "" }, |
| | | { text: "充值记录", icon: "../../static/images/index/icon33.png", url: "" }, |
| | | { text: "账户共享", icon: "../../static/images/index/icon34.png", url: "" }, |
| | | { text: "优惠卷", icon: "../../static/images/index/icon35.png", url: "" }, |
| | | { text: "电子发票", icon: "../../static/images/index/icon36.png", url: "" }, |
| | | { text: "联系客服", icon: "../../static/images/index/icon37.png", url: "" }, |
| | | { text: "推广分佣", icon: "../../static/images/index/icon38.png", url: "" } |
| | | ]); |
| | | function navTo(itemUrl) { |
| | | if (itemUrl) { |
| | | common_vendor.index.navigateTo({ |
| | | url: itemUrl |
| | | }); |
| | | } |
| | | } |
| | | common_vendor.onMounted(async () => { |
| | | getTopHeight(); |
| | | await getVipInfo(); |
| | | }); |
| | | return (_ctx, _cache) => { |
| | | return common_vendor.e({ |
| | |
| | | }, isVip.value ? { |
| | | b: common_assets._imports_0$1 |
| | | } : { |
| | | c: common_assets._imports_1 |
| | | c: common_assets._imports_1, |
| | | d: common_vendor.o(($event) => navTo("/pages/addCard/index")) |
| | | }, { |
| | | d: common_assets._imports_2, |
| | | e: common_assets._imports_3, |
| | | f: common_vendor.o(($event) => navToAddCard()), |
| | | e: common_assets._imports_2, |
| | | f: common_assets._imports_3, |
| | | g: topHeight.value + "rpx", |
| | | h: common_assets._imports_4, |
| | | i: common_assets._imports_5, |
| | | j: common_vendor.f(functionList.value, (item, index, i0) => { |
| | | i: common_vendor.o(($event) => navTo("/pages/sendWater/index")), |
| | | j: common_vendor.o(($event) => navTo("/pages/recharge/index")), |
| | | k: common_assets._imports_5, |
| | | l: common_vendor.f(functionList.value, (item, index, i0) => { |
| | | return { |
| | | a: item.icon, |
| | | b: common_vendor.t(item.text), |
| | |
| | | d: index |
| | | }; |
| | | }), |
| | | k: common_assets._imports_6, |
| | | l: common_assets._imports_7, |
| | | m: common_assets._imports_8, |
| | | n: common_assets._imports_9, |
| | | o: common_assets._imports_8 |
| | | m: common_assets._imports_6, |
| | | n: common_assets._imports_7, |
| | | o: common_assets._imports_8, |
| | | p: common_assets._imports_9, |
| | | q: common_assets._imports_8 |
| | | }); |
| | | }; |
| | | } |