|
@@ -1,42 +1,14 @@
|
|
<script>
|
|
<script>
|
|
-import Vue from 'vue'
|
|
|
|
|
|
+import tool from "./utils/tool";
|
|
export default {
|
|
export default {
|
|
onLaunch: function () {
|
|
onLaunch: function () {
|
|
- Vue.prototype.cutoff = (msg, title = "", mask = false, exitTime = 0, icon = 'none', duration = 2000,) => {
|
|
|
|
- if (msg != '成功' || title) wx.showToast({
|
|
|
|
- title: msg == '成功' ? title : msg,
|
|
|
|
- duration,
|
|
|
|
- icon,
|
|
|
|
- mask: mask || exitTime,
|
|
|
|
- })
|
|
|
|
- if (exitTime && msg == '成功') setTimeout(uni.navigateBack, exitTime)
|
|
|
|
- return msg != '成功';
|
|
|
|
- };
|
|
|
|
- Vue.prototype.tovw = (num) => (num * 100 / 375).toFixed(3) + "vw";
|
|
|
|
- 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
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ tool.setBar();
|
|
|
|
+ tool.mount();
|
|
},
|
|
},
|
|
onShow: function () {
|
|
onShow: function () {
|
|
|
|
+ this.getLocation().then(res => {
|
|
|
|
+ uni.setStorageSync("location", res)
|
|
|
|
+ })
|
|
},
|
|
},
|
|
onHide: function () {
|
|
onHide: function () {
|
|
}
|
|
}
|
|
@@ -47,7 +19,7 @@ export default {
|
|
@import "@/uni_modules/uview-ui/index.scss";
|
|
@import "@/uni_modules/uview-ui/index.scss";
|
|
@import "colorui/main.css";
|
|
@import "colorui/main.css";
|
|
@import "colorui/icon.css";
|
|
@import "colorui/icon.css";
|
|
-/* 你的项目css */
|
|
|
|
|
|
+
|
|
@import "uni.scss";
|
|
@import "uni.scss";
|
|
@import "static/iconfont/iconfont.css";
|
|
@import "static/iconfont/iconfont.css";
|
|
</style>
|
|
</style>
|