Commit 5c351bd3 by 前端

fixed

1 parent 9d0d4e53
Showing 35 changed files with 444 additions and 402 deletions
...@@ -312,10 +312,18 @@ class ActivityApi { ...@@ -312,10 +312,18 @@ class ActivityApi {
} }
activityStaffRank(data) { activityStaffRank(data) {
return api.post({ return api.post({
method: `scrm.api.assistant.activity.staff.rank `, method: `scrm.api.assistant.activity.staff.rank`,
...data ...data
}) })
} }
/*门店助手-店总版售后众筹活动相关统计*/
// getActivityList(data) {
// return api.post({
// method: ` scrm.api.assistant.activity.statics`,
// ...data
// })
// }
} }
......
...@@ -68,7 +68,9 @@ ...@@ -68,7 +68,9 @@
"name": "packageOutput", "name": "packageOutput",
"pages": [ "pages": [
"pages/openBusiness", "pages/openBusiness",
"pages/summary" "pages/summary",
"pages/shareWebview/shareWebview",
"pages/visitor/visitor"
] ]
}, },
{ {
......
...@@ -53,8 +53,12 @@ Page({ ...@@ -53,8 +53,12 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
const {activityId} = options
this.getDetail(activityId) },
onRoute(options) {
console.log(options)
const {id} = options
this.getDetail(id)
}, },
formatArr(arr, fn) { formatArr(arr, fn) {
let res = {} let res = {}
......
<!--packageOutput/pages/crowdDetail/crowdDetail.wxml--> <!--packageOutput/pages/crowdDetail/crowdDetail.wxml-->
<view class="container"> <view class="container">
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady">产值详情</navigation-bar> <navigation-bar showBack="{{true}}" navStyle="{{navStyle}}" bindnavbarReady="navbarReady">产值详情</navigation-bar>
<view class="layout" id="layout" style="top:{{navHeight}}px; height: calc(100vh - 150rpx)"> <view class="layout" id="layout" style="top:{{navHeight}}px; height: calc(100vh - 150rpx)">
<!-- 背景图 --> <!-- 背景图 -->
<view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight}}px"> <view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight}}px">
......
...@@ -23,7 +23,7 @@ Page({ ...@@ -23,7 +23,7 @@ Page({
}, { }, {
label: '产值', label: '产值',
name: 'outputValue', name: 'outputValue',
unit: '' _unit: '¥'
}], }],
outputValueBoutique: [{ outputValueBoutique: [{
label: '发券量(总)/张', label: '发券量(总)/张',
...@@ -36,15 +36,15 @@ Page({ ...@@ -36,15 +36,15 @@ Page({
}, { }, {
label: '营业额(总)/元', label: '营业额(总)/元',
name: 'orderMoneyTotal', name: 'orderMoneyTotal',
unit: '' _unit: '¥'
}, { }, {
label: '客单价/元', label: '客单价/元',
name: 'averagePrice', name: 'averagePrice',
unit: '' _unit: '¥'
}, { }, {
label: '转化率', label: '转化率',
name: 'upgradeRatio', name: 'upgradeRatio',
unit: '' unit_: '%'
}], }],
}, },
billboard: [{ billboard: [{
......
...@@ -104,6 +104,9 @@ ...@@ -104,6 +104,9 @@
font-size: 44rpx; font-size: 44rpx;
color: #1B233D; color: #1B233D;
line-height: 64rpx; line-height: 64rpx;
._unit {
font-size: 28rpx;
}
} }
.output-label { .output-label {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</view> </view>
<view class="output-value"> <view class="output-value">
<view class="output-item" wx:for="{{outputView[type == 2?'outputValue':'outputValueBoutique']}}" wx:key="{{index}}"> <view class="output-item" wx:for="{{outputView[type == 2?'outputValue':'outputValueBoutique']}}" wx:key="{{index}}">
<view class="output-num">{{outputData[item.name]||0}}</view> <view class="output-num"><text class="_unit">{{item._unit}}</text> {{outputData[item.name] ||0}}<text class="unit_">{{item.unit_}}</text></view>
<view class="output-label">{{item.label}}</view> <view class="output-label">{{item.label}}</view>
</view> </view>
</view> </view>
......
...@@ -71,103 +71,6 @@ const handlerMiss = (data, query, callBack) => { ...@@ -71,103 +71,6 @@ const handlerMiss = (data, query, callBack) => {
val.isCollapse = true val.isCollapse = true
val.startTime = val.startTime.split(' ')[0] val.startTime = val.startTime.split(' ')[0]
val.endTime = val.endTime.split(' ')[0] val.endTime = val.endTime.split(' ')[0]
// 活动中/活动未开始默认展开第一条 数据处理
// 处理不同模块的判断条件
let condition = false
let zc = val.activityStatus != 3 && index == 0 && pageNum == 1
let zc_3 = val.activityStatus == 3 && index == 0 && pageNum == 1
let pzj = val.activityStatus != 3 && index == 0
let bussinessScene = 3
if (serviceType == 0) {
condition = zc
} else {
condition = pzj
bussinessScene = 2
}
if (condition) {
val.isloading = true
ActivityApi.getActiveTaskList({ activityId: val.id, bussinessScene }, { isShowLoading: true }).then(res => {
res.forEach(a => {
a.platformMerchantMissionResponseList &&
a.platformMerchantMissionResponseList.forEach(k => {
k.detailInfo = { activityId: val.id, imgUrlList: [] }
k.platformMerchantMissionMaterialResponseList &&
k.platformMerchantMissionMaterialResponseList.forEach(i => {
// materialType 素材类型1文案 2图片 3视频 4专属链接
if (i.materialType == 1) {
// 文案
k.detailInfo.textContent = i.materialContent
}
if (i.materialType == 2 || i.materialType == 3) {
// 图片视频
k.detailInfo.imgUrlList.push({
url: i.materialContent,
type: i.materialType == 2 ? 'image' : 'video'
})
}
if (i.materialType == 4) {
// 链接
k.detailInfo.linkUrl = val.activityUrl
}
})
})
})
val.isloading = false
val.missionList = res
val.newtaskCalenderList = calenderFilter(JSON.parse(JSON.stringify(val.missionList)) || [], 7)
let d = new Date()
let nowDate = (d.getMonth() + 1).toString().padStart(2, '0') + '月' + d.getDate().toString().padStart(2, '0') + '日'
let ind = 0
val.calenderActiveIndex = 0
val.newtaskCalenderList.forEach((v, index) => {
v.forEach(k => {
k.time = (new Date(k.activityTime).getMonth() + 1).toString().padStart(2, '0') + '月' + new Date(k.activityTime).getDate().toString().padStart(2, '0') + '日'
k.ind = ind
let completeStatusNum = 0
k.platformMerchantMissionResponseList.forEach(i => {
if (i.completeStatus == 2) completeStatusNum++
})
if (nowDate == k.time) {
val.calenderActiveIndex = index
callBack && callBack({ activeDateIndex: ind })
}
// status 1过去日期任务全部完成 2过去日期任务有未完成的 3当前日期或未来日期
if (completeStatusNum == v.length && d.getTime() > new Date(`${k.activityTime.replace(/-/g, '/')} 23:59:59`).getTime()) {
k.status = 1
} else if (d.getTime() > new Date(`${k.activityTime.replace(/-/g, '/')} 23:59:59`).getTime()) {
k.status = 2
} else {
k.status = 3
}
ind++
})
})
val.isCollapse = false
let itemVal = `${listName}[${index}]`
callBack && callBack({ [itemVal]: val })
}).catch(err => {
console.log(err);
val.isloading = false
})
} else if (zc_3 && serviceType == 0) {
ActivityApi.getActivityEndInstallOrderList({ activityId: val.id }, { isShowLoading: true })
.then(res => {
val.isCollapse = false
res.orderList &&
res.orderList.forEach(it => {
it.time = it.createdDate ? new Date(it.createdDate).format('yyyy-MM-dd hh:mm') : ''
})
val.orderList = res.orderList
val.orderTotal = res.orderTotal
val.reInstallContactsName = res.reInstallContactsName
val.reInstallContactsPhone = res.reInstallContactsPhone
let itemVal = `${listName}[${index}]`
callBack && callBack({ [itemVal]: val })
})
.catch(err => {
val.isloading = false
})
}
}) })
const RESULT = { const RESULT = {
[listName]: pageNum == 1 ? data.list : [...orginList, ...data.list], [listName]: pageNum == 1 ? data.list : [...orginList, ...data.list],
......
...@@ -20,8 +20,7 @@ Component({ ...@@ -20,8 +20,7 @@ Component({
outputView: { outputView: {
outputValue: [{ outputValue: [{
label: '总报价量', label: '总报价量',
name: 'totalQuotationCount', name: 'totalQuotationCount'
unit: ''
}, { }, {
label: '总成交量', label: '总成交量',
name: 'totalSuccessCount', name: 'totalSuccessCount',
...@@ -29,11 +28,11 @@ Component({ ...@@ -29,11 +28,11 @@ Component({
}, { }, {
label: '总产值', label: '总产值',
name: 'totalOutputValue', name: 'totalOutputValue',
unit: '' _unit: '¥'
}, { }, {
label: '当月报价量', label: '当月报价量',
name: 'monthQuotationCount', name: 'monthQuotationCount',
unit: '' _unit: '¥'
}, { }, {
label: '当月成交量', label: '当月成交量',
name: 'monthSuccessCount', name: 'monthSuccessCount',
...@@ -41,19 +40,20 @@ Component({ ...@@ -41,19 +40,20 @@ Component({
}, { }, {
label: '当月产值', label: '当月产值',
name: 'monthOutputValue', name: 'monthOutputValue',
unit: '' _unit: '¥'
}, { }, {
label: '单价', label: '单价',
name: 'avgPrice', name: 'avgPrice',
unit: '' _unit: '¥'
}, { }, {
label: '升级率', label: '升级率',
name: 'conversionRate', name: 'conversionRate',
unit: '' unit_: '%',
multiple: 100,
}, { }, {
label: '平均车险报价', label: '平均车险报价',
name: 'avgQuotationPrice', name: 'avgQuotationPrice',
unit: '' _unit: '¥'
}], }],
boutiqueOutputValue: [{ boutiqueOutputValue: [{
label: '发券量(总)/张', label: '发券量(总)/张',
...@@ -66,15 +66,15 @@ Component({ ...@@ -66,15 +66,15 @@ Component({
}, { }, {
label: '营业额(总)/元', label: '营业额(总)/元',
name: 'orderMoneyTotal', name: 'orderMoneyTotal',
unit: '' _unit: '¥'
}, { }, {
label: '客单价/元', label: '客单价/元',
name: 'averagePrice', name: 'averagePrice',
unit: '' _unit: '¥'
}, { }, {
label: '转化率', label: '转化率',
name: 'upgradeRatio', name: 'upgradeRatio',
unit: '' unit_: '%'
}], }],
todayOutiqueOutputValue: [{ todayOutiqueOutputValue: [{
label: '发券量/张', label: '发券量/张',
......
...@@ -29,9 +29,13 @@ ...@@ -29,9 +29,13 @@
text-align: center; text-align: center;
.output-num { .output-num {
font-weight: 600;
font-size: 40rpx; font-size: 40rpx;
color: #1B233D; color: #1B233D;
line-height: 48rpx; line-height: 48rpx;
._unit {
font-size: 28rpx;
}
} }
.output-label { .output-label {
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<view class="output-title">产值总览</view> <view class="output-title">产值总览</view>
<view class="output-value"> <view class="output-value">
<view class="output-item" wx:for="{{outputView[entranceType == 2?'outputValue':'boutiqueOutputValue']}}"> <view class="output-item" wx:for="{{outputView[entranceType == 2?'outputValue':'boutiqueOutputValue']}}">
<view class="output-num">{{outputData[item.name]||0}}</view> <view class="output-num"><text class="_unit">{{item._unit}}</text> {{outputData[item.name] * (item.multiple || 1)||0}}<text class="unit_">{{item.unit_}}</text></view>
<view class="output-label">{{item.label}}</view> <view class="output-label">{{item.label}}</view>
</view> </view>
</view> </view>
<view class="output-title">当日日新增</view> <view class="output-title">当日新增</view>
<view class="output-value today"> <view class="output-value today">
<view class="output-item" wx:for="{{outputView[entranceType ==2 ?'todayOutputValue':'todayOutiqueOutputValue']}}"> <view class="output-item" wx:for="{{outputView[entranceType ==2 ?'todayOutputValue':'todayOutiqueOutputValue']}}">
<view class="output-num">{{outputData[item.name]|| 0}} </view> <view class="output-num">{{outputData[item.name]|| 0}} </view>
......
import ActivityApi from '~/api/activityApi/index' import ActivityApi from '~/api/activityApi/index'
import {handlerMiss} from '~/packagesList/common/common' import { handlerMiss } from '~/packagesList/common/common'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
isHaveSubcribe:Boolean, isHaveSubcribe: Boolean,
ids:Array, ids: Array,
entranceType:{ entranceType: {
type:Number, type: Number,
observer:function(val){ observer: function (val) {
if(val>-1&&this.control){ if (val > -1 && this.control) {
this.initLocal(val) this.initLocal(val)
}
}
},
fresh: {
type: Boolean,
observer: function (val) {
if (val) {
this.setData({
pageNum: 1
}, () => {
this.initLocal(this.data.entranceType)
})
}
}
} }
}
}, },
fresh:{
type:Boolean,
observer: function (val) {
if(val){
this.setData({
pageNum: 1
}, () => {
this.initLocal(this.data.entranceType)
})
}
}
}
},
/**
* 组件的初始数据
*/
data: {
listData: [],
activeTrigger: false,
activePageNum: 1,
activeTotal: 0,
pageNum: 1,
total: 0,
pageSize: 10,
noResult:false
},
/** /**
* 组件的方法列表 * 组件的初始数据
*/ */
methods: { data: {
// 初始化 tabList: [
initLocal(val){ { label: '全部', status: '' },
this.setData({ { label: '进行中', status: 1 },
{ label: '待开始', status: 2 },
{ label: '已结束', status: 3 }
],
listData: [], listData: [],
activeTrigger: false, activeTrigger: false,
activePageNum: 1, activePageNum: 1,
...@@ -57,80 +46,90 @@ Component({ ...@@ -57,80 +46,90 @@ Component({
pageNum: 1, pageNum: 1,
total: 0, total: 0,
pageSize: 10, pageSize: 10,
noResult:false noResult: false
},()=>{
this.getActivity(val)
})
}, },
// 获取数据
getActivity(type){ /**
let { pageSize, pageNum,listData,ids } = this.data * 组件的方法列表
let paraList = [],apiName = 'getActivityList',para = {pageNum,pageSize} */
if(type==1){ methods: {
ids.forEach(el=>{ // 初始化
if((el.serviceType==1&&type==1) || (el.serviceType==2&&type==2)){ initLocal(val) {
if(el.activityId){ this.setData({
paraList.push(el.activityId) listData: [],
} activeTrigger: false,
} activePageNum: 1,
}) activeTotal: 0,
para.ids = paraList pageNum: 1,
apiName = 'getSubscribeListByIdsApi' total: 0,
if(!paraList.length)return this.setData({noResult:true}) pageSize: 10,
}else if([2,5,6].includes(type)){ noResult: false
para.subscribe = type }, () => {
apiName = 'getActivityPageBySubscribe' this.getActivity(val)
} })
ActivityApi[apiName](para).then(res=>{ },
if(res&&res.list){ // 获取数据
handlerMiss(res,{serviceType:type,pageNum,listName:'listData',orginList:listData},(result)=>{ getActivity(type) {
if(result&&result.total&&type==0){ const activityItem = this.selectComponent('.activityItem')
this.triggerEvent('total',{type:0,total:result.total || 0}) const {status} = activityItem.data
let { pageSize, pageNum, listData, acticityName } = this.data
let apiName = 'getActivityList', para = { pageNum, pageSize, sessionId: 'mini-ca84848c-d589-4ceb-9c34-bd323ec16e93-rop' }
ActivityApi[apiName](para).then(res => {
if (res && res.list) {
handlerMiss(res, { serviceType: type, pageNum, listName: 'listData', orginList: listData }, (result) => {
this.setData(result)
})
}
})
},
handleBlur(e) {
const acticityName = e.detail.value;
this.setData({acticityName})
this.activityTab()
},
toFresh(e) {
if (e.detail) {
this.setData({
listData: e.detail
})
} }
this.setData(result) },
}) activityTab() {
} this.getActivity(this.data.entranceType)
}) },
}, // 下拉刷新
toFresh(e) { activityRefresh(e) {
if (e.detail) { this.setData({
this.setData({ pageNum: 1
listData: e.detail }, () => {
}) this.getActivity(this.data.entranceType)
} // 刷新获取订阅配置
if (!this.data.isHaveSubcribe) {
wx.$eventbus.emit("RESFRESH_SUBCRIBE", { type: this.data.entranceType, fresh: true })
}
})
},
// 上拉触底加载
scrollonReachBottom(e) {
let { pageNum, total, pageSize } = this.data
console.log(pageNum, total, pageSize)
// 判断当前页是否是末页
if (Math.floor(total / pageSize) == pageNum - 1) return
this.setData({
pageNum: pageNum + 1
}, () => {
this.getActivity(this.data.entranceType)
})
},
// 滚动中
scrollIng(e) { },
}, },
// 下拉刷新 lifetimes: {
activityRefresh(e) { attached() {
this.setData({ if (this.control) return
pageNum: 1 this.control = true
},()=>{ this.initLocal(this.data.entranceType)
this.getActivity(this.data.entranceType)
// 刷新获取订阅配置
if(!this.data.isHaveSubcribe){
wx.$eventbus.emit("RESFRESH_SUBCRIBE",{type:this.data.entranceType,fresh:true})
} }
})
},
// 上拉触底加载
scrollonReachBottom(e) {
let { pageNum, total, pageSize } = this.data
// 判断当前页是否是末页
if (Math.floor(total / pageSize) == pageNum - 1) return
this.setData({
pageNum: pageNum + 1
},()=>{
this.getActivity(this.data.entranceType)
})
}, },
// 滚动中
scrollIng(e) {},
},
lifetimes: {
attached() {
if(this.control)return
this.control = true
this.initLocal(this.data.entranceType)
}
},
}) })
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"usingComponents": { "usingComponents": {
"nothing-data":"../nothingData/nothingData", "nothing-data":"../nothingData/nothingData",
"activity-ing":"../activitying/index", "activity-ing":"../activitying/index",
"activity-end":"../activityend/index" "activity-end":"../activityend/index",
"activity-tab":"../activityTab/activityTab"
} }
} }
\ No newline at end of file \ No newline at end of file
.content-box{ .box {
padding: 0 22rpx 150rpx 24rpx; height: 100%;
z-index: 10;
}
.input-box {
width: 686rpx;
height: 64rpx;
background: #ffffff7d;
border: 2rpx solid #EEEEEE;
border-radius: 12rpx;
margin: 24rpx auto;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 0rpx 24rpx 0rpx 40rpx;
input {
height: 64rpx;
line-height: 64rpx;
flex: 1;
}
}
.main-box {
border-radius: 32rpx;
width: 100%;
background: #FFFFFF;
height: calc(100% - 64rpx);
}
.content-box {
padding: 0 16rpx 50rpx 16rpx;
} }
\ No newline at end of file \ No newline at end of file
<scroll-view scroll-y class="content" class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" refresher-triggered="{{activeTrigger}}" style="{{!listData.length ? 'padding-top: 16rpx;' : ''}}{{'height: calc(100% - 112rpx);'}}"> <view class="box">
<block wx:if="{{!noResult}}"> <view class="input-box">
<view class="content-box"> <input value="{{acticityName}}" type="text" placeholder="输入活动名称" bind:blur="handleBlur" />
<block wx:for="{{listData}}" wx:key="index"> <icon class="icon-small" type="search" size="14"></icon>
<block wx:if="{{item.activityStatus!=3}}"> </view>
<activity-ing tabType="{{entranceType}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{listData}}" item="{{item}}" activeDateIndex="{{activeDateIndex}}"></activity-ing> <view class="main-box">
<activity-tab class="activityItem" bind:activityTab="activityTab" tabList="{{tabList}}"></activity-tab>
<scroll-view scroll-y class="content" class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" refresher-triggered="{{activeTrigger}}" style="{{!listData.length ? 'padding-top: 16rpx;' : ''}}{{'height: calc(100% - 12rpx);'}}">
<block wx:if="{{!noResult}}">
<view class="content-box">
<block wx:for="{{listData}}" wx:key="index">
<block>
<activity-ing bind:refreshList="toFresh" index="{{index}}" activeList="{{listData}}" item="{{item}}" activeDateIndex="{{activeDateIndex}}"></activity-ing>
</block>
</block> </block>
<block wx:else>
<activity-end tabType="{{entranceType}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{listData}}" item="{{item}}"></activity-end>
</block>
</block>
</view>
</block>
<block wx:else>
<nothing-data description="请前往嘀加企微管家后台创建"></nothing-data>
</block>
</scroll-view>
\ No newline at end of file \ No newline at end of file
</view>
</block>
<block wx:else>
<nothing-data description="请前往嘀加企微管家后台创建"></nothing-data>
</block>
</scroll-view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -12,37 +12,17 @@ Component({ ...@@ -12,37 +12,17 @@ Component({
if (v) { if (v) {
// 活动概览数据处理 // 活动概览数据处理
let s = v.statics let s = v.statics
if (s && v.activityStatus != 3) {
v.overviewData = { // 活动中 v.overviewData = { // 活动中
browseData: { browseData: {
all: { title: '总浏览', num: s.browseCount, sort: s.browseCountRank }, all: { title: '总浏览', num: s.browseCount, sort: s.browseCountRank }
today: { title: '今日浏览', num: s.todayBrowseCount, sort: s.todayBrowseCountRank }
}, },
shareData: { shareData: {
all: { title: '总产值', num: this.priceFormat(s.totalAmount || 0), sort: 0 }, all: { title: '产值(总)/元', num: this.priceFormat(s.totalAmount || 0), sort: 0 }
today: { title: '今日产值', num: this.priceFormat(s.todayAmount || 0), sort: 0 }
}, },
visitorData: { visitorData: {
all: { title: '总访客', num: s.fansCount, sort: s.fansCountRank }, all: { title: '总访客', num: s.fansCount, sort: s.fansCountRank },
today: { title: '今日访客', num: s.todayFansCount, sort: s.todayFansCountRank }
}, },
orderData: {
all: { title: '总订单', num: s.orderCount, sort: s.orderCountRank },
today: { title: '今日订单', num: s.todayOrderCount, sort: s.todayOrderCountRank }
}
} }
// if(v.tabType&&v.tabType==2){
// v.overviewData.shareData.all = { title: '门店客户群', num: s.merchantCustomGroupCount, sort: 0 }
// v.overviewData.shareData.today = { title: '个人客户群', num: s.personCustomGroupCount, sort: 0 }
// }
} else if (s) {
v.overviewData = [ // 活动诊断
{ title: '浏览', num: s.browseCount, sort: s.browseCountRank },
// {title: '产值', num: s.shareCount, sort: s.totalAmount},
{ title: '访客', num: s.fansCount, sort: s.fansCountRank },
{ title: '订单', num: s.orderCount, sort: s.orderCountRank }
]
}
this.setData({ data: v }) this.setData({ data: v })
} }
} }
...@@ -72,21 +52,22 @@ Component({ ...@@ -72,21 +52,22 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
// 实时战报
jumpReport(e) {
let { item } = e.currentTarget.dataset
if (item.activityStatus == 1) return wx.$api.showToast('当前活动尚未开始')
wx.navigateTo({
url: `/packagesList/packageOutput/pages/shareWebview/shareWebview?url=${encodeURIComponent(item.reportUrl)}`,
});
},
// 跳转 // 跳转
jump(e) { jump(e) {
let { index } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
let itemData = this.data.data wx.$router.go("/packagesList/packageOutput/pages/visitor/visitor", { ...item })
console.log(itemData) },
if (index < 2) return // 分享和浏览数据不作跳转 jumpOutput(e) {
switch (index) { let { item } = e.currentTarget.dataset
case 2: // 访客 wx.$router.go("/packageOutput/pages/crowdDetail/crowdDetail", { ...item })
wx.$router.go("/packageStoreAssistant/packageActivity/pages/visitor/visitor", { ...itemData })
break
case 3: // 订单
wx.$router.go("/packageStoreAssistant/packageActivity/pages/order/order", { ...itemData })
break
}
}, },
// 价格格式化 // 价格格式化
priceFormat(num, point = 2) { priceFormat(num, point = 2) {
......
/* pages/tab/index/components/activityOverview/activityOverview.wxss */ /* pages/tab/index/components/activityOverview/activityOverview.wxss */
.active-overview{ .active-overview{
display: flex;
flex-wrap: wrap;
.wrapper{ .wrapper{
flex: 1; display: grid;
display: flex; grid-template-columns: repeat(3,33.33%);
flex-direction: column; &.overview-wrapper {
// height: 188rpx; background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);
border-radius: 8px; border-radius: 20rpx;
padding: 24rpx 12rpx; padding: 24rpx 0rpx 26rpx 0rpx;
box-sizing: border-box; margin: 24rpx 0rpx;
min-width: calc((100% - 32rpx) / 2); }
} }
.overview-item-box{ .overview-item-box{
width: 100%; width: 100%;
height: 100%; height: 100%;
// flex: 1; .all{
display: flex; text-align: center;
// height: 188rpx;
// border-radius: 8px;
// padding: 24rpx 12rpx;
// box-sizing: border-box;
// min-width: calc((100% - 32rpx) / 2);
.all, .today{
flex: 1;
display: flex;
flex-flow: column;
align-items: center;
justify-content: space-between;
.title{ .title{
color: #6E6E7A; color: #6E6E7A;
font-size: 24rpx; font-size: 24rpx;
margin-top: 10rpx;
} }
.primary-title{ .primary-title{
color: #4466F0; color: #4466F0;
...@@ -74,7 +62,6 @@ ...@@ -74,7 +62,6 @@
justify-content: center; justify-content: center;
box-sizing: border-box; box-sizing: border-box;
margin: 0 auto; margin: 0 auto;
margin-top: 24rpx;
} }
.godetail{ .godetail{
width: 236rpx; width: 236rpx;
......
...@@ -3,52 +3,20 @@ ...@@ -3,52 +3,20 @@
<wxs src="../index.wxs" module="fn"></wxs> <wxs src="../index.wxs" module="fn"></wxs>
<!-- 活动中 --> <!-- 活动中 -->
<view wx:if="{{textType == 1}}" class="active-overview"> <view wx:if="{{textType == 1}}" class="active-overview">
<block wx:for="{{activityOverviewList}}" wx:for-item="i" wx:for-index="ind" wx:key="ind"> <block>
<view class="wrapper" style="{{backStyle[ind]}}"> <view class="wrapper overview-wrapper">
<view class="overview-item-box"> <view class="overview-item-box" wx:for="{{activityOverviewList}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="all"> <view class="all">
<view class="title">{{data.overviewData[i].all.title}}</view>
<view class="number">{{data.overviewData[i].all.num || 0}}</view> <view class="number">{{data.overviewData[i].all.num || 0}}</view>
<view class="sort" wx:if="{{ind > 1}}"> <view class="title">{{data.overviewData[i].all.title}}</view>
<text>当前排名:</text>
{{data.overviewData[i].all.sort || '-'}}
</view>
<!-- <view wx:if="{{ind != 1}}" class="sort"><text>当前排名:</text>{{data.overviewData[i].all.sort || '-'}}</view>
<view wx:else class="sort"><text>排名 </text><text class="{{!data.overviewData[i].all.sort ? '' : (data.overviewData[i].all.sort > 0 ? 'up' : 'down')}}">{{fn.mathABS(data.overviewData[i].all.sort) || '-'}}<text wx:if="{{data.overviewData[i].all.sort}}">{{data.overviewData[i].all.sort > 0 ? ' ⬆ ' : ' ⬇ '}}</text></text></view> -->
</view>
<view class="today">
<view class="title">{{data.overviewData[i].today.title}}</view>
<view class="number">{{data.overviewData[i].today.num || 0}}</view>
<view class="sort" wx:if="{{ind > 1}}">
<text>当前排名:</text>
{{data.overviewData[i].today.sort || '-'}}
</view>
<!-- <view wx:if="{{ind != 1}}" class="sort"><text>当前排名:</text>{{data.overviewData[i].today.sort || '-'}}</view>
<view wx:else class="sort"><text>排名 </text><text class="{{!data.overviewData[i].today.sort ? '' : (data.overviewData[i].today.sort > 0 ? 'up' : 'down')}}">{{fn.mathABS(data.overviewData[i].today.sort) || '-'}}<text wx:if="{{data.overviewData[i].today.sort}}">{{data.overviewData[i].today.sort > 0 ? ' ⬆ ' : ' ⬇ '}}</text></text></view> -->
</view>
</view>
<view wx:if="{{ind > 1}}" bind:tap="jump" data-index="{{ind}}" class="checkDetail">查看详情</view>
</view>
</block>
</view>
<!-- 活动诊断 -->
<view wx:else class="active-overview">
<view class=" wrapper" style="{{backStyle[0]}}">
<view class="overview-item-box">
<view class="all" wx:for="{{data.overviewData}}" wx:for-item="val" wx:for-index="key" wx:key="key" data-index="{{key}}">
<view class="title">{{val.title}}</view>
<view class="number">{{val.num || 0}}</view>
<view class="sort">
<text>最终排名:</text>
{{val.sort || '-'}}
</view> </view>
</view> </view>
</view> </view>
<view class="btn-box flex_sac"> <view class="wrapper">
<view bind:tap="jump" data-index="{{2}}" class="checkDetail godetail">访客详情</view> <view bind:tap="jumpOutput" data-item="{{data}}" class="checkDetail">产值详情</view>
<view bind:tap="jump" data-index="{{3}}" class="checkDetail godetail">订单详情</view> <view bind:tap="jump" data-item="{{data}}" class="checkDetail">访客详情</view>
</view> <view bind:tap="jumpReport" data-item="{{data}}" class="checkDetail">活动战报</view>
</view> </view>
</block>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
// packagesList/outDetail/components/activityTab/activityTab.js
Component({
/**
* 组件的属性列表
*/
properties: {
tabList: {
type: Array,
observer(val) {
console.log(val)
}
}
},
/**
* 组件的初始数据
*/
data: {
status: ''
},
/**
* 组件的方法列表
*/
methods: {
handleTab(e) {
const {status} = e.target.dataset
this.setData({status})
this.triggerEvent('activityTab')
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packagesList/outDetail/components/activityTab/activityTab.wxss */
.tab {
display: flex;
align-items: center;
height: 78rpx;
line-height: 78rpx;
justify-content: space-around;
.tab-item {
color: #666666;
&.checked {
color: #708CFF;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/outDetail/components/activityTab/activityTab.wxml-->
<view class="tab">
<view class="tab-item {{status == item.status?'checked': ''}}" wx:key="index" data-status="{{item.status}}" wx:for="{{tabList}}" catchtap="handleTab">{{item.label}}</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
<view class="thum-icon"> <view class="thum-icon">
<image webp src="{{!tabType?data.activityImg:data.activityBigImg}}"></image> <image webp src="{{!tabType?data.activityImg:data.activityBigImg}}"></image>
</view> </view>
<view wx:if="{{!tabType}}" class="active-type">{{activityTypList[0]}}</view>
</view> </view>
<view class="active-title"> <view class="active-title">
<view class="name"> <view class="name">
......
...@@ -27,7 +27,7 @@ Component({ ...@@ -27,7 +27,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
activityOverviewList: ['browseData', 'shareData', 'visitorData', 'orderData'], activityOverviewList: ['browseData', 'visitorData','shareData'],
backStyle: ['background-image: linear-gradient(179deg, #FFFFFF 76%, #FFF8E6 100%);margin: 0 16rpx 16rpx 0;', 'background-image: linear-gradient(180deg, #FFFFFF 72%, #F4EDFF 100%);margin: 0 0 16rpx 0;', 'background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);margin: 0 16rpx 0 0;height: 252rpx;', 'background-image: linear-gradient(180deg, #FFFFFF 72%, #EBFEFF 100%);height: 252rpx;'], backStyle: ['background-image: linear-gradient(179deg, #FFFFFF 76%, #FFF8E6 100%);margin: 0 16rpx 16rpx 0;', 'background-image: linear-gradient(180deg, #FFFFFF 72%, #F4EDFF 100%);margin: 0 0 16rpx 0;', 'background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);margin: 0 16rpx 0 0;height: 252rpx;', 'background-image: linear-gradient(180deg, #FFFFFF 72%, #EBFEFF 100%);height: 252rpx;'],
shadow:['boxshowdown1','','boxshowdown2','boxshowdown2'], shadow:['boxshowdown1','','boxshowdown2','boxshowdown2'],
totalNum:0 totalNum:0
...@@ -54,14 +54,7 @@ Component({ ...@@ -54,14 +54,7 @@ Component({
// }) // })
// } // }
// }, // },
// 实时战报
jump(e) {
let { item } = e.currentTarget.dataset
if (item.activityStatus == 1) return wx.$api.showToast('当前活动尚未开始')
wx.navigateTo({
url: `/packageStoreAssistant/packageActivity/pages/shareWebview/shareWebview?url=${encodeURIComponent(item.reportUrl)}`,
});
},
// 分享活动 // 分享活动
copyActivityUrl(e) { copyActivityUrl(e) {
let { item } = e.currentTarget.dataset let { item } = e.currentTarget.dataset
......
...@@ -37,7 +37,9 @@ ...@@ -37,7 +37,9 @@
.hot { .hot {
color: #FE5662; color: #FE5662;
} }
.end{
color: #6E6E7A;
}
.un-start-class { .un-start-class {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
......
<view class="content-item {{shadow[tabType]}}"> <view class="content-item">
<view class="item-bg {{shadow[tabType]}}"> <view class="item-bg">
<glsx-image webp src="store-assistant/{{tabType>0?'index_active_bg_2':'index_active_bg'}}.png"></glsx-image> <glsx-image webp src="store-assistant-assemble/acvitity/activity-bg.png"></glsx-image>
</view> </view>
<view class="item-box"> <view class="item-box">
<!-- 活动top信息 --> <!-- 活动top信息 -->
<activity-top tabType="{{tabType}}" data="{{item}}" widthStyle="flex: 0 0 62%;"> <activity-top tabType="{{tabType}}" data="{{item}}" widthStyle="flex: 0 0 62%;">
<block wx:if="{{item.activityStatus==2}}"> <block wx:if="{{item.activityStatus==2}}">
<glsx-image webp src="store-assistant/hot-icon.png"></glsx-image> <glsx-image webp src="store-assistant/hot-icon.png"></glsx-image>
<text class="hot">火爆进行中</text> <text class="hot">火热进行中</text>
</block> </block>
<block wx:else> <block wx:if="{{item.activityStatus==1}}">
<glsx-image class="un-start-class" webp src="store-assistant/un-start-icon.png"></glsx-image> <glsx-image class="un-start-class" webp src="store-assistant-assemble/acvitity/un-start-icon.png"></glsx-image>
<text class="hot">活动尚未开始</text> <text class="end">待开始</text>
</block> </block>
</activity-top> <block wx:if="{{item.activityStatus==3}}">
<!-- 活动操作按钮 --> <glsx-image class="un-start-class" webp src="store-assistant-assemble/acvitity/end-icon.png"></glsx-image>
<view class="active-btn"> <text class="end">已结束</text>
<block wx:if="{{tabType==0}}">
<view class="btn" bind:tap="jump" data-item="{{item}}">实时战报</view>
<view class="btn" bind:tap="copyActivityUrl" data-item="{{item}}">分享活动</view>
</block>
<block wx:else>
<view class="btn max {{tabType>0?'primary':''}}" bind:tap="toPengzhangjinPage" data-item="{{item}}">分享活动</view>
<view wx:if="{{tabType==2}}" class="tips">你还可以转发企业微信哦!</view>
</block> </block>
</view> </activity-top>
<view wx:if="{{tabType==2}}" style="height:16rpx"></view>
<!-- 活动概览 --> <!-- 活动概览 -->
<activity-overview data="{{item}}" activityOverviewList="{{activityOverviewList}}" backStyle="{{backStyle}}" textType="{{1}}"></activity-overview> <activity-overview data="{{item}}" activityOverviewList="{{activityOverviewList}}" backStyle="{{backStyle}}" textType="{{1}}"></activity-overview>
<!-- 任务日历 -->
<view class="task-box {{item.isCollapse ? 'hidden' : ''}}">
<view class="box-content">
<activity-calender tabType="{{tabType}}" data="{{item}}" activeDateIndex="{{activeDateIndex}}" isCollapse="{{item.isCollapse}}"></activity-calender>
</view>
</view>
<!-- 展开/收起 -->
<view class="collapse" bindtap="collapseClick" data-flag="{{item.isCollapse}}" data-key="{{index}}" style="bottom: {{item.isCollapse ? 24 : 48}}rpx;">
<text>{{item.isCollapse ? '展开' : '收起'}}</text>
<text class="{{item.isCollapse ? 'gg-chevron-down' : 'gg-chevron-up'}}"></text>
<van-loading wx:if="{{item.isloading}}" size="30rpx" style="margin-left: 20rpx;" type="spinner" />
</view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
page {
overflow: hidden;
}
.navigation-bar { .navigation-bar {
position: fixed; position: fixed;
top: 0; top: 0;
...@@ -16,11 +19,11 @@ ...@@ -16,11 +19,11 @@
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
left: 0; left: 0;
z-index: -1;
.bg { .bg {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: absolute; position: absolute;
z-index: -1;
top: 0; top: 0;
left: 0; left: 0;
} }
......
// packagesList/packageOutput/pages/shareWebview/shareWebview.js
Page({
/**
* 页面的初始数据
*/
data: {
flag: true
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.$api.showLoading('加载中...')
let decodeUrl = decodeURIComponent(options.url)
let param = this.getParams(decodeUrl)
if (param.urlParam) {
let query = JSON.parse(param.urlParam)
this.data.refresh = query.refresh
}
this.setData({
url: decodeUrl
})
wx.hideLoading()
},
getParams(str) {
let params = str.split('?')
if (params.length < 2) return {}
let param = params[1].split('&')
let obj = {}
for (let i = 0; i < param.length; i++) {
let paramsA = param[i].split('=')
let key = paramsA[0]
let value = paramsA[1]
obj[key] = value
}
return obj
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
if (this.data.refresh) {
this.setData(
{
flag: true
},
() => {
this.setData({
url: this.data.url
})
}
)
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
let { url } = this.data
return {
title: '实时战报',
path: `/packagesList/packageOutput/pages/shareWebview/shareWebview?url=${encodeURIComponent(url)}`,
success: (res) => {
console.log("转发成功", e);
}
}
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packagesList/packageOutput/pages/shareWebview/shareWebview.wxss */
\ No newline at end of file \ No newline at end of file
<!--packagesList/packageOutput/pages/shareWebview/shareWebview.wxml-->
<block wx:if="{{flag}}">
<web-view src="{{url}}"></web-view>
</block>
import { IMG_URL } from "~/utils/constantData"; import { IMG_URL } from "~/utils/constantData";
import ActivityApi from '~/api/activityApi/index' import ActivityApi from '~/api/activityApi/index'
import index_const from "~/pages/tab/storeAssistant/pages/index/index_const" import index_const from "~/packagesList/outDetail/index_const"
import { commentTime } from '~/utils/format' import { commentTime } from '~/utils/format'
import {imgUrlMixin} from '~/mixins/index'
Page({ Page({
/** /**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!