magicsound/unpackage/dist/dev/mp-weixin/pages/me/mepage.js
2024-09-20 16:01:42 +08:00

59 lines
1.7 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
data() {
var dataList = [1, 2, 3, 4, 5, 6];
return {
systemBarHeight: 0,
subtractedHeight: 0,
dataList
};
},
onLoad() {
this.getStatusBarHeight();
this.getSubtractedHeight();
},
methods: {
// 获取状态栏高度的方法
getStatusBarHeight: function() {
var that = this;
common_vendor.index.getSystemInfo({
success: function(res) {
that.systemBarHeight = res.statusBarHeight;
}
});
},
getSubtractedHeight() {
const systemInfo = common_vendor.index.getSystemInfoSync();
systemInfo.screenWidth;
const windowHeight = systemInfo.windowHeight;
console.log("windowHeight", windowHeight);
this.subtractedHeight = windowHeight;
console.log("subtractedHeight", this.subtractedHeight);
},
toRecharge() {
common_vendor.index.navigateTo({
url: "/pages/recharge/RechargePage"
});
},
toSet() {
common_vendor.index.navigateTo({
url: "/pages/me/SettingPage"
});
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.o(($event) => $options.toSet()),
b: $data.systemBarHeight + "px",
c: common_vendor.o(($event) => $options.toRecharge()),
d: common_vendor.f($data.dataList, (item, index, i0) => {
return {};
}),
e: common_vendor.s("paddingTop: " + $data.systemBarHeight + "px; height:" + $data.subtractedHeight + "px")
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "F:/gitCode/uniapp/magicsound/pages/me/mepage.vue"]]);
wx.createPage(MiniProgramPage);