Commit cc5fec92 by 前端

fixed

1 parent c032ea47
......@@ -2,15 +2,15 @@ import api from "~/utils/request/request";
const path = "scrm.api.stoassistant";
class ActivityApi {
// 获取活动列表数据
getActivityList(data) {
return api.post({
// method: `scrm.api.assistant.activity.page`,
method: `scrm.api.assistant.activity.staff.page`,
...data,
},
false
);
}
// getActivityList(data) {
// return api.post({
// // method: `scrm.api.assistant.activity.page`,
// method: `scrm.api.assistant.activity.staff.page`,
// ...data,
// },
// false
// );
// }
// 获取活动中任务内容
getActiveTaskList(data, params) {
return api.post({
......@@ -317,12 +317,12 @@ class ActivityApi {
})
}
/*门店助手-店总版售后众筹活动相关统计*/
// getActivityList(data) {
// return api.post({
// method: ` scrm.api.assistant.activity.statics`,
// ...data
// })
// }
getActivityList(data) {
return api.post({
method: `scrm.api.assistant.activity.statics`,
...data
})
}
}
......
......@@ -6,6 +6,8 @@
"pages/tab/mine/mine",
"pages/webView/webView",
"login/index/index",
"pages/measure/measure/measure",
"pages/measure/measureResult/measureResult",
"login/accountItems/accountItems",
"packagesList/activityDetail/activityDetail",
"pages/tab/logout/logout"
......@@ -109,9 +111,16 @@
"network": "all",
"packages": [
"apply",
"packageOutput"
"packageOutput",
"outDetail"
]
}
},
"pages/tab/output/output": {
"network": "all",
"packages": [
"outDetail"
]
}
},
"usingComponents": {
"tab": "/components/Tab/Tab",
......
......@@ -59,13 +59,14 @@ const loginSuccess = () => {
targetPath
}
} = wx.$router.getPageInstance()
console.log(targetPath)
if (targetPath) {
const {
url,
obj
} = setRouteData(targetPath)
wx.$router.reLaunch(url, obj)
} else wx.$router.go('pages.index')
} else wx.reLaunch({url:"/pages/tab/output/output"})
}
const loginModal = async ({
message,
......
......@@ -66,17 +66,17 @@ const handlerMiss = (data, query, callBack) => {
if (!data) return
if (!query) return
let { pageNum, orginList, serviceType, listName } = query
data.list && data.list.forEach((val, index) => {
data.forEach((val, index) => {
val.tabType = serviceType
val.isCollapse = true
val.startTime = val.startTime.split(' ')[0]
val.endTime = val.endTime.split(' ')[0]
})
const RESULT = {
[listName]: pageNum == 1 ? data.list : [...orginList, ...data.list],
[listName]: pageNum == 1 ? data : [...orginList, ...data],
activeTrigger: false,
total: data.total,
noResult: pageNum == 1 ? (data.list.length ? false : true) : false
noResult: pageNum == 1 ? (data.length ? false : true) : false
}
callBack && callBack(RESULT)
}
......
......@@ -21,9 +21,7 @@
<view class="bar-box">
<output-bar opts="{{opts}}" id="bar" bind:selectEvent="selectBarEvent"></output-bar>
</view>
<view class="staf-box">
555
</view>
<staff sfaffList="{{sfaffList}}" tabelTh="{{tabelTh}}" downType="{{type ==2?'equity':'boutique'}}"/>
<view class="table-box">
<view class="btn-box day-btn" bindtap="jumpReport" data-time="day">查看日报表</view>
<view class="btn-box month-btn" bindtap="jumpReport" data-time="month">查看月报表</view>
......
import ActivityApi from '~/api/activityApi/index'
import { handlerMiss } from '~/packagesList/common/common'
let thisPage;
Component({
/**
* 组件的属性列表
......@@ -65,21 +66,24 @@ Component({
pageSize: 10,
noResult: false
}, () => {
thisPage = wx.$router.getPageInstance()
this.getActivity(val)
})
},
// 获取数据
getActivity(type) {
wx.showLoading()
const activityItem = this.selectComponent('.activityItem')
const {status} = activityItem.data
let { pageSize, pageNum, listData, acticityName } = this.data
let apiName = 'getActivityList', para = { pageNum, pageSize, sessionId: 'mini-ca84848c-d589-4ceb-9c34-bd323ec16e93-rop' }
ActivityApi[apiName](para).then(res => {
if (res && res.list) {
let para = { pageNum, pageSize,merchantIds: [thisPage.data.merchantId]}
ActivityApi.getActivityList(para).then(res => {
if (res) {
handlerMiss(res, { serviceType: type, pageNum, listName: 'listData', orginList: listData }, (result) => {
this.setData(result)
})
}
wx.hideLoading()
})
},
handleBlur(e) {
......
......@@ -11,16 +11,16 @@ Component({
observer(v) {
if (v) {
// 活动概览数据处理
let s = v.statics
let s = v
v.overviewData = { // 活动中
browseData: {
all: { title: '总浏览', num: s.browseCount, sort: s.browseCountRank }
all: { title: '总浏览', num: s.browseCount}
},
shareData: {
all: { title: '产值(总)/元', num: this.priceFormat(s.totalAmount || 0), sort: 0 }
all: { title: '产值(总)/元', num: this.priceFormat(s.totalAmount || 0), unit: '¥' }
},
visitorData: {
all: { title: '总访客', num: s.fansCount, sort: s.fansCountRank },
all: { title: '总访客', num: s.fansCount},
},
}
this.setData({ data: v })
......@@ -67,7 +67,7 @@ Component({
},
jumpOutput(e) {
let { item } = e.currentTarget.dataset
wx.$router.go("/packageOutput/pages/crowdDetail/crowdDetail", { ...item })
wx.$router.go("/packagesList/packageOutput/pages/crowdDetail/crowdDetail", { ...item })
},
// 价格格式化
priceFormat(num, point = 2) {
......
......@@ -29,6 +29,9 @@
color: #2D2D33;
font-size: 44rpx;
font-weight: 600;
text {
font-size: 28rpx;
}
}
.sort{
font-size: 20rpx;
......
......@@ -7,7 +7,7 @@
<view class="wrapper overview-wrapper">
<view class="overview-item-box" wx:for="{{activityOverviewList}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="all">
<view class="number">{{data.overviewData[i].all.num || 0}}</view>
<view class="number"><text>{{data.overviewData[i].all.unit}}</text>{{data.overviewData[i].all.num || 0}}</view>
<view class="title">{{data.overviewData[i].all.title}}</view>
</view>
</view>
......
......@@ -47,20 +47,17 @@ Component({
getMenuData(tabs){
let res = []
let data = [{
logo:'zc_icon',
active:'zc_icon_active',
logo:'zc-icon',
title:'售后众筹',
count:0,
serviceType:0
},{
logo:'sgjy_icon',
active:'sgjy_icon_active',
logo:'jpzs',
title:'精品升级',
count:0,
serviceType:1
},{
logo:'db_icon',
active:'db_icon_active',
logo:'hyqy-icon',
title:'会员权益/升级',
count:0,
serviceType:2
......
......@@ -9,20 +9,20 @@
.title{
height: 88rpx;
line-height: 88rpx;
padding-left: 16rpx;
padding-left: 26rpx;
font-weight: 600;
font-size: 34rpx;
color: #FFFFFF;
}
.element{
position: relative;
padding: 24rpx 0;
padding-left: 16rpx;
padding: 8rpx 0;
padding-left: 8rpx;
display: flex;
align-items: center;
.logo{
width: 64rpx;
height: 64rpx;
width: 96rpx;
height: 96rpx;
margin-right: 20rpx;
}
.label{
......
<van-popup custom-style="height: 100%;width:70%;" custom-class="popclass" bind:click-overlay="closeMenu" position="right" show="{{ show }}">
<view class="wrapper">
<view class="title">工作台</view>
<view class="title">场景切换</view>
<block wx:for="{{menus}}" wx:key="index">
<view catch:tap="selectMenu" data-index="{{item.serviceType}}" class="element {{item.serviceType==current?'active':''}}">
<glsx-image class="logo" webp src="store-assistant/menu/{{current==index?item.active:item.logo}}.png"></glsx-image>
<glsx-image class="logo" webp src="store-assistant-assemble/menu/{{item.logo}}.png"></glsx-image>
<view class="label">{{item.title}}</view>
<view wx:if="{{totals&&item.serviceType==0}}" class="num_pannel">{{totals}}</view>
</view>
......
......@@ -2,7 +2,7 @@
<view class="navigation-bar">
<navigation-bar showBack="{{true}}" navStyle="{{navStyle}}" bindnavbarReady="navbarReady" page-title="工作台">
<view class="bar-nav">
<view class="bar-text">工作台</view>
<view class="bar-text">{{merchantName}}</view>
</view>
</navigation-bar>
</view>
......
......@@ -8,7 +8,7 @@
<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">
<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>
......
......@@ -15,7 +15,7 @@ Page({
outputValue: [{
label: '今日产值/元',
name: 'avgQuotationPrice',
unit: ''
unit: '¥'
}, {
label: '今日订单/单',
name: 'avgQuotationPrice',
......@@ -27,7 +27,7 @@ Page({
}, {
label: '累计产值/元',
name: 'avgQuotationPrice',
unit: ''
unit: '¥'
}, {
label: '累计订单/单',
name: 'avgQuotationPrice',
......@@ -57,8 +57,8 @@ Page({
},
onRoute(options) {
console.log(options)
const {id} = options
this.getDetail(id)
const {activityId} = options
this.getDetail(activityId)
},
formatArr(arr, fn) {
let res = {}
......
......@@ -54,6 +54,9 @@
font-size: 44rpx;
color: #1B233D;
line-height: 64rpx;
text {
font-size: 28rpx;
}
}
.output-label {
......
......@@ -14,8 +14,8 @@
产值总览
</view>
<view class="output-value">
<view class="output-item" wx:for="{{outputValue}}" wx:key="{{index}}">
<view class="output-num">444</view>
<view class="output-item" wx:for="{{outputValue}}" wx:key="index">
<view class="output-num"><text>{{item.unit}}</text>444</view>
<view class="output-label">{{item.label}}</view>
</view>
</view>
......
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
// 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
{
"usingComponents": {},
"navigationBarTitleText": "展业测算"
}
\ No newline at end of file
/* pages/measure/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
<!--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
// 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
{
"usingComponents": {},
"navigationBarTitleText": "测算结果"
}
\ No newline at end of file
/* pages/measure/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
/* 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
const navStyle = 'background-color: transparent;'
import { IMG_URL } from '~/utils/constantData.js'
import { IMG_URL,IMG_URL_STORE } from '~/utils/constantData.js'
// import Util from '~/utils/util.js'
import { deleteSecond } from '~/utils/format'
// import { senceData } from './constant/data'
......@@ -23,6 +23,7 @@ Page({
*/
data: {
IMAGES,
IMG_URL_STORE,
navStyle,
IMG_URL,
IMG_URLLocal,
......@@ -219,7 +220,6 @@ Page({
},
// 跳转咨询页面
goConsult() {
// console.log('跳转到咨询页面')
wx.pro.openCustomerServiceChat({
extInfo: { url: 'https://work.weixin.qq.com/kfid/kfcf7b721472201345e' },
corpId: 'ww047bdc0f1e76cc13',
......
......@@ -4,7 +4,7 @@
</navigation-bar>
<view class="reclaim">
<!-- 头部 -->
<view class="header-wrap" style="height:{{headerHeight}}px; background-image: url('{{IMG_URL}}index/head.png')">
<view class="header-wrap" style="height:{{headerHeight}}px; background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/mine_center_bg.png?v=1.0.3')">
<!-- <view class="header"> -->
<!-- <view class="right" data-type="shop" bindtap="gotoApply">
......
......@@ -123,6 +123,7 @@ class Router {
url: routerMapItem.url
})
} else {
console.log(`${routerMapItem.url}${query}`)
wx.navigateTo({
url: `${routerMapItem.url}${query}`,
success: res => events && res.eventChannel.emit('getData', events)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!