Commit 141f2623 by liujinsa

提交

parent 41111d4f
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</div> </div>
<div class="monthList flex flex-cen flex-btw van-hairline--bottom" v-for="(monthItem,index1) in item.month" :key="index1"> <div class="monthList flex flex-cen flex-btw van-hairline--bottom" v-for="(monthItem,index1) in item.month" :key="index1">
<div class="state">{{monthItem}}月账单</div> <div class="state">{{monthItem}}月账单</div>
<van-button :loading="isLoading" @click="downloadPdf(item.year + monthItem)">下载</van-button> <van-button @click="downloadPdf(item.year + monthItem)">下载</van-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -32,7 +32,6 @@ export default { ...@@ -32,7 +32,6 @@ export default {
}, },
onLoad(options){ onLoad(options){
console.log(options,'xiazai') console.log(options,'xiazai')
this.getList();
live.getUserInfo().then(res => { live.getUserInfo().then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.userId = res.data.data ? res.data.data.userId : '' this.userId = res.data.data ? res.data.data.userId : ''
...@@ -40,7 +39,10 @@ export default { ...@@ -40,7 +39,10 @@ export default {
}) })
}, },
onShow() { onShow() {
// console.log(getTokenmu(),'userId') },
onReady(){
this.list = []
this.getList();
}, },
methods: { methods: {
filterDateFun(arr){ filterDateFun(arr){
...@@ -83,7 +85,10 @@ export default { ...@@ -83,7 +85,10 @@ export default {
window.location.href = url window.location.href = url
}, },
downloadPdf(id){ downloadPdf(id){
this.isLoading = true; wx.showLoading({ // 显示加载中loading效果
title: "加载中",
mask: true //开启蒙版遮罩
});
let Temurl = this.baseUrl + '/customdev'+`/${hashids.encode(id)}` + `/${hashids.encode(this.userId)}` +`?mixid=${this.$store.state.mixid}` let Temurl = this.baseUrl + '/customdev'+`/${hashids.encode(id)}` + `/${hashids.encode(this.userId)}` +`?mixid=${this.$store.state.mixid}`
console.log(Temurl,'mkurl') console.log(Temurl,'mkurl')
let pdfurl = this.baseUrl+`/innerApi/utilsService/genPdf?url=${Temurl}` let pdfurl = this.baseUrl+`/innerApi/utilsService/genPdf?url=${Temurl}`
...@@ -107,21 +112,24 @@ export default { ...@@ -107,21 +112,24 @@ export default {
wx.showToast({ wx.showToast({
title: '打开文档成功', title: '打开文档成功',
}) })
_this.isLoading = false; wx.hideLoading();
// _this.isLoading = false;
console.log('打开文档成功',res) console.log('打开文档成功',res)
}, },
fail: (err) =>{ fail: (err) =>{
wx.showToast({ wx.showToast({
title: '打开文档失败', title: '打开文档失败',
}) })
wx.hideLoading();
console.log('打开文档失败',err) console.log('打开文档失败',err)
_this.isLoading = false; // _this.isLoading = false;
} }
}) })
}, },
fail : (err) => { fail : (err) => {
console.log('下载失败',err) console.log('下载失败',err)
_this.isLoading = false; // _this.isLoading = false;
wx.hideLoading();
wx.showToast({ wx.showToast({
title: '打开文档失败', title: '打开文档失败',
}) })
...@@ -135,7 +143,7 @@ export default { ...@@ -135,7 +143,7 @@ export default {
console.log(res,'res') console.log(res,'res')
if(res.progress == 100){ if(res.progress == 100){
console.log('下载成功') console.log('下载成功')
this.isLoading = false; wx.hideLoading();
} }
}) })
}, },
......
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