个人案例
- 授权登录接口:不再返回用户性别及地区信息?
又改了吗? [图片]
2021-09-27 - 开发工具编辑器的代码所在行和调试器console.log()不一样?
Mac 开发工具编辑器的代码所在行和调试器console.log()不一样 [图片]
2021-09-24 - 云开发“字段名.$[].字段名”更新数组对象?
logo:为数组对象 我想实现下标0的default值改为true时,下标1的default值改为false。 [图片] const status = await db.collection('Group') .where({ _id: event.groupId }).update({ data: { 'logo.$[].default': _.set(_.expr( $.cond({ if: $.eq(['$default', true]), then: false, else: true }) )) } }); 我的方法报错:The dollar ($) prefixed field '$expr' in 'logo.0.default.$expr' is not valid for storage.
2021-09-23 - wx.getGroupEnterInfo接口报错?
开发工具,群工具场景进入 wx.getGroupEnterInfo接口报错 getGroupEnterInfo:fail errCode: 40097
2021-09-20 - aip提示滚动条?
开发工具的api提示滚动条,现在鼠标滑动到底部就自动推出了,基本底下内容还没看到。 [图片]
2021-09-12 - Canvas 绘制饼图,绘制出来的不是圆形?
Canvas 绘制饼图,绘制出来的不是圆形,大小也不一样 [图片] number: [ { type: 'male', color: '#ff6262', data: '15', }, { type: 'female', color: '#f7c11b', data: '20', }, { type: 'other', color: '#ff8015', data: '15', }, ] const query = this.createSelectorQuery(); query.select('#canvas') .fields({ node: true, size: true }) .exec((res) => { const canvas = res[0].node; const ctx = canvas.getContext('2d'); console.log("ctx---", ctx); // 设置圆点 x y 中心点 let point = { x: canvas._width/2, y: canvas._height/2, r: 30 }; ctx.moveTo(point.x, point.y); // 获取数据 各类项的个数 let temp = this.data.number; // 设置总数 let sign = 50; for (let i = 0; i < temp.length; i++) { let start = 0; // 开始绘制 ctx.beginPath() if (i > 0) { for (let j = 0; j < i; j++) { start += temp[j].data / sign * 2 * Math.PI } }; let end = start + temp[i].data / sign * 2 * Math.PI; ctx.fillStyle = temp[i].color; ctx.moveTo(point.x, point.y); ctx.arc(point.x, point.y, point.r, start, end, false); ctx.lineTo(point.x, point.y); ctx.fill(); // ctx.closePath(); }; // let img = ctx.createImage(); // img.onload = (res) => { // console.log('onload成功') // ctx.drawImage(img, 52, 52, 104, 104); // } }); <view class="chart"> <canvas id="canvas" type="2d" style="width: 104px; height: 104px; display: inline-block;"></canvas> </view> .chart { width: 208rpx; height: 208rpx; background-color: #EEC18C; filter: drop-shadow(2px 9px 6px rgba(32,26,49,0.29)); -webkit-filter: drop-shadow(2px 9px 6px rgba(32,26,49,0.29)); border-radius: 100%; position: absolute; top: 0; bottom: 0; left: 128rpx; margin: auto 0; }
2021-09-08 - 如何优化多条件判断?
我的业务逻辑需要进行大量的条件判断,根据不同情况展示不同弹窗内容。因为异步,经常先显示某一内容,等异步结束再显示正确内容。 请问以下代码该如何优化 onLoad: function (options) { const scene = app.globalData.scene; const enterScene = [1000, 1001, 1005, 1006, 1023, 1026, 1037, 1038, 1089]; // 注册成功后提示分享,此时未分享过 const isLogin = (options.pathType === 'Login') ? true : false; // 注册成功后首次分享 const isSignIn = (options.pathType === 'SignIn') ? true : false; // 单人聊天会话中的小程序消息卡片 const isShareChat = (isSignIn && scene === 1007) ? true : false; // 新注册成功后分享,并且从群聊会话中的小程序消息卡片打开 const isShareFlock = (isSignIn && scene === 1044 || scene === 1008) ? true : false; const isShare = (options.pathType === 'Share') ? true : false; const otherEnter = enterScene.includes(scene); const isGroupTools = (scene === 1158) ? true : false; const isAuthorize = app.globalData.isUserAuthorize; this.setData({ isLogin: isLogin, isSignIn: isSignIn, isAuthorize: isAuthorize, groupId: options.groupId, pathType: (options.pathType) ? options.pathType : '', scene: scene, isShareChat: isShareChat, isShareFlock: isShareFlock, isShare: isShare, otherEnter: otherEnter, isGroupTools: isGroupTools }); this._fetchGroupInfo(); this._fetchLottery(); this._fetchClockInRecord(); this._fetchLuckers(); this._fetchFlashSale(); this._fetchLinkShop(); this._fetchWantTo(); this._fetchAdviser(); this._fetchFlockBroadcast(); this._fetchURLLink(); this._fetchMyOrder(); }, _fetchopenGIds: function (openGIds) { wx.cloud.callFunction({ name: 'groupMgt', data: { $url: 'InquireOpenGIds', openGId: openGIds } }).then(res => { let total = res.result.data; let isExist = (total > 0) ? true : false; let isEqual = (this.data.openGId === openGIds) ? true : false; this.setData({ isExist: isExist, isEqual: isEqual, }); /** 走到这部时说明是新注册的,如果通过_fetchShareInfo获取到到openGid(isExist)存在,则说明分享的是老群。 */ !isExist && this.data.isAdmin && this.updataOpenGIds(openGIds); !isExist && !this.data.isFollow && this.updataMyGroup(openGIds); isExist && isEqual && !this.data.isFollow && this.updataMyGroup(openGIds); console.log("isExist------", isExist) console.log("isEqual------", isEqual) }).catch(err => { console.log(err) }) }, wxml,以下是不同情显示的弹窗。。。
2021-08-28 - 开发工具提醒:asmCrypto seems to be load from an ?
asmCrypto seems to be load from an insecure origin; this may cause to MitM-attack vulnerability. Consider using secure transport protocol. [图片]
2021-07-29 - antv-f2 图表开发工具正常显示数据,小程序不显示数据?
antv-f2 图表开发工具正常显示数据,小程序不显示数据? data: { onInitChart(F2, config) { drawChart(F2, config) } }; function drawChart(F2, config) { const chart = new F2.Chart(config); const data = [{ name: '销售金额', date: '07/14', value: 18.9 }, { name: '销售金额', date: '07/15', value: 28.8 }, { name: '销售金额', date: '07/16', value: 39.3 }, { name: '销售金额', date: '07/17', value: 81.4 }, { name: '销售金额', date: '07/18', value: 47 }, { name: '销售金额', date: '07/19', value: 20.3 }, { name: '销售金额', date: '07/20', value: 24 }, { name: '销售金额', date: '07/21', value: 35.6 }, { name: '销售数量', date: '07/14', value: 12 }, { name: '销售数量', date: '07/15', value: 23 }, { name: '销售数量', date: '07/16', value: 34 }, { name: '销售数量', date: '07/17', value: 99 }, { name: '销售数量', date: '07/18', value: 52 }, { name: '销售数量', date: '07/19', value: 35 }, { name: '销售数量', date: '07/20', value: 37 }, { name: '销售数量', date: '07/21', value: 42 }]; chart.source(data, { date: { // range: [0, 1], type: 'timeCat', mask: 'MM/DD' }, value: { min: 0, // tickCount: 4 } }); chart.interval() .position([ 'date', 'value' ]) .color('name') .adjust({ type: 'dodge', marginRatio: 0.09 // 设置分组间柱子的间距 }); chart.render(); // 注意:需要把chart return 出来 return chart; } 开发工具可以正常显示,手机预览就不显示 [图片]
2021-07-22 - 企业付款 AMOUNT_LIMIT 最小付款限额调整到最低5元了吗?
企业付款 AMOUNT_LIMIT 最小付款限额调整到最低5元了吗? [图片]
2021-07-14