Files
xk-doctor-wx/main.js
李琦 158ffd9e6e feat: 完善公账锁店流程,静态图改走 OSS
强化公账锁店页与首页横幅入口,支持声明已支付与催办;
代付二维码与 base64 工具抽到公共组件;本地 static 大图改为 OSS 引用。
2026-08-21 12:52:09 +08:00

100 lines
2.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import App from './App'
import {
addStyle,
navbarHeight,
m_by_checkID,
getAge
} from '@/common/js/util.js'
// 引入uView主JS库
import uView from "uview-ui";
import timeFormatIOSFix from '@/common/js/timeFormat.js'
import store from './store';
import share from '@/common/share.js'
import { staticOss } from '@/utils/staticOss.js'
Vue.mixin(share)
Vue.use(uView);
// 覆盖 uView 的 timeFormat / date修复 iOS 下 `yyyy-MM-dd HH:mm:ss` 无法解析
if (uni && uni.$u) {
uni.$u.timeFormat = timeFormatIOSFix
uni.$u.date = timeFormatIOSFix
}
let systemInfo = uni.getSystemInfoSync();
const $d = {
addStyle,
navbarHeight,
sys: systemInfo,
getAge
}
Vue.prototype.$toast = (title='', icon = 'none',duration=1500) => {
uni.showToast({
icon,
title,
duration
})
}
Vue.prototype.$go = (url, type = 0) => {
let userInfo = uni.getStorageSync('userInfo') || true;
const whitelist = ['pages', 'pharmacist_setInfo','workbench_succeed']
if (type!=4&&!whitelist.find(item => url.includes(item)) && userInfo && userInfo.status <= 1) {
Vue.prototype.$toast('资质审核通过后可开通')
return
}
let way = 'navigateTo';
switch (type) {
case 0:
way = 'navigateTo';
break;
case 1:
way = 'redirectTo';
break;
case 2:
way = 'reLaunch';
break;
case 3:
way = 'switchTab';
break;
case 4:
way = 'navigateBack';
break;
}
type == 4 ? uni.navigateBack(url) : uni[way]({
url: url,
fail: (e) => {
console.log(e);
}
})
}
// $d挂载到uni对象上
uni.$d = $d
Vue.prototype.$statusBarHeight = systemInfo.statusBarHeight
Vue.prototype.$d = $d
Vue.prototype.$navbarHeight = uni.$d.navbarHeight()
Vue.prototype.$windowHeight = systemInfo.windowHeight
Vue.prototype.$screenHeight = systemInfo.screenHeight
Vue.prototype.$checkID = m_by_checkID
Vue.prototype.$staticOss = staticOss
Vue.prototype.$male = staticOss('image/nan.png')
Vue.prototype.$girl = staticOss('image/nv.png')
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
store,
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import {
createSSRApp
} from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif