公司小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 lines
15 KiB

{"version":3,"sources":["webpack:///D:/Uni-App/HBuilderProjects/Test/components/min-picker/min-picker.vue?2753","uni-app:///components/min-picker/min-picker.vue","webpack:///D:/Uni-App/HBuilderProjects/Test/components/min-picker/min-picker.vue?c6b1","webpack:///D:/Uni-App/HBuilderProjects/Test/components/min-picker/min-picker.vue?3752","webpack:///D:/Uni-App/HBuilderProjects/Test/components/min-picker/min-picker.vue?732d"],"names":["components","render","_vm","this","_h","$createElement","g0","_self","_c","show","value","toString","$mp","data","Object","assign","$root","staticRenderFns","_withStripped","renderjs","component","options","__file"],"mappings":"iIAAA,8GAAoqB,eAAG,G,sHC0BvqB,CACA,iBACA,OACA,MACA,aACA,YAGA,WACA,WACA,sCAGA,SACA,YACA,cAEA,WACA,aAGA,aACA,kBACA,cAMA,UACA,YACA,YAGA,KAlCA,WAmCA,OACA,SACA,UACA,QACA,aACA,cACA,WACA,SACA,QACA,QACA,6FAGA,QAhDA,WAmDA,GAFA,gBAEA,wBACA,eACA,kBACA,iBACA,aACA,YACA,qBACA,gBACA,4BACA,8GACA,OACA,8BACA,gBACA,+CACA,eACA,+BACA,6CACA,wDACA,yEAEA,gBAEA,SACA,uBAEA,qFACA,aACA,qBACA,2BACA,gBACA,6BACA,eAEA,0BAIA,SAfA,WAgBA,cACA,gDACA,oBAIA,SAtBA,WAuBA,eACA,gBAEA,yBACA,kBAEA,sCACA,yBAKA,sBACA,qBAMA,QA1CA,WA2CA,aACA,gBACA,aACA,+CACA,kBACA,kDACA,uBAKA,kCACA,mBAIA,kBA3DA,SA2DA,KACA,iBACA,sBAGA,OAFA,2BACA,eACA,aAGA,MAnEA,WAoEA,yBAGA,KAvEA,WAuEA,MACA,0CACA,gCACA,wDAEA,wBACA,mBACA,YACA,aACA,gB,iGCnLA,sBAA2wC,EAAG,G,iCCA9wC,IAAIA,E,sGACJ,IAAIC,EAAS,WACX,IAAIC,EAAMC,KACNC,EAAKF,EAAIG,eAETC,GADKJ,EAAIK,MAAMC,GACVN,EAAIO,KAAOP,EAAIQ,MAAMC,WAAa,MAC3CT,EAAIU,IAAIC,KAAOC,OAAOC,OACpB,GACA,CACEC,MAAO,CACLV,GAAIA,MAMRW,EAAkB,GACtBhB,EAAOiB,eAAgB,G,iCCjBvB,yHACIC,EADJ,OASIC,EAAY,eACd,aACA,OACA,QACA,EACA,KACA,WACA,MACA,EACA,OACAD,GAGFC,EAAUC,QAAQC,OAAS,uCACZ,aAAAF,E","file":"components/min-picker/min-picker.js","sourcesContent":["import mod from \"-!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./min-picker.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./min-picker.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view class=\"min-picker\">\r\n\t\t<view class=\"min-popup\" v-if=\"show\" :class=\"[show ? 'min-show' : 'min-hide']\">\r\n\t\t <view class=\"min-content\" :style=\"{height:heightRpx+'rpx'}\">\r\n\t\t\t\t<view class=\"main-top\">\r\n\t\t\t\t\t<view class=\"picer-top\">\r\n\t\t\t\t\t\t<text @click=\"cacel\">取消</text>\r\n\t\t\t\t\t\t<text @click=\"sure\" class=\"sure\">确认</text>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t\t<picker-view :indicator-style=\"indicatorStyle\" :value=\"value\" @change=\"bindChange\" style=\"height:400rpx\" :key=\"value.toString()\">\r\n\t\t\t\t\t<picker-view-column>\r\n\t\t\t\t\t\t<view class=\"picker item\" v-for=\"(item,index) in years\" :key=\"index\">{{item}}年</view>\r\n\t\t\t\t\t</picker-view-column>\r\n\t\t\t\t\t<picker-view-column v-if=\"showType<=1\">\r\n\t\t\t\t\t\t<view class=\"picker item\" v-for=\"(item,index) in months\" :key=\"index\">{{item}}月</view>\r\n\t\t\t\t\t</picker-view-column>\r\n\t\t\t\t\t<picker-view-column v-if=\"showType==0\">\r\n\t\t\t\t\t\t<view class=\"picker item\" v-for=\"(item,index) in days\" :key=\"index\">{{item}}日</view>\r\n\t\t\t\t\t</picker-view-column>\r\n\t\t\t\t</picker-view>\r\n\t\t </view>\r\n\t\t</view>\r\n\t</view>\r\n</template>\r\n<script>\r\n\texport default {\r\n\t\tname:'MinPicker',\r\n\t\tprops: {\r\n\t\t\tshow: {\r\n\t\t\t\ttype: Boolean,\r\n\t\t\t\tdefault: false\r\n\t\t\t},\r\n\t\t\t///日期选择器的起始时间\r\n\t\t\tstartTime:{\r\n\t\t\t\ttype: Array,\r\n\t\t\t\tdefault: () => [2018,6,5]\r\n\t\t\t},\r\n\t\t\t///日期选择器的结束时间\r\n\t\t\tendTime:{\r\n\t\t\t\ttype: Number,\r\n\t\t\t\tdefault: 2045\r\n\t\t\t},\n\t\t\theightRpx: {\n\t\t\t type: String\n\t\t\t},\r\n\t\t\t///日期选择器默认显示的时间,例如[2022,1,1],默认月份与天数都是以1开始。\r\n\t\t\tcurrentTime : {\r\n\t\t\t\ttype : [Array,null],\r\n\t\t\t\tdefault:null\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * 现实类型,0->年月日,1->年月,2->年\r\n\t\t\t * 默认显示年月日\r\n\t\t\t */\r\n\t\t\tshowType : {\r\n\t\t\t\ttype : Number,\r\n\t\t\t\tdefault: 0,\r\n\t\t\t}\r\n\t\t},\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tyears: [],\r\n\t\t\t\tmonths: [],\r\n\t\t\t\tdays: [],\r\n\t\t\t\tdayLength: 30,\r\n\t\t\t\tvalue: [0, 0, 0],\r\n\t\t\t\tvisible: false,\r\n\t\t\t\tmonth: '',\r\n\t\t\t\tyear: '',\r\n\t\t\t\tflag: false,\r\n\t\t\t\tindicatorStyle: `height: ${Math.round(uni.getSystemInfoSync().screenWidth / (750 / 100))}rpx;`\r\n\t\t\t}\r\n\t\t},\r\n\t\tmounted() {\r\n\t\t\tthis.getYears();\r\n\t\t\t// 获取初始位置\r\n\t\t\tif(this.currentTime == null){\r\n\t\t\t\tconst time \t= new Date()\r\n\t\t\t\tconst year \t= time.getFullYear()\r\n\t\t\t\tconst month = time.getMonth() + 1\r\n\t\t\t\tthis.month \t= month\r\n\t\t\t\tthis.year \t= year\r\n\t\t\t\tthis.day\t= time.getDate();\r\n\t\t\t\tthis.getMonth()\r\n\t\t\t\tthis.getDaysInOneMonth(year, month)\r\n\t\t\t\tthis.value \t= [this.years.indexOf(this.year),this.months.indexOf(this.month),this.days.indexOf( time.getDate())]\r\n\t\t\t}else{\r\n\t\t\t\tthis.year \t= this.currentTime[0];\r\n\t\t\t\tthis.getMonth();\r\n\t\t\t\tvar m \t\t= this.months.indexOf(this.currentTime[1]);\r\n\t\t\t\tconsole.log(m);\r\n\t\t\t\tthis.month = this.currentTime[1];\r\n\t\t\t\tthis.getDaysInOneMonth(this.year, this.month);\r\n\t\t\t\tthis.day\t= this.currentTime[2] ?? 1;\r\n\t\t\t\tthis.value\t= [this.years.indexOf(this.year),m,this.days.indexOf(this.day)];\r\n\t\t\t}\r\n\t\t\tthis.getDays()\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tbindChange: function(e) {\r\n\t\t\t\t//console.log(e);\r\n\t\t\t\tthis.getDaysInOneMonth(this.years[e.target.value[0]], this.months[e.target.value[1]])\r\n\t\t\t\tthis.flag = true;\r\n\t\t\t\tconst val = e.detail.value;\r\n\t\t\t\tthis.year = this.years[val[0]];\r\n\t\t\t\tthis.getMonth();\r\n\t\t\t\tthis.month\t= this.months[val[1]];\r\n\t\t\t\tthis.getDays();\r\n\t\t\t\t//this.month = this.months[val[1]] < 10 ? '0' + this.months[val[1]] : this.months[val[1]];\r\n\t\t\t\tthis.day = this.days[val[2]];\r\n\t\t\t\t//console.log(this.year,this.month,this.day);\r\n\t\t\t},\r\n\t\t\t// 获得年份\r\n\t\t\tgetYears() {\r\n\t\t\t\tthis.years = []\r\n\t\t\t\tfor (let i = this.startTime[0]; i <= this.endTime; i++) {\r\n\t\t\t\t\tthis.years.push(i)\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t// 获取月份\r\n\t\t\tgetMonth() {\r\n\t\t\t\tthis.months = []\r\n\t\t\t\tvar year = this.year;\r\n\t\t\t\t//console.log(\"获取年份:\"+ year + \"的所有月份!\");\r\n\t\t\t\tif(year == this.startTime[0]){\r\n\t\t\t\t\tif(this.startTime[1]){\r\n\t\t\t\t\t\t//定义了起始月份的\r\n\t\t\t\t\t\tfor(var i = this.startTime[1];i<=12;i++){\r\n\t\t\t\t\t\t\tthis.months.push(i);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor (let i = 1; i <= 12; i++) {\r\n\t\t\t\t\tthis.months.push(i)\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * 获取当前月份的天数信息,在调用本方法之前,请确保你设置了this.year,this.month,\r\n\t\t\t */\r\n\t\t\tgetDays() {\r\n\t\t\t\tthis.days = []\r\n\t\t\t\tvar year \t= this.year;\r\n\t\t\t\tvar month\t= this.month;\r\n\t\t\t\tif(year == this.startTime[0] && month == this.startTime[1]){\r\n\t\t\t\t\tif(this.startTime[2]){\r\n\t\t\t\t\t\tfor(var i = this.startTime[2];i<=this.dayLength;i++){\r\n\t\t\t\t\t\t\tthis.days.push(i)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor (let i = 1; i <= this.dayLength; i++) {\r\n\t\t\t\t\tthis.days.push(i)\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t// 获取某年某月多少天\r\n\t\t\tgetDaysInOneMonth(year, month) {\r\n\t\t\t\tmonth = parseInt(month, 10)\r\n\t\t\t\tvar d = new Date(year, month, 0)\r\n\t\t\t\tthis.dayLength = d.getDate()\r\n\t\t\t\tthis.getDays()\r\n\t\t\t\treturn d.getDate()\r\n\t\t\t},\r\n\t\t\t// 取消\r\n\t\t\tcacel() {\r\n\t\t\t\tthis.$emit('cancel', false)\r\n\t\t\t},\r\n\t\t\t// 确认\r\n\t\t\tsure() {\r\n\t\t\t\tthis.value = [this.years.indexOf(this.year),\r\n\t\t\t\t\tthis.months.indexOf(this.month),\r\n\t\t\t\t\tthis.days.indexOf(this.day ?? 1),\r\n\t\t\t\t];\r\n\t\t\t\tthis.$emit('cancel', false)\r\n\t\t\t\tthis.$emit('sure', {\r\n\t\t\t\t\ta: this.year,\r\n\t\t\t\t\tb: this.month,\r\n\t\t\t\t\tc: this.day\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n\t.main-top {\r\n\t\tpadding: 0 30rpx;\r\n\t\tborder-radius: 20rpx;\r\n\t\t.picer-top {\r\n\t\t\twidth: 100%;\r\n\t\t\theight: 100rpx;\r\n\t\t\tdisplay: flex;\r\n\t\t\tflex-direction: row;\r\n\t\t\tjustify-content: space-between;\r\n\t\t\talign-items: center;\r\n\t\t\tfont-size: 30rpx;\r\n\t\t\t//background-color: #1CBBB4;\r\n\t\t\t.sure {\r\n\t\t\t\tcolor: #007aff;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t.picker {\r\n\t\ttext-align: center;\r\n\t\tline-height: 50rpx;\r\n\t}\r\n\t\r\n\t.min-popup{\r\n\t width: 100vw;\r\n\t height: 100vh;\r\n\t position: fixed;\r\n\t top:0;\r\n\t left: 0;\r\n\t z-index: 100;\r\n\t &.min-hide{\r\n\t .min-content{\r\n\t animation: hide .5s linear forwards;\r\n\t }\r\n\t .min-content-height{ animation: hide .5s linear forwards;}\r\n\t \r\n\t }\r\n\t &.min-show{\r\n\t .min-content{\r\n\t animation: show .5s linear forwards;\r\n\t }\r\n\t .min-content-height{ animation: show .5s linear forwards;}\r\n\t }\r\n\t .min-content{\r\n\t width: 100%;\r\n\t height:800rpx;\r\n\t background: #fff;\r\n\t position: absolute;\r\n\t left: 0;\r\n\t bottom: 0;\r\n\t z-index: 9999;\r\n\t overflow: hidden;\r\n\t border-radius: 20rpx 20rpx 0 0;\r\n\t }\r\n\t @keyframes hide {\r\n\t 100% {\r\n\t transform: translateY(100%);\r\n\t }\r\n\t 0% {\r\n\t transform: translateY(0);\r\n\t }\r\n\t }\r\n\t @keyframes show {\r\n\t 0% {\r\n\t transform: translateY(100%);\r\n\t }\r\n\t 100% {\r\n\t transform: translateY(0);\r\n\t }\r\n\t }\r\n\t}\r\n</style>\n","import mod from \"-!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./min-picker.vue?vue&type=style&index=0&id=d833cfb8&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./min-picker.vue?vue&type=style&index=0&id=d833cfb8&lang=scss&scoped=true&\"","var components\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n var g0 = _vm.show ? _vm.value.toString() : null\n _vm.$mp.data = Object.assign(\n {},\n {\n $root: {\n g0: g0\n }\n }\n )\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import { render, staticRenderFns, recyclableRender, components } from \"./min-picker.vue?vue&type=template&id=d833cfb8&scoped=true&\"\nvar renderjs\nimport script from \"./min-picker.vue?vue&type=script&lang=js&\"\nexport * from \"./min-picker.vue?vue&type=script&lang=js&\"\nimport style0 from \"./min-picker.vue?vue&type=style&index=0&id=d833cfb8&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../Tools/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"d833cfb8\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"components/min-picker/min-picker.vue\"\nexport default component.exports"],"sourceRoot":""}