This commit is contained in:
zmj 2023-12-18 18:49:23 +08:00
parent 453cd5822f
commit f4c2333170
9 changed files with 133 additions and 54 deletions

View File

@ -189,6 +189,11 @@ export function merchant_product_visitApi(params) {
export function merchant_product_cartApi(params) {
return instacne.get('/api/dataview/merchant_product_cart', { params })
}
export function merchantApi(params) {
return instacne.get('/api/dataview/merchant', { params })
}
//
///api/dataview/merchant_product_cart?areaCode=510524&streetCode=510524100&mer_id=42&start_date=2023-01-01&end_date=2023-12-09
//api/dataview/merchant?mer_id=36&areaCode=510524&streetCode=510524100
// }

View File

@ -52,7 +52,7 @@
</div>
</div>
<div class="right">
<datePicker v-if="route.path != '/storeLogin'"></datePicker>
<datePicker></datePicker>
<div class="rigth-li" @click="choseAreaFn"> <img style="width: 1VW;height:1VW;margin-right: 0.5vw;"
:src="u('DW')" alt=""> {{ area }}
</div>
@ -129,11 +129,10 @@ watch(
(value, oldValue) => {
console.log(value,oldValue)
if (value == '/index') {
showFn(0)
area.value = '龙马潭区'
area.value = '泸县'
}
if (value == '/townDetail') {
showFn(0)

View File

@ -4,13 +4,11 @@ import dataV from '@jiaminghi/data-view'
import router from "./router";
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// import VueDatePicker from '@vuepic/vue-datepicker';
// import '@vuepic/vue-datepicker/dist/main.css'
import {
createPinia
} from 'pinia'
import 'element-plus/dist/index.css'
// import '@/components/townDetail/test.js'
import 'amfe-flexible'
const pinia = createPinia()

View File

@ -35,12 +35,9 @@ export const areaObj = defineStore('counter', {
this.store.mer_id = mer_id
}
},
storeLogin(obj) {
this.userInfo.user = obj
}
}

View File

@ -1,5 +1,10 @@
<template>
<div class="box">
<div v-if="showLogin" class="center">
<dv-loading>正在登陆商户...</dv-loading>
</div>
<div class="box" v-else>
<div class="img-cls">
<img src="/static/town/TABBG.png" style="width: 100%;height: 100%;position: absolute;" alt="">
<div class="content">
@ -21,8 +26,10 @@
// 102B3
import { ref, reactive, onMounted } from "vue"
import { useRouter } from 'vue-router'
import { merchant_listApi } from "@/api.js"
import { merchant_listApi, merchantApi } from "@/api.js"
import { areaObj } from '@/store/index.js'
import router from "../router";
const showLogin = ref(false)
const areaStore = areaObj()
const route = useRouter()
@ -36,6 +43,8 @@ const num = (n) => {
}
let baseData = {}
const changeTable = (num) => {
configs.data.splice(0, configs.data.length)
@ -47,6 +56,7 @@ const changeTable = (num) => {
limit: 50
}
).then(res => {
baseData = res.data.list
addConfigData(res.data.list)
})
@ -55,7 +65,18 @@ const changeTable = (num) => {
const hdClick = (e) => {
if (e.columnIndex == 10) {
route.replace('/storeLogin')
merchantApi(
{
mer_id: baseData[e.rowIndex].mer_id,
...areaStore.area
}
).then(res => {
areaStore.storeLogin(res.data)
router.push('/storeLogin')
console.log(areaStore.userInfo)
})
}
@ -73,7 +94,7 @@ const addConfigData = (data) => {
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #02243D;'>${item.is_best ? "推荐" : "不推荐"}</div>`,
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #02243D;'>${item.create_time}</div>`,
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #02243D;'>${item.margin}</div>`,
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #02243D;'>${item.merchantCategory?.category_name||'--'}</div>`,
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #02243D;'>${item.merchantCategory?.category_name || '--'}</div>`,
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #02243D;'>${item.status ? '开启' : '关闭'}</div>`,
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #02243D;color:#3D9EB5';cursor: pointer;>登录</div>`,
]
@ -89,7 +110,7 @@ const addConfigData = (data) => {
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #102B3E;'>${item.is_best ? "推荐" : "不推荐"}</div>`,
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #102B3E;'>${item.create_time}</div>`,
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #102B3E;'>${item.margin}</div>`,
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #102B3E;'>${item.merchantCategory?.category_name||'--'}</div>`,
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #102B3E;'>${item.merchantCategory?.category_name || '--'}</div>`,
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #102B3E;'>${item.status ? '开启' : '关闭'}</div>`,
`<div style='width: 100%;text-align: center; height: 100%; color: aliceblue; background: #102B3E;color:#3D9EB5; cursor: pointer;'>登录</div>`,
]
@ -210,6 +231,11 @@ onMounted(() => {
.row {}
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
}
</style>

View File

@ -1,5 +1,9 @@
<template>
<div class="box" :style="{ opacity: loading ? 0 : 1 }">
<div v-if="showLoading" class="center">
<dv-loading>Loading...</dv-loading>
</div>
<div class="box" :style="{ opacity: showLoading ? 0 : 1 }">
<div class="body">
<div class="l">
<topLeft :areaCodes="areaCodes" />
@ -36,11 +40,19 @@ import bottomRight from "@/components/index/bottomRight.vue"
import { areaObj } from '@/store/index.js'
import { useRouter } from "vue-router"
const router = useRouter()
const showLoading = ref(true)
const areaStore = areaObj()
const areaCodes = reactive({
...areaStore.area
})
const loading = ref(false)
setTimeout(() => {
showLoading.value = false
}, 1000);
</script>
<style lang="scss">
@keyframes jump {
@ -118,4 +130,12 @@ const loading = ref(false)
position: relative;
}
}
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
}
</style>

View File

@ -94,7 +94,7 @@ const submit = () => {
if (res.data.user.street_code) {
role.value =3
role.value = 3
res.data.role = role.value
localStorage.setItem("TRADE_USER", JSON.stringify(res.data))

View File

@ -149,13 +149,29 @@
<script setup>
import { ref, reactive, onMounted } from "vue"
import { merchant_count_mainApi, merchant_product_rankingApi, merchant_product_visitApi, merchant_product_cartApi } from "@/api.js"
import { merchant_count_mainApi, merchant_product_rankingApi, merchant_product_visitApi, merchant_product_cartApi, } from "@/api.js"
import { areaObj } from "../store";
const areaStore = areaObj()
let query
let userInfo = JSON.parse(localStorage.getItem('TRADE_USER'))
// console.log
if (areaStore.userInfo.user?.merchant) {
let { area_id, mer_id, street_id } = areaStore.userInfo.user?.merchant
console.log(area_id, 5645545)
query = {
areaCode: area_id,
streetCode: street_id,
mer_id: mer_id
}
}
if (userInfo.user?.merchant) {
let { area_id, mer_id, street_id } = userInfo.user.merchant
console.log(area_id, 5645545)
@ -234,14 +250,14 @@ let total1 = ''
let total2 = ''
let total3 = ''
merchant_product_rankingApi(
{ ...query, start_date: '2023-12-01', end_date: '2023-12-09' }
{ ...query, start_date: '2020-12-18', end_date: '2023-12-18' }
).then(res => {
total1 = res.data.totalCount
addData1(res.data.list)
})
merchant_product_visitApi(
{ ...query, start_date: '2023-12-01', end_date: '2023-12-09' }
{ ...query, start_date: '2020-12-18', end_date: '2023-12-18' }
).then(res => {
total2 = res.data.totalCount
@ -249,7 +265,7 @@ merchant_product_visitApi(
})
merchant_product_cartApi(
{ ...query, start_date: '2023-01-01', end_date: '2023-12-09' }
{ ...query, start_date: '2020-01-01', end_date: '2023-12-18' }
).then(res => {
total3 = res.data.totalCount
addData3(res.data.list)

View File

@ -1,4 +1,11 @@
<template>
<div v-if="show" class="center">
<dv-loading>Loading...</dv-loading>
</div>
<div :style="{ opacity: show ? 0 : 1 }">
<div class="top box">
<div class="l">
<topLeft :code="route.query.code"></topLeft>
@ -25,6 +32,7 @@
</div>
</div>
</div>
</template>
<script setup>
import { onMounted } from 'vue';
@ -35,9 +43,9 @@ import { useRoute } from 'vue-router';
import topCenter from "@/components/townDetail/topCenter.vue"
import topLeft from "@/components/townDetail/topLeft.vue"
import topRight from "@/components/townDetail/topRight.vue"
import { ref } from 'vue'
const show = ref(true)
const route = useRoute()
@ -45,7 +53,9 @@ const route = useRoute()
onMounted(() => {
setTimeout(() => {
show.value = false
}, 1000)
})
@ -160,4 +170,12 @@ onMounted(() => {
background: linear-gradient(to right, #455CCC, #51C2E0);
transition: width 0.5s ease-in-out;
}
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
}
</style>