Commit ef7a2781 by 前端

commit

1 parent 561ebfdb
// 获取品牌年龄/性别/购车年限 // 获取企业客户总览数据
const overalldistribution = params => { const getEnterpriseOverview = params => {
return window.$HTTP.get('brand/overalldistribution', params) return window.$HTTP.get('enterpriseCustomer/getEnterpriseOverview', params)
} }
// 获取门店年龄/性别/购车年限 // 获取门店年龄/性别/购车年限
...@@ -8,6 +8,6 @@ const merchantOveralldistribution = params => { ...@@ -8,6 +8,6 @@ const merchantOveralldistribution = params => {
return window.$HTTP.get('merchant/overalldistribution', params) return window.$HTTP.get('merchant/overalldistribution', params)
} }
export default { export default {
overalldistribution, getEnterpriseOverview,
merchantOveralldistribution merchantOveralldistribution
} }
...@@ -19,7 +19,7 @@ class Request { ...@@ -19,7 +19,7 @@ class Request {
} }
if (method === 'GET') { if (method === 'GET') {
var paramsArray = [] var paramsArray = []
Object.keys(params.req).forEach(key => paramsArray.push('req.' + key + '=' + params.req[key])) params&&Object.keys(params.req).forEach(key => paramsArray.push('req.' + key + '=' + params.req[key]))
if (url.search(/\?/) === -1) { if (url.search(/\?/) === -1) {
url += '?' + paramsArray.join('&') url += '?' + paramsArray.join('&')
} else { } else {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="tabs flex box"> <div class="tabs flex box">
<div class="tab" v-for="item in tabs" :key="item.key"> <div class="tab" v-for="item in tabs" :key="item.key">
<div class="tab-title">{{ item.title }}</div> <div class="tab-title">{{ item.title }}</div>
<div class="tab-text text-linear">2,1744</div> <div class="tab-text text-linear">{{dataList[item.key]}}</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -13,41 +13,53 @@ export default { ...@@ -13,41 +13,53 @@ export default {
name: 'ViewTabs', name: 'ViewTabs',
data() { data() {
return { return {
dataList:{},
tabs: [ tabs: [
{ {
title: '总门店数', title: '总门店数',
key: 'wechat' key: 'totalNum'
}, },
{ {
title: '当年新增', title: '当年新增',
key: 'wechatGroup' key: 'incrNum'
}, },
{ {
title: '总门店数', title: '留存率',
key: 'applet' key: 'retention'
}, },
{ {
title: '总门店数', title: '单店产值',
key: 'publiccus' key: 'outputValue'
} }
] ]
} }
}, },
mounted() {}, created() {
methods: {} this.getEnterpriseOverview()
},
methods: {
getEnterpriseOverview() {
this.api.customer.getEnterpriseOverview().then(res => {
console.log(res)
if(res.code == 0){
this.dataList = res.data.dataList[0]
}
})
}
}
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.tabs { .tabs {
margin: 1.22vh 0 0.98vh 0; margin: 1.22vh 0 0.98vh 0;
padding:0 1.67vw; padding: 0 1.67vw;
height: 6.95vh; height: 6.95vh;
width:100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
justify-content: space-between; justify-content: space-between;
.tab { .tab {
margin:0.61vh 0; margin: 0.61vh 0;
.tab-title { .tab-title {
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: 12px;
......
...@@ -35,14 +35,13 @@ Vue.prototype.to = function (name, params) { ...@@ -35,14 +35,13 @@ Vue.prototype.to = function (name, params) {
Vue.config.productionTip = false Vue.config.productionTip = false
const isMock = ['prod','production'].includes(process.env.NODE_ENV) const isMock = ['prod','production'].includes(process.env.NODE_ENV)
console.log(isMock,'----------------')
fetchConfig(!isMock).then(res => { fetchConfig(!isMock).then(res => {
console.log(res)
// 从配置服务器获取动态配置 // 从配置服务器获取动态配置
// 设置 js中可以访问 $cdn // 设置 js中可以访问 $cdn
Vue.use(cfg) Vue.use(cfg)
// if (res.vconsole) new VConsole() // if (res.vconsole) new VConsole()
window.$HTTP = new Request(res.request) // window.$HTTP = new Request(res.request)
window.$HTTP = new Request()
Vue.prototype.api = api Vue.prototype.api = api
window.vm = new Vue({ window.vm = new Vue({
el: '#app', el: '#app',
......
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
this.isBrand = true this.isBrand = true
this.brandName = newVal.brand.name this.brandName = newVal.brand.name
} }
this.getClientData() // this.getClientData()
}, },
pieAction(data) { pieAction(data) {
this.brandList = [] this.brandList = []
......
...@@ -29,7 +29,7 @@ module.exports = { ...@@ -29,7 +29,7 @@ module.exports = {
}, },
proxy: { proxy: {
'/dev': { '/dev': {
target: 'http://192.168.1.152:8081', target: 'http://192.168.1.152:8080',
changeOrigin: true, changeOrigin: true,
ws: true, ws: true,
pathRewrite: { pathRewrite: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!