新增睡眠相关的工鞥呢

This commit is contained in:
weidizhu_admin 2024-07-30 19:18:59 +08:00
parent 6791dfb914
commit b43f972837
61 changed files with 360 additions and 298 deletions

View File

@ -77,6 +77,27 @@
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/only_test/ot5",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/index/sleep_info/sleep_info",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/index/sleep_info",
"style" :
{
"navigationBarTitleText" : ""
}
}
],
// "tabBar": {

View File

@ -460,7 +460,8 @@ import { mapGetters } from "vuex";
let len = 0;
let arr = [];
let dataArr = {};
this.option.series[0].markLine.symbol = 'none'
this.option.series[0].markLine.label.position ='insideEndTop'
switch(this.type){
case 'step':
data.map((v,i) => {
@ -610,8 +611,7 @@ import { mapGetters } from "vuex";
this.option.series[0].markLine.data[0].yAxis = this.getAverage(arr)
this.option.series[0].markLine.data[0].value = this.getAverage(arr)
this.option.series[0].markLine.symbol = 'none'
// this.option.series[0].markLine.data[0].type = 'average'
// this.option.series[0].markLine.data[0].name = ''
this.option.series[0].markLine.lineStyle.color = this.dataConfig[this.type].color
this.option.series[0].markLine.label.color = this.dataConfig[this.type].color
this.option.series[0].markLine.label.position ='insideEndTop'

View File

@ -45,6 +45,30 @@
<!-- <image src="../../static/icon/血糖.png" mode="widthFix"></image> -->
</view>
</view>
<view class="content-item" @click="toPage('/pages/index/sleep_info')">
<view class="title">
{{getNameByKey('sleep')}}
</view>
<view class="time">
{{dataListsNew.SleepDatas.data_msg? dataListsNew.SleepDatas.device_real_time + '更新' : '--'}}
</view>
<view class="date">
<view class="flex_data" v-if="dataListsNew.SleepDatas.data_msg">
<view v-if="!(i == 0 && v == 0)" class="" v-for="(v,i) in mkHourMin(dataListsNew.SleepDatas.data_msg[0].sleepTotalTime)" :key="i" class="flex_data">
<view class="f_left" >
{{v}}
</view>
<view class="f_right">
<text class="icon">{{(i == 0?'时':'分')}}</text>
</view>
</view>
</view>
</view>
<view class="bg">
<image src="../../static/icon/sleep.png" style="width: 200rpx;" mode="widthFix"></image>
</view>
</view>
<view class="content-item" @click="toPage('/pages/index/echarts?type=bloodGlucose')">
<view class="title">
{{getNameByKey('bloodGlucose')}}
@ -287,6 +311,7 @@
return {
keyNameMap: {
bloodGlucose: "血糖",
sleep: "睡眠",
bloodOxygen: "血氧",
bloodPressure: '血压',
bloodLiquid: "血脂",
@ -305,7 +330,8 @@
meiTuo:{},
bodyTemperature:{},
bloodLiquid:{},
ECGData:{}
ECGData:{},
SleepData:{}
}
// dataListsNew:{
// stepIndex:{
@ -354,7 +380,8 @@
'bodyTemperature',
'bloodLiquid',
'stepIndex',
'ECGData'
'ECGData',
'SleepDatas'
],
}).then(res => {
for(let i = 0;i<res.length;i++){
@ -363,9 +390,16 @@
this.dataListsNew[res[i].type] = res[i]
}
// this.dataListsNew = res.data_msg;
this.$refs.paging.complete();
// this.$refs.paging.complete();
});
},
mkHourMin(min){
console.log(min,'------------')
if(min < 60){
return [0,min]
}
return [(Math.floor(min / 60)),(min % 60)]
},
toPage(url) {
uni.navigateTo({
url

208
pages/index/sleep_info.vue Normal file
View File

@ -0,0 +1,208 @@
<template>
<view>
<tm-nav-bar left-icon="arrow-left" title="睡眠" @clickLeft="back" />
<view class="flx jcsb ac" style="height: 40rpx;background-color: #fff;padding: 20rpx;">
<view class="" style="font-size: 40rpx;font-weight: bold;">
</view>
<view class="" style="color: #b8b8b8;font-size: 24rpx;">
{{time}}
</view>
</view>
<view class="canvas_box">
<canvas canvas-id="circleCanvas" style="width: 400rpx; height: 400rpx;margin: 0 auto;"></canvas>
<view class="" style="height: 40rpx;">
</view>
<view class="flx flx_sb">
<view class="flx flx_ac">
<!-- color:'#e933dd',
bigColor:'#6452da', -->
<view class="circle" style="background-color:#6452da ;" >
</view>
<view class="sleep_info">
<view class="info_title">
睡眠时长
</view>
<view class="info_val">
{{sleep.shen}}
</view>
</view>
</view>
<view class="flx flx_ac">
<view class="sleep_info">
<view class="info_title" style="text-align: right;">
深度睡眠
</view>
<view class="info_val">
{{sleep.qian}}
</view>
</view>
<view class="circle" style="background-color:#e933dd ;">
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { mapGetters } from "vuex";
export default {
data() {
return {
cavasConfig:{
canvasWidth: 200,
canvasHeight: 200,
lineWidth:20,
radius: 68, //
startAngle: -90, // -903
bigRadius:90,//
cxt:null,
colorBg:'#f7c1f5',
bigColorBg:'#d1ccf4',
color:'#e933dd',
bigColor:'#6452da',
bigAngle:0,
angle:0,
startSmallAngle:0,
bigStartAngle:0,
stop:0,
bigStop:0,
maxTime:480
},
time: new Date().toISOString().substring(0, 10),
sleep:{
shen:'0 分',
qian:'0 分'
}
}
},
onLoad() {
this.getDataList()
},
onReady() {
this.cavasConfig.ctx = uni.createCanvasContext('circleCanvas', this);
this.drawCircle('bottom',360,this.cavasConfig.bigRadius,this.cavasConfig.bigColorBg);
this.drawCircle('bottom',360,this.cavasConfig.radius,this.cavasConfig.colorBg);
},
computed: {
...mapGetters({
getActiceDevice: "api/getActiceDevice"
})
},
methods: {
back() {
uni.navigateBack({
delta: 1
})
},
getDataList(){
let type = 'SleepDatas'
let res = this.$store.dispatch('api/getDeviceListDays', {
type: type,
// type: (this.type),
device_real_time: this.time,
device_id:this.getActiceDevice.device_id
}).then(res => {
console.log(res.data.length)
if(res.data.length > 0){
this.sleep.shen = this.min2Hour(res.data[0].data_msg[0].sleepTotalTime)
this.sleep.qian = this.min2Hour(res.data[0].data_msg[0].deepSleepTime)
this.cavasConfig.angle = this.getAngle(res.data[0].data_msg[0].deepSleepTime)
this.cavasConfig.bigAngle = this.getAngle(res.data[0].data_msg[0].sleepTotalTime)
this.doAnimation(0)
this.doAnimation(1)
}else{
this.doAnimation(0)
this.doAnimation(1)
}
})
},
getAngle(min){
return min/this.cavasConfig.maxTime * 360
},
min2Hour(min){
let hour = (Math.floor(min / 60))
let minute = (min % 60)
return (hour?hour + ' 小时 ' + minute+ ' 分':minute+ ' 分')
},
doAnimation(type){
if(type == 0){
if(this.cavasConfig.bigStop === 1){
return
}
if(this.cavasConfig.bigStartAngle >= this.cavasConfig.bigAngle){
this.cavasConfig.bigStartAngle = this.cavasConfig.bigAngle
this.cavasConfig.bigStop = 1;
}else{
this.cavasConfig.bigStartAngle += this.cavasConfig.bigAngle/50
}
this.drawCircle('round',this.cavasConfig.bigStartAngle,this.cavasConfig.bigRadius,this.cavasConfig.bigColor);
}else{
if(this.cavasConfig.stop == 1){
return
}
if(this.cavasConfig.startSmallAngle >= this.cavasConfig.angle){
this.cavasConfig.startSmallAngle = this.cavasConfig.angle
this.cavasConfig.stop = 1;
}else{
this.cavasConfig.startSmallAngle += this.cavasConfig.angle/50
}
this.drawCircle('round',this.cavasConfig.startSmallAngle,this.cavasConfig.radius,this.cavasConfig.color);
}
requestAnimationFrame(() => {
this.doAnimation(type)
})
},
// lineCap线 edangle radius color 线
drawCircle(lineCap,edangle,radius,color) {
this.cavasConfig.ctx.save()
const cx = this.cavasConfig.canvasWidth / 2
const cy = this.cavasConfig.canvasHeight / 2
this.cavasConfig.ctx.lineCap = lineCap
let start = this.cavasConfig.startAngle*Math.PI/180
let end = (edangle+this.cavasConfig.startAngle)*Math.PI/180
this.cavasConfig.ctx.beginPath()
this.cavasConfig.ctx.arc(cx, cy, radius , start, end);
this.cavasConfig.ctx.lineWidth = this.cavasConfig.lineWidth; // 线
this.cavasConfig.ctx.strokeStyle = color; //
this.cavasConfig.ctx.stroke(); //
this.cavasConfig.ctx.closePath()
this.cavasConfig.ctx.restore()
this.cavasConfig.ctx.draw(true)
}
}
}
</script>
<style scoped="scss">
.canvas_box{
background-color: #fff;
padding: 20rpx;
.circle {
width: 40rpx;
height: 40rpx;
margin: 0 auto;
border-radius: 50%;
margin: 0 10rpx;
}
.sleep_info{
.info_title{
font-size: 24rpx;
color: #999;
}
.info_val{
}
}
}
</style>

91
pages/only_test/ot5.vue Normal file
View File

@ -0,0 +1,91 @@
<template>
<view>
<canvas canvas-id="circleCanvas" style="width: 300px; height: 300px;border: 2rpx solid #000;"></canvas>
</view>
</template>
<script>
export default {
data() {
return {
cavasConfig:{
canvasWidth: 300,
canvasHeight: 300,
lineWidth:15,
radius: 73, //
startAngle: -90, // -903
bigRadius:90,//
cxt:null,
colorBg:'#f7c1f5',
bigColorBg:'#d1ccf4',
color:'#e933dd',
bigColor:'#6452da',
bigAngle:270,
angle:200,
startSmallAngle:0,
bigStartAngle:0,
stop:0,
bigStop:0
}
};
},
onLoad() {
},
onReady() {
this.cavasConfig.ctx = uni.createCanvasContext('circleCanvas', this);
this.drawCircle('bottom',360,this.cavasConfig.bigRadius,this.cavasConfig.bigColorBg);
this.drawCircle('bottom',360,this.cavasConfig.radius,this.cavasConfig.colorBg);
this.doAnimation(0)
this.doAnimation(1)
},
methods: {
doAnimation(type){
if(type == 0){
if(this.cavasConfig.bigStop === 1){
return
}
if(this.cavasConfig.bigStartAngle >= this.cavasConfig.bigAngle){
this.cavasConfig.bigStartAngle = this.cavasConfig.bigAngle
this.cavasConfig.bigStop = 1;
}else{
this.cavasConfig.bigStartAngle += this.cavasConfig.bigAngle/50
}
this.drawCircle('round',this.cavasConfig.bigStartAngle,this.cavasConfig.bigRadius,this.cavasConfig.bigColor);
}else{
if(this.cavasConfig.stop == 1){
return
}
if(this.cavasConfig.startSmallAngle >= this.cavasConfig.angle){
this.cavasConfig.startSmallAngle = this.cavasConfig.angle
this.cavasConfig.stop = 1;
}else{
this.cavasConfig.startSmallAngle += this.cavasConfig.angle/50
}
this.drawCircle('round',this.cavasConfig.startSmallAngle,this.cavasConfig.radius,this.cavasConfig.color);
}
requestAnimationFrame(() => {
this.doAnimation(type)
})
},
// lineCap线 edangle radius color 线
drawCircle(lineCap,edangle,radius,color) {
this.cavasConfig.ctx.save()
const cx = this.cavasConfig.canvasWidth / 2
const cy = this.cavasConfig.canvasHeight / 2
this.cavasConfig.ctx.lineCap = lineCap
let start = this.cavasConfig.startAngle*Math.PI/180
let end = (edangle+this.cavasConfig.startAngle)*Math.PI/180
this.cavasConfig.ctx.beginPath()
this.cavasConfig.ctx.arc(cx, cy, radius , start, end);
this.cavasConfig.ctx.lineWidth = this.cavasConfig.lineWidth; // 线
this.cavasConfig.ctx.strokeStyle = color; //
this.cavasConfig.ctx.stroke(); //
this.cavasConfig.ctx.closePath()
this.cavasConfig.ctx.restore()
this.cavasConfig.ctx.draw(true)
}
}
};
</script>

BIN
static/icon/sleep.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -1,2 +0,0 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>智能终端</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/watchapp/static/index.2da1efab.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/watchapp/static/js/chunk-vendors.a54e2e08.js></script><script src=/watchapp/static/js/index.b820a357.js></script></body></html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

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

View File

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-only_test-only_test"],{"17a5":function(t,e,n){"use strict";n.r(e);var a=n("7961"),i=n("eda3");for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);var u=n("828b"),f=Object(u["a"])(i["default"],a["b"],a["c"],!1,null,"751b30ec",null,!1,a["a"],void 0);e["default"]=f.exports},"229f":function(t,e,n){"use strict";n("6a54");var a=n("3639").default,i=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("aa9c");var r=i(n("2634")),u=i(n("2fdc")),f=a(n("d641")),o={data:function(){return{op:{title:{text:"心电图模拟"},tooltip:{trigger:"axis"},xAxis:{type:"time",splitLine:{show:!1}},yAxis:{boundaryGap:["0%","100%"],splitLine:{show:!1},type:"value",max:100,min:-100},series:[{name:"心电图",type:"line",data:[]}]}}},onLoad:function(){},methods:{init:function(){var t=this;return(0,u.default)((0,r.default)().mark((function e(){var n;return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$refs.chartRef.init(f);case 2:_self.chart=e.sent,_self.chart.setOption(t.op),n=_self.op.series[0].data,setInterval((function(){var t=new Date,e=100*Math.random()-50;n.push([t,e]);while(n[0]&&t-n[0][0]>6e5)n.shift();_self.chart.setOption({series:[{data:n}]})}),1e3);case 6:case"end":return e.stop()}}),e)})))()}}};e.default=o},7961:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return a}));var a={lEchart:n("70e1").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("v-uni-view",{staticStyle:{height:"600rpx","background-color":"#fff"}},[n("l-echart",{ref:"chartRef",on:{finished:function(e){arguments[0]=e=t.$handleEvent(e),t.init.apply(void 0,arguments)}}})],1)],1)},r=[]},eda3:function(t,e,n){"use strict";n.r(e);var a=n("229f"),i=n.n(a);for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);e["default"]=i.a}}]);

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-only_test-ot2"],{"0e29":function(t,e,n){"use strict";n("6a54");var a=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=a(n("b7c7"));n("8f71"),n("bf0f");var o={data:function(){return{dataId:"",interval:null,pLeft:"-10",list:[-8e-4,-.0016,-.0016,-.0016,-.0016,-8e-4,-8e-4,-.0016,-.0016,-.0024000000000000002,-.004,-.0048000000000000004,-.005600000000000001,-.007200000000000001,-.0088,-.009600000000000001,-.011200000000000002,-.012,-.0128,-.013600000000000001,-.015200000000000002,-.016,-.016800000000000002,-.0176,-.018400000000000003],height:300,width:3e3,centerY:200}},onShow:function(){},onReady:function(){this.list=this.list.filter((function(t){return 0!==t}));var t=uni.createCanvasContext("ecg",this);t.setStrokeStyle("#d5d5d5"),t.setLineWidth(1);for(var e=.5;e<3e3;e+=15)t.moveTo(e,0),t.lineTo(e,3e3),t.stroke();for(var n=.5;n<3e3;n+=15)t.moveTo(0,n),t.lineTo(3e3,n),t.stroke();t.draw(),this.drawCurve()},methods:{play:function(){var t=this;this.interval=setInterval((function(){console.log(123),t.move()}),50)},stop:function(){this.interval&&clearInterval(this.interval)},move:function(){this.pLeft-=1},drawCurve:function(){var t=uni.createCanvasContext("myCanvas",this),e=this.list,n=this.centerY,a=this.width,o=a/(e.length-1),r=n/(Math.max.apply(Math,(0,i.default)(e))-Math.min.apply(Math,(0,i.default)(e))),u=n/2-e[0]*r;t.beginPath(),t.moveTo(0,u),t.setStrokeStyle("#c96d79"),t.setLineWidth(2);for(var s=1;s<e.length;s++){var c=s*o,l=n/2-e[s]/2*r;t.lineTo(c,l)}t.stroke(),t.draw(!1)}}};e.default=o},"30f7":function(t,e,n){"use strict";n("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},n("7a76"),n("c9b5")},4733:function(t,e,n){"use strict";n("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if(Array.isArray(t))return(0,a.default)(t)};var a=function(t){return t&&t.__esModule?t:{default:t}}(n("8d0b"))},a0c0:function(t,e,n){var a=n("c86c");e=a(!1),e.push([t.i,".box1[data-v-cc507004]{position:absolute;left:0;top:50px;width:%?3000?%}.box2[data-v-cc507004]{position:absolute;left:0;top:50px;width:%?3000?%}.myScoll[data-v-cc507004]{width:100%;height:%?500?%;white-space:nowrap;position:relative}",""]),t.exports=e},b7c7:function(t,e,n){"use strict";n("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,a.default)(t)||(0,i.default)(t)||(0,o.default)(t)||(0,r.default)()};var a=u(n("4733")),i=u(n("d14d")),o=u(n("5d6b")),r=u(n("30f7"));function u(t){return t&&t.__esModule?t:{default:t}}},bf01:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",[n("v-uni-view",{staticClass:"box1"},[n("v-uni-canvas",{staticStyle:{width:"3000px",height:"300px"},attrs:{"canvas-id":"ecg"}})],1),n("v-uni-view",{staticClass:"box2",style:{left:t.pLeft+"px"}},[n("v-uni-canvas",{staticStyle:{width:"3000px",height:"300px"},attrs:{"canvas-id":"myCanvas"}})],1),n("v-uni-view",{on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.play.apply(void 0,arguments)}}},[t._v("点击播放"+t._s(t.pLeft))]),n("v-uni-view",{on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.stop.apply(void 0,arguments)}}},[t._v("停止播放"+t._s(t.pLeft))])],1)},i=[]},c7b2:function(t,e,n){"use strict";n.r(e);var a=n("bf01"),i=n("f2a7");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("e7a6");var r=n("828b"),u=Object(r["a"])(i["default"],a["b"],a["c"],!1,null,"cc507004",null,!1,a["a"],void 0);e["default"]=u.exports},e29c:function(t,e,n){var a=n("a0c0");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=n("967d").default;i("6d0f9861",a,!0,{sourceMap:!1,shadowMode:!1})},e7a6:function(t,e,n){"use strict";var a=n("e29c"),i=n.n(a);i.a},f2a7:function(t,e,n){"use strict";n.r(e);var a=n("0e29"),i=n.n(a);for(var o in a)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(o);e["default"]=i.a}}]);

View File

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-only_test-ot3"],{"01bf":function(e,n,t){"use strict";t.r(n);var o=t("b13b"),i=t("f43d");for(var u in i)["default"].indexOf(u)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(u);var r=t("828b"),d=Object(r["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);n["default"]=d.exports},"57dd":function(e,n,t){"use strict";t("6a54");var o=t("f5bd").default;Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=o(t("6e7c")),u={mounted:function(){uni.$on("keyboardHeightChange",this.handleKeyboardHeightChange)},beforeDestroy:function(){uni.$off("keyboardHeightChange",this.handleKeyboardHeightChange)},components:{wInput:i.default},methods:{getVerCode:function(){this.$refs.runCode.$emit("runCode")},handleKeyboardHeightChange:function(e){if(console.log("监听到了"),e.height>0){var n=this.getElementTop(this.$refs.inputRef),t=uni.getSystemInfoSync().windowHeight-e.height;n>t&&uni.pageScrollTo({scrollTop:n-t+10,duration:e.duration})}},getElementTop:function(e){return e.getBoundingClientRect().top+(uni.getSystemInfoSync().windowTop||0)}}};n.default=u},b13b:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"c",(function(){return i})),t.d(n,"a",(function(){}));var o=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("v-uni-view",[t("v-uni-view",{staticStyle:{"background-color":"#fff"}},[t("v-uni-view",{staticStyle:{height:"1200rpx"}}),t("v-uni-input",{ref:"inputRef",attrs:{type:"text",placeholder:"请输入内容"}})],1),t("v-uni-view",{},[t("wInput",{ref:"runCode",attrs:{type:"number",maxlength:"4",placeholder:"短信验证码",isShowCode:!0},on:{setCode:function(n){arguments[0]=n=e.$handleEvent(n),e.getVerCode()}},model:{value:e.verCode,callback:function(n){e.verCode=n},expression:"verCode"}}),t("v-uni-view",{},[e._v("123")])],1)],1)},i=[]},f43d:function(e,n,t){"use strict";t.r(n);var o=t("57dd"),i=t.n(o);for(var u in o)["default"].indexOf(u)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(u);n["default"]=i.a}}]);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

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

View File

@ -1,173 +0,0 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<style type="text/css">
html,
body,
.canvas {
padding: 0;
margin: 0;
overflow-y: hidden;
background-color: transparent;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="canvas" id="limeChart"></div>
<script type="text/javascript" src="./uni.webview.1.5.5.js"></script>
<script type="text/javascript" src="./echarts.min.js"></script>
<script type="text/javascript" src="./ecStat.min.js"></script>
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-liquidfill@latest/dist/echarts-liquidfill.min.js"></script> -->
<script>
let chart = null;
let cache = [];
console.log = function() {
emit('log', {
log: arguments,
})
}
function emit(event, data) {
postMessage({
event,
data
})
cache = []
}
function postMessage(data) {
uni.webView.postMessage({
data
})
// window.__uniapp_x_.postMessage(JSON.stringify(data))
};
function stringify(key, value) {
if (typeof value === 'object' && value !== null) {
if (cache.indexOf(value) !== -1) {
return;
}
cache.push(value);
}
return value;
}
function parse(name, callback, options) {
const optionNameReg = /[\w]+\.setOption\(([\w]+\.)?([\w]+)\)/
if (optionNameReg.test(callback)) {
const optionNames = callback.match(optionNameReg)
if (optionNames[1]) {
const _this = optionNames[1].split('.')[0]
window[_this] = {}
window[_this][optionNames[2]] = options
return optionNames[2]
} else {
return null
}
}
return null
}
function init(callback, options, opts, theme) {
if (!chart) {
chart = echarts.init(document.getElementById('limeChart'), theme, opts)
if (options) {
chart.setOption(options)
}
}
}
function on(data) {
if (chart && data.length > 0) {
const [type, query] = data
const key = `${type}${JSON.stringify(query||'')}`
if (query) {
chart.on(type, query, function(options) {
var obj = {};
Object.keys(options).forEach(function(key) {
if (key != 'event') {
obj[key] = options[key];
}
});
emit(key, {
event: key,
options: obj,
});
});
} else {
chart.on(type, function(options) {
var obj = {};
Object.keys(options).forEach(function(key) {
if (key != 'event') {
obj[key] = options[key];
}
});
emit(key, {
event: key,
options: obj,
});
});
}
}
}
function setChart(callback, options) {
if (!callback) return
if (chart && callback && options) {
var r = null
const name = parse('r', callback, options)
if (name) this[name] = options
eval(`r = ${callback};`)
if (r) {
r(chart)
}
}
}
function setOption(data) {
if (chart) chart.setOption(data[0], data[1])
}
function showLoading(data) {
if (chart) chart.showLoading(data[0], data[1])
}
function hideLoading() {
if (chart) chart.hideLoading()
}
function clear() {
if (chart) chart.clear()
}
function dispose() {
if (chart) chart.dispose()
}
function resize(size) {
if (chart) chart.resize(size)
}
function canvasToTempFilePath(opt) {
if (chart) {
delete opt.success
const src = chart.getDataURL(opt)
postMessage({
// event: 'file',
file: src
})
}
}
</script>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B