- 小程序使用web-view组件内嵌h5页面, ios上h5页面授权时会卡在授权页,如何解决?
小程序使用web-view组件内嵌h5页面, ios上h5页面授权时会卡在授权页,如下图: [图片] [图片]
10-25 - ios 清除公众号缓存
iOS上 修改了新的内容,打开公众号还是原来的(缓存),刷新页面后才是修改的内容。关闭页面重新打开还是原来的,怎么样实现修改功能之后重新打开页面就是最新的功能而不是原来的。
2019-02-25 - errMsg : "chooseImage:fail, the permissi
[图片]点击上传图片 偶尔会弹出errMsg : "chooseImage:fail, the permissi 手机机型iphone6 和 iphone xs max 进入页面立即点击(要快)就会出现报错 代码: store/modules/Wechat.js [代码]const actions = {[代码][代码] [代码][代码]/**[代码][代码] [代码][代码]* 初始化微信配置[代码][代码] [代码][代码]* @param {*} param0[代码][代码] [代码][代码]* @param {*} payload payload.perms微信权限[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]initConfig ({commit, state}, payload) {[代码][代码] [代码][代码]return[代码] [代码]new[代码] [代码]Promise((resolve, reject) => {[代码][代码] [代码][代码]let data = {[代码][代码] [代码][代码]url: state.url,[代码][代码] [代码][代码]perms: payload.perms[代码][代码] [代码][代码]}[代码][代码] [代码][代码]Http.post([代码][代码]'/v1/wechat/js'[代码][代码], data).then(response => {[代码][代码] [代码][代码]let wechatJs = response.data.meta.wechat_js[代码][代码] [代码][代码]// wechatJs.debug = true[代码][代码] [代码][代码]/* eslint-disable no-undef */[代码][代码] [代码][代码]wx.config(wechatJs)[代码][代码] [代码][代码]resolve()[代码][代码] [代码][代码]}).[代码][代码]catch[代码][代码](err => {[代码][代码] [代码][代码]reject(err)[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 从相册中选图片或者拍照[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]chooseImage ({dispatch, state}, payload) {[代码][代码] [代码][代码]return[代码] [代码]new[代码] [代码]Promise((resolve, reject) => {[代码][代码] [代码][代码]// 因为是用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中[代码][代码] [代码][代码]wx.chooseImage({[代码][代码] [代码][代码]count: payload, [代码][代码]// 默认9张照片[代码][代码] [代码][代码]sizeType: [[代码][代码]'original'[代码][代码], [代码][代码]'compressed'[代码][代码]], [代码][代码]// 可以指定是原图还是压缩图,默认二者都有[代码][代码] [代码][代码]sourceType: [[代码][代码]'album'[代码][代码], [代码][代码]'camera'[代码][代码]], [代码][代码]// 可以指定来源是相册还是相机,默认二者都有[代码][代码] [代码][代码]success: resolve,[代码][代码] [代码][代码]fail: reject[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 获取本地图片[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]getLocalImgData ({dispatch, state}, payload) {[代码][代码] [代码][代码]return[代码] [代码]new[代码] [代码]Promise((resolve, reject) => {[代码][代码] [代码][代码]// 因为是用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中[代码][代码] [代码][代码]wx.getLocalImgData({[代码][代码] [代码][代码]localId: payload, [代码][代码]// 图片的localID[代码][代码] [代码][代码]success: resolve,[代码][代码] [代码][代码]fail: reject[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码]}[代码]router/index.js [代码]// 微信分享部署[代码][代码]let wechatSetup = (to) => {[代码][代码] [代码][代码]// 设置微信校验Url[代码][代码] [代码][代码]store.commit([代码][代码]'Wechat/setUrl'[代码][代码], to.path)[代码][代码] [代码][代码]// 当页面中有上传图片就要调用Wechat/initConfig方法[代码][代码] [代码][代码]if[代码] [代码](to.name === [代码][代码]'TeacherTimeLinePublish'[代码] [代码]|| to.name === [代码][代码]'TeacherPublishBulletin'[代码] [代码]|| to.name === [代码][代码]'MasterPublishAnnounce'[代码] [代码]|| to.name === [代码][代码]'ParentMenage'[代码][代码]) {[代码][代码] [代码][代码]store.dispatch([代码][代码]'Wechat/initConfig'[代码][代码], {perms: [[代码][代码]'chooseImage'[代码][代码], [代码][代码]'getLocalImgData'[代码][代码]]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]if[代码] [代码](to.meta.specialShare !== undefined && to.meta.specialShare === [代码][代码]true[代码][代码]) {[代码][代码] [代码][代码]// 什么操作都不做[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]if[代码] [代码](to.meta.defaultShare === [代码][代码]false[代码] [代码]|| to.meta.defaultShare === undefined) {[代码][代码] [代码][代码]// 默认关闭分享[代码][代码] [代码][代码]store.dispatch([代码][代码]'Wechat/unShare'[代码][代码])[代码][代码] [代码][代码]}[代码][代码]}[代码] [代码]// 登录准备[代码][代码]let loginReady = (to, from, next) => {[代码][代码] [代码][代码]return[代码] [代码]new[代码] [代码]Promise((resolve, reject) => {[代码][代码] [代码][代码]let accessToken = Token.readAccessToken()[代码][代码] [代码][代码]let loginParams = {[代码][代码] [代码][代码]type: [代码][代码]'wechat'[代码][代码],[代码][代码] [代码][代码]state: to.query.state,[代码][代码] [代码][代码]code: to.query.code[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]if[代码] [代码](!accessToken) {[代码][代码] [代码][代码]if[代码] [代码](!loginParams.state || !loginParams.code) {[代码][代码] [代码][代码]// 没有state和code参数时说明没有进行第一次认证[代码][代码] [代码][代码]store.dispatch([代码][代码]'Auth/info'[代码][代码], {current_full_path: Utils.getUrlFullPath(to.path, to.query)}).then(data => {[代码][代码] [代码][代码]if[代码] [代码](data.mock === 1) {[代码][代码] [代码][代码]// 处理mock登录[代码][代码] [代码][代码]store.dispatch([代码][代码]'Auth/login'[代码][代码], loginParams).then(() => {[代码][代码] [代码][代码]resolve()[代码][代码] [代码][代码]next()[代码][代码] [代码][代码]}).[代码][代码]catch[代码][代码](err => {[代码][代码] [代码][代码]return[代码] [代码]Promise.reject(err)[代码][代码] [代码][代码]})[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]window.location.href = data.auth_url[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}).[代码][代码]catch[代码][代码](err => {[代码][代码] [代码][代码]Notice.error(err)[代码][代码] [代码][代码]})[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]store.dispatch([代码][代码]'Auth/login'[代码][代码], loginParams).then(() => {[代码][代码] [代码][代码]resolve()[代码][代码] [代码][代码]next()[代码][代码] [代码][代码]}).[代码][代码]catch[代码][代码](err => {[代码][代码] [代码][代码]Notice.error(err)[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]resolve()[代码][代码] [代码][代码]next()[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码]}[代码] [代码]router.beforeEach((to, from, next) => {[代码][代码] [代码][代码]if[代码] [代码](!to.query.hasOwnProperty([代码][代码]'pt'[代码][代码]) && Utils.pickAccountId().toLowerCase() !== [代码][代码]'public'[代码][代码]) {[代码][代码] [代码][代码]loginReady(to, from, next).then(() => {[代码][代码] [代码][代码]// 跳转之前验证登录[代码][代码] [代码][代码]identityRedirect(to, from, next)[代码][代码] [代码][代码]wechatSetup(to)[代码][代码] [代码][代码]})[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]next()[代码][代码] [代码][代码]if[代码] [代码](Utils.pickAccountId().toLowerCase() === [代码][代码]'public'[代码][代码]) {[代码][代码] [代码][代码]wechatSetup(to)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码]})[代码]页面 [代码]methods: {[代码][代码] [代码][代码]uploadImg () { [代码][代码]// 图片上传(微信的js-dk)[代码][代码] [代码][代码]var[代码] [代码]self = [代码][代码]this[代码][代码] [代码][代码]this[代码][代码].$store.dispatch([代码][代码]'Wechat/chooseImage'[代码][代码], 9).then(res => {[代码][代码] [代码][代码]var[代码] [代码]localIds = res.localIds [代码][代码]// 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片[代码][代码] [代码][代码]if[代码] [代码](localIds.length > 0) {[代码][代码] [代码][代码]for[代码] [代码](let i = 0; i < localIds.length; i++) {[代码][代码] [代码][代码]// 获取本地图片[代码][代码] [代码][代码]self.$store.dispatch([代码][代码]'Wechat/getLocalImgData'[代码][代码], localIds[i]).then(res => {[代码][代码] [代码][代码]var[代码] [代码]localData = res.localData [代码][代码]// localData是图片的base64数据,可以用img标签显示[代码][代码] [代码][代码]// self.imgSrc.push(localData)[代码][代码] [代码][代码]let obj = {[代码][代码] [代码][代码]// 读取成功的数据[代码][代码] [代码][代码]readData: localData,[代码][代码] [代码][代码]// 是否显示蒙层[代码][代码] [代码][代码]isShow: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]// 上传成功的状态 true代表成功,false代表还在上传,null代表错误[代码][代码] [代码][代码]isSuccess: [代码][代码]false[代码][代码] [代码][代码]}[代码][代码] [代码][代码]self.arr.push(obj)[代码][代码] [代码][代码]}).[代码][代码]catch[代码][代码](err => {[代码][代码] [代码][代码]this[代码][代码].$utils.showError([代码][代码]'getLocalImgData'[代码] [代码]+ JSON.stringify(err))[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}).[代码][代码]catch[代码][代码](err => {[代码][代码] [代码][代码]this[代码][代码].$utils.showError([代码][代码]'chooseImage'[代码] [代码]+ JSON.stringify(err))[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码]
2019-02-21 - 微信公众号的缓存是不是很严重
- 当前 Bug 的表现(可附上截图) - 预期表现 - 复现路径 - 提供一个最简复现 Demo 开启 debug后,重新关注公众号,打开页面 没有弹debug,刷新页面才弹debug。
2019-02-20 - 微信中公众号的问题我应该在那里问
微信中公众号的问题我应该在那里问 这里的标题只有小程序小游戏就是没有公众号的选项 公众号是不维护了么 [图片]
2019-01-10 - 微信公众号 分享的新接口不支持安卓
问题描述:在安卓手机上 微信分享的新接口 配置的参数不起作用(desc、imgUrl等参数) [图片]提问
2019-01-10 - 微信浏览器 不支持 html5 multiple多文件上传选择,只能选择一个文件
微信公众号开发时 实现多图上传的功能 但是实际上 安卓手机上只能义词上传一张图片(测试的机型:一加5、一加6、华为note10)代码如下: <div data-v-2dee107c="" class="uploaderImg van-uploader"> <img data-v-2dee107c="" src="http://s.xiyuekids.com/school-sass/wechat/static/teacher/icon-teacher-photo@2x.png" alt=""> <input type="file" ref="file" @change="readImg" accept="image/*" multiple="multiple" class="van-uploader__input"> </div> 别人也有过同样的问题http://bbs.mb.qq.com/thread-1191004-1-1.html
2018-08-30