Skip to content

Commit 12274b0

Browse files
author
wangyaqi
committed
update: 合并store版
1 parent a9aa54f commit 12274b0

File tree

14 files changed

+458
-236
lines changed

14 files changed

+458
-236
lines changed

pages/API/brightness/brightness.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
<view>
33
<page-head :title="title"></page-head>
44
<view class="uni-padding-wrap uni-common-mt">
5+
<!-- #ifndef MP-TOUTIAO -->
56
<view class="text-box">亮度 : {{ screen }}</view>
67
<view class="uni-slider"><slider :value="screen" @changing="sliderChange" step="1" /></view>
8+
<!-- #endif -->
79
<button type="primary" @click="keep">
810
{{ keepScreenOn ? '保持常亮状态' : '关闭常亮状态' }}
911
</button>

pages/API/download-file/download-file.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<image class="img" v-if="imageSrc" :src="imageSrc" mode="center" />
66
<block v-else>
77
<view class="uni-hello-text">
8-
点击按钮下载服务端示例图片
8+
点击按钮下载服务端示例图片(下载网络文件到本地临时目录)
99
</view>
1010
<view class="uni-btn-v">
1111
<button type="primary" @tap="downloadImage">下载</button>

pages/API/file/file.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,26 @@
4141
count: 1,
4242
success: (res) => {
4343
this.tempFilePath = res.tempFilePaths[0];
44+
},
45+
fail: (err) => {
46+
// #ifdef MP
47+
uni.getSetting({
48+
success: (res) => {
49+
let authStatus = res.authSetting['scope.album'] && res.authSetting['scope.camera'];
50+
if (!authStatus) {
51+
uni.showModal({
52+
title: '授权失败',
53+
content: 'Hello uni-app需要从您的相机或相册获取图片,请在设置界面打开相关权限',
54+
success: (res) => {
55+
if (res.confirm) {
56+
uni.openSetting()
57+
}
58+
}
59+
})
60+
}
61+
}
62+
})
63+
// #endif
4464
}
4565
});
4666
},

pages/API/get-user-info/get-user-info.vue

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,28 @@
6262
if (~content.indexOf('uni.login')) {
6363
content = '请在登录页面完成登录操作';
6464
}
65-
uni.showModal({
66-
title: '获取用户信息失败',
67-
content: '错误原因' + content,
68-
showCancel: false
69-
});
65+
uni.getSetting({
66+
success: (res) => {
67+
let authStatus = res.authSetting['scope.userInfo'];
68+
if (!authStatus) {
69+
uni.showModal({
70+
title: '授权失败',
71+
content: 'Hello uni-app需要获取您的用户信息,请在设置界面打开相关权限',
72+
success: (res) => {
73+
if (res.confirm) {
74+
uni.openSetting()
75+
}
76+
}
77+
})
78+
} else {
79+
uni.showModal({
80+
title: '获取用户信息失败',
81+
content: '错误原因' + content,
82+
showCancel: false
83+
});
84+
}
85+
}
86+
})
7087
}
7188
});
7289
},

0 commit comments

Comments
 (0)