Commit 710c440c by 前端

fixed

1 parent 5c351bd3
Showing 71 changed files with 378 additions and 3899 deletions
...@@ -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"
...@@ -70,7 +62,9 @@ ...@@ -70,7 +62,9 @@
"pages/openBusiness", "pages/openBusiness",
"pages/summary", "pages/summary",
"pages/shareWebview/shareWebview", "pages/shareWebview/shareWebview",
"pages/visitor/visitor" "pages/visitor/visitor",
"pages/monthReport/monthReport",
"pages/crowdDetail/crowdDetail"
] ]
}, },
{ {
...@@ -95,6 +89,13 @@ ...@@ -95,6 +89,13 @@
"pages": [ "pages": [
"pages/apply" "pages/apply"
] ]
},
{
"root": "packagesList/outDetail",
"name": "outDetail",
"pages": [
"index"
]
} }
], ],
"preloadRule": { "preloadRule": {
......
// 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
...@@ -308,7 +308,7 @@ Component({ ...@@ -308,7 +308,7 @@ Component({
entranceType entranceType
} = this.data } = this.data
wx.navigateTo({ wx.navigateTo({
url: `/packageOutput/pages/monthReport/monthReport?time=${time}&type=${entranceType}&merchantId=${thisPage.data.merchantId}&merchantName=${thisPage.data.merchantName}`, url: `/packagesList/packageOutput/pages/monthReport/monthReport?time=${time}&type=${entranceType}&merchantId=${thisPage.data.merchantId}&merchantName=${thisPage.data.merchantName}`,
}) })
} }
}, },
......
...@@ -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
...@@ -3,7 +3,6 @@ ...@@ -3,7 +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" "activity-tab":"../activityTab/activityTab"
} }
} }
\ 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>
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
...@@ -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
// 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'
})
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* 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
{
"component": true,
"usingComponents": {}
}
\ 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"
}, },
......
/* 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{
.funnel-box {
padding: 40rpx 0; padding: 40rpx 0;
position: relative; position: relative;
.funnel-bg{
.funnel-bg {
position: absolute; position: absolute;
top: 40rpx; top: 40rpx;
left: 50%; left: 50%;
transform: translate(-50%); transform: translate(-50%);
width: 406rpx; width: 458.18rpx;
height: 288rpx; height: 298rpx;
image {
width: 458.18rpx;
height: 298rpx;
} }
.funnel-content{ }
.funnel-content {
display: flex; display: flex;
justify-content: center; justify-content: center;
height: 248rpx; height: 248rpx;
width: 100%; width: 100%;
padding-top: 40rpx; padding-top: 40rpx;
.left,.right{
.left,
.right {
display: flex; display: flex;
} }
.left{
.left {
flex: 0 0 406rpx; flex: 0 0 406rpx;
flex-flow: column; flex-flow: column;
justify-content: space-around; justify-content: space-around;
...@@ -36,18 +47,21 @@ ...@@ -36,18 +47,21 @@
color: #2D2D33; color: #2D2D33;
box-sizing: border-box; box-sizing: border-box;
padding-right: 20rpx; padding-right: 20rpx;
view{
view {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 28rpx; margin-right: 28rpx;
text{
text {
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
margin-left: 4rpx; margin-left: 4rpx;
} }
} }
} }
.right{
.right {
flex: 1; flex: 1;
flex-flow: column; flex-flow: column;
align-items: flex-start; align-items: flex-start;
...@@ -56,12 +70,14 @@ ...@@ -56,12 +70,14 @@
padding-top: 20rpx; padding-top: 20rpx;
font-size: 24rpx; font-size: 24rpx;
position: relative; position: relative;
.sort-box:last-child{
.sort-box:last-child {
position: absolute; position: absolute;
left: -46rpx; left: -46rpx;
top: 50%; top: 50%;
} }
.sort{
.sort {
font-size: 40rpx; font-size: 40rpx;
font-weight: bold; font-weight: bold;
margin-top: 4rpx; margin-top: 4rpx;
......
<!--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
{
"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.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!