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

获取相册权限失败

parent 590a8249
......@@ -2,7 +2,7 @@
<view class="cus-wrap">
<w-navbar title="联系客服"></w-navbar>
<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>
<view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image>
......@@ -24,25 +24,25 @@
},
},
methods: {
download() {
let that = this;
uni.downloadFile({ //获得二维码的临时地址
url: that.erweimaImage,
success:(res)=>{
if(res.statusCode == 200){
uni.saveImageToPhotosAlbum({
filePath:res.tempFilePath,//传入临时地址
success() {
that.$u.toast('保存成功!');
},
fail() {
that.$u.toast('保存失败!');
}
})
}
}
})
}
// download() {
// let that = this;
// uni.downloadFile({ //获得二维码的临时地址
// url: that.erweimaImage,
// success:(res)=>{
// if(res.statusCode == 200){
// uni.saveImageToPhotosAlbum({
// filePath:res.tempFilePath,//传入临时地址
// success() {
// that.$u.toast('保存成功!');
// },
// fail() {
// that.$u.toast('保存失败!');
// }
// })
// }
// }
// })
// }
}
}
</script>
......
......@@ -9,7 +9,8 @@
</image>
</view>
<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 class="tips-box" v-if="info.tipsArr">
<text :class="['tips',info.tipsArr.length>1 && index===0 ? 'red' : '']"
......@@ -17,9 +18,13 @@
</view>
<view class="services-view">
<view v-if="[1, 2, 3, 4, 7].indexOf(status) != -1">
<image class="service-info-image" :src="erweimaImage" @longtap="saveQrcode"></image>
<view class="content-info-tip">长按二维码保存图片,添加官方客服微信</view>
<view class="content-info-tip">及时了解审核进度</view>
<view class="service-info-image">
<u-image class="qrcode" :src="erweimaImage" width="220" height="220" mode="widthFix"
:fade="true" duration="450">
</u-image>
</view>
<view class="content-info-tip">长按二维码保存图片</view>
<view class="content-info-tip">添加官方客服微信及时了解审核进度</view>
</view>
</view>
<button class="btn-submit" @click="$u.debounce(goPage, 500)">{{info.btnTxt}}</button>
......@@ -95,13 +100,14 @@
},
computed: {
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() {
return process.uniEnv.qn_base_url + 'erweima-bg.png'
},
},
onLoad(e) {
onLoad(e) {
if (e) {
if (e.pageIndex) {
this.pageIndex = e.pageIndex;
......@@ -110,10 +116,10 @@
// if(!this.settledInfo){
// this.getBaseInfo()
// }
},
onShow() {
if (!this.settledInfo) {
onShow() {
if (!this.settledInfo) {
this.getBaseInfo()
}
},
......@@ -129,27 +135,27 @@
}
let settledInfo = await app.getBaseInfo(this, callBack)
this.settledInfo = settledInfo
this.status = settledInfo.record.status
switch (this.status) {
case 1:
case 2:
case 3:
case 4:
this.pageIndex = 2;
break;
case 8:
this.pageIndex = 3;
break;
case 5:
case 6:
this.pageIndex = 4;
break;
case 7:
this.pageIndex = 5;
break;
default:
this.pageIndex = 1;
break;
this.status = settledInfo.record.status
switch (this.status) {
case 1:
case 2:
case 3:
case 4:
this.pageIndex = 2;
break;
case 8:
this.pageIndex = 3;
break;
case 5:
case 6:
this.pageIndex = 4;
break;
case 7:
this.pageIndex = 5;
break;
default:
this.pageIndex = 1;
break;
}
uni.hideLoading()
this.initInfo(settledInfo.record)
......@@ -177,20 +183,20 @@
}
// if (status === 6) {
// info.tipsArr[0] = '请缴纳' + this.settledInfo.record.deposit + '元质保金'
// } else
// } else
if (status === 4) {
info.tipsArr[1] = this.settledInfo.record.reason || ''
}
this.info = info
},
saveQrcode() {
download() {
let that = this;
uni.downloadFile({ //获得二维码的临时地址
uni.downloadFile({ //获得二维码的临时地址
url: that.erweimaImage,
success:(res)=>{
if(res.statusCode == 200){
success: (res) => {
if (res.statusCode == 200) {
uni.saveImageToPhotosAlbum({
filePath:res.tempFilePath,//传入临时地址
filePath: res.tempFilePath, //传入临时地址
success() {
that.$u.toast('保存成功!');
},
......@@ -202,13 +208,50 @@
}
})
},
// 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() {
const url = this.info.url
if (this.status == 1 || this.status == 3 || this.status == 7) {
uni.reLaunch({
url,
});
} else {
uni.navigateTo({
url,
......@@ -239,12 +282,12 @@
margin-top: 150rpx;
width: 234rpx;
height: 222rpx;
}
&.h {
margin-top: 38rpx;
width: 234rpx;
height: 222rpx;
}
&.h {
margin-top: 38rpx;
width: 234rpx;
height: 222rpx;
}
}
......@@ -255,9 +298,7 @@
padding: 30rpx;
}
.txt-box {
}
.txt-box {}
.title {
display: block;
......@@ -267,9 +308,11 @@
font-weight: bold;
font-size: 44rpx;
color: #2272FF;
&.failed {
color: #FA5A49;
}
&.active {
color: #666666;
font-size: 24rpx;
......@@ -306,19 +349,24 @@
color: #999;
}
}
.services-view {
padding-top: 50rpx;
text-align: center;
min-height: 120rpx;
.service-info-image {
margin-bottom: 30rpx;
width: 220rpx;
height: 220rpx;
width: 100%;
text-align: center;
display: flex;
justify-content: center;
}
.content-info-tip {
font-size: 22rpx;
color: #666666;
}
}
}
</style>
</style>
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