Skip to content

Commit 0f5b534

Browse files
committed
style: App.vue
1 parent 30fd840 commit 0f5b534

2 files changed

Lines changed: 45 additions & 41 deletions

File tree

‎App.vue‎

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,80 @@
11
<script>
22
export default {
3-
onLaunch: function () {
3+
onLaunch: function() {
44
console.log('App Launch');
5-
//#ifdef APP-PLUS
6-
/* 5+环境锁定屏幕方向 */
5+
// #ifdef APP-PLUS
6+
// 锁定屏幕方向
77
plus.screen.lockOrientation('portrait-primary'); //锁定
8-
/* 5+环境升级提示 */
9-
var server = "https://uniapp.dcloud.io/update"; //检查更新地址
10-
var req = { //升级检测数据
11-
"appid": plus.runtime.appid,
12-
"version": plus.runtime.version,
13-
"imei": plus.device.imei
14-
};
8+
// 检测升级
159
uni.request({
16-
url: server,
17-
data: req,
10+
url: 'https://uniapp.dcloud.io/update', //检查更新的服务器地址
11+
data: {
12+
appid: plus.runtime.appid,
13+
version: plus.runtime.version,
14+
imei: plus.device.imei
15+
},
1816
success: (res) => {
19-
console.log("success", res);
17+
console.log('success', res);
2018
if (res.statusCode == 200 && res.data.isUpdate) {
2119
let openUrl = plus.os.name === 'iOS' ? res.data.iOS : res.data.Android;
22-
uni.showModal({ //提醒用户更新
20+
// 提醒用户更新
21+
uni.showModal({
2322
title: '更新提示',
2423
content: res.data.note ? res.data.note : '是否选择更新',
25-
success: (res) => {
26-
if (res.confirm) {
24+
success: (showResult) => {
25+
if (showResult.confirm) {
2726
plus.runtime.openURL(openUrl);
2827
}
2928
}
3029
})
3130
}
3231
}
3332
})
34-
//#endif
33+
// #endif
3534
},
36-
onShow: function () {
35+
onShow: function() {
3736
console.log('App Show')
3837
},
39-
onHide: function () {
38+
onHide: function() {
4039
console.log('App Hide')
4140
}
4241
}
4342
</script>
43+
4444
<style>
4545
/* uni.css - 通用组件、模板样式库,可以当作一套ui库应用 */
46-
@import "./common/uni.css";
47-
46+
@import './common/uni.css';
47+
4848
/* 以下样式用于 hello uni-app 演示所需 */
4949
page {
50-
background-color:#F4F5F6;
50+
background-color: #F4F5F6;
5151
height: 100%;
52-
font-size:28upx;
52+
font-size: 28upx;
5353
line-height: 1.8;
5454
}
55-
.uni-header-logo{
56-
padding:30upx;
57-
text-align:center;
58-
margin-top:10upx;
55+
56+
.uni-header-logo {
57+
padding: 30upx;
58+
text-align: center;
59+
margin-top: 10upx;
5960
}
60-
.uni-header-logo image{
61+
62+
.uni-header-logo image {
6163
width: 140upx;
6264
height: 140upx;
6365
}
64-
.uni-hello-text{
65-
color:#7A7E83;
66+
67+
.uni-hello-text {
68+
color: #7A7E83;
6669
}
67-
.uni-hello-addfile{
68-
text-align:center;
69-
line-height:300upx;
70-
background:#FFF;
71-
padding:50upx;
72-
margin-top:10px;
73-
font-size:38upx;
74-
color:#808080;
70+
71+
.uni-hello-addfile {
72+
text-align: center;
73+
line-height: 300upx;
74+
background: #FFF;
75+
padding: 50upx;
76+
margin-top: 10px;
77+
font-size: 38upx;
78+
color: #808080;
7579
}
76-
</style>
80+
</style>

‎main.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Vue.prototype.$backgroundAudioData = {
1515
formatedPlayTime: '00:00:00'
1616
}
1717

18-
Vue.component('page-head',pageHead)
19-
Vue.component('page-foot',pageFoot)
18+
Vue.component('page-head', pageHead)
19+
Vue.component('page-foot', pageFoot)
2020

2121

2222
App.mpType = 'app'

0 commit comments

Comments
 (0)