diff --git a/src/App.vue b/src/App.vue index df93535..f01dedd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,12 +6,31 @@ const areaStroe = areaObj() if (localStorage.getItem("TRADE_USER")) { - let userInfo = JSON.parse(localStorage.getItem('TRADE_USER')) - areaStroe.changeUserInfo(userInfo) - let { area_code, street_code } = userInfo.user - areaStroe.changeArea({ areaCode: area_code, streetCode: street_code }) + let userInfo = JSON.parse(localStorage.getItem('TRADE_USER')) + areaStroe.changeUserInfo(userInfo) + let { area_code, street_code } = userInfo.user + areaStroe.changeArea({ areaCode: area_code, streetCode: street_code }) } +else { + localStorage.setItem('TRADE_USER', JSON.stringify({ + "user": { + "id": 8, + "account_type": 2, + "area_code": "510524", + "street_code": "510524100", + "account": "叙永镇", + "password": "3f4087bd6bdff7b6a3719ecc165c1a0d" + }, + "token": "345d45fcd348ff02a69137999df2bbd8", + "expire": 1718782774, + "role": 3 + })) + let userInfo = JSON.parse(localStorage.getItem('TRADE_USER')) + areaStroe.changeUserInfo(userInfo) + let { area_code, street_code } = userInfo.user + areaStroe.changeArea({ areaCode: area_code, streetCode: street_code }) +} @@ -29,9 +48,9 @@ if (localStorage.getItem("TRADE_USER")) { @@ -40,14 +59,14 @@ if (localStorage.getItem("TRADE_USER")) { @import '/static/font/font.css'; * { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } .main-box { - width: 100vw; - height: 100vh; - background-color: #000C14; - overflow: hidden; + width: 100vw; + height: 100vh; + background-color: #000C14; + overflow: hidden; } \ No newline at end of file diff --git a/src/api.js b/src/api.js index 4b00184..ba94c72 100644 --- a/src/api.js +++ b/src/api.js @@ -8,7 +8,8 @@ let expire = localStorage.getItem("TRADE_USER") ? JSON.parse(localStorage.getIte // 创建axios 实例 const instacne = axios.create({ - baseURL: "https://shop.lihaink.cn/", + baseURL: "http://192.168.1.22:8545", + // baseURL: "https://shop.lihaink.cn/", timeout: 30000, }); @@ -44,7 +45,7 @@ instacne.interceptors.request.use( instacne.interceptors.response.use( (res) => { - if (res.data.status != 200) { + if (res.data.code != 1) { ElMessage({ message: res.data.message, type: 'warning', @@ -64,7 +65,7 @@ instacne.interceptors.response.use( export function getUserNumApi(params) { - return instacne.get('/api/dataview/user_merchat_count', { params }) + return instacne.get('/statistics/user', { params }) } @@ -72,7 +73,7 @@ export function getOrderNumApi(params) { return instacne.get('/api/dataview/order_statistics', { params }) } export function getSalesRankApi(params) { - return instacne.get('/api/dataview/sales_ranking', { params }) + return instacne.get('/statistics/sales_ranking', { params }) } @@ -82,15 +83,15 @@ export function getTodayOrderAmountApi(params) { export function getProductCountApi(params) { - return instacne.get('/api/dataview/product_count', { params }) + return instacne.get('/statistics/product_count', { params }) } export function getViewCountApi(params) { - return instacne.get('/api/dataview/view_count', { params }) + return instacne.get('/statistics/index', { params }) } export function getUserTradeCountApi(params) { - return instacne.get('/api/dataview/user_trade_count', { params }) + return instacne.get('/statistics/user_trade_count', { params }) } export function getProductCategoryListApi(params) { @@ -158,7 +159,7 @@ export function withdraw_listApi(params) { } export function street_currday_order_countApi(params) { - return instacne.get('/api/dataview/street_currday_order_count', { params }) + return instacne.get('/statistics/street_currday_order_count', { params }) } export function loginApi(params) { return instacne.post('/api/dataview/login', params) @@ -173,7 +174,7 @@ export function merchant_count_mainApi(params) { return instacne.get('/api/dataview/merchant_count_main', { params }) } export function order_user_num_countApi(params) { - return instacne.get('/api/dataview/order_user_num_count', { params }) + return instacne.get('/statistics/order_user_num_count', { params }) } export function merchant_product_rankingApi(params) { diff --git a/src/components/Remake.vue b/src/components/Remake.vue index fe1359d..fb289c9 100644 --- a/src/components/Remake.vue +++ b/src/components/Remake.vue @@ -22,11 +22,16 @@ export default { } }, mounted() { - setTimeout(() => { - this.toOrderNum(this.num) // 这里输入数字即可调用 - }, 500); + // setTimeout(() => { + // this.toOrderNum(this.num) // 这里输入数字即可调用 + // }, 500); }, + watch:{ + num(n,o){ + this.toOrderNum(this.num) // 这里输入数字即可调用 + } + }, methods: { // 设置文字滚动 setNumberTransform() { diff --git a/src/components/header.vue b/src/components/header.vue index 7d4e37b..4b402df 100644 --- a/src/components/header.vue +++ b/src/components/header.vue @@ -2,7 +2,7 @@
-
+
{ - res.data.userTradeCountList.forEach(item => { + res.data.forEach(item => { transactionUsersTown.xAxis[0] transactionUsersTown.xAxis[0].data.push(item.date.slice(5, item.date.length)) transactionUsersTown.series[0].data.push(item.visitUser) - transactionUsersTown.series[1].data.push(item.orderUser) + transactionUsersTown.series[1].data.push(item.orderUser ) transactionUsersTown.series[2].data.push(item.payOrderUser) }) initCharts('transactionUsers', transactionUsersTown) @@ -28,7 +28,7 @@ const initCharts = (tag, option) => { } const transactionUsersTown = { - color: ['#015989', '#583936', '#416979'], + color: ['#4B5FDB', '#583936', '#10C1CE'], title: { text: '' }, @@ -45,8 +45,12 @@ const transactionUsersTown = { data: ['访客人数', '下单人数', '支付人数',], textStyle: { color: "white" - } - + }, + icon: 'cricle', + itemWidth: 10, + itemHeight: 10, + itemGap: 10, + top: '2%' }, grid: { @@ -83,7 +87,6 @@ const transactionUsersTown = { { name: '访客人数', type: 'line', - stack: 'Total', smooth: true, lineStyle: { width: 0 @@ -94,11 +97,11 @@ const transactionUsersTown = { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, - color: '#18394A' + color: '#4B5FDB' }, { offset: 1, - color: '#2885A4' + color: '#5A649D' } ]) }, @@ -110,7 +113,6 @@ const transactionUsersTown = { { name: '下单人数', type: 'line', - stack: 'Total', smooth: true, lineStyle: { width: 0 @@ -121,11 +123,11 @@ const transactionUsersTown = { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, - color: '#2752A6' + color: '#583936' }, { offset: 1, - color: '#005886' + color: '#8b7042' } ]) }, @@ -137,7 +139,6 @@ const transactionUsersTown = { { name: '支付人数', type: 'line', - stack: 'Total', smooth: true, lineStyle: { width: 0 @@ -148,11 +149,11 @@ const transactionUsersTown = { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, - color: '#005685' + color: '#10C1CE' }, { offset: 1, - color: '#355969' + color: '#0294E0' } ]) }, diff --git a/src/components/townDetail/bottomRight.vue b/src/components/townDetail/bottomRight.vue index e901a0c..68f362e 100644 --- a/src/components/townDetail/bottomRight.vue +++ b/src/components/townDetail/bottomRight.vue @@ -1,10 +1,10 @@ @@ -145,7 +146,8 @@ const data = reactive( const viewData = reactive({ lastWeekRate: -0, today: 0, - yesterday: 7 + yesterday: 7, + dayPayPrice: 0 }) getProductCountApi({ diff --git a/src/components/townDetail/topLeft.vue b/src/components/townDetail/topLeft.vue index cf3e0ff..4336a94 100644 --- a/src/components/townDetail/topLeft.vue +++ b/src/components/townDetail/topLeft.vue @@ -39,7 +39,7 @@ getUserNumApi({ }).then(res => { - res.data.userCountlist.forEach(item => { + res.data.forEach(item => { userChartOption.series[0].data.push(item.newUserCount) userChartOption.series[1].data.push(item.viewUserCount) userChartOption.series[2].data.push(item.totalUserCount) @@ -122,7 +122,7 @@ const userChartOption = { ], series: [ { - name: '新增用户数量', + name: '新增会员数量', type: 'bar', emphasis: { focus: 'series' @@ -150,7 +150,7 @@ const userChartOption = { }, }, { - name: '累计用户数量', + name: '累计会员数量', type: 'bar', emphasis: { focus: 'series' diff --git a/src/router/index.js b/src/router/index.js index bdebf6a..0386a70 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -64,18 +64,18 @@ const router = createRouter({ }) router.beforeEach(async (to, from, next) => { + // 全部放行 + // let token = localStorage.getItem("TRADE_USER") - let token = localStorage.getItem("TRADE_USER") + // if (to.name == "login" && token) { + // next("/") + // return + // } - if (to.name == "login" && token) { - next("/") - return - } - - if (to.name != "login" && !token) { - next("/login") //跳转 - return - } + // if (to.name != "login" && !token) { + // next("/login") //跳转 + // return + // } next() //放行 }) diff --git a/static/index/SSLL.png b/static/index/SSLL.png new file mode 100644 index 0000000..87bfab2 Binary files /dev/null and b/static/index/SSLL.png differ diff --git a/static/index/SSSK.jpg b/static/index/SSSK.jpg new file mode 100644 index 0000000..9936a46 Binary files /dev/null and b/static/index/SSSK.jpg differ