Commit 85c05c72 by chenwq

战报喜报

1 parent 55c0c112
...@@ -213,7 +213,6 @@ Component({ ...@@ -213,7 +213,6 @@ Component({
const res = await outputApi.reportPosterTrack({ const res = await outputApi.reportPosterTrack({
activityId activityId
}) })
console.log(res)
}, },
/**长按战报/喜报 */ /**长按战报/喜报 */
async handlePosterTouch(e) { async handlePosterTouch(e) {
...@@ -222,20 +221,26 @@ Component({ ...@@ -222,20 +221,26 @@ Component({
/**战报 */ /**战报 */
handleReport(e) { handleReport(e) {
const { const {
item item,
idx
} = e.currentTarget.dataset } = e.currentTarget.dataset
wx.$api.showLoading("战报生成中") wx.$api.showLoading("战报生成中")
outputApi.getNewReportUrl({ activityId: item.activityId }).then(res => { outputApi.getNewReportUrl({ activityId: item.activityId }).then(res => {
console.log(res) // console.log(res)
// item.posterUrl = res if(!res.url) {
wx.$api.showToast('战报生成失败')
return true
}
var posterItem = { var posterItem = {
posterUrl: res || 'https://wx.glsx.com.cn/upload/biz/592250239952490496.png', posterUrl: res.url,
date: new Date().toLocaleDateString() date: res.updatedDate
} }
this.setData({ this.setData({
posterItem: posterItem, posterItem: posterItem,
isShowPoster: true isShowPoster: true
}) })
wx.$api.hideLoading()
this.triggerEvent('handleZhanReport', { item: item, idx: idx, posterItem: posterItem })
}).catch(() => { }).catch(() => {
wx.$api.showToast('下载战报失败') wx.$api.showToast('下载战报失败')
}).finally(() => { }).finally(() => {
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</view> </view>
<!-- 战报 --> <!-- 战报 -->
<view class="new-report" wx:if="{{item.activityStatus != 1}}"> <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> <glsx-image class="icon-report" src="output/icon-report.webp"></glsx-image>
生成最新战报 生成最新战报
</view> </view>
......
...@@ -300,7 +300,6 @@ Page({ ...@@ -300,7 +300,6 @@ Page({
res.forEach(item => { res.forEach(item => {
total = total + item.totalAmount total = total + item.totalAmount
}) })
console.log(actList)
var activitingIdx = -1 var activitingIdx = -1
actList.forEach((item, idx) => { actList.forEach((item, idx) => {
var curItem = res.find(k => k.goodsCategoryCode == item.productCode) var curItem = res.find(k => k.goodsCategoryCode == item.productCode)
...@@ -369,7 +368,7 @@ Page({ ...@@ -369,7 +368,7 @@ Page({
}) })
this.setCurActivity() this.setCurActivity()
} }
if (this.data.sceneActive == 4) { if (this.data.sceneActive == 4 && activitingIdx != -1) {
var params = { var params = {
currentTarget: { currentTarget: {
dataset: { dataset: {
...@@ -393,7 +392,6 @@ Page({ ...@@ -393,7 +392,6 @@ Page({
const item = this.data.activityList[this.data.activityActive].outputData.activityList[idx] const item = this.data.activityList[this.data.activityActive].outputData.activityList[idx]
const posterObj = this.selectComponent('#crowdPoster') const posterObj = this.selectComponent('#crowdPoster')
const { options } = wx.$router.getPageInstance() const { options } = wx.$router.getPageInstance()
console.log(options)
try { try {
let flag = await posterObj.check(item) let flag = await posterObj.check(item)
posterObj.setData({ posterObj.setData({
...@@ -424,10 +422,19 @@ Page({ ...@@ -424,10 +422,19 @@ Page({
const res = await outputApi.reportPosterTrack({ const res = await outputApi.reportPosterTrack({
activityId activityId
}) })
console.log(res) // console.log(res)
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1]) 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 @@ ...@@ -41,7 +41,7 @@
</view> </view>
</view> </view>
<output-transform wx:if="{{sceneActive == 2 || sceneActive == 3}}" formData="{{activityList[activityActive].orderTotal}}" /> <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>
<view wx:else class="content-empty bg-white"> <view wx:else class="content-empty bg-white">
<image class="img-empty" src="{{IMGURL}}output/sum-empty.png?v={{img_version}}" /> <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!