This commit is contained in:
zmj 2024-02-28 15:42:37 +08:00
parent b15e2eb7ba
commit 164220a37f
3 changed files with 142 additions and 46 deletions

View File

@ -267,7 +267,8 @@ const storeData = reactive([])
const initStoreOption = (pageData, total) => {
storeData.splice(0, storeData.length);
pageData.forEach((item,index) => {
let range = ((item.merchant_count / total).toFixed(2) * 100)
let range = ((item.merchant_count / total) * 100).toFixed(2)
console.log(range,'rean=g')
storeData.push({
name: item.street_name,
num: item.merchant_count,

View File

@ -147,9 +147,98 @@ const changeBill = (num) => {
}
const billList = reactive([
// {
// icon: "DD",
// text: "",
// num: 1245
// },
// {
// icon: "CZ",
// text: "退",
// num: 1245
// },
// {
// icon: "YJ",
// text: "",
// num: 1245
// },
// {
// icon: "PT",
// text: "",
// num: 1245
// },
// {
// icon: "CZ",
// text: "",
// num: 1245
// },
// {
// icon: "CZXF",
// text: "",
// num: 1245
// },
// {
// icon: "CS",
// text: "",
// num: 1245
// },
// {
// icon: "YH",
// text: "",
// num: 1245
// },
// {
// icon: "CS",
// text: "",
// num: 1245
// },
// {
// icon: "YC",
// text: "",
// num: 1245
// },
// {
// icon: "XZ",
// text: "",
// num: 1245
// },
// {
// icon: "CY",
// text: "",
// num: 1245
// },
// {
// icon: "ZY",
// text: "",
// num: 1245
// },
// {
// icon: "PT",
// text: "",
// num: 1245
// },
])
financial_record_titleApi(
{
...areaStore.area
}
).then(res => {
res.data.stat.forEach((item, i) => {
billList.push({
icon: foundIcon(item.name),
text: item.name,
num: item.count
})
})
})
let lists = [{
icon: "DD",
text: "订单总金额收入",
text: "订单收入总金额",
num: 1245
},
{
@ -184,7 +273,7 @@ const billList = reactive([
},
{
icon: "YH",
text: "优惠券",
text: "优惠券金额",
num: 1245
},
{
@ -216,22 +305,24 @@ const billList = reactive([
icon: "PT",
text: "平台剩余手续费",
num: 1245
},
])
financial_record_titleApi(
{
...areaStore.area
}
).then(res => {
res.data.stat.forEach((item, i) => {
billList[i].num = item.count
},]
const foundIcon = (te) => {
let icons = ''
lists.forEach(item => {
item.text==te?icons=item.icon:icons='YJ'
})
})
return icons
}
// console.log(foundIcon(''))
const changeTable = (type, num) => {
if (type == 0) {
@ -501,8 +592,6 @@ const hdClick3 = (e) => {
})
}
showPop.value = true
}
@ -511,7 +600,7 @@ const hdClick3 = (e) => {
onMounted(() => {
changeTable(0)
changeTable(2)
addConfigHead()
financial_recordApi({
...areaStore.area,
@ -536,31 +625,30 @@ globalEventBus.on('header5-3-2', data => {
changeBill(2)
})
globalEventBus.on('header5-3-3', data => {
if (billType.value == 1) {
financial_record_detailApi(
{ ...areaStore.area, date: data.time }
).then(res => {
if (billType.value == 1) {
financial_record_detailApi(
{ ...areaStore.area, date: data.time }
).then(res => {
for (let key in res.data) {
detailData[key] = res.data[key]
}
for (let key in res.data) {
detailData[key] = res.data[key]
}
})
}
if (billType.value == 2) {
financial_record_detailApi2(
{ ...areaStore.area, date:data.time }
).then(res => {
})
}
if (billType.value == 2) {
financial_record_detailApi2(
{ ...areaStore.area, date: data.time }
).then(res => {
for (let key in res.data) {
detailData[key] = res.data[key]
}
for (let key in res.data) {
detailData[key] = res.data[key]
}
})
}
})
}
showPop.value = true
showPop.value = true
})
globalEventBus.on('header5-3-4', data => {
showPop.value = false

View File

@ -127,15 +127,15 @@
<div class="bottom">
<div class="ranking">
<img src="/static/storeLogin/SPXSPH.png" class="img-cls" alt="">
<dv-scroll-board :config="config1" v-if="config1.data.length" class="list" />
<dv-scroll-board :config="config1" v-if="showConfig1" class="list" />
</div>
<div class="ranking">
<img src="/static/storeLogin/SPFKPH.png" class="img-cls" alt="">
<dv-scroll-board :config="config2" v-if="config2.data.length" class="list" />
<dv-scroll-board :config="config2" v-if="showConfig2" class="list" />
</div>
<div class="ranking">
<img src="/static/storeLogin/SPJGPH.png" class="img-cls" alt="">
<dv-scroll-board :config="config3" v-if="config3.data.length" class="list" />
<dv-scroll-board :config="config3" v-if="showConfig3" class="list" />
</div>
</div>
</template>
@ -146,12 +146,14 @@ import { ref, reactive, onMounted, watch } from "vue"
import { merchant_count_mainApi, merchant_product_rankingApi, merchant_product_visitApi, merchant_product_cartApi, } from "@/api.js"
import { areaObj } from "../store";
import { globalEventBus } from '@/common/eventBus'
import { merchantApi } from "@/api.js"
const areaStore = areaObj()
let query;
let userInfo = JSON.parse(localStorage.getItem('TRADE_USER'));
let storeLogin = JSON.parse(localStorage.getItem('TRAD_STORE_INFO'))
const showConfig1=ref(false)
const showConfig2=ref(false)
const showConfig3=ref(false)
if (areaStore.userInfo.user?.merchant) {
let { area_id, mer_id, street_id } = areaStore.userInfo.user?.merchant
@ -249,6 +251,10 @@ let total3 = ''
const init = () => {
showConfig1.value=false
showConfig2.value=false
showConfig3.value=false
merchant_product_rankingApi(
{ ...query, start_date: areaStore.time[0], end_date: areaStore.time[1] }
).then(res => {
@ -290,13 +296,13 @@ const addData1 = (data) => {
]
)
})
showConfig1.value=true
}
const addData2 = (data) => {
config2.data.splice(0, 99999999)
data.forEach((item, i) => {
config2.data.push(
[
@ -311,11 +317,10 @@ const addData2 = (data) => {
)
})
showConfig2.value=true
}
const addData3 = (data) => {
config3.data.splice(0, 99999999)
data.forEach((item, i) => {
config3.data.push(
@ -330,6 +335,8 @@ const addData3 = (data) => {
]
)
})
showConfig3.value=true
}