w-picker.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103
  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. },
  310. areaCode(){
  311. this.initData();
  312. },
  313. value(){
  314. this.initData();
  315. }
  316. },
  317. methods:{
  318. touchStart(){
  319. if(this.timeout){
  320. this.confirmFlag=false;
  321. }
  322. },
  323. touchEnd(){
  324. if(this.timeout){
  325. setTimeout(()=>{
  326. this.confirmFlag=true;
  327. },500)
  328. }
  329. },
  330. getLinkageVal(value,flag){
  331. let dval=[];
  332. let list=this.linkList;
  333. let lev=this.level;
  334. let arr=value;
  335. let k=0;
  336. let checkArr=[];
  337. let checkValue=[];
  338. let resultStr="";
  339. let data=[];
  340. switch(lev){
  341. case 2:
  342. dval=[0,0];
  343. break;
  344. case 3:
  345. dval=[0,0,0];
  346. break;
  347. }
  348. const getData=(obj,key,str)=>{
  349. if(key<lev){
  350. data.push(obj);
  351. if(!arr){
  352. let item=obj[0];
  353. checkArr.push(item.label);
  354. checkValue.push(item.value);
  355. resultStr+=item.label;
  356. if(item.children){
  357. getData(item.children,key+=1);
  358. }
  359. }else{
  360. obj.map((v,j)=>{
  361. if(flag?v.value==arr[key]:v.label==arr[key]){
  362. dval[key]=j;
  363. checkArr.push(v.label);
  364. checkValue.push(v.value);
  365. resultStr+=v.label;
  366. if(v.children){
  367. getData(v.children,key+=1);
  368. }
  369. }
  370. });
  371. }
  372. return {
  373. data,
  374. dval,
  375. checkArr,
  376. checkValue,
  377. resultStr
  378. };
  379. }else{
  380. return false;
  381. }
  382. };
  383. return getData(list,k);
  384. },
  385. getRegionVal(value,useCode){
  386. let province=value[0];
  387. let city=value[1];
  388. let a=0,b=0,c=0,dval=[];
  389. let _this=this;
  390. provinces.map((v,k)=>{
  391. if(useCode?v.value==province:v.label==province){
  392. a=k;
  393. }
  394. })
  395. citys[a].map((v,k)=>{
  396. if(useCode?v.value==city:v.label==city){
  397. b=k;
  398. }
  399. })
  400. if(!_this.hideArea){
  401. let area=value[2];
  402. areas[a][b].map((v,k)=>{
  403. if(useCode?v.value==area:v.label==area){
  404. c=k;
  405. }
  406. })
  407. dval=[a,b,c];
  408. }else{
  409. dval=[a,b];
  410. }
  411. return dval;
  412. },
  413. useCurrent(){
  414. let aToday=new Date();
  415. let tYear=aToday.getFullYear().toString();
  416. let tMonth=this.formatNum(aToday.getMonth()+1).toString();
  417. let tDay=this.formatNum(aToday.getDate()).toString();
  418. let tHours=this.formatNum(aToday.getHours()).toString();
  419. let tMinutes=this.formatNum(aToday.getMinutes()).toString();
  420. let tSeconds=this.formatNum(aToday.getSeconds()).toString();
  421. if(this.current||!this.defaultVal){
  422. switch(this.mode){
  423. case "range":
  424. return [tYear+"-"+tMonth+"-"+tDay,tYear+"-"+tMonth+"-"+tDay];
  425. break;
  426. case "date":
  427. return tYear+"-"+tMonth+"-"+tDay;
  428. break;
  429. case "yearMonth":
  430. return tYear+"-"+tMonth;
  431. break;
  432. case "time":
  433. return tHours+":"+(Math.floor(tMinutes/this.step)*this.step).toString()+":"+tSeconds;
  434. break;
  435. default :
  436. return tYear+"-"+tMonth+"-"+tDay+" "+tHours+":"+(Math.floor(tMinutes/this.step)*this.step).toString()+":"+tSeconds;
  437. break;
  438. }
  439. }else{
  440. return this.defaultVal;
  441. }
  442. },
  443. formatNum(num){
  444. return num<10?'0'+num:num+'';
  445. },
  446. maskTap(){
  447. this.$emit("cancel",{
  448. checkArr:this.checkArr,
  449. defaultVal:this.pickVal
  450. });
  451. this.showPicker = false;
  452. },
  453. show(){
  454. this.showPicker = true;
  455. },
  456. hide(){
  457. this.showPicker = false;
  458. },
  459. pickerCancel(){
  460. this.$emit("cancel",{
  461. checkArr:this.checkArr,
  462. defaultVal:this.pickVal
  463. });
  464. this.showPicker = false;
  465. },
  466. pickerConfirm(e){
  467. if(!this.confirmFlag){
  468. return;
  469. }
  470. switch(this.mode){
  471. case "range":
  472. let checkArr=this.checkArr;
  473. let fDateTime=new Date(checkArr[0],checkArr[1],checkArr[2]);
  474. let tDateTime=new Date(checkArr[3],checkArr[4],checkArr[5]);
  475. let dVal=this.pickVal;
  476. if(fDateTime>tDateTime){
  477. this.checkArr=[checkArr[3],checkArr[4],checkArr[5],checkArr[0],checkArr[1],checkArr[2]];
  478. this.pickVal=[dVal[4],dVal[5],dVal[6],0,dVal[0],dVal[1],dVal[2]];
  479. this.$emit("confirm",{
  480. checkArr:[...this.checkArr],
  481. from:checkArr[3]+"-"+checkArr[4]+"-"+checkArr[5],
  482. to:checkArr[0]+"-"+checkArr[1]+"-"+checkArr[2],
  483. defaultVal:[...this.pickVal],
  484. result:this.resultStr
  485. });
  486. }else{
  487. this.$emit("confirm",{
  488. checkArr:[...this.checkArr],
  489. from:checkArr[0]+"-"+checkArr[1]+"-"+checkArr[2],
  490. to:checkArr[3]+"-"+checkArr[4]+"-"+checkArr[5],
  491. defaultVal:[...this.pickVal],
  492. result:this.resultStr
  493. });
  494. }
  495. break;
  496. case "limit":
  497. let aTime=new Date().getTime();
  498. let bTime=new Date(this.resultStr.replace(/-/g,'/')).getTime();
  499. if(aTime>bTime){
  500. uni.showModal({
  501. title:"提示",
  502. content:"选择时间必须大于当前时间",
  503. confirmColor:this.themeColor
  504. });
  505. return;
  506. }
  507. this.$emit("confirm",{
  508. checkArr:[...this.checkArr],
  509. defaultVal:[...this.pickVal],
  510. result:this.resultStr
  511. });
  512. break;
  513. case "region":
  514. case "linkage":
  515. this.$emit("confirm",{
  516. checkArr:[...this.checkArr],
  517. checkValue:[...this.checkValue],
  518. defaultVal:[...this.pickVal],
  519. result:this.resultStr
  520. });
  521. break;
  522. case "selector":
  523. this.$emit("confirm",{
  524. checkArr:this.checkArr,
  525. defaultVal:[...this.pickVal],
  526. result:this.resultStr
  527. });
  528. break;
  529. default:
  530. this.$emit("confirm",{
  531. checkArr:[this.checkArr],
  532. defaultVal:[...this.pickVal],
  533. result:this.resultStr
  534. });
  535. break;
  536. }
  537. this.showPicker = false;
  538. },
  539. bindChange(val){
  540. let _this=this;
  541. let arr=val.detail.value;
  542. let year="",month="",day="",hour="",minute="",second="",note=[],province,city,area;
  543. let checkArr=_this.checkArr;
  544. let days=[],months=[],endYears=[],endMonths=[],endDays=[],startDays=[];
  545. let mode=_this.mode;
  546. let col1,col2,col3,d,a,h,m;
  547. let xDate=new Date().getTime();
  548. switch(mode){
  549. case "limitHour":
  550. col1=_this.data.date[arr[0]];
  551. col2=_this.data.areas[arr[1]];
  552. col3=_this.data.hours[arr[2]];
  553. if(col1.value!=checkArr[0].value){
  554. arr[1]=0;
  555. arr[2]=0;
  556. let areas=initPicker.limitHour.initAreas(col1);
  557. _this.data.areas=areas;
  558. let hours=initPicker.limitHour.initHours(col1,_this.data.areas[arr[1]]);
  559. _this.data.hours=hours;
  560. };
  561. if(col2.value!=checkArr[1].value){
  562. arr[2]=0;
  563. let hours=initPicker.limitHour.initHours(col1,_this.data.areas[arr[1]]);
  564. _this.data.hours=hours;
  565. };
  566. d=_this.data.date[arr[0]]||_this.data.date[_this.data.date.length-1];
  567. a=_this.data.areas[arr[1]]||_this.data.areas[_this.data.areas.length-1];
  568. h=_this.data.hours[arr[2]]||_this.data.hours[_this.data.hours.length-1];
  569. _this.checkArr=[d,a,h];
  570. _this.resultStr=`${d.value+' '+a.label+' '+h.label+"时"}`;
  571. break;
  572. case "limit":
  573. col1=_this.data.date[arr[0]];
  574. col2=_this.data.hours[arr[1]];
  575. if(col1.value!=checkArr[0].value){
  576. let hours=initPicker.limit.initHours(_this.startHour,_this.endHour,_this.minuteStep,_this.afterStep,col1.value);
  577. let minutes=initPicker.limit.initMinutes(_this.startHour,_this.endHour,_this.minuteStep,_this.afterStep,col1.value,col2.value);
  578. _this.data.hours=hours;
  579. _this.data.minutes=minutes;
  580. };
  581. if(col2.value!=checkArr[1].value){
  582. let minutes=initPicker.limit.initMinutes(_this.startHour,_this.endHour,_this.minuteStep,_this.afterStep,col1.value,col2.value);
  583. _this.data.minutes=minutes;
  584. };
  585. d=_this.data.date[arr[0]]||_this.data.date[_this.data.date.length-1];
  586. h=_this.data.hours[arr[1]]||_this.data.hours[_this.data.hours.length-1];
  587. m=_this.data.minutes[arr[2]]||_this.data.minutes[_this.data.minutes.length-1];
  588. _this.checkArr=[d,h,m];
  589. _this.resultStr=`${d.value+' '+h.value+':'+m.value+":"+"00"}`;
  590. break;
  591. case "range":
  592. let fyear=_this.data.fyears[arr[0]]||_this.data.fyears[_this.data.fyears.length-1];
  593. let fmonth=_this.data.fmonths[arr[1]]||_this.data.fmonths[_this.data.fmonths.length-1];
  594. let fday=_this.data.fdays[arr[2]]||_this.data.fdays[_this.data.fdays.length-1];
  595. let tyear=_this.data.tyears[arr[4]]||_this.data.tyears[_this.data.tyears.length-1];
  596. let tmonth=_this.data.tmonths[arr[5]]||_this.data.tmonths[_this.data.tmonths.length-1];
  597. let tday=_this.data.tdays[arr[6]]||_this.data.tdays[_this.data.tdays.length-1];
  598. if(fyear!=checkArr[0]){
  599. arr[4]=0;
  600. arr[5]=0;
  601. arr[6]=0;
  602. startDays=initPicker.range.initStartDays(fyear,fmonth);
  603. endYears=initPicker.range.initEndYears(fyear,_this.startYear,_this.endYear);
  604. endMonths=initPicker.range.initEndMonths(fmonth);
  605. endDays=initPicker.range.initEndDays(fyear,fmonth,fday,tyear,tmonth);
  606. _this.data.fdays=startDays;
  607. _this.data.tyears=endYears;
  608. _this.data.tmonths=endMonths;
  609. _this.data.tdays=endDays;
  610. tyear=_this.data.tyears[0];
  611. checkArr[3]=_this.data.tyears[0];
  612. tmonth=_this.data.tmonths[0];
  613. checkArr[4]=_this.data.tmonths[0];
  614. tday=_this.data.tdays[0];
  615. checkArr[5]=_this.data.tdays[0];
  616. };
  617. if(fmonth!=checkArr[1]){
  618. arr[4]=0;
  619. arr[5]=0;
  620. arr[6]=0;
  621. startDays=initPicker.range.initStartDays(fyear,fmonth);
  622. endYears=initPicker.range.initEndYears(fyear,_this.startYear,_this.endYear);
  623. endMonths=initPicker.range.initEndMonths(fmonth);
  624. endDays=initPicker.range.initEndDays(fyear,fmonth,fday,tyear,tmonth);
  625. _this.data.fdays=startDays;
  626. _this.data.tyears=endYears;
  627. _this.data.tmonths=endMonths;
  628. _this.data.tdays=endDays;
  629. tyear=_this.data.tyears[0];
  630. checkArr[3]=_this.data.tyears[0];
  631. tmonth=_this.data.tmonths[0];
  632. checkArr[4]=_this.data.tmonths[0];
  633. tday=_this.data.tdays[0];
  634. checkArr[5]=_this.data.tdays[0];
  635. };
  636. if(fday!=checkArr[2]){
  637. arr[4]=0;
  638. arr[5]=0;
  639. arr[6]=0;
  640. endYears=initPicker.range.initEndYears(fyear,_this.startYear,_this.endYear);
  641. endMonths=initPicker.range.initEndMonths(fmonth);
  642. endDays=initPicker.range.initEndDays(fyear,fmonth,fday,tyear,tmonth);
  643. _this.data.tyears=endYears;
  644. _this.data.tmonths=endMonths;
  645. _this.data.tdays=endDays;
  646. tyear=_this.data.tyears[0];
  647. checkArr[3]=_this.data.tyears[0];
  648. tmonth=_this.data.tmonths[0];
  649. checkArr[4]=_this.data.tmonths[0];
  650. tday=_this.data.tdays[0];
  651. checkArr[5]=_this.data.tdays[0];
  652. };
  653. if(tyear!=checkArr[3]){
  654. arr[5]=0;
  655. arr[6]=0;
  656. endMonths=initPicker.range.initToMonths(fyear,fmonth,fday,tyear);
  657. endDays=initPicker.range.initEndDays(fyear,fmonth,fday,tyear,tmonth);
  658. _this.data.tmonths=endMonths;
  659. _this.data.tdays=endDays;
  660. tmonth=_this.data.tmonths[0];
  661. checkArr[4]=_this.data.tmonths[0];
  662. tday=_this.data.tdays[0];
  663. checkArr[5]=_this.data.tdays[0];
  664. };
  665. if(tmonth!=checkArr[4]){
  666. arr[6]=0;
  667. endDays=initPicker.range.initToDays(fyear,fmonth,fday,tyear,tmonth);
  668. _this.data.tdays=endDays;
  669. tday=_this.data.tdays[0];
  670. checkArr[5]=_this.data.tdays[0];
  671. };
  672. _this.checkArr=[fyear,fmonth,fday,tyear,tmonth,tday];
  673. _this.resultStr=`${fyear+'-'+fmonth+'-'+fday+'至'+tyear+'-'+tmonth+'-'+tday}`;
  674. break;
  675. case "half":
  676. year=_this.data.years[arr[0]]||_this.data.years[_this.data.years.length-1];
  677. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  678. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  679. area=_this.data.areas[arr[3]]||_this.data.areas[_this.data.areas.length-1];
  680. if(year!=checkArr[0]){
  681. months=initPicker.date.initMonths(year,_this.disabledAfter);
  682. days=initPicker.date.initDays(year,month,_this.disabledAfter);
  683. if(_this.disabledAfter){
  684. arr[1]=arr[1]>(months.length-1)?months.length-1:arr[1];
  685. arr[2]=arr[2]>(days.length-1)?days.length-1:arr[2];
  686. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  687. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  688. }
  689. _this.data.days=days;
  690. _this.data.months=months;
  691. };
  692. if(month!=checkArr[1]){
  693. days=initPicker.date.initDays(year,month,_this.disabledAfter);
  694. arr[2]=arr[2]>(days.length-1)?days.length-1:arr[2];
  695. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  696. _this.data.days=days;
  697. };
  698. _this.checkArr=[year,month,day,area];
  699. _this.resultStr=`${year+'-'+month+'-'+day+area.label}`;
  700. break;
  701. case "date":
  702. year=_this.data.years[arr[0]]||_this.data.years[_this.data.years.length-1];
  703. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  704. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  705. if(year!=checkArr[0]){
  706. months=initPicker.date.initMonths(year,_this.disabledAfter);
  707. days=initPicker.date.initDays(year,month,_this.disabledAfter);
  708. if(_this.disabledAfter){
  709. arr[1]=arr[1]>(months.length-1)?months.length-1:arr[1];
  710. arr[2]=arr[2]>(days.length-1)?days.length-1:arr[2];
  711. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  712. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  713. }
  714. _this.data.days=days;
  715. _this.data.months=months;
  716. };
  717. if(month!=checkArr[1]){
  718. days=initPicker.date.initDays(year,month,_this.disabledAfter);
  719. arr[2]=arr[2]>(days.length-1)?days.length-1:arr[2];
  720. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  721. _this.data.days=days;
  722. };
  723. _this.checkArr=[year,month,day];
  724. _this.resultStr=`${year+'-'+month+'-'+day}`;
  725. break;
  726. case "yearMonth":
  727. year=_this.data.years[arr[0]]||_this.data.years[_this.data.years.length-1];
  728. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  729. if(year!=checkArr[0]){
  730. if(_this.disabledAfter){
  731. arr[1]=arr[1]>(months.length-1)?months.length-1:arr[1];
  732. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  733. }
  734. months=initPicker.date.initMonths(year,_this.disabledAfter);
  735. _this.data.months=months;
  736. };
  737. _this.checkArr=[year,month];
  738. _this.resultStr=`${year+'-'+month}`;
  739. break;
  740. case "dateTime":
  741. year=_this.data.years[arr[0]]||_this.data.years[_this.data.years.length-1];
  742. month=_this.data.months[arr[1]]||_this.data.months[_this.data.months.length-1];
  743. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  744. hour=_this.data.hours[arr[3]]||_this.data.hours[_this.data.hours.length-1];
  745. minute=_this.data.minutes[arr[4]]||_this.data.minutes[_this.data.minutes.length-1];
  746. second=_this.data.seconds[arr[5]]||_this.data.seconds[_this.data.seconds.length-1];
  747. if(year!=checkArr[0]){
  748. arr[2]=0;
  749. days=initPicker.date.initDays(year,month);
  750. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  751. _this.data.days=days;
  752. };
  753. if(month!=checkArr[1]){
  754. arr[2]=0;
  755. days=initPicker.date.initDays(year,month);
  756. day=_this.data.days[arr[2]]||_this.data.days[_this.data.days.length-1];
  757. _this.data.days=days;
  758. };
  759. _this.checkArr=[year,month,day,hour,minute,second];
  760. _this.resultStr=`${year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second}`;
  761. break;
  762. case "time":
  763. hour=_this.data.hours[arr[0]]||_this.data.hours[_this.data.hours.length-1];
  764. minute=_this.data.minutes[arr[1]]||_this.data.minutes[_this.data.minutes.length-1];
  765. second=_this.data.seconds[arr[2]]||_this.data.seconds[_this.data.seconds.length-1];
  766. _this.checkArr=[hour,minute,second];
  767. _this.resultStr=`${hour+':'+minute+':'+second}`;
  768. break;
  769. case "linkage":
  770. let c1,c2,c3;
  771. let list=this.linkList;
  772. c1=_this.data[0][arr[0]]||_this.data[0][0];
  773. c2=_this.data[1][arr[1]]||_this.data[1][0];
  774. if(this.level==3){
  775. c3=_this.data[2][arr[2]]||_this.data[2][0];
  776. if(c1.label!=checkArr[0]){
  777. arr[1] = 0;
  778. arr[2] = 0;
  779. _this.data[1]=list[arr[0]].children;
  780. _this.data[2]=list[arr[0]].children[arr[1]].children;
  781. c2=_this.data[1][arr[1]]||_this.data[1][0];
  782. c3=_this.data[2][arr[2]]||_this.data[2][0];
  783. };
  784. if(c2.label!=checkArr[1]){
  785. arr[2] = 0;
  786. _this.data[2]=list[arr[0]].children[arr[1]].children;
  787. c3=_this.data[2][arr[2]]||_this.data[2][0];
  788. };
  789. _this.checkArr=[c1.label,c2.label,c3.label];
  790. _this.checkValue=[
  791. _this.data[0][arr[0]]?_this.data[0][arr[0]].value:_this.data[0][0].value,
  792. _this.data[1][arr[1]]?_this.data[1][arr[1]].value:_this.data[1][0].value,
  793. _this.data[2][arr[2]]?_this.data[2][arr[2]].value:_this.data[2][0].value
  794. ];
  795. _this.resultStr=c1.label+c2.label+c3.label;
  796. }else{
  797. if(c1.label!=checkArr[0]){
  798. _this.data[1]=list[arr[0]].children;
  799. arr[1] = 0;
  800. c2=_this.data[1][arr[1]]||_this.data[1][0];
  801. };
  802. _this.checkArr=[c1.label,c2.label];
  803. _this.checkValue=[
  804. _this.data[0][arr[0]]?_this.data[0][arr[0]].value:_this.data[0][0].value,
  805. _this.data[1][arr[1]]?_this.data[1][arr[1]].value:_this.data[1][0].value
  806. ];
  807. _this.resultStr=c1.label+c2.label;
  808. }
  809. break;
  810. case "region":
  811. province=_this.data.provinces[arr[0]]||_this.data.provinces[0];
  812. city=_this.data.citys[arr[1]]||_this.data.citys[0];
  813. if(!_this.hideArea){
  814. area=_this.data.areas[arr[2]]||_this.data.areas[0];
  815. }
  816. if(province.label!=checkArr[0]){
  817. _this.data.citys = citys[arr[0]]||citys[0];
  818. if(!_this.hideArea){
  819. _this.data.areas = areas[arr[0]][0]||areas[0][0];
  820. }
  821. arr[1] = 0;
  822. arr[2] = 0;
  823. city=_this.data.citys[arr[1]]||_this.data.citys[0];
  824. if(!_this.hideArea){
  825. area=_this.data.areas[arr[2]]||_this.data.areas[0];
  826. }
  827. };
  828. if(city.label!=checkArr[1]&&!_this.hideArea){
  829. _this.data.areas = areas[arr[0]][arr[1]]||areas[0][0];
  830. arr[2]=0;
  831. area=_this.data.areas[arr[2]]||_this.data.areas[0];
  832. };
  833. if(!_this.hideArea){
  834. _this.checkArr=[province.label,city.label,area.label];
  835. _this.checkValue=[
  836. _this.data.provinces[arr[0]]?_this.data.provinces[arr[0]].value:_this.data.provinces[0].value,
  837. _this.data.citys[arr[1]]?_this.data.citys[arr[1]].value:_this.data.citys[0].value,
  838. _this.data.areas[arr[2]]?_this.data.areas[arr[2]].value:_this.data.areas[0].value
  839. ];
  840. _this.resultStr=province.label+city.label+area.label;
  841. }else{
  842. _this.checkArr=[province.label,city.label];
  843. _this.checkValue=[
  844. _this.data.provinces[arr[0]]?_this.data.provinces[arr[0]].value:_this.data.provinces[0].value,
  845. _this.data.citys[arr[1]]?_this.data.citys[arr[1]].value:_this.data.citys[0].value
  846. ];
  847. _this.resultStr=province.label+city.label;
  848. };
  849. break;
  850. case "selector":
  851. _this.checkArr=_this.data[arr[0]]||_this.data[_this.data.length-1];
  852. _this.resultStr=_this.data[arr[0]]?_this.data[arr[0]].label:_this.data[_this.data.length-1].label;
  853. break;
  854. }
  855. _this.$nextTick(()=>{
  856. _this.pickVal=arr;
  857. })
  858. },
  859. initData(){
  860. let _this=this;
  861. let data={};
  862. let mode=_this.mode;
  863. let year,month,day,hour,minute,second,province,city,area;
  864. let col1,col2,col3;
  865. let dVal=[];
  866. switch(mode){
  867. case "linkage":
  868. let init;
  869. if(_this.value){
  870. init=_this.getLinkageVal(_this.value,true);
  871. }else{
  872. init=_this.getLinkageVal(_this.defaultVal);
  873. }
  874. dVal=init.dval;
  875. data=init.data;
  876. _this.checkArr=init.checkArr;
  877. _this.checkValue=init.checkValue;
  878. _this.resultStr=init.resultStr;
  879. break;
  880. case "region":
  881. if(_this.areaCode){
  882. dVal=_this.getRegionVal(_this.areaCode,true);
  883. }else{
  884. dVal=_this.getRegionVal(_this.defaultVal);
  885. }
  886. if(_this.hideArea){
  887. data={
  888. provinces:provinces,
  889. citys:citys[dVal[0]]
  890. };
  891. }else{
  892. data={
  893. provinces:provinces,
  894. citys:citys[dVal[0]],
  895. areas:areas[dVal[0]][dVal[1]]
  896. };
  897. };
  898. break;
  899. case "selector":
  900. let idx=0;
  901. data=[..._this.selectList];
  902. _this.selectList.map((v,k)=>{
  903. if(v.label==this.defaultVal){
  904. idx=k;
  905. }
  906. })
  907. dVal=[idx];
  908. break;
  909. case "limit":
  910. data=initPicker.limit.init(_this.dayStep,_this.startHour,_this.endHour,_this.minuteStep,_this.afterStep,this.defaultVal);
  911. dVal=data.defaultVal||_this.defaultVal;
  912. break;
  913. case "limitHour":
  914. data=initPicker.limitHour.init(_this.dayStep,this.defaultVal);
  915. dVal=data.defaultVal||_this.defaultVal;
  916. break;
  917. case "range":
  918. data=initPicker.range.init(_this.startYear,_this.endYear,_this.useCurrent(),_this.current);
  919. dVal=data.defaultVal||_this.defaultVal;
  920. break;
  921. default:
  922. data=initPicker.date.init(_this.startYear,_this.endYear,_this.mode,_this.step,_this.useCurrent(),_this.current,_this.disabledAfter);
  923. dVal=data.defaultVal||_this.defaultVal;
  924. break;
  925. }
  926. _this.data=data;
  927. switch(mode){
  928. case "limitHour":
  929. col1=data.date[dVal[0]]||data.date[data.date.length-1];
  930. col2=data.areas[dVal[2]]||data.areas[data.areas.length-1];
  931. col3=data.hours[dVal[1]]||data.hours[data.hours.length-1];
  932. _this.checkArr=[col1,col2,col3];
  933. _this.resultStr=`${col1.value+' '+col2.label+' '+col3.label+'时'}`;
  934. break;
  935. case "limit":
  936. col1=data.date[dVal[0]]||data.date[data.date.length-1];
  937. col2=data.hours[dVal[1]]||data.hours[data.hours.length-1];
  938. col3=data.minutes[dVal[2]]||data.minutes[data.minutes.length-1];
  939. _this.checkArr=[col1,col2,col3];
  940. _this.resultStr=`${col1.value+' '+col2.value+':'+col3.value+":"+"00"}`;
  941. break;
  942. case "range":
  943. let fYear=data.fyears[dVal[0]]||data.fyears[data.fyears.length-1];
  944. let fmonth=data.fmonths[dVal[1]]||data.fmonths[data.fmonths.length-1];
  945. let fday=data.fdays[dVal[2]]||data.fdays[data.fdays.length-1];
  946. let tYear=data.tyears[dVal[4]]||data.tyears[data.tyears.length-1];
  947. let tmonth=data.tmonths[dVal[5]]||data.tmonths[data.tmonths.length-1];
  948. let tday=data.tdays[dVal[6]]||data.tdays[data.tdays.length-1];
  949. _this.checkArr=[fYear,fmonth,fday,tYear,tmonth,tday];
  950. _this.resultStr=`${fYear+'-'+fmonth+'-'+fday+'至'+tYear+'-'+tmonth+'-'+tday}`;
  951. break;
  952. case "half":
  953. year=data.years[dVal[0]]||data.years[data.years.length-1];
  954. month=data.months[dVal[1]]||data.months[data.months.length-1];
  955. day=data.days[dVal[2]]||data.days[data.days.length-1];
  956. area=data.areas[dVal[3]]||data.areas[data.areas.length-1];
  957. _this.checkArr=[year,month,day,area];
  958. _this.resultStr=`${year+'-'+month+'-'+day+' '+area.label}`;
  959. break;
  960. case "date":
  961. year=data.years[dVal[0]]||data.years[data.years.length-1];
  962. month=data.months[dVal[1]]||data.months[data.months.length-1];
  963. day=data.days[dVal[2]]||data.days[data.days.length-1];
  964. _this.checkArr=[year,month,day];
  965. _this.resultStr=`${year+'-'+month+'-'+day}`;
  966. break;
  967. case "yearMonth":
  968. year=data.years[dVal[0]]||data.years[data.years.length-1];
  969. month=data.months[dVal[1]]||data.months[data.months.length-1];
  970. _this.checkArr=[year,month];
  971. _this.resultStr=`${year+'-'+month}`;
  972. break;
  973. case "dateTime":
  974. year=data.years[dVal[0]]||data.years[data.years.length-1];
  975. month=data.months[dVal[1]]||data.months[data.months.length-1];
  976. day=data.days[dVal[2]]||data.days[data.days.length-1];
  977. hour=data.hours[dVal[3]]||data.hours[data.hours.length-1];
  978. minute=data.minutes[dVal[4]]||data.minutes[data.minutes.length-1];
  979. second=data.seconds[dVal[5]]||data.seconds[data.seconds.length-1];
  980. _this.resultStr=`${year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second}`;
  981. _this.checkArr=[year,month,day,hour,minute];
  982. break;
  983. case "time":
  984. hour=data.hours[dVal[0]]||data.hours[data.hours.length-1];
  985. minute=data.minutes[dVal[1]]||data.minutes[data.minutes.length-1];
  986. second=data.seconds[dVal[2]]||data.seconds[data.seconds.length-1];
  987. _this.checkArr=[hour,minute,second];
  988. _this.resultStr=`${hour+':'+minute+':'+second}`;
  989. break;
  990. case "region":
  991. province=data.provinces[dVal[0]];
  992. city=data.citys[dVal[1]];
  993. if(!_this.hideArea){
  994. area=data.areas[dVal[2]];
  995. _this.checkArr=[province.label,city.label,area.label];
  996. _this.checkValue=[province.value,city.value,area.value];
  997. _this.resultStr=province.label+city.label+area.label;
  998. }else{
  999. _this.checkArr=[province.label,city.label];
  1000. _this.checkValue=[province.value,city.value];
  1001. _this.resultStr=province.label+city.label;
  1002. }
  1003. break;
  1004. case "selector":
  1005. _this.checkArr=data[dVal[0]]||data[data.length-1];
  1006. _this.resultStr=data[dVal[0]].label||data[data.length-1].label;
  1007. break;
  1008. }
  1009. _this.$nextTick(()=>{
  1010. _this.pickVal=[...dVal];
  1011. })
  1012. }
  1013. },
  1014. mounted() {
  1015. this.initData();
  1016. }
  1017. }
  1018. </script>
  1019. <style lang="scss">
  1020. .w-picker{
  1021. position: relative;
  1022. z-index: 888;
  1023. .mask {
  1024. position: fixed;
  1025. z-index: 1000;
  1026. top: 0;
  1027. right: 0;
  1028. left: 0;
  1029. bottom: 0;
  1030. background: rgba(0, 0, 0, 0.6);
  1031. visibility: hidden;
  1032. opacity: 0;
  1033. transition: all 0.3s ease;
  1034. }
  1035. .mask.show{
  1036. visibility: visible;
  1037. opacity: 1;
  1038. }
  1039. .w-picker-cnt {
  1040. position: fixed;
  1041. bottom: 0;
  1042. left: 0;
  1043. width: 100%;
  1044. transition: all 0.3s ease;
  1045. transform: translateY(100%);
  1046. z-index: 3000;
  1047. }
  1048. .w-picker-cnt.show {
  1049. transform: translateY(0);
  1050. }
  1051. .w-picker-hd {
  1052. display: flex;
  1053. align-items: center;
  1054. padding: 0 30upx;
  1055. height: 88upx;
  1056. background-color: #fff;
  1057. position: relative;
  1058. text-align: center;
  1059. font-size: 32upx;
  1060. justify-content: space-between;
  1061. .w-picker-btn{
  1062. font-size: 30upx;
  1063. }
  1064. }
  1065. .w-picker-hd:after {
  1066. content: ' ';
  1067. position: absolute;
  1068. left: 0;
  1069. bottom: 0;
  1070. right: 0;
  1071. height: 1px;
  1072. border-bottom: 1px solid #e5e5e5;
  1073. color: #e5e5e5;
  1074. transform-origin: 0 100%;
  1075. transform: scaleY(0.5);
  1076. }
  1077. .w-picker-item {
  1078. text-align: center;
  1079. width: 100%;
  1080. height: 88upx;
  1081. line-height: 88upx;
  1082. text-overflow: ellipsis;
  1083. white-space: nowrap;
  1084. font-size: 30upx;
  1085. }
  1086. .w-picker-view {
  1087. width: 100%;
  1088. height: 476upx;
  1089. overflow: hidden;
  1090. background-color: rgba(255, 255, 255, 1);
  1091. z-index: 666;
  1092. }
  1093. picker-view{
  1094. height: 100%;
  1095. }
  1096. }
  1097. </style>