You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
120 lines
2.8 KiB
120 lines
2.8 KiB
<style lang="scss">
|
|
@import "uview-ui/index.scss";
|
|
</style>
|
|
|
|
<script>
|
|
export default {
|
|
computed: {
|
|
i18n() {
|
|
return this.$t('index')
|
|
},
|
|
},
|
|
onLaunch: function() {
|
|
this.appVersion()
|
|
this.getIp();
|
|
console.log('App Launch')
|
|
|
|
},
|
|
onShow: function() {
|
|
|
|
console.log('App Show')
|
|
},
|
|
onHide: function() {
|
|
console.log('App Hide')
|
|
},
|
|
methods: {
|
|
async getIp() {
|
|
let param = {
|
|
'key': 'is_ban_china'
|
|
}
|
|
|
|
try {
|
|
const response = await this.$api.getConfig(param);
|
|
if (response.data.value == 'Y') {
|
|
const response2 = await this.$api.checkIp();
|
|
if (response2.data.country == '中国') {
|
|
uni.showModal({
|
|
content: this.i18n.mainInfo,
|
|
showCancel: false,
|
|
confirmText: this.i18n.Confirm, //这块是确定按钮的文字
|
|
success: function(res) {
|
|
if (res.confirm) {
|
|
// #ifdef APP-PLUS
|
|
plus.runtime.quit();
|
|
// #endif
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
} catch (e) {
|
|
console.log(e)
|
|
|
|
}
|
|
},
|
|
|
|
async appVersion() {
|
|
let param = {
|
|
'appId': uni.getSystemInfoSync().platform
|
|
}
|
|
console.log('ss' + JSON.stringify(uni.getSystemInfoSync()))
|
|
const response = await this.$api.versionUpgrade(param)
|
|
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
|
|
console.log('当前版本号' + wgtinfo.versionCode)
|
|
|
|
console.log((wgtinfo.versionCode < response.data.versionId))
|
|
console.log(wgtinfo.versionCode , response.data.versionId)
|
|
if (wgtinfo.versionCode < response.data.versionId) {
|
|
console.log('更新了吗')
|
|
let that=this;
|
|
uni.showModal({
|
|
title: that.i18n.updateTitle,
|
|
content: that.i18n.updateMsg,
|
|
confirmText: that.i18n.Confirm,//这块是确定按钮的文字
|
|
showCancel: false,
|
|
success: function (res) {
|
|
if (res.confirm) {
|
|
plus.runtime.openURL(response.data.appUrl);
|
|
}
|
|
}
|
|
});
|
|
|
|
}
|
|
});
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
|
|
button::after {
|
|
border: none;
|
|
}
|
|
|
|
|
|
|
|
|
|
uni-tabbar {
|
|
.uni-tabbar { // tab背景
|
|
padding-top:28rpx;
|
|
padding-bottom: 30rpx !important;
|
|
background-image: linear-gradient(to top, #FAF8F8, #FFFFFF)!important; // tab背景图片或者渐变色,背景色和背景图片最多选择一个进行设置
|
|
.uni-tabbar-border { // tabBar上边框
|
|
background-color: #F7F4F4!important; // tabBar上边框的颜色
|
|
}
|
|
.uni-tabbar__bd { // tabBar单项
|
|
.uni-tabbar__icon { // 图标
|
|
width: 48rpx!important;
|
|
height: 48rpx!important;
|
|
}
|
|
.uni-tabbar__label { // 文字
|
|
font-size: 20rpx!important;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
|