个人案例
- 基础库2.22.1,wx.cloud.uploadFile报错wx is not defined?
基础库2.22.1,wx.cloud.uploadFile报错:wx is not defined; 换回2.21.3就不会报错; WAServiceMainContext.js:2 Unhandled promise rejection ReferenceError: wx is not defined [图片]
2022-03-01 - 小程序要求用户上传身份证照片,后台人工审核,可以上线吗?
小程序要求用户上传身份证照片,后台人工审核,可以上线吗?
2022-02-28 - svg开发工具正常真机不显示?
图标svg格式,开发工具正常真机不显示 [图片] [图片] <?xml version="1.0" encoding="UTF-8"?> <svg width="57" height="51" fill="none" xmlns="http://www.w3.org/2000/svg"> <g filter="url(#a)"> <path d="M46.1046.190186h-35.24c-7.70779 0-12.51781 8.352404-8.64923 15.019014L19.8044 45.52c3.8504 6.6353 13.4301 6.6427 17.2907.0132l17.651-30.3107C58.6283 8.55587 53.8192.190186 46.1046.190186Z" fill="#fff" fill-opacity=".4" /> </g> <defs> <filter id="a" x="-5.15039" y="-5.80981" width="67.27" height="62.3107" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <feFlood flood-opacity="0" result="BackgroundImageFix" /> <feGaussianBlur in="BackgroundImage" stdDeviation="3" /> <feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_321_2" /> <feBlend in="SourceGraphic" in2="effect1_backgroundBlur_321_2" result="shape" /> </filter> </defs> </svg> wxss .btn_shop { width: 70px !important; height: 61px; line-height: 61px !important; border-radius: unset !important; margin: 0 auto !important; position: absolute; left: 0; right: 0; top: -22px; } .btn_back { width: 70px; height: 61px; }
2022-02-28 - 从page-container跳转下一页面,再返回,page-container页返回按钮无效?
page-container组件、开发工具最新版、基础库2.22; 问题描述:从首页跳转详情页,在详情页打开page-container并跳转编辑页(编辑页在分包中),再从编辑页返回详情页后,详情页的返回按钮失效,无法返回首页。只有再次打开page-container并关闭,返回按钮才有效。 代码片段: https://developers.weixin.qq.com/s/eRkZy2mh7Dxc
2022-02-13 - rich-text 富文本组件自定义的nodes如何修改?
rich-text 富文本组件自定义的nodes如何修改? 自定义nodes模块 const imgGrid = function () { const obj = { name: 'p', attrs: { class: 'rich-grid-2' }, children: [ { name: 'div', attrs: { class: 'img-grid' }, children: [ { name: 'img', attrs: { class: 'img-case', src: '' } } ] }, { name: 'div', attrs: { class: 'img-grid' }, children: [ { name: 'img', attrs: { class: 'img-case', src: '' } } ] }, { name: 'div', attrs: { class: 'grid-icon' }, children: [ { type: 'text', text: 'Vs' } ] } ] }; return obj }; export { imgGrid } js onLoad: function (options) { let imgGrid2 = imgGrid(); imgGrid2.children[0].children[0].attrs.src = ''; imgGrid2.children[1].children[0].attrs.src = ''; const h2 = header_h2(); const text = content(); h2.children[0].text = '智商税征收机'; text.children[0].text = '智商税征收机'; const text2 = text; const h3 = h2 this.setData({ nodes: [...this.data.nodes, h2, imgGrid2, text, h3, text2] }); console.log("nodes => ", this.data.nodes); }, [图片] wxml <rich-text nodes="{{nodes}}"></rich-text>
2022-01-27 - echarts 饼图不显示?
echarts 饼图不显示,柱形图可以正常显示。 [图片] const app = getApp(); import * as echarts from '../../components/ec-canvas/echarts'; var pieChart; Page({ data: { ecPie: { disableTouch: true, lazyLoad: true }, }, onLoad() { this._initPieChart(); }, _initPieChart: function () { this.chart2Componnet = this.selectComponent('#pie-chart'); this.chart2Componnet.init((canvas, width, height, dpr) => { pieChart = echarts.init(canvas, null, { width: width, height: height, devicePixelRatio: dpr }); canvas.setChart(pieChart); pieChart.setOption(this._getPieOption()); console.log("pieChart(23) => ", pieChart); return pieChart; }); }, _getPieOption: function () { let option = option = { tooltip: { trigger: 'item' }, legend: { top: '5%', left: 'center' }, series: [ { name: 'Access From', type: 'pie', radius: ['40%', '70%'], avoidLabelOverlap: false, itemStyle: { borderRadius: 10, borderColor: '#fff', borderWidth: 2 }, label: { show: false, position: 'center' }, emphasis: { label: { show: true, fontSize: '40', fontWeight: 'bold' } }, labelLine: { show: false }, data: [ { value: 1048, name: 'Search Engine' }, { value: 735, name: 'Direct' }, { value: 580, name: 'Email' }, { value: 484, name: 'Union Ads' } ] } ] }; return option }, }) <view class="pie_chart"> <ec-canvas id="pie-chart" canvas-id="pie-chart" ec="{{ ecPie }}"></ec-canvas> </view>
2022-01-21 - 云开发 存储 getaddrinfo ENOTFOUND 出问题了吗?
[图片]
2022-01-18 - canvas父级标签通过wx:if控制后,canvas不显示了?
canvas父级标签通过wx:if或hidden控制后,canvas不显示了? [图片] import * as echarts from '../../components/ec-canvas/echarts'; var chart = null; Page({ data: { isModal: false, ec: { onInit: initChart }, }, showDetail: function (e) { const item = e.currentTarget.dataset.item; const index = e.currentTarget.dataset.index; item.grade = index + 1; this.setData({ rankDetail: item, isModal: true }); this._showChart() }, _showChart: function () { const option = { xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed'] }, yAxis: { type: 'value', }, grid: { y: 0, left: 0, containLabel: true, bottom: 0, top: 10, right: 0 }, series: [ { data: [120, 200, 150], type: 'bar', barWidth: '30%', barCategoryGap: '10%' } ] }; chart.setOption(option); }, }); function initChart(canvas, width, height, dpr) { chart = echarts.init(canvas, null, { width: width, height: height, devicePixelRatio: dpr // new }); canvas.setChart(chart); return chart; }; <l-popup show="{{isModal}}" content-align="top" z-index="{{zIndex}}" bind:lintap="closeModal"> <view class="popup"> <view class="flex-column popup_ranking"> <text class="popup_ranking_name">{{rankDetail.title}}</text> <text class="popup_ranking_title">傻B行为指数榜</text> <view class="flex-column popup_vote"> <text>{{rankDetail.grade}}</text> <text>综合榜</text> </view> </view> <view class="flex-space canvas_case"> <view class="canvas"> <ec-canvas id="mychart-dom-bar" canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas> </view> <view class="canvas_tital"> <text class="tital_A">没做过</text> <text class="tital_B">偶尔做</text> <text class="tital_C">经常做</text> </view> </view> <button class="btn_detail" hover-class="btn_like" catchtap="toDetail">查看详情</button> </view> </l-popup>
2022-01-12 - Css transform 覆盖上层元素?
[图片] <view class="flex-center tab_bar" catchtap="toClassify"> <view class="flex-center to_class"> <text>{{ranking.classify}}</text> <text class="iconfont iconfont-right"></text> </view> </view> .tab_bar { width: 460rpx; height: 140rpx; position: fixed; bottom: 0; left: 0; right: 0; margin: 0 auto; z-index: 1; } .tab_bar::after { content: ''; width: 460rpx; height: 140rpx; background: #FFFFFF; border-radius: 40rpx 40rpx 0 0; transform: perspective(40px) scale(0.9) rotateX(20deg); filter: drop-shadow(0px -10px 29px rgba(0, 0, 0, 0.07)); box-sizing: border-box; position: absolute; bottom: 0; left: 0; right: 0; margin: 0 auto; z-index: 0; } .to_class { justify-content: center; font-size: 34rpx; font-weight: bold; color: #FA5136; position: absolute; left: 0; right: 0; bottom: 40rpx; margin: 0 auto; z-index: 9; transform: translateZ(1); }
2022-01-08