- 博客(31)
- 收藏
- 关注
原创 前端日常代码,主要是小程序的,多年积累,觉得有用的收藏吧
1.小程序点击事件传值: ele.currentTarget.dataset.id2.获得字符串逗号前面的元素(分解为数组):var s = “abc,abcd,aaa” let arr= s.split(",")3.Vue模板:export default {name: ‘index’,data() {return {}},methods: {},mounted() {}}4.Vue:index赋值:{{item}}5. 溢出点点:overflow: hidden; text-overflo
2021-12-23 17:39:21
543
原创 小程序中使用阿里云oss上传视频怎么获得视频截图?
在视频地址后面加上如下的后缀,就可以获取视频内部帧图片,当作封面使用。?x-oss-process=video/snapshot,t_1000,m_fast?x-oss-process=video/snapshot,t_700,w_600,h_600,m_fast
2021-12-23 13:39:03
1816
原创 2021-11-05
小程序谁决定第一显示的谁做了两年多的小程序了,我一直认为决定第一个高亮显示的是tabBar里面的list数组里面谁再前就先选中谁,因为一直用的都是小程序默认就会第一个创建index这个页面。最近做了一个需要显示中间按钮,我还再app.js里面加了一个跳转代码,直到今天才忽然发现,决定先选中谁的是app.json里的pages里面谁排在前面!!!!...
2021-11-05 10:09:00
102
原创 小程序下载保存线上视频
down(){let task = tt.downloadFile({url: “https://dyvideo.vikpay.com/sv/10b9ffe-17b86615e1e/10b9ffe-17b86615e1e.mp4”,success: (res) => {if (res.statusCode === 200) {// 下载的图片存到本地的地址console.log(“下载成功”, res.tempFilePath);tt.saveVideoToPhotosAlbum({f
2021-09-01 09:20:13
222
原创 vue使用v-for加载本地路径的图片
{{item.name}} effectsArr:[{url:require(’…/assets/dx1.png’),name:“生活”},{url:require(’…/assets/dx2.png’),name:“四季”},{url:require(’…/assets/dx3.png’),name:“未来”},{u...
2021-08-11 15:22:35
283
原创 el-select里面change传递多个参数时候使用
<el-select class="fl jumpsel" v-model="city" value-key="cityId" filterable placeholder="请选择" @change="cityBtn"> <el-option v-for="item in cityList" :key="item.cityId" :label="item.cityName" ...
2020-07-16 18:15:59
1382
原创 vue项目报错:npm ERR! Unexpected end of JSON input while parsing near...
1.清缓存npm cache clean --force2.切换淘宝镜像npm config set registry https://registry.npm.taobao.org/npm config get registry https://registry.npm.taobao.org/3.安装npm install
2020-07-13 09:25:06
266
原创 点赞动画淡入淡出
wxml <view class="show" animation="{{vip_animal}}"> <text class="show1">+1</text> <image class="shows" src="../images/zan.png"></image> </view> <view bindtap="giveBtn">点赞动画</view>css.show1
2020-05-17 22:14:09
152
原创 两层tab可滑动切换组件
wxml <view class="dynamic_box"> <!-- 一级分类 --> <view class="dybox"> <view wx:for="{{dynamic}}" data-index="{{index}}" class="dynamic_tie {{isindex==index?'active':''}...
2020-04-23 23:55:34
670
原创 小程序swiper禁止竖向滑动
<swiper class="list_content" style='height: {{height}}px' duration="500" current="{{currentTabs}}" bindchange="changeContents"> <swiper-item class="content-item" wx:for="{{menuList...
2020-04-20 23:54:06
598
原创 小程序swiper组件去除滑动时候的滚动条
::-webkit-scrollbar {width: 0;height: 0;color: transparent;}
2020-04-16 20:27:31
616
原创 小程序自定义样式音频播放器
wxml!!{{showTime1}}{{showTime2}}删除线格式 删除线格式 删除线格式删除线格式wxss!!.flex{float: left;width: 100%;position: relative;}.audioPlayer{width: 100%;height: 114rpx;box-sizing: bord...
2020-04-16 13:28:36
2297
1
原创 小程序时间转时间戳进行比较,安卓和ios的兼容写法
str2Stamp(time){ var date = time.substr(0, 10)var hour = time.substr(11, 2) == ‘00’ ? 0 : time.substr(11, 2).replace(/\b(0+)/gi, “”);var minute = time.substr(14, 2) == ‘00’ ? 0 : time.substr(14, 2...
2020-04-13 19:56:44
471
原创 小程序里面判断只走一路
**addYn = true** for (let l = 0; l < this.data.shop.length; l++) { addYn = false break } if (addYn){ 11111 }
2020-03-25 11:21:03
78
原创 超出部分点点点
view {overflow: hidden;text-overflow: ellipsis;-o-text-overflow: ellipsis;white-space:nowrap;}
2020-03-20 11:22:29
104
原创 css3属性整理
1.div里面文字自动转行:word-wrap:break-word2.溢出隐藏:text-overflow:clip溢出隐藏显示省略号:text-overflow:ellipsis3.Text-fill-color: 文字内部填充颜色Text-stroke-color: 文字边界填充颜色Text-stroke-width: 文字边界宽度4.多列布局Column-count:表示布局...
2020-03-05 13:58:01
96
原创 判断有没有授权过,决定显示头像授权还是不显示
// 判断有没有授权过,决定显示头像授权还是不显示wx.getSetting({success(res) {if (res.authSetting[‘scope.userInfo’]) {// 已经授权,可以直接调用 getUserInfo 获取头像昵称 } else { } } })...
2020-02-26 14:26:53
467
原创 拼接字符串然后转成字符串对象
let content = '{"type": "1", "tableId": "417364822703845376"}' var obj = JSON.parse(content)
2019-12-27 17:57:34
392
原创 小程序bindload获取参数的截取
获得h5页面的url地址,转stringlet str = String(ele.detail.src)获得第一个&的位置let s = str.indexOf(’&’) ;截取字符串let code = str.substring((s + 6), (str.length-12))...
2019-12-06 21:47:58
1112
原创 直接调用子组件里面的事件
deails.wxml:<poster id="posters"></poster>deails.json{"component": true,"usingComponents": {"poster": "../components/poster/poster"}}deails.jsnoload(){// 直接调用组件...
2019-11-20 14:07:53
189
原创 vue的input控制只能输入小数与整数不能输入负数的正则
oninput ="value=value.replace(/[^0-9.]/g,'')"
2019-11-14 10:39:15
3636
原创 小程序前后页面传值
微信小程序:得到上一页返回的参数let pages = getCurrentPages();let currPage = null; //当前页面let prevPage = null; //上一个页面if (pages.length >= 2) {currPage = pages[pages.lengt...
2019-11-12 23:27:00
108
原创 h5中关闭微信与支付宝窗口
WeixinJSBridge.call('closeWindow');// 关闭微信页面窗口AlipayJSBridge.call('closeWebview');// 关闭支付宝页面窗口...
2019-11-12 23:25:23
659
原创 vue鼠标移入移出添加去除class:
<div class="product1"@mouseover="mouseOver($event)"@mouseleave="mouseLeave($event)"></div>mouseOver($event) {$event.curren...
2019-11-12 23:22:01
404
原创 vue页面刷新:
1.在app.vue里面写刷新方法:<template><div id="app"><router-view v-if="isRouterAlive"></router-view></div></template><script>export default {name:...
2019-11-12 23:21:10
46
原创 vue动态绑定css样式
<div v-bind:style="{ margin: mt }" ></div>data{return{mt :"150px 0 0"}}
2019-11-12 23:18:26
242
原创 vue根据条件不同显示不同按钮
<template slot-scope="scope"> <el-button v-if="scope.row.isDeleted === 0" @click="lowerShelf(scope.row.id)" size="mini" type="primary" plain>下架</el-button> <el-button v-else ...
2019-11-12 23:14:20
6573
原创 提示框在点击的按钮附近弹出
1.创建一个页面组件:tips(暂时不会页面事件传值,以后会了精简一下) {{sucess_text}} {{error_text}} }2.使用组件页面引入import tips from ‘…/common/tips’;3.页面使用组件(1)html里面:(2)data里面sucess_text:""...
2019-11-12 17:53:16
531
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人