Commit 7e84ec16 by 胡悦

saas+喜报联调

1 parent 1ef891b2
import http from './http'
import { useUserStore } from '../store/user'
const PATH = 'rop-scrm-shopmall/router'
const DJPATH = 'rop-dj-smartcarlife/router'
const req: any = (url: string, data: any = {}, returnAll = false, method = 'POST',) => {
data.method = url
const options = {
......@@ -17,7 +17,7 @@ const djReq: any = (url: string, data: any = {}, returnAll = false, method = 'PO
data.method = url
const options = {
domain: 'otherRequest',
url: PATH,
url: DJPATH,
method,
data,
returnAll
......
<!--
* @Description:
* @Author: huyue
* @Date: 2023-02-07 16:36:16
* @LastEditors: huyue
* @LastEditTime: 2023-02-13 17:19:27
-->
<template>
<div class="wrapper-box">
<div class="header-box">
<img class="header-bg" src="@/assets/images/dj/header-bg.png" alt="" />
<img class="time-bg" src="@/assets/images/dj/time-bg.png" alt="" />
<div class="time">2022-12-29 16:49:45</div>
<div class="time">{{ data.reportInfo.time }}</div>
</div>
<div class="content-box">
<img class="reel" src="@/assets/images/dj/reel.png" alt="" />
......@@ -13,13 +20,13 @@
今日单量
<div class="content-value">
第
<span class="number">8</span>
<span class="number">{{ data.reportInfo!.todayOrderCount }}</span>
单
</div>
</div>
<div class="content-item">
订单收款
<div class="price">¥5846.00</div>
<div class="price">¥{{ data.reportInfo!.todayOrderPrice }}</div>
</div>
</div>
<div class="content-list">
......@@ -27,13 +34,13 @@
累计单量
<div class="content-value">
第
<span class="number">8</span>
<span class="number">{{ data.reportInfo!.totalOrderCount }}</span>
单
</div>
</div>
<div class="content-item">
累计产值
<div class="price">¥999999999.00</div>
<div class="price">¥{{ data.reportInfo!.totalOrderPrice }}</div>
</div>
</div>
</div>
......@@ -44,7 +51,37 @@
</div>
</div>
</template>
<script lang="ts" setup></script>
<script lang="ts" setup>
import { reactive, onMounted, inject } from "vue";
import { djReq } from "../../utils/request";
import { useRoute } from "vue-router";
import { DataInfo, Params } from "./interface";
const route = useRoute();
// 获取全局对象
const global: any = inject("global");
let query: Params = {};
const data = reactive<Partial<DataInfo>>({
reportInfo: {},
});
const getInfo = async () => {
data.reportInfo = await djReq(
"dj.api.smartcarlife.orderReport.stat.byGoodsNews",
query
);
// data.reportInfo.time = data.reportInfo.time.s
};
const getImageUrl = (name: any, path = "dj") => {
return new URL(`./${path}/${name}.png?v=${global.version}`, global.$imgUrl)
.href;
};
onMounted(() => {
if (route.query) {
query = route.query;
getInfo();
}
});
</script>
<style lang="scss" scoped>
@import "src/assets/styles/dj.scss";
</style>
/*
* @Description:
* @Author: huyue
* @Date: 2022-11-16 18:18:59
* @LastEditors: huyue
* @LastEditTime: 2023-02-13 17:06:37
*/
export interface ReportInfo {
time?: string;
todayOrderCount?: number;
todayOrderPrice?: number;
totalOrderCount?: number;
totalOrderPrice?: number;
}
export interface DataInfo {
reportInfo: ReportInfo;
}
export interface Params {
merchantId?: number | string;
}
export interface WarParams {
yqMerchantId?: number | string;
}
......@@ -101,7 +101,35 @@
<img class="bg-center" src="@/assets/images/dj/bg-center.png" alt="" />
</div>
</template>
<script lang="ts" setup></script>
<script lang="ts" setup>
import { reactive, onMounted, inject } from "vue";
import { djReq } from "../../utils/request";
import { useRoute } from "vue-router";
import { DataInfo, WarParams } from "./interface";
const route = useRoute();
// 获取全局对象
const global: any = inject("global");
let query: WarParams = {};
const data = reactive<Partial<DataInfo>>({
reportInfo: {},
});
const getInfo = async () => {
data.reportInfo = await djReq(
"dj.api.smartcarlife.orderSummary.getYqMerchantOrderReport",
query
);
};
const getImageUrl = (name: any, path = "dj") => {
return new URL(`./${path}/${name}.png?v=${global.version}`, global.$imgUrl)
.href;
};
onMounted(() => {
if (route.query) {
query = route.query;
getInfo();
}
});
</script>
<style lang="scss" scoped>
@import "src/assets/styles/dj.scss";
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!