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