- 博客(51)
- 收藏
- 关注
原创 uniapp传参
getParams(obj) { //接收值 this.formData = obj console.log(obj, '查询参数') },
2023-03-08 10:50:43
538
原创 uniapp中uni.navigateBack();传参
// B页面 let pages = getCurrentPages(); let prevPage = pages[pages.length - 2]; //上一个页面 this.lablelist.forEach(el => { if (el.seclect) { object.push(el) } }) prevPage.$vm.getParams(object); //重点$vm uni.navigateBack();/
2022-12-07 13:52:31
612
原创 uniapp(小程序)背景水印和原生html实现
export default { data() { return { } }, onLoad() { console.log('0000') this.dr
2022-09-28 20:22:53
946
原创 uniapp使用,map标记旅游景点
<view> <map class="map" :show-location="true" :markers="markers" @markertap="fetchShopDetail" @labeltap="fetchShopDetail2" @callouttap="fetchShopDetail3" longitude="116.336590" latitude="39.941127" :scale="11" id
2022-09-21 17:43:43
480
原创 微信小程序获取地理位置
"permission":{ "scope.userLocation": { "desc": "您的位置信息将用于获取周围门店信息" } }, "requiredPrivateInfos": [ "getLocation" ], "sitemapLocation": "sitemap.json",
2022-08-23 15:26:06
654
原创 微信公众号重定向
onLoad(option) { let userid = this.getUrlParam('userid') let code = this.getUrlParam('code') let state = this.getUrlParam('state') if (state) { this.state = state } const wx_url = `https://open.weixin.qq.com/connect/oauth2/auth
2022-08-16 10:44:29
1470
原创 vue 点击按钮新增div,for循环中取值赋值
<div> <ul class="list" style="list-style: none;"> <li v-for="(item, index) in arrs"> <div style="margin-bottom: 20px;">收据:{{index+1}}</div> <el-form-item label="收.
2022-04-29 13:16:58
1582
原创 vue百度地图手动定位位置
html<el-button type="primary" style="margin-left: 10px;" @click="latitude()">获取经纬度</el-button><el-dialog width="50%" :before-close="cancel" :closable="false" :mask-closable="false" :visible="visible"
2022-03-24 08:52:49
1141
原创 vue根据输入位置获取经纬度
latitude() { this.visible = true, this.showMapComponent = true jsonp(`https://apis.map.qq.com/ws/geocoder/v1/`, {//官方接口 output: 'jsonp', key: 'YTLBZ-MJ732-7FFUY-CKH44-XRQH2-LYFTs',//腾讯地图获取的key address: this.address//获取输入的位置.
2022-03-18 11:12:21
2192
原创 移动端window.open在苹果手机失效
var u = navigator.userAgent;var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android终端var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 if(isAndroid) { //android终端 let url = res.dat.
2022-03-12 11:28:21
4015
原创 vue路由传递对象
传参var row = {id:2,name:1}this.$router.push({path: '/index', query: {row: encodeURIComponent(JSON.stringify(row))}});接收参数console.log(JSON.parse(decodeURIComponent(this.$route.query.row)))
2022-03-10 09:55:29
5107
原创 vue +h5 调用支付宝支付
let htmls = res.Msg//后台返回的from表单 const div = document.createElement('div'); div.innerHTML = htmls; document.body.appendChild(div); document.forms[0].acceptCharset = 'utf-8'; document.forms[0].submit()
2022-02-24 14:09:27
1166
原创 小程序获取经纬度,当前省市区
// pages/numberDetail/numberDetail.jsvar QQMapWX = require('../../utils/qqmap-wx-jssdk.min.js');var qqmapsdk;const util = require('../../utils/utils.js')//防抖节流const app = getApp()Page({ /** * 页面的初始数据 */ data: { Phone:'', UserInfo:.
2022-02-08 11:21:49
1022
原创 uniapp解决苹果手机上传图片不显示问题
//重点:上传时压缩,添加请求头addvoicea() { var that = this; // 从本地相册选择图片或使用相机拍照。 uni.chooseImage({ count: 1, //最多可以选择的图片张数,默认9 //album 从相册选图,camera 使用相机,默认二者都有。 sourceType: ['album'], sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有 .
2022-01-21 13:48:53
3041
转载 使用javascript-obfuscator进行JS的(批量)最小化和混淆
安装NPM(node,js)安装javascript-obfuscatornpm install javascript-obfuscator -g最小化并混淆文件javascript-obfuscator input_file_name.js执行上面的指令后,会生成input_file_name-obfuscated.js批量操作javascript-obfuscator ./...
2021-12-10 10:49:00
719
原创 公众号实现下拉刷新
//methods中添加方法onPullDownRefresh() { console.log('refresh'); this.timer = setTimeout(() => { uni.stopPullDownRefresh() }, 1000); }, beforeDestroy() { clearInterval(this.timer); },.
2021-12-08 16:18:53
550
原创 h5调用JSAPI支付
// #ifdef H5 //调用后台接口 NET.request(API.gotojsapiPay, submitResult, 'POST').then(res => { WeixinJSBridge.invoke( 'getBrandWCPayRequest', { "appId": res.data.appId, //公众号ID,由商户传入 "timeStamp": res.data.timeS..
2021-12-07 16:30:21
1004
原创 小程序节流(防止重复点击)
util/utils.js// 防抖节流 防止重复点击function throttle(fn, gapTime) { if (gapTime == null || gapTime == undefined) { gapTime = 1500 } let _lastTime = null // 返回新的函数 return function () { let _nowTime = + new Date() if (_nowTime - _lastTime
2021-12-01 14:45:45
462
原创 vue前端实现左侧栏权限
router/index.vueimport Vue from 'vue'import Router from 'vue-router'Vue.use(Router)/* Layout */import Layout from '@/layout'/* Router Modules */// import componentsRouter from './modules/components'// import chartsRouter from './modules/charts
2021-12-01 13:23:45
977
原创 隐藏手机号中间4位
//隐藏手机号 phoneNumShow () { let that = this; let number = '17863444444'; //获取到手机号码字段 console.log('手机号', this.tel) let mphone = number.substring(0, 3) + '****' + number.substring(7...
2021-11-22 13:55:25
2539
原创 正则表达式大全
一、校验数字的表达式 1. 数字:^[0-9]*$2. n位的数字:^\d{n}$3. 至少n位的数字:^\d{n,}$4. m-n位的数字:^\d{m,n}$5. 零和非零开头的数字:^(0|[1-9][0-9]*)$6. 非零开头的最多带两位小数的数字:^([1-9][0-9]*)+(.[0-9]{1,2})?$7. 带1-2位小数的正数或负数:^(\-)?\d+(\.\d{1,2})?$8. 正数、负数、和小数:^(\-|\+)?\d+(\.\d+)?$9. 有.
2021-10-12 08:55:53
146
原创 微信公众号跳转小程序
<view class="point"> <view class="point-item" v-for="(item,index) of pointList" :key="index"> <wx-open-launch-weapp username="gh_xxxxxx">//username对用的是小程序原始id,(进入一个小程序,点击右上角那三个点点的图标,就出现图下图的弹窗,点击弹窗顶部标题,点击标题之后会进入类似下图的页面,点击更多资料可以查..
2021-07-05 10:13:16
247
原创 一键获取微信地址
if(wx.chooseAddress){ wx.chooseAddress({ success: function (res) { console.log(JSON.stringify(res)) }, fail: function(err){ console.log(JSON.stringify(err)) } }) }else{ console.log('..
2021-06-22 08:52:14
700
原创 jq移动端评分左右滑动效果
<!DOCTYPE html><html><head> <meta charset="utf-8" /> <meta name="layout" content="main"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content=.
2021-06-18 15:20:08
643
2
原创 vue下拉选择
<template> <div class="about"> <!-- 列表 --> <div class="center"> <!-- <p> --> <div> <div class="por"> <div class="selectBox" style="width: 100%;position: relative;"&.
2021-06-09 16:41:15
351
原创 vue移动端(element为例)上传多张图片
<template> <div class="about"> <!-- 列表 --> <div class="center"> <p> <input v-model="name" placeholder="请输入标题" /> </p> <!-- 详细信息 --> <div class="mark"> .
2021-06-09 16:35:57
559
原创 vue本地存储
localStorage.setItem('token', res.Msg.token);localStorage.getItem('token');
2021-06-07 16:44:40
271
原创 微信公众号授权前端(uniapp为例)
const base_url = 'http://baidu.com'// 前端域名 const wx_url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+appid+'&redirect_uri='+base_url+'&response_type=code&scope=snsapi_base&state=123#wechat_redirect' export def...
2021-06-07 16:16:55
601
原创 vue头部左右滑动导航
<template> <div class="about"> <div class="idd"> <ul> <li :class="{'active':indexTap == index}" v-for="(item,index) in lists" :key="index" @click="indexTap = index"> {{item}} <.
2021-05-31 11:09:57
270
原创 小程序点击图片预览大图
js topic_preview(e){ let id = e.currentTarget.dataset.id let arr = new Array this.data.list.forEach((item)=>{ if(item.id == id){ arr = item.imgList } }) wx.previewImage({ urls: arr,
2021-05-25 10:40:51
463
原创 小程序生成二维码
wxml<canvas canvas-id='canvas'></canvas>jsvar QRCode = require('../../utils/weapp-qrcode.js');var qrcode /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { qrcode = new QRCode('canvas', { //'canvas'为html中定义的canvas-id
2021-05-25 09:53:32
266
原创 iPhoneX安全区域(Safe Area)底部小黑条在微信小程序和H5的屏幕适配
app.jsvar bottomBarHeight = '';var otherHeight = '';let isAdaptation = falselet isIphoneX = falselet pixelRate = 0.5let statusBarHeightwx.getSystemInfo({ success: res => { // console.log(res); let modelmes = res.model; pixelRate =
2021-05-20 15:50:42
377
空空如也
bug uview日历插件
2023-08-31
TA创建的收藏夹 TA关注的收藏夹
TA关注的人