Commit 4afb5d1b by luyt

Merge remote-tracking branch 'remotes/origin/develop' into dev_v3.2.0

2 parents c9ef07d1 45eb7d7c
......@@ -99,5 +99,13 @@ class outputApi {
...data
})
}
/**获取最新喜报 */
getNewGoodUrl(data) {
return api.post({
method: 'scrm.api.busassistant.crowdFunding.good.report',
...data
})
}
}
export default outputApi
......@@ -10,19 +10,29 @@ Component({
item: {
type: Object,
observer(n) {
// 如果是喜报和战报就跳过图片生成
if (n.type == 'warReport') {
// n.posterUrl
wx.$api.showLoading('图片加载中')
return this.setData({
poster: n.posterUrl,
show: true
})
}
n.posterUrl &&
this.checkUrl()
.then(result => {
result &&
this.setData({
poster: result,
show: true
})
})
.catch(err => {
console.log(err)
this.begin()
})
.then(result => {
result &&
this.setData({
poster: result,
show: true
})
})
.catch(err => {
console.log(err)
this.begin()
})
}
},
scrollImg: {
......@@ -38,31 +48,35 @@ Component({
_item_: null,
findKey: 'posterUrl',
height: '68%'
// poster: 'https://wx.glsx.com.cn/upload/biz/599036445419769856.png'
},
/**
* 组件的方法列表
*/
methods: {
successOnload() {
// debugger
// console.log('a123456')
wx.$api.hideLoading()
// this.setData({
// show: true
// })
},
// 图片缓存 有取小程序缓存图片
checkUrl() {
let {
item: postObj
} = this.data
console.log('checkUrl')
let { item: postObj } = this.data
const fileList = wx.$storage.get('fileList') || [],
fn = wx.getFileSystemManager(),
{
findKey
} = this.data
{ findKey } = this.data
return new Promise((resolve, reject) => {
// return reject()
if (fileList.length) {
fn.readdir({
dirPath: wx.env.USER_DATA_PATH,
success({
files
}) {
success({ files }) {
let obj = fileList.find(e => e[findKey] === postObj[findKey])
const poster = files.find(s => obj?.path.includes(s))
wx.hideLoading()
......@@ -96,9 +110,7 @@ Component({
})
},
begin() {
let {
item
} = this.data
let { item } = this.data
item.posterUrl && this.getImageInfo(item)
},
check(n) {
......@@ -125,9 +137,7 @@ Component({
})
},
async init(n, ImgWidth, ImgHeight) {
const {
findKey
} = this.data
const { findKey } = this.data
// debugger
// const {pixelRatio} = wx.getWindowInfo()
let actualWidth = 247 //默认宽度
......@@ -159,9 +169,7 @@ Component({
},
this
),
{
userInfo
} = wx.$storage.get(),
{ userInfo } = wx.$storage.get(),
merchantName = userInfo.merchantName.length > 12 ? `${userInfo.merchantName.substring(0, 12)}...` : userInfo.merchantName
console.log(merchantName)
// console.log(n.activityName)
......@@ -169,19 +177,21 @@ Component({
textList = []
// debugger
if (n.type == 'warReport') {
imageList = [{
x: 0,
y: 0,
width: actualWidth + 32,
height: actualHeight + 82,
url: n.posterUrl
}]
imageList = [
{
x: 0,
y: 0,
width: actualWidth + 32,
height: actualHeight + 82,
url: n.posterUrl
}
]
textList = []
} else {
n.activityName = n.activityName.length > 12 ? `${n.activityName.substring(0, 12)}...` : n.activityName
imageList = [{
imageList = [
{
x: 0,
y: 0,
width: 279,
......@@ -196,7 +206,8 @@ Component({
url: n.posterUrl
}
]
textList = [{
textList = [
{
x: 12,
y: 14,
fontSize: 14,
......@@ -304,10 +315,8 @@ Component({
})
},
longpress() {
let {
_item_
} = this.data
this.triggerEvent('longtouch', _item_)
let { item } = this.data
this.triggerEvent('longtouch', item)
}
}
})
\ No newline at end of file
})
......@@ -25,8 +25,11 @@
box-sizing: border-box;
width: 500rpx;
max-height: 68%;
// height: 68%;
// height: 1108rpx;
overflow: scroll;
// smoo
// overflow: scroll;
border-radius: 8rpx 8rpx 0 0;
}
......
......@@ -8,6 +8,7 @@
<scroll-view scroll-y scroll-x="false" style="height: 100%">
<!-- mode="widthFix" -->
<image
bindload="successOnload"
src="{{poster}}"
mode="widthFix"
show-menu-by-longpress
......@@ -20,12 +21,14 @@
<!-- mode="widthFix" -->
<scroll-view scroll-y scroll-x="false" style="height: 100%">
<image
bindload="successOnload"
src="{{poster}}"
mode="widthFix"
show-menu-by-longpress
bindlongpress="longpress" />
</scroll-view>
<!-- </view> -->
`
</block>
</view>
<view class="btn">
......
<!-- packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml -->
<view class="crowdfund-layout">
<view class="box order">
<view class="order-block" wx:for="{{orderFormList}}" wx:key="index">
<view class="order-txt">
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
{{orderObj[item.name] || 0}}
</view>
<view class="order-label">{{item.label}}</view>
</view>
</view>
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head">
<!-- text-hide -->
<view class=" head-title" bindtap="handleJumpH5" data-item="{{item}}">
{{item.activityName}}
</view>
<view class="head-link" bindtap="download" data-item="{{item}}">
<image src="{{IMAGES.download}}" class="downloadIcon" webp></image>
母链海报
</view>
<view class="down-tips" wx:if="{{index == 0 && isShowTip}}">下载活动海报分享给门店开展活动</view>
</view>
<view class="content">
<view
class="content-row"
wx:for="{{merchantFormList}}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx">
<view class="content-label">{{subItem.label}}</view>
<view class="content-txt {{subItem.className}}">
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
{{item[subItem.name]}}
</view>
</view>
<!-- 排名 -->
<view class="content-rank">
<view class="rank-head">
<view>员工转发数据排名</view>
<view class="activity-status" wx:if="{{item.activityStatus == 1}}">
距离开始{{item.interDays}}天
</view>
<view class="activity-status" wx:if="{{item.activityStatus == 2}}">
已开始{{item.interDays}}天
</view>
<view class="activity-status" wx:if="{{item.activityStatus == 3 && item.interDays < 8}}">
已结束{{item.interDays}}天
</view>
</view>
<view class="rank-table">
<view class="tr">
<view
class="th"
style="width: {{subItem.width || ''}};"
wx:for="{{tableHeadList}}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx">
{{subItem.label}}
</view>
</view>
<view wx:if="{{item.showStaffList.length}}">
<block
wx:for="{{item.showStaffList}}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx">
<view class="tr">
<view
class="td text-hide"
style="width: {{i.width || ''}};"
wx:for="{{tableHeadList}}"
wx:for-item="i"
wx:for-index="j"
wx:key="j">
<view wx:if="{{j == 0 && idx < 3}}">
<image class="icon-rank" src="{{IMGURL}}output/rank0{{idx + 1}}.png?v={{img_version}}" />
</view>
<text wx:if="{{i.prefix}}">{{i.prefix}}</text>
{{subItem[i.name]}}
</view>
</view>
</block>
<view
wx:if="{{item.staffList.length}}"
class="btn-more"
bindtap="handleMore"
data-idx="{{index}}">
查看更多
</view>
</view>
<view class="tr-no-data" wx:else>暂无数据</view>
</view>
</view>
<!-- 诊断 -->
<view class="content-suggest" wx:if="{{item.activityStatus == 2 && item.suggestTxtList.length}}">
<view class="suggest-title"># 活动诊断</view>
<view class="suggest-txt">
<!-- <text wx:if="{{item.toEndDays < 8}}">距离活动结束剩余{{item.interDays}}天,</text> -->
{{item.suggestTxt}}推荐以下建议:
</view>
<view class="suggest-block">
<view
class="suggest-step"
wx:for="{{item.suggestList}}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx">
<view class="step-label">建议{{idx + 1}}</view>
<view class="step-txt">{{subItem}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<crowdfund-poster item="{{posterItem}}" id="poster" />
......@@ -89,7 +89,8 @@ Component({
},
showPoster(e) {
const { item } = e.currentTarget.dataset
let updatedTime = deleteSecond(item.updatedTime)
let updatedTime = deleteSecond(item.createdTime)
this.setData({
// findKey: 'crowdFundActivityId',
posterItem: {
......
......@@ -34,7 +34,7 @@
wx:key='index'
merchantName="{{item.merchantName}}"
messageType="{{item.messageType}}"
time="{{item.updatedTime}}">
time="{{item.createdTime}}">
<view class="warReportBox" wx:if="{{item.messageType == 2}}">
<view class="item">
<view class="label">当前产值</view>
......@@ -83,7 +83,7 @@
wx:key='index'
merchantName="{{item.merchantName}}"
messageType="{{item.messageType}}"
time="{{item.updatedTime}}">
time="{{item.createdTime}}">
<view wx:if="{{item.messageType == 1}}">
<view class="cell">
<view class="label">活动名称:</view>
......@@ -108,11 +108,11 @@
</view>
<view class="cell" wx:if="{{item.messageType == 5}}">
<view class="label">新车交付场景:</view>
<view class="value">{{item.productName}}</view>
<view class="value">{{item.activityName||item.productName}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 6}}">
<view class="label">0~12个月场景:</view>
<view class="value">{{item.activityName}}</view>
<view class="value">{{item.activityName||item.productName}}</view>
</view>
</msg-box>
</scroll-view>
......
......@@ -176,7 +176,7 @@ Component({
const { item } = e.currentTarget.dataset
// posterObj = this.selectComponent('#crowdPoster'),
// { options } = wx.$router.getPageInstance()
const { options } = wx.$router.getPageInstance()
// const { options } = wx.$router.getPageInstance()
// console.log(options)
// try {
// let flag = await posterObj.check(item)
......@@ -227,10 +227,10 @@ Component({
return true
}
var posterItem = {
...item,
...item,
posterUrl: res.url,
updatedTime:deleteSecond( res.updatedDate) ,
type : 'warReport'
updatedTime: deleteSecond(res.updatedDate),
type: 'warReport'
}
this.setData({
crowdPosterItem: posterItem,
......@@ -249,26 +249,44 @@ Component({
/**喜报 */
handleXiReport(e) {
const { item } = e.currentTarget.dataset
console.log(item);
if (!item.goodUrl) {
wx.$api.showToast('喜报生成失败')
return true
}
// console.log(item);
// debugger
var posterItem = {
...item,
posterUrl: item.goodUrl,
// date: item.goodReportDate,
updatedTime:deleteSecond( item.goodReportDate) ,
type : 'warReport'
}
this.setData({
// posterItem: posterItem,
// isShowPoster: true,
crowdPosterItem: posterItem,
isShowTip: false
})
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(() => {
// wx.$api.hideLoading()
})
// var posterItem = {
// ...item,
// posterUrl: item.goodUrl,
// // date: item.goodReportDate,
// updatedTime: deleteSecond(item.goodReportDate),
// type: 'warReport'
// }
// this.setData({
// // posterItem: posterItem,
// // isShowPoster: true,
// crowdPosterItem: posterItem,
// isShowTip: false
// })
}
}
})
......@@ -232,13 +232,15 @@
}
}
&-name {
.rank-row-name {
max-width: 200rpx;
font-size: 24rpx;
color: #3666FE;
margin-right: 12rpx;
}
.name-disabled {
max-width: 200rpx;
font-size: 24rpx;
color: #5A6066;
margin-right: 12rpx;
......@@ -375,7 +377,6 @@
// 战报
.new-report {
display: flex;
justify-content: space-between;
margin-top: 20rpx;
height: 52rpx;
line-height: 52rpx;
......@@ -390,8 +391,9 @@
padding: 0 20rpx;
height: 100%;
background: rgba(54, 102, 254, 0.06);
border: 2rpx solid #3666FE;
border-radius: 8rpx;
border: 2rpx solid rgba(62,113,254,0.70);
border-radius: 30rpx;
margin-right: 4rpx;
.icon-report {
width: 32rpx;
......
<!-- packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml -->
<wxs src="../../index.wxs" module="filter" />
<view class="crowdfund-layout">
<view class="box order">
<view class="order-block" wx:for="{{orderFormList}}" wx:key="index">
<view class="order-txt font-number">
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
{{filter.money_three_for_two_thousands(orderObj[item.name] || 0.00)}}
</view>
<view class="order-label">{{item.label}}</view>
</view>
</view>
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head">
<!-- text-hide -->
<view class=" head-title" bindtap="handleJumpH5" data-item="{{item}}">
{{item.activityName}}
</view>
<view class="head-link" bindtap="download" data-item="{{item}}">
<image src="{{IMAGES.download}}" class="downloadIcon" webp></image>
母链海报
</view>
<view class="down-tips" wx:if="{{index == 0 && isShowTip}}">下载活动海报分享给门店开展活动</view>
</view>
<view class="content">
<view
class="content-row"
wx:for="{{merchantFormList}}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx">
<view class="content-label">{{subItem.label}}</view>
<view class="content-txt {{subItem.className}}">
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
{{subItem.isNumber ? filter.money_three_for_two_thousands(item[subItem.name]) : item[subItem.name]}}
</view>
</view>
<!-- 排名 -->
<view class="content-rank" wx:if="{{item.showStaffList.length}}">
<view class="rank-title">员工任务排名</view>
<view class="rank-table">
<view
wx:for="{{item.showStaffList}}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx">
<view class="rank">
<view class="rank-left">
<view class="rank-num">{{idx + 1}}</view>
<view class="rank-head">
<glsx-image wx:if="{{subItem.shareType == 1}}" class="icon-wechat" src="output/icon-wechat.webp" />
<image wx:if="{{subItem.imageUrl}}" src="{{subItem.imageUrl}}" />
<glsx-image wx:else src="output/icon-head.webp" />
</view>
<view class="rank-content">
<view class="rank-row">
<text wx:if="{{subItem.goodUrl}}" class="rank-row-name" bindtap="handleXiReport" data-item="{{subItem}}">{{subItem.shareName}}{{}}</text>
<text wx:else class="name-disabled" bindtap="handleXiReport" data-item="{{subItem}}">{{subItem.shareName}}</text>
<view class="down-tips" wx:if="{{orderObj.staffIdx == index && idx == 0}}">
点击员工姓名看喜报
</view>
<text class="rank-row-dept">{{subItem.departmentName || ''}}</text>
</view>
<view class="rank-row">
<text class="rank-row-txt">访客<text class="font-number">{{subItem.browseCount || 0}}</text>人</text>
<text class="rank-row-txt">成交<text class="font-number">{{subItem.dealCount || 0}}</text>单</text>
</view>
</view>
</view>
<view wx:if="{{subItem.totalAmount}}" class="rank-price txt-red font-number">
¥ {{filter.money_three_for_two_thousands(subItem.totalAmount || 0.00)}}
</view>
<view wx:else class="rank-price">暂无业绩</view>
</view>
</view>
<view
wx:if="{{item.staffList.length}}"
class="btn-more"
bindtap="handleMore"
data-idx="{{index}}">
<glsx-image class="icon-more" src="output/icon-more.webp" />
</view>
</view>
</view>
<!-- 诊断 -->
<view class="content-suggest" wx:if="{{item.activityStatus == 2 && item.suggestTxtList.length}}">
<view class="suggest-title"># 活动诊断</view>
<view class="suggest-txt">{{item.suggestTxt}}推荐以下建议:</view>
<view class="suggest-block">
<view
class="suggest-step"
wx:for="{{item.suggestList}}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx">
<view class="step-label">建议{{idx + 1}}</view>
<view class="step-txt">{{subItem}}</view>
</view>
</view>
</view>
<!-- 战报 -->
<view class="new-report" wx:if="{{item.activityStatus != 1}}">
<view
class="report-left"
bindtap="handleReport"
data-item="{{item}}"
data-idx="{{index}}">
<glsx-image class="icon-report" src="output/icon-report.webp" />
生成最新战报
</view>
<view wx:if="{{item.reportDate}}">最新更新:{{item.reportDate}}</view>
</view>
</view>
</view>
<view class="box order">
<view class="order-block" wx:for="{{orderFormList}}" wx:key="index">
<view class="order-txt font-number">
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
{{filter.money_three_for_two_thousands(orderObj[item.name] || 0.00)}}
</view>
<view class="order-label">{{item.label}}</view>
</view>
</view>
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head">
<!-- text-hide -->
<view class=" head-title" bindtap="handleJumpH5" data-item="{{item}}">
{{item.activityName}}
</view>
<view class="head-link" bindtap="download" data-item="{{item}}">
<image src="{{IMAGES.download}}" class="downloadIcon" webp></image>
母链海报
</view>
<view class="down-tips" wx:if="{{index == 0 && isShowTip}}">下载活动海报分享给门店开展活动</view>
</view>
<view class="content">
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="content-label">{{subItem.label}}</view>
<view class="content-txt {{subItem.className}}">
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
{{subItem.isNumber ? filter.money_three_for_two_thousands(item[subItem.name]) : item[subItem.name]}}
</view>
</view>
<!-- 排名 -->
<view class="content-rank" wx:if="{{item.showStaffList.length}}">
<view class="rank-title">员工任务排名</view>
<view class="rank-table">
<view wx:for="{{item.showStaffList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="rank">
<view class="rank-left">
<view class="rank-num">{{idx + 1}}</view>
<view class="rank-head">
<glsx-image wx:if="{{subItem.shareType == 1}}" class="icon-wechat" src="output/icon-wechat.webp" />
<image wx:if="{{subItem.imageUrl}}" src="{{subItem.imageUrl}}" />
<glsx-image wx:else src="output/icon-head.webp" />
</view>
<view class="rank-content">
<view class="rank-row">
<!-- <text wx:if="{{subItem.goodUrl}}" class="rank-row-name text-hide" bindtap="handleXiReport" data-item="{{subItem}}">{{subItem.shareName}}</text> -->
<text wx:if="{{subItem.goodUrl}}" class="rank-row-name text-hide">{{subItem.shareName}}</text>
<text wx:else class="name-disabled text-hide">{{subItem.shareName}}</text>
<text class="rank-row-dept">{{subItem.departmentName || ''}}</text>
</view>
<view class="rank-row">
<text class="rank-row-txt">访客<text class="font-number">{{subItem.browseCount || 0}}</text>人</text>
<text class="rank-row-txt">成交<text class="font-number">{{subItem.dealCount || 0}}</text>单</text>
</view>
</view>
</view>
<view wx:if="{{subItem.totalAmount}}" class="rank-price txt-red font-number">
¥ {{filter.money_three_for_two_thousands(subItem.totalAmount || 0.00)}}
</view>
<view wx:else class="rank-price">暂无业绩</view>
</view>
</view>
<view wx:if="{{item.staffList.length}}" class="btn-more" bindtap="handleMore" data-idx="{{index}}">
<glsx-image class="icon-more" src="output/icon-more.webp" />
</view>
</view>
</view>
<!-- 诊断 -->
<view class="content-suggest" wx:if="{{item.activityStatus == 2 && item.suggestTxtList.length}}">
<view class="suggest-title"># 活动诊断</view>
<view class="suggest-txt">{{item.suggestTxt}}推荐以下建议:</view>
<view class="suggest-block">
<view class="suggest-step" wx:for="{{item.suggestList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="step-label">建议{{idx + 1}}</view>
<view class="step-txt">{{subItem}}</view>
</view>
</view>
</view>
<!-- 战报 -->
<view class="new-report" wx:if="{{item.activityStatus != 1}}">
<view class="report-left" bindtap="handleReport" data-item="{{item}}" data-idx="{{index}}">生成最新战报</view>
<view class="report-left" bindtap="handleXiReport" data-item="{{item}}" data-idx="{{index}}">生成最新喜报</view>
</view>
</view>
</view>
</view>
<crowdfund-poster
item="{{crowdPosterItem}}"
id="crowdPoster"
scrollImg="{{false}}"
bindlongtouch="longtouch" />
<crowdfund-poster item="{{crowdPosterItem}}" id="crowdPoster" scrollImg="{{false}}" bindlongtouch="longtouch" />
<!-- <poster
posterItem="{{posterItem}}"
id="poster"
show="{{isShowPoster}}"
bindlongtouch="handlePosterTouch" /> -->
bindlongtouch="handlePosterTouch" /> -->
\ No newline at end of file
......@@ -158,7 +158,13 @@ Page({
}
outputApi.getSceneProStatus(params).then(res => {
var data = this.dealOpenActivity(res)
var sceneObj = {}
// sceneStatus:0未开通 1已开通
res.forEach((item, idx) => {
sceneObj['scene' + (idx + 1)] = item.sceneStatus == 1
})
this.setData({
sceneObj: sceneObj,
['sceneActivityObj.scene1']: data[0].productList,
['sceneActivityObj.scene2']: data[1].productList,
['sceneActivityObj.scene3']: data[2].productList,
......@@ -308,13 +314,8 @@ Page({
if (curItem) {
curItem.totalNum = curItem.activityList.length
curItem.shareBtnIdx = -1
curItem.staffIdx = -1
let shareFlag = false
curItem.activityList.forEach((k, kIdx) => {
// 员工喜报
if (curItem.staffIdx == -1 && k.staffList?.length && k.staffList[0].imageUrl) {
curItem.staffIdx = kIdx
}
// 分享按钮判断shareStatus:活动分享状态 0:未分享 1:已分享
if (k.activityStatus == 2 && k.shareStatus == 0) {
curItem.shareBtnIdx = shareFlag ? -1 : kIdx + ''
......@@ -407,37 +408,37 @@ Page({
// show: true
// })
// } catch (error) {
wx.$api.showLoading('加载中...')
outputApi
.getPosterUrl({
id: item.activityId
})
.then(res => {
item.posterUrl = res
this.setData({
crowdPosterItem: item,
isShowTip: false
})
})
.catch(() => {
wx.$api.showToast('下载海报失败')
wx.$api.showLoading('加载中...')
outputApi
.getPosterUrl({
id: item.activityId
})
.then(res => {
item.posterUrl = res
this.setData({
crowdPosterItem: item,
isShowTip: false
})
})
.catch(() => {
wx.$api.showToast('下载海报失败')
})
// }
},
/**长按海报 */
async longtouch(e) {
console.log('长按海报', e)
// console.log('长按海报', e)
let { activityId } = e.detail
const res = await outputApi.reportPosterTrack({
activityId
})
wx.$eventbus.emit('clienRefresh')
wx.$eventbus.emit('clientRefresh')
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
},
// 母链分享
posterTrack() {
wx.$eventbus.emit('clienRefresh')
wx.$eventbus.emit('clientRefresh')
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
},
......@@ -456,13 +457,13 @@ Page({
onLoad(options) {
this.initTime()
wx.$router.getData(obj => {
var scene = {}
Object.keys(this.data.sceneObj).forEach(item => {
scene[item] = obj[item]
})
// var scene = {}
// Object.keys(this.data.sceneObj).forEach(item => {
// scene[item] = obj[item]
// })
this.setData({
merchantInfo: obj,
sceneObj: scene,
// sceneObj: scene,
sceneCodeList: obj.sceneCodeList
})
......@@ -477,5 +478,21 @@ Page({
wx.setNavigationBarTitle({
title: this.data.merchantInfo.merchantName
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
this.initTime()
this.setData({
activityActive: 0,
sceneActive: 4
})
wx.$api.showToast({
title: '刷新成功',
icon: 'success'
})
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1], true)
}
})
{
"enablePullDownRefresh": true,
"usingComponents": {
"scene-box": "../../../components/SceneBox/SceneBox",
"output-transform": "../components//outputTransform/outputTransform",
......
......@@ -433,12 +433,12 @@ Page({
if (posterId == result.valueUrl) return
// 为2是已经展示过了
wx.$storage.set('posterId', result.valueUrl)
let updatedTime = deleteSecond(result.updatedTime)
let updatedTime = deleteSecond(result.createdTime)
console.log(updatedTime)
this.setData({
posterItem: {
activityName: result.activityName,
// posterUrl: 'https://wx.glsx.com.cn/upload/biz/587076735934271488.png'
// posterUrl: 'https://wx.glsx.com.cn/upload/biz/598888808108396544.png',
posterUrl: result.valueUrl,
// crowdFundActivityId: item.valueUrl,
updatedTime,
......
......@@ -104,7 +104,7 @@
</view>
</view>
<!-- -->
<crowdfund-poster wx:show="{{!guideShow}}" item="{{posterItem}}" />
<crowdfund-poster wx:if="{{!guideShow}}" item="{{posterItem}}" />
<!-- 全屏视频组件 -->
<!-- <FullscreenVideo id="videocomp" src="{{videoSrc}}" title="{{videoTitle}}" /> -->
......
......@@ -36,14 +36,13 @@ Page({
const fn = wx.getFileSystemManager()
fn.readdir({
dirPath: wx.env.USER_DATA_PATH,
success({
files
}) {
files.length && files.map(e => {
fn.unlink({
filePath: `${wx.env.USER_DATA_PATH}/${e}`
success({ files }) {
files.length &&
files.map(e => {
fn.unlink({
filePath: `${wx.env.USER_DATA_PATH}/${e}`
})
})
})
}
})
// wx.$storage.rm('fileList')
......@@ -67,7 +66,9 @@ Page({
messageBoxPageIsRead() {
let { serviceMerchantId } = this.data
mineApi
.messageBoxPageIsRead({ serviceMerchantId })
.messageBoxPageIsRead({
serviceMerchantId
})
.then(result => {
console.log(result)
this.setData({
......
......@@ -30,7 +30,7 @@ Component({
},
lifetimes: {
attached() {
wx.$eventbus.on('clienRefresh', res => {
wx.$eventbus.on('clientRefresh', res => {
this.clientRefresh()
})
this.getPMerchantInfo()
......@@ -54,6 +54,7 @@ Component({
},
clientRefresh(isPull = false) {
this.getPMerchantInfo()
console.log('clientRefresh');
this.setData({
['pageObj.currentPage']: 1,
list: []
......@@ -117,41 +118,26 @@ Component({
activityId: this.data.list[idx].activityLastUnSharedInfo.id,
activityName: this.data.list[idx].activityLastUnSharedInfo.activityName
}
// const {
// item
// } = e.currentTarget.dataset,
console.log(item)
const posterObj = this.selectComponent('#poster')
const { options } = wx.$router.getPageInstance()
console.log(options)
try {
let flag = await posterObj.check(item)
posterObj.setData({
poster: flag,
show: true
wx.$api.showLoading('加载中...')
outputApi
.getPosterUrl({
id: item.activityId
})
} catch (error) {
wx.$api.showLoading('加载中...')
outputApi
.getPosterUrl({
id: item.activityId
.then(res => {
item.posterUrl = res
this.setData({
posterItem: item,
isShowTip: false
})
.then(res => {
item.posterUrl = res
this.setData({
posterItem: item,
isShowTip: false
})
})
.catch(() => {
wx.$api.showToast('下载海报失败')
})
}
})
.catch(() => {
wx.$api.showToast('下载海报失败')
})
},
/**长按海报 */
async longtouch(e) {
console.log('长按海报', e)
this.onBindRefresh()
this.clientRefresh()
let { activityId } = e.detail
const res = await outputApi.reportPosterTrack({
activityId
......
{
"appid": "wx24ebae5768e74138",
"appid": "wx2c28337db96364d2",
"projectname": "business-assistant",
"compileType": "miniprogram",
"packOptions": {
......
......@@ -153,6 +153,8 @@ export function setPrice(price) {
}
export function deleteSecond(time) {
console.log(time)
if (!time.length) return ''
time = time.split(' ')
let moth = time[0].split('-')
let hour = time[1].split(':')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!