前言
记录几个微信小程序,在真机上预览遇到的问题。
开始
- 上传图片失败
描述:在开发工具上传正常,打开调试,上传正常
解决:在小程序后台,要添加uploadFile合法域名 - 下拉刷新不回弹
描述:下拉刷新时,页面没有回弹
解决:在onPullDownRefresh(){ }中,主动调用wx.stopPullDownRefresh() - 导航栏显示加载动画
wx.showNavigationBarLoading()
wx.hideNavigationBarLoading() - 小程序的下拉刷新与scroll-view不能共存
在首页使用了scroll-view绑定了scroll事件,页面配置中设置onPullDownRefresh: true时,发现下拉刷新无效
将scroll-view改为view组价,onPullDownRefresh()方法能被正常调用。 - 设置小程序下拉刷新时,三个小圆点的样式
backgroundTextStyle: dark - 常用的接口
登录: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 - 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>
- 自定义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>
- 自定义小程序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 - 转发以及页面生命周期等相关资料:https://developers.weixin.qq.com/ebook?action=get_post_info&volumn=1&lang=zh_CN&book=miniprogram&docid=0004eec99acc808b00861a5bd5280a
总结
嘘寒问暖 不如打笔巨款~