添加忽略文件
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
unpackage/*
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"app.js","sources":["App.vue","main.js"],"sourcesContent":["<script>\r\n\texport default {\r\n\t\tonLaunch: function() {\r\n\t\t\tconsole.log('App Launch')\r\n\t\t},\r\n\t\tonShow: function() {\r\n\t\t\tconsole.log('App Show')\r\n\t\t},\r\n\t\tonHide: function() {\r\n\t\t\tconsole.log('App Hide')\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style>\r\n\t/*每个页面公共css */\r\n\t.bg {\r\n\t\tbackground-size: cover;\r\n\t\tbackground-repeat: no-repeat;\r\n\t\tbackground-position: center;\r\n\t\tbackground-attachment: fixed;\r\n\t}\r\n\r\n\t.column {\r\n\t\tdisplay: flex;\r\n\t\tflex-direction: column;\r\n\t}\r\n\r\n\t.row {\r\n\t\tdisplay: flex;\r\n\t\tflex-direction: row;\r\n\t}\r\n\r\n\t.center {\r\n\t\tdisplay: flex;\r\n\t\talign-items: center;\r\n\t\tjustify-content: center;\r\n\t}\r\n</style>","import App from './App'\n\n// #ifndef VUE3\nimport Vue from 'vue'\nimport './uni.promisify.adaptor'\nVue.config.productionTip = false\nApp.mpType = 'app'\nconst app = new Vue({\n ...App\n})\napp.$mount()\n// #endif\n\n// #ifdef VUE3\nimport { createSSRApp } from 'vue'\nexport function createApp() {\n const app = createSSRApp(App)\n return {\n app\n }\n}\n// #endif"],"names":["uni","createSSRApp","App"],"mappings":";;;;;;;;;;;AACC,MAAK,YAAU;AAAA,EACd,UAAU,WAAW;AACpBA,kBAAAA,MAAA,MAAA,OAAA,gBAAY,YAAY;AAAA,EACxB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,gBAAA,UAAU;AAAA,EACtB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,iBAAA,UAAU;AAAA,EACvB;AACD;ACIM,SAAS,YAAY;AAC1B,QAAM,MAAMC,cAAY,aAACC,SAAG;AAC5B,SAAO;AAAA,IACL;AAAA,EACD;AACH;;;"}
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"assets.js","sources":["static/refresh.png","static/9.png","static/ic_close.png","static/edit_info.png","static/appoin_record.png","static/problem.png","static/customer_s.png","static/blacklist.png","static/back.png","static/time.png","static/location.png","static/requirement.png","static/down.png"],"sourcesContent":["export default \"__VITE_ASSET__96e5bdd0__\"","export default \"__VITE_ASSET__9ab00ba2__\"","export default \"__VITE_ASSET__96212905__\"","export default \"__VITE_ASSET__e7dae23a__\"","export default \"__VITE_ASSET__4750ee6a__\"","export default \"__VITE_ASSET__cd0b082b__\"","export default \"__VITE_ASSET__3dbc10cf__\"","export default \"__VITE_ASSET__12aab81d__\"","export default \"__VITE_ASSET__7d17af36__\"","export default \"__VITE_ASSET__159e3b0c__\"","export default \"__VITE_ASSET__fe122ee2__\"","export default \"__VITE_ASSET__71b5ec0f__\"","export default \"__VITE_ASSET__b0500fc2__\""],"names":[],"mappings":";AAAA,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;;;;;;;;;;;;;;"}
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"blacklist-page.js","sources":["pages/me/blacklist-page.vue","../../../Software/HBuilderX.4.15.2024050802/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvbWUvYmxhY2tsaXN0LXBhZ2UudnVl"],"sourcesContent":["<template>\r\n\t<view class=\"content column\">\r\n\r\n\r\n\t\t<view class=\"row\" style=\"width: 90%; margin: 100rpx auto 0; justify-content: space-between;\">\r\n\t\t\t<image src=\"/static/back.png\" style=\"width: 40rpx; height: 40rpx;\" @click=\"goBack()\" mode=\"\"></image>\r\n\t\t\t<text style=\"font-size: 30rpx;\">黑名单</text>\r\n\t\t\t<view style=\"width: 40rpx;\"></view>\r\n\t\t</view>\r\n\r\n\r\n\t\t<view class=\"\" style=\" overflow-y: auto; margin-top: 30rpx;\">\r\n\r\n\t\t\t<view class=\"column\" style=\"width: 90%; margin: 0 auto 0;\">\r\n\r\n\t\t\t\t<view class=\"column\" v-for=\"(item,index) in 10\"\r\n\t\t\t\t\tstyle=\"width: 100%; background-color: #E9E9E9; border-radius: 10rpx; margin-bottom: 10rpx;\">\r\n\r\n\t\t\t\t\t<view class=\"row\" style=\"align-items: center;\">\r\n\t\t\t\t\t\t<image src=\"\"\r\n\t\t\t\t\t\t\tstyle=\"width: 130rpx; height: 130rpx; background-color: burlywood; border-radius: 50%; margin: 20rpx;\"\r\n\t\t\t\t\t\t\tmode=\"\">\r\n\t\t\t\t\t\t</image>\r\n\r\n\t\t\t\t\t\t<view class=\"column\" style=\"font-size: 24rpx; margin-left: 30rpx;\">\r\n\t\t\t\t\t\t\t<text>苏嘉辉</text>\r\n\t\t\t\t\t\t\t<text style=\"margin-top: 20rpx;\">UID:123456</text>\r\n\t\t\t\t\t\t</view>\r\n\r\n\t\t\t\t\t\t<view class=\"center\"\r\n\t\t\t\t\t\t\tstyle=\"width: 180rpx; height: 80rpx; background-color: #1989FA; font-size: 26rpx; border-radius: 10rpx; margin-left: auto; margin-right: 20rpx;\">\r\n\t\t\t\t\t\t\t取消拉黑\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\r\n\t\t\t\t\t<text\r\n\t\t\t\t\t\tstyle=\"margin-top: 20rpx; font-size: 24rpx; margin-left: 20rpx; margin-bottom: 20rpx;\">拉黑时间:2025/08/13\r\n\t\t\t\t\t\t13:56</text>\r\n\r\n\t\t\t\t</view>\r\n\r\n\t\t\t</view>\r\n\r\n\t\t</view>\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\texport default {\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\r\n\t\t\t}\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tgoBack() {\r\n\t\t\t\t// 返回上一页\r\n\t\t\t\tuni.navigateBack({\r\n\t\t\t\t\tdelta: 1\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style lang=\"scss\">\r\n\t.content {\r\n\t\twidth: 100%;\r\n\t\theight: 100vh;\r\n\t}\r\n</style>","import MiniProgramPage from 'F:/gitCode/uniapp/mahjong_group/pages/me/blacklist-page.vue'\nwx.createPage(MiniProgramPage)"],"names":["uni"],"mappings":";;;AAgDC,MAAK,YAAU;AAAA,EACd,OAAO;AACN,WAAO,CAEP;AAAA,EACA;AAAA,EACD,SAAS;AAAA,IACR,SAAS;AAERA,oBAAAA,MAAI,aAAa;AAAA,QAChB,OAAO;AAAA,MACR,CAAC;AAAA,IACD;AAAA,EACF;AACD;;;;;;;;;;;AC7DD,GAAG,WAAW,eAAe;"}
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"edit-info.js","sources":["pages/me/edit-info.vue","../../../Software/HBuilderX.4.15.2024050802/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvbWUvZWRpdC1pbmZvLnZ1ZQ"],"sourcesContent":["<template>\r\n\t<view class=\"content column\">\r\n\r\n\t\t<view class=\"row\" style=\"width: 90%; margin: 100rpx auto 0; justify-content: space-between;\">\r\n\t\t\t<image src=\"/static/back.png\" style=\"width: 40rpx; height: 40rpx;\" @click=\"goBack()\" mode=\"\"></image>\r\n\t\t\t<text style=\"font-size: 30rpx;\">修改信息</text>\r\n\t\t\t<view style=\"width: 40rpx;\"></view>\r\n\t\t</view>\r\n\r\n\t\t<view class=\"column\" style=\"width: 90%; margin: 80rpx auto 0;\">\r\n\r\n\t\t\t<view class=\"row\" style=\"justify-content: space-between; width: 100%; align-items: center;\">\r\n\r\n\t\t\t\t<text style=\"font-size: 26rpx;\">我的头像</text>\r\n\r\n\t\t\t\t<image src=\"\" style=\"width: 90rpx; height: 90rpx; background-color: aquamarine; border-radius: 50%;\"\r\n\t\t\t\t\tmode=\"\"></image>\r\n\t\t\t</view>\r\n\r\n\t\t\t<view style=\"width: 100%; height: 1rpx; background-color: antiquewhite; margin-top: 20rpx;\"></view>\r\n\r\n\t\t\t<view class=\"row\" style=\"justify-content: space-between; width: 100%; align-items: center; margin-top: 40rpx; font-size: 26rpx;\">\r\n\r\n\t\t\t\t<text style=\"\">我的昵称</text>\r\n\r\n\t\t\t\t<input type=\"text\" v-model=\"userName\" style=\"text-align: right;\" />\r\n\t\t\t</view>\r\n\r\n\t\t\t<view style=\"width: 100%; height: 1rpx; background-color: antiquewhite; margin-top: 20rpx;\"></view>\r\n\t\t\t\r\n\t\t\t<view class=\"row\" style=\"justify-content: space-between; width: 100%; align-items: center; margin-top: 40rpx; font-size: 26rpx;\">\r\n\t\t\t\r\n\t\t\t\t<text style=\"\">我的年龄</text>\r\n\t\t\t\r\n\t\t\t\t<input type=\"text\" v-model=\"userAge\" style=\"text-align: right;\" />\r\n\t\t\t</view>\r\n\t\t\t\r\n\t\t\t<view style=\"width: 100%; height: 1rpx; background-color: antiquewhite; margin-top: 20rpx;\"></view>\r\n\t\t\t\r\n\t\t\t<view class=\"row\" style=\"justify-content: space-between; width: 100%; align-items: center; margin-top: 40rpx; font-size: 26rpx;\">\r\n\t\t\t\t<text style=\"\">我的UID</text>\r\n\t\t\t\t<text style=\"\">{{userId}}</text>\r\n\t\t\t</view>\r\n\t\t\t\r\n\t\t\t<view style=\"width: 100%; height: 1rpx; background-color: antiquewhite; margin-top: 20rpx;\"></view>\r\n\r\n\t\t</view>\r\n\r\n\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\texport default {\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tuserName: \"树下的胖子\",\r\n\t\t\t\tuserAge:\"30\",\r\n\t\t\t\tuserId:\"132546\"\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tgoBack() {\r\n\t\t\t\t// 返回上一页\r\n\t\t\t\tuni.navigateBack({\r\n\t\t\t\t\tdelta: 1\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style lang=\"scss\">\r\n\t.content {\r\n\t\twidth: 100%;\r\n\t\theight: 100vh;\r\n\t}\r\n</style>","import MiniProgramPage from 'F:/gitCode/uniapp/mahjong_group/pages/me/edit-info.vue'\nwx.createPage(MiniProgramPage)"],"names":["uni"],"mappings":";;;AAqDC,MAAK,YAAU;AAAA,EACd,OAAO;AACN,WAAO;AAAA,MACN,UAAU;AAAA,MACV,SAAQ;AAAA,MACR,QAAO;AAAA,IAER;AAAA,EACA;AAAA,EACD,SAAS;AAAA,IACR,SAAS;AAERA,oBAAAA,MAAI,aAAa;AAAA,QAChB,OAAO;AAAA,MACR,CAAC;AAAA,IACD;AAAA,EACF;AACD;;;;;;;;;;;;;ACrED,GAAG,WAAW,eAAe;"}
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.js","sources":["uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js"],"sourcesContent":["import en from './en.json'\r\nimport zhHans from './zh-Hans.json'\r\nimport zhHant from './zh-Hant.json'\r\nexport default {\r\n\ten,\r\n\t'zh-Hans': zhHans,\r\n\t'zh-Hant': zhHant\r\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAe,eAAA;AAAA,EACd;AAAA,EACA,WAAW;AAAA,EACX,WAAW;AACZ;;"}
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"uni-icons.js","sources":["uni_modules/uni-icons/components/uni-icons/uni-icons.vue","../../../Software/HBuilderX.4.15.2024050802/HBuilderX/plugins/uniapp-cli-vite/uniComponent:/RjovZ2l0Q29kZS91bmlhcHAvbWFoam9uZ19ncm91cC91bmlfbW9kdWxlcy91bmktaWNvbnMvY29tcG9uZW50cy91bmktaWNvbnMvdW5pLWljb25zLnZ1ZQ"],"sourcesContent":["<template>\r\n\t<!-- #ifdef APP-NVUE -->\r\n\t<text :style=\"styleObj\" class=\"uni-icons\" @click=\"_onClick\">{{unicode}}</text>\r\n\t<!-- #endif -->\r\n\t<!-- #ifndef APP-NVUE -->\r\n\t<text :style=\"styleObj\" class=\"uni-icons\" :class=\"['uniui-'+type,customPrefix,customPrefix?type:'']\" @click=\"_onClick\">\r\n\t\t<slot></slot>\r\n\t</text>\r\n\t<!-- #endif -->\r\n</template>\r\n\r\n<script>\r\n\timport { fontData } from './uniicons_file_vue.js';\r\n\r\n\tconst getVal = (val) => {\r\n\t\tconst reg = /^[0-9]*$/g\r\n\t\treturn (typeof val === 'number' || reg.test(val)) ? val + 'px' : val;\r\n\t}\r\n\r\n\t// #ifdef APP-NVUE\r\n\tvar domModule = weex.requireModule('dom');\r\n\timport iconUrl from './uniicons.ttf'\r\n\tdomModule.addRule('fontFace', {\r\n\t\t'fontFamily': \"uniicons\",\r\n\t\t'src': \"url('\" + iconUrl + \"')\"\r\n\t});\r\n\t// #endif\r\n\r\n\t/**\r\n\t * Icons 图标\r\n\t * @description 用于展示 icons 图标\r\n\t * @tutorial https://ext.dcloud.net.cn/plugin?id=28\r\n\t * @property {Number} size 图标大小\r\n\t * @property {String} type 图标图案,参考示例\r\n\t * @property {String} color 图标颜色\r\n\t * @property {String} customPrefix 自定义图标\r\n\t * @event {Function} click 点击 Icon 触发事件\r\n\t */\r\n\texport default {\r\n\t\tname: 'UniIcons',\r\n\t\temits: ['click'],\r\n\t\tprops: {\r\n\t\t\ttype: {\r\n\t\t\t\ttype: String,\r\n\t\t\t\tdefault: ''\r\n\t\t\t},\r\n\t\t\tcolor: {\r\n\t\t\t\ttype: String,\r\n\t\t\t\tdefault: '#333333'\r\n\t\t\t},\r\n\t\t\tsize: {\r\n\t\t\t\ttype: [Number, String],\r\n\t\t\t\tdefault: 16\r\n\t\t\t},\r\n\t\t\tcustomPrefix: {\r\n\t\t\t\ttype: String,\r\n\t\t\t\tdefault: ''\r\n\t\t\t},\r\n\t\t\tfontFamily: {\r\n\t\t\t\ttype: String,\r\n\t\t\t\tdefault: ''\r\n\t\t\t}\r\n\t\t},\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\ticons: fontData\r\n\t\t\t}\r\n\t\t},\r\n\t\tcomputed: {\r\n\t\t\tunicode() {\r\n\t\t\t\tlet code = this.icons.find(v => v.font_class === this.type)\r\n\t\t\t\tif (code) {\r\n\t\t\t\t\treturn code.unicode\r\n\t\t\t\t}\r\n\t\t\t\treturn ''\r\n\t\t\t},\r\n\t\t\ticonSize() {\r\n\t\t\t\treturn getVal(this.size)\r\n\t\t\t},\r\n\t\t\tstyleObj() {\r\n\t\t\t\tif (this.fontFamily !== '') {\r\n\t\t\t\t\treturn `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`\r\n\t\t\t\t}\r\n\t\t\t\treturn `color: ${this.color}; font-size: ${this.iconSize};`\r\n\t\t\t}\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\t_onClick(e) {\r\n\t\t\t\tthis.$emit('click', e)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style lang=\"scss\">\r\n\t/* #ifndef APP-NVUE */\r\n\t@import './uniicons.css';\r\n\r\n\t@font-face {\r\n\t\tfont-family: uniicons;\r\n\t\tsrc: url('./uniicons.ttf');\r\n\t}\r\n\r\n\t/* #endif */\r\n\t.uni-icons {\r\n\t\tfont-family: uniicons;\r\n\t\ttext-decoration: none;\r\n\t\ttext-align: center;\r\n\t}\r\n</style>","import Component from 'F:/gitCode/uniapp/mahjong_group/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'\nwx.createComponent(Component)"],"names":["fontData"],"mappings":";;;AAcC,MAAM,SAAS,CAAC,QAAQ;AACvB,QAAM,MAAM;AACZ,SAAQ,OAAO,QAAQ,YAAY,IAAI,KAAK,GAAG,IAAK,MAAM,OAAO;AAClE;AAqBA,MAAK,YAAU;AAAA,EACd,MAAM;AAAA,EACN,OAAO,CAAC,OAAO;AAAA,EACf,OAAO;AAAA,IACN,MAAM;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACT;AAAA,IACD,OAAO;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,IACT;AAAA,IACD,MAAM;AAAA,MACL,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS;AAAA,IACT;AAAA,IACD,cAAc;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,IACT;AAAA,IACD,YAAY;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACA;AAAA,EACD,OAAO;AACN,WAAO;AAAA,MACN,OAAOA,2DAAO;AAAA,IACf;AAAA,EACA;AAAA,EACD,UAAU;AAAA,IACT,UAAU;AACT,UAAI,OAAO,KAAK,MAAM,KAAK,OAAK,EAAE,eAAe,KAAK,IAAI;AAC1D,UAAI,MAAM;AACT,eAAO,KAAK;AAAA,MACb;AACA,aAAO;AAAA,IACP;AAAA,IACD,WAAW;AACV,aAAO,OAAO,KAAK,IAAI;AAAA,IACvB;AAAA,IACD,WAAW;AACV,UAAI,KAAK,eAAe,IAAI;AAC3B,eAAO,UAAU,KAAK,KAAK,gBAAgB,KAAK,QAAQ,kBAAkB,KAAK,UAAU;AAAA,MAC1F;AACA,aAAO,UAAU,KAAK,KAAK,gBAAgB,KAAK,QAAQ;AAAA,IACzD;AAAA,EACA;AAAA,EACD,SAAS;AAAA,IACR,SAAS,GAAG;AACX,WAAK,MAAM,SAAS,CAAC;AAAA,IACtB;AAAA,EACD;AACD;;;;;;;;;;;AC1FD,GAAG,gBAAgB,SAAS;"}
|
||||
31
unpackage/dist/dev/mp-weixin/app.js
vendored
|
|
@ -1,31 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||
const common_vendor = require("./common/vendor.js");
|
||||
if (!Math) {
|
||||
"./pages/index/index.js";
|
||||
"./pages/appointment/appointment-page.js";
|
||||
"./pages/me/me-page.js";
|
||||
"./pages/me/appointment-record-page.js";
|
||||
"./pages/me/edit-info.js";
|
||||
"./pages/me/blacklist-page.js";
|
||||
}
|
||||
const _sfc_main = {
|
||||
onLaunch: function() {
|
||||
common_vendor.index.__f__("log", "at App.vue:4", "App Launch");
|
||||
},
|
||||
onShow: function() {
|
||||
common_vendor.index.__f__("log", "at App.vue:7", "App Show");
|
||||
},
|
||||
onHide: function() {
|
||||
common_vendor.index.__f__("log", "at App.vue:10", "App Hide");
|
||||
}
|
||||
};
|
||||
function createApp() {
|
||||
const app = common_vendor.createSSRApp(_sfc_main);
|
||||
return {
|
||||
app
|
||||
};
|
||||
}
|
||||
createApp().app.mount("#app");
|
||||
exports.createApp = createApp;
|
||||
//# sourceMappingURL=../.sourcemap/mp-weixin/app.js.map
|
||||
42
unpackage/dist/dev/mp-weixin/app.json
vendored
|
|
@ -1,42 +0,0 @@
|
|||
{
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/appointment/appointment-page",
|
||||
"pages/me/me-page",
|
||||
"pages/me/appointment-record-page",
|
||||
"pages/me/edit-info",
|
||||
"pages/me/blacklist-page"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "uni-app",
|
||||
"navigationBarBackgroundColor": "#F8F8F8",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#cdcdcd",
|
||||
"selectedColor": "#1296db",
|
||||
"borderStyle": "black",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "/static/tabbar/home.png",
|
||||
"selectedIconPath": "/static/tabbar/home_s.png",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/appointment/appointment-page",
|
||||
"iconPath": "/static/tabbar/appointment.png",
|
||||
"selectedIconPath": "/static/tabbar/appointment_s.png",
|
||||
"text": "预约"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/me/me-page",
|
||||
"iconPath": "/static/tabbar/me.png",
|
||||
"selectedIconPath": "/static/tabbar/me_s.png",
|
||||
"text": "我的"
|
||||
}
|
||||
]
|
||||
},
|
||||
"usingComponents": {}
|
||||
}
|
||||
22
unpackage/dist/dev/mp-weixin/app.wxss
vendored
|
|
@ -1,22 +0,0 @@
|
|||
|
||||
/*每个页面公共css */
|
||||
.bg {
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-attachment: fixed;
|
||||
}
|
||||
.column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
page{--status-bar-height:25px;--top-window-height:0px;--window-top:0px;--window-bottom:0px;--window-left:0px;--window-right:0px;--window-magin:0px}[data-c-h="true"]{display: none !important;}
|
||||
28
unpackage/dist/dev/mp-weixin/common/assets.js
vendored
|
|
@ -1,28 +0,0 @@
|
|||
"use strict";
|
||||
const _imports_0$2 = "/static/refresh.png";
|
||||
const _imports_1$2 = "/static/9.png";
|
||||
const _imports_2$2 = "/static/ic_close.png";
|
||||
const _imports_0$1 = "/static/edit_info.png";
|
||||
const _imports_1$1 = "/static/appoin_record.png";
|
||||
const _imports_2$1 = "/static/problem.png";
|
||||
const _imports_3$1 = "/static/customer_s.png";
|
||||
const _imports_4$1 = "/static/blacklist.png";
|
||||
const _imports_0 = "/static/back.png";
|
||||
const _imports_1 = "/static/time.png";
|
||||
const _imports_2 = "/static/location.png";
|
||||
const _imports_3 = "/static/requirement.png";
|
||||
const _imports_4 = "/static/down.png";
|
||||
exports._imports_0 = _imports_0$2;
|
||||
exports._imports_0$1 = _imports_0$1;
|
||||
exports._imports_0$2 = _imports_0;
|
||||
exports._imports_1 = _imports_1$2;
|
||||
exports._imports_1$1 = _imports_1$1;
|
||||
exports._imports_1$2 = _imports_1;
|
||||
exports._imports_2 = _imports_2$2;
|
||||
exports._imports_2$1 = _imports_2$1;
|
||||
exports._imports_2$2 = _imports_2;
|
||||
exports._imports_3 = _imports_3$1;
|
||||
exports._imports_3$1 = _imports_3;
|
||||
exports._imports_4 = _imports_4$1;
|
||||
exports._imports_4$1 = _imports_4;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/assets.js.map
|
||||
11199
unpackage/dist/dev/mp-weixin/common/vendor.js
vendored
|
|
@ -1,156 +0,0 @@
|
|||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
startTimeStr: "",
|
||||
endTimeStr: "",
|
||||
hours: "",
|
||||
minutes: "",
|
||||
roomValue: "",
|
||||
peopleValue: "",
|
||||
range: [{
|
||||
"value": 0,
|
||||
"text": "808号-大包,30元/小时"
|
||||
}, {
|
||||
"value": 1,
|
||||
"text": "807号-大包,30元/小时"
|
||||
}, {
|
||||
"value": 2,
|
||||
"text": "806号-大包,30元/小时"
|
||||
}, {
|
||||
"value": 3,
|
||||
"text": "805号-大包,30元/小时"
|
||||
}],
|
||||
peopleRange: [{
|
||||
"value": 0,
|
||||
"text": "1人"
|
||||
}, {
|
||||
"value": 1,
|
||||
"text": "2人"
|
||||
}, {
|
||||
"value": 2,
|
||||
"text": "3人"
|
||||
}, {
|
||||
"value": 3,
|
||||
"text": "4人"
|
||||
}],
|
||||
currentValue: 0,
|
||||
// 增加0.5
|
||||
increment() {
|
||||
if (this.currentValue < 5) {
|
||||
this.currentValue += 0.5;
|
||||
if (this.currentValue > 5) {
|
||||
this.currentValue = 5;
|
||||
}
|
||||
}
|
||||
},
|
||||
// 减少0.5
|
||||
decrement() {
|
||||
if (this.currentValue > 0) {
|
||||
this.currentValue -= 0.5;
|
||||
if (this.currentValue < 0) {
|
||||
this.currentValue = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeLog(e) {
|
||||
common_vendor.index.__f__("log", "at pages/appointment/appointment-page.vue:226", "change事件:", e);
|
||||
this.setTime();
|
||||
},
|
||||
changeLog2(e) {
|
||||
common_vendor.index.__f__("log", "at pages/appointment/appointment-page.vue:230", "change事件2:", e);
|
||||
this.setTime();
|
||||
},
|
||||
setTime() {
|
||||
if (this.startTimeStr == "" || this.endTimeStr == "") {
|
||||
return;
|
||||
}
|
||||
const startTime = new Date(this.startTimeStr.replace(/-/g, "/"));
|
||||
const endTime = new Date(this.endTimeStr.replace(/-/g, "/"));
|
||||
const timeDiff = endTime - startTime;
|
||||
const totalMinutes = Math.floor(timeDiff / 1e3 / 60);
|
||||
this.hours = Math.floor(totalMinutes / 60);
|
||||
this.minutes = totalMinutes % 60;
|
||||
common_vendor.index.__f__("log", "at pages/appointment/appointment-page.vue:255", `两个时间相差 ${this.hours} 小时 ${this.minutes} 分钟`);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_datetime_picker2 = common_vendor.resolveComponent("uni-datetime-picker");
|
||||
const _easycom_uni_data_select2 = common_vendor.resolveComponent("uni-data-select");
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
(_easycom_uni_datetime_picker2 + _easycom_uni_data_select2 + _easycom_uni_icons2)();
|
||||
}
|
||||
const _easycom_uni_datetime_picker = () => "../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.js";
|
||||
const _easycom_uni_data_select = () => "../../uni_modules/uni-data-select/components/uni-data-select/uni-data-select.js";
|
||||
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_datetime_picker + _easycom_uni_data_select + _easycom_uni_icons)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.o($options.changeLog),
|
||||
b: common_vendor.o(($event) => $data.startTimeStr = $event),
|
||||
c: common_vendor.p({
|
||||
type: "datetime",
|
||||
modelValue: $data.startTimeStr
|
||||
}),
|
||||
d: common_vendor.o($options.changeLog2),
|
||||
e: common_vendor.o(($event) => $data.endTimeStr = $event),
|
||||
f: common_vendor.p({
|
||||
type: "datetime",
|
||||
modelValue: $data.endTimeStr
|
||||
}),
|
||||
g: $data.hours != ""
|
||||
}, $data.hours != "" ? {
|
||||
h: common_vendor.t($data.hours),
|
||||
i: common_vendor.t($data.minutes)
|
||||
} : {}, {
|
||||
j: common_vendor.o(_ctx.change),
|
||||
k: common_vendor.o(($event) => $data.roomValue = $event),
|
||||
l: common_vendor.p({
|
||||
localdata: $data.range,
|
||||
modelValue: $data.roomValue
|
||||
}),
|
||||
m: common_vendor.o(_ctx.change),
|
||||
n: common_vendor.o(($event) => $data.peopleValue = $event),
|
||||
o: common_vendor.p({
|
||||
localdata: $data.peopleRange,
|
||||
modelValue: $data.peopleValue
|
||||
}),
|
||||
p: common_vendor.o(_ctx.change),
|
||||
q: common_vendor.o(($event) => $data.peopleValue = $event),
|
||||
r: common_vendor.p({
|
||||
localdata: $data.peopleRange,
|
||||
modelValue: $data.peopleValue
|
||||
}),
|
||||
s: common_vendor.o(_ctx.change),
|
||||
t: common_vendor.o(($event) => $data.peopleValue = $event),
|
||||
v: common_vendor.p({
|
||||
localdata: $data.peopleRange,
|
||||
modelValue: $data.peopleValue
|
||||
}),
|
||||
w: common_vendor.p({
|
||||
type: "minus",
|
||||
size: "24",
|
||||
color: "#666"
|
||||
}),
|
||||
x: common_vendor.o((...args) => $data.decrement && $data.decrement(...args)),
|
||||
y: $data.currentValue <= 0,
|
||||
z: common_vendor.t($data.currentValue.toFixed(1)),
|
||||
A: common_vendor.p({
|
||||
type: "plus",
|
||||
size: "24",
|
||||
color: "#666"
|
||||
}),
|
||||
B: common_vendor.o((...args) => $data.increment && $data.increment(...args)),
|
||||
C: $data.currentValue >= 5
|
||||
});
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/appointment/appointment-page.js.map
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"uni-datetime-picker": "../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker",
|
||||
"uni-data-select": "../../uni_modules/uni-data-select/components/uni-data-select/uni-data-select",
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.content {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.counter-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 50rpx;
|
||||
}
|
||||
.counter-btn {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
padding: 0;
|
||||
line-height: 1;
|
||||
}
|
||||
.minus-btn {
|
||||
background-color: #f5f5f5;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.counter-value {
|
||||
width: 120rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
title: "Hello",
|
||||
imgList: [1, 2, 3, 4, 5],
|
||||
dataList: [1, 2, 3, 4, 5, 6, 7, 8],
|
||||
rateValue: 3.5
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
methods: {
|
||||
openPop() {
|
||||
this.$refs.cardInfo.open();
|
||||
},
|
||||
clasePop() {
|
||||
this.$refs.cardInfo.close();
|
||||
},
|
||||
openUserPop() {
|
||||
this.$refs.userInfo.open();
|
||||
},
|
||||
closeUserPop() {
|
||||
this.$refs.userInfo.close();
|
||||
},
|
||||
onChange(e) {
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:254", "rate发生改变:" + JSON.stringify(e));
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
|
||||
const _easycom_uni_rate2 = common_vendor.resolveComponent("uni-rate");
|
||||
(_easycom_uni_popup2 + _easycom_uni_rate2)();
|
||||
}
|
||||
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
|
||||
const _easycom_uni_rate = () => "../../uni_modules/uni-rate/components/uni-rate/uni-rate.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_popup + _easycom_uni_rate)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.f($data.imgList, (item, index, i0) => {
|
||||
return {
|
||||
a: item,
|
||||
b: index
|
||||
};
|
||||
}),
|
||||
b: common_assets._imports_0,
|
||||
c: common_vendor.f(8, (item, index, i0) => {
|
||||
return {
|
||||
a: index,
|
||||
b: common_vendor.o(($event) => $options.openPop(), index)
|
||||
};
|
||||
}),
|
||||
d: common_assets._imports_1,
|
||||
e: common_vendor.f(3, (item, index, i0) => {
|
||||
return {};
|
||||
}),
|
||||
f: common_vendor.o(($event) => $options.openUserPop()),
|
||||
g: common_vendor.o(($event) => $options.clasePop()),
|
||||
h: common_vendor.sr("cardInfo", "60633b88-0"),
|
||||
i: common_vendor.p({
|
||||
type: "center"
|
||||
}),
|
||||
j: common_vendor.o(($event) => $options.closeUserPop()),
|
||||
k: common_assets._imports_2,
|
||||
l: common_vendor.o($options.onChange),
|
||||
m: common_vendor.o(($event) => $data.rateValue = $event),
|
||||
n: common_vendor.p({
|
||||
readonly: true,
|
||||
modelValue: $data.rateValue
|
||||
}),
|
||||
o: common_vendor.o($options.onChange),
|
||||
p: common_vendor.o(($event) => $data.rateValue = $event),
|
||||
q: common_vendor.p({
|
||||
readonly: true,
|
||||
modelValue: $data.rateValue
|
||||
}),
|
||||
r: common_vendor.sr("userInfo", "60633b88-1"),
|
||||
s: common_vendor.p({
|
||||
type: "center"
|
||||
})
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup",
|
||||
"uni-rate": "../../uni_modules/uni-rate/components/uni-rate/uni-rate"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.content {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.img-swiper {
|
||||
width: 100%;
|
||||
height: 386rpx;
|
||||
}
|
||||
.slide-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
background-color: aqua;
|
||||
}
|
||||
|
||||
/* 网格容器 - 4列布局 */
|
||||
.grid-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
/* 4列,每列宽度相等 */
|
||||
gap: 20rpx;
|
||||
/* 网格间距(行列间距相同) */
|
||||
}
|
||||
|
||||
/* 网格项内容 */
|
||||
.item-content {
|
||||
height: 630rpx;
|
||||
background-color: #E6E6E6;
|
||||
color: white;
|
||||
border-radius: 10rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
currentIndex: 0,
|
||||
rateValue1: 0,
|
||||
rateValue2: 0,
|
||||
keepAppointment: "",
|
||||
readonly: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
common_vendor.index.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
},
|
||||
click1() {
|
||||
this.currentIndex = 0;
|
||||
},
|
||||
click2() {
|
||||
this.currentIndex = 1;
|
||||
},
|
||||
openEvaluatePop() {
|
||||
this.$refs.evaluatePop.open();
|
||||
},
|
||||
openUserPop() {
|
||||
this.$refs.userPop.open();
|
||||
},
|
||||
keepAppointmentChange(e) {
|
||||
this.keepAppointment = e.detail.value;
|
||||
if (this.keepAppointment == "r1") {
|
||||
this.readonly = false;
|
||||
} else {
|
||||
this.readonly = true;
|
||||
this.rateValue1 = 0;
|
||||
this.rateValue2 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_rate2 = common_vendor.resolveComponent("uni-rate");
|
||||
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
|
||||
(_easycom_uni_rate2 + _easycom_uni_popup2)();
|
||||
}
|
||||
const _easycom_uni_rate = () => "../../uni_modules/uni-rate/components/uni-rate/uni-rate.js";
|
||||
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_rate + _easycom_uni_popup)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_assets._imports_0$2,
|
||||
b: common_vendor.o(($event) => $options.goBack()),
|
||||
c: common_vendor.s($data.currentIndex == 0 ? "color:#FA0D0D" : "color:#000000"),
|
||||
d: common_vendor.o(($event) => $options.click1()),
|
||||
e: common_vendor.s($data.currentIndex == 1 ? "color:#FA0D0D" : "color:#000000"),
|
||||
f: common_vendor.o(($event) => $options.click2()),
|
||||
g: common_vendor.f(4, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.f(4, (item2, index2, i1) => {
|
||||
return {};
|
||||
})
|
||||
};
|
||||
}),
|
||||
h: common_assets._imports_1$2,
|
||||
i: common_assets._imports_2$2,
|
||||
j: common_assets._imports_3$1,
|
||||
k: common_vendor.o(($event) => $options.openEvaluatePop()),
|
||||
l: common_assets._imports_4$1,
|
||||
m: common_vendor.o(($event) => $options.openUserPop()),
|
||||
n: common_vendor.o((...args) => $options.keepAppointmentChange && $options.keepAppointmentChange(...args)),
|
||||
o: common_vendor.o(($event) => $data.rateValue1 = $event),
|
||||
p: common_vendor.p({
|
||||
readonly: $data.readonly,
|
||||
modelValue: $data.rateValue1
|
||||
}),
|
||||
q: common_vendor.o(($event) => $data.rateValue2 = $event),
|
||||
r: common_vendor.p({
|
||||
readonly: $data.readonly,
|
||||
modelValue: $data.rateValue2
|
||||
}),
|
||||
s: common_vendor.sr("evaluatePop", "71ca20cf-0"),
|
||||
t: common_vendor.p({
|
||||
type: "center"
|
||||
}),
|
||||
v: common_vendor.f(3, (item, index, i0) => {
|
||||
return {};
|
||||
}),
|
||||
w: common_vendor.sr("userPop", "71ca20cf-3"),
|
||||
x: common_vendor.p({
|
||||
type: "center"
|
||||
})
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/me/appointment-record-page.js.map
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"uni-rate": "../../uni_modules/uni-rate/components/uni-rate/uni-rate",
|
||||
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.content {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
common_vendor.index.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_assets._imports_0$2,
|
||||
b: common_vendor.o(($event) => $options.goBack()),
|
||||
c: common_vendor.f(10, (item, index, i0) => {
|
||||
return {};
|
||||
})
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/me/blacklist-page.js.map
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
<view class="content column"><view class="row" style="width:90%;margin:100rpx auto 0;justify-content:space-between"><image src="{{a}}" style="width:40rpx;height:40rpx" bindtap="{{b}}" mode=""></image><text style="font-size:30rpx">黑名单</text><view style="width:40rpx"></view></view><view class="" style="overflow-y:auto;margin-top:30rpx"><view class="column" style="width:90%;margin:0 auto 0"><view wx:for="{{c}}" wx:for-item="item" class="column" style="width:100%;background-color:#E9E9E9;border-radius:10rpx;margin-bottom:10rpx"><view class="row" style="align-items:center"><image src="{{''}}" style="width:130rpx;height:130rpx;background-color:burlywood;border-radius:50%;margin:20rpx" mode=""></image><view class="column" style="font-size:24rpx;margin-left:30rpx"><text>苏嘉辉</text><text style="margin-top:20rpx">UID:123456</text></view><view class="center" style="width:180rpx;height:80rpx;background-color:#1989FA;font-size:26rpx;border-radius:10rpx;margin-left:auto;margin-right:20rpx"> 取消拉黑 </view></view><text style="margin-top:20rpx;font-size:24rpx;margin-left:20rpx;margin-bottom:20rpx">拉黑时间:2025/08/13 13:56</text></view></view></view></view>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.content {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
userName: "树下的胖子",
|
||||
userAge: "30",
|
||||
userId: "132546"
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
common_vendor.index.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_assets._imports_0$2,
|
||||
b: common_vendor.o(($event) => $options.goBack()),
|
||||
c: $data.userName,
|
||||
d: common_vendor.o(($event) => $data.userName = $event.detail.value),
|
||||
e: $data.userAge,
|
||||
f: common_vendor.o(($event) => $data.userAge = $event.detail.value),
|
||||
g: common_vendor.t($data.userId)
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/me/edit-info.js.map
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
<view class="content column"><view class="row" style="width:90%;margin:100rpx auto 0;justify-content:space-between"><image src="{{a}}" style="width:40rpx;height:40rpx" bindtap="{{b}}" mode=""></image><text style="font-size:30rpx">修改信息</text><view style="width:40rpx"></view></view><view class="column" style="width:90%;margin:80rpx auto 0"><view class="row" style="justify-content:space-between;width:100%;align-items:center"><text style="font-size:26rpx">我的头像</text><image src="{{''}}" style="width:90rpx;height:90rpx;background-color:aquamarine;border-radius:50%" mode=""></image></view><view style="width:100%;height:1rpx;background-color:antiquewhite;margin-top:20rpx"></view><view class="row" style="justify-content:space-between;width:100%;align-items:center;margin-top:40rpx;font-size:26rpx"><text style="">我的昵称</text><input type="text" style="text-align:right" value="{{c}}" bindinput="{{d}}"/></view><view style="width:100%;height:1rpx;background-color:antiquewhite;margin-top:20rpx"></view><view class="row" style="justify-content:space-between;width:100%;align-items:center;margin-top:40rpx;font-size:26rpx"><text style="">我的年龄</text><input type="text" style="text-align:right" value="{{e}}" bindinput="{{f}}"/></view><view style="width:100%;height:1rpx;background-color:antiquewhite;margin-top:20rpx"></view><view class="row" style="justify-content:space-between;width:100%;align-items:center;margin-top:40rpx;font-size:26rpx"><text style="">我的UID</text><text style="">{{g}}</text></view><view style="width:100%;height:1rpx;background-color:antiquewhite;margin-top:20rpx"></view></view></view>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.content {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
}
|
||||
81
unpackage/dist/dev/mp-weixin/pages/me/me-page.js
vendored
|
|
@ -1,81 +0,0 @@
|
|||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
rateValue: 4.5
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
openPop() {
|
||||
this.$refs.infoPop.open();
|
||||
},
|
||||
clasePop() {
|
||||
this.$refs.infoPop.close();
|
||||
},
|
||||
toAppointment() {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/me/appointment-record-page"
|
||||
});
|
||||
},
|
||||
toEditInfo() {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/me/edit-info"
|
||||
});
|
||||
},
|
||||
toBlacklist() {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/me/blacklist-page"
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_rate2 = common_vendor.resolveComponent("uni-rate");
|
||||
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
|
||||
(_easycom_uni_rate2 + _easycom_uni_popup2)();
|
||||
}
|
||||
const _easycom_uni_rate = () => "../../uni_modules/uni-rate/components/uni-rate/uni-rate.js";
|
||||
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_rate + _easycom_uni_popup)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_assets._imports_0$1,
|
||||
b: common_vendor.o(($event) => $options.toEditInfo()),
|
||||
c: common_vendor.f(3, (item, index, i0) => {
|
||||
return {};
|
||||
}),
|
||||
d: common_vendor.o(($event) => $options.openPop()),
|
||||
e: common_vendor.o(($event) => $data.rateValue = $event),
|
||||
f: common_vendor.p({
|
||||
readonly: true,
|
||||
modelValue: $data.rateValue
|
||||
}),
|
||||
g: common_vendor.o(($event) => $data.rateValue = $event),
|
||||
h: common_vendor.p({
|
||||
readonly: true,
|
||||
modelValue: $data.rateValue
|
||||
}),
|
||||
i: common_assets._imports_1$1,
|
||||
j: common_vendor.o(($event) => $options.toAppointment()),
|
||||
k: common_assets._imports_2$1,
|
||||
l: common_assets._imports_3,
|
||||
m: common_assets._imports_4,
|
||||
n: common_vendor.o(($event) => $options.toBlacklist()),
|
||||
o: common_vendor.f(3, (item, index, i0) => {
|
||||
return {};
|
||||
}),
|
||||
p: common_vendor.o(($event) => _ctx.openUserPop()),
|
||||
q: common_vendor.o(($event) => $options.clasePop()),
|
||||
r: common_vendor.sr("infoPop", "5735b596-2"),
|
||||
s: common_vendor.p({
|
||||
type: "center"
|
||||
})
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/me/me-page.js.map
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"uni-rate": "../../uni_modules/uni-rate/components/uni-rate/uni-rate",
|
||||
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.content {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
}
|
||||
29
unpackage/dist/dev/mp-weixin/project.config.json
vendored
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"description": "项目配置文件。",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
"es6": true,
|
||||
"postcss": false,
|
||||
"minified": false,
|
||||
"newFeature": true,
|
||||
"bigPackageSizeSupport": true,
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
}
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "3.9.3",
|
||||
"appid": "touristappid",
|
||||
"projectname": "mahjong_group",
|
||||
"condition": {},
|
||||
"editorSetting": {
|
||||
"tabIndent": "insertSpaces",
|
||||
"tabSize": 2
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||
"projectname": "mahjong_group",
|
||||
"setting": {
|
||||
"compileHotReLoad": true
|
||||
}
|
||||
}
|
||||
BIN
unpackage/dist/dev/mp-weixin/static/9.png
vendored
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 6.2 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/back.png
vendored
|
Before Width: | Height: | Size: 2.6 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/blacklist.png
vendored
|
Before Width: | Height: | Size: 7.2 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/customer_s.png
vendored
|
Before Width: | Height: | Size: 5.6 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/down.png
vendored
|
Before Width: | Height: | Size: 2.8 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/edit_info.png
vendored
|
Before Width: | Height: | Size: 3.6 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/ic_close.png
vendored
|
Before Width: | Height: | Size: 4.1 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/location.png
vendored
|
Before Width: | Height: | Size: 6.8 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/logo.png
vendored
|
Before Width: | Height: | Size: 3.9 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/no_content.png
vendored
|
Before Width: | Height: | Size: 4.4 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/problem.png
vendored
|
Before Width: | Height: | Size: 5.7 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/refresh.png
vendored
|
Before Width: | Height: | Size: 5.5 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/requirement.png
vendored
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/tabbar/home.png
vendored
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/tabbar/me.png
vendored
|
Before Width: | Height: | Size: 6.5 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/tabbar/me_s.png
vendored
|
Before Width: | Height: | Size: 6.6 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/time.png
vendored
|
Before Width: | Height: | Size: 4.9 KiB |
|
|
@ -1,515 +0,0 @@
|
|||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "uni-data-select",
|
||||
mixins: [common_vendor.nr.mixinDatacom || {}],
|
||||
emits: [
|
||||
"open",
|
||||
"close",
|
||||
"update:modelValue",
|
||||
"input",
|
||||
"clear",
|
||||
"change"
|
||||
],
|
||||
model: {
|
||||
prop: "modelValue",
|
||||
event: "update:modelValue"
|
||||
},
|
||||
options: {
|
||||
virtualHost: true
|
||||
},
|
||||
props: {
|
||||
localdata: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
value: {
|
||||
type: [String, Number, Array],
|
||||
default: ""
|
||||
},
|
||||
modelValue: {
|
||||
type: [String, Number, Array],
|
||||
default: ""
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "请选择"
|
||||
},
|
||||
emptyTips: {
|
||||
type: String,
|
||||
default: "无选项"
|
||||
},
|
||||
clear: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
defItem: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 格式化输出 用法 field="_id as value, version as text, uni_platform as label" format="{label} - {text}"
|
||||
format: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
placement: {
|
||||
type: String,
|
||||
default: "bottom"
|
||||
},
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
wrap: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
align: {
|
||||
type: String,
|
||||
default: "left"
|
||||
},
|
||||
hideRight: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: "default"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showSelector: false,
|
||||
current: "",
|
||||
mixinDatacomResData: [],
|
||||
apps: [],
|
||||
channels: [],
|
||||
cacheKey: "uni-data-select-lastSelectedValue"
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.debounceGet = this.debounce(() => {
|
||||
this.query();
|
||||
}, 300);
|
||||
if (this.collection && !this.localdata.length) {
|
||||
this.debounceGet();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
typePlaceholder() {
|
||||
const text = {
|
||||
"opendb-stat-app-versions": "版本",
|
||||
"opendb-app-channels": "渠道",
|
||||
"opendb-app-list": "应用"
|
||||
};
|
||||
const common = this.placeholder;
|
||||
const placeholder = text[this.collection];
|
||||
return placeholder ? common + placeholder : common;
|
||||
},
|
||||
valueCom() {
|
||||
if (this.value === "")
|
||||
return this.modelValue;
|
||||
if (this.modelValue === "")
|
||||
return this.value;
|
||||
return this.value;
|
||||
},
|
||||
textShow() {
|
||||
if (this.multiple) {
|
||||
const currentValues = this.getCurrentValues();
|
||||
if (Array.isArray(currentValues) && currentValues.length > 0) {
|
||||
const selectedItems = this.mixinDatacomResData.filter((item) => currentValues.includes(item.value));
|
||||
return selectedItems.map((item) => this.formatItemName(item)).join(", ");
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
return this.current;
|
||||
}
|
||||
},
|
||||
shouldShowClear() {
|
||||
if (this.multiple) {
|
||||
const currentValues = this.getCurrentValues();
|
||||
return Array.isArray(currentValues) && currentValues.length > 0;
|
||||
} else {
|
||||
return !!this.current;
|
||||
}
|
||||
},
|
||||
shouldWrap() {
|
||||
return this.multiple && this.wrap && !!this.textShow;
|
||||
},
|
||||
getOffsetByPlacement() {
|
||||
switch (this.placement) {
|
||||
case "top":
|
||||
return "bottom:calc(100% + 12px);";
|
||||
case "bottom":
|
||||
return "top:calc(100% + 12px);";
|
||||
}
|
||||
},
|
||||
slotSelected() {
|
||||
return this.$slots ? this.$slots.selected : false;
|
||||
},
|
||||
slotEmpty() {
|
||||
return this.$slots ? this.$slots.empty : false;
|
||||
},
|
||||
slotOption() {
|
||||
return this.$slots ? this.$slots.option : false;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
showSelector: {
|
||||
handler(val, old) {
|
||||
val ? this.$emit("open") : this.$emit("close");
|
||||
}
|
||||
},
|
||||
localdata: {
|
||||
immediate: true,
|
||||
handler(val, old) {
|
||||
if (Array.isArray(val) && old !== val) {
|
||||
this.mixinDatacomResData = val;
|
||||
}
|
||||
}
|
||||
},
|
||||
valueCom(val, old) {
|
||||
this.initDefVal();
|
||||
},
|
||||
mixinDatacomResData: {
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
if (val.length) {
|
||||
this.initDefVal();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getSelectedItems() {
|
||||
const currentValues = this.getCurrentValues();
|
||||
let _minxData = this.mixinDatacomResData;
|
||||
_minxData = JSON.parse(JSON.stringify(this.mixinDatacomResData));
|
||||
if (this.multiple) {
|
||||
return _minxData.filter((item) => currentValues.includes(item.value)) || [];
|
||||
} else {
|
||||
return _minxData.filter((item) => item.value === currentValues) || [];
|
||||
}
|
||||
},
|
||||
debounce(fn, time = 100) {
|
||||
let timer = null;
|
||||
return function(...args) {
|
||||
if (timer)
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
fn.apply(this, args);
|
||||
}, time);
|
||||
};
|
||||
},
|
||||
// 检查项目是否已选中
|
||||
isSelected(item) {
|
||||
if (this.multiple) {
|
||||
const currentValues = this.getCurrentValues();
|
||||
return Array.isArray(currentValues) && currentValues.includes(item.value);
|
||||
} else {
|
||||
return this.getCurrentValues() === item.value;
|
||||
}
|
||||
},
|
||||
// 获取当前选中的值
|
||||
getCurrentValues() {
|
||||
if (this.multiple) {
|
||||
return Array.isArray(this.valueCom) ? this.valueCom : this.valueCom ? [this.valueCom] : [];
|
||||
} else {
|
||||
return this.valueCom;
|
||||
}
|
||||
},
|
||||
// 执行数据库查询
|
||||
query() {
|
||||
this.mixinDatacomEasyGet();
|
||||
},
|
||||
// 监听查询条件变更事件
|
||||
onMixinDatacomPropsChange() {
|
||||
if (this.collection) {
|
||||
this.debounceGet();
|
||||
}
|
||||
},
|
||||
initDefVal() {
|
||||
let defValue = this.multiple ? [] : "";
|
||||
if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) {
|
||||
defValue = this.valueCom;
|
||||
} else {
|
||||
let strogeValue;
|
||||
if (this.collection) {
|
||||
strogeValue = this.getCache();
|
||||
}
|
||||
if (strogeValue || strogeValue === 0) {
|
||||
defValue = strogeValue;
|
||||
} else {
|
||||
let defItem = this.multiple ? [] : "";
|
||||
if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) {
|
||||
defItem = this.multiple ? [this.mixinDatacomResData[this.defItem - 1].value] : this.mixinDatacomResData[this.defItem - 1].value;
|
||||
}
|
||||
defValue = defItem;
|
||||
}
|
||||
if (defValue || defValue === 0 || this.multiple && Array.isArray(defValue) && defValue.length > 0) {
|
||||
this.emit(defValue);
|
||||
}
|
||||
}
|
||||
if (this.multiple) {
|
||||
const selectedValues = Array.isArray(defValue) ? defValue : defValue ? [defValue] : [];
|
||||
const selectedItems = this.mixinDatacomResData.filter((item) => selectedValues.includes(item.value));
|
||||
this.current = selectedItems.map((item) => this.formatItemName(item));
|
||||
} else {
|
||||
const def = this.mixinDatacomResData.find((item) => item.value === defValue);
|
||||
this.current = def ? this.formatItemName(def) : "";
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @param {[String, Number, Array]} value
|
||||
* 判断用户给的 value 是否同时为禁用状态
|
||||
*/
|
||||
isDisabled(value) {
|
||||
if (Array.isArray(value)) {
|
||||
return value.some((val) => {
|
||||
return this.mixinDatacomResData.some((item) => item.value === val && item.disable);
|
||||
});
|
||||
} else {
|
||||
let isDisabled = false;
|
||||
this.mixinDatacomResData.forEach((item) => {
|
||||
if (item.value === value) {
|
||||
isDisabled = item.disable;
|
||||
}
|
||||
});
|
||||
return isDisabled;
|
||||
}
|
||||
},
|
||||
clearVal() {
|
||||
const emptyValue = this.multiple ? [] : "";
|
||||
this.emit(emptyValue);
|
||||
this.current = this.multiple ? [] : "";
|
||||
if (this.collection) {
|
||||
this.removeCache();
|
||||
}
|
||||
this.$emit("clear");
|
||||
},
|
||||
checkBoxChange(res) {
|
||||
let range = res.detail.value;
|
||||
let currentValues = range && range.length > 0 ? range.map((item) => {
|
||||
const index = parseInt(item, 10);
|
||||
if (isNaN(index)) {
|
||||
common_vendor.index.__f__("error", "at uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue:426", `无效索引: ${item}`);
|
||||
}
|
||||
if (index < 0 || index >= this.mixinDatacomResData.length) {
|
||||
common_vendor.index.__f__("error", "at uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue:430", `索引越界: ${index}`);
|
||||
}
|
||||
return this.mixinDatacomResData[index].value;
|
||||
}) : [];
|
||||
const selectedItems = this.mixinDatacomResData.filter((dataItem) => currentValues.includes(dataItem.value));
|
||||
this.current = selectedItems.map((dataItem) => this.formatItemName(dataItem));
|
||||
this.emit(currentValues);
|
||||
},
|
||||
change(item) {
|
||||
if (!item.disable) {
|
||||
if (this.multiple) {
|
||||
let currentValues = this.getCurrentValues();
|
||||
if (!Array.isArray(currentValues)) {
|
||||
currentValues = currentValues ? [currentValues] : [];
|
||||
}
|
||||
const itemValue = item.value;
|
||||
const index = currentValues.indexOf(itemValue);
|
||||
if (index > -1) {
|
||||
currentValues.splice(index, 1);
|
||||
} else {
|
||||
currentValues.push(itemValue);
|
||||
}
|
||||
const selectedItems = this.mixinDatacomResData.filter((dataItem) => currentValues.includes(dataItem.value));
|
||||
this.current = selectedItems.map((dataItem) => this.formatItemName(dataItem));
|
||||
this.emit(currentValues);
|
||||
} else {
|
||||
this.showSelector = false;
|
||||
this.current = this.formatItemName(item);
|
||||
this.emit(item.value);
|
||||
}
|
||||
}
|
||||
},
|
||||
emit(val) {
|
||||
this.$emit("input", val);
|
||||
this.$emit("update:modelValue", val);
|
||||
this.$emit("change", val);
|
||||
if (this.collection) {
|
||||
this.setCache(val);
|
||||
}
|
||||
},
|
||||
toggleSelector() {
|
||||
if (this.disabled) {
|
||||
return;
|
||||
}
|
||||
this.showSelector = !this.showSelector;
|
||||
},
|
||||
formatItemName(item) {
|
||||
let {
|
||||
text,
|
||||
value,
|
||||
channel_code
|
||||
} = item;
|
||||
channel_code = channel_code ? `(${channel_code})` : "";
|
||||
if (this.format) {
|
||||
let str = "";
|
||||
str = this.format;
|
||||
for (let key in item) {
|
||||
str = str.replace(new RegExp(`{${key}}`, "g"), item[key]);
|
||||
}
|
||||
return str;
|
||||
} else {
|
||||
return this.collection.indexOf("app-list") > 0 ? `${text}(${value})` : text ? text : `未命名${channel_code}`;
|
||||
}
|
||||
},
|
||||
// 获取当前加载的数据
|
||||
getLoadData() {
|
||||
return this.mixinDatacomResData;
|
||||
},
|
||||
// 获取当前缓存key
|
||||
getCurrentCacheKey() {
|
||||
return this.collection;
|
||||
},
|
||||
// 获取缓存
|
||||
getCache(name = this.getCurrentCacheKey()) {
|
||||
let cacheData = common_vendor.index.getStorageSync(this.cacheKey) || {};
|
||||
return cacheData[name];
|
||||
},
|
||||
// 设置缓存
|
||||
setCache(value, name = this.getCurrentCacheKey()) {
|
||||
let cacheData = common_vendor.index.getStorageSync(this.cacheKey) || {};
|
||||
cacheData[name] = value;
|
||||
common_vendor.index.setStorageSync(this.cacheKey, cacheData);
|
||||
},
|
||||
// 删除缓存
|
||||
removeCache(name = this.getCurrentCacheKey()) {
|
||||
let cacheData = common_vendor.index.getStorageSync(this.cacheKey) || {};
|
||||
delete cacheData[name];
|
||||
common_vendor.index.setStorageSync(this.cacheKey, cacheData);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
_easycom_uni_icons2();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../../uni-icons/components/uni-icons/uni-icons.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_icons();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: $props.label
|
||||
}, $props.label ? {
|
||||
b: common_vendor.t($props.label + ":")
|
||||
} : {}, {
|
||||
c: $options.slotSelected
|
||||
}, $options.slotSelected ? {
|
||||
d: common_vendor.r("selected", {
|
||||
selectedItems: $options.getSelectedItems()
|
||||
}),
|
||||
e: $options.shouldWrap ? 1 : ""
|
||||
} : common_vendor.e({
|
||||
f: $options.textShow
|
||||
}, $options.textShow ? {
|
||||
g: common_vendor.t($options.textShow),
|
||||
h: common_vendor.n("align-" + $props.align),
|
||||
i: $options.shouldWrap ? 1 : ""
|
||||
} : {
|
||||
j: common_vendor.t($options.typePlaceholder),
|
||||
k: common_vendor.n("align-" + $props.align)
|
||||
}), {
|
||||
l: !$props.hideRight && $options.shouldShowClear && $props.clear && !$props.disabled
|
||||
}, !$props.hideRight && $options.shouldShowClear && $props.clear && !$props.disabled ? {
|
||||
m: common_vendor.p({
|
||||
type: "clear",
|
||||
color: "#c0c4cc",
|
||||
size: "24"
|
||||
}),
|
||||
n: common_vendor.o((...args) => $options.clearVal && $options.clearVal(...args))
|
||||
} : !$props.hideRight ? {
|
||||
p: common_vendor.p({
|
||||
type: $data.showSelector ? "top" : "bottom",
|
||||
size: "14",
|
||||
color: "#999"
|
||||
})
|
||||
} : {}, {
|
||||
o: !$props.hideRight,
|
||||
q: common_vendor.o((...args) => $options.toggleSelector && $options.toggleSelector(...args)),
|
||||
r: $options.shouldWrap ? 1 : "",
|
||||
s: $data.showSelector
|
||||
}, $data.showSelector ? {
|
||||
t: common_vendor.o((...args) => $options.toggleSelector && $options.toggleSelector(...args))
|
||||
} : {}, {
|
||||
v: $data.showSelector
|
||||
}, $data.showSelector ? common_vendor.e({
|
||||
w: common_vendor.n($props.placement == "bottom" ? "uni-popper__arrow_bottom" : "uni-popper__arrow_top"),
|
||||
x: $options.slotEmpty && $data.mixinDatacomResData.length === 0
|
||||
}, $options.slotEmpty && $data.mixinDatacomResData.length === 0 ? {
|
||||
y: common_vendor.r("empty", {
|
||||
empty: $props.emptyTips
|
||||
})
|
||||
} : common_vendor.e({
|
||||
z: $data.mixinDatacomResData.length === 0
|
||||
}, $data.mixinDatacomResData.length === 0 ? {
|
||||
A: common_vendor.t($props.emptyTips)
|
||||
} : {}), {
|
||||
B: $options.slotOption
|
||||
}, $options.slotOption ? {
|
||||
C: common_vendor.f($data.mixinDatacomResData, (itemData, index, i0) => {
|
||||
return {
|
||||
a: "option-" + i0,
|
||||
b: common_vendor.r("option", {
|
||||
item: itemData,
|
||||
itemSelected: $props.multiple ? $options.getCurrentValues().includes(itemData.value) : $options.getCurrentValues() == itemData.value
|
||||
}, i0),
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => $options.change(itemData), index)
|
||||
};
|
||||
})
|
||||
} : common_vendor.e({
|
||||
D: !$props.multiple && $data.mixinDatacomResData.length > 0
|
||||
}, !$props.multiple && $data.mixinDatacomResData.length > 0 ? {
|
||||
E: common_vendor.f($data.mixinDatacomResData, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t($options.formatItemName(item)),
|
||||
b: item.disable ? 1 : "",
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => $options.change(item), index)
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
F: $props.multiple && $data.mixinDatacomResData.length > 0
|
||||
}, $props.multiple && $data.mixinDatacomResData.length > 0 ? {
|
||||
G: common_vendor.f($data.mixinDatacomResData, (item, index, i0) => {
|
||||
return {
|
||||
a: index + "",
|
||||
b: $options.getCurrentValues().includes(item.value),
|
||||
c: item.disable,
|
||||
d: common_vendor.t($options.formatItemName(item)),
|
||||
e: item.disable ? 1 : "",
|
||||
f: index
|
||||
};
|
||||
}),
|
||||
H: common_vendor.o((...args) => $options.checkBoxChange && $options.checkBoxChange(...args))
|
||||
} : {}), {
|
||||
I: common_vendor.s($options.getOffsetByPlacement)
|
||||
}) : {}, {
|
||||
J: $props.disabled ? 1 : "",
|
||||
K: $options.shouldWrap ? 1 : "",
|
||||
L: $props.mode == "default" ? 1 : "",
|
||||
M: $props.mode == "underline" ? 1 : "",
|
||||
N: $data.current ? 1 : ""
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.js.map
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"uni-icons": "../../../uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
<view class="uni-stat__select"><label wx:if="{{a}}" class="uni-label-text hide-on-phone">{{b}}</label><view class="{{['uni-stat-box', N && 'uni-stat__actived']}}"><view class="{{['uni-select', J && 'uni-select--disabled', K && 'uni-select--wrap', L && 'border-default', M && 'border-bottom']}}"><view bindtap="{{q}}" class="{{['uni-select__input-box', r && 'uni-select__input-box--wrap']}}"><view wx:if="{{c}}" class="{{['slot-content', 'padding-top-bottom', e && 'uni-select__input-text--wrap']}}"><slot name="selected"></slot></view><block wx:else><view wx:if="{{f}}" class="{{['uni-select__input-text', i && 'uni-select__input-text--wrap']}}"><view class="{{['padding-top-bottom', h]}}">{{g}}</view></view><view wx:else class="{{['uni-select__input-text', 'uni-select__input-placeholder', k]}}">{{j}}</view></block><view wx:if="{{l}}" key="clear-button" catchtap="{{n}}"><uni-icons wx:if="{{m}}" u-i="d85de184-0" bind:__l="__l" u-p="{{m}}"/></view><view wx:elif="{{o}}" key="arrow-button"><uni-icons wx:if="{{p}}" u-i="d85de184-1" bind:__l="__l" u-p="{{p}}"/></view></view><view wx:if="{{s}}" class="uni-select--mask" bindtap="{{t}}"/><view wx:if="{{v}}" class="uni-select__selector" style="{{I}}"><view class="{{w}}"></view><scroll-view scroll-y="true" class="uni-select__selector-scroll"><block wx:if="{{x}}"><view class="uni-select__selector-empty"><slot name="empty"></slot></view></block><block wx:else><view wx:if="{{z}}" class="uni-select__selector-empty"><text>{{A}}</text></view></block><block wx:if="{{B}}"><view wx:for="{{C}}" wx:for-item="itemData" wx:key="c" bindtap="{{itemData.d}}"><slot name="{{itemData.a}}"></slot></view></block><block wx:else><block wx:if="{{D}}"><view wx:for="{{E}}" wx:for-item="item" wx:key="c" class="uni-select__selector-item" bindtap="{{item.d}}"><text class="{{[item.b && 'uni-select__selector__disabled']}}">{{item.a}}</text></view></block><view wx:if="{{F}}"><checkbox-group bindchange="{{H}}"><label wx:for="{{G}}" wx:for-item="item" wx:key="f" class="uni-select__selector-item"><checkbox value="{{item.a}}" checked="{{item.b}}" disabled="{{item.c}}"></checkbox><view class="{{[item.e && 'uni-select__selector__disabled']}}">{{item.d}}</view></label></checkbox-group></view></block></scroll-view></view></view></view></view>
|
||||
|
|
@ -1,240 +0,0 @@
|
|||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
@media screen and (max-width: 500px) {
|
||||
.hide-on-phone {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.uni-stat__select {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.uni-stat-box {
|
||||
background-color: #fff;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
.uni-stat__actived {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
.uni-label-text {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #6a6a6a;
|
||||
margin: auto 0;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.border-bottom {
|
||||
border-bottom: solid 1px #e5e5e5;
|
||||
}
|
||||
.border-default {
|
||||
border: 1px solid #e5e5e5;
|
||||
}
|
||||
.uni-select {
|
||||
font-size: 14px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 4px;
|
||||
padding: 0 5px;
|
||||
padding-left: 10px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
min-height: 35px;
|
||||
}
|
||||
.uni-select--disabled {
|
||||
background-color: #f5f7fa;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.uni-select--wrap {
|
||||
height: auto;
|
||||
min-height: 35px;
|
||||
}
|
||||
.uni-select__label {
|
||||
font-size: 16px;
|
||||
height: 35px;
|
||||
padding-right: 10px;
|
||||
color: #909399;
|
||||
}
|
||||
.uni-select__input-box {
|
||||
width: 0px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.uni-select__input-box--wrap .uni-select__input-text {
|
||||
margin-right: 8px;
|
||||
}
|
||||
.uni-select__input-box .padding-top-bottom {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
.uni-select__input-box .slot-content {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.uni-select__input {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.uni-select__input-plac {
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
}
|
||||
.uni-select__selector {
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #FFFFFF;
|
||||
border: 1px solid #EBEEF5;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
z-index: 3;
|
||||
padding: 4px 0;
|
||||
}
|
||||
.uni-select__selector-scroll {
|
||||
max-height: 200px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.uni-select__selector-empty,
|
||||
.uni-select__selector-item {
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
line-height: 35px;
|
||||
font-size: 14px;
|
||||
/* border-bottom: solid 1px $uni-border-3; */
|
||||
padding: 0px 10px;
|
||||
}
|
||||
.uni-select__selector-item-check {
|
||||
margin-left: auto;
|
||||
}
|
||||
.uni-select__selector-empty:last-child,
|
||||
.uni-select__selector-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.uni-select__selector__disabled {
|
||||
opacity: 0.4;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* picker 弹出层通用的指示小三角 */
|
||||
.uni-popper__arrow_bottom,
|
||||
.uni-popper__arrow_bottom::after,
|
||||
.uni-popper__arrow_top,
|
||||
.uni-popper__arrow_top::after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-color: transparent;
|
||||
border-style: solid;
|
||||
border-width: 6px;
|
||||
}
|
||||
.uni-popper__arrow_bottom {
|
||||
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
||||
top: -6px;
|
||||
left: 10%;
|
||||
margin-right: 3px;
|
||||
border-top-width: 0;
|
||||
border-bottom-color: #EBEEF5;
|
||||
}
|
||||
.uni-popper__arrow_bottom::after {
|
||||
content: " ";
|
||||
top: 1px;
|
||||
margin-left: -6px;
|
||||
border-top-width: 0;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
.uni-popper__arrow_top {
|
||||
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
||||
bottom: -6px;
|
||||
left: 10%;
|
||||
margin-right: 3px;
|
||||
border-bottom-width: 0;
|
||||
border-top-color: #EBEEF5;
|
||||
}
|
||||
.uni-popper__arrow_top::after {
|
||||
content: " ";
|
||||
bottom: 1px;
|
||||
margin-left: -6px;
|
||||
border-bottom-width: 0;
|
||||
border-top-color: #fff;
|
||||
}
|
||||
.uni-select__input-text {
|
||||
width: 100%;
|
||||
color: #333;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
.uni-select__input-text--wrap {
|
||||
white-space: normal;
|
||||
text-overflow: initial;
|
||||
-o-text-overflow: initial;
|
||||
overflow: visible;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
}
|
||||
.uni-select__input-placeholder {
|
||||
color: #6a6a6a;
|
||||
font-size: 12px;
|
||||
margin: 1px 0;
|
||||
}
|
||||
.uni-select--mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
.align-left {
|
||||
text-align: left;
|
||||
}
|
||||
.align-center {
|
||||
text-align: center;
|
||||
}
|
||||
.align-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
props: {
|
||||
weeks: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
calendar: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
selected: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
checkHover: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
choiceDate(weeks) {
|
||||
this.$emit("change", weeks);
|
||||
},
|
||||
handleMousemove(weeks) {
|
||||
this.$emit("handleMouse", weeks);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: $props.selected && $props.weeks.extraInfo
|
||||
}, $props.selected && $props.weeks.extraInfo ? {} : {}, {
|
||||
b: common_vendor.t($props.weeks.date),
|
||||
c: $props.calendar.fullDate === $props.weeks.fullDate && ($props.calendar.userChecked || !$props.checkHover) ? 1 : "",
|
||||
d: $props.checkHover ? 1 : "",
|
||||
e: $props.weeks.beforeMultiple ? 1 : "",
|
||||
f: $props.weeks.multiple ? 1 : "",
|
||||
g: $props.weeks.afterMultiple ? 1 : "",
|
||||
h: $props.weeks.disable ? 1 : "",
|
||||
i: $props.weeks.isToday ? 1 : "",
|
||||
j: $props.weeks.disable ? 1 : "",
|
||||
k: $props.weeks.beforeMultiple ? 1 : "",
|
||||
l: $props.weeks.multiple ? 1 : "",
|
||||
m: $props.weeks.afterMultiple ? 1 : "",
|
||||
n: common_vendor.o(($event) => $options.choiceDate($props.weeks)),
|
||||
o: common_vendor.o(($event) => $options.handleMousemove($props.weeks))
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.js.map
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
<view class="{{['uni-calendar-item__weeks-box', j && 'uni-calendar-item--disable', k && 'uni-calendar-item--before-checked-x', l && 'uni-calendar-item--multiple', m && 'uni-calendar-item--after-checked-x']}}" bindtap="{{n}}" bindmouseenter="{{o}}"><view class="{{['uni-calendar-item__weeks-box-item', c && 'uni-calendar-item--checked', d && 'uni-calendar-item--checked-range-text', e && 'uni-calendar-item--before-checked', f && 'uni-calendar-item--multiple', g && 'uni-calendar-item--after-checked', h && 'uni-calendar-item--disable']}}"><text wx:if="{{a}}" class="uni-calendar-item__weeks-box-circle"></text><text class="uni-calendar-item__weeks-box-text uni-calendar-item__weeks-box-text-disable uni-calendar-item--checked-text">{{b}}</text></view><view class="{{[i && 'uni-calendar-item--today']}}"></view></view>
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.uni-calendar-item__weeks-box {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 1px 0;
|
||||
position: relative;
|
||||
}
|
||||
.uni-calendar-item__weeks-box-text {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #001833;
|
||||
}
|
||||
.uni-calendar-item__weeks-box-item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
.uni-calendar-item__weeks-box-circle {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 8px;
|
||||
background-color: #dd524d;
|
||||
}
|
||||
.uni-calendar-item__weeks-box .uni-calendar-item--disable {
|
||||
cursor: default;
|
||||
}
|
||||
.uni-calendar-item--disable .uni-calendar-item__weeks-box-text-disable {
|
||||
color: #D1D1D1;
|
||||
}
|
||||
.uni-calendar-item--today {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 17%;
|
||||
background-color: #dd524d;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.uni-calendar-item--extra {
|
||||
color: #dd524d;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.uni-calendar-item__weeks-box .uni-calendar-item--checked {
|
||||
background-color: #007aff;
|
||||
border-radius: 50%;
|
||||
box-sizing: border-box;
|
||||
border: 3px solid #fff;
|
||||
}
|
||||
.uni-calendar-item--checked .uni-calendar-item--checked-text {
|
||||
color: #fff;
|
||||
}
|
||||
.uni-calendar-item--multiple .uni-calendar-item--checked-range-text {
|
||||
color: #333;
|
||||
}
|
||||
.uni-calendar-item--multiple {
|
||||
background-color: #F6F7FC;
|
||||
}
|
||||
.uni-calendar-item--multiple .uni-calendar-item--before-checked,
|
||||
.uni-calendar-item--multiple .uni-calendar-item--after-checked {
|
||||
background-color: #007aff;
|
||||
border-radius: 50%;
|
||||
box-sizing: border-box;
|
||||
border: 3px solid #F6F7FC;
|
||||
}
|
||||
.uni-calendar-item--before-checked .uni-calendar-item--checked-text,
|
||||
.uni-calendar-item--after-checked .uni-calendar-item--checked-text {
|
||||
color: #fff;
|
||||
}
|
||||
.uni-calendar-item--before-checked-x {
|
||||
border-top-left-radius: 50px;
|
||||
border-bottom-left-radius: 50px;
|
||||
box-sizing: border-box;
|
||||
background-color: #F6F7FC;
|
||||
}
|
||||
.uni-calendar-item--after-checked-x {
|
||||
border-top-right-radius: 50px;
|
||||
border-bottom-right-radius: 50px;
|
||||
background-color: #F6F7FC;
|
||||
}
|
||||
|
|
@ -1,605 +0,0 @@
|
|||
"use strict";
|
||||
const uni_modules_uniDatetimePicker_components_uniDatetimePicker_util = require("./util.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_uniDatetimePicker_components_uniDatetimePicker_i18n_index = require("./i18n/index.js");
|
||||
const calendarItem = () => "./calendar-item.js";
|
||||
const timePicker = () => "./time-picker.js";
|
||||
const {
|
||||
t
|
||||
} = common_vendor.initVueI18n(uni_modules_uniDatetimePicker_components_uniDatetimePicker_i18n_index.i18nMessages);
|
||||
const _sfc_main = {
|
||||
components: {
|
||||
calendarItem,
|
||||
timePicker
|
||||
},
|
||||
options: {
|
||||
virtualHost: true
|
||||
},
|
||||
props: {
|
||||
date: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
defTime: {
|
||||
type: [String, Object],
|
||||
default: ""
|
||||
},
|
||||
selectableTimes: {
|
||||
type: [Object],
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
selected: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
startDate: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
endDate: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
startPlaceholder: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
endPlaceholder: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
range: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
hasTime: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
insert: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
showMonth: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
clearDate: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
checkHover: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
hideSecond: {
|
||||
type: [Boolean],
|
||||
default: false
|
||||
},
|
||||
pleStatus: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
before: "",
|
||||
after: "",
|
||||
data: [],
|
||||
fulldate: ""
|
||||
};
|
||||
}
|
||||
},
|
||||
defaultValue: {
|
||||
type: [String, Object, Array],
|
||||
default: ""
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
weeks: [],
|
||||
calendar: {},
|
||||
nowDate: {},
|
||||
aniMaskShow: false,
|
||||
firstEnter: true,
|
||||
time: "",
|
||||
timeRange: {
|
||||
startTime: "",
|
||||
endTime: ""
|
||||
},
|
||||
tempSingleDate: "",
|
||||
tempRange: {
|
||||
before: "",
|
||||
after: ""
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
date: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
if (!this.range) {
|
||||
this.tempSingleDate = newVal;
|
||||
setTimeout(() => {
|
||||
this.init(newVal);
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
},
|
||||
defTime: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
if (!this.range) {
|
||||
this.time = newVal;
|
||||
} else {
|
||||
this.timeRange.startTime = newVal.start;
|
||||
this.timeRange.endTime = newVal.end;
|
||||
}
|
||||
}
|
||||
},
|
||||
startDate(val) {
|
||||
if (!this.cale) {
|
||||
return;
|
||||
}
|
||||
this.cale.setStartDate(val);
|
||||
this.cale.setDate(this.nowDate.fullDate);
|
||||
this.weeks = this.cale.weeks;
|
||||
},
|
||||
endDate(val) {
|
||||
if (!this.cale) {
|
||||
return;
|
||||
}
|
||||
this.cale.setEndDate(val);
|
||||
this.cale.setDate(this.nowDate.fullDate);
|
||||
this.weeks = this.cale.weeks;
|
||||
},
|
||||
selected(newVal) {
|
||||
if (!this.cale) {
|
||||
return;
|
||||
}
|
||||
this.cale.setSelectInfo(this.nowDate.fullDate, newVal);
|
||||
this.weeks = this.cale.weeks;
|
||||
},
|
||||
pleStatus: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
const {
|
||||
before,
|
||||
after,
|
||||
fulldate,
|
||||
which
|
||||
} = newVal;
|
||||
this.tempRange.before = before;
|
||||
this.tempRange.after = after;
|
||||
setTimeout(() => {
|
||||
if (fulldate) {
|
||||
this.cale.setHoverMultiple(fulldate);
|
||||
if (before && after) {
|
||||
this.cale.lastHover = true;
|
||||
if (this.rangeWithinMonth(after, before))
|
||||
return;
|
||||
this.setDate(before);
|
||||
} else {
|
||||
this.cale.setMultiple(fulldate);
|
||||
this.setDate(this.nowDate.fullDate);
|
||||
this.calendar.fullDate = "";
|
||||
this.cale.lastHover = false;
|
||||
}
|
||||
} else {
|
||||
if (!this.cale) {
|
||||
return;
|
||||
}
|
||||
this.cale.setDefaultMultiple(before, after);
|
||||
if (which === "left" && before) {
|
||||
this.setDate(before);
|
||||
this.weeks = this.cale.weeks;
|
||||
} else if (after) {
|
||||
this.setDate(after);
|
||||
this.weeks = this.cale.weeks;
|
||||
}
|
||||
this.cale.lastHover = true;
|
||||
}
|
||||
}, 16);
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
timepickerStartTime() {
|
||||
const activeDate = this.range ? this.tempRange.before : this.calendar.fullDate;
|
||||
return activeDate === this.startDate ? this.selectableTimes.start : "";
|
||||
},
|
||||
timepickerEndTime() {
|
||||
const activeDate = this.range ? this.tempRange.after : this.calendar.fullDate;
|
||||
return activeDate === this.endDate ? this.selectableTimes.end : "";
|
||||
},
|
||||
/**
|
||||
* for i18n
|
||||
*/
|
||||
selectDateText() {
|
||||
return t("uni-datetime-picker.selectDate");
|
||||
},
|
||||
startDateText() {
|
||||
return this.startPlaceholder || t("uni-datetime-picker.startDate");
|
||||
},
|
||||
endDateText() {
|
||||
return this.endPlaceholder || t("uni-datetime-picker.endDate");
|
||||
},
|
||||
okText() {
|
||||
return t("uni-datetime-picker.ok");
|
||||
},
|
||||
yearText() {
|
||||
return t("uni-datetime-picker.year");
|
||||
},
|
||||
monthText() {
|
||||
return t("uni-datetime-picker.month");
|
||||
},
|
||||
MONText() {
|
||||
return t("uni-calender.MON");
|
||||
},
|
||||
TUEText() {
|
||||
return t("uni-calender.TUE");
|
||||
},
|
||||
WEDText() {
|
||||
return t("uni-calender.WED");
|
||||
},
|
||||
THUText() {
|
||||
return t("uni-calender.THU");
|
||||
},
|
||||
FRIText() {
|
||||
return t("uni-calender.FRI");
|
||||
},
|
||||
SATText() {
|
||||
return t("uni-calender.SAT");
|
||||
},
|
||||
SUNText() {
|
||||
return t("uni-calender.SUN");
|
||||
},
|
||||
confirmText() {
|
||||
return t("uni-calender.confirm");
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.cale = new uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.Calendar({
|
||||
selected: this.selected,
|
||||
startDate: this.startDate,
|
||||
endDate: this.endDate,
|
||||
range: this.range
|
||||
});
|
||||
this.init(this.date);
|
||||
},
|
||||
methods: {
|
||||
leaveCale() {
|
||||
this.firstEnter = true;
|
||||
},
|
||||
handleMouse(weeks) {
|
||||
if (weeks.disable)
|
||||
return;
|
||||
if (this.cale.lastHover)
|
||||
return;
|
||||
let {
|
||||
before,
|
||||
after
|
||||
} = this.cale.multipleStatus;
|
||||
if (!before)
|
||||
return;
|
||||
this.calendar = weeks;
|
||||
this.cale.setHoverMultiple(this.calendar.fullDate);
|
||||
this.weeks = this.cale.weeks;
|
||||
if (this.firstEnter) {
|
||||
this.$emit("firstEnterCale", this.cale.multipleStatus);
|
||||
this.firstEnter = false;
|
||||
}
|
||||
},
|
||||
rangeWithinMonth(A, B) {
|
||||
const [yearA, monthA] = A.split("-");
|
||||
const [yearB, monthB] = B.split("-");
|
||||
return yearA === yearB && monthA === monthB;
|
||||
},
|
||||
// 蒙版点击事件
|
||||
maskClick() {
|
||||
this.close();
|
||||
this.$emit("maskClose");
|
||||
},
|
||||
clearCalender() {
|
||||
if (this.range) {
|
||||
this.timeRange.startTime = "";
|
||||
this.timeRange.endTime = "";
|
||||
this.tempRange.before = "";
|
||||
this.tempRange.after = "";
|
||||
this.cale.multipleStatus.before = "";
|
||||
this.cale.multipleStatus.after = "";
|
||||
this.cale.multipleStatus.data = [];
|
||||
this.cale.lastHover = false;
|
||||
} else {
|
||||
this.time = "";
|
||||
this.tempSingleDate = "";
|
||||
}
|
||||
this.calendar.fullDate = "";
|
||||
this.setDate(/* @__PURE__ */ new Date());
|
||||
},
|
||||
bindDateChange(e) {
|
||||
const value = e.detail.value + "-1";
|
||||
this.setDate(value);
|
||||
},
|
||||
/**
|
||||
* 初始化日期显示
|
||||
* @param {Object} date
|
||||
*/
|
||||
init(date) {
|
||||
if (!this.cale) {
|
||||
return;
|
||||
}
|
||||
this.cale.setDate(date || /* @__PURE__ */ new Date());
|
||||
this.weeks = this.cale.weeks;
|
||||
this.nowDate = this.cale.getInfo(date);
|
||||
this.calendar = {
|
||||
...this.nowDate
|
||||
};
|
||||
if (!date) {
|
||||
this.calendar.fullDate = "";
|
||||
if (this.defaultValue && !this.range) {
|
||||
const defaultDate = new Date(this.defaultValue);
|
||||
const fullDate = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDate(defaultDate);
|
||||
const year = defaultDate.getFullYear();
|
||||
const month = defaultDate.getMonth() + 1;
|
||||
const date2 = defaultDate.getDate();
|
||||
const day = defaultDate.getDay();
|
||||
this.calendar = {
|
||||
fullDate,
|
||||
year,
|
||||
month,
|
||||
date: date2,
|
||||
day
|
||||
}, this.tempSingleDate = fullDate;
|
||||
this.time = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getTime(defaultDate, this.hideSecond);
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 打开日历弹窗
|
||||
*/
|
||||
open() {
|
||||
if (this.clearDate && !this.insert) {
|
||||
this.cale.cleanMultipleStatus();
|
||||
this.init(this.date);
|
||||
}
|
||||
this.show = true;
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.aniMaskShow = true;
|
||||
}, 50);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 关闭日历弹窗
|
||||
*/
|
||||
close() {
|
||||
this.aniMaskShow = false;
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.show = false;
|
||||
this.$emit("close");
|
||||
}, 300);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 确认按钮
|
||||
*/
|
||||
confirm() {
|
||||
this.setEmit("confirm");
|
||||
this.close();
|
||||
},
|
||||
/**
|
||||
* 变化触发
|
||||
*/
|
||||
change(isSingleChange) {
|
||||
if (!this.insert && !isSingleChange)
|
||||
return;
|
||||
this.setEmit("change");
|
||||
},
|
||||
/**
|
||||
* 选择月份触发
|
||||
*/
|
||||
monthSwitch() {
|
||||
let {
|
||||
year,
|
||||
month
|
||||
} = this.nowDate;
|
||||
this.$emit("monthSwitch", {
|
||||
year,
|
||||
month: Number(month)
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 派发事件
|
||||
* @param {Object} name
|
||||
*/
|
||||
setEmit(name) {
|
||||
if (!this.range) {
|
||||
if (!this.calendar.fullDate) {
|
||||
this.calendar = this.cale.getInfo(/* @__PURE__ */ new Date());
|
||||
this.tempSingleDate = this.calendar.fullDate;
|
||||
}
|
||||
if (this.hasTime && !this.time) {
|
||||
this.time = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getTime(/* @__PURE__ */ new Date(), this.hideSecond);
|
||||
}
|
||||
}
|
||||
let {
|
||||
year,
|
||||
month,
|
||||
date,
|
||||
fullDate,
|
||||
extraInfo
|
||||
} = this.calendar;
|
||||
this.$emit(name, {
|
||||
range: this.cale.multipleStatus,
|
||||
year,
|
||||
month,
|
||||
date,
|
||||
time: this.time,
|
||||
timeRange: this.timeRange,
|
||||
fulldate: fullDate,
|
||||
extraInfo: extraInfo || {}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 选择天触发
|
||||
* @param {Object} weeks
|
||||
*/
|
||||
choiceDate(weeks) {
|
||||
if (weeks.disable)
|
||||
return;
|
||||
this.calendar = weeks;
|
||||
this.calendar.userChecked = true;
|
||||
this.cale.setMultiple(this.calendar.fullDate, true);
|
||||
this.weeks = this.cale.weeks;
|
||||
this.tempSingleDate = this.calendar.fullDate;
|
||||
const beforeDate = new Date(this.cale.multipleStatus.before).getTime();
|
||||
const afterDate = new Date(this.cale.multipleStatus.after).getTime();
|
||||
if (beforeDate > afterDate && afterDate) {
|
||||
this.tempRange.before = this.cale.multipleStatus.after;
|
||||
this.tempRange.after = this.cale.multipleStatus.before;
|
||||
} else {
|
||||
this.tempRange.before = this.cale.multipleStatus.before;
|
||||
this.tempRange.after = this.cale.multipleStatus.after;
|
||||
}
|
||||
this.change(true);
|
||||
},
|
||||
changeMonth(type) {
|
||||
let newDate;
|
||||
if (type === "pre") {
|
||||
newDate = this.cale.getPreMonthObj(this.nowDate.fullDate).fullDate;
|
||||
} else if (type === "next") {
|
||||
newDate = this.cale.getNextMonthObj(this.nowDate.fullDate).fullDate;
|
||||
}
|
||||
this.setDate(newDate);
|
||||
this.monthSwitch();
|
||||
},
|
||||
/**
|
||||
* 设置日期
|
||||
* @param {Object} date
|
||||
*/
|
||||
setDate(date) {
|
||||
this.cale.setDate(date);
|
||||
this.weeks = this.cale.weeks;
|
||||
this.nowDate = this.cale.getInfo(date);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _component_calendar_item = common_vendor.resolveComponent("calendar-item");
|
||||
const _component_time_picker = common_vendor.resolveComponent("time-picker");
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
(_component_calendar_item + _component_time_picker + _easycom_uni_icons2)();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../../uni-icons/components/uni-icons/uni-icons.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_icons();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: !$props.insert && $data.show
|
||||
}, !$props.insert && $data.show ? {
|
||||
b: $data.aniMaskShow ? 1 : "",
|
||||
c: common_vendor.o((...args) => $options.maskClick && $options.maskClick(...args))
|
||||
} : {}, {
|
||||
d: $props.insert || $data.show
|
||||
}, $props.insert || $data.show ? common_vendor.e({
|
||||
e: common_vendor.o(($event) => $options.changeMonth("pre")),
|
||||
f: common_vendor.t(($data.nowDate.year || "") + $options.yearText + ($data.nowDate.month || "") + $options.monthText),
|
||||
g: $props.date,
|
||||
h: common_vendor.o((...args) => $options.bindDateChange && $options.bindDateChange(...args)),
|
||||
i: common_vendor.o(($event) => $options.changeMonth("next")),
|
||||
j: !$props.insert
|
||||
}, !$props.insert ? {
|
||||
k: common_vendor.o((...args) => $options.maskClick && $options.maskClick(...args))
|
||||
} : {}, {
|
||||
l: !$props.insert ? 1 : "",
|
||||
m: $props.showMonth
|
||||
}, $props.showMonth ? {
|
||||
n: common_vendor.t($data.nowDate.month)
|
||||
} : {}, {
|
||||
o: common_vendor.t($options.SUNText),
|
||||
p: common_vendor.t($options.MONText),
|
||||
q: common_vendor.t($options.TUEText),
|
||||
r: common_vendor.t($options.WEDText),
|
||||
s: common_vendor.t($options.THUText),
|
||||
t: common_vendor.t($options.FRIText),
|
||||
v: common_vendor.t($options.SATText),
|
||||
w: common_vendor.f($data.weeks, (item, weekIndex, i0) => {
|
||||
return {
|
||||
a: common_vendor.f(item, (weeks, weeksIndex, i1) => {
|
||||
return {
|
||||
a: common_vendor.o($options.choiceDate, weeksIndex),
|
||||
b: common_vendor.o($options.handleMouse, weeksIndex),
|
||||
c: "ca55401c-0-" + i0 + "-" + i1,
|
||||
d: common_vendor.p({
|
||||
weeks,
|
||||
calendar: $data.calendar,
|
||||
selected: $props.selected,
|
||||
checkHover: $props.range
|
||||
}),
|
||||
e: weeksIndex
|
||||
};
|
||||
}),
|
||||
b: weekIndex
|
||||
};
|
||||
}),
|
||||
x: !$props.insert && !$props.range && $props.hasTime
|
||||
}, !$props.insert && !$props.range && $props.hasTime ? {
|
||||
y: common_vendor.t($data.tempSingleDate ? $data.tempSingleDate : $options.selectDateText),
|
||||
z: common_vendor.o(($event) => $data.time = $event),
|
||||
A: common_vendor.p({
|
||||
type: "time",
|
||||
start: $options.timepickerStartTime,
|
||||
end: $options.timepickerEndTime,
|
||||
disabled: !$data.tempSingleDate,
|
||||
border: false,
|
||||
["hide-second"]: $props.hideSecond,
|
||||
modelValue: $data.time
|
||||
})
|
||||
} : {}, {
|
||||
B: !$props.insert && $props.range && $props.hasTime
|
||||
}, !$props.insert && $props.range && $props.hasTime ? {
|
||||
C: common_vendor.t($data.tempRange.before ? $data.tempRange.before : $options.startDateText),
|
||||
D: common_vendor.o(($event) => $data.timeRange.startTime = $event),
|
||||
E: common_vendor.p({
|
||||
type: "time",
|
||||
start: $options.timepickerStartTime,
|
||||
border: false,
|
||||
["hide-second"]: $props.hideSecond,
|
||||
disabled: !$data.tempRange.before,
|
||||
modelValue: $data.timeRange.startTime
|
||||
}),
|
||||
F: common_vendor.p({
|
||||
type: "arrowthinright",
|
||||
color: "#999"
|
||||
}),
|
||||
G: common_vendor.t($data.tempRange.after ? $data.tempRange.after : $options.endDateText),
|
||||
H: common_vendor.o(($event) => $data.timeRange.endTime = $event),
|
||||
I: common_vendor.p({
|
||||
type: "time",
|
||||
end: $options.timepickerEndTime,
|
||||
border: false,
|
||||
["hide-second"]: $props.hideSecond,
|
||||
disabled: !$data.tempRange.after,
|
||||
modelValue: $data.timeRange.endTime
|
||||
})
|
||||
} : {}, {
|
||||
J: !$props.insert
|
||||
}, !$props.insert ? {
|
||||
K: common_vendor.t($options.confirmText),
|
||||
L: common_vendor.o((...args) => $options.confirm && $options.confirm(...args))
|
||||
} : {}, {
|
||||
M: !$props.insert ? 1 : "",
|
||||
N: $data.aniMaskShow ? 1 : "",
|
||||
O: $data.aniMaskShow ? 1 : ""
|
||||
}) : {}, {
|
||||
P: common_vendor.o((...args) => $options.leaveCale && $options.leaveCale(...args))
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.js.map
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"calendar-item": "./calendar-item",
|
||||
"time-picker": "./time-picker",
|
||||
"uni-icons": "../../../uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
<view class="uni-calendar" bindmouseleave="{{P}}"><view wx:if="{{a}}" class="{{['uni-calendar__mask', b && 'uni-calendar--mask-show']}}" bindtap="{{c}}"></view><view wx:if="{{d}}" class="{{['uni-calendar__content', M && 'uni-calendar--fixed', N && 'uni-calendar--ani-show', O && 'uni-calendar__content-mobile']}}"><view class="{{['uni-calendar__header', l && 'uni-calendar__header-mobile']}}"><view class="uni-calendar__header-btn-box" catchtap="{{e}}"><view class="uni-calendar__header-btn uni-calendar--left"></view></view><picker mode="date" value="{{g}}" fields="month" bindchange="{{h}}"><text class="uni-calendar__header-text">{{f}}</text></picker><view class="uni-calendar__header-btn-box" catchtap="{{i}}"><view class="uni-calendar__header-btn uni-calendar--right"></view></view><view wx:if="{{j}}" class="dialog-close" bindtap="{{k}}"><view class="dialog-close-plus" data-id="close"></view><view class="dialog-close-plus dialog-close-rotate" data-id="close"></view></view></view><view class="uni-calendar__box"><view wx:if="{{m}}" class="uni-calendar__box-bg"><text class="uni-calendar__box-bg-text">{{n}}</text></view><view class="uni-calendar__weeks" style="padding-bottom:7px"><view class="uni-calendar__weeks-day"><text class="uni-calendar__weeks-day-text">{{o}}</text></view><view class="uni-calendar__weeks-day"><text class="uni-calendar__weeks-day-text">{{p}}</text></view><view class="uni-calendar__weeks-day"><text class="uni-calendar__weeks-day-text">{{q}}</text></view><view class="uni-calendar__weeks-day"><text class="uni-calendar__weeks-day-text">{{r}}</text></view><view class="uni-calendar__weeks-day"><text class="uni-calendar__weeks-day-text">{{s}}</text></view><view class="uni-calendar__weeks-day"><text class="uni-calendar__weeks-day-text">{{t}}</text></view><view class="uni-calendar__weeks-day"><text class="uni-calendar__weeks-day-text">{{v}}</text></view></view><view wx:for="{{w}}" wx:for-item="item" wx:key="b" class="uni-calendar__weeks"><view wx:for="{{item.a}}" wx:for-item="weeks" wx:key="e" class="uni-calendar__weeks-item"><calendar-item wx:if="{{weeks.d}}" class="uni-calendar-item--hook" bindchange="{{weeks.a}}" bindhandleMouse="{{weeks.b}}" u-i="{{weeks.c}}" bind:__l="__l" u-p="{{weeks.d}}"></calendar-item></view></view></view><view wx:if="{{x}}" class="uni-date-changed uni-calendar--fixed-top" style="padding:0 80px"><view class="uni-date-changed--time-date">{{y}}</view><time-picker wx:if="{{A}}" class="time-picker-style" u-i="ca55401c-1" bind:__l="__l" bindupdateModelValue="{{z}}" u-p="{{A}}"></time-picker></view><view wx:if="{{B}}" class="uni-date-changed uni-calendar--fixed-top"><view class="uni-date-changed--time-start"><view class="uni-date-changed--time-date">{{C}}</view><time-picker wx:if="{{E}}" class="time-picker-style" u-i="ca55401c-2" bind:__l="__l" bindupdateModelValue="{{D}}" u-p="{{E}}"></time-picker></view><view style="line-height:50px"><uni-icons wx:if="{{F}}" u-i="ca55401c-3" bind:__l="__l" u-p="{{F}}"></uni-icons></view><view class="uni-date-changed--time-end"><view class="uni-date-changed--time-date">{{G}}</view><time-picker wx:if="{{I}}" class="time-picker-style" u-i="ca55401c-4" bind:__l="__l" bindupdateModelValue="{{H}}" u-p="{{I}}"></time-picker></view></view><view wx:if="{{J}}" class="uni-date-changed uni-date-btn--ok"><view class="uni-datetime-picker--btn" bindtap="{{L}}">{{K}}</view></view></view></view>
|
||||
|
|
@ -1,251 +0,0 @@
|
|||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.uni-calendar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.uni-calendar__mask {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
transition-property: opacity;
|
||||
transition-duration: 0.3s;
|
||||
opacity: 0;
|
||||
z-index: 99;
|
||||
}
|
||||
.uni-calendar--mask-show {
|
||||
opacity: 1;
|
||||
}
|
||||
.uni-calendar--fixed {
|
||||
position: fixed;
|
||||
bottom: calc(var(--window-bottom));
|
||||
left: 0;
|
||||
right: 0;
|
||||
transition-property: transform;
|
||||
transition-duration: 0.3s;
|
||||
transform: translateY(460px);
|
||||
z-index: 99;
|
||||
}
|
||||
.uni-calendar--ani-show {
|
||||
transform: translateY(0);
|
||||
}
|
||||
.uni-calendar__content {
|
||||
background-color: #fff;
|
||||
}
|
||||
.uni-calendar__content-mobile {
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.uni-calendar__header {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 50px;
|
||||
}
|
||||
.uni-calendar__header-mobile {
|
||||
padding: 10px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.uni-calendar--fixed-top {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
border-top-color: rgba(0, 0, 0, 0.4);
|
||||
border-top-style: solid;
|
||||
border-top-width: 1px;
|
||||
}
|
||||
.uni-calendar--fixed-width {
|
||||
width: 50px;
|
||||
}
|
||||
.uni-calendar__backtoday {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 25rpx;
|
||||
padding: 0 5px;
|
||||
padding-left: 10px;
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
font-size: 12px;
|
||||
border-top-left-radius: 25px;
|
||||
border-bottom-left-radius: 25px;
|
||||
color: #fff;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
.uni-calendar__header-text {
|
||||
text-align: center;
|
||||
width: 100px;
|
||||
font-size: 15px;
|
||||
color: #666;
|
||||
}
|
||||
.uni-calendar__button-text {
|
||||
text-align: center;
|
||||
width: 100px;
|
||||
font-size: 14px;
|
||||
color: #007aff;
|
||||
letter-spacing: 3px;
|
||||
}
|
||||
.uni-calendar__header-btn-box {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
.uni-calendar__header-btn {
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
border-left-color: #808080;
|
||||
border-left-style: solid;
|
||||
border-left-width: 1px;
|
||||
border-top-color: #555555;
|
||||
border-top-style: solid;
|
||||
border-top-width: 1px;
|
||||
}
|
||||
.uni-calendar--left {
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
.uni-calendar--right {
|
||||
transform: rotate(135deg);
|
||||
}
|
||||
.uni-calendar__weeks {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.uni-calendar__weeks-item {
|
||||
flex: 1;
|
||||
}
|
||||
.uni-calendar__weeks-day {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 40px;
|
||||
border-bottom-color: #F5F5F5;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 1px;
|
||||
}
|
||||
.uni-calendar__weeks-day-text {
|
||||
font-size: 12px;
|
||||
color: #B2B2B2;
|
||||
}
|
||||
.uni-calendar__box {
|
||||
position: relative;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
.uni-calendar__box-bg {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.uni-calendar__box-bg-text {
|
||||
font-size: 200px;
|
||||
font-weight: bold;
|
||||
color: #999;
|
||||
opacity: 0.1;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
}
|
||||
.uni-date-changed {
|
||||
padding: 0 10px;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
border-top-color: #DCDCDC;
|
||||
border-top-style: solid;
|
||||
border-top-width: 1px;
|
||||
flex: 1;
|
||||
}
|
||||
.uni-date-btn--ok {
|
||||
padding: 20px 15px;
|
||||
}
|
||||
.uni-date-changed--time-start {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.uni-date-changed--time-end {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.uni-date-changed--time-date {
|
||||
color: #999;
|
||||
line-height: 50px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.time-picker-style {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.mr-10 {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.dialog-close {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding: 0 25px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.dialog-close-plus {
|
||||
width: 16px;
|
||||
height: 2px;
|
||||
background-color: #737987;
|
||||
border-radius: 2px;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
.dialog-close-rotate {
|
||||
position: absolute;
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
.uni-datetime-picker--btn {
|
||||
border-radius: 100px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
background-color: #007aff;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.uni-datetime-picker--btn:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
"use strict";
|
||||
const en = {
|
||||
"uni-datetime-picker.selectDate": "select date",
|
||||
"uni-datetime-picker.selectTime": "select time",
|
||||
"uni-datetime-picker.selectDateTime": "select date and time",
|
||||
"uni-datetime-picker.startDate": "start date",
|
||||
"uni-datetime-picker.endDate": "end date",
|
||||
"uni-datetime-picker.startTime": "start time",
|
||||
"uni-datetime-picker.endTime": "end time",
|
||||
"uni-datetime-picker.ok": "ok",
|
||||
"uni-datetime-picker.clear": "clear",
|
||||
"uni-datetime-picker.cancel": "cancel",
|
||||
"uni-datetime-picker.year": "-",
|
||||
"uni-datetime-picker.month": "",
|
||||
"uni-calender.MON": "MON",
|
||||
"uni-calender.TUE": "TUE",
|
||||
"uni-calender.WED": "WED",
|
||||
"uni-calender.THU": "THU",
|
||||
"uni-calender.FRI": "FRI",
|
||||
"uni-calender.SAT": "SAT",
|
||||
"uni-calender.SUN": "SUN",
|
||||
"uni-calender.confirm": "confirm"
|
||||
};
|
||||
const zhHans = {
|
||||
"uni-datetime-picker.selectDate": "选择日期",
|
||||
"uni-datetime-picker.selectTime": "选择时间",
|
||||
"uni-datetime-picker.selectDateTime": "选择日期时间",
|
||||
"uni-datetime-picker.startDate": "开始日期",
|
||||
"uni-datetime-picker.endDate": "结束日期",
|
||||
"uni-datetime-picker.startTime": "开始时间",
|
||||
"uni-datetime-picker.endTime": "结束时间",
|
||||
"uni-datetime-picker.ok": "确定",
|
||||
"uni-datetime-picker.clear": "清除",
|
||||
"uni-datetime-picker.cancel": "取消",
|
||||
"uni-datetime-picker.year": "年",
|
||||
"uni-datetime-picker.month": "月",
|
||||
"uni-calender.SUN": "日",
|
||||
"uni-calender.MON": "一",
|
||||
"uni-calender.TUE": "二",
|
||||
"uni-calender.WED": "三",
|
||||
"uni-calender.THU": "四",
|
||||
"uni-calender.FRI": "五",
|
||||
"uni-calender.SAT": "六",
|
||||
"uni-calender.confirm": "确认"
|
||||
};
|
||||
const zhHant = {
|
||||
"uni-datetime-picker.selectDate": "選擇日期",
|
||||
"uni-datetime-picker.selectTime": "選擇時間",
|
||||
"uni-datetime-picker.selectDateTime": "選擇日期時間",
|
||||
"uni-datetime-picker.startDate": "開始日期",
|
||||
"uni-datetime-picker.endDate": "結束日期",
|
||||
"uni-datetime-picker.startTime": "開始时间",
|
||||
"uni-datetime-picker.endTime": "結束时间",
|
||||
"uni-datetime-picker.ok": "確定",
|
||||
"uni-datetime-picker.clear": "清除",
|
||||
"uni-datetime-picker.cancel": "取消",
|
||||
"uni-datetime-picker.year": "年",
|
||||
"uni-datetime-picker.month": "月",
|
||||
"uni-calender.SUN": "日",
|
||||
"uni-calender.MON": "一",
|
||||
"uni-calender.TUE": "二",
|
||||
"uni-calender.WED": "三",
|
||||
"uni-calender.THU": "四",
|
||||
"uni-calender.FRI": "五",
|
||||
"uni-calender.SAT": "六",
|
||||
"uni-calender.confirm": "確認"
|
||||
};
|
||||
const i18nMessages = {
|
||||
en,
|
||||
"zh-Hans": zhHans,
|
||||
"zh-Hant": zhHant
|
||||
};
|
||||
exports.i18nMessages = i18nMessages;
|
||||
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js.map
|
||||
|
|
@ -1,695 +0,0 @@
|
|||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_uniDatetimePicker_components_uniDatetimePicker_i18n_index = require("./i18n/index.js");
|
||||
const uni_modules_uniDatetimePicker_components_uniDatetimePicker_util = require("./util.js");
|
||||
const {
|
||||
t
|
||||
} = common_vendor.initVueI18n(uni_modules_uniDatetimePicker_components_uniDatetimePicker_i18n_index.i18nMessages);
|
||||
const _sfc_main = {
|
||||
name: "UniDatetimePicker",
|
||||
data() {
|
||||
return {
|
||||
indicatorStyle: `height: 50px;`,
|
||||
visible: false,
|
||||
fixNvueBug: {},
|
||||
dateShow: true,
|
||||
timeShow: true,
|
||||
title: "日期和时间",
|
||||
// 输入框当前时间
|
||||
time: "",
|
||||
// 当前的年月日时分秒
|
||||
year: 1920,
|
||||
month: 0,
|
||||
day: 0,
|
||||
hour: 0,
|
||||
minute: 0,
|
||||
second: 0,
|
||||
// 起始时间
|
||||
startYear: 1920,
|
||||
startMonth: 1,
|
||||
startDay: 1,
|
||||
startHour: 0,
|
||||
startMinute: 0,
|
||||
startSecond: 0,
|
||||
// 结束时间
|
||||
endYear: 2120,
|
||||
endMonth: 12,
|
||||
endDay: 31,
|
||||
endHour: 23,
|
||||
endMinute: 59,
|
||||
endSecond: 59
|
||||
};
|
||||
},
|
||||
options: {
|
||||
virtualHost: true
|
||||
},
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: "datetime"
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: ""
|
||||
},
|
||||
modelValue: {
|
||||
type: [String, Number],
|
||||
default: ""
|
||||
},
|
||||
start: {
|
||||
type: [Number, String],
|
||||
default: ""
|
||||
},
|
||||
end: {
|
||||
type: [Number, String],
|
||||
default: ""
|
||||
},
|
||||
returnType: {
|
||||
type: String,
|
||||
default: "string"
|
||||
},
|
||||
disabled: {
|
||||
type: [Boolean, String],
|
||||
default: false
|
||||
},
|
||||
border: {
|
||||
type: [Boolean, String],
|
||||
default: true
|
||||
},
|
||||
hideSecond: {
|
||||
type: [Boolean, String],
|
||||
default: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
modelValue: {
|
||||
handler(newVal) {
|
||||
if (newVal) {
|
||||
this.parseValue(uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.fixIosDateFormat(newVal));
|
||||
this.initTime(false);
|
||||
} else {
|
||||
this.time = "";
|
||||
this.parseValue(Date.now());
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
type: {
|
||||
handler(newValue) {
|
||||
if (newValue === "date") {
|
||||
this.dateShow = true;
|
||||
this.timeShow = false;
|
||||
this.title = "日期";
|
||||
} else if (newValue === "time") {
|
||||
this.dateShow = false;
|
||||
this.timeShow = true;
|
||||
this.title = "时间";
|
||||
} else {
|
||||
this.dateShow = true;
|
||||
this.timeShow = true;
|
||||
this.title = "日期和时间";
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
start: {
|
||||
handler(newVal) {
|
||||
this.parseDatetimeRange(uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.fixIosDateFormat(newVal), "start");
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
end: {
|
||||
handler(newVal) {
|
||||
this.parseDatetimeRange(uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.fixIosDateFormat(newVal), "end");
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
// 月、日、时、分、秒可选范围变化后,检查当前值是否在范围内,不在则当前值重置为可选范围第一项
|
||||
months(newVal) {
|
||||
this.checkValue("month", this.month, newVal);
|
||||
},
|
||||
days(newVal) {
|
||||
this.checkValue("day", this.day, newVal);
|
||||
},
|
||||
hours(newVal) {
|
||||
this.checkValue("hour", this.hour, newVal);
|
||||
},
|
||||
minutes(newVal) {
|
||||
this.checkValue("minute", this.minute, newVal);
|
||||
},
|
||||
seconds(newVal) {
|
||||
this.checkValue("second", this.second, newVal);
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 当前年、月、日、时、分、秒选择范围
|
||||
years() {
|
||||
return this.getCurrentRange("year");
|
||||
},
|
||||
months() {
|
||||
return this.getCurrentRange("month");
|
||||
},
|
||||
days() {
|
||||
return this.getCurrentRange("day");
|
||||
},
|
||||
hours() {
|
||||
return this.getCurrentRange("hour");
|
||||
},
|
||||
minutes() {
|
||||
return this.getCurrentRange("minute");
|
||||
},
|
||||
seconds() {
|
||||
return this.getCurrentRange("second");
|
||||
},
|
||||
// picker 当前值数组
|
||||
ymd() {
|
||||
return [this.year - this.minYear, this.month - this.minMonth, this.day - this.minDay];
|
||||
},
|
||||
hms() {
|
||||
return [this.hour - this.minHour, this.minute - this.minMinute, this.second - this.minSecond];
|
||||
},
|
||||
// 当前 date 是 start
|
||||
currentDateIsStart() {
|
||||
return this.year === this.startYear && this.month === this.startMonth && this.day === this.startDay;
|
||||
},
|
||||
// 当前 date 是 end
|
||||
currentDateIsEnd() {
|
||||
return this.year === this.endYear && this.month === this.endMonth && this.day === this.endDay;
|
||||
},
|
||||
// 当前年、月、日、时、分、秒的最小值和最大值
|
||||
minYear() {
|
||||
return this.startYear;
|
||||
},
|
||||
maxYear() {
|
||||
return this.endYear;
|
||||
},
|
||||
minMonth() {
|
||||
if (this.year === this.startYear) {
|
||||
return this.startMonth;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
},
|
||||
maxMonth() {
|
||||
if (this.year === this.endYear) {
|
||||
return this.endMonth;
|
||||
} else {
|
||||
return 12;
|
||||
}
|
||||
},
|
||||
minDay() {
|
||||
if (this.year === this.startYear && this.month === this.startMonth) {
|
||||
return this.startDay;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
},
|
||||
maxDay() {
|
||||
if (this.year === this.endYear && this.month === this.endMonth) {
|
||||
return this.endDay;
|
||||
} else {
|
||||
return this.daysInMonth(this.year, this.month);
|
||||
}
|
||||
},
|
||||
minHour() {
|
||||
if (this.type === "datetime") {
|
||||
if (this.currentDateIsStart) {
|
||||
return this.startHour;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (this.type === "time") {
|
||||
return this.startHour;
|
||||
}
|
||||
},
|
||||
maxHour() {
|
||||
if (this.type === "datetime") {
|
||||
if (this.currentDateIsEnd) {
|
||||
return this.endHour;
|
||||
} else {
|
||||
return 23;
|
||||
}
|
||||
}
|
||||
if (this.type === "time") {
|
||||
return this.endHour;
|
||||
}
|
||||
},
|
||||
minMinute() {
|
||||
if (this.type === "datetime") {
|
||||
if (this.currentDateIsStart && this.hour === this.startHour) {
|
||||
return this.startMinute;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (this.type === "time") {
|
||||
if (this.hour === this.startHour) {
|
||||
return this.startMinute;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
maxMinute() {
|
||||
if (this.type === "datetime") {
|
||||
if (this.currentDateIsEnd && this.hour === this.endHour) {
|
||||
return this.endMinute;
|
||||
} else {
|
||||
return 59;
|
||||
}
|
||||
}
|
||||
if (this.type === "time") {
|
||||
if (this.hour === this.endHour) {
|
||||
return this.endMinute;
|
||||
} else {
|
||||
return 59;
|
||||
}
|
||||
}
|
||||
},
|
||||
minSecond() {
|
||||
if (this.type === "datetime") {
|
||||
if (this.currentDateIsStart && this.hour === this.startHour && this.minute === this.startMinute) {
|
||||
return this.startSecond;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (this.type === "time") {
|
||||
if (this.hour === this.startHour && this.minute === this.startMinute) {
|
||||
return this.startSecond;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
maxSecond() {
|
||||
if (this.type === "datetime") {
|
||||
if (this.currentDateIsEnd && this.hour === this.endHour && this.minute === this.endMinute) {
|
||||
return this.endSecond;
|
||||
} else {
|
||||
return 59;
|
||||
}
|
||||
}
|
||||
if (this.type === "time") {
|
||||
if (this.hour === this.endHour && this.minute === this.endMinute) {
|
||||
return this.endSecond;
|
||||
} else {
|
||||
return 59;
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* for i18n
|
||||
*/
|
||||
selectTimeText() {
|
||||
return t("uni-datetime-picker.selectTime");
|
||||
},
|
||||
okText() {
|
||||
return t("uni-datetime-picker.ok");
|
||||
},
|
||||
clearText() {
|
||||
return t("uni-datetime-picker.clear");
|
||||
},
|
||||
cancelText() {
|
||||
return t("uni-datetime-picker.cancel");
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* @param {Object} item
|
||||
* 小于 10 在前面加个 0
|
||||
*/
|
||||
lessThanTen(item) {
|
||||
return item < 10 ? "0" + item : item;
|
||||
},
|
||||
/**
|
||||
* 解析时分秒字符串,例如:00:00:00
|
||||
* @param {String} timeString
|
||||
*/
|
||||
parseTimeType(timeString) {
|
||||
if (timeString) {
|
||||
let timeArr = timeString.split(":");
|
||||
this.hour = Number(timeArr[0]);
|
||||
this.minute = Number(timeArr[1]);
|
||||
this.second = Number(timeArr[2]);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 解析选择器初始值,类型可以是字符串、时间戳,例如:2000-10-02、'08:30:00'、 1610695109000
|
||||
* @param {String | Number} datetime
|
||||
*/
|
||||
initPickerValue(datetime) {
|
||||
let defaultValue = null;
|
||||
if (datetime) {
|
||||
defaultValue = this.compareValueWithStartAndEnd(datetime, this.start, this.end);
|
||||
} else {
|
||||
defaultValue = Date.now();
|
||||
defaultValue = this.compareValueWithStartAndEnd(defaultValue, this.start, this.end);
|
||||
}
|
||||
this.parseValue(defaultValue);
|
||||
},
|
||||
/**
|
||||
* 初始值规则:
|
||||
* - 用户设置初始值 value
|
||||
* - 设置了起始时间 start、终止时间 end,并 start < value < end,初始值为 value, 否则初始值为 start
|
||||
* - 只设置了起始时间 start,并 start < value,初始值为 value,否则初始值为 start
|
||||
* - 只设置了终止时间 end,并 value < end,初始值为 value,否则初始值为 end
|
||||
* - 无起始终止时间,则初始值为 value
|
||||
* - 无初始值 value,则初始值为当前本地时间 Date.now()
|
||||
* @param {Object} value
|
||||
* @param {Object} dateBase
|
||||
*/
|
||||
compareValueWithStartAndEnd(value, start, end) {
|
||||
let winner = null;
|
||||
value = this.superTimeStamp(value);
|
||||
start = this.superTimeStamp(start);
|
||||
end = this.superTimeStamp(end);
|
||||
if (start && end) {
|
||||
if (value < start) {
|
||||
winner = new Date(start);
|
||||
} else if (value > end) {
|
||||
winner = new Date(end);
|
||||
} else {
|
||||
winner = new Date(value);
|
||||
}
|
||||
} else if (start && !end) {
|
||||
winner = start <= value ? new Date(value) : new Date(start);
|
||||
} else if (!start && end) {
|
||||
winner = value <= end ? new Date(value) : new Date(end);
|
||||
} else {
|
||||
winner = new Date(value);
|
||||
}
|
||||
return winner;
|
||||
},
|
||||
/**
|
||||
* 转换为可比较的时间戳,接受日期、时分秒、时间戳
|
||||
* @param {Object} value
|
||||
*/
|
||||
superTimeStamp(value) {
|
||||
let dateBase = "";
|
||||
if (this.type === "time" && value && typeof value === "string") {
|
||||
const now = /* @__PURE__ */ new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = now.getMonth() + 1;
|
||||
const day = now.getDate();
|
||||
dateBase = year + "/" + month + "/" + day + " ";
|
||||
}
|
||||
if (Number(value)) {
|
||||
value = parseInt(value);
|
||||
dateBase = 0;
|
||||
}
|
||||
return this.createTimeStamp(dateBase + value);
|
||||
},
|
||||
/**
|
||||
* 解析默认值 value,字符串、时间戳
|
||||
* @param {Object} defaultTime
|
||||
*/
|
||||
parseValue(value) {
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
if (this.type === "time" && typeof value === "string") {
|
||||
this.parseTimeType(value);
|
||||
} else {
|
||||
let defaultDate = null;
|
||||
defaultDate = new Date(value);
|
||||
if (this.type !== "time") {
|
||||
this.year = defaultDate.getFullYear();
|
||||
this.month = defaultDate.getMonth() + 1;
|
||||
this.day = defaultDate.getDate();
|
||||
}
|
||||
if (this.type !== "date") {
|
||||
this.hour = defaultDate.getHours();
|
||||
this.minute = defaultDate.getMinutes();
|
||||
this.second = defaultDate.getSeconds();
|
||||
}
|
||||
}
|
||||
if (this.hideSecond) {
|
||||
this.second = 0;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 解析可选择时间范围 start、end,年月日字符串、时间戳
|
||||
* @param {Object} defaultTime
|
||||
*/
|
||||
parseDatetimeRange(point, pointType) {
|
||||
if (!point) {
|
||||
if (pointType === "start") {
|
||||
this.startYear = 1920;
|
||||
this.startMonth = 1;
|
||||
this.startDay = 1;
|
||||
this.startHour = 0;
|
||||
this.startMinute = 0;
|
||||
this.startSecond = 0;
|
||||
}
|
||||
if (pointType === "end") {
|
||||
this.endYear = 2120;
|
||||
this.endMonth = 12;
|
||||
this.endDay = 31;
|
||||
this.endHour = 23;
|
||||
this.endMinute = 59;
|
||||
this.endSecond = 59;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (this.type === "time") {
|
||||
const pointArr = point.split(":");
|
||||
this[pointType + "Hour"] = Number(pointArr[0]);
|
||||
this[pointType + "Minute"] = Number(pointArr[1]);
|
||||
this[pointType + "Second"] = Number(pointArr[2]);
|
||||
} else {
|
||||
if (!point) {
|
||||
pointType === "start" ? this.startYear = this.year - 60 : this.endYear = this.year + 60;
|
||||
return;
|
||||
}
|
||||
if (Number(point)) {
|
||||
point = parseInt(point);
|
||||
}
|
||||
const hasTime = /[0-9]:[0-9]/;
|
||||
if (this.type === "datetime" && pointType === "end" && typeof point === "string" && !hasTime.test(
|
||||
point
|
||||
)) {
|
||||
point = point + " 23:59:59";
|
||||
}
|
||||
const pointDate = new Date(point);
|
||||
this[pointType + "Year"] = pointDate.getFullYear();
|
||||
this[pointType + "Month"] = pointDate.getMonth() + 1;
|
||||
this[pointType + "Day"] = pointDate.getDate();
|
||||
if (this.type === "datetime") {
|
||||
this[pointType + "Hour"] = pointDate.getHours();
|
||||
this[pointType + "Minute"] = pointDate.getMinutes();
|
||||
this[pointType + "Second"] = pointDate.getSeconds();
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取 年、月、日、时、分、秒 当前可选范围
|
||||
getCurrentRange(value) {
|
||||
const range = [];
|
||||
for (let i = this["min" + this.capitalize(value)]; i <= this["max" + this.capitalize(value)]; i++) {
|
||||
range.push(i);
|
||||
}
|
||||
return range;
|
||||
},
|
||||
// 字符串首字母大写
|
||||
capitalize(str) {
|
||||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||
},
|
||||
// 检查当前值是否在范围内,不在则当前值重置为可选范围第一项
|
||||
checkValue(name, value, values) {
|
||||
if (values.indexOf(value) === -1) {
|
||||
this[name] = values[0];
|
||||
}
|
||||
},
|
||||
// 每个月的实际天数
|
||||
daysInMonth(year, month) {
|
||||
return new Date(year, month, 0).getDate();
|
||||
},
|
||||
/**
|
||||
* 生成时间戳
|
||||
* @param {Object} time
|
||||
*/
|
||||
createTimeStamp(time) {
|
||||
if (!time)
|
||||
return;
|
||||
if (typeof time === "number") {
|
||||
return time;
|
||||
} else {
|
||||
time = time.replace(/-/g, "/");
|
||||
if (this.type === "date") {
|
||||
time = time + " 00:00:00";
|
||||
}
|
||||
return Date.parse(time);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生成日期或时间的字符串
|
||||
*/
|
||||
createDomSting() {
|
||||
const yymmdd = this.year + "-" + this.lessThanTen(this.month) + "-" + this.lessThanTen(this.day);
|
||||
let hhmmss = this.lessThanTen(this.hour) + ":" + this.lessThanTen(this.minute);
|
||||
if (!this.hideSecond) {
|
||||
hhmmss = hhmmss + ":" + this.lessThanTen(this.second);
|
||||
}
|
||||
if (this.type === "date") {
|
||||
return yymmdd;
|
||||
} else if (this.type === "time") {
|
||||
return hhmmss;
|
||||
} else {
|
||||
return yymmdd + " " + hhmmss;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 初始化返回值,并抛出 change 事件
|
||||
*/
|
||||
initTime(emit = true) {
|
||||
this.time = this.createDomSting();
|
||||
if (!emit)
|
||||
return;
|
||||
if (this.returnType === "timestamp" && this.type !== "time") {
|
||||
this.$emit("change", this.createTimeStamp(this.time));
|
||||
this.$emit("input", this.createTimeStamp(this.time));
|
||||
this.$emit("update:modelValue", this.createTimeStamp(this.time));
|
||||
} else {
|
||||
this.$emit("change", this.time);
|
||||
this.$emit("input", this.time);
|
||||
this.$emit("update:modelValue", this.time);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 用户选择日期或时间更新 data
|
||||
* @param {Object} e
|
||||
*/
|
||||
bindDateChange(e) {
|
||||
const val = e.detail.value;
|
||||
this.year = this.years[val[0]];
|
||||
this.month = this.months[val[1]];
|
||||
this.day = this.days[val[2]];
|
||||
},
|
||||
bindTimeChange(e) {
|
||||
const val = e.detail.value;
|
||||
this.hour = this.hours[val[0]];
|
||||
this.minute = this.minutes[val[1]];
|
||||
this.second = this.seconds[val[2]];
|
||||
},
|
||||
/**
|
||||
* 初始化弹出层
|
||||
*/
|
||||
initTimePicker() {
|
||||
if (this.disabled)
|
||||
return;
|
||||
const value = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.fixIosDateFormat(this.time);
|
||||
this.initPickerValue(value);
|
||||
this.visible = !this.visible;
|
||||
},
|
||||
/**
|
||||
* 触发或关闭弹框
|
||||
*/
|
||||
tiggerTimePicker(e) {
|
||||
this.visible = !this.visible;
|
||||
},
|
||||
/**
|
||||
* 用户点击“清空”按钮,清空当前值
|
||||
*/
|
||||
clearTime() {
|
||||
this.time = "";
|
||||
this.$emit("change", this.time);
|
||||
this.$emit("input", this.time);
|
||||
this.$emit("update:modelValue", this.time);
|
||||
this.tiggerTimePicker();
|
||||
},
|
||||
/**
|
||||
* 用户点击“确定”按钮
|
||||
*/
|
||||
setTime() {
|
||||
this.initTime();
|
||||
this.tiggerTimePicker();
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t($data.time),
|
||||
b: !$data.time
|
||||
}, !$data.time ? {
|
||||
c: common_vendor.t($options.selectTimeText)
|
||||
} : {}, {
|
||||
d: $props.disabled ? 1 : "",
|
||||
e: $props.border ? 1 : "",
|
||||
f: common_vendor.o((...args) => $options.initTimePicker && $options.initTimePicker(...args)),
|
||||
g: $data.visible
|
||||
}, $data.visible ? {
|
||||
h: common_vendor.o((...args) => $options.tiggerTimePicker && $options.tiggerTimePicker(...args))
|
||||
} : {}, {
|
||||
i: $data.visible
|
||||
}, $data.visible ? common_vendor.e({
|
||||
j: common_vendor.t($options.selectTimeText),
|
||||
k: $data.dateShow
|
||||
}, $data.dateShow ? {
|
||||
l: common_vendor.f($options.years, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t($options.lessThanTen(item)),
|
||||
b: index
|
||||
};
|
||||
}),
|
||||
m: common_vendor.f($options.months, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t($options.lessThanTen(item)),
|
||||
b: index
|
||||
};
|
||||
}),
|
||||
n: common_vendor.f($options.days, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t($options.lessThanTen(item)),
|
||||
b: index
|
||||
};
|
||||
}),
|
||||
o: $data.indicatorStyle,
|
||||
p: $options.ymd,
|
||||
q: common_vendor.o((...args) => $options.bindDateChange && $options.bindDateChange(...args))
|
||||
} : {}, {
|
||||
r: $data.timeShow
|
||||
}, $data.timeShow ? common_vendor.e({
|
||||
s: common_vendor.f($options.hours, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t($options.lessThanTen(item)),
|
||||
b: index
|
||||
};
|
||||
}),
|
||||
t: common_vendor.f($options.minutes, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t($options.lessThanTen(item)),
|
||||
b: index
|
||||
};
|
||||
}),
|
||||
v: !$props.hideSecond
|
||||
}, !$props.hideSecond ? {
|
||||
w: common_vendor.f($options.seconds, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t($options.lessThanTen(item)),
|
||||
b: index
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
x: common_vendor.n($props.hideSecond ? "time-hide-second" : ""),
|
||||
y: $data.indicatorStyle,
|
||||
z: $options.hms,
|
||||
A: common_vendor.o((...args) => $options.bindTimeChange && $options.bindTimeChange(...args)),
|
||||
B: common_vendor.n($props.hideSecond ? "sign-center" : "sign-left"),
|
||||
C: !$props.hideSecond
|
||||
}, !$props.hideSecond ? {} : {}) : {}, {
|
||||
D: common_vendor.t($options.clearText),
|
||||
E: common_vendor.o((...args) => $options.clearTime && $options.clearTime(...args)),
|
||||
F: common_vendor.t($options.cancelText),
|
||||
G: common_vendor.o((...args) => $options.tiggerTimePicker && $options.tiggerTimePicker(...args)),
|
||||
H: common_vendor.t($options.okText),
|
||||
I: common_vendor.o((...args) => $options.setTime && $options.setTime(...args)),
|
||||
J: common_vendor.n($data.dateShow && $data.timeShow ? "" : "fix-nvue-height"),
|
||||
K: common_vendor.s($data.fixNvueBug)
|
||||
}) : {});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.js.map
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
<view class="uni-datetime-picker"><view bindtap="{{f}}"><block wx:if="{{$slots.d}}"><slot></slot></block><block wx:else><view class="{{['uni-datetime-picker-timebox-pointer', d && 'uni-datetime-picker-disabled', e && 'uni-datetime-picker-timebox']}}"><text class="uni-datetime-picker-text">{{a}}</text><view wx:if="{{b}}" class="uni-datetime-picker-time"><text class="uni-datetime-picker-text">{{c}}</text></view></view></block></view><view wx:if="{{g}}" id="mask" class="uni-datetime-picker-mask" bindtap="{{h}}"></view><view wx:if="{{i}}" class="{{['uni-datetime-picker-popup', J]}}" style="{{K}}"><view class="uni-title"><text class="uni-datetime-picker-text">{{j}}</text></view><view wx:if="{{k}}" class="uni-datetime-picker__container-box"><block wx:if="{{r0}}"><picker-view class="uni-datetime-picker-view" indicator-style="{{o}}" value="{{p}}" bindchange="{{q}}"><picker-view-column><view wx:for="{{l}}" wx:for-item="item" wx:key="b" class="uni-datetime-picker-item"><text class="uni-datetime-picker-item">{{item.a}}</text></view></picker-view-column><picker-view-column><view wx:for="{{m}}" wx:for-item="item" wx:key="b" class="uni-datetime-picker-item"><text class="uni-datetime-picker-item">{{item.a}}</text></view></picker-view-column><picker-view-column><view wx:for="{{n}}" wx:for-item="item" wx:key="b" class="uni-datetime-picker-item"><text class="uni-datetime-picker-item">{{item.a}}</text></view></picker-view-column></picker-view></block><text class="uni-datetime-picker-sign sign-left">-</text><text class="uni-datetime-picker-sign sign-right">-</text></view><view wx:if="{{r}}" class="uni-datetime-picker__container-box"><block wx:if="{{r0}}"><picker-view class="{{['uni-datetime-picker-view', x]}}" indicator-style="{{y}}" value="{{z}}" bindchange="{{A}}"><picker-view-column><view wx:for="{{s}}" wx:for-item="item" wx:key="b" class="uni-datetime-picker-item"><text class="uni-datetime-picker-item">{{item.a}}</text></view></picker-view-column><picker-view-column><view wx:for="{{t}}" wx:for-item="item" wx:key="b" class="uni-datetime-picker-item"><text class="uni-datetime-picker-item">{{item.a}}</text></view></picker-view-column><picker-view-column wx:if="{{v}}"><view wx:for="{{w}}" wx:for-item="item" wx:key="b" class="uni-datetime-picker-item"><text class="uni-datetime-picker-item">{{item.a}}</text></view></picker-view-column></picker-view></block><text class="{{['uni-datetime-picker-sign', B]}}">:</text><text wx:if="{{C}}" class="uni-datetime-picker-sign sign-right">:</text></view><view class="uni-datetime-picker-btn"><view bindtap="{{E}}"><text class="uni-datetime-picker-btn-text">{{D}}</text></view><view class="uni-datetime-picker-btn-group"><view class="uni-datetime-picker-cancel" bindtap="{{G}}"><text class="uni-datetime-picker-btn-text">{{F}}</text></view><view bindtap="{{I}}"><text class="uni-datetime-picker-btn-text">{{H}}</text></view></view></view></view></view>
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.uni-datetime-picker {
|
||||
/* width: 100%; */
|
||||
}
|
||||
.uni-datetime-picker-view {
|
||||
height: 130px;
|
||||
width: 270px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.uni-datetime-picker-item {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
.uni-datetime-picker-btn {
|
||||
margin-top: 60px;
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.uni-datetime-picker-btn-text {
|
||||
font-size: 14px;
|
||||
color: #007aff;
|
||||
}
|
||||
.uni-datetime-picker-btn-group {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.uni-datetime-picker-cancel {
|
||||
margin-right: 30px;
|
||||
}
|
||||
.uni-datetime-picker-mask {
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
transition-duration: 0.3s;
|
||||
z-index: 998;
|
||||
}
|
||||
.uni-datetime-picker-popup {
|
||||
border-radius: 8px;
|
||||
padding: 30px;
|
||||
width: 270px;
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
transition-duration: 0.3s;
|
||||
z-index: 999;
|
||||
}
|
||||
.uni-datetime-picker-time {
|
||||
color: grey;
|
||||
}
|
||||
.uni-datetime-picker-column {
|
||||
height: 50px;
|
||||
}
|
||||
.uni-datetime-picker-timebox {
|
||||
border: 1px solid #E5E5E5;
|
||||
border-radius: 5px;
|
||||
padding: 7px 10px;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
}
|
||||
.uni-datetime-picker-timebox-pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
.uni-datetime-picker-disabled {
|
||||
opacity: 0.4;
|
||||
}
|
||||
.uni-datetime-picker-text {
|
||||
font-size: 14px;
|
||||
line-height: 50px;
|
||||
}
|
||||
.uni-datetime-picker-sign {
|
||||
position: absolute;
|
||||
top: 53px;
|
||||
/* 减掉 10px 的元素高度,兼容nvue */
|
||||
color: #999;
|
||||
}
|
||||
.sign-left {
|
||||
left: 86px;
|
||||
}
|
||||
.sign-right {
|
||||
right: 86px;
|
||||
}
|
||||
.sign-center {
|
||||
left: 135px;
|
||||
}
|
||||
.uni-datetime-picker__container-box {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 40px;
|
||||
}
|
||||
.time-hide-second {
|
||||
width: 180px;
|
||||
}
|
||||
|
|
@ -1,851 +0,0 @@
|
|||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_uniDatetimePicker_components_uniDatetimePicker_i18n_index = require("./i18n/index.js");
|
||||
const uni_modules_uniDatetimePicker_components_uniDatetimePicker_util = require("./util.js");
|
||||
const Calendar = () => "./calendar.js";
|
||||
const TimePicker = () => "./time-picker.js";
|
||||
const _sfc_main = {
|
||||
name: "UniDatetimePicker",
|
||||
options: {
|
||||
virtualHost: true
|
||||
},
|
||||
components: {
|
||||
Calendar,
|
||||
TimePicker
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isRange: false,
|
||||
hasTime: false,
|
||||
displayValue: "",
|
||||
inputDate: "",
|
||||
calendarDate: "",
|
||||
pickerTime: "",
|
||||
calendarRange: {
|
||||
startDate: "",
|
||||
startTime: "",
|
||||
endDate: "",
|
||||
endTime: ""
|
||||
},
|
||||
displayRangeValue: {
|
||||
startDate: "",
|
||||
endDate: ""
|
||||
},
|
||||
tempRange: {
|
||||
startDate: "",
|
||||
startTime: "",
|
||||
endDate: "",
|
||||
endTime: ""
|
||||
},
|
||||
// 左右日历同步数据
|
||||
startMultipleStatus: {
|
||||
before: "",
|
||||
after: "",
|
||||
data: [],
|
||||
fulldate: ""
|
||||
},
|
||||
endMultipleStatus: {
|
||||
before: "",
|
||||
after: "",
|
||||
data: [],
|
||||
fulldate: ""
|
||||
},
|
||||
pickerVisible: false,
|
||||
pickerPositionStyle: null,
|
||||
isEmitValue: false,
|
||||
isPhone: false,
|
||||
isFirstShow: true,
|
||||
i18nT: () => {
|
||||
}
|
||||
};
|
||||
},
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: "datetime"
|
||||
},
|
||||
value: {
|
||||
type: [String, Number, Array, Date],
|
||||
default: ""
|
||||
},
|
||||
modelValue: {
|
||||
type: [String, Number, Array, Date],
|
||||
default: ""
|
||||
},
|
||||
start: {
|
||||
type: [Number, String],
|
||||
default: ""
|
||||
},
|
||||
end: {
|
||||
type: [Number, String],
|
||||
default: ""
|
||||
},
|
||||
returnType: {
|
||||
type: String,
|
||||
default: "string"
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
startPlaceholder: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
endPlaceholder: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
rangeSeparator: {
|
||||
type: String,
|
||||
default: "-"
|
||||
},
|
||||
border: {
|
||||
type: [Boolean],
|
||||
default: true
|
||||
},
|
||||
disabled: {
|
||||
type: [Boolean],
|
||||
default: false
|
||||
},
|
||||
clearIcon: {
|
||||
type: [Boolean],
|
||||
default: true
|
||||
},
|
||||
hideSecond: {
|
||||
type: [Boolean],
|
||||
default: false
|
||||
},
|
||||
defaultValue: {
|
||||
type: [String, Object, Array],
|
||||
default: ""
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
type: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
this.hasTime = newVal.indexOf("time") !== -1;
|
||||
this.isRange = newVal.indexOf("range") !== -1;
|
||||
}
|
||||
},
|
||||
modelValue: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
if (this.isEmitValue) {
|
||||
this.isEmitValue = false;
|
||||
return;
|
||||
}
|
||||
this.initPicker(newVal);
|
||||
}
|
||||
},
|
||||
start: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
if (!newVal)
|
||||
return;
|
||||
this.calendarRange.startDate = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDate(newVal);
|
||||
if (this.hasTime) {
|
||||
this.calendarRange.startTime = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getTime(newVal);
|
||||
}
|
||||
}
|
||||
},
|
||||
end: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
if (!newVal)
|
||||
return;
|
||||
this.calendarRange.endDate = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDate(newVal);
|
||||
if (this.hasTime) {
|
||||
this.calendarRange.endTime = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getTime(newVal, this.hideSecond);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
timepickerStartTime() {
|
||||
const activeDate = this.isRange ? this.tempRange.startDate : this.inputDate;
|
||||
return activeDate === this.calendarRange.startDate ? this.calendarRange.startTime : "";
|
||||
},
|
||||
timepickerEndTime() {
|
||||
const activeDate = this.isRange ? this.tempRange.endDate : this.inputDate;
|
||||
return activeDate === this.calendarRange.endDate ? this.calendarRange.endTime : "";
|
||||
},
|
||||
mobileCalendarTime() {
|
||||
const timeRange = {
|
||||
start: this.tempRange.startTime,
|
||||
end: this.tempRange.endTime
|
||||
};
|
||||
return this.isRange ? timeRange : this.pickerTime;
|
||||
},
|
||||
mobSelectableTime() {
|
||||
return {
|
||||
start: this.calendarRange.startTime,
|
||||
end: this.calendarRange.endTime
|
||||
};
|
||||
},
|
||||
datePopupWidth() {
|
||||
return this.isRange ? 653 : 301;
|
||||
},
|
||||
/**
|
||||
* for i18n
|
||||
*/
|
||||
singlePlaceholderText() {
|
||||
return this.placeholder || (this.type === "date" ? this.selectDateText : this.selectDateTimeText);
|
||||
},
|
||||
startPlaceholderText() {
|
||||
return this.startPlaceholder || this.startDateText;
|
||||
},
|
||||
endPlaceholderText() {
|
||||
return this.endPlaceholder || this.endDateText;
|
||||
},
|
||||
selectDateText() {
|
||||
return this.i18nT("uni-datetime-picker.selectDate");
|
||||
},
|
||||
selectDateTimeText() {
|
||||
return this.i18nT("uni-datetime-picker.selectDateTime");
|
||||
},
|
||||
selectTimeText() {
|
||||
return this.i18nT("uni-datetime-picker.selectTime");
|
||||
},
|
||||
startDateText() {
|
||||
return this.startPlaceholder || this.i18nT("uni-datetime-picker.startDate");
|
||||
},
|
||||
startTimeText() {
|
||||
return this.i18nT("uni-datetime-picker.startTime");
|
||||
},
|
||||
endDateText() {
|
||||
return this.endPlaceholder || this.i18nT("uni-datetime-picker.endDate");
|
||||
},
|
||||
endTimeText() {
|
||||
return this.i18nT("uni-datetime-picker.endTime");
|
||||
},
|
||||
okText() {
|
||||
return this.i18nT("uni-datetime-picker.ok");
|
||||
},
|
||||
clearText() {
|
||||
return this.i18nT("uni-datetime-picker.clear");
|
||||
},
|
||||
showClearIcon() {
|
||||
return this.clearIcon && !this.disabled && (this.displayValue || this.displayRangeValue.startDate && this.displayRangeValue.endDate);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initI18nT();
|
||||
this.platform();
|
||||
},
|
||||
methods: {
|
||||
initI18nT() {
|
||||
const vueI18n = common_vendor.initVueI18n(uni_modules_uniDatetimePicker_components_uniDatetimePicker_i18n_index.i18nMessages);
|
||||
this.i18nT = vueI18n.t;
|
||||
},
|
||||
initPicker(newVal) {
|
||||
if (!newVal && !this.defaultValue || Array.isArray(newVal) && !newVal.length) {
|
||||
this.$nextTick(() => {
|
||||
this.clear(false);
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!Array.isArray(newVal) && !this.isRange) {
|
||||
if (newVal) {
|
||||
this.displayValue = this.inputDate = this.calendarDate = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDate(newVal);
|
||||
if (this.hasTime) {
|
||||
this.pickerTime = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getTime(newVal, this.hideSecond);
|
||||
this.displayValue = `${this.displayValue} ${this.pickerTime}`;
|
||||
}
|
||||
} else if (this.defaultValue) {
|
||||
this.inputDate = this.calendarDate = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDate(this.defaultValue);
|
||||
if (this.hasTime) {
|
||||
this.pickerTime = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getTime(this.defaultValue, this.hideSecond);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const [before, after] = newVal;
|
||||
if (!before && !after)
|
||||
return;
|
||||
const beforeDate = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDate(before);
|
||||
const beforeTime = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getTime(before, this.hideSecond);
|
||||
const afterDate = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDate(after);
|
||||
const afterTime = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getTime(after, this.hideSecond);
|
||||
const startDate = beforeDate;
|
||||
const endDate = afterDate;
|
||||
this.displayRangeValue.startDate = this.tempRange.startDate = startDate;
|
||||
this.displayRangeValue.endDate = this.tempRange.endDate = endDate;
|
||||
if (this.hasTime) {
|
||||
this.displayRangeValue.startDate = `${beforeDate} ${beforeTime}`;
|
||||
this.displayRangeValue.endDate = `${afterDate} ${afterTime}`;
|
||||
this.tempRange.startTime = beforeTime;
|
||||
this.tempRange.endTime = afterTime;
|
||||
}
|
||||
const defaultRange = {
|
||||
before: beforeDate,
|
||||
after: afterDate
|
||||
};
|
||||
this.startMultipleStatus = Object.assign({}, this.startMultipleStatus, defaultRange, {
|
||||
which: "right"
|
||||
});
|
||||
this.endMultipleStatus = Object.assign({}, this.endMultipleStatus, defaultRange, {
|
||||
which: "left"
|
||||
});
|
||||
}
|
||||
},
|
||||
updateLeftCale(e) {
|
||||
const left = this.$refs.left;
|
||||
left.cale.setHoverMultiple(e.after);
|
||||
left.setDate(this.$refs.left.nowDate.fullDate);
|
||||
},
|
||||
updateRightCale(e) {
|
||||
const right = this.$refs.right;
|
||||
right.cale.setHoverMultiple(e.after);
|
||||
right.setDate(this.$refs.right.nowDate.fullDate);
|
||||
},
|
||||
platform() {
|
||||
if (typeof navigator !== "undefined") {
|
||||
this.isPhone = navigator.userAgent.toLowerCase().indexOf("mobile") !== -1;
|
||||
return;
|
||||
}
|
||||
const {
|
||||
windowWidth
|
||||
} = common_vendor.index.getWindowInfo();
|
||||
this.isPhone = windowWidth <= 500;
|
||||
this.windowWidth = windowWidth;
|
||||
},
|
||||
show() {
|
||||
this.$emit("show");
|
||||
if (this.disabled) {
|
||||
return;
|
||||
}
|
||||
this.platform();
|
||||
if (this.isPhone) {
|
||||
setTimeout(() => {
|
||||
this.$refs.mobile.open();
|
||||
}, 0);
|
||||
return;
|
||||
}
|
||||
this.pickerPositionStyle = {
|
||||
top: "10px"
|
||||
};
|
||||
const dateEditor = common_vendor.index.createSelectorQuery().in(this).select(".uni-date-editor");
|
||||
dateEditor.boundingClientRect((rect) => {
|
||||
if (this.windowWidth - rect.left < this.datePopupWidth) {
|
||||
this.pickerPositionStyle.right = 0;
|
||||
}
|
||||
}).exec();
|
||||
setTimeout(() => {
|
||||
this.pickerVisible = !this.pickerVisible;
|
||||
if (!this.isPhone && this.isRange && this.isFirstShow) {
|
||||
this.isFirstShow = false;
|
||||
const {
|
||||
startDate,
|
||||
endDate
|
||||
} = this.calendarRange;
|
||||
if (startDate && endDate) {
|
||||
if (this.diffDate(startDate, endDate) < 30) {
|
||||
this.$refs.right.changeMonth("pre");
|
||||
}
|
||||
} else {
|
||||
if (this.isPhone) {
|
||||
this.$refs.right.cale.lastHover = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 50);
|
||||
},
|
||||
close() {
|
||||
setTimeout(() => {
|
||||
this.pickerVisible = false;
|
||||
this.$emit("maskClick", this.value);
|
||||
this.$refs.mobile && this.$refs.mobile.close();
|
||||
}, 20);
|
||||
},
|
||||
setEmit(value) {
|
||||
if (this.returnType === "timestamp" || this.returnType === "date") {
|
||||
if (!Array.isArray(value)) {
|
||||
if (!this.hasTime) {
|
||||
value = value + " 00:00:00";
|
||||
}
|
||||
value = this.createTimestamp(value);
|
||||
if (this.returnType === "date") {
|
||||
value = new Date(value);
|
||||
}
|
||||
} else {
|
||||
if (!this.hasTime) {
|
||||
value[0] = value[0] + " 00:00:00";
|
||||
value[1] = value[1] + " 00:00:00";
|
||||
}
|
||||
value[0] = this.createTimestamp(value[0]);
|
||||
value[1] = this.createTimestamp(value[1]);
|
||||
if (this.returnType === "date") {
|
||||
value[0] = new Date(value[0]);
|
||||
value[1] = new Date(value[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$emit("update:modelValue", value);
|
||||
this.$emit("input", value);
|
||||
this.$emit("change", value);
|
||||
this.isEmitValue = true;
|
||||
},
|
||||
createTimestamp(date) {
|
||||
date = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.fixIosDateFormat(date);
|
||||
return Date.parse(new Date(date));
|
||||
},
|
||||
singleChange(e) {
|
||||
this.calendarDate = this.inputDate = e.fulldate;
|
||||
if (this.hasTime)
|
||||
return;
|
||||
this.confirmSingleChange();
|
||||
},
|
||||
confirmSingleChange() {
|
||||
if (!uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.checkDate(this.inputDate)) {
|
||||
const now = /* @__PURE__ */ new Date();
|
||||
this.calendarDate = this.inputDate = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDate(now);
|
||||
this.pickerTime = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getTime(now, this.hideSecond);
|
||||
}
|
||||
let startLaterInputDate = false;
|
||||
let startDate, startTime;
|
||||
if (this.start) {
|
||||
let startString = this.start;
|
||||
if (typeof this.start === "number") {
|
||||
startString = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDateTime(this.start, this.hideSecond);
|
||||
}
|
||||
[startDate, startTime] = startString.split(" ");
|
||||
if (this.start && !uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.dateCompare(startDate, this.inputDate)) {
|
||||
startLaterInputDate = true;
|
||||
this.inputDate = startDate;
|
||||
}
|
||||
}
|
||||
let endEarlierInputDate = false;
|
||||
let endDate, endTime;
|
||||
if (this.end) {
|
||||
let endString = this.end;
|
||||
if (typeof this.end === "number") {
|
||||
endString = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDateTime(this.end, this.hideSecond);
|
||||
}
|
||||
[endDate, endTime] = endString.split(" ");
|
||||
if (this.end && !uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.dateCompare(this.inputDate, endDate)) {
|
||||
endEarlierInputDate = true;
|
||||
this.inputDate = endDate;
|
||||
}
|
||||
}
|
||||
if (this.hasTime) {
|
||||
if (startLaterInputDate) {
|
||||
this.pickerTime = startTime || uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDefaultSecond(this.hideSecond);
|
||||
}
|
||||
if (endEarlierInputDate) {
|
||||
this.pickerTime = endTime || uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDefaultSecond(this.hideSecond);
|
||||
}
|
||||
if (!this.pickerTime) {
|
||||
this.pickerTime = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getTime(Date.now(), this.hideSecond);
|
||||
}
|
||||
this.displayValue = `${this.inputDate} ${this.pickerTime}`;
|
||||
} else {
|
||||
this.displayValue = this.inputDate;
|
||||
}
|
||||
this.setEmit(this.displayValue);
|
||||
this.pickerVisible = false;
|
||||
},
|
||||
leftChange(e) {
|
||||
const {
|
||||
before,
|
||||
after
|
||||
} = e.range;
|
||||
this.rangeChange(before, after);
|
||||
const obj = {
|
||||
before: e.range.before,
|
||||
after: e.range.after,
|
||||
data: e.range.data,
|
||||
fulldate: e.fulldate
|
||||
};
|
||||
this.startMultipleStatus = Object.assign({}, this.startMultipleStatus, obj);
|
||||
this.$emit("calendarClick", e);
|
||||
},
|
||||
rightChange(e) {
|
||||
const {
|
||||
before,
|
||||
after
|
||||
} = e.range;
|
||||
this.rangeChange(before, after);
|
||||
const obj = {
|
||||
before: e.range.before,
|
||||
after: e.range.after,
|
||||
data: e.range.data,
|
||||
fulldate: e.fulldate
|
||||
};
|
||||
this.endMultipleStatus = Object.assign({}, this.endMultipleStatus, obj);
|
||||
this.$emit("calendarClick", e);
|
||||
},
|
||||
mobileChange(e) {
|
||||
if (this.isRange) {
|
||||
const {
|
||||
before,
|
||||
after
|
||||
} = e.range;
|
||||
if (!before) {
|
||||
return;
|
||||
}
|
||||
this.handleStartAndEnd(before, after, true);
|
||||
if (this.hasTime) {
|
||||
const {
|
||||
startTime,
|
||||
endTime
|
||||
} = e.timeRange;
|
||||
this.tempRange.startTime = startTime;
|
||||
this.tempRange.endTime = endTime;
|
||||
}
|
||||
this.confirmRangeChange();
|
||||
} else {
|
||||
if (this.hasTime) {
|
||||
this.displayValue = e.fulldate + " " + e.time;
|
||||
} else {
|
||||
this.displayValue = e.fulldate;
|
||||
}
|
||||
this.setEmit(this.displayValue);
|
||||
this.calendarDate = this.displayValue;
|
||||
}
|
||||
this.$refs.mobile.close();
|
||||
},
|
||||
rangeChange(before, after) {
|
||||
if (!(before && after))
|
||||
return;
|
||||
this.handleStartAndEnd(before, after, true);
|
||||
if (this.hasTime)
|
||||
return;
|
||||
this.confirmRangeChange();
|
||||
},
|
||||
confirmRangeChange() {
|
||||
if (!this.tempRange.startDate || !this.tempRange.endDate) {
|
||||
this.pickerVisible = false;
|
||||
return;
|
||||
}
|
||||
if (!uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.checkDate(this.tempRange.startDate)) {
|
||||
this.tempRange.startDate = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDate(Date.now());
|
||||
}
|
||||
if (!uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.checkDate(this.tempRange.endDate)) {
|
||||
this.tempRange.endDate = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDate(Date.now());
|
||||
}
|
||||
let start, end;
|
||||
let startDateLaterRangeStartDate = false;
|
||||
let startDateLaterRangeEndDate = false;
|
||||
let startDate, startTime;
|
||||
let compareStartDateString = this.tempRange.startDate;
|
||||
let compareEndDateString = this.tempRange.endDate;
|
||||
if (this.hasTime) {
|
||||
compareStartDateString = `${this.tempRange.startDate} ${this.tempRange.startTime}`;
|
||||
compareEndDateString = `${this.tempRange.endDate} ${this.tempRange.endTime}`;
|
||||
}
|
||||
if (this.start) {
|
||||
let startString = this.start;
|
||||
if (typeof this.start === "number") {
|
||||
startString = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDateTime(this.start, this.hideSecond);
|
||||
}
|
||||
[startDate, startTime] = startString.split(" ");
|
||||
if (this.start && !uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.dateCompare(this.start, compareStartDateString)) {
|
||||
startDateLaterRangeStartDate = true;
|
||||
this.tempRange.startDate = startDate;
|
||||
}
|
||||
if (this.start && !uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.dateCompare(this.start, compareEndDateString)) {
|
||||
startDateLaterRangeEndDate = true;
|
||||
this.tempRange.endDate = startDate;
|
||||
}
|
||||
}
|
||||
let endDateEarlierRangeStartDate = false;
|
||||
let endDateEarlierRangeEndDate = false;
|
||||
let endDate, endTime;
|
||||
if (this.end) {
|
||||
let endString = this.end;
|
||||
if (typeof this.end === "number") {
|
||||
endString = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDateTime(this.end, this.hideSecond);
|
||||
}
|
||||
[endDate, endTime] = endString.split(" ");
|
||||
if (this.end && !uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.dateCompare(compareStartDateString, this.end)) {
|
||||
endDateEarlierRangeStartDate = true;
|
||||
this.tempRange.startDate = endDate;
|
||||
}
|
||||
if (this.end && !uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.dateCompare(compareEndDateString, this.end)) {
|
||||
endDateEarlierRangeEndDate = true;
|
||||
this.tempRange.endDate = endDate;
|
||||
}
|
||||
}
|
||||
if (!this.hasTime) {
|
||||
start = this.displayRangeValue.startDate = this.tempRange.startDate;
|
||||
end = this.displayRangeValue.endDate = this.tempRange.endDate;
|
||||
} else {
|
||||
if (startDateLaterRangeStartDate) {
|
||||
this.tempRange.startTime = startTime || uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDefaultSecond(this.hideSecond);
|
||||
} else if (endDateEarlierRangeStartDate) {
|
||||
this.tempRange.startTime = endTime || uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDefaultSecond(this.hideSecond);
|
||||
}
|
||||
if (!this.tempRange.startTime) {
|
||||
this.tempRange.startTime = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getTime(Date.now(), this.hideSecond);
|
||||
}
|
||||
if (startDateLaterRangeEndDate) {
|
||||
this.tempRange.endTime = startTime || uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDefaultSecond(this.hideSecond);
|
||||
} else if (endDateEarlierRangeEndDate) {
|
||||
this.tempRange.endTime = endTime || uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getDefaultSecond(this.hideSecond);
|
||||
}
|
||||
if (!this.tempRange.endTime) {
|
||||
this.tempRange.endTime = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.getTime(Date.now(), this.hideSecond);
|
||||
}
|
||||
start = this.displayRangeValue.startDate = `${this.tempRange.startDate} ${this.tempRange.startTime}`;
|
||||
end = this.displayRangeValue.endDate = `${this.tempRange.endDate} ${this.tempRange.endTime}`;
|
||||
}
|
||||
if (!uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.dateCompare(start, end)) {
|
||||
[start, end] = [end, start];
|
||||
}
|
||||
this.displayRangeValue.startDate = start;
|
||||
this.displayRangeValue.endDate = end;
|
||||
const displayRange = [start, end];
|
||||
this.setEmit(displayRange);
|
||||
this.pickerVisible = false;
|
||||
},
|
||||
handleStartAndEnd(before, after, temp = false) {
|
||||
if (!before)
|
||||
return;
|
||||
if (!after)
|
||||
after = before;
|
||||
const type = temp ? "tempRange" : "range";
|
||||
const isStartEarlierEnd = uni_modules_uniDatetimePicker_components_uniDatetimePicker_util.dateCompare(before, after);
|
||||
this[type].startDate = isStartEarlierEnd ? before : after;
|
||||
this[type].endDate = isStartEarlierEnd ? after : before;
|
||||
},
|
||||
/**
|
||||
* 比较时间大小
|
||||
*/
|
||||
dateCompare(startDate, endDate) {
|
||||
startDate = new Date(startDate.replace("-", "/").replace("-", "/"));
|
||||
endDate = new Date(endDate.replace("-", "/").replace("-", "/"));
|
||||
return startDate <= endDate;
|
||||
},
|
||||
/**
|
||||
* 比较时间差
|
||||
*/
|
||||
diffDate(startDate, endDate) {
|
||||
startDate = new Date(startDate.replace("-", "/").replace("-", "/"));
|
||||
endDate = new Date(endDate.replace("-", "/").replace("-", "/"));
|
||||
const diff = (endDate - startDate) / (24 * 60 * 60 * 1e3);
|
||||
return Math.abs(diff);
|
||||
},
|
||||
clear(needEmit = true) {
|
||||
if (!this.isRange) {
|
||||
this.displayValue = "";
|
||||
this.inputDate = "";
|
||||
this.pickerTime = "";
|
||||
if (this.isPhone) {
|
||||
this.$refs.mobile && this.$refs.mobile.clearCalender();
|
||||
} else {
|
||||
this.$refs.pcSingle && this.$refs.pcSingle.clearCalender();
|
||||
}
|
||||
if (needEmit) {
|
||||
this.$emit("change", "");
|
||||
this.$emit("input", "");
|
||||
this.$emit("update:modelValue", "");
|
||||
}
|
||||
} else {
|
||||
this.displayRangeValue.startDate = "";
|
||||
this.displayRangeValue.endDate = "";
|
||||
this.tempRange.startDate = "";
|
||||
this.tempRange.startTime = "";
|
||||
this.tempRange.endDate = "";
|
||||
this.tempRange.endTime = "";
|
||||
if (this.isPhone) {
|
||||
this.$refs.mobile && this.$refs.mobile.clearCalender();
|
||||
} else {
|
||||
this.$refs.left && this.$refs.left.clearCalender();
|
||||
this.$refs.right && this.$refs.right.clearCalender();
|
||||
this.$refs.right && this.$refs.right.changeMonth("next");
|
||||
}
|
||||
if (needEmit) {
|
||||
this.$emit("change", []);
|
||||
this.$emit("input", []);
|
||||
this.$emit("update:modelValue", []);
|
||||
}
|
||||
}
|
||||
},
|
||||
calendarClick(e) {
|
||||
this.$emit("calendarClick", e);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
const _component_time_picker = common_vendor.resolveComponent("time-picker");
|
||||
const _component_Calendar = common_vendor.resolveComponent("Calendar");
|
||||
(_easycom_uni_icons2 + _component_time_picker + _component_Calendar)();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../../uni-icons/components/uni-icons/uni-icons.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_icons();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: !$data.isRange
|
||||
}, !$data.isRange ? {
|
||||
b: common_vendor.p({
|
||||
type: "calendar",
|
||||
color: "#c0c4cc",
|
||||
size: "22"
|
||||
}),
|
||||
c: common_vendor.t($data.displayValue || $options.singlePlaceholderText)
|
||||
} : {
|
||||
d: common_vendor.p({
|
||||
type: "calendar",
|
||||
color: "#c0c4cc",
|
||||
size: "22"
|
||||
}),
|
||||
e: common_vendor.t($data.displayRangeValue.startDate || $options.startPlaceholderText),
|
||||
f: common_vendor.t($props.rangeSeparator),
|
||||
g: common_vendor.t($data.displayRangeValue.endDate || $options.endPlaceholderText)
|
||||
}, {
|
||||
h: $options.showClearIcon
|
||||
}, $options.showClearIcon ? {
|
||||
i: common_vendor.p({
|
||||
type: "clear",
|
||||
color: "#c0c4cc",
|
||||
size: "22"
|
||||
}),
|
||||
j: common_vendor.o((...args) => $options.clear && $options.clear(...args))
|
||||
} : {}, {
|
||||
k: $props.disabled ? 1 : "",
|
||||
l: $props.border ? 1 : "",
|
||||
m: common_vendor.o((...args) => $options.show && $options.show(...args)),
|
||||
n: $data.pickerVisible,
|
||||
o: common_vendor.o((...args) => $options.close && $options.close(...args)),
|
||||
p: !$data.isPhone
|
||||
}, !$data.isPhone ? common_vendor.e({
|
||||
q: !$data.isRange
|
||||
}, !$data.isRange ? common_vendor.e({
|
||||
r: $data.hasTime
|
||||
}, $data.hasTime ? {
|
||||
s: $options.selectDateText,
|
||||
t: $data.inputDate,
|
||||
v: common_vendor.o(($event) => $data.inputDate = $event.detail.value),
|
||||
w: $options.selectTimeText,
|
||||
x: !$data.inputDate,
|
||||
y: $data.pickerTime,
|
||||
z: common_vendor.o(($event) => $data.pickerTime = $event.detail.value),
|
||||
A: common_vendor.o(($event) => $data.pickerTime = $event),
|
||||
B: common_vendor.p({
|
||||
type: "time",
|
||||
border: false,
|
||||
disabled: !$data.inputDate,
|
||||
start: $options.timepickerStartTime,
|
||||
end: $options.timepickerEndTime,
|
||||
hideSecond: $props.hideSecond,
|
||||
modelValue: $data.pickerTime
|
||||
})
|
||||
} : {}, {
|
||||
C: common_vendor.sr("pcSingle", "4b5aca82-4"),
|
||||
D: common_vendor.o($options.singleChange),
|
||||
E: common_vendor.p({
|
||||
showMonth: false,
|
||||
["start-date"]: $data.calendarRange.startDate,
|
||||
["end-date"]: $data.calendarRange.endDate,
|
||||
date: $data.calendarDate,
|
||||
["default-value"]: $props.defaultValue
|
||||
}),
|
||||
F: $data.hasTime
|
||||
}, $data.hasTime ? {
|
||||
G: common_vendor.t($options.okText),
|
||||
H: common_vendor.o((...args) => $options.confirmSingleChange && $options.confirmSingleChange(...args))
|
||||
} : {}, {
|
||||
I: common_vendor.s($data.pickerPositionStyle)
|
||||
}) : common_vendor.e({
|
||||
J: $data.hasTime
|
||||
}, $data.hasTime ? {
|
||||
K: $options.startDateText,
|
||||
L: $data.tempRange.startDate,
|
||||
M: common_vendor.o(($event) => $data.tempRange.startDate = $event.detail.value),
|
||||
N: $options.startTimeText,
|
||||
O: !$data.tempRange.startDate,
|
||||
P: $data.tempRange.startTime,
|
||||
Q: common_vendor.o(($event) => $data.tempRange.startTime = $event.detail.value),
|
||||
R: common_vendor.o(($event) => $data.tempRange.startTime = $event),
|
||||
S: common_vendor.p({
|
||||
type: "time",
|
||||
start: $options.timepickerStartTime,
|
||||
border: false,
|
||||
disabled: !$data.tempRange.startDate,
|
||||
hideSecond: $props.hideSecond,
|
||||
modelValue: $data.tempRange.startTime
|
||||
}),
|
||||
T: common_vendor.p({
|
||||
type: "arrowthinright",
|
||||
color: "#999"
|
||||
}),
|
||||
U: $options.endDateText,
|
||||
V: $data.tempRange.endDate,
|
||||
W: common_vendor.o(($event) => $data.tempRange.endDate = $event.detail.value),
|
||||
X: $options.endTimeText,
|
||||
Y: !$data.tempRange.endDate,
|
||||
Z: $data.tempRange.endTime,
|
||||
aa: common_vendor.o(($event) => $data.tempRange.endTime = $event.detail.value),
|
||||
ab: common_vendor.o(($event) => $data.tempRange.endTime = $event),
|
||||
ac: common_vendor.p({
|
||||
type: "time",
|
||||
end: $options.timepickerEndTime,
|
||||
border: false,
|
||||
disabled: !$data.tempRange.endDate,
|
||||
hideSecond: $props.hideSecond,
|
||||
modelValue: $data.tempRange.endTime
|
||||
})
|
||||
} : {}, {
|
||||
ad: common_vendor.sr("left", "4b5aca82-8"),
|
||||
ae: common_vendor.o($options.leftChange),
|
||||
af: common_vendor.o($options.updateRightCale),
|
||||
ag: common_vendor.p({
|
||||
showMonth: false,
|
||||
["start-date"]: $data.calendarRange.startDate,
|
||||
["end-date"]: $data.calendarRange.endDate,
|
||||
range: true,
|
||||
pleStatus: $data.endMultipleStatus
|
||||
}),
|
||||
ah: common_vendor.sr("right", "4b5aca82-9"),
|
||||
ai: common_vendor.o($options.rightChange),
|
||||
aj: common_vendor.o($options.updateLeftCale),
|
||||
ak: common_vendor.p({
|
||||
showMonth: false,
|
||||
["start-date"]: $data.calendarRange.startDate,
|
||||
["end-date"]: $data.calendarRange.endDate,
|
||||
range: true,
|
||||
pleStatus: $data.startMultipleStatus
|
||||
}),
|
||||
al: $data.hasTime
|
||||
}, $data.hasTime ? {
|
||||
am: common_vendor.t($options.clearText),
|
||||
an: common_vendor.o((...args) => $options.clear && $options.clear(...args)),
|
||||
ao: common_vendor.t($options.okText),
|
||||
ap: common_vendor.o((...args) => $options.confirmRangeChange && $options.confirmRangeChange(...args))
|
||||
} : {}, {
|
||||
aq: common_vendor.s($data.pickerPositionStyle)
|
||||
}), {
|
||||
ar: $data.pickerVisible
|
||||
}) : {}, {
|
||||
as: $data.isPhone
|
||||
}, $data.isPhone ? {
|
||||
at: common_vendor.sr("mobile", "4b5aca82-10"),
|
||||
av: common_vendor.o($options.mobileChange),
|
||||
aw: common_vendor.o($options.close),
|
||||
ax: common_vendor.o($options.calendarClick),
|
||||
ay: common_vendor.p({
|
||||
clearDate: false,
|
||||
date: $data.calendarDate,
|
||||
defTime: $options.mobileCalendarTime,
|
||||
["start-date"]: $data.calendarRange.startDate,
|
||||
["end-date"]: $data.calendarRange.endDate,
|
||||
selectableTimes: $options.mobSelectableTime,
|
||||
startPlaceholder: $props.startPlaceholder,
|
||||
endPlaceholder: $props.endPlaceholder,
|
||||
["default-value"]: $props.defaultValue,
|
||||
pleStatus: $data.endMultipleStatus,
|
||||
showMonth: false,
|
||||
range: $data.isRange,
|
||||
hasTime: $data.hasTime,
|
||||
insert: false,
|
||||
hideSecond: $props.hideSecond
|
||||
})
|
||||
} : {});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.js.map
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"calendar": "./calendar",
|
||||
"time-picker": "./time-picker",
|
||||
"uni-icons": "../../../uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
<view class="uni-date"><view class="uni-date-editor" bindtap="{{m}}"><block wx:if="{{$slots.d}}"><slot></slot></block><block wx:else><view class="{{['uni-date-editor--x', k && 'uni-date-editor--x__disabled', l && 'uni-date-x--border']}}"><view wx:if="{{a}}" class="uni-date-x uni-date-single"><uni-icons wx:if="{{b}}" class="icon-calendar" u-i="4b5aca82-0" bind:__l="__l" u-p="{{b}}"></uni-icons><view class="uni-date__x-input">{{c}}</view></view><view wx:else class="uni-date-x uni-date-range"><uni-icons wx:if="{{d}}" class="icon-calendar" u-i="4b5aca82-1" bind:__l="__l" u-p="{{d}}"></uni-icons><view class="uni-date__x-input text-center">{{e}}</view><view class="range-separator">{{f}}</view><view class="uni-date__x-input text-center">{{g}}</view></view><view wx:if="{{h}}" class="uni-date__icon-clear" catchtap="{{j}}"><uni-icons wx:if="{{i}}" u-i="4b5aca82-2" bind:__l="__l" u-p="{{i}}"></uni-icons></view></view></block></view><view hidden="{{!n}}" class="uni-date-mask--pc" bindtap="{{o}}"></view><view wx:if="{{p}}" hidden="{{!ar}}" ref="datePicker" class="uni-date-picker__container"><view wx:if="{{q}}" class="uni-date-single--x" style="{{I}}"><view class="uni-popper__arrow"></view><view wx:if="{{r}}" class="uni-date-changed popup-x-header"><input class="uni-date__input text-center" type="text" placeholder="{{s}}" value="{{t}}" bindinput="{{v}}"/><time-picker wx:if="{{B}}" u-s="{{['d']}}" style="width:100%" u-i="4b5aca82-3" bind:__l="__l" bindupdateModelValue="{{A}}" u-p="{{B}}"><input class="uni-date__input text-center" type="text" placeholder="{{w}}" disabled="{{x}}" value="{{y}}" bindinput="{{z}}"/></time-picker></view><calendar wx:if="{{E}}" class="r" u-r="pcSingle" bindchange="{{D}}" style="padding:0 8px" u-i="4b5aca82-4" bind:__l="__l" u-p="{{E}}"/><view wx:if="{{F}}" class="popup-x-footer"><text class="confirm-text" bindtap="{{H}}">{{G}}</text></view></view><view wx:else class="uni-date-range--x" style="{{aq}}"><view class="uni-popper__arrow"></view><view wx:if="{{J}}" class="popup-x-header uni-date-changed"><view class="popup-x-header--datetime"><input class="uni-date__input uni-date-range__input" type="text" placeholder="{{K}}" value="{{L}}" bindinput="{{M}}"/><time-picker wx:if="{{S}}" u-s="{{['d']}}" u-i="4b5aca82-5" bind:__l="__l" bindupdateModelValue="{{R}}" u-p="{{S}}"><input class="uni-date__input uni-date-range__input" type="text" placeholder="{{N}}" disabled="{{O}}" value="{{P}}" bindinput="{{Q}}"/></time-picker></view><uni-icons wx:if="{{T}}" style="line-height:40px" u-i="4b5aca82-6" bind:__l="__l" u-p="{{T}}"></uni-icons><view class="popup-x-header--datetime"><input class="uni-date__input uni-date-range__input" type="text" placeholder="{{U}}" value="{{V}}" bindinput="{{W}}"/><time-picker wx:if="{{ac}}" u-s="{{['d']}}" u-i="4b5aca82-7" bind:__l="__l" bindupdateModelValue="{{ab}}" u-p="{{ac}}"><input class="uni-date__input uni-date-range__input" type="text" placeholder="{{X}}" disabled="{{Y}}" value="{{Z}}" bindinput="{{aa}}"/></time-picker></view></view><view class="popup-x-body"><calendar wx:if="{{ag}}" class="r" u-r="left" bindchange="{{ae}}" bindfirstEnterCale="{{af}}" style="padding:0 8px" u-i="4b5aca82-8" bind:__l="__l" u-p="{{ag}}"/><calendar wx:if="{{ak}}" class="r" u-r="right" bindchange="{{ai}}" bindfirstEnterCale="{{aj}}" style="padding:0 8px;border-left:1px solid #F1F1F1" u-i="4b5aca82-9" bind:__l="__l" u-p="{{ak}}"/></view><view wx:if="{{al}}" class="popup-x-footer"><text bindtap="{{an}}">{{am}}</text><text class="confirm-text" bindtap="{{ap}}">{{ao}}</text></view></view></view><calendar wx:if="{{as}}" class="r" u-r="mobile" bindconfirm="{{av}}" bindmaskClose="{{aw}}" bindchange="{{ax}}" u-i="4b5aca82-10" bind:__l="__l" u-p="{{ay}}"/></view>
|
||||
|
|
@ -1,197 +0,0 @@
|
|||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.uni-date {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
.uni-date-x {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
flex: 1;
|
||||
}
|
||||
.uni-date-x .icon-calendar {
|
||||
padding-left: 3px;
|
||||
}
|
||||
.uni-date-x .range-separator {
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
}
|
||||
.uni-date-x--border {
|
||||
box-sizing: border-box;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #e5e5e5;
|
||||
}
|
||||
.uni-date-editor--x {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
}
|
||||
.uni-date-editor--x .uni-date__icon-clear {
|
||||
padding-right: 3px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.uni-date__x-input {
|
||||
width: auto;
|
||||
height: 35px;
|
||||
position: relative;
|
||||
flex: 1;
|
||||
line-height: 35px;
|
||||
font-size: 14px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
.uni-date__input {
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
line-height: 40px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.uni-date-range__input {
|
||||
text-align: center;
|
||||
max-width: 142px;
|
||||
}
|
||||
.uni-date-picker__container {
|
||||
position: relative;
|
||||
}
|
||||
.uni-date-mask--pc {
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
transition-duration: 0.3s;
|
||||
z-index: 996;
|
||||
}
|
||||
.uni-date-single--x {
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
z-index: 999;
|
||||
border: 1px solid #EBEEF5;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.uni-date-range--x {
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
z-index: 999;
|
||||
border: 1px solid #EBEEF5;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.uni-date-editor--x__disabled {
|
||||
opacity: 0.4;
|
||||
cursor: default;
|
||||
}
|
||||
.uni-date-editor--logo {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* 添加时间 */
|
||||
.popup-x-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.popup-x-header--datetime {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex: 1;
|
||||
}
|
||||
.popup-x-body {
|
||||
display: flex;
|
||||
}
|
||||
.popup-x-footer {
|
||||
padding: 0 15px;
|
||||
border-top-color: #F1F1F1;
|
||||
border-top-style: solid;
|
||||
border-top-width: 1px;
|
||||
line-height: 40px;
|
||||
text-align: right;
|
||||
color: #666;
|
||||
}
|
||||
.popup-x-footer text:hover {
|
||||
color: #007aff;
|
||||
cursor: pointer;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.popup-x-footer .confirm-text {
|
||||
margin-left: 20px;
|
||||
color: #007aff;
|
||||
}
|
||||
.uni-date-changed {
|
||||
text-align: center;
|
||||
color: #333;
|
||||
border-bottom-color: #F1F1F1;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 1px;
|
||||
}
|
||||
.uni-date-changed .uni-date-changed--time {
|
||||
flex: 1;
|
||||
}
|
||||
.uni-date-changed--time-date {
|
||||
color: #333;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.mr-50 {
|
||||
margin-right: 50px;
|
||||
}
|
||||
|
||||
/* picker 弹出层通用的指示小三角, todo:扩展至上下左右方向定位 */
|
||||
.uni-popper__arrow,
|
||||
.uni-popper__arrow::after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 6px solid transparent;
|
||||
border-top-width: 0;
|
||||
}
|
||||
.uni-popper__arrow {
|
||||
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
||||
top: -6px;
|
||||
left: 10%;
|
||||
margin-right: 3px;
|
||||
border-bottom-color: #EBEEF5;
|
||||
}
|
||||
.uni-popper__arrow::after {
|
||||
content: " ";
|
||||
top: 1px;
|
||||
margin-left: -6px;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
|
|
@ -1,366 +0,0 @@
|
|||
"use strict";
|
||||
class Calendar {
|
||||
constructor({
|
||||
selected,
|
||||
startDate,
|
||||
endDate,
|
||||
range
|
||||
} = {}) {
|
||||
this.date = this.getDateObj(/* @__PURE__ */ new Date());
|
||||
this.selected = selected || [];
|
||||
this.startDate = startDate;
|
||||
this.endDate = endDate;
|
||||
this.range = range;
|
||||
this.cleanMultipleStatus();
|
||||
this.weeks = {};
|
||||
this.lastHover = false;
|
||||
}
|
||||
/**
|
||||
* 设置日期
|
||||
* @param {Object} date
|
||||
*/
|
||||
setDate(date) {
|
||||
const selectDate = this.getDateObj(date);
|
||||
this.getWeeks(selectDate.fullDate);
|
||||
}
|
||||
/**
|
||||
* 清理多选状态
|
||||
*/
|
||||
cleanMultipleStatus() {
|
||||
this.multipleStatus = {
|
||||
before: "",
|
||||
after: "",
|
||||
data: []
|
||||
};
|
||||
}
|
||||
setStartDate(startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
setEndDate(endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
getPreMonthObj(date) {
|
||||
date = fixIosDateFormat(date);
|
||||
date = new Date(date);
|
||||
const oldMonth = date.getMonth();
|
||||
date.setMonth(oldMonth - 1);
|
||||
const newMonth = date.getMonth();
|
||||
if (oldMonth !== 0 && newMonth - oldMonth === 0) {
|
||||
date.setMonth(newMonth - 1);
|
||||
}
|
||||
return this.getDateObj(date);
|
||||
}
|
||||
getNextMonthObj(date) {
|
||||
date = fixIosDateFormat(date);
|
||||
date = new Date(date);
|
||||
const oldMonth = date.getMonth();
|
||||
date.setMonth(oldMonth + 1);
|
||||
const newMonth = date.getMonth();
|
||||
if (newMonth - oldMonth > 1) {
|
||||
date.setMonth(newMonth - 1);
|
||||
}
|
||||
return this.getDateObj(date);
|
||||
}
|
||||
/**
|
||||
* 获取指定格式Date对象
|
||||
*/
|
||||
getDateObj(date) {
|
||||
date = fixIosDateFormat(date);
|
||||
date = new Date(date);
|
||||
return {
|
||||
fullDate: getDate(date),
|
||||
year: date.getFullYear(),
|
||||
month: addZero(date.getMonth() + 1),
|
||||
date: addZero(date.getDate()),
|
||||
day: date.getDay()
|
||||
};
|
||||
}
|
||||
/**
|
||||
* 获取上一个月日期集合
|
||||
*/
|
||||
getPreMonthDays(amount, dateObj) {
|
||||
const result = [];
|
||||
for (let i = amount - 1; i >= 0; i--) {
|
||||
const month = dateObj.month - 1;
|
||||
result.push({
|
||||
date: new Date(dateObj.year, month, -i).getDate(),
|
||||
month,
|
||||
disable: true
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 获取本月日期集合
|
||||
*/
|
||||
getCurrentMonthDays(amount, dateObj) {
|
||||
const result = [];
|
||||
const fullDate = this.date.fullDate;
|
||||
for (let i = 1; i <= amount; i++) {
|
||||
const currentDate = `${dateObj.year}-${dateObj.month}-${addZero(i)}`;
|
||||
const isToday = fullDate === currentDate;
|
||||
const info = this.selected && this.selected.find((item) => {
|
||||
if (this.dateEqual(currentDate, item.date)) {
|
||||
return item;
|
||||
}
|
||||
});
|
||||
if (this.startDate) {
|
||||
dateCompare(this.startDate, currentDate);
|
||||
}
|
||||
if (this.endDate) {
|
||||
dateCompare(currentDate, this.endDate);
|
||||
}
|
||||
let multiples = this.multipleStatus.data;
|
||||
let multiplesStatus = -1;
|
||||
if (this.range && multiples) {
|
||||
multiplesStatus = multiples.findIndex((item) => {
|
||||
return this.dateEqual(item, currentDate);
|
||||
});
|
||||
}
|
||||
const checked = multiplesStatus !== -1;
|
||||
result.push({
|
||||
fullDate: currentDate,
|
||||
year: dateObj.year,
|
||||
date: i,
|
||||
multiple: this.range ? checked : false,
|
||||
beforeMultiple: this.isLogicBefore(currentDate, this.multipleStatus.before, this.multipleStatus.after),
|
||||
afterMultiple: this.isLogicAfter(currentDate, this.multipleStatus.before, this.multipleStatus.after),
|
||||
month: dateObj.month,
|
||||
disable: this.startDate && !dateCompare(this.startDate, currentDate) || this.endDate && !dateCompare(
|
||||
currentDate,
|
||||
this.endDate
|
||||
),
|
||||
isToday,
|
||||
userChecked: false,
|
||||
extraInfo: info
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 获取下一个月日期集合
|
||||
*/
|
||||
_getNextMonthDays(amount, dateObj) {
|
||||
const result = [];
|
||||
const month = dateObj.month + 1;
|
||||
for (let i = 1; i <= amount; i++) {
|
||||
result.push({
|
||||
date: i,
|
||||
month,
|
||||
disable: true
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 获取当前日期详情
|
||||
* @param {Object} date
|
||||
*/
|
||||
getInfo(date) {
|
||||
if (!date) {
|
||||
date = /* @__PURE__ */ new Date();
|
||||
}
|
||||
const res = this.calendar.find((item) => item.fullDate === this.getDateObj(date).fullDate);
|
||||
return res ? res : this.getDateObj(date);
|
||||
}
|
||||
/**
|
||||
* 比较时间是否相等
|
||||
*/
|
||||
dateEqual(before, after) {
|
||||
before = new Date(fixIosDateFormat(before));
|
||||
after = new Date(fixIosDateFormat(after));
|
||||
return before.valueOf() === after.valueOf();
|
||||
}
|
||||
/**
|
||||
* 比较真实起始日期
|
||||
*/
|
||||
isLogicBefore(currentDate, before, after) {
|
||||
let logicBefore = before;
|
||||
if (before && after) {
|
||||
logicBefore = dateCompare(before, after) ? before : after;
|
||||
}
|
||||
return this.dateEqual(logicBefore, currentDate);
|
||||
}
|
||||
isLogicAfter(currentDate, before, after) {
|
||||
let logicAfter = after;
|
||||
if (before && after) {
|
||||
logicAfter = dateCompare(before, after) ? after : before;
|
||||
}
|
||||
return this.dateEqual(logicAfter, currentDate);
|
||||
}
|
||||
/**
|
||||
* 获取日期范围内所有日期
|
||||
* @param {Object} begin
|
||||
* @param {Object} end
|
||||
*/
|
||||
geDateAll(begin, end) {
|
||||
var arr = [];
|
||||
var ab = begin.split("-");
|
||||
var ae = end.split("-");
|
||||
var db = /* @__PURE__ */ new Date();
|
||||
db.setFullYear(ab[0], ab[1] - 1, ab[2]);
|
||||
var de = /* @__PURE__ */ new Date();
|
||||
de.setFullYear(ae[0], ae[1] - 1, ae[2]);
|
||||
var unixDb = db.getTime() - 24 * 60 * 60 * 1e3;
|
||||
var unixDe = de.getTime() - 24 * 60 * 60 * 1e3;
|
||||
for (var k = unixDb; k <= unixDe; ) {
|
||||
k = k + 24 * 60 * 60 * 1e3;
|
||||
arr.push(this.getDateObj(new Date(parseInt(k))).fullDate);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
/**
|
||||
* 获取多选状态
|
||||
*/
|
||||
setMultiple(fullDate) {
|
||||
if (!this.range)
|
||||
return;
|
||||
let {
|
||||
before,
|
||||
after
|
||||
} = this.multipleStatus;
|
||||
if (before && after) {
|
||||
if (!this.lastHover) {
|
||||
this.lastHover = true;
|
||||
return;
|
||||
}
|
||||
this.multipleStatus.before = fullDate;
|
||||
this.multipleStatus.after = "";
|
||||
this.multipleStatus.data = [];
|
||||
this.multipleStatus.fulldate = "";
|
||||
this.lastHover = false;
|
||||
} else {
|
||||
if (!before) {
|
||||
this.multipleStatus.before = fullDate;
|
||||
this.multipleStatus.after = void 0;
|
||||
this.lastHover = false;
|
||||
} else {
|
||||
this.multipleStatus.after = fullDate;
|
||||
if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
|
||||
this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
|
||||
} else {
|
||||
this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
|
||||
}
|
||||
this.lastHover = true;
|
||||
}
|
||||
}
|
||||
this.getWeeks(fullDate);
|
||||
}
|
||||
/**
|
||||
* 鼠标 hover 更新多选状态
|
||||
*/
|
||||
setHoverMultiple(fullDate) {
|
||||
if (!this.range || this.lastHover)
|
||||
return;
|
||||
const {
|
||||
before
|
||||
} = this.multipleStatus;
|
||||
if (!before) {
|
||||
this.multipleStatus.before = fullDate;
|
||||
} else {
|
||||
this.multipleStatus.after = fullDate;
|
||||
if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
|
||||
this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
|
||||
} else {
|
||||
this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
|
||||
}
|
||||
}
|
||||
this.getWeeks(fullDate);
|
||||
}
|
||||
/**
|
||||
* 更新默认值多选状态
|
||||
*/
|
||||
setDefaultMultiple(before, after) {
|
||||
this.multipleStatus.before = before;
|
||||
this.multipleStatus.after = after;
|
||||
if (before && after) {
|
||||
if (dateCompare(before, after)) {
|
||||
this.multipleStatus.data = this.geDateAll(before, after);
|
||||
this.getWeeks(after);
|
||||
} else {
|
||||
this.multipleStatus.data = this.geDateAll(after, before);
|
||||
this.getWeeks(before);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 获取每周数据
|
||||
* @param {Object} dateData
|
||||
*/
|
||||
getWeeks(dateData) {
|
||||
const {
|
||||
year,
|
||||
month
|
||||
} = this.getDateObj(dateData);
|
||||
const preMonthDayAmount = new Date(year, month - 1, 1).getDay();
|
||||
const preMonthDays = this.getPreMonthDays(preMonthDayAmount, this.getDateObj(dateData));
|
||||
const currentMonthDayAmount = new Date(year, month, 0).getDate();
|
||||
const currentMonthDays = this.getCurrentMonthDays(currentMonthDayAmount, this.getDateObj(dateData));
|
||||
const nextMonthDayAmount = 42 - preMonthDayAmount - currentMonthDayAmount;
|
||||
const nextMonthDays = this._getNextMonthDays(nextMonthDayAmount, this.getDateObj(dateData));
|
||||
const calendarDays = [...preMonthDays, ...currentMonthDays, ...nextMonthDays];
|
||||
const weeks = new Array(6);
|
||||
for (let i = 0; i < calendarDays.length; i++) {
|
||||
const index = Math.floor(i / 7);
|
||||
if (!weeks[index]) {
|
||||
weeks[index] = new Array(7);
|
||||
}
|
||||
weeks[index][i % 7] = calendarDays[i];
|
||||
}
|
||||
this.calendar = calendarDays;
|
||||
this.weeks = weeks;
|
||||
}
|
||||
}
|
||||
function getDateTime(date, hideSecond) {
|
||||
return `${getDate(date)} ${getTime(date, hideSecond)}`;
|
||||
}
|
||||
function getDate(date) {
|
||||
date = fixIosDateFormat(date);
|
||||
date = new Date(date);
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1;
|
||||
const day = date.getDate();
|
||||
return `${year}-${addZero(month)}-${addZero(day)}`;
|
||||
}
|
||||
function getTime(date, hideSecond) {
|
||||
date = fixIosDateFormat(date);
|
||||
date = new Date(date);
|
||||
const hour = date.getHours();
|
||||
const minute = date.getMinutes();
|
||||
const second = date.getSeconds();
|
||||
return hideSecond ? `${addZero(hour)}:${addZero(minute)}` : `${addZero(hour)}:${addZero(minute)}:${addZero(second)}`;
|
||||
}
|
||||
function addZero(num) {
|
||||
if (num < 10) {
|
||||
num = `0${num}`;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
function getDefaultSecond(hideSecond) {
|
||||
return hideSecond ? "00:00" : "00:00:00";
|
||||
}
|
||||
function dateCompare(startDate, endDate) {
|
||||
startDate = new Date(fixIosDateFormat(typeof startDate === "string" ? startDate.trim() : startDate));
|
||||
endDate = new Date(fixIosDateFormat(typeof endDate === "string" ? endDate.trim() : endDate));
|
||||
return startDate <= endDate;
|
||||
}
|
||||
function checkDate(date) {
|
||||
const dateReg = /((19|20)\d{2})(-|\/)\d{1,2}(-|\/)\d{1,2}/g;
|
||||
return date.match(dateReg);
|
||||
}
|
||||
const dateTimeReg = /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])( [0-5]?[0-9]:[0-5]?[0-9](:[0-5]?[0-9])?)?$/;
|
||||
function fixIosDateFormat(value) {
|
||||
if (typeof value === "string" && dateTimeReg.test(value)) {
|
||||
value = value.replace(/-/g, "/");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
exports.Calendar = Calendar;
|
||||
exports.checkDate = checkDate;
|
||||
exports.dateCompare = dateCompare;
|
||||
exports.fixIosDateFormat = fixIosDateFormat;
|
||||
exports.getDate = getDate;
|
||||
exports.getDateTime = getDateTime;
|
||||
exports.getDefaultSecond = getDefaultSecond;
|
||||
exports.getTime = getTime;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js.map
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
"use strict";
|
||||
const uni_modules_uniIcons_components_uniIcons_uniicons_file_vue = require("./uniicons_file_vue.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const getVal = (val) => {
|
||||
const reg = /^[0-9]*$/g;
|
||||
return typeof val === "number" || reg.test(val) ? val + "px" : val;
|
||||
};
|
||||
const _sfc_main = {
|
||||
name: "UniIcons",
|
||||
emits: ["click"],
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: "#333333"
|
||||
},
|
||||
size: {
|
||||
type: [Number, String],
|
||||
default: 16
|
||||
},
|
||||
customPrefix: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
fontFamily: {
|
||||
type: String,
|
||||
default: ""
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
icons: uni_modules_uniIcons_components_uniIcons_uniicons_file_vue.fontData
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
unicode() {
|
||||
let code = this.icons.find((v) => v.font_class === this.type);
|
||||
if (code) {
|
||||
return code.unicode;
|
||||
}
|
||||
return "";
|
||||
},
|
||||
iconSize() {
|
||||
return getVal(this.size);
|
||||
},
|
||||
styleObj() {
|
||||
if (this.fontFamily !== "") {
|
||||
return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`;
|
||||
}
|
||||
return `color: ${this.color}; font-size: ${this.iconSize};`;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
_onClick(e) {
|
||||
this.$emit("click", e);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.s($options.styleObj),
|
||||
b: common_vendor.n("uniui-" + $props.type),
|
||||
c: common_vendor.n($props.customPrefix),
|
||||
d: common_vendor.n($props.customPrefix ? $props.type : ""),
|
||||
e: common_vendor.o((...args) => $options._onClick && $options._onClick(...args))
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-icons/components/uni-icons/uni-icons.js.map
|
||||