- 微信小程序开发如何通过js唤起分享弹窗?
wx.showShareMenu这个API只是用来让右上角可以分享,但是如果我想点击页面内的按钮直接弹出分享的弹窗怎么弄啊(就等于是,点页面内的按钮和点右上角的...一样)?
01-12 - 微信小程序使用threejs渲染,整个canvas都是漆黑的怎么办?
用的是 npm i threejs-miniprogram ,然后直接把里面的 build/index.js 复制出来了。(或者大佬们有没有什么文章推荐一下?找了很久没找到不包含widnow的loader包) 代码如下: // 引入复制出来的index文件 import {createScopedThreejs} from '../../libs/index.js'; ... // 在 lifetimes 的 ready 里面执行 const qeury = wx.createSelectorQuery(); qeury.select('#c').node().exec(res => { let canvasId = String(res[0].node.id); // canvas = THREE.global.registerCanvas(canvasId, res[0].node) this.setData({ canvasId }) const THREE = createScopedThreejs(res[0].node); debugger scene = new THREE.Scene(); const lightness = new THREE.HemisphereLight(0xffffff, 0x444444); lightness.position.set(0, 100, 0); scene.add(lightness); const shadowLight = new THREE.DirectionalLight(0xffffff); shadowLight.position.set(0, 20, 10); scene.add(shadowLight); const geometry = new THREE.BoxGeometry(50, 50, 50); const material = new THREE.MeshBasicMaterial({ color: 0x0000ff }); const cube = new THREE.Mesh(geometry, material); scene.add(cube); const renderer = new THREE.WebGLRenderer(); wx.getSystemInfo({ success(res) { renderer.setPixelRatio(res.pixelRatio); } }) renderer.setSize(res[0].node.width, res[0].node.height); }) 不知道为什么整个canvas都是黑的, [图片]
2023-11-14