Commit 55c0c112 by chenwq

联调,样式

1 parent 9fb68234
......@@ -95,7 +95,7 @@ class outputApi {
/**获取活动最新战报 */
getNewReportUrl(data) {
return api.post({
method: 'scrm.api.assistant.crowd.activity.newest.report',
method: 'scrm.api.stoassistant.crowd.activity.newest.report',
...data
})
}
......
......@@ -7,7 +7,7 @@
<image webp wx:if="{{formData['scene' + (index + 1)]}}" class="scene-img" src="{{IMGURL}}output/caracticon0{{index + 1}}.png?v={{img_version}}"></image>
<view wx:else class="no-open-img">
<image webp wx:if="{{hasLockIcon}}" class="lock-img" src="{{IMGURL}}output/carlock0{{index + 1}}.png?v={{img_version}}"></image>
<image webp wx:else="" class="scene-img" src="{{IMGURL}}output/car0{{index + 1}}.png?v={{img_version}}"></image>
<image webp wx:else="" class="scene-img" src="{{IMGURL}}output/icon-car0{{index + 1}}.png?v={{img_version}}"></image>
</view>
<view class="scene-title {{formData['scene' + (index + 1)] ? '' : 'on-open'}}">
{{item.title}}
......
......@@ -267,7 +267,7 @@ Component({
} catch ({
errMsg
}) {
console.error(errMsg)
// console.error(errMsg)
this.reLogin()
}
},
......
......@@ -32,6 +32,7 @@ Component({
IMGURL: IMG_URL,
IMAGES,
isShowTip: true,
isShowPoster: false,
orderFormList: [{
label: '总场次',
name: 'totalNum'
......@@ -58,18 +59,19 @@ Component({
{
label: '订单数',
name: 'orderCount',
isNumber: true
className: 'font-number'
},
{
label: '产值',
name: 'realAmount',
className: 'red',
className: 'red font-number',
prefix: '¥',
isNumber: true
},
{
label: '预估产值',
name: 'predictAmount',
className: 'font-number',
prefix: '¥',
isNumber: true
}
......@@ -178,7 +180,7 @@ Component({
const {
item
} = e.currentTarget.dataset,
posterObj = this.selectComponent('#poster'),
posterObj = this.selectComponent('#crowdPoster'),
{ options } = wx.$router.getPageInstance()
console.log(options)
try {
......@@ -194,7 +196,7 @@ Component({
}).then(res => {
item.posterUrl = res
this.setData({
posterItem: item,
crowdPosterItem: item,
isShowTip: false
})
}).catch(() => {
......@@ -213,20 +215,49 @@ Component({
})
console.log(res)
},
/**长按战报/喜报 */
async handlePosterTouch(e) {
},
/**战报 */
handleReport(e) {
const {
item
} = e.currentTarget.dataset
wx.$api.showLoading("战报生成中")
outputApi.getNewReportUrl({ activityId: item.activityId }).then(res => {
console.log(res)
// item.posterUrl = res
// this.setData({
// posterItem: item,
// isShowTip: false
// })
var posterItem = {
posterUrl: res || 'https://wx.glsx.com.cn/upload/biz/592250239952490496.png',
date: new Date().toLocaleDateString()
}
this.setData({
posterItem: posterItem,
isShowPoster: true
})
}).catch(() => {
wx.$api.showToast('下载战报失败')
}).finally(() => {
wx.$api.hideLoading()
})
},
/**喜报 */
handleXiReport(e) {
const {
item
} = e.currentTarget.dataset
if(!item.goodUrl) {
wx.$api.showToast('喜报生成失败')
return true
}
var posterItem = {
posterUrl: item.goodUrl,
date: item.goodReportDate
}
this.setData({
posterItem: posterItem,
isShowPoster: true
})
}
}
......
{
"component": true,
"usingComponents": {}
"usingComponents": {
"poster": "../poster/poster"
}
}
......@@ -141,8 +141,9 @@
height: 72rpx;
line-height: 72rpx;
text-align: center;
font-size: 20rpx;
font-size: 26rpx;
color: #5A6066;
font-weight: 600;
border-bottom: 1rpx solid rgba(204, 206, 209, 0.50);
// .activity-status {
......@@ -195,6 +196,12 @@
margin-right: 12rpx;
}
.name-disabled {
font-size: 24rpx;
color: #5A6066;
margin-right: 12rpx;
}
&-dept {
color: #8A8C90;
}
......@@ -226,11 +233,15 @@
.rank-price {
text-align: right;
font-size: 26rpx;
color: #F35251;
color: #8A8C90;
height: 64rpx;
line-height: 64rpx;
}
.txt-red {
color: #F35251;
}
// .th,
// .td {
// width: calc((100% - 116rpx) / 4);
......
<!-- 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.isNumber ? 'font-number': ''}} {{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-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>
<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> -->
<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">
......@@ -81,21 +41,18 @@
<glsx-image class="rank-head" src="output/icon-head.webp"></glsx-image>
<view class="rank-content">
<view class="rank-row">
<text class="rank-row-name">{{subItem.shareName}}</text>
<text class="rank-row-dept">运营部</text>
<text wx:if="{{subItem.totalAmount}}" class="rank-row-name" bindtap="handleXiReport" data-item="{{subItem}}">{{subItem.shareName}}</text>
<text wx:else class="name-disabled">{{subItem.shareName}}</text>
<text class="rank-row-dept">{{subItem.departmentName}}</text>
</view>
<view class="rank-row">
<text class="rank-row-txt">访客136人</text>
<text class="rank-row-txt">成交</text>
<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 class="rank-price">¥ {{subItem.totalAmount}}</view>
<!-- <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 + 1}}</view>
<text wx:if="{{i.prefix}}">{{i.prefix}}</text>
{{subItem[i.name]}}
</view> -->
<view wx:if="{{subItem.totalAmount}}" class="rank-price txt-red font-number">¥ {{subItem.totalAmount}}</view>
<view wx:else class="rank-price">暂无业绩</view>
</view>
</view>
<view wx:if="{{item.staffList.length}}" class="btn-more" bindtap="handleMore" data-idx="{{index}}">
......@@ -107,7 +64,6 @@
<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">
......@@ -118,15 +74,15 @@
</view>
</view>
<!-- 战报 -->
<view class="new-report">
<view class="new-report" wx:if="{{item.activityStatus != 1}}">
<view class="report-left" bindtap="handleReport" data-item="{{item}}">
<glsx-image class="icon-report" src="output/icon-report.webp"></glsx-image>
生成最新战报
</view>
<view>最新更新:</view>
<view wx:if="{{item.reportDate}}">最新更新:{{item.reportDate}}</view>
</view>
</view>
</view>
</view>
<crowdfund-poster item="{{posterItem}}" id="poster" scrollImg="{{false}}" bindlongtouch="longtouch" />
<crowdfund-poster item="{{crowdPosterItem}}" id="crowdPoster" scrollImg="{{false}}" bindlongtouch="longtouch" />
<poster posterItem="{{posterItem}}" id="poster" show="{{isShowPoster}}" bindlongtouch="handlePosterTouch" />
\ No newline at end of file
// packagesList/packageOutput/components/poster/poster.js
Component({
/**
* 组件的属性列表
*/
properties: {
posterItem: {
type: Object,
value: {}
},
show: {
type: Boolean,
value: false
},
scrollImg: {
type: Boolean,
value: true
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
hide() {
this.setData({
show: false,
poster: ''
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packagesList/packageOutput/components/poster/poster.wxss */
.layout {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 998;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.bg {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
background: rgba(0,0,0,.8);
}
.bg-white {
padding: 32rpx 32rpx 0 32rpx;
background-color: #FFFFFF;
}
.poster {
width: 500rpx;
height: 68%;
// height: 1108rpx;
overflow: scroll;
border-radius: 8rpx 8rpx 0 0;
}
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 500rpx;
height: 90rpx;
background: #F7F8FA;
border-radius: 0 0 12rpx 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #3666FE;
margin-top: -2rpx;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 12rpx;
}
}
.tips {
margin: 40rpx 80rpx 0;
font-size: 24rpx;
color: #FFFFFF;
line-height: 36rpx;
.underline{
font-weight: 600;
text-decoration: underline;
}
}
}
\ No newline at end of file
<!--packagesList/packageOutput/components/poster/poster.wxml-->
<block wx:if="{{show}}">
<!-- catchtouchmove="noScroll" -->
<view class="layout">
<view class="bg" bindtap="hide" />
<block wx:if="{{scrollImg}}">
<view class="poster">
<!-- <scroll-view scroll-x="false" scroll-y="true" style="height: 100%"> -->
<image src="{{posterItem.posterUrl}}" mode="widthFix" show-menu-by-longpress />
<!-- </scroll-view> -->
</view>
</block>
<block wx:else>
<image src="{{posterItem.posterUrl}}" class="poster" mode="widthFix" show-menu-by-longpress bindlongpress="longpress" />
</block>
<view class="btn">
<glsx-image src="output/longtap.png" class="icon"></glsx-image>
长按图片转发
</view>
<view class="tips">最近更新时间:{{posterItem.date}} </view>
</view>
</block>
<!-- <authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" isShowCheck="{{false}}" id="auth" /> -->
......@@ -18,9 +18,9 @@
<view class="activity-box" wx:if="{{sceneActive != 1}}">
<view wx:for="{{activityList}}" wx:key="index" class="activity-item">
<!-- productStatus:0未申请;1申请中;2已开通;3:已结束 -->
<view wx:if="{{item.openFlag != 0}}">
<glsx-image wx:if="{{item.productStatus == 1}}" src="output/mark-active.webp" class="icon-mark"></glsx-image>
<glsx-image wx:if="{{item.productStatus == 2}}" src="output/mark-open.webp" class="icon-mark"></glsx-image>
<view wx:if="{{item.openFlag != 0 && item.productStatus == 2}}">
<glsx-image wx:if="{{sceneActive == 4}}" src="output/mark-active.webp" class="icon-mark"></glsx-image>
<glsx-image wx:if="{{sceneActive == 2 || sceneActive == 3}}" src="output/mark-open.webp" class="icon-mark"></glsx-image>
</view>
<view wx:if="{{item.openFlag == 0}}" class="text-hide {{ item.checked ? 'active' : '' }}" bindtap="handleActClick" data-idx="{{index}}">{{item.productName}}</view>
<view class="text-hide item-disabled" wx:else>{{item.productName}}</view>
......
......@@ -74,6 +74,8 @@ Page({
activityActive: idx,
// productStatus:0未申请;1申请中;2已开通;3:已结束
isShowData: [2, 3].includes(+this.data.activityList[idx].productStatus)
// 删----
// isShowData: true
})
if ([2, 3].includes(this.data.sceneActive)) {
this.getCustomerDetail(false, false)
......@@ -289,18 +291,29 @@ Page({
getActivityRevenue(isFirst = false) {
wx.showLoading()
var params = this.dealSearchStatus()
outputApi.getActivityRevenue({ merchantId: this.data.merchantInfo.merchantId, ...params }).then(res => {
// 删----
// outputApi.getActivityRevenue({ merchantId: 44211227, ...params }).then(res => {
outputApi.getActivityRevenue({ merchantId: this.data.merchantInfo.merchantId, ...params }).then(res => {
// console.log(this.data.sceneActivityObj, '++++++')
var actList = this.data.sceneActivityObj['scene' + (isFirst ? 4 : this.data.sceneActive)]
var total = 0
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)
if (curItem) {
curItem.totalNum = curItem.activityList.length
curItem.activityList.forEach(k => {
curItem.shareBtnIdx = -1
let shareFlag = false
curItem.activityList.forEach((k, kIdx) => {
// 分享按钮判断shareStatus:活动分享状态 0:未分享 1:已分享
if (k.activityStatus == 2 && k.shareStatus == 0) {
curItem.shareBtnIdx = shareFlag ? -1 : kIdx
shareFlag = true
}
// 时间
k.time = k.startTime.slice(0, 16).replace(/-/g, '.') + ' - ' + k.endTime.slice(0, 16).replace(/-/g, '.')
let startTimeFormat = k.startTime.slice(0, 10).replace(/-/g, '/') + ' 00:00:00'
......@@ -315,11 +328,11 @@ Page({
let endTimeFormat = k.endTime.slice(0, 10).replace(/-/g, '/') + ' 23:59:59'
k.interDays = parseInt((new Date().getTime() - new Date(startTimeFormat).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.toEndDays = parseInt((new Date(endTimeFormat).getTime() - new Date(nowDateFormat).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.realTime = '-'
k.realTime = k.realStartTime?.slice(0, 16).replace(/-/g, '.') + ' - ' + '已开始' + k.interDays + '天'
break
case 3:
k.interDays = parseInt((new Date(nowDateFormat).getTime() - new Date(k.endTime.replace(/-/g, '/')).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.realTime = '-'
k.realTime = (k.realStartTime?.slice(0, 16).replace(/-/g, '.') || '') + ' - ' + (k.realEndTime?.slice(0, 16).replace(/-/g, '.') || '')
break
}
k.suggestTxtList = []
......@@ -341,6 +354,10 @@ Page({
k.suggestTxt = k.suggestTxtList.join(',') + '。'
}
})
// 定位进行中的活动
if (activitingIdx == -1 && curItem.shareBtnIdx != -1) {
activitingIdx = idx
}
actList[idx].outputData = curItem
} else {
actList[idx].outputData = []
......@@ -350,16 +367,67 @@ Page({
this.setData({
['sceneActivityObj.scene' + this.data.sceneActive]: actList
})
this.setCurActivity()
}
if (this.data.sceneActive == 4) {
var params = {
currentTarget: {
dataset: {
idx: activitingIdx
}
}
}
this.handleActChange(params)
}
this.setData({
['scenePriceList[3].total']: total.toFixed(2)
})
!isFirst && this.setCurActivity()
}).finally(() => {
wx.hideLoading()
})
},
// 分享母链
async handleBtnShare(e) {
const idx = this.data.activityList[this.data.activityActive].outputData.shareBtnIdx
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({
poster: flag,
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('下载海报失败')
})
}
},
/**长按海报 */
async longtouch(e) {
console.log('长按海报', e)
let {
activityId
} = e.detail
const res = await outputApi.reportPosterTrack({
activityId
})
console.log(res)
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
},
/**
* 生命周期函数--监听页面加载
*/
......
......@@ -60,9 +60,10 @@
<view class="btn-disabled">点击开通</view>
</view>
</view>
<view wx:if="{{sceneActive == 4}}" class="isFullSucreen btn-box shadow">
<view wx:if="{{sceneActive == 4 && activityList[activityActive].outputData.shareBtnIdx != -1}}" class="isFullSucreen btn-box shadow" bindtap="handleBtnShare" data-item="">
<view class="btn">
<view class="btn-share">活动进行中,分享母链海报开展活动</view>
</view>
</view>
</view>
\ No newline at end of file
</view>
<crowdfund-poster item="{{crowdPosterItem}}" id="crowdPoster" scrollImg="{{false}}" bindlongtouch="longtouch" />
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!