-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
980 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<script> | ||
import request from '@/util/request.js'; | ||
export default { | ||
globalData: { | ||
site_url:'https://dj.sdwanyue.com', //网站域名 | ||
navHeight:0,//导航栏高度 | ||
userInfo:'',//用户信息 | ||
configInfo:[],//配置信息 | ||
front_auth: [], // 前台用户权限 | ||
login_score: 0, | ||
first_login: 0, | ||
}, | ||
onLaunch: function() { | ||
var _this = this; | ||
//获取本地用户缓存,看看是否登录 | ||
uni.getStorage({ | ||
key: 'userInfo', | ||
success (res) { //有本地缓存登录过 | ||
_this.globalData.userInfo = res.data; | ||
} | ||
}) | ||
uni.getSystemInfo({ | ||
success: res => { | ||
//导航高度 | ||
this.globalData.navHeight = res.statusBarHeight * (750 / res.windowWidth) + 97; | ||
}, fail(err) {} | ||
}); | ||
}, | ||
onShow: function() { | ||
var url = this.globalData.site_url+'/appapi/?s=Home.GetConfig'; | ||
request.requestApi(url,{}).then(res=>{ | ||
this.globalData.configInfo = res.data.info[0]; | ||
}) | ||
const updateManager = uni.getUpdateManager(); | ||
updateManager.onCheckForUpdate(function (res) { | ||
// 请求完新版本信息的回调 | ||
}) | ||
updateManager.onUpdateReady(function () { | ||
uni.showModal({ | ||
title: '更新提示', | ||
content: '新版本已经准备好,是否重启应用?', | ||
success: function (res) { | ||
if (res.confirm) { | ||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 | ||
updateManager.applyUpdate() | ||
} | ||
} | ||
}) | ||
}); | ||
updateManager.onUpdateFailed(function () { | ||
uni.showToast({ | ||
title: '新版本下载失败', | ||
icon:'none' | ||
}) | ||
}) | ||
}, | ||
onHide: function() { | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
/*每个页面公共css */ | ||
@import url("/static/dj.css"); | ||
@import url("/static/iconfont.css"); | ||
/deep/.uni-scroll-view ::-webkit-scrollbar { | ||
/* 隐藏滚动条,但依旧具备可以滚动的功能 */ | ||
display: none; | ||
width: 0; | ||
height: 0; | ||
color: transparent; | ||
background: transparent; | ||
} | ||
/deep/::-webkit-scrollbar { | ||
display: none; | ||
width: 0; | ||
height: 0; | ||
color: transparent; | ||
background: transparent; | ||
} | ||
/* 弹窗层级设为最高 */ | ||
uni-toast{ | ||
z-index: 99999; | ||
} | ||
uni-modal { | ||
z-index: 99999; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Vue from 'vue' | ||
import App from './App' | ||
|
||
Vue.config.productionTip = false | ||
App.mpType = 'app' | ||
|
||
const app = new Vue({ | ||
...App | ||
}) | ||
app.$mount() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ | ||
"name" : "新版党建小程序", | ||
"appid" : "__UNI__7E05929", | ||
"description" : "", | ||
"versionName" : "1.0.0", | ||
"versionCode" : "100", | ||
"transformPx" : false, | ||
/* 5+App特有相关 */ | ||
"app-plus" : { | ||
"usingComponents" : true, | ||
"nvueCompiler" : "uni-app", | ||
"compilerVersion" : 3, | ||
"splashscreen" : { | ||
"alwaysShowBeforeRender" : true, | ||
"waiting" : true, | ||
"autoclose" : true, | ||
"delay" : 0 | ||
}, | ||
/* 模块配置 */ | ||
"modules" : {}, | ||
/* 应用发布信息 */ | ||
"distribute" : { | ||
/* android打包配置 */ | ||
"android" : { | ||
"permissions" : [ | ||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", | ||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", | ||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", | ||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", | ||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", | ||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", | ||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", | ||
"<uses-permission android:name=\"android.permission.CAMERA\"/>", | ||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", | ||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", | ||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", | ||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", | ||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", | ||
"<uses-feature android:name=\"android.hardware.camera\"/>", | ||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" | ||
] | ||
}, | ||
/* ios打包配置 */ | ||
"ios" : {}, | ||
/* SDK配置 */ | ||
"sdkConfigs" : {} | ||
} | ||
}, | ||
/* 快应用特有相关 */ | ||
"quickapp" : {}, | ||
/* 小程序特有相关 */ | ||
"mp-weixin" : { | ||
"appid" : "wx5704787a99ea5887", | ||
"setting" : { | ||
"urlCheck" : false, | ||
"es6" : true | ||
}, | ||
"usingComponents" : true, | ||
"requiredBackgroundModes" : [ "audio" ] | ||
}, | ||
"mp-alipay" : { | ||
"usingComponents" : true | ||
}, | ||
"mp-baidu" : { | ||
"usingComponents" : true | ||
}, | ||
"mp-toutiao" : { | ||
"usingComponents" : true | ||
}, | ||
"uniStatistics" : { | ||
"enable" : false | ||
}, | ||
"h5" : { | ||
"title" : "万岳在线刷题系统", | ||
"domain" : "https://ninghua.sdweiyue.cn", | ||
"router" : { | ||
"mode" : "hash", | ||
"base" : "/UNIAPP/" | ||
}, | ||
"devServer" : { | ||
"https" : false | ||
} | ||
} | ||
} |
Oops, something went wrong.