| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- import App from './App'
- import messages from './locale/index'
- // 引入全局方法
- import {http} from '@/utils/request';
- import mytool from '@/utils/tool';
- // 挂载全局自定义方法
- Vue.prototype.$http = http;
- Vue.prototype.$mytool = mytool;
- Vue.prototype.$baseImagurl = 'https://backend.awayqtw.com/prod-api';//生产环境
- Vue.prototype.$upImagurl = 'http://108.61.127.24:8080';//生产环境
- //Vue.prototype.$baseImagurl = ' http://192.168.1.242:8080';//调试环境
- Vue.prototype.$formPr = function(price){
-
- var number = '0';
- var type = typeof(price);
- if(type=='string'){
- number = price
- }
- if(type=='number'){
- number = price.toString(); // 确保输入是字符串
- }
- const pattern = /(-?\d+)(\d{3})/;
- while (pattern.test(number)) {
- number = number.replace(pattern, "$1,$2");
- }
- return number;
-
- if(price%1000==0){
- return price;//price/1000+'k'
- }
- else{
- return price;
- }
- };
- let i18nConfig = {
- locale: uni.getLocale(),
- messages
- }
- // #ifndef VUE3
- import Vue from 'vue'
- import VueI18n from 'vue-i18n'
- Vue.use(VueI18n)
- const i18n = new VueI18n(i18nConfig)
- Vue.config.productionTip = false
- App.mpType = 'app'
- const app = new Vue({
- i18n,
- ...App
- })
- app.$mount()
- // #endif
- // #ifdef VUE3
- import { createSSRApp } from 'vue'
- import { createI18n } from 'vue-i18n'
- const i18n = createI18n(i18nConfig)
- export function createApp() {
- const app = createSSRApp(App)
- app.use(i18n)
- return {
- app
- }
- }
- // #endif
|