Commit dc29c083 by 陈婉清

Merge branch 'saas+v4.29.0_0927' into 'develop'

Saas+v4.29.0 0927上线后,代码合并。

See merge request !43
2 parents 50c60c17 ffdf00da
...@@ -195,5 +195,42 @@ class outputApi { ...@@ -195,5 +195,42 @@ class outputApi {
analysisNotUpgradePage(data) { analysisNotUpgradePage(data) {
return api.post({ method: 'dj.api.smartcarlife.data.analysis.notUpgrade.page', ...data }, false, 'dj') return api.post({ method: 'dj.api.smartcarlife.data.analysis.notUpgrade.page', ...data }, false, 'dj')
} }
/** 经营分析 */
/** 经营分析数据概览 */
getOverview(data) {
return api.post({
method: 'scrm.api.busassistant.business.analysis.overview',
...data
})
}
/** 门店引流数据 */
getFlowRank(data) {
return api.post({
method: 'scrm.api.busassistant.business.analysis.flow.rank',
...data
})
}
/** 门店引流数据分页查询 */
getRankList(data) {
return api.post({
method: 'scrm.api.busassistant.business.analysis.flow.rank.page',
...data
})
}
/** 采购数量分页查询 */
getPurchaseList(data) {
return api.post({
method: 'scrm.api.busassistant.business.analysis.purchase.page',
...data
})
}
/** 采购金额走势 */
getPurTendency(data) {
return api.post({
method: 'scrm.api.busassistant.business.analysis.purchase.tendency',
...data
})
}
} }
export default outputApi export default outputApi
...@@ -67,7 +67,8 @@ ...@@ -67,7 +67,8 @@
"pages": [ "pages": [
"pages/openBusiness", "pages/openBusiness",
"pages/summary", "pages/summary",
"pages/newSummary/newSummary" "pages/newSummary/newSummary",
"pages/businessAnalysis/businessAnalysis"
] ]
}, },
{ {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<!-- followUpPerson --> <!-- followUpPerson -->
<view class="item"> <view class="item">
<view class="label">跟进人</view> <view class="label">跟进人</view>
<view class="name">{{item.employeeName}}|{{item.advanceUserName}}</view> <view class="name">{{item.employeeName}}{{ item.sellerName ? ('|' + item.sellerName) : ''}}</view>
</view> </view>
<!-- reasonContainer --> <!-- reasonContainer -->
<view class="item"> <view class="item">
......
// packagesList/packageOutput/pages/businessAnalysis/businessAnalysis.js
import * as echarts from '~/packagesList/packageOutput/components/ec-canvas/echarts'
import constant from './constant/constant'
import echartData from './constant/echartData'
import outputApi from '~/api/outputApi/index'
import {
IMG_URL
} from '~/utils/constantData'
Page({
/**
* 页面的初始数据
*/
data: {
ec: {
lazyLoad: true
},
IMGURL: IMG_URL,
emptyShow: false,
navStyle: 'background-color: rgba(0,0,0,0);',
navTitleStyle: "font-weight: 600; font- size: 34rpx; color: #282829;",
sceneFormList: constant.sceneFormList,
rankFormList: constant.rankFormList,
dateObj: {
today: new Date().format('yyyy-MM')
},
totalObj: {
purchaseMoney: 0,
totalMoney: 0
},
flowRankList: [],
pieChartList: [],
rankList: [],
diagramList: [],
rankTotal: '-1',
rankPageCof: {
pageNum: 1,
pageSize: 10
},
purObj: {
purchaseMoney: 0,
purchaseNum: 0
},
isShowPie: true,
purList: [],
purTotal: '-1',
purPageCof: {
pageNum: 1,
pageSize: 10
}
},
initTime() {
// 获取当前日期
const currentDate = new Date()
let today = currentDate.format('yyyy-MM-dd')
let NewYearDay = currentDate.format('yyyy')
let month = currentDate.getMonth() + 1 < 10 ? ('0' + (currentDate.getMonth() + 1)) : currentDate.getMonth() + 1
let firstDayOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).format('yyyy-MM-dd')
// console.log(NewYearDay)
this.setData({
dateObj: {
beginDateStr: firstDayOfMonth,
endDateStr: today,
today: today,
pointUnit: 2, // 1日,2月,默认日
type: 'month',
label: NewYearDay,
nowMonth: true,
timeTxt: NewYearDay + '年' + month + '月'
}
})
},
getLastDay(year, month) {
var new_year = year //取当前的年份
var new_month = month++ //取下一个月的第一天,方便计算(最后一天不固定)
if (month > 12) {
new_month -= 12 //月份减
new_year++ //年份增
}
var new_date = new Date(new_year, new_month, 1) //取当年当月中的第一天
return new Date(new_date.getTime() - 1000 * 60 * 60 * 24).getDate() //获取当月最后一天日期
},
// 获取选中天数
rangeSelect(e) {
console.log(e)
// let { date } = e.detail
let {
date
} = e.detail
let {
dateObj
} = this.data
// 按月份
dateObj = Object.assign(dateObj, date)
let [year, month] = date.end.split('-')
let day = this.getLastDay(year, month)
dateObj.beginDateStr = date.start + '-01'
dateObj.endDateStr = date.end + '-' + day
dateObj.pointUnit = 2
dateObj.type = 'month'
dateObj.nowMonth = false,
dateObj.timeTxt = year + '年' + month + '月'
this.dateObj = dateObj
this.setData({
dateObj
})
this.freshPage()
},
onInitChart(id, fnName) {
let ecComponent = this.ecComponent || this.selectComponent('#' + id)
ecComponent &&
ecComponent.init((canvas, width, height, dpr) => {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr
})
this[fnName](chart)
return chart
})
},
setPieOption(chart) {
let { pieChartList } = this.data
var option = echartData.pieOptions
option.title.text = pieChartList.reduce((a, b) => { return a + b.value }, 0) + '人/次'
option.series[0].data = pieChartList
chart.setOption(option)
},
setBarOption(chart) {
let { diagramList } = this.data
const abscissaDataList = [],
moneyTotalList = []
diagramList.forEach(element => {
abscissaDataList.push(element.abscissaData)
moneyTotalList.push(element.purchaseMoney)
})
// 使用 Math.max 方法找到数组中的最大值
const max = Math.max(...moneyTotalList)
// console.log(moneyTotalList, 'moneyTotalList')
const colors = ['#3582EE', '#FF9D0A']
var option = {
color: colors,
grid: {
left: max > 100000 ? '25%' : '15%',
right: '15%'
},
tooltip: {
trigger: 'axis',
formatter: function (params) {
var html = params[0].seriesName + ':' + params[0].value
return html
}
},
// 滚动设置
dataZoom: [
{
type: 'slider', //隐藏或显示(true)组件
show: false,
showDetail: false, //是否显示detail,即拖拽时候显示详细数值信息
startValue: 0,
endValue: 5,
start: 50,
end: 100,
zoomLoxk: true // 是否锁定选择区域(或叫做数据窗口)的大小
},
{
//没有下面这块的话,只能拖动滚动条,鼠标滚轮在区域内不能控制外部滚动条
type: 'inside',
zoomOnMouseWheel: false, //滚轮是否触发缩放
moveOnMouseMove: true, //鼠标滚轮触发滚动
moveOnMouseWheel: true
}
],
legend: {
data: ['采购价格'],
top: 'bottom'
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
data: abscissaDataList || ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
}
],
yAxis: [
{
type: 'value',
name: '元',
nameTextStyle: {
padding: [0, 28, 0, 0]
},
position: 'left',
alignTicks: true,
offset: -10,
axisLabel: {
formatter: '{value}'
}
}
],
series: [
{
name: '采购价格',
type: 'bar',
yAxisIndex: 0,
data: moneyTotalList
}
]
}
chart.setOption(option)
},
navbarReady(e) {
let { height, statusBarHeight, navigationBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight,
tabBoxStyle: `height: ${navigationBarHeight}px`,
statusBarHeight,
navigationBarHeight
})
},
getOverview() {
let { dateObj } = this.data
const params = {
startDate: dateObj.beginDateStr,
endDate: dateObj.endDateStr
}
outputApi.getOverview(params).then(res => {
console.log(res)
this.setData({
totalObj: res || { purchaseMoney: 0, totalMoney: 0 }
})
})
},
getFlowRank() {
let { dateObj } = this.data
const params = {
startDate: dateObj.beginDateStr,
endDate: dateObj.endDateStr,
}
outputApi.getFlowRank(params).then(res => {
let _flowRankList = res?.flowRankList || []
_flowRankList = _flowRankList.concat(new Array(3).fill({ flowCount: '', merchantName: '' })).slice(0, 3)
this.setData({
flowRankList: _flowRankList,
pieChartList: res?.pieChartList || [],
isShowPie: !!res?.pieChartList.length
})
if (res?.pieChartList.length) {
this.onInitChart('mychart-dom-pie', 'setPieOption')
}
})
},
getRankList() {
const { rankPageCof, rankList, dateObj } = this.data
const params = {
startDate: dateObj.beginDateStr,
endDate: dateObj.endDateStr,
...rankPageCof
}
outputApi.getRankList(params).then(res => {
console.log(res)
let _list = res.list
this.setData({
rankList: rankPageCof.pageNum == 1 ? (_list || []) : rankList.concat(_list),
rankTotal: res.total,
['rankPageCof.pageNum']: rankPageCof.pageNum + 1
})
this.getFlowRank()
})
},
getPurchaseList() {
const { purPageCof, purList } = this.data
const params = {
...purPageCof
}
outputApi.getPurchaseList(params).then(res => {
console.log(res)
let _list = res.list
this.setData({
purList: purPageCof.pageNum == 1 ? (_list || []) : purList.concat(_list),
purTotal: res.total,
['purPageCof.pageNum']: purPageCof.pageNum + 1
})
this.getPurTendency()
})
},
getPurTendency() {
outputApi.getPurTendency({}).then(res => {
console.log(res, 'getPurTendency--')
this.setData({
diagramList: res?.diagramList || [],
purObj: {
purchaseMoney: res.purchaseMoney || 0,
purchaseNum: res.purchaseNum || 0
}
})
this.onInitChart('mychart-dom-bar', 'setBarOption')
})
},
freshPage() {
this.setData({
totalObj: {
purchaseMoney: 0,
totalMoney: 0
},
flowRankList: [],
pieChartList: [],
rankList: [],
rankTotal: '-1',
rankPageCof: {
pageNum: 1,
pageSize: 10
}
})
this.getOverview()
this.getRankList()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.$api.showLoading('加载中...')
this.initTime()
this.freshPage()
this.getPurchaseList()
new setTimeout(() => {
wx.$api.hideLoading()
this.setData({
emptyShow: true
})
}, 3000)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationStyle": "custom",
"usingComponents": {
"ec-canvas": "../../components/ec-canvas/ec-canvas",
"CalendarMonth": "/components/CalendarMonth/CalendarMonth"
}
}
\ No newline at end of file \ No newline at end of file
/* packagesList/packageOutput/pages/businessAnalysis/businessAnalysis.wxss */
.bg_iamge {
width: 100%;
position: absolute;
left: 0;
top: 0;
// z-index: -1;
.image_class {
background-color: #fff;
width: 100%;
height: 224rpx;
}
}
.top-tip {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 48rpx;
line-height: 48rpx;
background: #EAEFFE;
font-size: 24rpx;
color: #3666FE;
text-align: center;
}
.business-analysis {
box-sizing: border-box;
height: calc(100vh - 122px);
background-color: #F2F3F7;
padding: 16rpx 16rpx 60rpx;
color: #333333;
.box {
background: #FFFFFF;
padding: 20rpx 24rpx 32rpx;
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
border-radius: 16rpx;
margin-bottom: 24rpx;
.title {
display: flex;
justify-content: space-between;
font-weight: 600;
font-size: 28rpx;
color: #323436;
margin-bottom: 24rpx;
.title-tips {
display: flex;
font-size: 24rpx;
color: #333333;
.icon_down {
width: 40rpx;
height: 40rpx;
}
}
.title-tips.no-bold {
font-weight: 400;
}
.txt-red {
color: #F24724;
}
.people {
font-size: 24rpx;
color: #333333;
}
}
}
.box.drainage {
padding: 20rpx 0;
.p-rl-24 {
padding: 0 24rpx;
}
}
.output {
display: flex;
align-items: center;
.cur-block {
width: 50%;
.label {
height: 40rpx;
line-height: 40rpx;
color: #8A8C90;
}
}
.money-symbol {
font-size: 28rpx;
}
.num {
font-family: "ali-bold";
font-weight: 700;
font-size: 40rpx;
color: #3666FE;
margin-top: 12rpx;
}
}
.rank {
position: relative;
.bg {
width: 672rpx;
height: 369.5rpx;
}
.rank-pos {
position: absolute;
}
.num {
font-family: "ali-bold";
font-weight: 700;
font-size: 40rpx;
}
.txt {
width: 144rpx;
font-size: 24rpx;
margin-top: 32rpx;
word-break: break-all;
font-weight: 600;
}
.rank-1 {
top: 120rpx;
left: 264rpx;
color: #C66122;
text-align: center;
.num {
font-size: 44rpx;
}
}
.rank-2 {
top: 174rpx;
left: 40rpx;
text-align: center;
color: #6B6D70;
}
.rank-3 {
top: 174rpx;
left: 488rpx;
text-align: center;
color: #C37647;
}
}
.rank-list {
margin-top: 40rpx;
.list-title {
display: flex;
align-items: center;
height: 76rpx;
line-height: 76rpx;
background-image: linear-gradient(90deg, #FAFAFA 0%, #FFFFFF 100%);
.rank-num {
width: 92rpx;
flex-shrink: 0;
.rank-icon {
width: 68rpx;
height: 68rpx;
margin-left: 8rpx;
}
.rank-txt {
width: 32rpx;
height: 32rpx;
line-height: 32rpx;
background: #B8B8B8;
border-radius: 6rpx;
font-size: 20rpx;
color: #FFFFFF;
text-align: center;
margin-left: 32rpx;
}
}
}
.list-title.list0 {
background-image: linear-gradient(90deg, #FFFDF5 0%, #FFFFFF 100%);
}
.list-title.list1 {
background-image: linear-gradient(90deg, #F7FBFF 0%, #FFFFFF 100%);
}
.list-title.list2 {
background-image: linear-gradient(90deg, #FCF8F5 0%, #FFFFFF 100%);
}
.list-content {
display: flex;
color: #323436;
padding: 8rpx 0 28rpx 92rpx;
.cur-block {
width: 25%;
}
.num {
font-family: "ali-medium";
font-size: 28rpx;
margin-top: 16rpx;
}
}
.rank-merchant {
font-weight: 600;
}
.label {
font-size: 24rpx;
}
}
.rank-list.purchase {
.rank-block {
padding: 24rpx 0;
border-bottom: 1rpx solid #E4E6EE;
;
}
.rank-block:first-child {
padding: 0 0 24rpx;
}
.list-title {
width: 100%;
background-image: none;
justify-content: space-between;
height: 40rpx;
line-height: 40rpx;
margin-bottom: 20rpx;
.left {
width: 70%;
display: flex;
align-items: center;
}
.rank-num {
width: 52rpx;
.rank-txt {
margin-left: 12rpx;
}
.rank-txt.txt0 {
color: #A86921;
background-image: linear-gradient(180deg, #FFD767 0%, #F7C33F 100%);
}
.rank-txt.txt1 {
color: #8B8585;
background-image: linear-gradient(180deg, #DFE1E5 0%, #CBCCCE 100%);
}
.rank-txt.txt2 {
color: #CF7334;
background-image: linear-gradient(180deg, #F6DAC4 0%, #F0BE98 100%);
}
}
.goods-name {
max-width: calc(100% - 60rpx);
font-weight: 600;
font-size: 28rpx;
color: #333333;
}
.purchase-num {
font-size: 24rpx;
color: #F24724;
.num {
font-family: "ali-bold";
font-weight: 600;
font-size: 36rpx;
}
}
}
.merchant-name {
margin-left: 54rpx;
font-size: 24rpx;
color: #666666;
}
}
.img-center {
width: 100%;
text-align: center;
}
.more {
width: 40rpx;
height: 40rpx;
margin-top: 19rpx;
}
.ec-canvas {
width: 675rpx;
height: 415rpx;
.no-data {
width: 100%;
text-align: center;
font-size: 24rpx;
color: #8A8C90;
.icon-empty {
width: 172rpx;
height: 172rpx;
}
}
}
.ec-canvas.bar {
width: 670rpx;
height: 538rpx;
margin-bottom: 60rpx;
}
.content-empty {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.img-empty {
width: 512rpx;
height: 512rpx;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/packageOutput/pages/businessAnalysis/businessAnalysis.wxml-->
<wxs src="/pages/tab/outputValue/index.wxs" module="filter" />
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady" showBack="{{true}}" bindnavbarReady="navbarReady" navTitleStyle="{{navTitleStyle}}">
经营分析
</navigation-bar>
<view class="bg_iamge" style="height: calc({{statusBarHeight + navigationBarHeight + 24}}px);">
<glsx-image src="{{'output/background.png'}}" class="image_class" />
<view class="top-tip">本页面仅统计太阳膜业务经营数据</view>
</view>
<scroll-view class="business-analysis" id="scroller" scroll-y enable-back-to-top refresher-enabled="{{false}}" style="margin-top:calc({{statusBarHeight + navigationBarHeight + 24}}px);">
<!-- 产值 -->
<view class="box">
<view class="title">
精品升级-太阳膜
<view class="title-tips">
<CalendarMonth allowSameDay shortcut bind:select="rangeSelect" rangeAll dateType="range" calenderColor="#3666FE" vertical minDate="2020-10-01" maxDate="{{ dateObj.today }}" isComponents isChangeType="{{ false }}" forceFullSucreen="{{ bottomLift>0?true:false }}" dayType="{{ 0 }}">
<!-- {{dateObj.timeTxt}} -->
{{filter.dateFormatSlash(dateObj.beginDateStr)}}-{{filter.dateFormatSlash(dateObj.endDateStr)}}
<glsx-image src="{{'output/drop_down.png'}}" class="icon_down" />
</CalendarMonth>
</view>
</view>
<view class="output">
<view wx:for="{{sceneFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx" class="cur-block">
<view class="label">{{subItem.label}}</view>
<view class="num"><text class="money-symbol">¥</text>{{filter.money_three_for_two_thousands(totalObj[subItem.name] || 0)}}</view>
</view>
</view>
</view>
<!-- 门店引流 -->
<view class="box drainage" wx:if="{{rankList.length}}">
<!-- 门店引流排行 -->
<view class="p-rl-24">
<view class="title"><text>门店引流排行<text class="people">(人/次)</text></text></view>
<view class="rank">
<glsx-image src="{{'output/bg-rank.png'}}" class="bg" />
<view wx:for="{{flowRankList}}" wx:key="index" class="rank-pos {{'rank-' + (index + 1)}}">
<view class="num">{{item.flowCount || '-'}}</view>
<view class="text-two-line txt">{{item.merchantName || '-'}}</view>
</view>
</view>
</view>
<view class="rank-list">
<view wx:for="{{rankList}}" wx:key="index">
<view class="list-title {{'list' + index}}">
<view class="rank-num">
<glsx-image wx:if="{{index < 3}}" src="output/icon-rank0{{index + 1}}.png" class="rank-icon" />
<view wx:else class="rank-txt">{{index + 1}}</view>
</view>
<view class="rank-merchant">{{item.merchantName}}</view>
</view>
<view class="list-content">
<view wx:for="{{rankFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx" class="cur-block">
<view class="label">{{subItem.label}}</view>
<view class="num">{{filter.money_three_for_two_thousands(item[subItem.name] || 0)}}</view>
</view>
</view>
</view>
</view>
<view class="img-center">
<glsx-image wx:if="{{rankList.length != rankTotal}}" src="{{'output/icon-more.png'}}" class="more" bindtap="getRankList" />
</view>
<!-- 引流分析 -->
<view class="p-rl-24">
<view class="title">引流分析</view>
<view class="ec-canvas">
<!-- force-use-old-canvas="true" -->
<ec-canvas wx:if="{{isShowPie}}" class="echart-box" id="mychart-dom-pie" canvas-id="mychart-pie" ec="{{ ec }}"></ec-canvas>
<view wx:else class="no-data">
<glsx-image src="{{'output/icon-empty.png'}}" class="icon-empty" />
<view>暂无数据</view>
</view>
</view>
</view>
</view>
<!-- 采购金额 -->
<view class="box" wx:if="{{purList.length}}">
<!-- 采购金额走势 -->
<view class="title">采购金额走势
<view class="title-tips no-bold">总采购价<text class="txt-red">¥{{filter.money_three_for_two_thousands(purObj.purchaseMoney || 0)}}</text></view>
</view>
<view class="ec-canvas bar">
<!-- force-use-old-canvas="true" -->
<ec-canvas class="echart-box" id="mychart-dom-bar" canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>
</view>
<!-- 采购数量 -->
<view class="title">采购数量
<view class="title-tips no-bold">总采购数量{{purObj.purchaseNum}}卷</view>
</view>
<view class="rank-list purchase">
<view wx:for="{{purList}}" wx:key="index" class="rank-block">
<view class="list-title">
<view class="left">
<view class="rank-num">
<view class="rank-txt {{'txt' + index}}">{{index + 1}}</view>
</view>
<view class="goods-name text-hide">{{item.upgradeGoodsName}}</view>
</view>
<view class="purchase-num"><text class="num">{{item.goodsNumber}}</text>卷</view>
</view>
<view class="merchant-name">{{item.merchantName}}</view>
</view>
</view>
<view class="img-center">
<glsx-image wx:if="{{purList.length != purTotal}}" src="{{'output/icon-more.png'}}" class="more" bindtap="getPurchaseList" />
</view>
</view>
<!-- 暂无数据 -->
<view wx:if="{{!rankList.length && !purList.length && emptyShow}}" class="content-empty">
<image class="img-empty" src="{{IMGURL}}output/sun-empty-transparent.png?v={{img_version }}" />
</view>
</scroll-view>
\ No newline at end of file \ No newline at end of file
const sceneFormList = [{
label: '业务产值',
name: 'totalMoney'
}, {
label: '采购支出',
name: 'purchaseMoney'
}]
const rankFormList = [{
label: '引流人数',
name: 'flowCount'
}, {
label: '无效流量',
name: 'invalidFlowCount'
}, {
label: '升级客户',
name: 'upgradeCount'
}, {
label: '待预约',
name: 'waitToInviteCount'
}]
export default {
sceneFormList,
rankFormList
}
\ No newline at end of file \ No newline at end of file
const pieOptions = {
title: {
show: true, //显示策略,默认值true,可选为:true(显示) | false(隐藏)
// text: chartData.total + '人', //主标题文本,'\n'指定换行
text: '人', //主标题文本,'\n'指定换行
x: 'center', //水平安放位置,默认为'left',可选为:'center' | 'left' | 'right' | {number}(x坐标,单位px)
y: 'center', //垂直安放位置,默认为top,可选为:'top' | 'bottom' | 'center' | {number}(y坐标,单位px)
textAlign: null, //水平对齐方式,默认根据x设置自动调整,可选为: left' | 'right' | 'center
padding: 5, //标题内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距
// itemGap: 10, //主副标题纵向间隔,单位px,默认为10
textStyle: {
//主标题文本样式{"fontSize": 18,"fontWeight": "bolder","color": "#333"}
fontFamily: 'PingFangSC-Medium, Verdana, sans...',
fontSize: 14,
fontStyle: 'normal',
color: '#333333',
fontWeight: '600'
},
zlevel: 0, //一级层叠控制。默认0,每一个不同的zlevel将产生一个独立的canvas,相同zlevel的组件或图标将在同一个canvas上渲染。zlevel越高越靠顶层,canvas对象增多会消耗更多的内存和性能,并不建议设置过多的zlevel,大部分情况可以通过二级层叠控制z实现层叠控制。
z: 6 //二级层叠控制,默认6,同一个canvas(相同zlevel)上z越高约靠顶层。
},
color: ['#35C376', '#655FED', '#F24724', '#3582EE', '#FF9D0A'],
tooltip: {
trigger: 'item',
formatter: function (params) {
let txt = params.data.name + ':' + params.data.value
let list = txt.match(new RegExp(`.{1,6}`, 'g'))
var html = list.join('\n')
return html
}
},
label: {
show: true,
formatter: '{b}\n{c}',
align: 'right',
edgeDistance: '10%' // 可以调整文字与饼图边缘的距离
},
series: [
{
type: 'pie',
radius: ['40%', '70%'],
minAngle: 10,
labelLine: {
//设置提示线的长度
normal: {
length: 10, //第一条线
length2: 15 //第二条线
}
},
emphasis: {
label: {
show: true,
fontSize: 14
}
},
data: []
}
]
}
export default {
pieOptions
}
\ No newline at end of file \ No newline at end of file
...@@ -26,7 +26,9 @@ Component({ ...@@ -26,7 +26,9 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
jump() {
wx.$router.go('packagesList.businessAnalysis')
}
} }
}) })
...@@ -31,9 +31,31 @@ ...@@ -31,9 +31,31 @@
} }
.box { .box {
position: relative;
font-size: 28rpx; font-size: 28rpx;
padding: 32rpx 24rpx; padding: 32rpx 24rpx;
.busi-btn {
position: absolute;
top: 25rpx;
right: 26rpx;
display: flex;
justify-content: center;
align-items: center;
width: 152rpx;
height: 56rpx;
line-height: 56rpx;
background: #3666FE;
border-radius: 12rpx;
font-size: 24rpx;
color: #FFFFFF;
.busi-icon {
width: 32rpx;
height: 32rpx;
}
}
.total { .total {
height: 154rpx; height: 154rpx;
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
<view class="tips">服务商</view> <view class="tips">服务商</view>
</view> </view>
<view class="box"> <view class="box">
<view class="busi-btn" bindtap="jump">
<glsx-image src="{{'output/busi-icon.png'}}" class="busi-icon" />经营分析
</view>
<view class="total"> <view class="total">
<view class="label">总产值</view> <view class="label">总产值</view>
<view class="num"><text class="money-symbol">¥</text>{{filter.money_three_for_two_thousands(totalObj.total || 0)}}</view> <view class="num"><text class="money-symbol">¥</text>{{filter.money_three_for_two_thousands(totalObj.total || 0)}}</view>
......
...@@ -53,11 +53,36 @@ var filterDate = function (n) { ...@@ -53,11 +53,36 @@ var filterDate = function (n) {
return n && year + '/' + month return n && year + '/' + month
} }
var dateFormatSlash = function (date) {
// 验证日期格式
if (!date) return;
console.log(date);
// var regex = /^\d{4}-\d{2}-\d{2}$/; 不支持正则表达式
// if (typeof date !== 'string' || !regex.test(date)) {
// console.log('Invalid date format. Expected format: "YYYY-MM-DD"');
// return
// }
// 解构赋值提取年、月和日
var parts = date.split('-');
var year = parts[0];
var month = parts[1];
var day = parts[2] || '';
// 构建日期字符串
if (day) {
return year + '/' + month + '/' + day; // 带有日的格式:YY/MM/DD
} else {
return year + '/' + month; // 只有年月的格式:YY/MM
}
}
/* /*
* 导出 * 导出
*/ */
module.exports = { module.exports = {
setPrice: setPrice, setPrice: setPrice,
money_three_for_two_thousands: threeNumForTwo.money_three_for_two_thousands, //暴露接口调用 money_three_for_two_thousands: threeNumForTwo.money_three_for_two_thousands, //暴露接口调用
filterDate: filterDate filterDate: filterDate,
dateFormatSlash: dateFormatSlash
} }
import { preReleaseAppId } from '~/config' import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease'] const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
// const mockObj = {
// test: 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=business-assistant-config&env=test',
// product: 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=business-assistant-config&env=production'
// }
const mockObj = { const mockObj = {
test: 'https://oss-config.dev.glsx.com.cn/mock/63fd6c2034c4d918e2f4df4d/config', test: 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=business-assistant-config&env=test',
product: 'https://oss-config.test.glsx.com.cn/mock/63ff0b507dc47c4edc786e82/config' product: 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=business-assistant-config&env=production'
} }
// const mockObj = {
// test: 'https://oss-config.dev.glsx.com.cn/mock/63fd6c2034c4d918e2f4df4d/config',
// product: 'https://oss-config.test.glsx.com.cn/mock/63ff0b507dc47c4edc786e82/config'
// }
const h5Obj = { const h5Obj = {
test: 'https://dj.test.glsx.com.cn/dj-car-revenue-analysis/#/', test: 'https://dj.test.glsx.com.cn/dj-car-revenue-analysis/#/',
product: 'https://dj.glsx.com.cn/dj-car-revenue-analysis/#/' product: 'https://dj.glsx.com.cn/dj-car-revenue-analysis/#/'
...@@ -29,7 +29,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -29,7 +29,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
let index = 3 let index = 2
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!