微信小程序开发经验总结(五)

微信小程序开发经验总结(一) 1.入门请先阅读官方文档 2.app.json配置 pages tabBar windows 3.app.js 微信小程序从实战开发到放弃(入门请先阅读官方文档) 1. 官方文档 入门首选 https://mp.weixin.qq.com/debug/wxadoc/dev/ 2. app.json 配置 不能有注释 pages "pages": [ "pages/index/ 阅读详情

微信小程序开发经验总结

微信小程序开发经验总结(一)
微信小程序开发经验总结(二)
微信小程序开发经验总结(三)
微信小程序开发经验总结(四)
微信小程序开发经验总结(五)
微信小程序开发经验总结(六)
微信小程序开发经验总结(七)

13. 常用组件

button
  • 无type属性时 class才能生效 无type属性 or type=”default” 时 hover-class才能生效

  • hover-class

    .wxml
    <button hover-class="other-button-hover">拨打电话</button>
    .wxss
    /** 修改button默认的点击态样式类**/
    button-hover 默认为{background-color: rgba(0, 0, 0, 0.1); opacity: 0.7;}//opacity不透明
    .button-hover {
    background-color: red;
    }
    /** 添加自定义button点击态样式类**/
    .other-button-hover {
    background-color: blue;
    }
image
  • image组件默认宽度300px、高度225px 一般需要设置宽高

    .image {
    width: 180rpx;
    height: 180rpx;
    }
input
  • 实时获取input数据

    //能够获取用户输入的组件,需要使用组件的属性bindblur将用户的输入内容同步到 AppService。
    //输入框失去焦点时触发,event.detail = {value: value}
    <input id="myInput" bindblur="bindBlur" />
    var inputContent = {}
    Page({
    data: {
      inputContent: {}
    },
    bindBlur: function(e) {
      inputContent[e.currentTarget.id] = e.detail.value
    }
    })

    ​

text
  • ​

    <text/> 组件内只支持 <text/> 嵌套
swiper
  • swiper dots 指示点深度定制 改变形状 大小 位置等

    
    .swiper-box .wx-swiper-dots.wx-swiper-dots-horizontal{
     margin-bottom: 2rpx;
    }
    .swiper-box .wx-swiper-dot{
      width:40rpx;
      display: inline-flex;
      height: 10rpx;
      margin-left: 20rpx;
      justify-content:space-between;
    }
    .swiper-box .wx-swiper-dot::before{
      content: '';
      flex-grow: 1; 
      background: rgba(255,255,255,0.8);
      border-radius: 8rpx
    }
    .swiper-box .wx-swiper-dot-active::before{
      background:rgba(244,0,0,0.8);   
    }

    ​

scroll-view
  • 高度自适应屏幕高度

    /**
    * 生命周期函数--监听页面加载
    */
    onLoad: function (options) {
    //获取系统资料
    wx.getSystemInfo({
        success: function (res) {
          logUtil.log(res);
          that.setData({
            // 这里的高度单位为px,所有利用比例将300rpx转换为px)
            onlyList_height: res.windowHeight - res.windowWidth / 750 * 300,
            //
          });
        }
      });
    },

    ​

form 表单
  • 提交事件(用的不多,input textarea用得上,text不能使用,)

    <form bindsubmit="formSubmit" bindreset="formReset">
    <view class="btn-area">
      <button formType="submit">Submit</button>
      <button formType="reset">Reset</button>
    </view>
    </form>
    
    formSubmit: function (e) {
      console.log('form发生了submit事件,携带数据为:', e.detail.value)
    },
    formReset: function () {
      console.log('form发生了reset事件')
    },

14. 常用API

phone
wx.makePhoneCall({
  phoneNumber: '1340000' //仅为示例,并非真实的电话号码
})
loading
//loding
wx.showLoading({
  title: '登录中',
  mask: true
})
//hideLoading
wx.hideLoading()
Storage
//
wx.getStorage({
      key: "user",
      success: function (res){
        if (res.data==null)
          {
             this.login(e);
          }else{
          wx.showToast({
            title: '已登录',
            icon: 'success',
            duration: 2000
          });
          wx.navigateTo({
            url: '../success/success?a=sdihoshfi'//实际路径要写全
          })
          }
      },
      fail: function (res){
      },
}) 
 //  
 wx.clearStorage()
 //
 wx.setStorage({
      key: "user",
      data: e,
      success: function (res) {
        wx.redirectTo({
          url: '../../pages/success/success',
        })
      }
})
微信小程序开发BUG经验总结 摘要: 常见的微信小程序BUG! 小程序开发越来越热,开发中遇到各种各样的bug,在此总结了一些比较容易掉进去的坑分享给大家。 1. new Date跨平台兼容性问题 在Andriod使用new Date(“2018-05-30 00:00:00”)木有问题,但是在ios下面识别不出来。 因为IOS下面不能识别这种格式,需要用2018/05/30 00:00:00格式。可以使用正则表达式对做字符串... 阅读详情

相关推荐

WebStrom开发微信小程序

文章目录

Java721的博客 1万+

【微信小程序】swiper自定义样式:指示点样式 wx-swiper-dot

默认指示点位置贴近底部。,注意中间,没有空格。

coldriversnow的专栏 4887

微信小程序开发初探

【主要内容:】 1. 微信小程序web开发工具下载地址 2. 创建项目 3. 开发工具界面 4. 调试区六大工具介绍 5. 我与微信小程序的插曲 6. 微信小程序总结 一、微信小程序web开发工具下载地址 1.1 在微信公众平台-小程序里边去下载开发工具下载地址。 1.2 下载后安装一下就可以使用

张茫原 1万+

uni-app小程序 或 微信 小程序 swiper 分页器样式修改

在uni-app小程序中 修改swiper 分页器 及之指示点样式修改。

m0_65284931的博客 1853

PHP开发微信小程序的经验总结

写微信小程序的一些总结 新入职一家搞商铺中介的网络公司,入职第一天的任务是写一个微信小程序的PHP后台,虽然之前没有写过小程序的后台,但做下来感觉其实和写网站后台基本差不多。由于之前没有做过小程序后台,所以还是碰到了一些坑的,在这里做一个分享,给大家参考,错误之处欢迎留言指正。 如何获取微信手机号? 微信的手机号是加密存放手机端的,需要发送到后端,后端使用从腾讯API接口拿到的sessionKey解密。下面贴出解密逻辑(php版),只有主体过程,其他细节请自己实现。 verify....

昌南的博客 1191

基因的富集分析

通过RNA_seq差异表达分析等获得一组基因,想要进一步了解这些基因可能参与哪些生物学过程,具有哪些功能,一般就会用到基因的富集分析了。现在小麦基因注释信息已经可以获得,目前来看包括两套。一个是TGACv1,另一个就是IWGSC1.0。需要用到一个叫“clusterProfiler”的R包。下面用到的数据集来自TGACv1。1、安装source("https://bioconductor.org/b

xxxxx 1万+

小程序:swiper自定义点的样式

小程序:swiper自定义点的样式

分享前端开发工程师的一些日常生活、前端知识点、职业发展、对一些问题的看法、感悟等等 999

Code Ocean 上传代码 手把手教程

对于一些学术期刊,录用前会让把代码上传到Code Ocean上,但上传过程可能会遇到一些问题,小编分享一下自己的上传经验。他们会进行验证,验证通过,将自动发布。点此运行即可,但是运行比较慢。

u014071947的博客 1万+

微信小程序swiper的轮播图面板指示点 小圆点的样式设置

【代码】微信小程序swiper的轮播图面板指示点 小圆点的样式设置。

克里斯蒂亚诺更新的博客 688

浙江大学Fast-Lab从0制作自主空中机器人公开课教程补充及部分注意事项(适用于ubuntu系统和ROS零基础)

浙江大学Fast-Lab从0制作自主空中机器人公开课纯萌新补充(适用于从没接触过ubuntu系统),记录了一些自己不会的地方以及踩过的坑

qq_39986834的博客 2984

Simulink Test Sequence实战:5步搞定复杂逻辑测试(附Excel模板)

本文详细介绍了如何利用Simulink Test Sequence模块高效完成复杂逻辑测试。通过对比传统Excel方法的不足,阐述了Test Sequence以流程图和自然语言描述测试场景的优势,并提供了从环境搭建、逻辑构建到与Test Manager集成、利用Excel模板进行数据驱动的完整5步实战指南,帮助工程师将复杂的状态机或逻辑流测试从繁琐的‘体力活’转变为高效的‘技术活’。

snow3的博客 251

微信小程序 swiper组件 修改指示器圆点的样式位置等

前言 微信小程序的swiper组件,官方文档没有给具体的配置接口,有时我们需要一些个性化的样式,看到某位大佬曾在 开放工具中看到了小圆点的class类名,现在似乎是看不到了,不过类名还可以使用 附上原文地址 http://www.qianduan8.com/1009.html 解决方案 一种是隐藏官方的指示点即把 indicator-dots=“{{false}}”传入swiper组件,自己写小圆点指示器的样式,然后通过 bindchange 监听swiper变化,动态更新小圆点样式 一种..

天空之上有座城 5368

C#跨平台制图新纪元:Mapsui,一库在手,地图我有

深入学习Mapsui的渲染机制,定制属于你的地图样式,无论是颜色、图标还是文字,都可以随心所欲。

java专栏 1457

微信小程序开发经验总结(六)

微信小程序开发经验总结 15.能用上的js知识 string object date 数组列表...

LinWeiJ的博客 2434

【AI智能体】AI 编程 + 飞书CLI + Skills 重塑开发新范式实战操作详解

AI 编程 + 飞书CLI + Skills 重塑开发新范式实战操作详解

congge 3666

五、实战pxe安装ubuntu 22.04 软raid1(实际生产pxe配置)

这段配置文件是一个cloud-init的自动安装配置,用于自动化部署Ubuntu服务器操作系统。它定义了从系统身份、键盘布局、区域设置到磁盘分区和RAID配置的一系列设置,并且包含了在安装过程的最后阶段执行的一些命令。基础设置version: 1指定了autoinstall配置文件的版本。source定义了安装源,这里是ubuntu-server。identity设置了主机名(hostname)、用户(username)和密码(password注意这里的密码是经过加密的。键盘与语言设置。

jundao1997的专栏 999

微信小程序开发实战 ⑤(API及多人协调开发)

能够知道小程序如何进行协同开发和发布:成员管理、发布小程序、查看运营数据本文到这里就结束了,大佬们的支持是我持续更新的最大动力,希望这篇文章能帮到大家💪相关专栏连接🔗下篇文章再见ヾ( ̄▽ ̄)ByeByeHomePage社区链接🔗微信小程序专栏🔗。

m0_61490399的博客 3781

html2canvas - 解决截图后引入的字体样式丢失问题,第三方字体截图导出图片后字体失效,html2canvas截屏生成图片后艺术字体就丢失并且自动转成常规字体了,特殊字体显示不了无法截图怎么办

vue2,vue3,uniapp,html2canvas截图后引入的字体样式丢失,html2canvas艺术字截图不显示,使用外部字体无效,html2canvas无法识别网络字体文件怎么办,ttf文件,网页使用在线字体链接利用html2canvas无法截取,字体样式没有了,font-family第三方字体,@font-face引入本地字体文件后无法被html2canvas识别怎么办,html2canvas文字消失,vue页面正常显示艺术字体但截屏后没有,html2canvas截图存在特殊字体时截图不全,默认

✅ 精选推荐文章 1万+

微信小程序开发大赛经验总结

微信小程序开发大赛经验,问题,坑,注意事项等

qq_51297987的博客 1066

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

微信小程序开发经验总结(七)

微信小程序开发经验总结 16.自定义控件 17.toast提示框

LinWeiJ的博客 1389

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

微信小程序开发经验总结(四)

微信小程序开发经验总结 12.wxss flex布局 text font box

LinWeiJ的博客 1488

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

【微信小程序开发】开发框架与工具的使用详解

小程序开发框架是一套用于快速构建小程序的开发框架,提供了丰富的组件和API,使得开发者能够快速搭建小程序,并实现丰富的功能。微信小程序开发框架:官方提供的小程序开发框架,使用JavaScript语言进行开发,可运行在微信客户端上;支付宝小程序开发框架:支付宝提供的小程序开发框架,使用JavaScript语言进行开发,可运行在支付宝客户端上;百度智能小程序开发框架:百度提供的小程序开发框架,使用JavaScript语言进行开发,可运行在百度客户端上;字节跳动小程序开发框架。

陈橘又青的博客 2万+

微信小程序开发经验总结(二)

微信小程序开发经验总结 4.page.json 5.page跳转 6.page之间的传值(打开页面并传值,关闭页面并回传值)

LinWeiJ的博客 1676

微信小程序开发经验总结(三)

微信小程序开发经验总结 7.列表 相当于Android的listview 8.block 9.wx:if vs hidden 10.列表点击事件处理的两种方法 11.模块化 封装语句

LinWeiJ的博客 1535

微信小程序——小程序开发经验总结(持续更新)

1、部署前端后,刷新页面没有更换效果。2、本地调试成功,上线却无法获取后台数据。3、子组件无法使用Onload事件,但是可以用Onready进行替代。4、前端传值给下一个页面,不能携带太多信息。5、自定义导航栏。6、快速搜索方法。7、CSS开发笔记

Pan_peter的博客 6704

微信小程序开发语言(微信小程序开发教程)详细步骤

微信小程序开发语言 开发微信小程序用什么语言 1、微信小程序开发所需要的语言比较特别,首先介绍一下需要使用到的文件类型大致分为:WXML(WeiXin Mark Language 微信标记语言)、WXSS(WeiXin Style Sheet 微信样式表)、JS(JavaScript 小程序的主体); 2、首先是WXML,它与Android开发中的界面XML描述文件比较像,适合于程序界面的构建; 3、WXSS与前端中使用的CSS在语言上几乎没有差别可以直接通用; 4、JS文件这个与前段中使用的JS也是几乎没

juzilvpai的博客 2万+
上一篇: 微信小程序开发经验总结(四)
下一篇: 微信小程序开发经验总结(六)
LinWeiJ
博客等级 码龄10年 29粉丝 46原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值