| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424 |
- <template>
- <view class="container">
- <!-- 头部区域 -->
- <view class="header">
- <!-- 时间区域 -->
- <view class="calendar">
- <!-- 双左箭头区域 -->
- <view class="double" @click="handleDoubleLeft">
- <img src="./imgs/double_left.png">
- </view>
- <!-- 左箭头区域区域 -->
- <view class="single" @click="handleLeft">
- <img src="./imgs/left.png">
- </view>
- <!-- 时间区域 -->
- <view class="time">
- {{year}}-{{comMonth}}
- </view>
- <!-- 双右箭头区域 -->
- <view class="single2" @click="handleRight">
- <img src="./imgs/right.png">
- </view>
- <!-- 右箭头区域 -->
- <view class="double" @click="handleDoubleRight">
- <img src="./imgs/double_right.png">
- </view>
- </view>
- <!-- 打卡状态切换区域 -->
- <view class="state">
- <uni-segmented-control :current="current" :values="items" styleType="text" @clickItem="onClickItem"
- activeColor="#0082FC"></uni-segmented-control>
- </view>
- </view>
- <!-- 打卡记录区域 -->
- <view class="list">
- <!-- 每一条记录区域 -->
- <view class="box" v-for="item in list" :key="item.id">
- <!-- 人物信息区域 -->
- <view class="person">
- <view class="img">
- <img :src="item.peopleImg">
- </view>
- <view class="info">
- <view class="name">
- {{item.name}}
- </view>
- <view class="college">
- {{item.college}}
- </view>
- </view>
- </view>
- <!-- 图片区域 -->
- <view class="imgs" v-if="item.imgsList">
- <view class="imgs_item" v-for="(img,index) in (item.imgsList)" :key="index">
- <view class="image">
- <img :src="img.url">
- </view>
- <view class="title">
- {{img.title}}
- </view>
- </view>
- </view>
- <!-- 打卡信息区域 -->
- <view class="msg">
- <view class="msg_item">
- <view class="key">
- 打卡状态:
- </view>
- <view class="value">
- {{item.status}}
- </view>
- </view>
- <view class="msg_item">
- <view class="key">
- 打卡规则:
- </view>
- <view class="value">
- {{item.rule}}
- </view>
- </view>
- <view class="msg_item" v-if="item.time">
- <view class="key">
- 打卡时间:
- </view>
- <view class="value">
- {{item.time}}
- </view>
- </view>
- <view class="msg_item" v-if="item.place">
- <view class="key">
- 打卡地址:
- </view>
- <view class="value">
- {{item.place}}
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- year: null,
- month: null,
- items: ['打卡成功(30次)', '打卡失败(28次)'],
- current: 0,
- list: [],
- list2: [{
- id: 1,
- peopleImg: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
- name: "程佳欢",
- college: "文法学院",
- imgsList: [{
- url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
- title: "匹对照片"
- },
- {
- url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
- title: "被匹对照片"
- },
- {
- url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
- title: "场景照片"
- },
- ],
- status: '打卡成功',
- rule: "课间操打卡规则已打卡",
- time: "2022-02-04 15:15:15",
- place: "江西省南昌市南昌交通学院操场"
- },
- {
- id: 2,
- peopleImg: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
- name: "陈志斌",
- college: "南昌交通学院",
- imgsList: [{
- url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
- title: "匹对照片"
- },
- {
- url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
- title: "被匹对照片"
- },
- {
- url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
- title: "场景照片"
- },
- ],
- status: '打卡成功',
- rule: "课间操打卡规则已打卡",
- time: "2022-11-04 15:15:15",
- place: "江西省南昌市经开区"
- },
- ],
- list3: [{
- id: 1,
- peopleImg: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
- name: "甘昱新",
- college: "文法学院",
- status: '未打卡',
- rule: "课间操打卡规则",
- },
- {
- id: 2,
- peopleImg: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13579194276%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1671596163&t=52c9def84f0fa7832bfc5824364917e0",
- name: "甘昱新",
- college: "文法学院",
- status: '未打卡',
- rule: "课间操打卡规则",
- },
- ]
- };
- },
- onLoad(options) {
- this.month = options.month - 0 || 1
- this.getTime()
- this.list = this.list2
- },
- computed: {
- comMonth() {
- if (this.month) {
- let month = this.month < 10 ? '0' + this.month : this.month
- console.log(month);
- return month
- }
- }
- },
- methods: {
- // 获取当前年份
- getTime() {
- let date = new Date()
- let year = date.getFullYear()
- this.year = year
- },
- onClickItem(e) {
- console.log(e.currentIndex);
- if (e.currentIndex == 0) {
- this.list = this.list2
- } else {
- this.list = this.list3
- }
- },
- handleDoubleLeft() {
- if (this.year <= 2000) {
- uni.showToast({
- title: "不能选择2000年之前",
- icon: 'none'
- })
- } else {
- this.year -= 1
- }
- },
- handleLeft() {
- if (this.month <= 1) {
- if (this.year <= 2000) {
- uni.showToast({
- title: "不能选择2000年之前",
- icon: 'none'
- })
- } else {
- this.year -= 1
- this.month = 12
- }
- } else {
- this.month -= 1
- }
- },
- handleRight() {
- if (this.month >= 12) {
- if (this.year >= 2025) {
- uni.showToast({
- title: "不能选择2025年之后",
- icon: 'none'
- })
- } else {
- this.year += 1
- this.month = 1
- }
- } else {
- this.month += 1
- }
- },
- handleDoubleRight() {
- if (this.year >= 2025) {
- uni.showToast({
- title: "不能选择2025年之后",
- icon: 'none'
- })
- } else {
- this.year += 1
- }
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- padding-top: 20rpx;
- .header {
- display: flex;
- flex-direction: column;
- justify-content: space-evenly;
- margin: 0 auto;
- width: 690rpx;
- height: 192rpx;
- background-color: #fff;
- .calendar {
- display: flex;
- justify-content: center;
- align-items: center;
- flex: 1;
- .double {
- width: 40rpx;
- height: 40rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .single {
- margin-left: 30rpx;
- width: 40rpx;
- height: 40rpx;
- img {
- width: 80%;
- height: 70%;
- }
- }
- .single2 {
- margin-right: 30rpx;
- width: 40rpx;
- height: 40rpx;
- img {
- width: 100%;
- height: 70%;
- }
- }
- .time {
- width: 180rpx;
- height: 44rpx;
- font-size: 32rpx;
- text-align: center;
- }
- }
- .state {
- display: flex;
- flex-direction: column;
- justify-content: center;
- flex: 1;
- }
- }
- .list {
- padding-bottom: 50rpx;
- .box {
- margin: 0 auto;
- margin-top: 20rpx;
- width: 690rpx;
- background-color: #fff;
- .person {
- display: flex;
- align-items: center;
- height: 134rpx;
- .img {
- margin: 0 20rpx 0 30rpx;
- width: 70rpx;
- height: 70rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .info {
- width: 620rpx;
- height: 70rpx;
- .name {
- font-size: 32rpx;
- }
- .college {
- font-size: 24rpx;
- color: #A6A6A6;
- }
- }
- }
- .imgs {
- display: flex;
- justify-content: space-evenly;
- height: 201rpx;
- .imgs_item {
- display: flex;
- flex-direction: column;
- align-items: center;
- flex: 1;
- .image {
- width: 120rpx;
- height: 120rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .title {
- margin-top: 10rpx;
- font-size: 28rpx;
- }
- }
- }
- .msg {
- margin-left: 30rpx;
- .msg_item {
- display: flex;
- align-items: center;
- height: 63rpx;
- font-size: 28rpx;
- .key {
- color: #808080;
- }
- .value {}
- }
- }
- }
- }
- }
- </style>
|