Commit baf92eb5 by 李伟康

海报缓存

1 parent c331fa5f
...@@ -163,16 +163,31 @@ Component({ ...@@ -163,16 +163,31 @@ Component({
// const { item } = e.currentTarget.dataset // const { item } = e.currentTarget.dataset
// wx.$router.jumpH5(item.activityUrl) // wx.$router.jumpH5(item.activityUrl)
}, },
download(e) { async download(e) {
const { item } = e.currentTarget.dataset const {
item
} = e.currentTarget.dataset,
posterObj = this.selectComponent('#poster')
try {
let flag = await posterObj.check(item)
posterObj.setData({
poster: flag,
show: true
})
} catch (error) {
wx.$api.showLoading('加载中...') wx.$api.showLoading('加载中...')
outputApi.getPosterUrl({ id: item.activityId }).then(res => { outputApi.getPosterUrl({
id: item.activityId
}).then(res => {
item.posterUrl = res item.posterUrl = res
this.setData({ this.setData({
posterItem: item, posterItem: item,
isShowTip: false isShowTip: false
}) })
}).catch(()=>{
wx.$api.showToast('下载海报失败')
}) })
} }
} }
}
}) })
...@@ -115,5 +115,5 @@ ...@@ -115,5 +115,5 @@
</view> </view>
</view> </view>
</view> </view>
<crowdfund-poster item="{{posterItem}}" /> <crowdfund-poster item="{{posterItem}}" id="poster" />
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!