| | |
| | | this.list = target.list |
| | | }, |
| | | jump(item) { |
| | | |
| | | this.show = false |
| | | this.$emit('selected', item) |
| | | } |
| | | }
|
| | | }
|
| | |
| | | </div>
|
| | | </div>
|
| | | <!-- å
¥åºåï¼å个ä»åºï¼ -->
|
| | | <template
|
| | | v-if="route.query.type == 9 && info.woScanMaterialBeanList && info.woScanMaterialBeanList.length > 0">
|
| | | <template v-if="type == 9 && woScanMaterialBeanList && woScanMaterialBeanList.length > 0">
|
| | | <div class="page_yxwl_list">
|
| | | <div class="page_yxwl_list_item" v-for="(item, index) in info.woScanMaterialBeanList" :key="index">
|
| | | <div class="page_yxwl_list_item" v-for="(item, index) in woScanMaterialBeanList" :key="index">
|
| | | <div class="page_yxwl_list_item_top">
|
| | | <!-- <div class="page_yxwl_list_item_top_left" v-if="item.batch">{{item.materialName}} | {{item.materialCode}}ï½{{item.batch}}</div>-->
|
| | | <div class="page_yxwl_list_item_top_left">{{item.materialName}} | {{item.materialCode}}
|
| | |
| | | </div>
|
| | | </template>
|
| | | <!-- 转åºåï¼å¤ä¸ªä»åºï¼ -->
|
| | | <template v-else-if="route.query.type == 7 && seleMateriaList.length > 0">
|
| | | <template v-else-if="type == 7 && seleMateriaList.length > 0">
|
| | | <!-- <template v-for="(item, index) in info.wtransferWarehouseList" :key="index"> -->
|
| | | <div class="page_yxwl_list">
|
| | | <div class="page_yxwl_list_item" v-for="(item1, idx) in seleMateriaList" :key="idx">
|
| | |
| | | <span>确认å
¥åº</span>
|
| | | </div>
|
| | | </div>
|
| | | <SelectMultipleMaterial ref="selectMultipleMaterial" /> |
| | | <SelectLoaction ref="selectLoaction" @selected="selectLocation"/> |
| | | <MaterialIn ref="materialIn" @selected="selectLocation"/>
|
| | | <MaterialIn ref="materialIn" @selected="selectMaterial" />
|
| | | </view>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import InOutInfo from '@/components/InOutInfo.vue'
|
| | | import SelectMultipleMaterial from '@/components/SelectMultipleMaterial.vue' |
| | | import SelectLoaction from '@/components/SelectLoaction.vue' |
| | | import MaterialIn from '@/components/materialIn.vue'
|
| | | import {
|
| | |
| | | components: {
|
| | | InOutInfo, |
| | | SelectLoaction, |
| | | MaterialIn,
|
| | | SelectMultipleMaterial
|
| | | MaterialIn
|
| | | },
|
| | | data() {
|
| | | return {
|
| | |
| | | location: '', |
| | | locationName: '',
|
| | | wtransferWarehouseList: [],
|
| | | MateriaList: []
|
| | | MateriaList: [],
|
| | | woScanMaterialBeanList: [],
|
| | | seleMateriaList: [] // å·²éç©æ
|
| | | };
|
| | | },
|
| | | onLoad(option) {
|
| | |
| | | let data = {
|
| | | id: this.id
|
| | | }
|
| | | console.log(this.type, QRCodeType.CKD);
|
| | | if (this.type == QRCodeType.CKD) {
|
| | | // console.log(this.type, QRCodeType.CKD);
|
| | | if (this.type == QRCodeType.RKD) {
|
| | | infoAction = wOutBoundForInOut
|
| | | data.wOutboundType = '1'
|
| | | } else if (this.type == QRCodeType.ZKD) {
|
| | |
| | | } else {
|
| | | this.info = res.data.woutbound
|
| | | this.woutboundDetailsWait = res.data.woutboundDetailsWait
|
| | | this.woScanMaterialBeanList = res.data.woScanMaterialBeanList
|
| | | }
|
| | | }).catch(err => {
|
| | | uni.$u.toast(err)
|
| | |
| | | if (res.data.length === 1) { |
| | | this.location = res.data[0].id |
| | | this.locationName = res.data[0].unionName |
| | | this.$refs.materialIn.open({list: this.MateriaList}) |
| | | this.$refs.materialIn.open({
|
| | | list: this.MateriaList
|
| | | })
|
| | | } else { |
| | | this.$refs.selectLoaction.open({wareHouseId: this.wareHouseId}) |
| | | this.$refs.selectLoaction.open({
|
| | | wareHouseId: this.wareHouseId
|
| | | })
|
| | | }
|
| | | })
|
| | | }, |
| | | selectLocation(item) { |
| | | this.location = item.id |
| | | this.locationName = item.unionName |
| | | this.$refs.materialIn.open({list: this.MateriaList}) |
| | | this.$refs.materialIn.open({
|
| | | list: this.MateriaList
|
| | | })
|
| | | },
|
| | | selectMaterial(val) {
|
| | | let material = JSON.parse(JSON.stringify(val))
|
| | | let tempMaterial = this.seleMateriaList.find(item => item.locationId == this.location)
|
| | | if (tempMaterial) {
|
| | | if (tempMaterial.qualityType == material.qualityType && tempMaterial.procedureId == material
|
| | | .procedureId &&
|
| | | tempMaterial.batch == material.batch && tempMaterial.materialId == material.materialId) {
|
| | | uni.$u.toast('ç¸åè´§ä½ï¼åä¸ä¸ªç©æåªè½æä¸ä¸ª')
|
| | | return
|
| | | }
|
| | | }
|
| | | let materialNum = 0
|
| | | let num = 0
|
| | | this.seleMateriaList.forEach(item => {
|
| | | if (item.id === material.id) {
|
| | | materialNum += Number(item.outActnum)
|
| | | }
|
| | | })
|
| | | this.MateriaList.forEach(item => {
|
| | | if (item.id === material.id) {
|
| | | num = item.outActnum - materialNum
|
| | | }
|
| | | })
|
| | | material.outActnum = num
|
| | | this.seleMateriaList.push({
|
| | | ...material,
|
| | | locationId: this.location,
|
| | | locationName: this.locationName
|
| | | })
|
| | | },
|
| | | submit() {
|
| | | if (this.type == QRCodeType.ZKD) {
|
| | | if (!this.seleMateriaList.length) {
|
| | | uni.$u.toast('转å
¥ç©æä¸è½ä¸ºç©º')
|
| | | return
|
| | | }
|
| | | let result = this.seleMateriaList.reduce((a, b) => {
|
| | | if (a[b.id]) {
|
| | | a[b.id].push(b);
|
| | | } else {
|
| | | a[b.id] = [b];
|
| | | }
|
| | | return a;
|
| | | }, {});
|
| | | for (let i = 0; i < this.MateriaList.length; i++) {
|
| | | for (let a in result) {
|
| | | if (this.MateriaList[i].id == a) {
|
| | | let total = 0
|
| | | for (let b = 0; b < result[a].length; b++) {
|
| | | total = Number(total) + Number(result[a][b].outActnum)
|
| | | }
|
| | | if (!total || total <= 0) { |
| | | uni.$u.toast('å
¥åºæ°éä¸è½å°äº0')
|
| | | return |
| | | // Toast.fail({
|
| | | // message: 'å
¥åºæ°éä¸è½å°äº0',
|
| | | // forbidClick: true,
|
| | | // duration: 2000
|
| | | // })
|
| | | }
|
| | | if (total > this.MateriaList[i].outActnum) { |
| | | uni.$u.toast('å
¥åºæ°éä¸è½å¤§äºå¾
å
¥åºæ°é')
|
| | | return |
| | | // Toast.fail({
|
| | | // message: 'å
¥åºæ°éä¸è½å¤§äºå¾
å
¥åºæ°é',
|
| | | // forbidClick: true,
|
| | | // duration: 2000
|
| | | // })
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | let submitTransferInDetailDTOList = []
|
| | | this.seleMateriaList.forEach(item => {
|
| | | submitTransferInDetailDTOList.push({
|
| | | inNum: item.outActnum,
|
| | | locationId: item.locationId,
|
| | | wtransferDetailId: item.id
|
| | | })
|
| | | })
|
| | | transferToInNew({
|
| | | submitTransferInDetailDTOList,
|
| | | wtransferId: this.id
|
| | | }).then(res => {
|
| | | if (res.code === 200) {
|
| | | this.$store.dispatch('getUpcomingNum') |
| | | uni.$u.toast('æä½æå')
|
| | | // Toast.success({
|
| | | // message: 'æä½æå',
|
| | | // forbidClick: true,
|
| | | // duration: 2000
|
| | | // }) |
| | | |
| | | // setTimeout(() => {
|
| | | // if (route.query.Type == '4') { // 跳转å®å·¥å
¥åºè¯¦æ
|
| | | // router.push({
|
| | | // name: 'completionDetails',
|
| | | // query: {
|
| | | // id: route.query.id,
|
| | | // dbid: route.query.dbid,
|
| | | // type: 7,
|
| | | // isShow: 2
|
| | | // }
|
| | | // })
|
| | | // return
|
| | | // }
|
| | | // router.replace({
|
| | | // name: 'wTransferDetail',
|
| | | // query: {
|
| | | // id: route.query.id
|
| | | // }
|
| | | // })
|
| | | // }, 2000)
|
| | | }
|
| | | })
|
| | |
|
| | | } else if (this.type === QRCodeType.RKD) {
|
| | | wOutBoundForUpload({
|
| | | id: this.info.id,
|
| | | wOutboundType: 1
|
| | | }).then(res => {
|
| | | if (res.code === 200) {
|
| | | this.$store.dispatch('getUpcomingNum') |
| | | uni.$u.toast('æä½æå')
|
| | | // Toast.success({
|
| | | // message: 'æä½æå',
|
| | | // forbidClick: true,
|
| | | // duration: 2000
|
| | | // })
|
| | | // setTimeout(() => {
|
| | | // // router.go(-1)
|
| | | // router.replace({
|
| | | // name: 'wInboundDetail',
|
| | | // query: {
|
| | | // id: this.id
|
| | | // }
|
| | | // })
|
| | | // }, 2000)
|
| | | }
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | .nr {
|
| | | display: flex;
|
| | | font-size: 26rpx;
|
| | | font-weight: 400;
|
| | | color: #222222;
|
| | |
| | | :style="{paddingTop: `${statusbarHeight}px`, height: `${navHeight}px`, lineHeight:`${navHeight}px`, textAlign: 'center'}">
|
| | | å¾
å</view>
|
| | | <view class="cY">
|
| | | <u-search placeholder="æç´¢å
³é®å" bgColor="#f7f7f7" :showAction="false" @search="scrolltoupper"
|
| | | <u-search placeholder="æç´¢å
³é®å" bgColor="#f7f7f7" :showAction="false" @search="search"
|
| | | shape="square" v-model="searchForm.mixParam"></u-search>
|
| | | <image src="../../static/filter@2x.png" class="img48 ml20" @click="filterAction" mode=""></image>
|
| | | </view>
|
| | |
| | | selectType(status) {
|
| | | if (this.searchForm.status == status) return
|
| | | this.searchForm.status = status
|
| | | this.scrolltolower()
|
| | | this.search()
|
| | | },
|
| | | jump(item) { |
| | | console.log(item);
|
| | | if ((item.type === 0 || item.type === 2 || item.type === 5) && item.status === 0) { // 跳转åºåº(转åºå) |
| | | console.log('åºåº');
|
| | | uni.navigateTo({
|
| | | url: `/pages/OutOperation/OutOperation?id=${item.objId}&dbid=${item.id}&type=7` |
| | | })
|
| | |
| | | // }
|
| | | // })
|
| | | } else if (item.type === 9 && item.status === 0) { // è°æ´å
¥åº(å
¥åºå)
|
| | | uni.navigateTo({ |
| | | url: `/pages/InOperation/InOperation?id=${item.objId}&dbid=${item.id}&type=9` |
| | | })
|
| | | // router.push({
|
| | | // name: 'warehousing',
|
| | | // query: {
|
| | |
| | | confirm() {
|
| | | this.searchForm.type = this.type
|
| | | this.show = false
|
| | | this.scrolltoupper()
|
| | | this.search()
|
| | | }, |
| | | search() { |
| | | this.page.page = 1 |
| | | this.loadData() |
| | | }
|
| | | }
|
| | | }
|
| | |
| | | </template>
|
| | |
|
| | | <script> |
| | | import { createStandard } from '@/util/api/QualityAPI' |
| | | import { checkAllList, getListByCondition, toolingQueryById } from "@/util/api/WorkOrderAPI" |
| | | export default { |
| | | data() {
|
| | | return {
|
| | |
| | | }, |
| | | onLoad() { |
| | | uni.$on('workOrder', (data) => { |
| | | console.log(data); |
| | | this.form.gdmc = data.mmodel.name + '-' + data.pgmodel.name |
| | | this.form.gdid = data.id |
| | | this.info = data |
| | |
| | | <div class="Search_item_label">è®¡åæ¥æ</div>
|
| | | <div class="Search_item_content" @click="isOpenDate=true">
|
| | | <div class="Search_item_content_a" :style="form.startDate ? 'color: #000;' : ''">
|
| | | {{ form.startDate ? form.startDate : 'å¼å§æ¥æ'}}</div>
|
| | | {{ form.startDate ? form.startDate : 'å¼å§æ¥æ'}}
|
| | | </div>
|
| | | <span>-</span>
|
| | | <div class="Search_item_content_a" :style="form.endDate ? 'color: #000;' : ''">
|
| | | {{ form.endDate ? form.endDate : 'ç»ææ¥æ'}}</div>
|
| | | {{ form.endDate ? form.endDate : 'ç»ææ¥æ'}}
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </template>
|
| | |
| | | </div>
|
| | | <div class="content_total">å
±{{page.total}}æ¡æ°æ®</div> |
| | | <div class="content_list"> |
| | | <u-list @scrolltolower="scrolltolower" @scrolltoupper="scrolltoupper"> |
| | | <u-list-item v-for="(item, i) in list" :key="i"> |
| | | <div class="content_list_item" @click="jump(item)"> |
| | | <scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="refreshing"
|
| | | @scrolltolower="loadMore" @refresherrefresh="onRefresh" :style="{height: height}">
|
| | | <div class="content_list_item" v-for="(item, i) in list" :key="i" @click="jump(item)">
|
| | | <div class="content_list_item_top"> |
| | | <div class="content_list_item_top_left"> |
| | | <span v-if="item.mmodel">{{item.mmodel.name}} | {{item.procedureName}}</span> |
| | |
| | | <div class="content_list_item_content_item"> |
| | | <div class="content_list_item_content_item_label">è®¡åæ°éï¼</div> |
| | | <div class="content_list_item_content_item_nr" v-if="item.umodel"> |
| | | {{item.planNum}}{{item.umodel.name}}</div> |
| | | {{item.planNum}}{{item.umodel.name}}
|
| | | </div>
|
| | | </div> |
| | | <div class="content_list_item_content_item"> |
| | | <div class="content_list_item_content_item_label">ç产设å¤ï¼</div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </u-list-item> |
| | | </u-list> |
| | | </scroll-view>
|
| | | </div>
|
| | | <!-- <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
| | | <van-list v-model:loading="loading" :finished="finished" finished-text="æ²¡ææ´å¤äº~" @load="onLoad">
|
| | | </van-list>
|
| | | </van-pull-refresh> --> |
| | | <u-calendar :show="isOpenDate" mode="range" @close="isOpenDate=false" @confirm="onConfirm"></u-calendar>
|
| | | <!-- <van-calendar v-model:show="isOpenDate" type="range" :min-date="minDate" :max-date="maxDate" color="#4275FC"
|
| | | @confirm="onConfirm" /> -->
|
| | | <!-- <v-ScanCode
|
| | | :openCode="openCode"
|
| | | :infos="['ç¬¬ä¸æ¬¡æ«ç ']"
|
| | | @closePopup="closePopup"
|
| | | @onDecode="onDecode">
|
| | | </v-ScanCode> -->
|
| | |
|
| | | <l-calendar :lunar="false" v-model="isOpenDate" @change="onConfirm" :isRange="true" activeBgColor="#305ED5"
|
| | | rangeColor="#305ED5" rangeBgColor="rgba(48, 80, 213, 0.1)"></l-calendar>
|
| | |
|
| | | </view>
|
| | | </template>
|
| | |
|
| | | <script> |
| | | import vSearch from '@/components/Search.vue' |
| | | import vLableSelection from '@/components/LabelSelection.vue' |
| | | import { gsdate } from '@/util/utils'
|
| | | import {
|
| | | gsdate
|
| | | } from '@/util/utils'
|
| | | import {
|
| | | getList,
|
| | | pageCount
|
| | | } from '@/util/api/WorkOrderAPI'
|
| | | export default { |
| | | components: { |
| | | vSearch, |
| | |
| | | },
|
| | | data() {
|
| | | return {
|
| | | height: '',
|
| | | status: true, |
| | | isOpenDate: false, |
| | | refreshing: false,
|
| | | // tagList: [1,2,3], |
| | | tagList: [{ |
| | | id: [2,3,7], |
| | | name: 'ç产ä¸', |
| | | num: '' |
| | | }],
|
| | | minDate: '2021-01-01',
|
| | | maxDate: '',
|
| | | form: { |
| | | startDate: '', |
| | | endDate: '' |
| | | endDate: '',
|
| | | mixParam: '',
|
| | | statusList: []
|
| | | }, |
| | | list: [ |
| | | { |
| | | mmodel: { name: 'adsa', }, |
| | | mmodel: { code: 'wl-001' }, |
| | | umodel: { name: 'å¨' }, |
| | | pgmodel: { name: 'æ¶²åæº' }, |
| | | procedureName: 'åå¶', |
| | | urgent: 10, |
| | | paused: 0, |
| | | status: 0, |
| | | code: '00100', |
| | | planDate: '2023-08-30', |
| | | batch: 'kk-yw', |
| | | planNum: 300, |
| | | proNum: 100, |
| | | }, |
| | | { |
| | | mmodel: { name: 'adsa', }, |
| | | mmodel: { code: 'wl-001' }, |
| | | umodel: { name: 'å¨' }, |
| | | pgmodel: { name: 'æ¶²åæº' }, |
| | | procedureName: 'åå¶', |
| | | urgent: 10, |
| | | paused: 0, |
| | | status: 1, |
| | | code: '00100', |
| | | planDate: '2023-08-30', |
| | | batch: 'kk-yw', |
| | | planNum: 300, |
| | | proNum: 100 |
| | | }, |
| | | { |
| | | mmodel: { name: 'adsa', }, |
| | | mmodel: { code: 'wl-001' }, |
| | | umodel: { name: 'å¨' }, |
| | | pgmodel: { name: 'æ¶²åæº' }, |
| | | procedureName: 'åå¶', |
| | | urgent: 10, |
| | | paused: 0, |
| | | status: 2, |
| | | code: '00100', |
| | | planDate: '2023-08-30', |
| | | batch: 'kk-yw', |
| | | planNum: 300, |
| | | proNum: 100, |
| | | }, |
| | | { |
| | | mmodel: { name: 'adsa', }, |
| | | mmodel: { name: 'ç©æ001', code: 'wl-001' }, |
| | | umodel: { name: 'å¨' }, |
| | | pgmodel: { name: 'æ¶²åæº' }, |
| | | procedureName: 'åå¶', |
| | | urgent: 10, |
| | | paused: 0, |
| | | status: 3, |
| | | code: '00100', |
| | | planDate: '2023-08-30', |
| | | batch: 'kk-yw', |
| | | planNum: 300, |
| | | proNum: 100, |
| | | }, |
| | | { |
| | | mmodel: { name: 'adsa', }, |
| | | mmodel: { code: 'wl-001' }, |
| | | umodel: { name: 'å¨' }, |
| | | pgmodel: { name: 'æ¶²åæº' }, |
| | | procedureName: 'åå¶', |
| | | urgent: 10, |
| | | paused: 0, |
| | | status: 4, |
| | | code: '00100', |
| | | planDate: '2023-08-30', |
| | | batch: 'kk-yw', |
| | | planNum: 300, |
| | | proNum: 100, |
| | | }, |
| | | { |
| | | mmodel: { name: 'adsa', }, |
| | | mmodel: { code: 'wl-001' }, |
| | | umodel: { name: 'å¨' }, |
| | | pgmodel: { name: 'æ¶²åæº' }, |
| | | procedureName: 'åå¶', |
| | | urgent: 10, |
| | | paused: 0, |
| | | status: 5, |
| | | code: '00100', |
| | | planDate: '2023-08-30', |
| | | batch: 'kk-yw', |
| | | planNum: 300, |
| | | proNum: 100, |
| | | }, |
| | | { |
| | | mmodel: { name: 'adsa', }, |
| | | mmodel: { code: 'wl-001' }, |
| | | umodel: { name: 'å¨' }, |
| | | pgmodel: { name: 'æ¶²åæº' }, |
| | | procedureName: 'åå¶', |
| | | urgent: 10, |
| | | paused: 0, |
| | | status: 6, |
| | | code: '00100', |
| | | planDate: '2023-08-30', |
| | | batch: 'kk-yw', |
| | | planNum: 300, |
| | | proNum: 100, |
| | | }, |
| | | { |
| | | mmodel: { name: 'adsa', }, |
| | | mmodel: { code: 'wl-001' }, |
| | | umodel: { name: 'å¨' }, |
| | | pgmodel: { name: 'æ¶²åæº' }, |
| | | procedureName: 'åå¶', |
| | | urgent: 10, |
| | | paused: 0, |
| | | status: 7, |
| | | code: '00100', |
| | | planDate: '2023-08-30', |
| | | batch: 'kk-yw', |
| | | planNum: 300, |
| | | proNum: 100, |
| | | }, |
| | | ], |
| | | list: [],
|
| | | page: { |
| | | size: 10, |
| | | capacity: 10,
|
| | | index: 1, |
| | | total: 0 |
| | | }
|
| | | };
|
| | | }, |
| | | onLoad(opt) {
|
| | | this.$nextTick(() => {
|
| | | uni.createSelectorQuery().in(this).select('.content_search').boundingClientRect((rect) => {
|
| | | this.height = `calc(100vh - ${rect.height + 80}px)`
|
| | | }).exec()
|
| | | })
|
| | | if (opt.type == '1') {
|
| | | this.tagList = [{
|
| | | id: [0, 1],
|
| | | name: 'å¾
ç产',
|
| | | num: ''
|
| | | },
|
| | | {
|
| | | id: [2, 3, 7],
|
| | | name: 'ç产ä¸',
|
| | | num: ''
|
| | | }
|
| | | ]
|
| | | } else {
|
| | | this.tagList = [{
|
| | | id: [2, 3, 7],
|
| | | name: 'ç产ä¸',
|
| | | num: ''
|
| | | }]
|
| | | }
|
| | | this.maxDate = gsdate(new Date(`${new Date().getFullYear() + 1}-12-30`))
|
| | | this.pageCounts()
|
| | | this.loadData()
|
| | | },
|
| | | methods: { |
| | | reset() {}, |
| | | submit() {}, |
| | | reset() {
|
| | | this.form.startDate = ''
|
| | | this.form.endDate = ''
|
| | | this.search()
|
| | | },
|
| | | searchInput(val) {
|
| | | this.form.mixParam = val;
|
| | | this.search()
|
| | | },
|
| | | clickTag(v) {
|
| | | this.form.statusList = v
|
| | | this.search()
|
| | | },
|
| | | submit() {
|
| | | this.search()
|
| | | },
|
| | | onConfirm(value) { |
| | | const [start, end] = value |
| | | this.form.startDate = gsdate(start) |
| | | this.form.endDate = gsdate(end) |
| | | this.form.startDate = value.startDate
|
| | | this.form.endDate = value.endDate
|
| | | this.isOpenDate = false |
| | | }, |
| | | scrolltolower() {}, |
| | | scrolltoupper() {}, |
| | | onRefresh() {
|
| | | if (this.refreshing) return
|
| | | this.refreshing = true;
|
| | | this.search()
|
| | | },
|
| | | loadMore() {
|
| | | this.page.page += 1
|
| | | this.loadData()
|
| | | },
|
| | | search() {
|
| | | this.page.page = 1
|
| | | this.loadData()
|
| | | },
|
| | | loadData() {
|
| | | getList({
|
| | | ...this.page,
|
| | | model: { |
| | | ...this.form, |
| | | statusList: this.form.statusList.length === 0 ? this.tagList[0].id : this.form.statusList |
| | | } |
| | | })
|
| | | .then(res => {
|
| | | let {
|
| | | data
|
| | | } = res
|
| | | if (data.page == 1) {
|
| | | this.list = []
|
| | | }
|
| | | this.list.push(...data.records)
|
| | | this.page.total = data.total
|
| | | this.page.page = data.page
|
| | | })
|
| | | .catch(err => {
|
| | |
|
| | | })
|
| | | .finally(() => {
|
| | | this.refreshing = false
|
| | | })
|
| | | },
|
| | | pageCounts() {
|
| | | pageCount({}).then(res => {
|
| | | if (res.code === 200) {
|
| | | this.tagList.forEach(item => {
|
| | | if (item.name == 'å¾
ç产') {
|
| | | item.num = res.data.startNum
|
| | | }
|
| | | if (item.name == 'ç产ä¸') {
|
| | | item.num = res.data.ingNum
|
| | | }
|
| | | if (item.name == '已宿') {
|
| | | item.num = res.data.endNum
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | | },
|
| | | jump(item) { |
| | | uni.$emit('workOrder', item) |
| | | uni.navigateBack() |
| | |
| | |
|
| | | .content_list {
|
| | | width: 100%;
|
| | | height: 100%;
|
| | | // height: 100%;
|
| | | display: flex;
|
| | | flex-direction: column;
|
| | |
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | ## 1.0.3ï¼2023-05-31ï¼ |
| | | 1.0.3 |
| | | ## 1.0.2ï¼2023-05-20ï¼ |
| | | 1.0.2 |
| | | ## 1.0.1ï¼2023-05-19ï¼ |
| | | 1.0.1 |
| | | ## 1.0.0ï¼2023-05-19ï¼ |
| | | 1.0.0 |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * @1900-2100åºé´å
çå
¬åãååäºè½¬ |
| | | * @å
¬å转ååï¼solar2lunar |
| | | * @åå转å
¬åï¼lunar2solar |
| | | */ |
| | | let calendar = { |
| | | /** |
| | | * åå1900-2100çæ¶¦å¤§å°ä¿¡æ¯è¡¨ |
| | | * @Array Of Property |
| | | * @return Hex |
| | | */ |
| | | lunarInfo: [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, //1900-1909 |
| | | 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, //1910-1919 |
| | | 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, //1920-1929 |
| | | 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, //1930-1939 |
| | | 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, //1940-1949 |
| | | 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, //1950-1959 |
| | | 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, //1960-1969 |
| | | 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, //1970-1979 |
| | | 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, //1980-1989 |
| | | 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0, //1990-1999 |
| | | 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, //2000-2009 |
| | | 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, //2010-2019 |
| | | 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, //2020-2029 |
| | | 0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, //2030-2039 |
| | | 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, //2040-2049 |
| | | 0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0, //2050-2059 |
| | | 0x0a2e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4, //2060-2069 |
| | | 0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0, //2070-2079 |
| | | 0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160, //2080-2089 |
| | | 0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252, //2090-2099 |
| | | 0x0d520 |
| | | ], //2100 |
| | | /** |
| | | * å
¬åæ¯ä¸ªæä»½çå¤©æ°æ®é表 |
| | | * @Array Of Property |
| | | * @return Number |
| | | */ |
| | | solarMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], |
| | | /** |
| | | * 天干尿¯ä¹å¤©å¹²éæ¥è¡¨ |
| | | * @Array Of Property trans["ç²","ä¹","ä¸","ä¸","æ","å·±","åº","è¾","壬","ç¸"] |
| | | * @return Cn string |
| | | */ |
| | | Gan: ["\u7532", "\u4e59", "\u4e19", "\u4e01", "\u620a", "\u5df1", "\u5e9a", "\u8f9b", "\u58ec", "\u7678"], |
| | | /** |
| | | * 天干尿¯ä¹å°æ¯éæ¥è¡¨ |
| | | * @Array Of Property |
| | | * @trans["å","ä¸","å¯
","å¯","è¾°","å·³","å","æª","ç³","é
","æ","亥"] |
| | | * @return Cn string |
| | | */ |
| | | Zhi: ["\u5b50", "\u4e11", "\u5bc5", "\u536f", "\u8fb0", "\u5df3", "\u5348", "\u672a", "\u7533", "\u9149", "\u620c", |
| | | "\u4ea5" |
| | | ], |
| | | /** |
| | | * 天干尿¯ä¹å°æ¯éæ¥è¡¨<=>çè |
| | | * @Array Of Property |
| | | * @trans["é¼ ","ç","è","å
","é¾","è","马","ç¾","ç´","鸡","ç","çª"] |
| | | * @return Cn string |
| | | */ |
| | | Animals: ["\u9f20", "\u725b", "\u864e", "\u5154", "\u9f99", "\u86c7", "\u9a6c", "\u7f8a", "\u7334", "\u9e21", |
| | | "\u72d7", "\u732a" |
| | | ], |
| | | /** |
| | | * 24èæ°éæ¥è¡¨ |
| | | * @Array Of Property |
| | | * @trans["å°å¯","大å¯","ç«æ¥","鍿°´","æè°","æ¥å","æ¸
æ","è°·é¨","ç«å¤","å°æ»¡","èç§","å¤è³","å°æ","大æ","ç«ç§","夿","ç½é²","ç§å","å¯é²","éé","ç«å¬","å°éª","大éª","å¬è³"] |
| | | * @return Cn string |
| | | */ |
| | | solarTerm: ["\u5c0f\u5bd2", "\u5927\u5bd2", "\u7acb\u6625", "\u96e8\u6c34", "\u60ca\u86f0", "\u6625\u5206", |
| | | "\u6e05\u660e", "\u8c37\u96e8", "\u7acb\u590f", "\u5c0f\u6ee1", "\u8292\u79cd", "\u590f\u81f3", "\u5c0f\u6691", |
| | | "\u5927\u6691", "\u7acb\u79cb", "\u5904\u6691", "\u767d\u9732", "\u79cb\u5206", "\u5bd2\u9732", "\u971c\u964d", |
| | | "\u7acb\u51ac", "\u5c0f\u96ea", "\u5927\u96ea", "\u51ac\u81f3" |
| | | ], |
| | | /** |
| | | * 1900-2100åå¹´ç24èæ°æ¥æéæ¥è¡¨ |
| | | * @Array Of Property |
| | | * @return 0x string For splice |
| | | */ |
| | | sTermInfo: ['9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', |
| | | '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', |
| | | '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', |
| | | '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', |
| | | 'b027097bd097c36b0b6fc9274c91aa', '9778397bd19801ec9210c965cc920e', '97b6b97bd19801ec95f8c965cc920f', |
| | | '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd197c36c9210c9274c91aa', |
| | | '97b6b97bd19801ec95f8c965cc920e', '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', |
| | | '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec95f8c965cc920e', '97bcf97c3598082c95f8e1cfcc920f', |
| | | '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', |
| | | '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', |
| | | '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', |
| | | '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', |
| | | '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', |
| | | '97bcf97c359801ec95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', |
| | | '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd097bd07f595b0b6fc920fb0722', |
| | | '9778397bd097c36b0b6fc9210c8dc2', '9778397bd19801ec9210c9274c920e', '97b6b97bd19801ec95f8c965cc920f', |
| | | '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e', |
| | | '97b6b97bd19801ec95f8c965cc920f', '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', |
| | | '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bd07f1487f595b0b0bc920fb0722', |
| | | '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', |
| | | '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', |
| | | '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', |
| | | '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f531b0b0bb0b6fb0722', |
| | | '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', |
| | | '97bcf7f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', |
| | | '97b6b97bd19801ec9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', |
| | | '9778397bd097c36b0b6fc9210c91aa', '97b6b97bd197c36c9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', |
| | | '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e', |
| | | '97b6b7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', |
| | | '9778397bd097c36b0b70c9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722', |
| | | '7f0e397bd097c35b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', |
| | | '7f0e27f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', |
| | | '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', |
| | | '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', |
| | | '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', |
| | | '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9274c91aa', |
| | | '97b6b7f0e47f531b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', |
| | | '9778397bd097c36b0b6fc9210c91aa', '97b6b7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', |
| | | '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '977837f0e37f149b0723b0787b0721', |
| | | '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c35b0b6fc9210c8dc2', |
| | | '977837f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722', |
| | | '7f0e397bd097c35b0b6fc9210c8dc2', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', |
| | | '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '977837f0e37f14998082b0787b06bd', |
| | | '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', |
| | | '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', |
| | | '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', |
| | | '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', |
| | | '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', |
| | | '977837f0e37f14998082b0723b06bd', '7f07e7f0e37f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', |
| | | '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b0721', |
| | | '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f595b0b0bb0b6fb0722', '7f0e37f0e37f14898082b0723b02d5', |
| | | '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f531b0b0bb0b6fb0722', |
| | | '7f0e37f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', |
| | | '7f0e37f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd', |
| | | '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', |
| | | '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', |
| | | '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f149b0723b0787b0721', |
| | | '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0723b06bd', |
| | | '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', '7f0e37f0e366aa89801eb072297c35', |
| | | '7ec967f0e37f14998082b0723b06bd', '7f07e7f0e37f14998083b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', |
| | | '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14898082b0723b02d5', '7f07e7f0e37f14998082b0787b0721', |
| | | '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66aa89801e9808297c35', '665f67f0e37f14898082b0723b02d5', |
| | | '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66a449801e9808297c35', |
| | | '665f67f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', |
| | | '7f0e36665b66a449801e9808297c35', '665f67f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd', |
| | | '7f07e7f0e47f531b0723b0b6fb0721', '7f0e26665b66a449801e9808297c35', '665f67f0e37f1489801eb072297c35', |
| | | '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722' |
| | | ], |
| | | /** |
| | | * æ°åè½¬ä¸æéæ¥è¡¨ |
| | | * @Array Of Property |
| | | * @trans ['æ¥','ä¸','äº','ä¸','å','äº','å
','ä¸','å
«','ä¹','å'] |
| | | * @return Cn string |
| | | */ |
| | | nStr1: ["\u65e5", "\u4e00", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d", "\u4e03", "\u516b", "\u4e5d", "\u5341"], |
| | | /** |
| | | * æ¥æè½¬ååç§°å¼éæ¥è¡¨ |
| | | * @Array Of Property |
| | | * @trans ['å','å','廿','å
'] |
| | | * @return Cn string |
| | | */ |
| | | nStr2: ["\u521d", "\u5341", "\u5eff", "\u5345"], |
| | | /** |
| | | * æä»½è½¬ååç§°å¼éæ¥è¡¨ |
| | | * @Array Of Property |
| | | * @trans ['æ£','ä¸','äº','ä¸','å','äº','å
','ä¸','å
«','ä¹','å','å¬','è
'] |
| | | * @return Cn string |
| | | */ |
| | | nStr3: ["\u6b63", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d", "\u4e03", "\u516b", "\u4e5d", "\u5341", "\u51ac", |
| | | "\u814a" |
| | | ], |
| | | /** |
| | | * è¿åååy年䏿´å¹´çæ»å¤©æ° |
| | | * @param lunar Year |
| | | * @return Number |
| | | * @eg:let count = calendar.lYearDays(1987) ;//count=387 |
| | | */ |
| | | lYearDays: function(y) { |
| | | let i, sum = 348; |
| | | for (i = 0x8000; i > 0x8; i >>= 1) { |
| | | sum += (calendar.lunarInfo[y - 1900] & i) ? 1 : 0; |
| | | } |
| | | return (sum + calendar.leapDays(y)); |
| | | }, |
| | | /** |
| | | * è¿åååyå¹´é°ææ¯åªä¸ªæï¼è¥y年没æé°æ åè¿å0 |
| | | * @param lunar Year |
| | | * @return Number (0-12) |
| | | * @eg:let leapMonth = calendar.leapMonth(1987) ;//leapMonth=6 |
| | | */ |
| | | leapMonth: function(y) { //é°åç¼ç \u95f0 |
| | | return (calendar.lunarInfo[y - 1900] & 0xf); |
| | | }, |
| | | /** |
| | | * è¿åååyå¹´é°æçå¤©æ° è¥è¯¥å¹´æ²¡æé°æåè¿å0 |
| | | * @param lunar Year |
| | | * @return Number (0ã29ã30) |
| | | * @eg:let leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29 |
| | | */ |
| | | leapDays: function(y) { |
| | | if (calendar.leapMonth(y)) { |
| | | return ((calendar.lunarInfo[y - 1900] & 0x10000) ? 30 : 29); |
| | | } |
| | | return (0); |
| | | }, |
| | | /** |
| | | * è¿åååyå¹´mæï¼éé°æï¼çæ»å¤©æ°ï¼è®¡ç®mä¸ºé°ææ¶ç天æ°è¯·ä½¿ç¨leapDaysæ¹æ³ |
| | | * @param lunar Year |
| | | * @return Number (-1ã29ã30) |
| | | * @eg:let MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29 |
| | | */ |
| | | monthDays: function(y, m) { |
| | | if (m > 12 || m < 1) { |
| | | return -1 |
| | | } //æä»½åæ°ä»1è³12ï¼åæ°é误è¿å-1 |
| | | return ((calendar.lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29); |
| | | }, |
| | | /** |
| | | * è¿åå
¬å(!)yå¹´mæçå¤©æ° |
| | | * @param solar Year |
| | | * @return Number (-1ã28ã29ã30ã31) |
| | | * @eg:let solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30 |
| | | */ |
| | | solarDays: function(y, m) { |
| | | if (m > 12 || m < 1) { |
| | | return -1 |
| | | } //è¥åæ°é误 è¿å-1 |
| | | let ms = m - 1; |
| | | if (ms == 1) { //2æä»½çé°å¹³è§å¾æµç®å确认è¿å28æ29 |
| | | return (((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) ? 29 : 28); |
| | | } else { |
| | | return (calendar.solarMonth[ms]); |
| | | } |
| | | }, |
| | | /** |
| | | * åå年份转æ¢ä¸ºå¹²æ¯çºªå¹´ |
| | | * @param lYear ååå¹´çå¹´ä»½æ° |
| | | * @return Cn string |
| | | */ |
| | | toGanZhiYear: function(lYear) { |
| | | let ganKey = (lYear - 3) % 10; |
| | | let zhiKey = (lYear - 3) % 12; |
| | | if (ganKey == 0) ganKey = 10; //妿使°ä¸º0å为æåä¸ä¸ªå¤©å¹² |
| | | if (zhiKey == 0) zhiKey = 12; //妿使°ä¸º0å为æåä¸ä¸ªå°æ¯ |
| | | return calendar.Gan[ganKey - 1] + calendar.Zhi[zhiKey - 1]; |
| | | }, |
| | | /** |
| | | * å
¬åæãæ¥å¤ææå±æåº§ |
| | | * @param cMonth [description] |
| | | * @param cDay [description] |
| | | * @return Cn string |
| | | */ |
| | | toAstro: function(cMonth, cDay) { |
| | | let s = |
| | | "\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf"; |
| | | let arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22]; |
| | | return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + "\u5ea7"; //座 |
| | | }, |
| | | /** |
| | | * ä¼ å
¥offsetåç§»éè¿åå¹²æ¯ |
| | | * @param offset ç¸å¯¹ç²åçåç§»é |
| | | * @return Cn string |
| | | */ |
| | | toGanZhi: function(offset) { |
| | | return calendar.Gan[offset % 10] + calendar.Zhi[offset % 12]; |
| | | }, |
| | | /** |
| | | * ä¼ å
¥å
¬å(!)yå¹´è·å¾è¯¥å¹´ç¬¬nä¸ªèæ°çå
¬åæ¥æ |
| | | * @param yå
¬åå¹´(1900-2100)ï¼näºååèæ°ä¸ç第å ä¸ªèæ°(1~24)ï¼ä»n=1(å°å¯)ç®èµ· |
| | | * @return day Number |
| | | * @eg:let _24 = calendar.getTerm(1987,3) ;//_24=4;æå³1987å¹´2æ4æ¥ç«æ¥ |
| | | */ |
| | | getTerm: function(y, n) { |
| | | if (y < 1900 || y > 2100) { |
| | | return -1; |
| | | } |
| | | if (n < 1 || n > 24) { |
| | | return -1; |
| | | } |
| | | let _table = calendar.sTermInfo[y - 1900]; |
| | | let _info = [ |
| | | parseInt('0x' + _table.substr(0, 5)).toString(), |
| | | parseInt('0x' + _table.substr(5, 5)).toString(), |
| | | parseInt('0x' + _table.substr(10, 5)).toString(), |
| | | parseInt('0x' + _table.substr(15, 5)).toString(), |
| | | parseInt('0x' + _table.substr(20, 5)).toString(), |
| | | parseInt('0x' + _table.substr(25, 5)).toString() |
| | | ]; |
| | | let _calday = [ |
| | | _info[0].substr(0, 1), |
| | | _info[0].substr(1, 2), |
| | | _info[0].substr(3, 1), |
| | | _info[0].substr(4, 2), |
| | | _info[1].substr(0, 1), |
| | | _info[1].substr(1, 2), |
| | | _info[1].substr(3, 1), |
| | | _info[1].substr(4, 2), |
| | | _info[2].substr(0, 1), |
| | | _info[2].substr(1, 2), |
| | | _info[2].substr(3, 1), |
| | | _info[2].substr(4, 2), |
| | | _info[3].substr(0, 1), |
| | | _info[3].substr(1, 2), |
| | | _info[3].substr(3, 1), |
| | | _info[3].substr(4, 2), |
| | | _info[4].substr(0, 1), |
| | | _info[4].substr(1, 2), |
| | | _info[4].substr(3, 1), |
| | | _info[4].substr(4, 2), |
| | | _info[5].substr(0, 1), |
| | | _info[5].substr(1, 2), |
| | | _info[5].substr(3, 1), |
| | | _info[5].substr(4, 2), |
| | | ]; |
| | | return parseInt(_calday[n - 1]); |
| | | }, |
| | | /** |
| | | * ä¼ å
¥ååæ°åæä»½è¿åæ±è¯éä¿è¡¨ç¤ºæ³ |
| | | * @param lunar month |
| | | * @return Cn string |
| | | * @eg:let cnMonth = calendar.toChinaMonth(12) ;//cnMonth='è
æ' |
| | | */ |
| | | toChinaMonth: function(m) { // æ => \u6708 |
| | | if (m > 12 || m < 1) { |
| | | return -1 |
| | | } //è¥åæ°é误 è¿å-1 |
| | | let s = calendar.nStr3[m - 1]; |
| | | s += "\u6708"; //å 䏿å |
| | | return s; |
| | | }, |
| | | /** |
| | | * ä¼ å
¥ååæ¥ææ°åè¿åæ±åè¡¨ç¤ºæ³ |
| | | * @param lunar day |
| | | * @return Cn string |
| | | * @eg:let cnDay = calendar.toChinaDay(21) ;//cnMonth='廿ä¸' |
| | | */ |
| | | toChinaDay: function(d) { //æ¥ => \u65e5 |
| | | let s; |
| | | switch (d) { |
| | | case 10: |
| | | s = '\u521d\u5341'; |
| | | break; |
| | | case 20: |
| | | s = '\u4e8c\u5341'; |
| | | break; |
| | | break; |
| | | case 30: |
| | | s = '\u4e09\u5341'; |
| | | break; |
| | | break; |
| | | default: |
| | | s = calendar.nStr2[Math.floor(d / 10)]; |
| | | s += calendar.nStr1[d % 10]; |
| | | } |
| | | return (s); |
| | | }, |
| | | /** |
| | | * 年份转çè[!ä»
è½å¤§è´è½¬æ¢] => 精确ååçèåç线æ¯âç«æ¥â |
| | | * @param y year |
| | | * @return Cn string |
| | | * @eg:let animal = calendar.getAnimal(1987) ;//animal='å
' |
| | | */ |
| | | getAnimal: function(y) { |
| | | return calendar.Animals[(y - 4) % 12] |
| | | }, |
| | | /** |
| | | * ä¼ å
¥é³åå¹´ææ¥è·å¾è¯¦ç»çå
¬åãååobjectä¿¡æ¯ <=>JSON |
| | | * @param y solar year |
| | | * @param m solar month |
| | | * @param d solar day |
| | | * @return JSON object |
| | | * @eg:console.log(calendar.solar2lunar(1987,11,01)); |
| | | */ |
| | | solar2lunar: function(y, m, d) { //åæ°åºé´1900.1.31~2100.12.31 |
| | | if (y < 1900 || y > 2100) { |
| | | return -1; |
| | | } //年份éå®ãä¸é |
| | | if (y == 1900 && m == 1 && d < 31) { |
| | | return -1; |
| | | } //ä¸é |
| | | let objDate; |
| | | if (!y) { //æªä¼ å è·å¾å½å¤© |
| | | objDate = new Date(); |
| | | } else { |
| | | objDate = new Date(y, parseInt(m) - 1, d) |
| | | } |
| | | let i, leap = 0, |
| | | temp = 0; |
| | | //ä¿®æ£ymdåæ° |
| | | y = objDate.getFullYear(); |
| | | m = objDate.getMonth() + 1; |
| | | d = objDate.getDate(); |
| | | let offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, 31)) / |
| | | 86400000; |
| | | for (i = 1900; i < 2101 && offset > 0; i++) { |
| | | temp = calendar.lYearDays(i); |
| | | offset -= temp; |
| | | } |
| | | if (offset < 0) { |
| | | offset += temp; |
| | | i--; |
| | | } |
| | | //æ¯å¦ä»å¤© |
| | | let isTodayObj = new Date(), |
| | | isToday = false; |
| | | if (isTodayObj.getFullYear() == y && isTodayObj.getMonth() + 1 == m && isTodayObj.getDate() == d) { |
| | | isToday = true; |
| | | } |
| | | //ææå |
| | | let nWeek = objDate.getDay(), |
| | | cWeek = calendar.nStr1[nWeek]; |
| | | if (nWeek == 0) { |
| | | nWeek = 7; |
| | | } //æ°å表示å¨å 顺åºå¤©æå¨ä¸å¼å§çæ¯ä¾ |
| | | //ååå¹´ |
| | | let year = i; |
| | | leap = calendar.leapMonth(i); //é°åªä¸ªæ |
| | | let isLeap = false; |
| | | //æéªé°æ |
| | | for (i = 1; i < 13 && offset > 0; i++) { |
| | | //é°æ |
| | | if (leap > 0 && i == (leap + 1) && isLeap == false) { |
| | | --i; |
| | | isLeap = true; |
| | | temp = calendar.leapDays(year); //计ç®ååé°æå¤©æ° |
| | | } else { |
| | | temp = calendar.monthDays(year, i); //计ç®ååæ®éæå¤©æ° |
| | | } |
| | | //è§£é¤é°æ |
| | | if (isLeap == true && i == (leap + 1)) { |
| | | isLeap = false; |
| | | } |
| | | offset -= temp; |
| | | } |
| | | if (offset == 0 && leap > 0 && i == leap + 1) |
| | | if (isLeap) { |
| | | isLeap = false; |
| | | } else { |
| | | isLeap = true; |
| | | --i; |
| | | } |
| | | if (offset < 0) { |
| | | offset += temp; |
| | | --i; |
| | | } |
| | | //ååæ |
| | | let month = i; |
| | | //å忥 |
| | | let day = offset + 1; |
| | | //天干尿¯å¤ç |
| | | let sm = m - 1; |
| | | let gzY = calendar.toGanZhiYear(year); |
| | | //ææ± 1900å¹´1æå°å¯ä»¥å为 ä¸åæ(60è¿å¶12) |
| | | let firstNode = calendar.getTerm(year, (m * 2 - 1)); //è¿å彿ãèãä¸ºå æ¥å¼å§ |
| | | let secondNode = calendar.getTerm(year, (m * 2)); //è¿å彿ãèãä¸ºå æ¥å¼å§ |
| | | //便®12èæ°ä¿®æ£å¹²æ¯æ |
| | | let gzM = calendar.toGanZhi((y - 1900) * 12 + m + 11); |
| | | if (d >= firstNode) { |
| | | gzM = calendar.toGanZhi((y - 1900) * 12 + m + 12); |
| | | } |
| | | //ä¼ å
¥çæ¥æçèæ°ä¸å¦ |
| | | let isTerm = false; |
| | | let Term = null; |
| | | if (firstNode == d) { |
| | | isTerm = true; |
| | | Term = calendar.solarTerm[m * 2 - 2]; |
| | | } |
| | | if (secondNode == d) { |
| | | isTerm = true; |
| | | Term = calendar.solarTerm[m * 2 - 1]; |
| | | } |
| | | //æ¥æ± 彿䏿¥ä¸ 1900/1/1 ç¸å·®å¤©æ° |
| | | let dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10; |
| | | let gzD = calendar.toGanZhi(dayCyclical + d - 1); |
| | | //è¯¥æ¥ææå±çæåº§ |
| | | let astro = calendar.toAstro(m, d); |
| | | return { |
| | | 'lYear': year, |
| | | 'lMonth': month, |
| | | 'lDay': day, |
| | | 'Animal': calendar.getAnimal(year), |
| | | 'IMonthCn': (isLeap ? "\u95f0" : '') + calendar.toChinaMonth(month), |
| | | 'IDayCn': calendar.toChinaDay(day), |
| | | 'cYear': y, |
| | | 'cMonth': m, |
| | | 'cDay': d, |
| | | 'gzYear': gzY, |
| | | 'gzMonth': gzM, |
| | | 'gzDay': gzD, |
| | | 'isToday': isToday, |
| | | 'isLeap': isLeap, |
| | | 'nWeek': nWeek, |
| | | 'ncWeek': "\u661f\u671f" + cWeek, |
| | | 'isTerm': isTerm, |
| | | 'Term': Term, |
| | | 'astro': astro |
| | | }; |
| | | }, |
| | | /** |
| | | * ä¼ å
¥ååå¹´ææ¥ä»¥åä¼ å
¥çæä»½æ¯å¦é°æè·å¾è¯¦ç»çå
¬åãååobjectä¿¡æ¯ <=>JSON |
| | | * @param y lunar year |
| | | * @param m lunar month |
| | | * @param d lunar day |
| | | * @param isLeapMonth lunar month is leap or not.[妿æ¯ååé°æç¬¬åä¸ªåæ°èµå¼trueå³å¯] |
| | | * @return JSON object |
| | | * @eg:console.log(calendar.lunar2solar(1987,9,10)); |
| | | */ |
| | | lunar2solar: function(y, m, d, isLeapMonth) { //åæ°åºé´1900.1.31~2100.12.1 |
| | | isLeapMonth = !!isLeapMonth; |
| | | let leapOffset = 0; |
| | | let leapMonth = calendar.leapMonth(y); |
| | | let leapDay = calendar.leapDays(y); |
| | | if (isLeapMonth && (leapMonth != m)) { |
| | | return -1; |
| | | } //ä¼ åè¦æ±è®¡ç®è¯¥é°æå
¬å ä½è¯¥å¹´å¾åºçé°æä¸ä¼ åçæä»½å¹¶ä¸å |
| | | if (y == 2100 && m == 12 && d > 1 || y == 1900 && m == 1 && d < 31) { |
| | | return -1; |
| | | } //è¶
åºäºæå¤§æéå¼ |
| | | let day = calendar.monthDays(y, m); |
| | | let _day = day; |
| | | //bugFix 2016-9-25 |
| | | //if month is leap, _day use leapDays method |
| | | if (isLeapMonth) { |
| | | _day = calendar.leapDays(y, m); |
| | | } |
| | | if (y < 1900 || y > 2100 || d > _day) { |
| | | return -1; |
| | | } //åæ°åæ³æ§æéª |
| | | //计ç®ååçæ¶é´å·® |
| | | let offset = 0; |
| | | for (let i = 1900; i < y; i++) { |
| | | offset += calendar.lYearDays(i); |
| | | } |
| | | let leap = 0, |
| | | isAdd = false; |
| | | for (let i = 1; i < m; i++) { |
| | | leap = calendar.leapMonth(y); |
| | | if (!isAdd) { //å¤çé°æ |
| | | if (leap <= i && leap > 0) { |
| | | offset += calendar.leapDays(y); |
| | | isAdd = true; |
| | | } |
| | | } |
| | | offset += calendar.monthDays(y, i); |
| | | } |
| | | //转æ¢é°æåå éè¡¥å
è¯¥å¹´é°æçåä¸ä¸ªæçæ¶å·® |
| | | if (isLeapMonth) { |
| | | offset += day; |
| | | } |
| | | //1900å¹´å忣æä¸æ¥çå
¬åæ¶é´ä¸º1900å¹´1æ30æ¥0æ¶0å0ç§(该æ¶é´ä¹æ¯æ¬ååçæå¼å§èµ·å§ç¹) |
| | | let stmap = Date.UTC(1900, 1, 30, 0, 0, 0); |
| | | let calObj = new Date((offset + d - 31) * 86400000 + stmap); |
| | | let cY = calObj.getUTCFullYear(); |
| | | let cM = calObj.getUTCMonth() + 1; |
| | | let cD = calObj.getUTCDate(); |
| | | return calendar.solar2lunar(cY, cM, cD); |
| | | } |
| | | }; |
| | | |
| | | export default { |
| | | solar2lunar: calendar.solar2lunar, |
| | | lunar2solar: calendar.lunar2solar |
| | | }; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <view @touchmove.stop.prevent>
|
| | | <view class="l-calendar-box" :class="{'calendar-box-show': value}">
|
| | | <view class="calendar-top">
|
| | | <view>{{title}}</view>
|
| | | <view class="close l-icons icon-shanchu" hover-class="l-opacity" :hover-stay-time="150" @tap="hide">
|
| | | </view>
|
| | | </view>
|
| | |
|
| | | <view class="date-box">
|
| | | <view class=" date-arrowleft l-icons icon-youjiantou" :style="{ color: yearChangeColor }"
|
| | | hover-class="l-opacity" :hover-stay-time="150" @tap="changeYear(false)">
|
| | | </view>
|
| | | <view class=" date-arrowleft l-icons icon-zuojiantou" :style="{ color: monthChangeColor }"
|
| | | hover-class="l-opacity" :hover-stay-time="150" @tap="changeMonth(false)"></view>
|
| | | <view class="title-datetime">{{ showTitle }}</view>
|
| | | <view class=" date-arrowright l-icons icon-youjiantou2" :style="{ color: monthChangeColor }"
|
| | | hover-class="l-opacity" :hover-stay-time="150" @tap="changeMonth(true)"></view>
|
| | | <view class=" date-arrowright l-icons icon-youjiantou1" :style="{ color: yearChangeColor }"
|
| | | hover-class="l-opacity" :hover-stay-time="150" @tap="changeYear(true)"></view>
|
| | | </view>
|
| | | <view class="date-weekday">
|
| | | <view class="date-weekday-item">æ¥</view>
|
| | | <view class="date-weekday-item">ä¸</view>
|
| | | <view class="date-weekday-item">äº</view>
|
| | | <view class="date-weekday-item">ä¸</view>
|
| | | <view class="date-weekday-item">å</view>
|
| | | <view class="date-weekday-item">äº</view>
|
| | | <view class="date-weekday-item">å
</view>
|
| | | </view>
|
| | | <view class="date-content" :style="{ height: dateHeight * 6 + 'px' }">
|
| | | <block v-for="(item, index) in weekdayArr" :key="index">
|
| | | <view class="date-weekday-item"></view>
|
| | | </block>
|
| | | <view class="date-weekday-item" :class="{
|
| | | 'l-opacity': isDisable(year, month, index + 1),
|
| | | 'start-date': (isRange && startDate == `${year}-${month}-${index + 1}`) || !isRange,
|
| | | 'end-date': (isRange && endDate == `${year}-${month}-${index + 1}`) || !isRange
|
| | | }" :style="{ backgroundColor: getColor(index, 1), height: dateHeight + 'px',padding:0}"
|
| | | v-for="(item, index) in daysArr" :key="index" @tap="dateClick(index)">
|
| | | <view class="date-content-item" :style="{ color: getColor(index, 2) }">
|
| | | <view>{{ index + 1 }}</view>
|
| | | <!-- åå -->
|
| | | <view class="custom-desc">
|
| | | {{ getText(index, startDate, endDate) }}
|
| | | </view>
|
| | | </view>
|
| | | <view class="date-content-item-desc" :style="{ color: activeColor }"
|
| | | v-if="!lunar && isRange && startDate == `${year}-${month}-${index + 1}` && startDate != endDate">
|
| | | {{ startText }}
|
| | | </view>
|
| | | <view class="date-content-item-desc" :style="{ color: activeColor }"
|
| | | v-if="!lunar && isRange && endDate == `${year}-${month}-${index + 1}`">{{ endText }}</view>
|
| | | </view>
|
| | | <view class="bg-mounth">{{ month }}</view>
|
| | | </view>
|
| | |
|
| | | <view class="calendar-text">
|
| | | <!-- <view class="calendar-result">
|
| | | <text>{{ !isRange ? activeDate : startDate }}</text>
|
| | | <text v-if="endDate">è³{{ endDate }}</text>
|
| | | </view> -->
|
| | | <view class="calendar-btn">
|
| | | <button :style="{opacity:disabled ? '.5' : '1'}" :size="28" :disabled="disabled"
|
| | | @click="confireBtnClick(false)">ç¡®å®
|
| | | </button>
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | |
|
| | | <view class="mask" :class="[value ? 'mask-show' : '']" @tap="hide"></view>
|
| | | </view>
|
| | | </template>
|
| | | <script>
|
| | | import calendar from './calendar.js';
|
| | | export default {
|
| | | name: 'lCalendar',
|
| | | model: {
|
| | | prop: 'value',
|
| | | event: 'input'
|
| | | },
|
| | | props: {
|
| | | //ååç»å®çå¼ ç¨äºå±ç¤º/å
³éæ¥å
|
| | | value: {
|
| | | type: Boolean,
|
| | | default: false
|
| | | },
|
| | | //æ¯å¦éæ©èå´ trueæ¯ falseéæ©åä¸ªæ¥æ
|
| | | isRange: {
|
| | | type: Boolean,
|
| | | default: false
|
| | | },
|
| | | //å¯åæ¢æå¤§å¹´ä»½
|
| | | maxYear: {
|
| | | type: Number,
|
| | | default: 2100
|
| | | },
|
| | | //å¯åæ¢æå°å¹´ä»½
|
| | | minYear: {
|
| | | type: Number,
|
| | | default: 1920
|
| | | },
|
| | | //æå°å¯éæ¥æ ä¸å¨èå´å
æ¥æç¦é
|
| | | minDate: {
|
| | | type: String,
|
| | | default: '1920-01-01'
|
| | | },
|
| | | //æå¤§å¯éæ¥æ
|
| | | maxDate: {
|
| | | type: String,
|
| | | default: '2100-1-1'
|
| | | },
|
| | | //ç»ä»¶æ é¢
|
| | | title: {
|
| | | type: String,
|
| | | default: 'æ¥æéæ©'
|
| | | },
|
| | | //æä»½åæ¢ç®å¤´é¢è²
|
| | | monthChangeColor: {
|
| | | type: String,
|
| | | default: '#999'
|
| | | },
|
| | | //年份忢ç®å¤´é¢è²
|
| | | yearChangeColor: {
|
| | | type: String,
|
| | | default: '#bfbfbf'
|
| | | },
|
| | | //é»è®¤æ¥æåä½é¢è²
|
| | | color: {
|
| | | type: String,
|
| | | default: '#333'
|
| | | },
|
| | |
|
| | | //é䏿¥æåä½é¢è²
|
| | | activeColor: {
|
| | | type: String,
|
| | | default: '#fff'
|
| | | },
|
| | | //é䏿¥æèæ¯è²
|
| | | activeBgColor: {
|
| | | type: String,
|
| | | default: '#55BBF9'
|
| | | },
|
| | | //èå´å
æ¥æèæ¯è²
|
| | | rangeBgColor: {
|
| | | type: String,
|
| | | default: 'rgba(85, 187, 249, 0.1)'
|
| | | },
|
| | | //èå´å
æ¥æåä½é¢è²
|
| | | rangeColor: {
|
| | | type: String,
|
| | | default: '#55BBF9'
|
| | | },
|
| | |
|
| | | //èå´éæ©æ¶çæ å¼å§æ¥æèªå®ä¹æå
|
| | | startText: {
|
| | | type: String,
|
| | | default: 'å¼å§'
|
| | | },
|
| | | //èå´éæ©æ¶çæ ç»ææ¥æèªå®ä¹æå
|
| | | endText: {
|
| | | type: String,
|
| | | default: 'ç»æ'
|
| | | },
|
| | | //æ¯å¦æ¾ç¤ºåå
|
| | | lunar: {
|
| | | type: Boolean,
|
| | | default: true
|
| | | },
|
| | | //åå§åå¼å§é䏿¥æ æ ¼å¼ï¼ 2020-06-06 æ 2020/06/06
|
| | | initStartDate: {
|
| | | type: String,
|
| | | default: ''
|
| | | },
|
| | | //åå§åç»ææ¥æ æ ¼å¼ï¼ 2020-06-06 æ 2020/06/06
|
| | | initEndDate: {
|
| | | type: String,
|
| | | default: ''
|
| | | }
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | weekday: 1, // ææå ,å¼ä¸º1-7
|
| | | weekdayArr: [],
|
| | | days: 0, //å½åææå¤å°å¤©
|
| | | daysArr: [],
|
| | | showTitle: '',//å½åå¹´ææ é¢
|
| | | year: 2020,
|
| | | month: 0,
|
| | | day: 0,
|
| | | startYear: 0,
|
| | | startMonth: 0,
|
| | | startDay: 0,
|
| | | endYear: 0,
|
| | | endMonth: 0,
|
| | | endDay: 0,
|
| | | today: '', //ä»å¤©çæ¥æ
|
| | | activeDate: '', //å½åé䏿¥æ
|
| | | startDate: '', //èå´éæ©æ¶çéä¸å¼å§æ¥æ
|
| | | endDate: '', //èå´éæ©æ¶çéä¸ç»ææ¥æ
|
| | | isStart: true,
|
| | | min: null,
|
| | | max: null,
|
| | | dateHeight: 20
|
| | | };
|
| | | },
|
| | | computed: {
|
| | | dataChange() {
|
| | | return `${this.type}-${this.minDate}-${this.maxDate}-${this.initStartDate}-${this.initEndDate}`;
|
| | | },
|
| | | disabled() {
|
| | | return this.isRange && (!this.startDate || !this.endDate)
|
| | | }
|
| | | },
|
| | | watch: {
|
| | | dataChange(val) {
|
| | | this.init();
|
| | | },
|
| | | },
|
| | | created() {
|
| | | this.init();
|
| | | },
|
| | | methods: {
|
| | | getColor(index, type) {
|
| | | let color = type == 1 ? '' : this.color;
|
| | | let day = index + 1;
|
| | | let date = `${this.year}-${this.month}-${day}`;
|
| | | let timestamp = new Date(date.replace(/\-/g, '/')).getTime();
|
| | | let start = this.startDate.replace(/\-/g, '/');
|
| | | let end = this.endDate.replace(/\-/g, '/');
|
| | | if ((this.activeDate == date) || this.startDate == date || this.endDate == date) {
|
| | | color = type == 1 ? this.activeBgColor : this.activeColor;
|
| | | } else if (this.endDate && timestamp > new Date(start).getTime() && timestamp < new Date(end).getTime()) {
|
| | | color = type == 1 ? this.rangeBgColor : this.rangeColor;
|
| | | }
|
| | | return color;
|
| | | },
|
| | | getText(index, startDate, endDate) {
|
| | | let text = this.lunar ? this.getLunar(this.year, this.month, index + 1) : '';
|
| | | if (this.isRange) {
|
| | | if (this.lunar) {
|
| | | let date = `${this.year}-${this.month}-${index + 1}`;
|
| | | if (startDate == date && startDate != endDate) {
|
| | | text = this.startText;
|
| | | } else if (endDate == date) {
|
| | | text = this.endText;
|
| | | }
|
| | | }
|
| | | }
|
| | | return text;
|
| | | },
|
| | | getLunar(year, month, day) {
|
| | | let obj = calendar.solar2lunar(year, month, day);
|
| | | if (obj.IDayCn == 'åä¸') {
|
| | | return obj.IMonthCn
|
| | | }
|
| | | return obj.IDayCn;
|
| | | },
|
| | | init() {
|
| | | this.dateHeight = uni.getSystemInfoSync().windowWidth / 7;
|
| | | let now = new Date();
|
| | | this.year = now.getFullYear();
|
| | | this.month = now.getMonth() + 1;
|
| | | this.day = now.getDate();
|
| | | this.today = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`;
|
| | | this.activeDate = this.today;
|
| | | this.min = this.initDate(this.minDate);
|
| | | this.max = this.initDate(this.maxDate);
|
| | | if (this.isDisable(this.year, this.month, this.day)) {
|
| | | this.year = this.min.year;
|
| | | this.month = this.min.month;
|
| | | this.day = this.min.day;
|
| | | this.activeDate = `${this.min.year}-${this.min.month}-${this.min.day}`;
|
| | | this.max = this.initDate(this.maxDate || this.minDate);
|
| | | }
|
| | | this.startDate = '';
|
| | | this.startYear = 0;
|
| | | this.startMonth = 0;
|
| | | this.startDay = 0;
|
| | | if (this.initStartDate) {
|
| | | let start = new Date(this.initStartDate.replace(/\-/g, '/'));
|
| | | if (!this.isRange) {
|
| | | this.year = start.getFullYear();
|
| | | this.month = start.getMonth() + 1;
|
| | | this.day = start.getDate();
|
| | | this.activeDate = `${start.getFullYear()}-${start.getMonth() + 1}-${start.getDate()}`;
|
| | | } else {
|
| | | this.startDate = `${start.getFullYear()}-${start.getMonth() + 1}-${start.getDate()}`;
|
| | | this.startYear = start.getFullYear();
|
| | | this.startMonth = start.getMonth() + 1;
|
| | | this.startDay = start.getDate();
|
| | | this.activeDate = '';
|
| | | }
|
| | |
|
| | | }
|
| | | this.endYear = 0;
|
| | | this.endMonth = 0;
|
| | | this.endDay = 0;
|
| | | this.endDate = '';
|
| | | if (this.initEndDate && this.isRange) {
|
| | | let end = new Date(this.initEndDate.replace(/\-/g, '/'));
|
| | | this.endDate = `${end.getFullYear()}-${end.getMonth() + 1}-${end.getDate()}`;
|
| | | this.endYear = end.getFullYear();
|
| | | this.endMonth = end.getMonth() + 1;
|
| | | this.endDay = end.getDate();
|
| | | this.activeDate = '';
|
| | | this.year = end.getFullYear();
|
| | | this.month = end.getMonth() + 1;
|
| | | this.day = end.getDate();
|
| | | }
|
| | | this.isStart = true;
|
| | | this.changeData();
|
| | | },
|
| | | //æ¥æå¤ç
|
| | | initDate(date) {
|
| | | let dateArr = date.split('-');
|
| | | return {
|
| | | year: Number(dateArr[0] || 1920),
|
| | | month: Number(dateArr[1] || 1),
|
| | | day: Number(dateArr[2] || 1)
|
| | | };
|
| | | },
|
| | | isDisable(year, month, day) {
|
| | | let bool = true;
|
| | | let date = `${year}/${month}/${day}`;
|
| | | let min = `${this.min.year}/${this.min.month}/${this.min.day}`;
|
| | | let max = `${this.max.year}/${this.max.month}/${this.max.day}`;
|
| | | let timestamp = new Date(date).getTime();
|
| | | if (timestamp >= new Date(min).getTime() && timestamp <= new Date(max).getTime()) {
|
| | | bool = false;
|
| | | }
|
| | | return bool;
|
| | | },
|
| | | generateArray(start, end) {
|
| | | return Array.from(new Array(end + 1).keys()).slice(start);
|
| | | },
|
| | | formatNum(num) {
|
| | | return num < 10 ? '0' + num : num + '';
|
| | | },
|
| | | //ä¸ä¸ªææå¤å°å¤©
|
| | | getMonthDay(year, month) {
|
| | | let days = new Date(year, month, 0).getDate();
|
| | | return days;
|
| | | },
|
| | | // è·åå½åæ¥ææ¯ææå
|
| | | getWeekday(year, month) {
|
| | | let date = new Date(`${year}/${month}/01 00:00:00`);
|
| | | return date.getDay();
|
| | | },
|
| | | changeMonth(isAdd) {
|
| | | if (isAdd) {
|
| | | let month = this.month + 1;
|
| | | let year = month > 12 ? this.year + 1 : this.year;
|
| | | if (year > this.minYear || year < this.maxYear) {
|
| | | this.month = month > 12 ? 1 : month;
|
| | | this.year = year;
|
| | | this.changeData();
|
| | | }
|
| | | } else {
|
| | | let month = this.month - 1;
|
| | | let year = month < 1 ? this.year - 1 : this.year;
|
| | | if (year > this.minYear || year < this.maxYear) {
|
| | | this.month = month < 1 ? 12 : month;
|
| | | this.year = year;
|
| | | this.changeData();
|
| | | }
|
| | | }
|
| | | },
|
| | | changeYear(isAdd) {
|
| | | let year = isAdd ? this.year + 1 : this.year - 1;
|
| | | if (year > this.minYear || year < this.maxYear) {
|
| | | this.year = year;
|
| | | this.changeData();
|
| | | }
|
| | | },
|
| | | changeData() {
|
| | | this.days = this.getMonthDay(this.year, this.month);
|
| | | this.daysArr = this.generateArray(1, this.days);
|
| | | this.weekday = this.getWeekday(this.year, this.month);
|
| | | this.weekdayArr = this.generateArray(1, this.weekday);
|
| | | this.showTitle = `${this.year}å¹´${this.month}æ`;
|
| | | if (!this.isRange) {
|
| | | this.confireBtnClick(true);
|
| | | }
|
| | | },
|
| | | dateClick: function(day) {
|
| | | day += 1;
|
| | | if (!this.isDisable(this.year, this.month, day)) {
|
| | | this.day = day;
|
| | | let date = `${this.year}-${this.month}-${day}`;
|
| | | if (!this.isRange) {
|
| | | this.activeDate = date;
|
| | | } else {
|
| | | let compare = new Date(date.replace(/\-/g, '/')).getTime() < new Date(this.startDate.replace(
|
| | | /\-/g, '/')).getTime();
|
| | | if (this.isStart || compare) {
|
| | | this.startDate = date;
|
| | | this.startYear = this.year;
|
| | | this.startMonth = this.month;
|
| | | this.startDay = this.day;
|
| | | this.endYear = 0;
|
| | | this.endMonth = 0;
|
| | | this.endDay = 0;
|
| | | this.endDate = '';
|
| | | this.activeDate = '';
|
| | | this.isStart = false;
|
| | | } else {
|
| | | this.endDate = date;
|
| | | this.endYear = this.year;
|
| | | this.endMonth = this.month;
|
| | | this.endDay = this.day;
|
| | | this.isStart = true;
|
| | | }
|
| | | }
|
| | | }
|
| | | },
|
| | | hide() {
|
| | | this.$emit('input', false)
|
| | | },
|
| | | getWeekText(date) {
|
| | | date = new Date(`${date.replace(/\-/g, '/')} 00:00:00`);
|
| | | let week = date.getDay();
|
| | | return 'ææ' + ['æ¥', 'ä¸', 'äº', 'ä¸', 'å', 'äº', 'å
'][week];
|
| | | },
|
| | | confireBtnClick(show) {
|
| | | if (!show) {
|
| | | this.hide();
|
| | | }
|
| | | if (!this.isRange) {
|
| | | let arr = this.activeDate.split('-');
|
| | | let year = +arr[0];
|
| | | let month = +arr[1];
|
| | | let day = +arr[2];
|
| | | //å½åææå¤å°å¤©
|
| | | let days = this.getMonthDay(year, month);
|
| | | let result = `${year}-${this.formatNum(month)}-${this.formatNum(day)}`;
|
| | | let weekText = this.getWeekText(result);
|
| | | let isToday = false;
|
| | | if (`${year}-${month}-${day}` == this.today) {
|
| | | //ä»å¤©
|
| | | isToday = true;
|
| | | }
|
| | | let lunar = calendar.solar2lunar(year, month, day);
|
| | | this.$emit('change', {
|
| | | year: year,
|
| | | month: month,
|
| | | day: day,
|
| | | days: days,
|
| | | result: result,
|
| | | week: weekText,
|
| | | isToday: isToday,
|
| | | lunar: lunar
|
| | | });
|
| | | } else {
|
| | | if (!this.startDate || !this.endDate) return;
|
| | | let startMonth = this.formatNum(this.startMonth);
|
| | | let startDay = this.formatNum(this.startDay);
|
| | | let startDate = `${this.startYear}-${startMonth}-${startDay}`;
|
| | | let startWeek = this.getWeekText(startDate);
|
| | | let startLunar = calendar.solar2lunar(this.startYear, startMonth, startDay);
|
| | |
|
| | | let endMonth = this.formatNum(this.endMonth);
|
| | | let endDay = this.formatNum(this.endDay);
|
| | | let endDate = `${this.endYear}-${endMonth}-${endDay}`;
|
| | | let endWeek = this.getWeekText(endDate);
|
| | | let endLunar = calendar.solar2lunar(this.endYear, endMonth, endDay);
|
| | | this.$emit('change', {
|
| | | startYear: this.startYear,
|
| | | startMonth: this.startMonth,
|
| | | startDay: this.startDay,
|
| | | startDate: startDate,
|
| | | startWeek: startWeek,
|
| | | startLunar: startLunar,
|
| | | endYear: this.endYear,
|
| | | endMonth: this.endMonth,
|
| | | endDay: this.endDay,
|
| | | endDate: endDate,
|
| | | endWeek: endWeek,
|
| | | endLunar: endLunar
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | | };
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | @font-face {
|
| | | font-family: 'l-icons';
|
| | | src: url('data:font/ttf;charset=utf-8;base64,AAEAAAANAIAAAwBQRkZUTZa9XzsAAAjcAAAAHEdERUYAKQAOAAAIvAAAAB5PUy8yPDVJwwAAAVgAAABgY21hcMxRtw0AAAHUAAABYmdhc3D//wADAAAItAAAAAhnbHlm05h+ZAAAA0wAAAJ8aGVhZCQifFoAAADcAAAANmhoZWEHyAOSAAABFAAAACRobXR4EnYBLQAAAbgAAAAcbG9jYQKkAegAAAM4AAAAEm1heHABFgBMAAABOAAAACBuYW1lXoIBAgAABcgAAAKCcG9zdMeZtAYAAAhMAAAAaAABAAAAAQAA+jMzTF8PPPUACwQAAAAAAOCMnBkAAAAA4IycGQAA/6sD6gOAAAAACAACAAAAAAAAAAEAAAOA/4AAXAQLAAAAAAPqAAEAAAAAAAAAAAAAAAAAAAAGAAEAAAAIAEAABAAAAAAAAgAAAAoACgAAAP8AAAAAAAAABAQEAZAABQAAAokCzAAAAI8CiQLMAAAB6wAyAQgAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZADA5gDm8AOA/4AAAAPcAIAAAAABAAAAAAAAAAAAAAAgAAEEAAAAAAAAAAFVAAAECwAWBAsAHgQAAPkBCwAAAAAAAwAAAAMAAAAcAAEAAAAAAFwAAwABAAAAHAAEAEAAAAAMAAgAAgAE5gDmB+Yf5iPm8P//AADmAOYH5h/mI+bw//8aAxn9GeYZ4xkXAAEAAAAAAAAAAAAAAAAAAAEGAAABAAAAAAAAAAECAAAAAgAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAByAOAA9AEIAT4AAAAEABb/wQPiA0sAIQAkAD4APwAAAQYUFwEWHwE3Njc2JyYnJicBJwE2NzY3NicmJzEuAQYHCQE3ByU+ATc2JwEnNwE2Jy4BDwEGBw4BFwEWHwE3MQHuFhYBcRIZDAwvDQQDAwsFBf7IBQE3DgUJAgICAQQLLDET/o8BqAwM/kUbJwEBGf7HBgYBOhwGB1MiabFZFwEXAXESGAoJAbkWQxf+kBIEAgIKLQ8TDw4HBAE5BAE3DQgNDRINBQkYGAcT/o/+CAICAQIqGyIZATkEBQE6HCUsHh5psVgXRBf+kBIEAgEAAAAEAB7/tQPqAz8AIAAiADwAPQAAATY0JwEmLwEHBgcGFxYXFhcBFwEGBwYHBhcWFzEeATY3AwclDgEHBhcBFwcBBhceAT8BNjc+AScBJi8BBzECEhYW/o8SGQwMLw0EAwMLBQUBOAX+yQ4FCQICAgEECywxEzcMAccbJwEBGQE5Bgb+xhwGB1MiabFZFwEX/o8SGAoJAUcWQxcBcBIEAgIKLQ8TDw4HBP7HBP7JDQgNDRINBQkYGAcTA2kCAQIqGyIZ/scEBf7GHCUsHh5psVgXRBcBcBIEAgEAAAAAAQD5/68DSQOAAAUAADcXCQEHAflnAen+F2cBghZnAekB6Gf+fwAAAAEBC/+rAxgDVQAFAAAJARcJAQcBCwG9UP6JAWJRAYEB1Ez+dv52SgABAAD/sAPOA4AAGwAACQEWFAYiJwkBBiImNDcJASY0NjIXCQE2MhYUBwJPAWoVKzwW/pb+lhY8KxUBa/6VFSs8FgFqAWoWPCsVAZj+lRU9KxUBa/6VFSs9FQFrAWsVPSsV/pUBaxUrPRUAAAAAABIA3gABAAAAAAAAABMAKAABAAAAAAABAAgATgABAAAAAAACAAcAZwABAAAAAAADAAgAgQABAAAAAAAEAAgAnAABAAAAAAAFAAsAvQABAAAAAAAGAAgA2wABAAAAAAAKACsBPAABAAAAAAALABMBkAADAAEECQAAACYAAAADAAEECQABABAAPAADAAEECQACAA4AVwADAAEECQADABAAbwADAAEECQAEABAAigADAAEECQAFABYApQADAAEECQAGABAAyQADAAEECQAKAFYA5AADAAEECQALACYBaABDAHIAZQBhAHQAZQBkACAAYgB5ACAAaQBjAG8AbgBmAG8AbgB0AABDcmVhdGVkIGJ5IGljb25mb250AABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABSAGUAZwB1AGwAYQByAABSZWd1bGFyAABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABWAGUAcgBzAGkAbwBuACAAMQAuADAAAFZlcnNpb24gMS4wAABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABHAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAHMAdgBnADIAdAB0AGYAIABmAHIAbwBtACAARgBvAG4AdABlAGwAbABvACAAcAByAG8AagBlAGMAdAAuAABHZW5lcmF0ZWQgYnkgc3ZnMnR0ZiBmcm9tIEZvbnRlbGxvIHByb2plY3QuAABoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAABodHRwOi8vZm9udGVsbG8uY29tAAAAAAIAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAEAAgECAQMBBAEFAQYKeW91amlhbnRvdQt5b3VqaWFudG91MQt5b3VqaWFudG91Mgp6dW9qaWFudG91B3NoYW5jaHUAAAAB//8AAgABAAAADAAAABYAAAACAAEAAwAHAAEABAAAAAIAAAAAAAAAAQAAAADVpCcIAAAAAOCMnBkAAAAA4IycGQ==') format('truetype');
|
| | | font-weight: normal;
|
| | | font-style: normal;
|
| | | font-display: swap;
|
| | | }
|
| | |
|
| | | .l-icons {
|
| | | font-family: 'l-icons';
|
| | | font-size: 38rpx;
|
| | | color: #333333;
|
| | | font-style: normal;
|
| | | -webkit-font-smoothing: antialiased;
|
| | | -moz-osx-font-smoothing: grayscale
|
| | | }
|
| | |
|
| | | .icon-shanchu:before {
|
| | | content: "\e6f0";
|
| | | }
|
| | |
|
| | | .icon-youjiantou:before {
|
| | | content: "\e600";
|
| | | }
|
| | |
|
| | | .icon-zuojiantou:before {
|
| | | content: "\e623";
|
| | | }
|
| | |
|
| | | .icon-youjiantou1:before {
|
| | | content: "\e607";
|
| | | }
|
| | |
|
| | | .icon-youjiantou2:before {
|
| | | content: "\e61f";
|
| | | }
|
| | | |
| | | .l-calendar-box {
|
| | | width: 100%;
|
| | | position: fixed;
|
| | | left: 0;
|
| | | right: 0;
|
| | | bottom: 0;
|
| | | z-index: 9999;
|
| | | visibility: hidden;
|
| | | transform: translate3d(0, 100%, 0);
|
| | | transform-origin: center;
|
| | | transition: all 0.3s ease-in-out;
|
| | | min-height: 20rpx;
|
| | | |
| | | .calendar-top {
|
| | | width: 100%;
|
| | | height: 80rpx;
|
| | | padding: 0 40rpx;
|
| | | display: flex;
|
| | | justify-content: center;
|
| | | align-items: center;
|
| | | box-sizing: border-box;
|
| | | font-size: 30rpx;
|
| | | font-weight: bold;
|
| | | background-color: #fff;
|
| | | color: #333;
|
| | | position: relative;
|
| | | border-top-left-radius: 20rpx;
|
| | | border-top-right-radius: 20rpx;
|
| | | overflow: hidden;
|
| | | .close {
|
| | | position: absolute;
|
| | | right: 30rpx;
|
| | | top: 50%;
|
| | | transform: translateY(-50%);
|
| | | color: #999;
|
| | | |
| | | }
|
| | | }
|
| | | |
| | | .date-box {
|
| | | width: 100%;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | padding: 20rpx 0 30rpx;
|
| | | background-color: #fff;
|
| | | .date-arrowleft {
|
| | | margin-right: 32rpx;
|
| | | }
|
| | | |
| | | .date-arrowright {
|
| | | margin-left: 32rpx;
|
| | | }
|
| | | |
| | | .title-datetime {
|
| | | padding: 0 16rpx;
|
| | | color: #333;
|
| | | font-size: 30rpx;
|
| | | line-height: 30rpx;
|
| | | font-weight: bold;
|
| | | }
|
| | | }
|
| | | |
| | | .date-weekday {
|
| | | width: 100%;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | background-color: #fff;
|
| | | font-size: 24rpx;
|
| | | line-height: 24rpx;
|
| | | color: #555;
|
| | | box-shadow: 0 15rpx 20rpx -15rpx #efefef;
|
| | | position: relative;
|
| | | z-index: 2;
|
| | | .date-weekday-item {
|
| | | width: 14.2857%;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | padding: 12rpx 0;
|
| | | overflow: hidden;
|
| | | position: relative;
|
| | | z-index: 2;
|
| | | }
|
| | | }
|
| | | .date-content {
|
| | | width: 100%;
|
| | | display: flex;
|
| | | flex-wrap: wrap;
|
| | | padding: 12rpx 0;
|
| | | box-sizing: border-box;
|
| | | background-color: #fff;
|
| | | position: relative;
|
| | | align-content: flex-start;
|
| | | .date-weekday-item {
|
| | | width: 14.2857%;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | padding: 12rpx 0;
|
| | | overflow: hidden;
|
| | | position: relative;
|
| | | z-index: 2;
|
| | | |
| | | .date-content-item {
|
| | | width: 80rpx;
|
| | | height: 80rpx;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | flex-direction: column;
|
| | | font-size: 32rpx;
|
| | | line-height: 32rpx;
|
| | | position: relative;
|
| | | border-radius: 50%;
|
| | | background-color: transparent;
|
| | | .custom-desc {
|
| | | width: 100%;
|
| | | font-size: 24rpx;
|
| | | line-height: 24rpx;
|
| | | transform: scale(0.8);
|
| | | transform-origin: center center;
|
| | | text-align: center;
|
| | | }
|
| | | |
| | | }
|
| | | .date-content-item-desc {
|
| | | width: 100%;
|
| | | font-size: 24rpx;
|
| | | line-height: 24rpx;
|
| | | position: absolute;
|
| | | left: 0;
|
| | | transform: scale(0.8);
|
| | | transform-origin: center center;
|
| | | text-align: center;
|
| | | bottom: 8rpx;
|
| | | z-index: 2;
|
| | | }
|
| | | }
|
| | | .start-date {
|
| | | border-top-left-radius: 8rpx;
|
| | | border-bottom-left-radius: 8rpx;
|
| | | }
|
| | | |
| | | .end-date {
|
| | | border-top-right-radius: 8rpx;
|
| | | border-bottom-right-radius: 8rpx;
|
| | | }
|
| | | |
| | | .bg-mounth {
|
| | | position: absolute;
|
| | | font-size: 260rpx;
|
| | | line-height: 260rpx;
|
| | | left: 50%;
|
| | | top: 50%;
|
| | | transform: translate(-50%, -50%);
|
| | | color: #f5f5f7;
|
| | | z-index: 1;
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | .calendar-text {
|
| | | width: 100%;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | flex-direction: column;
|
| | | background-color: #fff;
|
| | | padding: 0 42rpx env(safe-area-inset-bottom);
|
| | | box-sizing: border-box;
|
| | | font-size: 24rpx;
|
| | | color: #666;
|
| | | .calendar-result {
|
| | | height: 48rpx;
|
| | | transform: scale(0.9);
|
| | | transform-origin: center 100%;
|
| | | }
|
| | | |
| | | .calendar-btn {
|
| | | width: 100%;
|
| | | |
| | | button {
|
| | | background-color: #305ED5;
|
| | | color: #fff;
|
| | | height: 72rpx;
|
| | | line-height: 72rpx;
|
| | | font-size: 32rpx
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | | }
|
| | | .mask {
|
| | | position: fixed;
|
| | | top: 0;
|
| | | left: 0;
|
| | | right: 0;
|
| | | bottom: 0;
|
| | | background: rgba(0, 0, 0, 0.6);
|
| | | z-index: 9996;
|
| | | transition: all 0.3s ease-in-out;
|
| | | opacity: 0;
|
| | | visibility: hidden;
|
| | | }
|
| | | |
| | | .mask-show {
|
| | | opacity: 1;
|
| | | visibility: visible;
|
| | | }
|
| | |
|
| | | /* @font-face {
|
| | | font-family: 'tuiDateFont';
|
| | | src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAVgAA0AAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAFRAAAABoAAAAci0/w50dERUYAAAUkAAAAHgAAAB4AKQANT1MvMgAAAaAAAABDAAAAVjxuSNNjbWFwAAAB+AAAAEoAAAFS5iPQt2dhc3AAAAUcAAAACAAAAAj//wADZ2x5ZgAAAlQAAAFHAAABvPf29TBoZWFkAAABMAAAADAAAAA2GMsN3WhoZWEAAAFgAAAAHQAAACQHjAOFaG10eAAAAeQAAAATAAAAFgzQAPJsb2NhAAACRAAAABAAAAAQAOoBSG1heHAAAAGAAAAAHgAAACABEwA3bmFtZQAAA5wAAAFJAAACiCnmEVVwb3N0AAAE6AAAADQAAABLUwjqHHjaY2BkYGAAYp5Gj5/x/DZfGbhZGEDg1tUn7+F00P/LzOuY9YFcDgYmkCgAa0gNlHjaY2BkYGBu+N/AEMPCAALM6xgYGVABCwBT4AMaAAAAeNpjYGRgYGBn0GZgYgABEMkFhAwM/8F8BgANaAFLAAB42mNgZGFgnMDAysDA1Ml0hoGBoR9CM75mMGLkAIoysDIzYAUBaa4pDA7PGJ49ZG7438AQw9zA0AAUZgTJAQDrcAy8AHjaY2GAABYIDgLCBQx1AAcEAc8AeNpjYGBgZoBgGQZGBhDwAfIYwXwWBgMgzQGETAwMzxifcTx7+P8/kMUAYUkxS/6VVIXqAgNGNgY4lxGoB6QPBTAyDHsAADDkDYkAAAAAAAAAAAAAADQAagC2AN542m2QsU7DMBCG/Tt1bNPUiUnkSgiVtqKpxJAgVLVbeAa6MaK+B4JXgJWBjY21UtW5gpkdMTFX7dzApaJLhXU6n8+n//ttxtn458N79XJWZ8eMxS00C4wy9A1EP8PQncAlIQzS4WgsVtPpSmwzV3OFRqLetH5TSQMK939X61ptPZ2p2EAttNMLBRMrtschQblDeS34aY50cIkCzg/B2Y5C+VpyQxhFkRgu515O8jvU5mmPM2O0wJ5Z27vhX+yMsV437WvCdTM+GI40MgwKfuGammC0uURqeqFMfe9cxaJclkt5GMaB1hIR1VobOgpEiKq+sLZcIrJWhO3/Jw7qWlYj1Jf21FaCtmd5bevrlk28O/7A4spXTl4KTh9MTlqQ8PESBRstReic+sRj0Dni9fIqmNS/pXNWCvWOeYBmx5S9Bsn9Ah+5WtAAeNp9kD1OAzEQhZ/zByQSQiCoXVEA2vyUKRMp9Ailo0g23pBo1155nUg5AS0VB6DlGByAGyDRcgpelkmTImvt6PObmeexAZzjGwr/3yXuhBWO8ShcwREy4Sr1F+Ea+V24jhY+hRvUf4SbuFUD4RYu1BsdVO2Eu5vSbcsKZxgIV3CKJ+Eq9ZVwjfwqXMcVPoQb1L+EmxjjV7iFa2WpDOFhMEFgnEFjig3jAjEcLJIyBtahOfRmEsxMTzd6ETubOBso71dilwMeaDnngCntPbdmvkon/mDLgdSYbh4FS7YpjS4idCgbXyyc1d2oc7D9nu22tNi/a4E1x+xRDWzU/D3bM9JIbAyvkJI18jK3pBJTj2hrrPG7ZynW814IiU68y/SIx5o0dTr3bmniwOLn8owcfbS5kj33qBw+Y1kIeb/dTsQgil2GP5PYcRkAAAB42mNgYoAALjDJyIAO2MGiTIxMjMyMLIys7GmJeRmlmWZQ2pQ5OSORLaU0Mz2/FACDfwlbAAAAAf//AAIAAQAAAAwAAAAWAAAAAgABAAMABgABAAQAAAACAAAAAHjaY2BgYGQAgqtL1DlA9K2rT97DaABNlwiuAAA=) format('woff');
|
| | | font-weight: normal;
|
| | | font-style: normal;
|
| | | }
|
| | |
|
| | | .tui-iconfont {
|
| | | font-family: 'tuiDateFont' !important;
|
| | | font-size: 36rpx;
|
| | | font-style: normal;
|
| | | -webkit-font-smoothing: antialiased;
|
| | | -moz-osx-font-smoothing: grayscale;
|
| | | }
|
| | |
|
| | | .tui-font-close:before {
|
| | | content: '\e608';
|
| | | }
|
| | |
|
| | | .tui-font-check:before {
|
| | | content: '\e6e1';
|
| | | }
|
| | |
|
| | | .date-arrowright:before {
|
| | | content: '\e600';
|
| | | }
|
| | |
|
| | | .date-arrowleft:before {
|
| | | content: '\e601';
|
| | | } */
|
| | |
|
| | | |
| | | // .calendar-radius {
|
| | | // border-top-left-radius: 20rpx;
|
| | | // border-top-right-radius: 20rpx;
|
| | | // overflow: hidden;
|
| | | // }
|
| | |
|
| | | |
| | |
|
| | | |
| | |
|
| | | |
| | |
|
| | | |
| | |
|
| | |
|
| | | |
| | |
|
| | | |
| | |
|
| | |
|
| | | |
| | |
|
| | | |
| | |
|
| | | .tui-btn-calendar {
|
| | | padding: 16rpx;
|
| | | box-sizing: border-box;
|
| | | text-align: center;
|
| | | text-decoration: none;
|
| | | }
|
| | |
|
| | | .l-opacity {
|
| | | opacity: 0.5;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | .calendar-box-show {
|
| | | transform: translate3d(0, 0, 0);
|
| | | visibility: visible;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | |
| | |
|
| | |
|
| | |
|
| | | |
| | |
|
| | | // .tui-lunar-unshow {
|
| | | // position: absolute;
|
| | | // left: 0;
|
| | | // bottom: 8rpx;
|
| | | // z-index: 2;
|
| | | // }
|
| | |
|
| | | |
| | |
|
| | | |
| | |
|
| | | |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "id": "l-calendar", |
| | | "displayName": "æ¥å æ¥æéæ© éæ©å¹´ææ¥", |
| | | "version": "1.0.3", |
| | | "description": "æ¥å æ¥æéæ© éæ©å¹´ææ¥ ä»
æµè¿å°ç¨åºå
¶ä»èªæµ", |
| | | "keywords": [ |
| | | "æ¥å", |
| | | "æ¥æéæ©", |
| | | "éæ©å¹´ææ¥", |
| | | "å¹´ææ¥", |
| | | "l-calendar" |
| | | ], |
| | | "repository": "", |
| | | "engines": { |
| | | }, |
| | | "dcloudext": { |
| | | "type": "component-vue", |
| | | "sale": { |
| | | "regular": { |
| | | "price": "0.00" |
| | | }, |
| | | "sourcecode": { |
| | | "price": "0.00" |
| | | } |
| | | }, |
| | | "contact": { |
| | | "qq": "" |
| | | }, |
| | | "declaration": { |
| | | "ads": "æ ", |
| | | "data": "æä»¶ä¸éé任使°æ®", |
| | | "permissions": "æ " |
| | | }, |
| | | "npmurl": "" |
| | | }, |
| | | "uni_modules": { |
| | | "dependencies": [], |
| | | "encrypt": [], |
| | | "platforms": { |
| | | "cloud": { |
| | | "tcb": "y", |
| | | "aliyun": "y" |
| | | }, |
| | | "client": { |
| | | "Vue": { |
| | | "vue2": "y", |
| | | "vue3": "y" |
| | | }, |
| | | "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", |
| | | "éé": "y", |
| | | "å¿«æ": "y", |
| | | "é£ä¹¦": "y", |
| | | "京ä¸": "y" |
| | | }, |
| | | "å¿«åºç¨": { |
| | | "å为": "y", |
| | | "èç": "y" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # l-calendar
|
| | |
|
| | | # ## ä½¿ç¨æ¹æ³ |
| | | é
ç½®easycomè§ååï¼èªå¨æéå¼å
¥ï¼æ é`import`ç»ä»¶ï¼ç´æ¥å¼ç¨å³å¯ã |
| | | |
| | | ```html |
| | | <template> |
| | | <l-calendar v-model="show" @change="change" :isRange="true"></l-calendar> |
| | | </template> |
| | | ``` |
| | | ## ç»ä»¶å±æ§
|
| | |
|
| | | | 屿§ | ç±»å | é»è®¤å¼ | 说æ |
|
| | | |:---:|:---:|:---:|---|
|
| | | | value | Boolean | false | v-module ååç»å®çå¼ |
|
| | | | isRange | Boolean | false | æ¯å¦éæ©èå´ trueæ¯ falseéæ©åä¸ªæ¥æ |
|
| | | | maxYear | Number | 2100 | å¯åæ¢æå¤§å¹´ä»½ |
|
| | | | minYear | Number | 1920 | å¯åæ¢æå°å¹´ä»½ |
|
| | | | minDate | String | '1920-01-01' | æå°å¯éæ¥æ ä¸å¨èå´å
æ¥æç¦é |
|
| | | | maxDate | String | '2100-1-1' | æå¤§å¯éæ¥æ ä¸å¨èå´å
æ¥æç¦é |
|
| | | | title | String | 'æ¥æéæ©' | ç»ä»¶æ é¢ |
|
| | | | monthChangeColor | String | #999 | æä»½åæ¢ç®å¤´é¢è² |
|
| | | | yearChangeColor | String | '#bfbfbf' | 年份忢ç®å¤´é¢è² |
|
| | | | color | String | #333 | é»è®¤æ¥æåä½é¢è² |
|
| | | | activeColor | String | '#fff' | é䏿¥æåä½é¢è² |
|
| | | | activeBgColor | String | '#55BBF9' | é䏿¥æèæ¯è² |
|
| | | | rangeBgColor | String | rgba(85, 187, 249, 0.1) | èå´å
æ¥æèæ¯è² |
|
| | | | startText | String | å¼å§ | èå´éæ©æ¶çæ å¼å§æ¥æèªå®ä¹æå |
|
| | | | endText | String | ç»æ | èå´éæ©æ¶çæ ç»ææ¥æèªå®ä¹æå |
|
| | | | lunar | Boolean | true | æ¯å¦æ¾ç¤ºåå |
|
| | | | initStartDate | String | '' | åå§åå¼å§é䏿¥æ æ ¼å¼ï¼ 2020-06-06 æ 2020/06/06 |
|
| | | | initEndDate | String | '' | åå§åå¼å§é䏿¥æ æ ¼å¼ï¼ 2020-06-06 æ 2020/06/06 |
|
| | |
|
| | |
|
| | | ## ç»ä»¶äºä»¶
|
| | |
|
| | | | åç§° | è§¦åæ¶æº |
|
| | | |:---:|---|
|
| | | | change | ç¹å»ç¡®å®æé®éæ©æ¥æ |
|
| | |
|