Commit bf8cd8d2 authored by 刘用法's avatar 刘用法

获取相册权限失败

parent 590a8249
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="cus-wrap"> <view class="cus-wrap">
<w-navbar title="联系客服"></w-navbar> <w-navbar title="联系客服"></w-navbar>
<view class="content"> <view class="content">
<u-image class="qrcode" :src="cusQrcode" width="400" height="400" mode="widthFix" @longtap="download" :fade="true" duration="450"> <u-image class="qrcode" :src="cusQrcode" width="400" height="400" mode="widthFix" :fade="true" duration="450">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx;">加载失败</view> <view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image> </u-image>
...@@ -24,25 +24,25 @@ ...@@ -24,25 +24,25 @@
}, },
}, },
methods: { methods: {
download() { // download() {
let that = this; // let that = this;
uni.downloadFile({ //获得二维码的临时地址 // uni.downloadFile({ //获得二维码的临时地址
url: that.erweimaImage, // url: that.erweimaImage,
success:(res)=>{ // success:(res)=>{
if(res.statusCode == 200){ // if(res.statusCode == 200){
uni.saveImageToPhotosAlbum({ // uni.saveImageToPhotosAlbum({
filePath:res.tempFilePath,//传入临时地址 // filePath:res.tempFilePath,//传入临时地址
success() { // success() {
that.$u.toast('保存成功!'); // that.$u.toast('保存成功!');
}, // },
fail() { // fail() {
that.$u.toast('保存失败!'); // that.$u.toast('保存失败!');
} // }
}) // })
} // }
} // }
}) // })
} // }
} }
} }
</script> </script>
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
</image> </image>
</view> </view>
<view class="txt-box"> <view class="txt-box">
<text :class="['title', {failed: status == 4} ,index ? 'active' : '']" v-for="(txt,index) in info.txtArr" :key="index">{{txt}}</text> <text :class="['title', {failed: status == 4} ,index ? 'active' : '']"
v-for="(txt,index) in info.txtArr" :key="index">{{txt}}</text>
</view> </view>
<view class="tips-box" v-if="info.tipsArr"> <view class="tips-box" v-if="info.tipsArr">
<text :class="['tips',info.tipsArr.length>1 && index===0 ? 'red' : '']" <text :class="['tips',info.tipsArr.length>1 && index===0 ? 'red' : '']"
...@@ -17,9 +18,13 @@ ...@@ -17,9 +18,13 @@
</view> </view>
<view class="services-view"> <view class="services-view">
<view v-if="[1, 2, 3, 4, 7].indexOf(status) != -1"> <view v-if="[1, 2, 3, 4, 7].indexOf(status) != -1">
<image class="service-info-image" :src="erweimaImage" @longtap="saveQrcode"></image> <view class="service-info-image">
<view class="content-info-tip">长按二维码保存图片,添加官方客服微信</view> <u-image class="qrcode" :src="erweimaImage" width="220" height="220" mode="widthFix"
<view class="content-info-tip">及时了解审核进度</view> :fade="true" duration="450">
</u-image>
</view>
<view class="content-info-tip">长按二维码保存图片</view>
<view class="content-info-tip">添加官方客服微信及时了解审核进度</view>
</view> </view>
</view> </view>
<button class="btn-submit" @click="$u.debounce(goPage, 500)">{{info.btnTxt}}</button> <button class="btn-submit" @click="$u.debounce(goPage, 500)">{{info.btnTxt}}</button>
...@@ -95,7 +100,8 @@ ...@@ -95,7 +100,8 @@
}, },
computed: { computed: {
imageUrl() { imageUrl() {
return this.status == 1 ? process.uniEnv.qn_base_url + 'chenggong.png' : process.uniEnv.qn_base_url + 'icon-prompt.png' return this.status == 1 ? process.uniEnv.qn_base_url + 'chenggong.png' : process.uniEnv.qn_base_url +
'icon-prompt.png'
}, },
erweimaImage() { erweimaImage() {
return process.uniEnv.qn_base_url + 'erweima-bg.png' return process.uniEnv.qn_base_url + 'erweima-bg.png'
...@@ -183,14 +189,14 @@ ...@@ -183,14 +189,14 @@
} }
this.info = info this.info = info
}, },
saveQrcode() { download() {
let that = this; let that = this;
uni.downloadFile({ //获得二维码的临时地址 uni.downloadFile({ //获得二维码的临时地址
url: that.erweimaImage, url: that.erweimaImage,
success:(res)=>{ success: (res) => {
if(res.statusCode == 200){ if (res.statusCode == 200) {
uni.saveImageToPhotosAlbum({ uni.saveImageToPhotosAlbum({
filePath:res.tempFilePath,//传入临时地址 filePath: res.tempFilePath, //传入临时地址
success() { success() {
that.$u.toast('保存成功!'); that.$u.toast('保存成功!');
}, },
...@@ -202,6 +208,43 @@ ...@@ -202,6 +208,43 @@
} }
}) })
}, },
// saveQrcode() {
// let that = this;
// uni.downloadFile({ //获得二维码的临时地址
// url: that.erweimaImage,
// success:(res)=>{
// if(res.statusCode == 200){
// uni.saveImageToPhotosAlbum({
// filePath:res.tempFilePath,//传入临时地址
// success() {
// that.$u.toast('保存成功!');
// },
// complete(res) {
// if (res.errMsg.indexOf('auth') != -1) {
// uni.showModal({
// title: '提示',
// content: '获取相册权限失败,请到设置页面开启权限',
// confirmText: '好的',
// success(res) {
// if (res.confirm) {
// uni.openSetting({
// success(res) {
// console.log(res.authSetting)
// }
// });
// }
// }
// })
// } else if (res.errMsg) {
// that.$u.toast('保存失败!');
// }
// }
// })
// }
// }
// })
// },
goPage() { goPage() {
const url = this.info.url const url = this.info.url
if (this.status == 1 || this.status == 3 || this.status == 7) { if (this.status == 1 || this.status == 3 || this.status == 7) {
...@@ -255,9 +298,7 @@ ...@@ -255,9 +298,7 @@
padding: 30rpx; padding: 30rpx;
} }
.txt-box { .txt-box {}
}
.title { .title {
display: block; display: block;
...@@ -267,9 +308,11 @@ ...@@ -267,9 +308,11 @@
font-weight: bold; font-weight: bold;
font-size: 44rpx; font-size: 44rpx;
color: #2272FF; color: #2272FF;
&.failed { &.failed {
color: #FA5A49; color: #FA5A49;
} }
&.active { &.active {
color: #666666; color: #666666;
font-size: 24rpx; font-size: 24rpx;
...@@ -306,15 +349,20 @@ ...@@ -306,15 +349,20 @@
color: #999; color: #999;
} }
} }
.services-view { .services-view {
padding-top: 50rpx; padding-top: 50rpx;
text-align: center; text-align: center;
min-height: 120rpx; min-height: 120rpx;
.service-info-image { .service-info-image {
margin-bottom: 30rpx; margin-bottom: 30rpx;
width: 220rpx; width: 100%;
height: 220rpx; text-align: center;
display: flex;
justify-content: center;
} }
.content-info-tip { .content-info-tip {
font-size: 22rpx; font-size: 22rpx;
color: #666666; color: #666666;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment