自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(29)
  • 资源 (2)
  • 收藏
  • 关注

原创 微信小程序——微信开发工具配置less语法

一、打开vscode 在扩展中搜索Easy Less 并安装二、找到less中Settings的位置如图第2个红框是用法第3个红框的意思:这允许您指定另一个输出文件扩展名(例如.wxss而不是.css)三、点击设置随后看到这样一个页面如果没有,点击这里打开文件在里面加入这个"less.compile": { "outExt": ".wxss"},意思是把less文件转成wxss文件最后,愉快地使用less吧!!...

2020-09-12 11:07:26 1460

原创 微信小程序——使用async await(异步)

.js文件page({ data: { demoList: [] }, async getDemoList () { const that = this const res = await API.getDemo() // api接口 let suggestFollow = res.data that.setData({ demoList }) console.log('demoList...', this.d

2020-09-12 10:53:12 244

原创 微信小程序——radio-group 控制选中某个元素

.wxml文件<radio-group class="radio-group" bindchange="radioChange"> <label class="radio"> <radio value="1"/> </label> <label class="radio"> <radio value="2"/> </label></radio-grou

2020-09-12 10:51:06 1500

原创 微信小程序——点击事件(阻止冒泡事件)

bindtap 改成 catchtap.wxml文件<view catchtap="call">点我</view>

2020-09-12 10:50:03 670

原创 微信小程序——删除数组中指定元素

1、arr.splice(index,howmany)index:表示从指定的位置上(哪里)删除元素;howmany:表示应该删除多少个元素,赋值为0就表示不删除元素;2、arr.findIndex() 当数组中的元素在测试条件时返回 true 时, findIndex() 返回符合条件的元素的索引位置;如果没有符合条件的元素返回 -1示例:.wxml文件<view wx:for="{{productList}}" wx:for-item="item" wx:key="index"

2020-09-12 10:48:41 11413 1

原创 微信小程序——forEach 遍历数组

.js文件data: {wareHousingList: []}demo: function () {let data = res.datathis.setData({wareHousingList: res.data})data.forEach(item => {item['cropName'] = item.cropNameitem['productName'] = item.productName}})this.setData({wareHousingList: d

2020-09-12 10:46:03 8793

原创 微信小程序——for of 遍历数组(es6)

注意:array.entries()可获取数组中的索引.js文件demo: function () { let dataList = [{id:1, name: 'a'},{id:2, name: 'b'}]let result = [] for (const [index, data_item] of dataList.entries()) { result.push({ text: data_item.na

2020-09-12 10:44:50 971

原创 微信小程序——调用全局变量的方法

app.js文件 demo: function () { //获取openId const _this = this return new Promise(function (resolve, reject) { wx.login({ success(res) { console.log(res); } }) }) },在demo文件中调用demo.js文件onLoad: function (options){app.demo().

2020-09-12 10:37:50 995

原创 微信小程序——api接口的配置

**1.新建一个文件夹,应包含以下文件新建一个文件夹,应包含以下文件**util.js文件module.exports = {}http.js文件const HTTP = amount => { const app = getApp() return new Promise(function (resolve, reject) { wx.showLoading({ title: '加载中', }) console.log(app.globalData.token)

2020-09-12 10:22:31 4317 2

原创 微信小程序——wx.request格式

wx.request格式wx.request({url: 'http://192.168.1.1/aa' + '/api/app/aa', //仅为示例,并非真实的接口地址method: 'POST', //请求方法data: { //需要传入的参数slName: this.data.slName,slCropId: this.data.cropId,},header: {"contentType": "application/json;charset=utf-8",'Authoriza

2020-09-12 09:37:57 618

原创 微信小程序——wx.uploadFile格式

如:以下是上传图片的一个格式wx.uploadFile({url: 'http://192.168.1.10:19001/aa/aa' + 'aa/aa/aa', // 接口地址filePath: that.data.tempFilePaths[0], // 需要上传的数据name: 'photoes', // 接口中参数名字formData: { // 其它需要上传的数据(参数:数据)userName: that.data.userName,contactNum: that.data.con

2020-09-10 10:27:53 950

原创 微信小程序——路由跳转页面传值(多个参数之间用&相连)

1、方式一.wxml文件<navigator url="/pages/demo/demo?productName={{item.productName}}&cropName={{item.cropName}}&labelId={{item.lableId}}"><view class="right" >点我跳转</view></navigator>方式二.wxml文件<view bindtap="clickMe">

2020-09-10 10:26:55 928

原创 微信小程序——获取input里的内容

.wxml文件<input class="search-input" maxlength="50" bindinput="bindKeyName" />.js文件bindKeyName: function (e) { console.log('内容为:', e.detail.value) },

2020-09-10 09:23:19 265

原创 微信小程序——获取view里的内容

wxml文件<view bindtap="selectDistrict" data-text="{{content}}" data-id="{{id}}">{{content}}</view>.js文件data: { content:'我是内容', id: 1} selectDistrict: function (e) { console.log(e.currentTarget.dataset.id) // 1 console.log(e.c

2020-09-10 09:21:22 2348

原创 微信小程序——showModal 弹出框

.js文件demo: function() { wx.showModal({ title: '标题', content: '提示的内容', confirmText: '确定', //确认按钮的文字,最多 4 个字符 confirmColor: '#346EFE', //确认按钮的文字颜色,必须是 16 进制格式的颜色字符串 showCancel: false, // 是否显示取消按钮 cancelText: '

2020-09-10 09:19:10 663 2

原创 微信小程序——showToast 消息提示框(官方自带)

.wxml文件wx.showToast({ title: '成功', // 提示的内容 icon: 'success', // icon: 'none'就是没有图标 duration: 2000 // 提示的延迟时间})

2020-09-10 09:17:53 634

原创 微信小程序——手机号、QQ号、邮箱正则

.js文件Page({ data: { testPhone: false, QQ: false, email: false, suggestContactInfo: '12345678911' // 模拟的一个手机号 }, demo: function() { // that.data.suggestContactInfo 是要测试的手机号/QQ号/邮箱正则 const that = this that.data.testPhone = /^1[34567

2020-09-10 09:16:48 806

原创 微信小程序——json文件的常用配置

.json文件{ "usingComponents": { "icon": "../../components/icon/icon", // 组件 }, "navigationBarTitleText":"我是标题", // 当前页面标题 "navigationBarBackgroundColor": "#0486FE", // 当前页面背景颜色 "navigationBarTextStyle": "white", //导航栏标题颜色 "enablePullDownRefr

2020-09-10 09:12:54 312

原创 微信小程序——&emsp;空格的使用

一个&nbsp;代表一个空格.wxml文件<text decode="true">我是&nbsp;&nbsp;&nbsp;测试</text>

2020-09-10 09:01:59 4167 2

原创 微信小程序——wx:for循环的使用

.wxml文件<view wx:for="{{jobList}}" wx:for-item="item" wx:key="index" > {{item}}</view>.js文件data: { jobList: ['1', '2', '3']}

2020-09-10 09:01:46 339

原创 微信小程序——存、取、清除缓存数据(同步)

存缓存:wx.setStorageSync(‘key’, data) , data是你要存入的数据取缓存: wx.getStorageSync(‘key’).js文件data: {address: ''},demo: function () { wx.setStorageSync('address', res.data.result.ad_info.city) // 存缓存this.setData({ address: wx.getStorageSync('address') //.

2020-09-09 22:39:01 2356

原创 微信小程序——下拉刷新事件(onPullDownRefresh)

.js文件// 下拉刷新 onPullDownRefresh: function () { console.log('下拉刷新事件') }, // 在onShow里面加载 /** * 生命周期函数--监听页面显示 */ onShow: function () { this.onPullDownRefresh() }.json文件{ "enablePullDownRefresh": true, "backgroundTextStyle": "dark" // 下

2020-09-09 22:37:17 3256

原创 微信小程序——配置tabBar(底部导航)

app.json文件{"tabBar": {"custom": false, //是否自定义"color": "#BFBFBF","font-size": "300rpx","selectedColor": "#0486FE", //选中后的颜色"backgroundColor": "#fff", //背景颜色"list": [{"pagePath": "pages/demo1/demo1", //页面路由"iconPath": "/resources/images/demo1_fa

2020-09-09 22:33:31 542

原创 微信小程序——微信授权获取手机号弹窗(官方自带)

.wxml文件<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">微信登录</button>.js文件// 微信授权获取手机号弹窗 getPhoneNumber: function (e) { var that = this; if (e.detail.errMsg == "getPhoneNumber:ok") { this.getLocation() wx.re

2020-09-09 22:30:28 4847 1

原创 微信小程序——获取微信昵称、头像、地区及性别弹框(官方自带)

.wxml 文件<button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 点我 </button>.js文件// 获取微信昵称、头像、地区及性别 getUserInfo: function(e) { console.log(e) this.setData({ dialogvisible3: true }

2020-09-09 22:29:03 5506

原创 微信小程序——自定义radio(radio选中/反选功能)

说明:微信小程序官网文档中的radio选中之后无法取消,所以自定义radio。.wxss 文件<label class="radio" catchtap='checkedTap'> <radio checked="{{checked}}" /></label>.js文件Page({ checkedTap: function () { var checked = this.data.checked; this.setData({ "check

2020-09-09 22:27:12 808

原创 微信小程序——全国城市列表

wxml文件<scroll-view class="scroll_view" scroll-y="true" scroll-into-view="{{jumpNum}}" scroll-with-animation> <view class="title">定位城市</view> <view class="position_city">北京</view> <view class="city_list" wx:for=

2020-09-09 22:11:34 1756

原创 微信小程序——获取信息位置

js文件// 获取位置信息 getUserLocation() { const _this = this wx.getSetting({ success(res) { console.log(res.authSetting) if (res.authSetting['scope.userLocation']) { //授权了 _this.setData({ not_auth: false }) wx.getLocation

2020-09-09 21:54:52 131

原创 微信开发者工具终端配置git

第一步:第二步:

2020-09-09 14:32:11 2344

使任何应用程序位于最顶部 把应用钉住 固定窗口功能

使任何应用程序位于最顶部 把应用钉住 固定窗口功能

2022-07-13

名称:WindTerm_2.5.0 Windows 64位版本zip压缩包 适合人群:合适前后端运维开发人员 使用场景:远程连接

名称:WindTerm_2.5.0 Windows 64位版本zip压缩包 适合人群:合适前后端运维开发人员 使用场景:远程连接

2022-06-27

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除