- 微信小程序如何高频渲染,更改元素宽度?
目前存在一个问题?微信小程序制作点击放大图片功能? 已经想到两种解决方案1.用原生自动api解决,但是无法定义菜单 2.自定义双指放大功能,但是高频更改图片宽度会特别卡顿
2021-03-18 - scroll-view enhanced属性无效?
scroll-view enhanced属性无效
2020-09-16 - 微信小程序post提交数据后台接受不到?
[图片]
2020-07-06 - 微信小程序插槽不会插到制定位置?
[图片] [图片] [图片] [图片]
2020-07-01 - 我是管理员,上传代码后。后台没有内容?
我是管理员,上传代码后。后台没有内容?
2020-06-16 - setData赋值不渲染?
onShow: function() { //var _this=this; console.log(wx.getStorageSync('CARD')) var wb=this.data.WebSocket; wb.card=wx.getStorageSync('CARD'); this.setData({ WebSocket:wb }) console.log(this.data.WebSocket)
2020-04-14 - 微信公众号返回scanQrcode permissinodenied?
微信公众号返回扫一扫 scanQrcode permissinodenied <template> <div class="hello"> <van-button type="primary" @click="saoyisao()">默认按钮</van-button> </div> </template> <script> import wx from 'weixin-js-sdk'; export default { name: 'HelloWorld', data () { return { msg: 'Welcome to Your Vue.js App' } }, mounted:function(){ this.getInfo(); }, methods: { getInfo:function(){ this.$axios.post('/api/wechat/getJssign') .then(function (result) { console.log(result.data); wx.config({ debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId: "XXXXXXX", // 必填,公众号的唯一标识 timestamp: result.data.timestamp, // 必填,生成签名的时间戳 nonceStr: result.data.nonceStr, // 必填,生成签名的随机串 signature: result.data.signature, // 必填,签名,见附录1 jsApiList: ['checkJsApi', 'chooseImage', 'uploadImage', 'scanQRCode'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }); }) .catch(function (error) { console.log(error); }); }, saoyisao:function(){ wx.scanQRCode({ needResult: 1, success: function (res) { //res.resultStr二维码中的数据 alert("ok") }, fail: function (res) { alert("扫码失败"); return false; } }) } } } </script> <!-- Add "scoped" attribute to limit CSS to this component only --> <style scoped> </style>
2019-12-26 - 微信公众号如果引入vue?vue cli如何引用微信sdk?
微信公众号如果引入vue?vue cli如何引用微信sdk?
2019-12-26 - 小程序webSocket怎么用?
我的小程序能接收到心跳,但是接受不到推送消息 [代码]linkSocket(){[代码][代码] [代码] [代码] [代码][代码]var[代码] [代码]that=[代码][代码]this[代码][代码];[代码][代码] [代码] [代码] [代码][代码]let obj = {[代码][代码] [代码][代码]userId: wx.getStorageSync([代码][代码]'customId'[代码][代码]),[代码][代码] [代码][代码]roleId: [代码][代码]'-1'[代码][代码],[代码][代码] [代码][代码]clientTypeId: [代码][代码]'18'[代码][代码],[代码][代码] [代码][代码]groupId: [代码][代码]'1'[代码][代码] [代码][代码]};[代码][代码] [代码][代码]wx.connectSocket({[代码][代码] [代码][代码]url: [代码][代码]'wss://xxx.com:8989/ws/getPushMsg?userId='[代码] [代码]+ obj.userId + [代码][代码]'&roleId='[代码] [代码]+ obj.roleId + [代码][代码]'&clientTypeId='[代码] [代码]+ obj.clientTypeId + [代码][代码]'&groupId='[代码] [代码]+ obj.groupId + [代码][代码]'&token=SCAPPc11bd2e581e44125aea4f0e20980f75a5984'[代码][代码],[代码][代码] [代码][代码]success() {[代码][代码] [代码][代码]console.log([代码][代码]'连接成功'[代码][代码])[代码][代码] [代码][代码]that.initEventHandle()[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]/**[代码][代码] [代码][代码]* 连接成功准备回话[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]initEventHandle(){[代码][代码] [代码][代码]var[代码] [代码]_this = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]const targetMap = {[代码][代码] [代码][代码]userId: wx.getStorageSync([代码][代码]'customId'[代码][代码]), [代码][代码]//添加用户id[代码][代码] [代码][代码]groupId: [代码][代码]"1"[代码][代码], [代码][代码]//添加机构id[代码][代码] [代码][代码]roleId: [代码][代码]"-1"[代码][代码], [代码][代码]//添加角色id 机构2[代码][代码] [代码][代码]clientTypeId: [代码][代码]"18"[代码][代码], [代码][代码]//大数据平台[代码][代码] [代码][代码]};[代码][代码] [代码][代码]let that = [代码][代码]this[代码][代码] [代码][代码]let socketOpen=[代码][代码]false[代码][代码];[代码][代码] [代码][代码]let socketMsgQueue = [][代码] [代码] [代码][代码]wx.onSocketOpen([代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]"open"[代码][代码])[代码][代码] [代码][代码]socketOpen = [代码][代码]true[代码][代码] [代码][代码]for[代码] [代码](let i = 0; i < socketMsgQueue.length; i++) {[代码][代码] [代码][代码]sendSocketMessage(socketMsgQueue[i])[代码][代码] [代码][代码]}[代码][代码] [代码][代码]socketMsgQueue = [][代码][代码] [代码][代码]timer = setInterval([代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]sayMarco()[代码][代码] [代码][代码]}, 10000);[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.onSocketError([代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'WebSocket连接打开失败'[代码][代码])[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.onSocketClose([代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'WebSocket 已关闭!'[代码][代码])[代码][代码] [代码][代码]})[代码] [代码] [代码][代码]function[代码] [代码]sendSocketMessage(msg) {[代码][代码] [代码][代码]console.log([代码][代码]"ok"[代码][代码])[代码][代码] [代码][代码]if[代码] [代码](socketOpen) {[代码][代码] [代码][代码]wx.sendSocketMessage({[代码][代码] [代码][代码]data: msg[代码][代码] [代码][代码]})[代码][代码] [代码][代码]wx.onSocketMessage([代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]let str = res.data;[代码][代码] [代码][代码]var[代码] [代码]dbObj = JSON.parse(str);[代码][代码] [代码][代码]//isOil[代码][代码] [代码][代码]if[代码] [代码](dbObj.autoDelete) {[代码][代码] [代码][代码]var[代码] [代码]obj = JSON.parse(dbObj.context);[代码][代码] [代码][代码]obj.isOil = _this.data.isOil;[代码][代码] [代码][代码]wx.navigateTo({[代码][代码] [代码][代码]url: [代码][代码]'../payForCode/payForCode?jsondata='[代码] [代码]+ JSON.stringify(obj)[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]socketMsgQueue.push(msg)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]function[代码] [代码]sayMarco() {[代码][代码] [代码][代码]console.log([代码][代码]"心跳"[代码][代码])[代码][代码] [代码] [代码] [代码][代码]let _targetMap = targetMap;[代码][代码] [代码][代码]let requestParamMap = {};[代码][代码] [代码][代码]requestParamMap[[代码][代码]"target"[代码][代码]] = _targetMap;[代码][代码] [代码][代码]requestParamMap[[代码][代码]"contextType"[代码][代码]] = 1; [代码][代码]//内容类型-文本 标识当前消息内容的类型[代码][代码] [代码][代码]requestParamMap[[代码][代码]"context"[代码][代码]] = [代码][代码]"545sfd45g64s9df"[代码][代码];[代码][代码] [代码][代码]requestParamMap[[代码][代码]"businessTypeCode"[代码][代码]] = 0;[代码][代码] [代码][代码]requestParamMap[[代码][代码]"sendUser"[代码][代码]] = _targetMap;[代码][代码] [代码][代码]requestParamMap[[代码][代码]"clientType"[代码][代码]] = 18;[代码][代码] [代码][代码]//当前参数仅终端存在[代码][代码] [代码][代码]requestParamMap[[代码][代码]"msgType"[代码][代码]] = 0; [代码][代码]//请求类型/消息类型标识当前信息的作用[代码][代码] [代码][代码]sendSocketMessage(JSON.stringify(requestParamMap))[代码][代码] [代码][代码]}[代码]
2019-12-11 - iPhonex 微信小程序不滚动,超出屏幕?
一个列表超出屏幕不滚动,安卓好事,待触底刷新,但是根部滚动不了肯定是超出了
2019-12-09