Przeglądaj źródła

1、优化架构;
2、首页增加实时测量

wenningning 2 lat temu
rodzic
commit
32bf4f5d79
35 zmienionych plików z 97999 dodań i 3398 usunięć
  1. 130 0
      sleep/components/mpvue-echarts/src/echarts.vue
  2. 73 0
      sleep/components/mpvue-echarts/src/wx-canvas.js
  3. 11 11
      sleep/pages/alertSetting/alertSetting.vue
  4. 293 26
      sleep/pages/home/index.vue
  5. 66 67
      sleep/pages/report/report.vue
  6. 97412 0
      sleep/static/echarts.js
  7. 13 0
      sleep/static/echarts.min.js
  8. 0 153
      sleep/uni_modules/lime-echart/changelog.md
  9. 0 380
      sleep/uni_modules/lime-echart/components/l-echart/canvas.js
  10. 0 462
      sleep/uni_modules/lime-echart/components/l-echart/l-echart.vue
  11. 0 35
      sleep/uni_modules/lime-echart/components/l-echart/nvue.js
  12. 0 126
      sleep/uni_modules/lime-echart/components/l-echart/utils.js
  13. 0 103
      sleep/uni_modules/lime-echart/components/lime-echart/lime-echart.vue
  14. 0 88
      sleep/uni_modules/lime-echart/package.json
  15. 0 42
      sleep/uni_modules/lime-echart/pnpm-lock.yaml
  16. 0 318
      sleep/uni_modules/lime-echart/readme.md
  17. 0 1
      sleep/uni_modules/lime-echart/static/ecStat.min.js
  18. 0 60
      sleep/uni_modules/lime-echart/static/echarts.min.js
  19. 0 129
      sleep/uni_modules/lime-echart/static/index.html
  20. 0 1
      sleep/uni_modules/lime-echart/static/uni.webview.1.5.3.js
  21. 0 68
      sleep/uni_modules/uni-popup/changelog.md
  22. 0 45
      sleep/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js
  23. 0 275
      sleep/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue
  24. 0 143
      sleep/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue
  25. 0 187
      sleep/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue
  26. 0 7
      sleep/uni_modules/uni-popup/components/uni-popup/i18n/en.json
  27. 0 8
      sleep/uni_modules/uni-popup/components/uni-popup/i18n/index.js
  28. 0 7
      sleep/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json
  29. 0 7
      sleep/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json
  30. 0 45
      sleep/uni_modules/uni-popup/components/uni-popup/keypress.js
  31. 0 26
      sleep/uni_modules/uni-popup/components/uni-popup/popup.js
  32. 0 473
      sleep/uni_modules/uni-popup/components/uni-popup/uni-popup.vue
  33. 0 87
      sleep/uni_modules/uni-popup/package.json
  34. 0 17
      sleep/uni_modules/uni-popup/readme.md
  35. 1 1
      sleep/utils/request.js

+ 130 - 0
sleep/components/mpvue-echarts/src/echarts.vue

@@ -0,0 +1,130 @@
+<template>
+	<canvas v-if="canvasId" class="ec-canvas" :id="canvasId" :canvasId="canvasId" @touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd" @error="error"></canvas>
+</template>
+
+<script>
+import WxCanvas from './wx-canvas';
+
+export default {
+	props: {
+		canvasId: {
+			type: String,
+			default: 'ec-canvas'
+		},
+		lazyLoad: {
+			type: Boolean,
+			default: false
+		},
+		disableTouch: {
+			type: Boolean,
+			default: false
+		},
+		throttleTouch: {
+			type: Boolean,
+			default: false
+		}
+	},
+	// #ifdef H5
+	mounted() {
+	  console.log('22222222222222222222222222')
+		if (!this.lazyLoad) this.init();
+	},
+	// #endif
+	// #ifndef H5
+	onReady() {
+		if (!this.lazyLoad) this.init();
+	},
+	// #endif
+	methods: {
+		setChart(chart){
+			this.chart = chart
+		},
+		init() {
+		  console.log('1111111111111111111')
+			const { canvasId } = this;
+			this.ctx = uni.createCanvasContext(canvasId, this);
+
+			this.canvas = new WxCanvas(this.ctx, canvasId);
+
+			const query = uni.createSelectorQuery().in(this);
+			query
+				.select(`#${canvasId}`)
+				.boundingClientRect(res => {
+				  console.log('width==', res.width)
+					if (!res) {
+						setTimeout(() => this.init(), 50);
+						return;
+					}
+					this.$emit('onInit', {
+						width: res.width,
+						height: res.height,
+						// canvas:this.canvas
+					});
+				})
+				.exec();
+		},
+		canvasToTempFilePath(opt) {
+			const { canvasId } = this;
+			this.ctx.draw(true, () => {
+				uni.canvasToTempFilePath({
+					canvasId,
+					...opt
+				});
+			});
+		},
+		touchStart(e) {
+			const { disableTouch, chart } = this;
+			if (disableTouch || !chart || !e.mp.touches.length) return;
+			const touch = e.mp.touches[0];
+			chart._zr.handler.dispatch('mousedown', {
+				zrX: touch.x,
+				zrY: touch.y
+			});
+			chart._zr.handler.dispatch('mousemove', {
+				zrX: touch.x,
+				zrY: touch.y
+			});
+		},
+		touchMove(e) {
+			const { disableTouch, throttleTouch, chart, lastMoveTime } = this;
+			if (disableTouch || !chart || !e.mp.touches.length) return;
+
+			if (throttleTouch) {
+				const currMoveTime = Date.now();
+				if (currMoveTime - lastMoveTime < 240) return;
+				this.lastMoveTime = currMoveTime;
+			}
+
+			const touch = e.mp.touches[0];
+			chart._zr.handler.dispatch('mousemove', {
+				zrX: touch.x,
+				zrY: touch.y
+			});
+		},
+		touchEnd(e) {
+			const { disableTouch, chart } = this;
+			if (disableTouch || !chart) return;
+			const touch = e.mp.changedTouches ? e.mp.changedTouches[0] : {};
+			chart._zr.handler.dispatch('mouseup', {
+				zrX: touch.x,
+				zrY: touch.y
+			});
+			chart._zr.handler.dispatch('click', {
+				zrX: touch.x,
+				zrY: touch.y
+			});
+		},
+    error(e) {
+		  console.log('error:', e)
+    }
+	}
+};
+</script>
+
+<style scoped>
+.ec-canvas {
+	width: 100%;
+	height: 100%;
+	flex: 1;
+}
+</style>

+ 73 - 0
sleep/components/mpvue-echarts/src/wx-canvas.js

@@ -0,0 +1,73 @@
+export default class WxCanvas {
+  constructor(ctx, canvasId) {
+    this.ctx = ctx;
+    this.canvasId = canvasId;
+    this.chart = null;
+
+    WxCanvas.initStyle(ctx);
+    this.initEvent();
+  }
+
+  getContext(contextType) {
+    return contextType === '2d' ? this.ctx : null;
+  }
+
+  setChart(chart) {
+    this.chart = chart;
+  }
+
+  attachEvent() {
+    // noop
+  }
+
+  detachEvent() {
+    // noop
+  }
+
+  static initStyle(ctx) {
+    const styles = ['fillStyle', 'strokeStyle', 'globalAlpha',
+      'textAlign', 'textBaseAlign', 'shadow', 'lineWidth',
+      'lineCap', 'lineJoin', 'lineDash', 'miterLimit', 'fontSize'];
+
+    styles.forEach((style) => {
+      Object.defineProperty(ctx, style, {
+        set: (value) => {
+          if ((style !== 'fillStyle' && style !== 'strokeStyle')
+            || (value !== 'none' && value !== null)
+          ) {
+            ctx[`set${style.charAt(0).toUpperCase()}${style.slice(1)}`](value);
+          }
+        },
+      });
+    });
+
+    ctx.createRadialGradient = () => ctx.createCircularGradient(arguments);
+  }
+
+  initEvent() {
+    this.event = {};
+    const eventNames = [{
+      wxName: 'touchStart',
+      ecName: 'mousedown',
+    }, {
+      wxName: 'touchMove',
+      ecName: 'mousemove',
+    }, {
+      wxName: 'touchEnd',
+      ecName: 'mouseup',
+    }, {
+      wxName: 'touchEnd',
+      ecName: 'click',
+    }];
+
+    eventNames.forEach((name) => {
+      this.event[name.wxName] = (e) => {
+        const touch = e.mp.touches[0];
+        this.chart._zr.handler.dispatch(name.ecName, {
+          zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
+          zrY: name.wxName === 'tap' ? touch.clientY : touch.y,
+        });
+      };
+    });
+  }
+}

+ 11 - 11
sleep/pages/alertSetting/alertSetting.vue

@@ -1,15 +1,15 @@
 <template>
 	<view class="flex-col justify-start page">
 	  <cu-custom isBack="true" bgColor="#000000"><view slot="content" style="color: #FFFFFF">UU睡眠</view></cu-custom>
-	  
+
 	  <time-slot
 	      ref="timeslot"
 	      :title="'选择时间段'"
 	      @confirm="confirmTime">
 	  </time-slot>
-		
+
 	  <view class="flex-col justify-start section">
-		  
+
 	    <view class="flex-col section_2 space-y-32">
 	      <view class="flex-col">
 	        <text class="self-start font_1 text_2">心率异常提醒</text>
@@ -37,8 +37,8 @@
 							  src="../../static/iconRight.png"
 							/>
 						</view>
-					</picker>  
-					  
+					</picker>
+
 	              </view>
 	            </view>
 	          </view>
@@ -71,7 +71,7 @@
 							/>
 						</view>
 	                </picker>
-					
+
 	              </view>
 	            </view>
 	          </view>
@@ -116,8 +116,8 @@
 							  src="../../static/iconRight.png"
 							/>
 						</view>
-					</picker>    
-					  
+					</picker>
+
 	              </view>
 	            </view>
 	          </view>
@@ -143,7 +143,7 @@
 	          <text class="self-start font_1 text_5">语音短信提示手机号码设置</text>
 	          <view class="flex-col space-y-4">
 	            <text class="font_5 text_6">
-	              注:设置提醒手机号需注册“小睡眠”小程序领取短信语言套餐包,才能发送短信语音提醒。
+	              注:设置提醒手机号需注册“小U睡眠”小程序领取短信语言套餐包,才能发送短信语音提醒。
 	            </text>
 	            <view class="flex-col section_9">
 	              <view class="flex-row justify-between items-center list-item">
@@ -194,7 +194,7 @@
 				this.$refs.timeslot.open();
 			},
 			confirmTime(val) {
-				
+
 			},
 			bindBreathPickerChange: function(e) {
 			    console.log('picker发送选择改变,携带值为', e.detail.value)
@@ -219,7 +219,7 @@
   overflow-y: auto;
   overflow-x: hidden;
   height: 100%;
-  
+
   .section{
     background-image: url('https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/649415135a7e3f0310661c1e/649415b654fe0000116ae544/16878800827323657149.png');
     background-size: 100% 100%;

+ 293 - 26
sleep/pages/home/index.vue

@@ -9,7 +9,7 @@
 			<view v-if="!deviceAdded">
 				<view class="flex-col items-start home-header space-y-10">
 					<text class="home-header-title">欢迎回来!</text>
-					<text class="font_3 text_3 home-header-subtitle">我是小,您的健康智慧管家。</text>
+					<text class="font_3 text_3 home-header-subtitle">我是小U,您的健康智慧管家。</text>
 				</view>
 
 				<view class="flex-row items-center home_add_devive space-x-10">
@@ -98,38 +98,38 @@
 
 				<view class="flex-col items-start home-header space-y-10">
 					<text class="home-header-title">欢迎回来!</text>
-					<text class="font_3 text_3 home-header-subtitle">我是小,您的健康智慧管家。</text>
+					<text class="font_3 text_3 home-header-subtitle">我是小U,您的健康智慧管家。</text>
 				</view>
 
 				<!-- home device -->
 				<view class="flex-col home-device space-y-15">
 					<view class="flex-row home-device-header">
-						<view class="flex-row justify-between flex-auto equal-division">
-							<view class="flex-row equal-division-item space-x-4">
-								<text class="font_3 text_5">场景</text>
-								<text class="font_3">老人房</text>
-							</view>
-							<view class="flex-row equal-division-item space-x-14">
-								<view class="flex-row space-x-4">
-									<image class="shrink-0 image_6" src="../../static/home/homeIconWifi.png" />
-									<text class="font_3">在线</text>
-								</view>
-								<view class="flex-row items-center space-x-6">
-									<text class="font_3 text_6">45%</text>
-									<image class="shrink-0 image_7" src="../../static/home/homeIconPower.png" />
-								</view>
-							</view>
-						</view>
+<!--						<view class="flex-row justify-between flex-auto equal-division">-->
+<!--							<view class="flex-row equal-division-item space-x-4">-->
+<!--								<text class="font_3 text_5">场景</text>-->
+<!--								<text class="font_3">老人房</text>-->
+<!--							</view>-->
+<!--							<view class="flex-row equal-division-item space-x-14">-->
+<!--								<view class="flex-row space-x-4">-->
+<!--									<image class="shrink-0 image_6" src="../../static/home/homeIconWifi.png" />-->
+<!--									<text class="font_3">在线</text>-->
+<!--								</view>-->
+<!--								<view class="flex-row items-center space-x-6">-->
+<!--									<text class="font_3 text_6">45%</text>-->
+<!--									<image class="shrink-0 image_7" src="../../static/home/homeIconPower.png" />-->
+<!--								</view>-->
+<!--							</view>-->
+<!--						</view>-->
 
-						<view class="flex-row items-center section_5 space-x-4">
-							<image class="shrink-0 image_8"	src="../../static/home/homeIconChange.png"/>
-							<text class="font_3">切换</text>
-						</view>
+<!--						<view class="flex-row items-center section_5 space-x-4">-->
+<!--							<image class="shrink-0 image_8"	src="../../static/home/homeIconChange.png"/>-->
+<!--							<text class="font_3">切换</text>-->
+<!--						</view>-->
 					</view>
 
 					<view class="flex-row justify-center self-center home-device-status space-x-8">
 						<text class="font_4 text_7">当前状态</text>
-						<text class="font_4">在床</text>
+						<text class="font_4">{{ sleepStatus }}</text>
 					</view>
 
 					<view>
@@ -159,7 +159,7 @@
 						</view>
 
 						<view class="flex-row items-center space-x-10">
-							<text class="font_5 text_3 text_10">小已为您生成最后一份睡眠报告</text>
+							<text class="font_5 text_3 text_10">小U已为您生成最后一份睡眠报告</text>
 							<text class="font_5 text_3 text_11">2021-08-24</text>
 						</view>
 					</view>
@@ -198,6 +198,28 @@
 					</view>
 				</view>
 
+        <view class="cu-card article">
+          <view class="cu-item shadow chartsBgColor">
+            <view class="title"><view class="text-cut text-lg text-gray">心率 <text class="text-green margin-left">{{ pjxl }} 分钟/次</text></view></view>
+            <view class="content">
+              <view class="echarts-wrap">
+                <mpvue-echarts class="ec-canvas" canvasId="canvasChart-1" ref="xinlvRefChart" @onInit="onInit1"></mpvue-echarts>
+              </view>
+            </view>
+          </view>
+        </view>
+
+        <view class="cu-card article">
+          <view class="cu-item shadow chartsBgColor">
+            <view class="title"><view class="text-cut text-lg text-white">呼吸<text class="text-orange margin-left">{{ pjhx }} 分钟/次</text></view></view>
+            <view class="content">
+              <view class="echarts-wrap">
+                <mpvue-echarts class="ec-canvas" canvasId="canvasChart-2" ref="huxiRefChart" @onInit="onInit2"></mpvue-echarts>
+              </view>
+            </view>
+          </view>
+        </view>
+
 				<view class="flex-col home-alert space-y-4">
 					<view @click="jumpToAlertSetting" class="flex-row items-center space-x-4 home-alert-header">
 						<image
@@ -234,7 +256,12 @@
 </template>
 
 <script>
+import echarts from '@/static/echarts.min.js'
+import mpvueEcharts from '@/components/mpvue-echarts/src/echarts.vue'
 export default {
+  components: {
+    mpvueEcharts
+  },
 	data() {
 		return {
 			deviceAdded: true,
@@ -248,16 +275,245 @@ export default {
 				title: '起床目标 7:00AM'
 			}, {
 				title: '今日起床 7:14AM'
-			}]
+			}],
+      chartObj1: null, // 心率图表
+      chartObj2: null, // 呼吸图表
+      myData1: [], // 心率数据
+      myData2: [], // 呼吸数据
+      myCount1: 0, // 心率x轴数字
+      myCount2: 0, // 呼吸x轴数字
+      allXl: 0, // 总心率
+      pjxl: 0, // 平均心率
+      allHx: 0, // 总呼吸
+      pjhx: 0, // 平均呼吸
+      sleepStatus: '离床',
+      connecting: false,
+      connected: false,
+      mySocketTask: null
 		};
 	},
 	created() {
 
 	},
   onLoad() {
-
+    const _this = this
+    setTimeout(() => {
+      _this.nowChart1()
+      _this.nowChart2()
+      _this.connect()
+    }, 800)
   },
 	methods: {
+    connect() {
+      let _this = this
+      if (this.connected || this.connecting) {
+        uni.showModal({
+          content: '正在连接或者已经连接,请勿重复连接!',
+          showCancel: false
+        });
+        return false
+      }
+      this.connecting = true
+      // let wsUrl = api.base.replace('http', 'ws')
+      this.mySocketTask = uni.connectSocket({
+        url: 'ws://wdkl.natapp1.cc/sleep_report/monitor/50289', // 先写死
+        success(res) {
+          // 这里是接口调用成功的回调,不是连接成功的回调,请注意
+        },
+        fail(err) {
+          // 这里是接口调用失败的回调,不是连接失败的回调,请注意
+        }
+      })
+      this.mySocketTask.onOpen(res => {
+        this.connecting = false
+        this.connected = true
+        uni.hideLoading()
+        let _this = this
+        this.timer = setInterval(function () { //每隔5秒钟发送一次心跳,避免websocket连接因超时而自动断开
+          _this.mySocketTask.send({data: 'ping'})
+        }, 30000) // 30秒的心跳包
+      })
+      this.mySocketTask.onError(err => {
+        this.connecting = false
+        this.connected = false
+        uni.hideLoading()
+        uni.showModal({
+          content: '连接失败,可能是websocket服务不可用,请稍后再试',
+          showCancel: false
+        })
+        console.log('onError', err)
+      })
+      this.mySocketTask.onMessage(res => {
+        let msg = res.data
+        console.log('收到消息:', msg)
+        if (msg.length === 30) {
+          this.getValue1(parseInt(msg.substring(22, 24), 16))
+          this.getValue2(parseInt(msg.substring(24, 26), 16))
+          switch (msg.substring(26, 28)) {
+            case "03":
+              this.sleepStatus = '在床'
+              break;
+            case "04":
+              this.sleepStatus = '离床'
+              break;
+            case "05":
+              this.sleepStatus = '打鼾'
+              break;
+            case "06":
+              this.sleepStatus = '体动'
+              break;
+            default:
+              break;
+          }
+        }
+      })
+      this.mySocketTask.onClose(res => {
+        this.connected = false
+        this.msg = false
+        clearInterval(this.timer)
+      })
+    },
+    nowChart1() {
+      this.onInit1(this.chartObj1)
+      let canvas = this.$refs.xinlvRefChart.canvas
+      echarts.setCanvasCreator(() => canvas)
+      this.myChart1 = echarts.init(canvas, 'halloween', {
+        width: this.chartObj1.width,
+        height: this.chartObj1.height
+      })
+      this.options1 = Object.assign(this.getOptions('#FFFFFF', 800), {})
+      this.options1.series.forEach((item) => {
+        item.data = this.myData1
+      })
+      this.myChart1.setOption(this.options1)
+    },
+    nowChart2() {
+      this.onInit2(this.chartObj2);
+      let canvas = this.$refs.huxiRefChart.canvas;
+      echarts.setCanvasCreator(() => canvas);
+      this.myChart2 = echarts.init(canvas, 'halloween', {
+        width: this.chartObj2.width,
+        height: this.chartObj2.height
+      });
+      this.options2 = Object.assign(this.getOptions('#06f5d2', 400), {})
+      this.options2.series.forEach((item) => {
+        item.data = this.myData2
+      })
+      this.myChart2.setOption(this.options2)
+    },
+    onInit1(e) {
+      this.chartObj1 = e
+    },
+    onInit2(e) {
+      this.chartObj2 = e
+    },
+    getOptions(color, xMax) {
+      return {
+        visualMap: [
+          {
+            show: false,
+            type: 'continuous',
+            seriesIndex: 0,
+            min: 0,
+            max: 300,
+          },
+        ],
+        color: color,
+        title: {
+          left: 'left',
+          // text: title,
+        },
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            animation: false,
+          },
+        },
+        grid: {
+          top: '15%',
+          bottom: '10%',
+        },
+        xAxis: {
+          type: 'category',
+          boundaryGap: [0, '100%'],
+          show: false, // 不显示x轴
+          splitLine: {
+            show: false,
+          },
+          triggerEvent: true
+        },
+        yAxis: {
+          type: 'value',
+          boundaryGap: [0, '100%'],
+          min: 0,
+          max: xMax,
+          // max: 'dataMax', // 取数据在该轴上的最大值作为最大刻度
+          splitLine: {
+            show: false, // 是否显示分隔线
+          },
+          axisLine: {
+            show: false, // 是否显示坐标轴轴线
+            lineStyle:{
+              color:'#FFFFFF',
+              width:1, //x轴线的宽度
+            }
+          },
+        },
+        series: [
+          {
+            type: 'line',
+            showSymbol: false,
+            hoverAnimation: false,
+            data: [],
+          },
+        ]
+      }
+    },
+    getValue1(value) {
+      console.log("心率是", value)
+      this.pjxl = value
+      if (this.myData1.length > 60) {
+        this.myData1.splice(0,5)
+      }
+      if (value !== 0) {
+        for (let i = 0; i < 5; i++) {
+          this.myCount1 ++;
+          value =  parseInt(Math.random(100) * 500 + 300)
+          this.myData1.push([this.myCount1, value])
+        }
+      } else {
+        for (let i = 0; i < 5; i++) {
+          this.myCount1 ++;
+          value = 410
+          this.myData1.push([this.myCount1, value])
+        }
+      }
+      this.myChart1.setOption(this.options1)
+      this.myChart1.setOption(this.options1)
+    },
+    getValue2(value) {
+      console.log("呼吸值是", value)
+      this.pjhx = value
+      if (this.myData2.length > 60) {
+        this.myData2.splice(0,5)
+      }
+      if (value === 0) {
+        for (let i = 0; i < 5; i++) {
+          this.myCount2 ++;
+          value = 220
+          this.myData2.push([this.myCount2, value])
+        }
+      } else {
+        value = parseInt((Math.random(10) * 300 + 100))
+        for (let i = 0; i < 5; i++) {
+          this.myCount2 ++;
+          value += parseInt(Math.random() * 10 - 5)
+          this.myData2.push([this.myCount2, value])
+        }
+      }
+      this.myChart2.setOption(this.options2)
+      this.myChart2.setOption(this.options2)
+    },
 		handleAlertSetting() {
 			uni.navigateTo({
 				url: "/pages/alertSetting/alertSetting"
@@ -268,6 +524,17 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+@import "../../colorui/animation.css";
+.echarts-wrap {
+  width: 100%;
+  height: 150px;
+  /*padding: 10upx;*/
+  margin-bottom: 0.3rem
+}
+.chartsBgColor{
+  background: linear-gradient(90deg, rgba(86, 17, 247, 0.5) 0%, #4d9efa 100%);
+}
+
 	.equal-division {
 		.equal-division-item {
 			padding: 0.25rem 0.38rem 0;

+ 66 - 67
sleep/pages/report/report.vue

@@ -1,36 +1,36 @@
 <template>
 	<view class="report-container">
-		
+
 		<cu-custom bgColor="#000000"><view slot="content" style="color: #FFFFFF">UU睡眠</view></cu-custom>
 		<time-slot
 		    ref="timeslot"
 		    :title="'选择时间段'"
 		    @confirm="confirmTime">
 		</time-slot>
-		
+
 		<view v-if="!isDeviceAdded" class="flex-col page">
 		  <view class="flex-col flex-auto image-wrapper_2">
 		    <image
 		      class="image_6"
 			  src="../../static/report/reportBG.png"
 		    />
-			
+
 			<view class="flex-row items-center self-center bottom-btns">
 				<view class="btn_1 bottom-btn">立即体验</view>
 				<view class="btn_2 bottom-btn">添加设备</view>
 			</view>
-			
+
 		  </view>
 		</view>
-		
+
 		<view v-if="isDeviceAdded" class="flex-col justify-start page">
 			<view class="flex-col report">
-				
+
 				<!-- report header -->
 				<view class="flex-col justify-start report_header relative">
-					
+
 					<img class="report-header-img" src="../../static/report/reportIconLight.png" />
-					
+
 					<view class="flex-col report_score space-y-55">
 						<view class="flex-row space-x-10 report_period">
 							<view class="flex-row justify-between flex-auto section_3">
@@ -47,7 +47,7 @@
 									/>
 								</view>
 							</view>
-							
+
 							<view @click="handleTimeChoose" class="flex-row items-center shrink-0 section_4 space-x-10">
 								<text class="font_2 text_3">23:30~05:42</text>
 								<image
@@ -56,7 +56,7 @@
 								/>
 							</view>
 						</view>
-							
+
 						<view class="flex-col report_score_data items-center">
 							<view class="flex-row justify-between items-center space-x-76-reverse">
 								<text class="text_4">极好</text>
@@ -71,10 +71,10 @@
 							<text class="self-center text_6">98</text>
 							<text class="self-center font_2 text_7">香睡指数</text>
 						</view>
-						
+
 						<view class="flex-row report-data-sum justify-between">
 							<view class="flex-row items-center">
-								<image 
+								<image
 									class="icon-data-sum"
 									src="../../static/report/reportIconTime.png"
 								/>
@@ -88,9 +88,9 @@
 									</view>
 								</view>
 							</view>
-							
+
 							<view class="flex-row items-center">
-								<image 
+								<image
 									class="icon-data-sum"
 									src="../../static/report/reportIconClock.png"
 								/>
@@ -104,13 +104,13 @@
 						</view>
 					</view>
 				</view>
-				
+
 				<!-- report analysis -->
 				<view class="flex-col report_analysis space-y-4">
 					<text class="self-start font_4 text_8">各项睡眠监测数据统计</text>
-		      
+
 					<view class="flex-col justify-start items-center relative report_analysis_data">
-						
+
 						<view class="flex-row equal-division space-x-29 pos">
 							<view class="flex-col equal-division-item">
 								<view class="flex-col section_6 space-y-12">
@@ -144,11 +144,11 @@
 										/>
 										<text class="font_3">温馨提示</text>
 									</view>
-									
+
 									<text class="font_2 text_10">本次睡眠,您有1项指标不及格。</text>
 								</view>
 							</view>
-							
+
 							<view class="flex-col equal-division-item_2 space-y-10">
 								<view class="flex-col section_7 space-y-12">
 									<view class="flex-row space-x-10">
@@ -165,7 +165,7 @@
 										<text class="font_5">分钟</text>
 									</view>
 								</view>
-								
+
 								<view class="flex-col section_7 space-y-12">
 									<view class="flex-row space-x-10">
 										<image
@@ -179,7 +179,7 @@
 										<text class="font_5">次/分</text>
 									</view>
 								</view>
-								
+
 								<view class="flex-row justify-between section_8">
 									<view class="flex-row items-center space-x-8">
 										<image
@@ -193,7 +193,7 @@
 										<text class="font_5">次</text>
 									</view>
 								</view>
-								
+
 								<view class="flex-row shrink-0 justify-between section_8 space-x-34">
 									<view class="flex-row items-center space-x-8">
 										<image
@@ -208,9 +208,9 @@
 									</view>
 								</view>
 							</view>
-						</view>	
+						</view>
 					</view>
-					
+
 					<view class="flex-row justify-between section_efficiency">
 						<view class="flex-row items-center">
 							<image
@@ -223,7 +223,7 @@
 							<text class="font_4">68%</text>
 						</view>
 					</view>
-					
+
 					<view class="flex-row justify-between section_easy">
 						<view class="flex-row items-center">
 							<image
@@ -236,14 +236,14 @@
 							<text class="font_4"><text class="font_7">入睡时间</text>134分钟</text>
 						</view>
 					</view>
-					
+
 				</view>
-				
+
 				<view class="flex-col page report-charts">
 				  <view class="flex-col justify-start flex-auto group">
 				    <view class="flex-col justify-start group_3">
 				      <view class="flex-col group_8 space-y-10">
-						  
+
 				        <view class="flex-col justify-start relative report_leave_bed">
 				          <view class="section_10"></view>
 				          <view class="flex-row justify-between items-center pos_2">
@@ -259,9 +259,9 @@
 				              <text class="font_6">次</text>
 				            </view>
 				          </view>
-						  
+
 				        </view>
-						
+
 				        <view class="flex-col justify-start relative report_move">
 				          <view class="section_20"></view>
 				          <view class="flex-row justify-between items-center pos_11">
@@ -277,9 +277,9 @@
 				              <text class="font_6">次</text>
 				            </view>
 				          </view>
-						  
+
 				        </view>
-						
+
 				        <view class="flex-col justify-start relative report_heart">
 				          <view class="section_25"></view>
 				          <view class="flex-row justify-center items-center group_11 space-x-9 pos_21">
@@ -304,7 +304,7 @@
 				            </view>
 				          </view>
 				        </view>
-						
+
 				        <view class="flex-col justify-start relative report_breath">
 				          <view class="flex-col justify-start relative">
 				            <view class="section_31"></view>
@@ -333,13 +333,13 @@
 				                    </view>
 				                  </view>
 				                </view>
-				                
+
 				              </view>
 				              <!-- <view class="list-divider" v-if="i !== 2"></view> -->
 				            <!-- </template> -->
 				          </view>
 				        </view>
-						
+
 						<view class="flex-col justify-start relative report_heart">
 						  <view class="section_25"></view>
 						  <view class="flex-row justify-center items-center group_11 space-x-9 pos_21">
@@ -353,7 +353,7 @@
 							  src="../../static/report/reportIconWhy.png"
 						    />
 						  </view>
-					
+
 						  <view class="flex-row justify-between report-sleep items-center">
 							<view class="flex-col item-sleep">
 								<text class="item-sleep-title">清醒</text>
@@ -366,25 +366,24 @@
 							<view class="flex-col item-sleep">
 								<text class="item-sleep-title">深睡</text>
 								<text class="item-sleep-desc">2小时14分钟</text>
-							</view>				  
+							</view>
 						  </view>
 						</view>
 				      </view>
 				    </view>
 				  </view>
 			</view>
-			
-			
+
+
 		</view>
-		
-		  
+
+
 		</view>
 		<!-- <tab-bar currentPage="report" /> -->
 	</view>
 </template>
 
 <script>
-	import * as echarts from '@/uni_modules/lime-echart/static/echarts.min'
 	import timeSlot from "@/components/wanghexu-timeslot/wanghexu-timeslot.vue"
 
 	export default {
@@ -398,7 +397,7 @@
 			};
 		},
 		onReady: function() {
-			
+
 		},
 		components: {
 			timeSlot
@@ -416,7 +415,7 @@
 				this.$refs.timeslot.open();
 			},
 			confirmTime(val) {
-				
+
 			},
 			bindDateChange: function(e) {
 			    this.date = e.detail.value
@@ -426,7 +425,7 @@
 			    let year = date.getFullYear();
 			    let month = date.getMonth() + 1;
 			    let day = date.getDate();
-			    		
+
 			    if (type === 'start') {
 			        year = year - 60;
 			    } else if (type === 'end') {
@@ -434,8 +433,8 @@
 			    }
 			    month = month > 9 ? month : '0' + month;
 			    day = day > 9 ? day : '0' + day;
-			    return `${year}-${month}-${day}`;    
-			}            
+			    return `${year}-${month}-${day}`;
+			}
 		}
 	}
 </script>
@@ -446,9 +445,9 @@
 		top: 3rem;
 		width: 100%;
 		padding: 0.3rem;
-		
+
 		.item-sleep {
-			
+
 			.item-sleep-title {
 				font-size: 14px;
 				font-weight: 400;
@@ -476,7 +475,7 @@
 	.bottom-btns {
 		position: absolute;
 		bottom: 10px;
-		
+
 		.bottom-btn {
 			font-size: 16px;
 			font-weight: 500;
@@ -504,7 +503,7 @@
 		margin: 1rem;
 		padding-top: 2.5rem;
 		color: #ffffff;
-		
+
 		.icon-data-sum {
 			width: 40px;
 			height: 40px;
@@ -512,7 +511,7 @@
 		.text-data-sum {
 			margin-left: 6px;
 			text-align: left;
-			
+
 			.title-data-sum {
 				width: 100%;
 				font-size: 12px;
@@ -527,18 +526,18 @@
 			}
 			.font_5 {
 				font-size: 14px;
-				line-height: 24px;	
+				line-height: 24px;
 			}
 		}
 	}
-	
+
 	.page {
 	  background-color: #000000;
 	  width: 100%;
 	  overflow-y: auto;
 	  overflow-x: hidden;
 	  height: 100%;
-	  
+
 	  .group {
 	    overflow-y: auto;
 	    .group_3 {
@@ -909,7 +908,7 @@
 	            right: 0;
 	            top: 0;
 	          }
-	        
+
 	          .pos_31 {
 	            position: absolute;
 	            left: 0;
@@ -1033,7 +1032,7 @@
 	                  right: 0;
 	                  top: 0;
 	                }
-	               
+
 	                .pos_43 {
 	                  position: absolute;
 	                  left: 0;
@@ -1172,19 +1171,19 @@
 	  overflow-x: hidden;
 	  height: 100%;
 	  margin-bottom: 1rem;
-	  
+
 	  .report {
 	    overflow-y: auto;
-		
+
 	    .report_header {
-		  
+
 		  .report-header-img {
 			  position: absolute;
 			  top: -3rem;
 			  left: 50%;
 			  width: 22.5rem;
 			  height: 28.5em;
-			  margin-left: -11.25rem;    
+			  margin-left: -11.25rem;
 		  }
 	      .report_score {
 			padding-top: 1rem;
@@ -1262,7 +1261,7 @@
 			opacity: 0.8;
 			border-radius: 8px;
 			background: linear-gradient(180deg, rgba(22, 125, 242, 1) 0%, rgba(52, 26, 75, 1) 100%);
-			
+
 			.image_7 {
 				width: 32px;
 				height: 32px;
@@ -1291,7 +1290,7 @@
 		  	opacity: 0.8;
 		  	border-radius: 8px;
 		  	background: linear-gradient(180deg, rgba(22, 125, 242, 1) 0%, rgba(52, 26, 75, 1) 100%);
-			
+
 			.image_7 {
 				width: 32px;
 				height: 32px;
@@ -1310,7 +1309,7 @@
 		  }
 	      .report_analysis_data {
 	        padding-top: 17.5rem;
-			
+
 	        .space-x-26 {
 	          & > view:not(:first-child),
 	          & > text:not(:first-child),
@@ -1366,13 +1365,13 @@
 				  background-repeat: no-repeat;
 				  background-size: cover;
 				  border-radius: 0.5rem;
-				  
+
 				  .text_10 {
 					  line-height: 1.4rem;
 					  margin-top: 0.2rem;
 				  }
 	            }
-				
+
 	          }
 	          .equal-division-item_2 {
 	            padding: 0.25rem 0.38rem;
@@ -1526,7 +1525,7 @@
   overflow-y: auto;
   overflow-x: hidden;
   height: 100%;
-  
+
   .image-wrapper_2 {
     padding-bottom: 0.38rem;
     overflow-y: auto;

Plik diff jest za duży
+ 97412 - 0
sleep/static/echarts.js


Plik diff jest za duży
+ 13 - 0
sleep/static/echarts.min.js


+ 0 - 153
sleep/uni_modules/lime-echart/changelog.md

@@ -1,153 +0,0 @@
-## 0.7.5(2023-05-25)
-- chore: 更新文档 和 demo, 使用`lime-echart`这个标签即可查看示例
-## 0.7.4(2023-05-22)
-- chore: 增加关于钉钉小程序上传时提示安全问题的说明及修改建议
-## 0.7.3(2023-05-16)
-- chore: 更新 vue3 非微信小程序平台可能缺少`wx`的说明
-## 0.7.2(2023-05-16)
-- chore: 更新 vue3 非微信小程序平台的可以缺少`wx`的说明
-## 0.7.1(2023-04-26)
-- chore: 更新demo,使用`lime-echart`这个标签即可查看示例
-- chore:微信小程序的`tooltip`文字有阴影,怀疑是微信的锅,临时解决方法是`tooltip.shadowBlur = 0`
-## 0.7.0(2023-04-24)
-- fix: 修复`setAttribute is not a function`
-## 0.6.9(2023-04-15)
-- chore: 更新文档,vue3请使用echarts esm的包
-## 0.6.8(2023-03-22)
-- feat: mac pc无法使用canvas 2d
-## 0.6.7(2023-03-17)
-- feat: 更新文档
-## 0.6.6(2023-03-17)
-- feat: 微信小程序PC已经支持canvas 2d,故去掉判断PC
-## 0.6.5(2022-11-03)
-- fix: 某些手机touches为对象,导致无法交互。
-## 0.6.4(2022-10-28)
-- fix: 优化点击事件的触发条件
-## 0.6.3(2022-10-26)
-- fix: 修复 dataZoom 拖动问题
-## 0.6.2(2022-10-23)
-- fix: 修复 飞书小程序 尺寸问题
-## 0.6.1(2022-10-19)
-- fix: 修复 PC mousewheel 事件 鼠标位置不准确的BUG,不兼容火狐!
-- feat: showLoading 增加传参
-## 0.6.0(2022-09-16)
-- feat: 增加PC的mousewheel事件
-## 0.5.4(2022-09-16)
-- fix: 修复 nvue 动态数据不显示问题
-## 0.5.3(2022-09-16)
-- feat: 增加enableHover属性, 在PC端时当鼠标进入显示tooltip,不必按下。
-- chore: 更新文档
-## 0.5.2(2022-09-16)
-- feat: 增加enableHover属性, 在PC端时当鼠标进入显示tooltip,不必按下。
-## 0.5.1(2022-09-16)
-- fix: 修复nvue报错
-## 0.5.0(2022-09-15)
-- feat: init(echarts, theme?:string, opts?:{}, callback: function(chart))
-## 0.4.8(2022-09-11)
-- feat: 增加 @finished
-## 0.4.7(2022-08-24)
-- chore: 去掉 stylus
-## 0.4.6(2022-08-24)
-- feat: 增加 beforeDelay
-## 0.4.5(2022-08-12)
-- chore: 更新文档
-## 0.4.4(2022-08-12)
-- fix: 修复 resize 无参数时报错
-## 0.4.3(2022-08-07)
-# 评论有说本插件对新手不友好,让我做不好就不要发出来。 还有的说跟官网一样,发出来做什么,给我整无语了。
-# 所以在此提醒一下准备要下载的你,如果你从未使用过 echarts 请不要下载 或 谨慎下载。
-# 如果你确认要下载,麻烦看完文档。还有请注意插件是让echarts在uniapp能运行,API 配置请自行去官网查阅!
-# 如果你不会echarts 但又需要图表,市场上有个很优秀的图表插件 uchart 你可以去使用这款插件,uchart的作者人很好,也热情。
-# 每个人都有自己的本职工作,如果你能力强可以自行兼容,如果使用了他人的插件也麻烦尊重他人的成果和劳动时间。谢谢。
-# 为了心情愉悦,本人已经使用插件屏蔽差评。
-- chore: 更新文档
-## 0.4.2(2022-07-20)
-- feat: 增加 resize
-## 0.4.1(2022-06-07)
-- fix: 修复 canvasToTempFilePath 不生效问题
-## 0.4.0(2022-06-04)
-- chore 为了词云 增加一个canvas 标签
-- 词云下载地址[echart-wordcloud](https://ext.dcloud.net.cn/plugin?id=8430)
-## 0.3.9(2022-06-02)
-- chore: 更新文档
-- tips: lines 不支持 `trailLength`
-## 0.3.8(2022-05-31)
-- fix: 修复 因mouse事件冲突tooltip跳动问题
-## 0.3.7(2022-05-26)
-- chore: 更新文档
-- chore: 设置默认宽高300px
-- fix: 修复 vue3 微信小程序 拖影BUG
-- chore: 支持PC
-## 0.3.5(2022-04-28)
-- chore: 更新使用方式
-- 🔔 必须使用hbuilderx 3.4.8-alpha以上
-## 0.3.4(2021-08-03)
-- chore: 增加 setOption的参数值
-## 0.3.3(2021-07-22)
-- fix: 修复 径向渐变报错的问题
-## 0.3.2(2021-07-09)
-- chore: 统一命名规范,无须主动引入组件
-## [代码示例站点1](https://limeui.qcoon.cn/#/echart-example)
-## [代码示例站点2](http://liangei.gitee.io/limeui/#/echart-example)
-## 0.3.1(2021-06-21)
-- fix: 修复 app-nvue ios is-enable 无效的问题
-## [代码示例站点1](https://limeui.qcoon.cn/#/echart-example)
-## [代码示例站点2](http://liangei.gitee.io/limeui/#/echart-example)
-## 0.3.0(2021-06-14)
-- fix: 修复 头条系小程序 2d 报 JSON.stringify 的问题
-- 目前 头条系小程序 2d 无法在开发工具上预览,划动图表页面无法滚动,axisLabel 字体颜色无法更改,建议使用非2d。
-## 0.2.9(2021-06-06)
-- fix: 修复 头条系小程序 2d 放大的BUG 
-- 头条系小程序 2d 无法在开发工具上预览,也存在划动图表页面无法滚动的问题。
-## [代码示例:http://liangei.gitee.io/limeui/#/echart-example](http://liangei.gitee.io/limeui/#/echart-example)
-## 0.2.8(2021-05-19)
-- fix: 修复 微信小程序 PC 显示过大的问题
-## 0.2.7(2021-05-19)
-- fix: 修复 微信小程序 PC 不显示问题
-## [代码示例:http://liangei.gitee.io/limeui/#/echart-example](http://liangei.gitee.io/limeui/#/echart-example)
-## 0.2.6(2021-05-14)
-- feat: 支持 `image`
-- feat: props 增加 `ec.clear`,更新时是否先删除图表样式 
-- feat: props 增加 `isDisableScroll` ,触摸图表时是否禁止页面滚动
-- feat: props 增加 `webviewStyles` ,webview 的样式, 仅nvue有效
-## 0.2.5(2021-05-13)
-- docs: 插件用到了css 预编译器 [stylus](https://ext.dcloud.net.cn/plugin?name=compile-stylus) 请安装它
-## 0.2.4(2021-05-12)
-- fix: 修复 百度平台 多个图表ctx 和 渐变色 bug
-- ## [代码示例:http://liangei.gitee.io/limeui/#/echart-example](http://liangei.gitee.io/limeui/#/echart-example)
-## 0.2.3(2021-05-10)
-- feat: 增加 `canvasToTempFilePath` 方法,用于生成图片
-```js
-this.$refs.chart.canvasToTempFilePath({success: (res) => {
-	console.log('tempFilePath:', res.tempFilePath)
-}})
-```
-## 0.2.2(2021-05-10)
-- feat: 增加 `dispose` 方法,用于销毁实例
-- feat: 增加 `isClickable` 是否派发点击
-- feat: 实验性的支持 `nvue` 使用要慎重考虑
-- ## [代码示例:http://liangei.gitee.io/limeui/#/echart-example](http://liangei.gitee.io/limeui/#/echart-example)
-## 0.2.1(2021-05-06)
-- fix:修复 微信小程序 json 报错
-- chore: `reset` 更改为 `setChart`
-- feat: 增加 `isEnable` 开启初始化 启用这个后 无须再使用`init`方法
-```html
-<l-echart ref="chart" is-enable />
-```
-```js
-// 显示加载
-this.$refs.chart.showLoading()
-// 使用实例回调
-this.$refs.chart.setChart(chart => ...code)
-// 直接设置图表配置
-this.$refs.chart.setOption(data)
-```
-## 0.2.0(2021-05-05)
-- fix:修复 头条 百度 偏移的问题
-- docs: 更新文档
-## [代码示例:http://liangei.gitee.io/limeui/#/echart-example](http://liangei.gitee.io/limeui/#/echart-example)
-## 0.1.0(2021-05-02)
-- chore:  第一次上传,基本全端兼容,使用方法与官网一致。
-- 已知BUG:非2d 无法使用背景色,已反馈官方
-- 已知BUG:头条 百度 有许些偏移
-- 后期计划:兼容nvue

+ 0 - 380
sleep/uni_modules/lime-echart/components/l-echart/canvas.js

@@ -1,380 +0,0 @@
-const cacheChart = {}
-const fontSizeReg = /([\d\.]+)px/;
-class EventEmit {
-	constructor() {
-		this.__events = {};
-	}
-	on(type, listener) {
-		if (!type || !listener) {
-			return;
-		}
-		const events = this.__events[type] || [];
-		events.push(listener);
-		this.__events[type] = events;
-	}
-	emit(type, e) {
-		if (type.constructor === Object) {
-			e = type;
-			type = e && e.type;
-		}
-		if (!type) {
-			return;
-		}
-		const events = this.__events[type];
-		if (!events || !events.length) {
-			return;
-		}
-		events.forEach((listener) => {
-			listener.call(this, e);
-		});
-	}
-	off(type, listener) {
-		const __events = this.__events;
-		const events = __events[type];
-		if (!events || !events.length) {
-			return;
-		}
-		if (!listener) {
-			delete __events[type];
-			return;
-		}
-		for (let i = 0, len = events.length; i < len; i++) {
-			if (events[i] === listener) {
-				events.splice(i, 1);
-				i--;
-			}
-		}
-	}
-}
-class Image {
-	constructor() {
-		this.currentSrc = null
-		this.naturalHeight = 0
-		this.naturalWidth = 0
-		this.width = 0
-		this.height = 0
-		this.tagName = 'IMG'
-	}
-	set src(src) {
-		this.currentSrc = src
-		uni.getImageInfo({
-			src,
-			success: (res) => {
-				this.naturalWidth = this.width = res.width
-				this.naturalHeight = this.height = res.height
-				this.onload()
-			},
-			fail: () => {
-				this.onerror()
-			}
-		})
-	}
-	get src() {
-		return this.currentSrc
-	}
-}
-class OffscreenCanvas {
-	constructor(ctx, com, canvasId) {
-		this.tagName = 'canvas'
-		this.com = com
-		this.canvasId = canvasId
-		this.ctx = ctx
-	}
-	set width(w) {
-		this.com.offscreenWidth = w
-	}
-	set height(h) {
-		this.com.offscreenHeight = h
-	}
-	get width() {
-		return this.com.offscreenWidth || 0
-	}
-	get height() {
-		return this.com.offscreenHeight || 0
-	}
-	getContext(type) {
-		return this.ctx
-	}
-	getImageData() {
-		return new Promise((resolve, reject) => {
-			this.com.$nextTick(() => {
-				uni.canvasGetImageData({
-					x:0,
-					y:0,
-					width: this.com.offscreenWidth,
-					height: this.com.offscreenHeight,
-					canvasId: this.canvasId,
-					success: (res) => {
-						resolve(res)
-					},
-					fail: (err) => {
-						reject(err)
-					},
-				}, this.com)
-			})
-		})
-	}
-}
-export class Canvas {
-	constructor(ctx, com, isNew, canvasNode={}) {
-		cacheChart[com.canvasId] = {ctx}
-		this.canvasId = com.canvasId;
-		this.chart = null;
-		this.isNew = isNew
-		this.tagName = 'canvas'
-		this.canvasNode = canvasNode;
-		this.com = com;
-		if (!isNew) {this._initStyle(ctx)}
-		this._initEvent();
-		this._ee = new EventEmit()
-	}
-	getContext(type) {
-		if (type === '2d') {
-			return this.ctx;
-		}
-	}
-	setAttribute(key, value) {
-		if(key === 'aria-label') {
-			this.com['ariaLabel'] = value
-		}
-	}
-	setChart(chart) {
-		this.chart = chart;
-	}
-	createOffscreenCanvas(param){
-		if(!this.children) {
-			this.com.isOffscreenCanvas = true
-			this.com.offscreenWidth = param.width||300
-			this.com.offscreenHeight = param.height||300
-			const com = this.com
-			const canvasId = this.com.offscreenCanvasId
-			const context = uni.createCanvasContext(canvasId, this.com)
-			this._initStyle(context)
-			this.children = new OffscreenCanvas(context, com, canvasId)
-		} 
-		return this.children
-	}
-	appendChild(child) {
-		console.log('child', child)
-	}
-	dispatchEvent(type, e) {
-		if(typeof type == 'object') {
-			this._ee.emit(type.type, type);
-		} else {
-			this._ee.emit(type, e);
-		}
-		return true
-	}
-	attachEvent() {
-	}
-	detachEvent() {
-	}
-	addEventListener(type, listener) {
-		this._ee.on(type, listener)
-	}
-	removeEventListener(type, listener) {
-		this._ee.off(type, listener)
-	}
-	_initCanvas(zrender, ctx) {
-		zrender.util.getContext = function() {
-			return ctx;
-		};
-		zrender.util.$override('measureText', function(text, font) {
-			ctx.font = font || '12px sans-serif';
-			return ctx.measureText(text, font);
-		});
-	}
-	_initStyle(ctx, child) {
-		const styles = [
-			'fillStyle',
-			'strokeStyle',
-			'fontSize',
-			'globalAlpha',
-			'opacity',
-			'textAlign',
-			'textBaseline',
-			'shadow',
-			'lineWidth',
-			'lineCap',
-			'lineJoin',
-			'lineDash',
-			'miterLimit',
-			'font'
-		];
-		const colorReg = /#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])\b/g;
-		styles.forEach(style => {
-			Object.defineProperty(ctx, style, {
-				set: value => {
-					if (style === 'font' && fontSizeReg.test(value)) {
-						const match = fontSizeReg.exec(value);
-						ctx.setFontSize(match[1]);
-						return;
-					}
-					if (style === 'opacity') {
-						ctx.setGlobalAlpha(value)
-						return;
-					}
-					if (style !== 'fillStyle' && style !== 'strokeStyle' || value !== 'none' && value !== null) {
-						// #ifdef H5 || APP-PLUS || MP-BAIDU
-						if(typeof value == 'object') {
-							if (value.hasOwnProperty('colorStop') || value.hasOwnProperty('colors')) {
-								ctx['set' + style.charAt(0).toUpperCase() + style.slice(1)](value);
-							}
-							return
-						} 
-						// #endif
-						// #ifdef MP-TOUTIAO
-						if(colorReg.test(value)) {
-							value = value.replace(colorReg, '#$1$1$2$2$3$3')
-						}
-						// #endif
-						ctx['set' + style.charAt(0).toUpperCase() + style.slice(1)](value);
-					}
-				}
-			});
-		});
-		if(!this.isNew && !child) {
-			ctx.uniDrawImage = ctx.drawImage
-			ctx.drawImage = (...a) => {
-				a[0] = a[0].src
-				ctx.uniDrawImage(...a)
-			}
-		}
-		if(!ctx.createRadialGradient) {
-			ctx.createRadialGradient = function() {
-				return ctx.createCircularGradient(...[...arguments].slice(-3))
-			};
-		}
-		// 字节不支持
-		if (!ctx.strokeText) {
-			ctx.strokeText = (...a) => {
-				ctx.fillText(...a)
-			}
-		}
-		// 钉钉不支持 
-		if (!ctx.measureText) {
-			const strLen = (str) => {
-				let len = 0;
-				for (let i = 0; i < str.length; i++) {
-					if (str.charCodeAt(i) > 0 && str.charCodeAt(i) < 128) {
-						len++;
-					} else {
-						len += 2;
-					}
-				}
-				return len;
-			}
-			ctx.measureText = (text, font) => {
-				let fontSize = 12;
-				if (font) {
-					fontSize = parseInt(font.match(/([\d\.]+)px/)[1])
-				}
-				fontSize /= 2;
-				return {
-					width: strLen(text) * fontSize
-				};
-			}
-		}
-	}
-
-	_initEvent(e) {
-		this.event = {};
-		const eventNames = [{
-			wxName: 'touchStart',
-			ecName: 'mousedown'
-		}, {
-			wxName: 'touchMove',
-			ecName: 'mousemove'
-		}, {
-			wxName: 'touchEnd',
-			ecName: 'mouseup'
-		}, {
-			wxName: 'touchEnd',
-			ecName: 'click'
-		}];
-
-		eventNames.forEach(name => {
-			this.event[name.wxName] = e => {
-				const touch = e.touches[0];
-				this.chart.getZr().handler.dispatch(name.ecName, {
-					zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
-					zrY: name.wxName === 'tap' ? touch.clientY : touch.y
-				});
-			};
-		});
-	}
-
-	set width(w) {
-		this.canvasNode.width = w
-	}
-	set height(h) {
-		this.canvasNode.height = h
-	}
-
-	get width() {
-		return this.canvasNode.width || 0
-	}
-	get height() {
-		return this.canvasNode.height || 0
-	}
-	get ctx() {
-		return cacheChart[this.canvasId]['ctx'] || null
-	}
-	set chart(chart) {
-		cacheChart[this.canvasId]['chart'] = chart
-	}
-	get chart() {
-		return cacheChart[this.canvasId]['chart'] || null
-	}
-}
-
-export function dispatch(name, {x,y, wheelDelta}) {
-	this.dispatch(name, {
-		zrX: x,
-		zrY: y,
-		zrDelta: wheelDelta,
-		preventDefault: () => {},
-		stopPropagation: () =>{}
-	});
-}
-export function setCanvasCreator(echarts, {canvas, node}) {
-	// echarts.setCanvasCreator(() => canvas);
-	if(echarts && !echarts.registerPreprocessor) {
-		return console.warn('echarts 版本不对或未传入echarts,vue3请使用esm格式')
-	}
-	echarts.registerPreprocessor(option => {
-		if (option && option.series) {
-			if (option.series.length > 0) {
-				option.series.forEach(series => {
-					series.progressive = 0;
-				});
-			} else if (typeof option.series === 'object') {
-				option.series.progressive = 0;
-			}
-		}
-	});
-	function loadImage(src, onload, onerror) {
-		let img = null
-		if(node && node.createImage) {
-			img = node.createImage()
-			img.onload = onload.bind(img);
-			img.onerror = onerror.bind(img);
-			img.src = src;
-			return img
-		} else {
-			img = new Image()
-			img.onload = onload.bind(img)
-			img.onerror = onerror.bind(img);
-			img.src = src
-			return img
-		}
-	}
-	if(echarts.setPlatformAPI) {
-		echarts.setPlatformAPI({
-			loadImage: canvas.setChart ? loadImage : null,
-			createCanvas(){
-				return canvas
-			}
-		})
-	}
-}

+ 0 - 462
sleep/uni_modules/lime-echart/components/l-echart/l-echart.vue

@@ -1,462 +0,0 @@
-<template>
-	<view class="lime-echart" :style="customStyle" v-if="canvasId" ref="limeEchart" :aria-label="ariaLabel">
-		<!-- #ifndef APP-NVUE -->
-		<canvas
-			class="lime-echart__canvas"
-			v-if="use2dCanvas"
-			type="2d"
-			:id="canvasId"
-			:style="canvasStyle"
-			:disable-scroll="isDisableScroll"
-			@touchstart="touchStart"
-			@touchmove="touchMove"
-			@touchend="touchEnd"
-		/>
-		<canvas
-			class="lime-echart__canvas"
-			v-else-if="isPc"
-			:style="canvasStyle"
-			:id="canvasId"
-			:canvas-id="canvasId"
-			:disable-scroll="isDisableScroll"
-			@mousedown="touchStart"
-			@mousemove="touchMove"
-			@mouseup="touchEnd"
-		/>
-		<canvas
-			class="lime-echart__canvas"
-			v-else
-			:width="nodeWidth"
-			:height="nodeHeight"
-			:style="canvasStyle"
-			:canvas-id="canvasId"
-			:id="canvasId"
-			:disable-scroll="isDisableScroll"
-			@touchstart="touchStart"
-			@touchmove="touchMove"
-			@touchend="touchEnd"
-		/>
-		<canvas v-if="isOffscreenCanvas" :style="offscreenStyle" :canvas-id="offscreenCanvasId"></canvas>
-		<!-- #endif -->
-		<!-- #ifdef APP-NVUE -->
-		<web-view
-			class="lime-echart__canvas"
-			:id="canvasId"
-			:style="canvasStyle"
-			:webview-styles="webviewStyles"
-			ref="webview"
-			src="/uni_modules/lime-echart/static/index.html"
-			@pagefinish="finished = true"
-			@onPostMessage="onMessage"
-		></web-view>
-		<!-- #endif -->
-	</view>
-</template>
-
-<script>
-// #ifdef VUE3
-// #ifdef APP-PLUS
-global = {}
-// #endif
-// #endif
-// #ifndef APP-NVUE
-import {Canvas, setCanvasCreator, dispatch} from './canvas';
-import {wrapTouch, devicePixelRatio ,sleep, canIUseCanvas2d, getRect} from './utils';
-// #endif
-// #ifdef APP-NVUE
-import { base64ToPath, sleep } from './utils';
-import {Echarts} from './nvue'
-// #endif
-const charts = {}
-const echartsObj = {}
-export default {
-	name: 'lime-echart',
-	props: {
-		// #ifdef MP-WEIXIN || MP-TOUTIAO
-		type: {
-			type: String,
-			default: '2d'
-		},
-		// #endif
-		// #ifdef APP-NVUE
-		webviewStyles: Object,
-		// hybrid: Boolean,
-		// #endif
-		customStyle: String,
-		isDisableScroll: Boolean,
-		isClickable: {
-			type: Boolean,
-			default: true
-		},
-		enableHover: Boolean,
-		beforeDelay: {
-			type: Number,
-			default: 30
-		}
-	},
-	data() {
-		return {
-			// #ifdef MP-WEIXIN || MP-TOUTIAO || MP-ALIPAY
-			use2dCanvas: true,
-			// #endif
-			// #ifndef MP-WEIXIN || MP-TOUTIAO || MP-ALIPAY
-			use2dCanvas: false,
-			// #endif
-			ariaLabel: '图表',
-			width: null,
-			height: null,
-			nodeWidth: null,
-			nodeHeight: null,
-			canvasNode: null,
-			config: {},
-			inited: false,
-			finished: false,
-			file: '',
-			platform: '',
-			isPc: false,
-			isDown: false,
-			isOffscreenCanvas: false,
-			offscreenWidth: 0,
-			offscreenHeight: 0
-		};
-	},
-	computed: {
-		canvasId() {
-			return `lime-echart${this._ && this._.uid || this._uid}`
-		},
-		offscreenCanvasId() {
-			return `${this.canvasId}_offscreen`
-		},
-		offscreenStyle() {
-			return `width:${this.offscreenWidth}px;height: ${this.offscreenHeight}px; position: fixed; left: 99999px; background: red`
-		},
-		canvasStyle() {
-			return  this.width && this.height ? ('width:' + this.width + 'px;height:' + this.height + 'px') : ''
-		}
-	},
-	// #ifndef VUE3
-	beforeDestroy() {
-		this.clear()
-		this.dispose()
-		// #ifdef H5
-		if(this.isPc) {
-			document.removeEventListener('mousewheel', this.mousewheel)
-		}
-		// #endif
-	},
-	// #endif
-	// #ifdef VUE3
-	unmounted() {
-		this.clear()
-		this.dispose()
-		// #ifdef H5
-		if(this.isPc) {
-			document.removeEventListener('mousewheel', this.mousewheel)
-		}
-		// #endif
-	},
-	// #endif
-	created() {
-		// #ifdef H5
-		if(!('ontouchstart' in window)) {
-			this.isPc = true
-			document.addEventListener('mousewheel', this.mousewheel)
-		}
-		// #endif
-		// #ifdef MP-WEIXIN || MP-TOUTIAO || MP-ALIPAY
-		const { platform } = uni.getSystemInfoSync();
-		this.isPC = /windows/i.test(platform)
-		// #endif
-		this.use2dCanvas = this.type === '2d' && canIUseCanvas2d()
-	},
-	mounted() {
-		this.$nextTick(() => {
-			this.$emit('finished')
-		})
-	},
-	methods: {
-		// #ifdef APP-NVUE
-		onMessage(e) {
-			const res = e?.detail?.data[0] || null;
-			if (res?.event) {
-				if(res.event === 'inited') {
-					this.inited = true
-				}
-				this.$emit(res.event, JSON.parse(res.data));
-			} else if(res?.file){
-				this.file = res.data
-			} else if(!res[0] && JSON.stringify(res[0]) != '{}'){
-				console.error(res);
-			} else {
-				console.log(...res)
-			}
-		},
-		// #endif
-		setChart(callback) {
-			if(!this.chart) {
-				console.warn(`组件还未初始化,请先使用 init`)
-				return
-			}
-			if(typeof callback === 'function' && this.chart) {
-				callback(this.chart);
-			}
-			// #ifdef APP-NVUE
-			if(typeof callback === 'function') {
-				this.$refs.webview.evalJs(`setChart(${JSON.stringify(callback.toString())}, ${JSON.stringify(this.chart.options)})`);
-			}
-			// #endif
-		},
-		setOption() {
-			if (!this.chart || !this.chart.setOption) {
-				console.warn(`组件还未初始化,请先使用 init`)
-				return
-			}
-			this.chart.setOption(...arguments);
-		},
-		showLoading() {
-			if(this.chart) {
-				this.chart.showLoading(...arguments)
-			}
-		},
-		hideLoading() {
-			if(this.chart) {
-				this.chart.hideLoading()
-			}
-		},
-		clear() {
-			if(this.chart) {
-				this.chart.clear()
-			}
-		},
-		dispose() {
-			if(this.chart) {
-				this.chart.dispose()
-			}
-		},
-		resize(size) {
-			if(size && size.width && size.height) {
-				this.height = size.height
-				this.width = size.width
-				if(this.chart) {this.chart.resize(size)}
-			} else {
-				this.$nextTick(() => {
-					uni.createSelectorQuery()
-						.in(this)
-						.select(`.lime-echart`)
-						.boundingClientRect()
-						.exec(res => {
-							if (res) {
-								let { width, height } = res[0];
-								this.width = width = width || 300;
-								this.height = height = height || 300;
-								this.chart.resize({width, height})
-							}
-						});
-				})
-				
-			}
-			
-		},
-		canvasToTempFilePath(args = {}) {
-			// #ifndef APP-NVUE
-			const { use2dCanvas, canvasId, canvasNode } = this;
-			return new Promise((resolve, reject) => {
-				const copyArgs = Object.assign({
-					canvasId,
-					success: resolve,
-					fail: reject
-				}, args);
-				if (use2dCanvas) {
-					delete copyArgs.canvasId;
-					copyArgs.canvas = canvasNode;
-				}
-				uni.canvasToTempFilePath(copyArgs, this);
-			});
-			// #endif
-			// #ifdef APP-NVUE
-			this.file = ''
-			this.$refs.webview.evalJs(`canvasToTempFilePath()`);
-			return new Promise((resolve, reject) => {
-				this.$watch('file', async (file) => {
-					if(file) {
-						const tempFilePath = await base64ToPath(file)
-						resolve(args.success({tempFilePath}))
-					} else {
-						reject(args.fail({error: ``}))
-					}
-				})
-			})
-			// #endif
-		},
-		async init(echarts, ...args) {
-			// #ifndef APP-NVUE
-			if(arguments && arguments.length < 1) {
-				console.error('缺少参数:init(echarts, theme?:string, opts?: object, callback?: function)')
-				return
-			}
-			// #endif
-			let theme=null,opts={},callback;
-			
-			Array.from(arguments).forEach(item => {
-				if(typeof item === 'function') {
-					callback = item
-				}
-				if(['string'].includes(typeof item)) {
-					theme = item
-				}
-				if(typeof item === 'object') {
-					opts = item
-				}
-			})
-			
-			if(this.beforeDelay) {
-				await sleep(this.beforeDelay)
-			}
-			let config = await this.getContext();
-			// #ifndef APP-NVUE
-			setCanvasCreator(echarts, config)
-			this.chart = echarts.init(config.canvas, theme, Object.assign({}, config, opts))
-			if(typeof callback === 'function') {
-				callback(this.chart)
-			} else {
-				return this.chart
-			}
-			// #endif
-			// #ifdef APP-NVUE
-			this.chart = new Echarts(this.$refs.webview)
-			this.$refs.webview.evalJs(`init(null, null, ${JSON.stringify(opts)}, ${theme})`)
-			if(callback) {
-				callback(this.chart)
-			} else {
-				return this.chart
-			}
-			// #endif
-		},
-		getContext() {
-			// #ifdef APP-NVUE
-			if(this.finished) {
-				return Promise.resolve(this.finished)
-			}
-			return new Promise(resolve => {
-				this.$watch('finished', (val) => {
-					if(val) {
-						resolve(this.finished)
-					}
-				})
-			})
-			// #endif
-			// #ifndef APP-NVUE
-			return getRect(`#${this.canvasId}`, {context: this, type: this.use2dCanvas ? 'fields': 'boundingClientRect'}).then(res => {
-				if(res) {
-					let dpr = devicePixelRatio
-					let {width, height, node} = res
-					let canvas;
-					this.width = width = width || 300;
-					this.height = height = height || 300;
-					if(node) {
-						const ctx = node.getContext('2d');
-						canvas = new Canvas(ctx, this, true, node);
-						this.canvasNode = node
-					} else {
-						// #ifdef MP-TOUTIAO
-						dpr = !this.isPC ? devicePixelRatio : 1// 1.25
-						// #endif
-						// #ifndef MP-ALIPAY || MP-TOUTIAO
-						dpr = this.isPC ? devicePixelRatio : 1
-						// #endif
-						// #ifdef MP-ALIPAY || MP-LARK
-						dpr = devicePixelRatio
-						// #endif
-						this.rect = res
-						this.nodeWidth = width * dpr;
-						this.nodeHeight = height * dpr;
-						const ctx = uni.createCanvasContext(this.canvasId, this);
-						canvas =  new Canvas(ctx, this, false);
-					}
-					return { canvas, width, height, devicePixelRatio: dpr, node };
-				} else {
-					return {}
-				}
-			})
-			// #endif
-		},
-		// #ifndef APP-NVUE
-		getRelative(e) {
-			return {x: e.pageX - this.rect.left, y: e.pageY - this.rect.top, wheelDelta: e.wheelDelta}
-		},
-		getTouch(e) {
-			return e.touches && e.touches[0] && e.touches[0].x ? e.touches[0] : this.getRelative(e);
-		},
-		touchStart(e) {
-			this.isDown = true
-			if (this.chart && ((e.touches.length > 0 || e.touches['0'])  && e.type != 'mousemove' || e.type == 'mousedown')) {
-				const touch = this.getTouch(e)
-				this.startX = touch.x
-				this.startY = touch.y
-				this.startT = new Date()
-				const handler = this.chart.getZr().handler;
-				dispatch.call(handler, 'mousedown', touch)
-				dispatch.call(handler, 'mousemove', touch)
-				handler.processGesture(wrapTouch(e), 'start');
-				clearTimeout(this.endTimer);
-			}
-		},
-		touchMove(e) {
-			if(this.isPc && this.enableHover && !this.isDown) {this.isDown = true}
-			if (this.chart && ((e.touches.length > 0 || e.touches['0']) && e.type != 'mousemove' || e.type == 'mousemove' && this.isDown)) {
-				const handler = this.chart.getZr().handler;
-				dispatch.call(handler, 'mousemove', this.getTouch(e))
-				handler.processGesture(wrapTouch(e), 'change');
-			}
-		},
-		touchEnd(e) {
-			this.isDown = false
-			if (this.chart) {
-				const {x} = e.changedTouches && e.changedTouches[0] || {}
-				const touch = (x ? e.changedTouches[0] : this.getRelative(e)) || {};
-				const handler = this.chart.getZr().handler;
-				const isClick = Math.abs(touch.x - this.startX) < 10 && new Date() - this.startT < 200;
-				dispatch.call(handler, 'mouseup', touch)
-				handler.processGesture(wrapTouch(e), 'end');
-				if(isClick) {
-					dispatch.call(handler, 'click', touch)
-				} else {
-					this.endTimer = setTimeout(() => {
-						dispatch.call(handler, 'mousemove', {x: 999999999,y: 999999999});
-						dispatch.call(handler, 'mouseup', {x: 999999999,y: 999999999});
-					},50)
-				}
-			}
-		},
-		// #endif
-		// #ifdef H5
-		mousewheel(e){
-			if(this.chart) {
-				dispatch.call(this.chart.getZr().handler, 'mousewheel', this.getTouch(e))
-			}
-		}
-		// #endif
-	}
-};
-</script>
-<style scoped>
-.lime-echart {
-	position: relative;
-	/* #ifndef APP-NVUE */
-	width: 100%;
-	height: 100%;
-	/* #endif */
-	/* #ifdef APP-NVUE */
-	flex: 1;
-	/* #endif */
-}
-.lime-echart__canvas {
-	/* #ifndef APP-NVUE */
-	width: 100%;
-	height: 100%;
-	/* #endif */
-	/* #ifdef APP-NVUE */
-	flex: 1;
-	/* #endif */
-}
-</style>

+ 0 - 35
sleep/uni_modules/lime-echart/components/l-echart/nvue.js

@@ -1,35 +0,0 @@
-export class Echarts {
-	constructor(webview) {
-		this.webview = webview
-		this.options = null
-	}
-	setOption() {
-		this.options = arguments
-		this.webview.evalJs(`setOption(${JSON.stringify(arguments)})`);
-	}
-	getOption() {
-		return this.options
-	}
-	showLoading() {
-		this.webview.evalJs(`showLoading(${JSON.stringify(arguments)})`);
-	}
-	hideLoading() {
-		this.webview.evalJs(`hideLoading()`);
-	}
-	clear() {
-		this.webview.evalJs(`clear()`);
-	}
-	dispose() {
-		this.webview.evalJs(`dispose()`);
-	}
-	resize(size) {
-		if(size) {
-			this.webview.evalJs(`resize(${size})`);
-		} else {
-			this.webview.evalJs(`resize()`);
-		}
-	}
-	on(type, ...args) {
-		console.warn('nvue 暂不支持事件')
-	}
-}

+ 0 - 126
sleep/uni_modules/lime-echart/components/l-echart/utils.js

@@ -1,126 +0,0 @@
-// #ifndef APP-NVUE
-// 计算版本
-export function compareVersion(v1, v2) {
-	v1 = v1.split('.')
-	v2 = v2.split('.')
-	const len = Math.max(v1.length, v2.length)
-	while (v1.length < len) {
-		v1.push('0')
-	}
-	while (v2.length < len) {
-		v2.push('0')
-	}
-	for (let i = 0; i < len; i++) {
-		const num1 = parseInt(v1[i], 10)
-		const num2 = parseInt(v2[i], 10)
-
-		if (num1 > num2) {
-			return 1
-		} else if (num1 < num2) {
-			return -1
-		}
-	}
-	return 0
-}
-const systemInfo = uni.getSystemInfoSync();
-function gte(version) {
-	// 截止 2023-03-22 mac pc小程序不支持 canvas 2d
-	console.log('uni', uni)
-	let { SDKVersion, platform } = systemInfo;
-	// #ifdef MP-ALIPAY
-	SDKVersion = my.SDKVersion
-	// #endif
-	// #ifdef MP-WEIXIN
-	return platform !== 'mac' && compareVersion(SDKVersion, version) >= 0;
-	// #endif
-	return compareVersion(SDKVersion, version) >= 0;
-}
-
-
-export function canIUseCanvas2d() {
-	// #ifdef MP-WEIXIN
-	return gte('2.9.0');
-	// #endif
-	// #ifdef MP-ALIPAY
-	return gte('2.7.0');
-	// #endif
-	// #ifdef MP-TOUTIAO
-	return gte('1.78.0');
-	// #endif
-	return false
-}
-
-export function wrapTouch(event) {
-	for (let i = 0; i < event.touches.length; ++i) {
-		const touch = event.touches[i];
-		touch.offsetX = touch.x;
-		touch.offsetY = touch.y;
-	}
-	return event;
-}
-export const devicePixelRatio = uni.getSystemInfoSync().pixelRatio
-// #endif
-// #ifdef APP-NVUE
-export function base64ToPath(base64) {
-	return new Promise((resolve, reject) => {
-		const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64) || [];
-		const bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now())
-		bitmap.loadBase64Data(base64, () => {
-			if (!format) {
-				reject(new Error('ERROR_BASE64SRC_PARSE'))
-			}
-			const time = new Date().getTime();
-			const filePath = `_doc/uniapp_temp/${time}.${format}`
-
-			bitmap.save(filePath, {},
-				() => {
-					bitmap.clear()
-					resolve(filePath)
-				},
-				(error) => {
-					bitmap.clear()
-					console.error(`${JSON.stringify(error)}`)
-					reject(error)
-				})
-		}, (error) => {
-			bitmap.clear()
-			console.error(`${JSON.stringify(error)}`)
-			reject(error)
-		})
-	})
-}
-// #endif
-
-
-export function sleep(time) {
-	return new Promise((resolve) => {
-		setTimeout(() => {
-			resolve(true)
-		}, time)
-	})
-}
-
-
-export function getRect(selector, options = {}) {
-	const typeDefault = 'boundingClientRect'
-	const { context, type = typeDefault} = options
-	return new Promise((resolve, reject) => {
-		const dom = uni.createSelectorQuery().in(context).select(selector);
-		const result = (rect) => {
-			if(rect) {
-				 resolve(rect)
-			} else {
-				reject()
-			}
-		}
-		if(type == typeDefault) {
-			dom[type](result).exec()
-		} else {
-			dom[type]({
-				node: true,
-				size: true,
-				rect: true
-			}, result).exec()
-		}
-	});
-};

+ 0 - 103
sleep/uni_modules/lime-echart/components/lime-echart/lime-echart.vue

@@ -1,103 +0,0 @@
-<template>
-	<view >
-		<view style="height: 750rpx; background-color: aquamarine;">
-			<l-echart ref="chart" @finished="init"></l-echart>
-		</view>
-	</view>		
-</template>
-
-<script>
-	// nvue 不需要引入
-	// #ifdef VUE2
-	import * as echarts from '@/uni_modules/lime-echart/static/echarts.min';
-	// #endif
-	// #ifdef VUE3
-	// #ifdef MP
-	// 由于vue3 使用vite 不支持umd格式的包,小程序依然可以使用,但需要使用require
-	const echarts = require('../../static/echarts.min');
-	// #endif
-	// #ifndef MP
-	// 由于 vue3 使用vite 不支持umd格式的包,故引入npm的包
-	import * as echarts from 'echarts/dist/echarts.esm';
-	// #endif
-	// #endif
-	export default {
-		data() {
-			return {
-				option:  {
-					tooltip: {
-						trigger: 'axis',
-						// shadowBlur: 0,
-						textStyle: {
-							textShadowBlur : 0
-						}
-					},
-					legend: {
-						data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
-					},
-					grid: {
-						left: '3%',
-						right: '4%',
-						bottom: '3%',
-						containLabel: true
-					},
-					xAxis: {
-						type: 'category',
-						boundaryGap: false,
-						data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
-					},
-					yAxis: {
-						type: 'value'
-					},
-					series: [
-						{
-							name: '邮件营销',
-							type: 'line',
-							stack: '总量',
-							data: [120, 132, 101, 134, 90, 230, 210]
-						},
-						{
-							name: '联盟广告',
-							type: 'line',
-							stack: '总量',
-							data: [220, 182, 191, 234, 290, 330, 310]
-						},
-						{
-							name: '视频广告',
-							type: 'line',
-							stack: '总量',
-							data: [150, 232, 201, 154, 190, 330, 410]
-						},
-						{
-							name: '直接访问',
-							type: 'line',
-							stack: '总量',
-							data: [320, 332, 301, 334, 390, 330, 320]
-						},
-						{
-							name: '搜索引擎',
-							type: 'line',
-							stack: '总量',
-							data: [820, 932, 901, 934, 1290, 1330, 1320]
-						}
-					]
-				}
-			}
-		},
-		methods: {
-			init() {
-				this.$refs.chart.init(echarts, chart => {
-					chart.setOption(this.option);
-					console.log('res::::')
-				});
-			},
-			save() {
-				this.$refs.chart.canvasToTempFilePath({
-					success(res) {
-						console.log('res::::', res)
-					}
-				})
-			}
-		}
-	}
-</script>

+ 0 - 88
sleep/uni_modules/lime-echart/package.json

@@ -1,88 +0,0 @@
-{
-  "id": "lime-echart",
-  "displayName": "echarts",
-  "version": "0.7.5",
-  "description": "echarts 全端兼容,一款使echarts图表能跑在uniapp各端中的插件",
-  "keywords": [
-    "echarts",
-    "canvas",
-    "图表",
-    "可视化"
-],
-  "repository": "https://gitee.com/liangei/lime-echart",
-  "engines": {
-    "HBuilderX": "^3.6.4"
-  },
-  "dcloudext": {
-    "sale": {
-      "regular": {
-        "price": "0.00"
-      },
-      "sourcecode": {
-        "price": "0.00"
-      }
-    },
-    "contact": {
-      "qq": ""
-    },
-    "declaration": {
-      "ads": "无",
-      "data": "无",
-      "permissions": "无"
-    },
-    "npmurl": "",
-    "type": "component-vue"
-  },
-  "uni_modules": {
-    "dependencies": [],
-    "encrypt": [],
-    "platforms": {
-      "cloud": {
-        "tcb": "y",
-        "aliyun": "y"
-      },
-      "client": {
-        "App": {
-          "app-vue": "y",
-          "app-nvue": "y"
-        },
-        "H5-mobile": {
-          "Safari": "y",
-          "Android Browser": "y",
-          "微信浏览器(Android)": "y",
-          "QQ浏览器(Android)": "y"
-        },
-        "H5-pc": {
-          "Chrome": "u",
-          "IE": "u",
-          "Edge": "u",
-          "Firefox": "u",
-          "Safari": "u"
-        },
-        "小程序": {
-          "微信": "y",
-          "阿里": "y",
-          "百度": "y",
-          "字节跳动": "y",
-          "QQ": "y",
-          "钉钉": "u",
-          "快手": "u",
-          "飞书": "u",
-          "京东": "u"
-        },
-        "快应用": {
-          "华为": "u",
-          "联盟": "u"
-        },
-        "Vue": {
-          "vue2": "y",
-          "vue3": "y"
-        }
-      }
-    }
-  },
-  "dependencies": {
-    "echarts": "^5.4.1",
-    "zrender": "^5.4.3"
-  }
-}

+ 0 - 42
sleep/uni_modules/lime-echart/pnpm-lock.yaml

@@ -1,42 +0,0 @@
-lockfileVersion: 5.4
-
-specifiers:
-  echarts: ^5.4.1
-  zrender: ^5.4.3
-
-dependencies:
-  echarts: registry.npmmirror.com/echarts/5.4.1
-  zrender: registry.npmmirror.com/zrender/5.4.3
-
-packages:
-
-  registry.npmmirror.com/echarts/5.4.1:
-    resolution: {integrity: sha512-9ltS3M2JB0w2EhcYjCdmtrJ+6haZcW6acBolMGIuf01Hql1yrIV01L1aRj7jsaaIULJslEP9Z3vKlEmnJaWJVQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/echarts/-/echarts-5.4.1.tgz}
-    name: echarts
-    version: 5.4.1
-    dependencies:
-      tslib: registry.npmmirror.com/tslib/2.3.0
-      zrender: registry.npmmirror.com/zrender/5.4.1
-    dev: false
-
-  registry.npmmirror.com/tslib/2.3.0:
-    resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz}
-    name: tslib
-    version: 2.3.0
-    dev: false
-
-  registry.npmmirror.com/zrender/5.4.1:
-    resolution: {integrity: sha512-M4Z05BHWtajY2241EmMPHglDQAJ1UyHQcYsxDNzD9XLSkPDqMq4bB28v9Pb4mvHnVQ0GxyTklZ/69xCFP6RXBA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/zrender/-/zrender-5.4.1.tgz}
-    name: zrender
-    version: 5.4.1
-    dependencies:
-      tslib: registry.npmmirror.com/tslib/2.3.0
-    dev: false
-
-  registry.npmmirror.com/zrender/5.4.3:
-    resolution: {integrity: sha512-DRUM4ZLnoaT0PBVvGBDO9oWIDBKFdAVieNWxWwK0niYzJCMwGchRk21/hsE+RKkIveH3XHCyvXcJDkgLVvfizQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/zrender/-/zrender-5.4.3.tgz}
-    name: zrender
-    version: 5.4.3
-    dependencies:
-      tslib: registry.npmmirror.com/tslib/2.3.0
-    dev: false

+ 0 - 318
sleep/uni_modules/lime-echart/readme.md

@@ -1,318 +0,0 @@
-# echarts 图表 <span style="font-size:16px;">👑👑👑👑👑 <span style="background:#ff9d00;padding:2px 4px;color:#fff;font-size:10px;border-radius: 3px;">全端</span></span>
-> 一个基于 JavaScript 的开源可视化图表库   [查看更多 站点1](https://limeui.qcoon.cn/#/echart) |  [查看更多 站点2](http://liangei.gitee.io/limeui/#/echart)  <br>
-> 基于 echarts 做了兼容处理,更多示例请访问  [uni示例 站点1](https://limeui.qcoon.cn/#/echart-example) | [uni示例 站点2](http://liangei.gitee.io/limeui/#/echart-example) | [官方示例](https://echarts.apache.org/examples/zh/index.html)     <br>
-> Q群:1046793420 <br>
-
-## 平台兼容
-
-| H5  | 微信小程序 | 支付宝小程序 | 百度小程序 | 头条小程序 | QQ 小程序 | App  |
-| --- | ---------- | ------------ | ---------- | ---------- | --------- | ---- |
-| √   | √          | √         | √      | √       | √      | √ |
-
-
-## 安装
-- 第一步、在uniapp 插件市场 找到 [百度图表](https://ext.dcloud.net.cn/plugin?id=4899) 导入
-- 第二步、安装 echarts 或者直接使用插件内的echarts.min文件
-```cmd
-pnpm add echarts
- -or-
-npm install echarts
-```
-
-
-**注意** 
-* 🔔 必须使用hbuilderx 3.4.8-alpha及以上
-* 🔔 echarts 5.3.0及以上
-* 🔔 如果是 `cli` 项目需要主动 `import` 插件
-```js
-import LEchart from '@/uni_modules/lime-echart/components/l-echart/l-echart.vue';
-export default {
-	components: {LEchart}
-}
-```
-
-## 代码演示
-### 基础用法
-```html
-<view><l-echart ref="chart" @finished="init"></l-echart></view>
-```
-
-```js
-// 方式一:自定义包
-// 使用插件内提供的echarts.min
-// 或在官网自定义包:https://echarts.apache.org/zh/builder.html
-// 注意 插件内的包是umd格式的,如果你是vue3请使用esm格式的包 https://github.com/apache/echarts/tree/master/dist
-import * as echarts from '@/uni_modules/lime-echart/static/echarts.min'
-
-
-// 方式二:全量包
-// 如果你使用 npm 安装了 echarts
-import * as echarts from 'echarts'
-
-
-// 方式三:按需引入
-// 按需引入 开始
-import * as echarts from 'echarts/core';
-import {LineChart, BarChart} from 'echarts/charts';
-import {TitleComponent,TooltipComponent,GridComponent, DatasetComponent, TransformComponent, LegendComponent } from 'echarts/components';
-// 标签自动布局,全局过渡动画等特性
-import {LabelLayout,UniversalTransition} from 'echarts/features';
-// 引入 Canvas 渲染器,注意引入 CanvasRenderer 是必须的一步
-import {CanvasRenderer} from 'echarts/renderers';
-
-// 按需引入 注册必须的组件
-echarts.use([
-	LegendComponent,
-	TitleComponent,
-	TooltipComponent,
-	GridComponent,
-	DatasetComponent,
-	TransformComponent,
-	LineChart,
-	BarChart,
-	LabelLayout,
-	UniversalTransition,
-	CanvasRenderer
-]);
-//-------------按需引入结束------------------------
-
-
-export default {
-	data() {
-		return {
-			option: {
-				tooltip: {
-					trigger: 'axis',
-					axisPointer: {
-						type: 'shadow' 
-					},
-					confine: true
-				},
-				legend: {
-					data: ['热度', '正面', '负面']
-				},
-				grid: {
-					left: 20,
-					right: 20,
-					bottom: 15,
-					top: 40,
-					containLabel: true
-				},
-				xAxis: [
-					{
-						type: 'value',
-						axisLine: {
-							lineStyle: {
-								color: '#999999'
-							}
-						},
-						axisLabel: {
-							color: '#666666'
-						}
-					}
-				],
-				yAxis: [
-					{
-						type: 'category',
-						axisTick: { show: false },
-						data: ['汽车之家', '今日头条', '百度贴吧', '一点资讯', '微信', '微博', '知乎'],
-						axisLine: {
-							lineStyle: {
-								color: '#999999'
-							}
-						},
-						axisLabel: {
-							color: '#666666'
-						}
-					}
-				],
-				series: [
-					{
-						name: '热度',
-						type: 'bar',
-						label: {
-							normal: {
-								show: true,
-								position: 'inside'
-							}
-						},
-						data: [300, 270, 340, 344, 300, 320, 310],
-					},
-					{
-						name: '正面',
-						type: 'bar',
-						stack: '总量',
-						label: {
-							normal: {
-								show: true
-							}
-						},
-						data: [120, 102, 141, 174, 190, 250, 220]
-					},
-					{
-						name: '负面',
-						type: 'bar',
-						stack: '总量',
-						label: {
-							normal: {
-								show: true,
-								position: 'left'
-							}
-						},
-						data: [-20, -32, -21, -34, -90, -130, -110]
-					}
-				]
-			},
-		};
-	},
-	// 组件能被调用必须是组件的节点已经被渲染到页面上
-	// 1、在页面mounted里调用,有时候mounted 组件也未必渲染完成
-	mounted() {
-		// init(echarts, theme?:string, opts?:{}, chart => {})
-		// echarts 必填, 非nvue必填,nvue不用填
-		// theme 可选,应用的主题,目前只支持名称,如:'dark'
-		// opts = { // 可选
-		//	locale?: string  // 从 `5.0.0` 开始支持
-		// }
-		// chart => {} , callback 返回图表实例
-		this.$refs.chart.init(echarts, chart => {
-			chart.setOption(this.option);
-		});
-	},
-	// 2、或者使用组件的finished事件里调用
-	methods: {
-		async init() {
-			// chart 图表实例不能存在data里
-			const chart = await this.$refs.chart.init(echarts);
-			chart.setOption(this.option)
-		}
-	}
-}
-```
-
-## 数据更新
-- 使用 `ref` 可获取`setOption`设置更新
-
-```js
-this.$refs.chart.setOption(data)
-```
-
-## 图表大小
-- 在有些场景下,我们希望当容器大小改变时,图表的大小也相应地改变。
-
-```js
-// 默认获取容器尺寸
-this.$refs.chart.resize()
-// 指定尺寸
-this.$refs.chart.resize({width: 375, height: 375})
-```
-
-## 插件标签
-- 默认 l-echart 为 component
-- 默认 lime-echart 为 demo
-```html
- // 在任意地方使用可查看domo, 代码位于/uni_modules/lime-echart/component/lime-echart
-<lime-echart></lime-echart>
-```
-
-
-## 常见问题
-- 微信小程序 `2d` 只支持 真机调试2.0
-- 微信开发工具会出现 `canvas` 不跟随页面的情况,真机不影响
-- toolbox 不支持 `saveImage`
-- echarts 5.3.0 的 lines 不支持 trailLength,故需设置为 `0`
-- dataZoom H5不要设置 `showDetail` 
-- 如果微信小程序的`tooltip`文字有阴影,可能是微信的锅,临时解决方法是`tooltip.shadowBlur = 0`
-- 如果钉钉小程序上传时报安全问题`Uint8Clamped`,可以向钉钉反馈是安全代码扫描把Uint8Clamped数组错误识别了,也可以在 echarts 文件修改`Uint8Clamped`
-```js
-// 找到这段代码把代码中`Uint8Clamped`改成`Uint8_Clamped`,再把下划线去掉,不过直接去掉`Uint8Clamped`也是可行的
-// ["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],(function(t,e){return t["[object "+e+"Array]"]
-// 改成如下
-["Int8","Uint8","Uint8_Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],(function(t,e){return t["[object "+e.replace('_','')+"Array]"]
-```
-
-- 注意 如果您是使用 **vite + vue3** 非wx平台可能会遇到`echarts`文件缺少`wx`判断导致无法使用,您可以在`echarts.min.js`文件开头增加以下内容,参考插件内的echart.min.js的做法
-```js
-var prefix = () => {
-	var UNDEFINED = 'undefined'
-	if(typeof wx !== UNDEFINED) return wx // 微信
-	if(typeof tt !== UNDEFINED) return tt // 字节 飞书
-	if(typeof swan !== UNDEFINED) return swan // 百度
-	if(typeof my !== UNDEFINED) return my // 支付宝
-	if(typeof dd !== UNDEFINED) return dd // 钉钉
-	if(typeof ks !== UNDEFINED) return ks // 快手
-	if(typeof jd !== UNDEFINED) return jd // 京东
-	if(typeof qa !== UNDEFINED) return qa // 快应用
-	if(typeof qq !== UNDEFINED) return qq // qq
-	if(typeof qh !== UNDEFINED) return qh // 360
-	if(typeof uni !== UNDEFINED) return uni
-	return null
-}
-//在 !function(t,e){"object"==typeof 下面加入 可能是第36行
-var wx = prefix();
-/*! *****************************************************************************
-    Copyright (c) Microsoft Corporation.
-```
-
-- 或者在`vite.config.js`的`define`设置环境
-
-```js
-//  或者在`vite.config.js`的`define`设置环境
-import { defineConfig } from 'vite';
-import uni from '@dcloudio/vite-plugin-uni';
-
-const UNI_PLATFORM = {
-	"app": "uni",
-	"web": "uni",
-	"mp-weixin": "wx",
-	"mp-baidu": "swan",
-	"mp-alipay": "my",
-	"mp-toutiao": "tt",
-	"mp-lark": "tt",
-	"mp-qq": "qq",
-	"mp-kuaishou": "ks",
-	"mp-jd": "jd",
-	"mp-360": "qh",
-	"quickapp-webview-union": "qa",
-	"quickapp-webview-huawei": "qa",
-	"quickapp-webview": "qa",
-}
-
-export default defineConfig({
-	plugins: [uni()],
-	define: { 
-		global: UNI_PLATFORM[process.env.UNI_PLATFORM],
-		wx: UNI_PLATFORM[process.env.UNI_PLATFORM]
-	}
-});
-```
-
-
-## Props
-
-| 参数             | 说明                                                            | 类型             | 默认值        | 版本 	|
-| ---------------  | --------                                                        | -------         | ------------ | ----- 	|
-| custom-style     | 自定义样式                                                      |   `string`       | -            | -     	|
-| type             | 指定 canvas 类型                                				 |    `string`      | `2d`         |   	    |
-| is-disable-scroll | 触摸图表时是否禁止页面滚动                                       |    `boolean`     | `false`     |   	    |
-| beforeDelay       |  延迟初始化 (毫秒)                       						|    `number`     | `30`     |   	    |
-| enableHover       |  PC端使用鼠标悬浮                       						|    `boolean`     | `false`     |   	    |
-
-## 事件
-
-| 参数                    | 说明                                                                                                             |
-| ---------------        | ---------------                                                                                                  |
-| init(echarts, chart => {})  | 初始化调用函数,第一个参数是传入`echarts`,第二个参数是回调函数,回调函数的参数是 `chart` 实例                                           |  
-| setChart(chart => {})        | 已经初始化后,请使用这个方法,是个回调函数,参数是 `chart` 实例                  |  
-| setOption(data)        | [图表配置项](https://echarts.apache.org/zh/option.html#title),用于更新 ,传递是数据 `option`  |  
-| clear()                | 清空当前实例,会移除实例中所有的组件和图表。  |  
-| dispose()              | 销毁实例  |  
-| showLoading()          | 显示加载  |  
-| hideLoading()          | 隐藏加载  |  
-| [canvasToTempFilePath](https://uniapp.dcloud.io/api/canvas/canvasToTempFilePath.html#canvastotempfilepath)(opt)  | 用于生成图片,与官方使用方法一致,但不需要传`canvasId`  |  
-
-
-## 打赏
-如果你觉得本插件,解决了你的问题,赠人玫瑰,手留余香。  
-![](https://testingcf.jsdelivr.net/gh/liangei/image@1.9/alipay.png)
-![](https://testingcf.jsdelivr.net/gh/liangei/image@1.9/wpay.png)

Plik diff jest za duży
+ 0 - 1
sleep/uni_modules/lime-echart/static/ecStat.min.js


Plik diff jest za duży
+ 0 - 60
sleep/uni_modules/lime-echart/static/echarts.min.js


+ 0 - 129
sleep/uni_modules/lime-echart/static/index.html

@@ -1,129 +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.3.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(...agrs) {
-				postMessage(agrs)
-			}
-			function emit(event, data) {
-				let dataStr = JSON.stringify(data, stringify)
-				postMessage({
-					event,
-					data: dataStr
-				})
-				cache = []
-			}
-			function postMessage(data) {
-				uni.postMessage({
-					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 = null) {
-				if(!chart) {
-					chart = echarts.init(document.getElementById('limeChart'), theme, opts)
-					if(options) {
-						chart.setOption(options)
-					}
-					// const name = parse('a', callback, options)
-					// console.log('options::', callback)
-					// if(name) this[name] = options
-					// eval(`a = ${callback};`)
-					// if(a) {a(chart)}
-				}
-			}
-			
-			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) {
-				  const src = chart.getDataURL(opt)
-				  postMessage({
-					  file: true,
-					  data: src
-				  })
-				}
-			}
-		</script>
-	</body>
-</html>

Plik diff jest za duży
+ 0 - 1
sleep/uni_modules/lime-echart/static/uni.webview.1.5.3.js


+ 0 - 68
sleep/uni_modules/uni-popup/changelog.md

@@ -1,68 +0,0 @@
-## 1.8.3(2023-04-17)
-- 修复 uni-popup 重复打开时的 bug
-## 1.8.2(2023-02-02)
-- uni-popup-dialog 组件新增 inputType 属性
-## 1.8.1(2022-12-01)
-- 修复 nvue 下 v-show 报错
-## 1.8.0(2022-11-29)
-- 优化 主题样式
-## 1.7.9(2022-04-02)
-- 修复 弹出层内部无法滚动的bug
-## 1.7.8(2022-03-28)
-- 修复 小程序中高度错误的bug
-## 1.7.7(2022-03-17)
-- 修复 快速调用open出现问题的Bug
-## 1.7.6(2022-02-14)
-- 修复 safeArea 属性不能设置为false的bug
-## 1.7.5(2022-01-19)
-- 修复 isMaskClick 失效的bug
-## 1.7.4(2022-01-19)
-- 新增 cancelText \ confirmText 属性 ,可自定义文本
-- 新增 maskBackgroundColor 属性 ,可以修改蒙版颜色
-- 优化 maskClick属性 更新为 isMaskClick ,解决微信小程序警告的问题
-## 1.7.3(2022-01-13)
-- 修复 设置 safeArea 属性不生效的bug
-## 1.7.2(2021-11-26)
-- 优化 组件示例
-## 1.7.1(2021-11-26)
-- 修复 vuedoc 文字错误
-## 1.7.0(2021-11-19)
-- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
-- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-popup](https://uniapp.dcloud.io/component/uniui/uni-popup)
-## 1.6.2(2021-08-24)
-- 新增 支持国际化
-## 1.6.1(2021-07-30)
-- 优化 vue3下事件警告的问题
-## 1.6.0(2021-07-13)
-- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
-## 1.5.0(2021-06-23)
-- 新增 mask-click 遮罩层点击事件
-## 1.4.5(2021-06-22)
-- 修复 nvue 平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug
-## 1.4.4(2021-06-18)
-- 修复 H5平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug
-## 1.4.3(2021-06-08)
-- 修复 错误的 watch 字段
-- 修复 safeArea 属性不生效的问题
-- 修复 点击内容,再点击遮罩无法关闭的Bug
-## 1.4.2(2021-05-12)
-- 新增 组件示例地址
-## 1.4.1(2021-04-29)
-- 修复 组件内放置 input 、textarea 组件,无法聚焦的问题
-## 1.4.0 (2021-04-29)
-- 新增 type 属性的 left\right 值,支持左右弹出
-- 新增 open(String:type) 方法参数 ,可以省略 type 属性 ,直接传入类型打开指定弹窗
-- 新增 backgroundColor 属性,可定义主窗口背景色,默认不显示背景色
-- 新增 safeArea 属性,是否适配底部安全区
-- 修复 App\h5\微信小程序底部安全区占位不对的Bug
-- 修复 App 端弹出等待的Bug
-- 优化 提升低配设备性能,优化动画卡顿问题
-- 优化 更简单的组件自定义方式
-## 1.2.9(2021-02-05)
-- 优化 组件引用关系,通过uni_modules引用组件
-## 1.2.8(2021-02-05)
-- 调整为uni_modules目录规范
-## 1.2.7(2021-02-05)
-- 调整为uni_modules目录规范
-- 新增 支持 PC 端
-- 新增 uni-popup-message 、uni-popup-dialog扩展组件支持 PC 端

+ 0 - 45
sleep/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js

@@ -1,45 +0,0 @@
-// #ifdef H5
-export default {
-  name: 'Keypress',
-  props: {
-    disable: {
-      type: Boolean,
-      default: false
-    }
-  },
-  mounted () {
-    const keyNames = {
-      esc: ['Esc', 'Escape'],
-      tab: 'Tab',
-      enter: 'Enter',
-      space: [' ', 'Spacebar'],
-      up: ['Up', 'ArrowUp'],
-      left: ['Left', 'ArrowLeft'],
-      right: ['Right', 'ArrowRight'],
-      down: ['Down', 'ArrowDown'],
-      delete: ['Backspace', 'Delete', 'Del']
-    }
-    const listener = ($event) => {
-      if (this.disable) {
-        return
-      }
-      const keyName = Object.keys(keyNames).find(key => {
-        const keyName = $event.key
-        const value = keyNames[key]
-        return value === keyName || (Array.isArray(value) && value.includes(keyName))
-      })
-      if (keyName) {
-        // 避免和其他按键事件冲突
-        setTimeout(() => {
-          this.$emit(keyName, {})
-        }, 0)
-      }
-    }
-    document.addEventListener('keyup', listener)
-    this.$once('hook:beforeDestroy', () => {
-      document.removeEventListener('keyup', listener)
-    })
-  },
-	render: () => {}
-}
-// #endif

+ 0 - 275
sleep/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue

@@ -1,275 +0,0 @@
-<template>
-	<view class="uni-popup-dialog">
-		<view class="uni-dialog-title">
-			<text class="uni-dialog-title-text" :class="['uni-popup__'+dialogType]">{{titleText}}</text>
-		</view>
-		<view v-if="mode === 'base'" class="uni-dialog-content">
-			<slot>
-				<text class="uni-dialog-content-text">{{content}}</text>
-			</slot>
-		</view>
-		<view v-else class="uni-dialog-content">
-			<slot>
-				<input class="uni-dialog-input" v-model="val" :type="inputType" :placeholder="placeholderText" :focus="focus" >
-			</slot>
-		</view>
-		<view class="uni-dialog-button-group">
-			<view class="uni-dialog-button" @click="closeDialog">
-				<text class="uni-dialog-button-text">{{closeText}}</text>
-			</view>
-			<view class="uni-dialog-button uni-border-left" @click="onOk">
-				<text class="uni-dialog-button-text uni-button-color">{{okText}}</text>
-			</view>
-		</view>
-
-	</view>
-</template>
-
-<script>
-	import popup from '../uni-popup/popup.js'
-	import {
-	initVueI18n
-	} from '@dcloudio/uni-i18n'
-	import messages from '../uni-popup/i18n/index.js'
-	const {	t } = initVueI18n(messages)
-	/**
-	 * PopUp 弹出层-对话框样式
-	 * @description 弹出层-对话框样式
-	 * @tutorial https://ext.dcloud.net.cn/plugin?id=329
-	 * @property {String} value input 模式下的默认值
-	 * @property {String} placeholder input 模式下输入提示
-	 * @property {String} type = [success|warning|info|error] 主题样式
-	 *  @value success 成功
-	 * 	@value warning 提示
-	 * 	@value info 消息
-	 * 	@value error 错误
-	 * @property {String} mode = [base|input] 模式、
-	 * 	@value base 基础对话框
-	 * 	@value input 可输入对话框
-	 * @property {String} content 对话框内容
-	 * @property {Boolean} beforeClose 是否拦截取消事件
-	 * @event {Function} confirm 点击确认按钮触发
-	 * @event {Function} close 点击取消按钮触发
-	 */
-
-	export default {
-		name: "uniPopupDialog",
-		mixins: [popup],
-		emits:['confirm','close'],
-		props: {
-			inputType:{
-				type: String,
-				default: 'text'
-			},
-			value: {
-				type: [String, Number],
-				default: ''
-			},
-			placeholder: {
-				type: [String, Number],
-				default: ''
-			},
-			type: {
-				type: String,
-				default: 'error'
-			},
-			mode: {
-				type: String,
-				default: 'base'
-			},
-			title: {
-				type: String,
-				default: ''
-			},
-			content: {
-				type: String,
-				default: ''
-			},
-			beforeClose: {
-				type: Boolean,
-				default: false
-			},
-			cancelText:{
-				type: String,
-				default: ''
-			},
-			confirmText:{
-				type: String,
-				default: ''
-			}
-		},
-		data() {
-			return {
-				dialogType: 'error',
-				focus: false,
-				val: ""
-			}
-		},
-		computed: {
-			okText() {
-				return this.confirmText || t("uni-popup.ok")
-			},
-			closeText() {
-				return this.cancelText || t("uni-popup.cancel")
-			},
-			placeholderText() {
-				return this.placeholder || t("uni-popup.placeholder")
-			},
-			titleText() {
-				return this.title || t("uni-popup.title")
-			}
-		},
-		watch: {
-			type(val) {
-				this.dialogType = val
-			},
-			mode(val) {
-				if (val === 'input') {
-					this.dialogType = 'info'
-				}
-			},
-			value(val) {
-				this.val = val
-			}
-		},
-		created() {
-			// 对话框遮罩不可点击
-			// this.popup.disableMask()
-			// this.popup.closeMask()
-			if (this.mode === 'input') {
-				this.dialogType = 'info'
-				this.val = this.value
-			} else {
-				this.dialogType = this.type
-			}
-		},
-		mounted() {
-			this.focus = true
-		},
-		methods: {
-			/**
-			 * 点击确认按钮
-			 */
-			onOk() {
-				if (this.mode === 'input'){
-					this.$emit('confirm', this.val)
-				}else{
-					this.$emit('confirm')
-				}
-				if(this.beforeClose) return
-				// this.popup.close()
-			},
-			/**
-			 * 点击取消按钮
-			 */
-			closeDialog() {
-				this.$emit('close')
-				if(this.beforeClose) return
-				// this.popup.close()
-			},
-			close(){
-				// this.popup.close()
-			}
-		}
-	}
-</script>
-
-<style lang="scss" >
-	.uni-popup-dialog {
-		width: 300px;
-		border-radius: 11px;
-		background-color: #fff;
-	}
-
-	.uni-dialog-title {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		justify-content: center;
-		padding-top: 25px;
-	}
-
-	.uni-dialog-title-text {
-		font-size: 16px;
-		font-weight: 500;
-	}
-
-	.uni-dialog-content {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		justify-content: center;
-		align-items: center;
-		padding: 20px;
-	}
-
-	.uni-dialog-content-text {
-		font-size: 14px;
-		color: #6C6C6C;
-	}
-
-	.uni-dialog-button-group {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		border-top-color: #f5f5f5;
-		border-top-style: solid;
-		border-top-width: 1px;
-	}
-
-	.uni-dialog-button {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-
-		flex: 1;
-		flex-direction: row;
-		justify-content: center;
-		align-items: center;
-		height: 45px;
-	}
-
-	.uni-border-left {
-		border-left-color: #f0f0f0;
-		border-left-style: solid;
-		border-left-width: 1px;
-	}
-
-	.uni-dialog-button-text {
-		font-size: 16px;
-		color: #333;
-	}
-
-	.uni-button-color {
-		color: #007aff;
-	}
-
-	.uni-dialog-input {
-		flex: 1;
-		font-size: 14px;
-		border: 1px #eee solid;
-		height: 40px;
-		padding: 0 10px;
-		border-radius: 5px;
-		color: #555;
-	}
-
-	.uni-popup__success {
-		color: #4cd964;
-	}
-
-	.uni-popup__warn {
-		color: #f0ad4e;
-	}
-
-	.uni-popup__error {
-		color: #dd524d;
-	}
-
-	.uni-popup__info {
-		color: #909399;
-	}
-</style>

+ 0 - 143
sleep/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue

@@ -1,143 +0,0 @@
-<template>
-	<view class="uni-popup-message">
-		<view class="uni-popup-message__box fixforpc-width" :class="'uni-popup__'+type">
-			<slot>
-				<text class="uni-popup-message-text" :class="'uni-popup__'+type+'-text'">{{message}}</text>
-			</slot>
-		</view>
-	</view>
-</template>
-
-<script>
-	import popup from '../uni-popup/popup.js'
-	/**
-	 * PopUp 弹出层-消息提示
-	 * @description 弹出层-消息提示
-	 * @tutorial https://ext.dcloud.net.cn/plugin?id=329
-	 * @property {String} type = [success|warning|info|error] 主题样式
-	 *  @value success 成功
-	 * 	@value warning 提示
-	 * 	@value info 消息
-	 * 	@value error 错误
-	 * @property {String} message 消息提示文字
-	 * @property {String} duration 显示时间,设置为 0 则不会自动关闭
-	 */
-
-	export default {
-		name: 'uniPopupMessage',
-		mixins:[popup],
-		props: {
-			/**
-			 * 主题 success/warning/info/error	  默认 success
-			 */
-			type: {
-				type: String,
-				default: 'success'
-			},
-			/**
-			 * 消息文字
-			 */
-			message: {
-				type: String,
-				default: ''
-			},
-			/**
-			 * 显示时间,设置为 0 则不会自动关闭
-			 */
-			duration: {
-				type: Number,
-				default: 3000
-			},
-			maskShow:{
-				type:Boolean,
-				default:false
-			}
-		},
-		data() {
-			return {}
-		},
-		created() {
-			this.popup.maskShow = this.maskShow
-			this.popup.messageChild = this
-		},
-		methods: {
-			timerClose(){
-				if(this.duration === 0) return
-				clearTimeout(this.timer) 
-				this.timer = setTimeout(()=>{
-					this.popup.close()
-				},this.duration)
-			}
-		}
-	}
-</script>
-<style lang="scss" >
-	.uni-popup-message {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		justify-content: center;
-	}
-
-	.uni-popup-message__box {
-		background-color: #e1f3d8;
-		padding: 10px 15px;
-		border-color: #eee;
-		border-style: solid;
-		border-width: 1px;
-		flex: 1;
-	}
-
-	@media screen and (min-width: 500px) {
-		.fixforpc-width {
-			margin-top: 20px;
-			border-radius: 4px;
-			flex: none;
-			min-width: 380px;
-			/* #ifndef APP-NVUE */
-			max-width: 50%;
-			/* #endif */
-			/* #ifdef APP-NVUE */
-			max-width: 500px;
-			/* #endif */
-		}
-	}
-
-	.uni-popup-message-text {
-		font-size: 14px;
-		padding: 0;
-	}
-
-	.uni-popup__success {
-		background-color: #e1f3d8;
-	}
-
-	.uni-popup__success-text {
-		color: #67C23A;
-	}
-
-	.uni-popup__warn {
-		background-color: #faecd8;
-	}
-
-	.uni-popup__warn-text {
-		color: #E6A23C;
-	}
-
-	.uni-popup__error {
-		background-color: #fde2e2;
-	}
-
-	.uni-popup__error-text {
-		color: #F56C6C;
-	}
-
-	.uni-popup__info {
-		background-color: #F2F6FC;
-	}
-
-	.uni-popup__info-text {
-		color: #909399;
-	}
-</style>

+ 0 - 187
sleep/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue

@@ -1,187 +0,0 @@
-<template>
-	<view class="uni-popup-share">
-		<view class="uni-share-title"><text class="uni-share-title-text">{{shareTitleText}}</text></view>
-		<view class="uni-share-content">
-			<view class="uni-share-content-box">
-				<view class="uni-share-content-item" v-for="(item,index) in bottomData" :key="index" @click.stop="select(item,index)">
-					<image class="uni-share-image" :src="item.icon" mode="aspectFill"></image>
-					<text class="uni-share-text">{{item.text}}</text>
-				</view>
-
-			</view>
-		</view>
-		<view class="uni-share-button-box">
-			<button class="uni-share-button" @click="close">{{cancelText}}</button>
-		</view>
-	</view>
-</template>
-
-<script>
-	import popup from '../uni-popup/popup.js'
-	import {
-	initVueI18n
-	} from '@dcloudio/uni-i18n'
-	import messages from '../uni-popup/i18n/index.js'
-	const {	t	} = initVueI18n(messages)
-	export default {
-		name: 'UniPopupShare',
-		mixins:[popup],
-		emits:['select'],
-		props: {
-			title: {
-				type: String,
-				default: ''
-			},
-			beforeClose: {
-				type: Boolean,
-				default: false
-			}
-		},
-		data() {
-			return {
-				bottomData: [{
-						text: '微信',
-						icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/c2b17470-50be-11eb-b680-7980c8a877b8.png',
-						name: 'wx'
-					},
-					{
-						text: '支付宝',
-						icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/d684ae40-50be-11eb-8ff1-d5dcf8779628.png',
-						name: 'wx'
-					},
-					{
-						text: 'QQ',
-						icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/e7a79520-50be-11eb-b997-9918a5dda011.png',
-						name: 'qq'
-					},
-					{
-						text: '新浪',
-						icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/0dacdbe0-50bf-11eb-8ff1-d5dcf8779628.png',
-						name: 'sina'
-					},
-					// {
-					// 	text: '百度',
-					// 	icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/1ec6e920-50bf-11eb-8a36-ebb87efcf8c0.png',
-					// 	name: 'copy'
-					// },
-					// {
-					// 	text: '其他',
-					// 	icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/2e0fdfe0-50bf-11eb-b997-9918a5dda011.png',
-					// 	name: 'more'
-					// }
-				]
-			}
-		},
-		created() {},
-		computed: {
-			cancelText() {
-				return t("uni-popup.cancel")
-			},
-		shareTitleText() {
-				return this.title || t("uni-popup.shareTitle")
-			}
-		},
-		methods: {
-			/**
-			 * 选择内容
-			 */
-			select(item, index) {
-				this.$emit('select', {
-					item,
-					index
-				})
-				this.close()
-
-			},
-			/**
-			 * 关闭窗口
-			 */
-			close() {
-				if(this.beforeClose) return
-				this.popup.close()
-			}
-		}
-	}
-</script>
-<style lang="scss" >
-	.uni-popup-share {
-		background-color: #fff;
-		border-top-left-radius: 11px;
-		border-top-right-radius: 11px;
-	}
-	.uni-share-title {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		align-items: center;
-		justify-content: center;
-		height: 40px;
-	}
-	.uni-share-title-text {
-		font-size: 14px;
-		color: #666;
-	}
-	.uni-share-content {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		justify-content: center;
-		padding-top: 10px;
-	}
-
-	.uni-share-content-box {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		flex-wrap: wrap;
-		width: 360px;
-	}
-
-	.uni-share-content-item {
-		width: 90px;
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: column;
-		justify-content: center;
-		padding: 10px 0;
-		align-items: center;
-	}
-
-	.uni-share-content-item:active {
-		background-color: #f5f5f5;
-	}
-
-	.uni-share-image {
-		width: 30px;
-		height: 30px;
-	}
-
-	.uni-share-text {
-		margin-top: 10px;
-		font-size: 14px;
-		color: #3B4144;
-	}
-
-	.uni-share-button-box {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		padding: 10px 15px;
-	}
-
-	.uni-share-button {
-		flex: 1;
-		border-radius: 50px;
-		color: #666;
-		font-size: 16px;
-	}
-
-	.uni-share-button::after {
-		border-radius: 50px;
-	}
-</style>

+ 0 - 7
sleep/uni_modules/uni-popup/components/uni-popup/i18n/en.json

@@ -1,7 +0,0 @@
-{
-	"uni-popup.cancel": "cancel",
-	"uni-popup.ok": "ok",
-	"uni-popup.placeholder": "pleace enter",
-	"uni-popup.title": "Hint",
-	"uni-popup.shareTitle": "Share to"
-}

+ 0 - 8
sleep/uni_modules/uni-popup/components/uni-popup/i18n/index.js

@@ -1,8 +0,0 @@
-import en from './en.json'
-import zhHans from './zh-Hans.json'
-import zhHant from './zh-Hant.json'
-export default {
-	en,
-	'zh-Hans': zhHans,
-	'zh-Hant': zhHant
-}

+ 0 - 7
sleep/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json

@@ -1,7 +0,0 @@
-{
-	"uni-popup.cancel": "取消",
-	"uni-popup.ok": "确定",
-	"uni-popup.placeholder": "请输入",
-		"uni-popup.title": "提示",
-		"uni-popup.shareTitle": "分享到"
-}

+ 0 - 7
sleep/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json

@@ -1,7 +0,0 @@
-{
-	"uni-popup.cancel": "取消",
-	"uni-popup.ok": "確定",
-	"uni-popup.placeholder": "請輸入",
-	"uni-popup.title": "提示",
-	"uni-popup.shareTitle": "分享到"
-}

+ 0 - 45
sleep/uni_modules/uni-popup/components/uni-popup/keypress.js

@@ -1,45 +0,0 @@
-// #ifdef H5
-export default {
-  name: 'Keypress',
-  props: {
-    disable: {
-      type: Boolean,
-      default: false
-    }
-  },
-  mounted () {
-    const keyNames = {
-      esc: ['Esc', 'Escape'],
-      tab: 'Tab',
-      enter: 'Enter',
-      space: [' ', 'Spacebar'],
-      up: ['Up', 'ArrowUp'],
-      left: ['Left', 'ArrowLeft'],
-      right: ['Right', 'ArrowRight'],
-      down: ['Down', 'ArrowDown'],
-      delete: ['Backspace', 'Delete', 'Del']
-    }
-    const listener = ($event) => {
-      if (this.disable) {
-        return
-      }
-      const keyName = Object.keys(keyNames).find(key => {
-        const keyName = $event.key
-        const value = keyNames[key]
-        return value === keyName || (Array.isArray(value) && value.includes(keyName))
-      })
-      if (keyName) {
-        // 避免和其他按键事件冲突
-        setTimeout(() => {
-          this.$emit(keyName, {})
-        }, 0)
-      }
-    }
-    document.addEventListener('keyup', listener)
-    // this.$once('hook:beforeDestroy', () => {
-    //   document.removeEventListener('keyup', listener)
-    // })
-  },
-	render: () => {}
-}
-// #endif

+ 0 - 26
sleep/uni_modules/uni-popup/components/uni-popup/popup.js

@@ -1,26 +0,0 @@
-
-export default {
-	data() {
-		return {
-			
-		}
-	},
-	created(){
-		this.popup = this.getParent()
-	},
-	methods:{
-		/**
-		 * 获取父元素实例
-		 */
-		getParent(name = 'uniPopup') {
-			let parent = this.$parent;
-			let parentName = parent.$options.name;
-			while (parentName !== name) {
-				parent = parent.$parent;
-				if (!parent) return false
-				parentName = parent.$options.name;
-			}
-			return parent;
-		},
-	}
-}

+ 0 - 473
sleep/uni_modules/uni-popup/components/uni-popup/uni-popup.vue

@@ -1,473 +0,0 @@
-<template>
-	<view v-if="showPopup" class="uni-popup" :class="[popupstyle, isDesktop ? 'fixforpc-z-index' : '']">
-		<view @touchstart="touchstart">
-			<uni-transition key="1" v-if="maskShow" name="mask" mode-class="fade" :styles="maskClass"
-				:duration="duration" :show="showTrans" @click="onTap" />
-			<uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration"
-				:show="showTrans" @click="onTap">
-				<view class="uni-popup__wrapper" :style="{ backgroundColor: bg }" :class="[popupstyle]" @click="clear">
-					<slot />
-				</view>
-			</uni-transition>
-		</view>
-		<!-- #ifdef H5 -->
-		<keypress v-if="maskShow" @esc="onTap" />
-		<!-- #endif -->
-	</view>
-</template>
-
-<script>
-	// #ifdef H5
-	import keypress from './keypress.js'
-	// #endif
-
-	/**
-	 * PopUp 弹出层
-	 * @description 弹出层组件,为了解决遮罩弹层的问题
-	 * @tutorial https://ext.dcloud.net.cn/plugin?id=329
-	 * @property {String} type = [top|center|bottom|left|right|message|dialog|share] 弹出方式
-	 * 	@value top 顶部弹出
-	 * 	@value center 中间弹出
-	 * 	@value bottom 底部弹出
-	 * 	@value left		左侧弹出
-	 * 	@value right  右侧弹出
-	 * 	@value message 消息提示
-	 * 	@value dialog 对话框
-	 * 	@value share 底部分享示例
-	 * @property {Boolean} animation = [true|false] 是否开启动画
-	 * @property {Boolean} maskClick = [true|false] 蒙版点击是否关闭弹窗(废弃)
-	 * @property {Boolean} isMaskClick = [true|false] 蒙版点击是否关闭弹窗
-	 * @property {String}  backgroundColor 主窗口背景色
-	 * @property {String}  maskBackgroundColor 蒙版颜色
-	 * @property {Boolean} safeArea		   是否适配底部安全区
-	 * @event {Function} change 打开关闭弹窗触发,e={show: false}
-	 * @event {Function} maskClick 点击遮罩触发
-	 */
-
-	export default {
-		name: 'uniPopup',
-		components: {
-			// #ifdef H5
-			keypress
-			// #endif
-		},
-		emits: ['change', 'maskClick'],
-		props: {
-			// 开启动画
-			animation: {
-				type: Boolean,
-				default: true
-			},
-			// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
-			// message: 消息提示 ; dialog : 对话框
-			type: {
-				type: String,
-				default: 'center'
-			},
-			// maskClick
-			isMaskClick: {
-				type: Boolean,
-				default: null
-			},
-			// TODO 2 个版本后废弃属性 ,使用 isMaskClick
-			maskClick: {
-				type: Boolean,
-				default: null
-			},
-			backgroundColor: {
-				type: String,
-				default: 'none'
-			},
-			safeArea: {
-				type: Boolean,
-				default: true
-			},
-			maskBackgroundColor: {
-				type: String,
-				default: 'rgba(0, 0, 0, 0.4)'
-			},
-		},
-
-		watch: {
-			/**
-			 * 监听type类型
-			 */
-			type: {
-				handler: function(type) {
-					if (!this.config[type]) return
-					this[this.config[type]](true)
-				},
-				immediate: true
-			},
-			isDesktop: {
-				handler: function(newVal) {
-					if (!this.config[newVal]) return
-					this[this.config[this.type]](true)
-				},
-				immediate: true
-			},
-			/**
-			 * 监听遮罩是否可点击
-			 * @param {Object} val
-			 */
-			maskClick: {
-				handler: function(val) {
-					this.mkclick = val
-				},
-				immediate: true
-			},
-			isMaskClick: {
-				handler: function(val) {
-					this.mkclick = val
-				},
-				immediate: true
-			},
-			// H5 下禁止底部滚动
-			showPopup(show) {
-				// #ifdef H5
-				// fix by mehaotian 处理 h5 滚动穿透的问题
-				document.getElementsByTagName('body')[0].style.overflow = show ? 'hidden' : 'visible'
-				// #endif
-			}
-		},
-		data() {
-			return {
-				duration: 300,
-				ani: [],
-				showPopup: false,
-				showTrans: false,
-				popupWidth: 0,
-				popupHeight: 0,
-				config: {
-					top: 'top',
-					bottom: 'bottom',
-					center: 'center',
-					left: 'left',
-					right: 'right',
-					message: 'top',
-					dialog: 'center',
-					share: 'bottom'
-				},
-				maskClass: {
-					position: 'fixed',
-					bottom: 0,
-					top: 0,
-					left: 0,
-					right: 0,
-					backgroundColor: 'rgba(0, 0, 0, 0.4)'
-				},
-				transClass: {
-					position: 'fixed',
-					left: 0,
-					right: 0
-				},
-				maskShow: true,
-				mkclick: true,
-				popupstyle: this.isDesktop ? 'fixforpc-top' : 'top'
-			}
-		},
-		computed: {
-			isDesktop() {
-				return this.popupWidth >= 500 && this.popupHeight >= 500
-			},
-			bg() {
-				if (this.backgroundColor === '' || this.backgroundColor === 'none') {
-					return 'transparent'
-				}
-				return this.backgroundColor
-			}
-		},
-		mounted() {
-			const fixSize = () => {
-				const {
-					windowWidth,
-					windowHeight,
-					windowTop,
-					safeArea,
-					screenHeight,
-					safeAreaInsets
-				} = uni.getSystemInfoSync()
-				this.popupWidth = windowWidth
-				this.popupHeight = windowHeight + (windowTop || 0)
-				// TODO fix by mehaotian 是否适配底部安全区 ,目前微信ios 、和 app ios 计算有差异,需要框架修复
-				if (safeArea && this.safeArea) {
-					// #ifdef MP-WEIXIN
-					this.safeAreaInsets = screenHeight - safeArea.bottom
-					// #endif
-					// #ifndef MP-WEIXIN
-					this.safeAreaInsets = safeAreaInsets.bottom
-					// #endif
-				} else {
-					this.safeAreaInsets = 0
-				}
-			}
-			fixSize()
-			// #ifdef H5
-			// window.addEventListener('resize', fixSize)
-			// this.$once('hook:beforeDestroy', () => {
-			// 	window.removeEventListener('resize', fixSize)
-			// })
-			// #endif
-		},
-		// #ifndef VUE3
-		// TODO vue2
-		destroyed() {
-			this.setH5Visible()
-		},
-		// #endif
-		// #ifdef VUE3
-		// TODO vue3
-		unmounted() {
-			this.setH5Visible()
-		},
-		// #endif
-		created() {
-			// this.mkclick =  this.isMaskClick || this.maskClick
-			if (this.isMaskClick === null && this.maskClick === null) {
-				this.mkclick = true
-			} else {
-				this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick
-			}
-			if (this.animation) {
-				this.duration = 300
-			} else {
-				this.duration = 0
-			}
-			// TODO 处理 message 组件生命周期异常的问题
-			this.messageChild = null
-			// TODO 解决头条冒泡的问题
-			this.clearPropagation = false
-			this.maskClass.backgroundColor = this.maskBackgroundColor
-		},
-		methods: {
-			setH5Visible() {
-				// #ifdef H5
-				// fix by mehaotian 处理 h5 滚动穿透的问题
-				document.getElementsByTagName('body')[0].style.overflow = 'visible'
-				// #endif
-			},
-			/**
-			 * 公用方法,不显示遮罩层
-			 */
-			closeMask() {
-				this.maskShow = false
-			},
-			/**
-			 * 公用方法,遮罩层禁止点击
-			 */
-			disableMask() {
-				this.mkclick = false
-			},
-			// TODO nvue 取消冒泡
-			clear(e) {
-				// #ifndef APP-NVUE
-				e.stopPropagation()
-				// #endif
-				this.clearPropagation = true
-			},
-
-			open(direction) {
-				// fix by mehaotian 处理快速打开关闭的情况
-				if (this.showPopup) {
-					return
-				}
-				let innerType = ['top', 'center', 'bottom', 'left', 'right', 'message', 'dialog', 'share']
-				if (!(direction && innerType.indexOf(direction) !== -1)) {
-					direction = this.type
-				}
-				if (!this.config[direction]) {
-					console.error('缺少类型:', direction)
-					return
-				}
-				this[this.config[direction]]()
-				this.$emit('change', {
-					show: true,
-					type: direction
-				})
-			},
-			close(type) {
-				this.showTrans = false
-				this.$emit('change', {
-					show: false,
-					type: this.type
-				})
-				clearTimeout(this.timer)
-				// // 自定义关闭事件
-				// this.customOpen && this.customClose()
-				this.timer = setTimeout(() => {
-					this.showPopup = false
-				}, 300)
-			},
-			// TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
-			touchstart() {
-				this.clearPropagation = false
-			},
-
-			onTap() {
-				if (this.clearPropagation) {
-					// fix by mehaotian 兼容 nvue
-					this.clearPropagation = false
-					return
-				}
-				this.$emit('maskClick')
-				if (!this.mkclick) return
-				this.close()
-			},
-			/**
-			 * 顶部弹出样式处理
-			 */
-			top(type) {
-				this.popupstyle = this.isDesktop ? 'fixforpc-top' : 'top'
-				this.ani = ['slide-top']
-				this.transClass = {
-					position: 'fixed',
-					left: 0,
-					right: 0,
-					backgroundColor: this.bg
-				}
-				// TODO 兼容 type 属性 ,后续会废弃
-				if (type) return
-				this.showPopup = true
-				this.showTrans = true
-				this.$nextTick(() => {
-					if (this.messageChild && this.type === 'message') {
-						this.messageChild.timerClose()
-					}
-				})
-			},
-			/**
-			 * 底部弹出样式处理
-			 */
-			bottom(type) {
-				this.popupstyle = 'bottom'
-				this.ani = ['slide-bottom']
-				this.transClass = {
-					position: 'fixed',
-					left: 0,
-					right: 0,
-					bottom: 0,
-					paddingBottom: this.safeAreaInsets + 'px',
-					backgroundColor: this.bg
-				}
-				// TODO 兼容 type 属性 ,后续会废弃
-				if (type) return
-				this.showPopup = true
-				this.showTrans = true
-			},
-			/**
-			 * 中间弹出样式处理
-			 */
-			center(type) {
-				this.popupstyle = 'center'
-				this.ani = ['zoom-out', 'fade']
-				this.transClass = {
-					position: 'fixed',
-					/* #ifndef APP-NVUE */
-					display: 'flex',
-					flexDirection: 'column',
-					/* #endif */
-					bottom: 0,
-					left: 0,
-					right: 0,
-					top: 0,
-					justifyContent: 'center',
-					alignItems: 'center'
-				}
-				// TODO 兼容 type 属性 ,后续会废弃
-				if (type) return
-				this.showPopup = true
-				this.showTrans = true
-			},
-			left(type) {
-				this.popupstyle = 'left'
-				this.ani = ['slide-left']
-				this.transClass = {
-					position: 'fixed',
-					left: 0,
-					bottom: 0,
-					top: 0,
-					backgroundColor: this.bg,
-					/* #ifndef APP-NVUE */
-					display: 'flex',
-					flexDirection: 'column'
-					/* #endif */
-				}
-				// TODO 兼容 type 属性 ,后续会废弃
-				if (type) return
-				this.showPopup = true
-				this.showTrans = true
-			},
-			right(type) {
-				this.popupstyle = 'right'
-				this.ani = ['slide-right']
-				this.transClass = {
-					position: 'fixed',
-					bottom: 0,
-					right: 0,
-					top: 0,
-					backgroundColor: this.bg,
-					/* #ifndef APP-NVUE */
-					display: 'flex',
-					flexDirection: 'column'
-					/* #endif */
-				}
-				// TODO 兼容 type 属性 ,后续会废弃
-				if (type) return
-				this.showPopup = true
-				this.showTrans = true
-			}
-		}
-	}
-</script>
-<style lang="scss">
-	.uni-popup {
-		position: fixed;
-		/* #ifndef APP-NVUE */
-		z-index: 99;
-
-		/* #endif */
-		&.top,
-		&.left,
-		&.right {
-			/* #ifdef H5 */
-			top: var(--window-top);
-			/* #endif */
-			/* #ifndef H5 */
-			top: 0;
-			/* #endif */
-		}
-
-		.uni-popup__wrapper {
-			/* #ifndef APP-NVUE */
-			display: block;
-			/* #endif */
-			position: relative;
-
-			/* iphonex 等安全区设置,底部安全区适配 */
-			/* #ifndef APP-NVUE */
-			// padding-bottom: constant(safe-area-inset-bottom);
-			// padding-bottom: env(safe-area-inset-bottom);
-			/* #endif */
-			&.left,
-			&.right {
-				/* #ifdef H5 */
-				padding-top: var(--window-top);
-				/* #endif */
-				/* #ifndef H5 */
-				padding-top: 0;
-				/* #endif */
-				flex: 1;
-			}
-		}
-	}
-
-	.fixforpc-z-index {
-		/* #ifndef APP-NVUE */
-		z-index: 999;
-		/* #endif */
-	}
-
-	.fixforpc-top {
-		top: 0;
-	}
-</style>

+ 0 - 87
sleep/uni_modules/uni-popup/package.json

@@ -1,87 +0,0 @@
-{
-	"id": "uni-popup",
-	"displayName": "uni-popup 弹出层",
-	"version": "1.8.3",
-	"description": " Popup 组件,提供常用的弹层",
-	"keywords": [
-        "uni-ui",
-        "弹出层",
-        "弹窗",
-        "popup",
-        "弹框"
-    ],
-	"repository": "https://github.com/dcloudio/uni-ui",
-	"engines": {
-		"HBuilderX": ""
-	},
-	"directories": {
-		"example": "../../temps/example_temps"
-	},
-    "dcloudext": {
-        "sale": {
-			"regular": {
-				"price": "0.00"
-			},
-			"sourcecode": {
-				"price": "0.00"
-			}
-		},
-		"contact": {
-			"qq": ""
-		},
-		"declaration": {
-			"ads": "无",
-			"data": "无",
-			"permissions": "无"
-		},
-        "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
-        "type": "component-vue"
-	},
-	"uni_modules": {
-		"dependencies": [
-			"uni-scss",
-			"uni-transition"
-		],
-		"encrypt": [],
-		"platforms": {
-			"cloud": {
-				"tcb": "y",
-				"aliyun": "y"
-			},
-			"client": {
-				"App": {
-					"app-vue": "y",
-					"app-nvue": "y"
-				},
-				"H5-mobile": {
-					"Safari": "y",
-					"Android Browser": "y",
-					"微信浏览器(Android)": "y",
-					"QQ浏览器(Android)": "y"
-				},
-				"H5-pc": {
-					"Chrome": "y",
-					"IE": "y",
-					"Edge": "y",
-					"Firefox": "y",
-					"Safari": "y"
-				},
-				"小程序": {
-					"微信": "y",
-					"阿里": "y",
-					"百度": "y",
-					"字节跳动": "y",
-					"QQ": "y"
-				},
-				"快应用": {
-					"华为": "u",
-					"联盟": "u"
-                },
-                "Vue": {
-                    "vue2": "y",
-                    "vue3": "y"
-                }
-			}
-		}
-	}
-}

+ 0 - 17
sleep/uni_modules/uni-popup/readme.md

@@ -1,17 +0,0 @@
-
-
-## Popup 弹出层
-> **组件名:uni-popup**
-> 代码块: `uPopup`
-> 关联组件:`uni-transition`
-
-
-弹出层组件,在应用中弹出一个消息提示窗口、提示框等
-
-### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-popup)
-#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 
-
-
-
-
-

+ 1 - 1
sleep/utils/request.js

@@ -2,7 +2,7 @@ import Vue from 'vue'
 
 const config = {
 	timeout: 15000,
-	baseURL: 'http://127.0.0.1:7000',
+	baseURL: 'http://wdkl.natapp1.cc',
 	headers: {
 		'Content-Type':'application/x-www-form-urlencoded'
 	}