Commit e6de5a02 by chenwq

样式

1 parent d6150e43
// pages/tab/output/components/client/client.js // pages/tab/output/components/client/client.js
import outputApi from '~/api/outputApi/index' import outputApi from '~/api/outputApi/index'
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from '~/utils/constantData'
import { deleteSecond } from '~/utils/format'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -410,6 +411,66 @@ Component({ ...@@ -410,6 +411,66 @@ Component({
activityId activityId
}) })
}, },
/**战报 */
handleReport(e) {
const { item, idx } = e.detail.currentTarget.dataset
wx.$api.showLoading('战报生成中')
outputApi
.getNewReportUrl({ activityId: item.activityId })
.then(res => {
if (!res.url) {
wx.$api.showToast('战报生成失败')
return true
}
var posterItem = {
...item,
posterUrl: res.url,
updatedTime: deleteSecond(res.updatedDate),
type: 'warReport'
}
this.setData({
posterItem: posterItem,
isShowTip: false
})
wx.$api.hideLoading()
this.triggerEvent('handleZhanReport', { item: item, idx: idx, posterItem: posterItem })
})
.catch(() => {
wx.$api.showToast('下载战报失败')
})
.finally(() => {
wx.$api.hideLoading()
})
},
/**喜报 */
handleXiReport(e) {
const { item } = e.detail.currentTarget.dataset
wx.$api.showLoading('喜报生成中')
outputApi
.getNewGoodUrl({ activityId: item.activityId })
.then(res => {
if (!res.goodUrl) {
wx.$api.showToast('暂无喜报')
return true
}
var posterItem = {
...item,
posterUrl: res.goodUrl,
updatedTime: res.goodReportDate ? deleteSecond(res.goodReportDate) : '',
type: 'warReport'
}
this.setData({
posterItem: posterItem
})
wx.$api.hideLoading()
})
.catch(() => {
wx.$api.showToast('下载喜报失败')
})
.finally(() => {
})
},
handleJump(e) { handleJump(e) {
let { idx, sceneCode } = e.currentTarget.dataset let { idx, sceneCode } = e.currentTarget.dataset
var currentItem = this.data.list[idx] var currentItem = this.data.list[idx]
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
</view> </view>
<!-- 售后众筹 --> <!-- 售后众筹 -->
<view class="output-box" wx:if="{{formData.sceneCode == 'SC004' || formData.sceneCode == 'SC003'}}"> <view class="output-box" wx:if="{{formData.sceneCode == 'SC004' || formData.sceneCode == 'SC003'}}">
<output-crowdfund wx:if="{{formData.sceneCode == 'SC004' || formData.sceneCode == 'SC003'}}" orderObj="{{crowdOrderObj}}" sceneCode="{{formData.sceneCode}}" proIdx="{{formData.sceneCode == 'SC003' ? '0' : formData.proIdx}}"></output-crowdfund> <output-crowdfund wx:if="{{formData.sceneCode == 'SC004' || formData.sceneCode == 'SC003'}}" orderObj="{{crowdOrderObj}}" sceneCode="{{formData.sceneCode}}" proIdx="{{formData.sceneCode == 'SC003' ? '0' : formData.proIdx}}" bindhandleReport="handleReport" bindhandleXiReport="handleXiReport"></output-crowdfund>
<view class="end-txt"> <view class="end-txt">
{{ crowdOrderObj.activityList.length ? '到底啦!' : '暂无数据' }} {{ crowdOrderObj.activityList.length ? '到底啦!' : '暂无数据' }}
</view> </view>
......
...@@ -107,62 +107,11 @@ Component({ ...@@ -107,62 +107,11 @@ Component({
methods: { methods: {
/**战报 */ /**战报 */
handleReport(e) { handleReport(e) {
const { item, idx } = e.currentTarget.dataset this.triggerEvent('handleReport', e)
wx.$api.showLoading('战报生成中')
outputApi
.getNewReportUrl({ activityId: item.activityId })
.then(res => {
if (!res.url) {
wx.$api.showToast('战报生成失败')
return true
}
var posterItem = {
...item,
posterUrl: res.url,
updatedTime: deleteSecond(res.updatedDate),
type: 'warReport'
}
this.setData({
crowdPosterItem: posterItem,
isShowTip: false
})
wx.$api.hideLoading()
this.triggerEvent('handleZhanReport', { item: item, idx: idx, posterItem: posterItem })
})
.catch(() => {
wx.$api.showToast('下载战报失败')
})
.finally(() => {
wx.$api.hideLoading()
})
}, },
/**喜报 */ /**喜报 */
handleXiReport(e) { handleXiReport(e) {
const { item } = e.currentTarget.dataset this.triggerEvent('handleXiReport', e)
wx.$api.showLoading('喜报生成中')
outputApi
.getNewGoodUrl({ activityId: item.activityId })
.then(res => {
if (!res.goodUrl) {
wx.$api.showToast('暂无喜报')
return true
}
var posterItem = {
...item,
posterUrl: res.goodUrl,
updatedTime: res.goodReportDate ? deleteSecond(res.goodReportDate) : '',
type: 'warReport'
}
this.setData({
crowdPosterItem: posterItem
})
wx.$api.hideLoading()
})
.catch(() => {
wx.$api.showToast('下载喜报失败')
})
.finally(() => {
})
}, },
// 活动详情-跳转门店助手 // 活动详情-跳转门店助手
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!