随笔分类 -  前端浅知识

vue uniapp拼团列表--倒计时
摘要:<template> <view> <view v-for="(item,index) in timelimitList" :key="index"> {{item.grouptime_d}}天 {{item.grouptime_h}}时 {{item.grouptime_m}}分 {{item.g 阅读全文

posted @ 2021-11-12 17:28 Monroe_Yu 阅读(312) 评论(0) 推荐(0) 编辑

vue 使用高德地图标记坐标,去除高德水印logo
摘要:第一步:找到项目里的index.html引入 <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=你申请的高德key"> 同样的文件里面添加下面的css,去掉高德水印 <style type="t 阅读全文

posted @ 2021-11-12 15:41 Monroe_Yu 阅读(1698) 评论(0) 推荐(0) 编辑

说一个奇奇怪怪的知识点,uniapp,公众号页面,uni.chooseImage只能相机或者相册选,不能同时使用两种方式sourceType:['camera','album']
摘要:由于自身认为这是一个小功能,于是没怎么细心吧 然后客户之前需要的是只能拍照上传,测试截图看到是有两种方式可选择的 于是我改为了sourceType:['camera''] 一种方式上传。但是另一个选择图片的地方,客户要求两种方式都要,我就写回了sourceType:['camera','album' 阅读全文

posted @ 2021-08-27 18:39 Monroe_Yu 阅读(1141) 评论(0) 推荐(0) 编辑

H5,uniapp 打开手机发送短信页面
摘要:methods: { // 3,发短信 plusReady(){ console.log("err") }, //短信 sendCode(phone){ var msg = plus.messaging.createMessage(plus.messaging.TYPE_SMS); msg.to = 阅读全文

posted @ 2021-08-12 11:19 Monroe_Yu 阅读(741) 评论(0) 推荐(0) 编辑

swiper 禁止滑动
摘要:<div class="swiper-container"> <swiper :style="'min-height:'+height+'px'" :current="active" duration="0" @change="swiperChange"> <swiper-item> </swipe 阅读全文

posted @ 2021-06-04 15:33 Monroe_Yu 阅读(90) 评论(4) 推荐(0) 编辑

uniapp css实现双排菜单向左滑动
摘要:<scroll-view class="typelist" scroll-x> <view class="nav-bar-wrap"> <block v-for="(item,index) in goodstypelist"> <view class="nav-bar-item"> <navigat 阅读全文

posted @ 2021-06-03 11:43 Monroe_Yu 阅读(341) 评论(0) 推荐(0) 编辑

根据屏幕高度自适应页面高度
摘要:var window_h=function(element,height){ var element=document.getElementsByClassName(element); for(let i=0;i<element.length;i++){ element[i].style.heigh 阅读全文

posted @ 2020-12-23 10:17 Monroe_Yu 阅读(215) 评论(0) 推荐(0) 编辑

js调用局部打印功能并还原
摘要:function printme() { //printMain为要打印的dom元素 window.document.body.innerHTML = document.getElementById('printMain').innerHTML; window.print(); // 还原界面 va 阅读全文

posted @ 2018-02-23 17:57 Monroe_Yu 阅读(224) 评论(0) 推荐(0) 编辑

滚动加载数据
摘要:var rows = 15;$(window).scroll(function(){ var scrollTop = $(this).scrollTop(); var scrollHeight = $(document).height(); var windowHeight = $(this).he 阅读全文

posted @ 2018-01-26 10:01 Monroe_Yu 阅读(105) 评论(0) 推荐(0) 编辑

js判断是否为IE浏览器
摘要:function isIe(){ if (!!window.ActiveXObject || "ActiveXObject" in window){ //是 mui. alert("是IE!"); }else{ //不是 mui.alert("不是IE!"); } } isIe(); 阅读全文

posted @ 2017-12-07 10:39 Monroe_Yu 阅读(121) 评论(0) 推荐(0) 编辑

工具类 ,无需再存localstorage
摘要:/** * 工具类 */var Utils = { /** * 获得查询参数 */ getQueryString: function(name) { var search = location.search; if(!search) { return null; } var reg = new Re 阅读全文

posted @ 2017-11-28 14:37 Monroe_Yu 阅读(287) 评论(0) 推荐(0) 编辑

jquery点击复制
摘要:/*点击复制*/ $(".copycode").delegate("img","click",function(){ var password = $(this).parent().parent().find("#password"); password.select(); // 选择对象 docu 阅读全文

posted @ 2017-11-24 18:19 Monroe_Yu 阅读(365) 评论(0) 推荐(0) 编辑

js 将base64转为图片
摘要:var imgurl = response.data; $(".codeimg").attr('src','data:image/png;base64,'+imgurl); var validate = response.validate; 阅读全文

posted @ 2017-11-20 12:24 Monroe_Yu 阅读(1531) 评论(0) 推荐(0) 编辑

js取两位小数点
摘要:var money = one.money; var tmoney = money.substr(0,money.indexOf(".")+3); 阅读全文

posted @ 2017-11-11 11:10 Monroe_Yu 阅读(227) 评论(0) 推荐(0) 编辑

json格式的ajax传输交互
摘要:/*设置呼叫转移*/var ownerId = localStorage.getItem("ownerId"); var roomId = localStorage.getItem("roomId"); var ownerPhone = localStorage.getItem("ownerPhon 阅读全文

posted @ 2017-10-24 14:29 Monroe_Yu 阅读(197) 评论(0) 推荐(0) 编辑

js全选与反选
摘要:/*全选*/$(".chooseall_box").click(function() { if($(".checkall").prop("checked")) { $("input[type='checkbox'][name='checkbox']").prop("checked", true); 阅读全文

posted @ 2017-10-18 14:41 Monroe_Yu 阅读(179) 评论(0) 推荐(0) 编辑

formdata,ajax提交数据
摘要:var data = document.getElementById("#dataForm"); var formData = new FormData(data); var account = $(".account").val(); var phone = $(".phone").val(); 阅读全文

posted @ 2017-10-11 12:06 Monroe_Yu 阅读(553) 评论(0) 推荐(0) 编辑

js判断是否微信浏览器、IE浏览器
摘要:/*判断(微信)浏览器*/ function isWeiXin(){var ua = window.navigator.userAgent.toLowerCase();if(ua.match(/MicroMessenger/i) == 'micromessenger'){return true;}e 阅读全文

posted @ 2017-09-20 10:57 Monroe_Yu 阅读(203) 评论(0) 推荐(0) 编辑

js实现列表从下往上循环滚动
摘要:html: <div class="liscorll"> <ul> <li>内容</li> </ul> </div> js: /* 通知-滚动条 */ var doscroll = function(){ var $parent = $('.liscorll ul'); var $first = $ 阅读全文

posted @ 2017-09-18 16:41 Monroe_Yu 阅读(2468) 评论(0) 推荐(0) 编辑

绝对定位始终居中
摘要:方法一:(不能微调) position:absolute; left:0; right:0; top:0; bottom:0; margin:auto; 方法二:(可微调) position:absolute; top:50%; left:50%; margin-top:-100px; /*元素高度 阅读全文

posted @ 2017-08-18 10:56 Monroe_Yu 阅读(215) 评论(0) 推荐(0) 编辑