This commit is contained in:
闫晓茹 2023-04-19 15:39:09 +08:00
parent 164f752f52
commit 3f10822514

View File

@ -24,12 +24,15 @@
{{item.totalFraction}}
<span></span>
</view>
<view class="baogao">
<view class="baogao" @tap='lookbook(item)'>
<view class="image">
</view>
<!-- <view class="look">查看报告</view> -->
<view class="look" @tap='showToast(item)' v-if="item.existFlag==false">查看报告</view>
<view class="lookreport" @tap='lookbook(item)' v-else>查看报告</view>
<view class="look" v-if="item.existFlag==false">暂无报告</view>
<view class="lookreport" v-else>查看报告</view>
<view class="lookreport" @tap='lookbook(item)' v-else>
<view class="image">
</view>查看报告
</view>
</view>
</view>
<u-toast ref="uToast" />
@ -70,42 +73,42 @@
},
methods: {
showToast() {
this.$refs.uToast.show({
message: "暂无报告",
type: 'error',
duration: 1000
})
},
lookbook(item) {
uni.showLoading({
title: '获取报告中'
});
var that = this
wx.downloadFile({
url: baseurl + item.downloadAddress,
success: function(res) {
var filePath = res.tempFilePath;
wx.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
}
});
},
fail: function(err) {
uni.hideLoading();
that.$refs.uToast.show({
message: '请求报告失败',
type: 'error'
})
}
});
if (item.existFlag == false) {
this.$refs.uToast.show({
message: "暂无报告",
type: 'error',
duration: 1000
})
} else {
uni.showLoading({
title: '获取报告中'
});
var that = this
wx.downloadFile({
url: baseurl + item.downloadAddress,
success: function(res) {
var filePath = res.tempFilePath;
wx.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
}
});
},
fail: function(err) {
uni.hideLoading();
that.$refs.uToast.show({
title: '请求报告失败',
type: 'error'
})
}
});
}
},
getPhoneNumberp(val) {
wx.login({