|
@@ -1,28 +1,47 @@
|
|
|
<template>
|
|
|
<view class="container clearfix">
|
|
|
- <view class="charts-navbar" id="topBar">
|
|
|
- <view
|
|
|
- class="nav-item tui-skeleton-fillet"
|
|
|
- v-for="(nav, index) in navBarList"
|
|
|
- :key="index"
|
|
|
- :class="{ current: tabCurrentIndex === nav.index }"
|
|
|
- @click="tabChange(nav.index)"
|
|
|
- >
|
|
|
- <text>{{ nav.name }}</text> <text class="line"></text>
|
|
|
+ <tui-skeleton
|
|
|
+ v-if="skeletonShow"
|
|
|
+ backgroundColor="#fafafa"
|
|
|
+ borderRadius="10rpx"
|
|
|
+ :isLoading="true"
|
|
|
+ :loadingType="5"
|
|
|
+ ></tui-skeleton>
|
|
|
+ <template v-else>
|
|
|
+<!-- <view class="charts-navbar" id="topBar">
|
|
|
+ <view
|
|
|
+ class="nav-item tui-skeleton-fillet"
|
|
|
+ v-for="(nav, index) in navBarList"
|
|
|
+ :key="index"
|
|
|
+ :class="{ current: tabCurrentIndex === nav.index }"
|
|
|
+ @click="tabChange(nav.index)"
|
|
|
+ >
|
|
|
+ <text>{{ nav.name }}</text> <text class="line"></text>
|
|
|
+ </view>
|
|
|
+ </view> -->
|
|
|
+ <view class="charts-content">
|
|
|
+ <!-- 重点资料 -->
|
|
|
+ <view class="charts-box charts-box0" id="charts-box0">
|
|
|
+ <echartInfo ref="echart-info" :clubInfo="clubInfo" :clubId="clubInfo.clubId" v-if="isRequest" />
|
|
|
+ </view>
|
|
|
+ <!-- 订单 -->
|
|
|
+ <view class="charts-box charts-box1" id="charts-box1">
|
|
|
+ <echartOrder ref="echartOrder" :clubId="clubInfo.clubId" v-if="isRequest" />
|
|
|
+ </view>
|
|
|
+ <!-- 关键词 -->
|
|
|
+ <view class="charts-box charts-box2" id="charts-box2">
|
|
|
+ <echartKeyword ref="echartKeyword" :clubId="clubInfo.clubId" v-if="isRequest" />
|
|
|
+ </view>
|
|
|
+ <!-- 咨询记录 -->
|
|
|
+ <view class="charts-box charts-box3" id="charts-box3">
|
|
|
+ <echartContact ref="echartContact" :clubId="clubInfo.clubId" v-if="isRequest" />
|
|
|
+ </view>
|
|
|
+ <!-- 访问记录 -->
|
|
|
+ <view class="charts-box charts-box4" id="charts-box4">
|
|
|
+ <echartService ref="echartService" :clubId="clubInfo.clubId" v-if="isRequest" />
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="charts-content">
|
|
|
- <!-- 重点资料 -->
|
|
|
- <view class="charts-box charts-box0" id="charts-box0"> <echartInfo ref="echart-info" /> </view>
|
|
|
- <!-- 订单 -->
|
|
|
- <view class="charts-box charts-box1" id="charts-box1"> <echartOrder ref="echart-order" /> </view>
|
|
|
- <!-- 关键词 -->
|
|
|
- <view class="charts-box charts-box2" id="charts-box2"> <echartKeyword ref="echart-keyword" /> </view>
|
|
|
- <!-- 咨询记录 -->
|
|
|
- <view class="charts-box charts-box3" id="charts-box3"> <echartContact ref="echart-contact" /> </view>
|
|
|
- <!-- 访问记录 -->
|
|
|
- <view class="charts-box charts-box4" id="charts-box4"> <echartService ref="echart-service" /> </view>
|
|
|
- </view>
|
|
|
+ </template>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -34,8 +53,10 @@ import echartOrder from './components/echart-order'
|
|
|
import echartKeyword from './components/echart-keyword'
|
|
|
import echartContact from './components/echart-contact'
|
|
|
import echartService from './components/echart-service'
|
|
|
+import chartMixin from './components/mixins/chart.mixin.js'
|
|
|
const observers = {}
|
|
|
export default {
|
|
|
+ mixins: [chartMixin],
|
|
|
components: {
|
|
|
echartInfo,
|
|
|
echartOrder,
|
|
@@ -45,6 +66,9 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ skeletonShow: true,
|
|
|
+ isRequest: false,
|
|
|
+ clubInfo: {},
|
|
|
navBarList: [
|
|
|
{ name: '重点资料', index: 0 },
|
|
|
{ name: '订单数据', index: 1 },
|
|
@@ -57,19 +81,30 @@ export default {
|
|
|
anchorStatus: [0, 0, 0, 0, 0] // 分别代表5个锚点区域的开关 0:关 1:开
|
|
|
}
|
|
|
},
|
|
|
- onLoad(option) {},
|
|
|
+ onLoad(option) {
|
|
|
+ this.getClubInfo(option.userId)
|
|
|
+ },
|
|
|
onReady() {
|
|
|
console.log('onReady')
|
|
|
- // if (!this.isRequest) {
|
|
|
- // this.getAnchorSection()
|
|
|
- // }
|
|
|
setTimeout(() => {
|
|
|
this.getAnchorSection()
|
|
|
}, 2000)
|
|
|
},
|
|
|
- filters: {},
|
|
|
- computed: {},
|
|
|
methods: {
|
|
|
+ getClubInfo(userId) {
|
|
|
+ //获取机构信息
|
|
|
+ this.UserService.OrganizationUpdateModifyInfo({ userId: userId })
|
|
|
+ .then(response => {
|
|
|
+ this.clubInfo = response.data.club
|
|
|
+ setTimeout(() => {
|
|
|
+ this.skeletonShow = false
|
|
|
+ this.isRequest = true
|
|
|
+ }, 1000)
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.log(error)
|
|
|
+ })
|
|
|
+ },
|
|
|
tabChange(index) {
|
|
|
this.tabCurrentIndex = index
|
|
|
this.scrollToAnchor()
|
|
@@ -77,28 +112,34 @@ export default {
|
|
|
// 获取锚点元素信息
|
|
|
getAnchorSection() {
|
|
|
const query = uni.createSelectorQuery().in(this)
|
|
|
- query.selectAll('.charts-box').boundingClientRect(data => {
|
|
|
- if (data.length > 0) {
|
|
|
- this.anchorList = data
|
|
|
- this.anchorList.forEach((dom, index) => {
|
|
|
- uni.createSelectorQuery().select('.charts-content').boundingClientRect(data => {
|
|
|
- //目标节点、也可以是最外层的父级节点
|
|
|
- uni.createSelectorQuery().select(`#${dom.id}`).boundingClientRect(res => {
|
|
|
- //dom
|
|
|
- dom.top = res.top - data.top + 5
|
|
|
- }).exec()
|
|
|
- }).exec()
|
|
|
- })
|
|
|
- console.log(this.anchorList)
|
|
|
- console.log('tabs is ready')
|
|
|
- // clearInterval(this.selectorTimer)
|
|
|
- this.observerAnchor(data)
|
|
|
- }
|
|
|
- }).exec()
|
|
|
+ query
|
|
|
+ .selectAll('.charts-box')
|
|
|
+ .boundingClientRect(data => {
|
|
|
+ if (data.length > 0) {
|
|
|
+ this.anchorList = data
|
|
|
+ this.anchorList.forEach((dom, index) => {
|
|
|
+ uni.createSelectorQuery()
|
|
|
+ .select('.charts-content')
|
|
|
+ .boundingClientRect(data => {
|
|
|
+ //目标节点、也可以是最外层的父级节点
|
|
|
+ uni.createSelectorQuery()
|
|
|
+ .select(`#${dom.id}`)
|
|
|
+ .boundingClientRect(res => {
|
|
|
+ //dom
|
|
|
+ dom.top = res.top - data.top + 8
|
|
|
+ })
|
|
|
+ .exec()
|
|
|
+ })
|
|
|
+ .exec()
|
|
|
+ })
|
|
|
+ console.log(this.anchorList)
|
|
|
+ this.observerAnchor(data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .exec()
|
|
|
},
|
|
|
// 滚动到锚点
|
|
|
scrollToAnchor() {
|
|
|
- // const selector = '#anchor' + (this.currentTab + 1)
|
|
|
let scrollTop = 0
|
|
|
const query = uni.createSelectorQuery().in(this)
|
|
|
if (this.tabCurrentIndex > 0) {
|
|
@@ -123,12 +164,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
- },
|
|
|
- // 设置currentTab
|
|
|
- setCurrentTab: debounce(function() {
|
|
|
- const index = this.anchorStatus.lastIndexOf(1)
|
|
|
- if (this.tabCurrentIndex !== index) this.tabCurrentIndex = index
|
|
|
- }, 200)
|
|
|
+ }
|
|
|
},
|
|
|
onPageScroll(e) {
|
|
|
this.scrollTop = e.scrollTop
|
|
@@ -145,8 +181,8 @@ page {
|
|
|
width: 100%;
|
|
|
height: auto;
|
|
|
box-sizing: border-box;
|
|
|
- padding: 0 24rpx;
|
|
|
- padding-top: 122rpx;
|
|
|
+ padding: 24rpx;
|
|
|
+ // padding-top: 122rpx;
|
|
|
}
|
|
|
.charts-navbar {
|
|
|
width: 100%;
|
|
@@ -158,7 +194,8 @@ page {
|
|
|
position: fixed;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
- z-index: 99;
|
|
|
+ z-index: 9999999;
|
|
|
+ display: none;
|
|
|
.nav-item {
|
|
|
display: flex;
|
|
|
flex: 1;
|
|
@@ -188,13 +225,13 @@ page {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-.charts-content{
|
|
|
+.charts-content {
|
|
|
width: 100%;
|
|
|
height: auto;
|
|
|
}
|
|
|
.charts-box {
|
|
|
width: 100%;
|
|
|
- min-height: 500rpx;
|
|
|
+ min-height: 350rpx;
|
|
|
box-sizing: border-box;
|
|
|
padding: 34rpx 24rpx;
|
|
|
background-color: #fff;
|
|
@@ -252,7 +289,7 @@ page {
|
|
|
}
|
|
|
.echart-main {
|
|
|
width: 100%;
|
|
|
- height: 404rpx;
|
|
|
+ min-height: 200rpx;
|
|
|
box-sizing: border-box;
|
|
|
padding: 32rpx 40rpx;
|
|
|
position: relative;
|
|
@@ -275,8 +312,7 @@ page {
|
|
|
height: 100%;
|
|
|
position: absolute;
|
|
|
right: 10rpx;
|
|
|
- top: 0;
|
|
|
- line-height: 404rpx;
|
|
|
+ top: 50%;
|
|
|
font-size: 28rpx;
|
|
|
color: #1890f9;
|
|
|
}
|
|
@@ -365,8 +401,26 @@ page {
|
|
|
}
|
|
|
.echart-mains {
|
|
|
width: 100%;
|
|
|
- min-height: 400rpx;
|
|
|
+ min-height: 300rpx;
|
|
|
float: left;
|
|
|
+ .echart-mains-none {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ flex-direction: column;
|
|
|
+ .none-image {
|
|
|
+ width: 220rpx;
|
|
|
+ height: 220rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ }
|
|
|
+ .none-text {
|
|
|
+ font-size: $font-size-28;
|
|
|
+ color: #999999;
|
|
|
+ line-height: 44rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|