Эх сурвалжийг харах

fix:屏蔽多语言解决主包超过2mb问题

jinchaoyu 1 жил өмнө
parent
commit
1f86831b1c

+ 7 - 3
pages/users/wechat_login/index.vue

@@ -27,10 +27,10 @@
 				您的公开信息 (昵称、头像)
 			</view>
 
-			<button class="now"  open-type="getPhoneNumber" hover-class="none" @getphonenumber="getPhoneNumber" >
+			<button class="now" open-type="getPhoneNumber" hover-class="none" @getphonenumber="getPhoneNumber">
 				使用微信权限登录
 			</button>
-			<button class="not_now">
+			<button class="not_now" @click="cancelLogin">
 				暂不登录
 			</button>
 		</view>
@@ -185,7 +185,11 @@ export default {
 				this.isPhoneBox = false;
 			}
 		},
-
+		cancelLogin () {
+			uni.switchTab({
+				url: '/pages/index/index'
+			})
+		},
 		getPhoneNumber (e) {
 			let _this = this;
 			console.log(e)

+ 19 - 19
utils/lang.js

@@ -1,29 +1,20 @@
-import en_us from '../lang/en_us.json'
+// import en_us from '../lang/en_us.json'
 import zh_cn from '../lang/zh_cn.json'
-import fr_fr from '../lang/fr_fr.json'
-import th_th from '../lang/th_th.json'
-import ja_jp from '../lang/ja_jp.json'
-import it_it from '../lang/it_it.json'
-import ko_kr from '../lang/ko_kr.json'
-import mn_mn from '../lang/mn_mn.json'
-import vi_vn from '../lang/vi_vn.json'
-import zh_ft from '../lang/zh_ft.json'
+// import fr_fr from '../lang/fr_fr.json'
+// import th_th from '../lang/th_th.json'
+// import ja_jp from '../lang/ja_jp.json'
+// import it_it from '../lang/it_it.json'
+// import ko_kr from '../lang/ko_kr.json'
+// import mn_mn from '../lang/mn_mn.json'
+// import vi_vn from '../lang/vi_vn.json'
+// import zh_ft from '../lang/zh_ft.json'
 import Vue from 'vue'; 
 import VueI18n from 'vue-i18n'
 
 
 Vue.use(VueI18n)
 let langJson = {
-		'en_us': en_us,
 		'zh_cn': zh_cn,
-		'fr_fr': fr_fr,
-		'th_th': th_th,
-		'ja_jp': ja_jp,
-		'it_it': it_it,
-		'ko_kr': ko_kr,
-		'mn_mn': mn_mn,
-		'vi_vn': vi_vn,
-		'zh_ft': zh_ft,
 	}
 let lang = '';
 // #ifdef MP || APP-PLUS
@@ -33,7 +24,16 @@ lang = uni.getStorageSync('locale') != '' ? uni.getStorageSync('locale') : 'zh_c
 lang = uni.getStorageSync('locale') != '' ? uni.getStorageSync('locale') : navigator.language.toLowerCase().replace('-','_');
 // #endif
 const i18n = new VueI18n({
-	locale: lang in langJson ? lang :'en_us',
+	locale: lang in langJson ? lang :'zh_cn',
 	messages: langJson
 })
+
+//import i18n from './lang.js';
+// const i18n = {
+// 		t:function(key){
+// 			return key
+// 		}
+// 	}
+
+
 export default i18n