zhengkaixin 1 năm trước cách đây
mục cha
commit
2f309dba90
1 tập tin đã thay đổi với 70 bổ sung5 xóa
  1. 70 5
      pages/oawork/data1.vue

+ 70 - 5
pages/oawork/data1.vue

@@ -2,8 +2,20 @@
 	<view>
 		<u-navbar title="数据明细">
 		</u-navbar>
+		<u-calendar v-model="show" mode="date" @change="change2"></u-calendar>
+
 		<view class="mainHead">
-			
+			<view class="headO headOindex" @click="btnHead(-1)">
+				<u-icon name="arrow-left" size="20"></u-icon>
+			</view>
+			<view  @click="show = true">
+				{{time}}<u-icon  style="margin-left: 6px;" name="arrow-down"></u-icon>
+			</view>
+			<view class="headO"  @click="btnHead(1)" :class="{
+				headOindex:nowtime!=time
+			}" >
+				<u-icon name="arrow-right" size="20" ></u-icon>
+			</view>
 		</view>
 		
 		<view class="mainBody">
@@ -129,9 +141,19 @@
 </template>
 
 <script>
+	import {
+		newDate,
+		currentTimeStamp,
+		parseUnixTime,
+		afterTimeStamp,
+	} from '@/apis/utils'
+	
 	export default {
 		data() {
 			return {
+				nowtime:"",
+				show:false,
+				time:"",
 				data1style:"",
 				 top: '0px',
 				current:0,
@@ -149,6 +171,11 @@
 				]
 			}
 		},
+		onLoad(){
+			this.nowtime=parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}');
+			
+			this.time=parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}');
+		},
 		onReady() {
 			const query = uni.createSelectorQuery().in(this);
 			query.select('.tableBody').boundingClientRect(data => {
@@ -175,15 +202,53 @@
 			}).exec();
 		},
 		methods: {
-			change(e){
-				
-			}
+			btnHead(a){
+					if(a>0){
+						if(this.nowtime==this.time){
+							return
+						}else{
+							
+						}
+					}else{
+						
+					}
+					this.time=parseUnixTime(afterTimeStamp(a,newDate(this.time)), '{y}-{m}-{d}');
+					
+			},
+			
+			change2(e) {
+							this.time=e.result;
+						},
+			change(index) {
+							this.current = index;
+						}
 		}
 	}
 </script>
 
 <style   lang="scss" scoped  >
-	
+	.headO{
+		color:#D4D6D9 ;
+		border: 1px solid #D4D6D9 ;
+		border-radius: 58px;
+		width: 20px;
+		height: 20px;
+		    display: flex;
+		    align-items: center;
+		    justify-content: center;
+	}
+	.headOindex{
+		color:#1677FF  ;
+		border: 1px solid #1677FF  ;
+	}
+	.mainHead{
+		background-color: rgba(255, 255, 255, 1);
+		margin: 12px 16px;
+		border-radius: 8px;
+		    display: flex;
+		    justify-content: space-around;
+			padding: 14px 0;
+	}
 	.scroll-Y {
 		height: 300rpx;
 	}