Bläddra i källkod

再次整合资源

wenningning 1 år sedan
förälder
incheckning
51b9b87825

+ 0 - 158
sleep/components/my-week-picker/my-week-picker.vue

@@ -1,158 +0,0 @@
-<template>
-	<view>
-		<picker :value="indexArr" mode="multiSelector" :range="multiArray" @change="testChange"
-			@columnchange="bindMultiPickerColumnChange">
-			<view class="my-week-picker_input">
-				{{result.year}}年{{result.month}}月第{{result.number}}周({{result.start}}至{{result.end}})
-			</view>
-		</picker>
-	</view>
-</template>
-
-<script>
-	import dayjs from 'dayjs';
-	import weekday from 'dayjs/plugin/weekday';
-	import isSameOrAfter from 'dayjs/plugin/isSameOrAfter'
-	import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'
-	dayjs.extend(weekday)
-	dayjs.extend(isSameOrAfter)
-	dayjs.extend(isSameOrBefore)
-	// 解决苹果电脑本地语言配置
-	require('dayjs/locale/en')
-	dayjs.locale('en')
-
-	export default {
-		name: "my-week-picker",
-		data() {
-			return {
-				indexArr: [0, 0, 0],
-				multiArray: [
-					['亚洲', '欧洲'],
-					['中国', '日本'],
-					['北京', '上海', '广州']
-				]
-			};
-		},
-		computed: {
-			result() {
-				// 2021年
-				// 9月
-				// 第1周(09月06日 至 09月12日)
-				let res = {
-					year: 2021,
-					month: 9,
-					number: 2,
-					start: "09月13日",
-					end: "09月19日"
-				}
-				return res
-			}
-		},
-		mounted() {
-			this.dateInit()
-		},
-		methods: {
-			dateInit() {
-				let y = dayjs().year();
-				let m = dayjs().month();
-				let w;
-				let y_arr = []; // 年
-				let m_arr = [...Array(12)].map((c, i) => i + 1); // 月份
-				let w_arr = [];
-				for (let i = (y - 50); i <= (y + 50); i++) {
-					y_arr.push(i)
-				}
-				let week_res = this.getWeek(y, m + 1);
-				w_arr = week_res.arr.map(i => i.text);
-				w = week_res.weekIndex;
-				this.multiArray = [y_arr, m_arr, w_arr];
-				this.indexArr = [50, m, w - 1]
-			},
-			/**
-			 * 根据年月查询周信息
-			 * @param {Object} y 年
-			 * @param {Object} m 月
-			 */
-			getWeek(y, m) {
-				let type = this.formatType;
-				let len = dayjs(`${y}-${m}`).daysInMonth();
-				let arr = [],
-					weekIndex, week;
-				let v = this.val;
-				[...Array(len)].forEach((c, i) => {
-					let date = dayjs(`${y}-${m}-${i+1}`);
-					if (date.day() == 1) {
-						let date_start = date.weekday(1);
-						let date_end = date.weekday(7);
-						console.log(
-							`${y}年${m}月第${arr.length+1}周为\r\n${date_start.format('YYYY年MM月DD日')} 至 ${date_end.format('YYYY年MM月DD日')}`
-						);
-						let index = arr.length + 1;
-						let start = type ? date_start.format('MM月DD日') : date_start.format('MM-DD');
-						let end = type ? date_end.format('MM月DD日') : date_end.format('MM-DD');
-						let obj = {
-							text: `第${index}周(${start}至${end})`,
-							year: y,
-							month: m,
-							val: `${dayjs(date_start).format('YYYY-MM-DD')}`,
-							start: start + '(周一)',
-							end: end + '(周日)',
-							index: index //1:该月第一周   2:该月第二周
-						}
-						arr.push(obj)
-						if (dayjs(v).isSameOrAfter(date_start, 'date') && dayjs(v).isSameOrBefore(
-								date_end, 'date')) {
-							weekIndex = index;
-							week = obj
-						}
-					}
-				})
-				return {
-					arr,
-					weekIndex,
-					week
-				}
-			},
-			bindMultiPickerColumnChange(e) {
-				let column = e.detail.column;
-				let index = e.detail.value;
-				let year, month, week;
-				if (column == 0) {
-					// 拖动年
-					year = this.year[index];
-				} else if (column == 1) {
-					// 拖动月
-					month = this.month[index];
-				}
-
-				// 得到年份,得到月份,根据年月。计算周信息
-
-			},
-			testChange(e) {
-				console.log(e);
-			},
-		}
-
-	}
-</script>
-
-<style>
-	.my-week-picker_input {
-		border: 1px solid #F1F1F1;
-		border-radius: 8rpx;
-		padding: 20rpx;
-	}
-
-	/* 修改样式 */
-	uni-picker-view-column:nth-child(1) {
-		flex: 1;
-	}
-
-	uni-picker-view-column:nth-child(2) {
-		flex: 1;
-	}
-	
-	.uni-picker-view-column{
-		flex: 3 !important;
-	}
-</style>

+ 0 - 111
sleep/components/tabBar/index.vue

@@ -1,111 +0,0 @@
-<template>
-	<view>
-		<view class="cu-bar tabbar bg-tabbar shadow foot">
-			<view class="action" @click="handleToHome">
-				<view class="cuIcon-cu-image"><image :src="'../../static/tabBar/' + [currentPage == 'home' ? 'homeSel' : 'home'] + '.png'"></image></view>
-				<view :class="currentPage == 'home' ? 'tabbar-text-active-color' : 'tabbar-text-color'" style="margin-top:2px">首页</view>
-			</view>
-			<view class="action" @click="handleToReport">
-				<view class="cuIcon-cu-image"><image :src="'../../static/tabBar/' + [currentPage == 'report' ? 'reportSel' : 'report'] + '.png'"></image></view>
-				<view :class="currentPage == 'report' ? 'tabbar-text-active-color' : 'tabbar-text-color'" style="margin-top:2px">报告</view>
-			</view>
-			<view class="action" @click="handleToDiscovery">
-				<view class="cuIcon-cu-image"><image :src="'../../static/tabBar/' + [currentPage == 'index' ? 'discoverSel' : 'discover'] + '.png'"></image></view>
-				<view :class="currentPage == 'index' ? 'tabbar-text-active-color' : 'tabbar-text-color'" style="margin-top:2px">发现</view>
-			</view>
-			<view class="action"  @click="handleToMy">
-				<view class="cuIcon-cu-image"><image :src="'../../static/tabBar/' + [currentPage == 'my' ? 'mySel' : 'my'] + '.png'"></image></view>
-				<view :class="currentPage == 'my' ? 'tabbar-text-active-color' : 'tabbar-text-color'" style="margin-top:2px">我的</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-import { mapState } from 'vuex';
-export default {
-	props: {
-		currentPage: {
-			type: String,
-			default: 'home'
-		}
-	},
-	computed: mapState({
-		playInfo: state => state.playInfo,
-		paused: state => state.paused
-	}),
-	data() {
-		return {
-			time: null,
-			rotate: 0
-		};
-	},
-	created() {
-		this.init();
-	},
-	methods: {
-		init() {
-			if (!this.paused) {
-				this.initRotate();
-			} else {
-				clearInterval(this.timer);
-			}
-		},
-		handleToPlay() {
-			uni.navigateTo({
-				url: '/pages/play/index'
-			});
-		},
-
-		handleToDiscovery() {
-			uni.navigateTo({
-				url: '/pages/tabBar/find'
-			});
-		},
-		handleToReport() {
-			uni.navigateTo({
-				url: '/pages/tabBar/report'
-			});
-		},
-		handleToMy(){
-			uni.navigateTo({
-				url: '/pages/tabBar/my'
-			});
-		},
-
-		handleToHome(){
-			uni.reLaunch({
-				url: '/pages/tabBar/home'
-			});
-		},
-
-		initRotate() {
-			this.timer = setInterval(() => {
-				this.rotate += 15;
-			}, 1000);
-		}
-	},
-	watch: {
-		paused() {
-			this.init();
-		}
-	}
-};
-</script>
-<style lang="scss" scoped>
-.music-img {
-	position: absolute;
-	width: 35px;
-	z-index: 2;
-	height: 35px;
-	border-radius: 50%;
-	line-height: 35px;
-	font-size: 25px;
-	top: -17px;
-	left: 0;
-	right: 0;
-	margin: auto;
-	padding: 0;
-	transition: all 1s linear;
-}
-</style>

+ 0 - 264
sleep/components/uni-popup/uni-popup.vue

@@ -1,264 +0,0 @@
-<template>
-	<view v-if="showPopup" class="uni-popup" @touchmove.stop.prevent="clear">
-		<uni-transition :mode-class="['fade']" :styles="maskClass" :duration="duration" :show="showTrans" @click="onTap" />
-		<uni-transition :mode-class="ani" :styles="transClass" :duration="duration" :show="showTrans" @click="onTap">
-			<view class="uni-popup__wrapper-box" @click.stop="clear">
-				<slot />
-			</view>
-		</uni-transition> 
-	</view>
-</template>
-
-<script>
-	import uniTransition from '../uni-transition/uni-transition.vue'
-
-	/**
-	 * PopUp 弹出层
-	 * @description 弹出层组件,为了解决遮罩弹层的问题
-	 * @tutorial https://ext.dcloud.net.cn/plugin?id=329
-	 * @property {String} type = [top|center|bottom] 弹出方式
-	 * 	@value top 顶部弹出
-	 * 	@value center 中间弹出
-	 * 	@value bottom 底部弹出
-	 * @property {Boolean} animation = [ture|false] 是否开启动画
-	 * @property {Boolean} maskClick = [ture|false] 蒙版点击是否关闭弹窗
-	 * @event {Function} change 打开关闭弹窗触发,e={show: false}
-	 */
-
-	export default {
-		name: 'UniPopup',
-		components: {
-			uniTransition
-		},
-		props: {
-			// 开启动画
-			animation: {
-				type: Boolean,
-				default: true
-			},
-			// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
-			type: {
-				type: String,
-				default: 'center'
-			},
-			// maskClick
-			maskClick: {
-				type: Boolean,
-				default: true
-			}
-		},
-		data() {
-			return {
-				duration: 300,
-				ani: [],
-				showPopup: false,
-				showTrans: false,
-				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,
-				}
-			}
-		},
-		watch: {
-			type: {
-				handler: function(newVal) {
-					switch (this.type) {
-						case 'top':
-							this.ani = ['slide-top']
-							this.transClass = {
-								'position': 'fixed',
-								'left': 0,
-								'right': 0,
-							}
-							break
-						case 'bottom':
-							this.ani = ['slide-bottom']
-							this.transClass = {
-								'position': 'fixed',
-								'left': 0,
-								'right': 0,
-								'bottom': 0
-							}
-							break
-						case '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'
-							}
-
-							break
-					}
-				},
-				immediate: true
-			}
-		},
-		created() {
-			if (this.animation) {
-				this.duration = 300
-			} else {
-				this.duration = 0
-			}
-		},
-		methods: {
-			clear(e) {
-				// TODO nvue 取消冒泡
-				e.stopPropagation()
-			},
-			open() {
-				this.showPopup = true
-				this.$nextTick(() => {
-					clearTimeout(this.timer)
-					this.timer = setTimeout(() => {
-						this.showTrans = true
-					}, 50);
-				})
-				this.$emit('change', {
-					show: true
-				})
-			},
-			close(type) {
-				this.showTrans = false
-				this.$nextTick(() => {
-					clearTimeout(this.timer)
-					this.timer = setTimeout(() => {
-						this.$emit('change', {
-							show: false
-						})
-						this.showPopup = false
-					}, 300)
-				})
-			},
-			onTap() {
-				if (!this.maskClick) return
-				this.close()
-			}
-		}
-	}
-</script>
-<style scoped>
-	.uni-popup {
-		position: fixed;
-		/* #ifdef H5 */
-		top: var(--window-top);
-		/* #endif */
-		/* #ifndef H5 */
-		top: 0;
-		/* #endif */
-		bottom: 0;
-		left: 0;
-		right: 0;
-		/* #ifndef APP-NVUE */
-		z-index: 99;
-		/* #endif */
-	}
-
-	.uni-popup__mask {
-		position: absolute;
-		top: 0;
-		bottom: 0;
-		left: 0;
-		right: 0;
-		background-color: rgba(0, 0, 0, 0.4);
-		opacity: 0;
-	}
-
-	.mask-ani {
-		transition-property: opacity;
-		transition-duration: 0.2s;
-	}
-
-	.uni-top-mask {
-		opacity: 1;
-	}
-
-	.uni-bottom-mask {
-		opacity: 1;
-	}
-
-	.uni-center-mask {
-		opacity: 1;
-	}
-
-	.uni-popup__wrapper {
-		/* #ifndef APP-NVUE */
-		display: block;
-		/* #endif */
-		position: absolute;
-	}
-
-	.top {
-		top: 0;
-		left: 0;
-		right: 0;
-		transform: translateY(-500px);
-	}
-
-	.bottom {
-		bottom: 0;
-		left: 0;
-		right: 0;
-		transform: translateY(500px);
-	}
-
-	.center {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		flex-direction: column;
-		/* #endif */
-		bottom: 0;
-		left: 0;
-		right: 0;
-		top: 0;
-		justify-content: center;
-		align-items: center;
-		transform: scale(1.2);
-		opacity: 0;
-	}
-
-	.uni-popup__wrapper-box {
-		/* #ifndef APP-NVUE */
-		display: block;
-		/* #endif */
-		position: relative;
-	}
-
-	.content-ani {
-		/* transition: transform 0.3s;
- */
-		transition-property: transform, opacity;
-		transition-duration: 0.2s;
-	}
-
-
-	.uni-top-content {
-		transform: translateY(0);
-	}
-
-	.uni-bottom-content {
-		transform: translateY(0);
-	}
-
-	.uni-center-content {
-		transform: scale(1);
-		opacity: 1;
-	}
-</style>

+ 0 - 279
sleep/components/uni-transition/uni-transition.vue

@@ -1,279 +0,0 @@
-<template>
-	<view v-if="isShow" ref="ani" class="uni-transition" :class="[ani.in]" :style="'transform:' +transform+';'+stylesObject" @click="change">
-		<slot></slot>
-	</view>
-</template>
-
-<script>
-	// #ifdef APP-NVUE
-	const animation = uni.requireNativePlugin('animation');
-	// #endif
-	/**
-	 * Transition 过渡动画
-	 * @description 简单过渡动画组件
-	 * @tutorial https://ext.dcloud.net.cn/plugin?id=985
-	 * @property {Boolean} show = [false|true] 控制组件显示或隐藏
-	 * @property {Array} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
-	 *  @value fade 渐隐渐出过渡
-	 *  @value slide-top 由上至下过渡
-	 *  @value slide-right 由右至左过渡
-	 *  @value slide-bottom 由下至上过渡
-	 *  @value slide-left 由左至右过渡
-	 *  @value zoom-in 由小到大过渡
-	 *  @value zoom-out 由大到小过渡
-	 * @property {Number} duration 过渡动画持续时间
-	 * @property {Object} styles 组件样式,同 css 样式,注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red`
-	 */
-	export default {
-		name: 'uniTransition',
-		props: {
-			show: {
-				type: Boolean,
-				default: false
-			},
-			modeClass: {
-				type: Array,
-				default () {
-					return []
-				}
-			},
-			duration: {
-				type: Number,
-				default: 300
-			},
-			styles: {
-				type: Object,
-				default () {
-					return {}
-				}
-			}
-		},
-		data() {
-			return {
-				isShow: false,
-				transform: '',
-				ani: {
-					in: '',
-					active: ''
-				}
-			};
-		},
-		watch: {
-			show: {
-				handler(newVal) {
-					if (newVal) {
-						this.open()
-					} else {
-						this.close()
-					}
-				},
-				immediate: true
-			}
-		},
-		computed: {
-			stylesObject() {
-				let styles = {
-					...this.styles,
-					'transition-duration': this.duration / 1000 + 's'
-				}
-				let transfrom = ''
-				for (let i in styles) {
-					let line = this.toLine(i)
-					transfrom += line + ':' + styles[i] + ';'
-				}
-				return transfrom
-			}
-		},
-		created() {
-			// this.timer = null
-			// this.nextTick = (time = 50) => new Promise(resolve => {
-			// 	clearTimeout(this.timer)
-			// 	this.timer = setTimeout(resolve, time)
-			// 	return this.timer
-			// });
-		},
-		methods: {
-			change() {
-				this.$emit('click', {
-					detail: this.isShow
-				})
-			},
-			open() {
-				clearTimeout(this.timer)
-				this.isShow = true
-				this.transform = ''
-				this.ani.in = ''
-				for (let i in this.getTranfrom(false)) {
-					if (i === 'opacity') {
-						this.ani.in = 'fade-in'
-					} else {
-						this.transform += `${this.getTranfrom(false)[i]} `
-					}
-				}
-				this.$nextTick(() => {
-					setTimeout(() => {
-						this._animation(true)
-					}, 50)
-				})
-
-			},
-			close(type) {
-				clearTimeout(this.timer)
-				this._animation(false)
-			},
-			_animation(type) {
-				let styles = this.getTranfrom(type)
-				// #ifdef APP-NVUE
-				if (!this.$refs['ani']) return
-				animation.transition(this.$refs['ani'].ref, {
-					styles,
-					duration: this.duration, //ms
-					timingFunction: 'ease',
-					needLayout: false,
-					delay: 0 //ms
-				}, () => {
-					if (!type) {
-						this.isShow = false
-					}
-					this.$emit('change', {
-						detail: this.isShow
-					})
-				})
-				// #endif
-				// #ifndef APP-NVUE
-				this.transform = ''
-				for (let i in styles) {
-					if (i === 'opacity') {
-						this.ani.in = `fade-${type?'out':'in'}`
-					} else {
-						this.transform += `${styles[i]} `
-					}
-				}
-				this.timer = setTimeout(() => {
-					if (!type) {
-						this.isShow = false
-					}
-					this.$emit('change', {
-						detail: this.isShow
-					})
-
-				}, this.duration)
-				// #endif
-
-			},
-			getTranfrom(type) {
-				let styles = {
-					transform: ''
-				}
-				this.modeClass.forEach((mode) => {
-					switch (mode) {
-						case 'fade':
-							styles.opacity = type ? 1 : 0
-							break;
-						case 'slide-top':
-							styles.transform += `translateY(${type?'0':'-100%'}) `
-							break;
-						case 'slide-right':
-							styles.transform += `translateX(${type?'0':'100%'}) `
-							break;
-						case 'slide-bottom':
-							styles.transform += `translateY(${type?'0':'100%'}) `
-							break;
-						case 'slide-left':
-							styles.transform += `translateX(${type?'0':'-100%'}) `
-							break;
-						case 'zoom-in':
-							styles.transform += `scale(${type?1:0.8}) `
-							break;
-						case 'zoom-out':
-							styles.transform += `scale(${type?1:1.2}) `
-							break;
-					}
-				})
-				return styles
-			},
-			_modeClassArr(type) {
-				let mode = this.modeClass
-				if (typeof(mode) !== "string") {
-					let modestr = ''
-					mode.forEach((item) => {
-						modestr += (item + '-' + type + ',')
-					})
-					return modestr.substr(0, modestr.length - 1)
-				} else {
-					return mode + '-' + type
-				}
-			},
-			// getEl(el) {
-			// 	console.log(el || el.ref || null);
-			// 	return el || el.ref || null
-			// },
-			toLine(name) {
-				return name.replace(/([A-Z])/g, "-$1").toLowerCase();
-			}
-		}
-	}
-</script>
-
-<style scoped>
-	.uni-transition {
-		transition-timing-function: ease;
-		transition-duration: 0.3s;
-		transition-property: transform, opacity;
-	}
-
-	.fade-in {
-		opacity: 0;
-	}
-
-	.fade-active {
-		opacity: 1;
-	}
-
-	.slide-top-in {
-		/* transition-property: transform, opacity; */
-		transform: translateY(-100%);
-	}
-
-	.slide-top-active {
-		transform: translateY(0);
-		/* opacity: 1; */
-	}
-
-	.slide-right-in {
-		transform: translateX(100%);
-	}
-
-	.slide-right-active {
-		transform: translateX(0);
-	}
-
-	.slide-bottom-in {
-		transform: translateY(100%);
-	}
-
-	.slide-bottom-active {
-		transform: translateY(0);
-	}
-
-	.slide-left-in {
-		transform: translateX(-100%);
-	}
-
-	.slide-left-active {
-		transform: translateX(0);
-		opacity: 1;
-	}
-
-	.zoom-in-in {
-		transform: scale(0.8);
-	}
-
-	.zoom-out-active {
-		transform: scale(1);
-	}
-
-	.zoom-out-in {
-		transform: scale(1.2);
-	}
-</style>

+ 1 - 1
sleep/pages.json

@@ -32,7 +32,7 @@
       }
     },
     {
-      "path": "pages/auth/auth",
+      "path": "pages/login/auth",
       "style": {
         "navigationBarTitleText": "授权"
       }

+ 3 - 3
sleep/components/ccq-week-picker/ccq-week-picker.vue

@@ -24,7 +24,7 @@
 
 <script>
 	import dayjs from 'dayjs';
-	import weekjs from '../../components/ccq-week-picker/week.js'
+	import weekjs from './week.js'
 	export default {
 		name: "ccq-week-picker",
 		props: {
@@ -80,7 +80,7 @@
 				// 年
 				for (var i = s; i <= e; i++) {
 					if (i == y) {
-						//所选年的index 
+						//所选年的index
 						y = i;
 						y_index = e - s - (e - y)
 					}
@@ -94,7 +94,7 @@
 					}
 				}
 				// 周
-				let res = await weekjs.getWeeksByMonth(y, m,this.val,this.formatType); 
+				let res = await weekjs.getWeeksByMonth(y, m,this.val,this.formatType);
 				this.weeks =  res.arr;
 				this.$set(this.pickerValue, 2, await res.weekIndex - 1)
 				this.$set(this.pickerValue, 0, y_index)

sleep/components/ccq-week-picker/week.js → sleep/pages/log/components/ccq-week-picker/week.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 866 - 866
sleep/uni_modules/lingfeng-timepicker/components/lingfeng-timepicker/lingfeng-timepicker.vue


+ 111 - 111
sleep/uni_modules/lingfeng-timepicker/components/lingfeng-timepicker/uitls/util.js

@@ -1,127 +1,127 @@
-/**
- * 获取某年某月有多少天
- */
-export const getOneMonthDays = (year,month)=>{
-	month = Number(month);
-	const baseMonthsDays = [31,28,31,30,31,30,31,31,30,31,30,31];
-	if(year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)){
-		if(month === 1){
-			baseMonthsDays[month] = 29;
-		}
-	}
-	return baseMonthsDays[month];
-}
-
-/**
- * 获取日期的年月日时分秒
- */
-export const getTimeArray = (date)=>{
-	const year = date.getFullYear();
-	const month = date.getMonth()+1;
-	const day = date.getDate();
-	const hour = date.getHours();
-	const minute = date.getMinutes();
-	const second = date.getSeconds();
-	return [year,month,day,hour,minute,second];
-}
-/**
- * 小于10的数字前面补0
- */
-export const addZero = (num)=>{
-	if(num/1==0){
-		return "00";
-	}
-	num = "" + num ;
-	return num < 10 ? (num.substr(0, 1) == 0 ? num : ('0' + num)) : num;
-}
-/**
- * 小于10的数字前面去除0
- */
-export const removeZero = (num)=>{
-	if(num/1==0){
-		return 0
-	}
-	num = "" + num ;
-	return  num.substr(0, 1) == 0 ? (num.substr(1)) : num ;
-}
-/**
- * 获取当前值在数组中的索引
- */
-export const getIndexOfArray = (value,array,key)=>{
-	let index;
-	if(key){
-		index = array.findIndex(item => item[key] == value);
-	}else{
-		index = array.findIndex(item => item == value);
-	}
-	return index > -1 ? index : 0;
-}
-
-/**
- * 获取季度
- */
-export const getQuarterArray=(startMOnth,endMOnth)=>{
-	let arr=["一季度","二季度","三季度","四季度"];
-	let start=Math.ceil(startMOnth/3);
-	let end=Math.ceil(endMOnth/3);
-	if(end<start){
-		return arr;
-	}else{
-		return arr.slice(start-1,end);
-	}
-}
-/**
- * 是否为范围选择
- */
-export const isRange=(type)=>{
-	return type.indexOf("range")>-1;
-}
-/**
- * 是否仅为时间选择
- */
-export const isOnlyTime=(type)=>{
-	return ["time", "hour-minute", "time-range"].includes(type);
-}
-/**
- * 获取start,end之间有多少周
- */
-export const getTotalWeeks=(start, end, en)=>{
+/**
+ * 获取某年某月有多少天
+ */
+export const getOneMonthDays = (year,month)=>{
+	month = Number(month);
+	const baseMonthsDays = [31,28,31,30,31,30,31,31,30,31,30,31];
+	if(year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)){
+		if(month === 1){
+			baseMonthsDays[month] = 29;
+		}
+	}
+	return baseMonthsDays[month];
+}
+
+/**
+ * 获取日期的年月日时分秒
+ */
+export const getTimeArray = (date)=>{
+	const year = date.getFullYear();
+	const month = date.getMonth()+1;
+	const day = date.getDate();
+	const hour = date.getHours();
+	const minute = date.getMinutes();
+	const second = date.getSeconds();
+	return [year,month,day,hour,minute,second];
+}
+/**
+ * 小于10的数字前面补0
+ */
+export const addZero = (num)=>{
+	if(num/1==0){
+		return "00";
+	}
+	num = "" + num ;
+	return num < 10 ? (num.substr(0, 1) == 0 ? num : ('0' + num)) : num;
+}
+/**
+ * 小于10的数字前面去除0
+ */
+export const removeZero = (num)=>{
+	if(num/1==0){
+		return 0
+	}
+	num = "" + num ;
+	return  num.substr(0, 1) == 0 ? (num.substr(1)) : num ;
+}
+/**
+ * 获取当前值在数组中的索引
+ */
+export const getIndexOfArray = (value,array,key)=>{
+	let index;
+	if(key){
+		index = array.findIndex(item => item[key] == value);
+	}else{
+		index = array.findIndex(item => item == value);
+	}
+	return index > -1 ? index : 0;
+}
+
+/**
+ * 获取季度
+ */
+export const getQuarterArray=(startMOnth,endMOnth)=>{
+	let arr=["一季度","二季度","三季度","四季度"];
+	let start=Math.ceil(startMOnth/3);
+	let end=Math.ceil(endMOnth/3);
+	if(end<start){
+		return arr;
+	}else{
+		return arr.slice(start-1,end);
+	}
+}
+/**
+ * 是否为范围选择
+ */
+export const isRange=(type)=>{
+	return type.indexOf("range")>-1;
+}
+/**
+ * 是否仅为时间选择
+ */
+export const isOnlyTime=(type)=>{
+	return ["time", "hour-minute", "time-range"].includes(type);
+}
+/**
+ * 获取start,end之间有多少周
+ */
+export const getTotalWeeks=(start, end, en)=>{
   //获取end当前周的第一天
   let endMon = getWeekFirstDate(new Date(end), en);
   //获取start当前周的第一天
-  let startMon = getWeekFirstDate(new Date(start), en);
-  let year=new Date(start).getFullYear();
+  let startMon = getWeekFirstDate(new Date(start), en);
+  let year=new Date(start).getFullYear();
   let firMon = getWeekFirstDate(new Date(year + '/01/01'), en); 
-  let d = Math.ceil((endMon.valueOf() - firMon.valueOf()) / 8.64e7);
-  let endWeek = Math.ceil(d / 7) + 1;
-  let startWeek = 1;
-  if(startMon !== firMon){
-	let d = Math.ceil((startMon.valueOf() - firMon.valueOf()) / 8.64e7);  
-	startWeek = Math.ceil(d / 7) + 1;
+  let d = Math.ceil((endMon.valueOf() - firMon.valueOf()) / 8.64e7);
+  let endWeek = Math.ceil(d / 7) + 1;
+  let startWeek = 1;
+  if(startMon !== firMon){
+	let d = Math.ceil((startMon.valueOf() - firMon.valueOf()) / 8.64e7);  
+	startWeek = Math.ceil(d / 7) + 1;
   }
-  return [startWeek, endWeek];	
-}
-/**
- * 获取当前周的第一天
- * 默认周一为第一天,en=true 时周日为第一天
- */
+  return [startWeek, endWeek];	
+}
+/**
+ * 获取当前周的第一天
+ * 默认周一为第一天,en=true 时周日为第一天
+ */
 function getWeekFirstDate(date, en = false) {
   let temptTime = new Date(date);
   let weekday = temptTime.getDay() || (en ? 0 : 7);
   return temptTime.setDate(temptTime.getDate() - weekday + (en ? 0 : 1));
-}
-/**
- * 获取当前年第week周的第一天和最后一天
- * 默认周一为第一天,en=true 时周日为第一天
- */
+}
+/**
+ * 获取当前年第week周的第一天和最后一天
+ * 默认周一为第一天,en=true 时周日为第一天
+ */
 export const getFirstAndLastDate=(year, week, en) => {
   let firstDate = new Date(getWeekFirstDate(new Date(year + '/01/01'), en));
   firstDate = new Date(firstDate.setDate(firstDate.getDate() + (week - 1) * 7));
   let lastDate = new Date(firstDate);
-  lastDate = new Date(lastDate.setDate(lastDate.getDate() + 6));
-  const [fy, fm, fd] = getTimeArray(firstDate);
-  const [ly, lm, ld] = getTimeArray(lastDate);
-  const start = `${fy}-${addZero(fm)}-${addZero(fd)}`;
+  lastDate = new Date(lastDate.setDate(lastDate.getDate() + 6));
+  const [fy, fm, fd] = getTimeArray(firstDate);
+  const [ly, lm, ld] = getTimeArray(lastDate);
+  const start = `${fy}-${addZero(fm)}-${addZero(fd)}`;
   const end = `${ly}-${addZero(lm)}-${addZero(ld)}`;
   return { start, end };
 }

+ 4 - 1
sleep/pages/log/report/monthReport.vue

@@ -71,8 +71,11 @@
 </template>
 
 <script>
-
+import lingfengTimepicker from '../components/lingfeng-timepicker/lingfeng-timepicker.vue'
 	export default {
+    components: {
+      lingfengTimepicker
+    },
 		data() {
 			return {
 				defaultData:{

+ 15 - 9
sleep/pages/log/report/weekReport.vue

@@ -14,11 +14,6 @@
 			</view>
 		</view>
 
-		<uni-popup ref="popup" type="bottom">
-		    <!-- value值不传默认是当前周 -->
-		    <ccq-week-picker :value="value" @change="getWeeks"></ccq-week-picker>
-		</uni-popup>
-
 		<view class="month-report flex-col">
 			<view class="block-month-report flex-col">
 				<view class="header-block-report">
@@ -74,21 +69,32 @@
 			</view>
 		</view>
 
+    <view class="cu-modal bottom-modal" :class="modalName=='bottomModal'?'show':''">
+      <view class="cu-dialog">
+          <ccq-week-picker :value="value" @change="getWeeks"></ccq-week-picker>
+      </view>
+    </view>
+
 	</view>
 </template>
 
 <script>
 	import dayjs from 'dayjs';
 	// 引入得到周信息函数
-	import weekjs from '@/components/ccq-week-picker/week.js';
+	import weekjs from '../components/ccq-week-picker/week.js'
+  import ccqWeekPicker from '../components/ccq-week-picker/ccq-week-picker.vue'
 
 	export default {
+    components: {
+      ccqWeekPicker
+    },
 		data() {
 			return {
 				today:dayjs().format('YYYY-MM-DD'),
 				yearMonthWeek: '',
 				week: '',
-				value: ''
+				value: '',
+        modalName: false
 			};
 		},
 		onReady: function() {
@@ -106,7 +112,7 @@
 			    if (res) {
 			        this.setResultInfo(res);
 			    }
-			    this.$refs['popup'].close()
+        this.modalName = false
 			},
 			// 设置结果集
 			setResultInfo(i){
@@ -117,7 +123,7 @@
 			    this.value = info.val;
 			},
 			openWeek() {
-			    this.$refs['popup'].open()
+			  this.modalName = 'bottomModal'
 			}
 		}
 	}

sleep/pages/auth/auth.vue → sleep/pages/login/auth.vue


+ 2 - 2
sleep/pages/login/index.vue

@@ -68,7 +68,7 @@ export default {
     this.haslogin = Storage.getItem('haslogin')
     if (!this.haslogin) {
       uni.reLaunch({
-        // url:'/pages/auth/auth'
+        // url:'/pages/login/auth'
       })
       return
     }
@@ -104,7 +104,7 @@ export default {
         icon: "none"
       })
       uni.reLaunch({
-        url:'/pages/auth/auth'
+        url:'/pages/login/auth'
       })
     },
     loginByHasLogin() {

+ 1 - 1
sleep/pages/tabBar/home.vue

@@ -863,7 +863,7 @@ export default {
           success: function(res) {
             if (res.confirm) {
               uni.reLaunch({
-                url:'/pages/auth/auth'
+                url:'/pages/login/auth'
               })
             }
           }

+ 2 - 2
sleep/pages/tabBar/my.vue

@@ -366,7 +366,7 @@ export default {
     },
     handleAuth() {
       uni.navigateTo({
-        url: '/pages/auth/auth'
+        url: '/pages/login/auth'
       })
     },
     handleShareData() {
@@ -508,7 +508,7 @@ export default {
           success: function(res) {
             if (res.confirm) {
               uni.reLaunch({
-                url:'/pages/auth/auth'
+                url:'/pages/login/auth'
               })
             }
           }

+ 1 - 1
sleep/pages/tabBar/report.vue

@@ -906,7 +906,7 @@
             success: function(res) {
               if (res.confirm) {
                 uni.reLaunch({
-                  url:'/pages/auth/auth'
+                  url:'/pages/login/auth'
                 })
               }
             }

+ 0 - 14
sleep/uni_modules/lingfeng-timepicker/changelog.md

@@ -1,14 +0,0 @@
-## 1.0.5(2023-07-02)
-新增周选择:type="week"
-## 1.0.4(2023-05-24)
-1、修复 type = year-month-range 时,日期展示undefined的bug;
-2、新增适配底部安全区属性:safeArea。
-## 1.0.3(2023-05-19)
-1、修复最大最小时间相同时最小时间不生效的bug;
-2、修复当前时间为最大最小时间时,切换年份导致当前选中日期乱跳的bug。
-## 1.0.2(2023-05-18)
-新增年范围选择:type = year-range
-## 1.0.1(2023-05-10)
-新增年、月范围选择:type = year-month-range
-## 1.0.0(2023-03-29)
-lingfeng-timepicker 时间选择器

+ 0 - 89
sleep/uni_modules/lingfeng-timepicker/package.json

@@ -1,89 +0,0 @@
-{
-  "id": "lingfeng-timepicker",
-  "displayName": "timepicker 时间选择器",
-  "version": "1.0.5",
-  "description": "基于picker-view、uni-popup的时间选择器,支持按年、月、日、时、分、秒、周、季度选择时间或时间范围,支持配置最大、最小选择日期",
-  "keywords": [
-    "timepicker",
-    "时间",
-    "日期",
-    "范围选择",
-    "时间选择器"
-],
-  "repository": "https://github.com/lingfengjgf/lingfeng-timepicker",
-  "engines": {
-    "HBuilderX": "^3.4.1"
-  },
-  "dcloudext": {
-    "type": "component-vue",
-    "sale": {
-      "regular": {
-        "price": "0.00"
-      },
-      "sourcecode": {
-        "price": "0.00"
-      }
-    },
-    "contact": {
-      "qq": ""
-    },
-    "declaration": {
-      "ads": "无",
-      "data": "插件不采集任何数据",
-      "permissions": "无"
-    },
-    "npmurl": ""
-  },
-  "uni_modules": {
-    "dependencies": [
-		"uni-scss",
-		"uni-transition",
-		"uni-popup"
-	],
-    "encrypt": [],
-    "platforms": {
-      "cloud": {
-        "tcb": "y",
-        "aliyun": "y"
-      },
-      "client": {
-        "Vue": {
-          "vue2": "y",
-          "vue3": "n"
-        },
-        "App": {
-          "app-vue": "y",
-          "app-nvue": "u"
-        },
-        "H5-mobile": {
-          "Safari": "y",
-          "Android Browser": "y",
-          "微信浏览器(Android)": "y",
-          "QQ浏览器(Android)": "y"
-        },
-        "H5-pc": {
-          "Chrome": "y",
-          "IE": "u",
-          "Edge": "y",
-          "Firefox": "u",
-          "Safari": "u"
-        },
-        "小程序": {
-          "微信": "y",
-          "阿里": "u",
-          "百度": "u",
-          "字节跳动": "u",
-          "QQ": "u",
-          "钉钉": "u",
-          "快手": "u",
-          "飞书": "u",
-          "京东": "u"
-        },
-        "快应用": {
-          "华为": "u",
-          "联盟": "u"
-        }
-      }
-    }
-  }
-}

+ 0 - 108
sleep/uni_modules/lingfeng-timepicker/readme.md

@@ -1,108 +0,0 @@
-# lingfeng-timepicker
-
-基于picker-view、uni-popup的时间选择器,支持按年、月、日、时、分、秒、周、季度选择时间或时间范围,支持配置最大、最小选择日期
-
-## 基本用法
-
-在 ``template`` 中使用组件
-
-```html
-<view @click="showPop()" class="show-time">选择年-月-日:{{defaultData.startTime}}</view>
-
-<lingfeng-timepicker ref="timePop" type="date" :defaultData="defaultData" :minDate="minDate" :maxDate="maxDate"  @change="timeChange"></lingfeng-timepicker>
-
-data(){
-	return {
-		defaultData:{
-			startTime:'2023-02-20'
-		},
-		minDate:{
-			year: 2020,
-			month: 3,
-			date: 5
-		},
-		maxDate:{
-			year: 2025,
-			month: 9,
-			date: 20
-		},
-	}
-},
-methods: {
-	showPop(){
-		this.$refs.timePop.show();
-	},
-	timeChange(val){
-		console.log(val); 
-	}
-}
-```
-
-## 组件属性
-
-|属性名	|类型		|默认值	|说明				|
-|:-:	|:-:		|:-:	|:-:				|
-|type	|String		|date		|选择时间类型,详见下文 [type属性说明](#type_info)|
-|minDate	|Object		|{ year: 1970, month: 1, date: 1 } |最小可选择时间|
-|maxDate	|Object		|{ year: 当前年份, month: 当前月份, date: 当前日期 } |最大可选择时间|
-|defaultData	|Object		| |默认选择时间,详见下文 [defaultData属性说明](#defaultData_info)|
-|toolBarTitle	|String		|""		|组件顶部标题  	|
-|toolBarTitleClass	|String		|tool-title		|组件顶部标题样式类名  	|
-|cancelButtonText	|String		|取消		|组件顶部取消按钮文字  	|
-|cancelButtonClass	|String		|cancel-btn		|组件顶部取消按钮文字样式类名  	|
-|confirmButtonText	|String		|确定		|组件顶部确定按钮文字  	|
-|confirmButtonClass	|String		|confirm-btn		|组件顶部确定按钮文字样式类名  	|
-|rangeBtnStyle	|Object		|{color:'#666'}		|范围选择按钮样式  	|
-|rangeBtnActiveStyle	|Object		|{color:'#049bff',borderColor:'#049bff'}		|范围选择按钮激活样式  	|
-|popIindicatorStyle	|Object		|null		|选择器中间选中框的样式  	|
-|safeArea	|Boolean		|true		|是否适配底部安全区(同uni-popup)  	|
-|en	|Boolean		|false		|当`type="week"`时是否以国外的标准返回日期(以周日为一周的第一天) 	|
-
-
-## 组件事件
-
-|事件名	|说明			|返回值|
-|:-:	|:-:			|:-:  |
-|@change|点击确定按钮事件|详见下文 [type属性说明](#type_info)|
-|@close|弹窗关闭事件| |
-
-<a id="type_info"></a>
-
-### type属性说明
-
-|值	|时间格式		|@change返回值示例	|说明				|
-|:-:	|:-:		|:-:	|:-:				|
-|year	|yyyy		|"2020"	|选择年 |
-|year-month	|yyyy-mm		|"2020-02"		|选择年、月 |
-|date	|yyyy-mm-dd		|"2020-02-20"		|选择年、月、日 |
-|datetime	|yyyy-mm-dd HH:MM		|"2020-02-20	08:30"	|选择年、月、日、时、分 |
-|datetime-all	|yyyy-mm-dd HH:MM:SS		|"2020-02-20	08:30:10"	|选择年、月、日、时、分、秒 |
-|time	|HH:MM:SS		|"08:30:10"	|选择时、分、秒 |
-|hour-minute	|HH:MM	|"08:30" |选择时、分 |
-|week	|yyyy week		|["2020 第一周", "2019-12-30", "2020-01-05"]	|选择年、周|
-|quarter	|yyyy quarter		|["2020 一季度", "2020-01-01", "2020-03-31"]	|选择年、季度|
-|year-range	|yyyy	|["2020", "2022"]|选择时间范围年|
-|year-month-range	|yyyy-mm	|["2020-02", "2020-03"]|选择时间范围年、月|
-|date-range	|yyyy-mm-dd	|["2020-02-20", "2020-03-20"]|选择时间范围年、月、日|
-|datetime-range	|yyyy-mm-dd HH:MM		|["2020-02-20	08:30", "2020-03-20	08:30"]|选择时间范围年、月、日、时、分 |
-|datetime-all-range	|yyyy-mm-dd HH:MM:SS	|["2020-02-20	08:30:10", "2020-03-20	08:30:10"]|选择时间范围年、月、日、时、分、秒 |
-|time-range	|HH:MM:SS	|["08:30:10", "09:30:10"]|选择时间范围时、分、秒 |
-
-
-<a id="defaultData_info"></a>
-
-### defaultData属性说明
-
-|属性名	|类型		|时间格式		|默认值	|说明				|
-|:-:	|:-:		|:-:	|:-:	|:-:				|
-|year	|String		| yyyy |当前年		|默认展示的年份,仅 `type="year"` 时生效|
-|month	|String		| yyyy-mm |当前年月		|仅 `type="year-month"` 时生效|
-|startTime	|String		| yyyy(-mm-dd) (HH:MM:SS)|当前日期(时间)		| 当`type!="year/year-month/quarter"` 时生效|
-|endTime	|String		| yyyy(-mm-dd) (HH:MM:SS)		|当前日期(时间)|当 `type="year-range/year-month-range/date-range/datetime-range/datetime-all-range/time-range"` 时生效|
-|week	|String		| yyyy week |最小可选择年 周		|仅 `type="week"` 时生效|
-|quarter	|String		| yyyy quarter |最小可选择年 季度		|仅 `type="quarter"` 时生效|
-
-
-## 联系作者
-
-QQ:1435464107

+ 2 - 2
sleep/uni_modules/uni-section/components/uni-section/uni-section.vue

@@ -57,7 +57,7 @@
       },
 			titleColor:{
 				type: String,
-				default: '#fff'
+				default: '#333'
 			},
 			subTitle: {
 				type: String,
@@ -103,7 +103,7 @@
 	$uni-primary: #2979ff !default;
 
 	.uni-section {
-		
+		background-color: #fff;
     .uni-section-header {
       position: relative;
       /* #ifndef APP-NVUE */

+ 3 - 3
sleep/utils/vue-mixin.js

@@ -76,7 +76,7 @@ const mixin = {
 				} else if (no_union_id) {
 					Storage.setItem('haslogin', { loginType: 'hand_movement' })
 					uni.reLaunch({
-						url:'/pages/auth/auth'
+						url:'/pages/login/auth'
 					})
 				} else {
 					uni.reLaunch({
@@ -92,7 +92,7 @@ const mixin = {
 					success: function(res) {
 						if (res.confirm) {
 							uni.reLaunch({
-								url:'/pages/auth/auth'
+								url:'/pages/login/auth'
 							})
 						}
 					}
@@ -129,7 +129,7 @@ const mixin = {
 			} else if (no_union_id) {
 				Storage.setItem('haslogin', { loginType: 'hand_movement' })
 				uni.reLaunch({
-					url:'/pages/auth/auth'
+					url:'/pages/login/auth'
 				})
 			} else {
 				uni.reLaunch({