Commit 85c05c72 by chenwq

战报喜报

1 parent 55c0c112
......@@ -213,7 +213,6 @@ Component({
const res = await outputApi.reportPosterTrack({
activityId
})
console.log(res)
},
/**长按战报/喜报 */
async handlePosterTouch(e) {
......@@ -222,20 +221,26 @@ Component({
/**战报 */
handleReport(e) {
const {
item
item,
idx
} = e.currentTarget.dataset
wx.$api.showLoading("战报生成中")
outputApi.getNewReportUrl({ activityId: item.activityId }).then(res => {
console.log(res)
// item.posterUrl = res
// console.log(res)
if(!res.url) {
wx.$api.showToast('战报生成失败')
return true
}
var posterItem = {
posterUrl: res || 'https://wx.glsx.com.cn/upload/biz/592250239952490496.png',
date: new Date().toLocaleDateString()
posterUrl: res.url,
date: res.updatedDate
}
this.setData({
posterItem: posterItem,
isShowPoster: true
})
wx.$api.hideLoading()
this.triggerEvent('handleZhanReport', { item: item, idx: idx, posterItem: posterItem })
}).catch(() => {
wx.$api.showToast('下载战报失败')
}).finally(() => {
......
......@@ -75,7 +75,7 @@
</view>
<!-- 战报 -->
<view class="new-report" wx:if="{{item.activityStatus != 1}}">
<view class="report-left" bindtap="handleReport" data-item="{{item}}">
<view class="report-left" bindtap="handleReport" data-item="{{item}}" data-idx="{{index}}">
<glsx-image class="icon-report" src="output/icon-report.webp"></glsx-image>
生成最新战报
</view>
......
......@@ -300,7 +300,6 @@ Page({
res.forEach(item => {
total = total + item.totalAmount
})
console.log(actList)
var activitingIdx = -1
actList.forEach((item, idx) => {
var curItem = res.find(k => k.goodsCategoryCode == item.productCode)
......@@ -369,7 +368,7 @@ Page({
})
this.setCurActivity()
}
if (this.data.sceneActive == 4) {
if (this.data.sceneActive == 4 && activitingIdx != -1) {
var params = {
currentTarget: {
dataset: {
......@@ -393,7 +392,6 @@ Page({
const item = this.data.activityList[this.data.activityActive].outputData.activityList[idx]
const posterObj = this.selectComponent('#crowdPoster')
const { options } = wx.$router.getPageInstance()
console.log(options)
try {
let flag = await posterObj.check(item)
posterObj.setData({
......@@ -424,10 +422,19 @@ Page({
const res = await outputApi.reportPosterTrack({
activityId
})
console.log(res)
// console.log(res)
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
},
// 战报
handleZhanReport(e) {
const { idx, posterItem } = e.detail
this.setData({
['sceneActivityObj.scene' + this.data.sceneActive + '[' + this.data.activityActive + '].outputData.activityList[' + idx + '].reportDate']: posterItem.date
})
this.setCurActivity()
},
/**
* 生命周期函数--监听页面加载
*/
......
......@@ -41,7 +41,7 @@
</view>
</view>
<output-transform wx:if="{{sceneActive == 2 || sceneActive == 3}}" formData="{{activityList[activityActive].orderTotal}}" />
<output-crowdfund wx:if="{{sceneActive == 4}}" orderObj="{{activityList[activityActive].outputData}}" />
<output-crowdfund wx:if="{{sceneActive == 4}}" orderObj="{{activityList[activityActive].outputData}}" bind:handleZhanReport="handleZhanReport"/>
</view>
<view wx:else class="content-empty bg-white">
<image class="img-empty" src="{{IMGURL}}output/sum-empty.png?v={{img_version}}" />
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!