This commit is contained in:
ylj20011123 2026-01-13 13:48:40 +08:00
parent 2b45e72eb1
commit a4dbc6781c
7 changed files with 368 additions and 295 deletions

351
App.vue
View File

@ -1,185 +1,183 @@
<script>
import Vue from 'vue'
import util from '@/common/utils'
import {
mapGetters,
mapActions,
mapMutations
} from 'vuex'
export default {
computed:{
...mapGetters({'user':'getUser'})
},
methods: {
...mapActions(['memberLogin','getLoginCode']),
...mapMutations(['setVisitChannels']),
// ip
handleGetUserInfo(){
wx.request({
url: 'https://qifu-api.baidubce.com/ip/local/geo/v1/district',
success(response) {
const data = response.data;
//
let obj = {
...data.data,
ip: data.ip
}
console.log('obj',obj)
uni.setStorageSync('userInfo',obj)
},
fail(error) {
//
}
});
}
},
onLaunch: async function(options) {
uni.getSystemInfo({
success: function(e) {
// #ifndef MP
Vue.prototype.StatusBar = e.statusBarHeight;
if (e.platform == 'android') {
Vue.prototype.CustomBar = e.statusBarHeight + 50;
} else {
Vue.prototype.CustomBar = e.statusBarHeight + 45;
};
// #endif
// #ifdef MP-WEIXIN
Vue.prototype.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
Vue.prototype.pageWindowHeight = e.screenHeight-custom.bottom - custom.top + e.statusBarHeight;;
// #endif
}
})
let _this = this
console.log('app',this.user.WeChat_MiniProToken)
if (this.user.WeChat_MiniProToken) {
await this.memberLogin() //
} else {
await this.getLoginCode()
}
this.setVisitChannels(options.scene)
const updateManager = uni.getUpdateManager()
updateManager.onUpdateReady(function(res) {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
// applyUpdate
updateManager.applyUpdate();
}
import Vue from 'vue'
import util from '@/common/utils'
import {
mapGetters,
mapActions,
mapMutations
} from 'vuex'
export default {
computed: {
...mapGetters({ 'user': 'getUser' })
},
methods: {
...mapActions(['memberLogin', 'getLoginCode']),
...mapMutations(['setVisitChannels']),
// ip
handleGetUserInfo() {
wx.request({
url: 'https://qifu-api.baidubce.com/ip/local/geo/v1/district',
success(response) {
const data = response.data;
//
let obj = {
...data.data,
ip: data.ip
}
});
uni.setStorageSync('userInfo', obj)
},
fail(error) {
//
}
});
this.handleGetUserInfo()
}
},
onLaunch: async function (options) {
uni.getSystemInfo({
success: function (e) {
// #ifndef MP
Vue.prototype.StatusBar = e.statusBarHeight;
if (e.platform == 'android') {
Vue.prototype.CustomBar = e.statusBarHeight + 50;
} else {
Vue.prototype.CustomBar = e.statusBarHeight + 45;
};
// #endif
this.$util.addUserBehaviorNew( {intoRoute: '/'+options.path, outtoRoute: ''}) //
// #ifdef MP-WEIXIN
Vue.prototype.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
Vue.prototype.pageWindowHeight = e.screenHeight - custom.bottom - custom.top + e.statusBarHeight;;
// #endif
},
onShow: function() {
// var pages = getCurrentPages() //
// let len = pages.length
// if (len > 0) {
// var currentPage = pages[len - 1] //
// var nowRoute = '/' + currentPage.route // url
// this.$util.addUserBehavior({intoRoute: nowRoute, outtoRoute: ''}) //
// }
console.log('App Show')
},
onHide: function(options) {
let pages = getCurrentPages() //
let len = pages.length
if (len > 0) {
let currentPage = pages[len - 1] //
let nowRoute = '/' + currentPage.route // url
this.$util.addUserBehaviorNew( {intoRoute: '', outtoRoute:nowRoute}) //
}
console.log('App Hide')
})
let _this = this
if (this.user.WeChat_MiniProToken) {
await this.memberLogin() //
} else {
await this.getLoginCode()
}
this.setVisitChannels(options.scene)
const updateManager = uni.getUpdateManager()
updateManager.onUpdateReady(function (res) {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
// applyUpdate
updateManager.applyUpdate();
}
}
});
});
// this.handleGetUserInfo()
this.$util.addUserBehaviorNew({ intoRoute: '/' + options.path, outtoRoute: '' }) //
},
onShow: function () {
// var pages = getCurrentPages() //
// let len = pages.length
// if (len > 0) {
// var currentPage = pages[len - 1] //
// var nowRoute = '/' + currentPage.route // url
// this.$util.addUserBehavior({intoRoute: nowRoute, outtoRoute: ''}) //
// }
},
onHide: function (options) {
let pages = getCurrentPages() //
let len = pages.length
if (len > 0) {
let currentPage = pages[len - 1] //
let nowRoute = '/' + currentPage.route // url
this.$util.addUserBehaviorNew({ intoRoute: '', outtoRoute: nowRoute }) //
}
}
}
</script>
<style>
@import url("./common/uni.css");
@import url("./common/uni.css");
/*每个页面公共css */
page {
font-size: 26rpx;
color: #333;
height: 100%;
background-color: #f8f9fb;
line-height: 1.2;
/*每个页面公共css */
page {
font-size: 26rpx;
color: #333;
height: 100%;
background-color: #f8f9fb;
line-height: 1.2;
}
}
/* 加载更多 */
.load-more {
text-align: center;
width: 100%;
height: 80rpx;
color: #9999;
font-size: 24rpx;
}
/* 加载更多 */
.load-more {
text-align: center;
width: 100%;
height: 80rpx;
color: #9999;
font-size: 24rpx;
}
/* 审核环节最后一个加底部边距 */
.process-box.uni-active {
padding-bottom: 30rpx;
}
.process-box process-unit:nth-last-child(1) .prosess-unit::before{
content: '';
width: 0rpx;
}
.ico,
.ico-s {
display: block;
/* 审核环节最后一个加底部边距 */
.process-box.uni-active {
padding-bottom: 30rpx;
}
}
.process-box process-unit:nth-last-child(1) .prosess-unit::before {
content: '';
width: 0rpx;
}
.ico-s:before,
.ico:before {
content: '';
width: 36rpx;
height: 34rpx;
display: block;
.ico,
.ico-s {
display: block;
margin-right: 6rpx;
background-repeat: no-repeat;
background-size: contain;
background-position: center;
}
}
.ico-s:before {
width: 18rpx;
height: 18rpx;
}
.ico-s:before,
.ico:before {
content: '';
width: 36rpx;
height: 34rpx;
display: block;
.ico-fj:before {
background-image: url('./static/images/fjwj.png');
}
margin-right: 6rpx;
background-repeat: no-repeat;
background-size: contain;
background-position: center;
}
.ico-tp:before {
background-image: url('./static/images/fjtp.png');
}
.ico-s:before {
width: 18rpx;
height: 18rpx;
}
.ico-bz:before {
background-image: url('./static/images/tender/yj.png');
}
.ico-fj:before {
background-image: url('./static/images/fjwj.png');
}
/* #ifdef MP-WEIXIN */
/*
.ico-tp:before {
background-image: url('./static/images/fjtp.png');
}
.ico-bz:before {
background-image: url('./static/images/tender/yj.png');
}
/* #ifdef MP-WEIXIN */
/*
checkbox .wx-checkbox-input {
border-radius: 20%;
border: 1rpx solid #91A6D7;
@ -197,25 +195,26 @@
font-size: 30rpx;
} */
checkbox .wx-checkbox-input {
border-radius: 50% ;
background-color: #D8DFEE ;
width: 38rpx ;
height: 38rpx ;
color: #fff;
}
checkbox .wx-checkbox-input {
border-radius: 50%;
background-color: #D8DFEE;
width: 38rpx;
height: 38rpx;
color: #fff;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked {
background-color: #2E6CF6;
border-color: #2E6CF6 ;
color: #fff !important;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked {
background-color: #2E6CF6;
border-color: #2E6CF6;
color: #fff !important;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
font-size: 30rpx;
}
/* #endif */
button::after{
border: none;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
font-size: 30rpx;
}
/* #endif */
button::after {
border: none;
}
</style>

View File

@ -42,7 +42,8 @@
<view class="tab-label">经营业态</view>
</view>
<view class="tab-item" @click="selectTab('nowTab', 3)"
v-if="areaProgress.length && areaProgress.length > 1" :class="{ 'active': nowTab == 3 }">
v-if="areaProgress && areaProgress.length && areaProgress.length > 1"
:class="{ 'active': nowTab == 3 }">
<view class="tab-icon">🗺</view>
<view class="tab-label">区域营收</view>
</view>
@ -55,7 +56,7 @@
</view>
<view class="content-wrapper">
<view class="chart-section" v-show="nowTab == 1"
v-if="modelProgress.length > 0 && theRequest.ProvinceCode == 340000">
v-if="modelProgress && modelProgress.length > 0 && theRequest.ProvinceCode == 340000">
<view class="chart-container chart-optimized">
<canvas canvas-id="modelCont" id="modelCont" class="modern-chart performance-chart"
@touchstart="touchPie($event, 'modelCont')"></canvas>
@ -74,7 +75,7 @@
</view>
</view>
</view>
<view class="chart-section" v-show="nowTab == 2" v-if="regionProgress.length > 0">
<view class="chart-section" v-show="nowTab == 2" v-if="regionProgress && regionProgress.length > 0">
<view class="chart-container chart-optimized">
<canvas canvas-id="businessCont" id="businessCont" class="modern-chart performance-chart"
@touchstart="touchPie($event, 'businessCont')"></canvas>
@ -93,7 +94,7 @@
</view>
</view>
</view>
<view class="chart-section" v-show="nowTab == 3" v-if="areaProgress.length > 0">
<view class="chart-section" v-show="nowTab == 3" v-if="areaProgress && areaProgress.length > 0">
<view class="chart-container chart-optimized">
<canvas canvas-id="areaCont" id="areaCont" class="modern-chart performance-chart"
@touchstart="touchPie($event, 'areaCont')"></canvas>
@ -121,7 +122,7 @@
<text>车流分析概览</text>
</view>
<view class="traffic-summary">
{{ bayonetProgress.length }}个区域
{{ bayonetProgress && bayonetProgress.length > 0 ? bayonetProgress.length : 0 }}个区域
</view>
</view>
@ -134,7 +135,8 @@
<view class="region-title">{{ item.name }}</view>
</view>
<view class="region-actions">
<view class="region-count">{{ item.list.length }}个服务区</view>
<view class="region-count">{{ item.list && item.list.length > 0 ? item.list.length : 0
}}个服务区</view>
<view class="region-arrow" :class="{ 'collapsed': item.collapsed }"></view>
</view>
</view>
@ -154,13 +156,13 @@
<view class="flow-item flow-item-counter">
<text class="flow-label">入区</text>
<text class="flow-value" :class="'counter-animate-' + o + '-' + idx">{{ child.data
}}</text>
}}</text>
</view>
<view class="flow-divider">|</view>
<view class="flow-item flow-item-counter">
<text class="flow-label">断面</text>
<text class="flow-value" :class="'counter-animate-' + o + '-' + idx">{{ child.flow
}}</text>
}}</text>
</view>
</view>
<view class="expand-arrow" :class="{ 'expanded': child.expanded }"></view>
@ -176,7 +178,7 @@
<view class="direction-info">
<text class="direction-name">{{ direction.name }}</text>
<text class="direction-percent direction-percent-highlight">{{ direction.bili
}}%</text>
}}%</text>
</view>
<view class="vehicle-stats">
<view class="vehicle-type-group">
@ -232,7 +234,7 @@
</view>
</view>
</view>
<template v-if="theRequest && theRequest.GroupType == 1020 && regionList.length">
<template v-if="theRequest && theRequest.GroupType == 1020 && regionList && regionList.length">
<view class="service-list">
<view v-for="(item, i) in regionList[0].child" :key="i" class="service-card" @click="toDetail(item)">
<view class="service-header">
@ -456,7 +458,7 @@ export default {
//
var urlParts = decodedUrl.split('?')
if (urlParts.length < 2) {
if (urlParts && urlParts.length < 2) {
console.log('二维码URL没有参数使用默认值')
return this.getDefaultParams()
}
@ -1168,6 +1170,9 @@ export default {
if (option.time.indexOf(' ') > -1) {
dateForApi = option.time.split(' ')[0]
}
console.log('dateForApi', dateForApi)
console.log('option.time', option.time)
// API YYYY-MM-DD
option.time = this.$util.cutDate(dateForApi, 'YYYY-MM-DD')
option.month = this.$util.cutDate(option.time, 'YYYYMM')

View File

@ -25,7 +25,7 @@
</div>
<div class="uni-flex ai-base jc-between">
<span class="center-num">{{ sMsg.totalMoneyShow }}</span>
<span class="budgetamount">
<span class="budgetamount" v-if="currentProvinceCode !== '530000'">
<text class="budget-title">计划营收():</text>
<text :class="sMsg.budgetAmount < sMsg.cashPay ? 'up-text-title' : 'down-text-title'">
{{ sMsg.budgetamoutShow }}
@ -104,7 +104,7 @@
<div class="pie-content">
<div class="model-busniess">经营业态占比</div>
<ServiceRevenuePie ref="serviceRevenuePie" v-show="ServiceRevenueData && ServiceRevenueData.length >= 2"
:data="ServiceRevenueData" @selectCate="selectCate" />
:data="ServiceRevenueData" @selectCate="selectCate" :currentProvinceCode="currentProvinceCode" />
<!-- 其余省份 -->
<!-- <canvas v-else-if="sellData.length>0" canvas-id="sellCate" id="sellCate" class="operation-cate-content" @click="touchPie($event,'sellCate')"></canvas> -->
<div class="model-busniess progress-section-enter">
@ -1059,7 +1059,8 @@ cover-view.page-title {
/* 门店卡片 */
.shop-card {
width: 192rpx;
// width: 192rpx;
width: calc((100% - 40rpx) / 3);
height: 240rpx;
border-radius: 16rpx;
color: #fff;

View File

@ -1,115 +1,140 @@
<template>
<uni-ec-canvas
class="uni-ec-canvas"
id="revenuecharts"
ref="revenuecharts"
canvas-id="revenuecharts"
:ec="ec"
@inited="inited"
></uni-ec-canvas>
<uni-ec-canvas class="uni-ec-canvas" id="revenuecharts" ref="revenuecharts" canvas-id="revenuecharts" :ec="ec"
@inited="inited"></uni-ec-canvas>
</template>
<script>
import uniEcCanvas from './uni-ec-canvas/uni-ec-canvas.vue';
export default {
props:['data'],
components:{
uniEcCanvas
},
computed:{
ec(){
if(this.data){
return {
option:{
tooltip: {
trigger: 'item',
formatter: '{b}: {c} ({d}%)'
},
series: [
{
name: '业态',
type: 'pie',
selectedMode: 'single',
radius: [0, '32%'],
center: ['50%','50%'],
startAngle: 40,
label: {
// position: 'inner',
formatter: '{b} \n {d}% ',
fontSize: 13,
color: '#D1D1D1',
// show: false,
},
startAngle: 115,
labelLine: {
// show: false,
length: 62,
length2: 12,
smooth: true,
lineStyle:{
color: '#D1D1D1'
},
},
data: [
...this.data[0]
],
color:['#FEA427','#7786E3','#75B7AD','#9BC9F8','#FFAC37',]
import uniEcCanvas from './uni-ec-canvas/uni-ec-canvas.vue';
export default {
props: ['data', 'currentProvinceCode'],
components: {
uniEcCanvas
},
computed: {
ec() {
if (this.data) {
return {
option: {
tooltip: {
trigger: 'item',
formatter: '{b}: {c} ({d}%)'
},
series: [
{
name: '业态',
type: 'pie',
selectedMode: 'single',
radius: [0, '32%'],
center: ['40%', '50%'],
startAngle: 40,
label: {
// position: 'inner',
// formatter: '{b} \n {d}% ',
// fontSize: 13,
// color: '#D1D1D1',
show: false,
},
{
name: '业态',
type: 'pie',
radius: ['48%', '72%'],
center: ['50%','50%'],
labelLine: {
length: 30,
},
label: {
show:false,
startAngle: 115,
labelLine: {
// show: false,
length: 62,
length2: 12,
smooth: true,
lineStyle: {
color: '#D1D1D1'
},
color: this.data[1].length> 7 ? ['#FFC3CD','#F4A4B2','#FE6582','#FFE7C0','#FEDA9D','#FEC057','#F9C8A0','#FAB176','#ffa25b','#E1C9F7','#CDA6F1',
'#E0E2F6','#C5CDF9','#9AA6EF','#D8ECEA','#8FE5B2','#70D599','#ADE5EE'] :
['#70D599', '#FFE7C0', '#ADE5EE','#C5CDF9','#e0e3f7', '#AFB7E6', '#F3B1C9' ],
},
data: [
...this.data[0]
],
color: ['#FEA427', '#7786E3', '#75B7AD', '#9BC9F8', '#FFAC37',]
},
{
name: '业态',
type: 'pie',
radius: ['48%', '72%'],
center: ['40%', '50%'],
labelLine: {
length: 30,
},
label: {
show: false,
},
data: [
...this.data[1]
]
}
]
color: this.data[1].length > 7 ? ['#FFC3CD', '#F4A4B2', '#FE6582', '#FFE7C0', '#FEDA9D', '#FEC057', '#F9C8A0', '#FAB176', '#ffa25b', '#E1C9F7', '#CDA6F1',
'#E0E2F6', '#C5CDF9', '#9AA6EF', '#D8ECEA', '#8FE5B2', '#70D599', '#ADE5EE'] :
['#70D599', '#FFE7C0', '#ADE5EE', '#C5CDF9', '#e0e3f7', '#AFB7E6', '#F3B1C9'],
data: [
...this.data[1]
]
}
],
grid: {
left: '5%',
right: '25%', //
top: '10%',
bottom: '10%',
containLabel: false
},
legend: this.currentProvinceCode === '530000' ? {
show: true,
orient: 'vertical',
top: 'center',
right: 10,
} : {
show: true,
orient: 'vertical',
top: 20,
right: 10,
width: 100, //
height: 200, // canvas263px
type: 'scroll', //
pageButtonPosition: 'end', //
pageIconSize: 10, //
pageIconColor: '#666', //
pageIconInactiveColor: '#ccc', //
itemGap: 6, //
itemWidth: 18, //
itemHeight: 10, //
textStyle: {
fontSize: 10, //
lineHeight: 14 //
}
}
}
}
}
},
methods:{
inited(chart){
let _this =this
// console.log('')
// console.log('chart', this.ec)
chart.on('click',function(params){
if(params.componentIndex==0){
_this.$emit('selectCate',params.dataIndex+1)
}
// console.log(params)
})
},
}
},
methods: {
inited(chart) {
let _this = this
// console.log('')
// console.log('chart', this.ec)
chart.on('click', function (params) {
if (params.componentIndex == 0) {
_this.$emit('selectCate', params.dataIndex + 1)
}
// console.log(params)
})
},
}
},
}
</script>
<style scoped>
/* page {
/* page {
background-color: #fff;
} */
.uni-ec-canvas{
width: 690rpx;
height: 526rpx;
margin-top: 40rpx;
display:block;
}
.uni-ec-canvas {
width: 690rpx;
height: 526rpx;
margin-top: 40rpx;
display: block;
}
</style>

View File

@ -15,6 +15,7 @@ const methods = {
*/
// let regionList = [] // 营收上传列表 reginListModel[]
this.groupType = obj.GroupType
this.provinceCode = obj.ProvinceCode
const requestParamas = {
Statistics_Date: obj.time,
Statistics_Month: obj.month,
@ -71,6 +72,15 @@ const methods = {
}, [], [], [], []]
}
// 云南全部自营 就接触注释 下面传入也变成newDataList
// let newDataList = []
// if (obj.ProvinceCode === '530000') {
// newDataList = data.Result_Data.List.filter(m => m.Business_TypeName === '自营')
// } else {
// newDataList = data.Result_Data.List
// }
if (isServerPartDetail) { // 是服务区营收推送页面
return _this.getSeverpartReginList(data.Result_Data.List, busniessCounts.Result_Data.List,
tradeData.Result_Data.List, budgetAmount.Result_Data.List)
@ -112,8 +122,17 @@ const methods = {
oldData.totalOffAmount += newData.TotalOffAmount
oldData.mobilePayment += newData.MobilePayment
oldData.cashPay += newData.CashPay
oldData.diffLessPrice += newData.Different_Price_Less
oldData.diffMorePrice += newData.Different_Price_More
// oldData.diffLessPrice += newData.Different_Price_Less
// oldData.diffMorePrice += newData.Different_Price_More
if (this.provinceCode === '530000') {
if (newData.Business_TypeName === '自营') {
oldData.diffLessPrice += newData.Different_Price_Less || 0
oldData.diffMorePrice += newData.Different_Price_More || 0
}
} else {
oldData.diffLessPrice += newData.Different_Price_Less || 0
oldData.diffMorePrice += newData.Different_Price_More || 0
}
if (newData.BusinessType == 1000) { // 商超
oldData.scCount = oldData.scCount ? oldData.scCount + 1 : 1
@ -129,8 +148,20 @@ const methods = {
oldData.totalOffAmount = newData.TotalOffAmount
oldData.mobilePayment = newData.MobilePayment
oldData.cashPay = newData.CashPay
oldData.diffLessPrice = newData.Different_Price_Less
oldData.diffMorePrice = newData.Different_Price_More
// oldData.diffLessPrice = newData.Different_Price_Less
// oldData.diffMorePrice = newData.Different_Price_More
if (this.provinceCode === '530000') {
if (newData.Business_TypeName === '自营') {
oldData.diffLessPrice = newData.Different_Price_Less || 0
oldData.diffMorePrice = newData.Different_Price_More || 0
} else {
oldData.diffLessPrice = 0
oldData.diffMorePrice = 0
}
} else {
oldData.diffLessPrice = newData.Different_Price_Less || 0
oldData.diffMorePrice = newData.Different_Price_More || 0
}
if (newData.BusinessType == 1000) { // 商超

View File

@ -1360,11 +1360,24 @@ export default {
if (option.ProvinceCode) {
// -
if (toSnhuiPageProvinceCode.indexOf(parseInt(option.ProvinceCode)) > -1) {
// 怀
let date = new Date(option.time)
let y = date.getFullYear()
let m = date.getMonth() + 1
let d = date.getDate()
if (m < 10) {
m = '0' + m
}
if (d < 10) {
d = '0' + d
}
// loading
const url = "/pages/everdayRenven/AnhuiIndex?ProvinceCode=" +
option.ProvinceCode +
"&time=" +
option.time +
`${y}-${m}-${d}` +
// option.time +
"&GroupType=" +
option.GroupType +
"&ServerpartIds=" +

View File

@ -27,7 +27,6 @@
<image :src="menus[item.id]==1?item.imagePath:item.noImagePath" mode="aspectFill"></image>
<text class="ico-t-count" v-if="toDoMsg[item.id]>0">{{toDoMsg[item.id]> 99 ? '99+' : toDoMsg[item.id]}}</text>
<text class="menu-text" :class="{'noFn': !menus[item.id] || menus[item.id]==0}">{{item.name}}</text>
</view>