w-picker.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104
  1. <template>
  2. <view class="w-picker">
  3. <view class="mask" :class="{'show':showPicker}" @tap="maskTap" @touchmove.stop.prevent catchtouchmove="true"></view>
  4. <view class="w-picker-cnt" :class="{'show':showPicker}">
  5. <view class="w-picker-hd" @touchmove.stop.prevent catchtouchmove="true">
  6. <view class="w-picker-btn" @tap="pickerCancel">取消</view>
  7. <view class="w-picker-btn" :style="{'color':themeColor}" @tap="pickerConfirm">确定</view>
  8. </view>
  9. <view class="w-picker-view" v-if="mode=='linkage'">
  10. <picker-view :indicator-style="itemHeight" :value="pickVal" @change="bindChange" @touchstart="touchStart" @touchend="touchEnd">
  11. <picker-view-column v-for="(col,colIndex) in data" :key="colIndex">
  12. <view class="w-picker-item" v-for="(item,index) in col" :key="index">{{item.label}}</view>
  13. </picker-view-column>
  14. </picker-view>
  15. </view>
  16. <view class="w-picker-view" v-if="mode=='half'">
  17. <picker-view :indicator-style="itemHeight" :value="pickVal" @change="bindChange" @touchstart="touchStart" @touchend="touchEnd">
  18. <picker-view-column>
  19. <view class="w-picker-item" v-for="(item,index) in data.years" :key="index">{{item}}年</view>
  20. </picker-view-column>
  21. <picker-view-column>
  22. <view class="w-picker-item" v-for="(item,index) in data.months" :key="index">{{item}}月</view>
  23. </picker-view-column>
  24. <picker-view-column>
  25. <view class="w-picker-item" v-for="(item,index) in data.days" :key="index">{{item}}日</view>
  26. </picker-view-column>
  27. <picker-view-column>
  28. <view class="w-picker-item" v-for="(item,index) in data.areas" :key="index">{{item.label}}</view>
  29. </picker-view-column>
  30. </picker-view>
  31. </view>
  32. <view class="w-picker-view" v-if="mode=='date'">
  33. <picker-view :indicator-style="itemHeight" :value="pickVal" @change="bindChange" @touchstart="touchStart" @touchend="touchEnd">
  34. <picker-view-column>
  35. <view class="w-picker-item" v-for="(item,index) in data.years" :key="index">{{item}}年</view>
  36. </picker-view-column>
  37. <picker-view-column>
  38. <view class="w-picker-item" v-for="(item,index) in data.months" :key="index">{{item}}月</view>
  39. </picker-view-column>
  40. <picker-view-column>
  41. <view class="w-picker-item" v-for="(item,index) in data.days" :key="index">{{item}}日</view>
  42. </picker-view-column>
  43. </picker-view>
  44. </view>
  45. <view class="w-picker-view" v-if="mode=='yearMonth'">
  46. <picker-view :indicator-style="itemHeight" :value="pickVal" @change="bindChange" @touchstart="touchStart" @touchend="touchEnd">
  47. <picker-view-column>
  48. <view class="w-picker-item" v-for="(item,index) in data.years" :key="index">{{item}}年</view>
  49. </picker-view-column>
  50. <picker-view-column>
  51. <view class="w-picker-item" v-for="(item,index) in data.months" :key="index">{{item}}月</view>
  52. </picker-view-column>
  53. </picker-view>
  54. </view>
  55. <view class="w-picker-view" v-if="mode=='dateTime'">
  56. <picker-view :indicator-style="itemHeight" :value="pickVal" @change="bindChange" @touchstart="touchStart" @touchend="touchEnd">
  57. <picker-view-column>
  58. <view class="w-picker-item" v-for="(item,index) in data.years" :key="index">{{item}}年</view>
  59. </picker-view-column>
  60. <picker-view-column>
  61. <view class="w-picker-item" v-for="(item,index) in data.months" :key="index">{{item}}月</view>
  62. </picker-view-column>
  63. <picker-view-column >
  64. <view class="w-picker-item" v-for="(item,index) in data.days" :key="index">{{item}}日</view>
  65. </picker-view-column>
  66. <picker-view-column>
  67. <view class="w-picker-item" v-for="(item,index) in data.hours" :key="index">{{item}}时</view>
  68. </picker-view-column>
  69. <picker-view-column>
  70. <view class="w-picker-item" v-for="(item,index) in data.minutes" :key="index">{{item}}分</view>
  71. </picker-view-column>
  72. <picker-view-column>
  73. <view class="w-picker-item" v-for="(item,index) in data.seconds" :key="index">{{item}}秒</view>
  74. </picker-view-column>
  75. </picker-view>
  76. </view>
  77. <view class="w-picker-view" v-if="mode=='range'">
  78. <picker-view :indicator-style="itemHeight" :value="pickVal" @change="bindChange" @touchstart="touchStart" @touchend="touchEnd">
  79. <picker-view-column>
  80. <view class="w-picker-item" v-for="(item,index) in data.fyears" :key="index">{{item}}</view>
  81. </picker-view-column>
  82. <picker-view-column>
  83. <view class="w-picker-item" v-for="(item,index) in data.fmonths" :key="index">{{item}}</view>
  84. </picker-view-column>
  85. <picker-view-column>
  86. <view class="w-picker-item" v-for="(item,index) in data.fdays" :key="index">{{item}}</view>
  87. </picker-view-column>
  88. <picker-view-column>
  89. <view class="w-picker-item">-</view>
  90. </picker-view-column>
  91. <picker-view-column>
  92. <view class="w-picker-item" v-for="(item,index) in data.tyears" :key="index">{{item}}</view>
  93. </picker-view-column>
  94. <picker-view-column>
  95. <view class="w-picker-item" v-for="(item,index) in data.tmonths" :key="index">{{item}}</view>
  96. </picker-view-column>
  97. <picker-view-column>
  98. <view class="w-picker-item" v-for="(item,index) in data.tdays" :key="index">{{item}}</view>
  99. </picker-view-column>
  100. </picker-view>
  101. </view>
  102. <view class="w-picker-view" v-if="mode=='time'">
  103. <picker-view :indicator-style="itemHeight" :value="pickVal" @change="bindChange" @touchstart="touchStart" @touchend="touchEnd">
  104. <picker-view-column>
  105. <view class="w-picker-item" v-for="(item,index) in data.hours" :key="index">{{item}}时</view>
  106. </picker-view-column>
  107. <picker-view-column>
  108. <view class="w-picker-item" v-for="(item,index) in data.minutes" :key="index">{{item}}分</view>
  109. </picker-view-column>
  110. <picker-view-column>
  111. <view class="w-picker-item" v-for="(item,index) in data.seconds" :key="index">{{item}}秒</view>
  112. </picker-view-column>
  113. </picker-view>
  114. </view>
  115. <view class="w-picker-view" v-if="mode=='region'">
  116. <picker-view :indicator-style="itemHeight" :value="pickVal" @change="bindChange" @touchstart="touchStart" @touchend="touchEnd">
  117. <picker-view-column>
  118. <view class="w-picker-item" v-for="(item,index) in data.provinces" :key="index">{{item.label}}</view>
  119. </picker-view-column>
  120. <picker-view-column>
  121. <view class="w-picker-item" v-for="(item,index) in data.citys" :key="index">{{item.label}}</view>
  122. </picker-view-column>
  123. <picker-view-column v-if="!hideArea">
  124. <view class="w-picker-item" v-for="(item,index) in data.areas" :key="index">{{item.label}}</view>
  125. </picker-view-column>
  126. </picker-view>
  127. </view>
  128. <view class="w-picker-view" v-if="mode=='selector'">
  129. <picker-view :indicator-style="itemHeight" :value="pickVal" @change="bindChange" @touchstart="touchStart" @touchend="touchEnd">
  130. <picker-view-column>
  131. <view class="w-picker-item" v-for="(item,index) in data" :key="index">{{item.label}}</view>
  132. </picker-view-column>
  133. </picker-view>
  134. </view>
  135. <view class="w-picker-view" v-if="mode=='limit'">
  136. <picker-view :indicator-style="itemHeight" :value="pickVal" @change="bindChange" @touchstart="touchStart" @touchend="touchEnd">
  137. <picker-view-column>
  138. <view class="w-picker-item" v-for="(item,index) in data.date" :key="index">{{item.label}}</view>
  139. </picker-view-column>
  140. <picker-view-column>
  141. <view class="w-picker-item" v-for="(item,index) in data.hours" :key="index">{{item.label}}时</view>
  142. </picker-view-column>
  143. <picker-view-column>
  144. <view class="w-picker-item" v-for="(item,index) in data.minutes" :key="index">{{item.label}}分</view>
  145. </picker-view-column>
  146. </picker-view>
  147. </view>
  148. <view class="w-picker-view" v-if="mode=='limitHour'">
  149. <picker-view :indicator-style="itemHeight" :value="pickVal" @change="bindChange" @touchstart="touchStart" @touchend="touchEnd">
  150. <picker-view-column>
  151. <view class="w-picker-item" v-for="(item,index) in data.date" :key="index">{{item.label}}</view>
  152. </picker-view-column>
  153. <picker-view-column>
  154. <view class="w-picker-item" v-for="(item,index) in data.areas" :key="index">{{item.label}}</view>
  155. </picker-view-column>
  156. <picker-view-column>
  157. <view class="w-picker-item" v-for="(item,index) in data.hours" :key="index">{{item.label}}时</view>
  158. </picker-view-column>
  159. </picker-view>
  160. </view>
  161. </view>
  162. </view>
  163. </template>
  164. <script>
  165. import provinces from './city-data/province.js';
  166. import citys from './city-data/city.js';
  167. import areas from './city-data/area.js';
  168. import initPicker from "./w-picker.js";
  169. function oneOf (value, validList) {
  170. for (let i = 0; i < validList.length; i++) {
  171. if (value === validList[i]) {
  172. return true;
  173. }
  174. }
  175. throw new Error('mode无效,请选择有效的mode!');
  176. return false;
  177. }
  178. export default {
  179. data() {
  180. return {
  181. result:[],
  182. data:{},
  183. checkArr:[],
  184. checkValue:[],
  185. pickVal:[],
  186. showPicker:false,
  187. resultStr:"",
  188. itemHeight:`height: ${uni.upx2px(88)}px;`,
  189. confirmFlag:true
  190. };
  191. },
  192. computed:{
  193. },
  194. props:{
  195. mode:{
  196. type:String,
  197. validator(mode){
  198. let modeList=['half','date', 'dateTime', 'yearMonth','time','region','selector','limit','limitHour','range','linkage'];//过滤无效mode;
  199. return oneOf(mode,modeList);
  200. },
  201. default(){
  202. return "date"
  203. }
  204. },
  205. themeColor:{
  206. type:String,
  207. default(){
  208. return "#f5a200"
  209. }
  210. },
  211. startYear:{
  212. type:[String,Number],
  213. default(){
  214. return "1970"
  215. }
  216. },
  217. endYear:{
  218. type:[String,Number],
  219. default(){
  220. return new Date().getFullYear()+''
  221. }
  222. },
  223. defaultVal:{
  224. type:[Array,String],
  225. default:""
  226. },
  227. areaCode:{
  228. type:Array,
  229. default(){
  230. return null
  231. }
  232. },
  233. hideArea:{//隐藏省市区三级联动 地区列
  234. type:Boolean,
  235. default:false
  236. },
  237. step:{
  238. type:[String,Number],
  239. default:1
  240. },
  241. current:{
  242. type:Boolean,
  243. default:false
  244. },
  245. selectList:{
  246. type:Array,
  247. default(){
  248. return [];
  249. }
  250. },
  251. //以下参数仅对mode==limit有效
  252. dayStep:{
  253. type:[String,Number],
  254. default:7
  255. },
  256. startHour:{
  257. type:[String,Number],
  258. default:8
  259. },
  260. endHour:{
  261. type:[String,Number],
  262. default:20
  263. },
  264. minuteStep:{
  265. type:[String,Number],
  266. default:10
  267. },
  268. afterStep:{
  269. type:[String,Number],
  270. default:30
  271. },
  272. disabledAfter:{
  273. type:Boolean,
  274. default:false
  275. },
  276. linkList:{
  277. type:Array,
  278. default(){
  279. return []
  280. }
  281. },
  282. value:{
  283. type:Array,
  284. default(){
  285. return null
  286. }
  287. },
  288. level:{
  289. type:[Number,String],
  290. default:2
  291. },
  292. timeout:{
  293. type:Boolean,
  294. default:false
  295. }
  296. },
  297. watch:{
  298. mode(){
  299. this.initData();
  300. },
  301. selectList(){
  302. this.initData();
  303. },
  304. linkList(){
  305. this.initData();
  306. },
  307. defaultVal(val){
  308. this.initData();
  309. console.log(val)
  310. },
  311. areaCode(){
  312. this.initData();
  313. },
  314. value(){
  315. this.initData();
  316. }
  317. },
  318. methods:{
  319. touchStart(){
  320. if(this.timeout){
  321. this.confirmFlag=false;
  322. }
  323. },
  324. touchEnd(){
  325. if(this.timeout){
  326. setTimeout(()=>{
  327. this.confirmFlag=true;
  328. },500)
  329. }
  330. },
  331. getLinkageVal(value,flag){
  332. let dval=[];
  333. let list=this.linkList;
  334. let lev=this.level;
  335. let arr=value;
  336. let k=0;
  337. let checkArr=[];
  338. let checkValue=[];
  339. let resultStr="";
  340. let data=[];
  341. switch(lev){
  342. case 2:
  343. dval=[0,0];
  344. break;
  345. case 3:
  346. dval=[0,0,0];
  347. break;
  348. }
  349. const getData=(obj,key,str)=>{
  350. if(key<lev){
  351. data.push(obj);
  352. if(!arr){
  353. let item=obj[0];
  354. checkArr.push(item.label);
  355. checkValue.push(item.value);
  356. resultStr+=item.label;
  357. if(item.children){
  358. getData(item.children,key+=1);
  359. }
  360. }else{
  361. obj.map((v,j)=>{
  362. if(flag?v.value==arr[key]:v.label==arr[key]){
  363. dval[key]=j;
  364. checkArr.push(v.label);
  365. checkValue.push(v.value);
  366. resultStr+=v.label;
  367. if(v.children){
  368. getData(v.children,key+=1);
  369. }
  370. }
  371. });
  372. }
  373. return {
  374. data,
  375. dval,
  376. checkArr,
  377. checkValue,
  378. resultStr
  379. };
  380. }else{
  381. return false;
  382. }
  383. };
  384. return getData(list,k);
  385. },
  386. getRegionVal(value,useCode){
  387. let province=value[0];
  388. let city=value[1];
  389. let a=0,b=0,c=0,dval=[];
  390. let _this=this;
  391. provinces.map((v,k)=>{
  392. if(useCode?v.value==province:v.label==province){
  393. a=k;
  394. }
  395. })
  396. citys[a].map((v,k)=>{
  397. if(useCode?v.value==city:v.label==city){
  398. b=k;
  399. }
  400. })
  401. if(!_this.hideArea){
  402. let area=value[2];
  403. areas[a][b].map((v,k)=>{
  404. if(useCode?v.value==area:v.label==area){
  405. c=k;
  406. }
  407. })
  408. dval=[a,b,c];
  409. }else{
  410. dval=[a,b];
  411. }
  412. return dval;
  413. },
  414. useCurrent(){
  415. let aToday=new Date();
  416. let tYear=aToday.getFullYear().toString();
  417. let tMonth=this.formatNum(aToday.getMonth()+1).toString();
  418. let tDay=this.formatNum(aToday.getDate()).toString();
  419. let tHours=this.formatNum(aToday.getHours()).toString();
  420. let tMinutes=this.formatNum(aToday.getMinutes()).toString();
  421. let tSeconds=this.formatNum(aToday.getSeconds()).toString();
  422. if(this.current||!this.defaultVal){
  423. switch(this.mode){
  424. case "range":
  425. return [tYear+"-"+tMonth+"-"+tDay,tYear+"-"+tMonth+"-"+tDay];
  426. break;
  427. case "date":
  428. return tYear+"-"+tMonth+"-"+tDay;
  429. break;
  430. case "yearMonth":
  431. return tYear+"-"+tMonth;
  432. break;
  433. case "time":
  434. return tHours+":"+(Math.floor(tMinutes/this.step)*this.step).toString()+":"+tSeconds;
  435. break;
  436. default :
  437. return tYear+"-"+tMonth+"-"+tDay+" "+tHours+":"+(Math.floor(tMinutes/this.step)*this.step).toString()+":"+tSeconds;
  438. break;
  439. }
  440. }else{
  441. return this.defaultVal;
  442. }
  443. },
  444. formatNum(num){
  445. return num<10?'0'+num:num+'';
  446. },
  447. maskTap(){
  448. this.$emit("cancel",{
  449. checkArr:this.checkArr,
  450. defaultVal:this.pickVal
  451. });
  452. this.showPicker = false;
  453. },
  454. show(){
  455. this.showPicker = true;
  456. },
  457. hide(){
  458. this.showPicker = false;
  459. },
  460. pickerCancel(){
  461. this.$emit("cancel",{
  462. checkArr:this.checkArr,
  463. defaultVal:this.pickVal
  464. });
  465. this.showPicker = false;
  466. },
  467. pickerConfirm(e){
  468. if(!this.confirmFlag){
  469. return;
  470. }
  471. switch(this.mode){
  472. case "range":
  473. let checkArr=this.checkArr;
  474. let fDateTime=new Date(checkArr[0],checkArr[1],checkArr[2]);
  475. let tDateTime=new Date(checkArr[3],checkArr[4],checkArr[5]);
  476. let dVal=this.pickVal;
  477. if(fDateTime>tDateTime){
  478. this.checkArr=[checkArr[3],checkArr[4],checkArr[5],checkArr[0],checkArr[1],checkArr[2]];
  479. this.pickVal=[dVal[4],dVal[5],dVal[6],0,dVal[0],dVal[1],dVal[2]];
  480. this.$emit("confirm",{
  481. checkArr:[...this.checkArr],
  482. from:checkArr[3]+"-"+checkArr[4]+"-"+checkArr[5],
  483. to:checkArr[0]+"-"+checkArr[1]+"-"+checkArr[2],
  484. defaultVal:[...this.pickVal],
  485. result:this.resultStr
  486. });
  487. }else{
  488. this.$emit("confirm",{
  489. checkArr:[...this.checkArr],
  490. from:checkArr[0]+"-"+checkArr[1]+"-"+checkArr[2],
  491. to:checkArr[3]+"-"+checkArr[4]+"-"+checkArr[5],
  492. defaultVal:[...this.pickVal],
  493. result:this.resultStr
  494. });
  495. }
  496. break;
  497. case "limit":
  498. let aTime=new Date().getTime();
  499. let bTime=new Date(this.resultStr.replace(/-/g,'/')).getTime();
  500. if(aTime>bTime){
  501. uni.showModal({
  502. title:"提示",
  503. content:"选择时间必须大于当前时间",
  504. confirmColor:this.themeColor
  505. });
  506. return;
  507. }
  508. this.$emit("confirm",{
  509. checkArr:[...this.checkArr],
  510. defaultVal:[...this.pickVal],
  511. result:this.resultStr
  512. });
  513. break;
  514. case "region":
  515. case "linkage":
  516. this.$emit("confirm",{
  517. checkArr:[...this.checkArr],
  518. checkValue:[...this.checkValue],
  519. defaultVal:[...this.pickVal],
  520. result:this.resultStr
  521. });
  522. break;
  523. case "selector":
  524. this.$emit("confirm",{
  525. checkArr:this.checkArr,
  526. defaultVal:[...this.pickVal],
  527. result:this.resultStr
  528. });
  529. break;
  530. default:
  531. this.$emit("confirm",{
  532. checkArr:[this.checkArr],
  533. defaultVal:[...this.pickVal],
  534. result:this.resultStr
  535. });
  536. break;
  537. }
  538. this.showPicker = false;
  539. },
  540. bindChange(val){
  541. let _this=this;
  542. let arr=val.detail.value;
  543. let year="",month="",day="",hour="",minute="",second="",note=[],province,city,area;
  544. let checkArr=_this.checkArr;
  545. let days=[],months=[],endYears=[],endMonths=[],endDays=[],startDays=[];
  546. let mode=_this.mode;
  547. let col1,col2,col3,d,a,h,m;
  548. let xDate=new Date().getTime();
  549. switch(mode){
  550. case "limitHour":
  551. col1=_this.data.date[arr[0]];
  552. col2=_this.data.areas[arr[1]];
  553. col3=_this.data.hours[arr[2]];
  554. if(col1.value!=checkArr[0].value){
  555. arr[1]=0;
  556. arr[2]=0;
  557. let areas=initPicker.limitHour.initAreas(col1);
  558. _this.data.areas=areas;
  559. let hours=initPicker.limitHour.initHours(col1,_this.data.areas[arr[1]]);
  560. _this.data.hours=hours;
  561. };
  562. if(col2.value!=checkArr[1].value){
  563. arr[2]=0;
  564. let hours=initPicker.limitHour.initHours(col1,_this.data.areas[arr[1]]);
  565. _this.data.hours=hours;
  566. };
  567. d=_this.data.date[arr[0]]||_this.data.date[_this.data.date.length-1];
  568. a=_this.data.areas[arr[1]]||_this.data.areas[_this.data.areas.length-1];
  569. h=_this.data.hours[arr[2]]||_this.data.hours[_this.data.hours.length-1];
  570. _this.checkArr=[d,a,h];
  571. _this.resultStr=`${d.value+' '+a.label+' '+h.label+"时"}`;
  572. break;
  573. case "limit":
  574. col1=_this.data.date[arr[0]];
  575. col2=_this.data.hours[arr[1]];
  576. if(col1.value!=checkArr[0].value){
  577. let hours=initPicker.limit.initHours(_this.startHour,_this.endHour,_this.minuteStep,_this.afterStep,col1.value);
  578. let minutes=initPicker.limit.initMinutes(_this.startHour,_this.endHour,_this.minuteStep,_this.afterStep,col1.value,col2.value);
  579. _this.data.hours=hours;
  580. _this.data.minutes=minutes;
  581. };
  582. if(col2.value!=checkArr[1].value){
  583. let minutes=initPicker.limit.initMinutes(_this.startHour,_this.endHour,_this.minuteStep,_this.afterStep,col1.value,col2.value);
  584. _this.data.minutes=minutes;
  585. };
  586. d=_this.data.date[arr[0]]||_this.data.date[_this.data.date.length-1];
  587. h=_this.data.hours[arr[1]]||_this.data.hours[_this.data.hours.length-1];
  588. m=_this.data.minutes[arr[2]]||_this.data.minutes[_this.data.minutes.length-1];
  589. _this.checkArr=[d,h,m];
  590. _this.resultStr=`${d.value+' '+h.value+':'+m.value+":"+"00"}`;
  591. break;
  592. case "range":
  593. let fyear=_this.data.fyears[arr[0]]||_this.data.fyears[_this.data.fyears.length-1];
  594. let fmonth=_this.data.fmonths[arr[1]]||_this.data.fmonths[_this.data.fmonths.length-1];
  595. let fday=_this.data.fdays[arr[2]]||_this.data.fdays[_this.data.fdays.length-1];
  596. let tyear=_this.data.tyears[arr[4]]||_this.data.tyears[_this.data.tyears.length-1];
  597. let tmonth=_this.data.tmonths[arr[5]]||_this.data.tmonths[_this.data.tmonths.length-1];
  598. let tday=_this.data.tdays[arr[6]]||_this.data.tdays[_this.data.tdays.length-1];
  599. if(fyear!=checkArr[0]){
  600. arr[4]=0;
  601. arr[5]=0;
  602. arr[6]=0;
  603. startDays=initPicker.range.initStartDays(fyear,fmonth);
  604. endYears=initPicker.range.initEndYears(fyear,_this.startYear,_this.endYear);
  605. endMonths=initPicker.range.initEndMonths(fmonth);
  606. endDays=initPicker.range.initEndDays(fyear,fmonth,fday,tyear,tmonth);
  607. _this.data.fdays=startDays;
  608. _this.data.tyears=endYears;
  609. _this.data.tmonths=endMonths;
  610. _this.data.tdays=endDays;
  611. tyear=_this.data.tyears[0];
  612. checkArr[3]=_this.data.tyears[0];
  613. tmonth=_this.data.tmonths[0];
  614. checkArr[4]=_this.data.tmonths[0];
  615. tday=_this.data.tdays[0];
  616. checkArr[5]=_this.data.tdays[0];
  617. };
  618. if(fmonth!=checkArr[1]){
  619. arr[4]=0;
  620. arr[5]=0;
  621. arr[6]=0;
  622. startDays=initPicker.range.initStartDays(fyear,fmonth);
  623. endYears=initPicker.range.initEndYears(fyear,_this.startYear,_this.endYear);
  624. endMonths=initPicker.range.initEndMonths(fmonth);
  625. endDays=initPicker.range.initEndDays(fyear,fmonth,fday,tyear,tmonth);
  626. _this.data.fdays=startDays;
  627. _this.data.tyears=endYears;
  628. _this.data.tmonths=endMonths;
  629. _this.data.tdays=endDays;
  630. tyear=_this.data.tyears[0];
  631. checkArr[3]=_this.data.tyears[0];
  632. tmonth=_this.data.tmonths[0];
  633. checkArr[4]=_this.data.tmonths[0];
  634. tday=_this.data.tdays[0];
  635. checkArr[5]=_this.data.tdays[0];
  636. };
  637. if(fday!=checkArr[2]){
  638. arr[4]=0;
  639. arr[5]=0;
  640. arr[6]=0;
  641. endYears=initPicker.range.initEndYears(fyear,_this.startYear,_this.endYear);
  642. endMonths=initPicker.range.initEndMonths(fmonth);
  643. endDays=initPicker.range.initEndDays(fyear,fmonth,fday,tyear,tmonth);
  644. _this.data.tyears=endYears;
  645. _this.data.tmonths=endMonths;
  646. _this.data.tdays=endDays;
  647. tyear=_this.data.tyears[0];
  648. checkArr[3]=_this.data.tyears[0];
  649. tmonth=_this.data.tmonths[0];
  650. checkArr[4]=_this.data.tmonths[0];
  651. tday=_this.data.tdays[0];
  652. checkArr[5]=_this.data.tdays[0];
  653. };
  654. if(tyear!=checkArr[3]){
  655. arr[5]=0;
  656. arr[6]=0;
  657. endMonths=initPicker.range.initToMonths(fyear,fmonth,fday,tyear);
  658. endDays=initPicker.range.initEndDays(fyear,fmonth,fday,tyear,tmonth);
  659. _this.data.tmonths=endMonths;
  660. _this.data.tdays=endDays;
  661. tmonth=_this.data.tmonths[0];
  662. checkArr[4]=_this.data.tmonths[0];
  663. tday=_this.data.tdays[0];
  664. checkArr[5]=_this.data.tdays[0];
  665. };
  666. if(tmonth!=checkArr[4]){
  667. arr[6]=0;
  668. endDays=initPicker.range.initToDays(fyear,fmonth,fday,tyear,tmonth);
  669. _this.data.tdays=endDays;
  670. tday=_this.data.tdays[0];
  671. checkArr[5]=_this.data.tdays[0];
  672. };
  673. _this.checkArr=[fyear,fmonth,fday,tyear,tmonth,tday];
  674. _this.resultStr=`${fyear+'-'+fmonth+'-'+fday+'至'+tyear+'-'+tmonth+'-'+tday}`;
  675. break;
  676. case "half":
  677. year=_this.data.years[arr[0]]||_this.data.years[_this.data.years.length-1];
  678. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  679. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  680. area=_this.data.areas[arr[3]]||_this.data.areas[_this.data.areas.length-1];
  681. if(year!=checkArr[0]){
  682. months=initPicker.date.initMonths(year,_this.disabledAfter);
  683. days=initPicker.date.initDays(year,month,_this.disabledAfter);
  684. if(_this.disabledAfter){
  685. arr[1]=arr[1]>(months.length-1)?months.length-1:arr[1];
  686. arr[2]=arr[2]>(days.length-1)?days.length-1:arr[2];
  687. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  688. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  689. }
  690. _this.data.days=days;
  691. _this.data.months=months;
  692. };
  693. if(month!=checkArr[1]){
  694. days=initPicker.date.initDays(year,month,_this.disabledAfter);
  695. arr[2]=arr[2]>(days.length-1)?days.length-1:arr[2];
  696. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  697. _this.data.days=days;
  698. };
  699. _this.checkArr=[year,month,day,area];
  700. _this.resultStr=`${year+'-'+month+'-'+day+area.label}`;
  701. break;
  702. case "date":
  703. year=_this.data.years[arr[0]]||_this.data.years[_this.data.years.length-1];
  704. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  705. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  706. if(year!=checkArr[0]){
  707. months=initPicker.date.initMonths(year,_this.disabledAfter);
  708. days=initPicker.date.initDays(year,month,_this.disabledAfter);
  709. if(_this.disabledAfter){
  710. arr[1]=arr[1]>(months.length-1)?months.length-1:arr[1];
  711. arr[2]=arr[2]>(days.length-1)?days.length-1:arr[2];
  712. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  713. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  714. }
  715. _this.data.days=days;
  716. _this.data.months=months;
  717. };
  718. if(month!=checkArr[1]){
  719. days=initPicker.date.initDays(year,month,_this.disabledAfter);
  720. arr[2]=arr[2]>(days.length-1)?days.length-1:arr[2];
  721. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  722. _this.data.days=days;
  723. };
  724. _this.checkArr=[year,month,day];
  725. _this.resultStr=`${year+'-'+month+'-'+day}`;
  726. break;
  727. case "yearMonth":
  728. year=_this.data.years[arr[0]]||_this.data.years[_this.data.years.length-1];
  729. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  730. if(year!=checkArr[0]){
  731. if(_this.disabledAfter){
  732. arr[1]=arr[1]>(months.length-1)?months.length-1:arr[1];
  733. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  734. }
  735. months=initPicker.date.initMonths(year,_this.disabledAfter);
  736. _this.data.months=months;
  737. };
  738. _this.checkArr=[year,month];
  739. _this.resultStr=`${year+'-'+month}`;
  740. break;
  741. case "dateTime":
  742. year=_this.data.years[arr[0]]||_this.data.years[_this.data.years.length-1];
  743. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  744. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  745. hour=_this.data.hours[arr[3]]||_this.data.hours[_this.data.hours.length-1];
  746. minute=_this.data.minutes[arr[4]]||_this.data.minutes[_this.data.minutes.length-1];
  747. second=_this.data.seconds[arr[5]]||_this.data.seconds[_this.data.seconds.length-1];
  748. if(year!=checkArr[0]){
  749. arr[2]=0;
  750. days=initPicker.date.initDays(year,month);
  751. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  752. _this.data.days=days;
  753. };
  754. if(month!=checkArr[1]){
  755. arr[2]=0;
  756. days=initPicker.date.initDays(year,month);
  757. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  758. _this.data.days=days;
  759. };
  760. _this.checkArr=[year,month,day,hour,minute,second];
  761. _this.resultStr=`${year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second}`;
  762. break;
  763. case "time":
  764. hour=_this.data.hours[arr[0]]||_this.data.hours[_this.data.hours.length-1];
  765. minute=_this.data.minutes[arr[1]]||_this.data.minutes[_this.data.minutes.length-1];
  766. second=_this.data.seconds[arr[2]]||_this.data.seconds[_this.data.seconds.length-1];
  767. _this.checkArr=[hour,minute,second];
  768. _this.resultStr=`${hour+':'+minute+':'+second}`;
  769. break;
  770. case "linkage":
  771. let c1,c2,c3;
  772. let list=this.linkList;
  773. c1=_this.data[0][arr[0]]||_this.data[0][0];
  774. c2=_this.data[1][arr[1]]||_this.data[1][0];
  775. if(this.level==3){
  776. c3=_this.data[2][arr[2]]||_this.data[2][0];
  777. if(c1.label!=checkArr[0]){
  778. arr[1] = 0;
  779. arr[2] = 0;
  780. _this.data[1]=list[arr[0]].children;
  781. _this.data[2]=list[arr[0]].children[arr[1]].children;
  782. c2=_this.data[1][arr[1]]||_this.data[1][0];
  783. c3=_this.data[2][arr[2]]||_this.data[2][0];
  784. };
  785. if(c2.label!=checkArr[1]){
  786. arr[2] = 0;
  787. _this.data[2]=list[arr[0]].children[arr[1]].children;
  788. c3=_this.data[2][arr[2]]||_this.data[2][0];
  789. };
  790. _this.checkArr=[c1.label,c2.label,c3.label];
  791. _this.checkValue=[
  792. _this.data[0][arr[0]]?_this.data[0][arr[0]].value:_this.data[0][0].value,
  793. _this.data[1][arr[1]]?_this.data[1][arr[1]].value:_this.data[1][0].value,
  794. _this.data[2][arr[2]]?_this.data[2][arr[2]].value:_this.data[2][0].value
  795. ];
  796. _this.resultStr=c1.label+c2.label+c3.label;
  797. }else{
  798. if(c1.label!=checkArr[0]){
  799. _this.data[1]=list[arr[0]].children;
  800. arr[1] = 0;
  801. c2=_this.data[1][arr[1]]||_this.data[1][0];
  802. };
  803. _this.checkArr=[c1.label,c2.label];
  804. _this.checkValue=[
  805. _this.data[0][arr[0]]?_this.data[0][arr[0]].value:_this.data[0][0].value,
  806. _this.data[1][arr[1]]?_this.data[1][arr[1]].value:_this.data[1][0].value
  807. ];
  808. _this.resultStr=c1.label+c2.label;
  809. }
  810. break;
  811. case "region":
  812. province=_this.data.provinces[arr[0]]||_this.data.provinces[0];
  813. city=_this.data.citys[arr[1]]||_this.data.citys[0];
  814. if(!_this.hideArea){
  815. area=_this.data.areas[arr[2]]||_this.data.areas[0];
  816. }
  817. if(province.label!=checkArr[0]){
  818. _this.data.citys = citys[arr[0]]||citys[0];
  819. if(!_this.hideArea){
  820. _this.data.areas = areas[arr[0]][0]||areas[0][0];
  821. }
  822. arr[1] = 0;
  823. arr[2] = 0;
  824. city=_this.data.citys[arr[1]]||_this.data.citys[0];
  825. if(!_this.hideArea){
  826. area=_this.data.areas[arr[2]]||_this.data.areas[0];
  827. }
  828. };
  829. if(city.label!=checkArr[1]&&!_this.hideArea){
  830. _this.data.areas = areas[arr[0]][arr[1]]||areas[0][0];
  831. arr[2]=0;
  832. area=_this.data.areas[arr[2]]||_this.data.areas[0];
  833. };
  834. if(!_this.hideArea){
  835. _this.checkArr=[province.label,city.label,area.label];
  836. _this.checkValue=[
  837. _this.data.provinces[arr[0]]?_this.data.provinces[arr[0]].value:_this.data.provinces[0].value,
  838. _this.data.citys[arr[1]]?_this.data.citys[arr[1]].value:_this.data.citys[0].value,
  839. _this.data.areas[arr[2]]?_this.data.areas[arr[2]].value:_this.data.areas[0].value
  840. ];
  841. _this.resultStr=province.label+city.label+area.label;
  842. }else{
  843. _this.checkArr=[province.label,city.label];
  844. _this.checkValue=[
  845. _this.data.provinces[arr[0]]?_this.data.provinces[arr[0]].value:_this.data.provinces[0].value,
  846. _this.data.citys[arr[1]]?_this.data.citys[arr[1]].value:_this.data.citys[0].value
  847. ];
  848. _this.resultStr=province.label+city.label;
  849. };
  850. break;
  851. case "selector":
  852. _this.checkArr=_this.data[arr[0]]||_this.data[_this.data.length-1];
  853. _this.resultStr=_this.data[arr[0]]?_this.data[arr[0]].label:_this.data[_this.data.length-1].label;
  854. break;
  855. }
  856. _this.$nextTick(()=>{
  857. _this.pickVal=arr;
  858. })
  859. },
  860. initData(){
  861. let _this=this;
  862. let data={};
  863. let mode=_this.mode;
  864. let year,month,day,hour,minute,second,province,city,area;
  865. let col1,col2,col3;
  866. let dVal=[];
  867. switch(mode){
  868. case "linkage":
  869. let init;
  870. if(_this.value){
  871. init=_this.getLinkageVal(_this.value,true);
  872. }else{
  873. init=_this.getLinkageVal(_this.defaultVal);
  874. }
  875. dVal=init.dval;
  876. data=init.data;
  877. _this.checkArr=init.checkArr;
  878. _this.checkValue=init.checkValue;
  879. _this.resultStr=init.resultStr;
  880. break;
  881. case "region":
  882. if(_this.areaCode){
  883. dVal=_this.getRegionVal(_this.areaCode,true);
  884. }else{
  885. dVal=_this.getRegionVal(_this.defaultVal);
  886. }
  887. if(_this.hideArea){
  888. data={
  889. provinces:provinces,
  890. citys:citys[dVal[0]]
  891. };
  892. }else{
  893. data={
  894. provinces:provinces,
  895. citys:citys[dVal[0]],
  896. areas:areas[dVal[0]][dVal[1]]
  897. };
  898. };
  899. break;
  900. case "selector":
  901. let idx=0;
  902. data=[..._this.selectList];
  903. _this.selectList.map((v,k)=>{
  904. if(v.label==this.defaultVal){
  905. idx=k;
  906. }
  907. })
  908. dVal=[idx];
  909. break;
  910. case "limit":
  911. data=initPicker.limit.init(_this.dayStep,_this.startHour,_this.endHour,_this.minuteStep,_this.afterStep,this.defaultVal);
  912. dVal=data.defaultVal||_this.defaultVal;
  913. break;
  914. case "limitHour":
  915. data=initPicker.limitHour.init(_this.dayStep,this.defaultVal);
  916. dVal=data.defaultVal||_this.defaultVal;
  917. break;
  918. case "range":
  919. data=initPicker.range.init(_this.startYear,_this.endYear,_this.useCurrent(),_this.current);
  920. dVal=data.defaultVal||_this.defaultVal;
  921. break;
  922. default:
  923. data=initPicker.date.init(_this.startYear,_this.endYear,_this.mode,_this.step,_this.useCurrent(),_this.current,_this.disabledAfter);
  924. dVal=data.defaultVal||_this.defaultVal;
  925. break;
  926. }
  927. _this.data=data;
  928. switch(mode){
  929. case "limitHour":
  930. col1=data.date[dVal[0]]||data.date[data.date.length-1];
  931. col2=data.areas[dVal[2]]||data.areas[data.areas.length-1];
  932. col3=data.hours[dVal[1]]||data.hours[data.hours.length-1];
  933. _this.checkArr=[col1,col2,col3];
  934. _this.resultStr=`${col1.value+' '+col2.label+' '+col3.label+'时'}`;
  935. break;
  936. case "limit":
  937. col1=data.date[dVal[0]]||data.date[data.date.length-1];
  938. col2=data.hours[dVal[1]]||data.hours[data.hours.length-1];
  939. col3=data.minutes[dVal[2]]||data.minutes[data.minutes.length-1];
  940. _this.checkArr=[col1,col2,col3];
  941. _this.resultStr=`${col1.value+' '+col2.value+':'+col3.value+":"+"00"}`;
  942. break;
  943. case "range":
  944. let fYear=data.fyears[dVal[0]]||data.fyears[data.fyears.length-1];
  945. let fmonth=data.fmonths[dVal[1]]||data.fmonths[data.fmonths.length-1];
  946. let fday=data.fdays[dVal[2]]||data.fdays[data.fdays.length-1];
  947. let tYear=data.tyears[dVal[4]]||data.tyears[data.tyears.length-1];
  948. let tmonth=data.tmonths[dVal[5]]||data.tmonths[data.tmonths.length-1];
  949. let tday=data.tdays[dVal[6]]||data.tdays[data.tdays.length-1];
  950. _this.checkArr=[fYear,fmonth,fday,tYear,tmonth,tday];
  951. _this.resultStr=`${fYear+'-'+fmonth+'-'+fday+'至'+tYear+'-'+tmonth+'-'+tday}`;
  952. break;
  953. case "half":
  954. year=data.years[dVal[0]]||data.years[data.years.length-1];
  955. month=data.months[dVal[1]]||data.months[data.months.length-1];
  956. day=data.days[dVal[2]]||data.days[data.days.length-1];
  957. area=data.areas[dVal[3]]||data.areas[data.areas.length-1];
  958. _this.checkArr=[year,month,day,area];
  959. _this.resultStr=`${year+'-'+month+'-'+day+' '+area.label}`;
  960. break;
  961. case "date":
  962. year=data.years[dVal[0]]||data.years[data.years.length-1];
  963. month=data.months[dVal[1]]||data.months[data.months.length-1];
  964. day=data.days[dVal[2]]||data.days[data.days.length-1];
  965. _this.checkArr=[year,month,day];
  966. _this.resultStr=`${year+'-'+month+'-'+day}`;
  967. break;
  968. case "yearMonth":
  969. year=data.years[dVal[0]]||data.years[data.years.length-1];
  970. month=data.months[dVal[1]]||data.months[data.months.length-1];
  971. _this.checkArr=[year,month];
  972. _this.resultStr=`${year+'-'+month}`;
  973. break;
  974. case "dateTime":
  975. year=data.years[dVal[0]]||data.years[data.years.length-1];
  976. month=data.months[dVal[1]]||data.months[data.months.length-1];
  977. day=data.days[dVal[2]]||data.days[data.days.length-1];
  978. hour=data.hours[dVal[3]]||data.hours[data.hours.length-1];
  979. minute=data.minutes[dVal[4]]||data.minutes[data.minutes.length-1];
  980. second=data.seconds[dVal[5]]||data.seconds[data.seconds.length-1];
  981. _this.resultStr=`${year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second}`;
  982. _this.checkArr=[year,month,day,hour,minute];
  983. break;
  984. case "time":
  985. hour=data.hours[dVal[0]]||data.hours[data.hours.length-1];
  986. minute=data.minutes[dVal[1]]||data.minutes[data.minutes.length-1];
  987. second=data.seconds[dVal[2]]||data.seconds[data.seconds.length-1];
  988. _this.checkArr=[hour,minute,second];
  989. _this.resultStr=`${hour+':'+minute+':'+second}`;
  990. break;
  991. case "region":
  992. province=data.provinces[dVal[0]];
  993. city=data.citys[dVal[1]];
  994. if(!_this.hideArea){
  995. area=data.areas[dVal[2]];
  996. _this.checkArr=[province.label,city.label,area.label];
  997. _this.checkValue=[province.value,city.value,area.value];
  998. _this.resultStr=province.label+city.label+area.label;
  999. }else{
  1000. _this.checkArr=[province.label,city.label];
  1001. _this.checkValue=[province.value,city.value];
  1002. _this.resultStr=province.label+city.label;
  1003. }
  1004. break;
  1005. case "selector":
  1006. _this.checkArr=data[dVal[0]]||data[data.length-1];
  1007. _this.resultStr=data[dVal[0]].label||data[data.length-1].label;
  1008. break;
  1009. }
  1010. _this.$nextTick(()=>{
  1011. _this.pickVal=[...dVal];
  1012. })
  1013. }
  1014. },
  1015. mounted() {
  1016. this.initData();
  1017. }
  1018. }
  1019. </script>
  1020. <style lang="scss">
  1021. .w-picker{
  1022. position: relative;
  1023. z-index: 888;
  1024. .mask {
  1025. position: fixed;
  1026. z-index: 1000;
  1027. top: 0;
  1028. right: 0;
  1029. left: 0;
  1030. bottom: 0;
  1031. background: rgba(0, 0, 0, 0.6);
  1032. visibility: hidden;
  1033. opacity: 0;
  1034. transition: all 0.3s ease;
  1035. }
  1036. .mask.show{
  1037. visibility: visible;
  1038. opacity: 1;
  1039. }
  1040. .w-picker-cnt {
  1041. position: fixed;
  1042. bottom: 0;
  1043. left: 0;
  1044. width: 100%;
  1045. transition: all 0.3s ease;
  1046. transform: translateY(100%);
  1047. z-index: 3000;
  1048. }
  1049. .w-picker-cnt.show {
  1050. transform: translateY(0);
  1051. }
  1052. .w-picker-hd {
  1053. display: flex;
  1054. align-items: center;
  1055. padding: 0 30upx;
  1056. height: 88upx;
  1057. background-color: #fff;
  1058. position: relative;
  1059. text-align: center;
  1060. font-size: 32upx;
  1061. justify-content: space-between;
  1062. .w-picker-btn{
  1063. font-size: 30upx;
  1064. }
  1065. }
  1066. .w-picker-hd:after {
  1067. content: ' ';
  1068. position: absolute;
  1069. left: 0;
  1070. bottom: 0;
  1071. right: 0;
  1072. height: 1px;
  1073. border-bottom: 1px solid #e5e5e5;
  1074. color: #e5e5e5;
  1075. transform-origin: 0 100%;
  1076. transform: scaleY(0.5);
  1077. }
  1078. .w-picker-item {
  1079. text-align: center;
  1080. width: 100%;
  1081. height: 88upx;
  1082. line-height: 88upx;
  1083. text-overflow: ellipsis;
  1084. white-space: nowrap;
  1085. font-size: 30upx;
  1086. }
  1087. .w-picker-view {
  1088. width: 100%;
  1089. height: 476upx;
  1090. overflow: hidden;
  1091. background-color: #FFFFFF;
  1092. z-index: 666;
  1093. }
  1094. picker-view{
  1095. height: 100%;
  1096. }
  1097. }
  1098. </style>