wjt
2024-06-21 07401392be0115d291e64471325fcc4c17ba2be9
图片压缩
7个文件已添加
1个文件已删除
20个文件已修改
2348 ■■■■■ 已修改文件
api/auth.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/policy.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/http.interceptor.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/customerForm.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/lingfeng-timepicker/lingfeng-timepicker.vue 980 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/lingfeng-timepicker/uitls/util.js 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/companyLogin/companyLogin.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
policy/applyRecord/applyRecord.vue 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
policy/applyRecordDetails/applyRecordDetails.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
policy/components/index.vue 124 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
policy/components/mine.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
policy/policyApply/perPage.vue 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
policy/policyApply/policyApply.vue 152 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
policy/policyIndex/policyIndex.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/head.png 补丁 | 查看 | 原始文档 | blame | 历史
static/i03.png 补丁 | 查看 | 原始文档 | blame | 历史
static/i04.png 补丁 | 查看 | 原始文档 | blame | 历史
static/policy/back.png 补丁 | 查看 | 原始文档 | blame | 历史
static/policy/qrcode-border.png 补丁 | 查看 | 原始文档 | blame | 历史
static/policy/zhi1.png 补丁 | 查看 | 原始文档 | blame | 历史
static/policy/zhi2.png 补丁 | 查看 | 原始文档 | blame | 历史
static/policy/zhi3.png 补丁 | 查看 | 原始文档 | blame | 历史
static/policy/zhi4.png 补丁 | 查看 | 原始文档 | blame | 历史
static/policy/zhi5.png 补丁 | 查看 | 原始文档 | blame | 历史
uni_modules/yt-dateTimePicker/changelog.md 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
uni_modules/yt-dateTimePicker/components/yt-dateTimePicker/yt-dateTimePicker.vue 339 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
uni_modules/yt-dateTimePicker/package.json 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
uni_modules/yt-dateTimePicker/readme.md 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/auth.js
@@ -25,3 +25,7 @@
export function getCompanyInfo(data) {
    return http.get(`/system/company/${data.companyId}`, {params: data});
}
// 查询惠企政策
export function docList(data) {
    return http.get(`/system/doc/list`, {params: data});
}
api/policy.js
@@ -8,4 +8,23 @@
// 查询企业 
export function companyList(data){
    return http.get('/system/company/list', {params: data}, { custom: { loading: true }});
}
// 执法人员 /enforce/peer/list
export function enforceList(data) {
    return http.get('/enforce/order/peerList', {params: data}, { custom: { loading: true }});
}
// 申请记录
export function orderList(data) {
    return http.get('/enforce/order/list', {params: data}, { custom: { loading: true }});
}
// 获取执法单 详情 /enforce/order/{orderId}
export function orderDetails(data) {
    return http.get(`/enforce/order/${data.orderId}`, {params: data}, { custom: { loading: true }});
}
// 执法审批
export function checkLogList(data) {
    return http.get(`/enforce/check/log/list`, {params: data}, { custom: { loading: true }});
}
common/http.interceptor.js
@@ -60,7 +60,7 @@
                // vm.$u.vuex('userInfo', null)
                // vm.$u.vuex('token', null)
                // uni.removeStorageSync("sessionToken")
                uni.clearStorageSync() // 清楚所有的缓存
                // uni.clearStorageSync() // 清楚所有的缓存
                uni.showToast({
                    title: '授权过期,请重新登录',
                    icon: 'none',
components/customerForm.vue
File was deleted
components/lingfeng-timepicker/lingfeng-timepicker.vue
New file
@@ -0,0 +1,980 @@
<template>
    <uni-popup ref="popup" type="bottom" :safe-area="safeArea" @change="popChange">
        <view class="date-time-picker" v-if="showPopPicker">
            <!-- <view class="date-time-mask" @click.stop="hide"></view> -->
            <view class="date-time-container" :class="{'safe-area-padding':!safeArea}" @click.stop="handleEvent">
                <view class="time-picker-tool">
                    <view class="cancel-base" :class="[cancelButtonClass]" @click.stop="close">
                        <text>{{cancelButtonText}}</text>
                    </view>
                    <view :class="[toolBarTitleClass]">
                        <text>{{toolBarTitle}}</text>
                    </view>
                    <view class="confirm-base" :class="[confirmButtonClass]" @click.stop="confirm">
                        <text>{{confirmButtonText}}</text>
                    </view>
                </view>
                <view class="picker-tab" v-if="isShowRange">
                    <view @click="dateTabChange(1)" class="picker-tab-item" :style="[rangeBtnStyle,dateTab==1?rangeBtnActiveStyle:'']"
                    >{{pickerData.startTime}}</view>
                    至
                    <view @click="dateTabChange(2)" class="picker-tab-item" :style="[rangeBtnStyle,dateTab==2?rangeBtnActiveStyle:'']"
                    >{{pickerData.endTime}}</view>
                </view>
                <picker-view class="picker-view" :indicator-style="popupIndicatorStyleString" :value="dateTime" @change="dateTimePickerChange">
                    <picker-view-column data-id='year' v-if='isShowYear'>
                        <view class="item" v-for="(item,index) in years" :key="index">{{item}}年</view>
                    </picker-view-column>
                    <picker-view-column data-id='month' v-if='isShowMonth'>
                        <view class="item" v-for="(item,index) in months" :key="index">{{item}}月</view>
                    </picker-view-column>
                    <picker-view-column data-id='day' v-if='isShowDay'>
                        <view class="item" v-for="(item,index) in days" :key="index">{{item}}日</view>
                    </picker-view-column>
                    <picker-view-column data-id='hour' v-if='isShowHour'>
                        <view class="item" v-for="(item,index) in hours" :key="index">{{item}}时</view>
                    </picker-view-column>
                    <picker-view-column data-id='minute' v-if='isShowMinute'>
                        <view class="item" v-for="(item,index) in minutes" :key="index">{{item}}分</view>
                    </picker-view-column>
                    <picker-view-column data-id='second' v-if='isShowSecond'>
                        <view class="item" v-for="(item,index) in seconds" :key="index">{{item}}秒</view>
                    </picker-view-column>
                    <picker-view-column data-id='week' v-if='isShowWeek'>
                        <view class="item" v-for="(item,index) in weeks" :key="index">{{item}}</view>
                    </picker-view-column>
                    <picker-view-column data-id='quarter' v-if='isShowQuarter'>
                        <view class="item" v-for="(item,index) in quarters" :key="index">{{item}}</view>
                    </picker-view-column>
                </picker-view>
            </view>
        </view>
    </uni-popup>
</template>
<script>
    import {
        getOneMonthDays,
        getTimeArray,
        addZero,
        removeZero,
        getIndexOfArray,
        getQuarterArray,
        isOnlyTime,
        isRange,
        getTotalWeeks,
        getFirstAndLastDate
    } from './uitls/util.js'
    const [year, month, date, hour, minute, second]=getTimeArray(new Date());
    export default {
        name: 'TimePicker',
        props: {
            minDate: { //最小选择时间
                type: Object,
                default: function() {
                    return {
                        year: 1970,
                        month: 1,
                        date: 1,
                        hour:0,
                        minute:0,
                        second:0
                    }
                }
            },
            maxDate: { //最大选择时间
                type: Object,
                default: function() {
                    return {
                        year,
                        month,
                        date,
                        hour:23,
                        minute:59,
                        second:59
                    }
                }
            },
            type: {
                /**
                 * date 年月日
                 * year-month 年月
                 * year 年
                 * datetime 年月日 时分
                 * datetime-all 年月日 时分秒
                 * time 时分秒
                 * hour-minute 时分
                 * week 周
                 * quarter 季度
                 * year-range 年-范围
                 * year-month-range 年月-范围
                 * date-range 年月日-范围
                 * datetime-range 年月日 时分-范围
                 * datetime-all-range 年月日 时分秒-范围
                 * time-range 时分秒-范围
                 */
                type: String,
                default: 'date'
            },
            defaultData: {
                type: Object,
                default: function() {
                    return {
                        startTime: "", //默认开始日期/时间 yyyy-mm-dd (HH:MM:SS)
                        endTime: "", //默认结束日期/时间 yyyy-mm-dd (HH:MM:SS)
                        year: "", //默认年份        yyyy
                        month: "", //默认年-月份 yyyy-mm
                        week: "", //默认周 2020 第1周
                        quarter: "", //默认季度 2020 一季度
                    }
                }
            },
            popIindicatorStyle:{
                type: Object,
                default: null
            },
            rangeBtnStyle: { // 范围选择按钮样式
                type: Object,
                default: function(){
                    return {
                        color:'#666'
                    }
                }
            },
            rangeBtnActiveStyle: { // 范围选择按钮激活样式
                type: Object,
                default: function(){
                    return {
                        color:'#049bff',
                        borderColor:'#049bff'
                    }
                }
            },
            cancelButtonText: {
                type: String,
                default: '取消'
            },
            cancelButtonClass: {
                type: String,
                default: 'cancel-btn'
            },
            toolBarTitle: {
                type: String,
                default: ''
            },
            toolBarTitleClass: {
                type: String,
                default: 'tool-title'
            },
            confirmButtonText: {
                type: String,
                default: '确定'
            },
            confirmButtonClass: {
                type: String,
                default: 'confirm-btn'
            },
            safeArea: {
                type: Boolean,
                default: true
            },
            en: {
                type: Boolean,
                default: false
            },
            weekType:{
                type:String,
                default:'firstWeek' // firstWeek fullWeek firstDay
            }
        },
        data() {
            return {
                showPicker: false,
                showPopPicker: false,
                dateTab: 1,
                popupIndicatorStyleString:"",
                dateTime: [],//picker-view-column 选中的值
                lastDateTime: [],//选中的时间,小于10的数不加0
                days: [],//可选的日列表
                months: [],//可选的月列表
                quarters: getQuarterArray(1, 12),//可选的季度列表
                weeks: [], //可选的周列表
                hours: [], //可选的时列表
                minutes: [], //可选的分列表
                seconds: [], //可选的秒列表
                datestring: "",//选中的时间,格式化后的展示
                allQuarter: [{
                        name: "一季度",
                        start: "01-01",
                        end: "03-31"
                    },
                    {
                        name: "二季度",
                        start: "04-01",
                        end: "06-30"
                    },
                    {
                        name: "三季度",
                        start: "07-01",
                        end: "09-30"
                    },
                    {
                        name: "四季度",
                        start: "10-01",
                        end: "12-31"
                    }
                ],
                pickerData: {
                    startTime: "",
                    endTime: "",
                    month: "",
                    quarter: "",
                    year: ""
                }
            };
        },
        methods: {
            showPop() {
                this.dateTab = 1;
                this.getPopIndicatorStyle();
                this.showPopPicker = true;
                this.tempTime = new Date().getTime();
                this.$refs.popup.open();
            },
            close() {
                this.$emit('close');
                this.showPopPicker = false;
                this.$refs.popup.close();
                this.pickerData={
                    startTime: "",
                    endTime: "",
                    month: "",
                    quarter: "",
                    year: ""
                }
                this.lastDateTime=[];
            },
            dateTabChange(i) {
                if (this.dateTab == i) {
                    return;
                }
                this.dateTab = i;
                this.datestring = i == 2 ? this.pickerData.endTime : this.pickerData.startTime;
                this.initDateTime();
                this.tempTime = new Date().getTime();
            },
            dateTimePickerChange(e) {
                if(new Date().getTime()-this.tempTime < 100){
                    //dateTimePickerChange 小程序端有时点击dateTabChange就触发了change
                    // console.log("无效滚动")
                    return;
                }
                this.tempTime = new Date().getTime();
                let columns = [...e.target.value];
                let currentDateList=[];
                if (isOnlyTime(this.type)) {
                    currentDateList = [this.hours[columns[0]],this.minutes[columns[1]],this.seconds[columns[2]]];
                    let tag = 2;
                    if(currentDateList[1]!=this.lastDateTime[1]){
                        tag = 3;
                    }
                    let minTag = currentDateList[0] == this.realMinDate.hour;
                    let maxTag = currentDateList[0] == this.realMaxDate.hour;
                    if(tag > 2) {
                        minTag = minTag && currentDateList[1] == this.realMinDate.minute;
                        maxTag = maxTag && currentDateList[1] == this.realMaxDate.minute;
                    }
                    this.getHMSColumnsData(currentDateList, this.lastDateTime, tag, minTag, maxTag);
                } else if (this.type === "week") {
                    if (this.lastDateTime[0] != this.years[columns[0]]) {
                        this.getWeeks(this.years[columns[0]]);
                    }
                } else if (this.type === "quarter") {
                    if (this.lastDateTime[0] != this.years[columns[0]]) {
                        if (columns[0] == 0) {
                            this.quarters = getQuarterArray(this.realMinDate.month, 12);
                        } else if (columns[0] == this.years.length - 1) {
                            this.quarters = getQuarterArray(1, this.realMaxDate.month);
                        } else {
                            this.quarters = getQuarterArray(1, 12);
                        }
                    }
                } else {
                    currentDateList=[this.years[columns[0]],this.months[columns[1]],this.days[columns[2]],this.hours[columns[3]],this.minutes[columns[4]],this.seconds[columns[5]]];
                    this.getColumnsData(currentDateList, this.lastDateTime);
                }
                setTimeout(() => {
                    if (this.type === "week") {
                        if (this.lastDateTime[0] != this.years[columns[0]]) {
                            let index = columns[1];
                            index = this.weeks.findIndex(val => val == this.lastDateTime[1]);
                            if (index < 0) {
                                index = columns[0] == 0 ? 0 : this.weeks.length - 1;
                            }
                            columns.splice(1, 1, index)
                        }
                    } else if (this.type === "quarter") {
                        if (this.lastDateTime[0] != this.years[columns[0]]) {
                            let index = columns[1];
                            index = this.quarters.findIndex(val => val == this.lastDateTime[1]);
                            if (index < 0) {
                                index = columns[0] == 0 ? 0 : this.quarters.length - 1;
                            }
                            columns.splice(1, 1, index)
                        }
                    } else {
                        let names = ['year', 'month', 'day', 'hour', 'minute', 'second'];
                        if (isOnlyTime(this.type)){
                            names=names.slice(3);
                        }
                        const arr = [];
                        let i = 1;
                        while(i < currentDateList.length && currentDateList[i] != undefined) {
                            const colName = names[i] + 's';
                            let index = this[colName].findIndex(val => val == currentDateList[i]);
                            if (index < 0) {
                                index = currentDateList[i] <= this[colName][0] ? 0 : this[colName].length - 1;
                            }
                            arr.push(index);
                            i++;
                        }
                        columns.splice(1, columns.length-1, ...arr);
                    }
                    columns.forEach((column, index) => {
                        this.dateTime.splice(index, 1, column);
                    })
                    this.formatDate();
                },50)
            },
            formatDate() {//选中的时间记录 及格式化
                let names = ['year', 'month', 'day', 'hour', 'minute', 'second'];
                let dateString, formatDateArray = [];
                if (['date','year','year-month','year-range','year-month-range','date-range'].includes(this.type)) {
                    formatDateArray = this.dateTime.map((item, index) => {
                        let num=this[names[index] + 's'][item] ? this[names[index] + 's'][item] : this[names[index] + 's'][this[names[index] + 's'].length-1];
                        return  addZero(num);
                    })
                    dateString = formatDateArray.join('-');
                } else if (isOnlyTime(this.type)) {
                    names = names.splice(3);
                    formatDateArray = this.dateTime.map((item, index) => {
                        return addZero(this[names[index] + 's'][item]);
                    })
                    dateString = formatDateArray.join(':');
                } else if (this.type === "week") {
                    dateString = this.years[this.dateTime[0]] + " " + this.weeks[this.dateTime[1]];
                } else if (this.type === "quarter") {
                    dateString = this.years[this.dateTime[0]] + " " + this.quarters[this.dateTime[1]];
                } else {
                    let name1 = names.splice(0, 3);
                    formatDateArray = this.dateTime.map((item, index) => {
                        if (index > 2) {
                            return addZero(this[names[index - 3] + 's'][item]);
                        } else {
                            return addZero(this[name1[index] + 's'][item]);
                        }
                    })
                    dateString = formatDateArray.splice(0, 3).join('-') + ' ' + formatDateArray.join(':');
                }
                if(['week','quarter'].includes(this.type)){
                    this.lastDateTime = dateString.split(/[-: ]/);
                }else{
                    let tempDate = [];
                    dateString.split(/[-: ]/).forEach((val) => {
                        tempDate.push(parseInt(removeZero(val)));
                    })
                    this.lastDateTime = tempDate;
                }
                switch (this.type) {
                    case "date":
                    case "datetime":
                    case "datetime-all":
                    case "time":
                    case "hour-minute":
                    case "year-range":
                    case "year-month-range":
                    case "date-range":
                    case "datetime-range":
                    case "datetime-all-range":
                    case "time-range":
                        if (this.dateTab == 2) {
                            this.pickerData.endTime = dateString;
                        } else {
                            this.pickerData.startTime = dateString;
                        };
                        break;
                    case "year-month":
                        this.pickerData.month = dateString;
                        break;
                    case "year":
                        this.pickerData.year = dateString;
                        break;
                    case "week":
                        this.pickerData.week = dateString;
                        break;
                    case "quarter":
                        this.pickerData.quarter = dateString;
                        break;
                }
                // this.$emit('change', dateString)
            },
            getPopIndicatorStyle() {
                if (this.popIindicatorStyle) {
                    for (let key in this.popIindicatorStyle) {
                        this.popupIndicatorStyleString += `${key}:${this.popIindicatorStyle[key]};`
                    }
                }
            },
            initDefaultDate() {//初始化起始时间
                const pickerData = {};
                Object.keys(this.defaultData).forEach(key=>{
                    pickerData[key] = this.defaultData[key];
                })
                let [y, m, d] = getTimeArray(new Date());
                if (this.type === 'year') {
                    pickerData.year=pickerData.year||y;
                    this.datestring = this.getDefaultYearMonth(pickerData.year,this.type);
                } else if (this.type === 'year-month') {
                    pickerData.month=pickerData.month||(y+'-'+addZero(m));
                    this.datestring = this.getDefaultYearMonth(pickerData.month,this.type);
                } else if (this.type === 'year-range') {
                    pickerData.startTime=pickerData.startTime||y;
                    pickerData.endTime=pickerData.endTime||y;
                    this.datestring = this.getDefaultYearMonth(pickerData.startTime,this.type);
                } else if (this.type === 'year-month-range') {
                    pickerData.startTime=pickerData.startTime||(y+'-'+addZero(m));
                    pickerData.endTime=pickerData.endTime||(y+'-'+addZero(m));
                    this.datestring = this.getDefaultYearMonth(pickerData.startTime,this.type);
                } else if (this.type === 'quarter') {
                    this.datestring = pickerData.quarter;
                } else if (this.type === 'week') {
                    this.datestring = pickerData.week;
                } else {
                    // 处理默认开始时间和结束时间
                    let startTime=isOnlyTime(this.type) ? y + "/" + m + "/" + d + " " + pickerData.startTime : pickerData.startTime;
                    startTime=this.getMinDate(startTime).replace(/-/g,"/");
                    pickerData.startTime = isNaN(Date.parse(startTime)) ? this.formatPickerData(new Date(),this.type) : this.formatPickerData(startTime,this.type);
                    if(isRange(this.type)){
                        let endTime=isOnlyTime(this.type) ? y + "/" + m + "/" + d + " " + pickerData.endTime : pickerData.endTime;
                        endTime=this.getMinDate(endTime).replace(/-/g,"/");
                        pickerData.endTime = isNaN(Date.parse(endTime)) ? this.formatPickerData(new Date(),this.type) : this.formatPickerData(endTime,this.type);
                    }
                    this.datestring = pickerData.startTime;
                }
                this.$nextTick(()=>{
                    Object.keys(pickerData).forEach(key=>{
                        this.pickerData[key] = pickerData[key];
                    })
                })
            },
            initDateTime() {//初始化picker-view选择的时间
                let value;
                if (this.datestring && this.datestring.length > 0) {
                    if (['year','year-range'].includes(this.type)) {
                        value = new Date(this.datestring, 0);
                    } else if (isOnlyTime(this.type)) {
                        let date = new Date();
                        let ary = this.datestring.split(':');
                        ary.forEach((item, index) => {
                            if (index == 0) {
                                date.setHours(item)
                            } else if (index == 1) {
                                date.setMinutes(item)
                            } else if (index == 2) {
                                date.setSeconds(item)
                            }
                        })
                        value = date;
                        const currentHMS = getTimeArray(value).slice(3);
                        const lastHMS = [-1, -1, -1];
                        this.getHMSColumnsData(currentHMS, lastHMS, 1, true, true);
                    } else if(['year-month','year-month-range'].includes(this.type)){
                        let datestring = this.datestring.replace(/-/g, '/');
                        value = isNaN(Date.parse(datestring)) ? new Date(datestring+'/01') : new Date(datestring);
                    } else {
                        value = new Date(this.datestring.replace(/-/g, '/'));
                    }
                } else {
                    value = new Date();
                }
                let len, timeArray, index;
                let array = ['week','quarter'].includes(this.type) ? this.datestring.split(" ") : getTimeArray(value);
                let [year, month, day, hour, minute, second] = array;
                if (this.isShowWeek) {
                    this.getWeeks(year?year:this.realMinDate.year);
                } else if(!isOnlyTime(this.type)){
                    this.getColumnsData(array);
                }
                let names = ['year', 'month', 'day', 'hour', 'minute', 'second'];
                switch (this.type) {
                    case "date":
                    case "time":
                    case "date-range":
                    case "time-range":
                        len = 3;
                        break;
                    case "year-month":
                    case "year-month-range":
                    case "hour-minute":
                    case "week":
                    case "quarter":
                        len = 2;
                        break;
                    case "year":
                    case "year-range":
                        len = 1;
                        break;
                    case "datetime":
                    case "datetime-range":
                        len = 5;
                        break;
                    case "datetime-all":
                    case "datetime-all-range":
                        len = 6;
                        break;
                }
                timeArray = new Array(len).fill(0);
                if (isOnlyTime(this.type)) {
                    names = names.slice(3);
                    array = array.slice(3);
                } else if (this.type === "week") {
                    names = ["year", "week"];
                } else if (this.type === "quarter") {
                    names = ["year", "quarter"];
                } else {
                    names = names.slice(0,len);
                    array = array.slice(0,len);
                }
                // setTimeout(() => {
                    timeArray = timeArray.map((item, index) => {
                        const name = names[index];
                        return getIndexOfArray(array[index], this[name + 's'])
                    })
                    this.dateTime = timeArray;
                    this.lastDateTime = array;
                    this.formatDate();
                // },100)
            },
            initTimeData(end, start) {//设置最大最小值
                let timeArray = [];
                while (start <= end) {
                    timeArray.push(start);
                    start++;
                }
                return timeArray;
            },
            getColumnsData(currentDateList, lastDateTime=[-1,-1,-1,-1,-1,-1]){
                let min='';
                let max='';
                let minTag=false;
                let maxTag=false;
                let currentYear=currentDateList[0];
                let currentMonth=currentDateList[1];
                let currentDate=currentDateList[2];
                let currentHMS=currentDateList.slice(3);
                let lastHMS=lastDateTime.slice(3);
                if(this.isShowMonth || this.isShowQuarter){
                    if(currentYear==this.realMinDate.year){
                        minTag=true;
                    }
                    if (currentYear == this.realMaxDate.year){
                        maxTag=true;
                    }
                    if(currentYear!=lastDateTime[0]){
                        min=1;
                        max=12;
                        if (minTag){
                            min=this.realMinDate.month;
                            currentMonth=currentMonth<min?min:currentMonth;
                        }
                        if (maxTag){
                            max=this.realMaxDate.month;
                            currentMonth=currentMonth>max?max:currentMonth;
                        }
                        this.isShowMonth && (this.months = this.initTimeData(max, min));
                        this.isShowQuarter && (this.quarters = getQuarterArray(min, max));
                    }
                }
                if(this.isShowDay){
                    minTag=minTag&&currentMonth == this.realMinDate.month;
                    maxTag=maxTag&&currentMonth == this.realMaxDate.month;
                    if(currentMonth!=lastDateTime[1]||max){
                        min=1;
                        max=getOneMonthDays(currentYear, currentMonth-1);
                        if (minTag){
                            min=this.realMinDate.date;
                            currentDate=currentDate<min?min:currentDate;
                        }
                        if (maxTag){
                            max=this.realMaxDate.date;
                            currentDate=currentDate>max?max:currentDate;
                        }
                        this.days = this.initTimeData(max, min);
                    }
                }
                if(this.isShowHour){
                    // 判断时分秒列表是否需要重新赋值
                    let tag=0;
                    if(currentHMS[1]!=lastDateTime[4]){
                        tag=3;
                    }
                    if(currentHMS[0]!=lastDateTime[3]){
                        tag=2;
                    }
                    if(max||currentDate!=lastDateTime[2]){
                        tag=1;
                    }
                    minTag=minTag&&currentDate==this.realMinDate.date;
                    maxTag=maxTag&&currentDate==this.realMaxDate.date;
                    if(tag>1){
                        minTag=minTag&&currentHMS[0]==this.realMinDate.hour;
                        maxTag=maxTag&&currentHMS[0]==this.realMaxDate.hour;
                    }
                    if(tag>2){
                        minTag=minTag&&currentHMS[1]==this.realMinDate.minute;
                        maxTag=maxTag&&currentHMS[1]==this.realMaxDate.minute;
                    }
                    this.getHMSColumnsData(currentHMS, lastHMS, tag, minTag, maxTag);
                }
            },
            getHMSColumnsData(currentHMS, lastHMS, tag, minTag, maxTag){
                let [currentHour, currentMinute, currentSecond] = currentHMS;
                let min="";
                let max="";
                if(tag==1){
                    min=0;
                    max=23;
                    if(minTag){
                        min=this.realMinDate.hour;
                        currentHour=currentHour<min?min:currentHour;
                    }
                    if(maxTag){
                        max=this.realMaxDate.hour;
                        currentHour=currentHour>max?max:currentHour;
                    }
                    this.hours = this.initTimeData(max, min);
                    tag=2;
                }
                if(tag==2){
                    minTag=minTag&&currentHour==this.realMinDate.hour;
                    maxTag=maxTag&&currentHour==this.realMaxDate.hour;
                    min=0;
                    max=59;
                    if(minTag){
                        min=this.realMinDate.minute;
                        currentMinute=currentMinute<min?min:currentMinute;
                    }
                    if(maxTag){
                        max=this.realMaxDate.minute;
                        currentMinute=currentMinute>max?max:currentMinute;
                    }
                    this.minutes = this.initTimeData(max, min);
                    tag=3;
                }
                if(tag=3){
                    minTag=minTag&&currentMinute==this.realMinDate.minute;
                    maxTag=maxTag&&currentMinute==this.realMaxDate.minute;
                    min=0;
                    max=59;
                    if(minTag){
                        min=this.realMinDate.second;
                    }
                    if(maxTag){
                        max=this.realMaxDate.second;
                    }
                    this.seconds = this.initTimeData(max, min);
                }
            },
            getWeeks(year){
                let startDate = year + '/01/01', endDate = year + '/12/31';
                if(year<=this.realMinDate.year){
                    startDate = this.realMinDate.year + '/' + addZero(this.realMinDate.month) + '/' + addZero(this.realMinDate.date);
                }
                if(year>=this.realMaxDate.year){
                    endDate = this.realMaxDate.year + '/' + addZero(this.realMaxDate.month) + '/' + addZero(this.realMaxDate.date);
                }
                const [start, end] = getTotalWeeks(startDate, endDate, this.en, this.weekType);
                this.weeks = this.initTimeData(end, start).map(item=>`第${item}周`);
            },
            getWeekDate(){
                let [year, w] = this.pickerData.week.split(" ");
                let week = w.slice(1, - 1);
                let { start, end } = getFirstAndLastDate(year, week, this.en, this.weekType);
                start = this.formatPickerData(this.getMinDate(start),'date');
                end = this.formatPickerData(this.getMAxDate(end),'date');
                return [this.pickerData.week, start, end];
            },
            getQuarterDate(){
                let [y, q] = this.pickerData.quarter.split(" ");
                let index = getIndexOfArray(q, this.allQuarter, "name");
                let start = y + "-" + this.allQuarter[index].start;
                let end = y + "-" + this.allQuarter[index].end;
                start = this.formatPickerData(this.getMinDate(start),'date');
                end = this.formatPickerData(this.getMAxDate(end),'date');
                return [this.pickerData.quarter,start, end];
            },
            getMinDate(date){
                let defaultMInArr=[1970,1,1,0,0,0];
                let minDate = `${this.realMinDate.year||defaultMInArr[0]}/${this.realMinDate.month||defaultMInArr[1]}/${this.realMinDate.date||defaultMInArr[2]} ${this.realMinDate.hour||defaultMInArr[3]}:${this.realMinDate.minute||defaultMInArr[4]}:${this.realMinDate.second||defaultMInArr[5]}`;
                let repDate=date.replace(/-/g,"/");
                let datetime=isNaN(Date.parse(repDate))?new Date().getTime():new Date(repDate).getTime();
                return datetime>new Date(minDate).getTime()?date:minDate.replace(/\//g,"-");
            },
            getMAxDate(date){
                let maxDate = `${this.realMaxDate.year}/${this.realMaxDate.month}/${this.realMaxDate.date} ${this.realMaxDate.hour}:${this.realMaxDate.minute}:${this.realMaxDate.second}`;
                let repDate=date.replace(/-/g,"/");
                let datetime=isNaN(Date.parse(repDate))?new Date().getTime():new Date(repDate).getTime();
                return datetime<new Date(maxDate).getTime()?date:maxDate;
            },
            getDefaultYearMonth(date,type){
                let minDate=['year','year-range'].includes(this.type)?this.realMinDate.year:(this.realMinDate.year+"-"+addZero(this.realMinDate.month));
                let maxDate=['year','year-range'].includes(this.type)?this.realMaxDate.year:(this.realMaxDate.year+"-"+addZero(this.realMaxDate.month));
                return date<minDate?minDate:date>maxDate?maxDate:date;
            },
            //popup
            show(){
                this.$nextTick(()=>{
                    this.initDefaultDate();
                    this.initDateTime();
                    this.showPop();
                })
            },
            handleEvent() {
                return;
            },
            confirm() {
                let val;
                switch (this.type){
                    case "date":
                    case "datetime":
                    case "datetime-all":
                    case "time":
                    case "hour-minute":
                        val = this.pickerData.startTime;
                        break;
                    case "year":
                        val = this.pickerData.year;
                        break;
                    case "year-month":
                        val = this.pickerData.month;
                        break;
                    case "week":
                        val = this.getWeekDate();
                        break;
                    case "quarter":
                        val = this.getQuarterDate();
                        break;
                    case "year-range":
                    case "year-month-range":
                    case "date-range":
                    case "datetime-range":
                    case "datetime-all-range":
                    case "time-range":
                        let start=this.pickerData.startTime;
                        let end=this.pickerData.endTime;
                        if(start>end){
                            val=[end,start];
                        }else{
                            val=[start,end];
                        }
                        break;
                    default:
                        break;
                }
                this.$emit("change",val)
                this.close();
            },
            popChange(val){
                if(!val.show){
                    this.$emit("close");
                    this.showPopPicker = false;
                    this.$parent.pageScrollFlag=true;
                }
            },
            formatPickerData(date,type){
                let [y, m, d, HH, MM, SS] = getTimeArray(new Date(date));
                m=addZero(m);
                d=addZero(d);
                HH=addZero(HH);
                MM=addZero(MM);
                SS=addZero(SS);
                switch (type){
                    case "date":
                    case "date-range":
                        return y + "-" + m + "-" + d;
                    case "datetime":
                    case "datetime-range":
                        return y + "-" + m + "-" + d + " " + HH + ":" + MM;
                    case "datetime-all":
                    case "datetime-all-range":
                        return y + "-" + m + "-" + d + " " + HH + ":" + MM + ":" + SS;
                    case "time":
                    case "time-range":
                        return HH + ":" + MM + ":" + SS;
                    case "hour-minute":
                        return HH + ":" + MM;
                    default:
                        return "";
                        break;
                }
            }
        },
        computed: {
            years() {//可选的年列表
                return this.initTimeData(this.realMaxDate.year, this.realMinDate.year);
            },
            isShowYear() {
                return !['time','hour-minute','time-range'].includes(this.type);
            },
            isShowMonth() {
                return !['year','time','hour-minute','week','quarter','year-range','time-range'].includes(this.type);
            },
            isShowDay() {
                return ['date','datetime','datetime-all','date-range','datetime-range','datetime-all-range'].includes(this.type);
            },
            isShowHour() {
                return !['date','year-month','year','week','quarter','year-range','year-month-range','date-range'].includes(this.type);
            },
            isShowRange() {
                return isRange(this.type);
            },
            isShowMinute() {
                return !['date','year-month','year','week','quarter','year-range','year-month-range','date-range'].includes(this.type);
            },
            isShowSecond() {
                return ['time','datetime-all','datetime-all-range','time-range'].includes(this.type);
            },
            isShowQuarter() {
                return this.type === 'quarter';
            },
            isShowWeek() {
                return this.type === 'week';
            },
            realMinDate(){
                return {
                    year: 1970,
                    month: 1,
                    date: 1,
                    hour:0,
                    minute:0,
                    second:0,
                    ...this.minDate
                }
            },
            realMaxDate(){
                return {
                    year,
                    month,
                    date,
                    hour:23,
                    minute:59,
                    second:59,
                    ...this.maxDate
                }
            }
        },
    }
</script>
<style lang="scss">
    // popup
    .date-time-picker {
        width: 100%;
        height: 40vh;
        border-top-right-radius: 10rpx;
        border-top-left-radius: 10rpx;
        .date-time-mask {
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: rgba($color: #000000, $alpha: .5);
            z-index: 998;
        }
        .date-time-container {
            width: 100%;
            height: 100%;
            border-top-right-radius: 10rpx;
            border-top-left-radius: 10rpx;
            box-sizing: border-box;
            padding-bottom: 20rpx;
            background-color: #f6f6f6;
            display: flex;
            flex-direction: column;
            .time-picker-tool {
                height: 80rpx;
                display: flex;
                align-items: center;
                justify-content: space-between;
                font-size: 32rpx;
                .cancel-base {
                    padding: 0 32rpx;
                    box-sizing: border-box;
                }
                .cancel-btn {
                    color: #969799;
                }
                .tool-title {
                    font-weight: 500;
                    font-size: 32rpx;
                    max-width: 50%;
                    overflow: hidden;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                }
                .confirm-base {
                    padding: 0 32rpx;
                    box-sizing: border-box;
                }
                .confirm-btn {
                    color: #049bff;
                }
            }
            .picker-view {
                width: 100%;
                flex: 1;
                .item {
                    font-size: 34rpx;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                }
            }
        }
        .safe-area-padding{
            padding-bottom: constant(safe-area-inset-bottom);
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
    .picker-tab{
        display: flex;
        justify-content: space-around;
        align-items: center;
        margin: 20rpx 0;
    }
    .picker-tab-item{
        box-sizing: border-box;
        width: 260rpx;
        text-align: center;
        padding: 4rpx 30rpx;
        border:2rpx solid #666;
        border-radius: 20rpx;
        font-size: 30rpx;
    }
</style>
components/lingfeng-timepicker/uitls/util.js
New file
@@ -0,0 +1,163 @@
/**
 * 获取某年某月有多少天
 */
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 = (data) => {
    const year = data.getFullYear();
    const month = data.getMonth() + 1;
    const date = data.getDate();
    const hour = data.getHours();
    const minute = data.getMinutes();
    const second = data.getSeconds();
    return [year, month, date, 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, weekType) => {
    if (weekType === 'firstDay') {
        return getFirstDayTotalWeeks(start, end, weekType)
    }
    //获取end当前周的第一天
    let endMon = getWeekFirstDate(new Date(end), en);
    //获取start当前周的第一天
    let startMon = getWeekFirstDate(new Date(start), en);
    let year = new Date(start).getFullYear();
    let firMon = getWeekFirstDate(new Date(year + '/01/01'), en);
    if (weekType === 'fullWeek') {
        if (new Date(startMon).getFullYear() != year) {
            let curTime = new Date(startMon);
            startMon = curTime.setDate(curTime.getDate() + 7);
        }
        if (new Date(firMon).getFullYear() != year) {
            let curTime = new Date(firMon);
            firMon = curTime.setDate(curTime.getDate() + 7);
        }
    }
    return getStartAndEndWeek(firMon, startMon, endMon, weekType);
}
/**
 * 获取当前周的第一天
 * 默认周一为第一天,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 时周日为第一天
 */
export const getFirstAndLastDate = (year, week, en, weekType) => {
    let firstDate = new Date(getWeekFirstDate(new Date(year + '/01/01'), en));
    if (weekType === 'fullWeek') {
        if (firstDate.getFullYear() != year) {
            firstDate.setDate(firstDate.getDate() + 7);
        }
    }
    if (weekType === 'firstDay') {
        firstDate = new Date(year + '/01/01');
    }
    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)}`;
    const end = `${ly}-${addZero(lm)}-${addZero(ld)}`;
    return {
        start,
        end
    };
}
function getStartAndEndWeek(first, start, end) {
    let d = Math.ceil((end.valueOf() - first.valueOf()) / 8.64e7) + 1;
    let endWeek = Math.ceil(d / 7);
    let startWeek = 1;
    if (start !== first) {
        let d = Math.ceil((start.valueOf() - first.valueOf()) / 8.64e7) + 1;
        startWeek = Math.ceil(d / 7);
    }
    return [startWeek, endWeek];
}
function getFirstDayTotalWeeks(start, end, weekType) {
    let year = new Date(start).getFullYear();
    let startTime = new Date(start).getTime();
    let endTime = new Date(end).getTime();
    let firstTime = new Date(year + '/01/01').getTime();
    return getStartAndEndWeek(firstTime, startTime, endTime, weekType)
}
pages/companyLogin/companyLogin.vue
@@ -24,7 +24,7 @@
                        手机号
                    </view>
                    <view class="form-input">
                        <input type="number"  placeholder="请输入11位手机号"/>
                        <input type="number"  v-model="form.phone"  placeholder="请输入11位手机号"/>
                    </view>
                </view>
                <view class="form-item">
@@ -32,7 +32,7 @@
                        验证码
                    </view>
                    <view class="form-input set-flex set-flex-content-between">
                        <input type="number" placeholder="请输入验证码"/>
                        <input type="number" v-model="form.code"  placeholder="请输入验证码"/>
                        <view @click="getCode">
                            <text class="driver"></text>
                            <text class="getcode">{{tips}}</text>
@@ -62,7 +62,7 @@
                form: {
                    phone: '',
                    code: '',
                    userType: ''
                    userType: '01'
                },
                loginToken: '',
                isSendCode: false,
policy/applyRecord/applyRecord.vue
@@ -2,13 +2,13 @@
    <view class="page-box">
        <u-sticky bgColor="white">
            <view class="set-search">
                <u-search placeholder="请输入申请记录关键词 "  shape="square" :showAction="false"></u-search>
                <u-search placeholder="请输入申请记录关键词 " @search="search" @blur="search" shape="square" :showAction="false"></u-search>
            </view>
            <view class="border"></view>
            <u-tabs :list="list1" @click="click" :scrollable="false" bgColor="white"></u-tabs>
            <u-tabs :list="list1" @click="click" :current="current" :scrollable="false" bgColor="white"></u-tabs>
        </u-sticky>
        <view class="list">
            <view class="list-item" @click="goReport">
            <view class="list-item" @click="goReport" v-for="(item,index) in dataList" :key="index">
                <view class="top-title">
                    <text>24年5月突击检查消防安全</text>
                    <text class="status">已结束</text>
@@ -34,80 +34,53 @@
                </view>
            </view>
            <view class="list-item">
                <view class="top-title">
                    <text>24年5月突击检查消防安全</text>
                    <text class="status">已结束</text>
                </view>
                <view class="user-info">
                    <text>王思雨</text>
                    <view class="driver"></view>
                    <text>执法一大队</text>
                </view>
                <view class="set-line">
                    <text>执法对象:</text>河南觉醒科技有限公司
                </view>
                <view class="line"></view>
                <view class="set-flex set-start set-flex-content-between">
                    <view>
                        <view class="set-line1">
                            <text>执法时间:</text>2024-05-12 12:00
                        </view>
                        <view class="set-line1">
                            <text>申请时间:</text>2024-05-12 12:00:12
                        </view>
                    </view>
                </view>
            </view>
            <view class="list-item">
                <view class="top-title">
                    <text>24年5月突击检查消防安全</text>
                    <text class="status">已结束</text>
                </view>
                <view class="user-info">
                    <text>王思雨</text>
                    <view class="driver"></view>
                    <text>执法一大队</text>
                </view>
                <view class="set-line">
                    <text>执法对象:</text>河南觉醒科技有限公司
                </view>
                <view class="line"></view>
                <view class="set-flex set-start set-flex-content-between">
                    <view>
                        <view class="set-line1">
                            <text>执法时间:</text>2024-05-12 12:00
                        </view>
                        <view class="set-line1">
                            <text>申请时间:</text>2024-05-12 12:00:12
                        </view>
                    </view>
                </view>
            </view>
             <u-empty v-if="!dataList.length"></u-empty>
        </view>
    </view>
</template>
<script>
    import { orderList } from '@/api/policy.js'
    export default {
        data() {
            return {
                current: 0,
                list1: [{
                    name: '全部',
                    value: ''
                }, {
                    name: '待审批',
                    value: 1
                }, {
                    name: '待执行',
                    value: 2
                }, {
                    name: '待上报',
                    value: 3
                }, {
                    name: '已拒绝',
                    value: -1
                }, {
                    name: '已结束',
                }]
                    value: 4
                }],
                queryParams: {
                    pageNum: 1,
                    pageSize: 10
                },
                total: 1,
                dataList: []
            }
        },
        onShow() {
            this.orderList()
        },
        onReachBottom() {
            if(this.list.length == this.total) {
                return
            }
            this.queryParams.pageNum++
            this.orderList()
        },
        methods: {
            goReport() {
@@ -115,8 +88,21 @@
                    url: `/policy/applyRecordDetails/applyRecordDetails`
                })
            },
            click() {
            click(e) {
                this.queryParams.pageNum = 1
                this.current = e.index
            },
            orderList() {
                orderList({...this.queryParams, orderStatus: this.list1[this.current].value}).then(val => {
                    // console.log(val.data)
                    this.total = val.data.total
                    this.dataList = [...this.dataList,...val.data.rows]
                })
            },
            search(e){
                this.queryParams.pageNum =1
                this.queryParams.companyName = e
                this.orderList()
            }
        }
    }
policy/applyRecordDetails/applyRecordDetails.vue
@@ -8,7 +8,7 @@
        <view class="top-content"></view>
        <view class="main-page">
            <view class="status">
                已结束
                {{mapStatus[details.orderStatus]}}
            </view>
            <view class="base-card">
                <view class="title">
@@ -17,47 +17,43 @@
                <view class="view-form">
                    <view class="view-form-item">
                        <view class="label">执法主题</view>
                        <view>24年5月份消防突击检查</view>
                        <view>{{details.enforceReason}}</view>
                    </view>
                    <view class="view-form-item">
                        <view class="label">执法对象</view>
                        <view>24年5月份消防突击检查</view>
                        <view>{{details.companyName}}</view>
                    </view>
                    <view class="view-form-item">
                        <view class="label">执法时间</view>
                        <view>24年5月份消防突击检查</view>
                    </view>
                    <view class="view-form-item">
                        <view class="label">执法时间</view>
                        <view>24年5月份消防突击检查</view>
                        <view>{{details.executeTime}}</view>
                    </view>
                    <view class="view-form-item">
                        <view class="label">执法类型</view>
                        <view>24年5月份消防突击检查</view>
                        <view>{{details.enforceTypeName}}</view>
                    </view>
                    <view class="view-form-item">
                        <view class="label">执法人员</view>
                        <view>24年5月份消防突击检查</view>
                        <view>{{details.executeUser}}</view>
                    </view>
                    <view class="view-form-item">
                        <view class="label">执法部门</view>
                        <view>24年5月份消防突击检查</view>
                        <view>{{details.executeDeptName}}</view>
                    </view>
                    <view class="view-form-item">
                        <view class="label">随行人员数量</view>
                        <view>24年5月份消防突击检查</view>
                        <view class="label">随行人员</view>
                        <view>随行人员</view>
                    </view>
                    <view class="view-form-item">
                        <view class="label">是否通知企业</view>
                        <view>24年5月份消防突击检查</view>
                        <view>{{details.isNoticeCompany == 0 ? '否': '是'}}</view>
                    </view>
                    <view class="view-form-item">
                        <view class="label">申请时间</view>
                        <view>24年5月份消防突击检查</view>
                        <view>{{details.applyTime}}</view>
                    </view>
                    <view class="view-form-item">
                        <view class="label">当前状态</view>
                        <view>24年5月份消防突击检查</view>
                        <view>{{mapStatus[details.orderStatus]}}</view>
                    </view>
                </view>
            </view>
@@ -66,11 +62,7 @@
                    <text>执法内容</text>
                </view>
                <view class="view-content">
                    灭火器使用:不同类型的灭火器适用于不同种类的火灾,如二氧化碳灭火器适用于固体、液体、气体和带电设备火灾,干粉灭火器同样适用于多种火灾类型。使用时应先拔掉保险销,然后瞄准火焰根部进行喷射。
                    消防栓使用:使用消防栓时,应确保至少有3人参与,其中2人握紧水枪,1人负责开启阀门。使用前应检查水带及接头是否完好,避免扭折,并确保水带与水枪正确连接。
                    防火措施:包括但不限于不乱丢烟蒂、不私拉乱接电线、不超负荷使用电器、定期检查电线和电器设备是否老化或破损、家中不存放易燃易爆物品等。
                    火灾逃生:发生火灾时,应迅速判断火势来源,选择与火源相反的方向逃生。切勿使用电梯逃生,应通过安全通道撤离。逃生过程中应保持低姿势,用湿毛巾掩护口鼻,减少吸入有毒烟雾。
                    报警和自救:发现火情后,应立即拨打“119”火警电话报警,并详细说明火灾地点、火势大小等信息。在等待救援时,应尽量保持冷静,采取正确的自救措施,如使用灭火器、消防栓等。
                    {{ details.regionReason }}
                </view>
            </view>
            <view class="base-card">
@@ -106,7 +98,7 @@
                    <image src="https://picsum.photos/200/300" mode="widthFix"></image>
                    <image src="https://picsum.photos/200/300" mode="widthFix"></image>
                    <image src="https://picsum.photos/200/300" mode="widthFix"></image>
                    <!-- {{regionImgs}} -->
                </view>
            </view>
            <view class="base-card">
@@ -152,14 +144,33 @@
</template>
<script>
    import {
        orderDetails
    } from '@/api/policy.js'
    export default {
        data() {
            return {
                details: {},
                mapStatus: {
                    1: '待审批',
                    2: "待执行",
                    3: "待上报",
                    '-1':"已拒绝",
                    4: "已结束"
                }
            }
        },
        onLoad(options) {
            this.orderDetails(options.id)
        },
        methods: {
            getDetails(orderId) {
                orderDetails({
                    orderId
                }).then(val => {
                    this.details = val.data
                })
            }
        }
    }
</script>
policy/components/index.vue
@@ -1,6 +1,6 @@
<template>
    <view class="page-content">
        <view class="banner">
            <image src="/static/head.png" mode=""></image>
        </view>
@@ -8,10 +8,11 @@
            <view class="second-box">
                <image src="/static/hqzc.png" class="icon"></image>
                <view class="driver"></view>
                <view class="right-box">
                    <view>
                        <view class="u-line-1 margin-bottom">海关总署贸易持续发展2024年立法局...</view>
                        <view class="u-line-1">国家医疗保障局办公室关于发布管理... </view>
                <view class="right-box" @click="goPolicyList">
                    <view class="article-list">
                        <view class="u-line-1 margin-bottom" v-for="(item, index) in policyList" :key="index">
                            {{item.docTitle}}</view>
                        <!-- <view class="u-line-1">国家医疗保障局办公室关于发布管理... </view> -->
                    </view>
                    <view class="icon-box">
                        <u-icon name="arrow-right" size="14" color="#868C98FF"></u-icon>
@@ -19,39 +20,59 @@
                </view>
            </view>
            <view class="policy-list">
                <!-- v-if="isJudge" -->
                <image src="/static/policy/zhi1.png"  @click="applyPulicy" mode="widthFix"></image>
                <image src="/static/policy/zhi2.png"  @click="recordZhifa" mode="widthFix"></image>
                <image src="/static/policy/zhi3.png" @click="report" mode="widthFix"></image>
                <image src="/static/policy/zhi4.png" @click="applyRecord" mode="widthFix"></image>
                <image src="/static/policy/zhi5.png" @click="goDataLook" mode="widthFix"></image>
                <image src="/static/policy/zhi1.png"  v-if="userAuth"  @click="applyPulicy" mode="widthFix"></image>
                <image src="/static/policy/zhi2.png" v-if="isJudge" @click="recordZhifa" mode="widthFix"></image>
                <image src="/static/policy/zhi3.png" v-if="userAuth" @click="report" mode="widthFix"></image>
                <image src="/static/policy/zhi4.png" v-if="userAuth" @click="applyRecord" mode="widthFix"></image>
                <image src="/static/policy/zhi5.png" @click="goDataLook" v-if="userType == '02'" mode="widthFix">
                </image>
            </view>
        </view>
    </view>
</template>
<script>
    import {  getInfo } from '@/api/auth.js'
    import {
        getInfo,
        docList
    } from '@/api/auth.js'
    import tabsCom from '@/policy/components/tabs.vue'
    export default {
        props: {
            isJudge: {
                type: Boolean,
                default: false
            },
            userType: {
                type: String,
                default: ""
            },
            userAuth: {
                type: Boolean,
                default: false
            }
        },
        components: {
            tabsCom
        },
        data() {
            return {
                isJudge: false
                // isJudge: false,
                policyList: []
            }
        },
        onShow() {
            this.getInfo()
        mounted() {
            // this.getInfo()
            this.docList()
        },
        methods: {
            getInfo() {
                getInfo().then(val =>{
                    // console.log()
                    this.isJudge = val.data.roles.some(item => item.includes('check_enforce'))
                })
            },
            // getInfo() {
            //     getInfo().then(val =>{
            // if(val.data.data.roles) {
            //     this.isJudge = val.data.data.roles.some(item => item.includes('check_enforce'))
            // }
            //     })
            // },
            applyPulicy() {
                uni.navigateTo({
                    url: '/policy/policyApply/policyApply'
@@ -76,26 +97,43 @@
                uni.navigateTo({
                    url: '/policy/translate/translate'
                })
            },
            // 去往惠企政策
            goPolicyList() {
                uni.navigateTo({
                    url: `/pages/hqzc/list`
                })
            },
            docList() {
                docList({
                    pageSize: 2,
                    pageNum: 1
                }).then(val => {
                    this.policyList = val.data.rows
                })
            }
        }
    }
</script>
<style lang="scss" scoped>
    .page-content{
        .banner{
    .page-content {
        .banner {
            width: 100%;
            height: 520rpx;
            image{
            image {
                width: 100%;
                height: 100%;
            }
        }
        .main-page-box{
        .main-page-box {
            position: relative;
            top: -60rpx;
        }
        .second-box{
        .second-box {
            margin: 0 32rpx;
            background-color: white;
            border-radius: 20rpx;
@@ -103,42 +141,58 @@
            display: flex;
            justify-content: space-between;
            align-items: center;
            .icon{
            .icon {
                width: 76rpx;
                height: 76rpx;
            }
            .driver{
            .driver {
                height: 50rpx;
                width: 2rpx;
                background-color: #F1F1F1;
                margin: 0 24rpx;
            }
            .right-box{
            .right-box {
                display: flex;
                justify-content: space-between;
                align-items: center;
                width: calc(100% - 76rpx - 50rpx);
                font-size: 26rpx;
                color: #4A4E60FF;
                .icon-box{
                .article-list {
                    width: 80%;
                }
                .icon-box {
                    background-color: #F1F1F1;
                    border-radius: 50%;
                    padding: 10rpx;
                }
                .margin-bottom{
                .margin-bottom {
                    margin-bottom: 10rpx;
                }
                .margin-bottom:last-child {
                    margin-bottom: 0;
                }
            }
        }
        .policy-list{
        .policy-list {
            margin: 22rpx 32rpx;
            image{
            image {
                width: 100%;
                height: 160rpx;
                margin-bottom: 20rpx;
            }
            image::last-child{
            image::last-child {
                margin-bottom: 0;
            }
        }
policy/components/mine.vue
@@ -6,12 +6,12 @@
                <image src="/static/policy/header.png" mode="widthFix"></image>
                <view class="user-info">
                    <view class="user-name">
                        <view class="inckname">刘小雅</view>
                        <view class="inckname">{{userInfo.data.nickName}}</view>
                        <view class="direc"></view>
                        <view class="dept-per">执法人员</view>
                    </view>
                    <view class="dept-name">
                        环保局--第一部门
                        {{userInfo.data.dept.parentName}}
                    </view>
                </view>
            </view>
@@ -19,13 +19,14 @@
        <view class="main-box">
            <view class="show-phone-number">
                <text class="label">联系电话</text>
                <text>168****4164</text>
                <text v-if="userInfo.phonenumber">{{userInfo.data.phonenumber.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2")}}</text>
                <text v-else>暂无手机号</text>
            </view>
            <view class="show-phone-number" @click="goChangePhone">
                <view class="set-flex">
                    <!-- <u-icon name="phone" size="22"></u-icon> -->
                    <image src="/static/policy/phone.png" mode="widthFix"></image>
                    <text class="change" >修改手机号</text>
                    <text class="change">修改手机号</text>
                </view>
                <u-icon name="arrow-right"></u-icon>
            </view>
@@ -38,6 +39,12 @@
<script>
    export default {
        props: {
            userInfo: {
                type: Object,
                default: () => ({})
            },
        },
        data(){
            return {
                src: '/static/policy/header.png'
policy/policyApply/perPage.vue
New file
@@ -0,0 +1,87 @@
<template>
    <u-popup mode="button" :safeAreaInsetBottom="false" :show="show" @close="close" @open="open" z-index="8000" bgColor="#fff">
        <view class="bg-box">
            <view class="title">选择随行人员</view>
            <u-checkbox-group     iconPlacement="right"  v-model="checkboxValue1" placement="column" @change="checkboxChange">
                <u-checkbox :customStyle="{marginBottom: '40rpx', }" v-for="(item, index) in checkboxList1" :key="index"
                     :name="item.userId" :label="`${item.dept.deptName}--${item.nickName}`">
                </u-checkbox>
            </u-checkbox-group>
            <view class="set-flex set-flex-content-between">
                <view class="button-per">
                    <u-button @click="close">取消</u-button>
                </view>
                <view class="button-per"  @click="enteryResult">
                    <u-button color="#1171E0">确认</u-button>
                </view>
            </view>
        </view>
    </u-popup>
</template>
<script>
    export default {
        props: {
            list: {
                type: Array,
                default: () => []
            }
        },
        data() {
            return {
                show: false,
                checkboxValue1: [],
                // 基本案列数据
                checkboxList1: [
                ],
            }
        },
        watch: {
            list: {
                handler(n) {
                this.checkboxList1 = n
                },
                immediate: true
            }
        },
        methods: {
            checkboxChange(n) {
                // console.log('change', n);
            },
            close(){
                this.show = false
            },
            open(list) {
                this.show = true
            },
            enteryResult() {
                this.$emit('selectValue', this.checkboxValue1)
                this.close()
                console.log(44)
            }
        }
    }
</script>
<style scoped>
    .bg-box{
        position: fixed;
        bottom: 0;
        background-color: white;
        border-radius: 20rpx 20rpx 0 0;
        padding: 20rpx 32rpx;
        z-index: 1000000;
        width: 100%;
        box-sizing: border-box;
    }
    .title{
        font-size: 36rpx;
        font-family: 500;
        margin-bottom: 40rpx;
    }
    .button-per{
        width: 48%;
    }
</style>
policy/policyApply/policyApply.vue
@@ -13,26 +13,26 @@
                        执法对象
                    </view>
                    <view class="input">
                        <input type="text" placeholder="请输入" v-model="form.companyName"/>
                        <input type="text"  placeholder="请输入" v-model="form.companyName"/>
                        <!-- <u-icon name="arrow-right"></u-icon> -->
                        <u-text text='搜索' type="primary"></u-text>
                        <u-text text='搜索' type="primary" @click="search"></u-text>
                    </view>
                </view>
                <view class="form-item">
                    <view class="form-label require">
                        执法时间
                    </view>
                    <view class="input">
                        <input type="text" placeholder="请输入"/>
                    <view class="input" @click="showTimeFun">
                        <input type="text" placeholder="请输入" disabled v-model="form.planTimeStr"/>
                        <u-icon name="arrow-right"></u-icon>
                    </view>
                </view>
                <view class="form-item">
                <view class="form-item" @click="showType = true">
                    <view class="form-label require">
                        执法类型
                    </view>
                    <view class="input">
                        <input type="text" placeholder="请输入"/>
                        <input type="text" placeholder="请输入" v-model="form.enforceTypeName" disabled/>
                        <u-icon name="arrow-right"></u-icon>
                    </view>
                </view>
@@ -52,19 +52,27 @@
                    <view class="form-label">
                        执法人员
                    </view>
                    <input type="text" placeholder="请输入"/>
                    <input type="text" placeholder="请输入" v-model="form.applyUser" disabled/>
                </view>
                <view class="form-item">
                    <view class="form-label">
                        执法部门
                    </view>
                    <input type="text" placeholder="请输入"/>
                    <input type="text" placeholder="请输入" v-model="form.applyDeptName" disabled/>
                </view>
                <view class="form-item">
                    <view class="form-label require">
                        随行人员数量
                <view class="form-item sui" style="align-items: flex-start;" @click="openPer">
                    <view class="form-label require ">
                        随行人员
                    </view>
                    <input type="text" placeholder="请输入"/>
                    <view>
                        <view style="color: #a2a2a2;" class="placeholder" v-if="!form.peers.length">请选择</view>
                        <view v-else>
                            <view style="margin-bottom: 20rpx;" v-for="(item,index) in form.peers"  :key="index">
                                {{item.peerUser}}({{item.peerDeptName}})
                            </view>
                        </view>
                    </view>
                    <!-- <u-textarea  border="none" disabled style="padding: 0;" placeholder="请选择" ></u-textarea> -->
                </view>
                <view class="form-item down-2">
                    <view class="form-label">
@@ -76,7 +84,7 @@
            </view>
        </view>
        <view class="down-options">
            <view class="button record" >申请记录</view>
            <view class="button record" @click="applyRecord">申请记录</view>
            <view class="button submit" @click="submitApply">提交申请</view>
        </view>
        <!-- <u-form label-position="top" label-width="120px">
@@ -115,62 +123,90 @@
<!--         <u-button @click="submitApply">提交申请</u-button>
        <u-button @click="applyRecord">申请记录</u-button> -->
        <u-picker :show="show" @close="show = false" @confirm="confirmSearch" @cancel="show = false" :columns="columns" keyName="companyName"></u-picker>
        <u-datetime-picker
                    :show="showTime"
                    @close="showTime = false"
                    @cancel="showTime = false"
                    v-model="currentTime"
                    @confirm="confirmTime"
                    :minDate="minDate"
                    mode="dateTime"
                    ref="datetimePicker"
                    class="hide-clear-button"
            ></u-datetime-picker>
        <!-- <u-datetime-picker
            :show="showTime"
            @close="showTime = false"
            @cancel="showTime = false"
            @confirm="confirmTime"
            :minDate="minDate"
            v-model="currentTime"
            @change="changeValue"
            mode="datetime"
            ref="datetimePicker"
            ></u-datetime-picker> -->
             <yt-dateTimePicker
                  ref="myPicker"
                  @submit="confirmTime"
                  :start-year="year"
                  :end-year="endYear"
                  :time-init="timeInit"
                  :time-hide="[true, true, true, true, false, false]"
                />
            <u-picker :show="showType" @close="showType = false" @confirm="confirmType" @cancel="showType = false" :columns="columnsType" keyName="dictLabel"></u-picker>
            <perPage :list="list" ref="perpage" @selectValue="selectValue"></perPage>
    </view>
</template>
<script>
    import { orderAdd, companyList } from '@/api/policy.js'
    import { orderAdd, companyList, enforceList } from '@/api/policy.js'
    import { getInfo } from '@/api/auth.js'
    import { getDicts } from '@/api/data'
    import perPage from './perPage'
    import YtDateTimePicker from "uni_modules/yt-dateTimePicker/components/yt-dateTimePicker/yt-dateTimePicker.vue"
    export default {
        components: {
            YtDateTimePicker,
            perPage
        },
        data() {
            return {
                currentTime: "",
                form: {
                    executeTime: "",
                    applyName: '',
                    applyUser: '',
                    applyDeptName: '',
                    enforceType: 1,
                    isNoticeCompany: 0,
                    regionReason: ''
                    regionReason: '',
                    planTimeStr: '',
                    peers: []
                },
                show: false,
                columns: [],
                showTime: false,
                columnsType: [],
                showType: false,
                minDate: ''
                minDate: '',
                year: '',
                endYear: '',
                timeInit: '',
                list: []
            }
        },
        onLoad() {
            this.currentTime = this.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss')
            this.year = new Date().getFullYear()
            this.endYear = this.year + 5
            this.minDate = new Date().valueOf()
            this.timeInit = this.$u.timeFormat(new Date(), 'yyyy-mm-dd')
            this.getInfo()
            this.getDicts()
            this.enforceList()
        },
        methods: {
            enforceList() {
                enforceList().then(val => {
                    this.list = val.data.data
                })
            },
            getDicts() {
                getDicts('enforce_type').then(val =>{
                    console.log(val.data.data)
                    this.columnsType = [val.data.data]
                })
            },
            getInfo() {
                getInfo().then(val => {
                    const value = val.data.data
                    this.form.applyName = value.nickName
                    // this.form.applyName = value.nickName
                    this.form.applyUser = value.nickName
                    this.form.applyId = value.userId
                    this.form.applyDeptName = value.dept.deptName
                    this.form.applyDeptId = value.dept.deptId
@@ -194,12 +230,20 @@
            submitApply(){
                orderAdd(this.form).then(val => {
                    if(val.data.code == 200) {
                        uni.navigateBack()
                        uni.showToast({
                            title: '提交成功',
                            icon: 'none'
                        })
                        setTimeout(() => {
                            uni.navigateBack()
                        }, 500)
                    }
                })
            },
            applyRecord() {
                uni.navigateTo({
                    url:`/policy/applyRecord/applyRecord`
                })
            },
            search() {
                companyList({companyName: this.form.companyName}).then(val => {
@@ -229,13 +273,13 @@
                this.show = false
            },
            confirmTime(e) {
                // console.log(e.value)
                this.form.applyTime = e.value
                this.showTime = false
                this.form.planTime = e.year + '-' + e.month+ '-' + + e.day + ' ' + e.hour + ":" + "00:00"
                this.form.planTimeStr = e.year + '-' + e.month+ '-' + + e.day + ' ' + e.hour
            },
            showTimeFun() {
                this.showTime = true
                // this.showTime = true
                          this.$refs.myPicker.show();
            },
            sheet(){
                
@@ -244,6 +288,26 @@
                this.form.enforceType = e.value[0].dictCode
                this.form.enforceTypeName = e.value[0].dictLabel
                this.showType = false
            },
            changeValue(e, e1) {
                this.currentTime = e.value
            },
            openPer() {
                this.$refs.perpage.open(this.list)
            },
            selectValue(value) {
                this.list.forEach(item => {
                    if(value.includes(item.userId)) {
                        this.form.peers.push({
                            peerDeptId: item.dept.deptId,
                            peerDeptName: item.dept.deptName,
                            peerId: item.userId,
                            peerPhone: item.phonenumber,
                            peerType: 3,
                            peerUser: item.nickName
                        })
                    }
                })
            }
        }
    }
@@ -251,6 +315,9 @@
<style>
    page{
        background-color: #F4F4F4;
    }
    .sui  .u-textarea{
        padding: 0 !important;
    }
</style>
<style scoped lang="scss">
@@ -323,7 +390,7 @@
    padding-bottom: 40rpx;
    width: 100%;
    padding: 22rpx 30rpx 40rpx;
    z-index: 1000;
    z-index: 800;
    display: flex;
    justify-content: space-between;
    align-items: center;
@@ -350,5 +417,8 @@
        text-align: center;
    }
}
.sui{
}
</style>
policy/policyIndex/policyIndex.vue
@@ -1,7 +1,7 @@
<template>
    <view class="padding-bottom">
        <policyIndexVue v-if="activeNumber == 0"></policyIndexVue>
        <minePage v-if="activeNumber == 1"></minePage>
        <policyIndexVue v-if="activeNumber == 0" :isJudge="isJudge" :userType="userInfo.userType" :userAuth="userAuth"></policyIndexVue>
        <minePage v-if="activeNumber == 1" :userInfo="userInfo" :roleGroup="roleGroup"></minePage>
        <tabsCom :activeNumber.sync="activeNumber"></tabsCom>
    </view>
</template>
@@ -20,7 +20,10 @@
        data() {
            return {
                isJudge: false,
                activeNumber: 0
                activeNumber: 0,
                userInfo: {},
                roleGroup: '',
                userAuth: false
            }
        },
        onShow() {
@@ -29,8 +32,18 @@
        methods: {
            getInfo() {
                getInfo().then(val =>{
                    // console.log()
                    this.isJudge = val.data.roles.some(item => item.includes('check_enforce'))
                    this.userInfo = val.data
                    if(val.data.roles) {
                        this.isJudge = val.data.roles.some(item => item.includes('check_enforce'))
                        const value = val.data.roles.filter(item => !item.includes('check_enforce'))
                        if(value.length) {
                            this.userAuth = true
                        } else {
                            this.userAuth = false
                        }
                    }
                })
            },
            applyPulicy() {
static/head.png

static/i03.png

static/i04.png

static/policy/back.png

static/policy/qrcode-border.png

static/policy/zhi1.png

static/policy/zhi2.png

static/policy/zhi3.png

static/policy/zhi4.png

static/policy/zhi5.png

uni_modules/yt-dateTimePicker/changelog.md
New file
@@ -0,0 +1,92 @@
## 1.2.2(2024-04-18)
说明文档
## 1.2.1(2024-04-18)
修复说明文档
## 1.2.0(2024-04-18)
改正秒打印不出来的问题
## 1.1.9(2024-01-11)
修改默认值说明文档
## 1.1.8(2024-01-11)
修改默认时间穿参方式
## 1.1.7(2023-11-07)
修改示例链接
## 1.1.6(2023-11-07)
增加示例链接
## 1.1.5(2023-11-06)
怎加联系方式
## 1.1.4(2023-11-06)
标签修改
## 1.1.3(2023-11-06)
介绍修改
## 1.1.2(2023-11-06)
名称修改
## 1.1.0(2023-11-06)
时间选择
## 1.0.9(2023-11-06)
修改bug
## 1.0.8(2023-11-06)
上传示例项目
## 1.0.7(2023-11-06)
删除图片
## 1.0.6(2023-11-06)
修改说明文档
## 1.0.5(2023-11-04)
更新说明文档
## 1.0.4\5(2023-11-04)
更新说明文档
## 1.0.4\5(2023-11-04)
更新说明文档
## 1.0.4\5(2023-11-04)
更新说明文档
## 1.0.4(2023-11-03)
修改bug
## 1.0.3(2023-11-03)
更新使用说明
## 1.0.2(2023-11-03)
修复bug
## 1.0.1(2023-11-03)
修改变量名
## 1.0.0(2023-11-03)
修复时间回显问题
# CHANGELOG
## 0.7.0(2023-07-11)
- 增加`time-init`属性, 自定义初始时间, 默认为当前时间, 值为时间戳
## 0.6.0(2023-07-11)
- 增加对秒的选择
- 增加`timeHidden`属性, 自定义年月日时分秒自由显示
- 增加`timeLabel`属性, 自定义界面时间单位,默认为 `["年", "月", "日", "时", "分", "秒"]`
- 修复微信小程序中无法定位到当前时间
## 0.5.0(2021-08-17)
- refactor
## 0.4.1(2021-08-17)
- update readme.md
## 0.4.0(2021-08-17)
- 移除组件 `color` 属性
- update readme.md
## 0.3.3(2021-08-15)
- 修改插件基本信息
## 0.3.2(2021-08-15)
- 更新文档
## 0.3.1(2021-08-15)
- fix
## 0.3.0(2019-07-22)
- 增加 color 属性,可以更换按钮颜色
## 0.0.4(2019-07-17)
- 增加从 npm 安装方式
uni_modules/yt-dateTimePicker/components/yt-dateTimePicker/yt-dateTimePicker.vue
New file
@@ -0,0 +1,339 @@
<template>
    <view class="yt-dateTimePicker" v-if="done">
        <view class="mask" :class="{ show: open }" @touchmove.stop.prevent catchtouchmove="true">
        </view>
        <view class="wrap" :class="{ show: open }">
            <view class="picker-header" @touchmove.stop.prevent catchtouchmove="true">
                <view class="btn-picker cancel" @click="open = false">取消</view>
                <view class="btn-picker submit" @click="_onSubmit">确定</view>
            </view>
            <view class="picker-body">
                <picker-view :value="value" @change="_onChange">
                    <picker-view-column :disable-flicking="true" v-if="timeHide[0]">
                        <view class="column-item" v-for="item in years" :key="item">
                            {{ item + timeLabel[0] }}
                        </view>
                    </picker-view-column>
                    <picker-view-column :disable-flicking="true" v-if="timeHide[1]">
                        <view class="column-item" v-for="item in months" :key="item">
                            {{ formatNum(item) + timeLabel[1] }}
                        </view>
                    </picker-view-column>
                    <picker-view-column :disable-flicking="true" v-if="timeHide[2]">
                        <view class="column-item" v-for="item in days" :key="item">
                            {{ formatNum(item) + timeLabel[2] }}
                        </view>
                    </picker-view-column>
                    <picker-view-column :disable-flicking="true" v-if="timeHide[3]">
                        <view class="column-item" v-for="item in hours" :key="item">
                            {{ formatNum(item) + timeLabel[3] }}
                        </view>
                    </picker-view-column>
                    <picker-view-column :disable-flicking="true" v-if="timeHide[4]">
                        <view class="column-item" v-for="item in minutes" :key="item">
                            {{ formatNum(item) + timeLabel[4] }}
                        </view>
                    </picker-view-column>
                    <picker-view-column :disable-flicking="true" v-if="timeHide[5]">
                        <view class="column-item" v-for="item in seconds" :key="item">
                            {{ formatNum(item) + timeLabel[5] }}
                        </view>
                    </picker-view-column>
                </picker-view>
            </view>
        </view>
    </view>
</template>
<script>
    export default {
        name: "yt-dateTimePicker",
        props: {
            startYear: {
                type: Number,
                default: 2000,
            },
            endYear: {
                type: Number,
                default: 2099,
            },
            timeLabel: {
                type: Array,
                default: () => ["年", "月", "日", "时", "分", "秒"],
            },
            timeHide: {
                type: Array,
                default: () => [true, true, true, true, true, true],
            },
            timeInit: {
                type: String,
                default: '', //new Date('2023-5-20').valueOf()
            },
        },
        data() {
            return {
                open: false,
                years: [],
                months: [],
                days: [],
                hours: [],
                minutes: [],
                seconds: [],
                year: "",
                month: "",
                day: "",
                hour: "",
                minute: "",
                second: "",
                value: [0, 0, 0, 0, 0, 0],
                done: false,
            };
        },
        computed: {
            currentDatetime() {
                return this.timeInit ? new Date(new Date(`${this.timeInit}`).valueOf()) : new Date(new Date().valueOf());
            },
        },
        mounted() {
            this.init();
        },
        watch: {
            month() {
                this.initDays();
            },
        },
        methods: {
            init() {
                this.initYears();
                this.initMonths();
                this.initDays();
                this.initHours();
                this.initMinutes();
                this.initSeconds();
                this.setSelectValue();
                this.done = true;
            },
            initYears() {
                const years = [];
                for (let year = this.startYear; year <= this.endYear; year++) {
                    years.push(year);
                    if (this.currentDatetime.getFullYear() === year) {
                        this.$set(this.value, 0, year - this.startYear);
                    }
                }
                this.years = years;
            },
            initMonths() {
                const months = [];
                for (let month = 1; month <= 12; month++) {
                    months.push(month);
                    if (this.currentDatetime.getMonth() + 1 === month) {
                        this.$set(this.value, 1, month - 1);
                    }
                }
                this.months = months;
            },
            initDays() {
                const value = this.value;
                const selectedYear = this.years[value[0]];
                const selectedMonth = this.months[value[1]];
                const days = [];
                const totalDays = new Date(selectedYear, selectedMonth, 0).getDate();
                for (let day = 1; day <= totalDays; day++) {
                    days.push(day);
                    if (this.currentDatetime.getDate() === day) {
                        this.$set(value, 2, day - 1);
                    }
                }
                this.days = days;
            },
            initHours() {
                const hours = [];
                for (let hour = 0; hour <= 23; hour++) {
                    hours.push(hour);
                    if (this.currentDatetime.getHours() === hour) {
                        this.$set(this.value, 3, hour);
                    }
                }
                this.hours = hours;
            },
            initMinutes() {
                const minutes = [];
                for (let minute = 0; minute < 60; minute++) {
                    minutes.push(minute);
                    if (this.currentDatetime.getMinutes() === minute) {
                        this.$set(this.value, 4, minute);
                    }
                }
                this.minutes = minutes;
            },
            initSeconds() {
                const seconds = [];
                for (let second = 0; second < 60; second++) {
                    seconds.push(second);
                    if (this.currentDatetime.getSeconds() === second) {
                        this.$set(this.value, 5, second);
                    }
                }
                this.seconds = seconds;
            },
            show() {
                this.init();
                this.open = true;
            },
            hide() {
                this.open = false;
            },
            _onChange(e) {
                this.value = e.detail.value;
                this.setSelectValue();
            },
            setSelectValue() {
                const v = this.value;
                this.year = this.years[v[0]];
                this.month = this.months[v[1]];
                this.day = this.days[v[2]];
                this.hour = this.hours[v[3]];
                this.minute = this.minutes[v[4]];
                this.second = this.seconds[v[5]];
            },
            _onSubmit() {
                const {
                    year,
                    month,
                    day,
                    hour,
                    minute,
                    second,
                    formatNum,
                    timeHide,
                    timeLabel,
                } = this;
                const result = {
                    year: timeHide[0] ? formatNum(year) : "",
                    month: timeHide[1] ? formatNum(month) : "",
                    day: timeHide[2] ? formatNum(day) : "",
                    hour: timeHide[3] ? formatNum(hour) : "",
                    minute: timeHide[4] ? formatNum(minute) : "",
                    second: timeHide[5] ? formatNum(second) : "",
                };
                this.$emit("submit", result);
                this.hide();
            },
            formatNum(num) {
                return num < 10 ? "0" + num : num + "";
            },
        },
    };
</script>
<style lang="scss">
    $transition: all 0.3s ease;
    $primary: #1171E0;
    .yt-dateTimePicker {
        position: relative;
        z-index: 999;
        picker-view {
            height: 100%;
        }
        .mask {
            position: fixed;
            z-index: 1000;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            background-color: rgba(0, 0, 0, 0.4);
            visibility: hidden;
            opacity: 0;
            transition: $transition;
            &.show {
                visibility: visible;
                opacity: 1;
            }
        }
        .wrap {
            z-index: 1001;
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            transition: $transition;
            transform: translateY(100%);
            &.show {
                transform: translateY(0);
            }
        }
        .picker-header {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            padding: 8px 8px;
            background-color: darken(#fff, 2%);
            background-color: #fff;
        }
        .picker-body {
            width: 100%;
            height: 420rpx;
            overflow: hidden;
            background-color: #fff;
        }
        .column-item {
            text-overflow: ellipsis;
            white-space: nowrap;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .btn-picker {
            position: relative;
            display: inline-block;
            padding-left: 10px;
            padding-right: 10px;
            box-sizing: border-box;
            text-align: center;
            text-decoration: none;
            line-height: 2;
            -webkit-tap-highlight-color: transparent;
            overflow: hidden;
            background-color: #eee;
            font-size: 14px;
            border-radius: 3px;
            color: #000;
            cursor: pointer;
        }
        .btn-picker.submit {
            background-color: $primary;
            color: #fff;
        }
    }
</style>
uni_modules/yt-dateTimePicker/package.json
New file
@@ -0,0 +1,76 @@
{
  "id": "yt-dateTimePicker",
  "displayName": "日期时间选择器(超级好用)自带滑动音效",
  "version": "1.2.2",
  "description": "这个选择器允许用户选择年、月、日、时、分和秒,提供了丰富的样式和配置选项。通过设置起始时间和结束时间范围,用户可以方便地进行精准的日期和时间选择。是开发uni-app应用程序的理想选择之一,",
  "keywords": [
    "时间",
    "日期",
    "年月日",
    "时间选择器",
    "日期时间选择器"
],
  "repository": "",
"engines": {
  },
"dcloudext": {
    "sale": {
      "regular": {
        "price": "0.00"
      },
      "sourcecode": {
        "price": "0.00"
      }
    },
    "contact": {
      "qq": "3190136675"
    },
    "declaration": {
      "ads": "无",
      "data": "无",
      "permissions": "无"
    },
    "npmurl": "",
    "type": "component-vue"
  },
  "uni_modules": {
    "dependencies": [],
    "encrypt": [],
    "platforms": {
      "cloud": {
        "tcb": "y",
        "aliyun": "y"
      },
      "client": {
        "App": {
          "app-vue": "y",
          "app-nvue": "u"
        },
        "H5-mobile": {
          "Safari": "y",
          "Android Browser": "y",
          "微信浏览器(Android)": "y",
          "QQ浏览器(Android)": "y"
        },
        "H5-pc": {
          "Chrome": "y",
          "IE": "n",
          "Edge": "y",
          "Firefox": "y",
          "Safari": "y"
        },
        "小程序": {
          "微信": "y",
          "阿里": "u",
          "百度": "u",
          "字节跳动": "u",
          "QQ": "u"
        },
        "快应用": {
          "华为": "u",
          "联盟": "u"
        }
      }
    }
  }
}
uni_modules/yt-dateTimePicker/readme.md
New file
@@ -0,0 +1,85 @@
# uniApp 简单的日期时间选择器
uniApp 日期时间选择器, 可选择年, 月, 日, 时, 分, 秒.
## 示例链接
[计算你来到这个世界多少天了](https://tinyurl.com/yangtao-age)
## 演示效果图
<p>
  <img align=top src="https://7072-prod-4gapv4gl33a8a0ff-1305990777.tcb.qcloud.la/%E9%87%8D%E8%A6%81%E5%9B%BE%E7%89%87%E5%AD%98%E5%82%A8/uniappcj.png?sign=67f6bd2b9d1e5f5bbdecc5ffdf9b923d&t=1699237042" width="500px" height="auto">
</p>
## 用法
在 template 中:
```vue
<template>
  <view>
    <button type="default" @click="openDatetimePicker">时间选择</button>
    <yt-dateTimePicker
      ref="myPicker"
      @submit="handleSubmit"
      :start-year="2000"
      :end-year="2099"
      time-init="2023-5-20"
      :time-hide="[true, true, true, true, true, false]"
      :time-label="['年', '月', '日', '时', '分', '秒']"
    />
  </view>
</template>
```
在 script 中:
- 该插件遵循 easycom 规范, 不用显式导入就可以使用 `<yt-dateTimePicker />`
- 如需按需导入可以使用`import YtDateTimePicker from "uni_modules/yt-dateTimePicker/components/yt-dateTimePicker/yt-dateTimePicker.vue";`
```javascript
export default {
  data() {
    return {
      birthday: "",
    };
  },
  methods: {
    // 打开picker
    openDatetimePicker() {
      this.$refs.myPicker.show();
    },
    // 关闭picker
    closeDatetimePicker() {
      this.$refs.myPicker.hide();
    },
    handleSubmit(e) {
      this.birthday = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
    },
  },
};
```
> Note: 不要把组件放 swiper 里面或者 v-for 里面等, 最好放在页面根部. 通常情况下打开 picker 需要调用`this.$refs.refName.show()`, 在选择完毕后 picker 会自动隐藏,不需要调用`this.$refs.refName.hide()`来手动隐藏。
## 属性说明
| 属性        | 是否必填    |  值类型    | 默认值    | 说明            |
| --------- | --------     | -----:     | --:     | :------------:|
| start-year|    是          | Number    |2000    | 选择开始年份    |
| end-year    |    是         | Number    |2099    | 选择结束年份    |
| time-init    |    否         | String    |2023-5-20| 自定义初始时间, 默认为当前时间    |
| time-hidden|    是         | Array    |[true, true, true, true, true, true]| 自定义时间列显示,默认显示年月日日分 |
| time-label|    否         | Array    |['年', '月', '日', '时', '分', '秒']    | 自定义各个时间单位    |
| @submit    |    否         | Function    |Object    |  监听选择事件, 回调函数的第一个参数包含了选择时间的完整信息|
| `QQ交流群(906392632)`  |
|<p><img align=top src="https://7072-prod-4gapv4gl33a8a0ff-1305990777.tcb.qcloud.la/%E9%87%8D%E8%A6%81%E5%9B%BE%E7%89%87%E5%AD%98%E5%82%A8/Snipaste_2023-11-06_16-50-56.png?sign=ed27f09cfeabb33e24835fecdd4108db&t=1699260686" width="500px" height="auto"></p>|
| QQ群号:906392632      |