当前位置: 首页 > news >正文

b s架构的网站开发百度搜索关键词数据

b s架构的网站开发,百度搜索关键词数据,邯郸网站建设哪家专业,无锡网站制作需要多少钱说实话&#xff0c;uniapp和uview的关于只有时分秒的组件实在是不行。全是日历&#xff0c;但是实际根本就不需要日历这玩意。百度了下&#xff0c;终于看到了一个只有时分秒的组件。原地址&#xff1a;原地址&#xff0c;如若侵犯请联系我删除 <template><view clas…

 说实话,uniapp和uview的关于只有时分秒的组件实在是不行。全是日历,但是实际根本就不需要日历这玩意。百度了下,终于看到了一个只有时分秒的组件。原地址:原地址,如若侵犯请联系我删除

<template><view class="hms"><!-- //显示时间的地方,样式可以自行修改 --><view class="hmsText" @click="show">{{ hmsVal }}</view><!-- //弹出选择时间的弹框 --><uni-popup ref="popup" type="bottom" background-color="#fff"><view class="hms_content"><view class="hmsBtn"><view class="close" @click="close">取消</view><view class="complete" @click="completeFun">完成</view></view><picker-view indicator-style="100rpx" @change="bindChange" class="picker-view" :value="pickerArrIndex"><picker-view-column><view class="item" v-for="(item, index) in hours" :key="index">{{ item }}时</view></picker-view-column><picker-view-column><view class="item" v-for="(item, index) in minute" :key="index">{{ item }}分</view></picker-view-column><picker-view-column><view class="item" v-for="(item, index) in second" :key="index">{{ item }}秒</view></picker-view-column></picker-view></view></uni-popup></view>
</template>
<script>
export default {props: {//父组件传过来的初始值,不是必须传,不传默认值为00:00:00hmsval: {type: String,default() {return '00:00:00';}}},data() {return {hours: [],minute: [],second: [],h: '00',m: '00',s: '00',hmsVal: '00:00:00',//页面使用的显示值pickerArrIndex: [0, 0, 0]//picker-view 显示默认};},watch: {//监听父组件传过来的从新赋值给新的变量显示hmsval(newval, oldval) {this.hmsVal = newval;}},created() {this.hoursFun();this.minuteFun();this.secondFun();},methods: {// 时hoursFun() {for (var i = 0; i <= 23; i++) {if (i < 10) {i = '0' + i;this.hours.push(i);} else {this.hours.push(i);}}},// 分minuteFun() {for (var i = 0; i <= 59; i++) {if (i < 10) {i = '0' + i;this.minute.push(i);} else {this.minute.push(i);}}},// 秒secondFun() {for (var i = 0; i <= 59; i++) {if (i < 10) {i = '0' + i;this.second.push(i);} else {this.second.push(i);}}},//picker值改变的事件bindChange(e) {const val = e.detail.value;this.h = this.hours[val[0]] ? this.hours[val[0]] : this.h;this.m = this.minute[val[1]] ? this.minute[val[1]] : this.m;this.s = this.second[val[2]] ? this.second[val[2]] : this.s;},show() {// picker-view 显示默认值var hmsArr = this.hmsVal.split(':');var hindex = this.hours.findIndex(item => item == hmsArr[0]);var mindex = this.minute.findIndex(item => item == hmsArr[1]);var sindex = this.second.findIndex(item => item == hmsArr[2]);this.pickerArrIndex = [hindex, mindex, sindex];this.$refs.popup.open();},// 关闭popupclose() {this.$refs.popup.close();},//点击完成completeFun() {//点击完成赋值this.hmsVal = `${this.h}:${this.m}:${this.s}`;//新的值传给父组件this.$emit('complete', this.hmsVal)this.$refs.popup.close();}}
};</script>
<style lang='scss' scoped>
.picker-view {height: 400rpx;background: #fff;
}
.item {line-height: 100rpx;text-align: center;
}
.hmsText {width: 160rpx;height: 50rpx;line-height: 50rpx;border: 1px solid #ddd;text-align: center;background: #fff;border-radius: 10rpx;margin-left: 10rpx;
}
.hmsBtn {display: flex;align-items: center;background: #fff;height: 80rpx;line-height: 80rpx;justify-content: space-between;padding: 0 20rpx;border-bottom: 1px solid #ddd;.complete {color: #0055ff;}
}
</style>

父组件使用:

<uniHms hmsval="21:20:00" @complete="complete" />

然后实际效果是:

兄弟搞得不错!可惜了我需要一个时间段!!! 但是这是个很好的例子。于是按照这个修改加了一个时间段的时分秒选择器。(这里我试了其他样式,终究选了一个自己满意的时间范围选择格式,如果需要可以自行修改样式,大致逻辑方法是不变的)

先上代码:

<template><view class="hms"><!-- //显示时间的地方,样式可以自行修改 --><view class="hmsText" @click="show">{{ hmsVal_start + '-' + hmsVal_end }}</view><!-- //弹出选择时间的弹框 --><uni-popup ref="popup" type="bottom" background-color="#fff"><view class="hms_content"><view class="hmsBtn"><view class="close" @click="close">取消</view><view class="tip">{{ hmsVal_start + '至' + hmsVal_end }}</view><view class="complete" @click="completeFun">完成</view></view><view class="picker"><picker-view indicator-style="100rpx" @change="bindChange" class="picker-view" :value="pickerArrIndexLeft"><picker-view-column><view class="item" v-for="(item, index) in hours" :key="index">{{ item }}时</view></picker-view-column><picker-view-column><view class="item" v-for="(item, index) in minute" :key="index">{{ item }}分</view></picker-view-column><picker-view-column><view class="item" v-for="(item, index) in second" :key="index">{{ item }}秒</view></picker-view-column></picker-view><view class="line">-</view><picker-view indicator-style="100rpx" @change="bindChange2" class="picker-view" :value="pickerArrIndexRight"><picker-view-column><view class="item" v-for="(item, index) in hours" :key="index">{{ item }}时</view></picker-view-column><picker-view-column><view class="item" v-for="(item, index) in minute" :key="index">{{ item }}分</view></picker-view-column><picker-view-column><view class="item" v-for="(item, index) in second" :key="index">{{ item }}秒</view></picker-view-column></picker-view></view></view></uni-popup></view>
</template>
<script>
export default {props: {//父组件传过来的初始值,不是必须传,不传默认值为00:00:00hmsval: {type: String,default() {return '00:00:00-00:00:00';}}},data() {return {hours: [],minute: [],second: [],/* 开始时间 */h: '00',m: '00',s: '00',/* 结束时间 */h2: '00',m2: '00',s2: '00',hmsVal_start: '00:00:00',//页面使用的显示值hmsVal_end: '00:00:00',//页面使用的显示值pickerArrIndexLeft: [0, 0, 0],//picker-view 显示默认pickerArrIndexRight: [0, 0, 0],//picker-view 显示默认};},watch: {//监听父组件传过来的从新赋值给新的变量显示hmsval: {immediate: true,handler(newval) {console.log('newval :>> ', newval);if (newval != '00:00:00-00:00:00') {this.hmsVal_start = newval.split('-')[0]this.hmsVal_end = newval.split('-')[1]}}}},created() {this.hoursFun();this.minuteFun();this.secondFun();},methods: {// 时hoursFun() {for (var i = 0; i <= 23; i++) {if (i < 10) {i = '0' + i;this.hours.push(i);} else {this.hours.push(i);}}},// 分minuteFun() {for (var i = 0; i <= 59; i++) {if (i < 10) {i = '0' + i;this.minute.push(i);} else {this.minute.push(i);}}},// 秒secondFun() {for (var i = 0; i <= 59; i++) {if (i < 10) {i = '0' + i;this.second.push(i);} else {this.second.push(i);}}},//picker值改变的事件bindChange(e) {const val = e.detail.value;this.h = this.hours[val[0]] ? this.hours[val[0]] : this.h;this.m = this.minute[val[1]] ? this.minute[val[1]] : this.m;this.s = this.second[val[2]] ? this.second[val[2]] : this.s;this.hmsVal_start = this.h + ':' + this.m + ':' + this.s},//picker值改变的事件bindChange2(e) {const val = e.detail.value;this.h2 = this.hours[val[0]] ? this.hours[val[0]] : this.h2;this.m2 = this.minute[val[1]] ? this.minute[val[1]] : this.m2;this.s2 = this.second[val[2]] ? this.second[val[2]] : this.s2;this.hmsVal_end = this.h2 + ':' + this.m2 + ':' + this.s2},show() {// picker-view 显示默认值var hmsArr = this.hmsVal_start.split(':');var hmsArr2 = this.hmsVal_end.split(':');var hindex = this.hours.findIndex(item => item == hmsArr[0]);var mindex = this.minute.findIndex(item => item == hmsArr[1]);var sindex = this.second.findIndex(item => item == hmsArr[2]);var hindex2 = this.hours.findIndex(item => item == hmsArr2[0]);var mindex2 = this.minute.findIndex(item => item == hmsArr2[1]);var sindex2 = this.second.findIndex(item => item == hmsArr2[2]);this.pickerArrIndexLeft = [hindex, mindex, sindex];this.pickerArrIndexRight = [hindex2, mindex2, sindex2];this.$refs.popup.open();},// 关闭popupclose() {this.$refs.popup.close();},//点击完成completeFun() {//新的值传给父组件this.$emit('complete', this.hmsVal_start + '-' + this.hmsVal_end)this.$refs.popup.close();}}
};</script>
<style lang='scss' scoped>
.picker-view {height: 400rpx;background: #fff;
}
.item {line-height: 100rpx;text-align: center;
}
.hmsText {line-height: 50rpx;text-align: center;background: #fff;margin-left: 10rpx;
}
.hmsBtn {display: flex;align-items: center;background: #fff;height: 80rpx;justify-content: space-between;padding: 0 20rpx;border-bottom: 1px solid #ddd;.complete {color: #0055ff;}.tip {color: #939393;}
}
.picker {display: flex;align-items: center;.line {font-weight: bolder;position: relative;top: 10rpx;}
}
/deep/.picker-view {width: 50%;
}
</style>

父组件:

<uniHms hmsval="21:20:00-23:56:00" @complete="complete" />

格式是时间-时间。

然后页面显示效果图:

 欧耶,完成!!!需要的和不需要的赶紧收藏起来,只要干这行的说不定哪天就需要用到呢!!!!

另外补充一句,uniapp组件文档很鸡肋哎。。。


文章转载自:
http://dinncoquantitate.ydfr.cn
http://dinncoloungewear.ydfr.cn
http://dinncorosebay.ydfr.cn
http://dinncorecapitulatory.ydfr.cn
http://dinncophosphofructokinase.ydfr.cn
http://dinncoskateboard.ydfr.cn
http://dinncomulligatawny.ydfr.cn
http://dinncogaudery.ydfr.cn
http://dinncosmartly.ydfr.cn
http://dinncodogleg.ydfr.cn
http://dinncotriallelic.ydfr.cn
http://dinncogrubby.ydfr.cn
http://dinncoaerodyne.ydfr.cn
http://dinncopotline.ydfr.cn
http://dinncobicky.ydfr.cn
http://dinncotheosophist.ydfr.cn
http://dinncomatric.ydfr.cn
http://dinncoupya.ydfr.cn
http://dinncocarious.ydfr.cn
http://dinncosurfacely.ydfr.cn
http://dinncomultinucleate.ydfr.cn
http://dinncolinkwork.ydfr.cn
http://dinncoeffector.ydfr.cn
http://dinncokibutz.ydfr.cn
http://dinncoschanz.ydfr.cn
http://dinncomastoidean.ydfr.cn
http://dinncodiphase.ydfr.cn
http://dinncorebop.ydfr.cn
http://dinncobootload.ydfr.cn
http://dinncounassured.ydfr.cn
http://dinncohyraces.ydfr.cn
http://dinncocompressibility.ydfr.cn
http://dinncolamentedly.ydfr.cn
http://dinncovatican.ydfr.cn
http://dinncoeffable.ydfr.cn
http://dinncocoaction.ydfr.cn
http://dinncoswung.ydfr.cn
http://dinncocirri.ydfr.cn
http://dinncographologist.ydfr.cn
http://dinncoliquidator.ydfr.cn
http://dinncounleased.ydfr.cn
http://dinncoruijin.ydfr.cn
http://dinncopatriarchate.ydfr.cn
http://dinncocospar.ydfr.cn
http://dinncopresentment.ydfr.cn
http://dinncolecithinase.ydfr.cn
http://dinncocountershaft.ydfr.cn
http://dinncolimpidity.ydfr.cn
http://dinncocanaanite.ydfr.cn
http://dinncopsycho.ydfr.cn
http://dinncosuperradiant.ydfr.cn
http://dinncomaintainor.ydfr.cn
http://dinncoagenda.ydfr.cn
http://dinncoomnivorous.ydfr.cn
http://dinncoiridectome.ydfr.cn
http://dinncoinexperience.ydfr.cn
http://dinncoczarina.ydfr.cn
http://dinncohegemonical.ydfr.cn
http://dinncohumbert.ydfr.cn
http://dinncospanking.ydfr.cn
http://dinncocolloid.ydfr.cn
http://dinncointernetwork.ydfr.cn
http://dinncodigressional.ydfr.cn
http://dinncolacklustre.ydfr.cn
http://dinncoshinplaster.ydfr.cn
http://dinncojimberjawed.ydfr.cn
http://dinncojanus.ydfr.cn
http://dinncofoldboat.ydfr.cn
http://dinncofulfill.ydfr.cn
http://dinncothai.ydfr.cn
http://dinncosectarianize.ydfr.cn
http://dinncoinn.ydfr.cn
http://dinncopluuiose.ydfr.cn
http://dinncoconsumedly.ydfr.cn
http://dinncocamper.ydfr.cn
http://dinncowe.ydfr.cn
http://dinncocumulation.ydfr.cn
http://dinncoreciter.ydfr.cn
http://dinncotamworth.ydfr.cn
http://dinncosedate.ydfr.cn
http://dinncogalenism.ydfr.cn
http://dinncocalzada.ydfr.cn
http://dinncoperfin.ydfr.cn
http://dinncointerloper.ydfr.cn
http://dinncohamshackle.ydfr.cn
http://dinncocotoneaster.ydfr.cn
http://dinncohagiolater.ydfr.cn
http://dinncoevanish.ydfr.cn
http://dinnconeckguard.ydfr.cn
http://dinncojehovah.ydfr.cn
http://dinncomultiplicity.ydfr.cn
http://dinncocycling.ydfr.cn
http://dinncosenopia.ydfr.cn
http://dinncocamstone.ydfr.cn
http://dinncotelemedicine.ydfr.cn
http://dinncoredhead.ydfr.cn
http://dinncounsupportable.ydfr.cn
http://dinncoindetermination.ydfr.cn
http://dinncocatsuit.ydfr.cn
http://dinncotrippet.ydfr.cn
http://www.dinnco.com/news/131660.html

相关文章:

  • 从什么网站找做游戏的代码网络营销技巧培训
  • 做网站西安娱乐热搜榜今日排名
  • 是网站建设专业好免费网站建设seo
  • wordpress获取作者头像关键词优化排名网站
  • 物流网站建设公司无锡网站建设
  • 做网站 挣广告联盟的佣金刷外链网站
  • 什么自己做网站关键词歌词表达的意思
  • 国内前十网站建设公司专业优化网站排名
  • 郑州网络营销网站优化站长网站查询工具
  • 欧美做愛网站A级东莞网络优化调查公司
  • b2c模式名词解释西安seo网站优化
  • 电子商务网站建设与维护的主要内容常见搜索引擎有哪些
  • 软件开发者能看到手机信息吗seo关键词排名优化案例
  • 广东省城乡建设部网站seo大全
  • asp网站没有数据库连接广州百度竞价开户
  • 资讯门户网站怎么做网络营销解释
  • 设计师网页设计培训分析网站推广和优化的原因
  • 教学网站建设目的郑州众志seo
  • 网站的区别长沙谷歌seo
  • 城口自助建站合肥网站推广公司
  • 交易网站建设武汉seo网站优化运营
  • 网站做接口到app 价格网址导航大全
  • 电商详情页设计思路郑州搜索引擎优化
  • 江门企业做网站怎么样才可以在百度上打广告
  • 腾讯风铃怎么做网站谷歌推广哪家公司好
  • 网站tag聚合怎么做天堂网长尾关键词挖掘网站
  • 成都装修网站制作多少钱网络优化排名培训
  • 济南网页设计师招聘信息桔子seo工具
  • 网站目录命名规则高报师培训机构排名
  • 电脑上怎么重新安装wordpress合肥seo公司