解决趋势chart滚动问题
This commit is contained in:
parent
01d4359ca7
commit
22debbb070
4
App.vue
4
App.vue
|
|
@ -36,7 +36,9 @@
|
|||
console.log('App Launch')
|
||||
},
|
||||
onShow: function() {
|
||||
console.log('App Show')
|
||||
uni.switchTab({
|
||||
url:"/pages/index/index"
|
||||
})
|
||||
},
|
||||
onHide: function() {
|
||||
console.log('App Hide')
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<view><text class="quan"></text>卡路里分析</view>
|
||||
</view>
|
||||
<div class="chart-wrap">
|
||||
<qiun-data-charts type="ring" :opts="opts" :chartData="chartData" :cHeight="320" :cWidth="320" />
|
||||
<qiun-data-charts type="ring" :opts="opts" :chartData="chartData" :canvas2d="true" canvasId="everyDay01"/>
|
||||
</div>
|
||||
<view class="foodtools">
|
||||
<view class="type" v-for="(item,index) in foodInfo.list">
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
<view><text class="quan"></text>营养元素能量占比</view>
|
||||
</view>
|
||||
<div class="chart-wrap">
|
||||
<qiun-data-charts type="ring" :opts="opts2" :chartData="chartData2" :cHeight="320" :cWidth="320" />
|
||||
<qiun-data-charts type="ring" :opts="opts2" :chartData="chartData2" :canvas2d="true" canvasId="everyDay02"/>
|
||||
</div>
|
||||
<view class="foodtools">
|
||||
<view class="top">
|
||||
|
|
@ -138,7 +138,7 @@
|
|||
import {
|
||||
mapState
|
||||
} from "vuex";
|
||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts.vue';
|
||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -228,7 +228,7 @@
|
|||
position: relative;
|
||||
width: 320rpx;
|
||||
height: 320rpx;
|
||||
margin: -30rpx auto 0;
|
||||
margin: 0rpx auto 0;
|
||||
|
||||
.uchart-val {
|
||||
margin-top: 70rpx;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
</view>
|
||||
<view class="progress">
|
||||
<div class="chart-wrap">
|
||||
<qiun-data-charts type="ring" :opts="opts" canvasId="foodCharts" :chartData="chartData"
|
||||
<qiun-data-charts type="ring" :opts="opts" canvasId="everyMeal01" :chartData="chartData"
|
||||
:cHeight="280" :cWidth="280" :canvas2d="true" />
|
||||
</div>
|
||||
<view class="info" v-if="info.nutrients_four">
|
||||
|
|
@ -81,8 +81,8 @@
|
|||
<view class="title">热量和营养</view>
|
||||
<view class="progress">
|
||||
<div class="chart-wrap">
|
||||
<qiun-data-charts v-if="chartVisible" type="ring" :opts="opts2"
|
||||
:chartData="chartData2" :cHeight="280" :cWidth="280" />
|
||||
<qiun-data-charts type="ring" :opts="opts2"
|
||||
:chartData="chartData2" :cHeight="280" :cWidth="280" canvasId="everyMeal02" :canvas2d="true"/>
|
||||
</div>
|
||||
<view class="info" v-if="activeFoodDetail.nutrients_four">
|
||||
<view class="info-item"
|
||||
|
|
@ -118,7 +118,7 @@
|
|||
mapState
|
||||
} from "vuex";
|
||||
let next = 0
|
||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts.vue';
|
||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -327,7 +327,7 @@
|
|||
position: relative;
|
||||
width: 280rpx;
|
||||
height: 280rpx;
|
||||
margin-top: -30rpx;
|
||||
margin-top: 0rpx;
|
||||
margin-left: -15px;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,10 +70,10 @@
|
|||
<uni-icons type="mic-filled" size="20" color="#fff"></uni-icons>
|
||||
语音搜索
|
||||
</view>
|
||||
<view class="mic-icon mic-icon2" @click="scanCode">
|
||||
<!-- <view class="mic-icon mic-icon2" @click="scanCode">
|
||||
<uni-icons type="scan" size="20" color="#fff"></uni-icons>
|
||||
扫一扫
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<!-- 搜索列表 -->
|
||||
|
|
@ -96,8 +96,10 @@
|
|||
<view class="jishiqi">
|
||||
<view class="left">
|
||||
<view class="chart-wrap">
|
||||
<qiun-data-charts type="arcbar" :chartData="chartData" :cHeight="280" :cWidth="280"
|
||||
:canvas2d="true" canvasId="searchCharts" />
|
||||
<view class="charts-box">
|
||||
<qiun-data-charts type="arcbar" :chartData="chartData" :canvas2d="true"
|
||||
canvasId="search02" />
|
||||
</view>
|
||||
<view class="center">
|
||||
摄入
|
||||
<text>{{foodInfo[0].today_intake}}</text>
|
||||
|
|
@ -194,7 +196,7 @@
|
|||
<!-- 蓝牙称重 -->
|
||||
<view class="blue-tooth" v-if="isBle">
|
||||
<blue-tooth @handleBle="handleBle" :weightKcal="weightKcal"
|
||||
@realTimeWeight="realTimeWeight" :btnType="'2'"></blue-tooth>
|
||||
@realTimeWeight="realTimeWeight" :btnType="btnType"></blue-tooth>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 营养分析 -->
|
||||
|
|
@ -254,10 +256,11 @@
|
|||
const plugin = requirePlugin("WechatSI")
|
||||
// #endif
|
||||
import blueTooth from "@/components/foodIndex/bluetooth_food.vue"
|
||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts.vue';
|
||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
btnType: 2,
|
||||
chartData: {
|
||||
series: [{
|
||||
data: 0,
|
||||
|
|
@ -274,7 +277,7 @@
|
|||
isShop: false,
|
||||
lastPage: "",
|
||||
isBle: true,
|
||||
weightKcal: "",
|
||||
weightKcal: 0,
|
||||
search_value: '',
|
||||
ActiveList: [],
|
||||
activeType: {},
|
||||
|
|
@ -300,6 +303,7 @@
|
|||
onLoad(options) {
|
||||
let that = this
|
||||
that.handleList()
|
||||
that.showScanCodeDlg = false
|
||||
that.time = that.countFoodInfo.date
|
||||
that.foodName = options.name
|
||||
},
|
||||
|
|
@ -366,6 +370,7 @@
|
|||
barcode: res.result,
|
||||
}).then(res => {
|
||||
uni.hideLoading();
|
||||
console.log("1111111111111", res)
|
||||
if (res.code != 0) {
|
||||
that.ScanCodeMsg = res.msg
|
||||
that.showScanCodeDlg = true
|
||||
|
|
@ -1291,12 +1296,12 @@
|
|||
height: 340rpx;
|
||||
|
||||
.chart-wrap {
|
||||
margin-top: -15px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.center {
|
||||
height: 270rpx;
|
||||
top: 55rpx;
|
||||
top: 15rpx;
|
||||
border: none;
|
||||
width: 260rpx;
|
||||
position: absolute;
|
||||
|
|
@ -1310,6 +1315,7 @@
|
|||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.right {
|
||||
|
|
@ -1471,6 +1477,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
.charts-box {
|
||||
width: 250rpx;
|
||||
height: 250rpx;
|
||||
}
|
||||
|
||||
.wrapperScan {
|
||||
.auto-search-dialog {
|
||||
bottom: 0;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
<view class="text">
|
||||
营养占比
|
||||
</view>
|
||||
<view class="slider">
|
||||
<view class="slider" v-if="isShow">
|
||||
<llt-slider-range :model-value="rangeValue" @change="handleChange" />
|
||||
</view>
|
||||
<view class="list">
|
||||
|
|
@ -55,6 +55,7 @@
|
|||
carbohydrate_v: 0,
|
||||
protein_v: 0,
|
||||
fat_v: 0,
|
||||
isShow: true,
|
||||
carbohydrate_p: 0,
|
||||
protein_p: 0,
|
||||
fat_p: 0,
|
||||
|
|
@ -80,14 +81,16 @@
|
|||
aud_id: that.user.aud_id
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
that.isShow = false
|
||||
that.kcal = res.data.kcal
|
||||
that.nutrition = res.data.nutrition
|
||||
that.weight = res.data.kcal.suggestion_kcal_val
|
||||
that.$nextTick(() => {
|
||||
that.isShow = true
|
||||
that.rangeValue[0] = Number(that.nutrition.list[0].proportion)
|
||||
that.rangeValue[1] = Number(that.nutrition.list[0].proportion) + Number(that.nutrition
|
||||
.list[1].proportion)
|
||||
console.log("that.rangeValue", that.rangeValue)
|
||||
that.rangeValue[1] = Number(that.nutrition.list[0].proportion) + Number(that.nutrition.list[1].proportion)
|
||||
that.handleProportion()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -22,17 +22,29 @@
|
|||
</view>
|
||||
<!-- 曲线图 -->
|
||||
<view class="box" v-if="weightList.length">
|
||||
<view class="listC">
|
||||
<view class="line" v-for="(item,index) in weightList">
|
||||
<view class="title">{{item.title}}</view>
|
||||
<view class="Charts" v-if="item.line.categories.length">
|
||||
<qiunDataCharts type="area" :chartData="item.line" :canvas2d="true"
|
||||
:canvasId="'canvasId02'+index" :tooltipShow="false" :ontouch="true"
|
||||
:opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:3}}" />
|
||||
</view>
|
||||
<view class="line" v-else>
|
||||
<view class="nolist">
|
||||
<image src="../../static/none.png"></image>
|
||||
<text>暂无数据,请手动添加~</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="listC">
|
||||
<view :class="{active2:index==active1}" class="name" v-for="(item,index) in weightList"
|
||||
:key="index" @click="showbox(index)">
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="blockC">
|
||||
<view v-if="handTrue&&lineData.categories&&lineData.categories.length">
|
||||
<qiunDataCharts type="area" :chartData="lineData" :canvas2d="true" canvasId="charts09"
|
||||
:animation="false" :Width="340" :Height="250"
|
||||
:opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:3}}" :ontouch="true" />
|
||||
<view v-if="handTrue&&lineData.categories.length">
|
||||
<qiun-data-charts type="area" :chartData="lineData" canvasId="canvasId02" :canvas2d="true" />
|
||||
</view>
|
||||
<view class="box" v-else>
|
||||
<view class="nolist">
|
||||
|
|
@ -40,7 +52,7 @@
|
|||
<text>暂无数据</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="box" v-else>
|
||||
<view class="nolist">
|
||||
|
|
@ -103,9 +115,15 @@
|
|||
active1: 0,
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
lineData: {},
|
||||
lineData: {
|
||||
categories: [],
|
||||
series: [{
|
||||
color: "#54d87c",
|
||||
data: []
|
||||
}]
|
||||
},
|
||||
weightList: [],
|
||||
handTrue: true,
|
||||
handTrue: false,
|
||||
target_weight: 0, //目标体重
|
||||
initial_weight: 0, //初始体重
|
||||
calculate_val: 0, //累计减重
|
||||
|
|
@ -166,11 +184,17 @@
|
|||
|
||||
showbox(index) {
|
||||
let that = this
|
||||
that.lineData = {}
|
||||
that.handTrue = false
|
||||
that.$nextTick(function() {
|
||||
that.handTrue = true
|
||||
that.lineData = that.weightList.length ? that.weightList[index].line : {},
|
||||
console.log("11111", that.lineData)
|
||||
that.lineData = that.weightList.length ? that.weightList[index].line : {
|
||||
categories: [],
|
||||
series: [{
|
||||
color: "#54d87c",
|
||||
data: []
|
||||
}]
|
||||
}
|
||||
})
|
||||
that.active1 = index
|
||||
},
|
||||
|
|
@ -191,7 +215,6 @@
|
|||
that.startTime = e.detail.value
|
||||
let endtime = that.endTime ? that.endTime : that.endDate
|
||||
that.handleLabelList(endtime, that.startTime)
|
||||
that.showbox(0)
|
||||
},
|
||||
// 结束
|
||||
handEndTimeH(e) {
|
||||
|
|
@ -210,7 +233,6 @@
|
|||
that.endTime = e.detail.value
|
||||
let startTime = that.startTime ? that.startTime : that.startDate
|
||||
that.handleLabelList(that.endTime, startTime)
|
||||
that.showbox(0)
|
||||
},
|
||||
handleClick(ind) {
|
||||
if (ind == 1) {
|
||||
|
|
@ -235,6 +257,38 @@
|
|||
min-height: 100vh;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.box {
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
background: inherit !important;
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
margin-top: 15px;
|
||||
border-radius: 10px;
|
||||
padding-bottom: 15px;
|
||||
// width: 100%;
|
||||
// height: 240px;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin: 15px 0;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.Charts {
|
||||
width: 100%;
|
||||
height: 240px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.listC {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@
|
|||
return {
|
||||
ranklist: [],
|
||||
page: 1,
|
||||
isDelete: false,
|
||||
lastPage: '',
|
||||
isActive: null,
|
||||
}
|
||||
|
|
@ -83,19 +82,12 @@
|
|||
return
|
||||
}
|
||||
that.ranklist.splice(index, 1)
|
||||
if (that.user.measure_model == "1") {
|
||||
that.$store.dispatch("getUserInfo", {
|
||||
aud_id: uni.getStorageSync('userid')
|
||||
aud_id:that.user.aud_id
|
||||
})
|
||||
}
|
||||
if (that.acd_id == 2) {
|
||||
that.$store.dispatch("getResult", {
|
||||
aud_id: uni.getStorageSync('userid')
|
||||
aud_id: that.user.aud_id
|
||||
})
|
||||
} else {
|
||||
that.isDelete = true
|
||||
}
|
||||
|
||||
that.$tools.msg("删除成功")
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@
|
|||
} from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
id: ""
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(["familayList"])
|
||||
|
|
@ -57,14 +59,14 @@
|
|||
//删除
|
||||
handleDeldet(e, ind) {
|
||||
let that = this
|
||||
let id = that.familayList[ind].id
|
||||
that.id = that.familayList[ind].id
|
||||
uni.showModal({
|
||||
title: '友情提示',
|
||||
content: '确定删除该成员吗',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
that.$model.getDelUser({
|
||||
aud_id: id,
|
||||
aud_id: that.id,
|
||||
}).then(res => {
|
||||
if (res.code != 0) return
|
||||
that.$tools.msg("删除成功!");
|
||||
|
|
@ -87,27 +89,34 @@
|
|||
return
|
||||
}
|
||||
that.$store.commit('changeFamilay', res.data.user_list)
|
||||
if (res.data.length) {
|
||||
uni.setStorageSync('userid', res.data.user_list[0].id)
|
||||
|
||||
console.log("删除", that.id, uni.getStorageSync('userid'))
|
||||
// 删除的是当前用户
|
||||
if (that.id == uni.getStorageSync('userid')) {
|
||||
let userid = res.data.user_list[0].id
|
||||
uni.setStorageSync('userid', userid)
|
||||
that.$store.dispatch('getUserInfo', {
|
||||
aud_id: res.data.user_list[0].id
|
||||
aud_id: userid
|
||||
})
|
||||
// 厨房秤接口
|
||||
that.$store.dispatch("getCountFoodInfo", {
|
||||
aud_id: userid,
|
||||
time: that.$tools.getDate("start")
|
||||
})
|
||||
// 全部卡片
|
||||
that.$store.dispatch("getCardAllList", {
|
||||
aud_id: userid
|
||||
})
|
||||
//
|
||||
that.$store.dispatch("getResult", {
|
||||
aud_id: userid
|
||||
})
|
||||
that.$store.dispatch("getPublicRecord", {
|
||||
aud_id: userid
|
||||
})
|
||||
that.handlePublicRecord(res.data.user_list[0].id)
|
||||
}
|
||||
}).catch(err => {})
|
||||
},
|
||||
// 公共手动记录内容
|
||||
handlePublicRecord(id) {
|
||||
let that = this
|
||||
that.$model.getPublicRecord({
|
||||
aud_id: id
|
||||
}).then(res => {
|
||||
console.log("公共手动记录", res)
|
||||
if (res.code == 0) {
|
||||
that.$store.commit('changePublicRecord', res.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
editorInfo(item) {
|
||||
uni.navigateTo({
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@
|
|||
nickname: "",
|
||||
activity_level: "",
|
||||
},
|
||||
addID: "",
|
||||
fields: "",
|
||||
levelInd: 0,
|
||||
isEdit: false,
|
||||
|
|
@ -118,27 +119,6 @@
|
|||
that.fields = "day"
|
||||
// #endif
|
||||
},
|
||||
watch: {
|
||||
familayList() {
|
||||
let that = this
|
||||
let userid = ""
|
||||
let found = that.familayList.find(e => e.id == that.userId);
|
||||
userid = found !== undefined ? that.userId : that.familayList[0].id
|
||||
uni.setStorageSync('userid', found !== undefined ? found.id : userid)
|
||||
uni.setStorageSync('gender', found !== undefined ? found.gender : that.familayList[0].gender)
|
||||
that.$store.commit('changeUser', found !== undefined ? found : that.familayList[0])
|
||||
that.$store.dispatch("getResult", {
|
||||
aud_id: userid
|
||||
})
|
||||
if (!that.isEdit && that.familayList.length == 1) {
|
||||
uni.switchTab({
|
||||
url: "/pages/home/home"
|
||||
})
|
||||
} else {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 提交
|
||||
confirmInfo() {
|
||||
|
|
@ -165,29 +145,67 @@
|
|||
}
|
||||
let https = that.isEdit ? that.$model.getEditUser(that.memInfo) : that.$model.getAddUser(that.memInfo)
|
||||
return https.then(res => {
|
||||
console.log("成功", res)
|
||||
console.log("成功", res, that.isEdit, uni.getStorageSync('userid'))
|
||||
if (res.code == 0) {
|
||||
that.$tools.msg("提交成功");
|
||||
that.userId = res.data.aud_id
|
||||
that.$store.dispatch('getFamilyList', {
|
||||
type: 2
|
||||
})
|
||||
if (!that.isEdit) {
|
||||
that.addID = res.aud_id
|
||||
}
|
||||
that.handleUserList()
|
||||
} else {
|
||||
that.$tools.msg(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 公共手动记录内容
|
||||
handlePublicRecord(id) {
|
||||
handleUserList() {
|
||||
let that = this
|
||||
that.$model.getPublicRecord({
|
||||
aud_id: id
|
||||
that.$model.getUserList({
|
||||
type: 2
|
||||
}).then(res => {
|
||||
console.log("公共手动记录", res)
|
||||
if (res.code == 0) {
|
||||
that.$store.commit('changePublicRecord', res.data)
|
||||
if (res.code != 0) {
|
||||
that.$tools.msg(res.msg)
|
||||
return
|
||||
}
|
||||
that.$store.commit('changeFamilay', res.data.user_list)
|
||||
// 新增成员
|
||||
if (!that.isEdit) {
|
||||
let userid = that.addID
|
||||
uni.setStorageSync('userid', that.addID)
|
||||
that.$store.dispatch('getUserInfo', {
|
||||
aud_id: userid
|
||||
})
|
||||
that.$store.dispatch("getCountFoodInfo", {
|
||||
aud_id: userid,
|
||||
time: that.$tools.getDate("start")
|
||||
})
|
||||
that.$store.dispatch("getCardAllList", {
|
||||
aud_id: userid
|
||||
})
|
||||
//
|
||||
that.$store.dispatch("getResult", {
|
||||
aud_id: userid
|
||||
})
|
||||
}
|
||||
// 编辑当前用户
|
||||
if (that.isEdit && that.memInfo.id == uni.getStorageSync('userid')) {
|
||||
that.$store.dispatch('getUserInfo', {
|
||||
aud_id: that.memInfo.id
|
||||
})
|
||||
that.$store.dispatch("getCountFoodInfo", {
|
||||
aud_id: that.memInfo.id,
|
||||
time: that.$tools.getDate("start")
|
||||
})
|
||||
that.$store.dispatch("getResult", {
|
||||
aud_id: that.memInfo.id
|
||||
})
|
||||
}
|
||||
setTimeout(function() {
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index"
|
||||
})
|
||||
}, 500)
|
||||
});
|
||||
},
|
||||
//确定年龄
|
||||
maskClick(e) {
|
||||
|
|
|
|||
|
|
@ -10,18 +10,6 @@
|
|||
<text>性别:{{depthInfo.user_data.gender==2?'女':'男'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="rightChart">
|
||||
<view class="charts-box">
|
||||
<qiun-data-charts type="arcbar" :opts="opts2" canvasId="foodCharts107"
|
||||
:chartData="chartData2" :canvas2d="true" :cHeight="300" :cWidth="300" />
|
||||
</view>
|
||||
<view class="score">
|
||||
<text>{{depthInfo.user_data.score}}</text>
|
||||
健康评分
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="text_l">
|
||||
|
|
@ -37,6 +25,18 @@
|
|||
<text class="size20 bold">{{depthInfo.user_data.weight}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="rightChart">
|
||||
<view class="charts-box" v-if="depthInfo.user_data.score">
|
||||
<qiun-data-charts type="arcbar" :opts="opts2" canvasId="rightChart209" :chartData="chartData2"
|
||||
:canvas2d="true" />
|
||||
</view>
|
||||
<view class="score">
|
||||
<text>{{depthInfo.user_data.score}}</text>
|
||||
健康评分
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 心脏健康 -->
|
||||
<view v-if="depthInfo.heart_rate&&depthInfo.heart_rate.value">
|
||||
|
|
@ -101,7 +101,7 @@
|
|||
</view>
|
||||
<view class="huan">
|
||||
<qiun-data-charts type="ring" :opts="opts" canvasId="foodCharts209" :chartData="chartData"
|
||||
:cHeight="320" :cWidth="320" :canvas2d="true" />
|
||||
:canvas2d="true" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -285,7 +285,7 @@
|
|||
import {
|
||||
mapState
|
||||
} from "vuex";
|
||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts.vue';
|
||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -427,6 +427,7 @@
|
|||
.header {
|
||||
background: #fff;
|
||||
padding: 10px;
|
||||
margin-top: 15PX;
|
||||
width: calc(100% - 20px);
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
|
|
@ -436,7 +437,7 @@
|
|||
height: 55px;
|
||||
|
||||
.left {
|
||||
width: calc(100% - 180px);
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
image {
|
||||
|
|
@ -456,13 +457,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 160px;
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: -35px;
|
||||
top: -30px;
|
||||
height: 100px;
|
||||
overflow: hidden;
|
||||
z-index: 999;
|
||||
|
||||
.rightChart {
|
||||
width: 140px;
|
||||
|
|
@ -475,7 +479,7 @@
|
|||
.charts-box {
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
margin-top: -15px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.score {
|
||||
|
|
@ -486,7 +490,7 @@
|
|||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
top: 0;
|
||||
top: -5px;
|
||||
|
||||
text {
|
||||
color: $maincolor;
|
||||
|
|
@ -496,8 +500,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.info {
|
||||
display: flex;
|
||||
text-align: center;
|
||||
|
|
@ -616,9 +618,10 @@
|
|||
|
||||
.huan {
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
margin-top: 35px;
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,9 +15,10 @@
|
|||
<view class="number"><text class="size26 bold">{{ite.value}}</text>{{ite.unit}}</view>
|
||||
<view class="standard bold size16" :style="{'color':ite.standard_color}">{{ite.standard}}</view>
|
||||
</view>
|
||||
<view class="charts">
|
||||
<qiun-data-charts type="area" :chartData="ite.curve_list.line" :canvas2d="true" :opts="opts"
|
||||
:canvasId="ite.key_name+'charts09'" :Width="140" :Height="85" />
|
||||
<view class="charts" v-if="handTrue&&ite.curve_list.line.categories.length">
|
||||
<qiun-data-charts type="area" :chartData="ite.curve_list.line" :Width="140" :Height="40"
|
||||
:canvas2d="true" :canvasId="ite.key_name+ind" :opts="opts" :tapLegend="false"
|
||||
:tooltipShow="false" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="Ideal c999" v-if="ite.ideal_weight">
|
||||
|
|
@ -58,24 +59,28 @@
|
|||
mapState
|
||||
} from "vuex";
|
||||
import record from '@/components/bodyIndex/record.vue';
|
||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts.vue'
|
||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue'
|
||||
export default {
|
||||
name: "body",
|
||||
components: {
|
||||
record,
|
||||
qiunDataCharts,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
handTrue: false,
|
||||
Measure: {
|
||||
card_list: [],
|
||||
top_list: []
|
||||
},
|
||||
opts: {
|
||||
padding: [0, 0, 0, 0],
|
||||
padding: [5, 0, 0, 0],
|
||||
dataLabel: false,
|
||||
dataPointShape: false,
|
||||
enableScroll: false,
|
||||
xAxis: {
|
||||
disabled: true,
|
||||
axisLine: false,
|
||||
disableGrid: true,
|
||||
itemCount: 5
|
||||
},
|
||||
yAxis: {
|
||||
gridType: "dash",
|
||||
|
|
@ -92,8 +97,24 @@
|
|||
info() {
|
||||
return this.user
|
||||
},
|
||||
Measure() {
|
||||
return this.MeasureResult
|
||||
// Measure() {
|
||||
// let that = this
|
||||
// return this.MeasureResult
|
||||
// }
|
||||
},
|
||||
watch: {
|
||||
MeasureResult: {
|
||||
handler(newVal, oldVal) {
|
||||
let that = this
|
||||
that.handTrue = false
|
||||
this.$nextTick(() => {
|
||||
that.handTrue = true
|
||||
that.Measure = newVal
|
||||
})
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -111,9 +132,12 @@
|
|||
},
|
||||
// 趋势
|
||||
handelCurveDetailed() {
|
||||
let that = this
|
||||
setTimeout(function() {
|
||||
uni.navigateTo({
|
||||
url: "/body/curve/curve"
|
||||
})
|
||||
}, 200)
|
||||
},
|
||||
// 手动
|
||||
handlerRecord() {
|
||||
|
|
@ -145,8 +169,8 @@
|
|||
|
||||
.weight {
|
||||
width: 100%;
|
||||
padding-top: 10px;
|
||||
display: flex;
|
||||
margin-top: 10px;
|
||||
justify-content: space-between;
|
||||
|
||||
.left {
|
||||
|
|
@ -168,7 +192,7 @@
|
|||
|
||||
.charts {
|
||||
width: 50%;
|
||||
height: 70px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.function {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<view class="overflow">
|
||||
{{item.nickname}}
|
||||
</view>
|
||||
<view class="dangqian" v-if="item.id == userinfo.id">当前</view>
|
||||
<view class="dangqian" v-if="item.id == userinfo.aud_id">当前</view>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view>{{item.gender==1?'男':'女'}}</view>
|
||||
|
|
@ -52,33 +52,30 @@
|
|||
// 切换用户
|
||||
toggle(val) {
|
||||
let that = this
|
||||
console.log("11111", val)
|
||||
uni.setStorageSync('userid', val.id)
|
||||
uni.setStorageSync('gender', val.gender)
|
||||
that.$store.commit('changeUser', val)
|
||||
that.$store.dispatch("getResult", {
|
||||
that.$store.dispatch('getUserInfo', {
|
||||
aud_id: val.id
|
||||
})
|
||||
that.$store.dispatch("getCountFoodInfo", {
|
||||
aud_id: val.id,
|
||||
time: that.$tools.getDate("start")
|
||||
})
|
||||
that.$store.dispatch("getResult", {
|
||||
aud_id: val.id,
|
||||
})
|
||||
that.$store.dispatch("getPublicRecord", {
|
||||
aud_id: val.id,
|
||||
})
|
||||
that.$store.commit("changehomeCard", 0);
|
||||
that.$store.commit("changeDrawe", false);
|
||||
// that.handlePublicRecord(val.id)
|
||||
},
|
||||
// 公共手动记录内容
|
||||
handlePublicRecord(id) {
|
||||
let that = this
|
||||
that.$model.getPublicRecord({
|
||||
aud_id: id
|
||||
}).then(res => {
|
||||
console.log("公共手动记录", res)
|
||||
if (res.code == 0) {
|
||||
that.$store.commit('changePublicRecord', res.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
//添加
|
||||
addInfo() {
|
||||
let that = this
|
||||
uni.navigateTo({
|
||||
url: "/pageTwo/my/userInfo"
|
||||
url: "/body/my/userInfo"
|
||||
})
|
||||
that.$store.commit("changeDrawe", false);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
<!-- 称重 -->
|
||||
<view class="blue-tooth" v-if="user.aud_id!=''">
|
||||
<blue-tooth :btnType="'1'"></blue-tooth>
|
||||
<blue-tooth :btnType="btnType"></blue-tooth>
|
||||
</view>
|
||||
<!-- 能量摄入 -->
|
||||
<view class="everyDay">
|
||||
|
|
@ -24,9 +24,11 @@
|
|||
</view>
|
||||
<view class="jishiqi">
|
||||
<view class="left">
|
||||
<view class="chart-wrap">
|
||||
<qiun-data-charts type="arcbar" :chartData="chartData" :cHeight="280" :cWidth="280"
|
||||
:canvas2d="true" canvasId="countCharts" v-if="handTrue" />
|
||||
<view class="chart-wrap" v-if="handTrue">
|
||||
<view class="charts-box">
|
||||
<qiun-data-charts type="arcbar" :chartData="chartData" :canvas2d="true"
|
||||
canvasId="foodCharts01" />
|
||||
</view>
|
||||
<view class="center">
|
||||
摄入
|
||||
<text>{{foodInfo.nutrients_four[0].today_intake}}</text>
|
||||
|
|
@ -125,9 +127,9 @@
|
|||
<view class="foodContent">
|
||||
<view class="title">热量和营养</view>
|
||||
<view class="progress">
|
||||
<div class="chart-wrap">
|
||||
<qiun-data-charts v-if="chartVisible" type="ring" :opts="opts"
|
||||
:chartData="chartData2" :cHeight="280" :cWidth="280" />
|
||||
<div class="chart-wrap" v-if="chartVisible">
|
||||
<qiun-data-charts type="ring" :opts="opts" :chartData="chartData2" :cHeight="280"
|
||||
:cWidth="280" :canvas2d="true" canvasId="foodCharts02" />
|
||||
</div>
|
||||
<view class="info" v-if="activeFoodDetail.nutrients_four">
|
||||
<view class="info-item"
|
||||
|
|
@ -163,11 +165,12 @@
|
|||
mapState
|
||||
} from "vuex";
|
||||
import blueTooth from "@/components/foodIndex/bluetooth_food.vue"
|
||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts.vue';
|
||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
|
||||
export default {
|
||||
name: "food",
|
||||
data() {
|
||||
return {
|
||||
btnType: 1,
|
||||
token: "",
|
||||
index: 0,
|
||||
opts: {
|
||||
|
|
@ -467,4 +470,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
.charts-box {
|
||||
width: 250rpx;
|
||||
height: 250rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
<template>
|
||||
<view v-if="isCity" class="visible">
|
||||
<view class="bg" @click="clear"></view>
|
||||
<view @click.stop class="item">
|
||||
<view class="groupBtn">
|
||||
<view @click="visible=false">取消</view>
|
||||
<view @click="handlesure()" class="sure">确定</view>
|
||||
</view>
|
||||
<picker-view @change="bindChange" :value="value" class="picker-view" :indicator-style="indicatorStyle">
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in province" :key="index">{{item.name}}</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in city" :key="index">{{item}}</view>
|
||||
</picker-view-column>
|
||||
<!-- <picker-view-column>
|
||||
<view class="item" v-for="(item,index) in area" :key="index">{{item?item:'请选择'}}</view>
|
||||
</picker-view-column> -->
|
||||
</picker-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState
|
||||
} from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: [2, 0],
|
||||
province: [], //省
|
||||
city: [], //市
|
||||
area: [], //区
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(["cityList", "user", "isCity"]),
|
||||
},
|
||||
mounted() {
|
||||
let that = this
|
||||
setTimeout(() => {
|
||||
that.handleCityList()
|
||||
console.log("1111", this.user.address, that.cityList, that.province)
|
||||
}, 500);
|
||||
},
|
||||
methods: {
|
||||
// 地区
|
||||
handleCityList() {
|
||||
let that = this
|
||||
that.province = that.cityList
|
||||
let str = that.user.address.split(',')[0]
|
||||
let str2 = that.user.address.split(',')[1]
|
||||
var Index0 = that.cityList.findIndex((profile) => profile.name === str);
|
||||
var Index2 = that.cityList[Index0].list.findIndex((ite) => ite === str2);
|
||||
that.value[0] = Index0
|
||||
that.value[1] = Index2
|
||||
that.city = that.cityList[Index0].list
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.bg {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
z-index: 99;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,133 +0,0 @@
|
|||
<template>
|
||||
<view class="wrapper" v-if="isDrawe">
|
||||
<view class="bg" @click="clear"></view>
|
||||
<view class="wrapper_box">
|
||||
<view class="top">
|
||||
<image class="headimage mt-10" v-if="userinfo.head_pic" :src="userinfo.head_pic"></image>
|
||||
<view class="overflow">{{userinfo.nickname}}</view>
|
||||
</view>
|
||||
<view class="drawerList">
|
||||
<view class="drawerList_item" v-for="(item, index) in List" :key="index" @click="toggle(item)"
|
||||
v-if="List.length">
|
||||
<image v-if="item.head_pic" :src="item.head_pic" class="image1"></image>
|
||||
<view class="right">
|
||||
<view class="name">
|
||||
<view class="overflow">
|
||||
{{item.nickname}}
|
||||
</view>
|
||||
<view class="dangqian" v-if="item.id == userinfo.id">当前</view>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view>{{item.gender==1?'男':'女'}}</view>
|
||||
<view>{{item.age}}岁</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="add" @click="addInfo()">
|
||||
+
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState
|
||||
} from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
...mapState(["user", "familayList", "isDrawe"]),
|
||||
userinfo() {
|
||||
return this.user
|
||||
},
|
||||
List() {
|
||||
return this.familayList
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 切换用户
|
||||
toggle(val) {
|
||||
let that = this
|
||||
uni.setStorageSync('userid', val.id)
|
||||
uni.setStorageSync('gender', val.gender)
|
||||
that.$store.commit('changeUser', val)
|
||||
that.$store.dispatch("getResult", {
|
||||
aud_id: val.id
|
||||
})
|
||||
that.$store.commit("changeDrawe", false);
|
||||
that.handlePublicRecord(val.id)
|
||||
},
|
||||
// 公共手动记录内容
|
||||
handlePublicRecord(id) {
|
||||
let that = this
|
||||
that.$model.getPublicRecord({
|
||||
aud_id: id
|
||||
}).then(res => {
|
||||
console.log("公共手动记录", res)
|
||||
if (res.code == 0) {
|
||||
that.$store.commit('changePublicRecord', res.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
//添加
|
||||
addInfo() {
|
||||
let that = this
|
||||
uni.navigateTo({
|
||||
url: "/pageTwo/my/userInfo"
|
||||
})
|
||||
that.$store.commit("changeDrawe", false);
|
||||
},
|
||||
clear() {
|
||||
this.$store.commit("changeDrawe", false);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.wrapper {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 999;
|
||||
|
||||
.bg {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.headimage {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
margin: auto;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.dangqian {
|
||||
font-size: 24upx !important;
|
||||
}
|
||||
|
||||
@keyframes wrapper_box {
|
||||
0% {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateX(0%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,255 +0,0 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="header">
|
||||
<view class="top" v-if="userList.length">
|
||||
<view class="headimg" @click="handleAddUser(1)">
|
||||
<image :src="info.head_pic"></image>
|
||||
</view>
|
||||
<view class="info" @click="handleAddUser(1)">
|
||||
<view class="size18 bold">{{info.nickname}}</view>
|
||||
<view class="mt-5">
|
||||
<text class="mr-10">性别:{{info.gender==1?'男':info.gender==2?'女':'未知'}}</text>
|
||||
<text class="ml-10">年龄:{{info.age}}岁</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="t-icon t-icon-qiehuan1" @click="$store.commit('changeDrawe', true)" v-if="isLeft"></text>
|
||||
</view>
|
||||
<view class="top" v-else @click="handleAddUser(2)">
|
||||
<view class="info">
|
||||
暂无成员,请先添加~
|
||||
</view>
|
||||
<view class="add">
|
||||
+
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 地区 -->
|
||||
<view class="cityList">
|
||||
<view class="area" v-if="isArea" @click="visible = true">
|
||||
<view>中招地区标准:</view>
|
||||
<view>{{region?region:info.address}}<uni-icons type="bottom"></uni-icons></view>
|
||||
</view>
|
||||
<!-- -->
|
||||
<view v-if="visible" class="visible" @click="visible=false">
|
||||
<view @click.stop class="item">
|
||||
<view class="groupBtn">
|
||||
<view @click="visible=false">取消</view>
|
||||
<view @click="handlesure()" class="sure">确定</view>
|
||||
</view>
|
||||
<picker-view @change="bindChange" :value="value" class="picker-view"
|
||||
:indicator-style="indicatorStyle">
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in province" :key="index">{{item.name}}</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in city" :key="index">{{item}}</view>
|
||||
</picker-view-column>
|
||||
<!-- <picker-view-column>
|
||||
<view class="item" v-for="(item,index) in area" :key="index">{{item?item:'请选择'}}</view>
|
||||
</picker-view-column> -->
|
||||
</picker-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 切换成员 -->
|
||||
<drawer></drawer>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState
|
||||
} from "vuex";
|
||||
import drawer from "@/element/drawer.vue"
|
||||
export default {
|
||||
name: "headerIndex",
|
||||
components: {
|
||||
drawer
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: [2, 0],
|
||||
visible: false,
|
||||
region: "",
|
||||
province: [], //省
|
||||
city: [], //市
|
||||
area: [], //区
|
||||
indicatorStyle: `height: 45px;`,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(["user", "familayList", "configInfo"]),
|
||||
info() {
|
||||
return this.user
|
||||
},
|
||||
userList() {
|
||||
return this.familayList
|
||||
},
|
||||
userAddress() {
|
||||
return this.user.address
|
||||
},
|
||||
},
|
||||
props: {
|
||||
isArea: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
isLeft: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
let that = this
|
||||
setTimeout(() => {
|
||||
if (that.isArea) {
|
||||
that.handleCityList()
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
watch: {
|
||||
userAddress() {
|
||||
let that = this
|
||||
that.region = that.user.address
|
||||
that.handleCityList()
|
||||
that.$emit("getAciveCity", that.region)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
bindChange: function(e) {
|
||||
let that = this
|
||||
if (e.detail.value[0] != that.value[0]) {
|
||||
e.detail.value[1] = 0
|
||||
}
|
||||
that.value = e.detail.value
|
||||
that.city = that.province[that.value[0]].list
|
||||
},
|
||||
handlesure() {
|
||||
let that = this
|
||||
let defaultRegion = [that.province[that.value[0]].name, that.city[that.value[1]]]
|
||||
that.region = defaultRegion.join(",");
|
||||
that.visible = false
|
||||
that.$emit("getAciveCity", that.region)
|
||||
},
|
||||
// 添加成员
|
||||
handleAddUser(ind) {
|
||||
let that = this
|
||||
if (uni.getStorageSync('token')) {
|
||||
let index = that.userList.findIndex((profile) => profile.id == that.info.id)
|
||||
uni.navigateTo({
|
||||
url: ind == 1 ? "/pageTwo/my/userInfo?info=" + JSON.stringify(that.userList[index]) :
|
||||
"/pageTwo/my/userInfo"
|
||||
})
|
||||
} else {
|
||||
console.log("headerIndex跳转登录页面")
|
||||
uni.reLaunch({
|
||||
url: '/pageTwo/login/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 地区
|
||||
handleCityList() {
|
||||
let that = this
|
||||
if ( that.configInfo.area_list.length) {
|
||||
if (that.user.address != '') {
|
||||
that.province = that.configInfo.area_list
|
||||
let str = that.user.address.split(',')[0]
|
||||
var Index0 = that.province.findIndex((profile) => profile.name == str);
|
||||
that.value[0] = Index0
|
||||
console.log("地区", str, Index0)
|
||||
that.city = that.province[Index0].list
|
||||
} else {
|
||||
that.value = [2, 0]
|
||||
that.city = that.configInfo.area_list[2].list
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.info {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-left: 15px;
|
||||
width: calc(100% - 70px);
|
||||
|
||||
view {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
last-child {
|
||||
margin-top: 2px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.area {
|
||||
margin: 15px 10px 0;
|
||||
padding: 15px 10px 10px;
|
||||
background-color: #fff;
|
||||
width: calc(100% - 40px);
|
||||
display: flex;
|
||||
border-radius: 10px;
|
||||
justify-content: space-between;
|
||||
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
|
||||
}
|
||||
|
||||
|
||||
.item {
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.visible {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 9999;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
|
||||
.groupBtn {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 15px;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 45%;
|
||||
z-index: 999;
|
||||
|
||||
view {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding: 0 10px;
|
||||
background-color: #dfdfdf;
|
||||
border-radius: 5px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.sure {
|
||||
background-color: $textcolor;
|
||||
color: #fff !important;
|
||||
}
|
||||
}
|
||||
|
||||
.picker-view {
|
||||
width: 100%;
|
||||
height: 45%;
|
||||
bottom: 0;
|
||||
position: absolute;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.t-icon-qiehuan1 {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -26,12 +26,12 @@
|
|||
<view class="boxLine">
|
||||
<view class="line" v-for="(item,index) in weightList">
|
||||
<view v-if="item.line.categories.length">
|
||||
<qiunDataCharts type="column" :chartData="item.line" :canvas2d="true" :canvasId="item.id"
|
||||
:Width="340" :Height="250" :animation="false"
|
||||
:opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:3}}" :ontouch="true" />
|
||||
<qiunDataCharts type="column" :chartData="item.line" :canvas2d="true" :canvasId="item.key"
|
||||
:opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:5}}" :ontouch="true"
|
||||
:tooltipShow="false" />
|
||||
</view>
|
||||
<view class="line" v-else>
|
||||
<view class="nolist mb-15">
|
||||
<view class="nolist">
|
||||
<image src="../../static/none.png"></image>
|
||||
<text>暂无数据,请手动添加~</text>
|
||||
</view>
|
||||
|
|
@ -54,7 +54,6 @@
|
|||
weightList: [],
|
||||
handTrue: true,
|
||||
active: 1,
|
||||
index: 0,
|
||||
time: "",
|
||||
}
|
||||
},
|
||||
|
|
@ -74,7 +73,7 @@
|
|||
return this.$tools.getDate("start")
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onShow() {
|
||||
let that = this
|
||||
that.active = 1
|
||||
that.index = 0
|
||||
|
|
@ -87,10 +86,9 @@
|
|||
that.index = ind
|
||||
that.active = 1
|
||||
that.time = that.startDate
|
||||
that.getList()
|
||||
that.handleActive(that.index)
|
||||
},
|
||||
getList() {
|
||||
let list = []
|
||||
let that = this
|
||||
that.$model.getPublicTrendList({
|
||||
aud_id: that.user.aud_id,
|
||||
|
|
@ -156,8 +154,9 @@
|
|||
padding: 0 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.TrendPage {
|
||||
margin-top: 50px;
|
||||
width: calc(1005 - 30px);
|
||||
width: 100%
|
||||
}
|
||||
</style>
|
||||
|
|
@ -64,7 +64,11 @@
|
|||
},
|
||||
onUnload: function() {
|
||||
let that = this
|
||||
that.$ble.closeBluetoothAdapter()
|
||||
that.$store.commit("changeBluetoothValue", {
|
||||
isFood: false,
|
||||
isConnectStatus: 1,
|
||||
bleTipsText: "点击重新连接",
|
||||
})
|
||||
that.$store.commit("changehomeCard", 0);
|
||||
that.$ble.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||
},
|
||||
|
|
|
|||
|
|
@ -65,7 +65,11 @@
|
|||
},
|
||||
onUnload: function() {
|
||||
let that = this
|
||||
that.$ble.closeBluetoothAdapter()
|
||||
that.$store.commit("changeBluetoothValue", {
|
||||
isFood: false,
|
||||
isConnectStatus: 1,
|
||||
bleTipsText: "点击重新连接",
|
||||
})
|
||||
that.$store.commit("changehomeCard", 0);
|
||||
that.$ble.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||
},
|
||||
|
|
|
|||
|
|
@ -66,8 +66,11 @@
|
|||
},
|
||||
onUnload: function() {
|
||||
let that = this
|
||||
that.$ble.closeBLEConnection()
|
||||
that.$ble.closeBluetoothAdapter()
|
||||
that.$store.commit("changeBluetoothValue", {
|
||||
isFood: false,
|
||||
isConnectStatus: 1,
|
||||
bleTipsText: "点击重新连接",
|
||||
})
|
||||
that.$store.commit("changehomeCard", 0);
|
||||
that.$ble.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||
},
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@
|
|||
}
|
||||
setTimeout(function() {
|
||||
uni.switchTab({
|
||||
url: "/pages/home/home"
|
||||
url: "/pages/index/index"
|
||||
})
|
||||
}, 200)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@
|
|||
import {
|
||||
mapState
|
||||
} from "vuex";
|
||||
import headerIndex from "@/element/headerIndex.vue"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -93,9 +92,6 @@
|
|||
user: {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
headerIndex
|
||||
},
|
||||
computed: {
|
||||
...mapState(["accountNumber", "familayList", "CooperationUrl", ]),
|
||||
nickname() {
|
||||
|
|
|
|||
|
|
@ -16,8 +16,32 @@
|
|||
uni.navigateToMiniProgram({
|
||||
appId: "wxdd371c9267b7299b",
|
||||
path: "/pages/index/index",
|
||||
success() {
|
||||
success(res) {
|
||||
console.log('跳转成功');
|
||||
if (res.cancel) {
|
||||
uni.showToast({
|
||||
title: "您已取消操作",
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
})
|
||||
setTimeout(function() {
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index"
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
fail() {
|
||||
uni.showToast({
|
||||
title: "您已取消操作",
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
})
|
||||
setTimeout(function() {
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index"
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1261,3 +1261,44 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
.voice-wave {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.wave-bar {
|
||||
width: 6px;
|
||||
background: #3498db;
|
||||
border-radius: 3px;
|
||||
animation: wave 1.2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.wave-bar:nth-child(2) {
|
||||
animation-delay: -1.1s;
|
||||
}
|
||||
|
||||
.wave-bar:nth-child(3) {
|
||||
animation-delay: -1.0s;
|
||||
}
|
||||
|
||||
.wave-bar:nth-child(4) {
|
||||
animation-delay: -0.9s;
|
||||
}
|
||||
|
||||
.wave-bar:nth-child(5) {
|
||||
animation-delay: -0.8s;
|
||||
}
|
||||
|
||||
@keyframes wave {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
50% {
|
||||
height: 30px;
|
||||
}
|
||||
}
|
||||
|
|
@ -54,36 +54,42 @@
|
|||
.left {
|
||||
float: left;
|
||||
width: 270rpx;
|
||||
height: 320rpx;
|
||||
height: 300rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.chart-wrap {
|
||||
position: relative;
|
||||
width: 250rpx;
|
||||
height: 250rpx;
|
||||
margin-top: -30rpx;
|
||||
margin-left: 5px;
|
||||
width: 260rpx;
|
||||
height: 260rpx;
|
||||
// margin-top: -10rpx;
|
||||
margin-left: 0px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.center {
|
||||
border: none;
|
||||
width: 280rpx;
|
||||
width: 255rpx;
|
||||
height: 210rpx;
|
||||
position: absolute;
|
||||
top: 64rpx;
|
||||
top: 25rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
text{
|
||||
margin: 5px 0;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mubiao {
|
||||
width: 100%;
|
||||
margin-top: 32rpx;
|
||||
margin-top: 0rpx;
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
|
@ -366,7 +372,7 @@
|
|||
position: relative;
|
||||
width: 280rpx;
|
||||
height: 280rpx;
|
||||
margin-top: -30rpx;
|
||||
margin-top: 0rpx;
|
||||
margin-left: -20px;
|
||||
|
||||
// .uchart-kcal {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ export default {
|
|||
tools.msg(res.msg)
|
||||
return
|
||||
}
|
||||
uni.setStorageSync('userid', res.data.id)
|
||||
uni.setStorageSync('userid', res.data.aud_id)
|
||||
uni.setStorageSync('gender', res.data.gender)
|
||||
commit('changeUser', res.data)
|
||||
});
|
||||
|
|
@ -76,7 +76,15 @@ export default {
|
|||
commit('changeCardList', res.data)
|
||||
})
|
||||
},
|
||||
|
||||
//趋势
|
||||
GetBodyTrendList({
|
||||
commit
|
||||
}, account) {
|
||||
return model.getTrendList(account).then((res) => {
|
||||
console.log("趋势", res)
|
||||
commit('changeTrend', res.data)
|
||||
})
|
||||
},
|
||||
getPublicRecord({
|
||||
commit
|
||||
}, account) {
|
||||
|
|
|
|||
|
|
@ -121,6 +121,13 @@ export default new Vuex.Store({
|
|||
isRecord: false, //手动记录
|
||||
isPublicRecord: false, //公共手动记录弹框
|
||||
isBluetoothTyle: false,
|
||||
trendInfo:{
|
||||
weightList:[],
|
||||
target_weight:"",
|
||||
calculate_val:"",
|
||||
initial_weight:"",
|
||||
calculate_time:"",
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
// 版本信息
|
||||
|
|
@ -176,6 +183,10 @@ export default new Vuex.Store({
|
|||
changeMeasureResult(state, newData) {
|
||||
Object.assign(state.MeasureResult, newData)
|
||||
},
|
||||
//趋势
|
||||
changeTrend(state, newData) {
|
||||
state.trendInfo = newData
|
||||
},
|
||||
// 菜谱
|
||||
changeMenuList(state, newData) {
|
||||
state.menuList = newData
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ function Bluetoothfilter(device) {
|
|||
return
|
||||
}
|
||||
// 广播思迈德协议,假阻抗,体脂秤
|
||||
if (device.name.toLowerCase() == "da") {
|
||||
if (device.name.toLowerCase().indexOf('da') != -1 ) {
|
||||
uni.navigateTo({
|
||||
url: "/pageTwo/devices/PCL22S?deviceId=" + device.deviceId
|
||||
})
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -28,61 +28,127 @@
|
|||
<!-- APP和H5采用renderjs渲染图表 -->
|
||||
<!-- #ifdef APP-VUE || H5 -->
|
||||
<block v-if="echarts">
|
||||
<view :style="{ background: background }" style="width: 100%;height: 100%;" :data-directory="directory"
|
||||
:id="'EC'+cid" :prop="echartsOpts" :change:prop="rdcharts.ecinit" :resize="echartsResize"
|
||||
:change:resize="rdcharts.ecresize" v-show="showchart" />
|
||||
<view
|
||||
:style="{ background: background }"
|
||||
style="width: 100%;height: 100%;"
|
||||
:data-directory="directory"
|
||||
:id="'EC'+cid"
|
||||
:prop="echartsOpts"
|
||||
:change:prop="rdcharts.ecinit"
|
||||
:resize="echartsResize"
|
||||
:change:resize="rdcharts.ecresize"
|
||||
v-show="showchart"
|
||||
/>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view v-on:tap="rdcharts.tap" v-on:mousemove="rdcharts.mouseMove" v-on:mousedown="rdcharts.mouseDown"
|
||||
v-on:mouseup="rdcharts.mouseUp" v-on:touchstart="rdcharts.touchStart"
|
||||
v-on:touchmove="rdcharts.touchMove" v-on:touchend="rdcharts.touchEnd" :id="'UC'+cid" :prop="uchartsOpts"
|
||||
:change:prop="rdcharts.ucinit">
|
||||
<canvas :id="cid" :canvasId="cid"
|
||||
<view
|
||||
v-on:tap="rdcharts.tap"
|
||||
v-on:mousemove="rdcharts.mouseMove"
|
||||
v-on:mousedown="rdcharts.mouseDown"
|
||||
v-on:mouseup="rdcharts.mouseUp"
|
||||
v-on:touchstart="rdcharts.touchStart"
|
||||
v-on:touchmove="rdcharts.touchMove"
|
||||
v-on:touchend="rdcharts.touchEnd"
|
||||
:id="'UC'+cid"
|
||||
:prop="uchartsOpts"
|
||||
:change:prop="rdcharts.ucinit"
|
||||
>
|
||||
<canvas
|
||||
:id="cid"
|
||||
:canvasId="cid"
|
||||
:style="{ width: cWidth + 'px', height: cHeight + 'px', background: background }"
|
||||
:disable-scroll="disableScroll" @error="_error" v-show="showchart" />
|
||||
:disable-scroll="disableScroll"
|
||||
@error="_error"
|
||||
v-show="showchart"
|
||||
/>
|
||||
</view>
|
||||
</block>
|
||||
<!-- #endif -->
|
||||
<!-- 支付宝小程序 -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<block v-if="ontouch">
|
||||
<canvas :id="cid" :canvasId="cid" :width="cWidth * pixel" :height="cHeight * pixel"
|
||||
<canvas
|
||||
:id="cid"
|
||||
:canvasId="cid"
|
||||
:width="cWidth * pixel"
|
||||
:height="cHeight * pixel"
|
||||
:style="{ width: cWidth + 'px', height: cHeight + 'px', background: background }"
|
||||
:disable-scroll="disScroll" @tap="_tap" @touchstart="_touchStart" @touchmove="_touchMove"
|
||||
@touchend="_touchEnd" @error="_error" v-show="showchart" />
|
||||
:disable-scroll="disScroll"
|
||||
@tap="_tap"
|
||||
@touchstart="_touchStart"
|
||||
@touchmove="_touchMove"
|
||||
@touchend="_touchEnd"
|
||||
@error="_error"
|
||||
v-show="showchart"
|
||||
/>
|
||||
</block>
|
||||
<block v-if="!ontouch">
|
||||
<canvas :id="cid" :canvasId="cid" :width="cWidth * pixel" :height="cHeight * pixel"
|
||||
<canvas
|
||||
:id="cid"
|
||||
:canvasId="cid"
|
||||
:width="cWidth * pixel"
|
||||
:height="cHeight * pixel"
|
||||
:style="{ width: cWidth + 'px', height: cHeight + 'px', background: background }"
|
||||
:disable-scroll="disScroll" @tap="_tap" @error="_error" v-show="showchart" />
|
||||
:disable-scroll="disScroll"
|
||||
@tap="_tap"
|
||||
@error="_error"
|
||||
v-show="showchart"
|
||||
/>
|
||||
</block>
|
||||
<!-- #endif -->
|
||||
<!-- 其他小程序通过vue渲染图表 -->
|
||||
<!-- #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-TOUTIAO || MP-KUAISHOU || MP-LARK || MP-JD || MP-360 -->
|
||||
<block v-if="type2d">
|
||||
<view v-if="ontouch" @tap="_tap">
|
||||
<canvas :id="cid" :canvasId="cid"
|
||||
:style="{ width: cWidth + 'px', height: cHeight + 'px', background: background }" type="2d"
|
||||
:disable-scroll="disScroll" @touchstart="_touchStart" @touchmove="_touchMove" @touchend="_touchEnd"
|
||||
@error="_error" v-show="showchart" />
|
||||
<canvas
|
||||
:id="cid"
|
||||
:canvasId="cid"
|
||||
:style="{ width: cWidth + 'px', height: cHeight + 'px', background: background }"
|
||||
type="2d"
|
||||
:disable-scroll="disScroll"
|
||||
@touchstart="_touchStart"
|
||||
@touchmove="_touchMove"
|
||||
@touchend="_touchEnd"
|
||||
@error="_error"
|
||||
v-show="showchart"
|
||||
/>
|
||||
</view>
|
||||
<view v-if="!ontouch" @tap="_tap">
|
||||
<canvas :id="cid" :canvasId="cid"
|
||||
:style="{ width: cWidth + 'px', height: cHeight + 'px', background: background }" type="2d"
|
||||
:disable-scroll="disScroll" @error="_error" v-show="showchart" />
|
||||
<canvas
|
||||
:id="cid"
|
||||
:canvasId="cid"
|
||||
:style="{ width: cWidth + 'px', height: cHeight + 'px', background: background }"
|
||||
type="2d"
|
||||
:disable-scroll="disScroll"
|
||||
@error="_error"
|
||||
v-show="showchart"
|
||||
/>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="!type2d">
|
||||
<view v-if="ontouch" @tap="_tap">
|
||||
<canvas :id="cid" :canvasId="cid"
|
||||
<canvas
|
||||
:id="cid"
|
||||
:canvasId="cid"
|
||||
:style="{ width: cWidth + 'px', height: cHeight + 'px', background: background }"
|
||||
@touchstart="_touchStart" @touchmove="_touchMove" @touchend="_touchEnd" :disable-scroll="disScroll"
|
||||
@error="_error" v-if="showchart" />
|
||||
@touchstart="_touchStart"
|
||||
@touchmove="_touchMove"
|
||||
@touchend="_touchEnd"
|
||||
:disable-scroll="disScroll"
|
||||
@error="_error"
|
||||
v-if="showchart"
|
||||
/>
|
||||
</view>
|
||||
<view v-if="!ontouch" >
|
||||
<canvas :id="cid" :canvasId="cid"
|
||||
<canvas
|
||||
:id="cid"
|
||||
:canvasId="cid"
|
||||
:style="{ width: cWidth + 'px', height: cHeight + 'px', background: background }"
|
||||
:disable-scroll="disScroll" @tap="_tap" @error="_error" v-if="showchart" />
|
||||
:disable-scroll="disScroll"
|
||||
@tap="_tap"
|
||||
@error="_error"
|
||||
v-if="showchart"
|
||||
/>
|
||||
</view>
|
||||
</block>
|
||||
<!-- #endif -->
|
||||
|
|
@ -100,9 +166,7 @@
|
|||
for (let i in args) {
|
||||
for (let key in args[i]) {
|
||||
if (args[i].hasOwnProperty(key)) {
|
||||
origin[key] = args[i][key] && typeof args[i][key] === 'object' ? deepCloneAssign(Array.isArray(args[i][
|
||||
key
|
||||
]) ? [] : {}, origin[key], args[i][key]) : args[i][key];
|
||||
origin[key] = args[i][key] && typeof args[i][key] === 'object' ? deepCloneAssign(Array.isArray(args[i][key]) ? [] : {}, origin[key], args[i][key]) : args[i][key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -323,14 +387,6 @@
|
|||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
Height: {
|
||||
type: Number,
|
||||
default: 340
|
||||
},
|
||||
Width: {
|
||||
type: Number,
|
||||
default: 340
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
|
@ -347,8 +403,8 @@
|
|||
disScroll: false,
|
||||
openmouse: false,
|
||||
pixel: 1,
|
||||
cWidth: 340,
|
||||
cHeight: 240,
|
||||
cWidth: 375,
|
||||
cHeight: 250,
|
||||
showchart: false,
|
||||
echarts: false,
|
||||
echartsResize:{
|
||||
|
|
@ -404,7 +460,6 @@
|
|||
this.disScroll = this.disableScroll;
|
||||
},
|
||||
mounted() {
|
||||
let that = this
|
||||
// #ifdef APP-VUE
|
||||
this.inApp = true;
|
||||
if (this.echartsApp === true) {
|
||||
|
|
@ -426,8 +481,6 @@
|
|||
this.echarts = true;
|
||||
}
|
||||
// #endif
|
||||
this.cWidth = this.Width ? this.Width : this.cWidth;
|
||||
this.cHeight = this.Height ? this.Height : this.cHeight;
|
||||
this.$nextTick(()=>{
|
||||
this.beforeInit();
|
||||
})
|
||||
|
|
@ -507,8 +560,7 @@
|
|||
optsProps: {
|
||||
handler(val, oldval) {
|
||||
if (typeof val === 'object') {
|
||||
if (JSON.stringify(val) !== JSON.stringify(oldval) && this.echarts === false && this.optsWatch ==
|
||||
true) {
|
||||
if (JSON.stringify(val) !== JSON.stringify(oldval) && this.echarts === false && this.optsWatch == true) {
|
||||
this.checkData(this.drawData);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -554,15 +606,7 @@
|
|||
},
|
||||
mixinDatacomErrorMessage(val, oldval) {
|
||||
if (val) {
|
||||
this.emitMsg({
|
||||
name: 'error',
|
||||
params: {
|
||||
type: "error",
|
||||
errorShow: this.errorShow,
|
||||
msg: val,
|
||||
id: this.cid
|
||||
}
|
||||
});
|
||||
this.emitMsg({name: 'error', params: {type:"error", errorShow: this.errorShow, msg: val, id: this.cid}});
|
||||
if(this.errorShow){
|
||||
console.log('[秋云图表组件]' + val);
|
||||
}
|
||||
|
|
@ -594,8 +638,7 @@
|
|||
methods: {
|
||||
beforeInit(){
|
||||
this.mixinDatacomErrorMessage = null;
|
||||
if (typeof this.chartData === 'object' && this.chartData != null && this.chartData.series !== undefined &&
|
||||
this.chartData.series.length > 0) {
|
||||
if (typeof this.chartData === 'object' && this.chartData != null && this.chartData.series !== undefined && this.chartData.series.length > 0) {
|
||||
//拷贝一下chartData,为了opts变更后统一数据来源
|
||||
this.drawData = deepCloneAssign({}, this.chartData);
|
||||
this.mixinDatacomLoading = false;
|
||||
|
|
@ -633,10 +676,7 @@
|
|||
}
|
||||
}
|
||||
let needCategories = false;
|
||||
let tmpData = {
|
||||
categories: [],
|
||||
series: []
|
||||
}
|
||||
let tmpData = {categories:[], series:[]}
|
||||
let tmpcategories = []
|
||||
let tmpseries = [];
|
||||
//拼接categories
|
||||
|
|
@ -676,19 +716,13 @@
|
|||
let tempskey = {};
|
||||
resdata.map(function(item, index) {
|
||||
if (item.group != undefined && !tempskey[item.group]) {
|
||||
tmpseries.push({
|
||||
name: item.group,
|
||||
data: []
|
||||
});
|
||||
tmpseries.push({ name: item.group, data: [] });
|
||||
tempskey[item.group] = true;
|
||||
}
|
||||
});
|
||||
//如果没有获取到分组名称(可能是带categories的数据,也可能是不带的饼图类)
|
||||
if (tmpseries.length == 0) {
|
||||
tmpseries = [{
|
||||
name: '默认分组',
|
||||
data: []
|
||||
}];
|
||||
tmpseries = [{ name: '默认分组', data: [] }];
|
||||
//如果是需要categories的图表类型
|
||||
if(needCategories === true){
|
||||
for (let j = 0; j < tmpcategories.length; j++) {
|
||||
|
|
@ -703,10 +737,7 @@
|
|||
//如果是饼图类的图表类型
|
||||
}else{
|
||||
for (let i = 0; i < resdata.length; i++) {
|
||||
tmpseries[0].data.push({
|
||||
"name": resdata[i].text,
|
||||
"value": resdata[i].value
|
||||
});
|
||||
tmpseries[0].data.push({"name": resdata[i].text,"value": resdata[i].value});
|
||||
}
|
||||
}
|
||||
//如果有分组名
|
||||
|
|
@ -858,8 +889,7 @@
|
|||
this.cWidth = data.width;
|
||||
this.cHeight = data.height;
|
||||
if(this.echarts !== true){
|
||||
cfu.option[cid].background = this.background == 'rgba(0,0,0,0)' ? '#FFFFFF' : this
|
||||
.background;
|
||||
cfu.option[cid].background = this.background == 'rgba(0,0,0,0)' ? '#FFFFFF' : this.background;
|
||||
cfu.option[cid].canvas2d = this.type2d;
|
||||
cfu.option[cid].pixelRatio = this.pixel;
|
||||
cfu.option[cid].animation = this.animation;
|
||||
|
|
@ -902,18 +932,14 @@
|
|||
const query = uni.createSelectorQuery().in(this)
|
||||
query
|
||||
.select('#' + cid)
|
||||
.fields({
|
||||
node: true,
|
||||
size: true
|
||||
})
|
||||
.fields({ node: true, size: true })
|
||||
.exec(res => {
|
||||
if (res[0]) {
|
||||
const canvas = res[0].node;
|
||||
const ctx = canvas.getContext('2d');
|
||||
cfu.option[cid].context = ctx;
|
||||
cfu.option[cid].rotateLock = cfu.option[cid].rotate;
|
||||
if (cfu.instance[cid] && cfu.option[cid] && cfu.option[
|
||||
cid].update === true) {
|
||||
if(cfu.instance[cid] && cfu.option[cid] && cfu.option[cid].update === true){
|
||||
this._updataUChart(cid)
|
||||
}else{
|
||||
canvas.width = data.width * this.pixel;
|
||||
|
|
@ -928,8 +954,7 @@
|
|||
}
|
||||
} else {
|
||||
this.showchart = false;
|
||||
this.mixinDatacomErrorMessage =
|
||||
'参数错误:开启2d模式后,未获取到dom节点,canvas-id:' + cid;
|
||||
this.mixinDatacomErrorMessage = '参数错误:开启2d模式后,未获取到dom节点,canvas-id:' + cid;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
@ -937,8 +962,7 @@
|
|||
cfu.option[cid].rotateLock = cfu.option[cid].rotate;
|
||||
}
|
||||
cfu.option[cid].context = uni.createCanvasContext(cid, this);
|
||||
if (cfu.instance[cid] && cfu.option[cid] && cfu.option[cid].update ===
|
||||
true) {
|
||||
if(cfu.instance[cid] && cfu.option[cid] && cfu.option[cid].update === true){
|
||||
this._updataUChart(cid)
|
||||
}else{
|
||||
setTimeout(()=>{
|
||||
|
|
@ -990,33 +1014,18 @@
|
|||
uni.canvasToTempFilePath({
|
||||
canvasId: this.cid,
|
||||
success: res=>{
|
||||
this.emitMsg({
|
||||
name: 'getImage',
|
||||
params: {
|
||||
type: "getImage",
|
||||
base64: res.tempFilePath
|
||||
}
|
||||
});
|
||||
this.emitMsg({name: 'getImage', params: {type:"getImage", base64: res.tempFilePath}});
|
||||
}
|
||||
},this);
|
||||
}else{
|
||||
const query = uni.createSelectorQuery().in(this)
|
||||
query
|
||||
.select('#' + this.cid)
|
||||
.fields({
|
||||
node: true,
|
||||
size: true
|
||||
})
|
||||
.fields({ node: true, size: true })
|
||||
.exec(res => {
|
||||
if (res[0]) {
|
||||
const canvas = res[0].node;
|
||||
this.emitMsg({
|
||||
name: 'getImage',
|
||||
params: {
|
||||
type: "getImage",
|
||||
base64: canvas.toDataURL('image/png')
|
||||
}
|
||||
});
|
||||
this.emitMsg({name: 'getImage', params: {type:"getImage", base64: canvas.toDataURL('image/png')}});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -1029,38 +1038,14 @@
|
|||
this.showchart = true;
|
||||
cfu.instance[cid] = new uCharts(cfu.option[cid]);
|
||||
cfu.instance[cid].addEventListener('renderComplete', () => {
|
||||
this.emitMsg({
|
||||
name: 'complete',
|
||||
params: {
|
||||
type: "complete",
|
||||
complete: true,
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
});
|
||||
this.emitMsg({name: 'complete', params: {type:"complete", complete: true, id: cid, opts: cfu.instance[cid].opts}});
|
||||
cfu.instance[cid].delEventListener('renderComplete')
|
||||
});
|
||||
cfu.instance[cid].addEventListener('scrollLeft', () => {
|
||||
this.emitMsg({
|
||||
name: 'scrollLeft',
|
||||
params: {
|
||||
type: "scrollLeft",
|
||||
scrollLeft: true,
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
});
|
||||
this.emitMsg({name: 'scrollLeft', params: {type:"scrollLeft", scrollLeft: true, id: cid, opts: cfu.instance[cid].opts}});
|
||||
});
|
||||
cfu.instance[cid].addEventListener('scrollRight', () => {
|
||||
this.emitMsg({
|
||||
name: 'scrollRight',
|
||||
params: {
|
||||
type: "scrollRight",
|
||||
scrollRight: true,
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
});
|
||||
this.emitMsg({name: 'scrollRight', params: {type:"scrollRight", scrollRight: true, id: cid, opts: cfu.instance[cid].opts}});
|
||||
});
|
||||
},
|
||||
_updataUChart(cid) {
|
||||
|
|
@ -1087,20 +1072,15 @@
|
|||
if (tc && tc !== undefined && tc !== null) {
|
||||
let offset = undefined;
|
||||
if (tc.x >= 0 && tc.y >= 0) {
|
||||
offset = {
|
||||
x: tc.x,
|
||||
y: tc.y + 10
|
||||
};
|
||||
offset = { x: tc.x, y: tc.y + 10 };
|
||||
}
|
||||
cfu.instance[cid].showToolTip(e, {
|
||||
index: tc.index,
|
||||
offset: offset,
|
||||
textList: tc.textList,
|
||||
formatter: (item, category, index, opts) => {
|
||||
if (typeof cfu.option[cid].tooltipFormat === 'string' && cfu.formatter[cfu.option[
|
||||
cid].tooltipFormat]) {
|
||||
return cfu.formatter[cfu.option[cid].tooltipFormat](item, category, index,
|
||||
opts);
|
||||
if (typeof cfu.option[cid].tooltipFormat === 'string' && cfu.formatter[cfu.option[cid].tooltipFormat]) {
|
||||
return cfu.formatter[cfu.option[cid].tooltipFormat](item, category, index, opts);
|
||||
} else {
|
||||
return this._tooltipDefault(item, category, index, opts);
|
||||
}
|
||||
|
|
@ -1109,10 +1089,8 @@
|
|||
} else {
|
||||
cfu.instance[cid].showToolTip(e, {
|
||||
formatter: (item, category, index, opts) => {
|
||||
if (typeof cfu.option[cid].tooltipFormat === 'string' && cfu.formatter[cfu.option[
|
||||
cid].tooltipFormat]) {
|
||||
return cfu.formatter[cfu.option[cid].tooltipFormat](item, category, index,
|
||||
opts);
|
||||
if (typeof cfu.option[cid].tooltipFormat === 'string' && cfu.formatter[cfu.option[cid].tooltipFormat]) {
|
||||
return cfu.formatter[cfu.option[cid].tooltipFormat](item, category, index, opts);
|
||||
} else {
|
||||
return this._tooltipDefault(item, category, index, opts);
|
||||
}
|
||||
|
|
@ -1137,15 +1115,9 @@
|
|||
.boundingClientRect(data => {
|
||||
e.changedTouches=[];
|
||||
if (this.inAli) {
|
||||
e.changedTouches.unshift({
|
||||
x: e.detail.clientX - data.left,
|
||||
y: e.detail.clientY - data.top
|
||||
});
|
||||
e.changedTouches.unshift({ x: e.detail.clientX - data.left, y: e.detail.clientY - data.top});
|
||||
}else{
|
||||
e.changedTouches.unshift({
|
||||
x: e.detail.x - data.left,
|
||||
y: e.detail.y - data.top - this.pageScrollTop
|
||||
});
|
||||
e.changedTouches.unshift({ x: e.detail.x - data.left, y: e.detail.y - data.top - this.pageScrollTop});
|
||||
}
|
||||
if(move){
|
||||
if (this.tooltipShow === true) {
|
||||
|
|
@ -1160,20 +1132,7 @@
|
|||
if (this.tooltipShow === true) {
|
||||
this._showTooltip(e);
|
||||
}
|
||||
this.emitMsg({
|
||||
name: 'getIndex',
|
||||
params: {
|
||||
type: "getIndex",
|
||||
event: {
|
||||
x: e.detail.x - data.left,
|
||||
y: e.detail.y - data.top
|
||||
},
|
||||
currentIndex: currentIndex,
|
||||
legendIndex: legendIndex,
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
});
|
||||
this.emitMsg({name: 'getIndex', params: { type:"getIndex", event:{ x: e.detail.x - data.left, y: e.detail.y - data.top }, currentIndex: currentIndex, legendIndex: legendIndex, id: cid, opts: cfu.instance[cid].opts}});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
|
|
@ -1184,10 +1143,7 @@
|
|||
}
|
||||
}else{
|
||||
e.changedTouches=[];
|
||||
e.changedTouches.unshift({
|
||||
x: e.detail.x - e.currentTarget.offsetLeft,
|
||||
y: e.detail.y - e.currentTarget.offsetTop
|
||||
});
|
||||
e.changedTouches.unshift({ x: e.detail.x - e.currentTarget.offsetLeft, y: e.detail.y - e.currentTarget.offsetTop });
|
||||
currentIndex = cfu.instance[cid].getCurrentDataIndex(e);
|
||||
legendIndex = cfu.instance[cid].getLegendDataIndex(e);
|
||||
if(this.tapLegend === true){
|
||||
|
|
@ -1196,20 +1152,7 @@
|
|||
if (this.tooltipShow === true) {
|
||||
this._showTooltip(e);
|
||||
}
|
||||
this.emitMsg({
|
||||
name: 'getIndex',
|
||||
params: {
|
||||
type: "getIndex",
|
||||
event: {
|
||||
x: e.detail.x,
|
||||
y: e.detail.y - e.currentTarget.offsetTop
|
||||
},
|
||||
currentIndex: currentIndex,
|
||||
legendIndex: legendIndex,
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
});
|
||||
this.emitMsg({name: 'getIndex', params: {type:"getIndex", event:{ x: e.detail.x, y: e.detail.y - e.currentTarget.offsetTop }, currentIndex: currentIndex, legendIndex: legendIndex, id: cid, opts: cfu.instance[cid].opts}});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1219,15 +1162,7 @@
|
|||
if(cfu.option[cid].enableScroll === true && e.touches.length == 1){
|
||||
cfu.instance[cid].scrollStart(e);
|
||||
}
|
||||
this.emitMsg({
|
||||
name: 'getTouchStart',
|
||||
params: {
|
||||
type: "touchStart",
|
||||
event: e.changedTouches[0],
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
});
|
||||
this.emitMsg({name:'getTouchStart', params:{type:"touchStart", event:e.changedTouches[0], id:cid, opts: cfu.instance[cid].opts}});
|
||||
},
|
||||
_touchMove(e) {
|
||||
let cid = this.cid
|
||||
|
|
@ -1242,34 +1177,17 @@
|
|||
if(this.ontap === true && cfu.option[cid].enableScroll === false && this.onmovetip === true){
|
||||
this._tap(e,true)
|
||||
}
|
||||
if (this.ontouch === true && cfu.option[cid].enableScroll === true && this.onzoom === true && e
|
||||
.changedTouches.length == 2) {
|
||||
if(this.ontouch === true && cfu.option[cid].enableScroll === true && this.onzoom === true && e.changedTouches.length == 2){
|
||||
cfu.instance[cid].dobuleZoom(e);
|
||||
}
|
||||
this.emitMsg({
|
||||
name: 'getTouchMove',
|
||||
params: {
|
||||
type: "touchMove",
|
||||
event: e.changedTouches[0],
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
});
|
||||
this.emitMsg({name: 'getTouchMove', params: {type:"touchMove", event:e.changedTouches[0], id: cid, opts: cfu.instance[cid].opts}});
|
||||
},
|
||||
_touchEnd(e) {
|
||||
let cid = this.cid
|
||||
if(cfu.option[cid].enableScroll === true && e.touches.length == 0){
|
||||
cfu.instance[cid].scrollEnd(e);
|
||||
}
|
||||
this.emitMsg({
|
||||
name: 'getTouchEnd',
|
||||
params: {
|
||||
type: "touchEnd",
|
||||
event: e.changedTouches[0],
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
});
|
||||
this.emitMsg({name:'getTouchEnd', params:{type:"touchEnd", event:e.changedTouches[0], id:cid, opts: cfu.instance[cid].opts}});
|
||||
if(this.ontap === true && cfu.option[cid].enableScroll === false && this.onmovetip === true){
|
||||
this._tap(e,true)
|
||||
}
|
||||
|
|
@ -1307,8 +1225,7 @@
|
|||
for (let i in args) {
|
||||
for (let key in args[i]) {
|
||||
if (args[i].hasOwnProperty(key)) {
|
||||
origin[key] = args[i][key] && typeof args[i][key] === 'object' ? rddeepCloneAssign(Array.isArray(args[
|
||||
i][key]) ? [] : {}, origin[key], args[i][key]) : args[i][key];
|
||||
origin[key] = args[i][key] && typeof args[i][key] === 'object' ? rddeepCloneAssign(Array.isArray(args[i][key]) ? [] : {}, origin[key], args[i][key]) : args[i][key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1333,19 +1250,13 @@
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
rootdom = {
|
||||
top: 0,
|
||||
left: 0
|
||||
}
|
||||
rootdom = {top:0,left:0}
|
||||
// #ifdef H5
|
||||
let dm = document.querySelectorAll('uni-main')[0]
|
||||
if(dm === undefined){
|
||||
dm = document.querySelectorAll('uni-page-wrapper')[0]
|
||||
}
|
||||
rootdom = {
|
||||
top: dm.offsetTop,
|
||||
left: dm.offsetLeft
|
||||
}
|
||||
rootdom = {top:dm.offsetTop,left:dm.offsetLeft}
|
||||
// #endif
|
||||
setTimeout(()=>{
|
||||
if(this.rid === null){
|
||||
|
|
@ -1384,8 +1295,7 @@
|
|||
}
|
||||
cfe.option[cid].series = []
|
||||
for (var i = 0; i < newData.series.length; i++) {
|
||||
cfe.option[cid].seriesTemplate = cfe.option[cid].seriesTemplate ? cfe.option[cid].seriesTemplate :
|
||||
{}
|
||||
cfe.option[cid].seriesTemplate = cfe.option[cid].seriesTemplate ? cfe.option[cid].seriesTemplate : {}
|
||||
let Template = rddeepCloneAssign({},cfe.option[cid].seriesTemplate,newData.series[i])
|
||||
cfe.option[cid].series.push(Template)
|
||||
}
|
||||
|
|
@ -1420,31 +1330,13 @@
|
|||
if(cfe.option[cid].ontap === true){
|
||||
cfe.instance[cid].on('click', resdata => {
|
||||
let event = JSON.parse(JSON.stringify({
|
||||
x: resdata.event.offsetX,
|
||||
y: resdata.event.offsetY
|
||||
x:resdata.event.offsetX,y:resdata.event.offsetY
|
||||
}))
|
||||
that[cid].callMethod('emitMsg', {
|
||||
name: "getIndex",
|
||||
params: {
|
||||
type: "getIndex",
|
||||
event: event,
|
||||
currentIndex: resdata.dataIndex,
|
||||
value: resdata.data,
|
||||
seriesName: resdata.seriesName,
|
||||
id: cid
|
||||
}
|
||||
})
|
||||
that[cid].callMethod('emitMsg',{name:"getIndex", params:{type:"getIndex", event:event, currentIndex:resdata.dataIndex, value:resdata.data, seriesName: resdata.seriesName,id:cid}})
|
||||
})
|
||||
// 增加ECharts的highlight消息,实现按下移动返回索引功能。add by onefish 创建于 2021-12-11 09:50
|
||||
cfe.instance[cid].on('highlight', resdata => {
|
||||
that[cid].callMethod('emitMsg', {
|
||||
name: "getHighlight",
|
||||
params: {
|
||||
type: "highlight",
|
||||
res: resdata,
|
||||
id: cid
|
||||
}
|
||||
})
|
||||
that[cid].callMethod('emitMsg',{name:"getHighlight", params:{type:"highlight", res:resdata, id:cid}})
|
||||
})
|
||||
}
|
||||
this.updataEChart(cid,cfe.option[cid])
|
||||
|
|
@ -1460,8 +1352,7 @@
|
|||
option.tooltip.position = this.tooltipPosition()
|
||||
//tooltipFormat方法,替换组件的tooltipFormat为config-echarts.js内对应的方法
|
||||
if (typeof option.tooltipFormat === 'string' && cfe.formatter[option.tooltipFormat]) {
|
||||
option.tooltip.formatter = option.tooltip.formatter ? option.tooltip.formatter : cfe.formatter[
|
||||
option.tooltipFormat]
|
||||
option.tooltip.formatter = option.tooltip.formatter ? option.tooltip.formatter : cfe.formatter[option.tooltipFormat]
|
||||
}
|
||||
}
|
||||
// 颜色渐变添加的方法
|
||||
|
|
@ -1469,21 +1360,13 @@
|
|||
for (let i in option.series) {
|
||||
let linearGradient = option.series[i].linearGradient
|
||||
if (linearGradient) {
|
||||
option.series[i].color = new echarts.graphic.LinearGradient(linearGradient[0], linearGradient[
|
||||
1], linearGradient[2], linearGradient[3], linearGradient[4])
|
||||
option.series[i].color = new echarts.graphic.LinearGradient(linearGradient[0],linearGradient[1],linearGradient[2],linearGradient[3],linearGradient[4])
|
||||
}
|
||||
}
|
||||
}
|
||||
cfe.instance[cid].setOption(option, option.notMerge)
|
||||
cfe.instance[cid].on('finished', function(){
|
||||
that[cid].callMethod('emitMsg', {
|
||||
name: "complete",
|
||||
params: {
|
||||
type: "complete",
|
||||
complete: true,
|
||||
id: cid
|
||||
}
|
||||
})
|
||||
that[cid].callMethod('emitMsg',{name:"complete",params:{type:"complete",complete:true,id:cid}})
|
||||
if(cfe.instance[cid]){
|
||||
cfe.instance[cid].off('finished')
|
||||
}
|
||||
|
|
@ -1496,9 +1379,7 @@
|
|||
Math.abs( that[cid].$el.children[0].clientWidth - cfe.instance[cid].getWidth() )>3 ||
|
||||
Math.abs( that[cid].$el.children[0].clientHeight - cfe.instance[cid].getHeight() )>3
|
||||
)
|
||||
) {
|
||||
this.ecresize();
|
||||
}
|
||||
){this.ecresize();}
|
||||
},
|
||||
tooltipPosition(){
|
||||
return (point, params, dom, rect, size) => {
|
||||
|
|
@ -1550,38 +1431,14 @@
|
|||
let cid = this.rid
|
||||
cfu.instance[cid] = new uChartsRD(cfu.option[cid])
|
||||
cfu.instance[cid].addEventListener('renderComplete', () => {
|
||||
that[cid].callMethod('emitMsg', {
|
||||
name: "complete",
|
||||
params: {
|
||||
type: "complete",
|
||||
complete: true,
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
})
|
||||
that[cid].callMethod('emitMsg',{name:"complete",params:{type:"complete",complete:true,id:cid, opts: cfu.instance[cid].opts}})
|
||||
cfu.instance[cid].delEventListener('renderComplete')
|
||||
});
|
||||
cfu.instance[cid].addEventListener('scrollLeft', () => {
|
||||
that[cid].callMethod('emitMsg', {
|
||||
name: "scrollLeft",
|
||||
params: {
|
||||
type: "scrollLeft",
|
||||
scrollLeft: true,
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
})
|
||||
that[cid].callMethod('emitMsg',{name:"scrollLeft",params:{type:"scrollLeft",scrollLeft:true,id:cid, opts: cfu.instance[cid].opts}})
|
||||
});
|
||||
cfu.instance[cid].addEventListener('scrollRight', () => {
|
||||
that[cid].callMethod('emitMsg', {
|
||||
name: "scrollRight",
|
||||
params: {
|
||||
type: "scrollRight",
|
||||
scrollRight: true,
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
})
|
||||
that[cid].callMethod('emitMsg',{name:"scrollRight",params:{type:"scrollRight",scrollRight:true,id:cid, opts: cfu.instance[cid].opts}})
|
||||
});
|
||||
},
|
||||
updataUChart() {
|
||||
|
|
@ -1608,20 +1465,15 @@
|
|||
if (tc && tc !== undefined && tc !== null) {
|
||||
let offset = undefined;
|
||||
if (tc.x >= 0 && tc.y >= 0) {
|
||||
offset = {
|
||||
x: tc.x,
|
||||
y: tc.y + 10
|
||||
};
|
||||
offset = { x: tc.x, y: tc.y + 10 };
|
||||
}
|
||||
cfu.instance[cid].showToolTip(e, {
|
||||
index: tc.index,
|
||||
offset: offset,
|
||||
textList: tc.textList,
|
||||
formatter: (item, category, index, opts) => {
|
||||
if (typeof cfu.option[cid].tooltipFormat === 'string' && cfu.formatter[cfu.option[
|
||||
cid].tooltipFormat]) {
|
||||
return cfu.formatter[cfu.option[cid].tooltipFormat](item, category, index,
|
||||
opts);
|
||||
if (typeof cfu.option[cid].tooltipFormat === 'string' && cfu.formatter[cfu.option[cid].tooltipFormat]) {
|
||||
return cfu.formatter[cfu.option[cid].tooltipFormat](item, category, index, opts);
|
||||
} else {
|
||||
return this.tooltipDefault(item, category, index, opts);
|
||||
}
|
||||
|
|
@ -1630,10 +1482,8 @@
|
|||
} else {
|
||||
cfu.instance[cid].showToolTip(e, {
|
||||
formatter: (item, category, index, opts) => {
|
||||
if (typeof cfu.option[cid].tooltipFormat === 'string' && cfu.formatter[cfu.option[
|
||||
cid].tooltipFormat]) {
|
||||
return cfu.formatter[cfu.option[cid].tooltipFormat](item, category, index,
|
||||
opts);
|
||||
if (typeof cfu.option[cid].tooltipFormat === 'string' && cfu.formatter[cfu.option[cid].tooltipFormat]) {
|
||||
return cfu.formatter[cfu.option[cid].tooltipFormat](item, category, index, opts);
|
||||
} else {
|
||||
return this.tooltipDefault(item, category, index, opts);
|
||||
}
|
||||
|
|
@ -1652,15 +1502,9 @@
|
|||
let rchartdom = document.getElementById('UC'+cid).getBoundingClientRect()
|
||||
let tmpe = {}
|
||||
if(e.detail.x){//tap或者click的事件
|
||||
tmpe = {
|
||||
x: e.detail.x - rchartdom.left,
|
||||
y: e.detail.y - rchartdom.top + rootdom.top
|
||||
}
|
||||
tmpe = { x: e.detail.x - rchartdom.left, y:e.detail.y - rchartdom.top + rootdom.top}
|
||||
}else{//mouse的事件
|
||||
tmpe = {
|
||||
x: e.clientX - rchartdom.left,
|
||||
y: e.clientY - rchartdom.top + rootdom.top
|
||||
}
|
||||
tmpe = { x: e.clientX - rchartdom.left, y:e.clientY - rchartdom.top + rootdom.top}
|
||||
}
|
||||
e.changedTouches = [];
|
||||
e.changedTouches.unshift(tmpe)
|
||||
|
|
@ -1672,17 +1516,7 @@
|
|||
if(tooltipShow==true){
|
||||
this.showTooltip(e,cid)
|
||||
}
|
||||
that[cid].callMethod('emitMsg', {
|
||||
name: "getIndex",
|
||||
params: {
|
||||
type: "getIndex",
|
||||
event: tmpe,
|
||||
currentIndex: currentIndex,
|
||||
legendIndex: legendIndex,
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
})
|
||||
that[cid].callMethod('emitMsg',{name:"getIndex",params:{type:"getIndex",event:tmpe,currentIndex:currentIndex,legendIndex:legendIndex,id:cid, opts: cfu.instance[cid].opts}})
|
||||
},
|
||||
touchStart(e) {
|
||||
let cid = this.rid
|
||||
|
|
@ -1691,15 +1525,7 @@
|
|||
if(cfu.option[cid].enableScroll === true && e.touches.length == 1){
|
||||
cfu.instance[cid].scrollStart(e);
|
||||
}
|
||||
that[cid].callMethod('emitMsg', {
|
||||
name: "getTouchStart",
|
||||
params: {
|
||||
type: "touchStart",
|
||||
event: e.changedTouches[0],
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
})
|
||||
that[cid].callMethod('emitMsg',{name:"getTouchStart",params:{type:"touchStart",event:e.changedTouches[0],id:cid, opts: cfu.instance[cid].opts}})
|
||||
},
|
||||
touchMove(e) {
|
||||
let cid = this.rid
|
||||
|
|
@ -1708,31 +1534,18 @@
|
|||
if(cfu.option[cid].enableScroll === true && e.changedTouches.length == 1){
|
||||
cfu.instance[cid].scroll(e);
|
||||
}
|
||||
if (cfu.option[cid].ontap === true && cfu.option[cid].enableScroll === false && cfu.option[cid]
|
||||
.onmovetip === true) {
|
||||
if(cfu.option[cid].ontap === true && cfu.option[cid].enableScroll === false && cfu.option[cid].onmovetip === true){
|
||||
let rchartdom = document.getElementById('UC'+cid).getBoundingClientRect()
|
||||
let tmpe = {
|
||||
x: e.changedTouches[0].clientX - rchartdom.left,
|
||||
y: e.changedTouches[0].clientY - rchartdom.top + rootdom.top
|
||||
}
|
||||
let tmpe = { x: e.changedTouches[0].clientX - rchartdom.left, y:e.changedTouches[0].clientY - rchartdom.top + rootdom.top}
|
||||
e.changedTouches.unshift(tmpe)
|
||||
if(cfu.option[cid].tooltipShow === true){
|
||||
this.showTooltip(e,cid)
|
||||
}
|
||||
}
|
||||
if (ontouch === true && cfu.option[cid].enableScroll === true && cfu.option[cid].onzoom === true && e
|
||||
.changedTouches.length == 2) {
|
||||
if(ontouch === true && cfu.option[cid].enableScroll === true && cfu.option[cid].onzoom === true && e.changedTouches.length == 2){
|
||||
cfu.instance[cid].dobuleZoom(e);
|
||||
}
|
||||
that[cid].callMethod('emitMsg', {
|
||||
name: "getTouchMove",
|
||||
params: {
|
||||
type: "touchMove",
|
||||
event: e.changedTouches[0],
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
})
|
||||
that[cid].callMethod('emitMsg',{name:"getTouchMove",params:{type:"touchMove",event:e.changedTouches[0],id:cid, opts: cfu.instance[cid].opts}})
|
||||
},
|
||||
touchEnd(e) {
|
||||
let cid = this.rid
|
||||
|
|
@ -1741,15 +1554,7 @@
|
|||
if(cfu.option[cid].enableScroll === true && e.touches.length == 0){
|
||||
cfu.instance[cid].scrollEnd(e);
|
||||
}
|
||||
that[cid].callMethod('emitMsg', {
|
||||
name: "getTouchEnd",
|
||||
params: {
|
||||
type: "touchEnd",
|
||||
event: e.changedTouches[0],
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
})
|
||||
that[cid].callMethod('emitMsg',{name:"getTouchEnd",params:{type:"touchEnd",event:e.changedTouches[0],id:cid, opts: cfu.instance[cid].opts}})
|
||||
},
|
||||
mouseDown(e) {
|
||||
let cid = this.rid
|
||||
|
|
@ -1757,23 +1562,12 @@
|
|||
if(onmouse == false) return;
|
||||
let rchartdom = document.getElementById('UC'+cid).getBoundingClientRect()
|
||||
let tmpe = {}
|
||||
tmpe = {
|
||||
x: e.clientX - rchartdom.left,
|
||||
y: e.clientY - rchartdom.top + rootdom.top
|
||||
}
|
||||
tmpe = { x: e.clientX - rchartdom.left, y:e.clientY - rchartdom.top + rootdom.top}
|
||||
e.changedTouches = [];
|
||||
e.changedTouches.unshift(tmpe)
|
||||
cfu.instance[cid].scrollStart(e)
|
||||
cfu.option[cid].mousedown=true;
|
||||
that[cid].callMethod('emitMsg', {
|
||||
name: "getTouchStart",
|
||||
params: {
|
||||
type: "mouseDown",
|
||||
event: tmpe,
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
})
|
||||
that[cid].callMethod('emitMsg',{name:"getTouchStart",params:{type:"mouseDown",event:tmpe,id:cid, opts: cfu.instance[cid].opts}})
|
||||
},
|
||||
mouseMove(e) {
|
||||
let cid = this.rid
|
||||
|
|
@ -1782,23 +1576,12 @@
|
|||
if(onmouse == false) return;
|
||||
let rchartdom = document.getElementById('UC'+cid).getBoundingClientRect()
|
||||
let tmpe = {}
|
||||
tmpe = {
|
||||
x: e.clientX - rchartdom.left,
|
||||
y: e.clientY - rchartdom.top + rootdom.top
|
||||
}
|
||||
tmpe = { x: e.clientX - rchartdom.left, y:e.clientY - rchartdom.top + rootdom.top}
|
||||
e.changedTouches = [];
|
||||
e.changedTouches.unshift(tmpe)
|
||||
if(cfu.option[cid].mousedown){
|
||||
cfu.instance[cid].scroll(e)
|
||||
that[cid].callMethod('emitMsg', {
|
||||
name: "getTouchMove",
|
||||
params: {
|
||||
type: "mouseMove",
|
||||
event: tmpe,
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
})
|
||||
that[cid].callMethod('emitMsg',{name:"getTouchMove",params:{type:"mouseMove",event:tmpe,id:cid, opts: cfu.instance[cid].opts}})
|
||||
}else if(cfu.instance[cid]){
|
||||
if(tooltipShow==true){
|
||||
this.showTooltip(e,cid)
|
||||
|
|
@ -1811,23 +1594,12 @@
|
|||
if(onmouse == false) return;
|
||||
let rchartdom = document.getElementById('UC'+cid).getBoundingClientRect()
|
||||
let tmpe = {}
|
||||
tmpe = {
|
||||
x: e.clientX - rchartdom.left,
|
||||
y: e.clientY - rchartdom.top + rootdom.top
|
||||
}
|
||||
tmpe = { x: e.clientX - rchartdom.left, y:e.clientY - rchartdom.top + rootdom.top}
|
||||
e.changedTouches = [];
|
||||
e.changedTouches.unshift(tmpe)
|
||||
cfu.instance[cid].scrollEnd(e)
|
||||
cfu.option[cid].mousedown=false;
|
||||
that[cid].callMethod('emitMsg', {
|
||||
name: "getTouchEnd",
|
||||
params: {
|
||||
type: "mouseUp",
|
||||
event: tmpe,
|
||||
id: cid,
|
||||
opts: cfu.instance[cid].opts
|
||||
}
|
||||
})
|
||||
that[cid].callMethod('emitMsg',{name:"getTouchEnd",params:{type:"mouseUp",event:tmpe,id:cid, opts: cfu.instance[cid].opts}})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,580 +0,0 @@
|
|||
/*
|
||||
* uCharts®
|
||||
* 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360)、Vue、Taro等支持canvas的框架平台
|
||||
* Copyright (c) 2021 QIUN®秋云 https://www.ucharts.cn All rights reserved.
|
||||
* Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
* 复制使用请保留本段注释,感谢支持开源!
|
||||
*
|
||||
* uCharts®官方网站
|
||||
* https://www.uCharts.cn
|
||||
*
|
||||
* 开源地址:
|
||||
* https://gitee.com/uCharts/uCharts
|
||||
*
|
||||
* uni-app插件市场地址:
|
||||
* http://ext.dcloud.net.cn/plugin?id=271
|
||||
*
|
||||
*/
|
||||
|
||||
// 主题颜色配置:如每个图表类型需要不同主题,请在对应图表类型上更改color属性
|
||||
const color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'];
|
||||
|
||||
//事件转换函数,主要用作格式化x轴为时间轴,根据需求自行修改
|
||||
const formatDateTime = (timeStamp, returnType) => {
|
||||
var date = new Date();
|
||||
date.setTime(timeStamp * 1000);
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth() + 1;
|
||||
m = m < 10 ? ('0' + m) : m;
|
||||
var d = date.getDate();
|
||||
d = d < 10 ? ('0' + d) : d;
|
||||
var h = date.getHours();
|
||||
h = h < 10 ? ('0' + h) : h;
|
||||
var minute = date.getMinutes();
|
||||
var second = date.getSeconds();
|
||||
minute = minute < 10 ? ('0' + minute) : minute;
|
||||
second = second < 10 ? ('0' + second) : second;
|
||||
if (returnType == 'full') {
|
||||
return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
|
||||
}
|
||||
if (returnType == 'y-m-d') {
|
||||
return y + '-' + m + '-' + d;
|
||||
}
|
||||
if (returnType == 'h:m') {
|
||||
return h + ':' + minute;
|
||||
}
|
||||
if (returnType == 'h:m:s') {
|
||||
return h + ':' + minute + ':' + second;
|
||||
}
|
||||
return [y, m, d, h, minute, second];
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
//demotype为自定义图表类型,一般不需要自定义图表类型,只需要改根节点上对应的类型即可
|
||||
"type": ["pie", "ring", "rose", "word", "funnel", "map", "arcbar", "line", "column", "area", "radar", "gauge",
|
||||
"candle", "mix", "tline", "tarea", "scatter", "bubble", "demotype"
|
||||
],
|
||||
"range": ["饼状图", "圆环图", "玫瑰图", "词云图", "漏斗图", "地图", "圆弧进度条", "折线图", "柱状图", "区域图", "雷达图", "仪表盘", "K线图", "混合图",
|
||||
"时间轴折线", "时间轴区域", "散点图", "气泡图", "自定义类型"
|
||||
],
|
||||
//增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype"
|
||||
//自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories
|
||||
"categories": ["line", "column", "area", "radar", "gauge", "candle", "mix", "demotype"],
|
||||
//instance为实例变量承载属性,不要删除
|
||||
"instance": {},
|
||||
//option为opts及eopts承载属性,不要删除
|
||||
"option": {},
|
||||
//下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换
|
||||
"formatter": {
|
||||
"yAxisDemo1": function(val) {
|
||||
return val + '元'
|
||||
},
|
||||
"yAxisDemo2": function(val) {
|
||||
return val.toFixed(2)
|
||||
},
|
||||
"xAxisDemo1": function(val) {
|
||||
return val + '年'
|
||||
},
|
||||
"xAxisDemo2": function(val) {
|
||||
return formatDateTime(val, 'h:m')
|
||||
},
|
||||
"seriesDemo1": function(val) {
|
||||
return val + '元'
|
||||
},
|
||||
"tooltipDemo1": function(item, category, index, opts) {
|
||||
if (index == 0) {
|
||||
return '随便用' + item.data + '年'
|
||||
} else {
|
||||
return '其他我没改' + item.data + '天'
|
||||
}
|
||||
},
|
||||
"pieDemo": function(val, index, series) {
|
||||
if (index !== undefined) {
|
||||
return series[index].name + ':' + series[index].data + '元'
|
||||
}
|
||||
},
|
||||
},
|
||||
//这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在opts参数,会将demotype与opts中option合并后渲染图表。
|
||||
"demotype": {
|
||||
//我这里把曲线图当做了自定义图表类型,您可以根据需要随意指定类型或配置
|
||||
"type": "line",
|
||||
"color": color,
|
||||
"padding": [15, 10, 0, 15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
},
|
||||
"legend": {},
|
||||
"extra": {
|
||||
"line": {
|
||||
"type": "curve",
|
||||
"width": 2
|
||||
},
|
||||
}
|
||||
},
|
||||
//下面是自定义配置,请添加项目所需的通用配置
|
||||
"pie": {
|
||||
"type": "pie",
|
||||
"color": color,
|
||||
"padding": [5, 5, 5, 5],
|
||||
"extra": {
|
||||
"pie": {
|
||||
"activeOpacity": 0.5,
|
||||
"activeRadius": 10,
|
||||
"offsetAngle": 0,
|
||||
"labelWidth": 15,
|
||||
"border": true,
|
||||
"borderWidth": 3,
|
||||
"borderColor": "#FFFFFF"
|
||||
},
|
||||
}
|
||||
},
|
||||
"ring": {
|
||||
"type": "ring",
|
||||
"color": color,
|
||||
"animation": false,
|
||||
"padding": [5, 5, 5, 5],
|
||||
"rotate": false,
|
||||
"dataLabel": false,
|
||||
"legend": {
|
||||
"show": false,
|
||||
"position": "right",
|
||||
"lineHeight": 25,
|
||||
},
|
||||
"title": {
|
||||
"name": "",
|
||||
"fontSize": 22,
|
||||
"color": "#666666"
|
||||
},
|
||||
"subtitle": {
|
||||
"name": "kcal",
|
||||
"fontSize": 14,
|
||||
"offsetY": 8,
|
||||
"color": "#888888"
|
||||
},
|
||||
"extra": {
|
||||
"ring": {
|
||||
"ringWidth": 10,
|
||||
"activeOpacity": 0.5,
|
||||
"activeRadius": 10,
|
||||
"offsetAngle": 0,
|
||||
"labelWidth": 0,
|
||||
"border": false,
|
||||
"borderWidth": 3,
|
||||
"borderColor": "#FFFFFF"
|
||||
},
|
||||
},
|
||||
},
|
||||
"rose": {
|
||||
"type": "rose",
|
||||
"color": color,
|
||||
"padding": [5, 5, 5, 5],
|
||||
"legend": {
|
||||
"show": true,
|
||||
"position": "left",
|
||||
"lineHeight": 25,
|
||||
},
|
||||
"extra": {
|
||||
"rose": {
|
||||
"type": "area",
|
||||
"minRadius": 50,
|
||||
"activeOpacity": 0.5,
|
||||
"activeRadius": 10,
|
||||
"offsetAngle": 0,
|
||||
"labelWidth": 15,
|
||||
"border": false,
|
||||
"borderWidth": 2,
|
||||
"borderColor": "#FFFFFF"
|
||||
},
|
||||
}
|
||||
},
|
||||
"word": {
|
||||
"type": "word",
|
||||
"color": color,
|
||||
"extra": {
|
||||
"word": {
|
||||
"type": "normal",
|
||||
"autoColors": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"funnel": {
|
||||
"type": "funnel",
|
||||
"color": color,
|
||||
"padding": [15, 15, 0, 15],
|
||||
"extra": {
|
||||
"funnel": {
|
||||
"activeOpacity": 0.3,
|
||||
"activeWidth": 10,
|
||||
"border": true,
|
||||
"borderWidth": 2,
|
||||
"borderColor": "#FFFFFF",
|
||||
"fillOpacity": 1,
|
||||
"labelAlign": "right"
|
||||
},
|
||||
}
|
||||
},
|
||||
"map": {
|
||||
"type": "map",
|
||||
"color": color,
|
||||
"padding": [0, 0, 0, 0],
|
||||
"dataLabel": true,
|
||||
"extra": {
|
||||
"map": {
|
||||
"border": true,
|
||||
"borderWidth": 1,
|
||||
"borderColor": "#666666",
|
||||
"fillOpacity": 0.6,
|
||||
"activeBorderColor": "#F04864",
|
||||
"activeFillColor": "#FACC14",
|
||||
"activeFillOpacity": 1
|
||||
},
|
||||
}
|
||||
},
|
||||
"arcbar": {
|
||||
"type": "arcbar",
|
||||
"color": color,
|
||||
"title": {
|
||||
"name": "",
|
||||
"fontSize": 25,
|
||||
"color": "#00FF00"
|
||||
},
|
||||
"subtitle": {
|
||||
"name": "",
|
||||
"fontSize": 15,
|
||||
"color": "#666666"
|
||||
},
|
||||
"extra": {
|
||||
"arcbar": {
|
||||
"type": "circle",
|
||||
"width": 8,
|
||||
"backgroundColor": "#E9E9E9",
|
||||
"startAngle": 0.75,
|
||||
"endAngle": 0.25,
|
||||
"gap": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"line": {
|
||||
"type": "line",
|
||||
"color": color,
|
||||
"padding": [15, 10, 0, 15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
},
|
||||
"legend": {},
|
||||
"extra": {
|
||||
"line": {
|
||||
"type": "straight",
|
||||
"width": 2
|
||||
},
|
||||
}
|
||||
},
|
||||
"tline": {
|
||||
"type": "line",
|
||||
"color": color,
|
||||
"padding": [15, 10, 0, 15],
|
||||
"xAxis": {
|
||||
"disableGrid": false,
|
||||
"boundaryGap": "justify",
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
"data": [{
|
||||
"min": 0,
|
||||
"max": 80
|
||||
}]
|
||||
},
|
||||
"legend": {},
|
||||
"extra": {
|
||||
"line": {
|
||||
"type": "curve",
|
||||
"width": 2
|
||||
},
|
||||
}
|
||||
},
|
||||
"tarea": {
|
||||
"type": "area",
|
||||
"color": color,
|
||||
"padding": [0, 15, 15, 5],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
"boundaryGap": "justify",
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
"data": [{
|
||||
"min": 0,
|
||||
"max": 80
|
||||
}]
|
||||
},
|
||||
"legend": {},
|
||||
"extra": {
|
||||
"area": {
|
||||
"type": "curve",
|
||||
"opacity": 0.2,
|
||||
"addLine": true,
|
||||
"width": 2,
|
||||
"gradient": true
|
||||
},
|
||||
}
|
||||
},
|
||||
"column": {
|
||||
"type": "column",
|
||||
"color": color,
|
||||
"padding": [15, 15, 0, 5],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"disableGrid": true,
|
||||
"gridColor": '#ffffff',
|
||||
"data": [{
|
||||
"tofix": 1,
|
||||
"min": 0
|
||||
}],
|
||||
},
|
||||
"legend": {},
|
||||
"extra": {
|
||||
"column": {
|
||||
"type": "group",
|
||||
"width": 20,
|
||||
"seriesGap": 5,
|
||||
"meterFillColor": "#FFFFFF",
|
||||
"activeBgColor": "#000000",
|
||||
"activeBgOpacity": 0.5,
|
||||
"barBorderCircle": true,
|
||||
"linearType": "opacity",
|
||||
// "customColor": "#ff9f40",
|
||||
"linearOpacity": 1,
|
||||
},
|
||||
}
|
||||
},
|
||||
"area": {
|
||||
"type": "area",
|
||||
"color": color,
|
||||
"padding": [20, 15, 5, 10],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"disableGrid": true,
|
||||
"gridColor": '#ffffff',
|
||||
"data": [{
|
||||
"tofix": 1,
|
||||
"min": 0
|
||||
}],
|
||||
},
|
||||
"legend": {
|
||||
"show": false,
|
||||
},
|
||||
"extra": {
|
||||
"area": {
|
||||
"type": "curve",
|
||||
"opacity": 0.2,
|
||||
"addLine": true,
|
||||
"width": 1,
|
||||
"gradient": true
|
||||
},
|
||||
}
|
||||
},
|
||||
"radar": {
|
||||
"type": "radar",
|
||||
"color": color,
|
||||
"padding": [5, 5, 5, 5],
|
||||
"legend": {
|
||||
"show": true,
|
||||
"position": "right",
|
||||
"lineHeight": 25,
|
||||
},
|
||||
"extra": {
|
||||
"radar": {
|
||||
"gridType": "radar",
|
||||
"gridColor": "#CCCCCC",
|
||||
"gridCount": 3,
|
||||
"opacity": 0.2,
|
||||
"max": 200
|
||||
},
|
||||
}
|
||||
},
|
||||
"gauge": {
|
||||
"type": "gauge",
|
||||
"color": color,
|
||||
"title": {
|
||||
"name": "66Km/H",
|
||||
"fontSize": 25,
|
||||
"color": "#2fc25b",
|
||||
"offsetY": 50
|
||||
},
|
||||
"subtitle": {
|
||||
"name": "实时速度",
|
||||
"fontSize": 15,
|
||||
"color": "#1890ff",
|
||||
"offsetY": -50
|
||||
},
|
||||
"extra": {
|
||||
"gauge": {
|
||||
"type": "default",
|
||||
"width": 30,
|
||||
"labelColor": "#666666",
|
||||
"startAngle": 0.75,
|
||||
"endAngle": 0.25,
|
||||
"startNumber": 0,
|
||||
"endNumber": 100,
|
||||
"labelFormat": "",
|
||||
"splitLine": {
|
||||
"fixRadius": 0,
|
||||
"splitNumber": 10,
|
||||
"width": 30,
|
||||
"color": "#FFFFFF",
|
||||
"childNumber": 5,
|
||||
"childWidth": 12
|
||||
},
|
||||
"pointer": {
|
||||
"width": 24,
|
||||
"color": "auto"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"candle": {
|
||||
"type": "candle",
|
||||
"color": color,
|
||||
"padding": [15, 15, 0, 15],
|
||||
"enableScroll": true,
|
||||
"enableMarkLine": true,
|
||||
"dataLabel": false,
|
||||
"xAxis": {
|
||||
"labelCount": 4,
|
||||
"itemCount": 40,
|
||||
"disableGrid": true,
|
||||
"gridColor": "#CCCCCC",
|
||||
"gridType": "solid",
|
||||
"dashLength": 4,
|
||||
"scrollShow": true,
|
||||
"scrollAlign": "left",
|
||||
"scrollColor": "#A6A6A6",
|
||||
"scrollBackgroundColor": "#EFEBEF"
|
||||
},
|
||||
"yAxis": {},
|
||||
"legend": {},
|
||||
"extra": {
|
||||
"candle": {
|
||||
"color": {
|
||||
"upLine": "#f04864",
|
||||
"upFill": "#f04864",
|
||||
"downLine": "#2fc25b",
|
||||
"downFill": "#2fc25b"
|
||||
},
|
||||
"average": {
|
||||
"show": true,
|
||||
"name": ["MA5", "MA10", "MA30"],
|
||||
"day": [5, 10, 20],
|
||||
"color": ["#1890ff", "#2fc25b", "#facc14"]
|
||||
}
|
||||
},
|
||||
"markLine": {
|
||||
"type": "dash",
|
||||
"dashLength": 5,
|
||||
"data": [{
|
||||
"value": 2150,
|
||||
"lineColor": "#f04864",
|
||||
"showLabel": true
|
||||
},
|
||||
{
|
||||
"value": 2350,
|
||||
"lineColor": "#f04864",
|
||||
"showLabel": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"mix": {
|
||||
"type": "mix",
|
||||
"color": color,
|
||||
"padding": [15, 15, 0, 15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"disabled": false,
|
||||
"disableGrid": false,
|
||||
"splitNumber": 5,
|
||||
"gridType": "dash",
|
||||
"dashLength": 4,
|
||||
"gridColor": "#CCCCCC",
|
||||
"padding": 10,
|
||||
"showTitle": true,
|
||||
"data": []
|
||||
},
|
||||
"legend": {},
|
||||
"extra": {
|
||||
"mix": {
|
||||
"column": {
|
||||
"width": 20
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
"scatter": {
|
||||
"type": "scatter",
|
||||
"color": color,
|
||||
"padding": [15, 15, 0, 15],
|
||||
"dataLabel": false,
|
||||
"xAxis": {
|
||||
"disableGrid": false,
|
||||
"gridType": "dash",
|
||||
"splitNumber": 5,
|
||||
"boundaryGap": "justify",
|
||||
"min": 0
|
||||
},
|
||||
"yAxis": {
|
||||
"disableGrid": false,
|
||||
"gridType": "dash",
|
||||
},
|
||||
"legend": {},
|
||||
"extra": {
|
||||
"scatter": {},
|
||||
}
|
||||
},
|
||||
"bubble": {
|
||||
"type": "bubble",
|
||||
"color": color,
|
||||
"padding": [15, 15, 0, 15],
|
||||
"xAxis": {
|
||||
"disableGrid": false,
|
||||
"gridType": "dash",
|
||||
"splitNumber": 5,
|
||||
"boundaryGap": "justify",
|
||||
"min": 0,
|
||||
"max": 250
|
||||
},
|
||||
"yAxis": {
|
||||
"disableGrid": false,
|
||||
"gridType": "dash",
|
||||
"data": [{
|
||||
"min": 0,
|
||||
"max": 150
|
||||
}]
|
||||
},
|
||||
"legend": {},
|
||||
"extra": {
|
||||
"bubble": {
|
||||
"border": 2,
|
||||
"opacity": 0.5,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -137,30 +137,31 @@ const cfu = {
|
|||
"color": color,
|
||||
"padding": [5, 5, 5, 5],
|
||||
"rotate": false,
|
||||
"dataLabel": true,
|
||||
"dataLabel": false,
|
||||
"legend": {
|
||||
"show": true,
|
||||
"show": false,
|
||||
"position": "right",
|
||||
"lineHeight": 25,
|
||||
},
|
||||
"title": {
|
||||
"name": "收益率",
|
||||
"fontSize": 15,
|
||||
"name": "",
|
||||
"fontSize": 20,
|
||||
"color": "#666666"
|
||||
},
|
||||
"subtitle": {
|
||||
"name": "70%",
|
||||
"fontSize": 25,
|
||||
"color": "#7cb5ec"
|
||||
"name": "kcal",
|
||||
"fontSize": 14,
|
||||
"offsetY": 8,
|
||||
"color": "#888888"
|
||||
},
|
||||
"extra": {
|
||||
"ring": {
|
||||
"ringWidth": 30,
|
||||
"ringWidth": 10,
|
||||
"activeOpacity": 0.5,
|
||||
"activeRadius": 10,
|
||||
"offsetAngle": 0,
|
||||
"labelWidth": 15,
|
||||
"border": true,
|
||||
"labelWidth": 0,
|
||||
"border": false,
|
||||
"borderWidth": 3,
|
||||
"borderColor": "#FFFFFF"
|
||||
},
|
||||
|
|
@ -272,7 +273,6 @@ const cfu = {
|
|||
"line": {
|
||||
"type": "straight",
|
||||
"width": 2,
|
||||
"activeType": "hollow"
|
||||
},
|
||||
}
|
||||
},
|
||||
|
|
@ -307,15 +307,16 @@ const cfu = {
|
|||
"padding": [15, 10, 0, 15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
"boundaryGap": "justify",
|
||||
"axisLine": false,
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
"disableGrid": true,
|
||||
"gridColor": '#ffffff',
|
||||
"data": [{
|
||||
"min": 0,
|
||||
"max": 80
|
||||
}]
|
||||
"tofix": 1,
|
||||
"min": 0
|
||||
}],
|
||||
},
|
||||
"legend": {},
|
||||
"extra": {
|
||||
|
|
@ -323,9 +324,8 @@ const cfu = {
|
|||
"type": "curve",
|
||||
"opacity": 0.2,
|
||||
"addLine": true,
|
||||
"width": 2,
|
||||
"gradient": true,
|
||||
"activeType": "hollow"
|
||||
"width": 1,
|
||||
"gradient": true
|
||||
},
|
||||
}
|
||||
},
|
||||
|
|
@ -344,9 +344,6 @@ const cfu = {
|
|||
"tofix": 1,
|
||||
"min": 0
|
||||
}],
|
||||
"data": [{
|
||||
"min": 0
|
||||
}]
|
||||
},
|
||||
"legend": {},
|
||||
"extra": {
|
||||
|
|
@ -359,7 +356,6 @@ const cfu = {
|
|||
"activeBgOpacity": 0.5,
|
||||
"barBorderCircle": true,
|
||||
"linearType": "opacity",
|
||||
// "customColor": "#ff9f40",
|
||||
"linearOpacity": 1,
|
||||
},
|
||||
}
|
||||
|
|
@ -410,9 +406,10 @@ const cfu = {
|
|||
"area": {
|
||||
"type": "area",
|
||||
"color": color,
|
||||
"padding": [20, 15, 5, 10],
|
||||
"padding": [15, 15, 0, 15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
"axisLine": false,
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
|
|
@ -428,12 +425,12 @@ const cfu = {
|
|||
},
|
||||
"extra": {
|
||||
"area": {
|
||||
"type": "curve",
|
||||
"type": "straight",
|
||||
"opacity": 0.2,
|
||||
"addLine": true,
|
||||
"width": 1,
|
||||
"width": 2,
|
||||
"gradient": true,
|
||||
"activeType": "hollow"
|
||||
// "activeType": "hollow"
|
||||
},
|
||||
}
|
||||
},
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":[],"names":[],"mappings":"","file":"uni_modules/lime-echart/components/l-echart/l-echart.js","sourceRoot":""}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue