5 Star 46 Fork 33

Silently9527/mall-coupons

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
app.js 1.83 KB
一键复制 编辑 原始数据 按行查看 历史
Wu Tian Qiang 提交于 2021-01-28 22:16 . Initial commit
import Vue from 'vue'
export default {
initTitleNav() {
uni.getSystemInfo({
success: function (e) {
// #ifndef MP
Vue.prototype.StatusBar = e.statusBarHeight;
if (e.platform === 'android') {
Vue.prototype.CustomBar = e.statusBarHeight + 50;
} else {
Vue.prototype.CustomBar = e.statusBarHeight + 45;
}
// #endif
// #ifdef MP-WEIXIN
Vue.prototype.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
// #endif
// #ifdef MP-ALIPAY
// Vue.prototype.StatusBar = e.statusBarHeight;
// Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
// #endif
// #ifdef MP-QQ
Vue.prototype.StatusBar = e.statusBarHeight;
let customQQ = qq.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = customQQ;
Vue.prototype.CustomBar = customQQ.bottom + customQQ.top - e.statusBarHeight;
if (e.model.indexOf("iPhone X") > -1) {
Vue.prototype.CustomBar = 82;
} else {
Vue.prototype.CustomBar = 60;
}
// #endif
// #ifdef MP-TOUTIAO
// Vue.prototype.StatusBar = e.statusBarHeight;
// let customTT = tt.getMenuButtonBoundingClientRect();
// Vue.prototype.Custom = customTT;
// Vue.prototype.CustomBar = customTT.bottom + customTT.top - e.statusBarHeight
// #endif
}
})
},
initShareMenu() {
// #ifdef MP-WEIXIN
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
// #endif
// #ifdef MP-QQ
uni.showShareMenu({
withShareTicket: true
})
// #endif
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/silently9527/mall-coupons.git
git@gitee.com:silently9527/mall-coupons.git
silently9527
mall-coupons
mall-coupons
master

搜索帮助