tm-pickersDateView.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. <!-- 日期组件 -->
  2. <template>
  3. <view class="tm-pickersDateView flex-start px-24" :class="[black_tmeme ? 'grey-darken-5' : bgColor]">
  4. <!-- :value="value_default" @change="change" -->
  5. <picker-view
  6. @pickstart="$emit('aniStart')"
  7. @pickend="$emit('aniEnd')"
  8. @change="change"
  9. v-if="list_cD != null"
  10. :value="value_default"
  11. :mask-style="black_tmeme ? 'opacity:0;' : ''"
  12. indicator-style="height:50px;"
  13. indicator-class="tm-pickersCView-item-h"
  14. class="tm-pickersCView-wk"
  15. >
  16. <picker-view-column v-show="syheng_key[key]" v-for="(item, key) in list_cD" :key="key">
  17. <view
  18. class="tm-pickersCView-item fulled-height flex-center "
  19. style="margin: 0 5px;"
  20. :class="[value_default[key] == index_pub ? ' text-weight-b active' : '', black_tmeme ? 'bk' : '', 'text-size-n']"
  21. v-for="(item_data, index_pub) in item"
  22. :key="index_pub"
  23. >
  24. <text>{{ buqi(item_data) }}</text>
  25. <text v-if="mode">{{ modhz[key] }}</text>
  26. </view>
  27. </picker-view-column>
  28. </picker-view>
  29. </view>
  30. </template>
  31. <script>
  32. /**
  33. * 日期下拉选择器(嵌入式)
  34. * @description 多级关联,单级关联选择
  35. * @property {Array} default-value = [] 默认:当前的时间,初始显示的时间
  36. * @property {String|Number} item-height = [34|42|50|58|62] 项目的高度单位px
  37. * @property {String|Boolean} black = [true|false] 是否开启暗黑模式。
  38. * @property {String|Boolean} disabled = [true|false] 是否禁用
  39. * @property {String} bg-color = [white|blue] 默认:white,白色背景;请填写背景的主题色名称。
  40. * @property {Object} show-detail = [{year:true,month:true,day:true,hour:false,min:false,sec:false}] 默认:{year:true,month:true,day:true,hour:false,min:false,sec:false}
  41. * @property {String} start = [1900-1-1 00:00:00] 默认:1900-1-1 00:00:00,开始的时间
  42. * @property {String} end = [] 默认:当前,结束的时间
  43. * @property {String|Boolean} mode = [true|false] 默认:true,是否显示中文年,月后缀
  44. * @property {String|Boolean} full-number = [true|false] 默认:true,是否把个位数补齐双位数
  45. */
  46. export default {
  47. name: 'tm-pickersDateView',
  48. props: {
  49. // 行高。
  50. itemHeight: {
  51. type: String | Number,
  52. default: 40
  53. },
  54. black: {
  55. type: String | Boolean,
  56. default: null
  57. },
  58. // 是否禁用
  59. disabled: {
  60. type: String | Boolean,
  61. default: false
  62. },
  63. // 背景颜色,主题色名称。
  64. bgColor: {
  65. type: String,
  66. default: 'white'
  67. },
  68. //要展示的时间。
  69. showDetail: {
  70. type: Object,
  71. default: () => {
  72. return {
  73. year: true, //年
  74. month: true, //月
  75. day: true, //天
  76. hour: false, //小时
  77. min: false, //分
  78. sec: false //秒
  79. };
  80. }
  81. },
  82. start: {
  83. type: String,
  84. default: '1949-1-1 00:00:00'
  85. },
  86. end: {
  87. type: String,
  88. default: ''
  89. },
  90. defaultValue: '',
  91. // 是否显示中文年,月后缀
  92. mode: {
  93. type: String | Boolean,
  94. default: true
  95. },
  96. //要展示的时间。
  97. modeValue: {
  98. type: Object,
  99. default: () => {
  100. return {
  101. year: '年', //年
  102. month: '月', //月
  103. day: '日', //天
  104. hour: '时', //小时
  105. min: '分', //分
  106. sec: '秒' //秒
  107. };
  108. }
  109. },
  110. // 是否把个位数补齐双位数
  111. fullNumber: {
  112. type: String | Boolean,
  113. default: true
  114. }
  115. },
  116. data() {
  117. return {
  118. dataCauser: {
  119. year: false, //年
  120. month: false, //月
  121. day: false, //天
  122. hour: false, //小时
  123. min: false, //分
  124. sec: false //秒
  125. },
  126. hoz: {
  127. year: '年', //年
  128. month: '月', //月
  129. day: '日', //天
  130. hour: '时', //小时
  131. min: '分', //分
  132. sec: '秒' //秒
  133. },
  134. totalRow:0,
  135. syheng_key: {},
  136. //当前生成的所有数据年~秒
  137. r_list:[],
  138. list_cD: null,
  139. value_default: [],
  140. nowObj:null,
  141. };
  142. },
  143. created() {
  144. this.dataCauser = {...this.dataCauser,...(this.showDetail||{})}
  145. this.setdataCauserArray();
  146. this._reInits();
  147. },
  148. mounted() {
  149. },
  150. watch: {
  151. showDetail:{
  152. deep:true,
  153. handler(){
  154. this.dataCauser = {...this.dataCauser,...this.showDetail};
  155. this.setdataCauserArray();
  156. }
  157. },
  158. defaultValue: function(val) {
  159. let nowdateVal;
  160. if (val) {
  161. nowdateVal = new Date(val.replace(/-/g, '/'));
  162. } else {
  163. nowdateVal = new Date();
  164. }
  165. this.nowObj = nowdateVal;
  166. if(this.list_cD==null) return;
  167. this._reInits();
  168. },
  169. start: async function() {
  170. if(this.list_cD==null) return;
  171. this._reInits();
  172. },
  173. end: async function() {
  174. if(this.list_cD==null) return;
  175. this._reInits();
  176. }
  177. },
  178. computed: {
  179. black_tmeme: function() {
  180. if (this.black !== null) return this.black;
  181. return this.$tm.vx.state().tmVuetify.black;
  182. },
  183. modhz: function() {
  184. let hz = [];
  185. let moz = { ...this.hoz, ...this.modeValue };
  186. hz.push(moz.year)
  187. hz.push(moz.month)
  188. hz.push(moz.day)
  189. hz.push(moz.hour)
  190. hz.push(moz.min)
  191. hz.push(moz.sec)
  192. return hz;
  193. },
  194. detavlue:function () {
  195. let d = this.defaultValue;
  196. if(!d){
  197. let ys = new Date();
  198. d = ys.getFullYear()+'-'+(ys.getMonth()+1)+'-'+ys.getDate()+' '+ys.getHours()+':'+ys.getMinutes()+':'+ys.getSeconds()
  199. }
  200. return d.replace(/-/g, '/');
  201. },
  202. //结束的日期,默认为当前
  203. end_str:function () {
  204. let d = this.end;
  205. if(!d){
  206. let ys = new Date();
  207. d = ys.getFullYear()+'-'+(ys.getMonth()+1)+'-'+ys.getDate()+' '+ys.getHours()+':'+ys.getMinutes()+':'+ys.getSeconds()
  208. }
  209. return d.replace(/-/g, '/');
  210. },
  211. //开始默认为1960年
  212. start_str:function () {
  213. let d = this.start;
  214. if(!d){
  215. d='1960-1-1 00:00:00'
  216. }
  217. return d.replace(/-/g, '/');
  218. },
  219. },
  220. methods: {
  221. //设置显示的行当。
  222. setdataCauserArray(){
  223. let t = this;
  224. let f = {
  225. '0':this.dataCauser['year'],
  226. '1':this.dataCauser['month'],
  227. '2':this.dataCauser['day'],
  228. '3':this.dataCauser['hour'],
  229. '4':this.dataCauser['min'],
  230. '5':this.dataCauser['sec'],
  231. }
  232. //显示的列表数。
  233. let totalHoz = 0;
  234. let p = Object.keys(this.dataCauser);
  235. p = p.filter(el=>t.dataCauser[el]==true)
  236. this.totalRow = p.length;
  237. this.syheng_key = f;
  238. },
  239. //初始生成对应的开始和结束日期数据。
  240. _reInits(date){
  241. let t = this;
  242. let nowdateVal;
  243. if (date) {
  244. nowdateVal = new Date(date.replace(/-/g, '/'));
  245. } else {
  246. nowdateVal = new Date(this.detavlue);
  247. }
  248. this.nowObj = nowdateVal;
  249. /**
  250. * 接下来,需要比对,年月,日。
  251. * 分开比较的原因是:如果年不变的话,只是改变月,那么只需重新
  252. * 更改日的数据(如果每月的日期一样,也不需要改变。)
  253. */
  254. //根据提供的值nodwdateVal来划定开始和结束的日期数据。为了保证流畅,采用一次性生成的方法。
  255. //先生成开始的数据。
  256. //开始
  257. const start = new Date(this.start_str);
  258. //结束
  259. const end = new Date(this.end_str);
  260. //当前
  261. const now = nowdateVal;
  262. let list = [];
  263. let year = this.range(start.getFullYear(),end.getFullYear())
  264. list.push(year)
  265. // 月。是需要根据nowdateVal提供的值来生成。因为月是不固定的。
  266. //默认先生成start到12的
  267. let month_s = this.range(start.getMonth()+1,12)
  268. let month_e = this.range(1,end.getMonth()+1)
  269. //同年同月
  270. if(start.getFullYear()==end.getFullYear()&&start.getMonth()==end.getMonth()){
  271. let tn = this.range(start.getMonth()+1,end.getMonth()+1);
  272. list.push([tn,tn])
  273. }else{
  274. list.push([month_s,month_e])
  275. }
  276. let day_s = this.range(start.getDate(),this.monthDay(start.getFullYear(),start.getMonth()))
  277. let day_e = this.range(1,end.getDate())
  278. //同年同月同日
  279. if(start.getFullYear()==end.getFullYear()
  280. &&start.getMonth()==end.getMonth()
  281. &&start.getDate()==end.getDate()
  282. ){
  283. let tn = this.range(start.getDate(),end.getDate());
  284. list.push([tn,tn])
  285. }else{
  286. list.push([day_s,day_e])
  287. }
  288. let hours_s = this.range(start.getHours(),23)
  289. let hours_e = this.range(0,end.getHours())
  290. //同年同月同日同时
  291. if(start.getFullYear()==end.getFullYear()
  292. &&start.getMonth()==end.getMonth()
  293. &&start.getDate()==end.getDate()
  294. &&start.getHours()==end.getHours()
  295. ){
  296. let tn = this.range(start.getHours(),end.getHours());
  297. list.push([tn,tn])
  298. }else{
  299. list.push([hours_s,hours_e])
  300. }
  301. let minutes_s = this.range(start.getMinutes(),59)
  302. let minutes_e = this.range(0,end.getMinutes())
  303. //同年同月同日同时同分
  304. if(start.getFullYear()==end.getFullYear()
  305. &&start.getMonth()==end.getMonth()
  306. &&start.getDate()==end.getDate()
  307. &&start.getHours()==end.getHours()
  308. ){
  309. let tn = this.range(start.getMinutes(),end.getMinutes());
  310. list.push([tn,tn])
  311. }else{
  312. list.push([minutes_s,minutes_e])
  313. }
  314. let seconds_s = this.range(start.getSeconds(),59)
  315. let seconds_e = this.range(0,end.getSeconds())
  316. //同年同月同日同时同分同秒
  317. if(start.getFullYear()==end.getFullYear()
  318. &&start.getMonth()==end.getMonth()
  319. &&start.getDate()==end.getDate()
  320. &&start.getHours()==end.getHours()
  321. &&start.getSeconds()==end.getSeconds()
  322. ){
  323. let tn = this.range(start.getSeconds(),end.getSeconds());
  324. list.push([tn,tn])
  325. }else{
  326. list.push([seconds_s,seconds_e])
  327. }
  328. this.r_list = list;
  329. this.$nextTick(function () {
  330. this._getListCd(start,end,now)
  331. })
  332. },
  333. //生成对应的列表数据,以供选择。不需要生成所有,只要生成默认当前时间的。
  334. _getListCd(start,end,now,issetd){
  335. let list_cD = [];
  336. //年
  337. list_cD.push(this.r_list[0])
  338. //月。
  339. let year_s = new Date(String(start.getFullYear())+'/1/1').getTime()
  340. let year_e = new Date(String(end.getFullYear())+'/1/1').getTime()
  341. let year_n = new Date(String(now.getFullYear())+'/1/1').getTime()
  342. if(
  343. year_s===year_e //开始和结束相同
  344. ||(year_s!=year_e&&year_n==year_s) //现在=开始。
  345. ||(year_s!=year_e&&year_n<year_s) //现在小于开始
  346. ){
  347. list_cD.push(this.r_list[1][0])
  348. }else if(
  349. (year_s!=year_e&&year_n==year_e) //现在=结束。
  350. ||(year_s!=year_e&&year_n>year_e) //现在大于结束
  351. ){
  352. list_cD.push(this.r_list[1][1])
  353. }else{ //在开始和结束之间。
  354. list_cD.push(this.range(1,12))
  355. }
  356. //日。
  357. let day_s = new Date(start.getFullYear()+'/'+(start.getMonth()+1)+'/1').getTime()
  358. let day_e = new Date(end.getFullYear()+'/'+(end.getMonth()+1)+'/1').getTime()
  359. let day_n = new Date(now.getFullYear()+'/'+(now.getMonth()+1)+'/1').getTime()
  360. if(
  361. day_s===day_e //开始和结束相同
  362. ||(day_s!=day_e&&day_n==day_s) //现在=开始。
  363. ||(day_s!=day_e&&day_n<day_s) //现在小于开始
  364. ){
  365. list_cD.push(this.r_list[2][0])
  366. }else if(
  367. (day_s!=day_e&&day_n==day_e) //现在=结束。
  368. ||(day_s!=day_e&&day_n>day_e) //现在大于结束
  369. ){
  370. list_cD.push(this.r_list[2][1])
  371. }else{ //在开始和结束之间。
  372. list_cD.push(this.range(1,this.monthDay(now.getFullYear(),now.getMonth())))
  373. }
  374. //时。
  375. let hours_s = new Date(String(start.getFullYear())+'/'+(start.getMonth()+1)+'/'+start.getDate()).getTime()
  376. let hours_e = new Date(String(end.getFullYear())+'/'+(end.getMonth()+1)+'/'+end.getDate()).getTime()
  377. let hours_n = new Date(String(now.getFullYear())+'/'+(now.getMonth()+1)+'/'+now.getDate()).getTime()
  378. if(
  379. hours_s===hours_e //开始和结束相同
  380. ||(hours_s!=hours_e&&hours_n==hours_s) //现在=开始。
  381. ||(hours_s!=hours_e&&hours_n<hours_s) //现在小于开始
  382. ){
  383. list_cD.push(this.r_list[3][0])
  384. }else if(
  385. (hours_s!=hours_e&&hours_n==hours_e) //现在=结束。
  386. ||(hours_s!=hours_e&&hours_n>hours_e) //现在大于结束
  387. ){
  388. list_cD.push(this.r_list[3][1])
  389. }else{ //在开始和结束之间。
  390. list_cD.push(this.range(0,23))
  391. }
  392. //分。
  393. let min_s = new Date(String(start.getFullYear())+'/'+(start.getMonth()+1)+'/'+start.getDate()+' '+start.getHours()+':00:00').getTime()
  394. let min_e = new Date(String(end.getFullYear())+'/'+(end.getMonth()+1)+'/'+end.getDate()+' '+end.getHours()+':00:00').getTime()
  395. let min_n = new Date(String(now.getFullYear())+'/'+(now.getMonth()+1)+'/'+now.getDate()+' '+now.getHours()+':00:00').getTime()
  396. if(
  397. min_s===min_e //开始和结束相同
  398. ||(min_s!=min_e&&min_n==min_s) //现在=开始。
  399. ||(min_s!=min_e&&min_n<min_s) //现在小于开始
  400. ){
  401. list_cD.push(this.r_list[4][0])
  402. }else if(
  403. (min_s!=min_e&&min_n==min_e) //现在=结束。
  404. ||(min_s!=min_e&&min_n>min_e) //现在大于结束
  405. ){
  406. list_cD.push(this.r_list[4][1])
  407. }else{ //在开始和结束之间。
  408. list_cD.push(this.range(0,59))
  409. }
  410. //秒。
  411. let seccode_s = new Date(String(start.getFullYear())+'/'+(start.getMonth()+1)+'/'+start.getDate()+' '+start.getHours()+':'+start.getMinutes()+':00').getTime()
  412. let seccode_e = new Date(String(end.getFullYear())+'/'+(end.getMonth()+1)+'/'+end.getDate()+' '+end.getHours()+':'+start.getMinutes()+':00').getTime()
  413. let seccode_n = new Date(String(now.getFullYear())+'/'+(now.getMonth()+1)+'/'+now.getDate()+' '+now.getHours()+':'+start.getMinutes()+':00').getTime()
  414. if(
  415. seccode_s===seccode_e //开始和结束相同
  416. ||(seccode_s!=seccode_e&&seccode_n==seccode_s) //现在=开始。
  417. ||(seccode_s!=seccode_e&&seccode_n<seccode_s) //现在小于开始
  418. ){
  419. list_cD.push(this.r_list[4][0])
  420. }else if(
  421. (seccode_s!=seccode_e&&seccode_n==seccode_e) //现在=结束。
  422. ||(seccode_s!=seccode_e&&seccode_n>seccode_e) //现在大于结束
  423. ){
  424. list_cD.push(this.r_list[4][1])
  425. }else{ //在开始和结束之间。
  426. list_cD.push(this.range(0,59))
  427. }
  428. this.$nextTick(function () {
  429. this.list_cD = list_cD;
  430. if(!issetd){
  431. this.$nextTick(function () {
  432. this.setDefaultIndex();
  433. })
  434. }
  435. })
  436. },
  437. monthDay(year, month) {
  438. let date = new Date(year, month, 1, 0, 0, 0);
  439. date.setMonth(date.getMonth()+1)
  440. let yesterDay = new Date(date - 1000);
  441. return yesterDay.getDate();
  442. },
  443. //生成一个数据数组。
  444. range(from=0,to){
  445. const range = [];
  446. if(from===to) return [from];
  447. for (let i = from; i <= to; i++) {
  448. range.push(i)
  449. }
  450. return range
  451. },
  452. //设置当前选中的索引。
  453. setDefaultIndex(){
  454. if(!this.list_cD) return;
  455. let value_default = [];
  456. let t = this;
  457. // 年。
  458. let year = this.list_cD[0].findIndex(el=>el==t.nowObj.getFullYear());
  459. year=year<=0?0:year;
  460. let month = this.list_cD[1].findIndex(el=>el==t.nowObj.getMonth()+1);
  461. month=month<=0?0:month;
  462. let day = this.list_cD[2].findIndex(el=>el==t.nowObj.getDate());
  463. day=day<=0?0:day;
  464. let hours = this.list_cD[3].findIndex(el=>el==t.nowObj.getHours());
  465. hours=hours<=0?0:hours;
  466. let minutes = this.list_cD[4].findIndex(el=>el==t.nowObj.getMinutes());
  467. minutes=minutes<=0?0:minutes;
  468. let seconds = this.list_cD[5].findIndex(el=>el==t.nowObj.getSeconds());
  469. seconds=seconds<=0?0:seconds;
  470. // 开始设置,如果当前默认的日期不在范围内。默认选中的索引日期。
  471. value_default = [year,month,day,hours,minutes,seconds]
  472. this.$nextTick(function () {
  473. this.value_default = value_default;
  474. })
  475. },
  476. //回显到初始化值。
  477. resetVal(setd){
  478. let val = this.defaultValue;
  479. if(setd) val = setd;
  480. let nowdateVal;
  481. if (val) {
  482. nowdateVal = new Date(val.replace(/-/g, '/'));
  483. } else {
  484. nowdateVal = new Date();
  485. }
  486. this.nowObj = nowdateVal;
  487. if(this.list_cD==null) return;
  488. this._reInits();
  489. this.$nextTick(function () {
  490. this.setDefaultIndex();
  491. })
  492. },
  493. buqi(val) {
  494. return val > 9 ? '' + val : '0' + val;
  495. },
  496. //通过索引获取当前数据
  497. SeletecdeIndexdefault(value_default) {
  498. if(!value_default) value_default = this.value_default;
  499. let t = this;
  500. let ap = [];
  501. this.value_default.forEach((item,index) => {
  502. let f = t.list_cD[index][parseInt(item)];
  503. f = typeof(f)=="undefined"? t.list_cD[index][ t.list_cD[index].length-1]:f;
  504. ap.push(f);
  505. });
  506. return ap;
  507. },
  508. // 获取当前选中的数据。
  509. getSelectedValue() {
  510. let t = this;
  511. let ap = this.SeletecdeIndexdefault();
  512. let jg = {
  513. year: ap[0], //年
  514. month: ap[1], //月
  515. day: ap[2], //天
  516. hour: ap[3], //小时
  517. min: ap[4], //分
  518. sec: ap[5] //秒
  519. };
  520. let ar = Object.keys(this.dataCauser);
  521. ar.forEach(item => {
  522. if (t.dataCauser[item] === false) {
  523. delete jg[item];
  524. }
  525. });
  526. return jg;
  527. },
  528. getSelsectDate() {
  529. let t = this;
  530. let ap = this.SeletecdeIndexdefault();
  531. let jg = {
  532. year: ap[0], //年
  533. month: ap[1], //月
  534. day: ap[2], //天
  535. hour: ap[3], //小时
  536. min: ap[4], //分
  537. sec: ap[5] //秒
  538. };
  539. return new Date(ap[0]+'/'+ap[1]+'/'+ap[2]+' '+ap[3]+':'+ap[4]+':'+ap[5]);
  540. },
  541. change(e) {
  542. //滑动后,要动态修改数据。
  543. let val = e.detail.value;
  544. let index =0;
  545. // 找出修改的index项。
  546. let nowD = [this.nowObj.getFullYear(),1,1,0,0,0];
  547. let nowObj = [this.nowObj.getFullYear(),this.nowObj.getMonth()+1,this.nowObj.getDate(),this.nowObj.getHours(),this.nowObj.getMinutes(),this.nowObj.getSeconds()];
  548. for (var i = 0; i < 6; i++) {
  549. if(this.value_default[i]!==val[i]){
  550. nowD[i] = this.list_cD[i][val[i]]
  551. }else{
  552. let idx = this.list_cD[i].findIndex(el=>el==nowObj[i])
  553. if(idx==-1){
  554. nowD[i] = this.list_cD[i][0]
  555. }else{
  556. nowD[i] = nowObj[i]
  557. }
  558. }
  559. }
  560. const now = nowD[0]+'/'+(nowD[1])+'/'+nowD[2]+' '+nowD[3]+':'+nowD[4]+':'+nowD[5];
  561. this._reInits(now)
  562. let nowVal = val.map(el=>{
  563. let dsdd = el<=0?0:el;
  564. return dsdd
  565. })
  566. this.$nextTick(function () {
  567. this.value_default = nowVal;
  568. // 发送滚动选中的时间数据。
  569. this.$emit('change',this.getSelectedValue());
  570. })
  571. },
  572. jswid() {
  573. let wd = this.gridNum - 1 - 2;
  574. if (wd <= 0) wd = 1;
  575. return 100 / wd;
  576. },
  577. }
  578. };
  579. </script>
  580. <style>
  581. .tm-pickersDateView .tm-pickersCView-item-h {
  582. height: 50px;
  583. background-color: rgba(0, 0, 0, 0.03);
  584. width: calc(100% - 10px);
  585. margin-left: 5px;
  586. border-radius: 20rpx;
  587. border: none;
  588. }
  589. .tm-pickersDateView .tm-pickersCView-item-h::after,
  590. .tm-pickersDateView .tm-pickersCView-item-h::before {
  591. border: none;
  592. }
  593. .tm-pickersDateView .tm-pickersCView-wk {
  594. position: relative;
  595. width: 750rpx;
  596. height: 500rpx;
  597. }
  598. .tm-pickersDateView .tm-pickersCView-wk .tm-pickersCView-item.bk {
  599. opacity: 0.4;
  600. }
  601. .tm-pickersDateView .tm-pickersCView-wk .tm-pickersCView-item.active {
  602. opacity: 1;
  603. border-radius: 20rpx;
  604. border: none;
  605. background-color: rgba(0, 0, 0, 0.06);
  606. }
  607. .tm-pickersDateView .tm-pickersCView-wk .tm-pickersCView-item.active.bk {
  608. background-color: rgba(255, 255, 255, 0.06);
  609. }
  610. </style>