| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 | 
							- <script>
 
- 	import {
 
- 		mapState,
 
- 		mapMutations
 
- 	} from 'vuex'
 
- 	export default {
 
- 		data() {
 
- 			return {
 
- 				show: false,
 
- 				content: '东临碣石,以观沧海',
 
- 				lang:""
 
- 			}
 
- 		},
 
- 		// 此处globalData为了演示其作用,不是uView框架的一部分
 
- 		computed: {
 
- 			...mapState(['hasLogin'])
 
- 		},
 
- 		globalData: {
 
- 			username: '白居易'
 
- 		},
 
- 		methods: {
 
- 			...mapMutations(['login'])
 
- 		},
 
- 		created() {
 
- 			const storeInfo = uni.getStorageSync("storeInfo") || "";
 
- 			if (storeInfo) {
 
- 				uni.getStorage({
 
- 					key: "storeInfo",
 
- 					success: (res) => {
 
- 						this.login(res.data)
 
- 						this.$u.route({
 
- 							url: 'pages/home/index',
 
- 							type: 'switchTab',
 
- 						})
 
- 					},
 
- 				})
 
- 			} else {
 
- 				this.$u.route({
 
- 					url: "pages/login/index",
 
- 					type: "redirect"
 
- 				})
 
- 			}
 
- 			let _this=this
 
- 			uni.getStorage({
 
- 				key: "lang",
 
- 				success:e=>{
 
- 					if(e.data){
 
- 						this.$i18n.locale = e.data
 
- 					}
 
- 				}
 
- 			})
 
- 		},
 
- 		// onLaunch() {
 
- 		// 	this.$u.route({
 
- 		// 		url: 'pages/login/upgrade'
 
- 		// 	})
 
- 		// 	// 1.1.0版本之前关于http拦截器代码,已平滑移动到/common/http.interceptor.js中
 
- 		// 	// 注意,需要在/main.js中实例化Vue之后引入如下(详见文档说明):
 
- 		// 	// import httpInterceptor from '@/common/http.interceptor.js'
 
- 		// 	// Vue.use(httpInterceptor, app)
 
- 		// },
 
- 		onShow() {}
 
- 	}
 
- </script>
 
- <style lang="scss">
 
- 	@import "uview-ui/index.scss";
 
- 	@import "common/demo.scss";
 
- 	/*每个页面公共css */
 
- 	// uni-page-head
 
- 	//     {
 
- 	//         display: none;
 
- 	//     }
 
- 	.u-checkbox__label[data-v-54acf820] {
 
- 		color: #B2B2B2 !important;
 
- 	}
 
- 	.uni-input-placeholder {
 
- 		color: #B2B2B2 !important;
 
- 	}
 
- 	page {
 
- 		background-color: #F4F4F4;
 
- 		font-weight: 500;
 
- 	}
 
- 	.u-skeleton {
 
- 		height: 100%;
 
- 	}
 
- 	.u-action[data-v-4c556b40]{
 
- 		color: #FFFFFF !important;
 
- 	}
 
- </style>
 
 
  |