This commit is contained in:
ylj20011123 2025-09-04 14:32:29 +08:00
parent 431d95645b
commit 42f254afb9
5 changed files with 1367 additions and 859 deletions

View File

@ -1,5 +1,16 @@
<template>
<view :class="'province-theme-' + currentProvinceCode">
<!-- 加载骨架屏 -->
<view class="loading-skeleton" v-if="isLoading">
<view class="skeleton-header"></view>
<view class="skeleton-cards">
<view class="skeleton-card" v-for="i in 3" :key="i"></view>
</view>
<view class="skeleton-list">
<view class="skeleton-item" v-for="i in 5" :key="i"></view>
</view>
</view>
<view class="page-body" v-if="showPage">
<AnhHead :today="today" :headMsg="headMsg" :lastDay="lastDay" :groupType="theRequest && theRequest.GroupType"
:provinceCode="theRequest && theRequest.ProvinceCode" @bindDateChange="bindDateChange" :isup="isup"
@ -277,8 +288,7 @@
<shopCell v-for="(item, i) in regionList" :key="i" :item='item' @toggleShow="toggleShow" :i='i' />
</template>
</view>
<template
v-if="theRequest && theRequest.ProvinceCode == '620000' || theRequest.ProvinceCode == '530000' || theRequest.ProvinceCode == '734100'">
<template v-if="theRequest && theRequest.ProvinceCode == '620000' || theRequest.ProvinceCode == '530000'">
<view class="uni-inline-item modle-title">
<image src="/static/images/revenue/product-ranking.png" mode="aspectFit"></image>
<text class="strong-text">商品销售排行</text>
@ -410,6 +420,133 @@ export default {
RankContent
},
methods: {
// - uniapp
parseQRCodeParams: function (qParam) {
try {
// URL
var decodedUrl = decodeURIComponent(qParam)
console.log('解码后的URL:', decodedUrl)
//
var urlParts = decodedUrl.split('?')
if (urlParts.length < 2) {
console.log('二维码URL没有参数使用默认值')
return this.getDefaultParams()
}
var queryString = urlParts[1]
var params = {}
//
var pairs = queryString.split('&')
for (var i = 0; i < pairs.length; i++) {
var pair = pairs[i]
var equalIndex = pair.indexOf('=')
if (equalIndex > -1) {
var key = pair.substring(0, equalIndex)
var value = pair.substring(equalIndex + 1)
if (key && value !== '') {
try {
params[decodeURIComponent(key)] = decodeURIComponent(value)
} catch (e) {
// 使
params[key] = value
}
}
}
}
console.log('解析的参数对象:', params)
//
var finalParams = {
ProvinceCode: params.ProvinceCode || '530000', //
GroupType: params.GroupType || '1000',
time: params.time || this.lastDay,
ServerpartIds: params.ServerpartIds || ''
}
//
if (finalParams.time) {
var timeStr = finalParams.time
console.log('原始时间字符串:', timeStr)
// URL++
timeStr = timeStr.replace(/\+/g, ' ')
console.log('处理+号后:', timeStr)
//
var datePart = ''
var timePart = ''
if (timeStr.indexOf(' ') > -1) {
var parts = timeStr.split(' ')
datePart = parts[0]
timePart = parts[1] || ''
} else {
datePart = timeStr
}
// 2025/9/1 -> 2025/09/01
if (datePart.indexOf('/') > -1) {
var dateSegments = datePart.split('/')
if (dateSegments.length === 3) {
var year = dateSegments[0]
var month = dateSegments[1].length === 1 ? '0' + dateSegments[1] : dateSegments[1]
var day = dateSegments[2].length === 1 ? '0' + dateSegments[2] : dateSegments[2]
datePart = year + '/' + month + '/' + day
}
}
//
if (timePart && timePart.indexOf(':') > -1) {
var timeSegments = timePart.split(':')
if (timeSegments.length >= 2) {
var hour = timeSegments[0].length === 1 ? '0' + timeSegments[0] : timeSegments[0]
var minute = timeSegments[1].length === 1 ? '0' + timeSegments[1] : timeSegments[1]
var second = '00'
if (timeSegments[2]) {
second = timeSegments[2].length === 1 ? '0' + timeSegments[2] : timeSegments[2]
}
timePart = hour + ':' + minute + ':' + second
}
}
//
if (timePart) {
finalParams.time = datePart + ' ' + timePart
} else {
finalParams.time = datePart
}
console.log('最终时间格式:', finalParams.time)
//
if (finalParams.time.length < 8) {
console.log('时间格式不正确,使用默认时间')
finalParams.time = this.lastDay
}
}
console.log('最终参数:', finalParams)
return finalParams
} catch (error) {
console.log('解析二维码参数失败:', error)
return this.getDefaultParams()
}
},
// - uniapp
getDefaultParams: function () {
return {
ProvinceCode: '530000', //
GroupType: '1000',
time: this.lastDay,
ServerpartIds: ''
}
},
//
initProvinceCode() {
let provinceCode = ''
@ -436,7 +573,7 @@ export default {
},
toggleCard(isup) {
this.isup = !isup
this.$forceUpdate()
// $forceUpdateVue
},
bindDateChange(e) { //
// let nowDate = this.theRequest.time
@ -448,12 +585,17 @@ export default {
this.$util.cutDate(selectT, 'MM.DD', -7)]
uni.showLoading({
title: '正在加载...',
mask: true
mask: false //
})
this.initData()
// this.getTender()
//
Promise.all([
this.initData(),
this.todayAmount()
this.$forceUpdate()
]).catch(err => {
console.error('数据刷新失败:', err)
uni.hideLoading()
})
// $forceUpdate
}
},
@ -472,15 +614,15 @@ export default {
})
this.$util.toNextRoute('navigateTo', severpartIndexPath)
item.visited = true
this.$forceUpdate()
// 使Vue.set
this.$set(item, 'visited', true)
},
selectTab(name, index) {
this[name] = index
},
toggleRegion(item) {
item.show = !item.show ? true : false
this.$forceUpdate()
// 使Vue.set
this.$set(item, 'show', !item.show)
},
// /
toggleRegionCollapse(item) {
@ -515,7 +657,7 @@ export default {
totalTicketCount: res.Data.TOTALTICKET,
avrticketCount: this.$util.fmoney(avrticket, 2),
}
_this.$forceUpdate()
// $forceUpdate
})
},
@ -616,8 +758,8 @@ export default {
},
toggleShow(i) {
let item = this.regionList[i]
item.show = !item.show
this.$forceUpdate()
// 使Vue.set
this.$set(item, 'show', !item.show)
},
defaultMsg() {
let option = null
@ -634,10 +776,32 @@ export default {
async initData() { //
let _this = this
console.log('this.theRequest1', this.theRequest)
// theRequest使
if (!this.theRequest) {
console.error('theRequest未初始化')
this.isLoading = false
this.showPage = false
uni.hideLoading()
return
}
this.theRequest.GroupType = 1000
this.theRequest.ServerpartIds = ''
const [reginList, totalData, busniessTypePie, busniessTradePie, busniessAreaPie, bayonetPie] =
await anhuiYestodayRevenueData.getData(this.theRequest) //
try {
//
const result = await anhuiYestodayRevenueData.getData(this.theRequest)
if (!result) {
console.error('数据获取失败')
this.isLoading = false
this.showPage = false
uni.hideLoading()
return
}
const [reginList, totalData, busniessTypePie, busniessTradePie, busniessAreaPie, bayonetPie] = result
if (this.theRequest.GroupType !== 1010) {
console.log('reginList', reginList)
@ -668,38 +832,48 @@ export default {
//
const [progressList, pieList] = this.getProgressData(busniessTypePie, totalData.cashPay)
this.modelProgress = progressList
//
this.$nextTick(() => {
setTimeout(() => {
//
var colors1 = ['#FFAC37', '#6B75B8'];
// console.log(pieList)
if (pieList.length > 0) {
this.showPie({
id: 'modelCont',
data: pieList,
colors: colors1,
});
//
}
//
const [tprogressList, tpieList] = this.getProgressData(busniessTradePie, totalData.cashPay)
this.regionProgress = tprogressList
//
var colors2 = ['#5E67B4', '#4E5699', '#75B7AD', '#AFB7E6'];
if (tpieList.length > 0) {
this.showPie({
id: 'businessCont',
data: tpieList,
colors: colors2,
});
}
//
const [aprogressList, apieList] = this.getProgressData(busniessAreaPie, totalData.cashPay)
this.areaProgress = aprogressList
//
var colors3 = ['#FFAC37', '#d8ece9', '#f7f5f6', '#b2b7e3', '#F4B27A', '#F3B1C9', '#e0e3f7', '#FFE886', '#f7f5f6'];
if (apieList.length > 0) {
this.showPie({
id: 'areaCont',
data: apieList,
colors: colors3,
});
}
}, 100);
});
//
if (this.theRequest.GroupType == 1000 && this.theRequest.ProvinceCode == 340000) {
@ -708,11 +882,21 @@ export default {
this.bayonetProgress = bayonetList
}
if (reginList.length) {
// loading
// 使
this.showPage = true
}
this.isLoading = false
uni.hideLoading()
} catch (error) {
console.error('initData执行错误:', error)
this.isLoading = false
this.showPage = false
uni.hideLoading()
uni.showToast({
title: '数据加载失败',
icon: 'none'
})
}
},
getProgressData(data, total) {
var _data1 = [];
@ -820,7 +1004,7 @@ export default {
} else {
this.wechatPushSalesList = {}
}
this.$forceUpdate()
// $forceUpdate
},
//
handleRealRevenue() {
@ -855,19 +1039,59 @@ export default {
this.opacity = (options.scrollTop - 30) / 68
},
onLoad(option) {
console.log('AnhuiIndex onLoad 接收参数:', option)
//
if (option.q) {
console.log('扫码进入,解析二维码参数')
option = this.parseQRCodeParams(option.q)
console.log('解析后的参数:', option)
}
//
uni.showLoading({
title: '正在加载...'
title: '正在加载...',
mask: false //
})
if (option.ProvinceCode) { //
if (option.ProvinceCode) { //
console.log('进入页面,参数:', JSON.stringify(option))
this.theRequest = option
option.time = this.$util.cutDate(option.time, 'YYYY-MM-DD')
//
if (option.time) {
console.log('处理前的时间:', option.time)
// API
var dateForApi = option.time
if (option.time.indexOf(' ') > -1) {
dateForApi = option.time.split(' ')[0]
}
// API YYYY-MM-DD
option.time = this.$util.cutDate(dateForApi, 'YYYY-MM-DD')
option.month = this.$util.cutDate(option.time, 'YYYYMM')
console.log('API用时间格式:', option.time, '月份:', option.month)
} else {
option.time = this.lastDay
option.month = this.$util.cutDate(this.lastDay, 'YYYYMM')
}
console.log('处理后的theRequest:', JSON.stringify(this.theRequest))
//
this.initProvinceCode()
this.initData()
//
Promise.all([
this.initData(),
this.handleRealRevenue()
]).catch(err => {
console.error('数据加载失败:', err)
this.isLoading = false
this.showPage = false
uni.hideLoading()
uni.showToast({
title: '加载失败,请重试',
icon: 'none'
})
})
} else { //
if (this.PushAuthority.length > 0) {
@ -884,8 +1108,20 @@ export default {
//
this.initProvinceCode()
this.initData()
//
Promise.all([
this.initData(),
this.handleRealRevenue()
]).catch(err => {
console.error('数据加载失败:', err)
this.isLoading = false
this.showPage = false
uni.hideLoading()
uni.showToast({
title: '加载失败,请重试',
icon: 'none'
})
})
} else {
uni.hideLoading()
this.theRequest = null
@ -902,7 +1138,7 @@ export default {
this.getDetail(this.theRequest)
}
//
if (this.theRequest && (this.theRequest.ProvinceCode == "620000" || this.theRequest.ProvinceCode == "530000" || this.theRequest.ProvinceCode == '734100')) {
if (this.theRequest && (this.theRequest.ProvinceCode == "620000" || this.theRequest.ProvinceCode == "530000")) {
this.getRankContent()
}
},
@ -1233,7 +1469,7 @@ text.fs12 {
}
.top-revenue-card .upLoad-text {
font-size: 28rpx;
font-size: 32rpx;
}
.check-unit {
@ -1257,7 +1493,7 @@ text.fs12 {
/* end */
.modle-title {
padding: 0 32rpx 0 32rpx;
padding: 0 32rpx 24rpx 32rpx;
font-size: 32rpx;
font-weight: 600;
color: #333;
@ -1933,7 +2169,7 @@ canvas.operation-content {
}
.ranking-content .ranking-list-unit {
font-size: 24rpx;
font-size: 28rpx;
flex: 1;
}
@ -2051,7 +2287,7 @@ canvas.operation-content {
}
.tab-label {
font-size: 24rpx;
font-size: 26rpx;
font-weight: 500;
line-height: 1.2;
}
@ -2133,7 +2369,7 @@ canvas.operation-content {
}
.amount {
font-size: 24rpx;
font-size: 32rpx;
font-weight: 700;
color: #27B25F;
font-family: 'DIN Alternate', 'Bahnschrift', monospace;
@ -2479,7 +2715,7 @@ canvas.operation-content {
}
.upload-text {
font-size: 28rpx;
font-size: 32rpx;
font-weight: 600;
color: #2c3e50;
}
@ -2496,7 +2732,7 @@ canvas.operation-content {
}
.summary-value {
font-size: 24rpx;
font-size: 28rpx;
font-weight: 600;
color: #27B25F;
font-family: 'DIN Alternate', 'Bahnschrift', monospace;
@ -2656,13 +2892,13 @@ canvas.operation-content {
}
.region-name {
font-size: 24rpx;
font-size: 30rpx;
font-weight: 600;
color: #2c3e50;
}
.region-revenue {
font-size: 28rpx;
font-size: 32rpx;
font-weight: 700;
color: #27B25F;
font-family: 'DIN Alternate', 'Bahnschrift', monospace;
@ -2685,7 +2921,7 @@ canvas.operation-content {
}
.metric-value {
font-size: 24rpx;
font-size: 26rpx;
font-weight: 600;
font-family: 'DIN Alternate', 'Bahnschrift', monospace;
}
@ -2774,4 +3010,59 @@ canvas.operation-content {
/* 微信小程序兼容性修正 - 移除不支持的特性 */
/* 移除 @media 查询,改用 flex 替代 grid */
/* 加载骨架屏样式 */
.loading-skeleton {
padding: 20rpx;
background-color: #f8f9fa;
min-height: 100vh;
}
.skeleton-header {
height: 300rpx;
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: loading 1.5s infinite;
border-radius: 16rpx;
margin-bottom: 24rpx;
}
.skeleton-cards {
display: flex;
gap: 16rpx;
margin-bottom: 24rpx;
}
.skeleton-card {
flex: 1;
height: 120rpx;
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: loading 1.5s infinite;
border-radius: 12rpx;
}
.skeleton-list {
display: flex;
flex-direction: column;
gap: 12rpx;
}
.skeleton-item {
height: 100rpx;
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: loading 1.5s infinite;
border-radius: 12rpx;
}
@keyframes loading {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}
</style>

View File

@ -32,33 +32,44 @@ const methods = {
Serverpart_ID: obj.ServerpartIds ? obj.ServerpartIds : ''
}
this.provinceCode = obj.ProvinceCode
// 营收数据
const data = await request.$webGet('CommercialApi/Revenue/GetRevenuePushList', requestParamas)
if (data.Result_Code != 100) return
// 在营门店数量统计
const busniessCounts = await request.$webGet('CommercialApi/BaseInfo/GetShopCountList', requestParamas)
if (busniessCounts.Result_Code != 100) return
try {
// 并行请求优化同时发起所有API请求减少加载时间
const [data, busniessCounts, tradeData, budgetAmount, mobileShare, mallDeliver, bayonetCount] = await Promise.all([
request.$webGet('CommercialApi/Revenue/GetRevenuePushList', requestParamas),
request.$webGet('CommercialApi/BaseInfo/GetShopCountList', requestParamas),
request.$webGet('CommercialApi/BaseInfo/GetBusinessTradeList', requestParamas),
request.$webGet('CommercialApi/Revenue/GetBudgetExpenseList', requestParamasBudget),
request.$webGet('CommercialApi/Revenue/GetMobileShare', requestParamas),
request.$webGet('CommercialApi/Revenue/GetMallDeliver', requestParamas),
request.$webGet('CommercialApi/Revenue/GetSPBayonetList', requestParamas)
])
// 业态关系
const tradeData = await request.$webGet('CommercialApi/BaseInfo/GetBusinessTradeList', requestParamas)
if (tradeData.Result_Code != 100) return
// 计划营收金额
const budgetAmount = await request.$webGet('CommercialApi/Revenue/GetBudgetExpenseList', requestParamasBudget)
if (budgetAmount.Result_Code != 100) return
// 移动支付分账数据
const mobileShare = await request.$webGet('CommercialApi/Revenue/GetMobileShare', requestParamas)
if (mobileShare.Result_Code != 100) return
// 万佳商城配送数据
const mallDeliver = await request.$webGet('CommercialApi/Revenue/GetMallDeliver', requestParamas)
if (mallDeliver.Result_Code != 100) return
// 片区车流量
const bayonetCount = await request.$webGet('CommercialApi/Revenue/GetSPBayonetList', requestParamas)
if (bayonetCount.Result_Code != 100) return
// 检查数据有效性
if (data.Result_Code != 100 ||
busniessCounts.Result_Code != 100 ||
tradeData.Result_Code != 100 ||
budgetAmount.Result_Code != 100 ||
mobileShare.Result_Code != 100 ||
mallDeliver.Result_Code != 100 ||
bayonetCount.Result_Code != 100) {
console.error('部分API请求失败', {
data: data.Result_Code,
busniessCounts: busniessCounts.Result_Code,
tradeData: tradeData.Result_Code,
budgetAmount: budgetAmount.Result_Code,
mobileShare: mobileShare.Result_Code,
mallDeliver: mallDeliver.Result_Code,
bayonetCount: bayonetCount.Result_Code
})
// 返回一个默认的空数据结构而不是undefined
return [[], {
cashPay: 0,
ticketCount: 0,
totalCount: 0,
uploadState: '0/0'
}, [], [], [], []]
}
if (isServerPartDetail) { // 是服务区营收推送页面
return _this.getSeverpartReginList(data.Result_Data.List, busniessCounts.Result_Data.List,
@ -69,6 +80,17 @@ const methods = {
bayonetCount.Result_Data.List, mobileShare.Result_Data, mallDeliver.Result_Data)
// [reginList, totalData, busniessTypePie, busniessTradePie]
} catch (error) {
console.error('API请求出错:', error)
// 返回默认空数据结构
return [[], {
cashPay: 0,
ticketCount: 0,
totalCount: 0,
uploadState: '0/0'
}, [], [], [], []]
}
},
getTotalShowData(newData, oldData, index) {
// <TotalModel>

View File

@ -557,7 +557,7 @@ export default {
methods: {
toggleCard(isup) {
this.isup = !isup;
this.$forceUpdate();
// $forceUpdateVue
},
bindDateChange(e) {
//
@ -574,10 +574,16 @@ export default {
title: "正在加载...",
mask: true,
});
this.getData();
this.getTender();
this.todayAmount();
this.$forceUpdate();
//
Promise.all([
this.getData(),
this.getTender(),
this.todayAmount()
]).catch(err => {
console.error('数据刷新失败:', err);
uni.hideLoading();
});
// $forceUpdate
}
},
toDetail(item, provinceId) {
@ -610,15 +616,15 @@ export default {
"navigateTo",
canToSeverpartIndex ? severpartIndexPath : serverpartUploadPath
);
item.visited = true;
this.$forceUpdate();
// 使Vue.set
this.$set(item, 'visited', true);
},
selectTab(name, index) {
this[name] = index;
},
toggleRegion(item) {
item.show = !item.show ? true : false;
this.$forceUpdate();
// 使Vue.set
this.$set(item, 'show', !item.show);
},
touchPie(e, id) {
rincanvas[id].showToolTip(e, {
@ -647,7 +653,7 @@ export default {
totalTicketCount: res.Data.TOTALTICKET,
avrticketCount: this.$util.fmoney(avrticket, 2),
};
_this.$forceUpdate();
// $forceUpdateVue
});
},
getRankmMap(list) {
@ -660,7 +666,7 @@ export default {
});
return map;
},
getData() {
async getData() {
let _this = this;
let theRequest = _this.theRequest;
let provinceCode = _this.theRequest.ProvinceCode;
@ -672,7 +678,7 @@ export default {
Statistics_Date: theRequest.time,
};
this.$request.$get("getRevenuePush", arr).then((res) => {
return this.$request.$get("getRevenuePush", arr).then((res) => {
console.log("res", res);
_this.isLoading = false;
if (res.ResultCode != 100) {
@ -711,7 +717,7 @@ export default {
}
uni.hideLoading();
_this.showPage = true;
_this.$forceUpdate();
// $forceUpdateVue
});
function sortMount(list) {
@ -1182,8 +1188,8 @@ export default {
},
toggleShow(i) {
let item = this.regionList[i];
item.show = !item.show;
this.$forceUpdate();
// 使Vue.set
this.$set(item, 'show', !item.show);
},
changeDate(name, index) {
@ -1200,7 +1206,7 @@ export default {
});
},
getTender() {
async getTender() {
//
let _this = this;
let obj = this.theRequest;
@ -1216,7 +1222,7 @@ export default {
2: [],
3: [],
};
_this.$request
return _this.$request
.$webGet("WeChat/GetRevenueTrends", {
Statictics_Type: "Week",
Report_Type: Report_Type[typeIndex],
@ -1266,7 +1272,7 @@ export default {
},
],
});
_this.$forceUpdate();
// $forceUpdateVue
});
bili.forEach((biliName, i) => {
if (i == 1) {
@ -1345,58 +1351,48 @@ export default {
},
onLoad(option) {
console.log("indexOption", option);
uni.showLoading({
title: "正在加载...",
});
const toSnhuiPageProvinceCode = [
340000, 520000, 451200, 510000, 530000, 620000, 630000, 330200, 330300, 734100
]; //
//
if (option.ProvinceCode) {
//
console.log(
"12321312",
toSnhuiPageProvinceCode.indexOf(parseInt(option.ProvinceCode))
);
// -
if (toSnhuiPageProvinceCode.indexOf(parseInt(option.ProvinceCode)) > -1) {
// 451200510000520000620000630000330200
uni.redirectTo({
url:
"/pages/everdayRenven/AnhuiIndex?ProvinceCode=" +
// loading
const url = "/pages/everdayRenven/AnhuiIndex?ProvinceCode=" +
option.ProvinceCode +
"&time=" +
option.time +
"&GroupType=" +
option.GroupType +
"&ServerpartIds=" +
option.ServerpartIds,
});
option.ServerpartIds;
console.log('推送跳转到AnhuiIndex参数:', url);
uni.redirectTo({ url });
return;
}
this.theRequest = option;
option.time = this.$util.cutDate(option.time, "YYYY-MM-DD");
this.getData();
this.getTender();
} else {
//
// -
if (this.PushAuthority.length > 0) {
console.log(1);
this.theRequest = this.defaultMsg() || {};
if (
toSnhuiPageProvinceCode.indexOf(this.theRequest.ProvinceCode) > -1
) {
uni.redirectTo({
url: "/pages/everdayRenven/AnhuiIndex",
});
//
const url = "/pages/everdayRenven/AnhuiIndex?" +
"ProvinceCode=" + this.theRequest.ProvinceCode +
"&GroupType=" + (this.theRequest.GroupType || '1000') +
"&time=" + this.lastDay +
"&ServerpartIds=" + (this.theRequest.ServerpartIds || '');
console.log('默认跳转到AnhuiIndex参数:', url);
uni.redirectTo({ url });
return;
}
this.theRequest.time = this.lastDay;
this.getData();
this.getTender();
this.nowTab = this.theRequest.ProvinceCode == 340000 ? 4 : 1;
} else {
uni.hideLoading();
this.theRequest = null;
this.isLoading = false;
this.showPage = false;
@ -1404,11 +1400,37 @@ export default {
return;
}
}
//
uni.showLoading({
title: "正在加载...",
mask: false
});
if (option.ProvinceCode) {
this.theRequest = option;
option.time = this.$util.cutDate(option.time, "YYYY-MM-DD");
} else {
this.theRequest.time = this.lastDay;
this.nowTab = this.theRequest.ProvinceCode == 340000 ? 4 : 1;
}
//
Promise.all([
this.getData(),
this.getTender(),
this.todayAmount()
]).catch(err => {
console.error('数据加载失败:', err);
uni.hideLoading();
this.isLoading = false;
});
this.sevenDate = [
this.$util.cutDate(new Date(this.theRequest.time), "MM.DD", -13),
this.$util.cutDate(new Date(this.theRequest.time), "MM.DD", -7),
];
this.todayAmount();
if (this.theRequest.GroupType == 1010) {
this.getDetail(this.theRequest);
}

View File

@ -6,22 +6,26 @@
<view class=""> ¥{{ $util.fmoney(pageMsg.Serverpart_Revenue, 2) }} </view>
</view>
<view class="uni-flex jc-between ai-center">
<text class=""> {{pageMsg.Serverpart_S||'南/东区'}} &nbsp; &nbsp;¥{{$util.fmoney(pageMsg.Serverpart_RevenueS,2)}}</text>
<text class=""> {{pageMsg.Serverpart_N||'北/西区'}} &nbsp; &nbsp;¥{{$util.fmoney(pageMsg.Serverpart_RevenueN,2)}}</text>
<text class=""> {{ pageMsg.Serverpart_S || '南/东区' }} &nbsp;
&nbsp;¥{{ $util.fmoney(pageMsg.Serverpart_RevenueS, 2) }}</text>
<text class=""> {{ pageMsg.Serverpart_N || '北/西区' }} &nbsp;
&nbsp;¥{{ $util.fmoney(pageMsg.Serverpart_RevenueN, 2) }}</text>
</view>
</view>
<view class="page-list">
<view v-for="(dateItem,i) in pageMsg.revenueReportDetilsDates" :key="i">
<text class="list-date"> {{$util.cutDate(dateItem.Statistics_Date,'MM.DD')}}</text>
<view class="cell-body uni-flex ai-center" v-for="(item,i) in dateItem.revenueReportDetils" :key="i">
<image :src="item.BusinessType_Logo || '/static/images/revenue/operating-shop.png'" mode="aspectFit"></image>
<view class="page-list" v-if="pageMsg.ShopList && pageMsg.ShopList.length > 0">
<!-- <view v-for="(dateItem,i) in pageMsg.revenueReportDetilsDates" :key="i">-->
<!-- <text class="list-date"> {{// $util.cutDate(dateItem.Statistics_Date,'MM.DD')}}</text>-->
<view class="cell-body uni-flex ai-center" v-for="(item, i) in pageMsg.ShopList" :key="i">
<image :src="item.BusinessType_Logo || '/static/images/revenue/operating-shop.png'" mode="aspectFit">
</image>
<view class="">
<view class="uni-flex ai-center jc-between">
<text>{{ item.BusinessType_Name }}</text>
<text class="shop-total"> ¥{{ $util.fmoney(item.BusinessType_Revenue, 2) }}</text>
</view>
<view class="uni-flex ai-center jc-between">
<text class="type-text" :class="{'scan':item.Upload_Type==1,'port':item.Upload_Type==2}">
<text style="display: inline-block;width: 20%" class="type-text"
:class="{ 'scan': item.Upload_Type == 1, 'port': item.Upload_Type == 2 }">
<template v-if="item.Upload_Type == 1">
扫码上传
</template>
@ -35,15 +39,36 @@
<text class="type-text port" >接口传输</text>
<text v-else>自动上传</text> -->
</text>
<view class="uni-flex ai-center">
<text class="text-coast">{{item.Serverpart_S||'南/东区'}}: ¥{{$util.fmoney(item.Serverpart_RevenueS,2)}}</text>
<text class="text-coast">{{item.Serverpart_N||'北/西区'}}: ¥{{$util.fmoney(item.Serverpart_RevenueN,2)}}</text>
<view class="uni-flex ai-center" style="display: inline-block;width: 80%">
<div style="display: inline-block;width: 48%;text-align: left;margin-right: 4%"
class="text-coast">
<text style="display: inline-block;width: 40px;text-align: left">
{{ item.Serverpart_RevenueS === 0 || item.Serverpart_RevenueS ?
`${item.Serverpart_S}
`: '' }}
</text>
<text style="display: inline-block;width: calc(100% - 50px);margin-left: 10px">
{{ item.Serverpart_RevenueS === 0 || item.Serverpart_RevenueS ?
`¥${$util.fmoney(item.Serverpart_RevenueS, 2)}` : '' }}
</text>
</div>
<div style="display: inline-block;width: 48%;text-align: right" class="text-coast">
<text style="display: inline-block;width: 40px;text-align: left">
{{ item.Serverpart_RevenueN === 0 || item.Serverpart_RevenueN ?
`${item.Serverpart_N}
`: '' }}
</text>
<text style="display: inline-block;width: calc(100% - 50px);margin-left: 10px">
{{ item.Serverpart_RevenueN === 0 || item.Serverpart_RevenueN ?
`¥${$util.fmoney(item.Serverpart_RevenueN, 2)}` : '' }}
</text>
</div>
</view>
</view>
</view>
</view>
</view>
<!-- </view>-->
</view>
<view class="" v-if="!isLoading && !pageMsg.Serverpart_Name">
<noFound nodata="true" :text="noDataText" />
@ -71,12 +96,16 @@
title: '正在加载...',
mask: true
})
_this.$request.$webGet('WeChat/GetRevenueReportDetils',{
const req = {
provinceCode: obj.pcode,
serverpartId: obj.id,
startTime: obj.st,
endTime: obj.et,
Serverpart_Id: obj.id,
pushProvinceCode: obj.pcode
}).then(res=>{
}
_this.$request.$webGet('CommercialApi/Revenue/GetRevenueReportDetil', req).then((res) => {
console.log('dadasda', res);
if (res.Result_Code == 100) {
_this.pageMsg = res.Result_Data
@ -87,6 +116,24 @@
uni.hideLoading()
_this.isLoading = false
})
// _this.$request.$webGet('WeChat/GetRevenueReportDetils',{
// startTime: obj.st,
// endTime: obj.et,
// Serverpart_Id: obj.id,
// pushProvinceCode: obj.pcode
// }).then(res=>{
// if(res.Result_Code==100) {
// _this.pageMsg = res.Result_Data
// }else{
// _this.noDataText = res.Result_Desc
// }
// uni.hideLoading()
// _this.isLoading = false
// })
},
},
@ -101,25 +148,31 @@
page {
background-color: #fff;
}
.page-card {
margin: 30rpx 20rpx;
}
.head-card {
padding: 30rpx 35rpx;
background: linear-gradient(to left, #f7f6f8 0%, #eceaeb 100%);
border-radius: 12rpx 12rpx 0 0;
}
.head-card>view+view {
margin-top: 16rpx;
}
.text-strong {
font-weight: bolder;
}
.head-card>view>text {
font-size: 24rpx;
color: #333;
}
.list-date {
font-size: 22rpx;
background-color: #f8f8f8;
@ -127,6 +180,7 @@
padding: 4rpx 12rpx;
margin-top: 20rpx;
}
.page-list {
border: 1rpx solid #F0F0F0;
border-radius: 0 0 12rpx 12rpx;
@ -134,53 +188,66 @@
padding: 30rpx 16rpx 30rpx 16rpx;
}
.cell-body {
position: relative;
padding: 20rpx 20rpx 20rpx 0;
}
.cell-body image {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
margin-right: 16rpx;
}
.cell-body>view {
flex: 1;
}
.page-list text {
font-size: 22rpx;
color: #2E2E2E;
}
text.shop-total {
font-size: 24rpx;
}
text.type-text {
color: #DFBE9F;
display: flex;
align-items: center;
}
text.type-text.scan::before,text.type-text.port::before {
text.type-text.scan::before,
text.type-text.port::before {
content: '';
width: 21rpx;
height: 23rpx;
margin-right: 8rpx;
}
text.type-text.scan::before {
background: url(/static/images/revenue/scan-up.png) no-repeat center;
background-size: contain;
}
text.type-text.port::before {
background: url(/static/images/revenue/port.png) no-repeat center;
background-size: contain;
}
text.type-text.port {
color: #95BAF2;
}
text.text-coast {
color: #848484;
width: 184rpx;
}
text.text-coast+text.text-coast {
text-align: right;
}

View File

@ -2,12 +2,14 @@
<view class="page-body">
<!-- 日期筛选 -->
<div class="uni-flex ai-center screen-box">
<picker mode="date" @change="bindDateChange($event,0)" :value="pageData.searchTime[0]" :end="pageData.endDate" start="2018-12-01" class="screen-unit">
<picker mode="date" @change="bindDateChange($event, 0)" :value="pageData.searchTime[0]"
:end="pageData.endDate" start="2018-12-01" class="screen-unit">
<text>{{ pageData.searchTime[0] }}</text>
<text class="uni-icon uni-icon-arrowdown"></text>
</picker>
<text class="mr20"></text>
<picker mode="date" @change="bindDateChange($event,1)" :value="pageData.searchTime[1]" :end="pageData.endDate" start="2018-12-01" class="screen-unit">
<picker mode="date" @change="bindDateChange($event, 1)" :value="pageData.searchTime[1]"
:end="pageData.endDate" start="2018-12-01" class="screen-unit">
<text>{{ pageData.searchTime[1] }}</text>
<text class="uni-icon uni-icon-arrowdown"></text>
</picker>
@ -24,7 +26,8 @@
切换
</div>
<view>{{ !regionType ? "省内" : "省外" }}实收</view>
<view class="price-num">¥{{!regionType ? $util.fmoney(pageData.msg.Province_InsideAmount,2) : $util.fmoney(pageData.msg.Province_ExternalAmount,2)}}</view>
<view class="price-num">¥{{ !regionType ? $util.fmoney(pageData.msg.Province_InsideAmount, 2) :
$util.fmoney(pageData.msg.Province_ExternalAmount, 2) }}</view>
</view>
<view class="" v-else>
<div class="all-diff" @tap="regionType = !regionType">
@ -32,7 +35,8 @@
切换方向
</div>
<view>{{ !regionType ? "东 (南)" : "西 (北)" }}区实收</view>
<view class="price-num">¥{{!regionType ? $util.fmoney(pageData.msg.Revenue_AmountS,2) : $util.fmoney(pageData.msg.Revenue_AmountN,2)}}</view>
<view class="price-num">¥{{ !regionType ? $util.fmoney(pageData.msg.Revenue_AmountS, 2) :
$util.fmoney(pageData.msg.Revenue_AmountN, 2) }}</view>
</view>
</view>
<view class="modle-title">
@ -40,7 +44,9 @@
<text>经营报表</text>
</view>
<view class="bg-white" v-if="ServerpartList.length > 0">
<view class="region-area-title uni-flex ai-center jc-between" v-show="pageData.msg.Province_ExternalAmount" :class="{'active':pageData.insideShow}" @tap="pageData.insideShow=!pageData.insideShow">
<view class="region-area-title uni-flex ai-center jc-between"
v-show="pageData.msg.Province_ExternalAmount" :class="{ 'active': pageData.insideShow }"
@tap="pageData.insideShow = !pageData.insideShow">
<text>省内区域</text>
</view>
@ -64,7 +70,8 @@
</div>
</div>
<ul class="region-cell-area" v-show="item.show">
<li v-for="(child,index) in item.revenueServerModels" :class="{'visited':child.visited}" :key="index" @tap="toDetail(child)">
<li v-for="(child, index) in item.revenueServerModels" :class="{ 'visited': child.visited }"
:key="index" @tap="toDetail(child)">
<view>{{ child.Serverpart_Name }}</view>
<view class="uni-flex ai-center data-number">
<text class="">{{ child.Revenue_Proportion }}</text>
@ -78,13 +85,15 @@
</view>
<template v-if="insideRegionList.length > 0">
<view class="region-area-title uni-flex ai-center jc-between" :class="{'active':pageData.exsideShow }" @tap="pageData.exsideShow = !pageData.exsideShow">
<view class="region-area-title uni-flex ai-center jc-between"
:class="{ 'active': pageData.exsideShow }" @tap="pageData.exsideShow = !pageData.exsideShow">
<text>省外区域</text>
</view>
<view v-show="pageData.exsideShow">
<view v-for="(item, i) in insideRegionList" :key="i">
<div class=" region-cell" @tap="toggleRegion(item)">
<div class="region-cell-unit region-title cuIcon-triangledownfill" :class="{'active':item.show}">
<div class="region-cell-unit region-title cuIcon-triangledownfill"
:class="{ 'active': item.show }">
<text class="">{{ item.Region_Name }}</text>
<div class="ct01">
<text class="strong-text">¥{{ $util.fmoney(item.Total_Revenue, 2) }}</text>
@ -99,10 +108,12 @@
</div>
</div>
<div class="region-cell-unit"><text class="uni-icon uni-icon-arrowright" :class="{'active':item.show}"></text></div>
<div class="region-cell-unit"><text class="uni-icon uni-icon-arrowright"
:class="{ 'active': item.show }"></text></div>
</div>
<ul class="region-cell-area" v-show="item.show">
<li v-for="(child,index) in item.revenueServerModels" :class="{'visited':child.visited}" :key="index" @tap="toDetail(child)">
<li v-for="(child, index) in item.revenueServerModels"
:class="{ 'visited': child.visited }" :key="index" @tap="toDetail(child)">
<view>{{ child.Serverpart_Name }}</view>
<view class="uni-flex ai-center data-number">
<text class="">{{ child.Revenue_Proportion }}</text>
@ -185,14 +196,23 @@
getList() {
let _this = this
let searchTime = this.pageData.searchTime
_this.$request.$webGet('WeChat/GetRevenueReport',{
const req = {
provinceCode: this.ProvinceCode,
startTime: searchTime[0],
endTime: searchTime[1],
additionalCode: this.ProvinceCode=='330000' ? '451200,630000' :''
}).then(res=>{
}
console.log('reqdad', req);
uni.showLoading({
title: '正在加载',
mask: true
})
_this.$request.$webGet('CommercialApi/Revenue/GetRevenueReport', req).then((res) => {
console.log('resresresres', res);
uni.hideLoading()
if (res.Result_Code == 100) {
_this.pageData.msg = res.Result_Data
_this.pageData.msg.countave = (Number(_this.pageData.msg.Province_InsideAmount) / Number(_this.pageData.msg.TotalCount)).toFixed(2)
res.Result_Data.revenueRegionModels.map(n => {
n.show = false
})
@ -203,15 +223,67 @@
_this.insideRegionList = res.Result_Data.revenueInsideRegionModels
}
// _this.pageData.msg.SearchResult
//
//
if (this.searchText) {
this.showModal = false
if (res.Result_Data.SearchResult) {
let newList = []
res.Result_Data.SearchResult.forEach(item => {
newList.push(item.split(this.searchText))
_this.pageData.msg.SearchResult = newList
_this.copySearchText = JSON.parse(JSON.stringify(this.searchText))
})
}
} else {
if (this.BusinessTypeValue || this.SettlementModeValue) {
this.showModal = true
}
}
_this.ServerpartList = res.Result_Data.revenueRegionModels
} else if (res.Result_Code == 200 || res.Result_Code == 999) {
_this.noDataText = '暂无数据'
_this.insideRegionList = []
_this.pageData.msg = null
} else {
_this.pageData.msg = null
_this.noDataText = res.Result_Desc
_this.insideRegionList = []
}
uni.hideLoading()
_this.requestText = _this.searchText
_this.pageData.isLoading = false
_this.$forceUpdate()
})
// _this.$request.$webGet('WeChat/GetRevenueReport', {
// startTime: searchTime[0],
// endTime: searchTime[1],
// additionalCode: this.ProvinceCode == '330000' ? '451200,630000' : ''
// }).then(res => {
// if (res.Result_Code == 100) {
// _this.pageData.msg = res.Result_Data
// res.Result_Data.revenueRegionModels.map(n => {
// n.show = false
// })
// if (res.Result_Data.revenueInsideRegionModels) {
// res.Result_Data.revenueInsideRegionModels.map(n => {
// n.show = false
// })
// _this.insideRegionList = res.Result_Data.revenueInsideRegionModels
// }
// _this.ServerpartList = res.Result_Data.revenueRegionModels
// } else {
// _this.pageData.msg = null
// _this.noDataText = res.Result_Desc
// }
// uni.hideLoading()
// _this.pageData.isLoading = false
// _this.$forceUpdate()
// })
}
},
onLoad() {
@ -229,6 +301,7 @@
.page-body {
padding-bottom: 80rpx;
}
.screen-box {
background-color: #fff;
padding: 0 20rpx;
@ -237,6 +310,7 @@
left: 0;
z-index: 9;
}
.screen-box .screen-unit {
display: flex;
align-items: center;
@ -244,28 +318,34 @@
padding: 0 14rpx;
line-height: 3;
}
.screen-box .mr20 {
margin-right: 20rpx;
color: #95999C;
}
.uni-icon-arrowdown {
font-size: 22rpx;
color: #C7C7C7;
margin-left: 8rpx;
}
.screen-box text {
line-height: 3;
}
.screen-box image {
width: 12rpx;
height: 8rpx;
margin: 0 16rpx;
vertical-align: middle;
}
.head-card {
padding: 40rpx 26rpx;
background-color: #fff;
}
.head-card>view {
width: 330rpx;
height: 190rpx;
@ -277,6 +357,7 @@
box-sizing: border-box;
}
.head-card>view:first-child {
background: linear-gradient(to left, #93a4ec 0%, #4b76e9 100%);
@ -288,11 +369,13 @@
position: relative;
overflow: hidden;
}
.head-card .price-num {
font-family: 'Bahnschrift Regular';
font-size: 50rpx;
line-height: 1.5;
}
.all-diff {
background: linear-gradient(#f28785, #ee5b4c);
height: 36rpx;
@ -307,11 +390,13 @@
border-radius: 0 0 0 54rpx;
}
.all-diff image {
width: 20rpx;
height: 17rpx;
margin-right: 8rpx;
}
.modle-title {
padding-left: 24rpx;
font-size: 30rpx;
@ -321,17 +406,20 @@
display: flex;
align-items: center;
}
.modle-title image {
max-width: 36rpx;
max-height: 36rpx;
margin-right: 14rpx;
}
.bg-white {
background-color: #fff;
margin: 0 24rpx;
border-radius: 12rpx;
padding-bottom: 26rpx;
}
.region-area-title {
color: #000;
font-weight: bolder;
@ -339,6 +427,7 @@
position: relative;
display: flex;
}
/*日结上传*/
.region-title {
position: relative;
@ -346,9 +435,12 @@
/* font-weight: bolder; */
}
.region-title,.ct01 {
.region-title,
.ct01 {
color: #000000;
}
.ct01 {
padding-top: 8rpx;
}
@ -368,6 +460,7 @@
transition: all 0.4s;
display: block;
}
.active.region-area-title:before {
border-left: 8rpx solid transparent;
@ -381,23 +474,28 @@
padding: 26rpx 46rpx 16rpx 56rpx;
align-items: flex-end;
}
.region-cell .active.uni-icon-arrowright::before {
transform: rotate(90deg);
}
.region-cell .uni-icon-arrowdown,.region-cell .uni-icon-arrowright {
.region-cell .uni-icon-arrowdown,
.region-cell .uni-icon-arrowright {
font-size: 36rpx;
color: #5A5A5A;
/* padding-bottom: 12rpx; */
position: relative;
}
.region-cell .uni-icon-arrowright::before {
position: absolute;
right: -26rpx;
top: -46rpx;
transition: all 0.4s;
}
.region-cell .region-cell-unit {
flex: 2;
display: flex;
@ -412,11 +510,13 @@
flex: 3;
text-align: left;
}
.region-cell .region-cell-unit:nth-child(3) {
flex: 2.5;
}
.region-cell-image {
width: 48rpx;
display: flex;
@ -435,13 +535,16 @@
.region-cell-area {
box-sizing: border-box;
}
.region-cell-area li:nth-child(2n+1) {
background-color: #FCFCFC;
}
.region-cell-area li view:first-child {
display: flex;
align-items: center;
}
.region-cell-area li.visited view:first-child {
color: #007AFF;
@ -491,17 +594,20 @@
font-size: 22rpx;
position: relative;
}
.region-cell-area li>view text {
font-size: 22rpx;
flex: 1;
text-align: right;
}
.region-cell-area li>view text:last-child {
/* text-align: right; */
font-weight: bolder;
padding-right: 8rpx;
flex: 2;
}
.region-cell-area li>view:last-child:after {
content: '';
background: url(/static/images/revenue/you-jt.png) no-repeat center;