新框架接口接了一个 迁移回了老项目
This commit is contained in:
parent
21f4219a02
commit
0c7407d62c
@ -7,4 +7,4 @@ VITE_BASE = '/api'
|
|||||||
VITE_USE_MOCK = true
|
VITE_USE_MOCK = true
|
||||||
|
|
||||||
# 本地环境接口地址
|
# 本地环境接口地址
|
||||||
VITE_API_URL = 'http://mp.eshangtech.com'
|
VITE_API_URL = 'https://api.eshangtech.com'
|
||||||
16
.hbuilderx/launch.json
Normal file
16
.hbuilderx/launch.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||||
|
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||||
|
"version": "0.0",
|
||||||
|
"configurations": [{
|
||||||
|
"default" :
|
||||||
|
{
|
||||||
|
"launchtype" : "local"
|
||||||
|
},
|
||||||
|
"mp-weixin" :
|
||||||
|
{
|
||||||
|
"launchtype" : "local"
|
||||||
|
},
|
||||||
|
"type" : "uniCloud"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
8
package-lock.json
generated
8
package-lock.json
generated
@ -3918,7 +3918,7 @@
|
|||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmmirror.com/immutable/-/immutable-4.1.0.tgz",
|
"resolved": "https://registry.npmmirror.com/immutable/-/immutable-4.1.0.tgz",
|
||||||
"integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==",
|
"integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==",
|
||||||
"dev": true
|
"devOptional": true
|
||||||
},
|
},
|
||||||
"node_modules/import-fresh": {
|
"node_modules/import-fresh": {
|
||||||
"version": "3.3.0",
|
"version": "3.3.0",
|
||||||
@ -5105,7 +5105,7 @@
|
|||||||
"version": "1.52.3",
|
"version": "1.52.3",
|
||||||
"resolved": "https://registry.npmmirror.com/sass/-/sass-1.52.3.tgz",
|
"resolved": "https://registry.npmmirror.com/sass/-/sass-1.52.3.tgz",
|
||||||
"integrity": "sha512-LNNPJ9lafx+j1ArtA7GyEJm9eawXN8KlA1+5dF6IZyoONg1Tyo/g+muOsENWJH/2Q1FHbbV4UwliU0cXMa/VIA==",
|
"integrity": "sha512-LNNPJ9lafx+j1ArtA7GyEJm9eawXN8KlA1+5dF6IZyoONg1Tyo/g+muOsENWJH/2Q1FHbbV4UwliU0cXMa/VIA==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chokidar": ">=3.0.0 <4.0.0",
|
"chokidar": ">=3.0.0 <4.0.0",
|
||||||
"immutable": "^4.0.0",
|
"immutable": "^4.0.0",
|
||||||
@ -8984,7 +8984,7 @@
|
|||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmmirror.com/immutable/-/immutable-4.1.0.tgz",
|
"resolved": "https://registry.npmmirror.com/immutable/-/immutable-4.1.0.tgz",
|
||||||
"integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==",
|
"integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==",
|
||||||
"dev": true
|
"devOptional": true
|
||||||
},
|
},
|
||||||
"import-fresh": {
|
"import-fresh": {
|
||||||
"version": "3.3.0",
|
"version": "3.3.0",
|
||||||
@ -9816,7 +9816,7 @@
|
|||||||
"version": "1.52.3",
|
"version": "1.52.3",
|
||||||
"resolved": "https://registry.npmmirror.com/sass/-/sass-1.52.3.tgz",
|
"resolved": "https://registry.npmmirror.com/sass/-/sass-1.52.3.tgz",
|
||||||
"integrity": "sha512-LNNPJ9lafx+j1ArtA7GyEJm9eawXN8KlA1+5dF6IZyoONg1Tyo/g+muOsENWJH/2Q1FHbbV4UwliU0cXMa/VIA==",
|
"integrity": "sha512-LNNPJ9lafx+j1ArtA7GyEJm9eawXN8KlA1+5dF6IZyoONg1Tyo/g+muOsENWJH/2Q1FHbbV4UwliU0cXMa/VIA==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"chokidar": ">=3.0.0 <4.0.0",
|
"chokidar": ">=3.0.0 <4.0.0",
|
||||||
"immutable": "^4.0.0",
|
"immutable": "^4.0.0",
|
||||||
|
|||||||
10
src/App.vue
10
src/App.vue
@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
||||||
import { getUser } from '@/api/login/login'
|
import { getUser, getUserInfo } from '@/api/login/login'
|
||||||
import { useUserInfo } from '@/stores/userInfo'
|
import { useUserInfo } from '@/stores/userInfo'
|
||||||
const store = useUserInfo()
|
const store = useUserInfo()
|
||||||
|
|
||||||
@ -11,12 +11,16 @@ function weChatLogin(code?) {
|
|||||||
}
|
}
|
||||||
store.weChatMessage = data
|
store.weChatMessage = data
|
||||||
getUser(data).then((res) => {
|
getUser(data).then((res) => {
|
||||||
console.log('res', res)
|
|
||||||
uni.setStorageSync('token', res.Result_Data.WeChat_MiniProToken)
|
uni.setStorageSync('token', res.Result_Data.WeChat_MiniProToken)
|
||||||
store.token = res.Result_Data.WeChat_MiniProToken
|
store.token = res.Result_Data.WeChat_MiniProToken
|
||||||
if (res.Result_Code === 100) {
|
if (res.Result_Code === 100) {
|
||||||
let user = res.Result_Data
|
let user = res.Result_Data
|
||||||
if (user.Membership_Id) {
|
if (user.Membership_Id) {
|
||||||
|
let data = {
|
||||||
|
Membership_Id: user.Membership_Id,
|
||||||
|
WeChat_AppId: 'wx4fb5da2b8d9e0e43',
|
||||||
|
}
|
||||||
|
getUserInfo(data)
|
||||||
} else {
|
} else {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '温馨提示',
|
title: '温馨提示',
|
||||||
@ -38,8 +42,6 @@ onLaunch(() => {
|
|||||||
} else {
|
} else {
|
||||||
uni.login({
|
uni.login({
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log('res', res)
|
|
||||||
|
|
||||||
weChatLogin(res.code)
|
weChatLogin(res.code)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,4 +1,10 @@
|
|||||||
import request from '@/utils/requestMethod'
|
import request from '@/utils/requestMethod'
|
||||||
|
|
||||||
//营收数据
|
//营收数据
|
||||||
export const getRevenueData = (data) => request.post(`CommercialApi/Revenue/GetRevenuePushList`, data)
|
export const getRevenueData = (data) => request.get(`/CommercialApi/Revenue/GetRevenuePushList`, data)
|
||||||
|
|
||||||
|
// 在营门店数量统计
|
||||||
|
export const getOnLineStore = (data) => request.get('/CommercialApi/BaseInfo/GetShopCountList', data)
|
||||||
|
|
||||||
|
// 业态关系
|
||||||
|
export const getBusinessRelation = (data) => request.get('/CommercialApi/BaseInfo/GetBusinessTradeList')
|
||||||
|
|||||||
@ -27,3 +27,10 @@ export const getPhoneEmpower = (data: any) =>
|
|||||||
`/Coop.Merchant/Handler/handler_ajax.ashx?action_type=WeChat_BusinessPhone&provinceCode=340000&time=&memberShipId=&SourcePlatform=minProgram&brand=devtools&model=&os_version=&APPGuid=1b56719e-aff9-44df-84e8-193680241c0b`,
|
`/Coop.Merchant/Handler/handler_ajax.ashx?action_type=WeChat_BusinessPhone&provinceCode=340000&time=&memberShipId=&SourcePlatform=minProgram&brand=devtools&model=&os_version=&APPGuid=1b56719e-aff9-44df-84e8-193680241c0b`,
|
||||||
data
|
data
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//获取用户信息
|
||||||
|
export const getUserInfo = (data: any) =>
|
||||||
|
request.get(
|
||||||
|
`/Coop.Merchant/Handler/handler_ajax.ashx?action_type=WeChat_GetBusinessMemberInfo&provinceCode=340000&time=&memberShipId=&SourcePlatform=minProgram&brand=devtools&model=&os_version=&APPGuid=1b56719e-aff9-44df-84e8-193680241c0b`,
|
||||||
|
data
|
||||||
|
)
|
||||||
|
|||||||
65
src/pages/index/getInfo.ts
Normal file
65
src/pages/index/getInfo.ts
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
import { getRevenueData } from '@/api/index'
|
||||||
|
import { handleYesterday } from '@/utils/dateTime/index'
|
||||||
|
|
||||||
|
// ticketCount: number // 客单数量 ,
|
||||||
|
// totalCount: number// 总数量 ,
|
||||||
|
// totalOffAmount: number// 优惠金额 ,
|
||||||
|
// mobilePayment: number// 移动支付金额 ,
|
||||||
|
// cashPay: number// 实收金额 ,
|
||||||
|
// different_Price_Less: number// 短款金额 ,
|
||||||
|
// different_Price_More: number// 长款金额 ,
|
||||||
|
|
||||||
|
interface allDateType {
|
||||||
|
headMsg: {
|
||||||
|
compared?: string
|
||||||
|
sumPay: number
|
||||||
|
TicketCount?: number
|
||||||
|
average?: number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export async function getInfo(params) {
|
||||||
|
//传入的参数
|
||||||
|
console.log(params)
|
||||||
|
const yesterday = handleYesterday(params.Statistics_Date)
|
||||||
|
const yesterdayData = {
|
||||||
|
pushProvinceCode: '340000',
|
||||||
|
Statistics_Date: yesterday,
|
||||||
|
}
|
||||||
|
//要输出的值
|
||||||
|
const allData: allDateType = {
|
||||||
|
headMsg: {
|
||||||
|
sumPay: 0,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
//获取营收数据
|
||||||
|
const todayRevenue = await getRevenueData(params)
|
||||||
|
|
||||||
|
//获取昨日营收数据
|
||||||
|
const yesterdayRevenue = await getRevenueData(yesterdayData)
|
||||||
|
allData.headMsg = getTotalReven(todayRevenue.Result_Data.List)
|
||||||
|
//昨日营收总额
|
||||||
|
const yesterdaySumPay = getTotalReven(yesterdayRevenue.Result_Data.List)
|
||||||
|
allData.headMsg.compared = (
|
||||||
|
((allData.headMsg.sumPay - yesterdaySumPay.sumPay) / yesterdaySumPay.sumPay) *
|
||||||
|
100
|
||||||
|
).toFixed(2)
|
||||||
|
return allData
|
||||||
|
}
|
||||||
|
|
||||||
|
//计算总的对客营收
|
||||||
|
function getTotalReven(list) {
|
||||||
|
const data = {
|
||||||
|
sumPay: 0,
|
||||||
|
TicketCount: 0,
|
||||||
|
average: 0,
|
||||||
|
}
|
||||||
|
list.forEach((item) => {
|
||||||
|
data.sumPay += item.CashPay
|
||||||
|
data.TicketCount += item.TicketCount
|
||||||
|
})
|
||||||
|
data.average = Number((data.sumPay / data.TicketCount).toFixed(2))
|
||||||
|
data.sumPay = Number(data.sumPay.toFixed(2))
|
||||||
|
console.log('data', data)
|
||||||
|
|
||||||
|
return data
|
||||||
|
}
|
||||||
@ -15,24 +15,39 @@
|
|||||||
<view class="other">
|
<view class="other">
|
||||||
<p class="title">对客营收<span class="text">(门店上传 818/825)</span></p>
|
<p class="title">对客营收<span class="text">(门店上传 818/825)</span></p>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<p class="allPrice">2,236,814.39</p>
|
<p class="allPrice">{{ data.headMsg.sumPay }}</p>
|
||||||
<image class="start" src="https://ahyd.eshangtech.com/UploadImageDir/ahyd_DIB/index/start.svg"></image>
|
<image class="start" src="https://ahyd.eshangtech.com/UploadImageDir/ahyd_DIB/index/start.svg"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="addBox">
|
<view class="addBox">
|
||||||
<image class="arrowTop" src="/static/images/index/arrow_top.svg"></image>
|
<image
|
||||||
<text class="text">+0.24%</text>
|
class="arrowTop"
|
||||||
|
:src="
|
||||||
|
Number(data.headMsg.compared) > 0
|
||||||
|
? '/static/images/index/arrow_top.svg'
|
||||||
|
: '/static/images/index/arrow_reduce.svg'
|
||||||
|
"
|
||||||
|
></image>
|
||||||
|
<text class="text">{{ data.headMsg.compared ? data.headMsg.compared + '%' : '' }}</text>
|
||||||
<text class="compare">(相比昨日)</text>
|
<text class="compare">(相比昨日)</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="type">
|
<view class="type">
|
||||||
<view v-for="(item, index) in typeList" :key="index" class="item">
|
<view class="item">
|
||||||
<view class="leftImg">
|
<view class="leftImg">
|
||||||
<image :src="item.url"></image>
|
<image src="/static/images/index/business.svg"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<p class="typeName">
|
<p class="typeName">客单交易<text class="unit">/笔</text></p>
|
||||||
{{ item.typeName }}<text class="unit">{{ item.unit }}</text>
|
<p class="price">{{ data.headMsg.TicketCount }}</p>
|
||||||
</p>
|
</view>
|
||||||
<p class="price">{{ item.price }}</p>
|
</view>
|
||||||
|
|
||||||
|
<view class="item">
|
||||||
|
<view class="leftImg">
|
||||||
|
<image src="/static/images/index/average.svg"></image>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<p class="typeName">客单均价<text class="unit">/元</text></p>
|
||||||
|
<p class="price">{{ data.headMsg.average }}</p>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -72,15 +87,17 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import Tabbar from '@/component/tabbar.vue'
|
import Tabbar from '@/component/tabbar.vue'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import { ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
import { capsuleBtn, type, detail, params } from '@/pages/user/userType'
|
import { capsuleBtn, type, detail, params } from '@/pages/user/userType'
|
||||||
import { timestampToTime, getThisDay } from '@/utils/dateTime'
|
import { timestampToTime, getThisDay, getYesterday } from '@/utils/dateTime'
|
||||||
import TabType from '@/pages/index/component/tabType.vue'
|
import TabType from '@/pages/index/component/tabType.vue'
|
||||||
import DetailType from '@/pages/index/component/detailType.vue'
|
import DetailType from '@/pages/index/component/detailType.vue'
|
||||||
import PropOfReven from '@/pages/index/component/propOfReven.vue'
|
import PropOfReven from '@/pages/index/component/propOfReven.vue'
|
||||||
import ThisMonth from '@/pages/index/component/thisMonth.vue'
|
import ThisMonth from '@/pages/index/component/thisMonth.vue'
|
||||||
import Notice from '@/pages/index/component/notice.vue'
|
import Notice from '@/pages/index/component/notice.vue'
|
||||||
import { useUserInfo } from '@/stores/userInfo'
|
import { useUserInfo } from '@/stores/userInfo'
|
||||||
|
import { fmoney } from '@/utils/dateTime/utils'
|
||||||
|
import { getInfo } from './getInfo'
|
||||||
|
|
||||||
const page = '/pages/index/index'
|
const page = '/pages/index/index'
|
||||||
const statusBarHeight = ref<number>(0)
|
const statusBarHeight = ref<number>(0)
|
||||||
@ -95,10 +112,11 @@ const menu = ref<capsuleBtn>({
|
|||||||
const store = useUserInfo()
|
const store = useUserInfo()
|
||||||
const single = ref(timestampToTime(new Date().getTime()))
|
const single = ref(timestampToTime(new Date().getTime()))
|
||||||
const thisDay = ref<string>('')
|
const thisDay = ref<string>('')
|
||||||
const typeList = ref<type[]>([
|
const yesterday = ref<string>('')
|
||||||
{ url: '/static/images/index/business.svg', typeName: '客单交易', unit: '/笔', price: 0 },
|
const data = ref({
|
||||||
{ url: '/static/images/index/average.svg', typeName: '客单均价', unit: '/元', price: 0 },
|
headMsg: {},
|
||||||
])
|
})
|
||||||
|
|
||||||
const detailList = ref<detail[]>([
|
const detailList = ref<detail[]>([
|
||||||
{ name: '长款金额', unit: '/元', price: 0 },
|
{ name: '长款金额', unit: '/元', price: 0 },
|
||||||
{ name: '短款金额', unit: '/元', price: 0 },
|
{ name: '短款金额', unit: '/元', price: 0 },
|
||||||
@ -112,14 +130,11 @@ const detailList = ref<detail[]>([
|
|||||||
])
|
])
|
||||||
|
|
||||||
const requestParams = ref<params>({
|
const requestParams = ref<params>({
|
||||||
pushProvinceCode: '',
|
pushProvinceCode: '340000',
|
||||||
Statistics_Date: '',
|
Statistics_Date: yesterday.value,
|
||||||
Serverpart_ID: 0,
|
|
||||||
SPRegionType_ID: 0,
|
|
||||||
Revenue_Include: 1,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(async () => {
|
||||||
// 拿到手机参数
|
// 拿到手机参数
|
||||||
let systemInfo = uni.getSystemInfoSync()
|
let systemInfo = uni.getSystemInfoSync()
|
||||||
statusBarHeight.value = Number(systemInfo.statusBarHeight)
|
statusBarHeight.value = Number(systemInfo.statusBarHeight)
|
||||||
@ -127,12 +142,15 @@ onLoad(() => {
|
|||||||
// 转化时间格式
|
// 转化时间格式
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
thisDay.value = getThisDay(date.getDay()) as string
|
thisDay.value = getThisDay(date.getDay()) as string
|
||||||
console.log('123', store.$state.userData)
|
//拿到昨天的时间
|
||||||
|
requestParams.value.Statistics_Date = getYesterday()
|
||||||
|
data.value = await getInfo(requestParams.value)
|
||||||
|
data.value.headMsg.sumPay = fmoney(data.value.headMsg.sumPay, 2)
|
||||||
|
console.log('index', data.value)
|
||||||
})
|
})
|
||||||
|
|
||||||
//展示日历
|
//展示日历
|
||||||
function bindDateChange(e) {
|
function bindDateChange(e) {
|
||||||
console.log(e.detail.value)
|
|
||||||
const date = new Date(e.detail.value).getTime()
|
const date = new Date(e.detail.value).getTime()
|
||||||
single.value = timestampToTime(date)
|
single.value = timestampToTime(date)
|
||||||
thisDay.value = getThisDay(new Date(e.detail.value).getDay()) as string
|
thisDay.value = getThisDay(new Date(e.detail.value).getDay()) as string
|
||||||
@ -236,7 +254,7 @@ $iphoneHeight: env(safe-area-inset-bottom);
|
|||||||
.arrowTop {
|
.arrowTop {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
margin-right: 8px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
.text {
|
.text {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
@ -261,6 +279,7 @@ $iphoneHeight: env(safe-area-inset-bottom);
|
|||||||
.item {
|
.item {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
float: left;
|
float: left;
|
||||||
.leftImg {
|
.leftImg {
|
||||||
width: 36px;
|
width: 36px;
|
||||||
|
|||||||
@ -39,7 +39,7 @@ export interface detail {
|
|||||||
export interface params {
|
export interface params {
|
||||||
pushProvinceCode: string //推送省份
|
pushProvinceCode: string //推送省份
|
||||||
Statistics_Date: string //统计日期
|
Statistics_Date: string //统计日期
|
||||||
Serverpart_ID: number //服务区内码
|
Serverpart_ID?: number //服务区内码
|
||||||
SPRegionType_ID: number //区域内码
|
SPRegionType_ID?: number //区域内码
|
||||||
Revenue_Include: number //是否纳入营收【每日营收推送中是否展示该门店的营收数据】(0:否;1:是)
|
Revenue_Include?: number //是否纳入营收【每日营收推送中是否展示该门店的营收数据】(0:否;1:是)
|
||||||
}
|
}
|
||||||
|
|||||||
16
src/static/images/index/arrow_reduce.svg
Normal file
16
src/static/images/index/arrow_reduce.svg
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>首页图标/本月计划备份_15@2x</title>
|
||||||
|
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="驿达小程序-首页0311" transform="translate(-199.000000, -2140.000000)">
|
||||||
|
<g id="编组-10" transform="translate(199.000000, 2140.000000)">
|
||||||
|
<circle id="椭圆形" fill="#FFFFFF" opacity="0.699999988" cx="7" cy="7" r="7"></circle>
|
||||||
|
<g id="编组-9" transform="translate(7.000000, 7.000000) scale(1, -1) translate(-7.000000, -7.000000) translate(4.000000, 3.000000)" fill="#07C160">
|
||||||
|
<rect id="矩形" x="2.56066017" y="1.06066017" width="1" height="6" rx="0.5"></rect>
|
||||||
|
<rect id="矩形备份-6" transform="translate(4.121320, 2.000000) rotate(-225.000000) translate(-4.121320, -2.000000) " x="3.62132034" y="0" width="1" height="4" rx="0.5"></rect>
|
||||||
|
<rect id="矩形" transform="translate(2.000000, 2.000000) rotate(-225.000000) translate(-2.000000, -2.000000) " x="0" y="1.5" width="4" height="1" rx="0.5"></rect>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.3 KiB |
@ -27,3 +27,20 @@ export function getThisDay(value: number) {
|
|||||||
return '星期日'
|
return '星期日'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getYesterday() {
|
||||||
|
const date = new Date()
|
||||||
|
const y = date.getFullYear()
|
||||||
|
const m = date.getMonth() + 1
|
||||||
|
const d = date.getDate()
|
||||||
|
return `${y}-${m}-${d - 1}`
|
||||||
|
}
|
||||||
|
|
||||||
|
//传入时间 拿到昨天的时间
|
||||||
|
export function handleYesterday(value: string) {
|
||||||
|
const date = new Date(value)
|
||||||
|
const y = date.getFullYear()
|
||||||
|
const m = date.getMonth() + 1
|
||||||
|
const d = date.getDate() - 1
|
||||||
|
return `${y}-${m}-${d}`
|
||||||
|
}
|
||||||
|
|||||||
22
src/utils/dateTime/utils.ts
Normal file
22
src/utils/dateTime/utils.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
export function fmoney(s, n) {
|
||||||
|
console.log(s, n)
|
||||||
|
/*
|
||||||
|
* 参数说明:
|
||||||
|
* s:要格式化的数字
|
||||||
|
* n:保留几位小数
|
||||||
|
* */
|
||||||
|
n = n > 0 && n <= 20 ? n : 2
|
||||||
|
let fuhao = '' //如果数字小于零则值为-
|
||||||
|
if (s < 0) {
|
||||||
|
s = Math.abs(s)
|
||||||
|
fuhao = '-'
|
||||||
|
}
|
||||||
|
s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(n) + ''
|
||||||
|
const l = s.split('.')[0].split('').reverse(),
|
||||||
|
r = s.split('.')[1]
|
||||||
|
let t = ''
|
||||||
|
for (let i = 0; i < l.length; i++) {
|
||||||
|
t += l[i] + ((i + 1) % 3 == 0 && i + 1 != l.length ? ',' : '')
|
||||||
|
}
|
||||||
|
return fuhao + [...t].reverse().join('') + '.' + r
|
||||||
|
}
|
||||||
@ -73,7 +73,6 @@ const baseRequest = <T>(config: baseConfig) => {
|
|||||||
config.url = url
|
config.url = url
|
||||||
}
|
}
|
||||||
const Url = import.meta.env.VITE_API_URL as string
|
const Url = import.meta.env.VITE_API_URL as string
|
||||||
console.log(Url)
|
|
||||||
const token = uni.getStorageSync('token')
|
const token = uni.getStorageSync('token')
|
||||||
if (config.header) {
|
if (config.header) {
|
||||||
config.header.Authorization = 'Bearer ' + token
|
config.header.Authorization = 'Bearer ' + token
|
||||||
@ -94,7 +93,6 @@ const baseRequest = <T>(config: baseConfig) => {
|
|||||||
header: config.header,
|
header: config.header,
|
||||||
data: config.data || {},
|
data: config.data || {},
|
||||||
success: (res: any) => {
|
success: (res: any) => {
|
||||||
console.log('res', res)
|
|
||||||
if (!config.showLoading) {
|
if (!config.showLoading) {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user