Commit c032ea47 by 王志慧
2 parents ebd4dd54 710c440c
Showing 96 changed files with 1155 additions and 5621 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
// })
// }
} }
......
...@@ -7,16 +7,8 @@ ...@@ -7,16 +7,8 @@
"pages/webView/webView", "pages/webView/webView",
"login/index/index", "login/index/index",
"login/accountItems/accountItems", "login/accountItems/accountItems",
"pages/viewVideo/index",
"pages/viewProd/index",
"pages/viewProdBanner/index",
"pages/measure/measure/measure",
"pages/measure/measureResult/measureResult",
"packagesList/activityDetail/activityDetail", "packagesList/activityDetail/activityDetail",
"packagesList/outDetail/index", "pages/tab/logout/logout"
"packageOutput/pages/monthReport/monthReport",
"pages/tab/logout/logout",
"packageOutput/pages/crowdDetail/crowdDetail"
], ],
"requiredPrivateInfos": [ "requiredPrivateInfos": [
"getLocation" "getLocation"
...@@ -68,7 +60,11 @@ ...@@ -68,7 +60,11 @@
"name": "packageOutput", "name": "packageOutput",
"pages": [ "pages": [
"pages/openBusiness", "pages/openBusiness",
"pages/summary" "pages/summary",
"pages/shareWebview/shareWebview",
"pages/visitor/visitor",
"pages/monthReport/monthReport",
"pages/crowdDetail/crowdDetail"
] ]
}, },
{ {
...@@ -93,7 +89,14 @@ ...@@ -93,7 +89,14 @@
"pages": [ "pages": [
"pages/apply" "pages/apply"
] ]
} },
{
"root": "packagesList/outDetail",
"name": "outDetail",
"pages": [
"index"
]
}
], ],
"preloadRule": { "preloadRule": {
"pages/tab/mine/mine": { "pages/tab/mine/mine": {
......
...@@ -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],
......
// packageStoreAssistant/components/BoutiqueCoupon/index.js
import boutiquecouponApi from '~/api/boutiquecouponApi'
Component({
/**
* 组件的属性列表
*/
properties: {
},
lifetimes: {
ready() {
const {
boutiqueCoupon_myself_status
} = wx.$storage.get('userInfo')
this.setData({
myself: boutiqueCoupon_myself_status
})
this.refresherrefresh(false)
wx.$eventbus.on('REFRESHBOUTIQUECOUPON', () => {
this.refresherrefresh(false)
})
}
},
/**
* 组件的初始数据
*/
data: {
couponIndex: 0,
usedFlag: 'N',
useCouponList: [],
pageNum: 1,
total: 0,
totalY: 0,
totalN: 0
},
/**
* 组件的方法列表
*/
methods: {
changeMyself() {
const userInfo = wx.$storage.get('userInfo')
let {
myself
} = this.data
myself = !myself
this.setData({
myself
})
userInfo.boutiqueCoupon_myself_status = myself
wx.$storage.set('userInfo', userInfo)
let {
usedFlag
} = this.data
this.getTotal()
this.clearData(usedFlag)
},
async getMerchantCouponList() {
let couponList = []
try {
const {
merchantId
} = wx.$storage.get('userInfo'), {
code,
data,
message
} = await boutiquecouponApi.getMerchantCouponList({
merchantId
// merchantId: '44209390'
})
if (code == 0) {
console.log(data)
data.map(e => {
if (e.enabledFlag == 'Y') {
e.num = e.amount - e.getAmount
if (e.num < 0) e.num = 0
e.couponName = e.couponInfo.couponName
couponList.push(e)
}
})
this.setData({
couponList
})
} else throw message
} catch (error) {
wx.$api.showToast(error)
}
this.setData({
couponFlag: true
})
},
async getMerchantCustomerCouponList(flag) {
wx.$api.showLoading()
let {
usedFlag,
pageNum,
myself
} = this.data
try {
const {
merchantId,
uuid
} = wx.$storage.get('userInfo')
let params = {
merchantId,
// merchantId: '44209390',
pageNum,
usedFlag: flag ? flag : usedFlag
}
if (myself) params.userId = uuid
const {
code,
data,
message
} = await boutiquecouponApi.getMerchantCustomerCouponList(params)
if (code == 0) {
const {
list,
total
} = data
if (flag) {
if (flag == 'Y') this.setData({
totalY: total
})
else this.setData({
totalN: total
})
return
}
if (list.length) {
const usedBool = usedFlag === 'Y'
list.map(e => {
const time = usedBool ? e.usedTime : e.createdDate
e.time = (usedBool ? '核销' : '领券') + '时间:' + new Date(time).format('yyyy-MM-dd hh:mm')
if (!usedBool) {
if (e.customerInviteRecordDTOList?.length) {
let {
inviteStatus,
inviteDate,
} = e.customerInviteRecordDTOList.at(-1)
//inviteStatus 1待预约 2已预约 3取消预约 4已施工 5过期到店
e.appointmentTime = {
1: '待预约',
2: new Date(inviteDate).format('yyyy-MM-dd hh:mm'),
3: '取消预约',
4: '已施工',
5: '过期到店',
} [inviteStatus]
e.appointmentStatus = inviteStatus
}
}
})
this.setData({
[`useCouponList[${pageNum - 1}]`]: list
})
}
this.setData({
total
})
wx.hideLoading()
} else throw message
} catch (error) {
if (pageNum != 1) this.setData({
pageNum: pageNum - 1
})
wx.$api.showToast(String(error))
}
this.setData({
useCouponFlag: true,
refresherrefreshFlag: false
})
},
getTotal() {
this.getMerchantCustomerCouponList('N')
this.getMerchantCustomerCouponList('Y')
},
couponChange(e) {
let {
current
} = e.detail
this.setData({
couponIndex: current
})
},
jump(e) {
const {
url,
item
} = e.currentTarget.dataset, {
userType
} = wx.$storage.get('userInfo')
if (url == 'createCoupon') {
if (item.num == 0) return
if (userType != 2) {
wx.$api.showToast('请使用员工账号生成礼券')
return
}
}
wx.$router.go(`/packageStoreAssistant/packageBoutiqueCoupon/pages/${url}/${url}`, item)
},
clearData(usedFlag) {
this.setData({
usedFlag,
useCouponList: [],
pageNum: 1,
useCouponFlag: false,
nothing: false,
})
this.getMerchantCustomerCouponList()
},
changeTab(e) {
let {
type
} = e.currentTarget.dataset, {
pageNum,
usedFlag
} = this.data
const result = type ? 'Y' : 'N'
if (pageNum == 1 && usedFlag == result) return
this.clearData(result)
},
refresherrefresh(val = true) {
this.setData({
refresherrefreshFlag: val
})
let {
usedFlag
} = this.data
this.getTotal()
this.getMerchantCouponList()
this.clearData(usedFlag)
},
scrollonReachBottom() {
let {
total,
pageNum
} = this.data
if (Math.ceil(total / 10) > pageNum) {
this.setData({
pageNum: pageNum + 1
})
this.getMerchantCustomerCouponList()
} else this.setData({
nothing: true
})
}
}
})
\ No newline at end of file \ No newline at end of file
/* packageStoreAssistant/components/BoutiqueCoupon/index.wxss */
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.coupon-layout {
height: calc(100% - 112rpx);
.coupon-box {
height: 342rpx;
box-sizing: border-box;
padding-top: 40rpx;
position: relative;
border-bottom: 8rpx solid #F7F8FA;
.coupon-bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.coupon-swiper {
height: 100%;
.coupon {
height: 204rpx;
position: absolute;
box-shadow: 0 10rpx 20rpx 0 rgba(129, 146, 214, .24);
border-radius: 34rpx;
left: 24rpx;
width: calc(100% - 48rpx);
top: 0;
&-info {
position: absolute;
width: 100%;
height: calc(100% - 54rpx);
display: flex;
left: 0;
top: 0;
z-index: 1;
font-size: 20rpx;
color: #997256;
overflow: hidden;
}
&-type {
position: absolute;
z-index: 2;
top: 76rpx;
left: 0;
width: 176rpx;
height: 46rpx;
display: flex;
align-items: center;
justify-content: center;
transform-origin: left bottom;
transform: rotate(-45deg);
white-space: nowrap;
font-weight: 500;
font-size: 20rpx;
color: #4466F0;
// clip-path: polygon(26% 0, 74% 0, 100% 100%, 0% 100%);
}
&-bottom {
position: absolute;
width: 100%;
height: 54rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 50rpx;
font-size: 20rpx;
color: #999999;
left: 0;
bottom: 0;
z-index: 2;
}
&-text {
box-sizing: border-box;
padding: 20rpx 0 0 100rpx;
width: calc(100% - 206rpx);
color: #fff;
.coupon-title {
font-weight: 600;
font-size: 44rpx;
line-height: 60rpx;
}
.num {
font-size: 20rpx;
.val {
font-weight: 500;
color: #FFFB39;
margin: 0 6rpx;
}
}
}
.coupon-add {
position: relative;
font-weight: 600;
font-size: 24rpx;
color: #fff;
display: flex;
align-items: center;
width: 206rpx;
padding-right: 50rpx;
justify-content: flex-end;
&-btn {
box-sizing: border-box;
width: 120rpx;
height: 52rpx;
border: 2rpx solid #FFFFFF;
border-radius: 34rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
.coupon-add.disabled {
opacity: .5;
}
}
}
.dots {
position: absolute;
bottom: 28rpx;
left: 0;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
flex-wrap: wrap;
box-sizing: border-box;
padding: 0 24rpx;
.dot {
width: 12rpx;
height: 12rpx;
background: #D8D8D8;
margin: 4.5rpx;
border-radius: 100%;
flex-shrink: 0;
}
.active {
background: #4466F0;
}
}
}
.coupon-nothing {
width: 100%;
height: 100%;
display: grid;
place-items: center;
color: #000;
font-size: 28rpx;
}
.coupon-list {
background: #FFFFFF;
box-shadow: 0 0 0 0 #E9E9E9;
border-radius: 20rpx;
.tab {
height: 88rpx;
display: flex;
position: sticky;
align-items: center;
top: 0;
z-index: 2;
background: #fff;
padding: 0 20rpx;
.item {
font-size: 24rpx;
color: rgba(27, 35, 61, .9);
text-align: center;
flex-shrink: 0;
padding: 0 40rpx;
position: relative;
height: 100%;
display: flex;
align-items: center;
background: linear-gradient(to right, #708CFF, #708CFF) no-repeat;
background-size: 0;
background-position: bottom;
}
.true {
font-weight: 600;
font-size: 28rpx;
color: #1B233D;
animation: show-line .25s forwards;
}
@keyframes show-line {
0% {
background-size: 0 4rpx;
}
100% {
background-size: calc(100% - 80rpx) 4rpx;
}
}
&-btn {
display: flex;
align-items: center;
margin-left: auto;
font-size: 24rpx;
color: #1B233D;
padding-right: 8rpx;
.icon {
width: 28rpx;
height: 28rpx;
border: 2rpx solid #4466F0;
box-sizing: border-box;
margin-right: 7rpx;
border-radius: 4rpx;
}
.false {
background-color: #4466F0;
}
}
}
.list-box {
padding: 20rpx 20rpx 170rpx;
.nothing-text {
padding: 20rpx 0 !important;
}
.item {
min-height: 278rpx;
background: #FFFFFF;
box-shadow: 0 10rpx 20rpx 0 rgba(129, 146, 214, .24);
border-radius: 12rpx;
margin-bottom: 20rpx;
box-sizing: border-box;
padding: 0 40rpx 28rpx;
position: relative;
&-top {
height: 106rpx;
border-bottom: 2rpx solid #F0F1F5;
display: flex;
align-items: center;
justify-content: space-between;
&-time {
font-size: 24rpx;
color: #6E6E7A;
flex-shrink: 0;
text-align: right;
}
&-customer {
font-weight: 500;
font-size: 32rpx;
color: #1B233D;
display: grid;
grid-template-columns: 46rpx 1fr;
align-items: center;
&-icon {
width: 46rpx;
height: 46rpx;
}
&-text {
margin-left: 26rpx;
}
}
}
&-center {
box-sizing: border-box;
font-size: 24rpx;
width: calc(100% - 104rpx);
&-person {
display: grid;
grid-template-columns: 116rpx 1fr;
gap: 0 20rpx;
color: #1B233D;
align-items: center;
padding-bottom: 12rpx;
line-height: 34rpx;
&-value {
color: #6E6E7A;
}
.have {
color: #F24724;
}
.nothing {
color: #EB9109;
}
}
&-title {
font-size: 28rpx;
color: #4466F0;
font-weight: 500;
font-weight: bold;
padding: 24rpx 0;
}
}
&-coupon-icon {
position: absolute;
right: 48rpx;
bottom: 48rpx;
width: 84rpx;
height: 84rpx;
}
}
}
}
}
.nothing-text {
text-align: center;
font-size: 28rpx;
color: #333;
padding: 60rpx 0;
}
\ No newline at end of file \ No newline at end of file
<scroll-view scroll-y class="coupon-layout" refresher-enabled bindrefresherrefresh="refresherrefresh" bindscrolltolower="scrollonReachBottom" refresher-triggered="{{refresherrefreshFlag}}">
<view class="coupon-box">
<block wx:if="{{couponFlag}}">
<block wx:if="{{couponList.length}}">
<swiper class="coupon-swiper" bindchange="couponChange">
<block wx:for="{{couponList}}" wx:key="index">
<swiper-item>
<view class="coupon">
<view class="coupon-info">
<view class="coupon-type">{{item.couponInfo.couponTypeName}}</view>
<view class="coupon-text">
<view class="coupon-title text-hide">{{item.couponName}}</view>
<view class="num text-hide">剩余<text class="val">{{item.num}}</text>张</view>
</view>
<view class="coupon-add {{item.num == 0 ? 'disabled':''}}" bindtap="jump" data-url="createCoupon" data-item="{{item}}">
<view class="coupon-add-btn">发放</view>
</view>
</view>
<view class="coupon-bottom">
<view class="coupon-time">
有效期:永久
</view>
</view>
<glsx-image src="store-assistant/boutiqueCoupon/coupon.png" class="coupon-bg"></glsx-image>
</view>
</swiper-item>
</block>
</swiper>
<view class="dots" wx:if="{{couponList.length > 1}}">
<block wx:for="{{couponList}}" wx:key="index">
<view class="dot {{couponIndex == index ? 'active':''}}"></view>
</block>
</view>
</block>
<block wx:else>
<view class="coupon-nothing">
暂无礼券
</view>
</block>
</block>
</view>
<view class="coupon-list">
<view class="tab">
<view class="item {{usedFlag == 'N'}}" bindtap="changeTab">
待核销({{totalN}})
</view>
<view class="item {{usedFlag == 'Y'}}" data-type bindtap="changeTab">
已核销({{totalY}})
</view>
<view class="tab-btn" bindtap="changeMyself">
<view class="icon" hidden="{{myself}}"></view>
<view class="icon {{!myself}}" hidden="{{!myself}}">
<glsx-image class="img" src="store-assistant/boutiqueCoupon/checkbox.png"></glsx-image>
</view>
仅看自己
</view>
</view>
<block wx:if="{{useCouponFlag}}">
<block wx:if="{{useCouponList.length}}">
<view class="list-box">
<block wx:for="{{useCouponList}}" wx:key="ind" wx:for-item="i" wx:for-index="ind">
<block wx:for="{{i}}" wx:key="index">
<view class="item" bindtap="jump" data-url="couponDetail" data-item="{{item}}">
<view class="item-top">
<view class="item-top-customer">
<view class="item-top-customer-icon sprite-icon icon-customer-icon">
<glsx-image src="store-assistant/boutiqueCoupon/customer-icon.png"></glsx-image>
</view>
<view class="item-top-customer-text text-hide">{{item.customerName}}</view>
</view>
<view class="item-top-time">{{item.time}}</view>
</view>
<view class="item-center">
<view class="item-center-title">
{{item.couponName}}
</view>
<view class="item-center-person">
<view class="item-center-person-label">推荐人</view>
<view class="item-center-person-value text-hide">{{item.merchantName}}-{{item.employeeName}}</view>
</view>
<block wx:if="{{usedFlag == 'N'}}">
<view class="item-center-person">
<view class="item-center-person-label">预约时间</view>
<view class="item-center-person-value {{item.appointmentStatus != 1?'have':'nothing'}}">{{item.appointmentTime}}</view>
</view>
</block>
</view>
<view wx:if="{{usedFlag === 'Y'}}" class="item-coupon-icon">
<glsx-image src="{{item.upgradeFlag === 'Y'?'store-assistant/boutiqueCoupon/coupon-sucess.png':'store-assistant/boutiqueCoupon/coupon-fail.png'}}"></glsx-image>
</view>
</view>
</block>
</block>
<block wx:if="{{nothing}}">
<view class="nothing-text">到底了~</view>
</block>
</view>
</block>
<block wx:else>
<view class="nothing-text">暂无数据</view>
</block>
</block>
</view>
</scroll-view>
\ No newline at end of file \ No newline at end of file
import ActivityApi from '~/api/activityApi/index' import ActivityApi from '~/api/activityApi/index'
let thisPage; let thisPage;
Component({ Component({
options: { /**
styleIsolation: 'shared' * 组件的属性列表
}, */
/** properties: {
* 组件的属性列表 entranceType: {
*/ type: Number,
properties: { observer: function (val) {
entranceType: { this.initLocal(val)
type: Number, }
observer: function (val) { }
this.initLocal(val)
}
}
},
/**
* 组件的初始数据
*/
data: {
outputView: {
outputValue: [{
label: '总报价量',
name: 'totalQuotationCount',
unit: ''
}, {
label: '总成交量',
name: 'totalSuccessCount',
unit: ''
}, {
label: '总产值',
name: 'totalOutputValue',
unit: ''
}, {
label: '当月报价量',
name: 'monthQuotationCount',
unit: ''
}, {
label: '当月成交量',
name: 'monthSuccessCount',
unit: ''
}, {
label: '当月产值',
name: 'monthOutputValue',
unit: ''
}, {
label: '单价',
name: 'avgPrice',
unit: ''
}, {
label: '升级率',
name: 'conversionRate',
unit: ''
}, {
label: '平均车险报价',
name: 'avgQuotationPrice',
unit: ''
}],
boutiqueOutputValue: [{
label: '发券量(总)/张',
name: 'sendCouponCountTotal',
unit: ''
}, {
label: '升级订单/单',
name: 'upgradeCountTotal',
unit: ''
}, {
label: '营业额(总)/元',
name: 'orderMoneyTotal',
unit: ''
}, {
label: '客单价/元',
name: 'averagePrice',
unit: ''
}, {
label: '转化率',
name: 'upgradeRatio',
unit: ''
}],
todayOutiqueOutputValue: [{
label: '发券量/张',
name: 'sendCouponCountToday',
unit: ''
}, {
label: '升级订单/单',
name: 'upgradeCountToday',
unit: ''
}, {
label: '营业额(总)/元',
name: 'orderMoneyTotalToday',
unit: ''
}],
todayOutputValue: [{
label: '发券量/张',
name: 'avgQuotationPrice',
unit: ''
}, {
label: '升级订单/单',
name: 'avgQuotationPrice',
unit: ''
}, {
label: '营业额(总)/元',
name: 'avgQuotationPrice',
unit: ''
}],
},
listData: [],
activeTrigger: false,
activePageNum: 1,
activeTotal: 0,
pageNum: 1,
total: 0,
pageSize: 10,
noResult: false,
isShow: false,
opts: {
keys: ['abscissaValue', 'ordinateValue'],
color: '#69C9FF',
lineColr: '#6ED0BE',
tickCount: 8,
lineList: [{
title: '营业额',
type: 1
}, {
title: '到店量',
type: 2
}],
barList: [{
title: '发券量',
type: 3
}, {
title: '营业额',
type: 1
}],
chartData: [{
"abscissaValue": "昨日",
"ordinateValue": 100
}, {
"abscissaValue": "今日",
"ordinateValue": 34
}, {
"abscissaValue": "上月",
"ordinateValue": 67
}, {
"abscissaValue": "当月",
"ordinateValue": 90
}],
lineData: [{
"abscissaValue": "2023-03-23",
"ordinateValue": 12
}, {
"abscissaValue": "2023-03-24",
"ordinateValue": 45
}, {
"abscissaValue": "2023-03-25",
"ordinateValue": 78
}, {
"abscissaValue": "2023-03-26",
"ordinateValue": 3
}, {
"abscissaValue": "2023-03-27",
"ordinateValue": 56
}, {
"abscissaValue": "2023-03-28",
"ordinateValue": 34
}, {
"abscissaValue": "2023-03-29",
"ordinateValue": 78
}, {
"abscissaValue": "2023-03-30",
"ordinateValue": 54
}, {
"abscissaValue": "2023-03-31",
"ordinateValue": 20
}, {
"abscissaValue": "2023-04-01",
"ordinateValue": 0
}, {
"abscissaValue": "2023-04-02",
"ordinateValue": 0
}, {
"abscissaValue": "2023-04-03",
"ordinateValue": 100
}, {
"abscissaValue": "2023-04-04",
"ordinateValue": 78
}, {
"abscissaValue": "2023-04-05",
"ordinateValue": 56
}, {
"abscissaValue": "2023-04-06",
"ordinateValue": 0
}, {
"abscissaValue": "2023-04-07",
"ordinateValue": 0
}, {
"abscissaValue": "2023-04-08",
"ordinateValue": 38
}, {
"abscissaValue": "2023-04-09",
"ordinateValue": 0
}, {
"abscissaValue": "2023-04-10",
"ordinateValue": 0
}, {
"abscissaValue": "2023-04-11",
"ordinateValue": 76
}, {
"abscissaValue": "2023-04-12",
"ordinateValue": 0
}, {
"abscissaValue": "2023-04-13",
"ordinateValue": 12
}, {
"abscissaValue": "2023-04-14",
"ordinateValue": 3
}, {
"abscissaValue": "2023-04-15",
"ordinateValue": 0
}, {
"abscissaValue": "2023-04-16",
"ordinateValue": 43
}, {
"abscissaValue": "2023-04-17",
"ordinateValue": 0
}, {
"abscissaValue": "2023-04-18",
"ordinateValue": 16
}, {
"abscissaValue": "2023-04-19",
"ordinateValue": 0
}, {
"abscissaValue": "2023-04-20",
"ordinateValue": 23
}, {
"abscissaValue": "2023-04-21",
"ordinateValue": 0
}]
}, },
}, /**
* 组件的初始数据
/** */
* 组件的方法列表 data: {
*/ outputView: {
methods: { outputValue: [{
// 初始化 label: '总报价量',
initLocal(val) { name: 'totalQuotationCount'
this.setData({ }, {
type: val, label: '总成交量',
name: 'totalSuccessCount',
unit: ''
}, {
label: '总产值',
name: 'totalOutputValue',
_unit: '¥'
}, {
label: '当月报价量',
name: 'monthQuotationCount',
_unit: '¥'
}, {
label: '当月成交量',
name: 'monthSuccessCount',
unit: ''
}, {
label: '当月产值',
name: 'monthOutputValue',
_unit: '¥'
}, {
label: '单价',
name: 'avgPrice',
_unit: '¥'
}, {
label: '升级率',
name: 'conversionRate',
unit_: '%',
multiple: 100,
}, {
label: '平均车险报价',
name: 'avgQuotationPrice',
_unit: '¥'
}],
boutiqueOutputValue: [{
label: '发券量(总)/张',
name: 'sendCouponCountTotal',
unit: ''
}, {
label: '升级订单/单',
name: 'upgradeCountTotal',
unit: ''
}, {
label: '营业额(总)/元',
name: 'orderMoneyTotal',
_unit: '¥'
}, {
label: '客单价/元',
name: 'averagePrice',
_unit: '¥'
}, {
label: '转化率',
name: 'upgradeRatio',
unit_: '%'
}],
todayOutiqueOutputValue: [{
label: '发券量/张',
name: 'sendCouponCountToday',
unit: ''
}, {
label: '升级订单/单',
name: 'upgradeCountToday',
unit: ''
}, {
label: '营业额(总)/元',
name: 'orderMoneyTotalToday',
unit: ''
}],
todayOutputValue: [{
label: '发券量/张',
name: 'avgQuotationPrice',
unit: ''
}, {
label: '升级订单/单',
name: 'avgQuotationPrice',
unit: ''
}, {
label: '营业额(总)/元',
name: 'avgQuotationPrice',
unit: ''
}],
},
listData: [], listData: [],
activeTrigger: false, activeTrigger: false,
activePageNum: 1, activePageNum: 1,
...@@ -256,192 +109,211 @@ Component({ ...@@ -256,192 +109,211 @@ Component({
pageNum: 1, pageNum: 1,
total: 0, total: 0,
pageSize: 10, pageSize: 10,
noResult: false noResult: false,
}, () => { opts: {
thisPage = wx.$router.getPageInstance() keys: ['abscissaValue', 'ordinateValue'],
this.getActivityInfo() color: '#69C9FF',
}) lineColr: '#6ED0BE',
}, tickCount: 8,
getActivityInfo() { lineList: [{
this.getOutput() title: '营业额',
this.getStaffOutput() type: 1
this.getHistogram() }, {
this.getTrend() title: '到店量',
}, type: 2
// 看产值-产值总览 }],
getOutput() { chartData: [{
const { year: '1951 年',
type sales: 10000
} = this.data },
let apiName = 'boutiquecouponOutputValue' {
let params = { year: '1952 年',
merchantId: thisPage.data.merchantId sales: 2000
} },
if ([2].includes(type)) { {
apiName = 'merchantsOutput' year: '1956 年',
params = { sales: 61
merchantIds: [thisPage.data.merchantId] },
} {
} year: '1957 年',
ActivityApi[apiName](params).then(res => { sales: 145
this.setData({ },
outputData: res {
}) year: '1958 年',
}) sales: 48
},
selectEvent() {
this.getTrend()
},
selectBarEvent() {
this.getHistogram()
},
selectTime() {
this.setData({
isShow: true
})
},
onClose(){
this.setData({
isShow: false
});
},
onConfirm(event) {
const [start, end] = event.detail;
const lineObj = this.selectComponent('#line')
this.setData({
isShow: false
});
lineObj.setData({
startTime: this.formatDate(start),
endTime: this.formatDate(end),
timePeriod: ''
})
this.getTrend()
},
formatDate(date) {
date = new Date(date);
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
},
/**柱状图 */
getHistogram() {
const barObj = this.selectComponent('#bar')
let {
dataType
} = barObj.data
const params = {
merchantId: 44211765,
dataType, //数据类型:1报价量/ 2成交量 /3产值
}
ActivityApi.boutiquecouponQueryCouponCountAndOrderMoney(params).then(res => {
this.setData({
'opts.chartData': res
})
})
},
/**折线图 */
getTrend() {
const lineObj = this.selectComponent('#line')
let {
dataType,
timePeriod,
startTime,
endTime
} = lineObj.data
const params = {
merchantId: 44211765,
dataType, //数据类型:1报价量/ 2成交量 /3产值
dateDimension: timePeriod, //时间类型 1本周 / 2本月 /3全年
startDate: startTime,
endDate: endTime
}
ActivityApi.boutiquecouponQueryOrderMoneyTotalAndToShopCount(params).then(res => {
this.setData({
'opts.lineData': res
})
})
},
getOutputReport() {
ActivityApi.merchantsOutputReport
},
/**员工排行 */
getStaffOutput() {
const {
type
} = this.data
let apiName, params, tabelTh;
const dataT = {
1: () => {
apiName = 'boutiquecouponQueryEmployeeRankList',
params = {
merchantId: thisPage.data.merchantId
}, },
tabelTh = { {
employeeName: '员工姓名', year: '1959 年',
orderMoneyTotal: '产值(营业额)', sales: 38
upgradeCountTotal: '单量', },
averagePrice: '客单价', {
upgradeRatio: '转化率' year: '1960 年',
sales: 38
},
{
year: '1962 年',
sales: 38
},
],
lineData: []
},
},
/**
* 组件的方法列表
*/
methods: {
// 初始化
initLocal(val) {
this.setData({
type: val,
listData: [],
activeTrigger: false,
activePageNum: 1,
activeTotal: 0,
pageNum: 1,
total: 0,
pageSize: 10,
noResult: false
}, () => {
thisPage = wx.$router.getPageInstance()
this.getActivityInfo()
})
},
getActivityInfo() {
this.getOutput()
this.getStaffOutput()
this.getHistogram()
this.getTrend()
},
// 看产值-产值总览
getOutput() {
const {
type
} = this.data
let apiName = 'boutiquecouponOutputValue'
let params = {
merchantId: thisPage.data.merchantId
}
if ([2].includes(type)) {
apiName = 'merchantsOutput'
params = {
merchantIds: [thisPage.data.merchantId]
}
} }
ActivityApi[apiName](params).then(res => {
this.setData({
outputData: res
})
})
},
selectEvent() {
this.getTrend()
}, },
2: () => { /**柱状图 */
apiName = 'merchantsStaffOutput', getHistogram() {
params = { const params = {
merchantIds: [thisPage.data.merchantId] merchantId: thisPage.data.merchantId,
dataType: 1, //数据类型:1报价量/ 2成交量 /3产值
timePeriod: 1, //时间类型 1本周 / 2本月 /3全年
startTime: '',
endTime: ''
} }
tabelTh = { ActivityApi.merchantsHistogram(params).then(res => {
transferName: "员工姓名", console.log(res)
outputValue: "产值", })
successCount: "成交量", },
quotationCount: "报价量", /**折线图 */
conversionRate: "转化率", getTrend() {
} const lineObj = this.selectComponent('#line')
let { dataType, timePeriod, startTime, endTime } = lineObj.data
} const params = {
} merchantId: thisPage.data.merchantId,
dataT[type]() dataType, //数据类型:1报价量/ 2成交量 /3产值
ActivityApi[apiName](params).then(res => { dateDimension: timePeriod, //时间类型 1本周 / 2本月 /3全年
const sfaffList = res.list || res || [] startDate: startTime,
this.setData({ endDate: endTime
sfaffList, }
tabelTh ActivityApi.boutiquecouponQueryOrderMoneyTotalAndToShopCount(params).then(res => {
}) this.setData({
}) 'opts.lineData': res
}, })
formatArr(arr, fn) { console.log(this.data.opts.lineData)
let res = {} })
for (let v of arr) { },
const val = Object.keys(v) getOutputReport() {
for (let i of val) { ActivityApi.merchantsOutputReport
if (res[i]) { },
res[i].push(v[i]) /**员工排行 */
continue getStaffOutput() {
} const {
res[i] = [v[i]] type
} = this.data
let apiName, params, tabelTh;
const dataT = {
1: () => {
apiName = 'boutiquecouponQueryEmployeeRankList',
params = { merchantId: thisPage.data.merchantId },
tabelTh = {
employeeName: '员工姓名',
orderMoneyTotal: '产值(营业额)',
upgradeCountTotal: '单量',
averagePrice: '客单价',
upgradeRatio: '转化率'
}
},
2: () => {
apiName = 'merchantsStaffOutput',
params = { merchantIds: [thisPage.data.merchantId] }
tabelTh = {
transferName: "员工姓名",
outputValue: "产值",
successCount: "成交量",
quotationCount: "报价量",
conversionRate: "转化率",
}
}
}
dataT[type]()
ActivityApi[apiName](params).then(res => {
const sfaffList = res.list || res || []
this.setData({ sfaffList ,tabelTh})
})
},
formatArr(arr, fn) {
let res = {}
for (let v of arr) {
const val = Object.keys(v)
for (let i of val) {
if (res[i]) {
res[i].push(v[i])
continue
}
res[i] = [v[i]]
}
}
return fn(res)
},
// 下拉刷新
activityRefresh(e) {
this.getActivityInfo()
},
jumpReport(e) {
const {
time
} = e.target.dataset
const {
entranceType
} = this.data
wx.navigateTo({
url: `/packagesList/packageOutput/pages/monthReport/monthReport?time=${time}&type=${entranceType}&merchantId=${thisPage.data.merchantId}&merchantName=${thisPage.data.merchantName}`,
})
} }
}
return fn(res)
},
// 下拉刷新
activityRefresh(e) {
this.getActivityInfo()
}, },
jumpReport(e) { // lifetimes: {
const { // attached() {
time // if(this.control)return
} = e.target.dataset // this.control = true
const { // this.initLocal(this.data.entranceType)
entranceType // }
} = this.data // },
wx.navigateTo({
url: `/packageOutput/pages/monthReport/monthReport?time=${time}&type=${entranceType}&merchantId=${thisPage.data.merchantId}&merchantName=${thisPage.data.merchantName}`,
})
}
},
// lifetimes: {
// attached() {
// if(this.control)return
// this.control = true
// this.initLocal(this.data.entranceType)
// }
// },
}) })
\ No newline at end of file \ No newline at end of file
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
"usingComponents": { "usingComponents": {
"nothing-data":"../nothingData/nothingData", "nothing-data":"../nothingData/nothingData",
"activity-ing":"../activitying/index", "activity-ing":"../activitying/index",
"activity-end":"../activityend/index", "staff": "../../../../packageOutput/components/staff/staff",
"output-bar": "./components/OutputBar/OutputBar", "output-bar": "./components/OutputBar/OutputBar",
"output-line": "./components/OutputLine/OutputLine", "output-line": "./components/OutputLine/OutputLine"
"staff": "../../../../packageOutput/components/staff/staff"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -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,6 @@ ...@@ -3,6 +3,6 @@
"usingComponents": { "usingComponents": {
"nothing-data":"../nothingData/nothingData", "nothing-data":"../nothingData/nothingData",
"activity-ing":"../activitying/index", "activity-ing":"../activitying/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
// pages/tab/index/components/activityCalender/activityCalender.js
import {
imgUrlMixin
} from '~/mixins/index'
import ActivityApi from '~/api/activityApi/index'
Component({
/**
* 组件的属性列表
*/
behaviors: [imgUrlMixin],
properties: {
data: {
type: Object,
value: {},
observer(newVal) {}
},
// 展开收起
isCollapse: {
type: Boolean,
value: false
},
// 默认选中日期(今天)
activeDateIndex: {
type: Number
},
tabType: Number
},
/**
* 组件的初始数据
*/
data: {
today: new Date().format('MM月dd日')
},
/**
* 组件的方法列表
*/
methods: {
// 任务时间大于7天切换
changeTaskCalender(e) {
let data = this.properties.data
if (data) data.calenderActiveIndex = e.detail.current
this.setData({
data
})
},
myevent(e) {
this.setData({
finishFlag: e.detail.flag,
finishKey: e.detail.index
})
},
finish(e) {
let {
item,
index
} = e.currentTarget.dataset
let {
finishFlag
} = this.data
// wx.$router.go('packageActivity.taskDetail', {...item})
if (finishFlag) {
return wx.showToast({
title: '正在下载中',
icon: 'none'
})
}
if (!item.platformMerchantMissionMaterialResponseList) return // 数据为空处理 未下载完
let taskDetailBox = this.selectComponent("#taskDetailBox")
taskDetailBox.finishTask(item, index)
},
// 切换日期查看任务
changeDate(e) {
let {
dateindex
} = e.currentTarget.dataset
this.setData({
activeDateIndex: dateindex
})
},
toTaskDetail(e) {
let {
missionid,
type
} = e.currentTarget.dataset
if (type == 1) return
if (type == 6) {
wx.navigateTo({
url: '/packageStoreAssistant/packageActivity/pages/myFollow/index?activityId='+this.data.data.id,
});
// wx.$router.go('/packageStoreAssistant/packageActivity/pages/myFollow/index', {
// activityId: this.data.data.id,
// })
return
}
wx.$router.go('/packageStoreAssistant/packageActivity/pages/taskDetail/taskDetail', {
missionId: missionid,
tabType: this.data.tabType
})
},
toHandler(e) {
const {
index,
item
} = e.currentTarget.dataset
console.log(item);
let isHaveLink = false
let arr = []
if (item.platformMerchantMissionMaterialResponseList) {
item.platformMerchantMissionMaterialResponseList.forEach(el => {
if (el.materialType == 4) {
isHaveLink = true
}
arr.push(el.materialType)
})
}
if (isHaveLink) {
this.finishTask(item.detailInfo)
this.jumpZC(item.detailInfo.activityId)
return
}
if (arr.indexOf(2) != -1 || arr.indexOf(3) != -1) {
let {
missionId
} = item
wx.$router.go('/packageStoreAssistant/packageActivity/pages/taskDetail/taskDetail', {
missionId,
tabType: this.data.tabType
})
return
}
this.tracker(item.detailInfo.activityId)
this.finishTask(item.detailInfo, index)
},
jumpZC(activityId) {
const userStorage = wx.$storage.get('userInfo')
let query = {
id: activityId,
exclusiveUuid: userStorage.uuid,
merchantId: userStorage.merchantId,
isExclusive: 1,
shareStaffUuid: userStorage.uuid,
form: 'task'
}
if (this.data.tabType == 0 || !this.data.tabType) {
wx.$router.go('/pages/crowdfunding/index/index', query)
} else {
query.notIntercept = true
wx.$router.go('/packageShopmall/packageExpandedGold/pages/activity/index/index', query)
}
},
finishTask(item, index) {
Promise.all([this.copyText(item)])
.then(() => {
wx.showToast({
title: index == 0 ? '文案已复制到剪切板,纯文案内容请直接通过微信发送给客户' : '文案已复制到剪切板,纯文案内容请前往朋友圈发送',
icon: 'none'
})
})
.catch(err => {
wx.showToast({
title: err,
icon: 'none'
})
})
},
copyText(item) {
return new Promise((resolve, reject) => {
let {
textContent
} = item
let copyData = ''
if (textContent) {
copyData = textContent
}
let _this = this
if (!copyData.length) {
// 复制内容为空 不做处理
return resolve()
}
wx.setClipboardData({
data: copyData,
success() {
resolve()
},
fail() {
reject('文案复制失败')
}
})
})
},
tracker(id) {
const USERINFO = wx.$storage.get('userInfo')
let data = {
action_type: 4, // 事件类型固定为4-分享
item_type: 3, // 商品类型,固定为3-众筹活动
merchant_id: USERINFO.merchantId, // 门店号
staff_uuid: USERINFO.uuid,
business_type: 1, // 业务类型,固定为1
add_way: 104, // 来源,固定为104
create_time: new Date().format('yyyy-MM-dd hh:mm:ss'), // 分享时间
item_id: id,
share_staff_type: 3
}
let jsonList = [JSON.stringify(data)]
ActivityApi.taskShareReport({
jsonList
}).then(res => {})
},
}
})
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/components/activityCalender/activityCalender.wxss */
.title{
padding-left: 8rpx;
font-size: 32rpx;
color: #1B233D;
font-weight: 600;
text{
font-size: 28rpx;
color: #2D2D33;
font-weight: 400;
}
}
.calender-box{
padding: 32rpx 0;
position: relative;
.swiper{
height: 112rpx;
.swiper_item{
display: flex;
.time-box{
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
background: #F7F8FA;
border-radius: 6px;
margin: 0 4rpx;
image{
width: 48rpx;
height: 48rpx;
margin-bottom: 10rpx;
}
.task-time{
font-size: 18rpx;
color: #1B233D;
}
}
.completed{
background-image: linear-gradient(180deg, #FFD84B 28%, #FFB33E 76%);
.task-time{
color: #FFFFFF;
}
}
.active{
background-image: linear-gradient(180deg, #FFF7DB 15%, #FFF1E0 87%);
.task-time{
color: #1B233D;
}
}
}
}
.swiper-dots{
display: flex;
align-items: center;
justify-content: center;
position: absolute;
width: 100%;
bottom: 24rpx;
left: 0;
.dots {
width: 16rpx;
height: 6rpx;
margin: 0 4rpx;
border-radius: 3rpx;
background: #E1E4EB;
transition: all .5s;
}
.dots.active{
width: 24rpx;
background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
}
}
}
.calender-box.p-b-54{
padding-bottom: 54rpx;
}
.task-show-box{
.item-box{
border-bottom: 1px solid #F0F1F5;
.task-item{
padding: 24rpx 0;
// padding: 24rpx 0 0 0;
display: flex;
align-items: center;
// justify-content: space-between;
margin-bottom: 7rpx;
position: relative;
.left{
display: flex;
position: relative;
image{
width: 80rpx;
height: 80rpx;
margin-right: 16rpx;
flex-shrink: 0;
}
.task-message{
display: flex;
flex-flow: column;
justify-content: space-around;
.task-title{
font-family: PingFangSC-Medium;
display: flex;
align-items: center;
flex-wrap: nowrap;
font-size: 28rpx;
font-weight: 500;
color: #1B233D;
word-break: break-all;
image{
width: 28rpx;
height: 28rpx;
margin: 0;
flex-shrink: 0;
}
.integral-num{
font-family: PingFangSC-Medium;
flex-shrink: 0;
font-size: 24rpx;
font-weight: 500;
color: #FE5662;
}
}
.task-content{
font-size: 22rpx;
word-break: break-all;
color: #9299AD;
}
}
.unstart{
position: absolute;
left: 0;
bottom: 0;
width: 80rpx;
height: 32rpx;
background: rgba(0, 0, 0, 0.5);
border-radius: 8rpx 8rpx 12rpx 12rpx;
font-weight: 400;
font-size: 20rpx;
color: #FFFFFF;
}
}
.right{
width: calc(100% - 120rpx);
.title-wrap{
display: flex;
align-items: center;
.text-title{
font-family: PingFangSC-Medium;
flex-wrap: nowrap;
font-size: 28rpx;
font-weight: 500;
color: #1B233D;
word-break: break-all;
}
.icon{
width: 28rpx;
height: 28rpx;
margin: 0;
flex-shrink: 0;
}
.integral-num{
font-family: PingFangSC-Medium;
flex-shrink: 0;
font-size: 24rpx;
font-weight: 500;
color: #FE5662;
}
}
.task-content{
font-size: 22rpx;
word-break: break-all;
color: #9299AD;
}
}
.task-btn{
margin-left: 32rpx;
display: flex;
align-items: center;
text-align: center;
.btn{
width: 84rpx;
height: 84rpx;
// line-height: 48rpx;
// display: flex;
// justify-content: center;
// align-items: center;
// width: 116rpx;
// height: 48rpx;
// background: #FEF1F4;
// border: 2rpx solid rgba(254,86,98,0.40);
// border-radius: 12rpx;
// font-size: 24rpx;
// color: #FE5662;
}
.primary{
border: none;
width: 120rpx;
height: 56rpx;
line-height: 56rpx;
background-image: linear-gradient(270deg, #FF3E7F 0%, #FE624B 100%);
border-radius: 6px;
color: #FFFFFF;
}
.grey-btn{
color: #9299AD;
border: 2rpx solid #CACDD5;
background: #F5F6F7;
}
.btn_title{
margin-top: 8rpx;
font-size: 11px;
color: #FE5662;
}
}
.right-compelete-icon{
position: absolute;
right: 40rpx;
top: 50%;
transform: translateY(-50%);
width: 84rpx;
height: 84rpx;
}
.right-arrow-icon{
position: absolute;
right: 0;
top: 50%;
transform: translate(0,-50%);
width: 24rpx;
height: 24rpx;
}
}
}
.item-box:last-child{
border: none;
margin: 0;
}
}
.task-share{
padding: 0 0 16rpx 0;
.btn{
font-weight: 400;
font-size: 24rpx;
color: #1B233D;
.icon{
width: 28rpx;
height: 28rpx;
margin-right: 8rpx;
}
}
}
.flex_cc{
display: flex;
align-items: center;
justify-content: center;
}
.flex_scb{
display: flex;
align-items: center;
justify-content: space-between;
}
.flex_sac{
display: flex;
align-items: center;
justify-content: space-around;
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/index/components/activityCalender/activityCalender.wxml-->
<wxs src="../index.wxs" module="fn"></wxs>
<block wx:if="{{!isCollapse}}">
<view class="title">任务日历<text> · {{data.missionList[activeDateIndex].platformMerchantMissionResponseList.length}}</text></view>
<view wx:if="{{data.newtaskCalenderList.length}}" class="calender-box {{data.newtaskCalenderList.length > 1 ? 'p-b-54' : ''}}">
<swiper class="swiper" current="{{data.calenderActiveIndex}}" bindchange="changeTaskCalender" data-index="{{index}}">
<block wx:for="{{data.newtaskCalenderList}}" wx:for-item="val" wx:for-index="k" wx:key="k">
<swiper-item class='swiper_item'>
<block wx:for="{{val}}" wx:for-item="v" wx:for-index="j" wx:key="j">
<view class="time-box {{v.status == 1 ? 'completed' : v.status == 2 ? 'past' : ''}} {{activeDateIndex == v.ind ? 'active' : ''}}" bind:tap="changeDate" data-dateindex="{{v.ind}}">
<!-- <image webp src="{{IMGURL}}store-assistant/{{v.status == 1 ? 'task_completed.png' : v.status == 2 ? 'calender_past_integral_icon.png' : 'calender_integral_icon.png'}}"></image> -->
<glsx-image webp src="store-assistant/{{v.status == 1 ? 'task_completed.png' : v.status == 2 ? 'calender_past_integral_icon.png' : 'calender_integral_icon.png'}}"></glsx-image>
<view class="task-time">{{v.time==today?'今天':v.time}}</view>
</view>
</block>
</swiper-item>
</block>
</swiper>
<block wx:if="{{data.newtaskCalenderList.length > 1}}">
<view class="swiper-dots">
<block wx:for="{{data.newtaskCalenderList}}" wx:for-item="value" wx:for-index="inde" wx:key="inde">
<view class="dots {{data.calenderActiveIndex == inde ?'active':''}}"></view>
</block>
</view>
</block>
</view>
<view class="task-show-box">
<block wx:for="{{data.missionList[activeDateIndex].platformMerchantMissionResponseList}}" wx:for-item="val" wx:for-index="ky" wx:key="ky">
<view catch:tap="toTaskDetail" data-type="{{val.missonType}}" data-missionid="{{val.missionId}}" class="item-box">
<view class="task-item">
<view class="left">
<glsx-image webp src="store-assistant/task_icon_{{val.missonType}}.png"></glsx-image>
<block wx:if="{{fn.timeFilter(data.missionList[activeDateIndex].activityTime, 2)}}">
<view wx:if="{{val.completeStatus != 2}}" class="unstart flex_cc">未开始</view>
</block>
</view>
<view class="right">
<view class="title-wrap">
<view class="text-title">{{fn.getString(val.missionName,12)}}</view>
<!-- <view wx:else class="text-title">您有{{totalNum || 0}}名意向用户待跟进</view> -->
<block wx:if="{{val.gainScore}}">
<glsx-image class="icon" webp src="store-assistant/integral_icon.png"></glsx-image>
<view class="integral-num">+{{val.gainScore}}积分</view>
</block>
</view>
<view class="task-content">{{val.missonDesc}}</view>
</view>
<block wx:if="{{fn.timeFilter(data.missionList[activeDateIndex].activityTime, 1) || val.completeStatus == 2}}">
<glsx-image wx:if="{{val.completeStatus == 2}}" class="right-compelete-icon" src="store-assistant/complete.png"></glsx-image>
</block>
<glsx-image class="right-arrow-icon" src="store-assistant/right_arrow_grey_icon.png?v={{img_version}}" />
<!-- <view class="left">
<glsx-image webp src="store-assistant/task_icon_{{val.missonType}}.png"></glsx-image>
<view class="task-message" wx:if="{{val.missonType!=6}}">
<view class="task-title">
<view class="text">{{val.missionName}}</view>
<block wx:if="{{val.gainScore}}">
<glsx-image webp src="store-assistant/integral_icon.png"></glsx-image>
<view class="integral-num">+{{val.gainScore}}积分</view>
</block>
</view>
<view class="task-content">{{val.missonDesc}}</view>
</view>
<view class="task-message" wx:else>
<view class="task-title">
<view class="text">您有{{totalNum?totalNum:0}}名意向用户待跟进</view>
<block wx:if="{{val.gainScore}}">
<glsx-image webp src="store-assistant/integral_icon.png"></glsx-image>
<view class="integral-num">+{{val.gainScore}}积分</view>
</block>
</view>
<view class="task-content">{{val.missonDesc}}</view>
</view>
<block wx:if="{{fn.timeFilter(data.missionList[activeDateIndex].activityTime, 2)}}">
<view wx:if="{{val.completeStatus != 2}}" class="unstart flex_cc">未开始</view>
</block>
</view>
<view class="task-btn">
<block wx:if="{{fn.timeFilter(data.missionList[activeDateIndex].activityTime, 1) || val.completeStatus == 2}}">
<glsx-image wx:if="{{val.completeStatus == 2}}" class="btn" src="store-assistant/complete.png"></glsx-image>
</block>
<glsx-image style="width:24rpx;height:24rpx;margin-left: 12rpx;" src="store-assistant/right_arrow_grey_icon.png?v={{img_version}}" />
</view> -->
</view>
<!-- 分享类任务 显示物料 -->
<view wx:if="{{val.missonType!=1&&val.missonType!=6}}" class="task-share flex_sac">
<view data-index="{{0}}" data-item="{{val}}" catch:tap="toHandler" class="btn flex_cc">
<glsx-image class="icon" webp src="store-assistant/share/index_share_hy.png" />
<text>分享好友</text>
</view>
<view data-index="{{1}}" data-item="{{val}}" catch:tap="toHandler" class="btn flex_cc">
<glsx-image class="icon" webp src="store-assistant/share/index_share_pyq.png" />
<text>发朋友圈</text>
</view>
</view>
</view>
</block>
</view>
</block>
...@@ -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')
},
}
})
/* 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">
......
import ActivityApi from '~/api/activityApi/index'
import { domain } from '~/utils/request/environment'
import { toUnicode } from '~/utils/format'
Component({
/**
* 组件的属性列表
*/
properties: {
item: Object,
activeList:Array,
index:Number,
tabType:Number,// 0众筹 1膨胀金
},
/**
* 组件的初始数据
*/
data: {
activityOverviewList: ['overviewData'],
backStyle: ['background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);margin: 0 0 16rpx 0;']
},
/**
* 组件的方法列表
*/
methods: {
toPengzhangjin(e){
let { item } = e.currentTarget.dataset
const userStorage = wx.$storage.get('userInfo')
let query = {
id: item.id,
exclusiveUuid: userStorage.uuid,
merchantId: userStorage.merchantId,
isExclusive: 1,
shareStaffUuid: userStorage.uuid,
form: 'task',
shareStaffType: 3,
notIntercept:true
}
wx.$router.go('/packageShopmall/packageExpandedGold/pages/activity/index/index', query)
},
// 活动详情
goToDetail(e) {
let { item } = e.currentTarget.dataset
let h5Url = this.filterJumpUrl(item)
console.log(h5Url)
wx.$router.jumpH5(h5Url)
},
// 活动战报
jump(e) {
let { item } = e.currentTarget.dataset
wx.$router.go('/packageStoreAssistant/packageActivity/pages/warReport/warReport', item)
},
// 刷新预约订单数据
toFresh(e) {
this.collapseClick(e, true)
},
// 点击事件
collapseClick(e, fresh) {
let { key, flag } = e.currentTarget.dataset
let { activeList } = this.data
activeList.forEach((val, ind) => {
if (key == ind) {
if ((flag && !val.orderList) || (flag && fresh)) {
val.isloading = true
ActivityApi.getActivityEndInstallOrderList({ activityId: val.id })
.then(res => {
res.orderList &&
res.orderList.forEach(it => {
it.time = it.createdDate ? new Date(it.createdDate).format('yyyy-MM-dd hh:mm') : ''
})
val.isloading = false
val.isCollapse = false
val.orderList = res.orderList
val.orderTotal = res.orderTotal
val.reInstallContactsName = res.reInstallContactsName
val.reInstallContactsPhone = res.reInstallContactsPhone
this.setData({
item: val
})
})
.catch(err => {
val.isloading = false
this.setData({
item: val
})
})
} else {
val.isCollapse = !flag
}
} else {
val.isCollapse = true
val.isloading = false
}
})
this.triggerEvent('refreshList',activeList)
this.setData({
activeList,
item:activeList[key]
})
},
filterJumpUrl(item) {
const userStorage = wx.$storage.get('userInfo')
return `${domain}/scrm-wx-merchant-activity/#/?id=${item.id}&merchantId=${userStorage.merchantId}&shareStaffUuid=${userStorage.uuid}&shareStaffName=${toUnicode(userStorage.name)}&isExclusive=1&exclusiveUuid=${userStorage.uuid}&shareStaffType=2&sharedTime=${Date.now()}`
},
}
})
{
"component": true,
"usingComponents": {
"activity-top": "../activityTop/activityTop",
"activity-overview": "../activityOverview/activityOverview",
"invert-analyse": "../invertAnalyse/invertAnalyse",
"booking-order": "../bookingOrder/bookingOrder"
}
}
\ No newline at end of file \ No newline at end of file
.content-item {
font-size: 28rpx;
width: 100%;
box-sizing: border-box;
position: relative;
display: inline-block;
margin: 32rpx 0 8rpx 0;
overflow: hidden;
box-shadow: 0 10rpx 20rpx 0 rgba(116, 132, 194, 0.16), inset 0 -2rpx 6rpx 0 rgba(255, 255, 255, 0.40);
border-radius: 32rpx;
.item-bg {
width: 100%;
height: 100%;
border-radius: 24rpx;
overflow: hidden;
position: absolute;
box-shadow: 0 10rpx 20rpx 0 rgba(116, 132, 194, 0.16), inset 0 -2rpx 6rpx 0 rgba(255, 255, 255, 0.40);
z-index: -1;
left: 0;
top: 0;
right: 0;
image {
object-fit: cover;
background-size: 100% auto;
}
}
.item-box {
box-sizing: border-box;
padding: 24rpx;
width: 100%;
height: 100%;
.end {
color: #6E6E7A;
margin-left: 10rpx;
}
.active-btn {
display: flex;
margin: 24rpx 0 32rpx 0;
justify-content: center;
.btn {
color: #4466F0;
flex: 1;
height: 64rpx;
text-align: center;
line-height: 64rpx;
border-radius: 14rpx;
background: rgba(255, 255, 255, 0.20);
border: 2rpx solid #4466F0;
margin-right: 16rpx;
}
.btn:last-child {
margin-right: 0;
}
.primary {
color: #ffffff;
height: 68rpx;
background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
line-height: 68rpx;
border: none;
}
.max{
flex: 0.75;
}
}
.earnings-box {
width: 100%;
height: 144rpx;
background-image: linear-gradient(180deg, #FFFFFF 72%, #EBF1FF 100%);
border-radius: 20rpx;
display: flex;
align-items: center;
padding: 32rpx;
box-sizing: border-box;
.left {
flex: 0 0 30%;
display: flex;
flex-flow: column;
justify-content: space-between;
.title {
font-weight: 400;
font-size: 24rpx;
color: #6E6E7A;
}
.sort {
margin-top: 8rpx;
font-size: 20rpx;
color: #1B233D;
}
}
.integral-num {
font-size: 68rpx;
font-weight: 700;
text {
background: linear-gradient(#FFC233, #FF9124);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.unit {
font-size: 28rpx;
font-weight: 500;
margin-left: 12rpx;
}
}
}
.invert-box {
margin-top: 24rpx;
padding: 32rpx 24rpx;
border-radius: 24rpx;
background: #ffffff;
// transition: all 0.1s linear;
will-change: height;
margin-top: 24rpx;
.box-content {
display: block;
padding-bottom: 40rpx;
}
}
.hidden {
height: 64rpx;
padding: 0;
background: transparent;
margin-top: 0;
transition: height .3;
.box-content {
display: none;
}
}
.collapse {
text-align: center;
color: #4466F0;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
.btn {
display: flex;
flex-flow: row;
}
.gg-chevron-down {
box-sizing: border-box;
position: relative;
display: block;
transform: scale(var(--ggs, 1));
width: 24rpx;
height: 24rpx;
border: 2rpx solid transparent;
border-radius: 100rpx
}
.gg-chevron-down::after {
content: "";
display: block;
box-sizing: border-box;
position: absolute;
width: 12rpx;
height: 12rpx;
border-bottom: 2rpx solid;
border-right: 2rpx solid;
transform: rotate(45deg);
left: 8rpx;
top: 0;
}
.gg-chevron-up {
box-sizing: border-box;
position: relative;
display: block;
transform: scale(var(--ggs, 1));
width: 24rpx;
height: 24rpx;
border: 2rpx solid transparent;
border-radius: 100rpx
}
.gg-chevron-up::after {
content: "";
display: block;
box-sizing: border-box;
position: absolute;
width: 12rpx;
height: 12rpx;
border-top: 2rpx solid;
border-right: 2rpx solid;
transform: rotate(-45deg);
left: 8rpx;
bottom: 0
}
}
}
}
.content-item:first-child {
margin: 16rpx 0 8rpx 0;
}
\ No newline at end of file \ No newline at end of file
<wxs src="../index.wxs" module="fn"></wxs>
<view class="content-item">
<view class="item-bg">
<glsx-image webp src="store-assistant/{{tabType>1?'index_active_bg_2':'activity_diagnosis_bg'}}.png"></glsx-image>
</view>
<view class="item-box">
<!-- 活动top信息 -->
<activity-top tabType="{{tabType}}" data="{{item}}" widthStyle="flex: 0 0 72%;" isShow="{{isShow}}">
<glsx-image webp src="store-assistant/activity_end_icon.png"></glsx-image>
<text class="end">已结束</text>
</activity-top>
<!-- 活动操作按钮 -->
<view class="active-btn">
<block wx:if="{{tabType==0}}">
<view class="btn" bind:tap="jump" data-item="{{item}}">活动战报</view>
<view class="btn primary" bind:tap="goToDetail" data-item="{{item}}">查看详情</view>
</block>
<block wx:else>
<view class="btn primary max" bind:tap="toPengzhangjin" data-item="{{item}}">查看详情</view>
</block>
<!-- <block wx:if="{{tabType==2}}">
<view class="btn primary max" data-item="{{item}}">查看详情</view>
</block>
<block wx:if="{{tabType==3}}">
<view class="btn primary max" data-item="{{item}}">查看详情</view>
</block> -->
</view>
<!-- 活动概览 -->
<activity-overview data="{{item}}" backStyle="{{backStyle}}" textType="{{2}}"></activity-overview>
<!-- 累计收益 -->
<view class="earnings-box">
<view class="left">
<view class="title">累计收益</view>
<view class="sort">最终排名:{{item.statics.incomeRank || "-"}}</view>
</view>
<view class="integral-num">
<text>{{fn.filterIntegral(item.statics.income || 0)}}</text>
<text class="unit">积分</text>
</view>
</view>
<!-- 转化分析 -->
<view class="invert-box">
<view class="box-content">
<invert-analyse data="{{item}}"></invert-analyse>
<!-- 预约订单 -->
<block wx:if="{{tabType==0}}">
<booking-order data-flag="{{true}}" data-key="{{index}}" bind:refreshList="toFresh" data="{{item}}"></booking-order>
</block>
</view>
</view>
<!-- 展开/收起 -->
<block wx:if="{{tabType==0}}">
<view class="collapse" bindtap="collapseClick" data-flag="{{item.isCollapse}}" style="bottom: {{item.isCollapse ? 24 : 48}}rpx;" data-key="{{index}}">
<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>
</block>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -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
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"activity-top": "../activityTop/activityTop", "activity-top": "../activityTop/activityTop",
"activity-overview": "../activityOverview/activityOverview", "activity-overview": "../activityOverview/activityOverview"
"activity-calender": "../activityCalender/activityCalender"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -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
// pages/tab/index/components/bookingOrder/bookingOrder.js
import {imgUrlMixin} from '~/mixins/index'
import ActivityApi from '~/api/activityApi/index'
Component({
/**
* 组件的属性列表
*/
behaviors: [imgUrlMixin],
properties: {
data: {
type: Object,
value: {},
observer(newVal) {
}
},
showPopup: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
// 打电话
callPhone(e) {
let { mobile } = e.currentTarget.dataset
wx.makePhoneCall({
phoneNumber: mobile.toString()
})
},
// 复制微信号
copyWechart(e) {
let { wechartno } = e.currentTarget.dataset
wx.setClipboardData({
data: wechartno.toString(),
success (res) {
wx.showToast({
title: '微信号已复制',
icon: "none"
})
}
})
},
// 查看预约安装信息
showPopup(e) {
let { item } = e.currentTarget.dataset
if (!item.reInstallContactsName && !item.reInstallContactsPhone) {
return wx.showToast({
title: '暂无安装联系人信息',
icon: 'none'
})
}
let thisPage = wx.$router.getPageInstance()
let components = thisPage.selectComponent(`#page-0`)
components.setData({
installItem: item,
showPopup: true
})
},
toComfirmInstall(e){
const {item} = e.currentTarget.dataset
ActivityApi.comfirmInstall({subOrderCode:item.subOrderCode}).then(res=>{
this.triggerEvent('refreshList',true)
wx.showToast({
title: '提交成功',
icon: 'none'
})
})
},
}
})
/* pages/tab/index/components/bookingOrder/bookingOrder.wxss */
.title{
font-weight: 600;
font-size: 32rpx;
color: #1B233D;
display: flex;
justify-content: space-between;
text{
font-weight: 400;
font-size: 28rpx;
color: #2D2D33;
}
.text-btn{
font-size: 28rpx;
color: #4466F0;
font-weight: 400;
}
}
.item-content{
display: flex;
flex-flow: column;
padding: 32rpx 0;
font-size: 26rpx;
color: #7A8299;
border-bottom: 1px solid #F0F1F5;
.top{
display: flex;
justify-content: space-between;
.top-left{
display: flex;
image{
width: 96rpx;
height: 96rpx;
border-radius: 50%;
margin-right: 20rpx;
}
.user-message{
display: flex;
flex-flow: column;
justify-content: space-between;
.name{
color: #1B233D;
font-size: 30rpx;
}
.mobile{
display: flex;
align-items: center;
image{
width: 48rpx;
height: 48rpx;
border-radius: 50%;
margin-left: 16rpx;
}
}
}
}
.btn-img{
width: 128rpx;
height: 56rpx;
background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 400;
font-size: 24rpx;
color: #FFFFFF;
}
.check-img{
width: 168rpx;
height: 48rpx;
background-image: linear-gradient(90deg, #FFF7EB 0%, #FFF3E0 100%);
color: #EB9109;
}
}
.bottom{
padding: 10rpx 0 0 116rpx;
text{
color: #1B233D;
margin-left: 16rpx;
}
}
}
.item-content:last-child{
border: none;
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/index/components/bookingOrder/bookingOrder.wxml-->
<view class="title">
<view>
待预约安装订单<text> · {{data.orderTotal}}</text>
</view>
<view class="text-btn" bind:tap="showPopup" data-item="{{data}}">预约安装信息</view>
</view>
<block wx:for="{{data.orderList}}" wx:key="index">
<view class="item-content">
<view class="top">
<view class="top-left">
<image webp src="{{item.customerImageUrl ? item.customerImageUrl : IMGURL+'store-assistant/default_avatar.png'}}"></image>
<view class="user-message">
<view class="name">{{item.customerNickName || ""}}</view>
<view class="mobile">
<text>{{item.customerPhone || ""}}</text>
<glsx-image wx:if="{{item.customerPhone}}" webp src="store-assistant/activity_order_phone_icon.png" bind:tap="callPhone" data-mobile="{{item.customerPhone}}"></glsx-image>
<glsx-image wx:if="{{item.wechartNo}}" webp src="store-assistant/activity_order_wechart_icon.png" bind:tap="copyWechart" data-wechartno="{{item.wechartNo}}"></glsx-image>
</view>
</view>
</view>
<view wx:if="{{item.orderStatus==7}}" class="btn-img" data-item="{{item}}" bind:tap="toComfirmInstall">
确认安装
</view>
<view wx:if="{{item.orderStatus==11}}" class="btn-img check-img">
已安装待审核
</view>
</view>
<view class="bottom">
下单时间
<text>{{item.time}}</text>
</view>
</view>
</block>
// import ActivityApi from '~/api/activityApi/index'
// import {handlerMiss} from '~/packagesList/common/common'
// Component({
// /**
// * 组件的属性列表
// */
// properties: {
// ids:Array,
// fresh:{
// type:Boolean,
// observer: function (val) {
// if(val){
// this.setData({
// pageNum: 1
// }, () => {
// this.getData()
// })
// }
// }
// }
// },
// /**
// * 组件的初始数据
// */
// data: {
// dbzlList: [],
// activeTrigger: false,
// pageNum: 1,
// total: 0,
// pageSize: 10,
// noResult: false
// },
// lifetimes: {
// attached() {
// this.getData()
// }
// },
// methods: {
// // 获取数据
// getData() {
// let { pageSize, pageNum,ids,dbzlList } = this.data
// let paraList = []
// ids.forEach(el=>{
// if(el.serviceType==2){
// paraList.push(el.activityId)
// }
// })
// ActivityApi.getSubscribeListByIdsApi({ pageNum, pageSize,ids:paraList }).then(res => {
// if (res && res.list) {
// handlerMiss(res,{serviceType:2,pageNum,listName:'dbzlList',orginList:dbzlList},(first)=>{
// this.setData(first)
// })
// }
// })
// },
// toFresh(e) {
// if (e.detail) {
// this.setData({
// dbzlList: e.detail
// })
// }
// },
// activityRefresh() {
// this.setData({
// pageNum: 1
// }, () => {
// // this.getData()
// wx.$eventbus.emit("RESFRESH_SUBCRIBE",{type:2,fresh:true})
// })
// },
// scrollonReachBottom() {
// let { pageNum, total, pageSize } = this.data
// // 判断当前页是否是末页
// if (Math.floor(total / pageSize) == pageNum - 1) return
// this.setData({
// pageNum: pageNum + 1
// }, () => {
// this.getData()
// })
// },
// scrollIng() { },
// }
// })
{
"component": true,
"usingComponents": {
"activity-ing":"../activitying/index",
"nothing-data":"../nothingData/nothingData",
"activity-end":"../activityend/index"
}
}
\ No newline at end of file \ No newline at end of file
// .content-box{
// padding: 0 22rpx 150rpx 24rpx;
// }
\ 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="{{!dbzlList.length ? 'padding-top: 16rpx;' : ''}}{{'height: calc(100% - 112rpx);'}}">
<block wx:if="{{dbzlList.length}}">
<view class="content-box">
<block wx:for="{{dbzlList}}" wx:key="index">
<block wx:if="{{item.activityStatus!=3}}">
<activity-ing tabType="{{3}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{dbzlList}}" item="{{item}}" activeDateIndex="{{activeDateIndex}}"></activity-ing>
</block>
<block wx:else>
<activity-end tabType="{{3}}" item="{{item}}"></activity-end>
</block>
</block>
</view>
</block>
<block wx:else>
<nothing-data></nothing-data>
</block>
</scroll-view> -->
\ No newline at end of file \ No newline at end of file
// import ActivityApi from '~/api/activityApi/index'
// Component({
// /**
// * 组件的属性列表
// */
// properties: {
// ids:Array
// },
// /**
// * 组件的初始数据
// */
// data: {
// pzjList: [],
// activeTrigger: false,
// pageNum: 1,
// total: 0,
// pageSize: 10,
// noResult: false
// },
// lifetimes: {
// attached() {
// this.getData()
// }
// },
// methods: {
// // 获取数据
// getData() {
// let { pageSize, pageNum,ids } = this.data
// let ignoreIds = []
// ids.forEach(el=>{
// ignoreIds.push(el.activityId)
// })
// ActivityApi.getPengZApi({ pageNum, pageSize,ignoreIds }).then(res => {
// if (res && res.list) {
// this.handlerMiss(res)
// }
// })
// },
// toFresh(e) {
// if (e.detail) {
// this.setData({
// pzjList: e.detail
// })
// }
// },
// handlerMiss(res) {
// let { pageNum, pzjList } = this.data
// res.list &&
// res.list.forEach((val, index) => {
// val.isCollapse = true
// val.startTime = val.startTime.split(' ')[0]
// val.endTime = val.endTime.split(' ')[0]
// // 活动中/活动未开始默认展开第一条 数据处理
// if (val.activityStatus != 3 && index == 0) {
// val.isloading = true
// ActivityApi.getActiveTaskList({ activityId: val.id,bussinessScene:2 }, { 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 = this.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
// this.setData({ 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 = 'pzjList[' + index + ']'
// this.setData({
// [itemVal]: val
// })
// })
// .catch(err => {
// val.isloading = false
// })
// } else if (val.activityStatus == 3 && index == 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 = 'pzjList[' + index + ']'
// // this.setData({
// // [itemVal]: val
// // })
// // })
// // .catch(err => {
// // val.isloading = false
// // })
// }
// })
// this.triggerEvent('total', { type: 1, total: res.total || 0 })
// this.setData({
// pzjList: pageNum == 1 ? res.list : [...pzjList, ...res.list],
// activeTrigger: false,
// total: res.total,
// noResult: pageNum == 1 ? (res.list.length ? false : true) : false
// })
// },
// calenderFilter(arr, length) {
// var _arr = []
// while (arr.length) {
// _arr.push(arr.splice(0, length))
// }
// return _arr
// },
// activityRefresh() {
// this.setData({
// pageNum: 1
// }, () => {
// this.getData()
// })
// },
// scrollonReachBottom() {
// let { pageNum, total, pageSize } = this.data
// // 判断当前页是否是末页
// if (Math.floor(total / pageSize) == pageNum - 1) return
// this.setData({
// pageNum: pageNum + 1
// }, () => {
// this.getData()
// })
// },
// scrollIng() { },
// }
// })
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
// .content-box{
// padding: 0 22rpx 150rpx 24rpx;
// }
\ 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="{{!pzjList.length ? 'padding-top: 16rpx;' : ''}}{{'height: calc(100% - 112rpx);'}}">
<block wx:if="{{pzjList.length}}">
<view class="content-box">
<block wx:for="{{pzjList}}" wx:key="index">
<block wx:if="{{item.activityStatus!=3}}">
<activity-ing tabType="{{1}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{pzjList}}" item="{{item}}" activeDateIndex="{{activeDateIndex}}"></activity-ing>
</block>
<block wx:else>
<activity-end tabType="{{1}}" item="{{item}}"></activity-end>
</block>
</block>
</view>
</block>
<block wx:else>
<nothing-data></nothing-data>
</block>
</scroll-view> -->
\ No newline at end of file \ No newline at end of file
import ActivityApi from "~/api/activityApi/index"
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
noResult:true,
dataList:[],
query:{
open:false,
borad:{},
missionList:[]
},
activeTrigger:false
},
/**
* 组件的方法列表
*/
methods: {
checkSubcribeInfo(){
const userStorage = wx.$storage.get("userInfo");
let para = {
merchantIds:[userStorage.merchantId]
}
ActivityApi.checkSubcribe(para).then(res=>{
let flag = false
if(res&&res.length){
res.forEach(item=>{
if(item.serviceType==3){
flag = true
}
})
}
this.triggerEvent('open',flag)
if(flag){
this.getMissTions()
this.getBoradData()
}
this.setData({
'query.open':flag,
activeTrigger:false
})
})
},
getMissTions(){
let para = {
bussinessScene:4
}
ActivityApi.getActiveTaskList(para).then(res=>{
let missionList = []
if(res&&res.length){
const {platformMerchantMissionResponseList} = res[0]
if(platformMerchantMissionResponseList&&platformMerchantMissionResponseList.length){
platformMerchantMissionResponseList.forEach(item=>{
let temp = {
title:item.missionName,
tip:item.missonDesc,
count:item.gainScore,
status:item.completeStatus,
id:item.id,
missonType:item.missonType,
icon:item.missonType==7?'add_store_flg_icon':'add_group_icon'
}
if(item.missonType==7 || item.missonType==8){
missionList.push(temp)
}
})
}
}
this.setData({
'query.missionList':missionList,
activeTrigger:false
})
})
},
getBoradData(){
const userStorage = wx.$storage.get("userInfo");
let para = {
merchantId:userStorage.merchantId,
uuid:userStorage.uuid,
}
ActivityApi.praviteBoradData(para).then(res=>{
this.setData({
'query.borad':res,
activeTrigger:false
})
})
},
activityRefresh(){
this.checkSubcribeInfo()
}
},
lifetimes: {
attached() {
this.checkSubcribeInfo()
}
},
})
{
"component": true,
"usingComponents": {
"pravitePage":"../../../../../../../packageStoreAssistant/components/praviteNotOpen/index"
}
}
\ No newline at end of file \ No newline at end of file
.content-box{
padding: 0 22rpx 150rpx 24rpx;
}
\ 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="{{noResult ? 'padding-top: 16rpx;' : ''}}{{'height: calc(100% - 112rpx);'}}">
<pravitePage query="{{query}}"></pravitePage>
</scroll-view>
\ No newline at end of file \ No newline at end of file
// import ActivityApi from '~/api/activityApi/index'
// import {handlerMiss} from '~/packagesList/common/common'
// Component({
// properties: {
// ids:Array,
// fresh:{
// type:Boolean,
// observer: function (val) {
// if(val){
// this.setData({
// pageNum: 1
// }, () => {
// this.getData()
// })
// }
// }
// }
// },
// data: {
// sgjyList: [],
// activeTrigger: false,
// pageNum: 1,
// total: 0,
// pageSize: 10,
// noResult: false
// },
// lifetimes: {
// attached() {
// this.getData()
// }
// },
// methods: {
// // 获取数据
// getData() {
// let { pageSize, pageNum,ids,sgjyList } = this.data
// let paraList = []
// ids.forEach(el=>{
// if(el.serviceType==1){
// if(el.activityId){
// paraList.push(el.activityId)
// }
// }
// })
// if(!paraList.length)return
// ActivityApi.getSubscribeListByIdsApi({ pageNum, pageSize,ids:paraList }).then(res => {
// if (res && res.list) {
// handlerMiss(res,{serviceType:1,pageNum,listName:'sgjyList',orginList:sgjyList},(first)=>{
// this.setData(first)
// })
// }
// })
// },
// toFresh(e) {
// if (e.detail) {
// this.setData({
// sgjyList: e.detail
// })
// }
// },
// activityRefresh() {
// this.setData({
// pageNum: 1
// }, () => {
// // this.getData()
// wx.$eventbus.emit("RESFRESH_SUBCRIBE",{type:1,fresh:true})
// })
// },
// scrollonReachBottom() {
// let { pageNum, total, pageSize } = this.data
// // 判断当前页是否是末页
// if (Math.floor(total / pageSize) == pageNum - 1) return
// this.setData({
// pageNum: pageNum + 1
// }, () => {
// this.getData()
// })
// },
// scrollIng() { },
// }
// })
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
// .content-box{
// padding: 0 22rpx 150rpx 24rpx;
// }
\ 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="{{!sgjyList.length ? 'padding-top: 16rpx;' : ''}}{{'height: calc(100% - 112rpx);'}}">
<block wx:if="{{sgjyList.length}}">
<view class="content-box">
<block wx:for="{{sgjyList}}" wx:key="index">
<block wx:if="{{item.activityStatus!=3}}">
<activity-ing tabType="{{2}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{sgjyList}}" item="{{item}}" activeDateIndex="{{activeDateIndex}}"></activity-ing>
</block>
<block wx:else>
<activity-end tabType="{{2}}" item="{{item}}"></activity-end>
</block>
</block>
</view>
</block>
<block wx:else>
<nothing-data></nothing-data>
</block>
</scroll-view> -->
\ No newline at end of file \ No newline at end of file
// import ActivityApi from '~/api/activityApi/index'
// import {handlerMiss} from '~/packagesList/common/common'
// Component({
// /**
// * 组件的属性列表
// */
// properties: {
// isHaveSubcribe:Boolean
// },
// /**
// * 组件的初始数据
// */
// data: {
// zcList: [],
// activeTrigger: false,
// activePageNum: 1,
// activeTotal: 0,
// pageNum: 1,
// total: 0,
// pageSize: 10,
// noResult:false
// },
// /**
// * 组件的方法列表
// */
// methods: {
// // 获取数据
// getActivity(){
// let { pageSize, pageNum,zcList } = this.data
// ActivityApi.getActivityList({pageNum,pageSize}).then(res=>{
// if(res&&res.list){
// handlerMiss(res,{serviceType:0,pageNum,listName:'zcList',orginList:zcList},(result)=>{
// if(result&&result.total){
// this.triggerEvent('total',{type:0,total:result.total || 0})
// }
// this.setData(result)
// })
// }
// })
// },
// toFresh(e) {
// if (e.detail) {
// this.setData({
// zcList: e.detail
// })
// }
// },
// // 下拉刷新
// activityRefresh(e) {
// this.setData({
// pageNum: 1
// },()=>{
// this.getActivity()
// // 刷新获取订阅配置
// if(!this.data.isHaveSubcribe){
// wx.$eventbus.emit("RESFRESH_SUBCRIBE",{type:0,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()
// })
// },
// // 滚动中
// scrollIng(e) {},
// },
// lifetimes: {
// attached() {
// this.getActivity()
// }
// },
// })
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
// .content-box{
// padding: 0 22rpx 150rpx 24rpx;
// }
\ 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="{{!zcList.length ? 'padding-top: 16rpx;' : ''}}{{'height: calc(100% - 112rpx);'}}">
<block wx:if="{{!noResult}}">
<view class="content-box">
<block wx:for="{{zcList}}" wx:key="index">
<block wx:if="{{item.activityStatus!=3}}">
<activity-ing tabType="{{0}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{zcList}}" item="{{item}}" activeDateIndex="{{activeDateIndex}}"></activity-ing>
</block>
<block wx:else>
<activity-end tabType="{{0}}" bind:refreshList="toFresh" index="{{index}}" activeList="{{zcList}}" item="{{item}}"></activity-end>
</block>
</block>
</view>
</block>
<block wx:else>
<nothing-data></nothing-data>
</block>
</scroll-view> -->
\ No newline at end of file \ No newline at end of file
{ {
"usingComponents": { "usingComponents": {
"menu":"./components/menu/index", "menu":"./components/menu/index",
"boutique-coupon":"./components/BoutiqueCoupon/index",
"workertableEntrance":"./components/WorktableEntrance/index", "workertableEntrance":"./components/WorktableEntrance/index",
"OutputWork":"./components/OutputWork/index" "OutputWork":"./components/OutputWork/index"
}, },
......
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;
} }
......
/* pages/tab/index/components/invertAnalyse/invertAnalyse.wxss */ /* pages/tab/index/components/invertAnalyse/invertAnalyse.wxss */
.title{ .title {
font-weight: 600; font-weight: 600;
font-size: 32rpx; font-size: 32rpx;
color: #1B233D; color: #1B233D;
line-height: 48rpx; line-height: 48rpx;
} }
.funnel-box{
padding: 40rpx 0; .funnel-box {
position: relative; padding: 40rpx 0;
.funnel-bg{ position: relative;
position: absolute;
top: 40rpx; .funnel-bg {
left: 50%; position: absolute;
transform: translate(-50%); top: 40rpx;
width: 406rpx; left: 50%;
height: 288rpx; transform: translate(-50%);
} width: 458.18rpx;
.funnel-content{ height: 298rpx;
display: flex;
justify-content: center; image {
height: 248rpx; width: 458.18rpx;
width: 100%; height: 298rpx;
padding-top: 40rpx; }
.left,.right{
display: flex;
} }
.left{
flex: 0 0 406rpx; .funnel-content {
flex-flow: column;
justify-content: space-around;
align-items: flex-end;
// align-items: center;
z-index: 1;
font-size: 22rpx;
color: #2D2D33;
box-sizing: border-box;
padding-right: 20rpx;
view{
display: flex; display: flex;
align-items: center; justify-content: center;
margin-right: 28rpx; height: 248rpx;
text{ width: 100%;
font-size: 28rpx; padding-top: 40rpx;
font-weight: bold;
margin-left: 4rpx; .left,
.right {
display: flex;
}
.left {
flex: 0 0 406rpx;
flex-flow: column;
justify-content: space-around;
align-items: flex-end;
// align-items: center;
z-index: 1;
font-size: 22rpx;
color: #2D2D33;
box-sizing: border-box;
padding-right: 20rpx;
view {
display: flex;
align-items: center;
margin-right: 28rpx;
text {
font-size: 28rpx;
font-weight: bold;
margin-left: 4rpx;
}
}
}
.right {
flex: 1;
flex-flow: column;
align-items: flex-start;
margin-left: 130rpx;
color: #4466F0;
padding-top: 20rpx;
font-size: 24rpx;
position: relative;
.sort-box:last-child {
position: absolute;
left: -46rpx;
top: 50%;
}
.sort {
font-size: 40rpx;
font-weight: bold;
margin-top: 4rpx;
}
} }
}
}
.right{
flex: 1;
flex-flow: column;
align-items: flex-start;
margin-left: 130rpx;
color: #4466F0;
padding-top: 20rpx;
font-size: 24rpx;
position: relative;
.sort-box:last-child{
position: absolute;
left: -46rpx;
top: 50%;
}
.sort{
font-size: 40rpx;
font-weight: bold;
margin-top: 4rpx;
}
} }
} }
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/index/components/invertAnalyse/invertAnalyse.wxml-->
<wxs src="../index.wxs" module="fn"></wxs>
<view class="title">转化分析</view>
<view class="funnel-box"> <view class="funnel-box">
<view class="funnel-bg"> <view class="funnel-bg">
<glsx-image webp src="store-assistant/activity_funnel.webp"></glsx-image> <glsx-image webp src="store-assistant/activity_funnel.webp"></glsx-image>
</view> </view>
<view class="funnel-content"> <view class="funnel-content">
<view class="left"> <view class="left">
<view wx:for="{{data.numList}}" wx:key="index">{{item.title}}<text>{{fn.formatNumber(item.num)}}</text></view> <view wx:for="{{data.numList}}" wx:key="index">{{item.title}}<text>{{item.num}}</text></view>
</view> </view>
<view class="right"> <view class="right">
<view class="sort-box" wx:for="{{data.sortList}}" wx:key="index"> <view class="sort-box" wx:for="{{data.sortList}}" wx:key="index">
......
// packageOutput/components/staff/staff.js
import Util from '~/utils/util'
Component({
/**
* 组件的属性列表
*/
properties: {
sfaffList: {
type: Object,
observer(val) {
this.getDetail(val)
this.filterStaff = val
this.setData({selectValue:1})
}
},
tabelTh: {
type: Object,
value: []
},
downType: {
type: String,
value: 'boutique'
}
},
/**
* 组件的初始数据
*/
data: {
dataType: {
crowType: [{
label: '转发次数',
value: 1
}, {
label: '访客总数',
value: 2
}, {
label: '浏览总数',
value: 3
}, {
label: '成交单量',
value: 4
}, {
label: '转化率',
value: 5
}],
boutique: [{
label: '单量',
value: 1
}, {
label: '客单量',
value: 2
}, {
label: '转化率',
value: 3
}],
equity: [{
label: '成交量',
value: 1
}, {
label: '报价量',
value: 2
}, {
label: '转化率',
value: 3
}]
},
empName: '',
show: true,
selectTxt: '单量',
selectValue: 1,
},
/**
* 组件的方法列表
*/
methods: {
showUp() {
this.setData({show:false})
},
selectType(e) {
const {value,label} = e.target.dataset
this.setData({
selectValue: value,
show:true,
selectTxt: label
})
this.getDetail(this.filterStaff)
},
hanldBlur(e) {
const empName = e.detail.value;
const sfaffList= this.data.sfaffList.filter(item=>{
const employeeName = item.transferName || item.employeeName
return employeeName?employeeName.includes(empName):item
})
this.filterStaff = sfaffList
this.getDetail(sfaffList)
},
//格式化数组
formatArr(arr, fn) {
let res = {}
for (let v of arr) {
const val = Object.keys(v)
for (let i of val) {
if (res[i]) {
res[i].push(v[i])
continue
}
res[i] = [v[i]]
}
}
return fn(res)
},
// 生成对应的表格数据
getDetail(val) {
let {tabelTh,dataType,selectValue,downType} = this.data,sortKey
for(let i in tabelTh) {
if(tabelTh[i] == dataType[downType][selectValue-1].label) {
sortKey = i
}
}
const tableData = Util.deepClone(val).sort((a,b)=>{
return (b[sortKey]||0)-(a[sortKey]||0)
})
// let obj = {
// employeeName: '员工姓名',
// orderMoneyTotal: '产值(营业额)',
// upgradeCountTotal: '单量',
// averagePrice: '客单价',
// upgradeRatio: '转化率'
// }
// obj = {
// employeeName: '员工姓名',
// orderMoneyTotal: '产值(营业额)',
// upgradeCountTotal: '转发次数',
// averagePrice: '访客总数',
// upgradeRatio: '浏览总数',
// upgradeRatio: '成交单量',
// upgradeRatio: '转化率',
// }
const sfaffList = this.formatArr(tableData, (item) => {
const result = []
const obj_keys = Object.keys(tabelTh)
for (let k of obj_keys) {
result.push({
name: tabelTh[k],
val: k,
list: item
})
}
return result
})
this.setData({ sfaff:sfaffList })
}
}
})
.box {
margin: 20rpx;
background: #FFFFFF;
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
border-radius: 20rpx;
padding: 32rpx 40rpx;
.box-title {
font-weight: 600;
font-size: 32rpx;
color: #1B233D;
line-height: 48rpx;
display: flex;
justify-content: space-between;
.select-up {
font-weight: 400;
font-size: 24rpx;
color: #666666;
position: relative;
text-align: center;
.staff-type {
width: 128rpx;
text {
display: inline-block;
width: 100rpx;
}
.up-icon {
width: 14rpx;
height: 8rpx;
vertical-align: middle;
}
}
.up-box {
position: absolute;
width: 108rpx;
height: 160rpx;
background: #FFFFFF;
box-shadow: 0 0 18rpx 0 #3a596a1c;
border-radius: 8rpx;
z-index: 10;
.up-item {
flex: auto;
font-weight: 400;
font-size: 20rpx;
color: #666666;
line-height: 53rpx;
&.checked {
color: #708CFF;
}
}
}
}
}
.staff-input {
width: 638rpx;
height: 64rpx;
background: #ffffff7d;
border: 2rpx solid #EEEEEE;
border-radius: 12rpx;
margin: 40rpx auto 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0rpx 20rpx;
box-sizing: border-box;
input {
height: 64rpx;
line-height: 64rpx;
color: #999999;
flex: 1;
}
}
}
.table {
display: flex;
}
.table_left_column {
min-width: 150rpx;
height: auto;
display: flex;
flex-direction: column;
}
.left_col_item {
width: 100%;
height: 63rpx;
font-size: 20rpx;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
color: #1B233D;
background: #F9F9F9;
&:first-child {
font-weight: 600;
font-size: 24rpx;
color: #1B233D;
}
&:nth-child(2n) {
background: #ffffff;
}
}
.table_right_scroll_box {
display: flex;
white-space: nowrap;
overflow-x: scroll;
}
.flex_direction_column_item {
min-width: 200rpx;
display: inline-block;
/* border: 1px solid #000; */
}
.item_name {
min-width: 200rpx;
height: 63rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 20rpx;
color: #1B233D;
background: #F9F9F9;
&:first-child {
font-weight: 600;
font-size: 24rpx;
color: #1B233D;
}
&:nth-child(2n) {
background: #ffffff;
}
}
\ No newline at end of file \ No newline at end of file
<!--packageOutput/components/staff/staff.wxml-->
<view class="box staff-box">
<view class="box-title">
<text>员工排行榜</text>
<view class="select-up">
<view bindtap="showUp" class="staff-type">
<text>{{dataType[downType][selectValue-1].label}}</text>
<glsx-image webp custom-class="up-icon" src="store-assistant-assemble/output/arrow.png"></glsx-image>
</view>
<view class="up-box" hidden="{{show}}">
<view class="up-item {{selectValue == item.value? 'checked':''}}" wx:for="{{dataType[downType]}}" wx:key="{{index}}" data-label="{{item.label}}" data-value="{{item.value}}" catchtap="selectType">
{{item.label}}
</view>
</view>
</view>
</view>
<view class="staff-input">
<input placeholder="输入员工名称" value="{{empName}}" bind:blur="hanldBlur"/>
<icon class="icon-small" type="search" size="14"></icon>
</view>
<view class='table'>
<!-- 左侧固定 -->
<view class='table_left_column'>
<view class='left_col_item'>排名</view>
<view class='left_col_item' wx:for="{{sfaff[0].list[sfaff[0].val]}}" wx:for-index="index" wx:key="index">{{index+1}}</view>
</view>
<!-- 右侧表格滚动 -->
<view class="table_right_scroll_box">
<view class="flex_direction_column_item" wx:for="{{sfaff}}" wx:for-index="index" wx:key="index">
<view class='item_name'>{{item.name}}</view>
<view wx:for="{{item.list[item.val]}}" wx:for-item="litem" wx:for-index="lindex" wx:key="lindex" class='item_name item_desc'>
<block>{{litem||'--'}}</block>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -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>
......
// 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
{ {
"component": true,
"usingComponents": {} "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({
/** /**
......
// pages/checkProduct/checkProduct.js
// const navStyle = "background-color: transparent;";
const navStyle = 'background-color: #fff'
import { senceData } from '~/pages/tab/index/constant/data'
import { IMG_URL } from '~/utils/constantData.js'
import { productBysceneApi } from '~/api/index.js'
import Draw from '~/utils/Draw.js'
import { createQrCodeApi, sceneByIdApi } from '~/api/checkProduct.js'
import utils from '~/utils/util.js'
Page({
/**
* 页面的初始数据
*/
noPageAuth: true,
data: {
navStyle,
headerHeight: 0,
senceData,
// 模态框
isShow: false,
// IMG_URL: `${IMG_URL}index`,
btnList: [
{
src: `${IMG_URL}index/down.png`,
name: '生成海报'
},
{
src: `${IMG_URL}index/wechat.png`,
name: '转发给好友'
}
// {
// src: `${IMG_URL}index/moments.png`,
// name: "朋友圈分享",
// },
],
// 4种场景下图片所有的高 (单位 rpx)
imgHeightArr: [
[1110, 1290, 596, 744, 490, 1532],
[2168, 1290, 596, 830, 490, 752],
[1110, 1290, 596, 984, 490],
[678, 1266, 1398, 830, 490, 1666]
],
posterUrl: '', //海报url
noVideoimgList: [],
//分享相关
isShare: false,
// 是否授权昵称
hasUserInfo: false,
phone: '', //授权手机号
userInfo: '',
isAuthphone: true, //授权昵称弹窗显示,更多按钮显示
// 视频播放地址
videoSrc:'',
videoTitle:'',
//下载海报授权
showAuth: false,
img_version:0.1
},
observers: {
actNum: function (actNum) {
let imgList = [`${IMG_URL}index/scene${actNum + 1}1.png`, `${IMG_URL}index/scene${actNum + 1}2.png`, `${IMG_URL}index/scene${actNum + 1}3.png`, `${IMG_URL}index/scene${actNum + 1}4.png`, `${IMG_URL}index/scene${actNum + 1}5.png`]
this.setData({
noVideoimgList: imgList
})
if (actNum != 2) {
imgList.push(`${IMG_URL}index/scene${actNum + 1}6.png`)
}
this.setData({
imgList
})
}
},
// navbar高度设置
navbarReady(e) {
let { height, statusBarHeight } = e.detail
console.log('height, statusBarHeight : ', height, statusBarHeight );
this.setData({
// headerHeight: height / 2 + statusBarHeight
headerHeight: height
// headerHeight: height / 2 + statusBarHeight + 88 * 2,
})
// console.log(e)
// console.log(this.data.headerHeight)
},
// 分项弹框关闭
modelcloseFn(e) {
this.setData({
isShow: false
})
},
// 分享按钮
sharehandle() {
this.setData({
isShow: true
})
},
//如果是直接查看页面,获取合成apiData
getData() {
console.log(123456)
// 看产品
productBysceneApi().then(res => {
let { code, data } = res
if (code == 0 && data) {
// this.setData({
// apiData: data
// })
this.compositionData(senceData, data)
// this.getFirstSenceIndex();
}
})
},
//接口数据,本地数据对接
compositionData(localData, apiData) {
localData.forEach((item, index) => {
apiData.forEach((inner, idx) => {
if (item.name == inner.stage) {
item.sceneStatus = inner.sceneStatus
item.productList.forEach((outChild, outIndex) => {
inner.productList.forEach((innerChild, innerIndex) => {
if (outChild.proName == innerChild.productName) {
outChild.productStatus = innerChild.productStatus
}
})
})
}
})
})
// console.log('localData, apiData: ', localData);
this.setData({
senceData: localData
})
},
//接受跳转的路由参数(小程序页面跳转)
onRoute(options) {
// console.log('分享onRoute ', options)
if (!options || utils.isEmptyObj(options)) return
// if(!Object.keys(options).includes('actNum'))return
let { senceData } = this.data
//选中场景的index,和产品的index
let {
actNum,
activeNavIdx,
// apiData,
outshowVideo,
isShow,
// origin //跳转来源 home
} = options
// if(actNum&&activeNavIdx)return
// 设置标题
let userInfoObj = wx.$storage.get('userInfo')
// #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
let name = userInfoObj.merchantName
// let name
// if (userInfoObj.name) {
// name = userInfoObj.name
// }else if(userInfoObj.merchantName){
// }else if(userInfoObj.merchantName){
// //全称
// name = userInfoObj.merchantName
// }
this.shareTitle = `${name}给你分享一个活动${senceData[actNum]?.productList[activeNavIdx].proName},戳我参与~`
this.getImgInfo(actNum)
this.setData({
actNum,
activeNavIdx,
// apiData,
outshowVideo,
isShow,
share_phone: options.sharePhone
// origin
// isShare
})
// let apiDataJson = JSON.stringify(apiData);
let item = senceData[actNum]?.productList[activeNavIdx]
this.shareQuery = `sceneCode=${senceData[actNum].sceneCode}&productCode=${item?.productCode}&isShare=${true}&productDesc=${item?.productName}&category=${item?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}`
this.shareTrackData = {
sceneCode: senceData[actNum]?.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName
// actNum,
// activeNavIdx,
// apiData,
}
},
// 分享按钮
handleClick(e) {
let { index } = e.currentTarget.dataset
let _this = this
switch (index) {
case 0:
wx.showModal({
content: '生成并下载页面为海报',
success: async res => {
if (res.confirm) {
wx.getSetting({
success: (res)=> {
if(res.authSetting['scope.writePhotosAlbum']===false){
_this.setData({
showAuth: true
})
}else{
_this.download()
}
}
})
}
},
confirmText:'下载',
cancelText:'返回',
fail: res => {},
complete: res => {}
})
// this.download();
break
case 1:
this.wechatFn()
break
}
},
//授权添加相册
toSetting() {
return new Promise((resolve, reject) => {
wx.getSetting({
success: res => {
if (res.authSetting['scope.writePhotosAlbum']) {
resolve(true)
} else {
wx.openSetting({
success: resp => {
if (resp.authSetting['scope.writePhotosAlbum']) {
resolve(true)
} else {
wx.showToast({
title: "下载海报前需要您授权'添加到相册'权限",
icon: 'none',
duration: 2500
})
}
}
})
}
}
})
})
},
// 微信转发
wechatFn() {
// this.data.onShareAppMessage()
// this.modelcloseFn();
},
// 下载海报
async download() {
let { actNum, activeNavIdx, imgHeightArr, imgPath } = this.data
const { appId } = wx.getAccountInfoSync().miniProgram
let { userInfo } = wx.$storage.get(),
wx_user_info = wx.$storage.get('wx_user_info'),
senceItem = senceData[actNum], item = senceData[actNum]?.productList[activeNavIdx];
// let wx_user_info = wx.$storage.get("wx_user_info");
// console.log('wx_user_info: ', wx_user_info.appId);
wx.showLoading({
title: "海报生成中...",
});
console.log(wx_user_info)
let params = {
actNum,
activeNavIdx,
isShare: true,
merchantId:userInfo.merchantId || '',
shareOpenId: wx_user_info.openId || '',
sharePhone: userInfo.phone || '',
sceneCode: senceItem?.sceneCode || '',
productCode: item?.productCode || '',
productDesc: item?.productName || '',
category: item?.category || ''
};
// console.log(' wx_user_info.appId', wx_user_info)
let res = await createQrCodeApi({
appId: appId,
// appId:'wx2c28337db96364d2',
path: 'pages/checkProduct/checkProduct',
scene: JSON.stringify(params)
})
let _this = this
console.log('imgPath',imgPath)
wx.getImageInfo({
src: imgPath,
success: async respp => {
let imgW = respp.width / 4,
imgH = respp.height / 4
let pradH = (288 * imgW) / 1029,
qrcodeH = 100
let drawFun = new Draw({
width: imgW,
height: imgH + pradH
})
console.log('actNum', actNum)
let qrcodeY = actNum == 2 ? 20 : 0
let arr = [456, 222, 0, 496]
let imgList = [
{
x: 0,
y: 0,
width: imgW,
height: pradH,
url: `${IMG_URL}index/canvas/${senceData[actNum].productList[activeNavIdx].img}.png`
},
{
x: 0,
y: pradH,
width: imgW,
height: imgH,
url: `https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/longpic${actNum + 1}.jpg?v=${Date.now()}`
// url: `https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/longpic${actNum + 1}.webp`
},
{
// x: 245 * 2,
// y: erCodeHeight + 30,
// width: 120 * 2,
// height: 120 * 2,
x: imgW - qrcodeH,
y: imgH + pradH - qrcodeH - 20,
width: qrcodeH,
height: qrcodeH,
url: res.data //二维码
}
]
let telephone = userInfo.phone ? userInfo.phone : ''
let textList = [
{
x: 22,
y: imgH + pradH - 25,
text: `联系我:${telephone}`,
color: '#323436',
fontSize: 10
}
]
// console.log(imgList)
let posterUrl = await drawFun.begin({
imageList: imgList,
textList
})
_this.setData({
posterUrl: posterUrl.path
})
console.log('posterUrl.path', posterUrl.path)
if (_this.data.posterUrl) {
wx.saveImageToPhotosAlbum({
filePath: _this.data.posterUrl, //仅为示例,并非真实的资源
success(res) {
console.log('res: ', res)
wx.$api.showToast('下载成功!')
}
})
}
// _this.modelcloseFn();
wx.hideLoading()
},
fail:(err)=>{
wx.$api.showToast('下载失败')
// console.log(err)
}
})
},
authFail(){
wx.showToast({
title: "下载海报前需要您授权'添加到相册'权限",
icon: "none",
duration: 2500,
});
},
authSuccess(){
this.download()
},
// //模态框关闭
// modelClose() {
// this.triggerEvent("modelclose", false);
// },
// 图片加载事件
// onloadFn(event) {
// // console.log("event.detail", event.detail);
// this.setData({
// imgHeight: event.detail.height / 5,
// imgWidth: event.detail.width / 5,
// });
// },
// 图片视频加载回调拿到url
getImgInfo(actNum) {
wx.showLoading({
title: '加载中'
})
let _this = this
wx.getImageInfo({
src: `https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/longpic${actNum + 1}.jpg?v=${Date.now()}`,
// src: `https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/longpic${actNum + 1}.png`,
success: async res => {
// console.log('res图片信息: ', res)
wx.hideLoading()
wx.nextTick(() => {
_this.setData({
// isShow: true,
imgPath: res.path
})
})
},
fail:(err) => {
console.log('err: ', err);
}
})
},
// 分享获取懂得用户数
authorizedFn(e) {
let res = e.detail
this.onLoad(null)
wx.nextTick(() => {
//储存手机号
// console.log("储存手机号",res.phone)
wx.$storage.set('authphone', res.phone)
this.setData({
// isShare: res.isShare,
phone: res.phone
})
})
},
/**
* 生命周期函数--监听页面加载 (扫码,分享链接)
*/
async onLoad(options) {
await this.getData()
// console.log('分享onLoad: ', options)
// actNum,activeNavIdx isShare
if (!options || utils.isEmptyObj(options)) return
// this.analysisOption();
// 解析二维码参数
if (options.scene) {
this.setData({
isShare: true
})
let ercodeParams = await this.analysisQRcode(options.scene)
console.log(ercodeParams)
options = JSON.parse(ercodeParams.scene)
this.options = options
console.log('====================',this.options)
this.onLoad(null)
}
let { senceData } = this.data
// 扫码进来
let { actNum, activeNavIdx, isShare } = options
console.log('actNum, activeNavIdx, isShare: ', actNum, activeNavIdx, isShare)
if (isShare) {
this.setData({
isShow: false
})
} else {
wx.showLoading({
title: '加载图片中'
})
}
this.setData({
actNum,
activeNavIdx,
isShare: true,
outshowVideo: false, //显示视频列表
share_phone: options.sharePhone
});
// 发请求
console.log()
let senceItem = senceData[actNum]
let item = senceData[actNum]?.productList[activeNavIdx]
this.shareQuery = `sceneCode=${senceItem?.sceneCode}&productCode=${item?.productCode}&isShare=${true}&productDesc=${item?.productName}&category=${item?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}`
this.shareTrackData = {
sceneCode: senceItem?.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName
// actNum,
// activeNavIdx,
}
// 有手机号就不用再一次授权昵称,手机号
let phone = wx.$storage.get('authphone')
console.log('储存手机号', phone)
if (phone) {
this.setData({
isAuthphone: false,
outshowVideo: true,
isShare: false
})
}
},
// 解析二维码回调
// async analysisOption() {},
// 解析扫码进来参数
async analysisQRcode(str) {
let id = str.split('%3D')[1]
let res = await sceneByIdApi({
id
})
// console.log('res: ', res);
return res
},
// 获取用户昵称
getUserProfile(e) {
this.setData({
hasUserInfo: true
})
let _this = this
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({
desc: '用于完善资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: res => {
// console.log('res: ', res.userInfo.nickName);
// userInfo.nickName
this.setData({
userInfo: res.userInfo
})
let wx_user_info = wx.$storage.get('wx_user_info')
// console.log('wx_user_info: ', wx_user_info);
let obj = {
...wx_user_info,
nickName: res.userInfo.nickName,
avatarUrl: res.userInfo.avatarUrl
}
// console.log('obj',obj)
wx.$storage.set('wx_user_info', obj)
_this.onLoad(null)
}
})
},
onPageScroll: (function () {
let timer = null
return function (e) {
// console.log("在滚动");
// 监听页面的滚动开始和结束
clearTimeout(timer)
timer = setTimeout(() => {
// console.log("滚动结束");
wx.$eventbus.emit('evt_page_scroll', { scrollTop: e.scrollTop })
}, 500)
}
})(),
//视频弹窗
videoplay(){
wx.$eventbus.on('getvideo',(e)=>{
// console.log('getvideo event bus: ', e);
let obj = {
videoTitle:e.title,
videoSrc:e.src
}
this.getVideoUrl(obj)
wx.nextTick(() => {
this.videocomp.play();
});
})
},
//设置视频url
getVideoUrl(params){
this.setData(params)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
this.videocomp = this.selectComponent("#videocomp1");
this.videoplay()
},
/**
* 生命周期函数--监听页面显示
*/
onShow(options) {
// wx.nextTick(()=>{
// let {senceData ,actNum, activeNavIdx} = this.data
// console.log('senceData: ', senceData,actNum,activeNavIdx);
// let item = senceData[actNum]?.productList[activeNavIdx].proName;
// console.log('item: ', item);
// wx.setNavigationBarTitle({
// title: item.proName,
// })
// })
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
/**
* 浏览埋点
*/
onShareTimeline() {},
onViewTrack: true
})
{
"usingComponents": {
"product": "../tab/index/components/product/product",
"FullscreenVideo":"../../components/FullscreenVideo/FullscreenVideo",
"authorize":"/components/Authorize/Authorize"
},
"navigationStyle": "custom",
"onReachBottomDistance": 10,
"enablePullDownRefresh": true
}
/* pages/checkProduct/checkProduct.wxss */
.productCon {
box-sizing: border-box;
padding-top: 88px;
display: block;
}
// 分享模态框
.share-wrap {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 2;
.img-wrap {
position: absolute;
top: 15%;
left: 50%;
transform: translateX(-50%);
// width: 225px;
width: 60%;
height: 54%;
// background-color: red;
overflow: auto;
border-radius: 16rpx;
.prod-item {
background-color: #f5f7fb;
.prod-item {
padding: 0 32rpx 32rpx;
margin: 16rpx auto 0;
// background-color: #f5f7fb;
// border-radius: 48rpx 48rpx 0 0;
}
.prod-card {
display: flex;
height: 120rpx;
background-image: linear-gradient(1deg, #ffffff 10%, #fdfcff 100%);
border: 2rpx solid #ffffff;
// box-shadow: 0 8rpx 20rpx 0 rgba(197, 205, 235, 0.35);
border-radius: 20rpx;
padding: 0 24rpx;
// box-sizing: border-box;
position: relative;
}
.prod-card .card-img {
padding-top: 10rpx;
width: 100rpx;
height: 100rpx;
flex-shrink: 0;
border-radius: 4rpx;
}
.img-desc {
position: absolute;
width: 104rpx;
height: 40rpx;
line-height: 40rpx;
background: #d7f5eb;
border-radius: 4rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 24rpx;
color: #24b38c;
letter-spacing: 0;
text-align: center;
}
.prod-info {
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 12rpx 0;
margin-left: 24rpx;
}
.prod-info > text {
display: block;
white-space: nowrap;
// height: 40rpx;
// line-height: 40rpx;
}
.prod-info .title {
font-weight: 500;
font-size: 16rpx;
color: #323436;
}
.prod-info .sale,
.prod-info .earnings {
font-size: 16rpx;
color: #7a8299;
}
.prod-info .sale-num {
font-size: 14rpx;
color: #323436;
}
.prod-info .earnings-num {
font-size: 14rpx;
font-weight: Bold;
color: #f35251;
}
}
.img {
width: 100%;
// height: auto;
// height: 60%;
background-color: #fff;
}
}
}
.btns-wrap {
padding-bottom: 84rpx;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 120rpx;
background: #ffffff;
z-index: 1;
// border-radius: 8px 8px 0 0;
.top {
display: flex;
justify-content: space-around;
.btn {
padding-top: 16px;
}
.img {
display: block;
margin: 0 auto 8px;
width: 40px;
height: 40px;
}
// .name {
// font-size: 12px;
// color: #323436;
// text-align: center;
// }
.name0{
width: 256rpx;
height: 88rpx;
border: 1px solid #EEEEEE;
border-radius: 8rpx;
font-size: 28rpx;
color: #8A8C90;
text-align: center;
line-height:88rpx;
}
.name1{
width: 414rpx;
height: 88rpx;
background: #3666FE;
border-radius: 8rpx;
font-size: 28rpx;
color: #FFFFFF;
line-height:88rpx;
}
.btn-wechat {
width: auto;
margin: 0;
padding: 0;
background-color: #fff;
}
}
.btom {
margin: 18px auto 0;
width: 343px;
height: 44px;
line-height: 44px;
border: 1px solid #eeeeee;
border-radius: 4px;
text-align: center;
}
}
/* 用户授权 */
.user-profile {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 3;
background-color: transparent;
}
<!-- pages/checkProduct/checkProduct.wxml -->
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
{{senceData[actNum].productList[activeNavIdx].proName}}
</navigation-bar>
<!-- <view style="height:{{headerHeight}}px">
</view> -->
<!-- style="padding-top:{{headerHeight}}px" -->
<product stickyTop="{{headerHeight}}" class="productCon" img_version="{{img_version}}" isAuthphone="{{isAuthphone}}" actNum="{{actNum}}" wrapactiveNavIdx="{{activeNavIdx}}" senceData="{{senceData}}" outshowVideo="{{outshowVideo}}" isShare="{{isShare}}" isShow="{{isShow}}" bindauthorized="authorizedFn" phone="{{share_phone}}" />
<!-- 分享弹框 -->
<!-- <view class="share-wrap" wx:if="{{isShow}}">
<view class="img-wrap">
<view class="prod-item">
<view class="prod-card">
<view class="card-img">
<image src="{{IMG_URL}}index/prod/{{senceData[actNum].productList[activeNavIdx].img}}.png" />
</view>
<view class="prod-info">
<text class="title">{{senceData[actNum].productList[activeNavIdx].proName}}</text>
<text class="sale" decode="{{true}}">
{{senceData[actNum]['productList'][activeNavIdx].varType == 1 ? '三年售后存量数':'新车销量'}}&nbsp;
<text class="sale-num">
{{senceData[actNum]['productList'][activeNavIdx].varType == 1? senceData[actNum]['productList'][activeNavIdx].flow : senceData[actNum]['productList'][activeNavIdx].sale}}
</text>
</text>
<text class="earnings" decode="{{true}}">
预估收益&nbsp;
<text class="earnings-num">
{{senceData[actNum]['productList'][activeNavIdx].profit}}
</text>
</text>
</view>
</view>
</view>
</view>
<button></button>
</view> -->
<!-- 用于图片加载事件 -->
<!-- <image class="img" webp src="{{IMG_URL}}index/longpic{{actNum+1}}.png" bindload="onloadFn" /> -->
<view class="btns-wrap" wx:if="{{isShow}}">
<view class="top">
<view class="btn" wx:for="{{btnList}}" wx:key="name" bindtap="handleClick" data-index="{{index}}">
<block wx:if="{{index == 1}}">
<button open-type="share" class="btn-wechat">
<view class="name{{index}}">{{item.name}}</view>
</button>
</block>
<block wx:else>
<view class="name{{index}}">{{item.name}}</view>
</block>
</view>
</view>
<!-- <view class="btom" bindtap="modelcloseFn">取消</view> -->
</view>
<!-- 授权昵称 -->
<!-- !hasUserInfo && !isShow -->
<view wx:if="{{!hasUserInfo && isShare && isAuthphone}}" class="user-profile" bindtap="getUserProfile"></view>
<!-- 全屏视频组件 -->
<FullscreenVideo id="videocomp1" src="{{videoSrc}}" title="{{videoTitle}}"></FullscreenVideo>
<!-- 下载授权 -->
<block wx:if="{{showAuth}}">
<authorize title="下载前需要获取您的‘添加到相册’权限,是否打开授权设置?" scopeType="writePhotosAlbum" buttonType="openSetting" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
</block>
var measureList = Object.freeze([
{
// name: '新车交付场景',
name: '精品升级',
// tips: '精品升级',
iconName: 'icon2',
product: [
{
name: '太阳膜升级',
parentName: '精品升级',
// tips: '精品升级',
// value: '1-0',
typeIndex: '1.1',
isCheck: false,
rate: '0.55',
averagePrice: 1400,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.65'
}
]
},
{
name: '次新车转化',
iconName: 'icon3',
// tips: '膨胀金活动',
product: [
{
name: '膨胀金活动-车衣',
parentName: '次新车转化',
// tips: '膨胀金活动',
// value: '2-0',
typeIndex: '1.2',
isCheck: false,
rate: '0.09',
averagePrice: 5000,
flowCost: '0.1',
flowCostText: '10%',
serviceDividendRatio: '0.85'
},
{
name: '膨胀金活动-改色膜',
parentName: '次新车转化',
// tips: '膨胀金活动',
// value: '2-1',
typeIndex: '1.2',
isCheck: false,
rate: '0.06',
averagePrice: 2999,
flowCost: '0.1',
flowCostText: '10%',
serviceDividendRatio: '0.74'
}
]
},
{
name: '售后众筹',
iconName: 'icon4',
// tips: '众筹活动',
product: [
{
name: '360全景导航',
parentName: '售后众筹',
// tips: '众筹活动',
typeIndex: '1.3',
// value: '3-0',
isCheck: false,
rate: '0.015',
averagePrice: 2680,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.16'
},
{
name: 'AR导航',
parentName: '售后众筹',
// tips: '众筹活动',
// value: '3-1',
typeIndex: '1.3',
isCheck: false,
rate: '0.015',
averagePrice: 1680,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.24'
},
{
name: '氛围灯',
parentName: '售后众筹',
// tips: '众筹活动',
// value: '3-2',
typeIndex: '1.3',
isCheck: false,
rate: '0.015',
averagePrice: 2680,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.22'
},
{
name: '座椅通风',
parentName: '售后众筹',
// tips: '众筹活动',
// value: '3-3',
typeIndex: '1.3',
isCheck: false,
rate: '0.01',
averagePrice: 2580,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.21'
},
{
name: '智能香薰',
parentName: '售后众筹',
// tips: '众筹活动',
// value: '3-4',
typeIndex: '1.3',
isCheck: false,
rate: '0.015',
averagePrice: 1680,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.24'
}
]
},
{
name: '会员权益/升级',
// tips: '车损升级',
iconName: 'icon1',
product: [
{
name: '车损升级',
parentName: '会员权益/升级',
// tips: '车损升级',
// value: '0-0',
typeIndex: '1.0',
isCheck: false,
rate: '0.5',
averagePrice: 1200,
flowCost: '0.4',
flowCostText: '40%',
serviceDividendRatio: '0.23'
}
]
},
])
export default {
measureList
}
\ No newline at end of file \ No newline at end of file
// pages/measure/measure.js
import Util from '~/utils/util'
import measureData from '../constant/data'
const checkMap = new Map()
let imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
Page({
/**
* 页面的初始数据
*/
data: {
IMGURL:imgUrl,
measureList: measureData.measureList,
isDisabled: true,
checkArray: [],
formData: {
storeNumber: '',
carNumber: '',
customNumber: ''
}
},
// 提交
submit() {
const reg = /^[1-9]\d*$/
// for(let i in this.data.formData) {
// if (!reg.test(this.data.formData[i])) {
// wx.showToast({
// title: '请输入正整数',
// icon: 'none',
// duration: 1000
// })
// this.setData({
// isDisabled: true
// })
// return
// }
// }
if (!this.data.isDisabled) {
// console.log(this.data.checkArray)
let checkArray = []
this.data.measureList.forEach(item => {
item.product.forEach(i => {
if (i.isCheck) {
checkArray.push(i)
}
})
})
// console.log(checkArray)
const params = Object.assign({checkArray}, this.data.formData)
// console.log(params)
wx.$router.go("measureResult", params);
}
},
// 选择产品
checkProduct(e) {
const { pidx, idx } = e.currentTarget.dataset
const value = pidx + '-' + idx
const name = `measureList[${pidx}].product[${idx}].isCheck`
const val = this.data.measureList[pidx].product[idx].isCheck
!val ? checkMap.set(value, !val) : checkMap.delete(value)
// console.log(checkMap)
this.setData({
[name]: !val,
checkArray: [...checkMap.keys()]
})
this.validForm()
// console.log(this.data.checkArray)
},
// 必填校验
validForm() {
const flag = this.data.formData.storeNumber && this.data.formData.carNumber && this.data.formData.customNumber && this.data.checkArray.length
this.setData({
isDisabled: !flag
})
return flag
},
// 表单输入
handleInput(e) {
let name = e.currentTarget.dataset.name
let val = this.validateNumber(e.detail.value)
// console.log(val)
const form = `formData.${name}`
this.setData({
[form]: val
})
this.validForm()
},
// 输入正整数校验
validateNumber(val) {
// console.log(val, val.replace(/\D/g, ''))
return val == 0 ? '' : val.replace(/\D/g, '')
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "展业测算"
}
\ No newline at end of file \ No newline at end of file
<!--pages/measure/measure.wxml-->
<view class="wrapper-measure">
<image class="header-bg" webp src="{{IMGURL}}measure/header-bg.png?v={{img_version}}"></image>
<view class="form first-form">
<view class="form-title">请输入4S店基本信息</view>
<view class="form-label">您合作的4S门店数量</view>
<input class="form-value" value="{{formData.storeNumber}}" bindinput="handleInput" data-name="storeNumber" maxlength="4" type="number" placeholder="请输入"/>
<view class="form-label">4S店单店月均新车销量</view>
<input class="form-value" value="{{formData.carNumber}}" bindinput="handleInput" data-name="carNumber" maxlength="4" type="number" placeholder="请输入"/>
<view class="form-label">4S店单店3年以上存量车主</view>
<input class="form-value" value="{{formData.customNumber}}" bindinput="handleInput" data-name="customNumber" maxlength="6" type="number" placeholder="请输入"/>
</view>
<view class="form second-form">
<view class="form-title">请选择场景/产品</view>
<block wx:for="{{measureList}}" wx:for-item="i" wx:key="index">
<view class="scenario">
<image class="icon" webp src="{{IMGURL}}measure/{{i.iconName}}.png?v={{img_version}}"></image>
{{i.name}}
<!-- <view wx:if="{{i.tips}}" class="title-tip">{{i.tips}}</view> -->
</view>
<view class="product-list">
<view class="product-item {{j.isCheck ? 'active':''}}" wx:for="{{i.product}}" wx:for-item="j" wx:for-index="jIdx" wx:key="index" data-pidx="{{index}}" data-idx="{{jIdx}}" data-value="{{j.value}}" bindtap="checkProduct">
<image hidden="{{!j.isCheck}}" class="iconCheck" webp src="{{IMGURL}}measure/icon-check.png?v={{img_version}}"></image>
{{j.name}}</view>
</view>
</block>
</view>
<view class="submit {{isDisabled ? 'disabled' : ''}}" bindtap="submit">开始测算</view>
</view>
/* pages/measure/measure.wxss */
.wrapper-measure {
position: relative;
padding: 0 24rpx 90rpx;
}
.wrapper-measure .header-bg {
position: absolute;
top: -224rpx;
left: 0;
width: 100%;
z-index: -1;
height: 480rpx;
}
.form {
width: 100%;
box-sizing: border-box;
background: #fff;
box-shadow: 0 4rpx 32rpx 0 rgba(175,181,219,0.40);
border-radius: 16rpx;
padding: 32rpx 40rpx;
}
.form-title {
font-weight: 500;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
text-align: center;
line-height: 56rpx;
}
.first-form {
margin-top: 224rpx;
}
.second-form {
margin-top: 48rpx;
}
.form-label {
font-size: 28rpx;
margin-top: 32rpx;
}
.form-value {
margin-top: 16rpx;
height: 80rpx;
background: #FFFFFF;
border: 2rpx solid #E6E6E6;
border-radius: 4rpx;
padding: 0 20rpx;
box-sizing: border-box;
font-size: 28rpx;
font-size: 28rpx;
line-height: 48rpx;
}
.scenario {
display: flex;
align-items: center;
width: 100%;
padding: 10rpx 24rpx;
background: #F5F5FA;
border-radius: 8rpx;
margin-top: 48rpx;
font-weight: 500;
font-size: 28rpx;
color: #323436;
letter-spacing: 0;
line-height: 44rpx;
box-sizing: border-box;
}
.scenario .icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
.title-tip {
font-weight: 400;
font-size: 24rpx;
color: #6E6E7A;
letter-spacing: 0;
line-height: 44rpx;
margin-left: 8rpx;
}
.product-list {
/* display: flex; */
width: 100%;
}
.product-item {
position: relative;
display: inline-block;
width: calc(50% - 42rpx);
background: #FFFFFF;
border: 2rpx solid #E6E6E6;
border-radius: 8rpx;
text-align: center;
padding: 14rpx;
margin-top: 18rpx;
font-size: 28rpx;
color: #323436;
letter-spacing: 0;
text-align: center;
line-height: 44rpx;
}
.product-item.active {
background-image: linear-gradient(0deg, #E8E8FF 14%, #FAFAFF 89%);
border: 2rpx solid #9994FF;
}
.product-item:nth-child(even) {
margin-left: 18rpx;
}
.iconCheck {
position: absolute;
width: 30rpx;
height: 22rpx;
top: -2rpx;
right: -2rpx;
}
.submit {
margin: 48rpx 32rpx;
padding: 24rpx 245rpx;
background: #5850FF;
border-radius: 8rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
letter-spacing: 0.8rpx;
text-align: center;
}
.submit.disabled {
background: #D3D3DB;
}
\ No newline at end of file \ No newline at end of file
// pages/measureResult/measureResult.js
import Util from '~/utils/util'
import measureData from '../constant/data'
let imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
Page({
/**
* 页面的初始数据
*/
data: {
IMGURL:imgUrl,
visible: false,
measureList: null,
formData: {
storeNumber: 1,
carNumber: 1,
customNumber: 1,
checkArray: []
},
checkList: [],
singleList: ['baseCustomersNumber', 'valueAddNumber', 'storeIncomeNumber', 'serviceIncomeNumber', 'singleValueAddNumber', 'singleStoreIncomeNumber', 'singleServiceIncomeNumber'],
countList: ['valueAddCount', 'storeIncomeCount', 'serviceIncomeCount', 'singleValueAddCount', 'singleStoreIncomeCount', 'singleServiceIncomeCount'],
countData: {},
dialogData: {
rate: '',
averagePrice: ''
}
},
// 计算公式
formula(name, item, list) {
console.log(name, item)
const {storeNumber, carNumber, customNumber} = this.data.formData
const {rate, averagePrice, flowCost, serviceDividendRatio, typeIndex} = item
console.log(storeNumber, carNumber, customNumber)
let value = 0
switch(name) {
// 增值产量(总)
case 'valueAddCount':
list.forEach(i => {
value = value + (+i.valueAddNumber)
})
break
// 4s店收入/年
case 'storeIncomeCount':
list.forEach(i => {
value = value + (+i.storeIncomeNumber)
})
break
// 服务商收入/年
case 'serviceIncomeCount':
list.forEach(i => {
value = value + (+i.serviceIncomeNumber)
})
break
// 单店均值
case 'singleValueAddCount':
let val = 0
list.forEach(i => {
val = val + (+i.valueAddNumber)
})
value = (val / storeNumber).toFixed(0)
break
// 单店均值
case 'singleStoreIncomeCount':
let val1 = 0
list.forEach(i => {
val1 = val1 + (+i.storeIncomeNumber)
})
value = (val1 / storeNumber).toFixed(0)
break
// 单店均值
case 'singleServiceIncomeCount':
let val2 = 0
list.forEach(i => {
val2 = val2 + (+i.serviceIncomeNumber)
})
value = (val2 / storeNumber).toFixed(0)
break
// 基盘客户数
case 'baseCustomersNumber':
if (typeIndex == '1.3') {
value = customNumber * storeNumber
} else {
value = carNumber * 12 * storeNumber
}
break
// 增量产值/年(单个产品)总
case 'valueAddNumber':
if (typeIndex == '1.3') {
value = (customNumber * storeNumber* rate * averagePrice).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice).toFixed(0)
}
break
// 单店产值
case 'singleValueAddNumber':
if (typeIndex == '1.3') {
value = (customNumber * storeNumber* rate * averagePrice / storeNumber).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice / storeNumber).toFixed(0)
}
break
// 4s店收入/年
case 'storeIncomeNumber':
if (typeIndex == '1.3') {
value = (customNumber * storeNumber* rate * averagePrice * flowCost).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice * flowCost).toFixed(0)
}
break
// 服务商收入/年
case 'serviceIncomeNumber':
if (typeIndex == '1.3') {
value = (customNumber * storeNumber* rate * averagePrice * serviceDividendRatio).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice * serviceDividendRatio).toFixed(0)
}
break
// 4s店收入/年,单店
case 'singleStoreIncomeNumber':
if (typeIndex == '1.3') {
value = (customNumber * storeNumber* rate * averagePrice * flowCost / storeNumber).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice * flowCost / storeNumber).toFixed(0)
}
break
// 服务商收入/年,单店
case 'singleServiceIncomeNumber':
if (typeIndex == '1.3') {
value = (customNumber * storeNumber* rate * averagePrice * serviceDividendRatio / storeNumber).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice * serviceDividendRatio / storeNumber).toFixed(0)
}
break
}
return value;
},
// 开始计算
getCalculate(checkArray, isCount = false) {
const checkList = checkArray
if (!isCount) {
const singleList = this.data.singleList
checkList.forEach(item => {
singleList.forEach(i => {
const value = this.formula(i, item)
item[i] = value
})
})
return checkList
} else {
const {countList} = this.data
const countData = {}
console.log(checkList)
checkList.forEach(i => {
countList.forEach(j => {
const value = this.formula(j, i, checkList)
countData[j] = value
})
})
return countData
}
},
// 编辑
toEdit(e) {
console.log(e)
const {item, index} = e.currentTarget.dataset
console.log(item)
this.setData({
visible: true,
'dialogData.rate': (item.rate * 10000 / 100).toFixed(2),
'dialogData.averagePrice': item.averagePrice,
'dialogData.index': index
});
},
showCalculate() {
this.setData({
visible: false
})
},
clickDialog(e) {
// console.log(e.changedTouches[0].clientY);
// if (e.changedTouches[0].clientY < 451) {
// this.setData({
// visible: false
// });
// }
},
submit(e) {
console.log(e, this.data.dialogData)
const {rate, averagePrice, index} = this.data.dialogData
console.log(index)
// const reg = /^[1-9]\d*$/
// const reg1 = /^[1-9]{0,1}\d{1}(.\d{0,2})$/
if (!rate) {
wx.showToast({
title: '请输入转化率',
icon: 'none',
duration: 2000
})
return
}
if (!averagePrice) {
wx.showToast({
title: '请输入客均单价',
icon: 'none',
duration: 2000
})
return
}
this.setData({
[`checkList[${index}].rate`]: rate / 100,
[`checkList[${index}].averagePrice`]: averagePrice,
visible: false
})
console.log(this.data)
const checkList = this.getCalculate(this.data.checkList)
const countData = this.getCalculate(this.data.checkList, true)
console.log(checkList, countData)
this.setData({
checkList,
countData
})
},
// 输入框输入
handleInput(e) {
console.log(e)
let value = e.detail.value
const name = e.target.dataset.name
const reg = /^[1-9]\d*$/
const reg1 = /^[1-9]{0,1}\d{1}(.\d{0,2})$/
console.log(value <100 && value > 0, (reg.test(value) || reg1.test(value)))
if (name == 'rate') {
if (value <= 0) {
value = null
} else if (value > 100) {
value = value.slice(0,2)
} else if (value > 0 && value < 100) {
const valueArr = value.split('.')
if (valueArr.length == 2) {
const decimal = value.split('.')[1].slice(0,2)
const integer = value.split('.')[0]
value = integer + '.' + decimal
}
} else {
console.log(value)
value = value.slice(0, value.length - 1)
}
} else {
value = this.validateNumber(value)
}
console.log(value)
const form = `dialogData.${name}`
this.setData({
[form]: value
})
// this.setData({
// 'dialogData.rate': value
// })
},
// 输入正整数校验
validateNumber(val) {
console.log(val, val.replace(/\D/g, ''))
return val == 0 ? '' : val.replace(/\D/g, '')
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.$router.getData(res => {
console.log(res)
const list = Util.deepClone(res)
this.setData({
formData: list
})
const checkList = this.getCalculate(list.checkArray)
const countData = this.getCalculate(list.checkArray, true)
console.log(checkList)
this.setData({
checkList,
countData,
})
console.log(countData)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
measureList: measureData.measureList
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "测算结果"
}
\ No newline at end of file \ No newline at end of file
<!--pages/measureResult/measureResult.wxml-->
<view class="wrapper">
<image class="header-bg {{formData.storeNumber > 1 ? '':'banner1'}}" webp src="{{IMGURL}}measure/{{formData.storeNumber > 1 ? 'banner2':'banner1'}}.png?v={{img_version}}"></image>
<view class="wrapper-header">
<view class="store-number">门店数量:{{formData.storeNumber}}</view>
<view class="header-box">
<view class="card-item">
<view class="card-label m-b-8">增量产值/年</view>
<view class="card-value">
<view class="card-number">{{filter.formatValue(countData.valueAddCount, false)}}</view>
<view class="card-unit">{{filter.formatValue(countData.valueAddCount, false, true)}}元</view>
</view>
</view>
<view class="card-item">
<view class="card-label m-b-8">4S店收入/年</view>
<view class="card-value">
<view class="card-number">{{filter.formatValue(countData.storeIncomeCount, false)}}</view>
<view class="card-unit">{{filter.formatValue(countData.storeIncomeCount, false, true)}}元</view>
</view>
</view>
<view class="card-item">
<view class="card-label m-b-8">服务商收入/年</view>
<view class="card-value">
<view class="card-number">{{filter.formatValue(countData.serviceIncomeCount, false)}}</view>
<view class="card-unit">{{filter.formatValue(countData.serviceIncomeCount, false, true)}}元</view>
</view>
</view>
<view class="m-b-24" wx:if="{{formData.storeNumber > 1}}">
<view class="card-item ">
<view class="card-label m-b-8 gray">单店均值</view>
<view class="card-value card-single-value">{{filter.formatValue(countData.singleValueAddCount, false)}}
<view class="card-single-unit">{{filter.formatValue(countData.singleValueAddCount, false, true)}}元</view>
</view>
</view>
<view class="card-item">
<view class="card-label m-b-8 gray">单店均值</view>
<view class="card-value card-single-value">
{{filter.formatValue(countData.singleStoreIncomeCount, false)}}
<view class="card-single-unit">{{filter.formatValue(countData.singleStoreIncomeCount, false, true)}}元</view>
</view>
</view>
<view class="card-item">
<view class="card-label m-b-8 gray">单店均值</view>
<view class="card-value card-single-value">
{{filter.formatValue(countData.singleServiceIncomeCount, false)}}
<view class="card-single-unit">{{filter.formatValue(countData.singleServiceIncomeCount, false, true)}}元</view>
</view>
</view>
</view>
</view>
</view>
<block wx:if="{{formData.storeNumber == 1}}">
<view class="card-box" wx:for="{{checkList}}" wx:for-item="m" wx:key="i" wx:for-index="i">
<view class="card-title">
<view class="card-left">
<view>{{m.parentName}}</view>
<view class="card-product">{{m.tips}} {{m.name}}</view>
</view>
<view class="card-edit" data-item="{{m}}" data-index="{{i}}" bindtap="toEdit">
<image class="icon-edit" webp src="{{IMGURL}}measure/icon-edit.png?v={{img_version}}"></image>
编辑
</view>
</view>
<view class="card-content">
<view class="card-item">
<view class="card-label gray m-b-4">{{ m.typeIndex == '1.3' ? '基盘客户数' : '新车客户数' }}</view>
<view class="card-value gray value-number">{{filter.formatValue(m.baseCustomersNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-4">转化率</view>
<view class="card-value color value-number">{{filter.decimalFormat(m.rate)}}%</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-4">客单均价</view>
<view class="card-value color value-number">{{m.averagePrice}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-4">增量产值/年</view>
<view class="card-value normal value-number">{{filter.formatValue(m.valueAddNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-4">流量成本</view>
<view class="card-value normal value-number">{{m.flowCost * 100}}%</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-4">4S店收入/年</view>
<view class="card-value normal value-number">{{filter.formatValue(m.storeIncomeNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">服务商分润比例</view>
<view class="card-value normal">{{m.serviceDividendRatio * 100}}%</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-4">服务商收入/年</view>
<view class="card-value normal">{{filter.formatValue(m.serviceIncomeNumber)}}</view>
</view>
</view>
</view>
</block>
<block wx:else>
<view class="card-box" wx:for="{{checkList}}" wx:for-item="n" wx:key="j" wx:for-index="j">
<view class="card-title">
<view class="card-left">
<view>{{n.parentName}}</view>
<view class="card-product">{{n.tips}} {{n.name}}</view>
</view>
<view class="card-edit" data-item="{{n}}" data-index="{{j}}" bindtap="toEdit">
<image class="icon-edit" webp src="{{IMGURL}}measure/icon-edit.png?v={{img_version}}"></image>
编辑
</view>
</view>
<view class="card-content">
<view class="card-item">
<view class="card-label gray m-b-8">{{ n.typeIndex == '1.3' ? '基盘客户数' : '新车客户数' }}</view>
<view class="card-value gray value-number">{{filter.formatValue(n.baseCustomersNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">转化率</view>
<view class="card-value color value-number">{{filter.decimalFormat(n.rate)}}%</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">客单均价</view>
<view class="card-value color value-number">{{n.averagePrice}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">增量产值/年</view>
<view class="card-value normal value-number">{{filter.formatValue(n.valueAddNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">单店产值/年</view>
<view class="card-value normal value-number">{{filter.formatValue(n.singleValueAddNumber)}}</view>
</view>
<view>
<view class="card-item">
<view class="card-label gray m-b-8">流量成本</view>
<view class="card-value normal value-number">{{n.flowCost * 100}}%</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">4S店收入/年</view>
<view class="card-value normal">{{filter.formatValue(n.storeIncomeNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">单店收入/年</view>
<view class="card-value normal">{{filter.formatValue(n.singleStoreIncomeNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">服务商分润比例</view>
<view class="card-value normal value-number">{{n.serviceDividendRatio * 100}}%</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">服务商收入/年</view>
<view class="card-value normal">{{filter.formatValue(n.serviceIncomeNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">单店服务商收入/年</view>
<view class="card-value normal">{{filter.formatValue(n.singleServiceIncomeNumber)}}</view>
</view>
</view>
</view>
</view>
</block>
</view>
<!-- 测算弹窗 -->
<view class="dialog-wrapper" bindtap="clickDialog" hidden="{{!visible}}">
<view class="dialog-box">
<form bindsubmit="submit">
<view class="dialog-header">
<view hidden="{{isReset}}" class="header-btn btn-gray" bindtap="showCalculate">取消</view>
<view hidden="{{!isReset}}" class="header-btn btn-gray" bindtap="reset">重置</view>
<button class="header-btn btn-primary" form-type="submit">确定</button>
</view>
<view class="dialog-content">
<!-- <view class="dialog-title">输入您门店的基本情况</view> -->
<view class="dialog-form">
<view class="form-item">
<view class="form-label">转化率</view>
<view class="input-box">
<input class="form-input" bindfocus="focus" bindinput="handleInput" maxlength="8" data-name="rate" value="{{dialogData.rate}}" type="number" />
<view class="form-unit">%</view>
</view>
</view>
<view class="form-item">
<view class="form-label">客均单价</view>
<view class="input-box">
<input class="form-input" bindfocus="focus" maxlength="6" data-name="averagePrice" bindinput="handleInput" type="number" value="{{dialogData.averagePrice}}" />
<view class="form-unit">元</view>
</view>
</view>
</view>
</view>
</form>
</view>
</view>
<wxs module="filter">
function formatValue(value, hasUnit = true, onlyUnit = false) {
var val = value
var unit = ''
if(!val) return
if (typeof value == 'number') {
val = value.toString()
}
if (val.length > 8 ) {
val = (val / 100000000).toFixed(0)
unit = '亿'
} else if (val.length > 5) {
val = (val / 10000).toFixed(0)
unit = '万'
}
return onlyUnit ? unit : hasUnit ? val + unit : val
// if (val.length > 8 ) {
// return (val / 100000000).toFixed(0) + '亿'
// } else if (val.length > 5) {
// return (val / 10000).toFixed(0) + '万'
// } else {
// return val
// }
}
function decimalFormat(value) {
return (value * 100).toFixed(2)
}
module.exports.formatValue = formatValue
module.exports.decimalFormat = decimalFormat
</wxs>
\ No newline at end of file \ No newline at end of file
/* pages/measureResult/measureResult.wxss */
.wrapper {
padding-bottom: 90rpx;
}
.header-bg {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: -1;
}
.banner1 {
height: 400rpx;
}
.wrapper-header {
padding: 48rpx 32rpx;
}
.store-number {
position: relative;
font-weight: 600;
font-size: 34rpx;
color: #2D2D2E;
}
.store-number::after {
content: '';
display: inline-block;
position: absolute;
left: 0;
bottom: -24rpx;
width: 48rpx;
height: 6rpx;
background-color: #F5A623;
}
.header-box {
margin-top: 62rpx;
}
.card-item {
display: inline-block;
width: calc(100%/3);
}
.card-label {
font-weight: 400;
font-size: 24rpx;
color: #2D2D33;
line-height: 36rpx;
}
.card-value {
display: flex;
align-items: baseline;
font-weight: 700;
font-size: 40rpx;
color: #FFA034;
line-height: 48rpx;
}
.card-single-unit {
display: inline-block;
font-size: 24rpx;
color: #1B233D;
}
.m-b-8 {
margin-bottom: 8rpx;
}
.m-b-4 {
margin-bottom: 4rpx;
}
.m-b-24 {
margin-top: 24rpx;
}
.card-box {
background: #FFFFFF;
box-shadow: 0 4rpx 24rpx 0 rgba(175,181,219,0.40);
border-radius: 16rpx;
margin: 0 24rpx 20rpx;
}
.card-title {
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 500;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
line-height: 48rpx;
padding: 24rpx 32rpx;
border-bottom: 1rpx solid #F0F1F5;
}
.card-product {
display: inline-block;
font-weight: 400;
font-size: 28rpx;
color: #333333;
/* margin-left: 15rpx; */
}
.card-edit {
display: flex;
width: 100rpx;
align-items: center;
font-weight: 400;
font-size: 24rpx;
color: #5850FF;
}
.icon-edit {
margin-right: 8rpx;
width: 28rpx;
height: 28rpx;
}
.card-content {
padding: 23rpx 32rpx 32rpx;
}
.value-number {
margin-bottom: 32rpx;
}
.card-number {
display: inline-block;
}
.card-unit {
display: inline-block;
font-weight: 400;
font-size: 28rpx;
color: #FFA034;
}
.card-label.gray {
color: #6E6E7A;
font-weight: 400;
}
.card-value.gray {
font-size: 32rpx;
color: #6E6E7A;
font-weight: 400;
}
.card-value.card-single-value {
font-size: 32rpx;
color: #1B233D;
font-weight: 400;
}
.card-value.color {
color: #5850FF;
font-weight: 400;
font-size: 32rpx;
}
.card-value.normal {
color: #2D2D33;
font-weight: 400;
font-size: 32rpx;
}
/* 测算弹窗 */
.dialog-wrapper {
position: fixed;
height: 100vh;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(45,45,51,0.50);
}
.dialog-box {
position: fixed;
bottom: 0;
width: 100%;
height: 540rpx;
background-color: #fff;
box-shadow: 0 -8rpx 20rpx 0 rgba(180,186,204,0.32);
border-radius: 32rpx 32rpx 0 0;
}
.dialog-header {
display: flex;
justify-content: space-between;
padding: 32rpx 48rpx;
border-bottom: 1rpx solid #eee;
}
.header-btn {
display: inline-block;
font-size: 32rpx;
line-height: 48rpx;
}
.btn-gray {
color: #6C737A;
}
.btn-primary {
background-color: #fff;
border: none;
margin: 0;
padding: 0;
font-weight: 500;
color: #5850FF;
}
.btn-primary::after {
border: none;
}
.dialog-content {
padding: 40rpx 24rpx 60rpx;
}
.dialog-title {
font-weight: 600;
font-size: 36rpx;
color: #333333;
letter-spacing: 0;
text-align: center;
line-height: 56rpx;
margin-bottom: 24rpx;
}
.dialog-form {
width: 100%;
/* height: 384rpx; */
border-radius: 8rpx;
padding: 32rpx;
box-sizing: border-box;
}
.form-item {
display: flex;
align-items: center;
height: 80rpx;
margin-bottom: 24rpx;
justify-content: space-between;
}
.form-label {
width: 256rpx;
font-size: 28rpx;
color: #2D2D33;
}
.form-input {
width: 100%;
padding: 16rpx 20rpx;
border: 2rpx solid #E6E6E6;
border-radius: 4rpx;
}
.input-box {
position: relative;
/* margin-left: 64rpx; */
margin-right: 16rpx;
width: 446rpx;
}
.form-unit {
position: absolute;
right: -10rpx;
top: 50%;
transform: translateY(-50%);
font-size: 28rpx;
color: #9E9EA8;
}
.dialog-btn {
width: 100%;
padding: 24rpx 0;
box-sizing: border-box;
background: #5850FF;
border-radius: 8rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
letter-spacing: 0.8rpx;
text-align: center;
line-height: 48rpx;
margin-top: 40rpx;
}
\ No newline at end of file \ 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!