微信小程序:跳坑指南——常见问题总结

前言

记录几个微信小程序,在真机上预览遇到的问题。

开始

  1. 上传图片失败
    描述:在开发工具上传正常,打开调试,上传正常
    解决:在小程序后台,要添加uploadFile合法域名
  2. 下拉刷新不回弹
    描述:下拉刷新时,页面没有回弹
    解决:在onPullDownRefresh(){ }中,主动调用wx.stopPullDownRefresh()
  3. 导航栏显示加载动画
    wx.showNavigationBarLoading()
    wx.hideNavigationBarLoading()
  4. 小程序的下拉刷新与scroll-view不能共存
    在首页使用了scroll-view绑定了scroll事件,页面配置中设置onPullDownRefresh: true时,发现下拉刷新无效
    将scroll-view改为view组价,onPullDownRefresh()方法能被正常调用。
  5. 设置小程序下拉刷新时,三个小圆点的样式
    backgroundTextStyle: dark
  6. 常用的接口

    登录:https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html

    获取用户信息:https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserInfo.html

    获取手机号码:https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html

    form组件:https://developers.weixin.qq.com/miniprogram/dev/component/form.html

    发送模板消息:https://developers.weixin.qq.com/miniprogram/dev/api/open-api/template-message/sendTemplateMessage.html

    wx:for:https://developers.weixin.qq.com/ebook?action=get_post_info&volumn=1&lang=zh_CN&book=miniprogram&docid=000ee2c29d4f805b0086a37a254c0a

    wx.pageScrollTo: https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/wx.pageScrollTo.html

    wx.getUserInfo: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserInfo.html

    UnionID: https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html

    wx.getUserInfo:https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserInfo.html

    wx.getSetting:https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/wx.getSetting.html

    关注公众号组件:https://developers.weixin.qq.com/miniprogram/dev/component/official-account.html

    场景值:https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/scene.html

    生成小程序码/二维码:https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/qr-code.html

    微信客服:http://kf.qq.com/faq/120911VrYVrA150210BBJvei.html
  7. wx:for遍历对象
    let obj = {
    	// 对象的每一个属性都是一个数组
    	type1: [1, 2, 3],
    	type2: [4, 5, 6]
    }
    <!-- 遍历对象 -->
    <!-- index就是对象的key(type1, type2); item就是对象的key对应的值([1, 2, 3],[4, 5, 6]) -->
    <view wx:for="{{obj}}" wx:key="{{index}}">{{index}}</view>

     

  8. 自定义wx:for的key和index的名称
    <!-- wx:for-index="xxx" wx:for-item="yyy" -->
    <view wx:for="{{obj}}" wx:key="{{type}}" wx:for-index="type" wx:for-item="typeArr">{{type}}{{typeArr}}</view>
  9. 自定义小程序swiper的指示点样式(自己测试未成功):http://www.qianduan8.com/1009.html
    https://developers.weixin.qq.com/community/develop/doc/f55b3d2332994316f6adf0c7fdc61c27?highLine=swiper%2520%25E8%2587%25AA%25E5%25AE%259A%25E4%25B9%2589
  10. 转发以及页面生命周期等相关资料:https://developers.weixin.qq.com/ebook?action=get_post_info&volumn=1&lang=zh_CN&book=miniprogram&docid=0004eec99acc808b00861a5bd5280a

总结 

嘘寒问暖 不如打笔巨款~

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值